FAXLIB: FAXLIB User's Manual (c55x)

  • Main Page
  • Files
  • Related Pages

FAXLIB User's Manual (c55x)

Release 2.1.0.1

Getting Started

Introduction | FAXLIB features and advantages
Package Contents | What the installation provides and where
Integration | How to integrate FAXLIB into your code
Examples | Example projects provided with FAXLIB
Component Reference | Detailed documentation for all FAXLIB components

Additional Documents

Release Notes | New features, device support, known issues, etc.
Software Manifest | Link to manifests for all packages in delivery

Helpful Links

Code Gen Tools | Download site for TI DSP code generation tools
Code Composer Studio | Download site for Code Composer Studio IDE
BIOS E2E Forum | Forum for FAXLIB questions or remarks
TI Telecom Libraries | Home for latest VoLIB and FAXLIB releases

Copyright 2013, Texas Instruments Incorporated


FAXLIB: File Index

FAXLIB File List

Here is a list of all files with brief descriptions:
doxygen.h [code]


FAXLIB: doxygen.h File Reference

doxygen.h File Reference

Go to the source code of this file.


FAXLIB: Page Index

FAXLIB Related Pages

Here is a list of all related documentation pages:
  • Introduction
  • Package Contents
  • Examples
  • Integration
  • Individual Component Documentation
  • Target Processor Library/Directory Reference


FAXLIB: Introduction

Introduction

Back

The FAX Library () provides components that allow a development team to reduce time-to-market by providing the major building blocks of a fax-relay processing system. G3 Fax relay processing is comprised of two modules: Fax Modem (FM), and Facsimile Interface Unit (FIU). FM implements the modulation/demodulation functions for V.21, V.27ter, V.29, V.17 and V.33, and HDLC framing/de-framing. FIU implements T.30 protocol processing, packet network facsimile processing, and compensations for network impairments: delay, jitter, and packet loss. It receives messages including demodulated data from FM and performs protocol conversion to a digital facsimile protocol (i.e. T.38) for transmission over the packet network. Likewise, in the receive direction, data packets are converted to T.30 protocol and passed to FM for HDLC framing if necessary and modulation for transmission over the analog connection.

Features and Benefits

The TI c55x FAXLIB includes the components listed below that, at a minimum, perform:

  • Fax Signal Modulation Demodulation
  • T.38 Message Processing
  • High-level Data Link Control (HDLC)

Figure 1 below provides a sample usage case for the components in FAXLIB. Specifics regarding component use, integration, performance, etc. are provided below in Individual Component Documentation.

Figure 1. G3 Fax Relay Software Architecture

System Requirements

While FAXLIB fulfills most all the algorithmically challenging needs of a Fax processing system, it is not a solution in itself. FAXLIB provides components/modules that allow a development team to produce a high quality fax solution with minimal effort and resources. It does not however, provide the system-level processing that passes fax samples through each component as required for a specific solution. This would unnecessarily constrain the developer to a pre-defined system architecture. Rather, any RX or TX processing chains are defined by the developer by providing the "glue" to suitably order component processing.

FAXLIB does not provide system routines to gather fax samples from any TDM or packet interface. These are the responsibility of the developer.

FAXLIB Components

As FAXLIB is a collection of individual components, clarification should be provided regarding what comprises a component and which components comprise FAXLIB.

Listed below are the components in the FAXLIB delivery for c55x.

  • Fax Interface Unit (FIU)
  • Fax Modem (FM)
  • High-level Data Link Control (HDLC)

Each component is delivered as a compressed package in the packages directory. The packages follow a common naming convention based on the package contents:

        ti_mas_<COMP>_<FMT>_<TARG>_<VER>.zip

Where:

  • <COMP> represents the component name
  • <FMT> represents the delivery format
    • obj for object code delivery
    • src for source code delivery
  • <TARG> represents the target processor
  • <VER> represents the component version

When extracted, each component in FAXLIB expands to a similar directory structure. The path will be:

          <WORK>/ti/mas/<COMP>/

Where:

  • <COMP> represents the component name
  • <WORK> represents the working directory in which the package was extracted.

Each component root directory will consist, at the very least, of the following directories and files:

  1. A docs sub\-directory for all documentation
  2. A c<TARG> sub-directory for the component library(s)
  3. Release notes in HTML format
  4. A makefile for building the code using GNU make (requires source delivery)
  5. One or more API header files for the component modules

Component Modules

As stated above, is a collection of individual components that each perform different fax processing task. In this context, a component in general is a collection of modules that do specific task. In many cases a component contains a single module that performs a specific task. For example, the Fax Interface Unit (FIU) component contains a single FIU module to accomplish its purpose.

Each module that comprise a particular component has its own header file in the root directory of the component. This header file defines the modules API and all #defines, structures and enumerations required to interact with the API.

For example, the root directory for the Fax Modem (FM) is:

          /ti/mas/fm/

Since the FM has a single FM module, the API for the FM is defined by the header file:

          /ti/mas/fm/fm.h


FAXLIB: Package Contents

Package Contents

Back

Unless otherwise specified, the package installs to the C:\Program Files\Texas Instruments directory. The package directory will follow the naming convention faxlib_<target>_<version> where <target> will be either C55,C64 C64P or C66 and the version string will be a four number string with underscore delimiters (e.g., 1_0_0_0).

The directory structure of the installed package will look similar to that displayed below in Figure 2, though the release notes will be named to match the version and DSP core (target) of the particular installation.

Figure 2. c55x FAXLIB Directory Structure

The FAXLIB installation can be categorized as following file categories:

  1. Documentation
  2. Repository
  3. Component Directories
  4. Eclipse Plug-in
  5. Examples
  6. Packaging

Documentation

Installation places all FAXLIB documentation in a docs directory in the FAXLIB root. The following documentation comes with the delivery:

  • FAXLIB_Users_Manual.chm (this document, CHM format)
  • FAXLIB_Users_Manual.html (this document, HTML format)
  • Release Notes
  • Software Manifest
  • Package License

Component Repository

The installation creates a components directory in the FAXLIB root folder. This directory serves as a repository for all packages included in the FAXLIB installation. Each package in this repository is compressed.

Component Directories

The installation creates a directory named packages in the FAXLIB root folder that contains all component and dependent packages. This directory is generated during installation by expanding all compressed packages in the components directory. The individual component packages expand to the packages\ti\mas directory (relative to FAXLIB root). The contents of each component directory are described in Individual Component Documentation below.

Eclipse Support

The eclipse directory contains all files required for FAXLIB to be recognized by Eclipse versions of Code Composer Studio (CCS) as a plug-in.

Packaging

The FAXLIB installation creates a package directory. This directory contains meta information required by the TI packaging tools.


FAXLIB: Examples

Examples

Back

Examples

The examples folder holds CCS example projects that illustrate how the components in FAXLIB can be used to integrate in the system to provide fax solutions. This directory currently has one example. Please check the Readme.txt inside the example folder for more information.

Unit Test Examples

Each component is delivered with a test code project to facilitate test execution in CCS. Though the code examples exhibit subtle variations in structure, each generally offers the ability to:

  1. Step through and understand the component lifecycle
  2. Tailor specific component configurations
  3. Vary input and observe changes in execution

Each component provides specific instructions to get its associated test code example up and running in CCS. The links below are provided for quick access to this documentation for each of the components that comprise FAXLIB.

  • FIU Simulation Users Manual
  • FM Simulation Users Manual
  • HDLC Simulation Users Manual


FAXLIB: Integration

Integration

Back

Integration, for components, is accomplished in four stages:

  1. Compile the components (optional)
  2. System Integration
  3. Compile the system code
  4. Link with libraries

Compile Components

On installation, the FAXLIB libraries are built and ready to link. As such, this step is only required when the original source code for any component has been refined or contributions have been added.

System Integration

Fax Relay Implementation Guide

Compile System

The path to the component module header files must be provided to the compiler for those components whose API has been referenced in the system source code. The suggested process for this is provided below:

  1. Extract all component packages to a common working directory
  2. Provide this working directory to the compiler via the -I compiler directive
  3. Reference all header files using their full path (i.e., #include <ti/mas/fiu/fiu.h>)

Link Component Libraries

The link process requires that the libraries of the respective components be identifiable by the linker. The path to the component libraries must be provided to the linker for those components whose API has been referenced in the system source code via the -l linker directive.


FAXLIB: Fax Relay Implementation Guide

Integration

Fax Relay Implementation Guide

The following subsections describe the process of integrating the FM and FIU modules into a system for implementing G3 fax relay:
1. Global context initialization
2. G3 fax relay switch-in
3. G3 fax relay processing
4. Call statistics
5. Real-Time Debug Tracing
6. G3 Fax Relay Switch-Out

For details on the APIs and data structures of a particular module, please see the corresponding API document. Also, the example code is provided for the reference.


FAXLIB: Global context initialization

Integration » Fax Relay Implementation Guide

Global context initialization

FM and FIU modules have their global context structures that contain non-channel-specific configuration information which is used by all active instances. The global context structures must be declared globally by system code and initialized prior to any calls to the APIs. The following are sample configurations for the global context structures:
        fmContext_t fmContext = {
            sysDebugInfo,
            sysGetSystemTime,
            NULL
        };
        fiuContext_t fiuContext = {
            sysAllocBuffer,
            sysFreeBuffer,
            22,
            sysGetSystemTime,
            sysDebugInfo,
            sysCriticalSectionBegin,
            sysCriticalSectionEnd
        };

The system integrator needs to implement the following APIs:

  • sysAllocBuffer() – a callout routine for allocating a data buffer from a global memory pool for use by the FIU.
  • sysFreeBuffer() – a callout routine for releasing a data buffer no longer in use by FIU.
  • sysGetSystemTime() – a callout routine for obtaining the current 32-bit system time in ms.
  • sysDebugInfo() – a callout routine for sending out the debug traces.
  • sysCriticalSectionBegin() – a callout routine that suspends the preemption of FIU processing (i.e. interrupts disabling).
  • sysCriticalSectionEnd() – a callout routine that re-enables the preemption of FIU processing (interrupts re-enabling).

Note that the supported external buffer size should be at least 22 words if an external global memory buffer pool is supported. If the global memory buffer pool is not supported, the function pointers for allocating and freeing the buffers should
be set to NULL and the buffer size should be set to 0.

The fmContext_t and fiuContext_t structures are defined in fm.h and fiu.h respectively.


FAXLIB: G3 fax relay switch-in

Integration » Fax Relay Implementation Guide

G3 fax relay switch-in

Request for Memory Requirements

The memory requirements for an instance of FM and FIU are obtained by calling the fmGetSizes() and fiuGetSizes() APIs respectively. The routines will return the number of required buffers and a memBuffer_t structure specifying the memory requirements of each buffer (i.e. size, alignment, memory type) for the modules. The memBuffer_t structure is defined in memmgm.h. The return value of the routines will indicate if there is any error.

Memory Allocation and Instance Creation

After obtaining the memory requirements, the system needs to allocate memory for the modules as specified in the memBuffer_t structure. Once the memory has been allocated statically or dynamically based on the requirements, the base address of each buffer in the memBuffer_t structure has to be initialized and the memory should not be used for any other purposes for the duration of the fax relay processing. An instance of FM and FIU is created by calling the fmNew() and fiuNew() APIs respectively with the proper memory buffer information and configuration. The return value of the routines will indicate if there is any error.

Instance Initializations

Before initiating fax relay processing, the instance of FM and FIU needs to be initialized by calling the fmOpen() and fiuOpen() APIs respectively with the proper configurations.

The following is a sample fmOpenConfig_t configuration:

        fmOpenConfig.debugLvl = fm_DBG_LVL_0;
        fmOpenConfig.tx_level = -10;
        fmOpenConfig.rx_cd_thr_set = 0;
        fmOpenConfig.fBufferData = FALSE;
        fmOpenConfig.maxBytesToBuffer = 0;
        fmOpenConfig.FMfeatureBitMap = 0;
        fmOpenConfig.ToneDetCtrl.ToneDetCtrl = sysToneDetCtrl;
        fmOpenConfig.ToneDetCtrl.TargetInst = sysInstPtr;
        fmOpenConfig.SendOutSpec.fmSendOut = fiuSendIn;
        fmOpenConfig.SendOutSpec.TargetInst = fiuInstPtr;
        fmOpenConfig.RxOutSpec.fmReceiveOut = sysRxPCMInterface;
        fmOpenConfig.RxOutSpec.TargetInst = sysInstPtr;
        fmOpenConfig.tablePtr = (fmTablePtrs_t  *)fmTablePtrs;

The system integrator needs to implement the following APIs:

  • sysToneDetCtrl() – a callout routine for enabling and disabling tone detection. Note that the tone detection utility is external to FM/FIU.
    The tones that need to be supported for detection are CNG (1100Hz) and CED (2100Hz).
  • sysRxPCMInterface() – a callout routine for passing samples of modulated signals towards the PCM interface.

fmOpenConfig.tablePtr is used to pass location of the tables to FM. fmTablesPtr should be initialized to point to the tables as shown as below:

        void * fmTablePtrs[] = {
            (void *) fm_TABLE1_START,
            (void *) fm_TABLE2_START,
            (void *) fm_TABLE3_START,
            (void *) fm_TABLE4_START,
            (void *) fm_TABLE5_START
        };

The following is a sample fiuOpenConfig_t configuration for T.38 UDP:

        fiuOpenConfig.frameSize = 10;
        fiuOpenConfig.MaxFaxRate = iffax_RATE_14400;
        fiuOpenConfig.dbgMode = fiu_DBG_OFF;
        fiuOpenConfig.RtpPayloadType = 0;
        fiuOpenConfig.RtpSyncSource = 0;
        fiuOpenConfig.HSPktPayloadSize = 20;
        fiuOpenConfig.LSPktPayloadSize = 1;
        fiuOpenConfig.LsDataRedundancy = 5;
        fiuOpenConfig.HsDataRedundancy = 1;
        fiuOpenConfig.TCFHandlingMethod = 2;
        fiuOpenConfig.T38Version = 0;
        fiuOpenConfig.faxNomDelay = 200;
        fiuOpenConfig.faxPacketSize = 0;
        fiuOpenConfig.NoActivityTimerVal = 20000;
        fiuOpenConfig.AAL2cid = 0;
        fiuOpenConfig.SendOutSpec.fiuSendOut = sysTxNetInterface;
        fiuOpenConfig.SendOutSpec.targetInst = sysInstPtr;
        fiuOpenConfig.ReceiveOutSpec.fiuReceiveOut = fmReceiveIn;
        fiuOpenConfig.ReceiveOutSpec.targetInst = fmInstPtr;
        fiuOpenConfig.EventHandlerSpec.fiuEventHandler = sysFaxEventHandler;
        fiuOpenConfig.EventHandlerSpec.targetInst = sysInstPtr;
        fiuOpenConfig.StartupTimer = 50000;
        fiuOpenConfig.faxNetCallTblPtr = faxNetCallTblPtr;
        fiuOpenConfig.NetProtocol = fiu_PT_T38_UDP;
        fiuOpenConfig.LocalTxNetTimeOutVal = 150000;
        fiuOpenConfig.EflagStartTimer = 2600;
        fiuOpenConfig.EflagStopTimer = 2300;
        fiuOpenConfig.T30FeatureSelector = fiu_T30FEATURE_ECM_DISABLE;
        fiuOpenConfig.FIUFeatureSelector = fiu_FEATURE_SLF_ENABLE |
                                           fiu_FEATURE_MDM_TRN_FAIL_COMP;
        fiuOpenConfig.NSFCountryCode = 0;
        fiuOpenConfig.NSFVendorCodeMSB = 0;
        fiuOpenConfig.NSFVendorCodeLSB = 0;

The system integrator needs to implement the following APIs:

  • sysTxNetInterface() – a callout routine for sending out the packets towards the network interface.
  • sysFaxEventHandler() – a callout routine for notifying the system about an event that requires actions. During G3 fax relay processing, there are two possible events: fiu_EVENT_CLEARDOWN and fiu_EVENT_G3_TO_V34 (if V.34 fax relay is supported). If the eventCode is fiu_EVENT_CLEARDOWN, the system is expected to switch out of the fax relay processing. If the eventCode is fiu_EVENT_G3_TO_V34, the system is expected to switch over to V.34 fax relay processing.

fiuOpenConfig.faxNetCallTblPtr is used to specify the pointer to the fax network module call tables. For example, if both T.38 and AAL2 protocols are supported, faxNetCallTblPtr should be initialized as shown below:

   fiuNetCallTbl_t *faxNetCallTblPtr[] = {
            &faxNetProtocolT38,
            &faxNetProtocolAal2,
            NULL
        };

Note that the table pointer must be a NULL-terminated list.

Initiation of G3 Fax Relay Processing

After opening the FM and FIU instances, only FM is active. FM is ready to process the PCM samples received via fmSendIn() and digital data received via fmReceiveIn(). However, FIU remains inactive. Any calls to fiuSendIn(), fiuReceiveIn() and fiuTask() will be returned without any processing. To initiate G3 fax relay processing, the system needs to call the fiuControl() API with fiu_ACTIVATE as the control code.


FAXLIB: G3 fax relay processing

Integration » Fax Relay Implementation Guide

G3 fax relay processing

Figure 3. G3 Fax Relay Data Processing Model

Since FM operates with 10ms frames, the fiuTask() API should be called followed by fmSendIn() on a 10ms task. On the PCM interface, the PCM linear samples received from the telephony are passed to FM for demodulation via fmSendIn(). The fmReceiveOut() callout routine is invoked for transmission of the modulated PCM samples towards the telephony interface whenever fmSendIn() is called. On the network interface, when packets are received from the network, they should be passed to FIU for processing via fiuReceiveIn(). The fiuSendOut() callout routine is invoked whenever there are packets to be transmitted towards the network interface.


FAXLIB: Call statistics

Integration » Fax Relay Implementation Guide

Call statistics

The call statistics regarding FM and FIU can be obtained by calling the fmStats() and fiuGetStats() APIs respectively.


FAXLIB: Real-Time Debug Tracing

Integration » Fax Relay Implementation Guide

Real-Time Debug Tracing

The debug traces from FM and FIU are sent out via the sysDebugInfo() callout routine. Depending on the debug level that is configured when opening the instances, different levels of debug information can be obtained. For debug level 0, only fatal errors are reported. For debug level 1, high-level protocol information and detected network anomalies in addition to fatal errors are reported. Debug level 2 is used for internal debugging purposes.


FAXLIB: G3 Fax Relay Switch-Out

Integration » Fax Relay Implementation Guide

G3 Fax Relay Switch-Out

To terminate fax relay processing and free up the memory, the FM and FIU instances are deleted by calling fmClose() and fiuClose() followed by fmDelete() and fiuDelete() respectively.


FAXLIB: Individual Component Documentation

Individual Component Documentation

Back

Documentation: FIU Component Users Manual
FIU Simulation Users Manual

Documentation: FM Component Users Manual
FM Simulation Users Manual

Documentation: HDLC Component Users Manual
HDLC Simulation Users Manual


FAXLIB: Target Processor Library/Directory Reference

Target Processor Library/Directory Reference

Processor Library/Directory Reference
Processor | Endian | Extension
C55x DSP | N/A | 55L
C64x DSP | Little | 64
C64x DSP | Big | 64e
C64x+ DSP | Little | 64P
C64x+ DSP | Big | 64Pe
C66x DSP | Little | 66
C66x DSP | Big | 66e


FAXLIB: doxygen.h Source File

doxygen.h

Go to the documentation of this file.
00001 /*
00002  * This is the header file which doxygen parses to generate the main
00003  * documentation page
00004  *
00005  */
00006
00465  *
00821  *
00822  */
00823
00824
00825
00826
00827


FAXLIB_C55 2.1.0.1 Release Notes

May 6, 2013

FAXLIB Bundle Release Notes

Contents

  1. Introduction
  2. Getting Started
  3. Documentation
  4. What's New
  5. Upgrade and Compatibility Information
  6. Device Support
  7. Validation Information
  8. Known Issues
  9. Technical Support
  10. Component Release Notes

Introduction

The FAXLIB bundle is a collection of fax relay components that adhere to a common API format.

Getting Started

The FAXLIB User's Manual provides the documentation and links necessary to commence with FAXLIB development and integration.

Documentation

The following documentation is available:

User's Manual [HTML]
[CHM]
Software Manifest [HTML]
Release Notes Archive [LINK]

What's New

The following features were added:

  1. Added C55x CPU Rev 3 Support.

Upgrade and Compatibility Information

This version of ti.mas.faxlib is compatible with the last released version:

YES | X
NO |

Note:
  1. Package compatibility keys are independent of component release versions. For more information visit: Package Versioning and Compatibility

Device Support

This release supports the following device families:

  • C55x DSP (COFF, Large Memory Model)

Validation Information

This release was built and validated using the following tools:

  • C55x Code Generation Tools version: 4.4.1
  • Code Composer Studio version: V5
  • GNU make version: 3.81
  • RTSC Packaging Standard version: 2.0
  • XDC Tools version: 3

Known Issues

  1. None
See individual component release notes for more information (links below).

Technical Support

Questions regarding this library, or any of the components comtained within, should be directed to the Texas Instruments BIOS Forum. Please include the text "FAXLIB" in the title of the post.

Component Release Notes

  1. FIU Release Notes
  2. FM Release Notes
  3. HDLC Release Notes

Package Versioning and Compatibility

Compatibility Keys

Compatibility keys serve two primary purposes:

  1. Enable tooling to identify incompatibilities between components
  2. Convey a level of compatibility between different releases to set end user expectations.

Each compatibility key is composed of 4 comma-delimited numbers - represented here by the letters M, S, R and P [M,S,R,P]. The table below provides a descriptive reference for compatibility key intention.

Compatibility Key Reference
Key | Meaning | Description
1 (M=Major) | Break in compatibility | The package consumer is required to re-write the calling source code to use the package
2 (S=Source) | Source compatibility | The package consumer’s source code doesn't require change, but does require a recompile
3 (R=Radix) | Introduction of new features | Compatibility with previous interfaces is not broken. If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source
4 (P=Patch) | Bug fixes only | If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source.

Versioning

Each package version is composed of 4 period-delimited numbers - represented here by the letters M, m, p and b [M.m.p.b]. The table below provides a descriptive reference regarding package version numbering.

Package Version Reference
Digit | Meaning | Description
1 (M=Major) | Major revision | Incremented when the new version is substantially different from the previous For example, a new module added or an existing module's algorithm significantly altered.
2 (m=minor) | Minor revision | Incremented when the new version has changed but not in a major way. For example, some minor changes in the API or feature set.
3 (p=patch) | Patch number | Incremented for all other source code changes. This include any packaging support code.
4 (b=build) | Build number | Incremented for each release delivery to CM. Reset for any change to M, m or p


FIU 3.1.0.3 Release Notes

April 29, 2013

Introduction
Documentation
What's New
Upgrade and Compatibility Information
Host Support
Device Support
Validation Information
Known Issues
Version Information
Technical Support

Introduction

The Facsimile Interface Unit (FIU) is a software module that process messages (including data) from the Facsimile Modem Unit (FM) for transmission over a packet network and vice versa.

back to top

Documentation

The following documentation is available:

  • FIU API Reference's Guide
  • FIU Source Reference's Guide (Source Release Only)

Release notes from previous releases are also available in the relnotes_archive directory.

back to top

What's New

The following new features were added:

  • SDOCM00078112 IR Fix
  • Added C64x+ ELF support.
  • Added C66x ELF and COFF support.
  • Changed the target folder for library from target specific folder to lib folder.

back to top

Upgrade and Compatibility Information

This ti.mas.fiu version is in-compatible with the last released ti.mas.fiu version. Please change the path to link the libraries to lib folder.

Please note that the package compatibility keys are independent of XDC product release numbers.

Package compatibility keys are intended to:

  1. Enable tooling to identify incompatibilities between components, and
  2. Convey a level of compatibility between different releases to set end user expectations.

Package compatibility keys are composed of 4 comma-delimited numbers - M, S, R, P - where:

  • M = Major - A difference in M indicates a break in compatibility. The package consumer is required to re-write its source code in order to use the package.
  • S = Source - A difference in S indicates source compatibility. The package consumer’s source code doesn't require change, but does require a recompile.
  • R = Radix - A difference in R indicates an introduction of new features, but compatibility with previous interfaces is not broken. If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source.
  • P = Patch - A difference in P indicates that only bugs have been fixed in the latest package and no new features have been introduced. If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source.

back to top

Host Support

The current XDC toolset can be used to build components on the following hosts:

  • Windows XP

back to top

Device Support

  • C54, C55
  • C64, C64P, C66

back to top

Validation Information

This release was built and validated using the following components:

Component Dependencies

  • ti.mas.types 5.5.4 (Common data type definitions)
  • ti.mas.swtools 5.0.1 (Internally used s/w tools)
  • ti.mas.util 4.7.5 (Common utilities)
  • ti.mas.fract 2.4.5 (Common Fractional utilities)
  • ti.mas.iface.ifpkt 3.1.2 (Packet Interface definitions)
  • ti.mas.iface.iffax 3.0.2 (Fax Interface definitions)
  • ti.mas.hdlc 3.1.0 (HDLC module)
  • ti.mas.asm 3.4.4 ( Assembly definitions required for C54x)

Tool Dependencies for Source Release

  • XDC Tools version 3.24.6.63
  • C6x Code Generation Tools version 7.4.2
  • C55 Code Generation Tools version 4.4.1
  • C54 Code Generation Tools version 4.10

back to top

Known Issues

None.

back to top

Versioning

This product's version follows a version format, M.m.p.b, where:

  • M is a single digit Major number
  • m is a single digit minor number
  • p is a single digit patch number
  • b is an unrestricted set of digits used as an incrementing build counter.

Please note that version numbers and compatibility keys are NOT the same. For an explanation of compatibility keys, please refer to the 'Upgrade and Compatibility Information' section.

back to top

Technical Support

Contact local TI Field Application Engineer for technical support.

back to top


FM 3.1.1.2 Release Notes

April 29, 2013

Introduction
Documentation
What's New
Upgrade and Compatibility Information
Host Support
Device Support
Validation Information
Known Issues
Version Information
Technical Support

Introduction

The Facsimile Modem Unit (FM) is a software module that performs all the modulation and demodulation functions required of a fax modem:
demodulation of PCM data received at the analog interface,
and modulation of facsimile protocol messages received from the Network interface.

back to top

Documentation

The following documentation is available:

  • FM API Reference's Guide
  • FM Source Reference's Guide (Source Release Only)

Release notes from previous releases are also available in the relnotes_archive directory.

back to top

What's New

The following new features were added:

  • External Tone Generation Support.(SDOCM00095533)

back to top

Upgrade and Compatibility Information

This ti.mas.fm version is compatible with the last released ti.mas.fm version.

Please note that the package compatibility keys are independent of XDC product release numbers.

Package compatibility keys are intended to:

  1. Enable tooling to identify incompatibilities between components, and
  2. Convey a level of compatibility between different releases to set end user expectations.

Package compatibility keys are composed of 4 comma-delimited numbers - M, S, R, P - where:

  • M = Major - A difference in M indicates a break in compatibility. The package consumer is required to re-write its source code in order to use the package.
  • S = Source - A difference in S indicates source compatibility. The package consumer’s source code doesn't require change, but does require a recompile.
  • R = Radix - A difference in R indicates an introduction of new features, but compatibility with previous interfaces is not broken. If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source.
  • P = Patch - A difference in P indicates that only bugs have been fixed in the latest package and no new features have been introduced. If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source.

back to top

Host Support

The current XDC toolset can be used to build components on the following hosts:

  • Windows XP

back to top

Device Support

  • C54, C55
  • C64, C64P, C66

back to top

Validation Information

This release was built and validated using the following components:

Component Dependencies

  • ti.mas.types 5.5.4 (Common data type definitions)
  • ti.mas.swtools 5.0.1 (Internally used s/w tools)
  • ti.mas.util 4.7.5 (Common utilities)
  • ti.mas.fract 2.4.5 (Common Fractional utilities)
  • ti.mas.iface.iffax 3.0.2 (Fax Interface definitions)
  • ti.mas.iface.ifsys 3.1.2 (Fax Interface definitions)
  • ti.mas.hdlc 3.1.0 (HDLC module)
  • ti.mas.asm 3.4.4 ( Assembly definitions required for C54x)

Tool Dependencies for Source Release

  • XDC Tools version 3.24.6.63
  • C6x Code Generation Tools version 7.4.2
  • C55 Code Generation Tools version 4.4.1
  • C54 Code Generation Tools version 4.10

back to top

Known Issues

None.

back to top

Versioning

This product's version follows a version format, M.m.p.b, where:

  • M is a single digit Major number
  • m is a single digit minor number
  • p is a single digit patch number
  • b is an unrestricted set of digits used as an incrementing build counter.

Please note that version numbers and compatibility keys are NOT the same. For an explanation of compatibility keys, please refer to the 'Upgrade and Compatibility Information' section.

back to top

Technical Support

Contact local TI Field Application Engineer for technical support.

back to top


FAXLIB: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


HDLC 3.1.0.2 Release Notes

April 29, 2013

Introduction
Documentation
What's New
Upgrade and Compatibility Information
Host Support
Device Support
Validation Information
Known Issues
Version Information
Technical Support

Introduction

High-Level Data Link Control (HDLC) is a protocol designed for transmitting data between two points.

back to top

Documentation

The following documentation is available:

  • HDLC API Reference's Guide
  • HDLC Source Reference's Guide (Source Release Only)

Release notes from previous releases are also available in the relnotes_archive directory.

back to top

What's New

The following changes were done:

  • Added C64x+ ELF support.
  • Added C66x ELF and COFF support.
  • Changed the target folder for library from target specific folder to lib folder.

back to top

Upgrade and Compatibility Information

This ti.mas.hdlc version is in-compatible with the last released ti.mas.hdlc version. Please change the path to link the libraries to lib folder.

Please note that the package compatibility keys are independent of XDC product release numbers.

Package compatibility keys are intended to:

  1. Enable tooling to identify incompatibilities between components, and
  2. Convey a level of compatibility between different releases to set end user expectations.

Package compatibility keys are composed of 4 comma-delimited numbers - M, S, R, P - where:

  • M = Major - A difference in M indicates a break in compatibility. The package consumer is required to re-write its source code in order to use the package.
  • S = Source - A difference in S indicates source compatibility. The package consumer’s source code doesn't require change, but does require a recompile.
  • R = Radix - A difference in R indicates an introduction of new features, but compatibility with previous interfaces is not broken. If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source.
  • P = Patch - A difference in P indicates that only bugs have been fixed in the latest package and no new features have been introduced. If libraries are provided by the package, an application must re-link with the new libraries, but is not required to recompile its source.

back to top

Host Support

The current XDC toolset can be used to build components on the following hosts:

  • Windows XP

back to top

Device Support

  • C54, C55
  • C64, C64P, C66

back to top

Validation Information

This release was built and validated using the following components:

Component Dependencies

  • ti.mas.types 5.5.4 (Common data type definitions)
  • ti.mas.swtools 5.0.1 (Internally used s/w tools)
  • ti.mas.util 4.7.5 (Common utilities)

Tool Dependencies for Source Release

  • XDC Tools version 3.24.6.63
  • C6x Code Generation Tools version 7.4.2
  • C55 Code Generation Tools version 4.4.1
  • C54 Code Generation Tools version 4.10

back to top

Known Issues

None.

back to top

Versioning

This product's version follows a version format, M.m.p.b, where:

  • M is a single digit Major number
  • m is a single digit minor number
  • p is a single digit patch number
  • b is an unrestricted set of digits used as an incrementing build counter.

Please note that version numbers and compatibility keys are NOT the same. For an explanation of compatibility keys, please refer to the 'Upgrade and Compatibility Information' section.

back to top

Technical Support

Contact local TI Field Application Engineer for technical support.

back to top


FIU: Version.h File Reference

  • Modules
  • Data Structures
  • Files
  • Related Pages
  • File List
  • Globals

Version.h File Reference

Go to the source code of this file.

Defines

#define | ti_mas_fiu_Version__top__
#define | __extern extern
#define | ti_mas_fiu_Version___VERS 150
#define | ti_mas_fiu_Version_MAJOR (3)
#define | ti_mas_fiu_Version_MINOR (1)
#define | ti_mas_fiu_Version_XVERTICAL (0)
#define | ti_mas_fiu_Version_PATCH (0)
#define | ti_mas_fiu_Version_BUILD (3)
#define | ti_mas_fiu_Version_QUALITY (3)
#define | ti_mas_fiu_Version_BTYPE (0)
#define | ti_mas_fiu_Version_WIDTH (0)
#define | Version_MAJOR ti_mas_fiu_Version_MAJOR
#define | Version_MINOR ti_mas_fiu_Version_MINOR
#define | Version_XVERTICAL ti_mas_fiu_Version_XVERTICAL
#define | Version_PATCH ti_mas_fiu_Version_PATCH
#define | Version_BUILD ti_mas_fiu_Version_BUILD
#define | Version_QUALITY ti_mas_fiu_Version_QUALITY
#define | Version_BTYPE ti_mas_fiu_Version_BTYPE
#define | Version_WIDTH ti_mas_fiu_Version_WIDTH

Define Documentation

#define ti_mas_fiu_Version__top__

Definition at line 27 of file Version.h.

#define __extern extern

Definition at line 33 of file Version.h.

#define ti_mas_fiu_Version___VERS 150

Definition at line 36 of file Version.h.

#define ti_mas_fiu_Version_MAJOR (3)

Definition at line 50 of file Version.h.

#define ti_mas_fiu_Version_MINOR (1)

Definition at line 53 of file Version.h.

#define ti_mas_fiu_Version_XVERTICAL (0)

Definition at line 56 of file Version.h.

#define ti_mas_fiu_Version_PATCH (0)

Definition at line 59 of file Version.h.

#define ti_mas_fiu_Version_BUILD (3)

Definition at line 62 of file Version.h.

#define ti_mas_fiu_Version_QUALITY (3)

Definition at line 65 of file Version.h.

#define ti_mas_fiu_Version_BTYPE (0)

Definition at line 68 of file Version.h.

#define ti_mas_fiu_Version_WIDTH (0)

Definition at line 71 of file Version.h.

#define Version_MAJOR ti_mas_fiu_Version_MAJOR

Definition at line 90 of file Version.h.

#define Version_MINOR ti_mas_fiu_Version_MINOR

Definition at line 91 of file Version.h.

#define Version_XVERTICAL ti_mas_fiu_Version_XVERTICAL

Definition at line 92 of file Version.h.

#define Version_PATCH ti_mas_fiu_Version_PATCH

Definition at line 93 of file Version.h.

#define Version_BUILD ti_mas_fiu_Version_BUILD

Definition at line 94 of file Version.h.

#define Version_QUALITY ti_mas_fiu_Version_QUALITY

Definition at line 95 of file Version.h.

#define Version_BTYPE ti_mas_fiu_Version_BTYPE

Definition at line 96 of file Version.h.

#define Version_WIDTH ti_mas_fiu_Version_WIDTH

Definition at line 97 of file Version.h.


FIU: Version.h Source File

  • File List
  • Globals

Version.h

Go to the documentation of this file.
00001 /*
00002  *  Do not modify this file; it is automatically
00003  *  generated and any modifications will be overwritten.
00004  *
00005  * @(#) xdc-t35
00006  */
00007
00008 /*
00009  * ======== GENERATED SECTIONS ========
00010  *
00011  *     PROLOGUE
00012  *     INCLUDES
00013  *     EPILOGUE
00014  *     PREFIX ALIASES
00015  */
00016
00017
00018 /*
00019  * ======== PROLOGUE ========
00020  */
00021
00022 #ifndef ti_mas_fiu_Version__include
00023 #define ti_mas_fiu_Version__include
00024
00025 #ifndef __nested__
00026 #define __nested__
00027 #define ti_mas_fiu_Version__top__
00028 #endif
00029
00030 #ifdef __cplusplus
00031 #define __extern extern "C"
00032 #else
00033 #define __extern extern
00034 #endif
00035
00036 #define ti_mas_fiu_Version___VERS 150
00037
00038
00039 /*
00040  * ======== INCLUDES ========
00041  */
00042
00043
00044
00045 /*
00046  * ======== AUXILIARY DEFINITIONS ========
00047  */
00048
00049 /* MAJOR */
00050 #define ti_mas_fiu_Version_MAJOR (3)
00051
00052 /* MINOR */
00053 #define ti_mas_fiu_Version_MINOR (1)
00054
00055 /* XVERTICAL */
00056 #define ti_mas_fiu_Version_XVERTICAL (0)
00057
00058 /* PATCH */
00059 #define ti_mas_fiu_Version_PATCH (0)
00060
00061 /* BUILD */
00062 #define ti_mas_fiu_Version_BUILD (3)
00063
00064 /* QUALITY */
00065 #define ti_mas_fiu_Version_QUALITY (3)
00066
00067 /* BTYPE */
00068 #define ti_mas_fiu_Version_BTYPE (0)
00069
00070 /* WIDTH */
00071 #define ti_mas_fiu_Version_WIDTH (0)
00072
00073 /*
00074  * ======== EPILOGUE ========
00075  */
00076
00077 #ifdef ti_mas_fiu_Version__top__
00078 #undef __nested__
00079 #endif
00080
00081 #endif /* ti_mas_fiu_Version__include */
00082
00083 /*
00084  * ======== PREFIX ALIASES ========
00085  */
00086
00087 #if !defined(__nested__) && !defined(ti_mas_fiu_Version__nolocalnames)
00088
00089 /* module prefix */
00090 #define Version_MAJOR      ti_mas_fiu_Version_MAJOR
00091 #define Version_MINOR      ti_mas_fiu_Version_MINOR
00092 #define Version_XVERTICAL  ti_mas_fiu_Version_XVERTICAL
00093 #define Version_PATCH      ti_mas_fiu_Version_PATCH
00094 #define Version_BUILD      ti_mas_fiu_Version_BUILD
00095 #define Version_QUALITY    ti_mas_fiu_Version_QUALITY
00096 #define Version_BTYPE      ti_mas_fiu_Version_BTYPE
00097 #define Version_WIDTH      ti_mas_fiu_Version_WIDTH
00098 #endif


FIU: Data Structures

  • Data Structures
  • Data Fields

FIU Data Structures

Here are the data structures with brief descriptions:
fiuContext_t | The FIU software module has a global context structure that contains non channel specific configuration information which is used by all active FIU instances. FIU Context is a structure that must be declared globally by system code, and initialized prior to any calls to the FIU API
fiuControlConfig_t | Control Configuration structure
fiuEventHandlerSpec_t | Specification of fiuEventHandlerSpec Object This structure contains the address of function and associated data structure for reporting events to the system for processing
fiuNetCallTbl_t | FIU Protocol Call Table
fiuNewConfig_t | New Configuration structure
fiuNSFInfo_t | NSF Information data structure
fiuOpenConfig_t | Open Configuration structure
fiuReceiveOutSpec_t | Specification of fiuReceiveOutSpec Object
fiuRelocInstance_t | FIU Relocation structure
fiuSendOutSpec_t | Specification of fiuSendOutSpec Object This structure contains the address of function and associated data structure for sending FAX packets to the network
fiuSizeCfg_t | FIU Size Configuration structure
fiuStats_t | FIU Statistics Structure


FIU: C55x Data Sheet

C55x Data Sheet

Copyright 2013, Texas Instruments Incorporated


FIU: C64x+ Data Sheet

C64x+ Data Sheet

Copyright 2013, Texas Instruments Incorporated


FIU:

IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.

TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed.

TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards.

TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.

Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation.

Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.

Mailing Address:
Texas Instruments
Post Office Box 655303
Dallas, Texas 75265

Copyright © 2006 Texas Instruments Incorporated. All rights reserved.

Information in this document is subject to change without notice. Texas Instruments may have pending patent applications, trademarks, copyrights, or other intellectual property rights covering matter in this document. The furnishing of this document is given for usage with Texas Instruments products only and does not give you any license to the intellectual property that might be contained within this document. Texas Instruments makes no implied or expressed warranties in this document and is not responsible for the products based from this document.


FIU: doxygen.h File Reference

  • File List
  • Globals

doxygen.h File Reference

Go to the source code of this file.


FIU: doxygen.h Source File

  • File List
  • Globals

doxygen.h

Go to the documentation of this file.
00001 /*
00002  * This is a little header file which doxygen parses to generate the main
00003  * documentation page
00004  */
00005


FIU: File Index

  • File List
  • Globals

FIU File List

Here is a list of all files with brief descriptions:
doxygen.h [code]
fiu.h [code] Fax Interface Unit API and Data Definitions


FIU: fiu.h File Reference

  • File List
  • Globals

fiu.h File Reference

Detailed Description

Fax Interface Unit API and Data Definitions.

path /dsps_gtmas/ti/mas/fiu/fiu.h

============================================================================ Copyright (c) 2007 – 2013 Texas Instruments Incorporated

All rights reserved not granted herein.

Limited License.

Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.

Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution

Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:

* No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.

* any redistribution and use are licensed by TI for use only with TI Devices.

* Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.

If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:

* any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.

* any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.

Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.

DISCLAIMER.

THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file fiu.h.

#include <ti/mas/types/types.h>
#include <ti/mas/iface/ifpkt/xferpkt.h>
#include <ti/mas/iface/iffax/iffax.h>
#include <ti/mas/util/debug.h>
#include <ti/mas/util/ecomem.h>

Include dependency graph for fiu.h:

Go to the source code of this file.

Data Structures

struct | fiuContext_t
The FIU software module has a global context structure that contains non channel specific configuration information which is used by all active FIU instances. FIU Context is a structure that must be declared globally by system code, and initialized prior to any calls to the FIU API. More...
struct | fiuEventHandlerSpec_t
Specification of fiuEventHandlerSpec Object This structure contains the address of function and associated data structure for reporting events to the system for processing. More...
struct | fiuSendOutSpec_t
Specification of fiuSendOutSpec Object This structure contains the address of function and associated data structure for sending FAX packets to the network. More...
struct | fiuReceiveOutSpec_t
Specification of fiuReceiveOutSpec Object. More...
struct | fiuSizeCfg_t
FIU Size Configuration structure. More...
struct | fiuNewConfig_t
New Configuration structure. More...
struct | fiuNetCallTbl_t
FIU Protocol Call Table. More...
struct | fiuOpenConfig_t
Open Configuration structure. More...
struct | fiuControlConfig_t
Control Configuration structure. More...
struct | fiuNSFInfo_t
NSF Information data structure. More...
struct | fiuStats_t
FIU Statistics Structure. More...
struct | fiuRelocInstance_t
FIU Relocation structure. More...

Defines

#define | fiu_NOMEMORY (-1)
#define | fiu_NOERR 0
#define | fiu_ERROR 1
#define | fiu_DBG_OFF 0
#define | fiu_DBG_LVL_1 1
#define | fiu_DBG_LVL_2 2
#define | fiu_DBG_INFORMATIONAL 0
#define | fiu_DBG_FATAL_ERROR 2
#define | fiu_EVENT_CLEARDOWN 0
#define | fiu_EVENT_G3_TO_V34 1
#define | fiu_EVENT_V34_TO_G3 2
#define | fiu_SWITCHOVER_V8_CM_RCVD_LOCAL 0
#define | fiu_SWITCHOVER_V8_CM_RCVD_REMOTE 1
#define | fiu_SWITCHOVER_V8_CI_RCVD_LOCAL 2
#define | fiu_SWITCHOVER_V8_CI_RCVD_REMOTE 3
#define | fiu_SWITCHOVER_V8_ANSAM_RCVD_REMOTE 4
#define | fiu_SWITCHOVER_PREAMBLE_RCVD_REMOTE 5
#define | fiu_SWITCHOVER_V34_NOT_SUPPORTED 6
#define | fiu_T30FEATURE_ECM_DISABLE 0x0001
#define | fiu_T30FEATURE_MR_DISABLE 0x0002
#define | fiu_T30FEATURE_V34_DISABLE 0x0004
#define | fiu_FEATURE_SLF_ENABLE 0x0001
#define | fiu_FEATURE_DIS_EFLAG_DISABLE 0x0002
#define | fiu_FEATURE_TFOP_FC_REPEAT 0x0004
#define | fiu_FEATURE_NSF_OVERRIDE 0x0008
#define | fiu_FEATURE_RTP_TS_PROC_DISABLE 0x0010
#define | fiu_FEATURE_AAL2_CID_CHK_DISABLE 0x0020
#define | fiu_FEATURE_MDM_TRN_FAIL_COMP 0x0040
#define | fiu_FEATURE_V34_FAX 0x0080
#define | fiu_FEATURE_T38_VOCALTEC_INTEROP 0x0100
#define | fiu_CALL_SUCCESS_BITFIELD_CLEAR 0x0000
#define | fiu_CALL_SUCCESS_BITFIELD_EOP 0x8000
#define | fiu_CALL_SUCCESS_BITFIELD_MCF 0x4000
#define | fiu_CALL_SUCCESS_BITFIELD_EOM 0x2000
#define | fiu_CALL_SUCCESS_BITFIELD_DCN_LOCAL 0x1000
#define | fiu_CALL_SUCCESS_BITFIELD_DCN_REMOTE 0x0800
#define | fiu_CALL_SUCCESS_BITFIELD_DIS_AFTER_EOM 0x0400
#define | fiu_NSF_CC_UNKNOWN 0xFFFF
NSF field definitions:.
#define | fiu_NSF_MC_UNKNOWN 0xFFFF

Enumerations

enum | fiuControlCode_e { fiu_CTRL_ACTIVATE = 1, fiu_CTRL_CONFIG }
enum fiuNetProtocol_e {
fiu_PT_T2, fiu_PT_T3, fiu_PT_FRF11, fiu_PT_RTP,
fiu_PT_T38_UDPTL, fiu_PT_T38_UDPTL_RTP, fiu_PT_AAL2, fiu_PT_RTPB,
fiu_PT_T38_RTP
}
enum | fiuDirection_e { fiu_DIR_ORG, fiu_DIR_DEST, fiu_DIR_UNKNOWN = 0x00FF }
Direction definitions. More...

Functions

ECO (Telogy Embedded Communication Object) APIs
tint | fiuGetSizes (tint *nbufs, const ecomemBuffer_t **bufs, fiuSizeCfg_t *SizeCfg)
This function obtains memory requirements for an instance of FIU.
tint | fiuNew (void **fiuInst, tint nbufs, ecomemBuffer_t *bufs, fiuNewConfig_t *cfg)
This function creates an instance of FIU and initializes the memory buffer pointers in the instance.
Remarks:
Function fiuNew() must be called before fiuOpen()is called.

void | fiuDelete (void **fiuInst)
This function deletes the FIU instance identified by fiuInst.
Remarks:
FIU must be closed prior to being deleted.

void | fiuControl (void *fiuInst, fiuControlCode_e ctrlCode, fiuControlConfig_t *ctrlConfig)
This function controls the operations of an instance of FIU.
tint | fiuOpen (void *fiuInst, fiuOpenConfig_t *cfg)
This function initializes and configures an FIU instance.
void | fiuClose (void *fiuInst)
This function closes the FIU instance identified by fiuInst. It sets the state of FIU to CLOSED.
tint | fiuReceiveIn (void *fiuInst, xferpktInfo_t *pktInfo)
This function processes packets received from the network.
void | fiuSendIn (void *fiuInst, void *message)
This function passes a message from a fax modem module (FM) to FIU for processing.
void | fiuTask (void *fiuInst)
Routine which performs fax protocol processing and network encoder/decoder operations.
void | fiuReloc (void **newFiuInst, void *oldFiuInst, ecomemBuffer_t *newFiuBufs)
Relocates an instantiated FIU instance to another area of memory.
void | fiuGetStats (void *fiuInst, tbool freset, fiuStats_t *stats)
Routine which obtains FIU statistics (both network- and call-specific) The stats can be requested from either an active call, or the last call if the current call session has been terminated.
tbool | fiuValidatePkt (fiuNetProtocol_e netProtocolType, tword *pkt, tuint pktSize)
Validates T.38 UDP packet This routine checks if the packet is a valid fax relay packet. Currently, only T.38 UDPTL is supported.

Variables

fiuContext_t fiuContext
reference of FIU Context Structure


FIU: fiu.h Source File

  • File List
  • Globals

fiu.h

Go to the documentation of this file.
00001 #ifndef _FIU_H
00002 #define _FIU_H
00003
00004 /* ========================================================================== */
00079 /* @{ */
00080
00081 /* System level header files */
00082 #include <ti/mas/types/types.h>
00083 #include <ti/mas/iface/ifpkt/xferpkt.h>
00084 #include <ti/mas/iface/iffax/iffax.h>
00085 #include <ti/mas/util/debug.h>
00086
00087 /* Memory management definitions */
00088 #include <ti/mas/util/ecomem.h>
00089
00098 typedef struct {
00105    void *      (*allocBuffer) (tuint);
00106
00112    tbool       (*freeBuffer) (tuint, void *);
00113
00122    tuint       SupportedExternalBuffSize;
00123
00129    tulong (*faxSystemTime) (void);
00130
00135    dbgInfo_t faxDebugTrace;
00140    void (*faxCriticalSectionBegin) (void);
00145    void (*faxCriticalSectionEnd)   (void);
00146 } fiuContext_t;
00147
00152 extern fiuContext_t fiuContext;
00153
00154
00159 /* @{ */
00164 #define fiu_NOMEMORY    (-1)
00165
00169 #define fiu_NOERR        0
00170
00174 #define fiu_ERROR        1
00175 /* @} */ /* ingroup */
00176
00181 /* @{ */
00186 #define fiu_DBG_OFF   0
00187
00196 #define fiu_DBG_LVL_1 1
00197
00201 #define fiu_DBG_LVL_2 2
00202
00203 /* @} */ /* ingroup */
00204
00209 /* @{ */
00210 typedef enum {
00211   fiu_CTRL_ACTIVATE = 1,
00212   fiu_CTRL_CONFIG
00213 } fiuControlCode_e;
00214 /* @} */ /* ingroup */
00215
00216
00217
00222 /* @{ */
00227 #define fiu_DBG_INFORMATIONAL   0
00228
00232 #define fiu_DBG_FATAL_ERROR     2
00233 /* @} */ /* ingroup */
00234
00235
00240 /* @{ */
00246 #define fiu_EVENT_CLEARDOWN 0
00247
00252 #define fiu_EVENT_G3_TO_V34 1
00253
00258 #define fiu_EVENT_V34_TO_G3 2
00259
00260 /* @} */ /* ingroup */
00261
00262
00267 /* @{ */
00272 #define fiu_SWITCHOVER_V8_CM_RCVD_LOCAL     0
00273
00277 #define fiu_SWITCHOVER_V8_CM_RCVD_REMOTE    1
00278
00282 #define fiu_SWITCHOVER_V8_CI_RCVD_LOCAL     2
00283
00287 #define fiu_SWITCHOVER_V8_CI_RCVD_REMOTE    3
00288
00292 #define fiu_SWITCHOVER_V8_ANSAM_RCVD_REMOTE 4
00293
00297 #define fiu_SWITCHOVER_PREAMBLE_RCVD_REMOTE 5
00298
00302 #define fiu_SWITCHOVER_V34_NOT_SUPPORTED    6
00303 /* @} */ /* ingroup */
00304
00305
00312 /* @{ */
00313 typedef enum {
00314   fiu_PT_T2,
00315   fiu_PT_T3,
00316   fiu_PT_FRF11,
00317   fiu_PT_RTP,
00318   fiu_PT_T38_UDPTL,
00319   fiu_PT_T38_UDPTL_RTP,
00320   fiu_PT_AAL2,
00321   fiu_PT_RTPB,
00322   fiu_PT_T38_RTP
00323 } fiuNetProtocol_e;
00324 /* @} */ /* ingroup */
00325
00326
00335 /* @{ */
00340 #define fiu_T30FEATURE_ECM_DISABLE 0x0001
00341
00345 #define fiu_T30FEATURE_MR_DISABLE  0x0002
00346
00350 #define fiu_T30FEATURE_V34_DISABLE 0x0004
00351 /* @} */ /* ingroup */
00352
00353
00361 /* @{ */
00366 #define fiu_FEATURE_SLF_ENABLE           0x0001
00367
00372 #define fiu_FEATURE_DIS_EFLAG_DISABLE    0x0002
00373
00378 #define fiu_FEATURE_TFOP_FC_REPEAT       0x0004
00379
00384 #define fiu_FEATURE_NSF_OVERRIDE         0x0008
00385
00390 #define fiu_FEATURE_RTP_TS_PROC_DISABLE  0x0010
00391
00395 #define fiu_FEATURE_AAL2_CID_CHK_DISABLE 0x0020
00396
00402 #define fiu_FEATURE_MDM_TRN_FAIL_COMP    0x0040
00403
00409 #define fiu_FEATURE_V34_FAX              0x0080
00410
00415 #define fiu_FEATURE_T38_VOCALTEC_INTEROP 0x0100
00416 /* @} */ /* ingroup */
00417
00418
00424 typedef struct  {
00429    void (*fiuEventHandler) (void *targetInst, tuint eventCode, tuint eventInfo);
00430    void *targetInst;
00431 } fiuEventHandlerSpec_t;
00432
00438 typedef struct  {
00449    tint (*fiuSendOut)(void *targetInst, xferpktInfo_t *pktInfo);
00450    void *targetInst;
00451 } fiuSendOutSpec_t;
00452
00466 typedef struct {
00471   tint (*fiuReceiveOut) (void *targetInst, void *message);
00472   void *targetInst;
00473 } fiuReceiveOutSpec_t;
00474
00481 typedef struct {
00482   tint NumInternalFIUBufs;
00485   tint NumInternalFIUOverlayBufs;
00487 } fiuSizeCfg_t;
00488
00495 typedef struct {
00496   tuint        ID;
00497   fiuSizeCfg_t SizeConfig;
00498 } fiuNewConfig_t;
00499
00506 typedef struct {
00507   fiuNetProtocol_e           NetProtocol;
00508   tint  (*faxNetInit)        (void *fndInst, void *cfg);
00509   void  (*faxNetDecoder)     (void *fndInst, xferpktInfo_t *pktInfo);
00510   void  (*faxNetDecoderTask) (void *fndInst);
00511   void  (*faxNetEncoder)     (void *fndInst,void *msg);
00512   void  (*faxNetEncoderTask) (void *fndInst);
00513   void  (*faxNetClose)       (void *fndInst);
00514   void  (*faxNetReloc)       (void *newRelocInstStruct,
00515                               void *oldRelocInstStruct);
00516 } fiuNetCallTbl_t;
00517
00524 typedef struct {
00525   tuint                frameSize;
00526   iffaxRate_e          MaxFaxRate;
00527   tuint                dbgMode;
00528   tuint                RtpPayloadType;
00530   tulong               RtpSyncSource;
00532   tint                 HSPktPayloadSize;
00534   tint                 LSPktPayloadSize;
00536   tint                 LsDataRedundancy;
00538   tint                 HsDataRedundancy;
00540   tuint                TCFHandlingMethod;
00542   tint                 T38Version;
00548   tuint                faxNomDelay;
00549   tint                 faxPacketSize;
00550   tulong               NoActivityTimerVal;
00551   tuint                AAL2cid;
00552   fiuSendOutSpec_t     SendOutSpec;
00555   fiuReceiveOutSpec_t  ReceiveOutSpec;
00558   fiuEventHandlerSpec_t EventHandlerSpec;
00560   tulong               StartupTimer;
00564   tuint                CleardownTimer;
00568   fiuNetCallTbl_t      **faxNetCallTblPtr;
00569   fiuNetProtocol_e     NetProtocol;
00570   tulong               LocalTxNetTimeOutVal;
00572   tulong               EflagStartTimer;
00575   tulong               EflagStopTimer;
00578   tuint                T30FeatureSelector;
00581   tuint                FIUFeatureSelector;
00588   /* @{ */
00589   tword                NSFCountryCode;
00590   tword                NSFVendorCodeMSB;
00591   tword                NSFVendorCodeLSB;
00592   /* @} */
00593
00594 } fiuOpenConfig_t;
00595
00602 typedef struct {
00603   fiuReceiveOutSpec_t  ReceiveOutSpec;
00606   tuint                frameSize;
00607 } fiuControlConfig_t;
00608
00617 /* @{ */
00618 #define fiu_CALL_SUCCESS_BITFIELD_CLEAR         0x0000
00619 #define fiu_CALL_SUCCESS_BITFIELD_EOP           0x8000
00620 #define fiu_CALL_SUCCESS_BITFIELD_MCF           0x4000
00621 #define fiu_CALL_SUCCESS_BITFIELD_EOM           0x2000
00622 #define fiu_CALL_SUCCESS_BITFIELD_DCN_LOCAL     0x1000
00623 #define fiu_CALL_SUCCESS_BITFIELD_DCN_REMOTE    0x0800
00624 #define fiu_CALL_SUCCESS_BITFIELD_DIS_AFTER_EOM 0x0400
00625 /* @} */ /* ingroup */
00626
00630 typedef enum {
00631   fiu_DIR_ORG,
00632   fiu_DIR_DEST,
00633   fiu_DIR_UNKNOWN = 0x00FF
00634 } fiuDirection_e;
00635
00646 typedef struct {
00647   tuint NSFCountryCode;
00648   tuint NSFManufacturer;
00649 } fiuNSFInfo_t;
00650
00654 #define fiu_NSF_CC_UNKNOWN  0xFFFF
00655 #define fiu_NSF_MC_UNKNOWN  0xFFFF
00663  typedef struct {
00664   tuint    MaxJitterBufDepth;
00665   tuint    MaxNetRxQDepth;
00666   tuint    JitterBufOverFlow;
00667   tuint    NetRxQOverFlow;
00668   tuint    RxInvalidPackets;
00669   tulong   RxOutOfSeqPacket;
00670   tulong   TxPackets;
00671   tulong   TxPacketsDropped;
00673   tulong   RxPackets;
00674   tulong   RxLostPackets;
00676   tuint    HSmodulation;
00677   tuint    NumberOfPages;
00678   tbool    ECMused;
00679   tuint    sendInQMaxDepth;
00680   tuint    RxOutQMaxDepth;
00681   tuint    MaxHSbufferUsage;
00682   tuint    sendInQOverflows;
00683   tuint    RxOutQOverflows;
00684   fiuDirection_e  Direction;
00685   fiuNSFInfo_t    NSFInfo;
00686   tulong          Bytes_From_Net ;
00687   tulong          Bytes_To_Net;
00688   tuint           Call_Success_Bitfield;
00689  } fiuStats_t;
00690
00698 typedef struct {
00699   void    *fiuInst;
00700   void    *frpInst;
00701   void    *fndInst;
00702 } fiuRelocInstance_t;
00703
00708
00720 tint  fiuGetSizes     (tint *nbufs, const ecomemBuffer_t **bufs,
00721                        fiuSizeCfg_t * SizeCfg);
00722
00740 tint  fiuNew          (void **fiuInst, tint nbufs, ecomemBuffer_t *bufs,
00741                        fiuNewConfig_t *cfg);
00742
00743
00752 void  fiuDelete       (void **fiuInst);
00753
00754
00765 void  fiuControl      (void *fiuInst, fiuControlCode_e ctrlCode, fiuControlConfig_t *ctrlConfig);
00766
00778 tint  fiuOpen         (void *fiuInst, fiuOpenConfig_t *cfg);
00779
00786 void  fiuClose        (void *fiuInst);
00787
00788
00789
00797 tint  fiuReceiveIn    (void *fiuInst, xferpktInfo_t *pktInfo);
00798
00799
00810 void  fiuSendIn       (void *fiuInst, void *message);
00811
00827 void  fiuTask         (void *fiuInst);
00828
00848 void  fiuReloc        (void **newFiuInst, void *oldFiuInst,
00849                        ecomemBuffer_t *newFiuBufs);
00850
00859 void  fiuGetStats     (void* fiuInst, tbool freset, fiuStats_t *stats);
00860
00871 tbool fiuValidatePkt   (fiuNetProtocol_e netProtocolType, tword *pkt, tuint pktSize);
00872  /* @name ECO APIs */
00874
00875 /* @} */ /* ingroup */
00876
00877 #endif /* _FIU_H */
00878
00879 /* nothing past this point */


FIU: Data Fields

  • Data Structures
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • j
  • l
  • m
  • n
  • r
  • s
  • t

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • AAL2cid : fiuOpenConfig_t
  • allocBuffer : fiuContext_t

- b -

  • Bytes_From_Net : fiuStats_t
  • Bytes_To_Net : fiuStats_t

- c -

  • Call_Success_Bitfield : fiuStats_t
  • CleardownTimer : fiuOpenConfig_t

- d -

  • dbgMode : fiuOpenConfig_t
  • Direction : fiuStats_t

- e -

  • ECMused : fiuStats_t
  • EflagStartTimer : fiuOpenConfig_t
  • EflagStopTimer : fiuOpenConfig_t
  • EventHandlerSpec : fiuOpenConfig_t

- f -

  • faxCriticalSectionBegin : fiuContext_t
  • faxCriticalSectionEnd : fiuContext_t
  • faxDebugTrace : fiuContext_t
  • faxNetCallTblPtr : fiuOpenConfig_t
  • faxNetClose : fiuNetCallTbl_t
  • faxNetDecoder : fiuNetCallTbl_t
  • faxNetDecoderTask : fiuNetCallTbl_t
  • faxNetEncoder : fiuNetCallTbl_t
  • faxNetEncoderTask : fiuNetCallTbl_t
  • faxNetInit : fiuNetCallTbl_t
  • faxNetReloc : fiuNetCallTbl_t
  • faxNomDelay : fiuOpenConfig_t
  • faxPacketSize : fiuOpenConfig_t
  • faxSystemTime : fiuContext_t
  • fiuEventHandler : fiuEventHandlerSpec_t
  • FIUFeatureSelector : fiuOpenConfig_t
  • fiuInst : fiuRelocInstance_t
  • fiuReceiveOut : fiuReceiveOutSpec_t
  • fiuSendOut : fiuSendOutSpec_t
  • fndInst : fiuRelocInstance_t
  • frameSize : fiuOpenConfig_t , fiuControlConfig_t
  • freeBuffer : fiuContext_t
  • frpInst : fiuRelocInstance_t

- h -

  • HsDataRedundancy : fiuOpenConfig_t
  • HSmodulation : fiuStats_t
  • HSPktPayloadSize : fiuOpenConfig_t

- i -

  • ID : fiuNewConfig_t

- j -

  • JitterBufOverFlow : fiuStats_t

- l -

  • LocalTxNetTimeOutVal : fiuOpenConfig_t
  • LsDataRedundancy : fiuOpenConfig_t
  • LSPktPayloadSize : fiuOpenConfig_t

- m -

  • MaxFaxRate : fiuOpenConfig_t
  • MaxHSbufferUsage : fiuStats_t
  • MaxJitterBufDepth : fiuStats_t
  • MaxNetRxQDepth : fiuStats_t

- n -

  • NetProtocol : fiuNetCallTbl_t , fiuOpenConfig_t
  • NetRxQOverFlow : fiuStats_t
  • NoActivityTimerVal : fiuOpenConfig_t
  • NSFCountryCode : fiuNSFInfo_t , fiuOpenConfig_t
  • NSFInfo : fiuStats_t
  • NSFManufacturer : fiuNSFInfo_t
  • NSFVendorCodeLSB : fiuOpenConfig_t
  • NSFVendorCodeMSB : fiuOpenConfig_t
  • NumberOfPages : fiuStats_t
  • NumInternalFIUBufs : fiuSizeCfg_t
  • NumInternalFIUOverlayBufs : fiuSizeCfg_t

- r -

  • ReceiveOutSpec : fiuOpenConfig_t , fiuControlConfig_t
  • RtpPayloadType : fiuOpenConfig_t
  • RtpSyncSource : fiuOpenConfig_t
  • RxInvalidPackets : fiuStats_t
  • RxLostPackets : fiuStats_t
  • RxOutOfSeqPacket : fiuStats_t
  • RxOutQMaxDepth : fiuStats_t
  • RxOutQOverflows : fiuStats_t
  • RxPackets : fiuStats_t

- s -

  • sendInQMaxDepth : fiuStats_t
  • sendInQOverflows : fiuStats_t
  • SendOutSpec : fiuOpenConfig_t
  • SizeConfig : fiuNewConfig_t
  • StartupTimer : fiuOpenConfig_t
  • SupportedExternalBuffSize : fiuContext_t

- t -

  • T30FeatureSelector : fiuOpenConfig_t
  • T38Version : fiuOpenConfig_t
  • targetInst : fiuEventHandlerSpec_t , fiuSendOutSpec_t , fiuReceiveOutSpec_t
  • TCFHandlingMethod : fiuOpenConfig_t
  • TxPackets : fiuStats_t
  • TxPacketsDropped : fiuStats_t


FIU: Data Fields - Variables

  • Data Structures
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • e
  • f
  • h
  • i
  • j
  • l
  • m
  • n
  • r
  • s
  • t

- a -

  • AAL2cid : fiuOpenConfig_t
  • allocBuffer : fiuContext_t

- b -

  • Bytes_From_Net : fiuStats_t
  • Bytes_To_Net : fiuStats_t

- c -

  • Call_Success_Bitfield : fiuStats_t
  • CleardownTimer : fiuOpenConfig_t

- d -

  • dbgMode : fiuOpenConfig_t
  • Direction : fiuStats_t

- e -

  • ECMused : fiuStats_t
  • EflagStartTimer : fiuOpenConfig_t
  • EflagStopTimer : fiuOpenConfig_t
  • EventHandlerSpec : fiuOpenConfig_t

- f -

  • faxCriticalSectionBegin : fiuContext_t
  • faxCriticalSectionEnd : fiuContext_t
  • faxDebugTrace : fiuContext_t
  • faxNetCallTblPtr : fiuOpenConfig_t
  • faxNetClose : fiuNetCallTbl_t
  • faxNetDecoder : fiuNetCallTbl_t
  • faxNetDecoderTask : fiuNetCallTbl_t
  • faxNetEncoder : fiuNetCallTbl_t
  • faxNetEncoderTask : fiuNetCallTbl_t
  • faxNetInit : fiuNetCallTbl_t
  • faxNetReloc : fiuNetCallTbl_t
  • faxNomDelay : fiuOpenConfig_t
  • faxPacketSize : fiuOpenConfig_t
  • faxSystemTime : fiuContext_t
  • fiuEventHandler : fiuEventHandlerSpec_t
  • FIUFeatureSelector : fiuOpenConfig_t
  • fiuInst : fiuRelocInstance_t
  • fiuReceiveOut : fiuReceiveOutSpec_t
  • fiuSendOut : fiuSendOutSpec_t
  • fndInst : fiuRelocInstance_t
  • frameSize : fiuOpenConfig_t , fiuControlConfig_t
  • freeBuffer : fiuContext_t
  • frpInst : fiuRelocInstance_t

- h -

  • HsDataRedundancy : fiuOpenConfig_t
  • HSmodulation : fiuStats_t
  • HSPktPayloadSize : fiuOpenConfig_t

- i -

  • ID : fiuNewConfig_t

- j -

  • JitterBufOverFlow : fiuStats_t

- l -

  • LocalTxNetTimeOutVal : fiuOpenConfig_t
  • LsDataRedundancy : fiuOpenConfig_t
  • LSPktPayloadSize : fiuOpenConfig_t

- m -

  • MaxFaxRate : fiuOpenConfig_t
  • MaxHSbufferUsage : fiuStats_t
  • MaxJitterBufDepth : fiuStats_t
  • MaxNetRxQDepth : fiuStats_t

- n -

  • NetProtocol : fiuNetCallTbl_t , fiuOpenConfig_t
  • NetRxQOverFlow : fiuStats_t
  • NoActivityTimerVal : fiuOpenConfig_t
  • NSFCountryCode : fiuNSFInfo_t , fiuOpenConfig_t
  • NSFInfo : fiuStats_t
  • NSFManufacturer : fiuNSFInfo_t
  • NSFVendorCodeLSB : fiuOpenConfig_t
  • NSFVendorCodeMSB : fiuOpenConfig_t
  • NumberOfPages : fiuStats_t
  • NumInternalFIUBufs : fiuSizeCfg_t
  • NumInternalFIUOverlayBufs : fiuSizeCfg_t

- r -

  • ReceiveOutSpec : fiuOpenConfig_t , fiuControlConfig_t
  • RtpPayloadType : fiuOpenConfig_t
  • RtpSyncSource : fiuOpenConfig_t
  • RxInvalidPackets : fiuStats_t
  • RxLostPackets : fiuStats_t
  • RxOutOfSeqPacket : fiuStats_t
  • RxOutQMaxDepth : fiuStats_t
  • RxOutQOverflows : fiuStats_t
  • RxPackets : fiuStats_t

- s -

  • sendInQMaxDepth : fiuStats_t
  • sendInQOverflows : fiuStats_t
  • SendOutSpec : fiuOpenConfig_t
  • SizeConfig : fiuNewConfig_t
  • StartupTimer : fiuOpenConfig_t
  • SupportedExternalBuffSize : fiuContext_t

- t -

  • T30FeatureSelector : fiuOpenConfig_t
  • T38Version : fiuOpenConfig_t
  • targetInst : fiuEventHandlerSpec_t , fiuSendOutSpec_t , fiuReceiveOutSpec_t
  • TCFHandlingMethod : fiuOpenConfig_t
  • TxPackets : fiuStats_t
  • TxPacketsDropped : fiuStats_t


FIU: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines
  • _
  • f
  • t
  • v

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- _ -

  • __extern : Version.h

- f -

  • fiu_CALL_SUCCESS_BITFIELD_CLEAR : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_DCN_LOCAL : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_DCN_REMOTE : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_DIS_AFTER_EOM : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_EOM : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_EOP : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_MCF : fiu.h
  • fiu_CTRL_ACTIVATE : fiu.h
  • fiu_CTRL_CONFIG : fiu.h
  • fiu_DBG_FATAL_ERROR : fiu.h
  • fiu_DBG_INFORMATIONAL : fiu.h
  • fiu_DBG_LVL_1 : fiu.h
  • fiu_DBG_LVL_2 : fiu.h
  • fiu_DBG_OFF : fiu.h
  • fiu_DIR_DEST : fiu.h
  • fiu_DIR_ORG : fiu.h
  • fiu_DIR_UNKNOWN : fiu.h
  • fiu_ERROR : fiu.h
  • fiu_EVENT_CLEARDOWN : fiu.h
  • fiu_EVENT_G3_TO_V34 : fiu.h
  • fiu_EVENT_V34_TO_G3 : fiu.h
  • fiu_FEATURE_AAL2_CID_CHK_DISABLE : fiu.h
  • fiu_FEATURE_DIS_EFLAG_DISABLE : fiu.h
  • fiu_FEATURE_MDM_TRN_FAIL_COMP : fiu.h
  • fiu_FEATURE_NSF_OVERRIDE : fiu.h
  • fiu_FEATURE_RTP_TS_PROC_DISABLE : fiu.h
  • fiu_FEATURE_SLF_ENABLE : fiu.h
  • fiu_FEATURE_T38_VOCALTEC_INTEROP : fiu.h
  • fiu_FEATURE_TFOP_FC_REPEAT : fiu.h
  • fiu_FEATURE_V34_FAX : fiu.h
  • fiu_NOERR : fiu.h
  • fiu_NOMEMORY : fiu.h
  • fiu_NSF_CC_UNKNOWN : fiu.h
  • fiu_NSF_MC_UNKNOWN : fiu.h
  • fiu_PT_AAL2 : fiu.h
  • fiu_PT_FRF11 : fiu.h
  • fiu_PT_RTP : fiu.h
  • fiu_PT_RTPB : fiu.h
  • fiu_PT_T2 : fiu.h
  • fiu_PT_T3 : fiu.h
  • fiu_PT_T38_RTP : fiu.h
  • fiu_PT_T38_UDPTL : fiu.h
  • fiu_PT_T38_UDPTL_RTP : fiu.h
  • fiu_SWITCHOVER_PREAMBLE_RCVD_REMOTE : fiu.h
  • fiu_SWITCHOVER_V34_NOT_SUPPORTED : fiu.h
  • fiu_SWITCHOVER_V8_ANSAM_RCVD_REMOTE : fiu.h
  • fiu_SWITCHOVER_V8_CI_RCVD_LOCAL : fiu.h
  • fiu_SWITCHOVER_V8_CI_RCVD_REMOTE : fiu.h
  • fiu_SWITCHOVER_V8_CM_RCVD_LOCAL : fiu.h
  • fiu_SWITCHOVER_V8_CM_RCVD_REMOTE : fiu.h
  • fiu_T30FEATURE_ECM_DISABLE : fiu.h
  • fiu_T30FEATURE_MR_DISABLE : fiu.h
  • fiu_T30FEATURE_V34_DISABLE : fiu.h
  • fiuClose() : fiu.h
  • fiuContext : fiu.h
  • fiuControl() : fiu.h
  • fiuControlCode_e : fiu.h
  • fiuDelete() : fiu.h
  • fiuDirection_e : fiu.h
  • fiuGetSizes() : fiu.h
  • fiuGetStats() : fiu.h
  • fiuNetProtocol_e : fiu.h
  • fiuNew() : fiu.h
  • fiuOpen() : fiu.h
  • fiuReceiveIn() : fiu.h
  • fiuReloc() : fiu.h
  • fiuSendIn() : fiu.h
  • fiuTask() : fiu.h
  • fiuValidatePkt() : fiu.h

- t -

  • ti_mas_fiu_Version___VERS : Version.h
  • ti_mas_fiu_Version__top__ : Version.h
  • ti_mas_fiu_Version_BTYPE : Version.h
  • ti_mas_fiu_Version_BUILD : Version.h
  • ti_mas_fiu_Version_MAJOR : Version.h
  • ti_mas_fiu_Version_MINOR : Version.h
  • ti_mas_fiu_Version_PATCH : Version.h
  • ti_mas_fiu_Version_QUALITY : Version.h
  • ti_mas_fiu_Version_WIDTH : Version.h
  • ti_mas_fiu_Version_XVERTICAL : Version.h

- v -

  • Version_BTYPE : Version.h
  • Version_BUILD : Version.h
  • Version_MAJOR : Version.h
  • Version_MINOR : Version.h
  • Version_PATCH : Version.h
  • Version_QUALITY : Version.h
  • Version_WIDTH : Version.h
  • Version_XVERTICAL : Version.h


FIU: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines
  • _
  • f
  • t
  • v

- _ -

  • __extern : Version.h

- f -

  • fiu_CALL_SUCCESS_BITFIELD_CLEAR : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_DCN_LOCAL : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_DCN_REMOTE : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_DIS_AFTER_EOM : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_EOM : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_EOP : fiu.h
  • fiu_CALL_SUCCESS_BITFIELD_MCF : fiu.h
  • fiu_DBG_FATAL_ERROR : fiu.h
  • fiu_DBG_INFORMATIONAL : fiu.h
  • fiu_DBG_LVL_1 : fiu.h
  • fiu_DBG_LVL_2 : fiu.h
  • fiu_DBG_OFF : fiu.h
  • fiu_ERROR : fiu.h
  • fiu_EVENT_CLEARDOWN : fiu.h
  • fiu_EVENT_G3_TO_V34 : fiu.h
  • fiu_EVENT_V34_TO_G3 : fiu.h
  • fiu_FEATURE_AAL2_CID_CHK_DISABLE : fiu.h
  • fiu_FEATURE_DIS_EFLAG_DISABLE : fiu.h
  • fiu_FEATURE_MDM_TRN_FAIL_COMP : fiu.h
  • fiu_FEATURE_NSF_OVERRIDE : fiu.h
  • fiu_FEATURE_RTP_TS_PROC_DISABLE : fiu.h
  • fiu_FEATURE_SLF_ENABLE : fiu.h
  • fiu_FEATURE_T38_VOCALTEC_INTEROP : fiu.h
  • fiu_FEATURE_TFOP_FC_REPEAT : fiu.h
  • fiu_FEATURE_V34_FAX : fiu.h
  • fiu_NOERR : fiu.h
  • fiu_NOMEMORY : fiu.h
  • fiu_NSF_CC_UNKNOWN : fiu.h
  • fiu_NSF_MC_UNKNOWN : fiu.h
  • fiu_SWITCHOVER_PREAMBLE_RCVD_REMOTE : fiu.h
  • fiu_SWITCHOVER_V34_NOT_SUPPORTED : fiu.h
  • fiu_SWITCHOVER_V8_ANSAM_RCVD_REMOTE : fiu.h
  • fiu_SWITCHOVER_V8_CI_RCVD_LOCAL : fiu.h
  • fiu_SWITCHOVER_V8_CI_RCVD_REMOTE : fiu.h
  • fiu_SWITCHOVER_V8_CM_RCVD_LOCAL : fiu.h
  • fiu_SWITCHOVER_V8_CM_RCVD_REMOTE : fiu.h
  • fiu_T30FEATURE_ECM_DISABLE : fiu.h
  • fiu_T30FEATURE_MR_DISABLE : fiu.h
  • fiu_T30FEATURE_V34_DISABLE : fiu.h

- t -

  • ti_mas_fiu_Version___VERS : Version.h
  • ti_mas_fiu_Version__top__ : Version.h
  • ti_mas_fiu_Version_BTYPE : Version.h
  • ti_mas_fiu_Version_BUILD : Version.h
  • ti_mas_fiu_Version_MAJOR : Version.h
  • ti_mas_fiu_Version_MINOR : Version.h
  • ti_mas_fiu_Version_PATCH : Version.h
  • ti_mas_fiu_Version_QUALITY : Version.h
  • ti_mas_fiu_Version_WIDTH : Version.h
  • ti_mas_fiu_Version_XVERTICAL : Version.h

- v -

  • Version_BTYPE : Version.h
  • Version_BUILD : Version.h
  • Version_MAJOR : Version.h
  • Version_MINOR : Version.h
  • Version_PATCH : Version.h
  • Version_QUALITY : Version.h
  • Version_WIDTH : Version.h
  • Version_XVERTICAL : Version.h


FIU: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • fiuControlCode_e : fiu.h
  • fiuDirection_e : fiu.h
  • fiuNetProtocol_e : fiu.h


FIU: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • fiu_CTRL_ACTIVATE : fiu.h
  • fiu_CTRL_CONFIG : fiu.h
  • fiu_DIR_DEST : fiu.h
  • fiu_DIR_ORG : fiu.h
  • fiu_DIR_UNKNOWN : fiu.h
  • fiu_PT_AAL2 : fiu.h
  • fiu_PT_FRF11 : fiu.h
  • fiu_PT_RTP : fiu.h
  • fiu_PT_RTPB : fiu.h
  • fiu_PT_T2 : fiu.h
  • fiu_PT_T3 : fiu.h
  • fiu_PT_T38_RTP : fiu.h
  • fiu_PT_T38_UDPTL : fiu.h
  • fiu_PT_T38_UDPTL_RTP : fiu.h


FIU: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • fiuClose() : fiu.h
  • fiuControl() : fiu.h
  • fiuDelete() : fiu.h
  • fiuGetSizes() : fiu.h
  • fiuGetStats() : fiu.h
  • fiuNew() : fiu.h
  • fiuOpen() : fiu.h
  • fiuReceiveIn() : fiu.h
  • fiuReloc() : fiu.h
  • fiuSendIn() : fiu.h
  • fiuTask() : fiu.h
  • fiuValidatePkt() : fiu.h


FIU: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • fiuContext : fiu.h


FIU: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


FIU: T.30 Protocol Call Success Bitfield

T.30 Protocol Call Success Bitfield
[FIU External API]

Collaboration diagram for T.30 Protocol Call Success Bitfield:

Detailed Description

A one-word (16-bit) success indicator that reflects the current status of important protocol events in the fax call. Bits 0-9 are unused.

Defines

#define | fiu_CALL_SUCCESS_BITFIELD_CLEAR 0x0000
#define | fiu_CALL_SUCCESS_BITFIELD_EOP 0x8000
#define | fiu_CALL_SUCCESS_BITFIELD_MCF 0x4000
#define | fiu_CALL_SUCCESS_BITFIELD_EOM 0x2000
#define | fiu_CALL_SUCCESS_BITFIELD_DCN_LOCAL 0x1000
#define | fiu_CALL_SUCCESS_BITFIELD_DCN_REMOTE 0x0800
#define | fiu_CALL_SUCCESS_BITFIELD_DIS_AFTER_EOM 0x0400

Define Documentation

#define fiu_CALL_SUCCESS_BITFIELD_CLEAR 0x0000

All bits

Definition at line 618 of file fiu.h.

#define fiu_CALL_SUCCESS_BITFIELD_EOP 0x8000

Bit 15 End of Procedure (EOP) indicator rec'd (either tele or net)

Definition at line 619 of file fiu.h.

#define fiu_CALL_SUCCESS_BITFIELD_MCF 0x4000

Bit 14 Message Confirmed (MCF) indicator rec'd (either tele or net)

Definition at line 620 of file fiu.h.

#define fiu_CALL_SUCCESS_BITFIELD_EOM 0x2000

Bit 13 - End of Message (EOM) indicator rec'd (either tele or net)

Definition at line 621 of file fiu.h.

#define fiu_CALL_SUCCESS_BITFIELD_DCN_LOCAL 0x1000

Bit 12 - Disconnect (DCN) indicator received from tele

Definition at line 622 of file fiu.h.

#define fiu_CALL_SUCCESS_BITFIELD_DCN_REMOTE 0x0800

Bit 11 - Disconnect (DCN) indicator received from net

Definition at line 623 of file fiu.h.

#define fiu_CALL_SUCCESS_BITFIELD_DIS_AFTER_EOM 0x0400

Bit 10 - DIS received after EOM negotiated

Definition at line 624 of file fiu.h.


FIU: Fax Debug Mode

Fax Debug Mode
[FIU External API]

Collaboration diagram for Fax Debug Mode:

Defines

#define | fiu_DBG_OFF 0
#define | fiu_DBG_LVL_1 1
#define | fiu_DBG_LVL_2 2

Define Documentation

#define fiu_DBG_OFF 0

FIU Debug Mode -- Only fatal errors are reported

Definition at line 186 of file fiu.h.

#define fiu_DBG_LVL_1 1

FIU Debug Mode -- Reports high-level protocol state information and fatal errors.Types of protocol information reported includes: Protocol state transitions (OPEN,IDLE, Local Low-speed Receive, Local High-speed Receive, Local TCF Receive,Local Low-speed Transmit, Local High-speed Transmit, Local TCF Transmit, Switch-out Pending) and detected low-speed frames (e.g., DIS, DCS, etc.). Detected network anomalies are also reported (e.g., packet loss).

Definition at line 196 of file fiu.h.

#define fiu_DBG_LVL_2 2

FIU Debug Mode -- Telogy internal debug mode

Definition at line 201 of file fiu.h.


FIU: Return Error Codes

Return Error Codes
[FIU External API]

Collaboration diagram for Return Error Codes:

Defines

#define | fiu_NOMEMORY (-1)
#define | fiu_NOERR 0
#define | fiu_ERROR 1

Define Documentation

#define fiu_NOMEMORY (-1)

FIU return code -- Insufficient memory allocated

Definition at line 164 of file fiu.h.

#define fiu_NOERR 0

FIU return code -- Initiaization of FIU was successful

Definition at line 169 of file fiu.h.

#define fiu_ERROR 1

FIU return code -- Invalid configuration

Definition at line 174 of file fiu.h.


FIU: FIU External API

FIU External API

Collaboration diagram for FIU External API:

Detailed Description

Modules

Return Error Codes
Fax Debug Mode
Fax Control Code
FIU Debug message types for debugInfo()
FIU Event Codes
Fax Switchover Reason Codes
Network Protocol Types
T30 Feature Selector Definitions
FIU Feature Selector Definitions
T.30 Protocol Call Success Bitfield

Data Structures

struct | fiuContext_t
The FIU software module has a global context structure that contains non channel specific configuration information which is used by all active FIU instances. FIU Context is a structure that must be declared globally by system code, and initialized prior to any calls to the FIU API. More...
struct | fiuContext_t
The FIU software module has a global context structure that contains non channel specific configuration information which is used by all active FIU instances. FIU Context is a structure that must be declared globally by system code, and initialized prior to any calls to the FIU API. More...
struct | fiuEventHandlerSpec_t
Specification of fiuEventHandlerSpec Object This structure contains the address of function and associated data structure for reporting events to the system for processing. More...
struct | fiuSendOutSpec_t
Specification of fiuSendOutSpec Object This structure contains the address of function and associated data structure for sending FAX packets to the network. More...
struct | fiuReceiveOutSpec_t
Specification of fiuReceiveOutSpec Object. More...
struct | fiuSizeCfg_t
FIU Size Configuration structure. More...
struct | fiuNewConfig_t
New Configuration structure. More...
struct | fiuNetCallTbl_t
FIU Protocol Call Table. More...
struct | fiuOpenConfig_t
Open Configuration structure. More...
struct | fiuControlConfig_t
Control Configuration structure. More...
struct | fiuNSFInfo_t
NSF Information data structure. More...
struct | fiuStats_t
FIU Statistics Structure. More...
struct | fiuRelocInstance_t
FIU Relocation structure. More...

ECO (Telogy Embedded Communication Object) APIs

tint | fiuGetSizes (tint *nbufs, const ecomemBuffer_t **bufs, fiuSizeCfg_t *SizeCfg)
This function obtains memory requirements for an instance of FIU.
tint | fiuNew (void **fiuInst, tint nbufs, ecomemBuffer_t *bufs, fiuNewConfig_t *cfg)
This function creates an instance of FIU and initializes the memory buffer pointers in the instance.
Remarks:
Function fiuNew() must be called before fiuOpen()is called.

void | fiuDelete (void **fiuInst)
This function deletes the FIU instance identified by fiuInst.
Remarks:
FIU must be closed prior to being deleted.

void | fiuControl (void *fiuInst, fiuControlCode_e ctrlCode, fiuControlConfig_t *ctrlConfig)
This function controls the operations of an instance of FIU.
tint | fiuOpen (void *fiuInst, fiuOpenConfig_t *cfg)
This function initializes and configures an FIU instance.
void | fiuClose (void *fiuInst)
This function closes the FIU instance identified by fiuInst. It sets the state of FIU to CLOSED.
tint | fiuReceiveIn (void *fiuInst, xferpktInfo_t *pktInfo)
This function processes packets received from the network.
void | fiuSendIn (void *fiuInst, void *message)
This function passes a message from a fax modem module (FM) to FIU for processing.
void | fiuTask (void *fiuInst)
Routine which performs fax protocol processing and network encoder/decoder operations.
void | fiuReloc (void **newFiuInst, void *oldFiuInst, ecomemBuffer_t *newFiuBufs)
Relocates an instantiated FIU instance to another area of memory.
void | fiuGetStats (void *fiuInst, tbool freset, fiuStats_t *stats)
Routine which obtains FIU statistics (both network- and call-specific) The stats can be requested from either an active call, or the last call if the current call session has been terminated.
tbool | fiuValidatePkt (fiuNetProtocol_e netProtocolType, tword *pkt, tuint pktSize)
Validates T.38 UDP packet This routine checks if the packet is a valid fax relay packet. Currently, only T.38 UDPTL is supported.

Defines

#define | fiu_NSF_CC_UNKNOWN 0xFFFF
NSF field definitions:.
#define | fiu_NSF_MC_UNKNOWN 0xFFFF

Enumerations

enum | fiuDirection_e { fiu_DIR_ORG, fiu_DIR_DEST, fiu_DIR_UNKNOWN = 0x00FF }
Direction definitions. More...

Variables

fiuContext_t fiuContext
reference of FIU Context Structure

Define Documentation

#define fiu_NSF_CC_UNKNOWN 0xFFFF

NSF field definitions:.

Country code unavailable

Definition at line 654 of file fiu.h.

#define fiu_NSF_MC_UNKNOWN 0xFFFF

Manufacturer's code unavailable

Definition at line 655 of file fiu.h.

Enumeration Type Documentation

enum fiuDirection_e

Direction definitions.

Enumerator:
fiu_DIR_ORG | local FTE is Originating
fiu_DIR_DEST | local FTE is Destination
fiu_DIR_UNKNOWN | local FTE is Direction is unknown

Definition at line 630 of file fiu.h.

Function Documentation

tint fiuGetSizes | ( | tint * | nbufs,
 |  | const ecomemBuffer_t ** | bufs,
 |  | fiuSizeCfg_t * | SizeCfg
 | ) |  |

This function obtains memory requirements for an instance of FIU.

Parameters:
[in] | SizeCfg | Pointer to a size configuration structure.
[out] | nbufs | Number of memory buffers stored in this address.
[out] | bufs | Address of buffer descriptors stored in this address.
Return values:
Value Return Error Codes
Precondition:
Global data structure fiuContext must be defined and initialized properly.
See also:
fiuSizeCfg_t

tint fiuNew | ( | void ** | fiuInst,
 |  | tint | nbufs,
 |  | ecomemBuffer_t * | bufs,
 |  | fiuNewConfig_t * | cfg
 | ) |  |

This function creates an instance of FIU and initializes the memory buffer pointers in the instance.

Remarks:
Function fiuNew() must be called before fiuOpen()is called.

Parameters:
[in] | nbufs | Number of memory buffers
[in] | bufs | Pointer to memory buffer descriptors
[in] | cfg | Pointer to new instance configuration structure
[in,out] | fiuInst | Pointer to FIU instance
Return values:
Value Return Error Codes
Precondition:
Pointer fiuInst must be set to NULL before this function is called.
Postcondition:
Pointer fiuInst will be set to point to the instance buffer described by bufs.
See also:
fiuNewConfig_t

void fiuDelete ( void ** fiuInst )

This function deletes the FIU instance identified by fiuInst.

Remarks:
FIU must be closed prior to being deleted.

Parameters:
[in,out] fiuInst Pointer to FIU instance.
Postcondition:
Pointer fiuInst will be set to NULL after this function is called.

void fiuControl | ( | void * | fiuInst,
 |  | fiuControlCode_e | ctrlCode,
 |  | fiuControlConfig_t * | ctrlConfig
 | ) |  |

This function controls the operations of an instance of FIU.

Parameters:
[in] | ctrlConfig | Pointer to FIU control config structure.
[in] | ctrlCode | FIU control code.
[in,out] | fiuInst | Pointer to FIU instance.
See also:
fiuControlCode_e

fiuControlConfig_t

tint fiuOpen | ( | void * | fiuInst,
 |  | fiuOpenConfig_t * | cfg
 | ) |  |

This function initializes and configures an FIU instance.

Parameters:
[in] | cfg | Pointer to FIU Open Configuration Structure.
[in,out] | fiuInst | Pointer to FIU instance.
Return values:
Value Return Error Codes
Postcondition:
The instance's state will be set to OPEN.
See also:
fiuOpenConfig_t

void fiuClose ( void * fiuInst )

This function closes the FIU instance identified by fiuInst. It sets the state of FIU to CLOSED.

Parameters:
[in,out] fiuInst

tint fiuReceiveIn | ( | void * | fiuInst,
 |  | xferpktInfo_t * | pktInfo
 | ) |  |

This function processes packets received from the network.

Parameters:
[in] | pktInfo | Pointer to the packet info structure.
[in,out] | fiuInst | Pointer to FIU instance.

void fiuSendIn | ( | void * | fiuInst,
 |  | void * | message
 | ) |  |

This function passes a message from a fax modem module (FM) to FIU for processing.

The message received from the FM is passed to the FRP module for processing. data is processed by the FRP. The FM to FP message structure is defined in the IFFAX.chm

Parameters:
[in] | message | a pointer to the FM to FP message structure.
[in,out] | fiuInst | Pointer to FIU instance.

void fiuTask ( void * fiuInst )

Routine which performs fax protocol processing and network encoder/decoder operations.

The fiuTask function is called every frame. The fiuTask perform FAX protocol processing. Specifically, the Fax Protocol Task is executed -- performing FAX protocol processing on both fax modem messages and network data/protocol messages. Next, the network driver task is executed to perform any required network encoder and/or decoder operations.

Remarks:
The order of the function calls is important. First, the FND task is executed, then the FRP task is executed. The reasoning for this execution order is to allow data to be provided to the modem from the network, preventing modem underruns.
Parameters:
[in,out] fiuInst Pointer to FIU instance.

void fiuReloc | ( | void ** | newFiuInst,
 |  | void * | oldFiuInst,
 |  | ecomemBuffer_t * | newFiuBufs
 | ) |  |

Relocates an instantiated FIU instance to another area of memory.

This function takes an existing (possibly active) instance of FIU and relocates it to another part of the DSP's memory. It is assumed that all memory management is handled external to the fiuReloc function. In particular, it is assumed that the calling code has allocated adequate memory for the new FIU instance and its associated runtime (dynamic) buffers; that the newly allocated memory space is contiguous; and that the new memory has been overwritten with the contents of the old FIU instance structure using the memcopy() C library function.

Remarks:
This function should not be interrupted during its execution
Parameters:
[in,out] | newFiuInst | Address of a location in which a ptr to the new FIU instance will be written
[in] | oldFiuInst | Pointer to the old FIU instance
[in] | newFiuBufs | Pointer to memory block where new FIU buffers will be located

void fiuGetStats | ( | void * | fiuInst,
 |  | tbool | freset,
 |  | fiuStats_t * | stats
 | ) |  |

Routine which obtains FIU statistics (both network- and call-specific) The stats can be requested from either an active call, or the last call if the current call session has been terminated.

Parameters:
[in,out] | fiuInst | Pointer to FIU instance
[in] | freset | Flag indicating whether to reset statistics
[in] | stats | pointer to statistics report structure

tbool fiuValidatePkt | ( | fiuNetProtocol_e | netProtocolType,
 |  | tword * | pkt,
 |  | tuint | pktSize
 | ) |  |

Validates T.38 UDP packet This routine checks if the packet is a valid fax relay packet. Currently, only T.38 UDPTL is supported.

Parameters:
[in,out] | netProtocolType | Network Protocol Types
[in,out] | pkt | Pointer to the packet to be validated
[in,out] | pktSize | Size of the packet
Return values:
TRUE | - packet is valid
FALSE | - packet is invalid or network protocol is not supported

Variable Documentation

fiuContext_t fiuContext

reference of FIU Context Structure


FIU: FIU Feature Selector Definitions

FIU Feature Selector Definitions
[FIU External API]

Collaboration diagram for FIU Feature Selector Definitions:

Detailed Description

The following is a bitmap definition of the FIUFeatureSelector field. It allows selective enabling/disabling of specific FIU capabilities.

Defines

#define | fiu_FEATURE_SLF_ENABLE 0x0001
#define | fiu_FEATURE_DIS_EFLAG_DISABLE 0x0002
#define | fiu_FEATURE_TFOP_FC_REPEAT 0x0004
#define | fiu_FEATURE_NSF_OVERRIDE 0x0008
#define | fiu_FEATURE_RTP_TS_PROC_DISABLE 0x0010
#define | fiu_FEATURE_AAL2_CID_CHK_DISABLE 0x0020
#define | fiu_FEATURE_MDM_TRN_FAIL_COMP 0x0040
#define | fiu_FEATURE_V34_FAX 0x0080
#define | fiu_FEATURE_T38_VOCALTEC_INTEROP 0x0100

Define Documentation

#define fiu_FEATURE_SLF_ENABLE 0x0001

FIU FEATURE -- Enable scan line fix-up feature

Definition at line 366 of file fiu.h.

#define fiu_FEATURE_DIS_EFLAG_DISABLE 0x0002

FIU FEATURE -- Disable Eflags for first DIS

Definition at line 372 of file fiu.h.

#define fiu_FEATURE_TFOP_FC_REPEAT 0x0004

FIU FEATURE -- Enable repeating of Frame Complete packet over the packet network for improved performance

Definition at line 378 of file fiu.h.

#define fiu_FEATURE_NSF_OVERRIDE 0x0008

FIU FEATURE -- Allow user to specify their own NSF fields

Definition at line 384 of file fiu.h.

#define fiu_FEATURE_RTP_TS_PROC_DISABLE 0x0010

FIU FEATURE -- Disable the use of T.38 RTP timestamps for playout

Definition at line 390 of file fiu.h.

#define fiu_FEATURE_AAL2_CID_CHK_DISABLE 0x0020

FIU FEATURE -- Enable or disables checking of CID in AAL2 Rx

Definition at line 395 of file fiu.h.

#define fiu_FEATURE_MDM_TRN_FAIL_COMP 0x0040

FIU FEATURE -- Enable feature to compensate for modem training failures in HS

Definition at line 402 of file fiu.h.

#define fiu_FEATURE_V34_FAX 0x0080

FIU FEATURE -- Enable V.34 fax relay protocol

Definition at line 409 of file fiu.h.

#define fiu_FEATURE_T38_VOCALTEC_INTEROP 0x0100

FIU FEATURE -- Workaround for interop with VocalTec T.38 gateways that cannot properly process reception of HS packets with t4-non-ecm-sig-end indications appended to them

Definition at line 415 of file fiu.h.


FIU: Fax Control Code

Fax Control Code
[FIU External API]

Collaboration diagram for Fax Control Code:

Enumerations

enum fiuControlCode_e { fiu_CTRL_ACTIVATE = 1, fiu_CTRL_CONFIG }

Enumeration Type Documentation

enum fiuControlCode_e

Enumerator:
fiu_CTRL_ACTIVATE | Activate the fax relay processing and timers
fiu_CTRL_CONFIG | Change the FIU configuration on the fly

Definition at line 210 of file fiu.h.


FIU: FIU Debug message types for debugInfo()

FIU Debug message types for debugInfo()
[FIU External API]

Collaboration diagram for FIU Debug message types for debugInfo():

Defines

#define | fiu_DBG_INFORMATIONAL 0
#define | fiu_DBG_FATAL_ERROR 2

Define Documentation

#define fiu_DBG_INFORMATIONAL 0

FIU Debug Message Type -- Fax general debug information message

Definition at line 227 of file fiu.h.

#define fiu_DBG_FATAL_ERROR 2

FIU Debug Message Type -- Fax critical debug information message

Definition at line 232 of file fiu.h.


FIU: FIU Event Codes

FIU Event Codes
[FIU External API]

Collaboration diagram for FIU Event Codes:

Defines

#define | fiu_EVENT_CLEARDOWN 0
#define | fiu_EVENT_G3_TO_V34 1
#define | fiu_EVENT_V34_TO_G3 2

Define Documentation

#define fiu_EVENT_CLEARDOWN 0

FIU Event Codes -- Notifies call processing software that the local fax processing has been terminated.

Definition at line 246 of file fiu.h.

#define fiu_EVENT_G3_TO_V34 1

FIU Event Codes -- Notifies call processing software to switch over from G3 fax relay to V.34 fax relay.

Definition at line 252 of file fiu.h.

#define fiu_EVENT_V34_TO_G3 2

FIU Event Codes -- Notifies call processing software to switch over from V.34 fax relay to G3 fax relay.

Definition at line 258 of file fiu.h.


FIU: Fax Switchover Reason Codes

Fax Switchover Reason Codes
[FIU External API]

Collaboration diagram for Fax Switchover Reason Codes:

Defines

#define | fiu_SWITCHOVER_V8_CM_RCVD_LOCAL 0
#define | fiu_SWITCHOVER_V8_CM_RCVD_REMOTE 1
#define | fiu_SWITCHOVER_V8_CI_RCVD_LOCAL 2
#define | fiu_SWITCHOVER_V8_CI_RCVD_REMOTE 3
#define | fiu_SWITCHOVER_V8_ANSAM_RCVD_REMOTE 4
#define | fiu_SWITCHOVER_PREAMBLE_RCVD_REMOTE 5
#define | fiu_SWITCHOVER_V34_NOT_SUPPORTED 6

Define Documentation

#define fiu_SWITCHOVER_V8_CM_RCVD_LOCAL 0

Fax Switchover Reason Codes -- V.8 CM received from local FTE

Definition at line 272 of file fiu.h.

#define fiu_SWITCHOVER_V8_CM_RCVD_REMOTE 1

Fax Switchover Reason Codes -- V.8 CM received from remote FTE

Definition at line 277 of file fiu.h.

#define fiu_SWITCHOVER_V8_CI_RCVD_LOCAL 2

Fax Switchover Reason Codes -- V.8 CI received from local FTE

Definition at line 282 of file fiu.h.

#define fiu_SWITCHOVER_V8_CI_RCVD_REMOTE 3

Fax Switchover Reason Codes -- V.8 CI received from remote FTE

Definition at line 287 of file fiu.h.

#define fiu_SWITCHOVER_V8_ANSAM_RCVD_REMOTE 4

Fax Switchover Reason Codes -- ANSam received from remote FTE

Definition at line 292 of file fiu.h.

#define fiu_SWITCHOVER_PREAMBLE_RCVD_REMOTE 5

Fax Switchover Reason Codes -- V.21 preamble received from remote FTE

Definition at line 297 of file fiu.h.

#define fiu_SWITCHOVER_V34_NOT_SUPPORTED 6

Fax Switchover Reason Codes -- V.34 HDX is not supported

Definition at line 302 of file fiu.h.


FIU: Network Protocol Types

Network Protocol Types
[FIU External API]

Collaboration diagram for Network Protocol Types:

Detailed Description

Definition of Network Protocol Types

Enumerations

enum fiuNetProtocol_e {
fiu_PT_T2, fiu_PT_T3, fiu_PT_FRF11, fiu_PT_RTP,
fiu_PT_T38_UDPTL, fiu_PT_T38_UDPTL_RTP, fiu_PT_AAL2, fiu_PT_RTPB,
fiu_PT_T38_RTP
}

Enumeration Type Documentation

enum fiuNetProtocol_e

Enumerator:
fiu_PT_T2 | Telogy-2 Protocol
fiu_PT_T3 | Telogy-3 Protocol
fiu_PT_FRF11 | FRF.11 Fax Relay Protocol
fiu_PT_RTP | RTP protocol
fiu_PT_T38_UDPTL | T.38 UDPTL protocol
fiu_PT_T38_UDPTL_RTP | T.38 UDPTL RTP proprietary protocol
fiu_PT_AAL2 | AAL2 Protocol
fiu_PT_RTPB | RTP version B protocol
fiu_PT_T38_RTP | T.38 RTP protocol

Definition at line 313 of file fiu.h.


FIU: T30 Feature Selector Definitions

T30 Feature Selector Definitions
[FIU External API]

Collaboration diagram for T30 Feature Selector Definitions:

Detailed Description

The following definitions are used by FIU to define which features of the fax call are to be enabled or disabled. A non-zero value is used to disable a feature.

Defines

#define | fiu_T30FEATURE_ECM_DISABLE 0x0001
#define | fiu_T30FEATURE_MR_DISABLE 0x0002
#define | fiu_T30FEATURE_V34_DISABLE 0x0004

Define Documentation

#define fiu_T30FEATURE_ECM_DISABLE 0x0001

T30 FEATURE -- Disable Error Correction Mode

Definition at line 340 of file fiu.h.

#define fiu_T30FEATURE_MR_DISABLE 0x0002

T30 FEATURE -- Disable Modify Record Page Compression

Definition at line 345 of file fiu.h.

#define fiu_T30FEATURE_V34_DISABLE 0x0004

T30 FEATURE -- Disable V.34 Fax

Definition at line 350 of file fiu.h.


FIU: FIU (Fax Interface Unit) Package

FIU (Fax Interface Unit) Package

Release 3.1.0.3

Page Contents

  1. Description
  2. Integration
  3. Default Configuration
  4. Performance
  5. Limitations
  6. Standards Compliance
  7. Dependent Packages

Description

The Facsimile Interface Unit (FIU) is a software module that process messages (including data) from the Facsimile Modem Unit (FM) for transmission over a packet network and vice versa. Likewise, it process digital data received from the network and passes them to FM for transmission over the analog connection. In doing so, the FIU performs protocol conversion between Group 3 facsimile protocols and the digital facsimile protocol employed over the packet network. The FIU performs the following functions:
  • T.30 protocol processing
  • Examination and alteration of binary signaling messages to ensure compatibility of the facsimile transfer
  • Packet network facsimile protocol processing
  • Compensation for network impairments: packet loss, jitter and delay
  • FAXMONTM real-time debug tracing

The FIU, as a modular software unit, is accessible via its standardized API, which provides defined function calls as detailed in the following sections.

Integration

The FIU component can be integrated into a system and provide reliable FAX processing following the link below. There, we descibe the build process, integration/link process and global structure initialization requirements.

Object deliveries come with the libraries built and ready for integration. Accordingly, the build process only applies to Source deliveries in which the FIU code may be customized and the libraries built.

Note:
  1. Source deliveries come with libraries pre-built. The build process is only required if changes to the source code are made.

Additional links: | FIU External API
 | FIU Integration

Default Configuration

None

Performance

For MIPS and memory information proceed to the links provided below

Additional links: FIU Performance

Limitations

None

Standards Compliance

. ITU-T Recommendation T.38, “Procedures for Real Time Group 3 Facsimile Communication Over IP Networks.”

Dependent Packages

The FIU package depends on the following packages for build and/or integration. The specific versions and compatibility keys are provided in the FIU release notes.
  1. ti.mas.types (Common data type defintions)
  2. ti.mas.util (Common utilities)
  3. ti.mas.fract (Common fractional arithmetic macros)
  4. ti.mas.iffax (External fax interface for configuration)
  5. ti.mas.ifpkt (Common Interface Package)
  6. ti.mas.swtools (Internally used s/w tools)


FIU: FIU Integration

FIU (Fax Interface Unit) Package

FIU Integration

Page Contents

  • XDC Build Process
  • Make Build Process
  • Linking FIU with System

XDC Build Process

Required Tools

The following tools are required to build the FIU component (links provided). Download and install all tools to a single local (C:) directory, for example c:\tools.

  1. Code Generation (download)
    • C55xx: CG Tools version:
    • C64xx: CG Tools version
  2. XDC (download)
    • XDC Tools version
  3. xDAIS (download)
    • xDAIS Developer's Kit version

Note:
  1. A "My.TI" account is required for download and can be registered at http://my.ti.com.

Windows Configuration

Once all tools are properly installed, the environment will need to be configured to recognize the tool paths. A Windows batch file should be created to provide a consistent manner to achieve this. The example below can used (cut & paste) to create a setenv.bat batch file in the ...\ti\mas\swtools directory.

Assumptions:
  1. The XDC tools were installed in c:\tools
  2. The C55 code generation tools were installed in c:\tools\cgen_<ver>
  3. The C64 code generation tools were installed in c:\tools\cgen_<ver>
  4. The xDAIS developr's kit was installed in c:\tools\xdais_<ver>

    @echo off
    rem # *************************************************************************
    rem # *** Version information (ONLY EDIT THIS SECTION)
    rem # *************************************************************************
    set LOCAL_TOOLSDIR=tools
    set XDCBASE=xdctools_<ver>
    set C55CODEGENBASE=cgen_<ver>
    set C64CODEGENBASE=cgen_<ver>
    set XDAISBASE=xdais_<ver>

    rem # *************************************************************************
    rem # *** Set up tools directory
    rem # *************************************************************************
    set LOCAL_TOOLSDIR_DOS=c:\%LOCAL_TOOLSDIR%

    rem # *************************************************************************
    rem # ** Set code generation tools path
    rem # *************************************************************************
    set C55CODEGENTOOL=%LOCAL_TOOLSDIR_DOS%\%C55CODEGENBASE%
    set C64CODEGENTOOL=%LOCAL_TOOLSDIR_DOS%\%C64CODEGENBASE%

    rem # *************************************************************************
    rem # ** Set the PATH
    rem # *************************************************************************
    set PATH=%SystemRoot%;%SystemRoot%\system32
    set PATH=%PATH%;%LOCAL_TOOLSDIR_DOS%\%XDCBASE%

    rem # *************************************************************************
    rem # ** Create environment variables for XDC
    rem # *************************************************************************
    set XDCCGROOT=%LOCAL_TOOLSDIR_DOS%
    set xdc=\%LOCAL_TOOLSDIR%\%XDCBASE%\xdc.exe $*

    rem # *************************************************************************
    rem # ** Set the XDC PATH
    rem # *************************************************************************
    set XDCPATH=%LOCAL_TOOLSDIR_DOS%\%XDCBASE%\packages
    set XDCPATH=%XDCPATH%;%LOCAL_TOOLSDIR_DOS%\%XDAISBASE%\packages

    rem # *************************************************************************
    rem # ** Identify the config.bld file
    rem # *************************************************************************
    xs -f setconfig.js
    call tempcfg
    del tempcfg.bat

    rem # End of file

Linux Configuration

TBD

Compilation

To build the FIU package, ensure (again) that all packages provided with the build have been extracted to a common working directory (as described in FIU Integration). Change to the swtools directory and configure the build environment by executing the setenv.bat batch file. To build the FIU using the XDC tools, change to the FIU directory and proceed.

With the environment configured, XDC may be eployed to build the FIU and its dependent packages. The four XDC commands below are all that is needed to clean and build any of the FIU packages. The first two commands provide a means to clean and build the FIU package (alone). Nothing further is needed unless the source for a dependent packages has changed.

If the source for any of the dependent packages has changed, commands (3) and (4) below provide a mechanism to clean and build both the FIU and all dependent packages.

Note:
  1. In the above, the <WORK>/ti/mas/ path is assumed and just the sub-directories are specified (e.g., FIU).

The XDC environment provides several build options.

  1. xdc clean
    • Removes all generated FIU build files
    • Analagous to "make clean"

  2. xdc XDCARGS="c<rtarg> obj"
    • Builds the FIU for the target specified by <rtarg> (see Dependent Packages)

  3. xdc XDCARGS="c<rtarg> obj" -PD .
    • Builds the FIU as in (2) above
    • The "-PD ." option ensures that all dependent packages are built as well (if needed).

  4. xdc clean -PD .
    • Removes all generated FIU build files as in (1) above
    • Removes all generated build files for all FIU dependent packages

Make Build Process

Each MAS component that generates a library or an executable artifact creates, as part of the build process, a GNU "makefile" in its root folder. This makefile provides the list of all tools and common build utilities required for generating the respective artifacts.

For each artifact generated by the package there is an additonal target makefile kept at the destination directory of the artifact. The top-level "makefile" recursively invokes each artifact makefile as required by the component build.

Procedure

The build procedure using make rather than the XDC tools follows:

Required Tools:

  1. Cygwin tools (Windows only) (Verified with Cygwin version 1.18)
  2. Texas Instruments Codegen Tools for the target processor

Procedure:

  1. Add "cygwin/bin" to the environment PATH (Windows only)
  2. Correct the XXX_GEN_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XXX_GEN_INSTALL_DIR in the environment with the correct tools PATH.
  3. Correct the MAS_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the MAS_INSTALL_DIR in the environment to match the installation PATH.
  4. Correct the XDAIS_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XDAIS_INSTALL_DIR in the environment with the correct tools PATH.
  5. Correct the XDC_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XDC_INSTALL_DIR in the environment with the correct tools PATH.
  6. The make targets supported are:
    1. "all": Build all library and executable artifacts. For executable it recursively builds all the dependent components as well.
    2. "clean": Clean all generated object files and artifacts
    3. "cleanall": Cleans all generated artifacts of the components as well its dependent component.

Notes:
  1. If you are building C55x library (for example), correct the C55x tools path only. You can ignore other codegen tool paths.
  2. Ignore steps 4 - 5 if not using XDAIS

Linking FIU with System

The FIU and each of its dependent packages (see Dependent Packages) should be expanded (unzipped) to a common working directory (<WORK>). This will create the following directory structure under the common directory.

  <WORK>/ti/mas/asm
               /swtools
               /types
               /util
               /fiu
               /iface

Note:
  1. This directory structure and its content should be maintained to allow subsequent compilation.

Include Requirements

The following header files must be included in any source file that references the FIU API:

  1. #include <ti/mas/types/types.h>
  2. #include <ti/mas/fiu/fiu.h>
  3. #include <ti/mas/iface/ifpkt/ifpkt.h>

The compile-time option below is required such that <WORK> resides in the compiler's include path.

  1. -i <WORK>

Where WORK is the path to the working directory.

Compile Defines

When compiling source files that include RTSC package header files (e.g., fiu.h or iffax.h) the following compiler option must be specified:

  1. -Dti_targets_<xtarg>

Note:
  1. <xtarg> represents the target platform using the XDC naming convention (see Dependent Packages).

Linking

The following libraries must be included in the final link:

  1. ti\mas\util\lib\util_a.a<rtarg>
  2. ti\mas\util\lib\util_c.a<rtarg>
  3. *ti\mas\fiu\lib\fiu_c.a<rtarg>
  4. **ti\mas\fiu\lib\fiu_g3_c.a<rtarg>
** required for G3 and SG3 fax relay ** required for G3 fax relay

Target Naming Conventions
Target | RTSC Naming (<rtarg>) | XDC Naming (<xtarg>)
C55x Large Memory Model | 55l | C55_large
C64x COFF Little Endian | 64 | C64
C64x COFF Big Endian | 64e | C64_big_endian
C64x+ COFF Little Endian | 64P | C64P
C64x+ COFF Big Endian | 64Pe | C64P_big_endian
C64x+ ELF Little Endian | e64P | C64P_elf
C64x+ ELF Big Endian | e64Pe | C64P_big_endian_elf
C66x COFF Little Endian | 66 | C66
C66x COFF Big Endian | 66e | C66_big_endian
C66x+ ELF Little Endian | e66 | C66_elf
C66x+ ELF Big Endian | e66e | C66_big_endian_elf


FIU: Module Index

FIU Modules

Here is a list of all modules:
  • FIU External API
    • Return Error Codes
    • Fax Debug Mode
    • Fax Control Code
    • FIU Debug message types for debugInfo()
    • FIU Event Codes
    • Fax Switchover Reason Codes
    • Network Protocol Types
    • T30 Feature Selector Definitions
    • FIU Feature Selector Definitions
    • T.30 Protocol Call Success Bitfield


FIU: Page Index

FIU Related Pages

Here is a list of all related documentation pages:
  • C55x Data Sheet
  • C64x+ Data Sheet
  • History
  • Disclaimer


FIU: FIU Performance

FIU (Fax Interface Unit) Package

FIU Performance

  • C64x+ Data Sheet
  • C55x Data Sheet


FIU: History

History

Revision History

Version | Comments
1.0.0.0 | Initial Version


FIU: fiuContext_t Struct Reference

  • Data Structures
  • Data Fields

fiuContext_t Struct Reference
[FIU External API, FIU External API]

#include <fiu.h>

Detailed Description

The FIU software module has a global context structure that contains non channel specific configuration information which is used by all active FIU instances. FIU Context is a structure that must be declared globally by system code, and initialized prior to any calls to the FIU API.

See also:
fiuContext_t

Definition at line 98 of file fiu.h.

Data Fields

void *(* | allocBuffer )(tuint)
This is a function pointer to an externally supported routine that allocates a data buffer from a global memory pool for use by the FIU. If an external pool is unsupported, set this to NULL.
tbool(* | freeBuffer )(tuint, void *)
This is a function pointer to an externally supported routine that frees a data buffer no longer in use by FIU. The data buffer is returned to the external memory pool. If an external pool is unsupported, set this to NULL.
tuint | SupportedExternalBuffSize
This parameter determines the amount of external buffering available for use by the FIU module. DO NOT LEAVE THIS PARAMETER UNINITIALIZED. If no external buffer capability is supported, make sure to set the value to 0.
tulong(* | faxSystemTime )(void)
A callout to an externally supported system time function that returns the system time in milliseconds. This is a function pointer and must point to a valid function location who meets the API requirements.
dbgInfo_t | faxDebugTrace
A callout to the system code's debug and exception tracing function. This is a function pointer and must point to a valid function location who meets the API requirements. refer UTIL.chm.
void(* | faxCriticalSectionBegin )(void)
Callout to externally supplied system function that suspends preemption of FIU processing. This is a function pointer and must point to a valid function location who meets the API requirements.
void(* | faxCriticalSectionEnd )(void)
Callout to externally supplied system function that suspends preemption of FIU processing. This is a function pointer and must point to a valid function location who meets the API requirements.

Field Documentation

void*(* fiuContext_t::allocBuffer)(tuint)

This is a function pointer to an externally supported routine that allocates a data buffer from a global memory pool for use by the FIU. If an external pool is unsupported, set this to NULL.

tbool(* fiuContext_t::freeBuffer)(tuint, void *)

This is a function pointer to an externally supported routine that frees a data buffer no longer in use by FIU. The data buffer is returned to the external memory pool. If an external pool is unsupported, set this to NULL.

tuint fiuContext_t::SupportedExternalBuffSize

This parameter determines the amount of external buffering available for use by the FIU module. DO NOT LEAVE THIS PARAMETER UNINITIALIZED. If no external buffer capability is supported, make sure to set the value to 0.

Definition at line 122 of file fiu.h.

tulong(* fiuContext_t::faxSystemTime)(void)

A callout to an externally supported system time function that returns the system time in milliseconds. This is a function pointer and must point to a valid function location who meets the API requirements.

dbgInfo_t fiuContext_t::faxDebugTrace

A callout to the system code's debug and exception tracing function. This is a function pointer and must point to a valid function location who meets the API requirements. refer UTIL.chm.

Definition at line 135 of file fiu.h.

void(* fiuContext_t::faxCriticalSectionBegin)(void)

Callout to externally supplied system function that suspends preemption of FIU processing. This is a function pointer and must point to a valid function location who meets the API requirements.

void(* fiuContext_t::faxCriticalSectionEnd)(void)

Callout to externally supplied system function that suspends preemption of FIU processing. This is a function pointer and must point to a valid function location who meets the API requirements.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuControlConfig_t Struct Reference

  • Data Structures
  • Data Fields

fiuControlConfig_t Struct Reference
[FIU External API]

#include <fiu.h>

Collaboration diagram for fiuControlConfig_t:

[legend]

Detailed Description

Control Configuration structure.

Data structure providing configuration information in fiuControl()

Definition at line 602 of file fiu.h.

Data Fields

fiuReceiveOutSpec_t ReceiveOutSpec
tuint frameSize

Field Documentation

fiuReceiveOutSpec_t fiuControlConfig_t::ReceiveOutSpec

Address of function and associated data structure for sending data to PCM interface

Definition at line 603 of file fiu.h.

tuint fiuControlConfig_t::frameSize

Specifies PCM frame size (in msec)

Definition at line 606 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuEventHandlerSpec_t Struct Reference

  • Data Structures
  • Data Fields

fiuEventHandlerSpec_t Struct Reference
[FIU External API]

#include <fiu.h>

Detailed Description

Specification of fiuEventHandlerSpec Object This structure contains the address of function and associated data structure for reporting events to the system for processing.

Definition at line 424 of file fiu.h.

Data Fields

void(* | fiuEventHandler )(void *targetInst, tuint eventCode, tuint eventInfo)
Notifies call-processing software an event that requires action. Valid event codes and the associated event information are described by FIU Event Codes.
void * | targetInst

Field Documentation

void(* fiuEventHandlerSpec_t::fiuEventHandler)(void *targetInst, tuint eventCode, tuint eventInfo)

Notifies call-processing software an event that requires action. Valid event codes and the associated event information are described by FIU Event Codes.

void* fiuEventHandlerSpec_t::targetInst

Pointer to Target Instance

Definition at line 430 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuNSFInfo_t Struct Reference

  • Data Structures
  • Data Fields

fiuNSFInfo_t Struct Reference
[FIU External API]

#include <fiu.h>

Detailed Description

NSF Information data structure.

This structure is used to record NSF informations received from the network or local FTE.

Remarks:
Information is initialized to UNKNOWN and recorded only when a valid NSF data frame is received.

Definition at line 646 of file fiu.h.

Data Fields

tuint | NSFCountryCode
tuint | NSFManufacturer

Field Documentation

tuint fiuNSFInfo_t::NSFCountryCode

Country code octet - 0xFFFF indicates info unavail

Definition at line 647 of file fiu.h.

tuint fiuNSFInfo_t::NSFManufacturer

Manufacturer code - 0xFFFF indicates info unavail

Definition at line 648 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuNetCallTbl_t Struct Reference

  • Data Structures
  • Data Fields

fiuNetCallTbl_t Struct Reference
[FIU External API]

#include <fiu.h>

Detailed Description

FIU Protocol Call Table.

This table contains the protocol-specific call table for each supported protocol.

Definition at line 506 of file fiu.h.

Data Fields

fiuNetProtocol_e NetProtocol
tint(* | faxNetInit )(void *fndInst, void *cfg)
void(* | faxNetDecoder )(void *fndInst, xferpktInfo_t *pktInfo)
void(* | faxNetDecoderTask )(void *fndInst)
void(* | faxNetEncoder )(void *fndInst, void *msg)
void(* | faxNetEncoderTask )(void *fndInst)
void(* | faxNetClose )(void *fndInst)
void(* | faxNetReloc )(void *newRelocInstStruct, void *oldRelocInstStruct)

Field Documentation

fiuNetProtocol_e fiuNetCallTbl_t::NetProtocol

Definition at line 507 of file fiu.h.

tint(* fiuNetCallTbl_t::faxNetInit)(void *fndInst, void *cfg)

void(* fiuNetCallTbl_t::faxNetDecoder)(void *fndInst, xferpktInfo_t *pktInfo)

void(* fiuNetCallTbl_t::faxNetDecoderTask)(void *fndInst)

void(* fiuNetCallTbl_t::faxNetEncoder)(void *fndInst, void *msg)

void(* fiuNetCallTbl_t::faxNetEncoderTask)(void *fndInst)

void(* fiuNetCallTbl_t::faxNetClose)(void *fndInst)

void(* fiuNetCallTbl_t::faxNetReloc)(void *newRelocInstStruct, void *oldRelocInstStruct)

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuNewConfig_t Struct Reference

  • Data Structures
  • Data Fields

fiuNewConfig_t Struct Reference
[FIU External API]

#include <fiu.h>

Collaboration diagram for fiuNewConfig_t:

[legend]

Detailed Description

New Configuration structure.

Data structure providing configuration information in fiuNew()

Definition at line 495 of file fiu.h.

Data Fields

tuint ID
fiuSizeCfg_t SizeConfig

Field Documentation

tuint fiuNewConfig_t::ID

User specified module ID

Definition at line 496 of file fiu.h.

fiuSizeCfg_t fiuNewConfig_t::SizeConfig

FIU memory allocation structure

Definition at line 497 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuOpenConfig_t Struct Reference

  • Data Structures
  • Data Fields

fiuOpenConfig_t Struct Reference
[FIU External API]

#include <fiu.h>

Collaboration diagram for fiuOpenConfig_t:

[legend]

Detailed Description

Open Configuration structure.

Data structure providing configuration information in fiuOpen()

Definition at line 524 of file fiu.h.

Data Fields

tuint | frameSize
iffaxRate_e | MaxFaxRate
tuint | dbgMode
tuint | RtpPayloadType
tulong | RtpSyncSource
tint | HSPktPayloadSize
tint | LSPktPayloadSize
tint | LsDataRedundancy
tint | HsDataRedundancy
tuint | TCFHandlingMethod
tint | T38Version
tuint | faxNomDelay
tint | faxPacketSize
tulong | NoActivityTimerVal
tuint | AAL2cid
fiuSendOutSpec_t SendOutSpec
fiuReceiveOutSpec_t ReceiveOutSpec
fiuEventHandlerSpec_t EventHandlerSpec
tulong | StartupTimer
tuint | CleardownTimer
fiuNetCallTbl_t ** faxNetCallTblPtr
fiuNetProtocol_e NetProtocol
tulong | LocalTxNetTimeOutVal
tulong | EflagStartTimer
tulong | EflagStopTimer
tuint | T30FeatureSelector
tuint | FIUFeatureSelector
tword | NSFCountryCode
tword | NSFVendorCodeMSB
tword | NSFVendorCodeLSB

Field Documentation

tuint fiuOpenConfig_t::frameSize

Specifies PCM frame size (in msec)

Definition at line 525 of file fiu.h.

iffaxRate_e fiuOpenConfig_t::MaxFaxRate

Specifies Maximum FAX data rate

Definition at line 526 of file fiu.h.

tuint fiuOpenConfig_t::dbgMode

Specifies debug mode level

Definition at line 527 of file fiu.h.

tuint fiuOpenConfig_t::RtpPayloadType

Specifies RTP payload type (applicable to RTP only)

Definition at line 528 of file fiu.h.

tulong fiuOpenConfig_t::RtpSyncSource

Specifies RTP synchrnization source.(applicable to RTP only)

Definition at line 530 of file fiu.h.

tint fiuOpenConfig_t::HSPktPayloadSize

Specifies Fax packet Primary high-speed payload size in ms

Definition at line 532 of file fiu.h.

tint fiuOpenConfig_t::LSPktPayloadSize

Specifies Fax packet Primary low-speed payload size in bytes

Definition at line 534 of file fiu.h.

tint fiuOpenConfig_t::LsDataRedundancy

Number of data redundancy for low speed data (T.38 UDP)

Definition at line 536 of file fiu.h.

tint fiuOpenConfig_t::HsDataRedundancy

Number of data redundancy for high speed data (T.38 UDP)

Definition at line 538 of file fiu.h.

tuint fiuOpenConfig_t::TCFHandlingMethod

Specifies the TCF handling method for T.38 UDP only

Definition at line 540 of file fiu.h.

tint fiuOpenConfig_t::T38Version

Version number for T.38's ASN.1 encode/decode functionality:
0 = Version 0 (06/1998)
1 = Version 1 (No change from version 0)
2 = Version 2 (03/2002)
3 = Version 3 (05/2002)

Definition at line 542 of file fiu.h.

tuint fiuOpenConfig_t::faxNomDelay

Specifies jitter buffer delay

Definition at line 548 of file fiu.h.

tint fiuOpenConfig_t::faxPacketSize

Specifies FAX packet size

Definition at line 549 of file fiu.h.

tulong fiuOpenConfig_t::NoActivityTimerVal

No activity timeout detection

Definition at line 550 of file fiu.h.

tuint fiuOpenConfig_t::AAL2cid

channel identifier for AAL2

Definition at line 551 of file fiu.h.

fiuSendOutSpec_t fiuOpenConfig_t::SendOutSpec

Address of function and associated data structure for sending data to network

Definition at line 552 of file fiu.h.

fiuReceiveOutSpec_t fiuOpenConfig_t::ReceiveOutSpec

Address of function and associated data structure for sending data to PCM interface

Definition at line 555 of file fiu.h.

fiuEventHandlerSpec_t fiuOpenConfig_t::EventHandlerSpec

Address of function and associated data structure for reporting events

Definition at line 558 of file fiu.h.

tulong fiuOpenConfig_t::StartupTimer

Specifies the amount of time that FRP will remain in STARTUP state with no activity present before clearing down the call

Definition at line 560 of file fiu.h.

tuint fiuOpenConfig_t::CleardownTimer

Specifies the time in ms to wait after a DCN is received from the local FTE before reporting the protocol termination to the local call processing software

Definition at line 564 of file fiu.h.

fiuNetCallTbl_t** fiuOpenConfig_t::faxNetCallTblPtr

Fax network protocol call table

Definition at line 568 of file fiu.h.

fiuNetProtocol_e fiuOpenConfig_t::NetProtocol

Specifies network protocol

Definition at line 569 of file fiu.h.

tulong fiuOpenConfig_t::LocalTxNetTimeOutVal

Fax Network timeout value in ms for local transmit states

Definition at line 570 of file fiu.h.

tulong fiuOpenConfig_t::EflagStartTimer

Specifies the time in ms after which the eflags are generated recommended value is 2600 ms

Definition at line 572 of file fiu.h.

tulong fiuOpenConfig_t::EflagStopTimer

Specifies the time in ms after which the eflags are stopped recommended value is 2300 ms

Definition at line 575 of file fiu.h.

tuint fiuOpenConfig_t::T30FeatureSelector

a bitmap is used to enable or disable certain features of the fax call

Definition at line 578 of file fiu.h.

tuint fiuOpenConfig_t::FIUFeatureSelector

Bitmap used to selectively enable specific FIU features

Definition at line 581 of file fiu.h.

tword fiuOpenConfig_t::NSFCountryCode

The following 3 words specify the NSF values to be used when the fiu_FEATURE_NSF_OVERRIDE is enabled. If the feature is disabled, Telogy assigned NSF values are used. Country Code

Definition at line 589 of file fiu.h.

tword fiuOpenConfig_t::NSFVendorCodeMSB

MSB of Vendor Code

Definition at line 590 of file fiu.h.

tword fiuOpenConfig_t::NSFVendorCodeLSB

LSB of Vendor Code

Definition at line 591 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuReceiveOutSpec_t Struct Reference

  • Data Structures
  • Data Fields

fiuReceiveOutSpec_t Struct Reference
[FIU External API]

#include <fiu.h>

Detailed Description

Specification of fiuReceiveOutSpec Object.

This structure contains the address of function and associated data structure for sending pcm data to the PCM interface.

RETURN VALUE:

  • iffax_FM_CMD_ACCEPTED (0) if the message is copied into message FIFO
  • iffax_FM_CMD_NOT_ACCEPTED (1) if the message is not copied into the message FIFO because the FIFO is full
  • iffax_FM_CMD_ERROR (-1) if message is not copied because FM is closed or invalid message ID

Definition at line 466 of file fiu.h.

Data Fields

tint(* | fiuReceiveOut )(void *targetInst, void *message)
Routine called by FIU to send a message to FM for processing. The structure of the FP-to-FM messages is defined in iffax.h (refer IFFAX.chm).
void * | targetInst

Field Documentation

tint(* fiuReceiveOutSpec_t::fiuReceiveOut)(void *targetInst, void *message)

Routine called by FIU to send a message to FM for processing. The structure of the FP-to-FM messages is defined in iffax.h (refer IFFAX.chm).

void* fiuReceiveOutSpec_t::targetInst

Pointer to FIU Target Instance

Definition at line 472 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuRelocInstance_t Struct Reference

  • Data Structures
  • Data Fields

fiuRelocInstance_t Struct Reference
[FIU External API]

#include <fiu.h>

Detailed Description

FIU Relocation structure.

This structure isu sed by the FIU relocation function fiuReloc to pass pointers to the internal functions fiuReloc, frpReloc and fndReloc.

Definition at line 698 of file fiu.h.

Data Fields

void * | fiuInst
void * | frpInst
void * | fndInst

Field Documentation

void* fiuRelocInstance_t::fiuInst

Pointer to FIU instance

Definition at line 699 of file fiu.h.

void* fiuRelocInstance_t::frpInst

Pointer to FRP instance

Definition at line 700 of file fiu.h.

void* fiuRelocInstance_t::fndInst

Pointer to FND instance

Definition at line 701 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuSendOutSpec_t Struct Reference

  • Data Structures
  • Data Fields

fiuSendOutSpec_t Struct Reference
[FIU External API]

#include <fiu.h>

Detailed Description

Specification of fiuSendOutSpec Object This structure contains the address of function and associated data structure for sending FAX packets to the network.

Definition at line 438 of file fiu.h.

Data Fields

tint(* | fiuSendOut )(void *targetInst, xferpktInfo_t *pktInfo)
Routine called by FIU to send packet(s) toward the network. The return values are defined as:
  • 0 => Packet(s) processed by network;
  • 1 => Network busy, packet(s) not processed.
    .

void * | targetInst

Field Documentation

tint(* fiuSendOutSpec_t::fiuSendOut)(void *targetInst, xferpktInfo_t *pktInfo)

Routine called by FIU to send packet(s) toward the network. The return values are defined as:

  • 0 => Packet(s) processed by network;
  • 1 => Network busy, packet(s) not processed.
    .

The parameter 'targetInst' is a pointer to the module instance that processes packets formatted and transmitted by the FIU module. The parameter 'pktInfo' is of structure type xferpktInfo_t, defined in file ifpkt.h(refer IFPKT.chm)

void* fiuSendOutSpec_t::targetInst

Pointer to FIU Target Instance

Definition at line 450 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuSizeCfg_t Struct Reference

  • Data Structures
  • Data Fields

fiuSizeCfg_t Struct Reference
[FIU External API]

#include <fiu.h>

Detailed Description

FIU Size Configuration structure.

DESCRIPTION: Data structure that describes memory requirements for FIU

Definition at line 481 of file fiu.h.

Data Fields

tint | NumInternalFIUBufs
tint | NumInternalFIUOverlayBufs

Field Documentation

tint fiuSizeCfg_t::NumInternalFIUBufs

Number of internal FIU buffers for use during fax processing - to complement the GMP buffers used externally

Definition at line 482 of file fiu.h.

tint fiuSizeCfg_t::NumInternalFIUOverlayBufs

Number of internal FIU buffers to be allocated from the overlayable memory pool

Definition at line 485 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU: fiuStats_t Struct Reference

  • Data Structures
  • Data Fields

fiuStats_t Struct Reference
[FIU External API]

#include <fiu.h>

Collaboration diagram for fiuStats_t:

[legend]

Detailed Description

FIU Statistics Structure.

This structure contains the statistics provided upon request with fiuGetStats().

Definition at line 663 of file fiu.h.

Data Fields

tuint | MaxJitterBufDepth
tuint | MaxNetRxQDepth
tuint | JitterBufOverFlow
tuint | NetRxQOverFlow
tuint | RxInvalidPackets
tulong | RxOutOfSeqPacket
tulong | TxPackets
tulong | TxPacketsDropped
tulong | RxPackets
tulong | RxLostPackets
tuint | HSmodulation
tuint | NumberOfPages
tbool | ECMused
tuint | sendInQMaxDepth
tuint | RxOutQMaxDepth
tuint | MaxHSbufferUsage
tuint | sendInQOverflows
tuint | RxOutQOverflows
fiuDirection_e Direction
fiuNSFInfo_t NSFInfo
tulong | Bytes_From_Net
tulong | Bytes_To_Net
tuint | Call_Success_Bitfield

Field Documentation

tuint fiuStats_t::MaxJitterBufDepth

Maximum depth of the jitter buffer

Definition at line 664 of file fiu.h.

tuint fiuStats_t::MaxNetRxQDepth

Maximum depth of the network Rx queue

Definition at line 665 of file fiu.h.

tuint fiuStats_t::JitterBufOverFlow

Number of jitter buffer overflows (lost data)

Definition at line 666 of file fiu.h.

tuint fiuStats_t::NetRxQOverFlow

Number of NetRxQ overflows

Definition at line 667 of file fiu.h.

tuint fiuStats_t::RxInvalidPackets

Number of invalid packets received

Definition at line 668 of file fiu.h.

tulong fiuStats_t::RxOutOfSeqPacket

Number of packets dropped due to out-of-sequence

Definition at line 669 of file fiu.h.

tulong fiuStats_t::TxPackets

Total number of packets sent to the network

Definition at line 670 of file fiu.h.

tulong fiuStats_t::TxPacketsDropped

Number of FAX packets dropped due to busy network interface

Definition at line 671 of file fiu.h.

tulong fiuStats_t::RxPackets

Total number of packets received from the network

Definition at line 673 of file fiu.h.

tulong fiuStats_t::RxLostPackets

Number of lost packets

Definition at line 674 of file fiu.h.

tuint fiuStats_t::HSmodulation

specifies the most recent high-speed modulation

Definition at line 676 of file fiu.h.

tuint fiuStats_t::NumberOfPages

Identifies the number of complete pages transfered

Definition at line 677 of file fiu.h.

tbool fiuStats_t::ECMused

Indicates if ECM was used

Definition at line 678 of file fiu.h.

tuint fiuStats_t::sendInQMaxDepth

Records maximum depth of sendIn queue

Definition at line 679 of file fiu.h.

tuint fiuStats_t::RxOutQMaxDepth

Records maximum depth of receiveIn queue

Definition at line 680 of file fiu.h.

tuint fiuStats_t::MaxHSbufferUsage

Record maximum usage of high-speed buffers

Definition at line 681 of file fiu.h.

tuint fiuStats_t::sendInQOverflows

Counts number of sendIn queue overflows

Definition at line 682 of file fiu.h.

tuint fiuStats_t::RxOutQOverflows

Counts number of receiveOut queue overflows

Definition at line 683 of file fiu.h.

fiuDirection_e fiuStats_t::Direction

Identifies whether local FTE is ORG or DEST

Definition at line 684 of file fiu.h.

fiuNSFInfo_t fiuStats_t::NSFInfo

Record received NSF data

Definition at line 685 of file fiu.h.

tulong fiuStats_t::Bytes_From_Net

Packet bytes received from the network

Definition at line 686 of file fiu.h.

tulong fiuStats_t::Bytes_To_Net

Packet bytes sent toward the network

Definition at line 687 of file fiu.h.

tuint fiuStats_t::Call_Success_Bitfield

Call compltetion information

Definition at line 688 of file fiu.h.

The documentation for this struct was generated from the following file:
  • fiu.h


FIU Test: Data Structures

  • Data Structures
  • Data Fields

FIU Test Data Structures

Here are the data structures with brief descriptions:
siuInst_s


FIU Test: Unit Test Configuration and Execution

Unit Test Configuration and Execution

  1. Run the simulation to completion.
  2. You should see all the T.30 Msg exchanged between two gateways.


FIU Test: doxygen.h File Reference

  • File List
  • Globals

doxygen.h File Reference

Go to the source code of this file.


FIU Test: doxygen.h Source File

  • File List
  • Globals

doxygen.h

Go to the documentation of this file.
00001 /*
00002  * This is a little header file which doxygen parses to generate the main
00003  * documentation page
00004  */
00005


FIU Test: File Index

  • File List
  • Globals

FIU Test File List

Here is a list of all files with brief descriptions:
doxygen.h [code]
fiuDebugTraceParser.c [code]
fiusim.c [code]
fiusim.h [code]


FIU Test: fiuDebugTraceParser.c File Reference

  • File List
  • Globals

fiuDebugTraceParser.c File Reference

#include <string.h>
#include <stdio.h>
#include <ti/mas/types/types.h>
#include <ti/mas/fiu/src/frtrace.h>
#include <ti/mas/fiu/src/frp/frp.h>
#include <ti/mas/fiu/src/frp/frploc.h>
#include <ti/mas/fiu/src/frp/frpt30.h>
#include <ti/mas/fiu/src/fnd/fndt38.h>
#include <ti/mas/fiu/src/fnd/fndfrf11.h>
#include <ti/mas/fiu/src/fnd/fndaal2.h>
#include <ti/mas/fiu/src/fnd/fndt2.h>

Include dependency graph for fiuDebugTraceParser.c:

Go to the source code of this file.

Functions

void | fiuDebugGetNetProtocol (int msgData, char *string)
void | fiuDebugGetFRPState (int msgData, char *string)
void | fiuDebugGetFCF (int msgData, char *string)
void | fiuDebugGetFCF2 (int msgData, char *string)
void | fiuDebugGetIFPHeader (int msgData, char *string)
void | fiuDebugGetPT (int msgData, char *string)
void | fiuDebugGetFRF11PacketType (int msgData, char *string)
void | fiuDebugGetFRF11DecoderState (int msgData, char *string)
void | fiuDebugGetAAL2PacketType (int msgData, char *string)
void | fiuDebugGetAAL2DecoderState (int msgData, char *string)
void | fiuDebugGetT38UDecoderState (int msgData, char *string)
void | fiuDebugGetT38UException (int msgData, char *string)
void | fiuDebugGetSLPPageMode (int msgData, char *string)
void | fiuDebugGetToneId (int msgData, char *string)
void | fiuDebugGetMDEvent (int msgData, char *string)
void | fiuDebugGetNetEvent (int msgData, char *string)
void | fiuDebugGetFRP2FNDMsg (int msgData, char *string)
void | fiuDebugGetTimerEvent (int msgData, char *string)
void | fiuDebugGetT2PLineState (int msgData, char *string)
void | fiuDebugGetT2PDecoderState (int msgData, char *string)
void | fiuDebugGetSwitchoverReason (int msgData, char *string)
void | fiuDebugGetCleardownReason (int msgData, char *string)
int | fiuDebugTraceParser (int msgId, int msgData, char *dstPtr)

Variables

char | fiuMsgString [40]

Function Documentation

void fiuDebugGetNetProtocol | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 85 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetFRPState | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 127 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetFCF | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 197 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetFCF2 | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 308 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetIFPHeader | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 346 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetPT | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 506 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetFRF11PacketType | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 668 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetFRF11DecoderState | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 702 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetAAL2PacketType | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 724 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetAAL2DecoderState | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 762 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetT38UDecoderState | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 788 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetT38UException | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 826 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetSLPPageMode | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 852 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetToneId | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 918 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetMDEvent | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 940 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetNetEvent | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 1030 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetFRP2FNDMsg | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 1108 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetTimerEvent | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 1202 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetT2PLineState | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 1248 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetT2PDecoderState | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 1278 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetSwitchoverReason | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 1300 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

void fiuDebugGetCleardownReason | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 1334 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().

int fiuDebugTraceParser | ( | int | msgId,
 |  | int | msgData,
 |  | char * | dstPtr
 | ) |  |

Definition at line 1368 of file fiuDebugTraceParser.c.

References fiuDebugGetAAL2DecoderState(), fiuDebugGetAAL2PacketType(), fiuDebugGetCleardownReason(), fiuDebugGetFCF(), fiuDebugGetFCF2(), fiuDebugGetFRF11DecoderState(), fiuDebugGetFRF11PacketType(), fiuDebugGetFRP2FNDMsg(), fiuDebugGetFRPState(), fiuDebugGetIFPHeader(), fiuDebugGetMDEvent(), fiuDebugGetNetEvent(), fiuDebugGetNetProtocol(), fiuDebugGetPT(), fiuDebugGetSLPPageMode(), fiuDebugGetSwitchoverReason(), fiuDebugGetT2PDecoderState(), fiuDebugGetT2PLineState(), fiuDebugGetT38UDecoderState(), fiuDebugGetT38UException(), fiuDebugGetTimerEvent(), fiuDebugGetToneId(), and fiuMsgString.

Referenced by siuDebugInfo().

Here is the call graph for this function:

Variable Documentation

char fiuMsgString[40]

Definition at line 83 of file fiuDebugTraceParser.c.

Referenced by fiuDebugTraceParser().


FIU Test: fiuDebugTraceParser.c Source File

  • File List
  • Globals

fiuDebugTraceParser.c

Go to the documentation of this file.
00001 /******************************************************************************
00002  * FILE PURPOSE: Parser for FIU debug traces
00003  ******************************************************************************
00004  * FILE NAME: fiuDebugTraceParser.c
00005  *
00006  * DESCRIPTION:
00007  *
00008  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00009  *
00010  *              All rights reserved not granted herein.
00011  *
00012  *                         Limited License.
00013  *
00014  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00015  *  non-exclusive license under copyrights and patents it now or hereafter owns
00016  *  or controls to make, have made, use, import, offer to sell and sell
00017  *  ("Utilize") this software subject to the terms herein.  With respect to the
00018  *  foregoing patent license, such license is granted solely to the extent that
00019  *  any such patent is necessary to Utilize the software alone.  The patent
00020  *  license shall not apply to any combinations which include this software,
00021  *  other than combinations with devices manufactured by or for TI (“TI
00022  *  Devices”).  No hardware patent is licensed hereunder.
00023  *
00024  *  Redistributions must preserve existing copyright notices and reproduce this
00025  *  license (including the above copyright notice and the disclaimer and (if
00026  *  applicable) source code license limitations below) in the documentation
00027  *  and/or other materials provided with the distribution
00028  *
00029  *  Redistribution and use in binary form, without modification, are permitted
00030  *  provided that the following conditions are met:
00031  *
00032  *    *  No reverse engineering, decompilation, or disassembly of this software
00033  *  is permitted with respect to any software provided in binary form.
00034  *
00035  *    *  any redistribution and use are licensed by TI for use only with TI
00036  *  Devices.
00037  *
00038  *    *  Nothing shall obligate TI to provide you with source code for the
00039  *  software licensed and provided to you in object code.
00040  *
00041  *  If software source code is provided to you, modification and redistribution
00042  *  of the source code are permitted provided that the following conditions are
00043  *  met:
00044  *
00045  *    *  any redistribution and use of the source code, including any resulting
00046  *  derivative works, are licensed by TI for use only with TI Devices.
00047  *
00048  *    *  any redistribution and use of any object code compiled from the source
00049  *  code and any resulting derivative works, are licensed by TI for use only
00050  *  with TI Devices.
00051  *
00052  *  Neither the name of Texas Instruments Incorporated nor the names of its
00053  *  suppliers may be used to endorse or promote products derived from this
00054  *  software without specific prior written permission.
00055  *
00056  *  DISCLAIMER.
00057  *
00058  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00059  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00060  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00061  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00062  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00063  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00064  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00065  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00066  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00067  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00068  *  DAMAGE.
00069  *****************************************************************************/
00070
00071 #include <string.h>
00072 #include <stdio.h>
00073 #include <ti/mas/types/types.h>
00074 #include <ti/mas/fiu/src/frtrace.h>
00075 #include <ti/mas/fiu/src/frp/frp.h>
00076 #include <ti/mas/fiu/src/frp/frploc.h>
00077 #include <ti/mas/fiu/src/frp/frpt30.h>
00078 #include <ti/mas/fiu/src/fnd/fndt38.h>
00079 #include <ti/mas/fiu/src/fnd/fndfrf11.h>
00080 #include <ti/mas/fiu/src/fnd/fndaal2.h>
00081 #include <ti/mas/fiu/src/fnd/fndt2.h>
00082
00083 char fiuMsgString[40];
00084
00085 void fiuDebugGetNetProtocol (int msgData, char *string)
00086 {
00087    switch (msgData)
00088    {
00089       case fiu_PT_T2:
00090          sprintf (string, "Telogy-2");
00091          break;
00092
00093       case fiu_PT_T3:
00094          sprintf (string, "Telogy-3");
00095          break;
00096
00097       case fiu_PT_FRF11:
00098          sprintf (string, "FRF.11");
00099          break;
00100
00101       case fiu_PT_RTP:
00102          sprintf (string, "RTP");
00103          break;
00104
00105       case fiu_PT_T38_UDPTL:
00106          sprintf (string, "T.38 UDPTL");
00107          break;
00108
00109       case fiu_PT_T38_UDPTL_RTP:
00110          sprintf (string, "T.38 UDPTL RTP");
00111          break;
00112
00113       case fiu_PT_T38_RTP:
00114          sprintf (string, "T.38 RTP");
00115          break;
00116
00117       case fiu_PT_AAL2:
00118          sprintf (string, "AAL2");
00119          break;
00120
00121       case fiu_PT_RTPB:
00122          sprintf (string, "RTP version B");
00123          break;
00124    }
00125 } /* fiuDebugGetNetProtocol() */
00126
00127 void fiuDebugGetFRPState (int msgData, char *string)
00128 {
00129    switch (msgData)
00130    {
00131       case FRP_SWITCH_OUT:
00132          sprintf (string, "switch out");
00133          break;
00134
00135       case FRP_IDLE:
00136          sprintf (string, "idle");
00137          break;
00138
00139       case FRP_EFLAG_GEN:
00140          sprintf (string, "eflag");
00141          break;
00142
00143       case FRP_LOCAL_LS_RX:
00144          sprintf (string, "local low-speed receive");
00145          break;
00146
00147       case FRP_LOCAL_HS_RX:
00148          sprintf (string, "local high-speed receive");
00149          break;
00150
00151       case FRP_LOCAL_TCF_RX:
00152          sprintf (string, "local TCF receive");
00153          break;
00154
00155       case FRP_REMOTE_LS_RX:
00156          sprintf (string, "remote low-speed receive");
00157          break;
00158
00159       case FRP_REMOTE_HS_RX:
00160          sprintf (string, "remote high-speed receive");
00161          break;
00162
00163       case FRP_REMOTE_TCF_RX:
00164          sprintf (string, "remote TCF receive");
00165          break;
00166
00167       case FRP_SWITCH_OUT_PENDING:
00168          sprintf (string, "switch out pending");
00169          break;
00170
00171       case FRP_STARTUP:
00172          sprintf (string, "startup");
00173          break;
00174
00175       case FRP_V34_CTRL_IDLE:
00176          sprintf (string, "V.34 control idle");
00177          break;
00178
00179       case FRP_V34_CTRL_TX_DATA:
00180          sprintf (string, "V.34 control tx data");
00181          break;
00182
00183       case FRP_V34_CTRL_RX_DATA:
00184          sprintf (string, "V.34 control rx data");
00185          break;
00186
00187       case FRP_V34_PRI_TX:
00188          sprintf (string, "V.34 primary tx");
00189          break;
00190
00191       case FRP_V34_PRI_RX:
00192          sprintf (string, "V.34 primary rx");
00193          break;
00194    }
00195 } /* fiuDebugGetFRPState() */
00196
00197 void fiuDebugGetFCF (int msgData, char *string)
00198 {
00199    switch (msgData & 0x7F)
00200    {
00201       case FRP_FCF_DIS:
00202          if ((msgData & 0x80) == 0)
00203             sprintf (string, "DIS (0x%X)", msgData);
00204          else
00205             sprintf (string, "DTC (0x%X)", msgData);
00206          break;
00207
00208       case FRP_FCF_CSI:
00209          if ((msgData & 0x80) == 0)
00210             sprintf (string, "CSI (0x%X)", msgData);
00211          else
00212             sprintf (string, "CIG (0x%X)", msgData);
00213          break;
00214
00215       case FRP_FCF_NSF:
00216          if ((msgData & 0x80) == 0)
00217             sprintf (string, "NSF (0x%X)", msgData);
00218          else
00219             sprintf (string, "NSC (0x%X)", msgData);
00220          break;
00221
00222       case FRP_FCF_DCS:
00223          sprintf (string, "DCS (0x%X)", msgData);
00224          break;
00225
00226       case FRP_FCF_TSI:
00227          sprintf (string, "TSI (0x%X)", msgData);
00228          break;
00229
00230       case FRP_FCF_NSS:
00231          sprintf (string, "NSS (0x%X)", msgData);
00232          break;
00233
00234       case FRP_FCF_CTC:
00235          sprintf (string, "CTC (0x%X)", msgData);
00236          break;
00237
00238       case FRP_FCF_EOM:
00239          sprintf (string, "EOM (0x%X)", msgData);
00240          break;
00241
00242       case FRP_FCF_MPS:
00243          sprintf (string, "MPS (0x%X)", msgData);
00244          break;
00245
00246       case FRP_FCF_EOP:
00247          sprintf (string, "EOP (0x%X)", msgData);
00248          break;
00249
00250       case FRP_FCF_PPS:
00251          sprintf (string, "PPS (0x%X)", msgData);
00252          break;
00253
00254       case FRP_FCF_EOR:
00255          sprintf (string, "EOR (0x%X)", msgData);
00256          break;
00257
00258       case FRP_FCF_RR:
00259          sprintf (string, "RR (0x%X)", msgData);
00260          break;
00261
00262       case FRP_FCF_RNR:
00263          sprintf (string, "RNR (0x%X)", msgData);
00264          break;
00265
00266       case FRP_FCF_ERR:
00267          sprintf (string, "ERR (0x%X)", msgData);
00268          break;
00269
00270       case FRP_FCF_DCN:
00271          sprintf (string, "DCN (0x%X)", msgData);
00272          break;
00273
00274       case FRP_FCF_FTT:
00275          sprintf (string, "FTT (0x%X)", msgData);
00276          break;
00277
00278       case FRP_FCF_CRP:
00279          sprintf (string, "CRP (0x%X)", msgData);
00280          break;
00281
00282       case FRP_FCF_MCF:
00283          sprintf (string, "MCF (0x%X)", msgData);
00284          break;
00285
00286       case FRP_FCF_RTN:
00287          sprintf (string, "RTN (0x%X)", msgData);
00288          break;
00289
00290       case FRP_FCF_RTP:
00291          sprintf (string, "RTP (0x%X)", msgData);
00292          break;
00293
00294       case FRP_FCF_PPR:
00295          sprintf (string, "PPR (0x%X)", msgData);
00296          break;
00297
00298       case FRP_FCF_CFR:
00299          sprintf (string, "CFR (0x%X)", msgData);
00300          break;
00301
00302       default:
00303          sprintf (string, "unknown (0x%X)", msgData);
00304          break;
00305    }
00306 } /* fiuDebugGetFCF() */
00307
00308 void fiuDebugGetFCF2 (int msgData, char *string)
00309 {
00310    switch (msgData)
00311    {
00312       case FRP_FCF2_NULL:
00313          sprintf (string, "NULL - no supplementary data (0x%X)", msgData);
00314          break;
00315
00316       case FRP_FCF2_EOM:
00317          sprintf (string, "EOM - another doc next (0x%X)", msgData);
00318          break;
00319
00320       case FRP_FCF2_MPS:
00321          sprintf (string, "MPS - another page of same doc next (0x%X)", msgData);
00322          break;
00323
00324       case FRP_FCF2_EOP:
00325          sprintf (string, "EOP - no more pages/docs (0x%X)", msgData);
00326          break;
00327
00328       case FRP_FCF2_PRI_EOM:
00329          sprintf (string, "PRI EOM - another doc next, procedure int (0x%X)", msgData);
00330          break;
00331
00332       case FRP_FCF2_PRI_MPS:
00333          sprintf (string, "PRI MPS - another page of same doc next, procedure int (0x%X)", msgData);
00334          break;
00335
00336       case FRP_FCF2_PRI_EOP:
00337          sprintf (string, "PRI EOP - no more pages/docs, procedure int (0x%X)", msgData);
00338          break;
00339
00340       default:
00341          sprintf (string, "unknown (0x%X)", msgData);
00342          break;
00343    }
00344 } /* fiuDebugGetFCF2() */
00345
00346 void fiuDebugGetIFPHeader (int msgData, char *string)
00347 {
00348    if ((msgData & FND_T38U_DATA_MESSAGE_IND) == 0)
00349    {
00350       /* indicator message */
00351       switch (msgData)
00352       {
00353          case FND_T38U_T30MSG_NO_SIGNAL_MOD:
00354             sprintf (string, "no signal ind");
00355             break;
00356
00357          case FND_T38U_T30MSG_CNG_MOD:
00358             sprintf (string, "CNG ind");
00359             break;
00360
00361          case FND_T38U_T30MSG_CED_MOD:
00362             sprintf (string, "CED ind");
00363             break;
00364
00365          case FND_T38U_T30MSG_V21_PREAMBLE_MOD:
00366             sprintf (string, "V.21 preamble ind");
00367             break;
00368
00369          case FND_T38U_T30MSG_V27_2400_MOD:
00370             sprintf (string, "V.27 2400bps ind");
00371             break;
00372
00373          case FND_T38U_T30MSG_V27_4800_MOD:
00374             sprintf (string, "V.27 4800bps ind");
00375             break;
00376
00377          case FND_T38U_T30MSG_V29_7200_MOD:
00378             sprintf (string, "V.29 7200bps ind");
00379             break;
00380
00381          case FND_T38U_T30MSG_V29_9600_MOD:
00382             sprintf (string, "V.29 9600bps ind");
00383             break;
00384
00385          case FND_T38U_T30MSG_V17_7200_S_MOD:
00386             sprintf (string, "V.17 7200bps - short training ind");
00387             break;
00388
00389          case FND_T38U_T30MSG_V17_7200_L_MOD:
00390             sprintf (string, "V.17 7200bps - long training ind");
00391             break;
00392
00393          case FND_T38U_T30MSG_V17_9600_S_MOD:
00394             sprintf (string, "V.17 9600bps - short training ind");
00395             break;
00396
00397          case FND_T38U_T30MSG_V17_9600_L_MOD:
00398             sprintf (string, "V.17 9600bps - long training ind");
00399             break;
00400
00401          case FND_T38U_T30MSG_V17_12000_S_MOD:
00402             sprintf (string, "V.17 12000bps - short training ind");
00403             break;
00404
00405          case FND_T38U_T30MSG_V17_12000_L_MOD:
00406             sprintf (string, "V.17 12000bps - long training ind");
00407             break;
00408
00409          case FND_T38U_T30MSG_V17_14400_S_MOD:
00410             sprintf (string, "V.17 14400bps - short training ind");
00411             break;
00412
00413          case FND_T38U_T30MSG_V17_14400_L_MOD:
00414             sprintf (string, "V.17 14400bps - long training ind");
00415             break;
00416
00417          case FND_T38U_T30MSG_EXT_V8_ANSAM_SIG_MOD:
00418             sprintf (string, "V.8 ANSam ind");
00419             break;
00420
00421          case FND_T38U_T30MSG_EXT_V8_SIGNAL_MOD:
00422             sprintf (string, "V.8 signal ind");
00423             break;
00424
00425          case FND_T38U_T30MSG_EXT_V34_CTRL_CH_1200_MOD:
00426             sprintf (string, "V.34 control channel 1200bps ind");
00427             break;
00428
00429          case FND_T38U_T30MSG_EXT_V34_PRI_CH_MOD:
00430             sprintf (string, "V.34 primary channel ind");
00431             break;
00432
00433          case FND_T38U_T30MSG_EXT_V34_CC_RETRAIN_MOD:
00434             sprintf (string, "V.34 control channel retrain ind");
00435             break;
00436
00437          default:
00438             sprintf (string, "unknown (0x%X)", msgData);
00439             break;
00440       }
00441    }
00442    else
00443    {
00444       /* data message */
00445       switch (msgData & 0x3fff)
00446       {
00447          case FND_T38U_DATA_V21_DT:
00448             sprintf (string, "V.21 data");
00449             break;
00450
00451          case FND_T38U_DATA_V27_2400_DT:
00452             sprintf (string, "V.27 2400bps data");
00453             break;
00454
00455          case FND_T38U_DATA_V27_4800_DT:
00456             sprintf (string, "V.27 4800bps data");
00457             break;
00458
00459          case FND_T38U_DATA_V29_7200_DT:
00460             sprintf (string, "V.29 7200bps data");
00461             break;
00462
00463          case FND_T38U_DATA_V29_9600_DT:
00464             sprintf (string, "V.29 9600bps data");
00465             break;
00466
00467          case FND_T38U_DATA_V17_7200_DT:
00468             sprintf (string, "V.17 7200bps data");
00469             break;
00470
00471          case FND_T38U_DATA_V17_9600_DT:
00472             sprintf (string, "V.17 9600bps data");
00473             break;
00474
00475          case FND_T38U_DATA_V17_12000_DT:
00476             sprintf (string, "V.17 12000bps data");
00477             break;
00478
00479          case FND_T38U_DATA_V17_14400_DT:
00480             sprintf (string, "V.17 14400bps data");
00481             break;
00482
00483          case FND_T38U_DATA_EXT_V8_DT:
00484             sprintf (string, "V.8 data");
00485             break;
00486
00487          case FND_T38U_DATA_EXT_V34_PRI_RATE_DT:
00488             sprintf (string, "V.34 primary rate data");
00489             break;
00490
00491          case FND_T38U_DATA_EXT_V34_CC_1200_DT:
00492             sprintf (string, "V.34 control channel 1200bps data");
00493             break;
00494
00495          case FND_T38U_DATA_EXT_V34_PRI_CH_DT:
00496             sprintf (string, "V.34 primary channel data");
00497             break;
00498
00499          default:
00500             sprintf (string, "unknown (0x%X)", msgData);
00501             break;
00502       }
00503    }
00504 } /* fiuDebugGetIFPHeader() */
00505
00506 void fiuDebugGetPT (int msgData, char *string)
00507 {
00508    switch (msgData)
00509    {
00510       case FND_T38U_T30IND_NO_SIGNAL_PT:
00511          sprintf (string, "no signal ind");
00512          break;
00513
00514       case FND_T38U_T30IND_PREAMBLE_PT:
00515          sprintf (string, "preamble ind");
00516          break;
00517
00518       case FND_T38U_T30IND_CED_PT:
00519          sprintf (string, "CED ind");
00520          break;
00521
00522       case FND_T38U_T30IND_CNG_PT:
00523          sprintf (string, "CNG ind");
00524          break;
00525
00526       case FND_T38U_T30IND_V17_7200_STRAIN_PT:
00527          sprintf (string, "V.17 7200bps - short training ind");
00528          break;
00529
00530       case FND_T38U_T30IND_V17_7200_LTRAIN_PT:
00531          sprintf (string, "V.17 7200bps - long training ind");
00532          break;
00533
00534       case FND_T38U_T30IND_V17_9600_STRAIN_PT:
00535          sprintf (string, "V.17 9600bps - short training ind");
00536          break;
00537
00538       case FND_T38U_T30IND_V17_9600_LTRAIN_PT:
00539          sprintf (string, "V.17 9600bps - long training ind");
00540          break;
00541
00542       case FND_T38U_T30IND_V17_12000_STRAIN_PT:
00543          sprintf (string, "V.17 12000bps - short training ind");
00544          break;
00545
00546       case FND_T38U_T30IND_V17_12000_LTRAIN_PT:
00547          sprintf (string, "V.17 12000bps - long training ind");
00548          break;
00549
00550       case FND_T38U_T30IND_V17_14400_STRAIN_PT:
00551          sprintf (string, "V.17 14400bps - short training ind");
00552          break;
00553
00554       case FND_T38U_T30IND_V17_14400_LTRAIN_PT:
00555          sprintf (string, "V.17 14400bps - long training ind");
00556          break;
00557
00558       case FND_T38U_T30IND_V29_9600_TRAIN_PT:
00559          sprintf (string, "V.29 9600bps ind");
00560          break;
00561
00562       case FND_T38U_T30IND_V29_7200_TRAIN_PT:
00563          sprintf (string, "V.29 7200bps ind");
00564          break;
00565
00566       case FND_T38U_T30IND_V27_4800_TRAIN_PT:
00567          sprintf (string, "V.27 4800bps ind");
00568          break;
00569
00570       case FND_T38U_T30IND_V27_2400_TRAIN_PT:
00571          sprintf (string, "V.27 2400bps ind");
00572          break;
00573
00574       case FND_T38U_T30IND_V8_ANSAM_PT:
00575          sprintf (string, "V.8 ANSam ind");
00576          break;
00577
00578       case FND_T38U_T30IND_V8_SIGNAL_PT:
00579          sprintf (string, "V.8 signal ind");
00580          break;
00581
00582       case FND_T38U_T30IND_V34_CC_1200_PT:
00583          sprintf (string, "V.34 control channel 1200bps ind");
00584          break;
00585
00586       case FND_T38U_T30IND_V34_PRI_CH_PT:
00587          sprintf (string, "V.34 primary channel ind");
00588          break;
00589
00590       case FND_T38U_T30IND_V34_CC_RETRAIN_PT:
00591          sprintf (string, "V.34 control channel retrain ind");
00592          break;
00593
00594       case FND_T38U_DATA_V21_PT:
00595          sprintf (string, "V.21 data");
00596          break;
00597
00598       case FND_T38U_DATA_V17_7200_PT:
00599          sprintf (string, "V.17 7200bps data");
00600          break;
00601
00602       case FND_T38U_DATA_V17_9600_PT:
00603          sprintf (string, "V.17 9600bps data");
00604          break;
00605
00606       case FND_T38U_DATA_V17_12000_PT:
00607          sprintf (string, "V.17 12000bps data");
00608          break;
00609
00610       case FND_T38U_DATA_V17_14400_PT:
00611          sprintf (string, "V.17 14400bps data");
00612          break;
00613
00614       case FND_T38U_DATA_V29_7200_PT:
00615          sprintf (string, "V.29 7200bps data");
00616          break;
00617
00618       case FND_T38U_DATA_V29_9600_PT:
00619          sprintf (string, "V.29 9600bps data");
00620          break;
00621
00622       case FND_T38U_DATA_V27_2400_PT:
00623          sprintf (string, "V.27 2400bps data");
00624          break;
00625
00626       case FND_T38U_DATA_V27_4800_PT:
00627          sprintf (string, "V.27 4800bps data");
00628          break;
00629
00630       case FND_T38U_DATA_V8_PT:
00631          sprintf (string, "V.8 data");
00632          break;
00633
00634       case FND_T38U_DATA_V34_PRI_RATE_PT:
00635          sprintf (string, "V.34 primary rate data");
00636          break;
00637
00638       case FND_T38U_DATA_V34_CC_1200_PT:
00639          sprintf (string, "V.34 control channel 1200bps data");
00640          break;
00641
00642       case FND_T38U_DATA_V34_PRI_CH_PT:
00643          sprintf (string, "V.34 primary channel data");
00644          break;
00645
00646       case FND_T38U_RX_INVALID_PKT_PT:
00647          sprintf (string, "Rx invalid packet");
00648          break;
00649
00650       case FND_T38U_RX_PKT_ERROR_PT:
00651          sprintf (string, "Rx packet error");
00652          break;
00653
00654       case FND_T38U_RX_QE_EMPTY:
00655          sprintf (string, "Rx queue empty");
00656          break;
00657
00658       case FND_T38U_RX_QE_BUSY:
00659          sprintf (string, "Rx queue busy");
00660          break;
00661
00662       default:
00663          sprintf (string, "unknown (0x%X)", msgData);
00664          break;
00665    }
00666 } /* fiuDebugGetPT() */
00667
00668 void fiuDebugGetFRF11PacketType (int msgData, char *string)
00669 {
00670    switch (msgData)
00671    {
00672       case FRF11_PKT_TYPE_MOD_OFF:
00673          sprintf (string, "modulation off", msgData);
00674          break;
00675
00676       case FRF11_PKT_TYPE_MOD_ON:
00677          sprintf (string, "modulation on", msgData);
00678          break;
00679
00680       case FRF11_PKT_TYPE_T30_DATA:
00681          sprintf (string, "T.30 data", msgData);
00682          break;
00683
00684       case FRF11_PKT_TYPE_T30_EOF_GOOD:
00685          sprintf (string, "T.30 EOF - good", msgData);
00686          break;
00687
00688       case FRF11_PKT_TYPE_T30_EOF_ABORT:
00689          sprintf (string, "T.30 EOF - abort", msgData);
00690          break;
00691
00692       case FRF11_PKT_TYPE_T4_DATA:
00693          sprintf (string, "T.4 data", msgData);
00694          break;
00695
00696       default:
00697          sprintf (string, "unknown (0x%X)", msgData);
00698          break;
00699    }
00700 } /* fiuDebugGetFRF11PacketType() */
00701
00702 void fiuDebugGetFRF11DecoderState (int msgData, char *string)
00703 {
00704    switch (msgData)
00705    {
00706       case FRF11_RX_TRANSP:
00707          sprintf (string, "transparent");
00708          break;
00709
00710       case FRF11_RX_LSD:
00711          sprintf (string, "low-speed data");
00712          break;
00713
00714       case FRF11_RX_HSD:
00715          sprintf (string, "high-speed data");
00716          break;
00717
00718       case FRF11_IDLE_SYNC:
00719          sprintf (string, "idle resynchronization");
00720          break;
00721    }
00722 } /* fiuDebugGetFRF11DecoderState() */
00723
00724 void fiuDebugGetAAL2PacketType (int msgData, char *string)
00725 {
00726    switch (msgData)
00727    {
00728       case FND_AAL2_PKT_TYPE_IDLE:
00729          sprintf (string, "idle", msgData);
00730          break;
00731
00732       case FND_AAL2_PKT_TYPE_PREAMBLE:
00733          sprintf (string, "preamble", msgData);
00734          break;
00735
00736       case FND_AAL2_PKT_TYPE_EPT:
00737          sprintf (string, "EPT", msgData);
00738          break;
00739
00740       case FND_AAL2_PKT_TYPE_T30_DATA:
00741          sprintf (string, "T.30 data", msgData);
00742          break;
00743
00744       case FND_AAL2_PKT_TYPE_TRAINING:
00745          sprintf (string, "training", msgData);
00746          break;
00747
00748       case FND_AAL2_PKT_TYPE_T4_DATA:
00749          sprintf (string, "T.4 data", msgData);
00750          break;
00751
00752       case FND_AAL2_PKT_TYPE_INVALID:
00753          sprintf (string, "invalid", msgData);
00754          break;
00755
00756       default:
00757          sprintf (string, "unknown (0x%X)", msgData);
00758          break;
00759    }
00760 } /* fiuDebugGetAAL2PacketType() */
00761
00762 void fiuDebugGetAAL2DecoderState (int msgData, char *string)
00763 {
00764    switch (msgData)
00765    {
00766       case FND_AAL2_RX_STARTUP:
00767          sprintf (string, "startup");
00768          break;
00769
00770       case FND_AAL2_RX_TRANSP:
00771          sprintf (string, "transparent");
00772          break;
00773
00774       case FND_AAL2_RX_LSD:
00775          sprintf (string, "low-speed data");
00776          break;
00777
00778       case FND_AAL2_RX_HSD:
00779          sprintf (string, "high-speed data");
00780          break;
00781
00782       case FND_AAL2_IDLE_SYNC:
00783          sprintf (string, "idle resynchronization");
00784          break;
00785    }
00786 } /* fiuDebugGetAAL2DecoderState() */
00787
00788 void fiuDebugGetT38UDecoderState (int msgData, char *string)
00789 {
00790    switch (msgData)
00791    {
00792       case FND_T38U_DECODER_ST_TRANSP:
00793          sprintf (string, "transparent");
00794          break;
00795
00796       case FND_T38U_DECODER_ST_LSD:
00797          sprintf (string, "low-speed data");
00798          break;
00799
00800       case FND_T38U_DECODER_ST_HSD:
00801          sprintf (string, "high-speed data");
00802          break;
00803
00804       case FND_T38U_DECODER_ST_RESYNC:
00805          sprintf (string, "resynchronization");
00806          break;
00807
00808       case FND_T38U_DECODER_ST_STARTUP:
00809          sprintf (string, "startup");
00810          break;
00811
00812       case FND_T38U_DECODER_ST_V34_CTRL_IDLE:
00813          sprintf (string, "V.34 control idle");
00814          break;
00815
00816       case FND_T38U_DECODER_ST_V34_CTRL_DATA:
00817          sprintf (string, "V.34 control data");
00818          break;
00819
00820       case FND_T38U_DECODER_ST_V34_PRI_RX:
00821          sprintf (string, "V.34 primary receive");
00822          break;
00823    }
00824 } /* fiuDebugGetT38UDecoderState() */
00825
00826 void fiuDebugGetT38UException (int msgData, char *string)
00827 {
00828    switch (msgData)
00829    {
00830       case FND_T38U_EXC_INIT:
00831          sprintf (string, "init");
00832          break;
00833
00834       case FND_T38U_EXC_ENC_IFP_INVALID:
00835          sprintf (string, "encoder IFP invalid");
00836          break;
00837
00838       case FND_T38U_EXC_ENC_DF_NULL:
00839          sprintf (string, "encoder DF null");
00840          break;
00841
00842       case FND_T38U_EXC_ENC_TASK_IFP_INVALID:
00843          sprintf (string, "encoder task IFP invalid");
00844          break;
00845
00846       case FND_T38U_EXC_ENC_TASK_DF_NULL:
00847          sprintf (string, "encoder task DF null");
00848          break;
00849    }
00850 } /* fiuDebugGetT38UException() */
00851
00852 void fiuDebugGetSLPPageMode (int msgData, char *string)
00853 {
00854    switch (msgData)
00855    {
00856       case fiu_SLP_MODE_UNKNOWN:
00857          sprintf (string, "unknown");
00858          break;
00859
00860       case fiu_SLP_MODE_TRANS:
00861          sprintf (string, "transparent");
00862          break;
00863
00864       case fiu_SLP_MODE_TCF:
00865          sprintf (string, "TCF");
00866          break;
00867
00868       case fiu_SLP_MODE_MR_1728:
00869          sprintf (string, "MR 1728");
00870          break;
00871
00872       case fiu_SLP_MODE_MR_2048:
00873          sprintf (string, "MR 2048");
00874          break;
00875
00876       case fiu_SLP_MODE_MR_2432:
00877          sprintf (string, "MR 2432");
00878          break;
00879
00880       case fiu_SLP_MODE_MR_3456:
00881          sprintf (string, "MR 3456");
00882          break;
00883
00884       case fiu_SLP_MODE_MR_4096:
00885          sprintf (string, "MR 4096");
00886          break;
00887
00888       case fiu_SLP_MODE_MR_4864:
00889          sprintf (string, "MR 4864");
00890          break;
00891
00892       case fiu_SLP_MODE_MH_1728:
00893          sprintf (string, "MH 1728");
00894          break;
00895
00896       case fiu_SLP_MODE_MH_2048:
00897          sprintf (string, "MH 2048");
00898          break;
00899
00900       case fiu_SLP_MODE_MH_2432:
00901          sprintf (string, "MH 2432");
00902          break;
00903
00904       case fiu_SLP_MODE_MH_3456:
00905          sprintf (string, "MH 3456");
00906          break;
00907
00908       case fiu_SLP_MODE_MH_4096:
00909          sprintf (string, "MH 4096");
00910          break;
00911
00912       case fiu_SLP_MODE_MH_4864:
00913          sprintf (string, "MH 4864");
00914          break;
00915    }
00916 } /* fiuDebugGetSLPPageMode() */
00917
00918 void fiuDebugGetToneId (int msgData, char *string)
00919 {
00920    switch (msgData)
00921    {
00922       case iffax_TONE_CED:
00923          sprintf (string, "CED");
00924          break;
00925
00926       case iffax_TONE_CNG:
00927          sprintf (string, "CNG");
00928          break;
00929
00930       case iffax_TONE_ANSAM:
00931          sprintf (string, "ANSam");
00932          break;
00933
00934       default:
00935          sprintf (string, "unknown (0x%X)", msgData);
00936          break;
00937    }
00938 } /* fiuDebugGetToneId() */
00939
00940 void fiuDebugGetMDEvent (int msgData, char *string)
00941 {
00942    switch (msgData)
00943    {
00944       case iffax_FM_FP_PREAMBLE_DETECT:
00945          sprintf (string, "FM_FP_PREAMBLE_DETECT");
00946          break;
00947
00948       case iffax_FM_FP_CARRIER_DETECT:
00949          sprintf (string, "FM_FP_CARRIER_DETECT");
00950          break;
00951
00952       case iffax_FM_FP_CARRIER_LOSS:
00953          sprintf (string, "FM_FP_CARRIER_LOSS");
00954          break;
00955
00956       case iffax_FM_FP_TEP_DETECT:
00957          sprintf (string, "FM_FP_TEP_DETECT");
00958          break;
00959
00960       case iffax_FM_FP_HS_TRAIN_DETECT:
00961          sprintf (string, "FM_FP_HS_TRAIN_DETECT");
00962          break;
00963
00964       case iffax_FM_FP_FRAME_COMP:
00965          sprintf (string, "FM_FP_FRAME_COMP");
00966          break;
00967
00968       case iffax_FM_FP_SYNC_ACK:
00969          sprintf (string, "FM_FP_SYNC_ACK");
00970          break;
00971
00972       case iffax_FM_FP_DATA:
00973          sprintf (string, "FM_FP_DATA");
00974          break;
00975
00976       case iffax_FM_FP_TONE_DETECT:
00977          sprintf (string, "FM_FP_TONE_DETECT");
00978          break;
00979
00980       case iffax_FM_FP_SIGNAL_DETECT:
00981          sprintf (string, "FM_FP_SIGNAL_DETECT");
00982          break;
00983
00984       case iffax_FM_FP_SIGNAL_LOSS:
00985          sprintf (string, "FM_FP_SIGNAL_LOSS");
00986          break;
00987
00988       case iffax_FM_FP_V8_CI_RECEIVED:
00989          sprintf (string, "FM_FP_V8_CI_RECEIVED");
00990          break;
00991
00992       case iffax_FM_FP_V8_CM_RECEIVED:
00993          sprintf (string, "FM_FP_V8_CM_RECEIVED");
00994          break;
00995
00996       case iffax_FM_FP_V8_JM_RECEIVED:
00997          sprintf (string, "FM_FP_V8_JM_RECEIVED");
00998          break;
00999
01000       case iffax_FM_FP_V34_E_DETECTED:
01001          sprintf (string, "FM_FP_V34_E_DETECTED");
01002          break;
01003
01004       case iffax_FM_FP_V34_PRI_RATE_KNOWN:
01005          sprintf (string, "FM_FP_V34_PRI_RATE_KNOWN");
01006          break;
01007
01008       case iffax_FM_FP_V34_CC_RETRAIN:
01009          sprintf (string, "FM_FP_V34_CC_RETRAIN");
01010          break;
01011
01012       case iffax_FM_FP_V34_PRI_CH_TURN_OFF:
01013          sprintf (string, "FM_FP_V34_PRI_CH_TURN_OFF");
01014          break;
01015
01016       case iffax_FM_FP_40_ONES_DETECTED:
01017          sprintf (string, "FM_FP_40_ONES_DETECTED");
01018          break;
01019
01020       case iffax_FM_FP_SILENCE_DETECTED:
01021          sprintf (string, "FM_FP_SILENCE_DETECTED");
01022          break;
01023
01024       default:
01025          sprintf (string, "unknown event (0x%X)", msgData);
01026          break;
01027    }
01028 } /* fiuDebugGetMDEvent() */
01029
01030 void fiuDebugGetNetEvent (int msgData, char *string)
01031 {
01032    switch (msgData)
01033    {
01034       case FND_FRP_SIGNAL_END:
01035          sprintf (string, "FND_FRP_SIGNAL_END");
01036          break;
01037
01038       case FND_FRP_TONE_ON_LS:
01039          sprintf (string, "FND_FRP_TONE_ON_LS");
01040          break;
01041
01042       case FND_FRP_HS_TRAINING:
01043          sprintf (string, "FND_FRP_HS_TRAINING");
01044          break;
01045
01046       case FND_FRP_PREAMBLE:
01047          sprintf (string, "FND_FRP_PREAMBLE");
01048          break;
01049
01050       case FND_FRP_DATA_BYTE:
01051          sprintf (string, "FND_FRP_DATA_BYTE");
01052          break;
01053
01054       case FND_FRP_DATA_BUFFER:
01055          sprintf (string, "FND_FRP_DATA_BUFFER");
01056          break;
01057
01058       case FND_FRP_FRAME_COMP:
01059          sprintf (string, "FND_FRP_FRAME_COMP");
01060          break;
01061
01062       case FND_FRP_PREAMBLE_NOTIF:
01063          sprintf (string, "FND_FRP_PREAMBLE_NOTIF");
01064          break;
01065
01066       case FND_FRP_HS_TRAIN_NOTIF:
01067          sprintf (string, "FND_FRP_HS_TRAIN_NOTIF");
01068          break;
01069
01070       case FND_FRP_V8_CI:
01071          sprintf (string, "FND_FRP_V8_CI");
01072          break;
01073
01074       case FND_FRP_V8_CM:
01075          sprintf (string, "FND_FRP_V8_CM");
01076          break;
01077
01078       case FND_FRP_V8_JM:
01079          sprintf (string, "FND_FRP_V8_JM");
01080          break;
01081
01082       case FND_FRP_V34_PRI_RATE:
01083          sprintf (string, "FND_FRP_V34_PRI_RATE");
01084          break;
01085
01086       case FND_FRP_V34_PRI_BEGIN:
01087          sprintf (string, "FND_FRP_V34_PRI_BEGIN");
01088          break;
01089
01090       case FND_FRP_V34_CTRL_BEGIN:
01091          sprintf (string, "FND_FRP_V34_CTRL_BEGIN");
01092          break;
01093
01094       case FND_FRP_V34_CC_RETRAIN:
01095          sprintf (string, "FND_FRP_V34_CC_RETRAIN");
01096          break;
01097
01098       case FND_FRP_V8_SIG:
01099          sprintf (string, "FND_FRP_V8_SIG");
01100          break;
01101
01102       default:
01103          sprintf (string, "unknown event (0x%X)", msgData);
01104          break;
01105    }
01106 } /* fiuDebugGetNetEvent() */
01107
01108 void fiuDebugGetFRP2FNDMsg (int msgData, char *string)
01109 {
01110    switch (msgData)
01111    {
01112       case FRP_FND_SIGNAL_END:
01113          sprintf (string, "FRP_FND_SIGNAL_END");
01114          break;
01115
01116       case FRP_FND_TEP_DETECT:
01117          sprintf (string, "FRP_FND_TEP_DETECT");
01118          break;
01119
01120       case FRP_FND_HS_TRNG_DETECT:
01121          sprintf (string, "FRP_FND_HS_TRNG_DETECT");
01122          break;
01123
01124       case FRP_FND_PREAMBLE_DETECT:
01125          sprintf (string, "FRP_FND_PREAMBLE_DETECT");
01126          break;
01127
01128       case FRP_FND_DATA_BYTE:
01129          sprintf (string, "FRP_FND_DATA_BYTE");
01130          break;
01131
01132       case FRP_FND_DATA_BUFFER:
01133          sprintf (string, "FRP_FND_DATA_BUFFER");
01134          break;
01135
01136       case FRP_FND_FRAME_COMP:
01137          sprintf (string, "FRP_FND_FRAME_COMP");
01138          break;
01139
01140       case FRP_FND_HS_RATE:
01141          sprintf (string, "FRP_FND_HS_RATE");
01142          break;
01143
01144       case FRP_FND_SLP_INFO:
01145          sprintf (string, "FRP_FND_SLP_INFO");
01146          break;
01147
01148       case FRP_FND_TONE_DETECT:
01149          sprintf (string, "FRP_FND_TONE_DETECT");
01150          break;
01151
01152       case FRP_FND_V8_CI:
01153          sprintf (string, "FRP_FND_V8_CI");
01154          break;
01155
01156       case FRP_FND_V8_CM:
01157          sprintf (string, "FRP_FND_V8_CM");
01158          break;
01159
01160       case FRP_FND_V8_JM:
01161          sprintf (string, "FRP_FND_V8_JM");
01162          break;
01163
01164       case FRP_FND_V34_PRI_RATE:
01165          sprintf (string, "FRP_FND_V34_PRI_RATE");
01166          break;
01167
01168       case FRP_FND_V34_CTRL_DATA:
01169          sprintf (string, "FRP_FND_V34_CTRL_DATA");
01170          break;
01171
01172       case FRP_FND_V34_PRI_DATA:
01173          sprintf (string, "FRP_FND_V34_PRI_DATA");
01174          break;
01175
01176       case FRP_FND_V34_PRI_BEGIN:
01177          sprintf (string, "FRP_FND_V34_PRI_BEGIN");
01178          break;
01179
01180       case FRP_FND_V34_CTRL_BEGIN:
01181          sprintf (string, "FRP_FND_V34_CTRL_BEGIN");
01182          break;
01183
01184       case FRP_FND_V34_CC_RETRAIN:
01185          sprintf (string, "FRP_FND_V34_CC_RETRAIN");
01186          break;
01187
01188       case FRP_FND_V8_SIG:
01189          sprintf (string, "FRP_FND_V8_SIG");
01190          break;
01191
01192       case FRP_FND_V34_SIGNAL_END:
01193          sprintf (string, "FRP_FND_V34_SIGNAL_END");
01194          break;
01195
01196       default:
01197          sprintf (string, "unknown (0x%X)", msgData);
01198          break;
01199    }
01200 } /* fiuDebugGetFRP2FNDMsg() */
01201
01202 void fiuDebugGetTimerEvent (int msgData, char *string)
01203 {
01204    switch (msgData)
01205    {
01206       case FRP_NOACTIVITY_TIMER_EXP:
01207          sprintf (string, "no activity timer");
01208          break;
01209
01210       case FRP_CLEARDOWN_TIMER_EXP:
01211          sprintf (string, "cleardown timer");
01212          break;
01213
01214       case FRP_EFLAG_START_TIMER_EXP:
01215          sprintf (string, "eflag start timer");
01216          break;
01217
01218       case FRP_EFLAG_STOP_TIMER_EXP:
01219          sprintf (string, "eflag stop timer");
01220          break;
01221
01222       case FRP_CARRIER_DETECT_TIMER_EXP:
01223          sprintf (string, "carrier detect timer");
01224          break;
01225
01226       case FRP_XT2_TIMER_EXP:
01227          sprintf (string, "XT2 timer");
01228          break;
01229
01230       case FRP_NETWORK_TIMEOUT_EXP:
01231          sprintf (string, "network timer");
01232          break;
01233
01234       case FRP_TCF_DETECT_TIMER_EXP:
01235          sprintf (string, "TCF detect timer");
01236          break;
01237
01238       case FRP_STARTUP_TIMER_EXP:
01239          sprintf (string, "startup timer");
01240          break;
01241
01242       default:
01243          sprintf (string, "unknown event (0x%X)", msgData);
01244          break;
01245    }
01246 } /* fiuDebugGetTimerEvent() */
01247
01248 void fiuDebugGetT2PLineState (int msgData, char *string)
01249 {
01250    switch (msgData)
01251    {
01252       case FND_T2P_LS_IDLE:
01253          sprintf (string, "idle");
01254          break;
01255
01256       case FND_T2P_LS_PREAMBLE:
01257          sprintf (string, "preamble");
01258          break;
01259
01260       case FND_T2P_LS_LOW_SPEED_DATA:
01261          sprintf (string, "low-speed data");
01262          break;
01263
01264       case FND_T2P_HIGH_SPEED_TRAINING:
01265          sprintf (string, "high-speed training");
01266          break;
01267
01268       case FND_T2P_HIGH_SPEED_DATA:
01269          sprintf (string, "high-speed data");
01270          break;
01271
01272       default:
01273          sprintf (string, "unknown (0x%X)", msgData);
01274          break;
01275    }
01276 } /* fiuDebugGetT2PLineState() */
01277
01278 void fiuDebugGetT2PDecoderState (int msgData, char *string)
01279 {
01280    switch (msgData)
01281    {
01282       case FND_DECODER_T2P_TRANSP:
01283          sprintf (string, "transparent");
01284          break;
01285
01286       case FND_DECODER_T2P_LSD:
01287          sprintf (string, "low-speed data");
01288          break;
01289
01290       case FND_DECODER_T2P_HSD:
01291          sprintf (string, "high-speed data");
01292          break;
01293
01294       case FND_DECODER_T2P_IDLE_SYNC:
01295          sprintf (string, "idle resynchronization");
01296          break;
01297    }
01298 } /* fiuDebugGetT2PDecoderState() */
01299
01300 void fiuDebugGetSwitchoverReason (int msgData, char *string)
01301 {
01302    switch (msgData)
01303    {
01304       case fiu_SWITCHOVER_V8_CM_RCVD_LOCAL:
01305          sprintf (string, "V.8 CM received from local");
01306          break;
01307
01308       case fiu_SWITCHOVER_V8_CM_RCVD_REMOTE:
01309          sprintf (string, "V.8 CM received from remote");
01310          break;
01311
01312       case fiu_SWITCHOVER_V8_CI_RCVD_LOCAL:
01313          sprintf (string, "V.8 CI received from local");
01314          break;
01315
01316       case fiu_SWITCHOVER_V8_CI_RCVD_REMOTE:
01317          sprintf (string, "V.8 CI received from remote");
01318          break;
01319
01320       case fiu_SWITCHOVER_V8_ANSAM_RCVD_REMOTE:
01321          sprintf (string, "V.8 ANSam received from remote");
01322          break;
01323
01324       case fiu_SWITCHOVER_PREAMBLE_RCVD_REMOTE:
01325          sprintf (string, "V.21 preamble received from remote");
01326          break;
01327
01328       case fiu_SWITCHOVER_V34_NOT_SUPPORTED:
01329          sprintf (string, "V.34 fax not supported");
01330          break;
01331    }
01332 } /* fiuDebugGetSwitchoverReason() */
01333
01334 void fiuDebugGetCleardownReason (int msgData, char *string)
01335 {
01336    switch (msgData)
01337    {
01338       case FRP_CLEARDOWN_DCN_RCVD_LOCAL:
01339          sprintf (string, "DCN message received from local");
01340          break;
01341
01342       case FRP_CLEARDOWN_DCN_RCVD_REMOTE:
01343          sprintf (string, "DCN message received from remote");
01344          break;
01345
01346       case FRP_CLEARDOWN_NSS_RCVD_LOCAL:
01347          sprintf (string, "NSS message received from local");
01348          break;
01349
01350       case FRP_CLEARDOWN_NSS_RCVD_REMOTE:
01351          sprintf (string, "NSS message received from remote");
01352          break;
01353
01354       case FRP_CLEARDOWN_NO_ACTIVITY_TIMEOUT:
01355          sprintf (string, "no-activity timeout");
01356          break;
01357
01358       case FRP_CLEARDOWN_TX_NETWORK_TIMEOUT:
01359          sprintf (string, "network timeout waiting for data");
01360          break;
01361
01362       case FRP_CLEARDOWN_STARTUP_TIMEOUT:
01363          sprintf (string, "startup timer expired");
01364          break;
01365    }
01366 } /* fiuDebugGetCleardownReason() */
01367
01368 int fiuDebugTraceParser (int msgId, int msgData, char *dstPtr)
01369 {
01370    int returnVal = TRUE;
01371
01372    switch (msgId)
01373    {
01374       case TRC_FIU_OPEN:
01375          sprintf (dstPtr, "FIU is opened: frame size = %d ms", msgData);
01376          break;
01377
01378       case TRC_FIU_CLOSED:
01379          sprintf (dstPtr, "FIU is closed");
01380          break;
01381
01382       case TRC_FIU_CLEARDOWN_IND:
01383          fiuDebugGetCleardownReason (msgData, fiuMsgString);
01384          sprintf (dstPtr, "Fax cleardown: %s", fiuMsgString);
01385          break;
01386
01387       case TRC_FIU_RELOC:
01388          sprintf (dstPtr, "FIU relocation requested");
01389          break;
01390
01391       case TRC_FIU_INVD_CONTROL:
01392          sprintf (dstPtr, "fiuControl called with invalid code: %d", msgData);
01393          break;
01394
01395       case TRC_FIU_G3_TO_V34:
01396          fiuDebugGetSwitchoverReason (msgData, fiuMsgString);
01397          sprintf (dstPtr, "Switchover from G3 to V.34 processing: %s", fiuMsgString);
01398          break;
01399
01400       case TRC_FIU_V34_TO_G3:
01401          fiuDebugGetSwitchoverReason (msgData, fiuMsgString);
01402          sprintf (dstPtr, "Switchover from V.34 to G3 processing: %s", fiuMsgString);
01403          break;
01404
01405       case TRC_FND_INVALID_PKT:
01406          sprintf (dstPtr, "Invalid packet received from network: %s",
01407                   ((msgData == 0) ? "header error":"invalid state"));
01408          break;
01409
01410       case TRC_FND_PACKET_LOSS:
01411          sprintf (dstPtr, "Loss of data: number of lost packets = %d", msgData);
01412          break;
01413
01414       case TRC_FND_T2P_RX_LC_UNDEF:
01415          sprintf (dstPtr, "Undefined line state detected from network: %d", msgData);
01416          break;
01417
01418       case TRC_FND_TX_PKT_DROPPED:
01419          sprintf (dstPtr, "Packets cannot be transmitted to the network");
01420          break;
01421
01422       case TRC_FND_EXCEPTION:
01423          sprintf (dstPtr, "FND exception: code = %d", msgData);
01424          break;
01425
01426       case TRC_FND_T38U_INVD_FDT:
01427          sprintf (dstPtr, "Received T.38 packet with invalid field data type: 0x%X", msgData);
01428          break;
01429
01430       case TRC_FND_T38U_EXCEPTION:
01431          fiuDebugGetT38UException (msgData, fiuMsgString);
01432          sprintf (dstPtr, "FND exception problem with T.38 packet: %s", fiuMsgString);
01433          break;
01434
01435       case TRC_FRP_FND_MSG_DROPPED:
01436          fiuDebugGetFRP2FNDMsg (msgData, fiuMsgString);
01437          sprintf (dstPtr, "FRP-to-FND message dropped: %s", fiuMsgString);
01438          break;
01439
01440       case TRC_FND_T38U_ENC_IFP_BUF_FULL:
01441          sprintf (dstPtr, "IFP buffer full");
01442          break;
01443
01444       case TRC_FND_T38U_ENC_IFP_BUF_EMPTY:
01445          sprintf (dstPtr, "IFP buffer empty");
01446          break;
01447
01448       case TRC_FND_T38U_ENC_IFP_DELETE_ERROR:
01449          sprintf (dstPtr, "Attempting to delete an IFP that has not been sent to the network");
01450          break;
01451
01452       case TRC_FND_T38U_NO_DF_AVAIL:
01453          sprintf (dstPtr, "No data buffer available for IFP data - msg will be dropped");
01454          break;
01455
01456       case TRC_FND_T38U_ENC_DF_DELETE_ERROR:
01457          sprintf (dstPtr, "Attempting to delete a data field that is NULL");
01458          break;
01459
01460       case TRC_FND_T38U_VERSION_NUM:
01461          sprintf (dstPtr, "T.38 version %d", msgData);
01462          break;
01463
01464       case TRC_FRP_STATE_CHANGE:
01465          fiuDebugGetFRPState (msgData, fiuMsgString);
01466          sprintf (dstPtr, "FRP state change: %s", fiuMsgString);
01467          break;
01468
01469       case TRC_FRP_FCF_ID:
01470          fiuDebugGetFCF (msgData, fiuMsgString);
01471          sprintf (dstPtr, "FCF of current frame: %s", fiuMsgString);
01472          break;
01473
01474       case TRC_FRP_FM_DATA_SIZE_EXCEEDED:
01475          sprintf (dstPtr, "Received a data message from FM with invalid size");
01476          break;
01477
01478       case TRC_FRP_FM_MESSAGE_ERROR:
01479          sprintf (dstPtr, "A message from FRP to FM was reported as ERROR by FM");
01480          break;
01481
01482       case TRC_FRP_FCF2_ID:
01483          fiuDebugGetFCF2 (msgData, fiuMsgString);
01484          sprintf (dstPtr, "FCF2 of current frame: %s", fiuMsgString);
01485          break;
01486
01487 #ifndef FAX_DBG_LEVEL_1_ONLY_PARSER
01488       case TRC_FIU_NO_HS_BUFFER_AVAIL:
01489          sprintf (dstPtr, "Memory allocation failure: no high speed buffer available");
01490          break;
01491
01492       case TRC_FIUDBG_LOST_TRACE:
01493          sprintf (dstPtr, "%d Trace message(s) have been lost", msgData);
01494          break;
01495
01496       case TRC_FIU_TONE_DET_CTRL:
01497          sprintf (dstPtr, "Tone detector control called: %s",
01498                   ((msgData == 0) ? "disabled":"enabled"));
01499          break;
01500
01501       case TRC_FIU_TONE_DETECTED:
01502          sprintf (dstPtr, "Tone detected: %s",
01503                   ((msgData == 0) ? "CED":"CNG"));
01504          break;
01505
01506       case TRC_FIU_NBUFFER_POOL_SIZE:
01507          sprintf (dstPtr, "FIU buffer pool size: %d", msgData);
01508          break;
01509
01510       case TRC_FND_STARTUP:
01511          fiuDebugGetNetProtocol (msgData, fiuMsgString);
01512          sprintf (dstPtr, "FND successful startup: %s network protocol", fiuMsgString);
01513          break;
01514
01515       case TRC_FND_OUT_OF_SEQ_PKT:
01516          sprintf (dstPtr, "Out-of-sequence packet dropped");
01517          break;
01518
01519       case TRC_FND_NETRXQ_OVERFLOW:
01520          sprintf (dstPtr, "Network rx queue overflow");
01521          break;
01522
01523       case TRC_FND_JITBUF_OVERFLOW:
01524          sprintf (dstPtr, "Network jitter buffer overflow");
01525          break;
01526
01527       case TRC_FND_T2P_RX_LC_DET:
01528          fiuDebugGetT2PLineState (msgData, fiuMsgString);
01529          sprintf (dstPtr, "New line state detected from network: %s", fiuMsgString);
01530          break;
01531
01532       case TRC_FND_T2P_STATE_CHANGE:
01533          fiuDebugGetT2PDecoderState (msgData, fiuMsgString);
01534          sprintf (dstPtr, "FND T2 decoder state change: %s", fiuMsgString);
01535          break;
01536
01537       case TRC_FND_T2P_TX_PKT:
01538          fiuDebugGetFRP2FNDMsg (msgData, fiuMsgString);
01539          sprintf (dstPtr, "T2P packet transmitted to the network: %s", fiuMsgString);
01540          break;
01541
01542       case TRC_FND_T2P_TX_FIRST_DATA:
01543          sprintf (dstPtr, "Transmission of first data packet to the network");
01544          break;
01545
01546       case TRC_FND_HS_BUFFER_UNAVAIL:
01547          sprintf (dstPtr, "Memory allocation failure: number of failures = %d", msgData);
01548          break;
01549
01550       case TRC_FND_T2P_RX_FRAME_COMP:
01551          sprintf (dstPtr, "Frame complete was received from the network: %s CRC",
01552                   ((msgData == 0)? "good":"bad"));
01553          break;
01554
01555       case TRC_FND_FRF11_RX:
01556          fiuDebugGetFRF11PacketType (msgData, fiuMsgString);
01557          sprintf (dstPtr, "Received FRF.11 packet from network: %s", fiuMsgString);
01558          break;
01559
01560       case TRC_FND_FRF11_STATE_CHANGE:
01561          fiuDebugGetFRF11DecoderState (msgData, fiuMsgString);
01562          sprintf (dstPtr, "FND FRF.11 decoder state change: %s", fiuMsgString);
01563          break;
01564
01565       case TRC_FND_FRF11_TX_PKT:
01566          fiuDebugGetFRP2FNDMsg (msgData, fiuMsgString);
01567          sprintf (dstPtr, "Sent FRF.11 packet to network: msg ID = %s", fiuMsgString);
01568          break;
01569
01570       case TRC_FND_FRF11_INVALID_PKT:
01571          sprintf (dstPtr, "Received FRF.11 packet with invalid field");
01572          break;
01573
01574       case TRC_FND_AAL2_RX:
01575          fiuDebugGetAAL2PacketType (msgData, fiuMsgString);
01576          sprintf (dstPtr, "Received AAL2 packet from network: %s", fiuMsgString);
01577          break;
01578
01579       case TRC_FND_AAL2_STATE_CHANGE:
01580          fiuDebugGetAAL2DecoderState (msgData, fiuMsgString);
01581          sprintf (dstPtr, "FND AAL2 decoder state change: %s", fiuMsgString);
01582          break;
01583
01584       case TRC_FND_AAL2_TX_PKT:
01585          sprintf (dstPtr, "Sent AAL2 packet to network");
01586          break;
01587
01588       case TRC_FND_AAL2_INVALID_PKT:
01589          fiuDebugGetAAL2PacketType (msgData, fiuMsgString);
01590          sprintf (dstPtr, "Received invalid AAL2 packet from network: %s", fiuMsgString);
01591          break;
01592
01593       case TRC_FND_T38U_STATE_CHANGE:
01594          fiuDebugGetT38UDecoderState (msgData, fiuMsgString);
01595          sprintf (dstPtr, "FND T.38 decoder state change: %s", fiuMsgString);
01596          break;
01597
01598       case TRC_FND_T38U_RX_PT_DET:
01599          fiuDebugGetPT (msgData, fiuMsgString);
01600          sprintf (dstPtr, "Received T.38 packet with new payload type from network: %s", fiuMsgString);
01601          break;
01602
01603       case TRC_FND_T38U_TX_PKT:
01604          fiuDebugGetIFPHeader (msgData, fiuMsgString);
01605          sprintf (dstPtr, "Sent T.38 packet to network: %s", fiuMsgString);
01606          break;
01607
01608       case TRC_FRP_FND_MESSAGE:
01609          fiuDebugGetFRP2FNDMsg (msgData, fiuMsgString);
01610          sprintf (dstPtr, "FRP-to-FND message sent: %s", fiuMsgString);
01611          break;
01612
01613       case TRC_FND_FRP_MESSAGE:
01614          sprintf (dstPtr, "FND-to-FRP message sent: %d", msgData);
01615          break;
01616
01617       case TRC_FRP_STARTUP:
01618          sprintf (dstPtr, "FRP successful startup");
01619          break;
01620
01621       case TRC_FRP_RXOUTQ_OVERFLOW:
01622          sprintf (dstPtr, "An overflow condition in ReceiveOut queue (data was lost)");
01623          break;
01624
01625       case TRC_FRP_SENDINQ_OVERFLOW:
01626          sprintf (dstPtr, "An overflow condition in SendIn queue (data was lost)");
01627          break;
01628
01629       case TRC_FRP_NETEVT_IGNORE:
01630          fiuDebugGetNetEvent (msgData, fiuMsgString);
01631          sprintf (dstPtr, "Received ignored network event in current FRP state: %s", fiuMsgString);
01632          break;
01633
01634       case TRC_FRP_MDEVT_IGNORE:
01635          fiuDebugGetMDEvent (msgData, fiuMsgString);
01636          sprintf (dstPtr, "Received ignored modem event in current FRP state: %s", fiuMsgString);
01637          break;
01638
01639       case TRC_FRP_TMREVT_IGNORE:
01640          fiuDebugGetTimerEvent (msgData, fiuMsgString);
01641          sprintf (dstPtr, "Received ignored timer event in current FRP state: %s", fiuMsgString);
01642          break;
01643
01644       case TRC_FRP_TIMER_EXPIRE:
01645          fiuDebugGetTimerEvent (msgData, fiuMsgString);
01646          sprintf (dstPtr, "Expiration of protocol timer: %s", fiuMsgString);
01647          break;
01648
01649       case TRC_FRP_FIRST_HS_DATA:
01650          sprintf (dstPtr, "Received first high-speed data bytes by FRP from either modem or network");
01651          break;
01652
01653       case TRC_FRP_FIRST_LS_BYTE:
01654          sprintf (dstPtr, "Received first byte of a low-speed data frame: 0x%X", msgData);
01655          break;
01656
01657       case TRC_FRP_EXCEPTION:
01658          sprintf (dstPtr, "Software exception in FRP occured");
01659          break;
01660
01661       case TRC_FRP_SLP_PAGE_MODE:
01662          fiuDebugGetSLPPageMode (msgData, fiuMsgString);
01663          sprintf (dstPtr, "SLP page mode: %s", fiuMsgString);
01664          break;
01665
01666       case TRC_FRP_LOCAL_TONE_GEN:
01667          fiuDebugGetToneId (msgData, fiuMsgString);
01668          sprintf (dstPtr, "Start of local tone generation: %s", fiuMsgString);
01669          break;
01670
01671       case TRC_FRP_LOCAL_TONE_DET:
01672          fiuDebugGetToneId (msgData, fiuMsgString);
01673          sprintf (dstPtr, "Detected local tone: %s", fiuMsgString);
01674          break;
01675
01676       case TRC_FRP_REMOTE_TONE_DET:
01677          fiuDebugGetToneId (msgData, fiuMsgString);
01678          sprintf (dstPtr, "Detected tone from remote: %s", fiuMsgString);
01679          break;
01680
01681       case TRC_FRP_FINAL_FRAME_DET:
01682          sprintf (dstPtr, "Received the final frame of a low-speed transmission");
01683          break;
01684
01685       case TRC_FRP_ACTIVATE:
01686          fiuDebugGetFRPState (msgData, fiuMsgString);
01687          sprintf (dstPtr, "FRP has been activated in state: %s", fiuMsgString);
01688          break;
01689
01690       case TRC_FRP_V34_LOCAL_PRI_RATE:
01691          sprintf (dstPtr, "V.34 local primary channel data rate: %dbps", msgData);
01692          break;
01693
01694       case TRC_FRP_PP_NUM_FRAMES:
01695          sprintf (dstPtr, "Number of data frames in the partial page: %d", msgData);
01696          break;
01697 #endif /* FAX_DBG_LEVEL_1_ONLY_PARSER */
01698
01699       default:
01700          returnVal = FALSE;
01701          break;
01702    }
01703
01704    return (returnVal);
01705
01706 } /* fiuDebugTraceParser() */
01707
01708 /* nothing past this point */


FIU Test: fiusim.c File Reference

  • File List
  • Globals

fiusim.c File Reference

#include <stdio.h>
#include <ti/mas/fiu/test/src/fiusim.h>
#include <ti/mas/util/ecomem.h>

Include dependency graph for fiusim.c:

Go to the source code of this file.

Defines

#define | DATA_SEGMENT_SIZE_BYTES 1
#define | FM_FP_LS_DIS_MSG_SIZE_BYTES 9
#define | FM_FP_LS_DIS_MSG_SIZE_WORDS ((FM_FP_LS_DIS_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES 12
#define | FM_FP_LS_DIS_NONECM_MSG_SIZE_WORDS ((FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_DCS_MSG_SIZE_BYTES 9
#define | FM_FP_LS_DCS_MSG_SIZE_WORDS ((FM_FP_LS_DCS_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES 12
#define | FM_FP_LS_DCS_NONECM_MSG_SIZE_WORDS ((FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_CFR_MSG_SIZE_BYTES 3
#define | FM_FP_LS_CFR_MSG_SIZE_WORDS ((FM_FP_LS_CFR_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES 7
#define | FM_FP_LS_PPS_EOP_MSG_SIZE_WORDS ((FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_EOP_MSG_SIZE_BYTES 3
#define | FM_FP_LS_EOP_MSG_SIZE_WORDS ((FM_FP_LS_EOP_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_MCF_MSG_SIZE_BYTES 3
#define | FM_FP_LS_MCF_MSG_SIZE_WORDS ((FM_FP_LS_MCF_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_LS_DCN_MSG_SIZE_BYTES 4
#define | FM_FP_LS_DCN_MSG_SIZE_WORDS ((FM_FP_LS_DCN_MSG_SIZE_BYTES + 1) >> 1)
#define | FM_FP_HS_DATA_MSG_SIZE_BYTES 8
#define | FM_FP_HS_DATA_MSG_SIZE_WORDS ((FM_FP_HS_DATA_MSG_SIZE_BYTES + 1) >> 1)
#define | RTP_SEQNUM_OFFSET 1

Functions

int | fiuDebugTraceParser (int msgId, int msgData, char *dstPtr)
tulong | siuGetTime (void)
tint | siuNetInterface (void *targetInst, xferpktInfo_t *pktInfo)
void | fiuSimCreateFmFpDataMsgs (iffaxFmFpMsg_t *fmMsg, tuint *inIndex, tword *dataAddress, tuint dataSize)
tint | siuG3FmInterface (void *targetInst, void *message)
void | siuFaxEventHandler (void *targetInst, tuint eventCode, tuint eventInfo)
void | siuDebugInfo (void *mId, tuint msgType, tuint msgCode, tuint msgLength, tuint *supportingData)
void | siuFatalError (tuint id, char *str)
void | siuCriticalSectionBegin (void)
void | siuCriticalSectionEnd (void)
void | siu_init (tint chnum)
void | siu_new_fiu (tint chnum)
void | siu_open_fiu (tint chnum)
void | siu_close_fiu (tint chnum)
void | siu_delete_fiu (tint chnum)
void | main (void)

Variables

fiuNetProtocol_e | faxNetProtocol = fiu_PT_T38_UDPTL
iffaxFmFpMsg_t | gw1FmMsg [SIU_FM_MESSAGE_ARRAY_SIZE]
iffaxFmFpMsg_t | gw2FmMsg [SIU_FM_MESSAGE_ARRAY_SIZE]
tuint | gw1FmFpMsgInIndex = 0
tuint | gw1FmFpMsgOutIndex = 0
tuint | gw2FmFpMsgInIndex = 0
tuint | gw2FmFpMsgOutIndex = 0
tuint | gw1DataIndex = 0
tuint | gw2DataIndex = 0
tuint | gw1ChNum = 1
tuint | gw2ChNum = 2
tuint | msgTimestamp = 0
tword | gw1RxData [100]
tint | gw1RxDataIndex = 0
tword | gw2RxData [100]
tint | gw2RxDataIndex = 0
tbool | fDISSent = FALSE
tbool | fG3FaxECM = FALSE
tword | FmFpLsDISMsg [FM_FP_LS_DIS_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x01, 0x00, 0x72, 0x5F, 0x21, 0x01, 0xD8}
tword | FmFpLsDISNonECMMsg [FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x01, 0x00, 0x77, 0x41, 0x23, 0x01, 0xF9, 0x01, 0x01, 0x00}
tword | FmFpLsDCSMsg [FM_FP_LS_DCS_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xC1, 0x00, 0x70, 0x1F, 0x21, 0x01, 0x10}
tword | FmFpLsDCSNonECMMsg [FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xC1, 0x00, 0x44, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00}
tword | FmFpLsCFRMsg [FM_FP_LS_CFR_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x21}
tword | FmFpLsPPS_EOPMsg [FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xFD, 0xF4, 0x00, 0x00, 0x64}
tword | FmFpLsEOPMsg [FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xF4}
tword | FmFpLsMCFMsg [FM_FP_LS_MCF_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x31}
tword | FmFpLsDCNMsg [FM_FP_LS_DCN_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x5F, 0x20}
tword | FmFpHsData [FM_FP_HS_DATA_MSG_SIZE_BYTES] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}
siuInst_t | siuInst [SIU_NUMBER_OF_CHANNELS]
tulong | systemTime = 0
tuint | prevTime = 0
tbool | fLoop = TRUE
tuint | gFrameSize = 10
tuint | numCleardownMsg = 0
fiuNetCallTbl_t * | faxNetCallTblPtr []
char | siuFatalString = 0
fiuStats_t | gw1FaxStats
fiuStats_t | gw2FaxStats
fiuContext_t | fiuContext
tuint | gw1RtpSeqNum = 0
tuint | gw2RtpSeqNum = 0

Define Documentation

#define DATA_SEGMENT_SIZE_BYTES 1

Definition at line 107 of file fiusim.c.

Referenced by fiuSimCreateFmFpDataMsgs(), and main().

#define FM_FP_LS_DIS_MSG_SIZE_BYTES 9

Definition at line 115 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_DIS_MSG_SIZE_WORDS ((FM_FP_LS_DIS_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 116 of file fiusim.c.

#define FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES 12

Definition at line 119 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_DIS_NONECM_MSG_SIZE_WORDS ((FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 120 of file fiusim.c.

#define FM_FP_LS_DCS_MSG_SIZE_BYTES 9

Definition at line 123 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_DCS_MSG_SIZE_WORDS ((FM_FP_LS_DCS_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 124 of file fiusim.c.

#define FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES 12

Definition at line 127 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_DCS_NONECM_MSG_SIZE_WORDS ((FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 128 of file fiusim.c.

#define FM_FP_LS_CFR_MSG_SIZE_BYTES 3

Definition at line 131 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_CFR_MSG_SIZE_WORDS ((FM_FP_LS_CFR_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 132 of file fiusim.c.

#define FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES 7

Definition at line 135 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_PPS_EOP_MSG_SIZE_WORDS ((FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 136 of file fiusim.c.

#define FM_FP_LS_EOP_MSG_SIZE_BYTES 3

Definition at line 139 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_EOP_MSG_SIZE_WORDS ((FM_FP_LS_EOP_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 140 of file fiusim.c.

#define FM_FP_LS_MCF_MSG_SIZE_BYTES 3

Definition at line 143 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_MCF_MSG_SIZE_WORDS ((FM_FP_LS_MCF_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 144 of file fiusim.c.

#define FM_FP_LS_DCN_MSG_SIZE_BYTES 4

Definition at line 147 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_LS_DCN_MSG_SIZE_WORDS ((FM_FP_LS_DCN_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 148 of file fiusim.c.

#define FM_FP_HS_DATA_MSG_SIZE_BYTES 8

Definition at line 151 of file fiusim.c.

Referenced by siuG3FmInterface().

#define FM_FP_HS_DATA_MSG_SIZE_WORDS ((FM_FP_HS_DATA_MSG_SIZE_BYTES + 1) >> 1)

Definition at line 152 of file fiusim.c.

#define RTP_SEQNUM_OFFSET 1

Definition at line 220 of file fiusim.c.

Referenced by siuNetInterface().

Function Documentation

int fiuDebugTraceParser | ( | int | msgId,
 |  | int | msgData,
 |  | char * | dstPtr
 | ) |  |

Definition at line 1368 of file fiuDebugTraceParser.c.

References fiuDebugGetAAL2DecoderState(), fiuDebugGetAAL2PacketType(), fiuDebugGetCleardownReason(), fiuDebugGetFCF(), fiuDebugGetFCF2(), fiuDebugGetFRF11DecoderState(), fiuDebugGetFRF11PacketType(), fiuDebugGetFRP2FNDMsg(), fiuDebugGetFRPState(), fiuDebugGetIFPHeader(), fiuDebugGetMDEvent(), fiuDebugGetNetEvent(), fiuDebugGetNetProtocol(), fiuDebugGetPT(), fiuDebugGetSLPPageMode(), fiuDebugGetSwitchoverReason(), fiuDebugGetT2PDecoderState(), fiuDebugGetT2PLineState(), fiuDebugGetT38UDecoderState(), fiuDebugGetT38UException(), fiuDebugGetTimerEvent(), fiuDebugGetToneId(), and fiuMsgString.

Referenced by siuDebugInfo().

Here is the call graph for this function:

tulong siuGetTime ( void )

Definition at line 240 of file fiusim.c.

References systemTime.

tint siuNetInterface | ( | void * | targetInst,
 |  | xferpktInfo_t * | pktInfo
 | ) |  |

Definition at line 270 of file fiusim.c.

References faxNetProtocol, gw1ChNum, gw1RtpSeqNum, gw2ChNum, gw2RtpSeqNum, RTP_SEQNUM_OFFSET, SIU_WORD_TO_MAU, and siuInst.

Referenced by siu_open_fiu().

void fiuSimCreateFmFpDataMsgs | ( | iffaxFmFpMsg_t * | fmMsg,
 |  | tuint * | inIndex,
 |  | tword * | dataAddress,
 |  | tuint | dataSize
 | ) |  |

Definition at line 554 of file fiusim.c.

References DATA_SEGMENT_SIZE_BYTES, and msgTimestamp.

Referenced by siuG3FmInterface().

tint siuG3FmInterface | ( | void * | targetInst,
 |  | void * | message
 | ) |  |

Definition at line 594 of file fiusim.c.

References fDISSent, fG3FaxECM, fiuSimCreateFmFpDataMsgs(), FM_FP_HS_DATA_MSG_SIZE_BYTES, FM_FP_LS_CFR_MSG_SIZE_BYTES, FM_FP_LS_DCN_MSG_SIZE_BYTES, FM_FP_LS_DCS_MSG_SIZE_BYTES, FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES, FM_FP_LS_DIS_MSG_SIZE_BYTES, FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES, FM_FP_LS_EOP_MSG_SIZE_BYTES, FM_FP_LS_MCF_MSG_SIZE_BYTES, FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES, FmFpHsData, FmFpLsCFRMsg, FmFpLsDCNMsg, FmFpLsDCSMsg, FmFpLsDCSNonECMMsg, FmFpLsDISMsg, FmFpLsDISNonECMMsg, FmFpLsEOPMsg, FmFpLsMCFMsg, FmFpLsPPS_EOPMsg, gw1ChNum, gw1DataIndex, gw1FmFpMsgInIndex, gw1FmMsg, gw1RxData, gw1RxDataIndex, gw2DataIndex, gw2FmFpMsgInIndex, gw2FmMsg, gw2RxData, gw2RxDataIndex, msgTimestamp, siuInst, and systemTime.

Referenced by siu_open_fiu().

Here is the call graph for this function:

void siuFaxEventHandler | ( | void * | targetInst,
 |  | tuint | eventCode,
 |  | tuint | eventInfo
 | ) |  |

Definition at line 895 of file fiusim.c.

References fLoop, and numCleardownMsg.

Referenced by siu_open_fiu().

void siuDebugInfo | ( | void * | mId,
 |  | tuint | msgType,
 |  | tuint | msgCode,
 |  | tuint | msgLength,
 |  | tuint * | supportingData
 | ) |  |

Definition at line 926 of file fiusim.c.

References fiuDebugTraceParser(), prevTime, SIU_EXCEPTION_FIU_DBG_DEFAULT, SIU_EXCEPTION_FIU_DBG_FATAL_ERROR, and siuFatalError().

Here is the call graph for this function:

void siuFatalError | ( | tuint | id,
 |  | char * | str
 | ) |  |

Definition at line 1000 of file fiusim.c.

References siuFatalString.

Referenced by siu_new_fiu(), siu_open_fiu(), and siuDebugInfo().

void siuCriticalSectionBegin ( void )

Definition at line 1023 of file fiusim.c.

void siuCriticalSectionEnd ( void )

Definition at line 1040 of file fiusim.c.

void siu_init ( tint chnum )

Definition at line 1060 of file fiusim.c.

References siuInst_s::aux_heap_size, siuInst_s::fiu_heap_size, siuInst_s::fiuBufs, siuInst_s::fiuInst, siuInst_s::fiuNbufs, and siuInst.

Referenced by main().

void siu_new_fiu ( tint chnum )

Definition at line 1085 of file fiusim.c.

References siuInst_s::aux_heap_size, siuInst_s::fiu_heap_size, siuInst_s::fiuBufs, siuInst_s::fiuInst, siuInst_s::fiuNbufs, SIU_EXCEPTION_FIU_NEW_ERR, SIU_EXCEPTION_FIU_SIZES_ERR, SIU_FIU_ID, siuFatalError(), and siuInst.

Referenced by main().

Here is the call graph for this function:

void siu_open_fiu ( tint chnum )

Definition at line 1157 of file fiusim.c.

References faxNetCallTblPtr, faxNetProtocol, siuInst_s::fiuInst, gFrameSize, SIU_EXCEPTION_FIU_OPEN_ERR, SIU_FIU_ID, siuFatalError(), siuFaxEventHandler(), siuG3FmInterface(), siuInst, and siuNetInterface().

Referenced by main().

Here is the call graph for this function:

void siu_close_fiu ( tint chnum )

Definition at line 1233 of file fiusim.c.

References siuInst_s::fiuInst, and siuInst.

Referenced by main().

void siu_delete_fiu ( tint chnum )

Definition at line 1253 of file fiusim.c.

References siuInst_s::aux_heap_size, siuInst_s::fiu_heap_size, siuInst_s::fiuBufs, siuInst_s::fiuInst, siuInst_s::fiuNbufs, and siuInst.

Referenced by main().

void main ( void )

Definition at line 1290 of file fiusim.c.

References DATA_SEGMENT_SIZE_BYTES, fLoop, gFrameSize, gw1ChNum, gw1FaxStats, gw1FmFpMsgInIndex, gw1FmFpMsgOutIndex, gw1FmMsg, gw1RxData, gw2ChNum, gw2FaxStats, gw2FmFpMsgInIndex, gw2FmFpMsgOutIndex, gw2FmMsg, gw2RxData, siu_close_fiu(), siu_delete_fiu(), siu_init(), siu_new_fiu(), siu_open_fiu(), siuInst, and systemTime.

Here is the call graph for this function:

Variable Documentation

fiuNetProtocol_e faxNetProtocol = fiu_PT_T38_UDPTL

Definition at line 78 of file fiusim.c.

Referenced by siu_open_fiu(), and siuNetInterface().

iffaxFmFpMsg_t gw1FmMsg[SIU_FM_MESSAGE_ARRAY_SIZE]

Definition at line 89 of file fiusim.c.

Referenced by main(), and siuG3FmInterface().

iffaxFmFpMsg_t gw2FmMsg[SIU_FM_MESSAGE_ARRAY_SIZE]

Definition at line 90 of file fiusim.c.

Referenced by main(), and siuG3FmInterface().

tuint gw1FmFpMsgInIndex = 0

Definition at line 91 of file fiusim.c.

Referenced by main(), and siuG3FmInterface().

tuint gw1FmFpMsgOutIndex = 0

Definition at line 92 of file fiusim.c.

Referenced by main().

tuint gw2FmFpMsgInIndex = 0

Definition at line 93 of file fiusim.c.

Referenced by main(), and siuG3FmInterface().

tuint gw2FmFpMsgOutIndex = 0

Definition at line 94 of file fiusim.c.

Referenced by main().

tuint gw1DataIndex = 0

Definition at line 95 of file fiusim.c.

Referenced by siuG3FmInterface().

tuint gw2DataIndex = 0

Definition at line 96 of file fiusim.c.

Referenced by siuG3FmInterface().

tuint gw1ChNum = 1

Definition at line 97 of file fiusim.c.

Referenced by main(), siuG3FmInterface(), and siuNetInterface().

tuint gw2ChNum = 2

Definition at line 98 of file fiusim.c.

Referenced by main(), and siuNetInterface().

tuint msgTimestamp = 0

Definition at line 99 of file fiusim.c.

Referenced by fiuSimCreateFmFpDataMsgs(), and siuG3FmInterface().

tword gw1RxData[100]

Definition at line 101 of file fiusim.c.

Referenced by main(), and siuG3FmInterface().

tint gw1RxDataIndex = 0

Definition at line 102 of file fiusim.c.

Referenced by siuG3FmInterface().

tword gw2RxData[100]

Definition at line 103 of file fiusim.c.

Referenced by main(), and siuG3FmInterface().

tint gw2RxDataIndex = 0

Definition at line 104 of file fiusim.c.

Referenced by siuG3FmInterface().

tbool fDISSent = FALSE

Definition at line 106 of file fiusim.c.

Referenced by siuG3FmInterface().

tbool fG3FaxECM = FALSE

Definition at line 111 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsDISMsg[FM_FP_LS_DIS_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x01, 0x00, 0x72, 0x5F, 0x21, 0x01, 0xD8}

Definition at line 117 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsDISNonECMMsg[FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x01, 0x00, 0x77, 0x41, 0x23, 0x01, 0xF9, 0x01, 0x01, 0x00}

Definition at line 121 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsDCSMsg[FM_FP_LS_DCS_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xC1, 0x00, 0x70, 0x1F, 0x21, 0x01, 0x10}

Definition at line 125 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsDCSNonECMMsg[FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xC1, 0x00, 0x44, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00}

Definition at line 129 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsCFRMsg[FM_FP_LS_CFR_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x21}

Definition at line 133 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsPPS_EOPMsg[FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xFD, 0xF4, 0x00, 0x00, 0x64}

Definition at line 137 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsEOPMsg[FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xF4}

Definition at line 141 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsMCFMsg[FM_FP_LS_MCF_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x31}

Definition at line 145 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpLsDCNMsg[FM_FP_LS_DCN_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x5F, 0x20}

Definition at line 149 of file fiusim.c.

Referenced by siuG3FmInterface().

tword FmFpHsData[FM_FP_HS_DATA_MSG_SIZE_BYTES] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}

Definition at line 153 of file fiusim.c.

Referenced by siuG3FmInterface().

siuInst_t siuInst[SIU_NUMBER_OF_CHANNELS]

Definition at line 160 of file fiusim.c.

Referenced by main(), siu_close_fiu(), siu_delete_fiu(), siu_init(), siu_new_fiu(), siu_open_fiu(), siuG3FmInterface(), and siuNetInterface().

tulong systemTime = 0

Definition at line 163 of file fiusim.c.

Referenced by main(), siuG3FmInterface(), and siuGetTime().

tuint prevTime = 0

Definition at line 164 of file fiusim.c.

Referenced by siuDebugInfo().

tbool fLoop = TRUE

Definition at line 173 of file fiusim.c.

Referenced by main(), and siuFaxEventHandler().

tuint gFrameSize = 10

Definition at line 179 of file fiusim.c.

Referenced by main(), and siu_open_fiu().

tuint numCleardownMsg = 0

Definition at line 183 of file fiusim.c.

Referenced by siuFaxEventHandler().

fiuNetCallTbl_t* faxNetCallTblPtr[]

Initial value:

{
   &faxNetProtocolT38,
   &faxNetProtocolAal2,
   &faxNetProtocolT3,

}

Definition at line 190 of file fiusim.c.

Referenced by siu_open_fiu().

char siuFatalString = 0

Definition at line 201 of file fiusim.c.

Referenced by siuFatalError().

fiuStats_t gw1FaxStats

Definition at line 204 of file fiusim.c.

Referenced by main().

fiuStats_t gw2FaxStats

Definition at line 205 of file fiusim.c.

Referenced by main().

fiuContext_t fiuContext

Initial value:

 {
   NULL,
   NULL,
   0,
   siuGetTime,
   siuDebugInfo,
   siuCriticalSectionBegin,
   siuCriticalSectionEnd
}

Definition at line 207 of file fiusim.c.

tuint gw1RtpSeqNum = 0

Definition at line 218 of file fiusim.c.

Referenced by siuNetInterface().

tuint gw2RtpSeqNum = 0

Definition at line 219 of file fiusim.c.

Referenced by siuNetInterface().


FIU Test: fiusim.c Source File

  • File List
  • Globals

fiusim.c

Go to the documentation of this file.
00001 /******************************************************************************
00002  * FILE PURPOSE: Main routine for simulating fax relay processing
00003  ******************************************************************************
00004  * FILE NAME: fiusim.c
00005  *
00006  * DESCRIPTION: This source file contains functions, variables, and processing code
00007  *              designed to provide a simulation of the fax relay software (FIU).
00008  *
00009  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00010  *
00011  *              All rights reserved not granted herein.
00012  *
00013  *                         Limited License.
00014  *
00015  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00016  *  non-exclusive license under copyrights and patents it now or hereafter owns
00017  *  or controls to make, have made, use, import, offer to sell and sell
00018  *  ("Utilize") this software subject to the terms herein.  With respect to the
00019  *  foregoing patent license, such license is granted solely to the extent that
00020  *  any such patent is necessary to Utilize the software alone.  The patent
00021  *  license shall not apply to any combinations which include this software,
00022  *  other than combinations with devices manufactured by or for TI (“TI
00023  *  Devices”).  No hardware patent is licensed hereunder.
00024  *
00025  *  Redistributions must preserve existing copyright notices and reproduce this
00026  *  license (including the above copyright notice and the disclaimer and (if
00027  *  applicable) source code license limitations below) in the documentation
00028  *  and/or other materials provided with the distribution
00029  *
00030  *  Redistribution and use in binary form, without modification, are permitted
00031  *  provided that the following conditions are met:
00032  *
00033  *    *  No reverse engineering, decompilation, or disassembly of this software
00034  *  is permitted with respect to any software provided in binary form.
00035  *
00036  *    *  any redistribution and use are licensed by TI for use only with TI
00037  *  Devices.
00038  *
00039  *    *  Nothing shall obligate TI to provide you with source code for the
00040  *  software licensed and provided to you in object code.
00041  *
00042  *  If software source code is provided to you, modification and redistribution
00043  *  of the source code are permitted provided that the following conditions are
00044  *  met:
00045  *
00046  *    *  any redistribution and use of the source code, including any resulting
00047  *  derivative works, are licensed by TI for use only with TI Devices.
00048  *
00049  *    *  any redistribution and use of any object code compiled from the source
00050  *  code and any resulting derivative works, are licensed by TI for use only
00051  *  with TI Devices.
00052  *
00053  *  Neither the name of Texas Instruments Incorporated nor the names of its
00054  *  suppliers may be used to endorse or promote products derived from this
00055  *  software without specific prior written permission.
00056  *
00057  *  DISCLAIMER.
00058  *
00059  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00060  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00061  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00062  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00063  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00064  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00065  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00066  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00067  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00068  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00069  *  DAMAGE.
00070  *****************************************************************************/
00071 #include <stdio.h>
00072 #include <ti/mas/fiu/test/src/fiusim.h>
00073 #include <ti/mas/util/ecomem.h>
00074
00075 //#define V34_FAX_SIMULATION
00076
00077 /* Network protocol */
00078 fiuNetProtocol_e faxNetProtocol = fiu_PT_T38_UDPTL;     /* T.38 UDPTL protocol */
00079 //fiuNetProtocol_e faxNetProtocol = fiu_PT_T38_RTP;       /* T.38 RTP protocol */
00080 //fiuNetProtocol_e faxNetProtocol = fiu_PT_T38_UDPTL_RTP; /* T.38 UDPTL RTP protocol */
00081 //fiuNetProtocol_e faxNetProtocol = fiu_PT_AAL2;          /* AAL2 protocol */
00082 //fiuNetProtocol_e faxNetProtocol = fiu_PT_T2;            /* Telogy-2 protocol */
00083 //fiuNetProtocol_e faxNetProtocol = fiu_PT_T3;            /* Telogy-3 protocol */
00084 //fiuNetProtocol_e faxNetProtocol = fiu_PT_RTP;           /* RTP protocol */
00085 //fiuNetProtocol_e faxNetProtocol = fiu_PT_RTPB;          /* RTP version B protocol */
00086 //fiuNetProtocol_e faxNetProtocol = fiu_PT_FRF11;         /* FRF.11 fax relay protocol */
00087
00088 /* Global FM_FP message array */
00089 iffaxFmFpMsg_t gw1FmMsg[SIU_FM_MESSAGE_ARRAY_SIZE];
00090 iffaxFmFpMsg_t gw2FmMsg[SIU_FM_MESSAGE_ARRAY_SIZE];
00091 tuint     gw1FmFpMsgInIndex = 0;
00092 tuint     gw1FmFpMsgOutIndex = 0;
00093 tuint     gw2FmFpMsgInIndex = 0;
00094 tuint     gw2FmFpMsgOutIndex = 0;
00095 tuint     gw1DataIndex = 0;
00096 tuint     gw2DataIndex = 0;
00097 tuint     gw1ChNum = 1;
00098 tuint     gw2ChNum = 2;
00099 tuint     msgTimestamp = 0;
00100
00101 tword gw1RxData[100];
00102 tint gw1RxDataIndex = 0;
00103 tword gw2RxData[100];
00104 tint gw2RxDataIndex = 0;
00105
00106 tbool fDISSent = FALSE;
00107 #define DATA_SEGMENT_SIZE_BYTES 1
00108
00109 /* Flag for enabling ECM */
00110 /* Note: This simulation does not support ECM mode in AAL2 */
00111 tbool fG3FaxECM = FALSE;
00112
00113 /* Global FM_FP data messages with associated variables
00114    for both control channel and primary channel data */
00115 #define FM_FP_LS_DIS_MSG_SIZE_BYTES 9
00116 #define FM_FP_LS_DIS_MSG_SIZE_WORDS ((FM_FP_LS_DIS_MSG_SIZE_BYTES + 1) >> 1)
00117 tword   FmFpLsDISMsg[FM_FP_LS_DIS_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x01, 0x00, 0x72, 0x5F, 0x21, 0x01, 0xD8};
00118
00119 #define FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES 12
00120 #define FM_FP_LS_DIS_NONECM_MSG_SIZE_WORDS ((FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES + 1) >> 1)
00121 tword   FmFpLsDISNonECMMsg[FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x01, 0x00, 0x77, 0x41, 0x23, 0x01, 0xF9, 0x01, 0x01, 0x00};
00122
00123 #define FM_FP_LS_DCS_MSG_SIZE_BYTES 9
00124 #define FM_FP_LS_DCS_MSG_SIZE_WORDS ((FM_FP_LS_DCS_MSG_SIZE_BYTES + 1) >> 1)
00125 tword   FmFpLsDCSMsg[FM_FP_LS_DCS_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xC1, 0x00, 0x70, 0x1F, 0x21, 0x01, 0x10};
00126
00127 #define FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES 12
00128 #define FM_FP_LS_DCS_NONECM_MSG_SIZE_WORDS ((FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES + 1) >> 1)
00129 tword   FmFpLsDCSNonECMMsg[FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xC1, 0x00, 0x44, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00};
00130
00131 #define FM_FP_LS_CFR_MSG_SIZE_BYTES 3
00132 #define FM_FP_LS_CFR_MSG_SIZE_WORDS ((FM_FP_LS_CFR_MSG_SIZE_BYTES + 1) >> 1)
00133 tword   FmFpLsCFRMsg[FM_FP_LS_CFR_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x21};
00134
00135 #define FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES 7
00136 #define FM_FP_LS_PPS_EOP_MSG_SIZE_WORDS ((FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES + 1) >> 1)
00137 tword   FmFpLsPPS_EOPMsg[FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xFD, 0xF4, 0x00, 0x00, 0x64};
00138
00139 #define FM_FP_LS_EOP_MSG_SIZE_BYTES 3
00140 #define FM_FP_LS_EOP_MSG_SIZE_WORDS ((FM_FP_LS_EOP_MSG_SIZE_BYTES + 1) >> 1)
00141 tword   FmFpLsEOPMsg[FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0xF4};
00142
00143 #define FM_FP_LS_MCF_MSG_SIZE_BYTES 3
00144 #define FM_FP_LS_MCF_MSG_SIZE_WORDS ((FM_FP_LS_MCF_MSG_SIZE_BYTES + 1) >> 1)
00145 tword   FmFpLsMCFMsg[FM_FP_LS_MCF_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x31};
00146
00147 #define FM_FP_LS_DCN_MSG_SIZE_BYTES 4
00148 #define FM_FP_LS_DCN_MSG_SIZE_WORDS ((FM_FP_LS_DCN_MSG_SIZE_BYTES + 1) >> 1)
00149 tword   FmFpLsDCNMsg[FM_FP_LS_DCN_MSG_SIZE_BYTES] = {0xFF, 0xC8, 0x5F, 0x20};
00150
00151 #define FM_FP_HS_DATA_MSG_SIZE_BYTES 8
00152 #define FM_FP_HS_DATA_MSG_SIZE_WORDS ((FM_FP_HS_DATA_MSG_SIZE_BYTES + 1) >> 1)
00153 tword   FmFpHsData[FM_FP_HS_DATA_MSG_SIZE_BYTES] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
00154
00155 /******************************************************************************
00156  * GLOBAL VARIABLE DEFINITIONS
00157  *****************************************************************************/
00158
00159 /* Global SIU channel instance */
00160 siuInst_t siuInst[SIU_NUMBER_OF_CHANNELS];
00161
00162 /* Global system timer variable in ms */
00163 tulong systemTime = 0;
00164 tuint prevTime = 0;
00165
00166 #ifdef SIM_MEM_HEAP
00167 #define SIU_MEM_HEAP_SIZE 0x2000
00168 tuint siuMemHeap[SIU_MEM_HEAP_SIZE];
00169 void *siuMemHeapHandle;
00170 #endif
00171
00172 /* Global boolean used to break out of main() processing loop */
00173 tbool fLoop = TRUE;
00174
00175 /* Global frame size variable in ms */
00176 #ifdef V34_FAX_SIMULATION
00177 tuint gFrameSize = 6;
00178 #else
00179 tuint gFrameSize = 10;
00180 #endif
00181
00182 /* Global counter of cleardown messages */
00183 tuint numCleardownMsg = 0;
00184
00185 /* Global fax network protocol call table - only one protocol at a time
00186    is supported.  Un-comment out the protocol of your choice.  All calls
00187    to the fiuNetCallTbl_t functions (faxNetInit, faxNetDecoder,
00188    faxNetDecoderTask, faxNetEncoder & faxNetEncoderTask) are directed
00189    to NULL (i.e. not processed). */
00190 fiuNetCallTbl_t *faxNetCallTblPtr[] =
00191 {
00192    &faxNetProtocolT38,
00193    &faxNetProtocolAal2,
00194    &faxNetProtocolT3,
00195 #ifdef FRF11
00196    &faxNetProtocolFrf11
00197 #endif
00198 };
00199
00200 /* Global char signifying entity calling siuFatalError() function */
00201 char siuFatalString = 0;
00202
00203 /* Global network and fax call statistics structures */
00204 fiuStats_t gw1FaxStats;
00205 fiuStats_t gw2FaxStats;
00206
00207 fiuContext_t fiuContext = {
00208    NULL,                    /* Global allocBuffer function - external buffering not implemented */
00209    NULL,                    /* Global freeBuffer function  - external buffering not implemented */
00210    0,                       /* SupportedExternalBuffSize - external buffering not implemented */
00211    siuGetTime,              /* Timer function pointer */
00212    siuDebugInfo,            /* Debug function pointer */
00213    siuCriticalSectionBegin, /* Critical section Begin macro */
00214    siuCriticalSectionEnd    /* Critical section End macro */
00215 };
00216
00217 /* RTP sequence number */
00218 tuint gw1RtpSeqNum = 0;
00219 tuint gw2RtpSeqNum = 0;
00220 #define RTP_SEQNUM_OFFSET 1
00221
00222 extern int fiuDebugTraceParser (int msgId, int msgData, char *dstPtr);
00223
00224 /******************************************************************************
00225  * GLOBAL FUNCTION DEFINITIONS
00226  *****************************************************************************/
00227
00228 /******************************************************************************
00229  * FUNCTION PURPOSE: Gets SIU system time in milliseconds.
00230  ******************************************************************************
00231  * DESCRIPTION: Returns current value of system time (in milliseconds).
00232  *
00233  * CALLING FORMAT:
00234  *   siuGetTime ()
00235  *
00236  * RETURN VALUES:
00237  *   systemTime        - 32-bit indication of system time (in ms)
00238  *
00239  *****************************************************************************/
00240 tulong siuGetTime (void)
00241 {
00242    return (systemTime);
00243
00244 } /* siuGetTime() */
00245
00246 /******************************************************************************
00247  * FUNCTION PURPOSE: Implements fiuSendOut() API function, which sends network
00248  *                   packets to the network interface.
00249  ******************************************************************************
00250  * DESCRIPTION: Routine called by FIU to send packet(s) toward the network.
00251  *              FIU sends packets out (in the SendOut direction) to whatever
00252  *              packet processing module is tied to fiuSendOut - in this case
00253  *              siuNetInterface, which accepts packets but does no processing.
00254  *              Return value signifies that there was not an error.
00255  *
00256  * CALLING FORMAT:
00257  *   siuNetInterface (void          *targetInst, - ptr to packet processing module
00258  *                    xferpktInfo_t *pktInfo)    - packet descriptor structure
00259
00260
00261
00262
00263  *
00264  * RETURN VALUES:
00265  *                    0                    - Pkt(s) successfully processed
00266  *                                           by network
00267  *                    1                    - network busy; pkt not processed
00268  *
00269  *****************************************************************************/
00270 tint siuNetInterface (void *targetInst, xferpktInfo_t *pktInfo)
00271 {
00272    siuInst_t *inst = (siuInst_t *)targetInst;
00273
00274    if (faxNetProtocol == fiu_PT_AAL2)
00275    {
00276       tuint cid;
00277       tuint uui;
00278       tuint li;
00279       ifpktSendPktHeader_t *txAcuHdr = (ifpktSendPktHeader_t *)pktInfo->pktIn[0];
00280       ifpktReceivePktHeader_t *rxAcuHdr = (ifpktReceivePktHeader_t *)pktInfo->pktIn[0];
00281
00282       cid = txAcuHdr->proto.aal2.cid;
00283       uui = txAcuHdr->proto.aal2.uui;
00284       li  = txAcuHdr->proto.aal2.li;
00285
00286       rxAcuHdr->common.rxLastTime = 0;
00287       rxAcuHdr->proto.aal2.cid = cid;
00288       rxAcuHdr->proto.aal2.uui = uui;
00289       rxAcuHdr->proto.aal2.li  = li;
00290    }
00291
00292    if (inst == &siuInst[gw1ChNum - 1])
00293    {
00294       if (faxNetProtocol == fiu_PT_T38_RTP)
00295       {
00296          tword *rtpPkt = pktInfo->pktIn[1];
00297
00298          /* Fill in the sequence number of the RTP header */
00299          pktWrite16bits(&rtpPkt[SIU_WORD_TO_MAU(RTP_SEQNUM_OFFSET)], 0, gw1RtpSeqNum);
00300
00301          /* Update the RTP sequence number */
00302          gw1RtpSeqNum++;
00303       }
00304
00305       fiuReceiveIn (siuInst[gw2ChNum - 1].fiuInst, pktInfo);
00306    }
00307    else
00308    {
00309       if (faxNetProtocol == fiu_PT_T38_RTP)
00310       {
00311          tword *rtpPkt = pktInfo->pktIn[1];
00312
00313          /* Fill in the sequence number of the RTP header */
00314          pktWrite16bits(&rtpPkt[SIU_WORD_TO_MAU(RTP_SEQNUM_OFFSET)], 0, gw2RtpSeqNum);
00315
00316          /* Update the RTP sequence number */
00317          gw2RtpSeqNum++;
00318       }
00319
00320       fiuReceiveIn (siuInst[gw1ChNum - 1].fiuInst, pktInfo);
00321    }
00322
00323    return (0);
00324
00325 } /* siuNetInterface() */
00326
00327 /******************************************************************************
00328  * FUNCTION PURPOSE: Implements fiuReceiveOut() API function which sends a
00329  *                   messsage to FM.
00330  ******************************************************************************
00331  * DESCRIPTION: Routine called by FIU to send a message of type iffaxFpFmMsg_t to
00332  *              FM. No actual message processing is done.  The function always
00333  *              successfully.
00334  *
00335  * CALLING FORMAT:
00336  *   siuV34FmInterface (void *targetInst,  - ptr to FM processing module
00337  *                      void *message)     - ptr to message for FM
00338  *
00339  * RETURN: tint
00340  *              iffax_FM_CMD_ACCEPTED (0)     if the message is copied into message FIFO
00341  *              iffax_FM_CMD_NOT_ACCEPTED (1) if the message is not copied into the
00342  *                                            message FIFO because the FIFO is full
00343  *              iffax_FM_CMD_ERROR (-1)       if message is not copied because FM
00344  *                                            is closed or invalid message ID
00345  ***************************************************************************/
00346 #ifdef V34_FAX_SIMULATION
00347 tint siuV34FmInterface (void *targetInst, void *message)
00348 {
00349    siuInst_t *inst = (siuInst_t *) targetInst;
00350    iffaxFpFmMsg_t *fiuMsg = (iffaxFpFmMsg_t *)message;
00351    tint i, numBytes;
00352    tword *src;
00353
00354    if (inst == &siuInst[gw1ChNum - 1])
00355    {
00356       switch (fiuMsg->MsgId)
00357       {
00358          case iffax_FP_FM_V34_ESTABLISH_LINK:
00359             break;
00360
00361          case iffax_FP_FM_SEND_ANSAM:
00362             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_V8_CM_RECEIVED;
00363             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.V8Data.callFunction = 4;
00364             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.V8Data.modMode = 0x0004;
00365             gw1FmFpMsgInIndex++;
00366             break;
00367
00368          case iffax_FP_FM_SEND_JM:
00369             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_V34_PRI_RATE_KNOWN;
00370             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.V34Info.priRate = 33600;
00371             gw1FmFpMsgInIndex++;
00372
00373             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_V34_E_DETECTED;
00374             gw1FmFpMsgInIndex++;
00375             break;
00376
00377          case iffax_FP_FM_V34_DATA:
00378             numBytes = fiuMsg->MsgBody.V34Data.numBytes;
00379             src = fiuMsg->MsgBody.V34Data.DataAddr;
00380
00381             for (i = 0; i < (utlNbytes2NtwordsCeil(numBytes)); i++)
00382                gw1RxData[gw1RxDataIndex++] = src[i];
00383
00384             switch (gw1DataIndex)
00385             {
00386                case 0:
00387                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_DATA;
00388                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.numBytes = FM_FP_LS_DCS_MSG_SIZE_BYTES;
00389                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.DataAddress = &FmFpLsDCSMsg[0];
00390                   gw1FmFpMsgInIndex++;
00391
00392                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00393                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00394                   gw1FmFpMsgInIndex++;
00395
00396                   gw1DataIndex++;
00397                   break;
00398
00399                case 1:
00400                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_40_ONES_DETECTED;
00401                   gw1FmFpMsgInIndex++;
00402
00403                   gw1DataIndex++;
00404                   break;
00405
00406                case 2:
00407                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_DATA;
00408                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.numBytes = FM_FP_LS_DCN_MSG_SIZE_BYTES;
00409                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.DataAddress = &FmFpLsDCNMsg[0];
00410                   gw1FmFpMsgInIndex++;
00411
00412                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00413                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00414                   gw1FmFpMsgInIndex++;
00415
00416                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_40_ONES_DETECTED;
00417                   gw1FmFpMsgInIndex++;
00418
00419                   gw1DataIndex++;
00420                   break;
00421             }
00422             break;
00423
00424          case iffax_FP_FM_SWITCH_TO_PRI_CH:
00425             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_DATA;
00426             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.numBytes = FM_FP_HS_DATA_MSG_SIZE_BYTES;
00427             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.DataAddress = &FmFpHsData[0];
00428             gw1FmFpMsgInIndex++;
00429
00430             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00431             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00432             gw1FmFpMsgInIndex++;
00433
00434             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_V34_PRI_CH_TURN_OFF;
00435             gw1FmFpMsgInIndex++;
00436
00437             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_DATA;
00438             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.numBytes = FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES;
00439             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.DataPayload.DataAddress = &FmFpLsPPS_EOPMsg[0];
00440             gw1FmFpMsgInIndex++;
00441
00442             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00443             gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00444             gw1FmFpMsgInIndex++;
00445             break;
00446
00447          default:
00448             break;
00449       }
00450    }
00451    else /* gateway 2 */
00452    {
00453       switch (fiuMsg->MsgId)
00454       {
00455          case iffax_FP_FM_V34_ESTABLISH_LINK:
00456             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_TONE_DETECT;
00457             gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.ToneDetect.ToneId = iffax_TONE_ANSAM;
00458             gw2FmFpMsgInIndex++;
00459             break;
00460
00461          case iffax_FP_FM_SEND_CM:
00462             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_V8_JM_RECEIVED;
00463             gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.V8Data.callFunction = 4;
00464             gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.V8Data.modMode = 0x0004;
00465             gw2FmFpMsgInIndex++;
00466
00467             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_V34_PRI_RATE_KNOWN;
00468             gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.V34Info.priRate = 33600;
00469             gw2FmFpMsgInIndex++;
00470
00471             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_V34_E_DETECTED;
00472             gw2FmFpMsgInIndex++;
00473
00474             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_DATA;
00475             gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.DataPayload.numBytes = FM_FP_LS_DIS_MSG_SIZE_BYTES;
00476             gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.DataPayload.DataAddress = &FmFpLsDISMsg[0];
00477             gw2FmFpMsgInIndex++;
00478
00479             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00480             gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00481             gw2FmFpMsgInIndex++;
00482             break;
00483
00484          case iffax_FP_FM_SEND_ONES:
00485             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_SILENCE_DETECTED;
00486             gw2FmFpMsgInIndex++;
00487             break;
00488
00489          case iffax_FP_FM_SWITCH_TO_PRI_CH:
00490             break;
00491
00492          case iffax_FP_FM_V34_DATA:
00493             numBytes = fiuMsg->MsgBody.V34Data.numBytes;
00494             src = fiuMsg->MsgBody.V34Data.DataAddr;
00495
00496             for (i = 0; i < (utlNbytes2NtwordsCeil(numBytes)); i++)
00497                gw2RxData[gw2RxDataIndex++] = src[i];
00498
00499             switch (gw2DataIndex)
00500             {
00501                case 0:
00502                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_DATA;
00503                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.DataPayload.numBytes = FM_FP_LS_CFR_MSG_SIZE_BYTES;
00504                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.DataPayload.DataAddress = &FmFpLsCFRMsg[0];
00505                   gw2FmFpMsgInIndex++;
00506
00507                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00508                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00509                   gw2FmFpMsgInIndex++;
00510
00511                   gw2DataIndex++;
00512                   break;
00513
00514                case 1:
00515                   /* image data */
00516                   gw2DataIndex++;
00517                   break;
00518
00519                case 2:
00520                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_DATA;
00521                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.DataPayload.numBytes = FM_FP_LS_MCF_MSG_SIZE_BYTES;
00522                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.DataPayload.DataAddress = &FmFpLsMCFMsg[0];
00523                   gw2FmFpMsgInIndex++;
00524
00525                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00526                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00527                   gw2FmFpMsgInIndex++;
00528
00529                   gw2DataIndex++;
00530                   break;
00531             }
00532             break;
00533
00534          case iffax_FP_FM_SYNC:
00535             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_SYNC_ACK;
00536             gw2FmFpMsgInIndex++;
00537             break;
00538
00539          case iffax_FP_FM_SWITCH_TO_CTRL_CH:
00540             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_V34_PRI_CH_TURN_OFF;
00541             gw2FmFpMsgInIndex++;
00542             break;
00543
00544          default:
00545             break;
00546       }
00547    }
00548
00549    return (iffax_FM_CMD_ACCEPTED);
00550
00551 } /* siuV34FmInterface() */
00552 #endif /* V34_FAX_SIMULATION */
00553
00554 void fiuSimCreateFmFpDataMsgs(iffaxFmFpMsg_t *fmMsg, tuint *inIndex, tword *dataAddress, tuint dataSize)
00555 {
00556    tuint i;
00557    tuint numBytes;
00558
00559    for (i = 0; i < dataSize; i += DATA_SEGMENT_SIZE_BYTES)
00560    {
00561       if ((i + DATA_SEGMENT_SIZE_BYTES) < dataSize)
00562          numBytes = DATA_SEGMENT_SIZE_BYTES;
00563       else
00564          numBytes = dataSize - i;
00565
00566       fmMsg[*inIndex].MsgId = iffax_FM_FP_DATA;
00567       fmMsg[*inIndex].MsgBody.DataPayload.numBytes = numBytes;
00568       fmMsg[*inIndex].MsgBody.DataPayload.DataAddress = &dataAddress[i];
00569       fmMsg[*inIndex].Timestamp = msgTimestamp;
00570       msgTimestamp += 30 * DATA_SEGMENT_SIZE_BYTES;
00571       *inIndex += 1;
00572    }
00573 }
00574
00575 /******************************************************************************
00576  * FUNCTION PURPOSE: Implements fiuReceiveOut() API function which sends a
00577  *                   messsage to FM.
00578  ******************************************************************************
00579  * DESCRIPTION: Routine called by FIU to send a message of type iffaxFpFmMsg_t to
00580  *              FM. No actual message processing is done.  The function always
00581  *              successfully.
00582  *
00583  * CALLING FORMAT:
00584  *   siuG3FmInterface (void *targetInst, - ptr to FM processing module
00585  *                     void *message)    - ptr to message for FM
00586  *
00587  * RETURN: tint
00588  *              iffax_FM_CMD_ACCEPTED (0)     if the message is copied into message FIFO
00589  *              iffax_FM_CMD_NOT_ACCEPTED (1) if the message is not copied into the
00590  *                                            message FIFO because the FIFO is full
00591  *              iffax_FM_CMD_ERROR (-1)       if message is not copied because FM
00592  *                                            is closed or invalid message ID
00593  ***************************************************************************/
00594 tint siuG3FmInterface (void *targetInst, void *message)
00595 {
00596    siuInst_t *inst = (siuInst_t *) targetInst;
00597    iffaxFpFmMsg_t *fiuMsg = (iffaxFpFmMsg_t *)message;
00598    tint i, numBytes;
00599    tword *src;
00600
00601    if (inst == &siuInst[gw1ChNum - 1])
00602    {
00603       switch (fiuMsg->MsgId)
00604       {
00605          case iffax_FP_FM_DATA:
00606             numBytes = fiuMsg->MsgBody.DataPayload.numBytes;
00607             src = fiuMsg->MsgBody.DataPayload.DataAddr;
00608
00609             for (i = 0; i < (utlNbytes2NtwordsCeil(numBytes)); i++)
00610                gw1RxData[gw1RxDataIndex++] = src[i];
00611             break;
00612
00613          case iffax_FP_FM_FRAME_COMP:
00614             switch (gw1DataIndex)
00615             {
00616                case 0:
00617                   /* Introduce turnaround time */
00618                   msgTimestamp = systemTime + 100;
00619
00620                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_PREAMBLE_DETECT;
00621                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00622                   msgTimestamp += 300;
00623                   gw1FmFpMsgInIndex++;
00624
00625                   if (fG3FaxECM)
00626                      fiuSimCreateFmFpDataMsgs(gw1FmMsg, &gw1FmFpMsgInIndex, FmFpLsDCSMsg, FM_FP_LS_DCS_MSG_SIZE_BYTES);
00627                   else
00628                      fiuSimCreateFmFpDataMsgs(gw1FmMsg, &gw1FmFpMsgInIndex, FmFpLsDCSNonECMMsg, FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES);
00629
00630                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00631                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00632                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00633                   msgTimestamp += 30;
00634                   gw1FmFpMsgInIndex++;
00635
00636                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00637                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00638                   msgTimestamp += 70;
00639                   gw1FmFpMsgInIndex++;
00640
00641                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_HS_TRAIN_DETECT;
00642                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00643                   msgTimestamp += 1500;
00644                   gw1FmFpMsgInIndex++;
00645
00646                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00647                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00648                   msgTimestamp += 30;
00649                   gw1FmFpMsgInIndex++;
00650
00651                   gw1DataIndex++;
00652                   break;
00653
00654                case 1:
00655                   /* Introduce turnaround time */
00656                   msgTimestamp = systemTime + 100;
00657
00658                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_TEP_DETECT;
00659                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00660                   msgTimestamp += 100;
00661                   gw1FmFpMsgInIndex++;
00662
00663                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_HS_TRAIN_DETECT;
00664                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00665                   msgTimestamp += 500;
00666                   gw1FmFpMsgInIndex++;
00667
00668                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_DETECT;
00669                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00670                   msgTimestamp += 30;
00671                   gw1FmFpMsgInIndex++;
00672
00673                   fiuSimCreateFmFpDataMsgs(gw1FmMsg, &gw1FmFpMsgInIndex, FmFpHsData, FM_FP_HS_DATA_MSG_SIZE_BYTES);
00674
00675                   if (fG3FaxECM)
00676                   {
00677                      gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00678                      gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00679                      gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00680                      msgTimestamp += 30;
00681                      gw1FmFpMsgInIndex++;
00682                   }
00683
00684                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00685                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00686                   msgTimestamp += 70;
00687                   gw1FmFpMsgInIndex++;
00688
00689                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_PREAMBLE_DETECT;
00690                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00691                   msgTimestamp += 300;
00692                   gw1FmFpMsgInIndex++;
00693
00694                   if (fG3FaxECM)
00695                      fiuSimCreateFmFpDataMsgs(gw1FmMsg, &gw1FmFpMsgInIndex, FmFpLsPPS_EOPMsg, FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES);
00696                   else
00697                      fiuSimCreateFmFpDataMsgs(gw1FmMsg, &gw1FmFpMsgInIndex, FmFpLsEOPMsg, FM_FP_LS_EOP_MSG_SIZE_BYTES);
00698
00699                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00700                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00701                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00702                   msgTimestamp += 30;
00703                   gw1FmFpMsgInIndex++;
00704
00705                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00706                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00707                   msgTimestamp += 30;
00708                   gw1FmFpMsgInIndex++;
00709
00710                   gw1DataIndex++;
00711                   break;
00712
00713                case 2:
00714                   /* Introduce turnaround time */
00715                   msgTimestamp = systemTime + 100;
00716
00717                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_PREAMBLE_DETECT;
00718                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00719                   msgTimestamp += 300;
00720                   gw1FmFpMsgInIndex++;
00721
00722                   fiuSimCreateFmFpDataMsgs(gw1FmMsg, &gw1FmFpMsgInIndex, FmFpLsDCNMsg, FM_FP_LS_DCN_MSG_SIZE_BYTES);
00723
00724                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00725                   gw1FmMsg[gw1FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00726                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00727                   msgTimestamp += 30;
00728                   gw1FmFpMsgInIndex++;
00729
00730                   gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00731                   gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = msgTimestamp;
00732                   msgTimestamp += 30;
00733                   gw1FmFpMsgInIndex++;
00734
00735                   gw1DataIndex++;
00736                   break;
00737             }
00738             break;
00739
00740          case iffax_FP_FM_SYNC:
00741             gw1FmMsg[gw1FmFpMsgInIndex].MsgId = iffax_FM_FP_SYNC_ACK;
00742             gw1FmMsg[gw1FmFpMsgInIndex].Timestamp = systemTime;
00743             gw1FmFpMsgInIndex++;
00744             break;
00745
00746          default:
00747             break;
00748       }
00749    }
00750    else /* gateway 2 */
00751    {
00752       switch (fiuMsg->MsgId)
00753       {
00754          case iffax_FP_FM_MODE:
00755             switch (fiuMsg->MsgBody.Mode.Modulation)
00756             {
00757                case iffax_MODEM_MODE_V21:
00758                   if (fDISSent == FALSE)
00759                   {
00760                      msgTimestamp = systemTime;
00761
00762                      gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_PREAMBLE_DETECT;
00763                      gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00764                      msgTimestamp += 300;
00765                      gw2FmFpMsgInIndex++;
00766
00767                      if (fG3FaxECM)
00768                         fiuSimCreateFmFpDataMsgs(gw2FmMsg, &gw2FmFpMsgInIndex, FmFpLsDISMsg, FM_FP_LS_DIS_MSG_SIZE_BYTES);
00769                      else
00770                         fiuSimCreateFmFpDataMsgs(gw2FmMsg, &gw2FmFpMsgInIndex, FmFpLsDISNonECMMsg, FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES);
00771
00772                      gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00773                      gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00774                      gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00775                      msgTimestamp += 30;
00776                      gw2FmFpMsgInIndex++;
00777
00778                      gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00779                      gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00780                      msgTimestamp += 30;
00781                      gw2FmFpMsgInIndex++;
00782
00783                      fDISSent = TRUE;
00784                   }
00785                   break;
00786
00787                default:
00788                   break;
00789             }
00790             break;
00791
00792          case iffax_FP_FM_DATA:
00793             numBytes = fiuMsg->MsgBody.DataPayload.numBytes;
00794             src = (tword *)fiuMsg->MsgBody.DataPayload.DataAddr;
00795
00796             for (i = 0; i < (utlNbytes2NtwordsCeil(numBytes)); i++)
00797                gw2RxData[gw2RxDataIndex++] = src[i];
00798             break;
00799
00800          case iffax_FP_FM_FRAME_COMP:
00801             switch (gw2DataIndex)
00802             {
00803                case 0:
00804                   /* Introduce turnaround time */
00805                   msgTimestamp = systemTime + 2000;
00806
00807                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_PREAMBLE_DETECT;
00808                   gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00809                   msgTimestamp += 300;
00810                   gw2FmFpMsgInIndex++;
00811
00812                   fiuSimCreateFmFpDataMsgs(gw2FmMsg, &gw2FmFpMsgInIndex, FmFpLsCFRMsg, FM_FP_LS_CFR_MSG_SIZE_BYTES);
00813
00814                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00815                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00816                   gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00817                   msgTimestamp += 30;
00818                   gw2FmFpMsgInIndex++;
00819
00820                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00821                   gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00822                   msgTimestamp += 30;
00823                   gw2FmFpMsgInIndex++;
00824
00825                   if (fG3FaxECM)
00826                      gw2DataIndex++;
00827                   else
00828                      gw2DataIndex += 2;
00829
00830                   break;
00831
00832                case 1:
00833                   /* image data */
00834                   gw2DataIndex++;
00835                   break;
00836
00837                case 2:
00838                   /* Introduce turnaround time */
00839                   msgTimestamp = systemTime + 100;
00840
00841                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_PREAMBLE_DETECT;
00842                   gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00843                   msgTimestamp += 300;
00844                   gw2FmFpMsgInIndex++;
00845
00846                   fiuSimCreateFmFpDataMsgs(gw2FmMsg, &gw2FmFpMsgInIndex, FmFpLsMCFMsg, FM_FP_LS_MCF_MSG_SIZE_BYTES);
00847
00848                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_FRAME_COMP;
00849                   gw2FmMsg[gw2FmFpMsgInIndex].MsgBody.FrameComp.FrameFcs = iffax_FCS_GOOD;
00850                   gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00851                   msgTimestamp += 30;
00852                   gw2FmFpMsgInIndex++;
00853
00854                   gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_CARRIER_LOSS;
00855                   gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = msgTimestamp;
00856                   msgTimestamp += 30;
00857                   gw2FmFpMsgInIndex++;
00858
00859                   gw2DataIndex++;
00860                   break;
00861             }
00862             break;
00863
00864          case iffax_FP_FM_SYNC:
00865             gw2FmMsg[gw2FmFpMsgInIndex].MsgId = iffax_FM_FP_SYNC_ACK;
00866             gw2FmMsg[gw2FmFpMsgInIndex].Timestamp = systemTime;
00867             gw2FmFpMsgInIndex++;
00868             break;
00869
00870          default:
00871             break;
00872       }
00873    }
00874
00875    return (iffax_FM_CMD_ACCEPTED);
00876
00877 } /* siuG3FmInterface() */
00878
00879
00880
00881 /******************************************************************************
00882  * FUNCTION PURPOSE: Implements fiuEventHandler() API call.
00883  ******************************************************************************
00884  * DESCRIPTION: Notifies call-processing software of an event.
00885  *
00886  * CALLING FORMAT:
00887  *   siuFaxEventHandler (void  *targetInst, - pointer to SIU module
00888  *                       tuint eventCode,   - event code
00889  *                       tuint eventInfo)   - associated event information
00890  *
00891  * RETURN VALUES:
00892  *   None
00893  *
00894  *****************************************************************************/
00895 void siuFaxEventHandler (void *targetInst, tuint eventCode, tuint eventInfo)
00896 {
00897    if (eventCode == fiu_EVENT_CLEARDOWN)
00898    {
00899       numCleardownMsg++;
00900
00901       if (numCleardownMsg >= 2)
00902          fLoop = FALSE;
00903    }
00904
00905 } /* siuFaxEventHandler() */
00906
00907 /******************************************************************************
00908  * FUNCTION PURPOSE: Implements FIU's debugInfo() API call.
00909  ******************************************************************************
00910  * DESCRIPTION: Handles FIU API calls to debugInfo(). All INFORMATIONAL msgs
00911  *              are ignored; if the msgType is FATAL_ERROR or undefined,
00912  *              a call to siuFatalError() is made.
00913  *
00914  * CALLING FORMAT:
00915  *   siuDebugInfo (void* moduleID,        - ID and channel of FIU
00916  *                 tuint msgType,         - FATAL_ERROR (2) or
00917  *                                          INFORMATIONAL (0)
00918  *                 tuint msgCode,         - message code
00919  *                 tuint msgLength,       - message length
00920  *                 tuint *supportingData) - supporting data
00921  *
00922  * RETURN VALUES:
00923  *   None
00924  *
00925  *****************************************************************************/
00926 void siuDebugInfo (void* mId, tuint msgType, tuint msgCode,
00927                    tuint msgLength, tuint *supportingData)
00928 {
00929    tint fiuRetVal = FALSE;
00930    char buffer[256];
00931    char *string = NULL;
00932    tuint time = 0;
00933    tuint deltaTime = 0;
00934    tuint moduleID= (tuint)(*((tulong *)&mId) & 0xFFFF);
00935
00936    switch (msgType)
00937    {
00938       case fiu_DBG_INFORMATIONAL:
00939          fiuRetVal = fiuDebugTraceParser (msgCode, *supportingData, buffer);
00940
00941          if (msgLength == 2)
00942          {
00943            time = supportingData[1];
00944
00945            if (time >= prevTime)
00946                deltaTime = time - prevTime;
00947             else
00948                deltaTime = (0xFFFF - prevTime + 1) + time;
00949
00950            prevTime = time;
00951          }
00952
00953          if ((moduleID & 0x00FF) == 1)
00954             printf ("%.4X(+%.4dms)GW1: ", time, deltaTime);
00955          else
00956             printf ("%.4X(+%.4dms)GW2: ", time, deltaTime);
00957
00958          if (fiuRetVal == TRUE)
00959          {
00960             printf ("%s\n", buffer);
00961          }
00962          else
00963          {
00964             printf ("Invalid trace: msgId = 0x%X, msgData = 0x%X\n", msgCode, *supportingData);
00965          }
00966          break;
00967
00968       case fiu_DBG_FATAL_ERROR:
00969          *string = SIU_EXCEPTION_FIU_DBG_FATAL_ERROR;
00970          siuFatalError (moduleID, string);
00971          break;
00972
00973       default:
00974          *string = SIU_EXCEPTION_FIU_DBG_DEFAULT;
00975          siuFatalError (moduleID, string);
00976          break;
00977    }
00978 } /* siuDebugInfo() */
00979
00980 /******************************************************************************
00981  * FUNCTION PURPOSE: Generic function for handling FIU and DPU exception calls.
00982  ******************************************************************************
00983  * DESCRIPTION: Handles exception and debug calls. Goes into and infinite loop,
00984  *              allowing for an eventual break and examintaaion of reason for
00985  *              calling a fata error. The global variable siuFatalString
00986  *              contains the reason for entry, as enumerated in the global
00987  *              enumeration siuFatalErrorChar_e of file main.h.
00988  *
00989  * CALLING FORMAT:
00990  *   siuFatalError   (tuint ID,       -  ID and channel of calling entity
00991  *                                         (either FIU or DPU)
00992  *                    char* str)      -  Global ptr to char that holds the
00993  *                                         value of reason for entering
00994  *                                         this function
00995  *
00996  * RETURN VALUES:
00997  *   None
00998  *
00999  *****************************************************************************/
01000 void siuFatalError (tuint id, char *str)
01001 {
01002    siuFatalString = *str;
01003
01004    while (1)
01005    {
01006       /* Endless loop entered */
01007    }
01008
01009 } /* siuFatalError() */
01010
01011 /******************************************************************************
01012  * FUNCTION PURPOSE: Critical section handling routine.
01013  ******************************************************************************
01014  * DESCRIPTION:
01015  *
01016  * CALLING FORMAT:
01017  *   siuCriticalSectionBegin ()
01018  *
01019  * RETURN VALUES:
01020  *   None
01021  *
01022  *****************************************************************************/
01023 void siuCriticalSectionBegin (void)
01024 {
01025    return;
01026 } /* siuCriticalSectionBegin() */
01027
01028 /******************************************************************************
01029  * FUNCTION PURPOSE: Critical section handling routine.
01030  ******************************************************************************
01031  * DESCRIPTION:
01032  *
01033  * CALLING FORMAT:
01034  *   siuCriticalSectionEnd ()
01035  *
01036  * RETURN VALUES:
01037  *   None
01038  *
01039  *****************************************************************************/
01040 void siuCriticalSectionEnd (void)
01041 {
01042    return;
01043 } /* siuCriticalSectionEnd() */
01044
01045
01046
01047 /******************************************************************************
01048  * FUNCTION PURPOSE: Initializes/resets SIU instance parameters.
01049  ******************************************************************************
01050  * DESCRIPTION: Initializes siu instance parameters and structures to nominal
01051  *              values
01052  *
01053  * CALLING FORMAT:
01054  *   siu_init        (tint chnum)  -  channel number
01055  *
01056  * RETURN VALUES:
01057  *   None
01058  *
01059  *****************************************************************************/
01060 void siu_init (tint chnum)
01061 {
01062    siuInst_t *inst = &siuInst[chnum - 1];
01063
01064    inst->fiuInst = NULL;
01065
01066    inst->fiuBufs       = NULL;
01067    inst->fiuNbufs      = 0;
01068    inst->fiu_heap_size = 0;
01069    inst->aux_heap_size = 0;
01070
01071 } /* siu_init() */
01072
01073 /******************************************************************************
01074  * FUNCTION PURPOSE: Create FIU module.
01075  ******************************************************************************
01076  * DESCRIPTION: Creates an instance of FIU.
01077  *
01078  * CALLING FORMAT:
01079  *   siu_new_fiu     (tint chnum)  -  channel number
01080  *
01081  * RETURN VALUES:
01082  *   None
01083  *
01084  *****************************************************************************/
01085 void siu_new_fiu (tint chnum)
01086 {
01087    tint                i, stat, fiuNbufs;
01088    char                *str = NULL;
01089    const ecomemBuffer_t   *bufs;
01090    ecomemBuffer_t         *fiuLocalBufs;
01091    fiuSizeCfg_t        fiuSizeCfg;
01092    fiuNewConfig_t      fiuCfgNew;
01093    siuInst_t           *inst = &siuInst[chnum - 1];
01094
01095    /* FIU get sizes */
01096    fiuSizeCfg.NumInternalFIUBufs = 100; /* 100 is default allocation size */
01097    fiuSizeCfg.NumInternalFIUOverlayBufs = 0;
01098    stat = fiuGetSizes (&fiuNbufs, &bufs, &fiuSizeCfg);
01099    if (!(stat == fiu_NOERR))
01100    {
01101       *str = SIU_EXCEPTION_FIU_SIZES_ERR;
01102       siuFatalError (SIU_FIU_ID, str);
01103    }
01104
01105    /* Allocate FIU memory buffer descriptors & increment auxiliary heap size */
01106
01107    fiuLocalBufs = (ecomemBuffer_t*) malloc (fiuNbufs * sizeof(ecomemBuffer_t));
01108
01109    inst->aux_heap_size += fiuNbufs * sizeof(ecomemBuffer_t);
01110
01111    /* Allocate FIU memory buffers & increment fiu heap size. Data from the (global)
01112       variable fiuBufs is copied into the (local) variable fiuLocalBufs in order to
01113       correctly set fiuLocalBufs' size parameter */
01114    for (i = 0; i < fiuNbufs; i++)
01115    {
01116       fiuLocalBufs[i]            = bufs[i];
01117       fiuLocalBufs[i].mclass     = ecomem_CLASS_EXTERNAL;
01118       fiuLocalBufs[i].log2align  = 0;
01119       fiuLocalBufs[i].volat      = FALSE;
01120
01121       fiuLocalBufs[i].base       = malloc (bufs[i].size);
01122       inst->fiu_heap_size        += bufs[i].size;
01123    }
01124
01125    /* Need these as a handle to delete this channel's FIU someday */
01126    inst->fiuNbufs = fiuNbufs;
01127    inst->fiuBufs  = &fiuLocalBufs[0];
01128
01129    /* FIU New */
01130    fiuCfgNew.ID = (SIU_FIU_ID << 8) | chnum;
01131
01132    fiuCfgNew.SizeConfig.NumInternalFIUBufs = fiuSizeCfg.NumInternalFIUBufs;
01133    fiuCfgNew.SizeConfig.NumInternalFIUOverlayBufs = 0;
01134    stat = fiuNew (&inst->fiuInst, fiuNbufs, fiuLocalBufs, &fiuCfgNew);
01135
01136    if (!(stat == fiu_NOERR))
01137    {
01138       *str = SIU_EXCEPTION_FIU_NEW_ERR;
01139       siuFatalError (SIU_FIU_ID, str);
01140    }
01141
01142 } /* siu_new_fiu() */
01143
01144
01145 /******************************************************************************
01146  * FUNCTION PURPOSE: Open FIU module
01147  ******************************************************************************
01148  * DESCRIPTION: Opens one instance of a FIU module
01149  *
01150  * CALLING FORMAT:
01151  *   siu_open_fiu    (tint chnum)     - channel number
01152  *
01153  * RETURN VALUES:
01154  *   None
01155  *
01156  *****************************************************************************/
01157 void siu_open_fiu (tint chnum)
01158 {
01159    tint            stat;
01160    char            *str = NULL;
01161    fiuOpenConfig_t fiuCfg;
01162    siuInst_t       *inst = &siuInst[chnum - 1];
01163
01164    fiuCfg.frameSize                     = gFrameSize;      /* in ms */
01165    fiuCfg.MaxFaxRate                    = iffax_RATE_14400;
01166    fiuCfg.dbgMode                       = fiu_DBG_LVL_2;
01167    fiuCfg.RtpPayloadType                = 0;               /* not needed for this sim */
01168    fiuCfg.RtpSyncSource                 = 0;               /* not needed for this sim */
01169    fiuCfg.faxNomDelay                   = 300;             /* in ms */
01170    fiuCfg.faxPacketSize                 = 20;              /* in ms */
01171    fiuCfg.NoActivityTimerVal            = 20000;           /* in ms */
01172    fiuCfg.AAL2cid                       = 0;               /* not used for T.38 */
01173    fiuCfg.SendOutSpec.fiuSendOut        = siuNetInterface;
01174    fiuCfg.SendOutSpec.targetInst        = (void *) inst;
01175 #ifdef V34_FAX_SIMULATION
01176    fiuCfg.ReceiveOutSpec.fiuReceiveOut  = siuV34FmInterface;
01177 #else
01178    fiuCfg.ReceiveOutSpec.fiuReceiveOut  = siuG3FmInterface;
01179 #endif
01180    fiuCfg.ReceiveOutSpec.targetInst     = (void *) inst;
01181    fiuCfg.EventHandlerSpec.fiuEventHandler = siuFaxEventHandler;
01182    fiuCfg.EventHandlerSpec.targetInst      = (void *) inst;
01183
01184 #ifndef NO_TONESUPP
01185    fiuCfg.StartupTimer                  = 10000;
01186 #endif /* NO_TONESUPP */
01187    fiuCfg.CleardownTimer                = 2000;
01188    fiuCfg.faxNetCallTblPtr              = faxNetCallTblPtr;
01189    fiuCfg.NetProtocol                   = faxNetProtocol;
01190    fiuCfg.LocalTxNetTimeOutVal          = 120000;               /* in ms */
01191    fiuCfg.EflagStartTimer               = 2600;                 /* in ms */
01192    fiuCfg.EflagStopTimer                = 2300;                 /* in ms */
01193
01194    fiuCfg.T30FeatureSelector            = 0x0000;
01195    fiuCfg.FIUFeatureSelector            = fiu_FEATURE_TFOP_FC_REPEAT;
01196 #ifdef V34_FAX_SIMULATION
01197    fiuCfg.FIUFeatureSelector           |= fiu_FEATURE_V34_FAX;
01198 #endif
01199    fiuCfg.NSFCountryCode                = 0;
01200    fiuCfg.NSFVendorCodeMSB              = 0;
01201    fiuCfg.NSFVendorCodeLSB              = 0;
01202
01203    /* T.38 UDP related parameters */
01204    fiuCfg.HSPktPayloadSize              = 40; /* in ms */
01205    fiuCfg.LSPktPayloadSize              = 1;  /* in number of bytes */
01206    fiuCfg.HsDataRedundancy              = 2;  /* in number of packets */
01207    fiuCfg.LsDataRedundancy              = 5;  /* in number of packets */
01208    fiuCfg.TCFHandlingMethod             = 2;  /* TCF Method 2 */
01209    fiuCfg.T38Version                    = 0;
01210
01211    stat = fiuOpen (inst->fiuInst, &fiuCfg);
01212
01213    if (!(stat == fiu_NOERR))
01214    {
01215       *str = SIU_EXCEPTION_FIU_OPEN_ERR;
01216       siuFatalError (SIU_FIU_ID, str);
01217    }
01218
01219 } /* siu_open_fiu() */
01220
01221 /******************************************************************************
01222  * FUNCTION PURPOSE: Close FIU module
01223  ******************************************************************************
01224  * DESCRIPTION: Closes one instance of a FIU module
01225  *
01226  * CALLING FORMAT:
01227  *   siu_close_fiu   (tint chnum)      - channel number
01228  *
01229  * RETURN VALUES:
01230  *   None
01231  *
01232  *****************************************************************************/
01233 void siu_close_fiu (tint chnum)
01234 {
01235    siuInst_t *inst = &siuInst[chnum - 1];
01236    fiuClose (inst->fiuInst);
01237
01238 } /* siu_close_fiu() */
01239
01240
01241 /******************************************************************************
01242  * FUNCTION PURPOSE: Delete FIU module
01243  ******************************************************************************
01244  * DESCRIPTION: Deletes one instance of a FIU module
01245  *
01246  * CALLING FORMAT:
01247  *   siu_delete_fiu  (tint chnum)      - channel number
01248  *
01249  * RETURN VALUES:
01250  *   None
01251  *
01252  *****************************************************************************/
01253 void siu_delete_fiu (tint chnum)
01254 {
01255    tint i;
01256    siuInst_t *inst = &siuInst[chnum - 1];
01257
01258    fiuDelete (&(inst->fiuInst));
01259
01260    /* Free memory allocated for FIU buffers & adjust fiu_heap_size */
01261    for (i = 0; i < inst->fiuNbufs; i++)
01262    {
01263
01264       free (inst->fiuBufs[i].base);
01265       inst->fiu_heap_size -= inst->fiuBufs[i].size;
01266    }
01267
01268    /* Free memory for FIU buffer descriptors & adjust aux_heap_size */
01269    free (inst->fiuBufs);
01270    inst->fiuBufs = NULL;
01271    inst->aux_heap_size -= inst->fiuNbufs * sizeof(ecomemBuffer_t);
01272    inst->fiuNbufs = 0;
01273
01274 } /* siu_delete_fiu() */
01275
01276
01277 /******************************************************************************
01278  * FUNCTION PURPOSE: Main SIU (system integration unit) processing routine
01279  ******************************************************************************
01280  * DESCRIPTION: This routine exercises the APIs for both the FIU and DPU
01281  *              modules.
01282  *
01283  * CALLING FORMAT:
01284  *   void main (void)
01285  * RETURN VALUES:
01286  *   None
01287  *
01288  *****************************************************************************/
01289
01290 void main (void)
01291 {
01292    memset (gw1RxData, 0, sizeof(gw1RxData));
01293    memset (gw2RxData, 0, sizeof(gw2RxData));
01294
01295    siu_init (gw1ChNum);
01296    siu_init (gw2ChNum);
01297
01298    /* Create new FIU instances */
01299    siu_new_fiu (gw1ChNum);
01300    siu_new_fiu (gw2ChNum);
01301
01302    /* Open FIU instances */
01303    siu_open_fiu (gw1ChNum);
01304    siu_open_fiu (gw2ChNum);
01305
01306    fiuControl (siuInst[gw1ChNum - 1].fiuInst, fiu_CTRL_ACTIVATE, NULL);
01307    fiuControl (siuInst[gw2ChNum - 1].fiuInst, fiu_CTRL_ACTIVATE, NULL);
01308
01309    fLoop = TRUE;
01310
01311    while (fLoop == TRUE)
01312    {
01313       fiuTask (siuInst[gw1ChNum - 1].fiuInst);
01314       fiuTask (siuInst[gw2ChNum - 1].fiuInst);
01315
01316       if (gw1FmFpMsgInIndex > gw1FmFpMsgOutIndex)
01317       {
01318          if (gw1FmMsg[gw1FmFpMsgOutIndex].Timestamp < systemTime)
01319          {
01320             tword data[DATA_SEGMENT_SIZE_BYTES];
01321
01322             if (gw1FmMsg[gw1FmFpMsgOutIndex].MsgId == iffax_FM_FP_DATA)
01323             {
01324                /* Pack data */
01325                pktPackBytesIntoWords(gw1FmMsg[gw1FmFpMsgOutIndex].MsgBody.DataPayload.DataAddress,
01326                                      data,
01327                                      gw1FmMsg[gw1FmFpMsgOutIndex].MsgBody.DataPayload.numBytes,
01328                                      0);
01329                gw1FmMsg[gw1FmFpMsgOutIndex].MsgBody.DataPayload.DataAddress = &data[0];
01330             }
01331
01332             fiuSendIn (siuInst[gw1ChNum - 1].fiuInst, &(gw1FmMsg[gw1FmFpMsgOutIndex++]));
01333          }
01334       }
01335
01336       if (gw2FmFpMsgInIndex > gw2FmFpMsgOutIndex)
01337       {
01338          if (gw2FmMsg[gw2FmFpMsgOutIndex].Timestamp < systemTime)
01339          {
01340             tword data[DATA_SEGMENT_SIZE_BYTES];
01341
01342             if (gw2FmMsg[gw2FmFpMsgOutIndex].MsgId == iffax_FM_FP_DATA)
01343             {
01344                /* Pack data */
01345                pktPackBytesIntoWords(gw2FmMsg[gw2FmFpMsgOutIndex].MsgBody.DataPayload.DataAddress,
01346                                      data,
01347                                      gw2FmMsg[gw2FmFpMsgOutIndex].MsgBody.DataPayload.numBytes,
01348                                      0);
01349                gw2FmMsg[gw2FmFpMsgOutIndex].MsgBody.DataPayload.DataAddress = &data[0];
01350             }
01351
01352             fiuSendIn (siuInst[gw2ChNum - 1].fiuInst, &(gw2FmMsg[gw2FmFpMsgOutIndex++]));
01353          }
01354       }
01355
01356       /* Increment "system time" by gFrameSize */
01357       systemTime += gFrameSize;
01358
01359    } /* while (fLoop) */
01360
01361    /* Get updated net and fax stats */
01362    fiuGetStats (siuInst[gw1ChNum - 1].fiuInst, 0, &gw1FaxStats);
01363    fiuGetStats (siuInst[gw2ChNum - 1].fiuInst, 0, &gw2FaxStats);
01364
01365    /* Close FIU instances */
01366    siu_close_fiu (gw1ChNum);
01367    siu_close_fiu (gw2ChNum);
01368
01369    /* Delete FIU instances */
01370    siu_delete_fiu (gw1ChNum);
01371    siu_delete_fiu (gw2ChNum);
01372
01373    exit (0);
01374
01375 } /* main() */
01376
01377 /* nothing past this point */


FIU Test: fiusim.h File Reference

  • File List
  • Globals

fiusim.h File Reference

#include <string.h>
#include <stdlib.h>
#include <ti/mas/types/types.h>
#include <ti/mas/iface/ifpkt/ifpkt.h>
#include <ti/mas/util/utl.h>
#include <ti/mas/util/pkt.h>
#include <ti/mas/fiu/fiu.h>
#include <ti/mas/util/ecomem.h>

Include dependency graph for fiusim.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct | siuInst_s

Defines

#define | SIU_NUMBER_OF_CHANNELS 2
#define | SIU_FM_MESSAGE_ARRAY_SIZE 30
#define | SIU_FIU_ID 0x02
#define | SIU_WORD_TO_MAU(fnd_word_cnt) ((fnd_word_cnt) * (16/TYP_TWORD_SIZE))

Typedefs

typedef siuInst_s | siuInst_t

Enumerations

enum siuFatalErrorChar_e {
SIU_EXCEPTION_FIU_DBG_FATAL_ERROR, SIU_EXCEPTION_FIU_DBG_DEFAULT, SIU_EXCEPTION_FIU_SIZES_ERR, SIU_EXCEPTION_FIU_BUFS_ERR,
SIU_EXCEPTION_FIU_NEW_ERR, SIU_EXCEPTION_FIU_OPEN_ERR
}

Functions

tulong | siuGetTime (void)
tint | siuNetInterface (void *targetInst, xferpktInfo_t *pktInfo)
tint | siuFmInterface (void *targetInst, void *message)
void | siuCleardownFax (void *targetInst, tuint TermCode)
void | siuDebugInfo (void *moduleID, tuint msgType, tuint msgCode, tuint msgLength, tuint *supportingData)
void | siuFatalError (tuint id, char *str)
void | siu_init (tint chnum)
void | siu_new_fiu (tint chnum)
void | siu_open_fiu (tint chnum)
void | siu_close_fiu (tint chnum)
void | siu_delete_fiu (tint chnum)
void | siuCriticalSectionBegin (void)
void | siuCriticalSectionEnd (void)

Variables

fiuNetCallTbl_t | faxNetProtocolT38
fiuNetCallTbl_t | faxNetProtocolT3
fiuNetCallTbl_t | faxNetProtocolAal2
fiuNetCallTbl_t | faxNetProtocolFrf11

Define Documentation

#define SIU_NUMBER_OF_CHANNELS 2

Definition at line 82 of file fiusim.h.

#define SIU_FM_MESSAGE_ARRAY_SIZE 30

Definition at line 83 of file fiusim.h.

#define SIU_FIU_ID 0x02

Definition at line 84 of file fiusim.h.

Referenced by siu_new_fiu(), and siu_open_fiu().

#define SIU_WORD_TO_MAU ( fnd_word_cnt ) ((fnd_word_cnt) * (16/TYP_TWORD_SIZE))

Definition at line 86 of file fiusim.h.

Referenced by siuNetInterface().

Typedef Documentation

typedef struct siuInst_s siuInst_t

Enumeration Type Documentation

enum siuFatalErrorChar_e

Enumerator:
SIU_EXCEPTION_FIU_DBG_FATAL_ERROR
SIU_EXCEPTION_FIU_DBG_DEFAULT
SIU_EXCEPTION_FIU_SIZES_ERR
SIU_EXCEPTION_FIU_BUFS_ERR
SIU_EXCEPTION_FIU_NEW_ERR
SIU_EXCEPTION_FIU_OPEN_ERR

Definition at line 110 of file fiusim.h.

Function Documentation

tulong siuGetTime ( void )

Definition at line 240 of file fiusim.c.

References systemTime.

tint siuNetInterface | ( | void * | targetInst,
 |  | xferpktInfo_t * | pktInfo
 | ) |  |

Definition at line 270 of file fiusim.c.

References faxNetProtocol, gw1ChNum, gw1RtpSeqNum, gw2ChNum, gw2RtpSeqNum, RTP_SEQNUM_OFFSET, SIU_WORD_TO_MAU, and siuInst.

Referenced by siu_open_fiu().

tint siuFmInterface | ( | void * | targetInst,
 |  | void * | message
 | ) |  |

void siuCleardownFax | ( | void * | targetInst,
 |  | tuint | TermCode
 | ) |  |

void siuDebugInfo | ( | void * | moduleID,
 |  | tuint | msgType,
 |  | tuint | msgCode,
 |  | tuint | msgLength,
 |  | tuint * | supportingData
 | ) |  |

Definition at line 926 of file fiusim.c.

References fiuDebugTraceParser(), prevTime, SIU_EXCEPTION_FIU_DBG_DEFAULT, SIU_EXCEPTION_FIU_DBG_FATAL_ERROR, and siuFatalError().

Here is the call graph for this function:

void siuFatalError | ( | tuint | id,
 |  | char * | str
 | ) |  |

Definition at line 1000 of file fiusim.c.

References siuFatalString.

Referenced by siu_new_fiu(), siu_open_fiu(), and siuDebugInfo().

void siu_init ( tint chnum )

Definition at line 1060 of file fiusim.c.

References siuInst_s::aux_heap_size, siuInst_s::fiu_heap_size, siuInst_s::fiuBufs, siuInst_s::fiuInst, siuInst_s::fiuNbufs, and siuInst.

Referenced by main().

void siu_new_fiu ( tint chnum )

Definition at line 1085 of file fiusim.c.

References siuInst_s::aux_heap_size, siuInst_s::fiu_heap_size, siuInst_s::fiuBufs, siuInst_s::fiuInst, siuInst_s::fiuNbufs, SIU_EXCEPTION_FIU_NEW_ERR, SIU_EXCEPTION_FIU_SIZES_ERR, SIU_FIU_ID, siuFatalError(), and siuInst.

Referenced by main().

Here is the call graph for this function:

void siu_open_fiu ( tint chnum )

Definition at line 1157 of file fiusim.c.

References faxNetCallTblPtr, faxNetProtocol, siuInst_s::fiuInst, gFrameSize, SIU_EXCEPTION_FIU_OPEN_ERR, SIU_FIU_ID, siuFatalError(), siuFaxEventHandler(), siuG3FmInterface(), siuInst, and siuNetInterface().

Referenced by main().

Here is the call graph for this function:

void siu_close_fiu ( tint chnum )

Definition at line 1233 of file fiusim.c.

References siuInst_s::fiuInst, and siuInst.

Referenced by main().

void siu_delete_fiu ( tint chnum )

Definition at line 1253 of file fiusim.c.

References siuInst_s::aux_heap_size, siuInst_s::fiu_heap_size, siuInst_s::fiuBufs, siuInst_s::fiuInst, siuInst_s::fiuNbufs, and siuInst.

Referenced by main().

void siuCriticalSectionBegin ( void )

Definition at line 1023 of file fiusim.c.

void siuCriticalSectionEnd ( void )

Definition at line 1040 of file fiusim.c.

Variable Documentation

fiuNetCallTbl_t faxNetProtocolT38

fiuNetCallTbl_t faxNetProtocolT3

fiuNetCallTbl_t faxNetProtocolAal2

fiuNetCallTbl_t faxNetProtocolFrf11


FIU Test: fiusim.h Source File

  • File List
  • Globals

fiusim.h

Go to the documentation of this file.
00001 #ifndef _FIUSIM_H
00002 #define _FIUSIM_H
00003 /******************************************************************************
00004  * FILE PURPOSE: Common system-specific definitions
00005  ******************************************************************************
00006  * FILE NAME: fiusim.h
00007  *
00008  * DESCRIPTION: This header file contains common system-specific data definitions,
00009  *              and global definitions.
00010  *
00011  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00012  *
00013  *              All rights reserved not granted herein.
00014  *
00015  *                         Limited License.
00016  *
00017  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00018  *  non-exclusive license under copyrights and patents it now or hereafter owns
00019  *  or controls to make, have made, use, import, offer to sell and sell
00020  *  ("Utilize") this software subject to the terms herein.  With respect to the
00021  *  foregoing patent license, such license is granted solely to the extent that
00022  *  any such patent is necessary to Utilize the software alone.  The patent
00023  *  license shall not apply to any combinations which include this software,
00024  *  other than combinations with devices manufactured by or for TI (“TI
00025  *  Devices”).  No hardware patent is licensed hereunder.
00026  *
00027  *  Redistributions must preserve existing copyright notices and reproduce this
00028  *  license (including the above copyright notice and the disclaimer and (if
00029  *  applicable) source code license limitations below) in the documentation
00030  *  and/or other materials provided with the distribution
00031  *
00032  *  Redistribution and use in binary form, without modification, are permitted
00033  *  provided that the following conditions are met:
00034  *
00035  *    *  No reverse engineering, decompilation, or disassembly of this software
00036  *  is permitted with respect to any software provided in binary form.
00037  *
00038  *    *  any redistribution and use are licensed by TI for use only with TI
00039  *  Devices.
00040  *
00041  *    *  Nothing shall obligate TI to provide you with source code for the
00042  *  software licensed and provided to you in object code.
00043  *
00044  *  If software source code is provided to you, modification and redistribution
00045  *  of the source code are permitted provided that the following conditions are
00046  *  met:
00047  *
00048  *    *  any redistribution and use of the source code, including any resulting
00049  *  derivative works, are licensed by TI for use only with TI Devices.
00050  *
00051  *    *  any redistribution and use of any object code compiled from the source
00052  *  code and any resulting derivative works, are licensed by TI for use only
00053  *  with TI Devices.
00054  *
00055  *  Neither the name of Texas Instruments Incorporated nor the names of its
00056  *  suppliers may be used to endorse or promote products derived from this
00057  *  software without specific prior written permission.
00058  *
00059  *  DISCLAIMER.
00060  *
00061  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00062  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00063  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00064  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00065  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00066  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00067  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00068  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00069  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00070  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00071  *  DAMAGE.
00072  *****************************************************************************/
00073 #include <string.h>
00074 #include <stdlib.h>
00075 #include <ti/mas/types/types.h>
00076 #include <ti/mas/iface/ifpkt/ifpkt.h>
00077 #include <ti/mas/util/utl.h>
00078 #include <ti/mas/util/pkt.h>
00079 #include <ti/mas/fiu/fiu.h>
00080 #include <ti/mas/util/ecomem.h>
00081
00082 #define SIU_NUMBER_OF_CHANNELS    2
00083 #define SIU_FM_MESSAGE_ARRAY_SIZE 30
00084 #define SIU_FIU_ID                0x02
00085
00086 #define SIU_WORD_TO_MAU(fnd_word_cnt) ((fnd_word_cnt) * (16/TYP_TWORD_SIZE))
00087
00088 /******************************************************************************
00089  * GLOBAL STRUCTURE AND ENUMERATION DEFINITIONS
00090  *****************************************************************************/
00091
00092 /* Global SIU instance structure */
00093 typedef struct siuInst_s {
00094    /* FIU elements */
00095    void        *fiuInst;       /* FIU instance pointer */
00096    ecomemBuffer_t *fiuBufs;       /* Pointer to base of FIU buffer space */
00097    tint         fiuNbufs;      /* Number of allocated FIU buffers */
00098    tint         fiu_heap_size; /* Heap allocation for FIU */
00099    /* Other elements */
00100    tint         aux_heap_size; /* Auxiliary heap allocation */
00101 } siuInst_t;
00102
00103 /* Global fax call table declarations */
00104 extern fiuNetCallTbl_t faxNetProtocolT38;
00105 extern fiuNetCallTbl_t faxNetProtocolT3;
00106 extern fiuNetCallTbl_t faxNetProtocolAal2;
00107 extern fiuNetCallTbl_t faxNetProtocolFrf11;
00108
00109 /* Global exception char enumeration */
00110 typedef enum {
00111    SIU_EXCEPTION_FIU_DBG_FATAL_ERROR,
00112    SIU_EXCEPTION_FIU_DBG_DEFAULT,
00113    SIU_EXCEPTION_FIU_SIZES_ERR,
00114    SIU_EXCEPTION_FIU_BUFS_ERR,
00115    SIU_EXCEPTION_FIU_NEW_ERR,
00116    SIU_EXCEPTION_FIU_OPEN_ERR
00117 } siuFatalErrorChar_e;
00118
00119 /******************************************************************************
00120  * GLOBAL FUNCTION DECLARATIONS
00121  *****************************************************************************/
00122
00123 tulong siuGetTime              (void);
00124 tint   siuNetInterface         (void *targetInst, xferpktInfo_t *pktInfo);
00125 tint   siuFmInterface          (void *targetInst, void *message);
00126 void   siuCleardownFax         (void *targetInst, tuint TermCode);
00127 void   siuDebugInfo            (void *moduleID, tuint msgType, tuint msgCode,
00128
00129
00130                                 tuint msgLength,  tuint *supportingData);
00131 void   siuFatalError           (tuint id, char *str);
00132 void   siu_init                (tint chnum);
00133 void   siu_new_fiu             (tint chnum);
00134 void   siu_open_fiu            (tint chnum);
00135 void   siu_close_fiu           (tint chnum);
00136 void   siu_delete_fiu          (tint chnum);
00137
00138
00139
00140 void   siuCriticalSectionBegin (void);
00141 void   siuCriticalSectionEnd   (void);
00142
00143 #endif /* _FIUSIM_H */
00144
00145 /* nothing past this point */
00146
00147


FIU Test: Data Fields

  • Data Structures
  • Data Fields
  • All
  • Variables
Here is a list of all struct and union fields with links to the structures/unions they belong to:

  • aux_heap_size : siuInst_s
  • fiu_heap_size : siuInst_s
  • fiuBufs : siuInst_s
  • fiuInst : siuInst_s
  • fiuNbufs : siuInst_s


FIU Test: Data Fields - Variables

  • Data Structures
  • Data Fields
  • All
  • Variables

  • aux_heap_size : siuInst_s
  • fiu_heap_size : siuInst_s
  • fiuBufs : siuInst_s
  • fiuInst : siuInst_s
  • fiuNbufs : siuInst_s


FIU Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • d
  • f
  • g
  • m
  • n
  • p
  • r
  • s

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- d -

  • DATA_SEGMENT_SIZE_BYTES : fiusim.c

- f -

  • faxNetCallTblPtr : fiusim.c
  • faxNetProtocol : fiusim.c
  • faxNetProtocolAal2 : fiusim.h
  • faxNetProtocolFrf11 : fiusim.h
  • faxNetProtocolT3 : fiusim.h
  • faxNetProtocolT38 : fiusim.h
  • fDISSent : fiusim.c
  • fG3FaxECM : fiusim.c
  • fiuContext : fiusim.c
  • fiuDebugGetAAL2DecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetAAL2PacketType() : fiuDebugTraceParser.c
  • fiuDebugGetCleardownReason() : fiuDebugTraceParser.c
  • fiuDebugGetFCF() : fiuDebugTraceParser.c
  • fiuDebugGetFCF2() : fiuDebugTraceParser.c
  • fiuDebugGetFRF11DecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetFRF11PacketType() : fiuDebugTraceParser.c
  • fiuDebugGetFRP2FNDMsg() : fiuDebugTraceParser.c
  • fiuDebugGetFRPState() : fiuDebugTraceParser.c
  • fiuDebugGetIFPHeader() : fiuDebugTraceParser.c
  • fiuDebugGetMDEvent() : fiuDebugTraceParser.c
  • fiuDebugGetNetEvent() : fiuDebugTraceParser.c
  • fiuDebugGetNetProtocol() : fiuDebugTraceParser.c
  • fiuDebugGetPT() : fiuDebugTraceParser.c
  • fiuDebugGetSLPPageMode() : fiuDebugTraceParser.c
  • fiuDebugGetSwitchoverReason() : fiuDebugTraceParser.c
  • fiuDebugGetT2PDecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetT2PLineState() : fiuDebugTraceParser.c
  • fiuDebugGetT38UDecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetT38UException() : fiuDebugTraceParser.c
  • fiuDebugGetTimerEvent() : fiuDebugTraceParser.c
  • fiuDebugGetToneId() : fiuDebugTraceParser.c
  • fiuDebugTraceParser() : fiuDebugTraceParser.c , fiusim.c
  • fiuMsgString : fiuDebugTraceParser.c
  • fiuSimCreateFmFpDataMsgs() : fiusim.c
  • fLoop : fiusim.c
  • FM_FP_HS_DATA_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_HS_DATA_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_CFR_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_CFR_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DCN_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DCN_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DCS_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DCS_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DCS_NONECM_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DIS_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DIS_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DIS_NONECM_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_EOP_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_EOP_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_MCF_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_MCF_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_PPS_EOP_MSG_SIZE_WORDS : fiusim.c
  • FmFpHsData : fiusim.c
  • FmFpLsCFRMsg : fiusim.c
  • FmFpLsDCNMsg : fiusim.c
  • FmFpLsDCSMsg : fiusim.c
  • FmFpLsDCSNonECMMsg : fiusim.c
  • FmFpLsDISMsg : fiusim.c
  • FmFpLsDISNonECMMsg : fiusim.c
  • FmFpLsEOPMsg : fiusim.c
  • FmFpLsMCFMsg : fiusim.c
  • FmFpLsPPS_EOPMsg : fiusim.c

- g -

  • gFrameSize : fiusim.c
  • gw1ChNum : fiusim.c
  • gw1DataIndex : fiusim.c
  • gw1FaxStats : fiusim.c
  • gw1FmFpMsgInIndex : fiusim.c
  • gw1FmFpMsgOutIndex : fiusim.c
  • gw1FmMsg : fiusim.c
  • gw1RtpSeqNum : fiusim.c
  • gw1RxData : fiusim.c
  • gw1RxDataIndex : fiusim.c
  • gw2ChNum : fiusim.c
  • gw2DataIndex : fiusim.c
  • gw2FaxStats : fiusim.c
  • gw2FmFpMsgInIndex : fiusim.c
  • gw2FmFpMsgOutIndex : fiusim.c
  • gw2FmMsg : fiusim.c
  • gw2RtpSeqNum : fiusim.c
  • gw2RxData : fiusim.c
  • gw2RxDataIndex : fiusim.c

- m -

  • main() : fiusim.c
  • msgTimestamp : fiusim.c

- n -

  • numCleardownMsg : fiusim.c

- p -

  • prevTime : fiusim.c

- r -

  • RTP_SEQNUM_OFFSET : fiusim.c

- s -

  • siu_close_fiu() : fiusim.c , fiusim.h
  • siu_delete_fiu() : fiusim.h , fiusim.c
  • SIU_EXCEPTION_FIU_BUFS_ERR : fiusim.h
  • SIU_EXCEPTION_FIU_DBG_DEFAULT : fiusim.h
  • SIU_EXCEPTION_FIU_DBG_FATAL_ERROR : fiusim.h
  • SIU_EXCEPTION_FIU_NEW_ERR : fiusim.h
  • SIU_EXCEPTION_FIU_OPEN_ERR : fiusim.h
  • SIU_EXCEPTION_FIU_SIZES_ERR : fiusim.h
  • SIU_FIU_ID : fiusim.h
  • SIU_FM_MESSAGE_ARRAY_SIZE : fiusim.h
  • siu_init() : fiusim.h , fiusim.c
  • siu_new_fiu() : fiusim.h , fiusim.c
  • SIU_NUMBER_OF_CHANNELS : fiusim.h
  • siu_open_fiu() : fiusim.h , fiusim.c
  • SIU_WORD_TO_MAU : fiusim.h
  • siuCleardownFax() : fiusim.h
  • siuCriticalSectionBegin() : fiusim.h , fiusim.c
  • siuCriticalSectionEnd() : fiusim.c , fiusim.h
  • siuDebugInfo() : fiusim.h , fiusim.c
  • siuFatalError() : fiusim.c , fiusim.h
  • siuFatalErrorChar_e : fiusim.h
  • siuFatalString : fiusim.c
  • siuFaxEventHandler() : fiusim.c
  • siuFmInterface() : fiusim.h
  • siuG3FmInterface() : fiusim.c
  • siuGetTime() : fiusim.h , fiusim.c
  • siuInst : fiusim.c
  • siuInst_t : fiusim.h
  • siuNetInterface() : fiusim.c , fiusim.h
  • systemTime : fiusim.c


FIU Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • DATA_SEGMENT_SIZE_BYTES : fiusim.c
  • FM_FP_HS_DATA_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_HS_DATA_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_CFR_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_CFR_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DCN_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DCN_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DCS_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DCS_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DCS_NONECM_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DCS_NONECM_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DIS_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DIS_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_DIS_NONECM_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_DIS_NONECM_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_EOP_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_EOP_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_MCF_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_MCF_MSG_SIZE_WORDS : fiusim.c
  • FM_FP_LS_PPS_EOP_MSG_SIZE_BYTES : fiusim.c
  • FM_FP_LS_PPS_EOP_MSG_SIZE_WORDS : fiusim.c
  • RTP_SEQNUM_OFFSET : fiusim.c
  • SIU_FIU_ID : fiusim.h
  • SIU_FM_MESSAGE_ARRAY_SIZE : fiusim.h
  • SIU_NUMBER_OF_CHANNELS : fiusim.h
  • SIU_WORD_TO_MAU : fiusim.h


FIU Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • siuFatalErrorChar_e : fiusim.h


FIU Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • SIU_EXCEPTION_FIU_BUFS_ERR : fiusim.h
  • SIU_EXCEPTION_FIU_DBG_DEFAULT : fiusim.h
  • SIU_EXCEPTION_FIU_DBG_FATAL_ERROR : fiusim.h
  • SIU_EXCEPTION_FIU_NEW_ERR : fiusim.h
  • SIU_EXCEPTION_FIU_OPEN_ERR : fiusim.h
  • SIU_EXCEPTION_FIU_SIZES_ERR : fiusim.h


FIU Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • f
  • m
  • s

- f -

  • fiuDebugGetAAL2DecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetAAL2PacketType() : fiuDebugTraceParser.c
  • fiuDebugGetCleardownReason() : fiuDebugTraceParser.c
  • fiuDebugGetFCF() : fiuDebugTraceParser.c
  • fiuDebugGetFCF2() : fiuDebugTraceParser.c
  • fiuDebugGetFRF11DecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetFRF11PacketType() : fiuDebugTraceParser.c
  • fiuDebugGetFRP2FNDMsg() : fiuDebugTraceParser.c
  • fiuDebugGetFRPState() : fiuDebugTraceParser.c
  • fiuDebugGetIFPHeader() : fiuDebugTraceParser.c
  • fiuDebugGetMDEvent() : fiuDebugTraceParser.c
  • fiuDebugGetNetEvent() : fiuDebugTraceParser.c
  • fiuDebugGetNetProtocol() : fiuDebugTraceParser.c
  • fiuDebugGetPT() : fiuDebugTraceParser.c
  • fiuDebugGetSLPPageMode() : fiuDebugTraceParser.c
  • fiuDebugGetSwitchoverReason() : fiuDebugTraceParser.c
  • fiuDebugGetT2PDecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetT2PLineState() : fiuDebugTraceParser.c
  • fiuDebugGetT38UDecoderState() : fiuDebugTraceParser.c
  • fiuDebugGetT38UException() : fiuDebugTraceParser.c
  • fiuDebugGetTimerEvent() : fiuDebugTraceParser.c
  • fiuDebugGetToneId() : fiuDebugTraceParser.c
  • fiuDebugTraceParser() : fiusim.c , fiuDebugTraceParser.c
  • fiuSimCreateFmFpDataMsgs() : fiusim.c

- m -

  • main() : fiusim.c

- s -

  • siu_close_fiu() : fiusim.c , fiusim.h
  • siu_delete_fiu() : fiusim.c , fiusim.h
  • siu_init() : fiusim.h , fiusim.c
  • siu_new_fiu() : fiusim.h , fiusim.c
  • siu_open_fiu() : fiusim.c , fiusim.h
  • siuCleardownFax() : fiusim.h
  • siuCriticalSectionBegin() : fiusim.c , fiusim.h
  • siuCriticalSectionEnd() : fiusim.c , fiusim.h
  • siuDebugInfo() : fiusim.h , fiusim.c
  • siuFatalError() : fiusim.h , fiusim.c
  • siuFaxEventHandler() : fiusim.c
  • siuFmInterface() : fiusim.h
  • siuG3FmInterface() : fiusim.c
  • siuGetTime() : fiusim.h , fiusim.c
  • siuNetInterface() : fiusim.h , fiusim.c


FIU Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • siuInst_t : fiusim.h


FIU Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • f
  • g
  • m
  • n
  • p
  • s

- f -

  • faxNetCallTblPtr : fiusim.c
  • faxNetProtocol : fiusim.c
  • faxNetProtocolAal2 : fiusim.h
  • faxNetProtocolFrf11 : fiusim.h
  • faxNetProtocolT3 : fiusim.h
  • faxNetProtocolT38 : fiusim.h
  • fDISSent : fiusim.c
  • fG3FaxECM : fiusim.c
  • fiuContext : fiusim.c
  • fiuMsgString : fiuDebugTraceParser.c
  • fLoop : fiusim.c
  • FmFpHsData : fiusim.c
  • FmFpLsCFRMsg : fiusim.c
  • FmFpLsDCNMsg : fiusim.c
  • FmFpLsDCSMsg : fiusim.c
  • FmFpLsDCSNonECMMsg : fiusim.c
  • FmFpLsDISMsg : fiusim.c
  • FmFpLsDISNonECMMsg : fiusim.c
  • FmFpLsEOPMsg : fiusim.c
  • FmFpLsMCFMsg : fiusim.c
  • FmFpLsPPS_EOPMsg : fiusim.c

- g -

  • gFrameSize : fiusim.c
  • gw1ChNum : fiusim.c
  • gw1DataIndex : fiusim.c
  • gw1FaxStats : fiusim.c
  • gw1FmFpMsgInIndex : fiusim.c
  • gw1FmFpMsgOutIndex : fiusim.c
  • gw1FmMsg : fiusim.c
  • gw1RtpSeqNum : fiusim.c
  • gw1RxData : fiusim.c
  • gw1RxDataIndex : fiusim.c
  • gw2ChNum : fiusim.c
  • gw2DataIndex : fiusim.c
  • gw2FaxStats : fiusim.c
  • gw2FmFpMsgInIndex : fiusim.c
  • gw2FmFpMsgOutIndex : fiusim.c
  • gw2FmMsg : fiusim.c
  • gw2RtpSeqNum : fiusim.c
  • gw2RxData : fiusim.c
  • gw2RxDataIndex : fiusim.c

- m -

  • msgTimestamp : fiusim.c

- n -

  • numCleardownMsg : fiusim.c

- p -

  • prevTime : fiusim.c

- s -

  • siuFatalString : fiusim.c
  • siuInst : fiusim.c
  • systemTime : fiusim.c


FIU Test: FIU Unit Test

FIU Unit Test

Page Contents

  1. Description
  2. Building Unit Test
  3. Unit Test Procedures
  4. Dependent Packages

Description

This package contains a basic test for the FIU. This is not a regression test, its purpose is to show how the FIU module can be integrated into a system and to become familiar with the external API. The package also provides a means to experiment with changes to the configuration and observe the operational effect(s).

Building Unit Test

The FIU Unit Test package can be compiled in the following manners:

  1. Apply the GNU Makefile build procedure to the test package.
  2. Load the FIU Unit Test project into CCSV5 and build. All projects will reside in the fiu\test\ccsProjects directory.

Notes:
  1. The GNU Makefile build procedure is described in detail in the main FIU documentation.

Unit Test Procedures

The FIU Unit Test package comes complete with a compiled CCS Project as well as a directly loadable test image. If the unit test code has been altered or enhanced, the Building Unit Test procedure above should be completed before moving forward.

Unit Test Image

The procedure to test using the unit test image is described below. Note that this procedure does not require CCS version 5.2 and may be used for those who haven't yet upgraded to CCS V5.2 (Eclipse).

  1. Open CCS
  2. Load the FIU Unit Test image for the target of interest
    • Will reside in the fiu\test\lnkr\<targ> directory
    • Will have the extension *.x<target>
  3. Run to the main() symbol
  4. Follow the Unit Test Configuration and Execution procedure

Unit Test Project

The procedure to test using the CCS project is described below. Note that this procedure requires CCS version 5.2 and above(Eclipse).

  1. Open CCS version 5.2
  2. Load the FIU project for the target of interest
    • Will be a subdirectory off the fiu\test\ directory
    • Can be identified using the CCS menu options "Project"-->"Import Existing CCS/CCE Eclipse Project" and browsing the fiu\test\ directory.
    • (Optional) Rebuild the project
  3. Open the proper Debug Target Configuration and load the build
    • Can be identified using the CCS menu options "Target"-->"Load Program" and selecting the "Browse Projects" button
    • (Optional) Run to the main() symbol
  4. Follow the Unit Test Configuration and Execution procedure

Dependent Packages

  • ti.mas.types (Common data type defintions)
  • ti.mas.util (Common utilities)
  • ti.mas.fiu (FIU API)
  • ti.mas.swtools (to build software)


FIU Test: Page Index

FIU Test Related Pages

Here is a list of all related documentation pages:
  • Unit Test Configuration and Execution


FIU Test: siuInst_s Struct Reference

  • Data Structures
  • Data Fields

siuInst_s Struct Reference

#include <fiusim.h>

Detailed Description

Definition at line 93 of file fiusim.h.

Data Fields

void * | fiuInst
ecomemBuffer_t * | fiuBufs
tint | fiuNbufs
tint | fiu_heap_size
tint | aux_heap_size

Field Documentation

void* siuInst_s::fiuInst

Definition at line 95 of file fiusim.h.

Referenced by siu_close_fiu(), siu_delete_fiu(), siu_init(), siu_new_fiu(), and siu_open_fiu().

ecomemBuffer_t* siuInst_s::fiuBufs

Definition at line 96 of file fiusim.h.

Referenced by siu_delete_fiu(), siu_init(), and siu_new_fiu().

tint siuInst_s::fiuNbufs

Definition at line 97 of file fiusim.h.

Referenced by siu_delete_fiu(), siu_init(), and siu_new_fiu().

tint siuInst_s::fiu_heap_size

Definition at line 98 of file fiusim.h.

Referenced by siu_delete_fiu(), siu_init(), and siu_new_fiu().

tint siuInst_s::aux_heap_size

Definition at line 100 of file fiusim.h.

Referenced by siu_delete_fiu(), siu_init(), and siu_new_fiu().

The documentation for this struct was generated from the following file:
  • fiusim.h


FM: Version.h File Reference

  • File List
  • Globals

Version.h File Reference

Go to the source code of this file.

Defines

#define | ti_mas_fm_Version__top__
#define | __extern extern
#define | ti_mas_fm_Version___VERS 150
#define | ti_mas_fm_Version_MAJOR (3)
#define | ti_mas_fm_Version_MINOR (1)
#define | ti_mas_fm_Version_XVERTICAL (0)
#define | ti_mas_fm_Version_PATCH (1)
#define | ti_mas_fm_Version_BUILD (2)
#define | ti_mas_fm_Version_QUALITY (3)
#define | ti_mas_fm_Version_BTYPE (0)
#define | ti_mas_fm_Version_WIDTH (0)
#define | Version_MAJOR ti_mas_fm_Version_MAJOR
#define | Version_MINOR ti_mas_fm_Version_MINOR
#define | Version_XVERTICAL ti_mas_fm_Version_XVERTICAL
#define | Version_PATCH ti_mas_fm_Version_PATCH
#define | Version_BUILD ti_mas_fm_Version_BUILD
#define | Version_QUALITY ti_mas_fm_Version_QUALITY
#define | Version_BTYPE ti_mas_fm_Version_BTYPE
#define | Version_WIDTH ti_mas_fm_Version_WIDTH

Define Documentation

#define ti_mas_fm_Version__top__

Definition at line 27 of file Version.h.

#define __extern extern

Definition at line 33 of file Version.h.

#define ti_mas_fm_Version___VERS 150

Definition at line 36 of file Version.h.

#define ti_mas_fm_Version_MAJOR (3)

Definition at line 50 of file Version.h.

#define ti_mas_fm_Version_MINOR (1)

Definition at line 53 of file Version.h.

#define ti_mas_fm_Version_XVERTICAL (0)

Definition at line 56 of file Version.h.

#define ti_mas_fm_Version_PATCH (1)

Definition at line 59 of file Version.h.

#define ti_mas_fm_Version_BUILD (2)

Definition at line 62 of file Version.h.

#define ti_mas_fm_Version_QUALITY (3)

Definition at line 65 of file Version.h.

#define ti_mas_fm_Version_BTYPE (0)

Definition at line 68 of file Version.h.

#define ti_mas_fm_Version_WIDTH (0)

Definition at line 71 of file Version.h.

#define Version_MAJOR ti_mas_fm_Version_MAJOR

Definition at line 90 of file Version.h.

#define Version_MINOR ti_mas_fm_Version_MINOR

Definition at line 91 of file Version.h.

#define Version_XVERTICAL ti_mas_fm_Version_XVERTICAL

Definition at line 92 of file Version.h.

#define Version_PATCH ti_mas_fm_Version_PATCH

Definition at line 93 of file Version.h.

#define Version_BUILD ti_mas_fm_Version_BUILD

Definition at line 94 of file Version.h.

#define Version_QUALITY ti_mas_fm_Version_QUALITY

Definition at line 95 of file Version.h.

#define Version_BTYPE ti_mas_fm_Version_BTYPE

Definition at line 96 of file Version.h.

#define Version_WIDTH ti_mas_fm_Version_WIDTH

Definition at line 97 of file Version.h.


FM: Version.h Source File

  • File List
  • Globals

Version.h

Go to the documentation of this file.
00001 /*
00002  *  Do not modify this file; it is automatically
00003  *  generated and any modifications will be overwritten.
00004  *
00005  * @(#) xdc-t35
00006  */
00007
00008 /*
00009  * ======== GENERATED SECTIONS ========
00010  *
00011  *     PROLOGUE
00012  *     INCLUDES
00013  *     EPILOGUE
00014  *     PREFIX ALIASES
00015  */
00016
00017
00018 /*
00019  * ======== PROLOGUE ========
00020  */
00021
00022 #ifndef ti_mas_fm_Version__include
00023 #define ti_mas_fm_Version__include
00024
00025 #ifndef __nested__
00026 #define __nested__
00027 #define ti_mas_fm_Version__top__
00028 #endif
00029
00030 #ifdef __cplusplus
00031 #define __extern extern "C"
00032 #else
00033 #define __extern extern
00034 #endif
00035
00036 #define ti_mas_fm_Version___VERS 150
00037
00038
00039 /*
00040  * ======== INCLUDES ========
00041  */
00042
00043
00044
00045 /*
00046  * ======== AUXILIARY DEFINITIONS ========
00047  */
00048
00049 /* MAJOR */
00050 #define ti_mas_fm_Version_MAJOR (3)
00051
00052 /* MINOR */
00053 #define ti_mas_fm_Version_MINOR (1)
00054
00055 /* XVERTICAL */
00056 #define ti_mas_fm_Version_XVERTICAL (0)
00057
00058 /* PATCH */
00059 #define ti_mas_fm_Version_PATCH (1)
00060
00061 /* BUILD */
00062 #define ti_mas_fm_Version_BUILD (2)
00063
00064 /* QUALITY */
00065 #define ti_mas_fm_Version_QUALITY (3)
00066
00067 /* BTYPE */
00068 #define ti_mas_fm_Version_BTYPE (0)
00069
00070 /* WIDTH */
00071 #define ti_mas_fm_Version_WIDTH (0)
00072
00073 /*
00074  * ======== EPILOGUE ========
00075  */
00076
00077 #ifdef ti_mas_fm_Version__top__
00078 #undef __nested__
00079 #endif
00080
00081 #endif /* ti_mas_fm_Version__include */
00082
00083 /*
00084  * ======== PREFIX ALIASES ========
00085  */
00086
00087 #if !defined(__nested__) && !defined(ti_mas_fm_Version__nolocalnames)
00088
00089 /* module prefix */
00090 #define Version_MAJOR      ti_mas_fm_Version_MAJOR
00091 #define Version_MINOR      ti_mas_fm_Version_MINOR
00092 #define Version_XVERTICAL  ti_mas_fm_Version_XVERTICAL
00093 #define Version_PATCH      ti_mas_fm_Version_PATCH
00094 #define Version_BUILD      ti_mas_fm_Version_BUILD
00095 #define Version_QUALITY    ti_mas_fm_Version_QUALITY
00096 #define Version_BTYPE      ti_mas_fm_Version_BTYPE
00097 #define Version_WIDTH      ti_mas_fm_Version_WIDTH
00098 #endif


FM: Data Structures

  • Data Structures
  • Data Fields

FM Data Structures

Here are the data structures with brief descriptions:
cd_thr_t |
commonTable1_sPtrs_t | Common Cluster-1 definitions
dpu_shaping_bank_t |
dpu_trec_bank_t |
fmContext_t | FM context Structure
fmNewConfig_t | FM New data structure
fmOpenConfig_t | Open Configuration structure
fmProtoStats_t | Statistics of protocol
fmReceiveOutSpec_t | Specification of fmReceiveOutSpec Object
fmSendOutSpec_t | Specification of fmSendOutSpec Object
fmSigQStats_t | Statistics of signal quality
fmStatsReport_t | FM Statistics Data Structure
fmTablePtrs_t | FM table Pointer structure
fmToneDetCtrlSpec_t | Specification of fmToneDetSpec Object
fmToneGenSpec_t | Specification of fmToneGenSpec Object
v17Table_sPtrs_t | V.17 Cluster definitions
v27Table_sPtrs_t | V.27 Cluster definitions
v29Table_sPtrs_t | V.29 Cluster definitions


FM: C55x Data Sheet

C55x Data Sheet

Copyright 2013, Texas Instruments Incorporated


FM: C64x+ Data Sheet

C64x+ Data Sheet

Copyright 2013, Texas Instruments Incorporated


FM:

IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.

TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed.

TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards.

TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.

Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation.

Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.

Mailing Address:
Texas Instruments
Post Office Box 655303
Dallas, Texas 75265

Copyright © 2006 Texas Instruments Incorporated. All rights reserved.

Information in this document is subject to change without notice. Texas Instruments may have pending patent applications, trademarks, copyrights, or other intellectual property rights covering matter in this document. The furnishing of this document is given for usage with Texas Instruments products only and does not give you any license to the intellectual property that might be contained within this document. Texas Instruments makes no implied or expressed warranties in this document and is not responsible for the products based from this document.


FM: doxygen.h File Reference

  • File List
  • Globals

doxygen.h File Reference

Go to the source code of this file.


FM: doxygen.h Source File

  • File List
  • Globals

doxygen.h

Go to the documentation of this file.
00001 /*
00002  * This is a little header file which doxygen parses to generate the main
00003  * documentation page
00004  */
00005


FM: File Index

  • File List
  • Globals

FM File List

Here is a list of all files with brief descriptions:
doxygen.h [code]
fm.h [code] Public Definitions for Fax Modem


FM: fm.h File Reference

  • File List
  • Globals

fm.h File Reference

Detailed Description

Public Definitions for Fax Modem.

path /dsps_gtmas/ti/mas/fm/fm.h

============================================================================ Copyright (c) 2007 – 2013 Texas Instruments Incorporated

All rights reserved not granted herein.

Limited License.

Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.

Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution

Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:

* No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.

* any redistribution and use are licensed by TI for use only with TI Devices.

* Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.

If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:

* any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.

* any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.

Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.

DISCLAIMER.

THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file fm.h.

#include <ti/mas/types/types.h>
#include <ti/mas/util/debug.h>
#include <ti/mas/iface/iffax/iffax.h>
#include <ti/mas/iface/ifsys/tgn.h>
#include <ti/mas/fm/fmTablesTypes.h>
#include <ti/mas/util/ecomem.h>

Include dependency graph for fm.h:

Go to the source code of this file.

Data Structures

struct | fmReceiveOutSpec_t
Specification of fmReceiveOutSpec Object. More...
struct | fmSendOutSpec_t
Specification of fmSendOutSpec Object. More...
struct | fmToneGenSpec_t
Specification of fmToneGenSpec Object. More...
struct | fmToneDetCtrlSpec_t
Specification of fmToneDetSpec Object. More...
struct | v29Table_sPtrs_t
V.29 Cluster definitions. More...
struct | v27Table_sPtrs_t
V.27 Cluster definitions. More...
struct | v17Table_sPtrs_t
V.17 Cluster definitions. More...
struct | commonTable1_sPtrs_t
common Cluster-1 definitions More...
struct | fmTablePtrs_t
FM table Pointer structure. More...
struct | fmContext_t
FM context Structure. More...
struct | fmNewConfig_t
FM New data structure. More...
struct | fmOpenConfig_t
Open Configuration structure. More...
struct | fmSigQStats_t
Statistics of signal quality. More...
struct | fmProtoStats_t
Statistics of protocol. More...
struct | fmStatsReport_t
FM Statistics Data Structure. More...

Defines

#define | fm_ERROR (-1)
#define | fm_NOERR 0
#define | fm_NOMEMORY (-2)
#define | fm_DBG_LVL_0 0
#define | fm_DBG_LVL_1 1
#define | fm_DBG_LVL_2 2
#define | fm_INFOMATIONAL 0
#define | fm_EXCEPTION 2
#define | fm_HDLC_FLAG_PATTERN 0x7E
HDLC Flag pattern used for T.30 processing.
#define | fm_FEATURE_FLC 0x00
#define | fm_FEATURE_FLC_ENABLE_MASK 0x01
#define | GG_NUM_FM_ENC_TABLES 0
Definitions of FM table relocation constants.
#define | GG_NUM_FM_DEC_TABLES 0
#define | GG_NUM_FM_COMMON_TABLES 5
#define | GG_NUM_FM_TABLES
#define | fm_TABLE1_START &v29tables
#define | fm_TABLE2_START &v27tables
#define | fm_TABLE3_START &v17tables
#define | fm_TABLE4_START &c1tables
#define | fm_TABLE5_START &dpuTrecTableAsFcnPt[0]
#define | fm_TABLE1_L sizeof(v29Table_sPtrs_t)
#define | fm_TABLE2_L sizeof(v27Table_sPtrs_t)
#define | fm_TABLE3_L sizeof(v17Table_sPtrs_t)
#define | fm_TABLE4_L sizeof(commonTable1_sPtrs_t)
#define | fm_TABLE5_L sizeof(dpuTrecTableAsFcnPt)

Functions

ECO (Telogy Embedded Communication Object) APIs
tint | fmGetSizes (tint *nbufs, const ecomemBuffer_t **bufs)
This function obtains memory requirements for an instance of FM.
tint | fmNew (void **fmInst, tint nbufs, ecomemBuffer_t *bufs, fmNewConfig_t *cfg)
This function creates an instance of FM and initializes the memory buffer pointers in the instance.
Remarks:
Function fmNew() must be called before fmOpen()is called.

tint | fmOpen (void *fmInst, fmOpenConfig_t *cfg)
This function initializes and configures an FM instance.
void | fmClose (void *fmInst)
This function closes the FM instance identified by fmInst. It sets the state of FM to CLOSED.
void | fmDelete (void **fmInst)
This function deletes the FM instance identified by fmInst.
Remarks:
FM must be closed prior to being deleted.

void | fmStats (void *fmInst, tbool freset, fmStatsReport_t *stats)
Routine which obtains FM statistics.
void | fmSendIn (void *fmInst, linSample *pcm_samples)
This function passes a frame of PCM linear samples to the FM for processing.
tint | fmReceiveIn (void *fmInst, void *message)
This function passes a message from the FIU to the FM.
void | fmToneDetect (void *fmInst, tuint toneID, tuint v8CallFunction, tuint v8ModMode)
This function notifies FM that a tone detection indication has been received from an external tone detection module.

Variables

fmContext_t fmContext
Reference to FM context Structure.
const v29Table_sPtrs_t | v29tables
const v27Table_sPtrs_t | v27tables
const v17Table_sPtrs_t | v17tables
const commonTable1_sPtrs_t | c1tables
Fract | dpuTrecTableAsFcnPt [1107]


FM: fm.h Source File

  • File List
  • Globals

fm.h

Go to the documentation of this file.
00001 #ifndef _FM_H_
00002 #define _FM_H_
00003
00004 /* ========================================================================== */
00084 /* @{ */
00085 /* System level header files */
00086 #include <ti/mas/types/types.h>
00087 #include <ti/mas/util/debug.h>
00088 #include <ti/mas/iface/iffax/iffax.h>
00089 #include <ti/mas/iface/ifsys/tgn.h>
00090 #include <ti/mas/fm/fmTablesTypes.h>
00091
00092 /* Memory management definitions */
00093 #include <ti/mas/util/ecomem.h>
00094
00099 /* @{ */
00104 #define fm_ERROR    (-1)
00105
00109 #define fm_NOERR        0
00110
00114 #define fm_NOMEMORY     (-2)
00115 /* @} */ /* ingroup */
00116
00121 /* @{ */
00126 #define fm_DBG_LVL_0   0
00127
00132 #define fm_DBG_LVL_1 1
00133
00137 #define fm_DBG_LVL_2 2
00138
00139 /* @} */ /* ingroup */
00140
00141
00146 /* @{ */
00151 #define fm_INFOMATIONAL   0
00152
00156 #define fm_EXCEPTION     2
00157 /* @} */ /* ingroup */
00158
00162 #define fm_HDLC_FLAG_PATTERN 0x7E
00163
00182 /* @{ */
00183 #define fm_FEATURE_FLC                  0x00
00184 #define fm_FEATURE_FLC_ENABLE_MASK      0x01
00185 /* @} */ /* ingroup */
00186
00193 typedef struct {
00199   void (*fmReceiveOut) (void *TargetInst, void *PcmData);
00200   void *TargetInst;
00201 } fmReceiveOutSpec_t;
00202
00209 typedef struct {
00215   void (*fmSendOut) (void *TargetInst, void *message);
00216   void *TargetInst;
00217 } fmSendOutSpec_t;
00218
00225 typedef struct {
00231   void (*ToneOnCmd) (void *TargetInst, tgnParams_t *toneParams);
00235   void (*ToneOffCmd) (void *TargetInst);
00236   void *TargetInst;
00237 } fmToneGenSpec_t;
00238
00239
00240
00248 typedef struct {
00255   void (*ToneDetCtrl) (void *TargetInst, tuint ControlCode);
00256   void  *TargetInst;
00257 } fmToneDetCtrlSpec_t;
00258
00268  typedef struct
00269 {
00270   Fract dpu_smap_V29_96_pt[32];
00271   Fract dpu_smap_V29_72_pt[16];
00272   dpu_shaping_bank_t shape_v29_pt[1];
00273   Fract dpu_slic_pt_V29_72_pt[32];
00274   Fract dpu_slic_pt_V29_96_pt[64];
00275   Fract dpu_denc_V29_9600_pt[8];
00276   Fract dpu_denc_V29_4800_pt[4] ;
00277   Fract dpu_ddec_V29_9600_pt[8];
00278   Fract dpu_ddec_V29_4800_pt[4];
00279   Fract dpu_slic_bits_V29_72_pt[16];
00280   Fract dpu_slic_bits_V29_96_pt[32];
00281   Fract dpu_slic_invmod_V29_96_pt[4];
00282   Fract bp_rx_v29_pt[43];
00283   Fract bp_hilb_v29_pt[43];
00284 } v29Table_sPtrs_t;
00285
00290 typedef struct
00291 {
00292   Fract dpu_smap_V27_48_pt[16];
00293   Fract dpu_smap_V27_24_pt[8];
00294   dpu_shaping_bank_t shape_v27_24_pt[1];
00295   dpu_shaping_bank_t shape_v27_48_pt[1];
00296   Fract dpu_slic_pt_V27_48_pt[16];
00297   Fract dpu_slic_pt_V27_24_pt[8];
00298   Fract dpu_slic_bits_V27_48_pt[8];
00299   Fract dpu_v27_count_pt[8];
00300   Fract bp_rx_v27_48_pt[45];
00301   Fract bp_hilb_v27_48_pt[45];
00302 } v27Table_sPtrs_t;
00303
00307 typedef struct
00308 {
00309   Fract dpu_smap_V17_120_pt[128];
00310   Fract dpu_smap_V17_144_pt[256];
00311   dpu_shaping_bank_t shape_v17_pt[1];
00312   Fract dpu_smap_V17_96_pt[64];
00313   Fract dpu_smap_V17_72_pt[32];
00314   Fract dpu_ddec_V17_AllRates_pt[16];
00315   Fract dpu_denc_V17_AllRates_pt[16];
00316   Fract dpu_slic_invmod_v17_pt[10][10];
00317   Fract dpu_PN_smap_table_v17_AllRates_pt[8];
00318   Fract dpu_bridge_smap_table_v17_AllRates_pt[8];
00319   Fract tanTableInFirstOctant_pt[10];
00320   Fract atan2ScaleFactors_pt[16];
00321   Fract bp_rx_v17_pt[43];
00322   Fract bp_hilb_v17_pt[43];
00323 } v17Table_sPtrs_t;
00324
00328 typedef struct
00329 {
00330   Fract dpuModConvTable_pt[11];
00331   Fract dpuModRateTable_pt[11];
00332   Fract dpuModTypeTable_pt[11];
00333   Fract hn_96_80_pt[5][42];
00334   Fract hn_72_80_pt[10][39];
00335   Fract hn_80_96_pt[6][38];
00336   cd_thr_t cd_thresholds_pt[3];
00337   Fract dpu_trec_fil_coef_pt[4][4];
00338   Fract bp_rx_v21_96_pt[23];
00339   Fract bp_hilb_v21_96_pt[23];
00340 } commonTable1_sPtrs_t;
00341
00345 typedef struct
00346 {
00347   v29Table_sPtrs_t     *v29TablePtrs;
00348   v27Table_sPtrs_t     *v27TablePtrs;
00349   v17Table_sPtrs_t     *v17TablePtrs;
00350   commonTable1_sPtrs_t *commonTable1Ptrs;
00351   Fract                *commonTable2Ptrs;
00352 } fmTablePtrs_t;
00353
00365 typedef struct {
00366   dbgInfo_t debugInfo;
00367   tulong (*fmGetTime) (void);
00368   fmTablePtrs_t *tablePtr;
00369 } fmContext_t;
00370
00374 extern fmContext_t fmContext;
00375
00379 typedef struct {
00380   tuint  ID;
00381 } fmNewConfig_t;
00382
00389 typedef struct {
00390   tuint               debugLvl;
00391   tint                tx_level;
00392   tint                rx_cd_thr_set;
00397   tbool               fBufferData;
00401   tint                maxBytesToBuffer;
00402   tuint               FMfeatureBitMap;
00403   fmToneGenSpec_t     ToneGen;
00404   fmToneDetCtrlSpec_t ToneDetCtrl;
00405   fmReceiveOutSpec_t  RxOutSpec;
00406   fmSendOutSpec_t     SendOutSpec;
00407   fmTablePtrs_t       *tablePtr;
00417 } fmOpenConfig_t;
00418
00422 typedef struct {
00423   tuint dpustatus;
00426   tint snr;
00427   tint carr_offset;
00429   tint percentBaudOffset;
00431   tint tx_level;
00432   tint rx_level;
00433   tint tx_rate;
00434   tint rx_rate;
00435   tuint fslAdjCnt;
00436 } fmSigQStats_t;
00437
00441 typedef struct {
00442   tuint  HDLC_Tx_Underflow;
00443   tuint  Non_HDLC_Tx_Underflow;
00444   tuint  Bad_CRC_From_Tele;
00445   tuint  Bad_CRC_To_Tele;
00446   tulong Good_CRC_From_Tele;
00447   tulong Good_CRC_To_Tele;
00448   tulong Non_HDLC_Rx_From_Tele;
00449   tulong Non_HDLC_Tx_To_Tele;
00450 } fmProtoStats_t;
00451
00452
00456 typedef struct {
00457   fmSigQStats_t  fmSigQStats;
00458   fmProtoStats_t fmProtoStats;
00459 } fmStatsReport_t;
00460
00465
00475 tint fmGetSizes  (tint *nbufs, const ecomemBuffer_t **bufs);
00476
00493 tint fmNew       (void **fmInst, tint nbufs, ecomemBuffer_t *bufs,
00494                   fmNewConfig_t *cfg);
00495
00507 tint fmOpen      (void *fmInst, fmOpenConfig_t *cfg);
00508
00515 void fmClose     (void *fmInst);
00516
00525 void fmDelete    (void **fmInst);
00526
00527
00536 void fmStats     (void *fmInst, tbool freset, fmStatsReport_t *stats);
00537
00547 void fmSendIn    (void *fmInst, linSample *pcm_samples);
00548
00561 tint fmReceiveIn (void *fmInst, void *message);
00562
00574 void fmToneDetect(void *fmInst, tuint toneID, tuint v8CallFunction, tuint v8ModMode);
00575  /* @name ECO APIs */
00577
00578
00586 #define GG_NUM_FM_ENC_TABLES    0
00587 #define GG_NUM_FM_DEC_TABLES    0
00588 #define GG_NUM_FM_COMMON_TABLES 5
00589
00590 #define GG_NUM_FM_TABLES (GG_NUM_FM_ENC_TABLES + \
00591                           GG_NUM_FM_DEC_TABLES + \
00592                           GG_NUM_FM_COMMON_TABLES)
00593
00595 extern const v29Table_sPtrs_t     v29tables;
00596 extern const v27Table_sPtrs_t     v27tables;
00597 extern const v17Table_sPtrs_t     v17tables;
00598 extern const commonTable1_sPtrs_t c1tables;
00599 extern Fract dpuTrecTableAsFcnPt[1107];
00600
00601 #define fm_TABLE1_START &v29tables
00602 #define fm_TABLE2_START &v27tables
00603 #define fm_TABLE3_START &v17tables
00604 #define fm_TABLE4_START &c1tables
00605 #define fm_TABLE5_START &dpuTrecTableAsFcnPt[0]
00606
00608 #define fm_TABLE1_L sizeof(v29Table_sPtrs_t)
00609 #define fm_TABLE2_L sizeof(v27Table_sPtrs_t)
00610 #define fm_TABLE3_L sizeof(v17Table_sPtrs_t)
00611 #define fm_TABLE4_L sizeof(commonTable1_sPtrs_t)
00612 #define fm_TABLE5_L sizeof(dpuTrecTableAsFcnPt)
00613
00614 /* @} */ /* ingroup */
00615
00616 #endif /* _FM_H_ */
00617 /* nothing past this point */


FM: fmTablesTypes.h File Reference

  • File List
  • Globals

fmTablesTypes.h File Reference

#include <ti/mas/types/types.h>

Include dependency graph for fmTablesTypes.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct | dpu_trec_bank_t
struct | dpu_shaping_bank_t
struct | cd_thr_t

Defines

#define | DPU_TREC_LEN 27
#define | DPU_TREC_NUMBER 41
#define | SHAP_MAX_L 6
#define | SHAP_MAX_M_COEF 7

Define Documentation

#define DPU_TREC_LEN 27

Definition at line 85 of file fmTablesTypes.h.

#define DPU_TREC_NUMBER 41

Definition at line 86 of file fmTablesTypes.h.

#define SHAP_MAX_L 6

Definition at line 93 of file fmTablesTypes.h.

#define SHAP_MAX_M_COEF 7

Definition at line 94 of file fmTablesTypes.h.


FM: fmTablesTypes.h Source File

  • File List
  • Globals

fmTablesTypes.h

Go to the documentation of this file.
00001 #ifndef _FMTABLESTYPES_H_
00002 #define _FMTABLESTYPES_H_
00003 /******************************************************************************
00004 *
00005 * FILE PURPOSE: Public Definitions of Table types for Fax Modem
00006 *
00007 *******************************************************************************
00008 * FILE NAME: fm.h
00009 *
00010 * DESCRIPTION:  Public Definitions for Fax Modem.
00011 *
00012 * NOTE: none
00013 *
00014 * REVISION HISTORY:
00015 *
00016 * DATE          AUTHOR        CHANGE DESCRIPTION
00017 * ====          ======        ==================
00018 * 15-Nov-02     ppatel        Created initial version
00019 *
00020 *
00021  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00022  *
00023  *              All rights reserved not granted herein.
00024  *
00025  *                         Limited License.
00026  *
00027  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00028  *  non-exclusive license under copyrights and patents it now or hereafter owns
00029  *  or controls to make, have made, use, import, offer to sell and sell
00030  *  ("Utilize") this software subject to the terms herein.  With respect to the
00031  *  foregoing patent license, such license is granted solely to the extent that
00032  *  any such patent is necessary to Utilize the software alone.  The patent
00033  *  license shall not apply to any combinations which include this software,
00034  *  other than combinations with devices manufactured by or for TI (“TI
00035  *  Devices”).  No hardware patent is licensed hereunder.
00036  *
00037  *  Redistributions must preserve existing copyright notices and reproduce this
00038  *  license (including the above copyright notice and the disclaimer and (if
00039  *  applicable) source code license limitations below) in the documentation
00040  *  and/or other materials provided with the distribution
00041  *
00042  *  Redistribution and use in binary form, without modification, are permitted
00043  *  provided that the following conditions are met:
00044  *
00045  *    *  No reverse engineering, decompilation, or disassembly of this software
00046  *  is permitted with respect to any software provided in binary form.
00047  *
00048  *    *  any redistribution and use are licensed by TI for use only with TI
00049  *  Devices.
00050  *
00051  *    *  Nothing shall obligate TI to provide you with source code for the
00052  *  software licensed and provided to you in object code.
00053  *
00054  *  If software source code is provided to you, modification and redistribution
00055  *  of the source code are permitted provided that the following conditions are
00056  *  met:
00057  *
00058  *    *  any redistribution and use of the source code, including any resulting
00059  *  derivative works, are licensed by TI for use only with TI Devices.
00060  *
00061  *    *  any redistribution and use of any object code compiled from the source
00062  *  code and any resulting derivative works, are licensed by TI for use only
00063  *  with TI Devices.
00064  *
00065  *  Neither the name of Texas Instruments Incorporated nor the names of its
00066  *  suppliers may be used to endorse or promote products derived from this
00067  *  software without specific prior written permission.
00068  *
00069  *  DISCLAIMER.
00070  *
00071  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00072  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00073  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00074  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00075  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00076  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00077  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00078  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00079  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00080  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00081  *  DAMAGE.
00082 ******************************************************************************/
00083 #include <ti/mas/types/types.h>
00084
00085 #define DPU_TREC_LEN         27
00086 #define DPU_TREC_NUMBER      41
00087
00088 typedef struct
00089 {
00090  Fract filters[ DPU_TREC_NUMBER][DPU_TREC_LEN];
00091 } dpu_trec_bank_t;
00092
00093 #define SHAP_MAX_L        6
00094 #define SHAP_MAX_M_COEF   7
00095
00096 typedef struct
00097 {
00098  Fract filters_re[SHAP_MAX_L][SHAP_MAX_M_COEF];
00099  Fract filters_im[SHAP_MAX_L][SHAP_MAX_M_COEF];
00100 } dpu_shaping_bank_t;
00101
00102 typedef struct {
00103   LFract high_thr;
00104   LFract low_thr;
00105 } cd_thr_t;
00106
00107 #endif /* _FMTABLESTYPES_H_ */
00108 /* Nothing past this point */


FM: Data Fields

  • Data Structures
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • t
  • v

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • atan2ScaleFactors_pt : v17Table_sPtrs_t

- b -

  • Bad_CRC_From_Tele : fmProtoStats_t
  • Bad_CRC_To_Tele : fmProtoStats_t
  • bp_hilb_v17_pt : v17Table_sPtrs_t
  • bp_hilb_v21_96_pt : commonTable1_sPtrs_t
  • bp_hilb_v27_48_pt : v27Table_sPtrs_t
  • bp_hilb_v29_pt : v29Table_sPtrs_t
  • bp_rx_v17_pt : v17Table_sPtrs_t
  • bp_rx_v21_96_pt : commonTable1_sPtrs_t
  • bp_rx_v27_48_pt : v27Table_sPtrs_t
  • bp_rx_v29_pt : v29Table_sPtrs_t

- c -

  • carr_offset : fmSigQStats_t
  • cd_thresholds_pt : commonTable1_sPtrs_t
  • commonTable1Ptrs : fmTablePtrs_t
  • commonTable2Ptrs : fmTablePtrs_t

- d -

  • debugInfo : fmContext_t
  • debugLvl : fmOpenConfig_t
  • dpu_bridge_smap_table_v17_AllRates_pt : v17Table_sPtrs_t
  • dpu_ddec_V17_AllRates_pt : v17Table_sPtrs_t
  • dpu_ddec_V29_4800_pt : v29Table_sPtrs_t
  • dpu_ddec_V29_9600_pt : v29Table_sPtrs_t
  • dpu_denc_V17_AllRates_pt : v17Table_sPtrs_t
  • dpu_denc_V29_4800_pt : v29Table_sPtrs_t
  • dpu_denc_V29_9600_pt : v29Table_sPtrs_t
  • dpu_PN_smap_table_v17_AllRates_pt : v17Table_sPtrs_t
  • dpu_slic_bits_V27_48_pt : v27Table_sPtrs_t
  • dpu_slic_bits_V29_72_pt : v29Table_sPtrs_t
  • dpu_slic_bits_V29_96_pt : v29Table_sPtrs_t
  • dpu_slic_invmod_v17_pt : v17Table_sPtrs_t
  • dpu_slic_invmod_V29_96_pt : v29Table_sPtrs_t
  • dpu_slic_pt_V27_24_pt : v27Table_sPtrs_t
  • dpu_slic_pt_V27_48_pt : v27Table_sPtrs_t
  • dpu_slic_pt_V29_72_pt : v29Table_sPtrs_t
  • dpu_slic_pt_V29_96_pt : v29Table_sPtrs_t
  • dpu_smap_V17_120_pt : v17Table_sPtrs_t
  • dpu_smap_V17_144_pt : v17Table_sPtrs_t
  • dpu_smap_V17_72_pt : v17Table_sPtrs_t
  • dpu_smap_V17_96_pt : v17Table_sPtrs_t
  • dpu_smap_V27_24_pt : v27Table_sPtrs_t
  • dpu_smap_V27_48_pt : v27Table_sPtrs_t
  • dpu_smap_V29_72_pt : v29Table_sPtrs_t
  • dpu_smap_V29_96_pt : v29Table_sPtrs_t
  • dpu_trec_fil_coef_pt : commonTable1_sPtrs_t
  • dpu_v27_count_pt : v27Table_sPtrs_t
  • dpuModConvTable_pt : commonTable1_sPtrs_t
  • dpuModRateTable_pt : commonTable1_sPtrs_t
  • dpuModTypeTable_pt : commonTable1_sPtrs_t
  • dpustatus : fmSigQStats_t

- f -

  • fBufferData : fmOpenConfig_t
  • filters : dpu_trec_bank_t
  • filters_im : dpu_shaping_bank_t
  • filters_re : dpu_shaping_bank_t
  • FMfeatureBitMap : fmOpenConfig_t
  • fmGetTime : fmContext_t
  • fmProtoStats : fmStatsReport_t
  • fmReceiveOut : fmReceiveOutSpec_t
  • fmSendOut : fmSendOutSpec_t
  • fmSigQStats : fmStatsReport_t
  • fslAdjCnt : fmSigQStats_t

- g -

  • Good_CRC_From_Tele : fmProtoStats_t
  • Good_CRC_To_Tele : fmProtoStats_t

- h -

  • HDLC_Tx_Underflow : fmProtoStats_t
  • high_thr : cd_thr_t
  • hn_72_80_pt : commonTable1_sPtrs_t
  • hn_80_96_pt : commonTable1_sPtrs_t
  • hn_96_80_pt : commonTable1_sPtrs_t

- i -

  • ID : fmNewConfig_t

- l -

  • low_thr : cd_thr_t

- m -

  • maxBytesToBuffer : fmOpenConfig_t

- n -

  • Non_HDLC_Rx_From_Tele : fmProtoStats_t
  • Non_HDLC_Tx_To_Tele : fmProtoStats_t
  • Non_HDLC_Tx_Underflow : fmProtoStats_t

- p -

  • percentBaudOffset : fmSigQStats_t

- r -

  • rx_cd_thr_set : fmOpenConfig_t
  • rx_level : fmSigQStats_t
  • rx_rate : fmSigQStats_t
  • RxOutSpec : fmOpenConfig_t

- s -

  • SendOutSpec : fmOpenConfig_t
  • shape_v17_pt : v17Table_sPtrs_t
  • shape_v27_24_pt : v27Table_sPtrs_t
  • shape_v27_48_pt : v27Table_sPtrs_t
  • shape_v29_pt : v29Table_sPtrs_t
  • snr : fmSigQStats_t

- t -

  • tablePtr : fmContext_t , fmOpenConfig_t
  • tanTableInFirstOctant_pt : v17Table_sPtrs_t
  • TargetInst : fmReceiveOutSpec_t , fmSendOutSpec_t , fmToneGenSpec_t , fmToneDetCtrlSpec_t
  • ToneDetCtrl : fmOpenConfig_t , fmToneDetCtrlSpec_t
  • ToneGen : fmOpenConfig_t
  • ToneOffCmd : fmToneGenSpec_t
  • ToneOnCmd : fmToneGenSpec_t
  • tx_level : fmSigQStats_t , fmOpenConfig_t
  • tx_rate : fmSigQStats_t

- v -

  • v17TablePtrs : fmTablePtrs_t
  • v27TablePtrs : fmTablePtrs_t
  • v29TablePtrs : fmTablePtrs_t


FM: Data Fields - Variables

  • Data Structures
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • t
  • v

- a -

  • atan2ScaleFactors_pt : v17Table_sPtrs_t

- b -

  • Bad_CRC_From_Tele : fmProtoStats_t
  • Bad_CRC_To_Tele : fmProtoStats_t
  • bp_hilb_v17_pt : v17Table_sPtrs_t
  • bp_hilb_v21_96_pt : commonTable1_sPtrs_t
  • bp_hilb_v27_48_pt : v27Table_sPtrs_t
  • bp_hilb_v29_pt : v29Table_sPtrs_t
  • bp_rx_v17_pt : v17Table_sPtrs_t
  • bp_rx_v21_96_pt : commonTable1_sPtrs_t
  • bp_rx_v27_48_pt : v27Table_sPtrs_t
  • bp_rx_v29_pt : v29Table_sPtrs_t

- c -

  • carr_offset : fmSigQStats_t
  • cd_thresholds_pt : commonTable1_sPtrs_t
  • commonTable1Ptrs : fmTablePtrs_t
  • commonTable2Ptrs : fmTablePtrs_t

- d -

  • debugInfo : fmContext_t
  • debugLvl : fmOpenConfig_t
  • dpu_bridge_smap_table_v17_AllRates_pt : v17Table_sPtrs_t
  • dpu_ddec_V17_AllRates_pt : v17Table_sPtrs_t
  • dpu_ddec_V29_4800_pt : v29Table_sPtrs_t
  • dpu_ddec_V29_9600_pt : v29Table_sPtrs_t
  • dpu_denc_V17_AllRates_pt : v17Table_sPtrs_t
  • dpu_denc_V29_4800_pt : v29Table_sPtrs_t
  • dpu_denc_V29_9600_pt : v29Table_sPtrs_t
  • dpu_PN_smap_table_v17_AllRates_pt : v17Table_sPtrs_t
  • dpu_slic_bits_V27_48_pt : v27Table_sPtrs_t
  • dpu_slic_bits_V29_72_pt : v29Table_sPtrs_t
  • dpu_slic_bits_V29_96_pt : v29Table_sPtrs_t
  • dpu_slic_invmod_v17_pt : v17Table_sPtrs_t
  • dpu_slic_invmod_V29_96_pt : v29Table_sPtrs_t
  • dpu_slic_pt_V27_24_pt : v27Table_sPtrs_t
  • dpu_slic_pt_V27_48_pt : v27Table_sPtrs_t
  • dpu_slic_pt_V29_72_pt : v29Table_sPtrs_t
  • dpu_slic_pt_V29_96_pt : v29Table_sPtrs_t
  • dpu_smap_V17_120_pt : v17Table_sPtrs_t
  • dpu_smap_V17_144_pt : v17Table_sPtrs_t
  • dpu_smap_V17_72_pt : v17Table_sPtrs_t
  • dpu_smap_V17_96_pt : v17Table_sPtrs_t
  • dpu_smap_V27_24_pt : v27Table_sPtrs_t
  • dpu_smap_V27_48_pt : v27Table_sPtrs_t
  • dpu_smap_V29_72_pt : v29Table_sPtrs_t
  • dpu_smap_V29_96_pt : v29Table_sPtrs_t
  • dpu_trec_fil_coef_pt : commonTable1_sPtrs_t
  • dpu_v27_count_pt : v27Table_sPtrs_t
  • dpuModConvTable_pt : commonTable1_sPtrs_t
  • dpuModRateTable_pt : commonTable1_sPtrs_t
  • dpuModTypeTable_pt : commonTable1_sPtrs_t
  • dpustatus : fmSigQStats_t

- f -

  • fBufferData : fmOpenConfig_t
  • filters : dpu_trec_bank_t
  • filters_im : dpu_shaping_bank_t
  • filters_re : dpu_shaping_bank_t
  • FMfeatureBitMap : fmOpenConfig_t
  • fmGetTime : fmContext_t
  • fmProtoStats : fmStatsReport_t
  • fmReceiveOut : fmReceiveOutSpec_t
  • fmSendOut : fmSendOutSpec_t
  • fmSigQStats : fmStatsReport_t
  • fslAdjCnt : fmSigQStats_t

- g -

  • Good_CRC_From_Tele : fmProtoStats_t
  • Good_CRC_To_Tele : fmProtoStats_t

- h -

  • HDLC_Tx_Underflow : fmProtoStats_t
  • high_thr : cd_thr_t
  • hn_72_80_pt : commonTable1_sPtrs_t
  • hn_80_96_pt : commonTable1_sPtrs_t
  • hn_96_80_pt : commonTable1_sPtrs_t

- i -

  • ID : fmNewConfig_t

- l -

  • low_thr : cd_thr_t

- m -

  • maxBytesToBuffer : fmOpenConfig_t

- n -

  • Non_HDLC_Rx_From_Tele : fmProtoStats_t
  • Non_HDLC_Tx_To_Tele : fmProtoStats_t
  • Non_HDLC_Tx_Underflow : fmProtoStats_t

- p -

  • percentBaudOffset : fmSigQStats_t

- r -

  • rx_cd_thr_set : fmOpenConfig_t
  • rx_level : fmSigQStats_t
  • rx_rate : fmSigQStats_t
  • RxOutSpec : fmOpenConfig_t

- s -

  • SendOutSpec : fmOpenConfig_t
  • shape_v17_pt : v17Table_sPtrs_t
  • shape_v27_24_pt : v27Table_sPtrs_t
  • shape_v27_48_pt : v27Table_sPtrs_t
  • shape_v29_pt : v29Table_sPtrs_t
  • snr : fmSigQStats_t

- t -

  • tablePtr : fmContext_t , fmOpenConfig_t
  • tanTableInFirstOctant_pt : v17Table_sPtrs_t
  • TargetInst : fmReceiveOutSpec_t , fmSendOutSpec_t , fmToneGenSpec_t , fmToneDetCtrlSpec_t
  • ToneDetCtrl : fmOpenConfig_t , fmToneDetCtrlSpec_t
  • ToneGen : fmOpenConfig_t
  • ToneOffCmd : fmToneGenSpec_t
  • ToneOnCmd : fmToneGenSpec_t
  • tx_level : fmSigQStats_t , fmOpenConfig_t
  • tx_rate : fmSigQStats_t

- v -

  • v17TablePtrs : fmTablePtrs_t
  • v27TablePtrs : fmTablePtrs_t
  • v29TablePtrs : fmTablePtrs_t


FM: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines
  • _
  • c
  • d
  • f
  • g
  • s
  • t
  • v

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- _ -

  • __extern : Version.h

- c -

  • c1tables : fm.h

- d -

  • DPU_TREC_LEN : fmTablesTypes.h
  • DPU_TREC_NUMBER : fmTablesTypes.h
  • dpuTrecTableAsFcnPt : fm.h

- f -

  • fm_DBG_LVL_0 : fm.h
  • fm_DBG_LVL_1 : fm.h
  • fm_DBG_LVL_2 : fm.h
  • fm_ERROR : fm.h
  • fm_EXCEPTION : fm.h
  • fm_FEATURE_FLC : fm.h
  • fm_FEATURE_FLC_ENABLE_MASK : fm.h
  • fm_HDLC_FLAG_PATTERN : fm.h
  • fm_INFOMATIONAL : fm.h
  • fm_NOERR : fm.h
  • fm_NOMEMORY : fm.h
  • fm_TABLE1_L : fm.h
  • fm_TABLE1_START : fm.h
  • fm_TABLE2_L : fm.h
  • fm_TABLE2_START : fm.h
  • fm_TABLE3_L : fm.h
  • fm_TABLE3_START : fm.h
  • fm_TABLE4_L : fm.h
  • fm_TABLE4_START : fm.h
  • fm_TABLE5_L : fm.h
  • fm_TABLE5_START : fm.h
  • fmClose() : fm.h
  • fmContext : fm.h
  • fmDelete() : fm.h
  • fmGetSizes() : fm.h
  • fmNew() : fm.h
  • fmOpen() : fm.h
  • fmReceiveIn() : fm.h
  • fmSendIn() : fm.h
  • fmStats() : fm.h
  • fmToneDetect() : fm.h

- g -

  • GG_NUM_FM_COMMON_TABLES : fm.h
  • GG_NUM_FM_DEC_TABLES : fm.h
  • GG_NUM_FM_ENC_TABLES : fm.h
  • GG_NUM_FM_TABLES : fm.h

- s -

  • SHAP_MAX_L : fmTablesTypes.h
  • SHAP_MAX_M_COEF : fmTablesTypes.h

- t -

  • ti_mas_fm_Version___VERS : Version.h
  • ti_mas_fm_Version__top__ : Version.h
  • ti_mas_fm_Version_BTYPE : Version.h
  • ti_mas_fm_Version_BUILD : Version.h
  • ti_mas_fm_Version_MAJOR : Version.h
  • ti_mas_fm_Version_MINOR : Version.h
  • ti_mas_fm_Version_PATCH : Version.h
  • ti_mas_fm_Version_QUALITY : Version.h
  • ti_mas_fm_Version_WIDTH : Version.h
  • ti_mas_fm_Version_XVERTICAL : Version.h

- v -

  • v17tables : fm.h
  • v27tables : fm.h
  • v29tables : fm.h
  • Version_BTYPE : Version.h
  • Version_BUILD : Version.h
  • Version_MAJOR : Version.h
  • Version_MINOR : Version.h
  • Version_PATCH : Version.h
  • Version_QUALITY : Version.h
  • Version_WIDTH : Version.h
  • Version_XVERTICAL : Version.h


FM: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines
  • _
  • d
  • f
  • g
  • s
  • t
  • v

- _ -

  • __extern : Version.h

- d -

  • DPU_TREC_LEN : fmTablesTypes.h
  • DPU_TREC_NUMBER : fmTablesTypes.h

- f -

  • fm_DBG_LVL_0 : fm.h
  • fm_DBG_LVL_1 : fm.h
  • fm_DBG_LVL_2 : fm.h
  • fm_ERROR : fm.h
  • fm_EXCEPTION : fm.h
  • fm_FEATURE_FLC : fm.h
  • fm_FEATURE_FLC_ENABLE_MASK : fm.h
  • fm_HDLC_FLAG_PATTERN : fm.h
  • fm_INFOMATIONAL : fm.h
  • fm_NOERR : fm.h
  • fm_NOMEMORY : fm.h
  • fm_TABLE1_L : fm.h
  • fm_TABLE1_START : fm.h
  • fm_TABLE2_L : fm.h
  • fm_TABLE2_START : fm.h
  • fm_TABLE3_L : fm.h
  • fm_TABLE3_START : fm.h
  • fm_TABLE4_L : fm.h
  • fm_TABLE4_START : fm.h
  • fm_TABLE5_L : fm.h
  • fm_TABLE5_START : fm.h

- g -

  • GG_NUM_FM_COMMON_TABLES : fm.h
  • GG_NUM_FM_DEC_TABLES : fm.h
  • GG_NUM_FM_ENC_TABLES : fm.h
  • GG_NUM_FM_TABLES : fm.h

- s -

  • SHAP_MAX_L : fmTablesTypes.h
  • SHAP_MAX_M_COEF : fmTablesTypes.h

- t -

  • ti_mas_fm_Version___VERS : Version.h
  • ti_mas_fm_Version__top__ : Version.h
  • ti_mas_fm_Version_BTYPE : Version.h
  • ti_mas_fm_Version_BUILD : Version.h
  • ti_mas_fm_Version_MAJOR : Version.h
  • ti_mas_fm_Version_MINOR : Version.h
  • ti_mas_fm_Version_PATCH : Version.h
  • ti_mas_fm_Version_QUALITY : Version.h
  • ti_mas_fm_Version_WIDTH : Version.h
  • ti_mas_fm_Version_XVERTICAL : Version.h

- v -

  • Version_BTYPE : Version.h
  • Version_BUILD : Version.h
  • Version_MAJOR : Version.h
  • Version_MINOR : Version.h
  • Version_PATCH : Version.h
  • Version_QUALITY : Version.h
  • Version_WIDTH : Version.h
  • Version_XVERTICAL : Version.h


FM: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines

  • fmClose() : fm.h
  • fmDelete() : fm.h
  • fmGetSizes() : fm.h
  • fmNew() : fm.h
  • fmOpen() : fm.h
  • fmReceiveIn() : fm.h
  • fmSendIn() : fm.h
  • fmStats() : fm.h
  • fmToneDetect() : fm.h


FM: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines

  • c1tables : fm.h
  • dpuTrecTableAsFcnPt : fm.h
  • fmContext : fm.h
  • v17tables : fm.h
  • v27tables : fm.h
  • v29tables : fm.h


FM: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


FM: Fax Debug Mode

Fax Debug Mode
[FM External API]

Collaboration diagram for Fax Debug Mode:

Defines

#define | fm_DBG_LVL_0 0
#define | fm_DBG_LVL_1 1
#define | fm_DBG_LVL_2 2

Define Documentation

#define fm_DBG_LVL_0 0

FM Debug Mode -- Only fatal errors are reported

Definition at line 126 of file fm.h.

#define fm_DBG_LVL_1 1

FM Debug Mode -- Reports high-level FM state information and fatal errors.

Definition at line 132 of file fm.h.

#define fm_DBG_LVL_2 2

FM Debug Mode -- Telogy internal debug mode

Definition at line 137 of file fm.h.


FM: Return Error Codes

Return Error Codes
[FM External API]

Collaboration diagram for Return Error Codes:

Defines

#define | fm_ERROR (-1)
#define | fm_NOERR 0
#define | fm_NOMEMORY (-2)

Define Documentation

#define fm_ERROR (-1)

FM return code -- Invalid configuration

Definition at line 104 of file fm.h.

#define fm_NOERR 0

FM return code -- Initiaization of FM was successful

Definition at line 109 of file fm.h.

#define fm_NOMEMORY (-2)

FIU return code -- Insufficient memory allocated

Definition at line 114 of file fm.h.


FM: FM External API

FM External API

Collaboration diagram for FM External API:

Detailed Description

FM external interfaces are divided into three subcategories: Control Interface, PCM Interface, and Protocol Interface.

Modules

Return Error Codes
Fax Debug Mode
FM Debug message types for debugInfo()
FM Feature register

Data Structures

struct | fmReceiveOutSpec_t
Specification of fmReceiveOutSpec Object. More...
struct | fmSendOutSpec_t
Specification of fmSendOutSpec Object. More...
struct | fmToneGenSpec_t
Specification of fmToneGenSpec Object. More...
struct | fmToneDetCtrlSpec_t
Specification of fmToneDetSpec Object. More...
struct | v29Table_sPtrs_t
V.29 Cluster definitions. More...
struct | v29Table_sPtrs_t
V.29 Cluster definitions. More...
struct | v27Table_sPtrs_t
V.27 Cluster definitions. More...
struct | v17Table_sPtrs_t
V.17 Cluster definitions. More...
struct | commonTable1_sPtrs_t
common Cluster-1 definitions More...
struct | fmTablePtrs_t
FM table Pointer structure. More...
struct | fmContext_t
FM context Structure. More...
struct | fmNewConfig_t
FM New data structure. More...
struct | fmOpenConfig_t
Open Configuration structure. More...
struct | fmSigQStats_t
Statistics of signal quality. More...
struct | fmProtoStats_t
Statistics of protocol. More...
struct | fmStatsReport_t
FM Statistics Data Structure. More...

ECO (Telogy Embedded Communication Object) APIs

tint | fmGetSizes (tint *nbufs, const ecomemBuffer_t **bufs)
This function obtains memory requirements for an instance of FM.
tint | fmNew (void **fmInst, tint nbufs, ecomemBuffer_t *bufs, fmNewConfig_t *cfg)
This function creates an instance of FM and initializes the memory buffer pointers in the instance.
Remarks:
Function fmNew() must be called before fmOpen()is called.

tint | fmOpen (void *fmInst, fmOpenConfig_t *cfg)
This function initializes and configures an FM instance.
void | fmClose (void *fmInst)
This function closes the FM instance identified by fmInst. It sets the state of FM to CLOSED.
void | fmDelete (void **fmInst)
This function deletes the FM instance identified by fmInst.
Remarks:
FM must be closed prior to being deleted.

void | fmStats (void *fmInst, tbool freset, fmStatsReport_t *stats)
Routine which obtains FM statistics.
void | fmSendIn (void *fmInst, linSample *pcm_samples)
This function passes a frame of PCM linear samples to the FM for processing.
tint | fmReceiveIn (void *fmInst, void *message)
This function passes a message from the FIU to the FM.
void | fmToneDetect (void *fmInst, tuint toneID, tuint v8CallFunction, tuint v8ModMode)
This function notifies FM that a tone detection indication has been received from an external tone detection module.

Defines

#define | fm_HDLC_FLAG_PATTERN 0x7E
HDLC Flag pattern used for T.30 processing.
#define | GG_NUM_FM_ENC_TABLES 0
Definitions of FM table relocation constants.
#define | GG_NUM_FM_DEC_TABLES 0
#define | GG_NUM_FM_COMMON_TABLES 5
#define | GG_NUM_FM_TABLES
#define | fm_TABLE1_START &v29tables
#define | fm_TABLE2_START &v27tables
#define | fm_TABLE3_START &v17tables
#define | fm_TABLE4_START &c1tables
#define | fm_TABLE5_START &dpuTrecTableAsFcnPt[0]
#define | fm_TABLE1_L sizeof(v29Table_sPtrs_t)
#define | fm_TABLE2_L sizeof(v27Table_sPtrs_t)
#define | fm_TABLE3_L sizeof(v17Table_sPtrs_t)
#define | fm_TABLE4_L sizeof(commonTable1_sPtrs_t)
#define | fm_TABLE5_L sizeof(dpuTrecTableAsFcnPt)

Variables

fmContext_t fmContext
Reference to FM context Structure.
const v29Table_sPtrs_t | v29tables
const v27Table_sPtrs_t | v27tables
const v17Table_sPtrs_t | v17tables
const commonTable1_sPtrs_t | c1tables
Fract | dpuTrecTableAsFcnPt [1107]

Define Documentation

#define fm_HDLC_FLAG_PATTERN 0x7E

HDLC Flag pattern used for T.30 processing.

Definition at line 162 of file fm.h.

#define GG_NUM_FM_ENC_TABLES 0

Definitions of FM table relocation constants.

Defines sizes of FM tables and symbols that are used as base of these tables (for dynamic table relocation).

Definition at line 586 of file fm.h.

#define GG_NUM_FM_DEC_TABLES 0

Definition at line 587 of file fm.h.

#define GG_NUM_FM_COMMON_TABLES 5

Definition at line 588 of file fm.h.

#define GG_NUM_FM_TABLES

Value:

(GG_NUM_FM_ENC_TABLES + \
                          GG_NUM_FM_DEC_TABLES + \
                          GG_NUM_FM_COMMON_TABLES)
Table address definitions

Definition at line 590 of file fm.h.

#define fm_TABLE1_START &v29tables

Definition at line 601 of file fm.h.

#define fm_TABLE2_START &v27tables

Definition at line 602 of file fm.h.

#define fm_TABLE3_START &v17tables

Definition at line 603 of file fm.h.

#define fm_TABLE4_START &c1tables

Definition at line 604 of file fm.h.

#define fm_TABLE5_START &dpuTrecTableAsFcnPt[0]

Table Lengths

Definition at line 605 of file fm.h.

#define fm_TABLE1_L sizeof(v29Table_sPtrs_t)

Definition at line 608 of file fm.h.

#define fm_TABLE2_L sizeof(v27Table_sPtrs_t)

Definition at line 609 of file fm.h.

#define fm_TABLE3_L sizeof(v17Table_sPtrs_t)

Definition at line 610 of file fm.h.

#define fm_TABLE4_L sizeof(commonTable1_sPtrs_t)

Definition at line 611 of file fm.h.

#define fm_TABLE5_L sizeof(dpuTrecTableAsFcnPt)

Definition at line 612 of file fm.h.

Function Documentation

tint fmGetSizes | ( | tint * | nbufs,
 |  | const ecomemBuffer_t ** | bufs
 | ) |  |

This function obtains memory requirements for an instance of FM.

Parameters:
[out] | nbufs | Number of memory buffers stored in this address.
[out] | bufs | Address of buffer descriptors stored in this address.
Return values:
Value Return Error Codes
Precondition:
Global data structure fmContext must be defined and initialized properly.

tint fmNew | ( | void ** | fmInst,
 |  | tint | nbufs,
 |  | ecomemBuffer_t * | bufs,
 |  | fmNewConfig_t * | cfg
 | ) |  |

This function creates an instance of FM and initializes the memory buffer pointers in the instance.

Remarks:
Function fmNew() must be called before fmOpen()is called.

Parameters:
[in] | nbufs | Number of memory buffers
[in] | bufs | Pointer to memory buffer descriptors
[in] | cfg | Pointer to new instance configuration structure
[in,out] | fmInst | Pointer to FM instance
Return values:
Value Return Error Codes
Precondition:
Pointer fmInst must be set to NULL before this function is called.
Postcondition:
Pointer fmInst will be set to point to the instance buffer described by bufs.
See also:
fmNewConfig_t

tint fmOpen | ( | void * | fmInst,
 |  | fmOpenConfig_t * | cfg
 | ) |  |

This function initializes and configures an FM instance.

Parameters:
[in] | cfg | Pointer to FM Open Configuration Structure.
[in,out] | fmInst | Pointer to FM instance.
Return values:
Value Return Error Codes
Postcondition:
The instance's state will be set to OPEN.
See also:
fmOpenConfig_t

void fmClose ( void * fmInst )

This function closes the FM instance identified by fmInst. It sets the state of FM to CLOSED.

Parameters:
[in,out] fmInst

void fmDelete ( void ** fmInst )

This function deletes the FM instance identified by fmInst.

Remarks:
FM must be closed prior to being deleted.

Parameters:
[in,out] fmInst Pointer to FM instance.
Postcondition:
Pointer fmInst will be set to NULL after this function is called.

void fmStats | ( | void * | fmInst,
 |  | tbool | freset,
 |  | fmStatsReport_t * | stats
 | ) |  |

Routine which obtains FM statistics.

Remarks:
Some of the values are meaningful only if the modem is configured in the proper mode (e.g., high or low speed transmit or receive).
Parameters:
[in,out] | fmInst | Pointer to FM instance
[in] | freset | Flag indicating whether to reset statistics
[in] | stats | pointer to statistics report structure

void fmSendIn | ( | void * | fmInst,
 |  | linSample * | pcm_samples
 | ) |  |

This function passes a frame of PCM linear samples to the FM for processing.

The FM demodulates the input signal and passes the corresponding data and signaling information to the FIU module.

Parameters:
[in] | pcm_samples | Pointer to an array of PCM samples .
[in,out] | fmInst | Pointer to FM instance.

tint fmReceiveIn | ( | void * | fmInst,
 |  | void * | message
 | ) |  |

This function passes a message from the FIU to the FM.

IFFAX.chm describes the format and meaning of the messages from the FIU to the FM

Parameters:
[in] | message | Pointer to the message passed to the FM.
[in,out] | fmInst | Pointer to FM instance.
Return values:
iffax_FM_CMD_ACCEPTED | if the message is copied into message FIFO
iffax_FM_CMD_NOT_ACCEPTED | if the message is not copied into the message FIFO because the FIFO is full
iffax_FM_CMD_ERROR | if message is not copied because FM is closed or invalid message ID

void fmToneDetect | ( | void * | fmInst,
 |  | tuint | toneID,
 |  | tuint | v8CallFunction,
 |  | tuint | v8ModMode
 | ) |  |

This function notifies FM that a tone detection indication has been received from an external tone detection module.

The toneID, v8CallFunction, and v8ModMode parameters are described in the IFFAX.chm.

Parameters:
[in] | toneID | ID of tone detected.
[in] | v8CallFunction | V.8 call function.
[in] | v8ModMode | V.8 modulation mode.
[in,out] | fmInst | Pointer to FM instance.

Variable Documentation

fmContext_t fmContext

Reference to FM context Structure.

const v29Table_sPtrs_t v29tables

const v27Table_sPtrs_t v27tables

const v17Table_sPtrs_t v17tables

const commonTable1_sPtrs_t c1tables

Fract dpuTrecTableAsFcnPt[1107]


FM: FM Feature register

FM Feature register
[FM External API]

Collaboration diagram for FM Feature register:

Detailed Description

A one-word (16-bit) Feature register that reflects the features enabled in FM. The register is laid out as follows:
               ---------------------------------------------------------------
              |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
              |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
               ---------------------------------------------------------------
       Bit #:  15  14  13  12  11  10  09  08  07  06  05  04  03  02  01  00
                                                                            ^
                                                                            |
                                                                            |
                                                                           FLC

Defines

#define | fm_FEATURE_FLC 0x00
#define | fm_FEATURE_FLC_ENABLE_MASK 0x01

Define Documentation

#define fm_FEATURE_FLC 0x00

FrameSlip Logic bit number

Definition at line 183 of file fm.h.

#define fm_FEATURE_FLC_ENABLE_MASK 0x01

FrameSlip Logic bit number Mask

Definition at line 184 of file fm.h.


FM: FM Debug message types for debugInfo()

FM Debug message types for debugInfo()
[FM External API]

Collaboration diagram for FM Debug message types for debugInfo():

Defines

#define | fm_INFOMATIONAL 0
#define | fm_EXCEPTION 2

Define Documentation

#define fm_INFOMATIONAL 0

FM Debug Message Type -- Fax general debug information message

Definition at line 151 of file fm.h.

#define fm_EXCEPTION 2

FM Debug Message Type -- Fax critical debug information message

Definition at line 156 of file fm.h.


FM: FM (Fax Modem) Package

FM (Fax Modem) Package

Release 3.1.1.2

Page Contents

  1. Description
  2. Integration
  3. Default Configuration
  4. Performance
  5. Limitations
  6. Standards Compliance
  7. Dependent Packages

Description

The Facsimile Modem Unit (FM) is a software module that performs all the modulation and demodulation functions required of a fax modem: demodulation of PCM data received at the analog interface, and modulation of facsimile protocol messages received from the FIU. The FM module has the following capabilities and features:
  • V.21 300 bps channel 2 (1750 Hz nominal frequency) binary signal modulation and demodulation
  • HDLC framing / deframing (0 bit insertion & removal, CRC generation & checking)
  • V.27ter (2400 / 4800 bps),
  • V.29 (7200 / 9600 bps),
  • V.17 (7200 / 9600 / 12000 / 14400 bps),
  • V.33 (12000 / 14400 bps) high-speed data modulation and demodulation
  • Control the generation of fax tones (i.e. CNG / CED) by an external tone generation utility through API's

Integration

The FM component can be integrated into a system and provide reliable fax modem following the link below. There, we descibe the build process, integration/link process and global structure initialization requirements.

Object deliveries come with the libraries built and ready for integration. Accordingly, the build process only applies to Source deliveries in which the FM code may be customized and the libraries built.

Note:
  1. Source deliveries come with libraries pre-built. The build process is only required if changes to the source code are made.

Additional links: | FM External API
 | FM Integration

Default Configuration

None

Performance

For MIPS and memory information proceed to the links provided below

Additional links: Performance

Limitations

None

Standards Compliance

  1. CCITT Recommendation T.30, “Procedures for Document Facsimile Transmission in the General Switched Telephone Network.”
  2. CCITT Recommendation T.4, “Standardization of Group 3 Facsimile Apparatus for Document Transmission.”
  3. CCITT Recommendation T.6, “Facsimile Coding Schemes and Coding Control Functions for Group 4 Facsimile Apparatus.
  4. ITU-T Recommendation V.21, “300 Bits Per Second Duplex Modem Standardized for Use in the General Switched Telephone Network.”
  5. ITU-T Recommendation V.27 ter, “4800/2400 Bits Per Second Modem Standardized for Use in the General Switched Telephone Network.”
  6. ITU-T Recommendation V.29, “9600 Bits Per Second Modem Standardized for Use on Point-To-Point 4-Wire Leased Telephone-Type Circuits.”
  7. ITU-T Recommendation V.33, “14400 Bits Per Second Modem Standardized for Use on Point-To-Point 4-Wire Leased Telephone-Type Circuits.”
  8. ITU-T Recommendation V.17, “A 2-Wire Modem for Facsimile Applications with Rates Up To 14400 bit/s.”

Dependent Packages

The FM package depends on the following packages for build and/or integration. The specific versions and compatibility keys are provided in the release notes.

  1. ti.mas.types (Common data type defintions)
  2. ti.mas.util (Common utilities)
  3. ti.mas.fract (Common fractional arithmetic macros)
  4. ti.mas.iffax (External fax interface for configuration)
  5. ti.mas.ifsys (Common Interface Package)
  6. ti.mas.swtools (Internally used s/w tools)


FM: FM Integration

FM (Fax Modem) Package

FM Integration

Page Contents

  • XDC Build Process
  • Make Build Process
  • Linking FM with System

XDC Build Process

Required Tools

The following tools are required to build the FM component (links provided). Download and install all tools to a single local (C:) directory, for example c:\tools.

  1. Code Generation (download)
    • C55xx: CG Tools version:
    • C64xx: CG Tools version
  2. XDC (download)
    • XDC Tools version
  3. xDAIS (download)
    • xDAIS Developer's Kit version

Note:
  1. A "My.TI" account is required for download and can be registered at http://my.ti.com.

Windows Configuration

Once all tools are properly installed, the environment will need to be configured to recognize the tool paths. A Windows batch file should be created to provide a consistent manner to achieve this. The example below can used (cut & paste) to create a setenv.bat batch file in the ...\ti\mas\swtools directory.

Assumptions:
  1. The XDC tools were installed in c:\tools
  2. The C55 code generation tools were installed in c:\tools\cgen_<ver>
  3. The C64 code generation tools were installed in c:\tools\cgen_<ver>
  4. The xDAIS developr's kit was installed in c:\tools\xdais_<ver>

    @echo off
    rem # *************************************************************************
    rem # *** Version information (ONLY EDIT THIS SECTION)
    rem # *************************************************************************
    set LOCAL_TOOLSDIR=tools
    set XDCBASE=xdctools_<ver>
    set C55CODEGENBASE=cgen_<ver>
    set C64CODEGENBASE=cgen_<ver>
    set XDAISBASE=xdais_<ver>

    rem # *************************************************************************
    rem # *** Set up tools directory
    rem # *************************************************************************
    set LOCAL_TOOLSDIR_DOS=c:\%LOCAL_TOOLSDIR%

    rem # *************************************************************************
    rem # ** Set code generation tools path
    rem # *************************************************************************
    set C55CODEGENTOOL=%LOCAL_TOOLSDIR_DOS%\%C55CODEGENBASE%
    set C64CODEGENTOOL=%LOCAL_TOOLSDIR_DOS%\%C64CODEGENBASE%

    rem # *************************************************************************
    rem # ** Set the PATH
    rem # *************************************************************************
    set PATH=%SystemRoot%;%SystemRoot%\system32
    set PATH=%PATH%;%LOCAL_TOOLSDIR_DOS%\%XDCBASE%

    rem # *************************************************************************
    rem # ** Create environment variables for XDC
    rem # *************************************************************************
    set XDCCGROOT=%LOCAL_TOOLSDIR_DOS%
    set xdc=\%LOCAL_TOOLSDIR%\%XDCBASE%\xdc.exe $*

    rem # *************************************************************************
    rem # ** Set the XDC PATH
    rem # *************************************************************************
    set XDCPATH=%LOCAL_TOOLSDIR_DOS%\%XDCBASE%\packages
    set XDCPATH=%XDCPATH%;%LOCAL_TOOLSDIR_DOS%\%XDAISBASE%\packages

    rem # *************************************************************************
    rem # ** Identify the config.bld file
    rem # *************************************************************************
    xs -f setconfig.js
    call tempcfg
    del tempcfg.bat

    rem # End of file

Linux Configuration

TBD

Compilation

To build the FM package, ensure (again) that all packages provided with the build have been extracted to a common working directory (as described in FM Integration). Change to the swtools directory and configure the build environment by executing the setenv.bat batch file. To build the FM using the XDC tools, change to the FM directory and proceed.

With the environment configured, XDC may be eployed to build the FM and its dependent packages. The four XDC commands below are all that is needed to clean and build any of the FM packages. The first two commands provide a means to clean and build the FM package (alone). Nothing further is needed unless the source for a dependent packages has changed.

If the source for any of the dependent packages has changed, commands (3) and (4) below provide a mechanism to clean and build both the FM and all dependent packages.

Note:
  1. In the above, the <WORK>/ti/mas/ path is assumed and just the sub-directories are specified (e.g., FM).

The XDC environment provides several build options.

  1. xdc clean
    • Removes all generated FM build files
    • Analagous to "make clean"

  2. xdc XDCARGS="c<rtarg> obj"
    • Builds the FM for the target specified by <rtarg> (see Dependent Packages)

  3. xdc XDCARGS="c<rtarg> obj" -PD .
    • Builds the FM as in (2) above
    • The "-PD ." option ensures that all dependent packages are built as well (if needed).

  4. xdc clean -PD .
    • Removes all generated FM build files as in (1) above
    • Removes all generated build files for all FM dependent packages

Make Build Process

Each MAS component that generates a library or an executable artifact creates, as part of the build process, a GNU "makefile" in its root folder. This makefile provides the list of all tools and common build utilities required for generating the respective artifacts.

For each artifact generated by the package there is an additonal target makefile kept at the destination directory of the artifact. The top-level "makefile" recursively invokes each artifact makefile as required by the component build.

Procedure

The build procedure using make rather than the XDC tools follows:

Required Tools:

  1. Cygwin tools (Windows only) (Verified with Cygwin version 1.18)
  2. Texas Instruments Codegen Tools for the target processor

Procedure:

  1. Add "cygwin/bin" to the environment PATH (Windows only)
  2. Correct the XXX_GEN_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XXX_GEN_INSTALL_DIR in the environment with the correct tools PATH.
  3. Correct the MAS_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the MAS_INSTALL_DIR in the environment to match the installation PATH.
  4. Correct the XDAIS_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XDAIS_INSTALL_DIR in the environment with the correct tools PATH.
  5. Correct the XDC_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XDC_INSTALL_DIR in the environment with the correct tools PATH.
  6. The make targets supported are:
    1. "all": Build all library and executable artifacts. For executable it recursively builds all the dependent components as well.
    2. "clean": Clean all generated object files and artifacts
    3. "cleanall": Cleans all generated artifacts of the components as well its dependent component.

Notes:
  1. If you are building C55x library (for example), correct the C55x tools path only. You can ignore other codegen tool paths.
  2. Ignore steps 4 - 5 if not using XDAIS

Linking FM with System

The FM and each of its dependent packages (see Dependent Packages) should be expanded (unzipped) to a common working directory (<WORK>). This will create the following directory structure under the common directory.

  <WORK>/ti/mas/asm
               /hdlc
               /swtools
               /types
               /util
               /fm
               /iface
               /fract

Note:
  1. This directory structure and its content should be maintained to allow subsequent compilation.

Include Requirements

The following header files must be included in any source file that references the FM API:

  1. #include <ti/mas/types/types.h>
  2. #include <ti/mas/fm/fm.h>
  3. #include <ti/mas/iface/iffax/iffax.h>
  4. #include <ti/mas/iface/ifsys/tgn.h>

The compile-time option below is required such that <WORK> resides in the compiler's include path.

  1. -i <WORK>

Where WORK is the path to the working directory.

Compile Defines

When compiling source files that include RTSC package header files (e.g., fm.h or tgn.h) the following compiler option must be specified:

  1. -Dti_targets_<xtarg>

Note:
  1. <xtarg> represents the target platform using the XDC naming convention (see Dependent Packages).

Linking

The following libraries must be included in the final link:

  1. ti\mas\util\lib\util_a.a<rtarg>
  2. ti\mas\util\lib\util_c.a<rtarg>
  3. **ti\mas\hdlc\lib\hdlc_a.a<rtarg>
  4. ti\mas\hdlc\lib\hdlc_c.a<rtarg>
  5. ti\mas\fm\lib\fm_a.a<rtarg>
  6. ti\mas\fm\lib\fm_c.a<rtarg>

**Only required for C55x

Target Naming Conventions
Target | RTSC Naming (<rtarg>) | XDC Naming (<xtarg>)
C55x Large Memory Model | 55l | C55_large
C64x COFF Little Endian | 64 | C64
C64x COFF Big Endian | 64e | C64_big_endian
C64x+ COFF Little Endian | 64P | C64P
C64x+ COFF Big Endian | 64Pe | C64P_big_endian
C64x+ ELF Little Endian | e64P | C64P_elf
C64x+ ELF Big Endian | e64Pe | C64P_big_endian_elf
C66x COFF Little Endian | 66 | C66
C66x COFF Big Endian | 66e | C66_big_endian
C66x+ ELF Little Endian | e66 | C66_elf
C66x+ ELF Big Endian | e66e | C66_big_endian_elf


FM: Performance

FM (Fax Modem) Package

Performance

  • C64x+ Data Sheet
  • C55x Data Sheet


FM: Module Index

FM Modules

Here is a list of all modules:
  • FM External API
    • Return Error Codes
    • Fax Debug Mode
    • FM Debug message types for debugInfo()
    • FM Feature register


FM: Page Index

FM Related Pages

Here is a list of all related documentation pages:
  • C55x Data Sheet
  • C64x+ Data Sheet
  • History
  • Disclaimer


FM: History

History

Revision History

Version | Comments
1.0.0.0 | Initial Version


FM: cd_thr_t Struct Reference

  • Data Structures
  • Data Fields

cd_thr_t Struct Reference

#include <fmTablesTypes.h>

Detailed Description

Definition at line 102 of file fmTablesTypes.h.

Data Fields

LFract | high_thr
LFract | low_thr

Field Documentation

LFract cd_thr_t::high_thr

Definition at line 103 of file fmTablesTypes.h.

LFract cd_thr_t::low_thr

Definition at line 104 of file fmTablesTypes.h.

The documentation for this struct was generated from the following file:
  • fmTablesTypes.h


FM: commonTable1_sPtrs_t Struct Reference

  • Data Structures
  • Data Fields

commonTable1_sPtrs_t Struct Reference
[FM External API]

#include <fm.h>

Collaboration diagram for commonTable1_sPtrs_t:

[legend]

Detailed Description

common Cluster-1 definitions

Definition at line 328 of file fm.h.

Data Fields

Fract | dpuModConvTable_pt [11]
Fract | dpuModRateTable_pt [11]
Fract | dpuModTypeTable_pt [11]
Fract | hn_96_80_pt [5][42]
Fract | hn_72_80_pt [10][39]
Fract | hn_80_96_pt [6][38]
cd_thr_t | cd_thresholds_pt [3]
Fract | dpu_trec_fil_coef_pt [4][4]
Fract | bp_rx_v21_96_pt [23]
Fract | bp_hilb_v21_96_pt [23]

Field Documentation

Fract commonTable1_sPtrs_t::dpuModConvTable_pt[11]

Definition at line 330 of file fm.h.

Fract commonTable1_sPtrs_t::dpuModRateTable_pt[11]

Definition at line 331 of file fm.h.

Fract commonTable1_sPtrs_t::dpuModTypeTable_pt[11]

Definition at line 332 of file fm.h.

Fract commonTable1_sPtrs_t::hn_96_80_pt[5][42]

Definition at line 333 of file fm.h.

Fract commonTable1_sPtrs_t::hn_72_80_pt[10][39]

Definition at line 334 of file fm.h.

Fract commonTable1_sPtrs_t::hn_80_96_pt[6][38]

Definition at line 335 of file fm.h.

cd_thr_t commonTable1_sPtrs_t::cd_thresholds_pt[3]

Definition at line 336 of file fm.h.

Fract commonTable1_sPtrs_t::dpu_trec_fil_coef_pt[4][4]

Definition at line 337 of file fm.h.

Fract commonTable1_sPtrs_t::bp_rx_v21_96_pt[23]

Definition at line 338 of file fm.h.

Fract commonTable1_sPtrs_t::bp_hilb_v21_96_pt[23]

Definition at line 339 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: dpu_shaping_bank_t Struct Reference

  • Data Structures
  • Data Fields

dpu_shaping_bank_t Struct Reference

#include <fmTablesTypes.h>

Detailed Description

Definition at line 96 of file fmTablesTypes.h.

Data Fields

Fract | filters_re [SHAP_MAX_L][SHAP_MAX_M_COEF]
Fract | filters_im [SHAP_MAX_L][SHAP_MAX_M_COEF]

Field Documentation

Fract dpu_shaping_bank_t::filters_re[SHAP_MAX_L][SHAP_MAX_M_COEF]

Definition at line 98 of file fmTablesTypes.h.

Fract dpu_shaping_bank_t::filters_im[SHAP_MAX_L][SHAP_MAX_M_COEF]

Definition at line 99 of file fmTablesTypes.h.

The documentation for this struct was generated from the following file:
  • fmTablesTypes.h


FM: dpu_trec_bank_t Struct Reference

  • Data Structures
  • Data Fields

dpu_trec_bank_t Struct Reference

#include <fmTablesTypes.h>

Detailed Description

Definition at line 88 of file fmTablesTypes.h.

Data Fields

Fract filters [DPU_TREC_NUMBER][DPU_TREC_LEN]

Field Documentation

Fract dpu_trec_bank_t::filters[DPU_TREC_NUMBER][DPU_TREC_LEN]

Definition at line 90 of file fmTablesTypes.h.

The documentation for this struct was generated from the following file:
  • fmTablesTypes.h


FM: fmContext_t Struct Reference

  • Data Structures
  • Data Fields

fmContext_t Struct Reference
[FM External API]

#include <fm.h>

Collaboration diagram for fmContext_t:

[legend]

Detailed Description

FM context Structure.

The FM software module has a global context structure that contains non channel specific configuration information which is used by all active FM instances. FM context is a structure that must be declared globally by system code, and initialized prior to any calls to the FM API's.

Definition at line 365 of file fm.h.

Data Fields

dbgInfo_t | debugInfo
tulong(* | fmGetTime )(void)
fmTablePtrs_t * tablePtr

Field Documentation

dbgInfo_t fmContext_t::debugInfo

Pointer to a function for sending debug trace messages and exceptions

Definition at line 366 of file fm.h.

tulong(* fmContext_t::fmGetTime)(void)

Pointer to a function for obtaining system time in milliseconds

fmTablePtrs_t* fmContext_t::tablePtr

Pointer to the FM tables that should be initialized to NULL

Definition at line 368 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmNewConfig_t Struct Reference

  • Data Structures
  • Data Fields

fmNewConfig_t Struct Reference
[FM External API]

#include <fm.h>

Detailed Description

FM New data structure.

Definition at line 379 of file fm.h.

Data Fields

tuint ID

Field Documentation

tuint fmNewConfig_t::ID

User-specified module ID

Definition at line 380 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmOpenConfig_t Struct Reference

  • Data Structures
  • Data Fields

fmOpenConfig_t Struct Reference
[FM External API]

#include <fm.h>

Collaboration diagram for fmOpenConfig_t:

[legend]

Detailed Description

Open Configuration structure.

Data structure providing configuration information in fmOpen

Definition at line 389 of file fm.h.

Data Fields

tuint | debugLvl
tint | tx_level
tint | rx_cd_thr_set
tbool | fBufferData
tint | maxBytesToBuffer
tuint | FMfeatureBitMap
fmToneGenSpec_t ToneGen
fmToneDetCtrlSpec_t ToneDetCtrl
fmReceiveOutSpec_t RxOutSpec
fmSendOutSpec_t SendOutSpec
fmTablePtrs_t * tablePtr

Field Documentation

tuint fmOpenConfig_t::debugLvl

Valid FM Debug Modes

Definition at line 390 of file fm.h.

tint fmOpenConfig_t::tx_level

default transmit level ( in -dBm)

Definition at line 391 of file fm.h.

tint fmOpenConfig_t::rx_cd_thr_set

Received CD threshold set selector:
0: off-to-on = -43dBm, on-to-off = -48dBm
1: off-to-on = -26dBm, on-to-off = -31dBm
2: off-to-on = -31dBm, on-to-off = -37dBm

Definition at line 392 of file fm.h.

tbool fmOpenConfig_t::fBufferData

Indication to buffer data:
FALSE (0): data is passed to the partner module as soon as it is received.
TRUE (1): data is collected in buffers of maxBytesToBuffer size before sending to partner module.

Definition at line 397 of file fm.h.

tint fmOpenConfig_t::maxBytesToBuffer

Maximum number of bytes to buffer in BufferData mode

Definition at line 401 of file fm.h.

tuint fmOpenConfig_t::FMfeatureBitMap

FM feature bitmap: unused

Definition at line 402 of file fm.h.

fmToneGenSpec_t fmOpenConfig_t::ToneGen

Address of function and associated data structure for controlling tone generation

Definition at line 403 of file fm.h.

fmToneDetCtrlSpec_t fmOpenConfig_t::ToneDetCtrl

Address of function and associated data structure for tone detection control

Definition at line 404 of file fm.h.

fmReceiveOutSpec_t fmOpenConfig_t::RxOutSpec

Address of function and associated data structure for passing PCM samples

Definition at line 405 of file fm.h.

fmSendOutSpec_t fmOpenConfig_t::SendOutSpec

Address of function and associated data structure for passing data and signaling

Definition at line 406 of file fm.h.

fmTablePtrs_t* fmOpenConfig_t::tablePtr

Pointer to relocatable FM tables (i.e. fmTablePtrs). fmTablePtrs should be initialized to point to the tables as shown below:
void * fmTablePtrs[] =
{
(void *) fm_TABLE1_START,
(void *) fm_TABLE2_START,
(void *) fm_TABLE3_START,
(void *) fm_TABLE4_START,
(void *) fm_TABLE5_START
};

Definition at line 407 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmProtoStats_t Struct Reference

  • Data Structures
  • Data Fields

fmProtoStats_t Struct Reference
[FM External API]

#include <fm.h>

Detailed Description

Statistics of protocol.

Definition at line 441 of file fm.h.

Data Fields

tuint | HDLC_Tx_Underflow
tuint | Non_HDLC_Tx_Underflow
tuint | Bad_CRC_From_Tele
tuint | Bad_CRC_To_Tele
tulong | Good_CRC_From_Tele
tulong | Good_CRC_To_Tele
tulong | Non_HDLC_Rx_From_Tele
tulong | Non_HDLC_Tx_To_Tele

Field Documentation

tuint fmProtoStats_t::HDLC_Tx_Underflow

Underflow counter of HDLC tx

Definition at line 442 of file fm.h.

tuint fmProtoStats_t::Non_HDLC_Tx_Underflow

Underflow counter of non-HDLC tx

Definition at line 443 of file fm.h.

tuint fmProtoStats_t::Bad_CRC_From_Tele

Number of bad CRC frames from telephony

Definition at line 444 of file fm.h.

tuint fmProtoStats_t::Bad_CRC_To_Tele

Number of bad CRC frames to telephony

Definition at line 445 of file fm.h.

tulong fmProtoStats_t::Good_CRC_From_Tele

Number of good CRC frames from telephony

Definition at line 446 of file fm.h.

tulong fmProtoStats_t::Good_CRC_To_Tele

Number of good CRC frames to telephony

Definition at line 447 of file fm.h.

tulong fmProtoStats_t::Non_HDLC_Rx_From_Tele

Number of non-HDLC data bytes received from telephony

Definition at line 448 of file fm.h.

tulong fmProtoStats_t::Non_HDLC_Tx_To_Tele

Number of non-HDLC data bytes transmitted to telephony

Definition at line 449 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmReceiveOutSpec_t Struct Reference

  • Data Structures
  • Data Fields

fmReceiveOutSpec_t Struct Reference
[FM External API]

#include <fm.h>

Detailed Description

Specification of fmReceiveOutSpec Object.

This structure contains the address of function and associated data structure for sending data to the PCM interface unit

Definition at line 193 of file fm.h.

Data Fields

void(* | fmReceiveOut )(void *TargetInst, void *PcmData)
Routine called by FM to send a frame of linear PCM samples to the target instance (typically the PIU). This callout function is invoked whenever fmSendIn() is called.
void * | TargetInst

Field Documentation

void(* fmReceiveOutSpec_t::fmReceiveOut)(void *TargetInst, void *PcmData)

Routine called by FM to send a frame of linear PCM samples to the target instance (typically the PIU). This callout function is invoked whenever fmSendIn() is called.

void* fmReceiveOutSpec_t::TargetInst

Pointer to Target Instance

Definition at line 200 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmSendOutSpec_t Struct Reference

  • Data Structures
  • Data Fields

fmSendOutSpec_t Struct Reference
[FM External API]

#include <fm.h>

Detailed Description

Specification of fmSendOutSpec Object.

This structure contains the address of function and associated data structure for sending modem event/data to the FAX protocol processing unit.

Definition at line 209 of file fm.h.

Data Fields

void(* | fmSendOut )(void *TargetInst, void *message)
Routine called by FM to send a message to the FIU. A non-zero return value indicates an error. Please refer IFFAX.chm for messages from the FM to the FIU.
void * | TargetInst

Field Documentation

void(* fmSendOutSpec_t::fmSendOut)(void *TargetInst, void *message)

Routine called by FM to send a message to the FIU. A non-zero return value indicates an error. Please refer IFFAX.chm for messages from the FM to the FIU.

void* fmSendOutSpec_t::TargetInst

Pointer to Target Instance

Definition at line 216 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmSigQStats_t Struct Reference

  • Data Structures
  • Data Fields

fmSigQStats_t Struct Reference
[FM External API]

#include <fm.h>

Detailed Description

Statistics of signal quality.

Definition at line 422 of file fm.h.

Data Fields

tuint | dpustatus
tint | snr
tint | carr_offset
tint | percentBaudOffset
tint | tx_level
tint | rx_level
tint | tx_rate
tint | rx_rate
tuint | fslAdjCnt

Field Documentation

tuint fmSigQStats_t::dpustatus

Status of the DPU. The 8 MSBs contain configuration parameters:
6 MSBs specify the modulation mode, 1 bit specifies the half/full duplex, 1 bit TX or RX. The 8 LSBs specify the current state of the state machine.

Definition at line 423 of file fm.h.

tint fmSigQStats_t::snr

Estimated signal to noise ratio (in dB) in data mode for high speed (V.27ter, V.29, V.17 or V.33).

Definition at line 426 of file fm.h.

tint fmSigQStats_t::carr_offset

Carrier frequency offset in 0.1 Hz (e.g., if carr_offset is 100, the carrier frequency offset is 10 Hz). This value is meaningful only in data mode for high speed (V.27ter, V.29, V.17 or V.33).

Definition at line 427 of file fm.h.

tint fmSigQStats_t::percentBaudOffset

Timing offset in 0.0001% (e.g., if percentBaudOffset is 25, the timing offset is 25e-4 %). This value is meaningful only in data mode for high speed (V.27ter, V.29, V.17 or V.33).

Definition at line 429 of file fm.h.

tint fmSigQStats_t::tx_level

TX Level ( in -dBm )

Definition at line 431 of file fm.h.

tint fmSigQStats_t::rx_level

RX Level ( in -dBm )

Definition at line 432 of file fm.h.

tint fmSigQStats_t::tx_rate

Configured TX rate (in bps).

Definition at line 433 of file fm.h.

tint fmSigQStats_t::rx_rate

Configured RX rate (in bps).

Definition at line 434 of file fm.h.

tuint fmSigQStats_t::fslAdjCnt

Frame slip adjustment counter

Definition at line 435 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmStatsReport_t Struct Reference

  • Data Structures
  • Data Fields

fmStatsReport_t Struct Reference
[FM External API]

#include <fm.h>

Collaboration diagram for fmStatsReport_t:

[legend]

Detailed Description

FM Statistics Data Structure.

Definition at line 456 of file fm.h.

Data Fields

fmSigQStats_t fmSigQStats
fmProtoStats_t fmProtoStats

Field Documentation

fmSigQStats_t fmStatsReport_t::fmSigQStats

Signal quality stats structure

Definition at line 457 of file fm.h.

fmProtoStats_t fmStatsReport_t::fmProtoStats

Protocol stats structure

Definition at line 458 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmTablePtrs_t Struct Reference

  • Data Structures
  • Data Fields

fmTablePtrs_t Struct Reference
[FM External API]

#include <fm.h>

Collaboration diagram for fmTablePtrs_t:

[legend]

Detailed Description

FM table Pointer structure.

Definition at line 345 of file fm.h.

Data Fields

v29Table_sPtrs_t * v29TablePtrs
v27Table_sPtrs_t * v27TablePtrs
v17Table_sPtrs_t * v17TablePtrs
commonTable1_sPtrs_t * commonTable1Ptrs
Fract * commonTable2Ptrs

Field Documentation

v29Table_sPtrs_t* fmTablePtrs_t::v29TablePtrs

Pointer to V.29 Cluster tables

Definition at line 347 of file fm.h.

v27Table_sPtrs_t* fmTablePtrs_t::v27TablePtrs

Pointer to V.27 Cluster tables

Definition at line 348 of file fm.h.

v17Table_sPtrs_t* fmTablePtrs_t::v17TablePtrs

Pointer to V.17 Cluster tables

Definition at line 349 of file fm.h.

commonTable1_sPtrs_t* fmTablePtrs_t::commonTable1Ptrs

Pointer to Common Cluster-1 tables

Definition at line 350 of file fm.h.

Fract* fmTablePtrs_t::commonTable2Ptrs

Pointer to Common Cluster-2 tables

Definition at line 351 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmToneDetCtrlSpec_t Struct Reference

  • Data Structures
  • Data Fields

fmToneDetCtrlSpec_t Struct Reference
[FM External API]

#include <fm.h>

Detailed Description

Specification of fmToneDetSpec Object.

This structure contains the address of function and associated data structure for tone detection.

Definition at line 248 of file fm.h.

Data Fields

void(* | ToneDetCtrl )(void *TargetInst, tuint ControlCode)
Routine called by FM to configure tone detection funtionality Control Codes:
iffax_TONE_DETECT_CTRL_DISABLE 0
iffax_TONE_DETECT_CTRL_ENABLE 1.
void * | TargetInst

Field Documentation

void(* fmToneDetCtrlSpec_t::ToneDetCtrl)(void *TargetInst, tuint ControlCode)

Routine called by FM to configure tone detection funtionality Control Codes:
iffax_TONE_DETECT_CTRL_DISABLE 0
iffax_TONE_DETECT_CTRL_ENABLE 1.

void* fmToneDetCtrlSpec_t::TargetInst

Pointer to Target Instance

Definition at line 256 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: fmToneGenSpec_t Struct Reference

  • Data Structures
  • Data Fields

fmToneGenSpec_t Struct Reference
[FM External API]

#include <fm.h>

Detailed Description

Specification of fmToneGenSpec Object.

This structure contains the address of function and associated data structure for tone generation.

Definition at line 225 of file fm.h.

Data Fields

void(* | ToneOnCmd )(void *TargetInst, tgnParams_t *toneParams)
Routine called by FM to initialize generation of single frequency tone cadence (i.e. CNG/CED) by an external tone generator utility. The parameter 'params' is a pointer to a data structure defining the frequency, amplitude, and on/off cadence of the tone.
void(* | ToneOffCmd )(void *TargetInst)
Routine called by FM to terminate generation of a tone cadence by an external tone generator utility.
void * | TargetInst

Field Documentation

void(* fmToneGenSpec_t::ToneOnCmd)(void *TargetInst, tgnParams_t *toneParams)

Routine called by FM to initialize generation of single frequency tone cadence (i.e. CNG/CED) by an external tone generator utility. The parameter 'params' is a pointer to a data structure defining the frequency, amplitude, and on/off cadence of the tone.

void(* fmToneGenSpec_t::ToneOffCmd)(void *TargetInst)

Routine called by FM to terminate generation of a tone cadence by an external tone generator utility.

void* fmToneGenSpec_t::TargetInst

Pointer to Target Instance

Definition at line 236 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: v17Table_sPtrs_t Struct Reference

  • Data Structures
  • Data Fields

v17Table_sPtrs_t Struct Reference
[FM External API]

#include <fm.h>

Collaboration diagram for v17Table_sPtrs_t:

[legend]

Detailed Description

V.17 Cluster definitions.

Definition at line 307 of file fm.h.

Data Fields

Fract | dpu_smap_V17_120_pt [128]
Fract | dpu_smap_V17_144_pt [256]
dpu_shaping_bank_t | shape_v17_pt [1]
Fract | dpu_smap_V17_96_pt [64]
Fract | dpu_smap_V17_72_pt [32]
Fract | dpu_ddec_V17_AllRates_pt [16]
Fract | dpu_denc_V17_AllRates_pt [16]
Fract | dpu_slic_invmod_v17_pt [10][10]
Fract | dpu_PN_smap_table_v17_AllRates_pt [8]
Fract | dpu_bridge_smap_table_v17_AllRates_pt [8]
Fract | tanTableInFirstOctant_pt [10]
Fract | atan2ScaleFactors_pt [16]
Fract | bp_rx_v17_pt [43]
Fract | bp_hilb_v17_pt [43]

Field Documentation

Fract v17Table_sPtrs_t::dpu_smap_V17_120_pt[128]

Definition at line 309 of file fm.h.

Fract v17Table_sPtrs_t::dpu_smap_V17_144_pt[256]

Definition at line 310 of file fm.h.

dpu_shaping_bank_t v17Table_sPtrs_t::shape_v17_pt[1]

Definition at line 311 of file fm.h.

Fract v17Table_sPtrs_t::dpu_smap_V17_96_pt[64]

Definition at line 312 of file fm.h.

Fract v17Table_sPtrs_t::dpu_smap_V17_72_pt[32]

Definition at line 313 of file fm.h.

Fract v17Table_sPtrs_t::dpu_ddec_V17_AllRates_pt[16]

Definition at line 314 of file fm.h.

Fract v17Table_sPtrs_t::dpu_denc_V17_AllRates_pt[16]

Definition at line 315 of file fm.h.

Fract v17Table_sPtrs_t::dpu_slic_invmod_v17_pt[10][10]

Definition at line 316 of file fm.h.

Fract v17Table_sPtrs_t::dpu_PN_smap_table_v17_AllRates_pt[8]

Definition at line 317 of file fm.h.

Fract v17Table_sPtrs_t::dpu_bridge_smap_table_v17_AllRates_pt[8]

Definition at line 318 of file fm.h.

Fract v17Table_sPtrs_t::tanTableInFirstOctant_pt[10]

Definition at line 319 of file fm.h.

Fract v17Table_sPtrs_t::atan2ScaleFactors_pt[16]

Definition at line 320 of file fm.h.

Fract v17Table_sPtrs_t::bp_rx_v17_pt[43]

Definition at line 321 of file fm.h.

Fract v17Table_sPtrs_t::bp_hilb_v17_pt[43]

Definition at line 322 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: v27Table_sPtrs_t Struct Reference

  • Data Structures
  • Data Fields

v27Table_sPtrs_t Struct Reference
[FM External API]

#include <fm.h>

Collaboration diagram for v27Table_sPtrs_t:

[legend]

Detailed Description

V.27 Cluster definitions.

Definition at line 290 of file fm.h.

Data Fields

Fract | dpu_smap_V27_48_pt [16]
Fract | dpu_smap_V27_24_pt [8]
dpu_shaping_bank_t | shape_v27_24_pt [1]
dpu_shaping_bank_t | shape_v27_48_pt [1]
Fract | dpu_slic_pt_V27_48_pt [16]
Fract | dpu_slic_pt_V27_24_pt [8]
Fract | dpu_slic_bits_V27_48_pt [8]
Fract | dpu_v27_count_pt [8]
Fract | bp_rx_v27_48_pt [45]
Fract | bp_hilb_v27_48_pt [45]

Field Documentation

Fract v27Table_sPtrs_t::dpu_smap_V27_48_pt[16]

Definition at line 292 of file fm.h.

Fract v27Table_sPtrs_t::dpu_smap_V27_24_pt[8]

Definition at line 293 of file fm.h.

dpu_shaping_bank_t v27Table_sPtrs_t::shape_v27_24_pt[1]

Definition at line 294 of file fm.h.

dpu_shaping_bank_t v27Table_sPtrs_t::shape_v27_48_pt[1]

Definition at line 295 of file fm.h.

Fract v27Table_sPtrs_t::dpu_slic_pt_V27_48_pt[16]

Definition at line 296 of file fm.h.

Fract v27Table_sPtrs_t::dpu_slic_pt_V27_24_pt[8]

Definition at line 297 of file fm.h.

Fract v27Table_sPtrs_t::dpu_slic_bits_V27_48_pt[8]

Definition at line 298 of file fm.h.

Fract v27Table_sPtrs_t::dpu_v27_count_pt[8]

Definition at line 299 of file fm.h.

Fract v27Table_sPtrs_t::bp_rx_v27_48_pt[45]

Definition at line 300 of file fm.h.

Fract v27Table_sPtrs_t::bp_hilb_v27_48_pt[45]

Definition at line 301 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM: v29Table_sPtrs_t Struct Reference

  • Data Structures
  • Data Fields

v29Table_sPtrs_t Struct Reference
[FM External API, FM External API]

#include <fm.h>

Collaboration diagram for v29Table_sPtrs_t:

[legend]

Detailed Description

V.29 Cluster definitions.

Definition at line 268 of file fm.h.

Data Fields

Fract | dpu_smap_V29_96_pt [32]
Fract | dpu_smap_V29_72_pt [16]
dpu_shaping_bank_t | shape_v29_pt [1]
Fract | dpu_slic_pt_V29_72_pt [32]
Fract | dpu_slic_pt_V29_96_pt [64]
Fract | dpu_denc_V29_9600_pt [8]
Fract | dpu_denc_V29_4800_pt [4]
Fract | dpu_ddec_V29_9600_pt [8]
Fract | dpu_ddec_V29_4800_pt [4]
Fract | dpu_slic_bits_V29_72_pt [16]
Fract | dpu_slic_bits_V29_96_pt [32]
Fract | dpu_slic_invmod_V29_96_pt [4]
Fract | bp_rx_v29_pt [43]
Fract | bp_hilb_v29_pt [43]

Field Documentation

Fract v29Table_sPtrs_t::dpu_smap_V29_96_pt[32]

Definition at line 270 of file fm.h.

Fract v29Table_sPtrs_t::dpu_smap_V29_72_pt[16]

Definition at line 271 of file fm.h.

dpu_shaping_bank_t v29Table_sPtrs_t::shape_v29_pt[1]

Definition at line 272 of file fm.h.

Fract v29Table_sPtrs_t::dpu_slic_pt_V29_72_pt[32]

Definition at line 273 of file fm.h.

Fract v29Table_sPtrs_t::dpu_slic_pt_V29_96_pt[64]

Definition at line 274 of file fm.h.

Fract v29Table_sPtrs_t::dpu_denc_V29_9600_pt[8]

Definition at line 275 of file fm.h.

Fract v29Table_sPtrs_t::dpu_denc_V29_4800_pt[4]

Definition at line 276 of file fm.h.

Fract v29Table_sPtrs_t::dpu_ddec_V29_9600_pt[8]

Definition at line 277 of file fm.h.

Fract v29Table_sPtrs_t::dpu_ddec_V29_4800_pt[4]

Definition at line 278 of file fm.h.

Fract v29Table_sPtrs_t::dpu_slic_bits_V29_72_pt[16]

Definition at line 279 of file fm.h.

Fract v29Table_sPtrs_t::dpu_slic_bits_V29_96_pt[32]

Definition at line 280 of file fm.h.

Fract v29Table_sPtrs_t::dpu_slic_invmod_V29_96_pt[4]

Definition at line 281 of file fm.h.

Fract v29Table_sPtrs_t::bp_rx_v29_pt[43]

Definition at line 282 of file fm.h.

Fract v29Table_sPtrs_t::bp_hilb_v29_pt[43]

Definition at line 283 of file fm.h.

The documentation for this struct was generated from the following file:
  • fm.h


FM Test: Data Structures

  • Data Structures
  • Data Fields

FM Test Data Structures

Here are the data structures with brief descriptions:
siuInst_t


FM Test: Unit Test Configuration and Execution

Unit Test Configuration and Execution

  1. Allow the target to run to completion. The simulation will cycle through the all tests.
  2. The output file showing Bit Error Rate will be created in "../vectors/output" directory.
  3. Compare the generated output file with the reference output file in the "../vectors/refout".
  4. The BER should be same for corresponding test vectors..


FM Test: doxygen.h File Reference

  • File List
  • Globals

doxygen.h File Reference

Go to the source code of this file.


FM Test: doxygen.h Source File

  • File List
  • Globals

doxygen.h

Go to the documentation of this file.
00001 /*
00002  * This is a little header file which doxygen parses to generate the main
00003  * documentation page
00004  */
00005


FM Test: File Index

  • File List
  • Globals

FM Test File List

Here is a list of all files with brief descriptions:
doxygen.h [code]
fmDebugTraceParser.c [code]
fmsim.c [code]
fmsim.h [code]


FM Test: fmDebugTraceParser.c File Reference

  • File List
  • Globals

fmDebugTraceParser.c File Reference

#include <string.h>
#include <stdio.h>
#include <ti/mas/types/types.h>
#include <ti/mas/fm/src/fmtrace.h>
#include <ti/mas/fm/src/fmloc.h>

Include dependency graph for fmDebugTraceParser.c:

Go to the source code of this file.

Enumerations

enum FxmMode_e {
FXM_MODE_OFF, FXM_MODE_RX, FXM_MODE_RX_HDLC, FXM_MODE_TX,
FXM_MODE_TX_HDLC, FXM_MODE_COUNT
}

Functions

void | fmDebugGetFMState (int msgData, char *string)
void | fmDebugGetModulation (int msgData, char *string)
void | fmDebugGetFMMode (int msgData, char *string)
int | fmDebugTraceParser (int msgId, int msgData, char *dstPtr)

Variables

char | msgString [40]

Enumeration Type Documentation

enum FxmMode_e

Enumerator:
FXM_MODE_OFF
FXM_MODE_RX
FXM_MODE_RX_HDLC
FXM_MODE_TX
FXM_MODE_TX_HDLC
FXM_MODE_COUNT

Definition at line 72 of file fmDebugTraceParser.c.

Function Documentation

void fmDebugGetFMState | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 81 of file fmDebugTraceParser.c.

Referenced by fmDebugTraceParser().

void fmDebugGetModulation | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 127 of file fmDebugTraceParser.c.

Referenced by fmDebugTraceParser().

void fmDebugGetFMMode | ( | int | msgData,
 |  | char * | string
 | ) |  |

Definition at line 193 of file fmDebugTraceParser.c.

References FXM_MODE_OFF, FXM_MODE_RX, FXM_MODE_RX_HDLC, FXM_MODE_TX, and FXM_MODE_TX_HDLC.

Referenced by fmDebugTraceParser().

int fmDebugTraceParser | ( | int | msgId,
 |  | int | msgData,
 |  | char * | dstPtr
 | ) |  |

Definition at line 219 of file fmDebugTraceParser.c.

References fmDebugGetFMMode(), fmDebugGetFMState(), fmDebugGetModulation(), and msgString.

Referenced by siuFmDebugInfo().

Here is the call graph for this function:

Variable Documentation

char msgString[40]

Definition at line 70 of file fmDebugTraceParser.c.

Referenced by fmDebugTraceParser().


FM Test: fmDebugTraceParser.c Source File

  • File List
  • Globals

fmDebugTraceParser.c

Go to the documentation of this file.
00001 /*
00002  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00003  *
00004  *              All rights reserved not granted herein.
00005  *
00006  *                         Limited License.
00007  *
00008  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00009  *  non-exclusive license under copyrights and patents it now or hereafter owns
00010  *  or controls to make, have made, use, import, offer to sell and sell
00011  *  ("Utilize") this software subject to the terms herein.  With respect to the
00012  *  foregoing patent license, such license is granted solely to the extent that
00013  *  any such patent is necessary to Utilize the software alone.  The patent
00014  *  license shall not apply to any combinations which include this software,
00015  *  other than combinations with devices manufactured by or for TI (“TI
00016  *  Devices”).  No hardware patent is licensed hereunder.
00017  *
00018  *  Redistributions must preserve existing copyright notices and reproduce this
00019  *  license (including the above copyright notice and the disclaimer and (if
00020  *  applicable) source code license limitations below) in the documentation
00021  *  and/or other materials provided with the distribution
00022  *
00023  *  Redistribution and use in binary form, without modification, are permitted
00024  *  provided that the following conditions are met:
00025  *
00026  *    *  No reverse engineering, decompilation, or disassembly of this software
00027  *  is permitted with respect to any software provided in binary form.
00028  *
00029  *    *  any redistribution and use are licensed by TI for use only with TI
00030  *  Devices.
00031  *
00032  *    *  Nothing shall obligate TI to provide you with source code for the
00033  *  software licensed and provided to you in object code.
00034  *
00035  *  If software source code is provided to you, modification and redistribution
00036  *  of the source code are permitted provided that the following conditions are
00037  *  met:
00038  *
00039  *    *  any redistribution and use of the source code, including any resulting
00040  *  derivative works, are licensed by TI for use only with TI Devices.
00041  *
00042  *    *  any redistribution and use of any object code compiled from the source
00043  *  code and any resulting derivative works, are licensed by TI for use only
00044  *  with TI Devices.
00045  *
00046  *  Neither the name of Texas Instruments Incorporated nor the names of its
00047  *  suppliers may be used to endorse or promote products derived from this
00048  *  software without specific prior written permission.
00049  *
00050  *  DISCLAIMER.
00051  *
00052  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00053  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00054  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00055  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00056  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00057  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00058  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00059  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00060  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00061  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00062  *  DAMAGE.
00063 */
00064 #include <string.h>
00065 #include <stdio.h>
00066 #include <ti/mas/types/types.h>
00067 #include <ti/mas/fm/src/fmtrace.h>
00068 #include <ti/mas/fm/src/fmloc.h>
00069
00070 char msgString[40];
00071
00072 typedef enum {
00073   FXM_MODE_OFF,           /* turn modem off */
00074   FXM_MODE_RX,            /* set modem to receive mode */
00075   FXM_MODE_RX_HDLC,       /* set modem to receive mode and do HDLC processing */
00076   FXM_MODE_TX,            /* set modem to transmit mode */
00077   FXM_MODE_TX_HDLC,       /* set modem to transmit mode and do HDLC processing */
00078   FXM_MODE_COUNT          /* number of FXM modes */
00079 } FxmMode_e;
00080
00081 void fmDebugGetFMState (int msgData, char *string)
00082 {
00083    switch (msgData)
00084    {
00085       case FM_OFFLINE_STATE:
00086          sprintf (string, "offline");
00087          break;
00088
00089       case FM_HS_RX_STATE:
00090          sprintf (string, "high speed rx");
00091          break;
00092
00093       case FM_LS_RX_STATE:
00094          sprintf (string, "low speed rx");
00095          break;
00096
00097       case FM_LS_TX_STATE_FLAG:
00098          sprintf (string, "low speed tx flag");
00099          break;
00100
00101       case FM_LS_TX_STATE_DATA:
00102          sprintf (string, "low speed tx data");
00103          break;
00104
00105       case FM_LS_TX_STATE_FCS:
00106          sprintf (string, "low speed tx fcs");
00107          break;
00108
00109       case FM_HS_TX_STATE_TRAINING:
00110          sprintf (string, "high speed tx training");
00111          break;
00112
00113       case FM_HS_TX_STATE_DATA:
00114          sprintf (string, "high speed tx data");
00115          break;
00116
00117       case FM_HS_TX_STATE_PRE_OFF:
00118          sprintf (string, "high speed tx preamble off");
00119          break;
00120
00121       case FM_HS_TX_STATE_ECM:
00122          sprintf (string, "high speed tx ecm");
00123          break;
00124    }
00125 } /* fmDebugGetFMState() */
00126
00127 void fmDebugGetModulation (int msgData, char *string)
00128 {
00129    switch (msgData)
00130    {
00131       case iffax_MODEM_MODE_V21:
00132          sprintf (string, "V.21 300bps");
00133          break;
00134
00135       case iffax_MODEM_MODE_V27_2400:
00136          sprintf (string, "V.27 2400bps");
00137          break;
00138
00139       case iffax_MODEM_MODE_V27_4800:
00140          sprintf (string, "V.27 4800bps");
00141          break;
00142
00143       case iffax_MODEM_MODE_V29_7200:
00144          sprintf (string, "V.29 7200bps");
00145          break;
00146
00147       case iffax_MODEM_MODE_V29_9600:
00148          sprintf (string, "V.29 9600bps");
00149          break;
00150
00151       case iffax_MODEM_MODE_V17_S_7200:
00152          sprintf (string, "V.17 7200bps - short training");
00153          break;
00154
00155       case iffax_MODEM_MODE_V17_S_9600:
00156          sprintf (string, "V.17 9600bps - short training");
00157          break;
00158
00159       case iffax_MODEM_MODE_V17_S_12000:
00160          sprintf (string, "V.17 12000bps - short training");
00161          break;
00162
00163       case iffax_MODEM_MODE_V17_S_14400:
00164          sprintf (string, "V.17 14400bps - short training");
00165          break;
00166
00167       case iffax_MODEM_MODE_V17_L_7200:
00168          sprintf (string, "V.17 7200bps - long training");
00169          break;
00170
00171       case iffax_MODEM_MODE_V17_L_9600:
00172          sprintf (string, "V.17 9600bps - long training");
00173          break;
00174
00175       case iffax_MODEM_MODE_V17_L_12000:
00176          sprintf (string, "V.17 12000bps - long training");
00177          break;
00178
00179       case iffax_MODEM_MODE_V17_L_14400:
00180          sprintf (string, "V.17 14400bps - long training");
00181          break;
00182
00183       case iffax_MODEM_MODE_V33_12000:
00184          sprintf (string, "V.33 12000bps");
00185          break;
00186
00187       case iffax_MODEM_MODE_V33_14400:
00188          sprintf (string, "V.33 14400bps");
00189          break;
00190    }
00191 } /* fmDebugGetModulation() */
00192
00193 void fmDebugGetFMMode (int msgData, char *string)
00194 {
00195    switch (msgData)
00196    {
00197       case FXM_MODE_OFF:
00198          sprintf (string, "off");
00199          break;
00200
00201       case FXM_MODE_RX:
00202          sprintf (string, "receive mode");
00203          break;
00204
00205       case FXM_MODE_RX_HDLC:
00206          sprintf (string, "receive mode and do HDLC processing");
00207          break;
00208
00209       case FXM_MODE_TX:
00210          sprintf (string, "transmit mode");
00211          break;
00212
00213       case FXM_MODE_TX_HDLC:
00214          sprintf (string, "transmit mode and do HDLC processing");
00215          break;
00216    }
00217 } /* fmDebugGetFMMode() */
00218
00219 int fmDebugTraceParser (int msgId, int msgData, char *dstPtr)
00220 {
00221    int returnVal = TRUE;
00222
00223    switch (msgId)
00224    {
00225 #ifndef FAX_DBG_LEVEL_1_ONLY_PARSER
00226       case FM_TRC_FIFO_FULL:
00227          sprintf (dstPtr, "The message FIFO of the FM instance is full and FM is not accepting any messages fmom fax protocol: msgId = %d",
00228                   msgData);
00229          break;
00230
00231       case FM_TRC_NEW_STATE:
00232          fmDebugGetFMState (msgData, msgString);
00233          sprintf (dstPtr, "State transition: %s", msgString);
00234          break;
00235
00236       case FM_TRC_MODE_MSG_ID:
00237          fmDebugGetFMMode (msgData, msgString);
00238          sprintf (dstPtr, "Mode change: %s", msgString);
00239          break;
00240
00241       case FM_TRC_NEW_MODULATION:
00242          fmDebugGetModulation (msgData, msgString);
00243          sprintf (dstPtr, "New modulation: %s", msgString);
00244          break;
00245
00246       case FM_TRC_CARRIER_LOSS:
00247          fmDebugGetFMState (msgData, msgString);
00248          sprintf (dstPtr, "Carrier loss detected in state: %s", msgString);
00249          break;
00250
00251       case FM_TRC_TEP_DETECT:
00252          fmDebugGetFMState (msgData, msgString);
00253          sprintf (dstPtr, "TEP detected in state: %s", msgString);
00254          break;
00255
00256       case FM_TRC_P2_DETECT:
00257          fmDebugGetFMState (msgData, msgString);
00258          sprintf (dstPtr, "P2 detected in state: %s", msgString);
00259          break;
00260
00261       case FM_TRC_PREAMBLE_DETECT:
00262          fmDebugGetFMState (msgData, msgString);
00263          sprintf (dstPtr, "Preamble detected in state: %s", msgString);
00264          break;
00265
00266       case FM_TRC_CARRIER_DETECT:
00267          fmDebugGetFMState (msgData, msgString);
00268          sprintf (dstPtr, "Carrier detected in state: %s", msgString);
00269          break;
00270
00271       case FM_TRC_DELAY_BEGIN:
00272          sprintf (dstPtr, "Beginning of the delay message processing: msgData = %x", msgData);
00273          break;
00274
00275       case FM_TRC_DELAY_END:
00276          sprintf (dstPtr, "End of the delay message processing");
00277          break;
00278
00279       case FM_TRC_FILL_PATTERN:
00280          sprintf (dstPtr, "Processed fill pattern message: fill byte = %x", msgData);
00281          break;
00282
00283       case FM_TRC_SYNC_ACK:
00284          sprintf (dstPtr, "Processed sync message");
00285          break;
00286
00287       case FM_TRC_INVALID_MSG:
00288          sprintf (dstPtr, "Invalid message received: msgId = %d", msgData);
00289          break;
00290
00291       case FM_TRC_CURRENT_STATE:
00292          fmDebugGetFMState (msgData, msgString);
00293          sprintf (dstPtr, "Current state of FM processing module: %s", msgString);
00294          break;
00295
00296       case FM_TRC_TX_UNDERRUN:
00297          sprintf (dstPtr, "Underrun during data transmission: number of bytes transmitted to modem = %d",
00298                   msgData);
00299          break;
00300
00301       case FM_TRC_DATA_BEGIN:
00302          sprintf (dstPtr, "Beginning of data RX or TX during transmission");
00303          break;
00304
00305       case FM_TRC_DATA_END:
00306          sprintf (dstPtr, "End of data RX or TX during transmission");
00307          break;
00308 #endif /* FAX_DBG_LEVEL_1_ONLY_PARSER */
00309
00310       case FM_TRC_GOOD_FRAME:
00311          sprintf (dstPtr, "TX or RX of a good HDLC frame: number of bytes in the frame = %d",
00312                   msgData);
00313          break;
00314
00315       case FM_TRC_BAD_FRAME:
00316          sprintf (dstPtr, "TX or RX of a bad HDLC frame: number of bytes in the frame = %d",
00317                   msgData);
00318          break;
00319
00320       default:
00321          returnVal = FALSE;
00322          break;
00323    }
00324
00325    return (returnVal);
00326
00327 } /* fmDebugTraceParser() */
00328
00329 /* nothing past this point */


FM Test: fmsim.c File Reference

  • File List
  • Globals

fmsim.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <ti/mas/fm/src/fmloc.h>
#include <ti/mas/hdlc/hdlcTx.h>
#include <ti/mas/hdlc/hdlcRx.h>
#include <ti/mas/util/pkt.h>
#include <ti/mas/iface/ifsys/tgn.h>
#include "fmsim.h"

Include dependency graph for fmsim.c:

Go to the source code of this file.

Defines

#define | TESTDPUVECS TRUE
#define | CUSTPROB_DBG FALSE
#define | LINEAR_PCM FALSE
#define | ADD_NOISE FALSE
#define | CAPTURE_PCM_TX FALSE
#define | TEST_CDL FALSE
#define | V17_STRAIN_TST FALSE

Functions

void | ClearAllGlobalVariables (void)
void | dpuBerMeas (tword *data, int len)
int | PopulateTestDataBase (char *EcoTestDpuRoot, int LineCode)
void | wngInit (tint noise_level, tuint seed, tint *mean, tuint *rng_state)
void | UAExpand (tint len, tword *mulawPcm, Fract *out_pcm, const tint *table)
void | CaptureDataShort1 (int length, short *data, char *filename)
void | CaptureDataShort (int length, short *data, char *filename)
void | CaptureDataLFract (int length, int *data, char *filename)
tulong | siuGetTime (void)
void | siuPcmInterface_Ch1 (void *targetInst, void *PcmData)
void | siuPcmInterface_Ch2 (void *targetInst, void *PcmData)
void | siuFpInterface_Ch1 (void *targetInst, void *FmFpMessage)
void | siuFpInterface_Ch2 (void *targetInst, void *FmFpMessage)
void | siuToneOnFax (void *TargetInst, tgnParams_t *toneParams)
void | siuToneOffFax (void *TargetInst)
void | siuToneDetectCtrl (void *siuInst, tuint ControlCode)
char * | GetDirectionString (int direction)
void | StatusPrintMonitor (char *dstPtr, int direction)
int | fmDebugTraceParser (int msgId, int msgData, char *dstPtr)
void | siuFmDebugInfo (void *moduleID, tuint msgType, tuint messageCode, tuint msgLength, tuint *supportingData)
void | siuFatalError (tuint id, char *str)
void | siu_init (tint chnum)
void | siu_init_lin_samples (tint chnum)
void | siu_init_fm_fp_messages (tint chnum)
void | siu_init_fp_fm_messages (iffaxModulationTypes_e HighSpeedModType)
void | siu_new_fm (tint chnum)
void | siu_open_fm (tint chnum)
void | siu_close_fm (tint chnum)
void | siu_delete_fm (tint chnum)
void | main (void)

Variables

int | rhrDataBufCnt = 1
siuInst_t | siuInst [SIU_NUMBER_OF_CHANNELS]
tulong | systemTime = 0
tbool | running = TRUE
char | siuDebugString = 0
char | siuFatalString = 0
tuint | siuTermCode = 0
fmStatsReport_t | siuFmStats [2]
fmTablePtrs_t | fmTablePtrs
const tuint | gg_pmst_init = 0x7fe0
const tuint | gg_swwsr_init = 0x2208
const tuint | gg_bscr_init = 0x0000
iffaxFmFpMsg_t | GlobalFmFpMsgOut [SIU_NUMBER_OF_CHANNELS][SIU_FM_FP_OUT_MSG_ARRAY_SIZE]
tuint | GlobalFmFpMsgOutIndex1 = 0
tuint | GlobalFmFpMsgOutIndex2 = 0
iffaxFpFmMsg_t | GlobalFpFmMsgIn [SIU_NUMBER_OF_CHANNELS][SIU_FP_FM_IN_MSG_ARRAY_SIZE]
tuint | GlobalFpFmMsgInIndex1 = 0
tuint | GlobalFpFmMsgInIndex2 = 0
tword | FpFmLsData [32]
tword | FpFmHsData [40]
tword | FpFmTestData [40]
Fract | GlobalLinSample [SIU_NUMBER_OF_CHANNELS][SIU_FM_LIN_SAMPLE_ARRAY_SIZE]
tulong | BerCount = 0
tulong | OnesCount = 0
tulong | limit_count = 0
tint | loop_flag = 1
iffaxModulationTypes_e | ModAssoc [125]
int | ByteBuf [30]
tword | bit_mask
char | TestFileNames [125][60]
volatile int | FirstTime1 = 1
volatile int | FirstTime = 1
int | FirstTime123 = 1
tuint | i = 0
tuint | TxCap = 0
tuint | RxCap = 0
int | gbindx = 0
fmContext_t | fmContext
tuint | CDLoss [10] = {0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead}
tuint | CDLossInd = 0
tulong | CDLossTime [10]
tuint | CDLossTimeInd = 0
tuint | ch1_msg_num = 0
tuint | ch2_msg_num = 0
tint | NOISELEVEL = -168
tint | MEAN = 0
tuint | SEED = 0
tuint | RNGSTATE = 0

Define Documentation

#define TESTDPUVECS TRUE

Definition at line 98 of file fmsim.c.

Referenced by main().

#define CUSTPROB_DBG FALSE

Definition at line 99 of file fmsim.c.

#define LINEAR_PCM FALSE

Definition at line 100 of file fmsim.c.

#define ADD_NOISE FALSE

Definition at line 101 of file fmsim.c.

#define CAPTURE_PCM_TX FALSE

Definition at line 102 of file fmsim.c.

#define TEST_CDL FALSE

Definition at line 103 of file fmsim.c.

#define V17_STRAIN_TST FALSE

Definition at line 104 of file fmsim.c.

Function Documentation

void ClearAllGlobalVariables ( void )

Referenced by main().

void dpuBerMeas | ( | tword * | data,
 |  | int | len
 | ) |  |

Definition at line 203 of file fmsim.c.

References i.

Referenced by siuFpInterface_Ch2().

int PopulateTestDataBase | ( | char * | EcoTestDpuRoot,
 |  | int | LineCode
 | ) |  |

Referenced by main().

void wngInit | ( | tint | noise_level,
 |  | tuint | seed,
 |  | tint * | mean,
 |  | tuint * | rng_state
 | ) |  |

Referenced by main().

void UAExpand | ( | tint | len,
 |  | tword * | mulawPcm,
 |  | Fract * | out_pcm,
 |  | const tint * | table
 | ) |  |

Definition at line 224 of file fmsim.c.

Referenced by main().

void CaptureDataShort1 | ( | int | length,
 |  | short * | data,
 |  | char * | filename
 | ) |  |

Definition at line 247 of file fmsim.c.

References i.

Referenced by main().

void CaptureDataShort | ( | int | length,
 |  | short * | data,
 |  | char * | filename
 | ) |  |

Definition at line 291 of file fmsim.c.

References i.

void CaptureDataLFract | ( | int | length,
 |  | int * | data,
 |  | char * | filename
 | ) |  |

Definition at line 334 of file fmsim.c.

References i.

tulong siuGetTime ( void )

Definition at line 392 of file fmsim.c.

References systemTime.

void siuPcmInterface_Ch1 | ( | void * | targetInst,
 |  | void * | PcmData
 | ) |  |

Definition at line 417 of file fmsim.c.

References i, and SIU_FM_LIN_SAMPLE_ARRAY_SIZE.

Referenced by siu_open_fm().

void siuPcmInterface_Ch2 | ( | void * | targetInst,
 |  | void * | PcmData
 | ) |  |

Definition at line 449 of file fmsim.c.

References i, and SIU_FM_LIN_SAMPLE_ARRAY_SIZE.

Referenced by siu_open_fm().

void siuFpInterface_Ch1 | ( | void * | targetInst,
 |  | void * | FmFpMessage
 | ) |  |

Definition at line 475 of file fmsim.c.

References SIU_FM_FP_OUT_MSG_ARRAY_SIZE.

Referenced by siu_open_fm().

void siuFpInterface_Ch2 | ( | void * | targetInst,
 |  | void * | FmFpMessage
 | ) |  |

Definition at line 498 of file fmsim.c.

References dpuBerMeas(), and SIU_FM_FP_OUT_MSG_ARRAY_SIZE.

Referenced by siu_open_fm().

Here is the call graph for this function:

void siuToneOnFax | ( | void * | TargetInst,
 |  | tgnParams_t * | toneParams
 | ) |  |

Definition at line 533 of file fmsim.c.

void siuToneOffFax ( void * TargetInst )

Definition at line 551 of file fmsim.c.

void siuToneDetectCtrl | ( | void * | siuInst,
 |  | tuint | ControlCode
 | ) |  |

Definition at line 569 of file fmsim.c.

Referenced by siu_open_fm().

char* GetDirectionString ( int direction )

Definition at line 577 of file fmsim.c.

Referenced by StatusPrintMonitor().

void StatusPrintMonitor | ( | char * | dstPtr,
 |  | int | direction
 | ) |  |

Definition at line 588 of file fmsim.c.

References GetDirectionString().

Referenced by siuFmDebugInfo().

Here is the call graph for this function:

int fmDebugTraceParser | ( | int | msgId,
 |  | int | msgData,
 |  | char * | dstPtr
 | ) |  |

Definition at line 219 of file fmDebugTraceParser.c.

References fmDebugGetFMMode(), fmDebugGetFMState(), fmDebugGetModulation(), and msgString.

Referenced by siuFmDebugInfo().

Here is the call graph for this function:

void siuFmDebugInfo | ( | void * | moduleID,
 |  | tuint | msgType,
 |  | tuint | messageCode,
 |  | tuint | msgLength,
 |  | tuint * | supportingData
 | ) |  |

Definition at line 616 of file fmsim.c.

References fmDebugTraceParser(), SIU_EXCEPTION_FM_DBG_DEFAULT, SIU_EXCEPTION_FM_DBG_FATAL_ERROR, siuFatalError(), and StatusPrintMonitor().

Referenced by main().

Here is the call graph for this function:

void siuFatalError | ( | tuint | id,
 |  | char * | str
 | ) |  |

Definition at line 681 of file fmsim.c.

References siuFatalString.

Referenced by siu_new_fm(), siu_open_fm(), and siuFmDebugInfo().

void siu_init ( tint chnum )

Definition at line 703 of file fmsim.c.

References siuInst_t::aux_heap_size, siuInst_t::fm_heap_size, siuInst_t::fmBufs, siuInst_t::fmInst, siuInst_t::fmNbufs, siuInst_t::ID, SIU_SIU_ID, and siuInst.

Referenced by main().

void siu_init_lin_samples ( tint chnum )

Definition at line 728 of file fmsim.c.

References i, and SIU_FM_LIN_SAMPLE_ARRAY_SIZE.

Referenced by main().

void siu_init_fm_fp_messages ( tint chnum )

Definition at line 751 of file fmsim.c.

References i, and SIU_FM_FP_OUT_MSG_ARRAY_SIZE.

Referenced by main().

void siu_init_fp_fm_messages ( iffaxModulationTypes_e HighSpeedModType )

Definition at line 792 of file fmsim.c.

Referenced by main().

void siu_new_fm ( tint chnum )

Definition at line 852 of file fmsim.c.

References siuInst_t::aux_heap_size, siuInst_t::fm_heap_size, siuInst_t::fmBufs, siuInst_t::fmInst, siuInst_t::fmNbufs, i, SIU_EXCEPTION_FM_NEW_ERR, SIU_EXCEPTION_FM_SIZES_ERR, SIU_FM_ID, siuFatalError(), and siuInst.

Referenced by main().

Here is the call graph for this function:

void siu_open_fm ( tint chnum )

Definition at line 916 of file fmsim.c.

References siuInst_t::fmInst, fmTablePtrs, SIU_EXCEPTION_FM_OPEN_ERR, SIU_FM_ID, siuFatalError(), siuFpInterface_Ch1(), siuFpInterface_Ch2(), siuInst, siuPcmInterface_Ch1(), siuPcmInterface_Ch2(), and siuToneDetectCtrl().

Referenced by main().

Here is the call graph for this function:

void siu_close_fm ( tint chnum )

Definition at line 976 of file fmsim.c.

References siuInst_t::fmInst, and siuInst.

Referenced by main().

void siu_delete_fm ( tint chnum )

Definition at line 995 of file fmsim.c.

References siuInst_t::aux_heap_size, siuInst_t::fm_heap_size, siuInst_t::fmBufs, siuInst_t::fmInst, siuInst_t::fmNbufs, and siuInst.

Referenced by main().

void main ( void )

Definition at line 1048 of file fmsim.c.

References CaptureDataShort1(), ClearAllGlobalVariables(), MEAN, modC1, NOC1FILES, ONES_LIMIT, PopulateTestDataBase(), RNGSTATE, running, RxCap, siu_close_fm(), siu_delete_fm(), siu_init(), siu_init_fm_fp_messages(), siu_init_fp_fm_messages(), siu_init_lin_samples(), siu_new_fm(), SIU_NUMBER_OF_CHANNELS, siu_open_fm(), siuFmDebugInfo(), siuFmStats, siuInst, systemTime, tblAlaw, tblUlaw, TESTDPUVECS, TestFileNamesC1, TxCap, UAExpand(), and wngInit().

Here is the call graph for this function:

Variable Documentation

int rhrDataBufCnt = 1

Definition at line 123 of file fmsim.c.

siuInst_t siuInst[SIU_NUMBER_OF_CHANNELS]

Definition at line 125 of file fmsim.c.

Referenced by main(), siu_close_fm(), siu_delete_fm(), siu_init(), siu_new_fm(), and siu_open_fm().

tulong systemTime = 0

Definition at line 128 of file fmsim.c.

Referenced by main(), and siuGetTime().

tbool running = TRUE

Definition at line 131 of file fmsim.c.

Referenced by main().

char siuDebugString = 0

Definition at line 134 of file fmsim.c.

char siuFatalString = 0

Definition at line 137 of file fmsim.c.

Referenced by siuFatalError().

tuint siuTermCode = 0

Definition at line 140 of file fmsim.c.

fmStatsReport_t siuFmStats[2]

Definition at line 143 of file fmsim.c.

Referenced by main().

fmTablePtrs_t fmTablePtrs

Initial value:

{
   (v29Table_sPtrs_t *)fm_TABLE1_START,
   (v27Table_sPtrs_t *)fm_TABLE2_START,
   (v17Table_sPtrs_t *)fm_TABLE3_START,
   (commonTable1_sPtrs_t *)fm_TABLE4_START,
   (Fract *)fm_TABLE5_START
}

Definition at line 145 of file fmsim.c.

Referenced by siu_open_fm().

const tuint gg_pmst_init = 0x7fe0

Definition at line 155 of file fmsim.c.

const tuint gg_swwsr_init = 0x2208

Definition at line 156 of file fmsim.c.

const tuint gg_bscr_init = 0x0000

Definition at line 157 of file fmsim.c.

iffaxFmFpMsg_t GlobalFmFpMsgOut[SIU_NUMBER_OF_CHANNELS][SIU_FM_FP_OUT_MSG_ARRAY_SIZE]

Definition at line 160 of file fmsim.c.

tuint GlobalFmFpMsgOutIndex1 = 0

Definition at line 161 of file fmsim.c.

tuint GlobalFmFpMsgOutIndex2 = 0

Definition at line 162 of file fmsim.c.

iffaxFpFmMsg_t GlobalFpFmMsgIn[SIU_NUMBER_OF_CHANNELS][SIU_FP_FM_IN_MSG_ARRAY_SIZE]

Definition at line 165 of file fmsim.c.

tuint GlobalFpFmMsgInIndex1 = 0

Definition at line 166 of file fmsim.c.

tuint GlobalFpFmMsgInIndex2 = 0

Definition at line 167 of file fmsim.c.

tword FpFmLsData[32]

Initial value:

 {0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5,
                            0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5,
                            0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5,
                            0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5}

Definition at line 169 of file fmsim.c.

tword FpFmHsData[40]

Initial value:

 {0X01,0X02,0X03,0X04,0X05,0X06,0X07,0X08,
              0X09,0X10,0X11,0x12,0X13,0X14,0X15,0X16,
              0X17,0X18,0X19,0X20,0X21,0X22,0X23,0X24,
              0X25,0X26,0X27,0X28,0X29,0X30,0X31,0X32,
              0X32,0X33,0X34,0X35,0X36,0X37,0X38,0X39}

Definition at line 173 of file fmsim.c.

tword FpFmTestData[40]

Initial value:

 {0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
              0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
              0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
              0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
              0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF}

Definition at line 179 of file fmsim.c.

Fract GlobalLinSample[SIU_NUMBER_OF_CHANNELS][SIU_FM_LIN_SAMPLE_ARRAY_SIZE]

Definition at line 185 of file fmsim.c.

tulong BerCount = 0

Definition at line 193 of file fmsim.c.

tulong OnesCount = 0

Definition at line 194 of file fmsim.c.

tulong limit_count = 0

Definition at line 195 of file fmsim.c.

tint loop_flag = 1

Definition at line 196 of file fmsim.c.

iffaxModulationTypes_e ModAssoc[125]

Definition at line 197 of file fmsim.c.

int ByteBuf[30]

Definition at line 198 of file fmsim.c.

tword bit_mask

Definition at line 199 of file fmsim.c.

char TestFileNames[125][60]

Definition at line 201 of file fmsim.c.

volatile int FirstTime1 = 1

Definition at line 245 of file fmsim.c.

volatile int FirstTime = 1

Definition at line 289 of file fmsim.c.

int FirstTime123 = 1

Definition at line 333 of file fmsim.c.

tuint i = 0

Definition at line 1029 of file fmsim.c.

Referenced by CaptureDataLFract(), CaptureDataShort(), CaptureDataShort1(), dpuBerMeas(), siu_init_fm_fp_messages(), siu_init_lin_samples(), siu_new_fm(), siuPcmInterface_Ch1(), and siuPcmInterface_Ch2().

tuint TxCap = 0

Definition at line 1029 of file fmsim.c.

Referenced by main().

tuint RxCap = 0

Definition at line 1029 of file fmsim.c.

Referenced by main().

int gbindx = 0

Definition at line 1030 of file fmsim.c.

fmContext_t fmContext

Initial value:

{
   siuFmDebugInfo,
   siuGetTime,
   NULL
}

Definition at line 1031 of file fmsim.c.

tuint CDLoss[10] = {0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead}

Definition at line 1038 of file fmsim.c.

tuint CDLossInd = 0

Definition at line 1039 of file fmsim.c.

tulong CDLossTime[10]

Definition at line 1041 of file fmsim.c.

tuint CDLossTimeInd = 0

Definition at line 1042 of file fmsim.c.

tuint ch1_msg_num = 0

Definition at line 1043 of file fmsim.c.

tuint ch2_msg_num = 0

Definition at line 1044 of file fmsim.c.

tint NOISELEVEL = -168

Definition at line 1045 of file fmsim.c.

tint MEAN = 0

Definition at line 1045 of file fmsim.c.

Referenced by main().

tuint SEED = 0

Definition at line 1046 of file fmsim.c.

tuint RNGSTATE = 0

Definition at line 1046 of file fmsim.c.

Referenced by main().


FM Test: fmsim.c Source File

  • File List
  • Globals

fmsim.c

Go to the documentation of this file.
00001 /******************************************************************************
00002  * FILE PURPOSE: Main routine for exercising FM API function calls.
00003  *
00004  ******************************************************************************
00005  * FILE NAME:    fmsim.c
00006  *
00007  * DESCRIPTION:  This file contains functions, variables and processing code
00008  *               designed to provide a simulation for Telogy's Fax Modem module.
00009  *               By implementing this simulation, system integrators can the
00010  *               FM module, and the manner in which the FM API is accessed.
00011  *
00012  *               Consult the Telogy FM Application Programmer's Interface
00013  *               (API) document for detailed instructions on how to use this
00014  *               code.
00015  *
00016  * FUNCTION                 DESCRIPTION
00017  * ========                 ===========
00018  * main                     Main processing routine for FM simulation
00019  * siu_init                 Initialize SIU
00020  * siu_init_fm_fp_messages  Initialize FM_FP message buffer
00021  * siu_init_fp_fm_messages  Initialize FP_FM message buffer
00022  * siu_new_fm               Create an instance of FM
00023  * siu_open_fm              Open an instance of FM
00024  * siu_close_fm             Close an instance of FM
00025  * siu_delete_fm            Delete an instance of FM
00026  *
00027  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00028  *
00029  *              All rights reserved not granted herein.
00030  *
00031  *                         Limited License.
00032  *
00033  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00034  *  non-exclusive license under copyrights and patents it now or hereafter owns
00035  *  or controls to make, have made, use, import, offer to sell and sell
00036  *  ("Utilize") this software subject to the terms herein.  With respect to the
00037  *  foregoing patent license, such license is granted solely to the extent that
00038  *  any such patent is necessary to Utilize the software alone.  The patent
00039  *  license shall not apply to any combinations which include this software,
00040  *  other than combinations with devices manufactured by or for TI (“TI
00041  *  Devices”).  No hardware patent is licensed hereunder.
00042  *
00043  *  Redistributions must preserve existing copyright notices and reproduce this
00044  *  license (including the above copyright notice and the disclaimer and (if
00045  *  applicable) source code license limitations below) in the documentation
00046  *  and/or other materials provided with the distribution
00047  *
00048  *  Redistribution and use in binary form, without modification, are permitted
00049  *  provided that the following conditions are met:
00050  *
00051  *    *  No reverse engineering, decompilation, or disassembly of this software
00052  *  is permitted with respect to any software provided in binary form.
00053  *
00054  *    *  any redistribution and use are licensed by TI for use only with TI
00055  *  Devices.
00056  *
00057  *    *  Nothing shall obligate TI to provide you with source code for the
00058  *  software licensed and provided to you in object code.
00059  *
00060  *  If software source code is provided to you, modification and redistribution
00061  *  of the source code are permitted provided that the following conditions are
00062  *  met:
00063  *
00064  *    *  any redistribution and use of the source code, including any resulting
00065  *  derivative works, are licensed by TI for use only with TI Devices.
00066  *
00067  *    *  any redistribution and use of any object code compiled from the source
00068  *  code and any resulting derivative works, are licensed by TI for use only
00069  *  with TI Devices.
00070  *
00071  *  Neither the name of Texas Instruments Incorporated nor the names of its
00072  *  suppliers may be used to endorse or promote products derived from this
00073  *  software without specific prior written permission.
00074  *
00075  *  DISCLAIMER.
00076  *
00077  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00078  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00079  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00080  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00081  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00082  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00083  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00084  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00085  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00086  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00087  *  DAMAGE.
00088  *****************************************************************************/
00089 #include <stdio.h>
00090 #include <stdlib.h>
00091
00092 #include <ti/mas/fm/src/fmloc.h>
00093 #include <ti/mas/hdlc/hdlcTx.h>
00094 #include <ti/mas/hdlc/hdlcRx.h>
00095 #include <ti/mas/util/pkt.h>
00096 #include <ti/mas/iface/ifsys/tgn.h>
00097
00098 #define  TESTDPUVECS    TRUE
00099 #define  CUSTPROB_DBG   FALSE
00100 #define  LINEAR_PCM     FALSE
00101 #define  ADD_NOISE      FALSE
00102 #define  CAPTURE_PCM_TX FALSE
00103 #define  TEST_CDL       FALSE
00104 #define  V17_STRAIN_TST FALSE
00105
00106 #include "fmsim.h"
00107
00108 #if      TESTDPUVECS
00109 #include <string.h>
00110 #include <ti/mas/util/utl.h>
00111 #define FILEIO
00112 #endif
00113
00114 #if      CUSTPROB_DBG
00115 #include <string.h>
00116 #include <ti/mas/util/util.h>
00117 #define FILEIO
00118 #endif
00119
00120 /******************************************************************************
00121  * GLOBAL VARIABLE DEFINITIONS
00122  *****************************************************************************/
00123 int rhrDataBufCnt = 1;
00124 /* Global SIU channel instance */
00125 siuInst_t siuInst[SIU_NUMBER_OF_CHANNELS];
00126
00127 /* Gobal system timer variable */
00128 tulong systemTime = 0;
00129
00130 /* Gobal boolean used to break out of main() processing loop */
00131 tbool running = TRUE;
00132
00133 /* Global char signifying entity calling siuFmDebug() function */
00134 char siuDebugString = 0;
00135
00136 /* Global char signifying entity calling siuFatalError() function */
00137 char siuFatalString = 0;
00138
00139 /* Global tuint designating reason for calling fmCleardown function */
00140 tuint siuTermCode = 0;
00141
00142 /* Global network and fax call statistics structures */
00143 fmStatsReport_t siuFmStats[2];
00144
00145 fmTablePtrs_t fmTablePtrs =
00146 {
00147    (v29Table_sPtrs_t *)fm_TABLE1_START,
00148    (v27Table_sPtrs_t *)fm_TABLE2_START,
00149    (v17Table_sPtrs_t *)fm_TABLE3_START,
00150    (commonTable1_sPtrs_t *)fm_TABLE4_START,
00151    (Fract *)fm_TABLE5_START
00152 };
00153
00154 /* Following work for C549 XDS platform */
00155 const tuint gg_pmst_init  = 0x7fe0;
00156 const tuint gg_swwsr_init = 0x2208;
00157 const tuint gg_bscr_init =  0x0000;
00158
00159 /* Gobal FM_FP message array with index. Used to store FM_FM_MSG output */
00160 iffaxFmFpMsg_t GlobalFmFpMsgOut [SIU_NUMBER_OF_CHANNELS] [SIU_FM_FP_OUT_MSG_ARRAY_SIZE];
00161 tuint          GlobalFmFpMsgOutIndex1 = 0;
00162 tuint          GlobalFmFpMsgOutIndex2 = 0;
00163
00164 /* Gobal FP_FM message array with index. Used to send input messages to FM */
00165 iffaxFpFmMsg_t GlobalFpFmMsgIn [SIU_NUMBER_OF_CHANNELS] [SIU_FP_FM_IN_MSG_ARRAY_SIZE];
00166 tuint          GlobalFpFmMsgInIndex1 = 0;
00167 tuint          GlobalFpFmMsgInIndex2 = 0;
00168 //tword      FpFmLsData[4]  = {0x0004, 0x0002, 0x0001, 0x0000};
00169 tword      FpFmLsData[32] = {0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5,
00170                             0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5,
00171                             0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5,
00172                             0x00FF, 0x00C0, 0x004, 0x00b5,0x00FF, 0x00C0, 0x004, 0x00b5};
00173 tword      FpFmHsData[40] = {0X01,0X02,0X03,0X04,0X05,0X06,0X07,0X08,
00174               0X09,0X10,0X11,0x12,0X13,0X14,0X15,0X16,
00175               0X17,0X18,0X19,0X20,0X21,0X22,0X23,0X24,
00176               0X25,0X26,0X27,0X28,0X29,0X30,0X31,0X32,
00177               0X32,0X33,0X34,0X35,0X36,0X37,0X38,0X39};
00178
00179 tword      FpFmTestData[40] = {0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
00180               0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
00181               0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
00182               0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
00183               0xFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF};
00184 /* Global PCM data buffer to store output of FM's PCM interface */
00185 Fract GlobalLinSample [SIU_NUMBER_OF_CHANNELS] [SIU_FM_LIN_SAMPLE_ARRAY_SIZE];
00186
00187 /* Local Functions */
00188 void ClearAllGlobalVariables(void);
00189 void dpuBerMeas(tword *data, int len);
00190 int  PopulateTestDataBase(char *EcoTestDpuRoot,int LineCode);
00191 extern void wngInit (tint noise_level, tuint seed, tint *mean, tuint *rng_state);
00192
00193 tulong BerCount = 0;
00194 tulong OnesCount =0;
00195 tulong limit_count=0;
00196 tint   loop_flag = 1;
00197 iffaxModulationTypes_e ModAssoc[125];
00198 int ByteBuf[30];
00199 tword bit_mask;
00200 //extern LFract power_sat,sig_power,CDLPendingFlag;
00201 char TestFileNames[125][60];
00202
00203 void dpuBerMeas(tword *data, int len)
00204 {
00205  int i =0;
00206  tword *RxByteBuf;
00207  volatile tword tmp;
00208   RxByteBuf = data;
00209   for (i=0; i < len; i++) {
00210     ByteBuf[i] = pktRead8bits(RxByteBuf,i);
00211     for ( bit_mask = (tword)0x80; bit_mask != 0; bit_mask >>= 1 ) {
00212       tmp = bit_mask & ByteBuf[i];
00213        if (tmp == 0)
00214        {
00215           BerCount++;
00216        }
00217       OnesCount++;
00218       limit_count++;
00219     }
00220   }
00221
00222 } /* dpuBerMeas */
00223
00224 void UAExpand(tint len, tword *mulawPcm, Fract *out_pcm, const tint *table){
00225
00226   tint pcm_8th_bit,pcm_mask,PCM_MASK =0x7f;
00227   Fract ret_value;
00228   int j;
00229
00230   for (j=0; j<len;j++)
00231   {
00232     pcm_mask    = mulawPcm[j] & PCM_MASK;
00233     pcm_8th_bit = mulawPcm[j] & 0x080;
00234     ret_value   = (Fract)table[pcm_mask];
00235
00236     if (!pcm_8th_bit)
00237     {
00238       ret_value= ~ret_value;
00239       ret_value = ret_value +1;
00240     }
00241     out_pcm[j] = ret_value;
00242   }
00243 } /* UAExpand */
00244
00245 volatile int FirstTime1 =1;
00246
00247 void CaptureDataShort1(int length, short *data,char *filename)
00248 {
00249   int i,result;
00250   char OutFileName[30];
00251   FILE *OutHexFile;
00252
00253   strcpy(OutFileName,filename);
00254   if (FirstTime1) {
00255     /* Open for read (will fail if file "data" does not exist) */
00256     if( (OutHexFile = fopen(OutFileName,"w" )) == NULL ) {
00257       printf( "The OutBinFile not opened for write\n");
00258       getchar();
00259       exit(0);
00260     }
00261
00262     result = fseek(OutHexFile,0L,SEEK_SET);
00263   //  fprintf(OutHexFile,"1651 1 0 0 0\n");
00264     if( result ) {
00265       printf("Fseek failed" );
00266       getchar();
00267       exit(0);
00268     }
00269     for (i =0; i < length; i++) {
00270       fprintf(OutHexFile,"%d\n",data[i]);
00271     }
00272     FirstTime1 =0;
00273     i= fclose(OutHexFile);
00274   }
00275   else {
00276     /* Open for read (will fail if file "data" does not exist) */
00277     if( (OutHexFile = fopen(OutFileName,"a" )) == NULL ) {
00278       printf( "The OutBinFile not opened for append mode\n");
00279       getchar();
00280       exit(0);
00281     }
00282     for (i =0; i < length; i++) {
00283       fprintf(OutHexFile,"%d\n",data[i]);
00284     }
00285     i= fclose(OutHexFile);
00286   }
00287 } /* CaptureDataShort1 */
00288
00289 volatile int FirstTime =1;
00290
00291 void CaptureDataShort(int length, short *data,char *filename)
00292 {
00293   int i,result;
00294   char OutFileName[30];
00295   FILE *OutHexFile;
00296
00297   strcpy(OutFileName,filename);
00298   if (FirstTime) {
00299     /* Open for read (will fail if file "data" does not exist) */
00300     if( (OutHexFile = fopen(OutFileName,"w" )) == NULL ) {
00301       printf( "The OutBinFile not opened for write\n");
00302       getchar();
00303       exit(0);
00304     }
00305
00306     result = fseek(OutHexFile,0L,SEEK_SET);
00307   //  fprintf(OutHexFile,"1651 1 0 0 0\n");
00308     if( result ) {
00309       printf("Fseek failed" );
00310       getchar();
00311       exit(0);
00312     }
00313     for (i =0; i < length; i++) {
00314       fprintf(OutHexFile,"%d\n",data[i]);
00315     }
00316     FirstTime =0;
00317     i= fclose(OutHexFile);
00318   }
00319   else {
00320     /* Open for read (will fail if file "data" does not exist) */
00321     if( (OutHexFile = fopen(OutFileName,"a" )) == NULL ) {
00322       printf( "The OutBinFile not opened for append mode\n");
00323       getchar();
00324       exit(0);
00325     }
00326     for (i =0; i < length; i++) {
00327       fprintf(OutHexFile,"%d\n",data[i]);
00328     }
00329     i= fclose(OutHexFile);
00330   }
00331 } /* CaptureDataShort */
00332
00333 int FirstTime123 = 1;
00334 void CaptureDataLFract(int length, int *data,char *filename)
00335 {
00336   int i,result;
00337   char OutFileName[30];
00338   FILE *OutHexFile;
00339
00340   strcpy(OutFileName,filename);
00341   if (FirstTime123) {
00342     /* Open for read (will fail if file "data" does not exist) */
00343     if( (OutHexFile = fopen(OutFileName,"w" )) == NULL ) {
00344       printf( "The OutBinFile not opened for write\n");
00345       getchar();
00346       exit(0);
00347     }
00348
00349     result = fseek(OutHexFile,0L,SEEK_SET);
00350   //  fprintf(OutHexFile,"1651 3 1000 1 3\n");
00351     if( result ) {
00352       printf("Fseek failed" );
00353       getchar();
00354       exit(0);
00355     }
00356     for (i =0; i < length; i++) {
00357       fprintf(OutHexFile,"%d\n",data[i]);
00358     }
00359     FirstTime123 =0;
00360     i= fclose(OutHexFile);
00361   }
00362   else {
00363     /* Open for read (will fail if file "data" does not exist) */
00364     if( (OutHexFile = fopen(OutFileName,"a" )) == NULL ) {
00365       printf( "The OutBinFile not opened for append mode\n");
00366       getchar();
00367       exit(0);
00368     }
00369     for (i =0; i < length; i++) {
00370       fprintf(OutHexFile,"%d\n",data[i]);
00371     }
00372     i= fclose(OutHexFile);
00373   }
00374 } /* CaptureDataLFract */
00375
00376 /******************************************************************************
00377  * GLOBAL FUNCTION DEFINITIONS
00378  *****************************************************************************/
00379
00380 /******************************************************************************
00381  * FUNCTION PURPOSE: Gets SIU system time in milliseconds.
00382  ******************************************************************************
00383  * DESCRIPTION: Returns current value of system time (in milliseconds).
00384  *
00385  * CALLING FORMAT:
00386  *   siuGetTime ()
00387  *
00388  * RETURN VALUE:
00389  *   systemTime        - 32-bit indication of system time (in ms)
00390  *
00391  *****************************************************************************/
00392 tulong siuGetTime (void)
00393 {
00394   return (systemTime);
00395
00396 } /* siuGetTime */
00397
00398 /******************************************************************************
00399  * FUNCTION PURPOSE: Implements fmSendOut() API function, which sends network
00400  *                   packets to the network interface.
00401  ******************************************************************************
00402  * DESCRIPTION: Routine called by FM to send packet(s) toward the network.
00403  *              FM sends packets out (in the SendOut direction) to whatever
00404  *              packet processing module is tied to fmSendOut - in this case
00405  *              siuNetInterface, which accepts packets but does no processing.
00406  *              Return value signifies that there was not an error.
00407  *
00408  * CALLING FORMAT:
00409  *   siuPcmInterface (void *targetInst,    - ptr to packet processing module
00410  *                    tint PcmData,      - number of complete network pkts
00411  *                                           being sent to the network
00412  *
00413  * RETURN VALUE:
00414  *   None
00415  *
00416  *****************************************************************************/
00417 void siuPcmInterface_Ch1 (void *targetInst, void *PcmData)
00418 {
00419    tuint i;
00420    Fract *pcm = (Fract *) PcmData;
00421
00422
00423    for (i = 0; i < SIU_FM_LIN_SAMPLE_ARRAY_SIZE; i++)
00424    {
00425       GlobalLinSample [0] [i] = pcm[i];
00426    }
00427
00428 } /* siuPcmInterface__Ch1 */
00429
00430 /******************************************************************************
00431  * FUNCTION PURPOSE: Implements fmSendOut() API function, which sends network
00432  *                   packets to the network interface.
00433  ******************************************************************************
00434  * DESCRIPTION: Routine called by FM to send packet(s) toward the network.
00435  *              FM sends packets out (in the SendOut direction) to whatever
00436  *              packet processing module is tied to fmSendOut - in this case
00437  *              siuNetInterface, which accepts packets but does no processing.
00438  *              Return value signifies that there was not an error.
00439  *
00440  * CALLING FORMAT:
00441  *   siuPcmInterface (void *targetInst,    - ptr to packet processing module
00442  *                    tint PcmData,      - number of complete network pkts
00443  *                                           being sent to the network
00444  *
00445  * RETURN VALUE:
00446  *   None
00447  *
00448  *****************************************************************************/
00449 void siuPcmInterface_Ch2 (void *targetInst, void *PcmData)
00450 {
00451    tuint i;
00452    Fract *pcm = (Fract *) PcmData;
00453
00454
00455    for (i = 0; i < SIU_FM_LIN_SAMPLE_ARRAY_SIZE; i++)
00456    {
00457       GlobalLinSample [1] [i] = pcm[i];
00458    }
00459
00460 } /* siuPcmInterface_Ch2 */
00461
00462 /******************************************************************************
00463  * FUNCTION PURPOSE: Interface to the FP module (FIU or FaxTerm app)
00464  ******************************************************************************
00465  * DESCRIPTION:
00466  *
00467  * CALLING FORMAT:
00468  *   siuFpInterface  (void *targetInst,    - ptr to FM processing module
00469  *                    void *FpFmMessage)   - ptr to message for FM
00470  *
00471  * RETURN VALUE:
00472  *   None
00473  *
00474  *****************************************************************************/
00475 void siuFpInterface_Ch1 (void *targetInst, void *FmFpMessage)
00476 {
00477    iffaxFmFpMsg_t *localMsg = (iffaxFmFpMsg_t *)FmFpMessage;
00478
00479    GlobalFmFpMsgOut [0] [GlobalFmFpMsgOutIndex1 ++] = *(localMsg);
00480
00481    GlobalFmFpMsgOutIndex1 = GlobalFmFpMsgOutIndex1 % SIU_FM_FP_OUT_MSG_ARRAY_SIZE;
00482
00483 } /* siuFpInterface_Ch1 */
00484
00485 /******************************************************************************
00486  * FUNCTION PURPOSE: Interface to the FP module (FIU or FaxTerm app)
00487  ******************************************************************************
00488  * DESCRIPTION:
00489  *
00490  * CALLING FORMAT:
00491  *   siuFpInterface  (void *targetInst,    - ptr to FM processing module
00492  *                    void *FpFmMessage)   - ptr to message for FM
00493  *
00494  * RETURN VALUE:
00495  *   None
00496  *
00497  *****************************************************************************/
00498 void siuFpInterface_Ch2 (void *targetInst, void *FmFpMessage)
00499 {
00500    iffaxFmFpMsg_t *localMsg = (iffaxFmFpMsg_t *)FmFpMessage;
00501    tword *data;
00502    int len;
00503
00504    GlobalFmFpMsgOutIndex2 = GlobalFmFpMsgOutIndex2 % SIU_FM_FP_OUT_MSG_ARRAY_SIZE;
00505
00506    data = localMsg->MsgBody.DataPayload.DataAddress;
00507    len  = localMsg->MsgBody.DataPayload.numBytes;
00508    if (len > 0)
00509    {
00510      dpuBerMeas(data,len);
00511    }
00512
00513 } /* siuFpInterface_Ch2 */
00514
00515
00516 #ifndef NO_TONESUPP
00517 /******************************************************************************
00518  * FUNCTION PURPOSE: Implements ToneOnCmd() API call.
00519  ******************************************************************************
00520  * DESCRIPTION: Instructs the tone generator to start generating the specified
00521  *              tone cadence.  In this simulation, calls to this function do
00522  *              nothing.
00523  *
00524  * CALLING FORMAT:
00525  *   siuToneOnFax    (void *targetInst,        - pointer to FM instance
00526  *                    tgnParams_t *toneParams) - pointer to tone generation
00527  *                                                structure
00528  *
00529  * RETURN VALUE:
00530  *   None
00531  *
00532  *****************************************************************************/
00533 void siuToneOnFax (void *TargetInst, tgnParams_t *toneParams)
00534 {
00535
00536 } /* siuToneOnFax */
00537
00538 /******************************************************************************
00539  * FUNCTION PURPOSE: Implements ToneOffCmd() API call.
00540  ******************************************************************************
00541  * DESCRIPTION: Instructs the tone generator to halt generating tones.  In
00542  *              this simulation, calls to this function do nothing.
00543  *
00544  * CALLING FORMAT:
00545  *   siuToneOffFax   (void *targetInst)       - pointer to FM instance
00546  *
00547  * RETURN VALUE:
00548  *   None
00549  *
00550  *****************************************************************************/
00551 void siuToneOffFax (void *TargetInst)
00552 {
00553
00554 } /* siuToneOffFax */
00555
00556 /******************************************************************************
00557  * FUNCTION PURPOSE: Tone Detector Unit control processing
00558  ******************************************************************************
00559  * DESCRIPTION: Send a control command to the Tone Detector Unit.
00560  *              Currently we simply enable or disable the TDU.
00561  *
00562  *  void siuToneOn (
00563  *    void    *siuInst,     - pointer to channel instance
00564  *    tuint    ControlCode) - configuration of TDU:
00565  *                            0 = iffax_TONE_DETECT_CTRL_DISABLE,
00566  *                            1 = iffax_TONE_DETECT_CTRL_ENABLE
00567  *
00568  *****************************************************************************/
00569 void siuToneDetectCtrl (void *siuInst, tuint ControlCode)
00570 {
00571
00572 } /* siuToneDetectCtrl */
00573 #endif
00574
00575
00576
00577 char* GetDirectionString(int  direction)
00578 {
00579    if (direction == 1)
00580       return "Ans";
00581    else if (direction == 0)
00582       return "Org";
00583    else
00584       return "";
00585
00586 } /* GetDirectionString */
00587
00588 void StatusPrintMonitor(char * dstPtr,int direction)
00589 {
00590    printf("%20s%8s\n", dstPtr, GetDirectionString(direction));
00591
00592 } /* StatusPrintMonitor */
00593
00594 extern int fmDebugTraceParser (int msgId, int msgData, char *dstPtr);
00595
00596 /******************************************************************************
00597  * FUNCTION PURPOSE: Implements FM's debugInfo() API call.
00598  ******************************************************************************
00599  * DESCRIPTION: Handles FM API calls to debugInfo(). All INFORMATIONAL msgs
00600  *              are ignored; if the msgType is FATAL_ERROR or undefined,
00601  *              a call to siuFatalError() is made.
00602  *
00603  * CALLING FORMAT:
00604  *   siuFmDebugInfo (tuint moduleID,      - ID and channel of FM
00605  *                    tuint msgType,      - FATAL_ERROR (2) or
00606  *                                              INFORMATIONAL (0)
00607  *                    tuint messageCode,    - not used
00608  *                    tuint msgLength,      - not used
00609  *                    tuint *supportingData)  - not used
00610  *
00611  * RETURN VALUE:
00612  *   None
00613  *
00614  *****************************************************************************/
00615
00616 void   siuFmDebugInfo          (void * moduleID, tuint msgType, tuint messageCode,
00617                                 tuint msgLength,  tuint *supportingData)
00618 {
00619   char *string = NULL;
00620   char buffer[256];
00621   int fmRetVal,dir;
00622   int msgData;
00623   tuint mId= (tuint)(*((tulong *)&moduleID) & 0xFFFF);
00624
00625   msgData = supportingData[0];
00626
00627   if ((mId & 0xFF) == 1)
00628     dir = 0;
00629
00630   if ((mId & 0xFF) == 2)
00631   dir = 1;
00632
00633   switch (msgType)
00634   {
00635      case fm_INFOMATIONAL:
00636      fmRetVal = fmDebugTraceParser(messageCode, msgData, buffer);
00637       break;
00638
00639      case fm_EXCEPTION:
00640       *string = SIU_EXCEPTION_FM_DBG_FATAL_ERROR;
00641       siuFatalError (mId, string);
00642     break;
00643
00644      default:
00645       *string = SIU_EXCEPTION_FM_DBG_DEFAULT;
00646       siuFatalError (mId, string);
00647     break;
00648   }
00649
00650   if (fmRetVal == TRUE)
00651    {
00652      StatusPrintMonitor(buffer,dir);
00653    }
00654    else
00655    {
00656       printf ("Invalid trace: msgId = 0x%X, msgData = 0x%X\n", messageCode, *supportingData);
00657    }
00658
00659 } /* siuFmDebugInfo */
00660
00661 /******************************************************************************
00662  * FUNCTION PURPOSE: Generic function for handling FM and DPU exception calls.
00663  ******************************************************************************
00664  * DESCRIPTION: Handles exception and debug calls. Goes into and infinite loop,
00665  *              allowing for an eventual break and examintaaion of reason for
00666  *              calling a fata error. The global variable siuFatalString
00667  *              contains the reason for entry, as enumerated in the global
00668  *              enumeration siuFatalErrorChar_e of file main.h.
00669  *
00670  * CALLING FORMAT:
00671  *   siuFatalError   (tuint ID,       -  ID and channel of calling entity
00672  *                                         (either FM or DPU)
00673  *                    char* str)      -  Global ptr to char that holds the
00674  *                                         value of reason for entering
00675  *                                         this function
00676  *
00677  * RETURN VALUE:
00678  *   None
00679  *
00680  *****************************************************************************/
00681 void siuFatalError (tuint id, char *str)
00682 {
00683    siuFatalString = *str;
00684
00685    /* Infinite loop */
00686    while (1);
00687
00688 } /* siuFatalError */
00689
00690 /******************************************************************************
00691  * FUNCTION PURPOSE: Initializes/resets SIU instance parameters.
00692  ******************************************************************************
00693  * DESCRIPTION: Initializes siu instance parameters and structures to nominal
00694  *              values
00695  *
00696  * CALLING FORMAT:
00697  *   siu_init        (tint chnum)  -  channel number
00698  *
00699  * RETURN VALUE:
00700  *   None
00701  *
00702  *****************************************************************************/
00703 void siu_init (tint chnum)
00704 {
00705   siuInst_t *inst = &siuInst[chnum - 1];
00706
00707   inst->ID            = ((SIU_SIU_ID << 8) | chnum);
00708   inst->fmInst        = NULL;
00709   inst->fmBufs        = NULL;
00710   inst->fmNbufs       = 0;
00711   inst->fm_heap_size  = 0;
00712   inst->aux_heap_size = 0;
00713
00714 } /* siu_init */
00715
00716 /******************************************************************************
00717  * FUNCTION PURPOSE: Initialize linear samples buffer
00718  ******************************************************************************
00719  * DESCRIPTION:
00720  *
00721  * CALLING FORMAT:
00722  *   siu_init_lin_samples (tint chnum)  -  channel number
00723  *
00724  * RETURN VALUE:
00725  *   None
00726  *
00727  *****************************************************************************/
00728 void siu_init_lin_samples (tint chnum)
00729 {
00730   tuint i;
00731
00732   for (i = 0; i < SIU_FM_LIN_SAMPLE_ARRAY_SIZE; i ++)
00733   {
00734      GlobalLinSample [chnum - 1] [i] = (Fract) 0xBEEF;
00735   }
00736
00737 } /* siu_init_lin_samples */
00738
00739 /******************************************************************************
00740  * FUNCTION PURPOSE: Initialize FM_FP message buffer
00741  ******************************************************************************
00742  * DESCRIPTION:
00743  *
00744  * CALLING FORMAT:
00745  *   siu_init_fm_fp_messages (tint chnum)  -  channel number
00746  *
00747  * RETURN VALUE:
00748  *   None
00749  *
00750  *****************************************************************************/
00751 void siu_init_fm_fp_messages (tint chnum)
00752 {
00753   tuint i; /* loop counter */
00754
00755   for (i = 0; i < SIU_FM_FP_OUT_MSG_ARRAY_SIZE; i ++)
00756   {
00757      (GlobalFmFpMsgOut [chnum - 1] [i]).MsgId     =(iffaxFmFpMsgId_e) 0x0123;
00758      (GlobalFmFpMsgOut [chnum - 1] [i]).Timestamp = 0x4567;
00759      (GlobalFmFpMsgOut [chnum - 1] [i]).MsgBody.DataPayload.numBytes
00760                                         = (tint) 0x89AB;
00761      (GlobalFmFpMsgOut [chnum - 1] [i]).MsgBody.DataPayload.DataAddress =
00762                                        (tword *) 0xCDEF;
00763   }
00764
00765 } /* siu_init_fm_fp_messages */
00766
00767 /******************************************************************************
00768  * FUNCTION PURPOSE: Initialize FP_FM message buffer
00769  ******************************************************************************
00770  * DESCRIPTION: Formats FP-FM messages for sending to FM inorder to exercise
00771  *              FM in its various states:
00772  *
00773  *              Messages:
00774  *              ---------------------------------------------------------------
00775  *              struct FP_FM_MODE_S              Mode;
00776  *              struct FP_FM_DATA_S              DataPayload;
00777  *              struct FP_FM_FRAME_COMP_S        FrameComp;
00778  *              struct FP_FM_DELAY_S             Delay;
00779  *              struct FP_FM_TONE_GEN_ON_S       ToneOn;
00780  *              struct FP_FM_TONE_GEN_OFF_S      ToneOff (currently unused);
00781  *              struct FP_FM_TONE_DET_CTRL_S     ToneDetCtrl;
00782  *              struct FP_FM_FILL_PATTERN_S      FillPattern;
00783  *              ---------------------------------------------------------------
00784  *
00785  * CALLING FORMAT:
00786  *   siu_init_fp_fm_messages (tint chnum)  -  channel number
00787  *
00788  * RETURN VALUE:
00789  *   None
00790  *
00791  *****************************************************************************/
00792 void siu_init_fp_fm_messages (iffaxModulationTypes_e HighSpeedModType)
00793 {
00794
00795 /* ------------------------------------------------------------------*/
00796    /* Configure Ch 2 for HS receive */
00797   GlobalFpFmMsgIn[1] [0].MsgId                         = iffax_FP_FM_MODE;
00798   GlobalFpFmMsgIn[1] [0].MsgBody.Mode.HdlcEnable       = FALSE;
00799   GlobalFpFmMsgIn[1] [0].MsgBody.Mode.TEPEnable        = FALSE;
00800   GlobalFpFmMsgIn[1] [0].MsgBody.Mode.TrainLengthShort = FALSE;
00801   GlobalFpFmMsgIn[1] [0].MsgBody.Mode.Rx               = TRUE;
00802   GlobalFpFmMsgIn[1] [0].MsgBody.Mode.Tx               = FALSE;
00803   GlobalFpFmMsgIn[1] [0].MsgBody.Mode.Modulation     = HighSpeedModType;
00804   GlobalFpFmMsgInIndex2 ++;
00805
00806   /* Configure Ch 1 for HS transmit */
00807   GlobalFpFmMsgIn[0] [0].MsgId                         = iffax_FP_FM_MODE;
00808   GlobalFpFmMsgIn[0] [0].MsgBody.Mode.HdlcEnable       = FALSE;
00809   GlobalFpFmMsgIn[0] [0].MsgBody.Mode.TEPEnable        = FALSE;
00810   GlobalFpFmMsgIn[0] [0].MsgBody.Mode.TrainLengthShort = FALSE;
00811   GlobalFpFmMsgIn[0] [0].MsgBody.Mode.Rx               = FALSE;
00812   GlobalFpFmMsgIn[0] [0].MsgBody.Mode.Tx               = TRUE;
00813   GlobalFpFmMsgIn[0] [0].MsgBody.Mode.Modulation     = HighSpeedModType;
00814   GlobalFpFmMsgInIndex1 ++;
00815
00816   /* Send FM Ch1 Sync (should result in SYNC_ACK) */
00817   GlobalFpFmMsgIn[0] [1].MsgId                         = iffax_FP_FM_SYNC;
00818   GlobalFpFmMsgInIndex1 ++;
00819
00820   /* Send Ch 1 Modem HS data */
00821   {
00822      GlobalFpFmMsgIn[0] [2].MsgId                        = iffax_FP_FM_DATA;
00823      GlobalFpFmMsgIn[0] [2].MsgBody.DataPayload.numBytes = 40;
00824      GlobalFpFmMsgIn[0] [2].MsgBody.DataPayload.DataAddr = &FpFmHsData[0];
00825   GlobalFpFmMsgInIndex1 ++;
00826   }
00827
00828   /* Configure Ch 1 for Idle */
00829   GlobalFpFmMsgIn[0] [3].MsgId = iffax_FP_FM_MODE;
00830   GlobalFpFmMsgIn[0] [3].MsgBody.Mode.HdlcEnable       = FALSE;
00831   GlobalFpFmMsgIn[0] [3].MsgBody.Mode.TEPEnable        = FALSE;
00832   GlobalFpFmMsgIn[0] [3].MsgBody.Mode.TrainLengthShort = FALSE;
00833   GlobalFpFmMsgIn[0] [3].MsgBody.Mode.Rx               = FALSE;
00834   GlobalFpFmMsgIn[0] [3].MsgBody.Mode.Tx               = FALSE;
00835   GlobalFpFmMsgIn[0] [3].MsgBody.Mode.Modulation     = 0;
00836   GlobalFpFmMsgInIndex1 ++;
00837
00838 } /* siu_init_fp_fm_messages */
00839
00840 /******************************************************************************
00841  * FUNCTION PURPOSE: Create FM module.
00842  ******************************************************************************
00843  * DESCRIPTION: Creates an instance of FM.
00844  *
00845  * CALLING FORMAT:
00846  *   siu_new_fm  (tint chnum)  -  channel number
00847  *
00848  * RETURN VALUE:
00849  *   None
00850  *
00851  *****************************************************************************/
00852 void siu_new_fm (tint chnum)
00853 {
00854    tint                i, result, fmNbufs;
00855    char               *str = NULL;
00856    const ecomemBuffer_t   *bufs;
00857    ecomemBuffer_t        *fmLocalBufs;
00858    fmNewConfig_t       fmCfgNew;
00859    siuInst_t          *inst = &siuInst[chnum - 1];
00860
00861    /* FM get sizes */
00862    result = fmGetSizes (&fmNbufs, &bufs);
00863
00864    if (!(result == fm_NOERR))
00865    {
00866       *str = SIU_EXCEPTION_FM_SIZES_ERR;
00867       siuFatalError (SIU_FM_ID, str);
00868    }
00869
00870    /* Allocate FM memory buffer descriptors & increment auxiliary heap size */
00871    fmLocalBufs = (ecomemBuffer_t*) malloc (fmNbufs * sizeof(ecomemBuffer_t));
00872    inst->aux_heap_size += fmNbufs * sizeof(ecomemBuffer_t);
00873
00874    /* Allocate FM memory buffers & increment FM heap size. Data from the (global)
00875       variable fmBufs is copied into the (local) variable fmLocalBufs in order to
00876       correctly set fmLocalBufs' size parameter */
00877    for (i = 0; i < fmNbufs; i++)
00878    {
00879       fmLocalBufs[i]            = bufs[i];
00880       fmLocalBufs[i].mclass     = ecomem_CLASS_EXTERNAL;
00881       fmLocalBufs[i].log2align  = 0;
00882       fmLocalBufs[i].volat      = FALSE;
00883       fmLocalBufs[i].base       = malloc (bufs[i].size);
00884       inst->fm_heap_size        += bufs[i].size;
00885    }
00886
00887    /* Need these as a handle to delete this channel's FM someday */
00888    inst->fmNbufs = fmNbufs;
00889    inst->fmBufs  = &fmLocalBufs[0];
00890
00891    /* Fill out the FM new config structure, and call fmNew() */
00892    fmCfgNew.ID        = (SIU_FM_ID << 8) | chnum;
00893
00894    result = fmNew (&inst->fmInst, fmNbufs, fmLocalBufs, &fmCfgNew);
00895
00896    if (!(result == fm_NOERR))
00897    {
00898       *str = SIU_EXCEPTION_FM_NEW_ERR;
00899       siuFatalError (SIU_FM_ID, str);
00900    }
00901
00902 } /* siu_new_fm */
00903
00904 /******************************************************************************
00905  * FUNCTION PURPOSE: Open FM module
00906  ******************************************************************************
00907  * DESCRIPTION: Opens one instance of an FM module
00908  *
00909  * CALLING FORMAT:
00910  *   siu_open_fm    (tint chnum)     - channel number
00911  *
00912  * RETURN VALUE:
00913  *   None
00914  *
00915  *****************************************************************************/
00916 void siu_open_fm (tint chnum)
00917 {
00918   tint           result;
00919   char           *str = NULL;
00920   fmOpenConfig_t fmOpencfg;
00921   siuInst_t      *inst = &siuInst[chnum - 1];
00922
00923   /* Fill out the FM open config structure, and call fmOpen() */
00924   fmOpencfg.debugLvl                = 2;
00925   fmOpencfg.tx_level                = -10;
00926   fmOpencfg.rx_cd_thr_set           = 0;
00927   fmOpencfg.fBufferData             = FALSE;
00928   fmOpencfg.maxBytesToBuffer        = 1;
00929   fmOpencfg.tablePtr        = &fmTablePtrs;
00930
00931   if (chnum == 1)
00932   {
00933     fmOpencfg.RxOutSpec.fmReceiveOut  = siuPcmInterface_Ch1;
00934     fmOpencfg.SendOutSpec.fmSendOut   = siuFpInterface_Ch1;
00935   }
00936   else if (chnum == 2)
00937   {
00938     fmOpencfg.RxOutSpec.fmReceiveOut  = siuPcmInterface_Ch2;
00939     fmOpencfg.SendOutSpec.fmSendOut   = siuFpInterface_Ch2;
00940   }
00941
00942   fmOpencfg.RxOutSpec.TargetInst    = NULL;
00943   fmOpencfg.SendOutSpec.TargetInst  = NULL;
00944
00945 #ifndef NO_TONESUPP
00946   fmOpencfg.ToneDetCtrl.ToneDetCtrl = siuToneDetectCtrl;
00947   fmOpencfg.ToneDetCtrl.TargetInst  = inst;
00948   fmOpencfg.ToneGen.ToneOnCmd       = NULL;//siuToneOnFax;
00949   fmOpencfg.ToneGen.ToneOffCmd      = NULL;//siuToneOffFax;
00950   fmOpencfg.ToneGen.TargetInst      = NULL;//inst;
00951
00952 #endif
00953
00954   result = fmOpen (inst->fmInst, &fmOpencfg);
00955
00956   if (!(result == fm_NOERR))
00957   {
00958      *str = SIU_EXCEPTION_FM_OPEN_ERR;
00959      siuFatalError (SIU_FM_ID, str);
00960   }
00961
00962 } /* siu_open_fm */
00963
00964 /******************************************************************************
00965  * FUNCTION PURPOSE: Close FM module
00966  ******************************************************************************
00967  * DESCRIPTION: Closes one instance of a FM module
00968  *
00969  * CALLING FORMAT:
00970  *   siu_close_fm   (tint chnum)      - channel number
00971  *
00972  * RETURN VALUE:
00973  *   None
00974  *
00975  *****************************************************************************/
00976 void siu_close_fm (tint chnum)
00977 {
00978   siuInst_t *inst = &siuInst[chnum - 1];
00979   fmClose (inst->fmInst);
00980
00981 } /* siu_close_fm */
00982
00983 /******************************************************************************
00984  * FUNCTION PURPOSE: Delete FM module
00985  ******************************************************************************
00986  * DESCRIPTION: Deletes one instance of a FM module
00987  *
00988  * CALLING FORMAT:
00989  *   siu_delete_fm  (tint chnum)      - channel number
00990  *
00991  * RETURN VALUE:
00992  *   None
00993  *
00994  *****************************************************************************/
00995 void siu_delete_fm (tint chnum)
00996 {
00997   tint ii;
00998   siuInst_t *inst = &siuInst[chnum - 1];
00999
01000   fmDelete (&(inst->fmInst));
01001
01002   /* Free memory for FM buffer descriptors & adjust aux_heap_size */
01003   inst->aux_heap_size -= inst->fmNbufs * sizeof(ecomemBuffer_t);
01004   for (ii = 0; ii < inst->fmNbufs; ii++)
01005   {
01006    free(inst->fmBufs[ii].base);
01007    inst->fm_heap_size -= inst->fmBufs[ii].size;
01008
01009   }
01010
01011   /* Free memory for FM buffer descriptors & adjust aux_heap_size */
01012   free(inst->fmBufs);
01013   inst->fmNbufs = 0;
01014
01015 } /* siu_delete_fm */
01016
01017 /******************************************************************************
01018  * FUNCTION PURPOSE: Main SIU (system integration unit) processing routine
01019  ******************************************************************************
01020  * DESCRIPTION: This routine exercises the APIs for both the FM and DPU
01021  *              modules.
01022  *
01023  * CALLING FORMAT:
01024  *   void main (void)
01025  * RETURN VALUE:
01026  *   None
01027  *
01028  *****************************************************************************/
01029 tuint i=0,TxCap= 0,RxCap = 0;                         /* Loop counter */
01030 int   gbindx = 0;
01031 fmContext_t fmContext =
01032 {
01033    siuFmDebugInfo,
01034    siuGetTime,
01035    NULL
01036 };
01037
01038 tuint CDLoss[10] = {0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead,0xdead};
01039 tuint CDLossInd = 0;
01040
01041 tulong CDLossTime[10];
01042 tuint  CDLossTimeInd = 0;
01043 tuint  ch1_msg_num   = 0;              /* Ch1 message counter */
01044 tuint  ch2_msg_num   = 0;              /* Ch2 message counter */
01045 tint   NOISELEVEL = -168,MEAN = 0;
01046 tuint  SEED = 0,RNGSTATE = 0;
01047
01048 void main (void)
01049 {
01050    tint chnum;                          /* Channel number for 1-channel sim */
01051 #ifndef FILEIO
01052    tbool running = TRUE;                 /* While loop condition */
01053 #endif
01054    tword mulawpcmIn[80];
01055 #if   LINEAR_PCM
01056    Fract pcmIn[80];
01057 #endif
01058 #if V17_STRAIN_TST
01059    tulong sessionCnt = 0;
01060 #endif
01061 /* Handle CCS Project paths */
01062 #ifdef  __CCS_PROJECT_REL_PATH
01063    char EcoTestDpuRoot[50] = {"..//..//..//vectors//input//"};
01064 #else
01065    char EcoTestDpuRoot[50] = {"..//..//vectors//input//"};
01066 #endif
01067 #if CUSTPROB_DBG
01068   FILE *MuLawCustSampsIn;
01069 #endif
01070 #if V17_STRAIN_TST
01071   FILE *V17MuLawSampsIn;
01072   fmInst_t *fmInstance;
01073   int   NFiles,CarrierDetected=0;
01074 #endif
01075
01076 #if    TESTDPUVECS
01077   int   NumberOfFiles,LineCode = 1000;
01078 #endif
01079     FILE *MuLawSampsIn;
01080    switch(LineCode)
01081    {
01082    case 0001:
01083      LineCode = 1;
01084      break;
01085    case 0010:
01086      LineCode = 2;
01087      break;
01088    case 0011:
01089      LineCode = 3;
01090      break;
01091    case 0100:
01092      LineCode = 4;
01093      break;
01094    case 0101:
01095       LineCode = 5;
01096      break;
01097    case 0110:
01098       LineCode = 6;
01099      break;
01100    case 0111:
01101       LineCode = 7;
01102      break;
01103    case 1000:
01104       LineCode = 8;
01105      break;
01106    case 1001:
01107       LineCode = 9;
01108      break;
01109    case 1010:
01110       LineCode = 10;
01111      break;
01112    case 1011:
01113       LineCode = 11;
01114      break;
01115    case 1100:
01116       LineCode = 12;
01117      break;
01118    case 1101:
01119       LineCode = 13;
01120      break;
01121    case 1110:
01122       LineCode = 14;
01123      break;
01124    case 1111:
01125       LineCode = 15;
01126      break;
01127    default:
01128       LineCode = 16;
01129      break;
01130    }
01131    NumberOfFiles  = PopulateTestDataBase(EcoTestDpuRoot,LineCode);
01132
01133    NumberOfFiles--;
01134    do
01135    {
01136 #if ADD_NOISE
01137    /* Initialize Noise Generator */
01138   wngInit(NOISELEVEL,SEED,&MEAN,&RNGSTATE);
01139 #endif
01140
01141 #if V17_STRAIN_TST
01142   NFiles = PopulateTestDataBase(EcoTestDpuRoot,16);
01143 #endif
01144
01145    /* Configure, initialize and open all FM instances */
01146    for (chnum = 1; chnum <= SIU_NUMBER_OF_CHANNELS; chnum ++)
01147    {
01148 #if   TESTDPUVECS
01149       ClearAllGlobalVariables();
01150 #endif
01151     siu_init                (chnum);
01152       siu_init_lin_samples    (chnum);
01153       siu_init_fm_fp_messages (chnum);
01154       siu_new_fm              (chnum);
01155       siu_open_fm             (chnum);
01156    }
01157
01158    /* Initialize the FP-FM messages array, configure Ch 1 for Tx and
01159       configure Ch 2 for Rx for a given Modulation and Rate */
01160 #if TESTDPUVECS
01161    siu_init_fp_fm_messages (ModAssoc[gbindx]);
01162 #else
01163 #if V17_STRAIN_TST
01164      siu_init_fp_fm_messages (iffax_MODEM_MODE_V17_L_14400);
01165 #else
01166      siu_init_fp_fm_messages (iffax_MODEM_MODE_V17_L_9600);
01167 #endif
01168 #endif
01169    if (fmReceiveIn (siuInst[0].fmInst, (void *) &(GlobalFpFmMsgIn[0] [ch1_msg_num++]))
01170        != iffax_FM_CMD_ACCEPTED)
01171    {
01172       siuFmDebugInfo ((void *)siuInst[0].ID, fm_EXCEPTION, 0, 0, 0);
01173    }
01174
01175    if (fmReceiveIn (siuInst[1].fmInst, (void *) &(GlobalFpFmMsgIn[1] [ch2_msg_num++]))
01176        != iffax_FM_CMD_ACCEPTED)
01177    {
01178       siuFmDebugInfo ((void *)siuInst[1].ID, fm_EXCEPTION, 0, 0, 0);
01179    }
01180
01181
01182 #if TESTDPUVECS
01183    if ( (MuLawSampsIn = fopen(TestFileNames[gbindx++], "rb")) != NULL)
01184    {
01185      /* file exists in the directory, Process it */
01186      BerCount = OnesCount= 0;
01187      printf("=======================================================================================\n");
01188      printf("Running test for vector file:%s\n",TestFileNames[gbindx-1]);
01189    }
01190    else
01191    {
01192      printf( " FILE OPEN ERR \n \n" );
01193      exit(1);
01194    }
01195 #endif
01196
01197 #if V17_STRAIN_TST
01198    if ( (V17MuLawSampsIn = fopen(TestFileNames[0], "rb")) != NULL)
01199    {
01200      /* file exists in the directory, Process it */
01201      BerCount = OnesCount= 0;
01202    }
01203    else
01204    {
01205      printf( " FILE OPEN ERR \n \n" );
01206      exit(1);
01207    }
01208 #endif
01209 #if  CUSTPROB_DBG
01210    strcpy(TestFileNames[0],"d:\\temp\\HermanTest11_SIL1.pcm");
01211    if ( (MuLawCustSampsIn = fopen(TestFileNames[0], "rb")) != NULL)
01212    {
01213      /* file exists in the directory, Process it */
01214      BerCount = OnesCount= 0;
01215    }
01216    else
01217    {
01218      printf( " FILE OPEN ERR \n \n" );
01219      exit(1);
01220    }
01221 #endif
01222
01223    /* Main loop for processing global FP-FM messages */
01224 #ifndef FILEIO
01225    while (running)
01226    {
01227 #if  V17_STRAIN_TST
01228      if (!loop_flag)
01229     running = FALSE;
01230 #else
01231      if (i++ >= 6000)
01232         running = FALSE;
01233 #endif
01234 #else
01235    while ((loop_flag) &&
01236         (limit_count < ONES_LIMIT) )
01237    {
01238 #endif
01239       /* Send message to Ch 1 FM */
01240       if ((i % 5) == 0)
01241       {
01242          if (ch1_msg_num < GlobalFpFmMsgInIndex1)
01243          {
01244             if (fmReceiveIn (siuInst[0].fmInst, (void *) &(GlobalFpFmMsgIn[0] [ch1_msg_num++]))
01245                 != iffax_FM_CMD_ACCEPTED)
01246             {
01247                 siuFmDebugInfo ((void *)siuInst[0].ID, fm_EXCEPTION, 0, 0, 0);
01248             }
01249          }
01250     }
01251
01252       /* Each FM module now processes PCM samples output from other channel */
01253       fmSendIn (siuInst[0].fmInst, (Fract *) &(GlobalLinSample[1] [0]));
01254
01255 #if TESTDPUVECS
01256     /* Overwrite the PCM samples output from Ch1 */
01257      if (fread((void *)mulawpcmIn, sizeof(char),80, MuLawSampsIn) != 80)
01258       loop_flag = 0;
01259 #if   !LINEAR_PCM
01260      if(loop_flag)
01261        UAExpand((tint)80,(tword *)mulawpcmIn,(Fract *) &GlobalLinSample[0][0],(const tint *)tblUlaw);
01262 #endif
01263
01264 #endif
01265
01266 #if V17_STRAIN_TST
01267     /* Overwrite the PCM samples output from Ch1 */
01268      if (fread((void *)mulawpcmIn, sizeof(char),80, V17MuLawSampsIn) != 80)
01269       loop_flag = 0;
01270      if(loop_flag)
01271        UAExpand((tint)80,(tword *)mulawpcmIn,(Fract *) &GlobalLinSample[0][0],(const tint *)tblUlaw);
01272 #endif
01273
01274 #if   CUSTPROB_DBG
01275     /* Overwrite the PCM samples output from Ch1 */
01276 #if   LINEAR_PCM
01277      if (fread((void *)pcmIn, sizeof(Fract),80, MuLawCustSampsIn) != 80)
01278       loop_flag = 0;
01279      for (index = 0; index < 80; index++)
01280     GlobalLinSample[0][index] = pcmIn[index];
01281 #else
01282      if (fread((void *)mulawpcmIn, sizeof(char),80, MuLawCustSampsIn) != 80)
01283       loop_flag = 0;
01284      if(loop_flag)
01285        UAExpand((tint)80,(tword *)mulawpcmIn,(Fract *) &GlobalLinSample[0][0],(const tint *)tblAlaw);
01286 #endif
01287
01288 #endif
01289
01290 #if   ADD_NOISE
01291     wngGenNoiseFrame(MEAN,&RNGSTATE,80,(Fract *) &GlobalLinSample[0][0]);
01292 #endif
01293
01294 #if   CAPTURE_PCM_TX
01295     /* Capture 80 samples starting from &GlobalLinSample[0][0] */
01296     CaptureDataShort1((int)80,(Fract *)&GlobalLinSample[0][0],"D:\\temp\\pcmtx.dat");
01297 #endif
01298
01299 #if   TEST_CDL
01300     ReadDataOntoMemory(80,&GlobalLinSample[0][0],"D:\\temp\\pcmtxV2724_36dbm.dat");
01301 #endif
01302       fmSendIn (siuInst[1].fmInst, (Fract *) &(GlobalLinSample[0] [0]));
01303
01304 #if V17_STRAIN_TST
01305
01306     fmInstance = (fmInst_t *)siuInst[1].fmInst;
01307     if (fmInstance->FmStatus & 0x01)
01308     {
01309       CarrierDetected = 1;
01310     }
01311     if (CarrierDetected)
01312     {
01313       if (!(fmInstance->FmStatus & 0x01))
01314       {
01315         CarrierDetected = 0;BerCount = OnesCount = 0;
01316         sessionCnt++;
01317
01318         if ((sessionCnt % 6) == 0)
01319         {
01320           fmInstance->Dpu.CtrlParam.Config &= ~FM_DPU_CONFIG_STRAIN;
01321           fmInstance->Dpu.CtrlParam.Config |= FM_DPU_CONFIG_SETUP;
01322         }
01323
01324         ch1_msg_num = ch2_msg_num = 0;
01325         GlobalFpFmMsgInIndex1 = GlobalFpFmMsgInIndex2 = 0;
01326         GlobalFmFpMsgOutIndex1 = GlobalFmFpMsgOutIndex2 = 0;
01327       }
01328     }
01329 #endif
01330
01331     systemTime += 80;
01332
01333
01334    } /* while (running) */
01335
01336 #if TESTDPUVECS
01337    fclose(MuLawSampsIn);
01338 #endif
01339 #if V17_STRAIN_TST
01340    fclose(V17MuLawSampsIn);
01341 #endif
01342 #if CUSTPROB_DBG
01343    fclose(MuLawCustSampsIn);
01344 #endif
01345    for (chnum = 1; chnum <= SIU_NUMBER_OF_CHANNELS; chnum ++)
01346    {
01347       /* Get updated net and fax stats */
01348       fmStats (siuInst[chnum-1].fmInst, 0, &siuFmStats[chnum-1]);
01349     /* Close all channels and delette the instances */
01350       siu_close_fm  (chnum);
01351       siu_delete_fm (chnum);
01352    }
01353 #if TESTDPUVECS
01354    printf("Test Results:\n");
01355    printf("SNR REPORTED in dB: %d\n",siuFmStats[1].fmSigQStats.snr);
01356    printf("BER REPORTED:%ld\nONES TRANSMITTED:%ld\n",(unsigned long)BerCount,(unsigned long)OnesCount);
01357    printf("RXLEVEL REPORTED: %3d\n",siuFmStats[1].fmSigQStats.rx_level);
01358    //printf("POWER  LEVEL LATCHED in dB: %d\n",frctRoundF(utlLin2dBPower(power_sat),4,0));
01359    //printf("SIGNAL POWER LEVEL REPORTED in dB : %d\n",frctRoundF(utlLin2dBPower(sig_power),4,0));
01360    //printf("Carrier LOSS PENDING FLAG: %ld\n",CDLPendingFlag);
01361    printf("Completed test for vector file:%s\n",TestFileNames[gbindx-1]);
01362    printf("=======================================================================================\n");
01363    //power_sat = sig_power = CDLPendingFlag = 0;
01364  } while(NumberOfFiles--);
01365 #endif
01366
01367    exit(0);
01368
01369 } /* main */
01370
01371 void ClearAllGlobalVariables(void)
01372 {
01373    i = TxCap = RxCap = 0;
01374    ch1_msg_num = ch2_msg_num = 0;
01375    GlobalFpFmMsgInIndex1 = GlobalFpFmMsgInIndex2 = 0;
01376    GlobalFmFpMsgOutIndex1 = GlobalFmFpMsgOutIndex2 = 0;
01377    loop_flag = 1;
01378    limit_count = 0;
01379
01380 } /* ClearAllGlobalVariables */
01381
01382 #if  TESTDPUVECS
01383 int CopyC1LineFiles(char *EcoTestDpuRoot,int Index)
01384 {
01385    int i,j = 0;
01386    char EcoTestC1[80];
01387
01388    strcpy(EcoTestC1,EcoTestDpuRoot);
01389 //   strcat(EcoTestC1,"\\c1\\");
01390
01391    for ( i= Index; i < (Index+NOC1FILES); i++,j++)
01392    {
01393       strcpy(&TestFileNames[i][0],EcoTestC1);
01394       strcat(&TestFileNames[i][0],TestFileNamesC1[j]);
01395       ModAssoc[i] = modC1[i];
01396    }
01397
01398    return(NOC1FILES);
01399
01400 } /* CopyC1LineFiles */
01401
01402 #endif /* TESTDPUVECS */
01403
01404 #if  V17_STRAIN_TST
01405 int CopyV17STrainFiles(char *EcoTestDpuRoot,int Index)
01406 {
01407    char temp[80];
01408    strcpy(temp,EcoTestDpuRoot);
01409    strcat(temp,"\\V17shortTraining\\");
01410
01411    for ( i= Index; i < (Index+1); i++)
01412    {
01413       strcpy(TestFileNames[i],temp);
01414       strcat(TestFileNames[i],"V17_14400_long_short_using_script_flat_NoNoise_10dBUp.pcm");
01415    }
01416    return(1);
01417
01418 } /* CopyV17STrainFiles */
01419 #endif
01420
01421 int PopulateTestDataBase(char *EcoTestDpuRoot,int LineCode)
01422 {
01423   int NumOfFiles = 0,IndexStart = 0;
01424
01425   if (LineCode & 0x8)
01426   {
01427 #if TESTDPUVECS
01428     NumOfFiles =  CopyC1LineFiles(EcoTestDpuRoot,IndexStart);
01429 #endif
01430     IndexStart  += NumOfFiles;
01431   }
01432
01433   if (LineCode & 0x10)
01434   {
01435 #if V17_STRAIN_TST
01436     NumOfFiles =  CopyV17STrainFiles(EcoTestDpuRoot,IndexStart);
01437 #endif
01438     IndexStart  += NumOfFiles;
01439   }
01440   return(IndexStart);
01441
01442 } /* PopulateTestDataBase */
01443
01444 /* nothing past this point */


FM Test: fmsim.h File Reference

  • File List
  • Globals

fmsim.h File Reference

#include "string.h"
#include "stdlib.h"
#include <ti/mas/types/types.h>
#include <ti/mas/iface/iffax/iffax.h>
#include <ti/mas/util/ecomem.h>
#include <ti/mas/fm/fm.h>

Include dependency graph for fmsim.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct | siuInst_t

Defines

#define | NO_TONESUPP TRUE
#define | SIU_NUMBER_OF_CHANNELS 2
#define | SIU_SIU_ID 0x01
#define | SIU_DPU_ID 0x02
#define | SIU_FM_ID 0x03
#define | SIU_FM_FP_MSG_COUNT FM_FP_COUNT - 1
#define | SIU_FM_FP_OUT_MSG_ARRAY_SIZE 10
#define | SIU_FP_FM_MSG_COUNT FP_FM_COUNT - 1
#define | SIU_FP_FM_IN_MSG_ARRAY_SIZE 15
#define | SIU_FM_LIN_SAMPLE_ARRAY_SIZE 80
#define | ONES_LIMIT 100000
#define | NOC1FILES 8

Enumerations

enum siuFatalErrorChar_e {
SIU_EXCEPTION_FM_DBG_FATAL_ERROR, SIU_EXCEPTION_FM_DBG_DEFAULT, SIU_EXCEPTION_FM_SIZES_ERR, SIU_EXCEPTION_FM_BUFS_ERR,
SIU_EXCEPTION_FM_NEW_ERR, SIU_EXCEPTION_FM_OPEN_ERR
}

Functions

tulong | siuGetTime (void)
void | siuPcmInterface_Ch1 (void *targetInst, void *PcmData)
void | siuPcmInterface_Ch2 (void *targetInst, void *PcmData)
void | siuFpInterface_Ch1 (void *targetInst, void *FmFpMessage)
void | siuFpInterface_Ch2 (void *targetInst, void *FmFpMessage)
void | siuToneOffFax (void *TargetInst)
void | siuToneDetectCtrl (void *siuInst, tuint ControlCode)
void | siuFmDebugInfo (void *moduleID, tuint msgType, tuint messageCode, tuint msgLength, tuint *supportingData)
void | siuFatalError (tuint id, char *str)
void | siu_init (tint chnum)
void | siu_init_lin_samples (tint chnum)
void | siu_init_fm_fp_messages (tint chnum)
void | siu_init_fp_fm_messages (iffaxModulationTypes_e hsmod)
void | siu_new_fm (tint chnum)
void | siu_open_fm (tint chnum)
void | siu_close_fm (tint chnum)
void | siu_delete_fm (tint chnum)
void | UAExpand (tint sub_segment_size, tword *pcm_in, Fract *send_out_buf_ptr_ptr, const tint *pcm_expand_table)

Variables

const tint | tblUlaw [128]
const tint | tblAlaw [128]
char | TestFileNamesC1 [NOC1FILES][35]
iffaxModulationTypes_e | modC1 [NOC1FILES]

Define Documentation

#define NO_TONESUPP TRUE

Definition at line 83 of file fmsim.h.

#define SIU_NUMBER_OF_CHANNELS 2

Definition at line 86 of file fmsim.h.

Referenced by main().

#define SIU_SIU_ID 0x01

Definition at line 87 of file fmsim.h.

Referenced by siu_init().

#define SIU_DPU_ID 0x02

Definition at line 88 of file fmsim.h.

#define SIU_FM_ID 0x03

Definition at line 89 of file fmsim.h.

Referenced by siu_new_fm(), and siu_open_fm().

#define SIU_FM_FP_MSG_COUNT FM_FP_COUNT - 1

Definition at line 91 of file fmsim.h.

#define SIU_FM_FP_OUT_MSG_ARRAY_SIZE 10

Definition at line 92 of file fmsim.h.

Referenced by siu_init_fm_fp_messages(), siuFpInterface_Ch1(), and siuFpInterface_Ch2().

#define SIU_FP_FM_MSG_COUNT FP_FM_COUNT - 1

Definition at line 94 of file fmsim.h.

#define SIU_FP_FM_IN_MSG_ARRAY_SIZE 15

Definition at line 95 of file fmsim.h.

#define SIU_FM_LIN_SAMPLE_ARRAY_SIZE 80

Definition at line 97 of file fmsim.h.

Referenced by siu_init_lin_samples(), siuPcmInterface_Ch1(), and siuPcmInterface_Ch2().

#define ONES_LIMIT 100000

Definition at line 106 of file fmsim.h.

Referenced by main().

#define NOC1FILES 8

Definition at line 213 of file fmsim.h.

Referenced by main().

Enumeration Type Documentation

enum siuFatalErrorChar_e

Enumerator:
SIU_EXCEPTION_FM_DBG_FATAL_ERROR
SIU_EXCEPTION_FM_DBG_DEFAULT
SIU_EXCEPTION_FM_SIZES_ERR
SIU_EXCEPTION_FM_BUFS_ERR
SIU_EXCEPTION_FM_NEW_ERR
SIU_EXCEPTION_FM_OPEN_ERR

Definition at line 128 of file fmsim.h.

Function Documentation

tulong siuGetTime ( void )

Definition at line 392 of file fmsim.c.

References systemTime.

void siuPcmInterface_Ch1 | ( | void * | targetInst,
 |  | void * | PcmData
 | ) |  |

Definition at line 417 of file fmsim.c.

References i, and SIU_FM_LIN_SAMPLE_ARRAY_SIZE.

Referenced by siu_open_fm().

void siuPcmInterface_Ch2 | ( | void * | targetInst,
 |  | void * | PcmData
 | ) |  |

Definition at line 449 of file fmsim.c.

References i, and SIU_FM_LIN_SAMPLE_ARRAY_SIZE.

Referenced by siu_open_fm().

void siuFpInterface_Ch1 | ( | void * | targetInst,
 |  | void * | FmFpMessage
 | ) |  |

Definition at line 475 of file fmsim.c.

References SIU_FM_FP_OUT_MSG_ARRAY_SIZE.

Referenced by siu_open_fm().

void siuFpInterface_Ch2 | ( | void * | targetInst,
 |  | void * | FmFpMessage
 | ) |  |

Definition at line 498 of file fmsim.c.

References dpuBerMeas(), and SIU_FM_FP_OUT_MSG_ARRAY_SIZE.

Referenced by siu_open_fm().

Here is the call graph for this function:

void siuToneOffFax ( void * TargetInst )

Definition at line 551 of file fmsim.c.

void siuToneDetectCtrl | ( | void * | siuInst,
 |  | tuint | ControlCode
 | ) |  |

Definition at line 569 of file fmsim.c.

Referenced by siu_open_fm().

void siuFmDebugInfo | ( | void * | moduleID,
 |  | tuint | msgType,
 |  | tuint | messageCode,
 |  | tuint | msgLength,
 |  | tuint * | supportingData
 | ) |  |

Definition at line 616 of file fmsim.c.

References fmDebugTraceParser(), SIU_EXCEPTION_FM_DBG_DEFAULT, SIU_EXCEPTION_FM_DBG_FATAL_ERROR, siuFatalError(), and StatusPrintMonitor().

Referenced by main().

Here is the call graph for this function:

void siuFatalError | ( | tuint | id,
 |  | char * | str
 | ) |  |

Definition at line 681 of file fmsim.c.

References siuFatalString.

Referenced by siu_new_fm(), siu_open_fm(), and siuFmDebugInfo().

void siu_init ( tint chnum )

Definition at line 703 of file fmsim.c.

References siuInst_t::aux_heap_size, siuInst_t::fm_heap_size, siuInst_t::fmBufs, siuInst_t::fmInst, siuInst_t::fmNbufs, siuInst_t::ID, SIU_SIU_ID, and siuInst.

Referenced by main().

void siu_init_lin_samples ( tint chnum )

Definition at line 728 of file fmsim.c.

References i, and SIU_FM_LIN_SAMPLE_ARRAY_SIZE.

Referenced by main().

void siu_init_fm_fp_messages ( tint chnum )

Definition at line 751 of file fmsim.c.

References i, and SIU_FM_FP_OUT_MSG_ARRAY_SIZE.

Referenced by main().

void siu_init_fp_fm_messages ( iffaxModulationTypes_e hsmod )

Definition at line 792 of file fmsim.c.

Referenced by main().

void siu_new_fm ( tint chnum )

Definition at line 852 of file fmsim.c.

References siuInst_t::aux_heap_size, siuInst_t::fm_heap_size, siuInst_t::fmBufs, siuInst_t::fmInst, siuInst_t::fmNbufs, i, SIU_EXCEPTION_FM_NEW_ERR, SIU_EXCEPTION_FM_SIZES_ERR, SIU_FM_ID, siuFatalError(), and siuInst.

Referenced by main().

Here is the call graph for this function:

void siu_open_fm ( tint chnum )

Definition at line 916 of file fmsim.c.

References siuInst_t::fmInst, fmTablePtrs, SIU_EXCEPTION_FM_OPEN_ERR, SIU_FM_ID, siuFatalError(), siuFpInterface_Ch1(), siuFpInterface_Ch2(), siuInst, siuPcmInterface_Ch1(), siuPcmInterface_Ch2(), and siuToneDetectCtrl().

Referenced by main().

Here is the call graph for this function:

void siu_close_fm ( tint chnum )

Definition at line 976 of file fmsim.c.

References siuInst_t::fmInst, and siuInst.

Referenced by main().

void siu_delete_fm ( tint chnum )

Definition at line 995 of file fmsim.c.

References siuInst_t::aux_heap_size, siuInst_t::fm_heap_size, siuInst_t::fmBufs, siuInst_t::fmInst, siuInst_t::fmNbufs, and siuInst.

Referenced by main().

void UAExpand | ( | tint | sub_segment_size,
 |  | tword * | pcm_in,
 |  | Fract * | send_out_buf_ptr_ptr,
 |  | const tint * | pcm_expand_table
 | ) |  |

Definition at line 224 of file fmsim.c.

Referenced by main().

Variable Documentation

const tint tblUlaw[128]

Initial value:

 {
   32124,  31100,  30076,  29052,  28028,  27004,  25980,  24956,
   23932,  22908,  21884,  20860,  19836,  18812,  17788,  16764,
   15996,  15484,  14972,  14460,  13948,  13436,  12924,  12412,
   11900,  11388,  10876,  10364,   9852,   9340,   8828,   8316,
    7932,   7676,   7420,   7164,   6908,   6652,   6396,   6140,
    5884,   5628,   5372,   5116,   4860,   4604,   4348,   4092,
    3900,   3772,   3644,   3516,   3388,   3260,   3132,   3004,
    2876,   2748,   2620,   2492,   2364,   2236,   2108,   1980,
    1884,   1820,   1756,   1692,   1628,   1564,   1500,   1436,
    1372,   1308,   1244,   1180,   1116,   1052,    988,    924,
     876,    844,    812,    780,    748,    716,    684,    652,
     620,    588,    556,    524,    492,    460,    428,    396,
     372,    356,    340,    324,    308,    292,    276,    260,
     244,    228,    212,    196,    180,    164,    148,    132,
     120,    112,    104,     96,     88,     80,     72,     64,
      56,     48,     40,     32,     24,     16,      8,      0
}

Definition at line 167 of file fmsim.h.

Referenced by main().

const tint tblAlaw[128]

Initial value:

 {
    5504,   5248,   6016,   5760,   4480,   4224,   4992,   4736,
    7552,   7296,   8064,   7808,   6528,   6272,   7040,   6784,
    2752,   2624,   3008,   2880,   2240,   2112,   2496,   2368,
    3776,   3648,   4032,   3904,   3264,   3136,   3520,   3392,
   22016,  20992,  24064,  23040,  17920,  16896,  19968,  18944,
   30208,  29184,  32256,  31232,  26112,  25088,  28160,  27136,
   11008,  10496,  12032,  11520,   8960,   8448,   9984,   9472,
   15104,  14592,  16128,  15616,  13056,  12544,  14080,  13568,
     344,    328,    376,    360,    280,    264,    312,    296,
     472,    456,    504,    488,    408,    392,    440,    424,
      88,     72,    120,    104,     24,      8,     56,     40,
     216,    200,    248,    232,    152,    136,    184,    168,
    1376,   1312,   1504,   1440,   1120,   1056,   1248,   1184,
    1888,   1824,   2016,   1952,   1632,   1568,   1760,   1696,
     688,    656,    752,    720,    560,    528,    624,    592,
     944,    912,   1008,    976,    816,    784,    880,    848
}

Definition at line 194 of file fmsim.h.

Referenced by main().

char TestFileNamesC1[NOC1FILES][35]

Initial value:

{
        "V29_9600_c1_48dBrn.pcm",
        "V17_14400_c1_45dBrn.pcm",
        "V17_12000_c1_48dBrn.pcm",
        "V17_7200_c1_55dBrn.pcm",
        "V17_9600_c1_52dBrn.pcm",
        "V27_4800_c1_52dBrn.pcm",
        "V27_2400_c1_60dBrn.pcm" ,
        "V29_7200_c1_51dBrn.pcm"
}

Definition at line 214 of file fmsim.h.

Referenced by main().

iffaxModulationTypes_e modC1[NOC1FILES]

Initial value:

{
    iffax_MODEM_MODE_V29_9600,
    iffax_MODEM_MODE_V17_L_14400,
    iffax_MODEM_MODE_V17_L_12000,
    iffax_MODEM_MODE_V17_L_7200,
    iffax_MODEM_MODE_V17_L_9600,
    iffax_MODEM_MODE_V27_4800,
    iffax_MODEM_MODE_V27_2400,
    iffax_MODEM_MODE_V29_7200
}

Definition at line 226 of file fmsim.h.

Referenced by main().


FM Test: fmsim.h Source File

  • File List
  • Globals

fmsim.h

Go to the documentation of this file.
00001 #ifndef _FMSIM_H
00002 #define _FMSIM_H
00003 /******************************************************************************
00004  * FILE PURPOSE: Common system-specific definitions for FM simulation
00005  ******************************************************************************
00006  * FILE NAME: fmsim.h
00007  *
00008  * DESCRIPTION: Contains common system-specific data definitions, and global
00009  *              definitions for FM simulation.
00010  *
00011  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00012  *
00013  *              All rights reserved not granted herein.
00014  *
00015  *                         Limited License.
00016  *
00017  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00018  *  non-exclusive license under copyrights and patents it now or hereafter owns
00019  *  or controls to make, have made, use, import, offer to sell and sell
00020  *  ("Utilize") this software subject to the terms herein.  With respect to the
00021  *  foregoing patent license, such license is granted solely to the extent that
00022  *  any such patent is necessary to Utilize the software alone.  The patent
00023  *  license shall not apply to any combinations which include this software,
00024  *  other than combinations with devices manufactured by or for TI (“TI
00025  *  Devices”).  No hardware patent is licensed hereunder.
00026  *
00027  *  Redistributions must preserve existing copyright notices and reproduce this
00028  *  license (including the above copyright notice and the disclaimer and (if
00029  *  applicable) source code license limitations below) in the documentation
00030  *  and/or other materials provided with the distribution
00031  *
00032  *  Redistribution and use in binary form, without modification, are permitted
00033  *  provided that the following conditions are met:
00034  *
00035  *    *  No reverse engineering, decompilation, or disassembly of this software
00036  *  is permitted with respect to any software provided in binary form.
00037  *
00038  *    *  any redistribution and use are licensed by TI for use only with TI
00039  *  Devices.
00040  *
00041  *    *  Nothing shall obligate TI to provide you with source code for the
00042  *  software licensed and provided to you in object code.
00043  *
00044  *  If software source code is provided to you, modification and redistribution
00045  *  of the source code are permitted provided that the following conditions are
00046  *  met:
00047  *
00048  *    *  any redistribution and use of the source code, including any resulting
00049  *  derivative works, are licensed by TI for use only with TI Devices.
00050  *
00051  *    *  any redistribution and use of any object code compiled from the source
00052  *  code and any resulting derivative works, are licensed by TI for use only
00053  *  with TI Devices.
00054  *
00055  *  Neither the name of Texas Instruments Incorporated nor the names of its
00056  *  suppliers may be used to endorse or promote products derived from this
00057  *  software without specific prior written permission.
00058  *
00059  *  DISCLAIMER.
00060  *
00061  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00062  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00063  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00064  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00065  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00066  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00067  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00068  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00069  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00070  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00071  *  DAMAGE.
00072  *****************************************************************************/
00073 #include "string.h"
00074 #include "stdlib.h"
00075 #include <ti/mas/types/types.h>
00076 #include <ti/mas/iface/iffax/iffax.h>
00077 #include <ti/mas/util/ecomem.h>
00078 #include <ti/mas/fm/fm.h>
00079
00080 /******************************************************************************
00081  * GLOBAL PREPROCESSOR DIRECTIVES
00082  *****************************************************************************/
00083 #define NO_TONESUPP                    TRUE /* undefine if tone support is
00084                                                desired */
00085 #undef  NO_TONESUPP
00086 #define SIU_NUMBER_OF_CHANNELS         2
00087 #define SIU_SIU_ID                     0x01
00088 #define SIU_DPU_ID                     0x02
00089 #define SIU_FM_ID                      0x03
00090
00091 #define SIU_FM_FP_MSG_COUNT            FM_FP_COUNT - 1
00092 #define SIU_FM_FP_OUT_MSG_ARRAY_SIZE   10
00093
00094 #define SIU_FP_FM_MSG_COUNT            FP_FM_COUNT - 1
00095 #define SIU_FP_FM_IN_MSG_ARRAY_SIZE    15
00096
00097 #define SIU_FM_LIN_SAMPLE_ARRAY_SIZE   80
00098
00099 #ifdef  SIMC55X
00100 #define C55X 1
00101 #endif
00102
00103 /* TESTDPUVECS will test the dpu test vectors under the ecotest directory for   */
00104 /* specific number of bits to evaluate the BER, note that only dpu Rx is useful */
00105 /* if you do not require the BER Rate test, then undef the TESTDPUVECS          */
00106 #define ONES_LIMIT 100000
00107
00108 /******************************************************************************
00109  * GLOBAL STRUCTURE AND ENUMERATION DEFINITIONS
00110  *****************************************************************************/
00111
00112 /* Global SIU instance structure */
00113 typedef struct {
00114
00115     /* FM elements */
00116     tuint         ID;            /* ID of current SIU instance */
00117     void         *fmInst;        /* FM instance pointer */
00118     ecomemBuffer_t  *fmBufs;        /* Pointer to base of FM buffer space */
00119     tint          fmNbufs;       /* Number of allocated FM buffers */
00120     tint          fm_heap_size;  /* Heap allocation for FM */
00121
00122     /* Auxiliary elements */
00123     tint          aux_heap_size; /* Auxiliary heap allocation */
00124
00125 } siuInst_t;
00126
00127 /* Global exception char enumeration */
00128 typedef enum {
00129      SIU_EXCEPTION_FM_DBG_FATAL_ERROR,
00130      SIU_EXCEPTION_FM_DBG_DEFAULT,
00131      SIU_EXCEPTION_FM_SIZES_ERR,
00132      SIU_EXCEPTION_FM_BUFS_ERR,
00133      SIU_EXCEPTION_FM_NEW_ERR,
00134      SIU_EXCEPTION_FM_OPEN_ERR
00135 } siuFatalErrorChar_e;
00136
00137 /******************************************************************************
00138  * GLOBAL FUNCTION DECLARATIONS
00139  *****************************************************************************/
00140
00141 tulong siuGetTime              (void);
00142 void   siuPcmInterface_Ch1     (void *targetInst, void *PcmData);
00143 void   siuPcmInterface_Ch2     (void *targetInst, void *PcmData);
00144 void   siuFpInterface_Ch1      (void *targetInst, void *FmFpMessage);
00145 void   siuFpInterface_Ch2      (void *targetInst, void *FmFpMessage);
00146 void   siuToneOffFax           (void *TargetInst);
00147 void   siuToneDetectCtrl       (void *siuInst, tuint ControlCode);
00148 void   siuFmDebugInfo          (void * moduleID, tuint msgType, tuint messageCode,
00149                                 tuint msgLength,  tuint *supportingData);
00150 void   siuFatalError           (tuint id, char *str);
00151 void   siu_init                (tint chnum);
00152 void   siu_init_lin_samples    (tint chnum);
00153 void   siu_init_fm_fp_messages (tint chnum);
00154 void   siu_init_fp_fm_messages (iffaxModulationTypes_e hsmod);
00155 void   siu_new_fm              (tint chnum);
00156 void   siu_open_fm             (tint chnum);
00157 void   siu_close_fm            (tint chnum);
00158 void   siu_delete_fm           (tint chnum);
00159
00160 void   UAExpand(tint       sub_segment_size,       /* subsegment size */
00161                 tword      *pcm_in,                /* input data array */
00162                 Fract      *send_out_buf_ptr_ptr,  /* address of output buffer pointer */
00163                 const tint *pcm_expand_table);     /* pointer to the A_law or U_law table */
00164
00165
00166 /* Tables used in main.c file */
00167 const tint tblUlaw[128] = {
00168    32124,  31100,  30076,  29052,  28028,  27004,  25980,  24956,
00169    23932,  22908,  21884,  20860,  19836,  18812,  17788,  16764,
00170    15996,  15484,  14972,  14460,  13948,  13436,  12924,  12412,
00171    11900,  11388,  10876,  10364,   9852,   9340,   8828,   8316,
00172     7932,   7676,   7420,   7164,   6908,   6652,   6396,   6140,
00173     5884,   5628,   5372,   5116,   4860,   4604,   4348,   4092,
00174     3900,   3772,   3644,   3516,   3388,   3260,   3132,   3004,
00175     2876,   2748,   2620,   2492,   2364,   2236,   2108,   1980,
00176     1884,   1820,   1756,   1692,   1628,   1564,   1500,   1436,
00177     1372,   1308,   1244,   1180,   1116,   1052,    988,    924,
00178      876,    844,    812,    780,    748,    716,    684,    652,
00179      620,    588,    556,    524,    492,    460,    428,    396,
00180      372,    356,    340,    324,    308,    292,    276,    260,
00181      244,    228,    212,    196,    180,    164,    148,    132,
00182      120,    112,    104,     96,     88,     80,     72,     64,
00183       56,     48,     40,     32,     24,     16,      8,      0
00184 };
00185
00186 /******************************************************************************
00187  * DATA DEFINITION: A-law expansion table
00188  ******************************************************************************
00189  * DESCRIPTION: Converts an 8-bit A-law value to its corresponding 16-bit
00190  *              int value.
00191  *
00192  *****************************************************************************/
00193
00194 const tint tblAlaw[128] = {
00195     5504,   5248,   6016,   5760,   4480,   4224,   4992,   4736,
00196     7552,   7296,   8064,   7808,   6528,   6272,   7040,   6784,
00197     2752,   2624,   3008,   2880,   2240,   2112,   2496,   2368,
00198     3776,   3648,   4032,   3904,   3264,   3136,   3520,   3392,
00199    22016,  20992,  24064,  23040,  17920,  16896,  19968,  18944,
00200    30208,  29184,  32256,  31232,  26112,  25088,  28160,  27136,
00201    11008,  10496,  12032,  11520,   8960,   8448,   9984,   9472,
00202    15104,  14592,  16128,  15616,  13056,  12544,  14080,  13568,
00203      344,    328,    376,    360,    280,    264,    312,    296,
00204      472,    456,    504,    488,    408,    392,    440,    424,
00205       88,     72,    120,    104,     24,      8,     56,     40,
00206      216,    200,    248,    232,    152,    136,    184,    168,
00207     1376,   1312,   1504,   1440,   1120,   1056,   1248,   1184,
00208     1888,   1824,   2016,   1952,   1632,   1568,   1760,   1696,
00209      688,    656,    752,    720,    560,    528,    624,    592,
00210      944,    912,   1008,    976,    816,    784,    880,    848
00211 } ;
00212
00213 #define NOC1FILES 8
00214 char TestFileNamesC1 [NOC1FILES][35] =
00215 {
00216         "V29_9600_c1_48dBrn.pcm",
00217         "V17_14400_c1_45dBrn.pcm",
00218         "V17_12000_c1_48dBrn.pcm",
00219         "V17_7200_c1_55dBrn.pcm",
00220         "V17_9600_c1_52dBrn.pcm",
00221         "V27_4800_c1_52dBrn.pcm",
00222         "V27_2400_c1_60dBrn.pcm" ,
00223         "V29_7200_c1_51dBrn.pcm"
00224 };
00225
00226 iffaxModulationTypes_e modC1[NOC1FILES] =
00227 {
00228     iffax_MODEM_MODE_V29_9600,
00229     iffax_MODEM_MODE_V17_L_14400,
00230     iffax_MODEM_MODE_V17_L_12000,
00231     iffax_MODEM_MODE_V17_L_7200,
00232     iffax_MODEM_MODE_V17_L_9600,
00233     iffax_MODEM_MODE_V27_4800,
00234     iffax_MODEM_MODE_V27_2400,
00235     iffax_MODEM_MODE_V29_7200
00236 };
00237
00238 #endif /* _FMSIM_H */
00239 /* nothing past this point */


FM Test: Data Fields

  • Data Structures
  • Data Fields
  • All
  • Variables
Here is a list of all struct and union fields with links to the structures/unions they belong to:

  • aux_heap_size : siuInst_t
  • fm_heap_size : siuInst_t
  • fmBufs : siuInst_t
  • fmInst : siuInst_t
  • fmNbufs : siuInst_t
  • ID : siuInst_t


FM Test: Data Fields - Variables

  • Data Structures
  • Data Fields
  • All
  • Variables

  • aux_heap_size : siuInst_t
  • fm_heap_size : siuInst_t
  • fmBufs : siuInst_t
  • fmInst : siuInst_t
  • fmNbufs : siuInst_t
  • ID : siuInst_t


FM Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- a -

  • ADD_NOISE : fmsim.c

- b -

  • BerCount : fmsim.c
  • bit_mask : fmsim.c
  • ByteBuf : fmsim.c

- c -

  • CAPTURE_PCM_TX : fmsim.c
  • CaptureDataLFract() : fmsim.c
  • CaptureDataShort() : fmsim.c
  • CaptureDataShort1() : fmsim.c
  • CDLoss : fmsim.c
  • CDLossInd : fmsim.c
  • CDLossTime : fmsim.c
  • CDLossTimeInd : fmsim.c
  • ch1_msg_num : fmsim.c
  • ch2_msg_num : fmsim.c
  • ClearAllGlobalVariables() : fmsim.c
  • CUSTPROB_DBG : fmsim.c

- d -

  • dpuBerMeas() : fmsim.c

- f -

  • FirstTime : fmsim.c
  • FirstTime1 : fmsim.c
  • FirstTime123 : fmsim.c
  • fmContext : fmsim.c
  • fmDebugGetFMMode() : fmDebugTraceParser.c
  • fmDebugGetFMState() : fmDebugTraceParser.c
  • fmDebugGetModulation() : fmDebugTraceParser.c
  • fmDebugTraceParser() : fmsim.c , fmDebugTraceParser.c
  • fmTablePtrs : fmsim.c
  • FpFmHsData : fmsim.c
  • FpFmLsData : fmsim.c
  • FpFmTestData : fmsim.c
  • FXM_MODE_COUNT : fmDebugTraceParser.c
  • FXM_MODE_OFF : fmDebugTraceParser.c
  • FXM_MODE_RX : fmDebugTraceParser.c
  • FXM_MODE_RX_HDLC : fmDebugTraceParser.c
  • FXM_MODE_TX : fmDebugTraceParser.c
  • FXM_MODE_TX_HDLC : fmDebugTraceParser.c
  • FxmMode_e : fmDebugTraceParser.c

- g -

  • gbindx : fmsim.c
  • GetDirectionString() : fmsim.c
  • gg_bscr_init : fmsim.c
  • gg_pmst_init : fmsim.c
  • gg_swwsr_init : fmsim.c
  • GlobalFmFpMsgOut : fmsim.c
  • GlobalFmFpMsgOutIndex1 : fmsim.c
  • GlobalFmFpMsgOutIndex2 : fmsim.c
  • GlobalFpFmMsgIn : fmsim.c
  • GlobalFpFmMsgInIndex1 : fmsim.c
  • GlobalFpFmMsgInIndex2 : fmsim.c
  • GlobalLinSample : fmsim.c

- i -

  • i : fmsim.c

- l -

  • limit_count : fmsim.c
  • LINEAR_PCM : fmsim.c
  • loop_flag : fmsim.c

- m -

  • main() : fmsim.c
  • MEAN : fmsim.c
  • ModAssoc : fmsim.c
  • modC1 : fmsim.h
  • msgString : fmDebugTraceParser.c

- n -

  • NO_TONESUPP : fmsim.h
  • NOC1FILES : fmsim.h
  • NOISELEVEL : fmsim.c

- o -

  • ONES_LIMIT : fmsim.h
  • OnesCount : fmsim.c

- p -

  • PopulateTestDataBase() : fmsim.c

- r -

  • rhrDataBufCnt : fmsim.c
  • RNGSTATE : fmsim.c
  • running : fmsim.c
  • RxCap : fmsim.c

- s -

  • SEED : fmsim.c
  • siu_close_fm() : fmsim.c , fmsim.h
  • siu_delete_fm() : fmsim.c , fmsim.h
  • SIU_DPU_ID : fmsim.h
  • SIU_EXCEPTION_FM_BUFS_ERR : fmsim.h
  • SIU_EXCEPTION_FM_DBG_DEFAULT : fmsim.h
  • SIU_EXCEPTION_FM_DBG_FATAL_ERROR : fmsim.h
  • SIU_EXCEPTION_FM_NEW_ERR : fmsim.h
  • SIU_EXCEPTION_FM_OPEN_ERR : fmsim.h
  • SIU_EXCEPTION_FM_SIZES_ERR : fmsim.h
  • SIU_FM_FP_MSG_COUNT : fmsim.h
  • SIU_FM_FP_OUT_MSG_ARRAY_SIZE : fmsim.h
  • SIU_FM_ID : fmsim.h
  • SIU_FM_LIN_SAMPLE_ARRAY_SIZE : fmsim.h
  • SIU_FP_FM_IN_MSG_ARRAY_SIZE : fmsim.h
  • SIU_FP_FM_MSG_COUNT : fmsim.h
  • siu_init() : fmsim.c , fmsim.h
  • siu_init_fm_fp_messages() : fmsim.c , fmsim.h
  • siu_init_fp_fm_messages() : fmsim.c , fmsim.h
  • siu_init_lin_samples() : fmsim.c , fmsim.h
  • siu_new_fm() : fmsim.c , fmsim.h
  • SIU_NUMBER_OF_CHANNELS : fmsim.h
  • siu_open_fm() : fmsim.c , fmsim.h
  • SIU_SIU_ID : fmsim.h
  • siuDebugString : fmsim.c
  • siuFatalError() : fmsim.c , fmsim.h
  • siuFatalErrorChar_e : fmsim.h
  • siuFatalString : fmsim.c
  • siuFmDebugInfo() : fmsim.c , fmsim.h
  • siuFmStats : fmsim.c
  • siuFpInterface_Ch1() : fmsim.c , fmsim.h
  • siuFpInterface_Ch2() : fmsim.h , fmsim.c
  • siuGetTime() : fmsim.c , fmsim.h
  • siuInst : fmsim.c
  • siuPcmInterface_Ch1() : fmsim.c , fmsim.h
  • siuPcmInterface_Ch2() : fmsim.h , fmsim.c
  • siuTermCode : fmsim.c
  • siuToneDetectCtrl() : fmsim.c , fmsim.h
  • siuToneOffFax() : fmsim.h , fmsim.c
  • siuToneOnFax() : fmsim.c
  • StatusPrintMonitor() : fmsim.c
  • systemTime : fmsim.c

- t -

  • tblAlaw : fmsim.h
  • tblUlaw : fmsim.h
  • TEST_CDL : fmsim.c
  • TESTDPUVECS : fmsim.c
  • TestFileNames : fmsim.c
  • TestFileNamesC1 : fmsim.h
  • TxCap : fmsim.c

- u -

  • UAExpand() : fmsim.c , fmsim.h

- v -

  • V17_STRAIN_TST : fmsim.c

- w -

  • wngInit() : fmsim.c


FM Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • ADD_NOISE : fmsim.c
  • CAPTURE_PCM_TX : fmsim.c
  • CUSTPROB_DBG : fmsim.c
  • LINEAR_PCM : fmsim.c
  • NO_TONESUPP : fmsim.h
  • NOC1FILES : fmsim.h
  • ONES_LIMIT : fmsim.h
  • SIU_DPU_ID : fmsim.h
  • SIU_FM_FP_MSG_COUNT : fmsim.h
  • SIU_FM_FP_OUT_MSG_ARRAY_SIZE : fmsim.h
  • SIU_FM_ID : fmsim.h
  • SIU_FM_LIN_SAMPLE_ARRAY_SIZE : fmsim.h
  • SIU_FP_FM_IN_MSG_ARRAY_SIZE : fmsim.h
  • SIU_FP_FM_MSG_COUNT : fmsim.h
  • SIU_NUMBER_OF_CHANNELS : fmsim.h
  • SIU_SIU_ID : fmsim.h
  • TEST_CDL : fmsim.c
  • TESTDPUVECS : fmsim.c
  • V17_STRAIN_TST : fmsim.c


FM Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • FxmMode_e : fmDebugTraceParser.c
  • siuFatalErrorChar_e : fmsim.h


FM Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • FXM_MODE_COUNT : fmDebugTraceParser.c
  • FXM_MODE_OFF : fmDebugTraceParser.c
  • FXM_MODE_RX : fmDebugTraceParser.c
  • FXM_MODE_RX_HDLC : fmDebugTraceParser.c
  • FXM_MODE_TX : fmDebugTraceParser.c
  • FXM_MODE_TX_HDLC : fmDebugTraceParser.c
  • SIU_EXCEPTION_FM_BUFS_ERR : fmsim.h
  • SIU_EXCEPTION_FM_DBG_DEFAULT : fmsim.h
  • SIU_EXCEPTION_FM_DBG_FATAL_ERROR : fmsim.h
  • SIU_EXCEPTION_FM_NEW_ERR : fmsim.h
  • SIU_EXCEPTION_FM_OPEN_ERR : fmsim.h
  • SIU_EXCEPTION_FM_SIZES_ERR : fmsim.h


FM Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines
  • c
  • d
  • f
  • g
  • m
  • p
  • s
  • u
  • w

- c -

  • CaptureDataLFract() : fmsim.c
  • CaptureDataShort() : fmsim.c
  • CaptureDataShort1() : fmsim.c
  • ClearAllGlobalVariables() : fmsim.c

- d -

  • dpuBerMeas() : fmsim.c

- f -

  • fmDebugGetFMMode() : fmDebugTraceParser.c
  • fmDebugGetFMState() : fmDebugTraceParser.c
  • fmDebugGetModulation() : fmDebugTraceParser.c
  • fmDebugTraceParser() : fmsim.c , fmDebugTraceParser.c

- g -

  • GetDirectionString() : fmsim.c

- m -

  • main() : fmsim.c

- p -

  • PopulateTestDataBase() : fmsim.c

- s -

  • siu_close_fm() : fmsim.c , fmsim.h
  • siu_delete_fm() : fmsim.c , fmsim.h
  • siu_init() : fmsim.c , fmsim.h
  • siu_init_fm_fp_messages() : fmsim.c , fmsim.h
  • siu_init_fp_fm_messages() : fmsim.h , fmsim.c
  • siu_init_lin_samples() : fmsim.c , fmsim.h
  • siu_new_fm() : fmsim.h , fmsim.c
  • siu_open_fm() : fmsim.h , fmsim.c
  • siuFatalError() : fmsim.c , fmsim.h
  • siuFmDebugInfo() : fmsim.c , fmsim.h
  • siuFpInterface_Ch1() : fmsim.c , fmsim.h
  • siuFpInterface_Ch2() : fmsim.c , fmsim.h
  • siuGetTime() : fmsim.c , fmsim.h
  • siuPcmInterface_Ch1() : fmsim.c , fmsim.h
  • siuPcmInterface_Ch2() : fmsim.h , fmsim.c
  • siuToneDetectCtrl() : fmsim.c , fmsim.h
  • siuToneOffFax() : fmsim.c , fmsim.h
  • siuToneOnFax() : fmsim.c
  • StatusPrintMonitor() : fmsim.c

- u -

  • UAExpand() : fmsim.c , fmsim.h

- w -

  • wngInit() : fmsim.c


FM Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines
  • b
  • c
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • r
  • s
  • t

- b -

  • BerCount : fmsim.c
  • bit_mask : fmsim.c
  • ByteBuf : fmsim.c

- c -

  • CDLoss : fmsim.c
  • CDLossInd : fmsim.c
  • CDLossTime : fmsim.c
  • CDLossTimeInd : fmsim.c
  • ch1_msg_num : fmsim.c
  • ch2_msg_num : fmsim.c

- f -

  • FirstTime : fmsim.c
  • FirstTime1 : fmsim.c
  • FirstTime123 : fmsim.c
  • fmContext : fmsim.c
  • fmTablePtrs : fmsim.c
  • FpFmHsData : fmsim.c
  • FpFmLsData : fmsim.c
  • FpFmTestData : fmsim.c

- g -

  • gbindx : fmsim.c
  • gg_bscr_init : fmsim.c
  • gg_pmst_init : fmsim.c
  • gg_swwsr_init : fmsim.c
  • GlobalFmFpMsgOut : fmsim.c
  • GlobalFmFpMsgOutIndex1 : fmsim.c
  • GlobalFmFpMsgOutIndex2 : fmsim.c
  • GlobalFpFmMsgIn : fmsim.c
  • GlobalFpFmMsgInIndex1 : fmsim.c
  • GlobalFpFmMsgInIndex2 : fmsim.c
  • GlobalLinSample : fmsim.c

- i -

  • i : fmsim.c

- l -

  • limit_count : fmsim.c
  • loop_flag : fmsim.c

- m -

  • MEAN : fmsim.c
  • ModAssoc : fmsim.c
  • modC1 : fmsim.h
  • msgString : fmDebugTraceParser.c

- n -

  • NOISELEVEL : fmsim.c

- o -

  • OnesCount : fmsim.c

- r -

  • rhrDataBufCnt : fmsim.c
  • RNGSTATE : fmsim.c
  • running : fmsim.c
  • RxCap : fmsim.c

- s -

  • SEED : fmsim.c
  • siuDebugString : fmsim.c
  • siuFatalString : fmsim.c
  • siuFmStats : fmsim.c
  • siuInst : fmsim.c
  • siuTermCode : fmsim.c
  • systemTime : fmsim.c

- t -

  • tblAlaw : fmsim.h
  • tblUlaw : fmsim.h
  • TestFileNames : fmsim.c
  • TestFileNamesC1 : fmsim.h
  • TxCap : fmsim.c


FM Test: FM Unit Test

FM Unit Test

Page Contents

  1. Description
  2. Building Unit Test
  3. Unit Test Procedures
  4. Dependent Packages

Description

This package contains a basic test for the FM. This is not a regression test, its purpose is to show how the FM module can be integrated into a system and to become familiar with the external API. The package also provides a means to experiment with changes to the configuration and observe the operational effect(s).

Building Unit Test

The FM Unit Test package can be compiled in the following manners:

  1. Apply the GNU Makefile build procedure to the test package.
  2. Load the FM Unit Test project into CCSV5 and build. All projects will reside in the fm\test\ccsProjects directory.

Notes:
  1. The GNU Makefile build procedure is described in detail in the main FM documentation.

Unit Test Procedures

The FM Unit Test package comes complete with a compiled CCS Project as well as a directly loadable test image. If the unit test code has been altered or enhanced, the Building Unit Test procedure above should be completed before moving forward.

Unit Test Image

The procedure to test using the unit test image is described below. Note that this procedure does not require CCS version 5.2 or above and may be used for those who haven't yet upgraded to CCS v5.2 or above.

  1. Open CCS
  2. Load the FM Unit Test image for the target of interest
    • Will reside in the fm\test\lnkr\<targ> directory
    • Will have the extension *.x<target>
  3. Run to the main() symbol
  4. Follow the Unit Test Configuration and Execution procedure

Unit Test Project

The procedure to test using the CCS project is described below. Note that this procedure requires CCS version 5.2 or above (Eclipse).

  1. Open CCS version 5.2 or above
  2. Load the FM project for the target of interest
    • Will be a subdirectory off the fm\test\ directory
    • Can be identified using the CCS menu options "Project"-->"Import Existing CCS/CCE Eclipse Project" and browsing the fm\test\ directory.
    • (Optional) Rebuild the project
  3. Open the proper Debug Target Configuration and load the build
    • Can be identified using the CCS menu options "Target"-->"Load Program" and selecting the "Browse Projects" button
    • (Optional) Run to the main() symbol
  4. Follow the Unit Test Configuration and Execution procedure

Dependent Packages

  • ti.mas.types (Common data type defintions)
  • ti.mas.util (Common utilities)
  • ti.mas.fm (Fax Modem API)
  • ti.mas.swtools (to build software)


FM Test: Page Index

FM Test Related Pages

Here is a list of all related documentation pages:
  • Unit Test Configuration and Execution


FM Test: siuInst_t Struct Reference

  • Data Structures
  • Data Fields

siuInst_t Struct Reference

#include <fmsim.h>

Detailed Description

Definition at line 113 of file fmsim.h.

Data Fields

tuint | ID
void * | fmInst
ecomemBuffer_t * | fmBufs
tint | fmNbufs
tint | fm_heap_size
tint | aux_heap_size

Field Documentation

tuint siuInst_t::ID

Definition at line 116 of file fmsim.h.

Referenced by siu_init().

void* siuInst_t::fmInst

Definition at line 117 of file fmsim.h.

Referenced by siu_close_fm(), siu_delete_fm(), siu_init(), siu_new_fm(), and siu_open_fm().

ecomemBuffer_t* siuInst_t::fmBufs

Definition at line 118 of file fmsim.h.

Referenced by siu_delete_fm(), siu_init(), and siu_new_fm().

tint siuInst_t::fmNbufs

Definition at line 119 of file fmsim.h.

Referenced by siu_delete_fm(), siu_init(), and siu_new_fm().

tint siuInst_t::fm_heap_size

Definition at line 120 of file fmsim.h.

Referenced by siu_delete_fm(), siu_init(), and siu_new_fm().

tint siuInst_t::aux_heap_size

Definition at line 123 of file fmsim.h.

Referenced by siu_delete_fm(), siu_init(), and siu_new_fm().

The documentation for this struct was generated from the following file:
  • fmsim.h


HDLC: Version.h File Reference

  • File List
  • Globals

Version.h File Reference

Go to the source code of this file.

Defines

#define | ti_mas_hdlc_Version__top__
#define | __extern extern
#define | ti_mas_hdlc_Version___VERS 150
#define | ti_mas_hdlc_Version_MAJOR (3)
#define | ti_mas_hdlc_Version_MINOR (1)
#define | ti_mas_hdlc_Version_XVERTICAL (0)
#define | ti_mas_hdlc_Version_PATCH (0)
#define | ti_mas_hdlc_Version_BUILD (2)
#define | ti_mas_hdlc_Version_QUALITY (3)
#define | ti_mas_hdlc_Version_BTYPE (0)
#define | ti_mas_hdlc_Version_WIDTH (0)
#define | Version_MAJOR ti_mas_hdlc_Version_MAJOR
#define | Version_MINOR ti_mas_hdlc_Version_MINOR
#define | Version_XVERTICAL ti_mas_hdlc_Version_XVERTICAL
#define | Version_PATCH ti_mas_hdlc_Version_PATCH
#define | Version_BUILD ti_mas_hdlc_Version_BUILD
#define | Version_QUALITY ti_mas_hdlc_Version_QUALITY
#define | Version_BTYPE ti_mas_hdlc_Version_BTYPE
#define | Version_WIDTH ti_mas_hdlc_Version_WIDTH

Define Documentation

#define ti_mas_hdlc_Version__top__

Definition at line 27 of file Version.h.

#define __extern extern

Definition at line 33 of file Version.h.

#define ti_mas_hdlc_Version___VERS 150

Definition at line 36 of file Version.h.

#define ti_mas_hdlc_Version_MAJOR (3)

Definition at line 50 of file Version.h.

#define ti_mas_hdlc_Version_MINOR (1)

Definition at line 53 of file Version.h.

#define ti_mas_hdlc_Version_XVERTICAL (0)

Definition at line 56 of file Version.h.

#define ti_mas_hdlc_Version_PATCH (0)

Definition at line 59 of file Version.h.

#define ti_mas_hdlc_Version_BUILD (2)

Definition at line 62 of file Version.h.

#define ti_mas_hdlc_Version_QUALITY (3)

Definition at line 65 of file Version.h.

#define ti_mas_hdlc_Version_BTYPE (0)

Definition at line 68 of file Version.h.

#define ti_mas_hdlc_Version_WIDTH (0)

Definition at line 71 of file Version.h.

#define Version_MAJOR ti_mas_hdlc_Version_MAJOR

Definition at line 90 of file Version.h.

#define Version_MINOR ti_mas_hdlc_Version_MINOR

Definition at line 91 of file Version.h.

#define Version_XVERTICAL ti_mas_hdlc_Version_XVERTICAL

Definition at line 92 of file Version.h.

#define Version_PATCH ti_mas_hdlc_Version_PATCH

Definition at line 93 of file Version.h.

#define Version_BUILD ti_mas_hdlc_Version_BUILD

Definition at line 94 of file Version.h.

#define Version_QUALITY ti_mas_hdlc_Version_QUALITY

Definition at line 95 of file Version.h.

#define Version_BTYPE ti_mas_hdlc_Version_BTYPE

Definition at line 96 of file Version.h.

#define Version_WIDTH ti_mas_hdlc_Version_WIDTH

Definition at line 97 of file Version.h.


HDLC: Version.h Source File

  • File List
  • Globals

Version.h

Go to the documentation of this file.
00001 /*
00002  *  Do not modify this file; it is automatically
00003  *  generated and any modifications will be overwritten.
00004  *
00005  * @(#) xdc-t35
00006  */
00007
00008 /*
00009  * ======== GENERATED SECTIONS ========
00010  *
00011  *     PROLOGUE
00012  *     INCLUDES
00013  *     EPILOGUE
00014  *     PREFIX ALIASES
00015  */
00016
00017
00018 /*
00019  * ======== PROLOGUE ========
00020  */
00021
00022 #ifndef ti_mas_hdlc_Version__include
00023 #define ti_mas_hdlc_Version__include
00024
00025 #ifndef __nested__
00026 #define __nested__
00027 #define ti_mas_hdlc_Version__top__
00028 #endif
00029
00030 #ifdef __cplusplus
00031 #define __extern extern "C"
00032 #else
00033 #define __extern extern
00034 #endif
00035
00036 #define ti_mas_hdlc_Version___VERS 150
00037
00038
00039 /*
00040  * ======== INCLUDES ========
00041  */
00042
00043
00044
00045 /*
00046  * ======== AUXILIARY DEFINITIONS ========
00047  */
00048
00049 /* MAJOR */
00050 #define ti_mas_hdlc_Version_MAJOR (3)
00051
00052 /* MINOR */
00053 #define ti_mas_hdlc_Version_MINOR (1)
00054
00055 /* XVERTICAL */
00056 #define ti_mas_hdlc_Version_XVERTICAL (0)
00057
00058 /* PATCH */
00059 #define ti_mas_hdlc_Version_PATCH (0)
00060
00061 /* BUILD */
00062 #define ti_mas_hdlc_Version_BUILD (2)
00063
00064 /* QUALITY */
00065 #define ti_mas_hdlc_Version_QUALITY (3)
00066
00067 /* BTYPE */
00068 #define ti_mas_hdlc_Version_BTYPE (0)
00069
00070 /* WIDTH */
00071 #define ti_mas_hdlc_Version_WIDTH (0)
00072
00073 /*
00074  * ======== EPILOGUE ========
00075  */
00076
00077 #ifdef ti_mas_hdlc_Version__top__
00078 #undef __nested__
00079 #endif
00080
00081 #endif /* ti_mas_hdlc_Version__include */
00082
00083 /*
00084  * ======== PREFIX ALIASES ========
00085  */
00086
00087 #if !defined(__nested__) && !defined(ti_mas_hdlc_Version__nolocalnames)
00088
00089 /* module prefix */
00090 #define Version_MAJOR      ti_mas_hdlc_Version_MAJOR
00091 #define Version_MINOR      ti_mas_hdlc_Version_MINOR
00092 #define Version_XVERTICAL  ti_mas_hdlc_Version_XVERTICAL
00093 #define Version_PATCH      ti_mas_hdlc_Version_PATCH
00094 #define Version_BUILD      ti_mas_hdlc_Version_BUILD
00095 #define Version_QUALITY    ti_mas_hdlc_Version_QUALITY
00096 #define Version_BTYPE      ti_mas_hdlc_Version_BTYPE
00097 #define Version_WIDTH      ti_mas_hdlc_Version_WIDTH
00098 #endif


HDLC: Data Structures

  • Data Structures
  • Data Fields

HDLC Data Structures

Here are the data structures with brief descriptions:
hdlcRxInit_t | HDLC RX initialization structure
hdlcRxInst_t | HDLC RX processing instance structure
hdlcTxInit_t | HDLC TX initialization structure
hdlcTxInst_t | HDLC TX processing instance structure


HDLC: C55x Data Sheet

C55x Data Sheet

Copyright 2013, Texas Instruments Incorporated


HDLC: C64x+ Data Sheet

C64x+ Data Sheet

Copyright 2013, Texas Instruments Incorporated


HDLC:

IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.

TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed.

TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards.

TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.

Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation.

Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.

Mailing Address:
Texas Instruments
Post Office Box 655303
Dallas, Texas 75265

Copyright © 2006 Texas Instruments Incorporated. All rights reserved.

Information in this document is subject to change without notice. Texas Instruments may have pending patent applications, trademarks, copyrights, or other intellectual property rights covering matter in this document. The furnishing of this document is given for usage with Texas Instruments products only and does not give you any license to the intellectual property that might be contained within this document. Texas Instruments makes no implied or expressed warranties in this document and is not responsible for the products based from this document.


HDLC: doxygen.h File Reference

  • File List
  • Globals

doxygen.h File Reference

Go to the source code of this file.


HDLC: doxygen.h Source File

  • File List
  • Globals

doxygen.h

Go to the documentation of this file.
00001 /*
00002  * This is a template header file which doxygen parses to generate the main
00003  * documentation page
00004  */
00005


HDLC: HDLC External API

HDLC (High-level Data Link Control) Package

HDLC External API

The HDLC software is partitioned into transmitter and receiver modules.
  • HDLC Receiver
  • HDLC Transmitter


HDLC: File Index

  • File List
  • Globals

HDLC File List

Here is a list of all files with brief descriptions:
doxygen.h [code]
hdlcfcs.c [code]
hdlcrx.c [code] | The HDLC RX module decodes HDLC data stream into data frames
hdlcrx.h [code] | This file declares function prototypes and the instance for the HDLC RX (decoding) processing routines
hdlctx.c [code] | The HDLC TX module encodes data stream to HDLC frames
hdlctx.h [code] | Declare Function Prototypes and Type definitions for HDLC Transmit processing


HDLC: Data Fields

  • Data Structures
  • Data Fields
  • All
  • Variables
  • c
  • d
  • e
  • f
  • m
  • o
  • s

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- c -

  • currOctet : hdlcRxInst_t , hdlcTxInst_t
  • currOctetBitCnt : hdlcTxInst_t

- d -

  • dataBufBitCnt : hdlcRxInst_t
  • dataBufBitSize : hdlcRxInst_t
  • dataBufByteCnt : hdlcTxInst_t
  • dataBufByteSize : hdlcTxInst_t
  • dataBufCnt : hdlcTxInst_t , hdlcRxInst_t
  • dataBufCurr : hdlcTxInst_t , hdlcRxInst_t
  • dataByteCnt : hdlcRxInst_t
  • dataFcs : hdlcRxInst_t
  • dataRegister : hdlcRxInst_t
  • dataRegisterBitCnt : hdlcRxInst_t
  • decodedDataBigEndian : hdlcTxInit_t , hdlcRxInit_t
  • decodedDataBytePerWord : hdlcRxInst_t , hdlcTxInst_t , hdlcRxInit_t , hdlcTxInit_t

- e -

  • encodedDataBigEndian : hdlcRxInit_t , hdlcTxInit_t
  • encodedDataBytePerWord : hdlcRxInit_t , hdlcTxInit_t , hdlcTxInst_t
  • encodedDataSizeBits : hdlcRxInst_t

- f -

  • fcs : hdlcTxInst_t
  • flagsCnt : hdlcTxInst_t

- m -

  • minFlagsCnt : hdlcTxInit_t , hdlcTxInst_t

- o -

  • oneCnt : hdlcTxInst_t

- s -

  • state : hdlcRxInst_t
  • status : hdlcTxInst_t


HDLC: Data Fields - Variables

  • Data Structures
  • Data Fields
  • All
  • Variables
  • c
  • d
  • e
  • f
  • m
  • o
  • s

- c -

  • currOctet : hdlcRxInst_t , hdlcTxInst_t
  • currOctetBitCnt : hdlcTxInst_t

- d -

  • dataBufBitCnt : hdlcRxInst_t
  • dataBufBitSize : hdlcRxInst_t
  • dataBufByteCnt : hdlcTxInst_t
  • dataBufByteSize : hdlcTxInst_t
  • dataBufCnt : hdlcTxInst_t , hdlcRxInst_t
  • dataBufCurr : hdlcTxInst_t , hdlcRxInst_t
  • dataByteCnt : hdlcRxInst_t
  • dataFcs : hdlcRxInst_t
  • dataRegister : hdlcRxInst_t
  • dataRegisterBitCnt : hdlcRxInst_t
  • decodedDataBigEndian : hdlcTxInit_t , hdlcRxInit_t
  • decodedDataBytePerWord : hdlcRxInst_t , hdlcTxInst_t , hdlcRxInit_t , hdlcTxInit_t

- e -

  • encodedDataBigEndian : hdlcRxInit_t , hdlcTxInit_t
  • encodedDataBytePerWord : hdlcRxInit_t , hdlcTxInit_t , hdlcTxInst_t
  • encodedDataSizeBits : hdlcRxInst_t

- f -

  • fcs : hdlcTxInst_t
  • flagsCnt : hdlcTxInst_t

- m -

  • minFlagsCnt : hdlcTxInit_t , hdlcTxInst_t

- o -

  • oneCnt : hdlcTxInst_t

- s -

  • state : hdlcRxInst_t
  • status : hdlcTxInst_t


HDLC: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines
  • _
  • h
  • t
  • v
  • w

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- _ -

  • __extern : Version.h

- h -

  • hdlc_FLAG_PATTERN : hdlctx.h
  • hdlc_IDLE_PATTERN : hdlctx.h
  • HDLC_INIT_FCS : hdlcrx.c
  • hdlc_RX_BUFFER_END : hdlcrx.h
  • HDLC_RX_DEBUG : hdlcrx.c
  • hdlc_RX_FRAME_ABORT : hdlcrx.h
  • hdlc_RX_FRAME_BAD : hdlcrx.h
  • hdlc_RX_FRAME_DATA : hdlcrx.h
  • hdlc_RX_FRAME_END : hdlcrx.h
  • hdlc_RX_FRAME_FLAGS : hdlcrx.h
  • hdlc_RX_FRAME_GOOD : hdlcrx.h
  • hdlc_RX_FRAME_NONALIGN : hdlcrx.h
  • hdlc_RX_STATE_DATA : hdlcrx.h
  • hdlc_RX_STATE_IDLE : hdlcrx.h
  • hdlc_TX_ABORT_BYTE : hdlctx.c
  • hdlc_TX_BITSTUFF_CNT : hdlctx.c
  • hdlc_TX_BYTE_SIZE : hdlctx.c
  • hdlc_TX_CONTINUE : hdlctx.h
  • hdlc_TX_ERROR : hdlctx.h
  • hdlc_TX_FCS_INIT : hdlctx.c
  • hdlc_TX_FLAGS_BYTE : hdlctx.c
  • hdlc_TX_FRAME_DATA : hdlctx.h
  • hdlc_TX_FRAME_FCS : hdlctx.h
  • hdlc_TX_FRAME_FLAGS : hdlctx.h
  • hdlc_TX_LSB_MASK : hdlctx.c
  • hdlc_TX_MIN_FLAG_CNT : hdlctx.c
  • hdlc_TX_MSB_MASK : hdlctx.c
  • hdlcFcsTable : hdlctx.c , hdlcfcs.c , hdlcrx.c
  • hdlcRx() : hdlcrx.h , hdlcrx.c
  • hdlcRxConfig() : hdlcrx.h , hdlcrx.c
  • hdlcRxInit() : hdlcrx.h , hdlcrx.c
  • hdlcRxState_e : hdlcrx.h
  • hdlcTxAbort() : hdlctx.c , hdlctx.h
  • hdlcTxConfig() : hdlctx.h , hdlctx.c
  • hdlcTxData() : hdlctx.h , hdlctx.c
  • hdlcTxFcs() : hdlctx.c , hdlctx.h
  • hdlcTxFlags() : hdlctx.c , hdlctx.h
  • hdlcTxInit() : hdlctx.c , hdlctx.h

- t -

  • ti_mas_hdlc_Version___VERS : Version.h
  • ti_mas_hdlc_Version__top__ : Version.h
  • ti_mas_hdlc_Version_BTYPE : Version.h
  • ti_mas_hdlc_Version_BUILD : Version.h
  • ti_mas_hdlc_Version_MAJOR : Version.h
  • ti_mas_hdlc_Version_MINOR : Version.h
  • ti_mas_hdlc_Version_PATCH : Version.h
  • ti_mas_hdlc_Version_QUALITY : Version.h
  • ti_mas_hdlc_Version_WIDTH : Version.h
  • ti_mas_hdlc_Version_XVERTICAL : Version.h
  • TYP_WORD_SIZE_HDLC : hdlcrx.c

- v -

  • Version_BTYPE : Version.h
  • Version_BUILD : Version.h
  • Version_MAJOR : Version.h
  • Version_MINOR : Version.h
  • Version_PATCH : Version.h
  • Version_QUALITY : Version.h
  • Version_WIDTH : Version.h
  • Version_XVERTICAL : Version.h

- w -

  • WORD_MASK : hdlcrx.c


HDLC: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines
  • _
  • h
  • t
  • v
  • w

- _ -

  • __extern : Version.h

- h -

  • hdlc_FLAG_PATTERN : hdlctx.h
  • hdlc_IDLE_PATTERN : hdlctx.h
  • HDLC_INIT_FCS : hdlcrx.c
  • hdlc_RX_BUFFER_END : hdlcrx.h
  • HDLC_RX_DEBUG : hdlcrx.c
  • hdlc_RX_FRAME_ABORT : hdlcrx.h
  • hdlc_RX_FRAME_BAD : hdlcrx.h
  • hdlc_RX_FRAME_DATA : hdlcrx.h
  • hdlc_RX_FRAME_END : hdlcrx.h
  • hdlc_RX_FRAME_FLAGS : hdlcrx.h
  • hdlc_RX_FRAME_GOOD : hdlcrx.h
  • hdlc_RX_FRAME_NONALIGN : hdlcrx.h
  • hdlc_TX_ABORT_BYTE : hdlctx.c
  • hdlc_TX_BITSTUFF_CNT : hdlctx.c
  • hdlc_TX_BYTE_SIZE : hdlctx.c
  • hdlc_TX_CONTINUE : hdlctx.h
  • hdlc_TX_ERROR : hdlctx.h
  • hdlc_TX_FCS_INIT : hdlctx.c
  • hdlc_TX_FLAGS_BYTE : hdlctx.c
  • hdlc_TX_FRAME_DATA : hdlctx.h
  • hdlc_TX_FRAME_FCS : hdlctx.h
  • hdlc_TX_FRAME_FLAGS : hdlctx.h
  • hdlc_TX_LSB_MASK : hdlctx.c
  • hdlc_TX_MIN_FLAG_CNT : hdlctx.c
  • hdlc_TX_MSB_MASK : hdlctx.c

- t -

  • ti_mas_hdlc_Version___VERS : Version.h
  • ti_mas_hdlc_Version__top__ : Version.h
  • ti_mas_hdlc_Version_BTYPE : Version.h
  • ti_mas_hdlc_Version_BUILD : Version.h
  • ti_mas_hdlc_Version_MAJOR : Version.h
  • ti_mas_hdlc_Version_MINOR : Version.h
  • ti_mas_hdlc_Version_PATCH : Version.h
  • ti_mas_hdlc_Version_QUALITY : Version.h
  • ti_mas_hdlc_Version_WIDTH : Version.h
  • ti_mas_hdlc_Version_XVERTICAL : Version.h
  • TYP_WORD_SIZE_HDLC : hdlcrx.c

- v -

  • Version_BTYPE : Version.h
  • Version_BUILD : Version.h
  • Version_MAJOR : Version.h
  • Version_MINOR : Version.h
  • Version_PATCH : Version.h
  • Version_QUALITY : Version.h
  • Version_WIDTH : Version.h
  • Version_XVERTICAL : Version.h

- w -

  • WORD_MASK : hdlcrx.c


HDLC: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • hdlcRxState_e : hdlcrx.h


HDLC: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • hdlc_RX_STATE_DATA : hdlcrx.h
  • hdlc_RX_STATE_IDLE : hdlcrx.h


HDLC: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • hdlcRx() : hdlcrx.h , hdlcrx.c
  • hdlcRxConfig() : hdlcrx.c , hdlcrx.h
  • hdlcRxInit() : hdlcrx.h , hdlcrx.c
  • hdlcTxAbort() : hdlctx.h , hdlctx.c
  • hdlcTxConfig() : hdlctx.h , hdlctx.c
  • hdlcTxData() : hdlctx.h , hdlctx.c
  • hdlcTxFcs() : hdlctx.c , hdlctx.h
  • hdlcTxFlags() : hdlctx.h , hdlctx.c
  • hdlcTxInit() : hdlctx.c , hdlctx.h


HDLC: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Defines

  • hdlcFcsTable : hdlcfcs.c , hdlctx.c , hdlcrx.c


HDLC: HDLC Fill Pattern

HDLC Fill Pattern
[HDLC Transmitter]

Collaboration diagram for HDLC Fill Pattern:

Defines

#define | hdlc_FLAG_PATTERN 0x7E
hdlc flag sequence
#define | hdlc_IDLE_PATTERN 0xFF
hdlc idle sequence

Define Documentation

#define hdlc_FLAG_PATTERN 0x7E

hdlc flag sequence

Definition at line 130 of file hdlctx.h.

#define hdlc_IDLE_PATTERN 0xFF

hdlc idle sequence

Definition at line 135 of file hdlctx.h.


HDLC: HDLC Receiver

HDLC Receiver

Collaboration diagram for HDLC Receiver:

Detailed Description

The HDLC RX module decodes the HDLC data passed to it. The data is decoded using the following steps:
  1. The HDLC RX instance is initialized by calling the hdlcRxInit() function which initializes the HDLC RX module state and the some counters. The HDLC RX also configures the module to decode data packed in different formats (packed or unpacked). The HDLC RX can also be configured for the option of not computing the CRC.
  2. A pointer to the encoded data and the number of bytes of encoded data is passed to the HDLC RX module by calling the hdlcRxConfig() function. The pointer and the size of the data buffer are saved inside HDLC RX instance. The size of the data buffer is stored as one less then the number of bits of data in the buffer. For a 16 byte buffer. The buffer size will be (16 * 8) – 1 = 127.
  3. The hdlcRx() is called to decode the data passed to the HDLC RX module. The location of a buffer where the decoded data is to be saved in passed as a parameter. The processing performed for decoding is discussed in detail in the following sub-section. The hdlcRx() function returns a status when it detects one of the following conditions:
    • Detects an end of data frame. It also reports if the frame had a good CRC or a bad CRC, if a CRC option is used.
    • Detects a frame abort in the middle of a frame. A frame abort detected before one byte of data has been decoded is not reported.
    • All data passed to the HDLC RX module has been decoded.

HDLC RX Processing

The data processing is performed in one of the states listed below until all data passed to HDLC RX has been processed. The following sub-sections describe the implementation details and notes that are intended as a reference.

IDLE STATE

The HDLC RX processing is performed in IDLE state when an abort sequence is detected. The remaining data is searched for a flag. Once a flag is detected, the state is changed to DATA.

DATA STATE

The HDLC frame data is decoded in this state. The HDLC encoded data format requires a ‘0’ fill bit insertion after a five ‘1’ bits. A string of six ‘1’ bits can be a flag. A string of seven ‘1’ bits or more is the abort sequence. Thus while decoding data, we can process seven bits at one time and check them if there is any fill bit, or if it is a flag or an abort sequence. Instead of processing one bit at a time, which can be MIPS intensive, we first look at the data processed during the previous iteration and determine the number of ones in the last six bits as shown in the figure below:
The maximum number of ‘1’ bit count can be six. If we had more then six consecutive ‘1’ bits during last iteration that would be an abort condition resulting in change of state to IDLE. For example, if the number of ‘1’ bits is three, we can process the next three bits during this iteration.
Once we have the bits that are to be processed, we remove fill bits, if there are five consecutive ‘1’ bits. The data bits are shifted into a 32-bit register, which is used to save the current byte of data and the previous two bytes of data that have been decoded. The reason for saving the previous two bytes of data is that the last two bytes of each HDLC frame constitute the frame checksum. These last two bytes are not passed to the outside and are used to check for correct CRC only.
If a flag is detected, we check if we have received a complete byte. In other words, if we detect a flag and the frame data has some partial bits, it is considered a bad frame if it has more then two bytes of decoded data. If the frame has less then two bytes of decoded data, we ignore that frame since it has not been reported to the outside as if it was not detected.
If a flag is not detected and we decode a byte of data, we compute the CRC and continue accumulating the byte in the 32-bit register. When we have three bytes of data we start saving the data one byte at a time to the external buffer.

Modules

HDLC Rx status

Data Structures

struct | hdlcRxInit_t
HDLC RX initialization structure. More...
struct | hdlcRxInst_t
HDLC RX processing instance structure. More...

HDLC Rx API

void | hdlcRxInit (hdlcRxInst_t *inst, hdlcRxInit_t *init)
This function initializes an instance of the HDLC receiver module.
void | hdlcRxConfig (hdlcRxInst_t *inst, tword *data, tuint size)
This function configures HDLC receiver to process data from a buffer passed to it.
tuint | hdlcRx (hdlcRxInst_t *inst, tword *dst, tuint *dst_cnt, tuint max_size)
This function performs de-stuffing and FCS computation of the received data.

Enumerations

enum | hdlcRxState_e { hdlc_RX_STATE_DATA, hdlc_RX_STATE_IDLE }
HDLC RX state definitions. More...

Variables

tint | hdlcRxInit_t::decodedDataBytePerWord
tbool | hdlcRxInit_t::encodedDataBigEndian
tbool | hdlcRxInit_t::decodedDataBigEndian
tint | hdlcRxInst_t::dataBufBitCnt
tword * | hdlcRxInst_t::dataBufCurr
tword | hdlcRxInst_t::currOctet
tulong | hdlcRxInst_t::dataRegister
tuint | hdlcRxInst_t::state
tint | hdlcRxInst_t::dataRegisterBitCnt
tint | hdlcRxInst_t::dataByteCnt
tuint | hdlcRxInst_t::dataFcs
tint | hdlcRxInst_t::encodedDataSizeBits
tint | hdlcRxInst_t::decodedDataBytePerWord
tuint | hdlcRxInst_t::dataBufCnt

Enumeration Type Documentation

enum hdlcRxState_e

HDLC RX state definitions.

Enumerator:
hdlc_RX_STATE_DATA | decoding data and flags
hdlc_RX_STATE_IDLE | looking for start of a new data frame

Definition at line 151 of file hdlcrx.h.

Function Documentation

void hdlcRxInit | ( | hdlcRxInst_t * | inst,
 |  | hdlcRxInit_t * | init
 | ) |  |

This function initializes an instance of the HDLC receiver module.

Remarks:
It must be called before calling other HDLC receive processing routines.
Parameters:
[in] | init | Pointer to HDLC Rx init Structure.
[in,out] | inst | Pointer to HDLC Rx instance.

Definition at line 152 of file hdlcrx.c.

References hdlcRxInst_t::currOctet, hdlcRxInst_t::dataBufCnt, hdlcRxInst_t::decodedDataBytePerWord, hdlcRxInit_t::decodedDataBytePerWord, hdlcRxInit_t::encodedDataBytePerWord, hdlcRxInst_t::encodedDataSizeBits, hdlc_RX_STATE_IDLE, and hdlcRxInst_t::state.

void hdlcRxConfig | ( | hdlcRxInst_t * | inst,
 |  | tword * | data,
 |  | tuint | size
 | ) |  |

This function configures HDLC receiver to process data from a buffer passed to it.

Parameters:
[in] | size | The number of data bytes to be processed by the HDLC receiver
[in] | data | The address of the data buffer to be processed by the HDLC receiver
[in,out] | inst | Pointer to HDLC Rx instance.

Definition at line 169 of file hdlcrx.c.

References hdlcRxInst_t::dataBufBitCnt, hdlcRxInst_t::dataBufBitSize, hdlcRxInst_t::dataBufCnt, hdlcRxInst_t::dataBufCurr, and TYP_WORD_SIZE_HDLC.

tuint hdlcRx | ( | hdlcRxInst_t * | inst,
 |  | tword * | dst,
 |  | tuint * | dst_cnt,
 |  | tuint | max_size
 | ) |  |

This function performs de-stuffing and FCS computation of the received data.

The HDLC processing function provides the following functionality that is used to decode the HDLC data frames

  • De-formatting receive data
  • Flag detection
  • Zero-bit deletion
  • FCS checking
  • Abort detection

Parameters:
[in,out] | dst | The address of the data buffer where the decoded data will be saved
[in,out] | dst_cnt | The address of the variable which is incremented by one each time a byte is decoded and copied to the 'dst' buffer.
[in] | max_size | Maximum number of bytes that can be decoded.
[in,out] | inst | Pointer to HDLC Rx instance.
Return values:
Returns HDLC Rx status

Definition at line 198 of file hdlcrx.c.

References hdlcRxInst_t::currOctet, hdlcRxInst_t::dataBufBitCnt, hdlcRxInst_t::dataBufBitSize, hdlcRxInst_t::dataBufCnt, hdlcRxInst_t::dataBufCurr, hdlcRxInst_t::dataByteCnt, hdlcRxInst_t::dataFcs, hdlcRxInst_t::dataRegister, hdlcRxInst_t::dataRegisterBitCnt, HDLC_INIT_FCS, hdlc_RX_BUFFER_END, hdlc_RX_FRAME_ABORT, hdlc_RX_FRAME_BAD, hdlc_RX_FRAME_DATA, hdlc_RX_FRAME_END, hdlc_RX_FRAME_FLAGS, hdlc_RX_FRAME_GOOD, hdlc_RX_STATE_DATA, hdlc_RX_STATE_IDLE, hdlcFcsTable, hdlcRxInst_t::state, TYP_WORD_SIZE_HDLC, and WORD_MASK.

Variable Documentation

tint hdlcRxInit_t::decodedDataBytePerWord [inherited]

Size of the decoded data word (1 or 2 bytes per word

Definition at line 141 of file hdlcrx.h.

Referenced by hdlcRxInit().

tbool hdlcRxInit_t::encodedDataBigEndian [inherited]

TRUE for big-endian byte notation.
FALSE for little-endian byte notation.

Definition at line 142 of file hdlcrx.h.

tbool hdlcRxInit_t::decodedDataBigEndian [inherited]

TRUE for big-endian byte notation.
FALSE for little-endian byte notation.

Definition at line 144 of file hdlcrx.h.

tint hdlcRxInst_t::dataBufBitCnt [inherited]

number of bits decoded so far

Definition at line 169 of file hdlcrx.h.

Referenced by hdlcRx(), and hdlcRxConfig().

tword* hdlcRxInst_t::dataBufCurr [inherited]

pointer to the location in the buffer being decoded

Definition at line 171 of file hdlcrx.h.

Referenced by hdlcRx(), and hdlcRxConfig().

tword hdlcRxInst_t::currOctet [inherited]

contains the bits we are or have been processing recently

Definition at line 173 of file hdlcrx.h.

Referenced by hdlcRx(), and hdlcRxInit().

tulong hdlcRxInst_t::dataRegister [inherited]

32 bit register with the decoded data bytes

Definition at line 175 of file hdlcrx.h.

Referenced by hdlcRx().

tuint hdlcRxInst_t::state [inherited]

current receive processing state

Definition at line 177 of file hdlcrx.h.

Referenced by hdlcRx(), and hdlcRxInit().

tint hdlcRxInst_t::dataRegisterBitCnt [inherited]

counts the number of bits of data in the dataRegister

Definition at line 179 of file hdlcrx.h.

Referenced by hdlcRx().

tint hdlcRxInst_t::dataByteCnt [inherited]

counts the number of bytes decoded so far

Definition at line 181 of file hdlcrx.h.

Referenced by hdlcRx().

tuint hdlcRxInst_t::dataFcs [inherited]

records the fcs we have computed so far

Definition at line 183 of file hdlcrx.h.

Referenced by hdlcRx().

tint hdlcRxInst_t::encodedDataSizeBits [inherited]

size of the encoded data word

Definition at line 185 of file hdlcrx.h.

Referenced by hdlcRxInit().

tint hdlcRxInst_t::decodedDataBytePerWord [inherited]

size of the decoded data word

Definition at line 187 of file hdlcrx.h.

Referenced by hdlcRxInit().

tuint hdlcRxInst_t::dataBufCnt [inherited]

byte offset is now included in the instance

Definition at line 189 of file hdlcrx.h.

Referenced by hdlcRx(), hdlcRxConfig(), and hdlcRxInit().


HDLC: HDLC Transmitter

HDLC Transmitter

Collaboration diagram for HDLC Transmitter:

Detailed Description

The HDLCTX module encodes the given data passed to it and stores the encoded data in a location provided. The data is encoded using the following steps:
  1. The HDLC TX instance is initialized by calling the hdlcTxInit() function which initializes the HDLC TX module state and the some counters. It configures the module to encode data packed in different formats (packed or unpacked). The HDLC TX can also be configured for the option of not computing the CRC.
  2. A pointer to the location of buffer where the encoded data will be placed and the number of bytes of encoded data is passed to the HDLC TX module by calling the hdlcTxConfig() function. The pointer and the size of the data buffer are saved inside HDLC TX instance.
  3. The hdlcTxData() is called to encode the data and save it the the buffer provided during configuration. The location of a buffer, which has the data to be encoded is passed as a parameter. The processing performed for encoding is discussed in detail in the following sub-section. The hdlcTx() function returns a status when it detects one of the following conditions:
    • Encoded all data that was provided.
    • The data buffer provided for encoded data is full.
  4. The hdlcTxFcs() function is called to append a CRC to the encoded data buffer.
  5. The hdlcTxAbort() function is called to append the abort sequence to the encoded data buffer.

HDLC TX Processing

For HDLC TX processing, we go through a ‘while’ loop until we have completely filled the buffer provided for the encoded data.
The encoded data is kept in a 32-bit register, during each iteration, we first check if we have more then eight bits of data in the register. If yes, we extract one byte from the register and save it in the location provided, and then go back to the beginning of the loop again. Once we have less then eight bits, we begin encoding data. The encoding of the data is performed according to the state. In DATA state, we check if we have more data to encode and then encode (bit fill) the data into HDLC format, and shift the encoded data into the 32-bit data register. After encoding one byte of data, we go back to the beginning of the loop since we now have more then eight bits of data and we can copy that byte of data.
During each iteration, we bit fill the data and save it in a 32-bit iteration

Modules

HDLC Tx status
HDLC Fill Pattern

Data Structures

struct | hdlcTxInit_t
HDLC TX initialization structure. More...
struct | hdlcTxInst_t
HDLC TX processing instance structure. More...

HDLC Tx API

void | hdlcTxInit (hdlcTxInst_t *inst, hdlcTxInit_t *init)
This function initializes an instance of the HDLC transmitter module.
tuint | hdlcTxConfig (hdlcTxInst_t *inst, tword *dataBuffer, tuint size)
This function configures HDLC transmitter to process data from a buffer passed to it.
tuint | hdlcTxData (hdlcTxInst_t *inst, tword *src, tuint *src_idx, tuint size)
This function performs bit stuffing and stores the encoded data in the transmit buffer.
tuint | hdlcTxFcs (hdlcTxInst_t *inst, tbool good_frame)
This function generates the FCS bytes and one HDLC flag to mark end the current frame and stores them in the transmit buffer.
tuint | hdlcTxFlags (hdlcTxInst_t *inst, tint num_flags, tint fill_pattern)
This function generates the HDLC flags to fill the current transmit buffer.
tuint | hdlcTxAbort (hdlcTxInst_t *inst)
This function appends the abort sequence at the end of the data stream .

Function Documentation

void hdlcTxInit | ( | hdlcTxInst_t * | inst,
 |  | hdlcTxInit_t * | init
 | ) |  |

This function initializes an instance of the HDLC transmitter module.

Remarks:
It must be called before calling other HDLC transmitter processing routines.
Parameters:
[in] | init | Pointer to HDLC Tx init Structure.
[in,out] | inst | Pointer to HDLC Tx instance.

Definition at line 98 of file hdlctx.c.

References hdlcTxInst_t::currOctetBitCnt, hdlcTxInst_t::dataBufCnt, hdlcTxInst_t::decodedDataBytePerWord, hdlcTxInit_t::decodedDataBytePerWord, hdlcTxInst_t::encodedDataBytePerWord, hdlcTxInit_t::encodedDataBytePerWord, hdlcTxInst_t::fcs, hdlcTxInst_t::flagsCnt, hdlc_TX_FCS_INIT, hdlc_TX_FRAME_FLAGS, hdlcTxInst_t::minFlagsCnt, hdlcTxInit_t::minFlagsCnt, hdlcTxInst_t::oneCnt, and hdlcTxInst_t::status.

tuint hdlcTxConfig | ( | hdlcTxInst_t * | inst,
 |  | tword * | dataBuffer,
 |  | tuint | size
 | ) |  |

This function configures HDLC transmitter to process data from a buffer passed to it.

Parameters:
[in] | size | The size of the data buffer in bytes
[in] | dataBuffer | The address of the data buffer where the encoded data will be saved.
[in,out] | inst | Pointer to HDLC Tx instance.

Definition at line 120 of file hdlctx.c.

References hdlcTxInst_t::dataBufByteCnt, hdlcTxInst_t::dataBufByteSize, hdlcTxInst_t::dataBufCnt, hdlcTxInst_t::dataBufCurr, hdlc_TX_CONTINUE, and hdlcTxInst_t::status.

tuint hdlcTxData | ( | hdlcTxInst_t * | inst,
 |  | tword * | src,
 |  | tuint * | src_idx,
 |  | tuint | size
 | ) |  |

This function performs bit stuffing and stores the encoded data in the transmit buffer.

Parameters:
[in] | src | The address of the data buffer which has the data to be encoded
[in] | src_idx | The address of the variable, which indicates the location, from where the HDLC transmit will begin processing the data.
[in] | size | Maximum number of bytes that can be encoded.
[in,out] | inst | Pointer to HDLC Tx instance.
Return values:
Returns HDLC Tx status

Definition at line 140 of file hdlctx.c.

References hdlcTxInst_t::currOctet, hdlcTxInst_t::currOctetBitCnt, hdlcTxInst_t::dataBufByteCnt, hdlcTxInst_t::dataBufByteSize, hdlcTxInst_t::dataBufCnt, hdlcTxInst_t::dataBufCurr, hdlcTxInst_t::fcs, hdlc_TX_BITSTUFF_CNT, hdlc_TX_BYTE_SIZE, hdlc_TX_CONTINUE, hdlc_TX_FRAME_DATA, hdlc_TX_FRAME_FCS, hdlc_TX_LSB_MASK, hdlcFcsTable, hdlcTxInst_t::oneCnt, and hdlcTxInst_t::status.

Referenced by hdlcTxAbort(), hdlcTxFcs(), and hdlcTxFlags().

tuint hdlcTxFcs | ( | hdlcTxInst_t * | inst,
 |  | tbool | good_frame
 | ) |  |

This function generates the FCS bytes and one HDLC flag to mark end the current frame and stores them in the transmit buffer.

A bad or incorrect FCS is generated if the parameter good_frame is FALSE (0). Otherwise, a good FCS is generated

Remarks:
The function must be called after calling the hdlcTxData
Parameters:
[in] | good_frame | Number of data bytes to be encoded
[in,out] | inst | Pointer to HDLC Tx instance.
Return values:
Returns HDLC Tx status

Definition at line 313 of file hdlctx.c.

References hdlcTxInst_t::fcs, hdlcTxInst_t::flagsCnt, hdlc_TX_BYTE_SIZE, hdlc_TX_ERROR, hdlc_TX_FRAME_DATA, hdlc_TX_FRAME_FCS, hdlc_TX_FRAME_FLAGS, hdlc_TX_LSB_MASK, hdlcTxData(), and hdlcTxInst_t::status.

Here is the call graph for this function:

tuint hdlcTxFlags | ( | hdlcTxInst_t * | inst,
 |  | tint | num_flags,
 |  | tint | fill_pattern
 | ) |  |

This function generates the HDLC flags to fill the current transmit buffer.

The number of flags generated is given by the parameter num_flags. The minimum number of the HDLC flags generated is one regardless of the value of the parameter num_flags. The maximum number of the HDLC flags generated is determined by the parameter num_flags or if the transmit buffer gets full (which ever comes first).

Parameters:
[in] | num_flags | number of flags to be generated
[in] | fill_pattern | HDLC Fill Pattern
[in,out] | inst | Pointer to HDLC Tx instance.
Remarks:
The function must be called after calling the hdlcTxFcs since flags can only be generated between frames. The function returns a status value as defined before.
Return values:
Returns HDLC Tx status

Definition at line 356 of file hdlctx.c.

References hdlcTxInst_t::currOctet, hdlcTxInst_t::currOctetBitCnt, hdlcTxInst_t::fcs, hdlc_TX_BYTE_SIZE, hdlc_TX_CONTINUE, hdlc_TX_FCS_INIT, hdlcTxData(), and hdlcTxInst_t::oneCnt.

Here is the call graph for this function:

tuint hdlcTxAbort ( hdlcTxInst_t * inst )

This function appends the abort sequence at the end of the data stream .

Parameters:
[in,out] inst Pointer to HDLC Tx instance.
Return values:
Returns HDLC Tx status

Definition at line 385 of file hdlctx.c.

References hdlcTxInst_t::currOctet, hdlcTxInst_t::currOctetBitCnt, hdlcTxInst_t::fcs, hdlc_TX_ABORT_BYTE, hdlc_TX_BYTE_SIZE, hdlc_TX_FCS_INIT, hdlc_TX_FRAME_FLAGS, hdlcTxData(), and hdlcTxInst_t::status.

Here is the call graph for this function:


HDLC: HDLC Rx status

HDLC Rx status
[HDLC Receiver]

Collaboration diagram for HDLC Rx status:

Detailed Description

The HDLC RX function 'hdlcRx' function decodes the data provided and looks for the end-of-frame, flags, and abort sequence. When it finds any of those data sequences, it stops decoding any more data and reports the status back to the calling function. The calling function can then process the decoded data frames.

Defines

#define | hdlc_RX_FRAME_DATA 0x0001
#define | hdlc_RX_FRAME_END 0x0002
#define | hdlc_RX_FRAME_GOOD 0x0004
#define | hdlc_RX_FRAME_BAD 0x0008
#define | hdlc_RX_FRAME_ABORT 0x0010
#define | hdlc_RX_FRAME_FLAGS 0x0020
#define | hdlc_RX_BUFFER_END 0x0040
#define | hdlc_RX_FRAME_NONALIGN 0x0080

Define Documentation

#define hdlc_RX_FRAME_DATA 0x0001

Definition at line 118 of file hdlcrx.h.

Referenced by hdlcRx().

#define hdlc_RX_FRAME_END 0x0002

Definition at line 119 of file hdlcrx.h.

Referenced by hdlcRx().

#define hdlc_RX_FRAME_GOOD 0x0004

Definition at line 120 of file hdlcrx.h.

Referenced by hdlcRx().

#define hdlc_RX_FRAME_BAD 0x0008

Definition at line 121 of file hdlcrx.h.

Referenced by hdlcRx().

#define hdlc_RX_FRAME_ABORT 0x0010

Definition at line 122 of file hdlcrx.h.

Referenced by hdlcRx().

#define hdlc_RX_FRAME_FLAGS 0x0020

Definition at line 123 of file hdlcrx.h.

Referenced by hdlcRx().

#define hdlc_RX_BUFFER_END 0x0040

Definition at line 124 of file hdlcrx.h.

Referenced by hdlcRx().

#define hdlc_RX_FRAME_NONALIGN 0x0080

Definition at line 125 of file hdlcrx.h.


HDLC: HDLC Tx status

HDLC Tx status
[HDLC Transmitter]

Collaboration diagram for HDLC Tx status:

Detailed Description

The HDLC TX status is reported by HDLC TX functions to provide information to the user. It indicates to the user if the data buffer provided has been filled or if the user needs to continue calling the HDLC TX routines.

Defines

#define | hdlc_TX_CONTINUE 0x0001
#define | hdlc_TX_FRAME_DATA 0x0002
#define | hdlc_TX_FRAME_FCS 0x0004
#define | hdlc_TX_FRAME_FLAGS 0x0008
#define | hdlc_TX_ERROR 0x0010

Define Documentation

#define hdlc_TX_CONTINUE 0x0001

Definition at line 114 of file hdlctx.h.

Referenced by hdlcTxConfig(), hdlcTxData(), and hdlcTxFlags().

#define hdlc_TX_FRAME_DATA 0x0002

Definition at line 115 of file hdlctx.h.

Referenced by hdlcTxData(), and hdlcTxFcs().

#define hdlc_TX_FRAME_FCS 0x0004

Definition at line 116 of file hdlctx.h.

Referenced by hdlcTxData(), and hdlcTxFcs().

#define hdlc_TX_FRAME_FLAGS 0x0008

Definition at line 117 of file hdlctx.h.

Referenced by hdlcTxAbort(), hdlcTxFcs(), and hdlcTxInit().

#define hdlc_TX_ERROR 0x0010

Definition at line 118 of file hdlctx.h.

Referenced by hdlcTxFcs().


HDLC: hdlcfcs.c File Reference

  • File List
  • Globals

hdlcfcs.c File Reference

#include <ti/mas/types/types.h>

Include dependency graph for hdlcfcs.c:

Go to the source code of this file.

Variables

const tuint hdlcFcsTable [256]

Variable Documentation

const tuint hdlcFcsTable[256]

Definition at line 85 of file hdlcfcs.c.

Referenced by hdlcRx(), and hdlcTxData().


HDLC: hdlcfcs.c Source File

  • File List
  • Globals

hdlcfcs.c

Go to the documentation of this file.
00001 /******************************************************************************
00002 * FILE PURPOSE: HDLC Frame Check Sequence Computations
00003 *
00004 *******************************************************************************
00005 * FILE NAME: hdlcfcs.c
00006 *
00007 * DESCRIPTION: This file contains routines and data structures used to
00008 * generate and check the HDLC FCS sequence.  The HDLC FCS is a two-byte cyclic
00009 * redundancy check (CRC) value computed using the algorithm described in the
00010 * CCITT X.25 specification.  In HDLC chip documentation, this is usually
00011 * referred to as the "CCITT" algorithm.  Note that the "CCITT" algorithm is
00012 * very different from the "CRC-16" algorithm, another popular algorithm
00013 * frequently mentioned in chip documentation (which we don't support).
00014 *
00015 * REVISION HISTORY:
00016 *
00017 * $Log: HDLCFCS.C $
00018 * Revision 1.1  1999/12/06 10:28:14  sakhtar
00019 * Initial revision
00020 *
00021  *        Copyright (c) 2007 – 2013 Texas Instruments Incorporated
00022  *
00023  *              All rights reserved not granted herein.
00024  *
00025  *                         Limited License.
00026  *
00027  *  Texas Instruments Incorporated grants a world-wide, royalty-free,
00028  *  non-exclusive license under copyrights and patents it now or hereafter owns
00029  *  or controls to make, have made, use, import, offer to sell and sell
00030  *  ("Utilize") this software subject to the terms herein.  With respect to the
00031  *  foregoing patent license, such license is granted solely to the extent that
00032  *  any such patent is necessary to Utilize the software alone.  The patent
00033  *  license shall not apply to any combinations which include this software,
00034  *  other than combinations with devices manufactured by or for TI (“TI
00035  *  Devices”).  No hardware patent is licensed hereunder.
00036  *
00037  *  Redistributions must preserve existing copyright notices and reproduce this
00038  *  license (including the above copyright notice and the disclaimer and (if
00039  *  applicable) source code license limitations below) in the documentation
00040  *  and/or other materials provided with the distribution
00041  *
00042  *  Redistribution and use in binary form, without modification, are permitted
00043  *  provided that the following conditions are met:
00044  *
00045  *    *  No reverse engineering, decompilation, or disassembly of this software
00046  *  is permitted with respect to any software provided in binary form.
00047  *
00048  *    *  any redistribution and use are licensed by TI for use only with TI
00049  *  Devices.
00050  *
00051  *    *  Nothing shall obligate TI to provide you with source code for the
00052  *  software licensed and provided to you in object code.
00053  *
00054  *  If software source code is provided to you, modification and redistribution
00055  *  of the source code are permitted provided that the following conditions are
00056  *  met:
00057  *
00058  *    *  any redistribution and use of the source code, including any resulting
00059  *  derivative works, are licensed by TI for use only with TI Devices.
00060  *
00061  *    *  any redistribution and use of any object code compiled from the source
00062  *  code and any resulting derivative works, are licensed by TI for use only
00063  *  with TI Devices.
00064  *
00065  *  Neither the name of Texas Instruments Incorporated nor the names of its
00066  *  suppliers may be used to endorse or promote products derived from this
00067  *  software without specific prior written permission.
00068  *
00069  *  DISCLAIMER.
00070  *
00071  *  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS
00072  *  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00073  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00074  *  DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY
00075  *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00076  *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00077  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00078  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00079  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00080  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00081  *  DAMAGE.
00082 ******************************************************************************/
00083 #include <ti/mas/types/types.h>
00084
00085 const tuint hdlcFcsTable [256] = {
00086 0x0000,0x2110,0x4220,0x6330,0x8440,0xA550,0xC660,0xE770,
00087 0x0881,0x2991,0x4AA1,0x6BB1,0x8CC1,0xADD1,0xCEE1,0xEFF1,
00088 0x3112,0x1002,0x7332,0x5222,0xB552,0x9442,0xF772,0xD662,
00089 0x3993,0x1883,0x7BB3,0x5AA3,0xBDD3,0x9CC3,0xFFF3,0xDEE3,
00090 0x6224,0x4334,0x2004,0x0114,0xE664,0xC774,0xA444,0x8554,
00091 0x6AA5,0x4BB5,0x2885,0x0995,0xEEE5,0xCFF5,0xACC5,0x8DD5,
00092 0x5336,0x7226,0x1116,0x3006,0xD776,0xF666,0x9556,0xB446,
00093 0x5BB7,0x7AA7,0x1997,0x3887,0xDFF7,0xFEE7,0x9DD7,0xBCC7,
00094 0xC448,0xE558,0x8668,0xA778,0x4008,0x6118,0x0228,0x2338,
00095 0xCCC9,0xEDD9,0x8EE9,0xAFF9,0x4889,0x6999,0x0AA9,0x2BB9,
00096 0xF55A,0xD44A,0xB77A,0x966A,0x711A,0x500A,0x333A,0x122A,
00097 0xFDDB,0xDCCB,0xBFFB,0x9EEB,0x799B,0x588B,0x3BBB,0x1AAB,
00098 0xA66C,0x877C,0xE44C,0xC55C,0x222C,0x033C,0x600C,0x411C,
00099 0xAEED,0x8FFD,0xECCD,0xCDDD,0x2AAD,0x0BBD,0x688D,0x499D,
00100 0x977E,0xB66E,0xD55E,0xF44E,0x133E,0x322E,0x511E,0x700E,
00101 0x9FFF,0xBEEF,0xDDDF,0xFCCF,0x1BBF,0x3AAF,0x599F,0x788F,
00102 0x8891,0xA981,0xCAB1,0xEBA1,0x0CD1,0x2DC1,0x4EF1,0x6FE1,
00103 0x8010,0xA100,0xC230,0xE320,0x0450,0x2540,0x4670,0x6760,
00104 0xB983,0x9893,0xFBA3,0xDAB3,0x3DC3,0x1CD3,0x7FE3,0x5EF3,
00105 0xB102,0x9012,0xF322,0xD232,0x3542,0x1452,0x7762,0x5672,
00106 0xEAB5,0xCBA5,0xA895,0x8985,0x6EF5,0x4FE5,0x2CD5,0x0DC5,
00107 0xE234,0xC324,0xA014,0x8104,0x6674,0x4764,0x2454,0x0544,
00108 0xDBA7,0xFAB7,0x9987,0xB897,0x5FE7,0x7EF7,0x1DC7,0x3CD7,
00109 0xD326,0xF236,0x9106,0xB016,0x5766,0x7676,0x1546,0x3456,
00110 0x4CD9,0x6DC9,0x0EF9,0x2FE9,0xC899,0xE989,0x8AB9,0xABA9,
00111 0x4458,0x6548,0x0678,0x2768,0xC018,0xE108,0x8238,0xA328,
00112 0x7DCB,0x5CDB,0x3FEB,0x1EFB,0xF98B,0xD89B,0xBBAB,0x9ABB,
00113 0x754A,0x545A,0x376A,0x167A,0xF10A,0xD01A,0xB32A,0x923A,
00114 0x2EFD,0x0FED,0x6CDD,0x4DCD,0xAABD,0x8BAD,0xE89D,0xC98D,
00115 0x267C,0x076C,0x645C,0x454C,0xA23C,0x832C,0xE01C,0xC10C,
00116 0x1FEF,0x3EFF,0x5DCF,0x7CDF,0x9BAF,0xBABF,0xD98F,0xF89F,
00117 0x176E,0x367E,0x554E,0x745E,0x932E,0xB23E,0xD10E,0xF01E };
00118
00119 /* This table is only used in c54x.
00120    TODO: It should be moved to c54x\hdlcrx.s. */
00121 #if (defined(ti_targets_C54) || defined(ti_targets_C54_far))
00122 const tuint hdlcRxInitTable [12] = {
00123 0X0000,0x0001,0x0002,0x0006,0x0007,0x0008,0x00FF,0x0010,
00124 0x007E,0x003E,0x003F,0x007F };
00125 #endif
00126
00127 /* nothing past this point */


HDLC: hdlcrx.c File Reference

  • File List
  • Globals

hdlcrx.c File Reference

Detailed Description

The HDLC RX module decodes HDLC data stream into data frames.

path /dsps_gtmas/ti/mas/hdlc/src/hdlcrx.c

============================================================================ Copyright (c) 2007 – 2013 Texas Instruments Incorporated

All rights reserved not granted herein.

Limited License.

Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.

Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution

Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:

* No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.

* any redistribution and use are licensed by TI for use only with TI Devices.

* Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.

If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:

* any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.

* any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.

Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.

DISCLAIMER.

THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hdlcrx.c.

#include <ti/mas/types/types.h>
#include <ti/mas/hdlc/hdlcrx.h>
#include <ti/mas/util/pkt.h>

Include dependency graph for hdlcrx.c:

Go to the source code of this file.

Defines

#define | TYP_WORD_SIZE_HDLC 8
#define | HDLC_INIT_FCS 0xFFFF
#define | WORD_MASK ( (1 << TYP_WORD_SIZE_HDLC) - 1)
#define | HDLC_RX_DEBUG 0

Functions

void | hdlcRxInit (hdlcRxInst_t *inst, hdlcRxInit_t *init)
This function initializes an instance of the HDLC receiver module.
void | hdlcRxConfig (hdlcRxInst_t *inst, tword *data, tuint size)
This function configures HDLC receiver to process data from a buffer passed to it.
tuint | hdlcRx (hdlcRxInst_t *inst, tword *dst, tuint *dst_cnt, tuint max_size)
This function performs de-stuffing and FCS computation of the received data.

Variables

const tuint | hdlcFcsTable []

Define Documentation

#define TYP_WORD_SIZE_HDLC 8

Definition at line 78 of file hdlcrx.c.

Referenced by hdlcRx(), and hdlcRxConfig().

#define HDLC_INIT_FCS 0xFFFF

Definition at line 85 of file hdlcrx.c.

Referenced by hdlcRx().

#define WORD_MASK ( (1 << TYP_WORD_SIZE_HDLC) - 1)

Definition at line 86 of file hdlcrx.c.

Referenced by hdlcRx().

#define HDLC_RX_DEBUG 0

Definition at line 95 of file hdlcrx.c.

Variable Documentation

const tuint hdlcFcsTable[]

Definition at line 85 of file hdlcfcs.c.


HDLC: hdlcrx.c Source File

  • File List
  • Globals

hdlcrx.c

Go to the documentation of this file.
00001 /* ========================================================================== */
00073
00074 #include <ti/mas/types/types.h>
00075 #include <ti/mas/hdlc/hdlcrx.h>
00076 #include <ti/mas/util/pkt.h>
00077
00078 #define TYP_WORD_SIZE_HDLC 8
00079
00080 /******************************************************************************
00081 * DATA DEFINITION:  HDLC RX local definitions
00082 ******************************************************************************/
00083 extern const tuint hdlcFcsTable[]; /* used for FCS computation */
00084
00085 #define   HDLC_INIT_FCS    0xFFFF  /* initail value for FCS */
00086 #define   WORD_MASK        ( (1 << TYP_WORD_SIZE_HDLC) - 1)
00087
00088 /******************************************************************************
00089 * DATA DEFINITION:  HDLC RX debugging data defintion and function
00090 *
00091 * DESCRIPTION:      The following data variables are used for debugging
00092 *                   purposes only. These variables are commented out under
00093 *                   normal conditions
00094 ******************************************************************************/
00095 #define HDLC_RX_DEBUG 0
00096
00097 #if HDLC_RX_DEBUG
00098   #define HDLC_RX_BUF  20
00099
00100   typedef struct {
00101     hdlcRxInst_t instance;
00102     tint bit_cnt;
00103     tword temp_bit;
00104   } hdlcTemp_t;
00105
00106   hdlcTemp_t BefBuf[hdlc_RX_BUF];
00107
00108   tulong iteration_count = 0;
00109   tulong iteration_test = 0;
00110
00111   void hdlcRxDebug (hdlcRxInst_t *inst, tint bit_cnt, tword temp_bit)
00112   {
00113     tint i,j,*k,*l;
00114
00115     if (iteration_count == iteration_test)
00116     {
00117     asm ("   nop");
00118     asm ("   nop");
00119     asm ("   nop");
00120     asm ("   nop");
00121     asm ("   nop");
00122     }
00123
00124     iteration_count ++;
00125
00126    for (i = (hdlc_RX_BUF - 1); i > 0; i--)
00127    {
00128     k = (tuint *) &BefBuf[i - 1];
00129       l = (tuint *) &BefBuf[i];
00130
00131       for (j = 0; j < sizeof(hdlcTemp_t); j++) *l++ = *k++;
00132    }
00133
00134    BefBuf[0].instance = *inst;
00135    BefBuf[0].bit_cnt = bit_cnt;
00136    BefBuf[0].temp_bit = temp_bit;
00137   }
00138
00139 #endif
00140
00152 void hdlcRxInit (hdlcRxInst_t *inst, hdlcRxInit_t *init)
00153 {
00154   inst->state = hdlc_RX_STATE_IDLE;
00155   inst->currOctet = 0;
00156   inst->dataBufCnt = 0;
00157   inst->encodedDataSizeBits = init->encodedDataBytePerWord * 8;
00158   inst->decodedDataBytePerWord = init->decodedDataBytePerWord - 1;
00159 }
00169 void hdlcRxConfig (hdlcRxInst_t *inst, tword *data, tuint size)
00170 {
00171   inst->dataBufBitSize = (size * 8) - 1;
00172   inst->dataBufBitCnt  = TYP_WORD_SIZE_HDLC;
00173   inst->dataBufCurr    = data;
00174   inst->dataBufCnt = 0;
00175 }
00176
00198 tuint hdlcRx (hdlcRxInst_t *inst, tword *dst, tuint *dst_cnt, tuint max_size)
00199 {
00200   tuint retStatus, octet_size,fcs_idx;
00201   tword temp_octet;
00202   tint bit_cnt;
00203   tword temp_bit;
00204
00205   /* initialize the return status */
00206   retStatus  = 0;
00207   octet_size = TYP_WORD_SIZE_HDLC;
00208
00209   if (inst->state == hdlc_RX_STATE_DATA)
00210   {
00211     /* process all the bits */
00212     while (inst->dataBufBitSize >= 0)
00213     {
00214
00215     /* compute the maximum number of bits we can read. Since a zero is     */
00216     /* inserted after 5 '1's, we can read at most 6 bits at a time and     */
00217     /* then remove the last bit if it is a '0' after 5 '1' bits.           */
00218     /* The variable bit_cnt is initialized to '6' since that is the max.   */
00219     /* number of bits we can read at a time */
00220
00221     /* first we look to see how many '1' bits are left from the last time  */
00222     /* for each '1' bit left, we decrement 'bit_cnt' by 1 and stop when we */
00223     /* see a '0' bit */
00224     for (bit_cnt = 6,temp_octet = inst->currOctet;temp_octet & 0x0001;bit_cnt--)
00225       temp_octet >>= 1;
00226
00227       /* we have the maximum number of bits we can read during this iteration */
00228     /* but we must check if we have enough bits or not */
00229     if (inst->dataBufBitSize < bit_cnt)
00230       bit_cnt = inst->dataBufBitSize;
00231
00232     /* we process enough bits that will give a decoded byte which is used   */
00233     /* for FCS computation using the table. If 'bit_cnt' is greater then    */
00234     /* that, we reduce the bit_cnt */
00235     if (inst->dataRegisterBitCnt < bit_cnt)
00236       bit_cnt = inst->dataRegisterBitCnt;
00237
00238     /* we must read atleast one bit during an iteration, so if we are in a  */
00239     /* condition (like detecting flags or aborts) that has more then 5 '1'  */
00240     /* we will read at least one bit */
00241     if (bit_cnt == 0)
00242         bit_cnt = 1;
00243
00244       /* decrement the bit counters for the next iteration */
00245       inst->dataBufBitSize -= bit_cnt;
00246     inst->dataBufBitCnt  -= bit_cnt;
00247
00248     /* read 'bit_cnt' bits from the data buffer and add them to the         */
00249     /* 'inst->currOctet' shift register which is used later.                */
00250       temp_bit = (tword) pktReadnbits_m(inst->dataBufCurr,inst->dataBufCnt,inst->dataBufBitCnt);
00251
00252     /* need to use the next word this time, or set the pointer to the next */
00253     /* for the next time */
00254     if (inst->dataBufBitCnt <= 0)
00255     {
00256     tword temp_byte;
00257     inst->dataBufCnt++;
00258     inst->dataBufBitCnt += TYP_WORD_SIZE_HDLC;
00259     temp_byte = (tword )pktRead8bits_m(inst->dataBufCurr,inst->dataBufCnt);
00260     temp_bit |= temp_byte >> inst->dataBufBitCnt;
00261     }
00262
00263     /* 'temp_bit' has unwanted bits that must be masked out */
00264     temp_bit &= WORD_MASK >> (TYP_WORD_SIZE_HDLC - bit_cnt);
00265
00266     /* roll over the new bits into the 'inst->currOctet' register */
00267     inst->currOctet <<= bit_cnt;
00268     inst->currOctet |= temp_bit;
00269     inst->currOctet &= 0x007F;
00270
00271 #if HDLC_RX_DEBUG
00272     hdlcRxDebug (inst,bit_cnt,temp_bit);
00273 #endif
00274
00275     /* check for bit stuffing and remove the stuffed bit and move on to    */
00276     /* decode more bits */
00277     if (inst->currOctet == 0x003E)
00278     {
00279       inst->dataRegister <<= (bit_cnt - 1);
00280       inst->dataRegister |= (tulong) (temp_bit >> 1);
00281       inst->dataRegisterBitCnt -= (bit_cnt - 1);
00282       continue;
00283     }
00284
00285     /* insert the new bits into the 'inst->dataRegister' and update counter */
00286     inst->dataRegister <<= bit_cnt;
00287     inst->dataRegister |= (tulong) temp_bit;
00288     inst->dataRegisterBitCnt -= bit_cnt;
00289
00290     /* check for abort sequence and change state to IDLE and report an ABORT */
00291     /* to the calling function */
00292     if (inst->currOctet == 0x007F)
00293     {
00294             inst->state = hdlc_RX_STATE_IDLE;
00295          if (inst->dataByteCnt <= 2)
00296            goto IDLE;
00297           return (hdlc_RX_FRAME_ABORT);
00298     }
00299
00300     /* check for flag sequence, it may be the end of a frame, so we must check */
00301     /* for that and process the last data byte and check the FCS and report it */
00302     /* to the calling function */
00303     if (inst->currOctet == 0x007E)
00304     {
00305     retStatus = hdlc_RX_FRAME_FLAGS;
00306
00307       /* An HDLC frame must have a certain number of bytes and no bits, so if  */
00308         /* we have any partial bits left at the end, then the frame is invalid   */
00309     /* and we report a bad frame to the calling function */
00310     if (inst->dataRegisterBitCnt == 0)
00311       {
00312
00313           /* computing FCS for the last word */
00314       if (inst->dataByteCnt > 2)
00315       {
00316         fcs_idx  = (tuint)((inst->dataRegister >> 16) & 0x00FF);
00317         fcs_idx ^= inst->dataFcs;
00318         inst->dataFcs = ((inst->dataFcs >> 8) & 0x00FF) ^ hdlcFcsTable[fcs_idx & 0x00FF];
00319
00320         fcs_idx  = (tuint)((inst->dataRegister >> 8) & 0x00FF);
00321         fcs_idx ^= inst->dataFcs;
00322         inst->dataFcs = ((inst->dataFcs >> 8) & 0x00FF) ^ hdlcFcsTable[fcs_idx & 0x00FF];
00323
00324         /* set the return status to good intially */
00325         retStatus |= (hdlc_RX_FRAME_GOOD | hdlc_RX_FRAME_END);
00326
00327         /* change it to bad if the frame has a bad CRC */
00328         if (inst->dataFcs != 0x0F1D)
00329         {
00330           retStatus ^= (hdlc_RX_FRAME_BAD | hdlc_RX_FRAME_GOOD);
00331         }
00332       }
00333
00334       /* initialize variables for the next frame */
00335       inst->dataByteCnt = 0;
00336       inst->dataRegisterBitCnt = TYP_WORD_SIZE_HDLC;
00337       inst->dataFcs = HDLC_INIT_FCS;
00338       return (retStatus);
00339       }
00340     /* if we have received at least 2 bytes (which are for FCS)   */
00341     /* and the frame has some partail bits, then it can't be a    */
00342     /* valid frame */
00343       else if (inst->dataByteCnt > 2)
00344       {
00345       retStatus |= (hdlc_RX_FRAME_BAD | hdlc_RX_FRAME_END);
00346         inst->dataByteCnt = 0;
00347         inst->dataRegisterBitCnt = TYP_WORD_SIZE_HDLC;
00348         inst->dataFcs = HDLC_INIT_FCS;
00349       return (retStatus);
00350       }
00351
00352     /* if the frame has less then 2 bytes of data, then we discard */
00353     /* it and do not report it to the user since it is not a valid */
00354     /* frame anyway and it is too small */
00355       inst->dataByteCnt = 0;
00356       inst->dataRegisterBitCnt = TYP_WORD_SIZE_HDLC;
00357       inst->dataFcs = HDLC_INIT_FCS;
00358     }
00359
00360     /* processing for data bytes. If we have reached here, then we must */
00361     /* have data bits, we check if we have a new decoded byte, if yes   */
00362     /* then we compute it's FCS and copy it to the 'dst' buffer         */
00363     if (inst->dataRegisterBitCnt == 0)
00364     {
00365       /* reset the counter and compute FCS */
00366     inst->dataRegisterBitCnt = TYP_WORD_SIZE_HDLC;
00367     retStatus = hdlc_RX_FRAME_DATA;
00368
00369     /* copy the data byte after the 2 bytes have benn decoded which are */
00370     /* for the FCS */
00371       if (inst->dataByteCnt >= 2)
00372       {
00373       tword temp_byte;
00374       temp_byte  = (inst->dataRegister >> 16) & (WORD_MASK);
00375       pktWrite8bits_m(dst,*dst_cnt,temp_byte);
00376       *dst_cnt = *dst_cnt + 1;
00377
00378       /* Compute the FCS */
00379       fcs_idx  = (((tuint) temp_byte) & 0x00FF) ^ inst->dataFcs;
00380           inst->dataFcs = ((inst->dataFcs >> 8) & 0x00FF) ^ hdlcFcsTable[fcs_idx & 0x00FF];
00381
00382       /* check if we have reached the last data byte if the buffer we are */
00383       /* writing to. If yes, then return               */
00384       if (*dst_cnt == max_size)
00385       {
00386       return(retStatus | hdlc_RX_FRAME_DATA);
00387       }
00388       }
00389
00390       inst->dataByteCnt ++;
00391     }
00392     }
00393   }
00394   else
00395   {
00396  IDLE:
00397     /* process all the bits */
00398     while (inst->dataBufBitSize >= 0)
00399     {
00400     tword temp_byte;
00401
00402     /* decrement the buffer bit counter */
00403     inst->dataBufBitSize --;
00404
00405     /* check if need a new word */
00406     if (inst->dataBufBitCnt == 0)
00407     {
00408       inst->dataBufBitCnt = octet_size;
00409       inst->dataBufCnt++;
00410     }
00411
00412     /* decrement the word bit counter */
00413     inst->dataBufBitCnt --;
00414
00415     temp_byte = (tword) pktRead8bits_m(inst->dataBufCurr,inst->dataBufCnt);
00416     /* roll the data bits */
00417     temp_bit = (temp_byte >> inst->dataBufBitCnt) & 1;
00418
00419     /* shift the next bit into the 'inst->currOctet' register */
00420     inst->currOctet <<= 1;
00421     inst->currOctet |= temp_bit;
00422     inst->currOctet &= 0x00FF;
00423
00424 #if HDLC_RX_DEBUG
00425     hdlcRxDebug (inst,bit_cnt,temp_bit);
00426 #endif
00427
00428     /* check for a flag and change state to DATA state */
00429     if (inst->currOctet == 0x007E)
00430     {
00431       inst->dataRegisterBitCnt = TYP_WORD_SIZE_HDLC;
00432     inst->dataByteCnt = 0;
00433       inst->dataFcs = HDLC_INIT_FCS;
00434     inst->state = hdlc_RX_STATE_DATA;
00435     return (hdlc_RX_FRAME_FLAGS);
00436     }
00437     }
00438   }
00439
00440   /* we must have processed all data provided if have gotten here */
00441   /* report buffer_end to the outside */
00442   return (retStatus | hdlc_RX_BUFFER_END);
00443 }
00444
00445 /* nothing past this point */


HDLC: hdlcrx.h File Reference

  • File List
  • Globals

hdlcrx.h File Reference

Detailed Description

This file declares function prototypes and the instance for the HDLC RX (decoding) processing routines.

path /dsps_gtmas/ti/mas/hdlc/hdlcrx.h

============================================================================ Copyright (c) 2007 – 2013 Texas Instruments Incorporated

All rights reserved not granted herein.

Limited License.

Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.

Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution

Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:

* No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.

* any redistribution and use are licensed by TI for use only with TI Devices.

* Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.

If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:

* any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.

* any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.

Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.

DISCLAIMER.

THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hdlcrx.h.

#include <ti/mas/types/types.h>

Include dependency graph for hdlcrx.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct | hdlcRxInit_t
HDLC RX initialization structure. More...
struct | hdlcRxInst_t
HDLC RX processing instance structure. More...

Defines

#define | hdlc_RX_FRAME_DATA 0x0001
#define | hdlc_RX_FRAME_END 0x0002
#define | hdlc_RX_FRAME_GOOD 0x0004
#define | hdlc_RX_FRAME_BAD 0x0008
#define | hdlc_RX_FRAME_ABORT 0x0010
#define | hdlc_RX_FRAME_FLAGS 0x0020
#define | hdlc_RX_BUFFER_END 0x0040
#define | hdlc_RX_FRAME_NONALIGN 0x0080

Enumerations

enum | hdlcRxState_e { hdlc_RX_STATE_DATA, hdlc_RX_STATE_IDLE }
HDLC RX state definitions. More...

Functions

HDLC Rx API
void | hdlcRxInit (hdlcRxInst_t *inst, hdlcRxInit_t *init)
This function initializes an instance of the HDLC receiver module.
void | hdlcRxConfig (hdlcRxInst_t *inst, tword *data, tuint size)
This function configures HDLC receiver to process data from a buffer passed to it.
tuint | hdlcRx (hdlcRxInst_t *inst, tword *dst, tuint *dst_cnt, tuint max_size)
This function performs de-stuffing and FCS computation of the received data.


HDLC: hdlcrx.h Source File

  • File List
  • Globals

hdlcrx.h

Go to the documentation of this file.
00001 #ifndef _HDLCRX_H_
00002 #define _HDLCRX_H_
00003
00004 /* ========================================================================== */
00100 /* @{ */
00101
00102 #include <ti/mas/types/types.h>
00103
00117 /* @{ */
00118 #define hdlc_RX_FRAME_DATA     0x0001
00119 #define hdlc_RX_FRAME_END      0x0002
00120 #define hdlc_RX_FRAME_GOOD     0x0004
00121 #define hdlc_RX_FRAME_BAD      0x0008
00122 #define hdlc_RX_FRAME_ABORT    0x0010
00123 #define hdlc_RX_FRAME_FLAGS    0x0020
00124 #define hdlc_RX_BUFFER_END     0x0040
00125 #define hdlc_RX_FRAME_NONALIGN 0x0080
00126 /* @} */
00127
00139 typedef struct {
00140   tint encodedDataBytePerWord;
00141   tint decodedDataBytePerWord;
00142   tbool encodedDataBigEndian;
00144   tbool decodedDataBigEndian;
00146 } hdlcRxInit_t;
00147
00151 typedef enum
00152 {
00153   hdlc_RX_STATE_DATA,
00154   hdlc_RX_STATE_IDLE
00155 } hdlcRxState_e;
00156
00165 typedef struct {
00166
00167   tint  dataBufBitSize;
00169   tint  dataBufBitCnt;
00171   tword *dataBufCurr;
00173   tword currOctet;
00175   tulong dataRegister;
00177   tuint state;
00179   tint  dataRegisterBitCnt;
00181   tint  dataByteCnt;
00183   tuint dataFcs;
00185   tint  encodedDataSizeBits;
00187   tint  decodedDataBytePerWord;
00189   tuint dataBufCnt;
00191 } hdlcRxInst_t;
00192
00208 void  hdlcRxInit (hdlcRxInst_t *inst, hdlcRxInit_t *init);
00209
00210
00220 void  hdlcRxConfig (hdlcRxInst_t *inst, tword *data, tuint size);
00221
00222
00244 tuint hdlcRx (hdlcRxInst_t *inst, tword *dst, tuint *dst_cnt, tuint max_size);  /* @name HDLC Rx API */
00246
00247 /* @} */ /* ingroup */
00248
00249 #endif


HDLC: hdlctx.c File Reference

  • File List
  • Globals

hdlctx.c File Reference

Detailed Description

The HDLC TX module encodes data stream to HDLC frames.

path /dsps_gtmas/ti/mas/hdlc/src/hdlctx.c

============================================================================ Copyright (c) 2007 – 2013 Texas Instruments Incorporated

All rights reserved not granted herein.

Limited License.

Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.

Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution

Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:

* No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.

* any redistribution and use are licensed by TI for use only with TI Devices.

* Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.

If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:

* any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.

* any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.

Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.

DISCLAIMER.

THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hdlctx.c.

#include <ti/mas/types/types.h>
#include <ti/mas/hdlc/hdlctx.h>
#include <ti/mas/util/pkt.h>

Include dependency graph for hdlctx.c:

Go to the source code of this file.

Defines

#define | hdlc_TX_FCS_INIT 0xFFFF
#define | hdlc_TX_FLAGS_BYTE 0x007E
#define | hdlc_TX_ABORT_BYTE 0x00FE
#define | hdlc_TX_BYTE_SIZE 8
#define | hdlc_TX_MSB_MASK 0xFF00
#define | hdlc_TX_LSB_MASK 0x00FF
#define | hdlc_TX_MIN_FLAG_CNT 1
#define | hdlc_TX_BITSTUFF_CNT 5

Functions

void | hdlcTxInit (hdlcTxInst_t *inst, hdlcTxInit_t *init)
This function initializes an instance of the HDLC transmitter module.
tuint | hdlcTxConfig (hdlcTxInst_t *inst, tword *dataBuffer, tuint size)
This function configures HDLC transmitter to process data from a buffer passed to it.
tuint | hdlcTxData (hdlcTxInst_t *inst, tword *src, tuint *src_idx, tuint size)
This function performs bit stuffing and stores the encoded data in the transmit buffer.
tuint | hdlcTxFcs (hdlcTxInst_t *inst, tbool good_frame)
This function generates the FCS bytes and one HDLC flag to mark end the current frame and stores them in the transmit buffer.
tuint | hdlcTxFlags (hdlcTxInst_t *inst, tint num_flags, tint fill_pattern)
This function generates the HDLC flags to fill the current transmit buffer.
tuint | hdlcTxAbort (hdlcTxInst_t *inst)
This function appends the abort sequence at the end of the data stream .

Variables

const tuint | hdlcFcsTable []

Define Documentation

#define hdlc_TX_FCS_INIT 0xFFFF

Definition at line 76 of file hdlctx.c.

Referenced by hdlcTxAbort(), hdlcTxFlags(), and hdlcTxInit().

#define hdlc_TX_FLAGS_BYTE 0x007E

Definition at line 77 of file hdlctx.c.

#define hdlc_TX_ABORT_BYTE 0x00FE

Definition at line 78 of file hdlctx.c.

Referenced by hdlcTxAbort().

#define hdlc_TX_BYTE_SIZE 8

Definition at line 79 of file hdlctx.c.

Referenced by hdlcTxAbort(), hdlcTxData(), hdlcTxFcs(), and hdlcTxFlags().

#define hdlc_TX_MSB_MASK 0xFF00

Definition at line 80 of file hdlctx.c.

#define hdlc_TX_LSB_MASK 0x00FF

Definition at line 81 of file hdlctx.c.

Referenced by hdlcTxData(), and hdlcTxFcs().

#define hdlc_TX_MIN_FLAG_CNT 1

Definition at line 82 of file hdlctx.c.

#define hdlc_TX_BITSTUFF_CNT 5

Definition at line 83 of file hdlctx.c.

Referenced by hdlcTxData().

Variable Documentation

const tuint hdlcFcsTable[]

Definition at line 85 of file hdlcfcs.c.

Referenced by hdlcRx(), and hdlcTxData().


HDLC: hdlctx.c Source File

  • File List
  • Globals

hdlctx.c

Go to the documentation of this file.
00001 /* ========================================================================== */
00072 #include <ti/mas/types/types.h>
00073 #include <ti/mas/hdlc/hdlctx.h>
00074 #include <ti/mas/util/pkt.h>
00075
00076 #define    hdlc_TX_FCS_INIT       0xFFFF
00077 #define    hdlc_TX_FLAGS_BYTE     0x007E
00078 #define    hdlc_TX_ABORT_BYTE     0x00FE
00079 #define    hdlc_TX_BYTE_SIZE      8
00080 #define    hdlc_TX_MSB_MASK       0xFF00
00081 #define    hdlc_TX_LSB_MASK       0x00FF
00082 #define    hdlc_TX_MIN_FLAG_CNT   1
00083 #define    hdlc_TX_BITSTUFF_CNT   5
00084
00085 extern const tuint hdlcFcsTable[];
00086
00098 void hdlcTxInit (hdlcTxInst_t *inst, hdlcTxInit_t *init)
00099 {
00100   inst->status         = hdlc_TX_FRAME_FLAGS;
00101   inst->fcs            = hdlc_TX_FCS_INIT;
00102   inst->currOctetBitCnt = 0;
00103   inst->flagsCnt       = 0;
00104   inst->oneCnt         = 0;
00105   inst->minFlagsCnt    = init->minFlagsCnt;
00106   inst->dataBufCnt     = 0;
00107   inst->encodedDataBytePerWord = init->encodedDataBytePerWord - 1;
00108   inst->decodedDataBytePerWord = init->decodedDataBytePerWord - 1;
00109 }
00110
00120 tuint hdlcTxConfig (hdlcTxInst_t *inst, tword *dataBuffer, tuint size)
00121 {
00122   inst->dataBufByteSize = size;
00123   inst->dataBufByteCnt  = 0;
00124   inst->dataBufCurr     = dataBuffer;
00125   inst->dataBufCnt    = 0;
00126   return (inst->status | hdlc_TX_CONTINUE);
00127 }
00128
00140 tuint hdlcTxData (hdlcTxInst_t *inst, tword *src, tuint *src_idx, tuint size)
00141 {
00142   tword  temp_octet;
00143   tuint bit_mask,array_data,fcs_idx;
00144
00145   /* loop until we have filled the buffered passed by calling hdlcTxConfig() */
00146   while (inst->dataBufByteSize > 0)
00147   {
00148     /* check the register (currOctet) to see if have more then 8 bits. If   */
00149   /* yes, then remove the 8 bits and copy them into the encoded data      */
00150   /* buffer */
00151   if (inst->currOctetBitCnt >= hdlc_TX_BYTE_SIZE)
00152   {
00153     /* decrement the bit counter and copy the bits to temp_octet */
00154     inst->currOctetBitCnt -= hdlc_TX_BYTE_SIZE;
00155     temp_octet = (tword) (inst->currOctet >> inst->currOctetBitCnt);
00156     temp_octet &= hdlc_TX_LSB_MASK;
00157
00158     /* save the temp_octet in the buffer */
00159     pktWrite8bits_m(inst->dataBufCurr,inst->dataBufCnt,temp_octet);
00160     inst->dataBufCnt++;
00161
00162     /* update the counters */
00163     inst->dataBufByteSize--;
00164     inst->dataBufByteCnt++;
00165
00166     /* check if we can copy another byte to the buffer */
00167     continue;
00168   }
00169
00170   /* need to encode more data to fill the buffer */
00171   if (inst->status & hdlc_TX_FRAME_DATA)
00172   {
00173       /* check if we don't have any more data bytes. If so return */
00174     if (*src_idx == size)
00175     {
00176     inst->status |= hdlc_TX_CONTINUE;
00177     return (inst->status);
00178     }
00179
00180     /* check for double/single packed cases and read one byte of data */
00181     array_data = pktRead8bits_m(src,*src_idx);
00182
00183     /* increment the data counter and mask most significant 8 bits */
00184     *src_idx   = *src_idx + 1;
00185       array_data &= hdlc_TX_LSB_MASK;
00186
00187     /* compute the new FCS */
00188     fcs_idx = (inst->fcs ^ array_data) & hdlc_TX_LSB_MASK;
00189     inst->fcs = ((inst->fcs >> hdlc_TX_BYTE_SIZE) & hdlc_TX_LSB_MASK) ^ hdlcFcsTable[fcs_idx];
00190
00191     /* do bit stuffing, if needed (MIPS intensive) */
00192     for (bit_mask = 0x0080;bit_mask != 0;bit_mask >>= 1)
00193     {
00194         if (inst->oneCnt == hdlc_TX_BITSTUFF_CNT)
00195       {
00196       inst->oneCnt = 0;
00197       inst->currOctet = (inst->currOctet << 1);
00198       inst->currOctetBitCnt ++;
00199       }
00200
00201       inst->currOctet = (inst->currOctet << 1);
00202       inst->currOctetBitCnt ++;
00203
00204       if (bit_mask & array_data)
00205       {
00206         inst->oneCnt++;
00207       inst->currOctet |=  1;
00208       }
00209       else
00210       {
00211         inst->oneCnt = 0;
00212       }
00213     }
00214
00215     /* check for bit stuffing at the end again and add a '0' bit at the end */
00216     if (inst->oneCnt == hdlc_TX_BITSTUFF_CNT)
00217     {
00218       inst->currOctet <<= 1;
00219       inst->currOctetBitCnt ++;
00220     inst->oneCnt = 0;
00221     }
00222
00223     /* ready to copy the encoded data byte into the buffer */
00224     continue;
00225     }
00226
00227     /* we are in FCS state, perform the bitstuffing for the FCS */
00228   if (inst->status & hdlc_TX_FRAME_FCS)
00229   {
00230       /* bit stuffing of the 16 bit fcs */
00231     for (bit_mask = 0x8000;bit_mask != 0;bit_mask >>= 1)
00232     {
00233       if (inst->oneCnt == hdlc_TX_BITSTUFF_CNT)
00234       {
00235       inst->oneCnt = 0;
00236       inst->currOctet <<= 1;
00237       inst->currOctetBitCnt ++;
00238       }
00239
00240       inst->currOctet <<= 1;
00241       inst->currOctetBitCnt ++;
00242
00243       if (bit_mask & inst->fcs)
00244       {
00245         inst->oneCnt++;
00246       inst->currOctet |=  1;
00247       }
00248       else
00249       {
00250         inst->oneCnt = 0;
00251       }
00252     }
00253
00254     if (inst->oneCnt == hdlc_TX_BITSTUFF_CNT)
00255     {
00256       inst->currOctet <<= 1;
00257       inst->currOctetBitCnt ++;
00258     inst->oneCnt = 0;
00259     }
00260
00261     /* ready to copy the encoded data byte into the buffer */
00262     inst->status = inst->status ^ (hdlc_TX_FRAME_FLAGS | hdlc_TX_FRAME_FCS);
00263     continue;
00264   }
00265
00266   /* if we are not in data or FCS state, then assume we are in flags state */
00267   /* encode flags until you reach minFlagsCnt */
00268   if (inst->flagsCnt < inst->minFlagsCnt)
00269   {
00270     inst->oneCnt = 0;
00271     inst->currOctet <<= hdlc_TX_BYTE_SIZE;
00272     inst->currOctet |=  hdlc_TX_FLAGS_BYTE;
00273     inst->currOctetBitCnt += hdlc_TX_BYTE_SIZE;
00274     inst->fcs = hdlc_TX_FCS_INIT;
00275     inst->flagsCnt ++;
00276           continue;
00277   }
00278
00279   /* we are done with the present frame, either start the new frame or return */
00280   if (inst->flagsCnt == inst->minFlagsCnt)
00281   {
00282     inst->status = inst->status ^ (hdlc_TX_FRAME_DATA | hdlc_TX_FRAME_FLAGS);
00283
00284     if (*src_idx != size)
00285     {
00286     continue;
00287     }
00288
00289     inst->status |= hdlc_TX_CONTINUE;
00290     return (inst->status);
00291   }
00292   }
00293
00294   /* if we reach here, the buffer must be full. so no need to continue */
00295   inst->status &= (~hdlc_TX_CONTINUE);
00296   return (inst->status);
00297 }
00298
00313 tuint hdlcTxFcs (hdlcTxInst_t *inst, tbool good_frame)
00314 {
00315   tword temp_byte;
00316   tuint temp_val;
00317
00318   if (inst->status & hdlc_TX_FRAME_FLAGS)
00319   {
00320     return (hdlc_TX_ERROR);
00321   }
00322
00323   /* switch the bytes of the CRC */
00324   temp_byte = inst->fcs & hdlc_TX_LSB_MASK;
00325   inst->fcs = (unsigned) inst->fcs >> hdlc_TX_BYTE_SIZE;
00326   inst->fcs |= (temp_byte << hdlc_TX_BYTE_SIZE);
00327   inst->flagsCnt = 0;
00328   inst->status = inst->status ^ (hdlc_TX_FRAME_FCS | hdlc_TX_FRAME_DATA);
00329
00330   if (good_frame == TRUE)
00331   {
00332     inst->fcs = ~(inst->fcs);
00333   }
00334
00335   temp_byte = 0;
00336   temp_val  = 0;
00337
00338   return (hdlcTxData (inst,&temp_byte,&temp_val,0));
00339 }
00340
00356 tuint hdlcTxFlags (hdlcTxInst_t *inst, tint num_flags, tint fill_pattern)
00357 {
00358   tword temp_byte;
00359   tuint i, temp_val,ret_val;
00360
00361   temp_byte = 0;
00362   temp_val = 0;
00363   ret_val = hdlcTxData (inst,&temp_byte,&temp_val,0);
00364
00365   for (i = 0;((i < num_flags) && (ret_val & hdlc_TX_CONTINUE)); i++)
00366   {
00367   inst->oneCnt = 0;
00368   inst->fcs = hdlc_TX_FCS_INIT;
00369     inst->currOctet <<= hdlc_TX_BYTE_SIZE;
00370     inst->currOctet |= fill_pattern;
00371     inst->currOctetBitCnt += hdlc_TX_BYTE_SIZE;
00372     ret_val = hdlcTxData (inst,&temp_byte,&temp_val,0);
00373   }
00374
00375   return (ret_val);
00376 }
00377
00385 tuint hdlcTxAbort (hdlcTxInst_t *inst)
00386 {
00387   tword temp_byte;
00388   tuint temp_val;
00389
00390   temp_byte = 0;
00391   temp_val = 0;
00392
00393   inst->currOctet <<= hdlc_TX_BYTE_SIZE;
00394   inst->currOctet |= hdlc_TX_ABORT_BYTE;
00395   inst->currOctetBitCnt += hdlc_TX_BYTE_SIZE;
00396   inst->status = hdlc_TX_FRAME_FLAGS;
00397   inst->fcs = hdlc_TX_FCS_INIT;
00398
00399   return (hdlcTxData (inst,&temp_byte,&temp_val,0));
00400 }
00401
00402 /* nothing past this point */


HDLC: hdlctx.h File Reference

  • File List
  • Globals

hdlctx.h File Reference

Detailed Description

Declare Function Prototypes and Type definitions for HDLC Transmit processing.

path /dsps_gtmas/ti/mas/hdlc/hdlctx.h

============================================================================ Copyright (c) 2007 – 2013 Texas Instruments Incorporated

All rights reserved not granted herein.

Limited License.

Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.

Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution

Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:

* No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.

* any redistribution and use are licensed by TI for use only with TI Devices.

* Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.

If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:

* any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.

* any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.

Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.

DISCLAIMER.

THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hdlctx.h.

#include <ti/mas/types/types.h>

Include dependency graph for hdlctx.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct | hdlcTxInit_t
HDLC TX initialization structure. More...
struct | hdlcTxInst_t
HDLC TX processing instance structure. More...

Defines

#define | hdlc_TX_CONTINUE 0x0001
#define | hdlc_TX_FRAME_DATA 0x0002
#define | hdlc_TX_FRAME_FCS 0x0004
#define | hdlc_TX_FRAME_FLAGS 0x0008
#define | hdlc_TX_ERROR 0x0010
#define | hdlc_FLAG_PATTERN 0x7E
hdlc flag sequence
#define | hdlc_IDLE_PATTERN 0xFF
hdlc idle sequence

Functions

HDLC Tx API
void | hdlcTxInit (hdlcTxInst_t *inst, hdlcTxInit_t *init)
This function initializes an instance of the HDLC transmitter module.
tuint | hdlcTxConfig (hdlcTxInst_t *inst, tword *dataBuffer, tuint size)
This function configures HDLC transmitter to process data from a buffer passed to it.
tuint | hdlcTxData (hdlcTxInst_t *inst, tword *src, tuint *src_idx, tuint size)
This function performs bit stuffing and stores the encoded data in the transmit buffer.
tuint | hdlcTxFcs (hdlcTxInst_t *inst, tbool good_frame)
This function generates the FCS bytes and one HDLC flag to mark end the current frame and stores them in the transmit buffer.
tuint | hdlcTxFlags (hdlcTxInst_t *inst, tint num_flags, tint fill_pattern)
This function generates the HDLC flags to fill the current transmit buffer.
tuint | hdlcTxAbort (hdlcTxInst_t *inst)
This function appends the abort sequence at the end of the data stream .


HDLC: hdlctx.h Source File

  • File List
  • Globals

hdlctx.h

Go to the documentation of this file.
00001 #ifndef _HDLCTX_H_
00002 #define _HDLCTX_H_
00003
00004 /* ========================================================================== */
00100 /* @{ */
00101 #include <ti/mas/types/types.h>
00102
00113 /* @{ */
00114 #define hdlc_TX_CONTINUE        0x0001
00115 #define hdlc_TX_FRAME_DATA        0x0002
00116 #define hdlc_TX_FRAME_FCS         0x0004
00117 #define hdlc_TX_FRAME_FLAGS       0x0008
00118 #define hdlc_TX_ERROR             0x0010
00119 /* @} */
00120
00126 /* @{ */
00130 #define hdlc_FLAG_PATTERN         0x7E
00131
00135 #define hdlc_IDLE_PATTERN         0xFF
00136
00137 /* @} */
00138
00150 typedef struct {
00151   tint minFlagsCnt;
00153   tint encodedDataBytePerWord;
00154   tint decodedDataBytePerWord;
00155   tbool encodedDataBigEndian;
00157   tbool decodedDataBigEndian;
00159 } hdlcTxInit_t;
00160
00169 typedef struct
00170 {
00171   tint      dataBufByteSize;
00173   tint      dataBufByteCnt;
00175   tword     *dataBufCurr;
00177   tuint     status;
00182   tulong     currOctet;
00186   tuint     currOctetBitCnt;
00188   tuint     fcs;
00190   tint      flagsCnt;
00192   tint      minFlagsCnt;
00194   tint      oneCnt;
00196   tint  encodedDataBytePerWord;
00198   tint  decodedDataBytePerWord;
00200   tuint      dataBufCnt;
00202 } hdlcTxInst_t;
00203
00219 void hdlcTxInit   (hdlcTxInst_t *inst,hdlcTxInit_t *init);
00220
00230 tuint hdlcTxConfig (hdlcTxInst_t *inst, tword *dataBuffer, tuint size);
00231
00243 tuint hdlcTxData   (hdlcTxInst_t *inst, tword *src, tuint *src_idx, tuint size);
00244
00259 tuint hdlcTxFcs    (hdlcTxInst_t *inst, tbool good_frame);
00260
00261
00262
00278 tuint hdlcTxFlags  (hdlcTxInst_t *inst, tint num_flags, tint fill_pattern);
00279
00287 tuint hdlcTxAbort  (hdlcTxInst_t *inst);
00288
00289  /* @name HDLC Tx API  */
00291
00292 /* @} */ /* ingroup */
00293
00294 #endif
00295


HDLC: HDLC (High-level Data Link Control) Package

HDLC (High-level Data Link Control) Package

Release 3.1.0.2

Page Contents

  1. Description
  2. Integration
  3. Default Configuration
  4. Performance
  5. Limitations
  6. Standards Compliance
  7. Dependent Packages

Description

HDLC is a protocol designed for transmitting data between two points. In HDLC, data is organized into a unit (called a frame) and sent across a network to a destination that verifies its successful arrival or if an error occurred during the transmission. The HDLC protocol also manages the flow or pacing at which data is sent. HDLC is used in what is Layer 2 of the OSI industry communication reference model. (Layer 1 is the detailed physical level that involves actually generating and receiving the electronic signals.

The flag is a sequence 01111110 which delimits the start of the frame. A technique known as "bit stuffing" is used to insert additional zeros into the data so that a flag sequence never appears anywhere but at the start and end of a frame. These extra bits are "unstuffed" again by the receiver. The address field is usually one byte, but may be more. The control field is one or more bytes. It contains information on the type of frame. The "payload" of the frame is the data field. Following the data field are two bytes comprising the Cyclic Redundancy Check (CRC). Finally, the frame is terminated by another flag character. The High-level Data Link Control (HDLC) processing software allows the user to perform HDLC formatting and de-formatting of transmit and receive data streams.

Integration

The HDLC component can be integrated into a system and provide reliable HDLC processing following the link below. There, we descibe the build process, integration/link process and global structure initialization requirements.

Object deliveries come with the libraries built and ready for integration. Accordingly, the build process only applies to Source deliveries in which the HDLC code may be customized and the libraries built.

Note:
  1. Source deliveries come with libraries pre-built. The build process is only required if changes to the source code are made.

Additional links: | HDLC External API
 | HDLC Integration

Default Configuration

None

Performance

For MIPS and memory information proceed to the links provided below

Additional links: HDLC Performance

Limitations

None

Standards Compliance

The HDLC frame format and the checksum algorithm is defined in the ITU X.25 LAPB specification [2]. The frame structure is also consistent with ISO Standard 4435:1979 [1].

Dependent Packages

The HDLC package depends on the following packages for build and/or integration. The specific versions and compatibility keys are provided in the HDLC release notes.

  1. ti.mas.types (Common data type defintions)
  2. ti.mas.util (Common utilities)
  3. ti.mas.swtools (Internally used s/w tools)


HDLC: HDLC Integration

HDLC (High-level Data Link Control) Package

HDLC Integration

Page Contents

  • XDC Build Process
  • Make Build Process
  • Linking HDLC with System

XDC Build Process

Required Tools

The following tools are required to build the HDLC component (links provided). Download and install all tools to a single local (C:) directory, for example c:\tools.

  1. Code Generation (download)
    • C55xx: CG Tools version:
    • C64xx: CG Tools version
  2. XDC (download)
    • XDC Tools version
  3. xDAIS (download)
    • xDAIS Developer's Kit version

Note:
  1. A "My.TI" account is required for download and can be registered at http://my.ti.com.

Windows Configuration

Once all tools are properly installed, the environment will need to be configured to recognize the tool paths. A Windows batch file should be created to provide a consistent manner to achieve this. The example below can used (cut & paste) to create a setenv.bat batch file in the ...\ti\mas\swtools directory.

Assumptions:
  1. The XDC tools were installed in c:\tools
  2. The C55 code generation tools were installed in c:\tools\cgen_<ver>
  3. The C64 code generation tools were installed in c:\tools\cgen_<ver>
  4. The xDAIS developr's kit was installed in c:\tools\xdais_<ver>

    @echo off
    rem # *************************************************************************
    rem # *** Version information (ONLY EDIT THIS SECTION)
    rem # *************************************************************************
    set LOCAL_TOOLSDIR=tools
    set XDCBASE=xdctools_<ver>
    set C55CODEGENBASE=cgen_<ver>
    set C64CODEGENBASE=cgen_<ver>
    set XDAISBASE=xdais_<ver>

    rem # *************************************************************************
    rem # *** Set up tools directory
    rem # *************************************************************************
    set LOCAL_TOOLSDIR_DOS=c:\%LOCAL_TOOLSDIR%

    rem # *************************************************************************
    rem # ** Set code generation tools path
    rem # *************************************************************************
    set C55CODEGENTOOL=%LOCAL_TOOLSDIR_DOS%\%C55CODEGENBASE%
    set C64CODEGENTOOL=%LOCAL_TOOLSDIR_DOS%\%C64CODEGENBASE%

    rem # *************************************************************************
    rem # ** Set the PATH
    rem # *************************************************************************
    set PATH=%SystemRoot%;%SystemRoot%\system32
    set PATH=%PATH%;%LOCAL_TOOLSDIR_DOS%\%XDCBASE%

    rem # *************************************************************************
    rem # ** Create environment variables for XDC
    rem # *************************************************************************
    set XDCCGROOT=%LOCAL_TOOLSDIR_DOS%
    set xdc=\%LOCAL_TOOLSDIR%\%XDCBASE%\xdc.exe $*

    rem # *************************************************************************
    rem # ** Set the XDC PATH
    rem # *************************************************************************
    set XDCPATH=%LOCAL_TOOLSDIR_DOS%\%XDCBASE%\packages
    set XDCPATH=%XDCPATH%;%LOCAL_TOOLSDIR_DOS%\%XDAISBASE%\packages

    rem # *************************************************************************
    rem # ** Identify the config.bld file
    rem # *************************************************************************
    xs -f setconfig.js
    call tempcfg
    del tempcfg.bat

    rem # End of file

Linux Configuration

TBD

Compilation

To build the HDLC package, ensure (again) that all packages provided with the build have been extracted to a common working directory (as described in HDLC Integration). Change to the swtools directory and configure the build environment by executing the setenv.bat batch file. To build the HDLC using the XDC tools, change to the HDLC directory and proceed.

With the environment configured, XDC may be eployed to build the HDLC and its dependent packages. The four XDC commands below are all that is needed to clean and build any of the HDLC packages. The first two commands provide a means to clean and build the HDLC package (alone). Nothing further is needed unless the source for a dependent packages has changed.

If the source for any of the dependent packages has changed, commands (3) and (4) below provide a mechanism to clean and build both the HDLC and all dependent packages.

Note:
  1. In the above, the <WORK>/ti/mas/ path is assumed and just the sub-directories are specified (e.g., HDLC).

The XDC environment provides several build options.

  1. xdc clean
    • Removes all generated HDLC build files
    • Analagous to "make clean"

  2. xdc XDCARGS="c<rtarg> obj"
    • Builds the HDLC for the target specified by <rtarg> (see Dependent Packages)

  3. xdc XDCARGS="c<rtarg> obj" -PD .
    • Builds the HDLC as in (2) above
    • The "-PD ." option ensures that all dependent packages are built as well (if needed).

  4. xdc clean -PD .
    • Removes all generated HDLC build files as in (1) above
    • Removes all generated build files for all HDLC dependent packages

Make Build Process

Each MAS component that generates a library or an executable artifact creates, as part of the build process, a GNU "makefile" in its root folder. This makefile provides the list of all tools and common build utilities required for generating the respective artifacts.

For each artifact generated by the package there is an additonal target makefile kept at the destination directory of the artifact. The top-level "makefile" recursively invokes each artifact makefile as required by the component build.

Procedure

The build procedure using make rather than the XDC tools follows:

Required Tools:

  1. Cygwin tools (Windows only) (Verified with Cygwin version 1.18)
  2. Texas Instruments Codegen Tools for the target processor

Procedure:

  1. Add "cygwin/bin" to the environment PATH (Windows only)
  2. Correct the XXX_GEN_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XXX_GEN_INSTALL_DIR in the environment with the correct tools PATH.
  3. Correct the MAS_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the MAS_INSTALL_DIR in the environment to match the installation PATH.
  4. Correct the XDAIS_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XDAIS_INSTALL_DIR in the environment with the correct tools PATH.
  5. Correct the XDC_INSTALL_DIR path in the "makefile" by:
    1. Directly modifying the makefile.
    2. Setting the XDC_INSTALL_DIR in the environment with the correct tools PATH.
  6. The make targets supported are:
    1. "all": Build all library and executable artifacts. For executable it recursively builds all the dependent components as well.
    2. "clean": Clean all generated object files and artifacts
    3. "cleanall": Cleans all generated artifacts of the components as well its dependent component.

Notes:
  1. If you are building C55x library (for example), correct the C55x tools path only. You can ignore other codegen tool paths.
  2. Ignore steps 4 - 5 if not using XDAIS

Linking HDLC with System

The HDLC and each of its dependent packages (see Dependent Packages) should be expanded (unzipped) to a common working directory (<WORK>). This will create the following directory structure under the common directory.

  <WORK>/ti/mas/asm
               /hdlc
               /swtools
               /types
               /util

Note:
  1. This directory structure and its content should be maintained to allow subsequent compilation.

Include Requirements

The following header files must be included in any source file that references the HDLC API:

  1. #include <ti/mas/types/types.h>
  2. #include <ti/mas/hdlc/hdlcrx.h>
  3. #include <ti/mas/hdlc/hdlctx.h>

The compile-time option below is required such that <WORK> resides in the compiler's include path.

  1. -i <WORK>

Where WORK is the path to the working directory.

Compile Defines

When compiling source files that include RTSC package header files (e.g., hdlcrx.h or hdlctx.h) the following compiler option must be specified:

  1. -Dti_targets_<xtarg>

Note:
  1. <xtarg> represents the target platform using the XDC naming convention (see Dependent Packages).

Linking

The following libraries must be included in the final link:

  1. ti\mas\util\lib\util_a.a<rtarg>
  2. ti\mas\util\lib\util_c.a<rtarg>
  3. **ti\mas\hdlc\lib\hdlc_a.a<rtarg>
  4. ti\mas\hdlc\lib\hdlc_c.a<rtarg>
**Only required for C55x

Target Naming Conventions
Target | RTSC Naming (<rtarg>) | XDC Naming (<xtarg>)
C55x Large Memory Model | 55l | C55_large
C64x COFF Little Endian | 64 | C64
C64x COFF Big Endian | 64e | C64_big_endian
C64x+ COFF Little Endian | 64P | C64P
C64x+ COFF Big Endian | 64Pe | C64P_big_endian
C64x+ ELF Little Endian | e64P | C64P_elf
C64x+ ELF Big Endian | e64Pe | C64P_big_endian_elf
C66x COFF Little Endian | 66 | C66
C66x COFF Big Endian | 66e | C66_big_endian
C66x+ ELF Little Endian | e66 | C66_elf
C66x+ ELF Big Endian | e66e | C66_big_endian_elf


HDLC: Module Index

HDLC Modules

Here is a list of all modules:
  • HDLC Receiver
    • HDLC Rx status
  • HDLC Transmitter
    • HDLC Tx status
    • HDLC Fill Pattern


HDLC: Page Index

HDLC Related Pages

Here is a list of all related documentation pages:
  • C55x Data Sheet
  • C64x+ Data Sheet
  • History
  • Disclaimer


HDLC: HDLC Performance

HDLC (High-level Data Link Control) Package

HDLC Performance

  • C55x Data Sheet
  • C64x+ Data Sheet


HDLC: History

History

Revision History

Version | Comments
1.0.0.0 | Initial Version


HDLC: hdlcRxInit_t Struct Reference

  • Data Structures
  • Data Fields

hdlcRxInit_t Struct Reference
[HDLC Receiver]

#include <hdlcrx.h>

Detailed Description

HDLC RX initialization structure.

The HDLC RX instance can be initialized into different modes as required. These modes allow the user to use big-endian or little-endian notation for the data that is being decoded or the decoded data. The user can also specify if encoded or decoded data bytes are packed or if they are unpacked (one byte of data per word).

Definition at line 139 of file hdlcrx.h.

Data Fields

tint | encodedDataBytePerWord
tint | decodedDataBytePerWord
tbool | encodedDataBigEndian
tbool | decodedDataBigEndian

Field Documentation

tint hdlcRxInit_t::encodedDataBytePerWord

Size of encoded data word (1 or 2 bytes per word)

Definition at line 140 of file hdlcrx.h.

Referenced by hdlcRxInit().

The documentation for this struct was generated from the following file:
  • hdlcrx.h


HDLC: hdlcRxInst_t Struct Reference

  • Data Structures
  • Data Fields

hdlcRxInst_t Struct Reference
[HDLC Receiver]

#include <hdlcrx.h>

Detailed Description

HDLC RX processing instance structure.

All variables for an HDLC channel receive processing are in the instance. The instance is passed to all HDLC RX functions for decoding the HDLC data.

Definition at line 165 of file hdlcrx.h.

Data Fields

tint | dataBufBitSize
tint | dataBufBitCnt
tword * | dataBufCurr
tword | currOctet
tulong | dataRegister
tuint | state
tint | dataRegisterBitCnt
tint | dataByteCnt
tuint | dataFcs
tint | encodedDataSizeBits
tint | decodedDataBytePerWord
tuint | dataBufCnt

Field Documentation

tint hdlcRxInst_t::dataBufBitSize

size of the buffer to be decoded in bits

Definition at line 167 of file hdlcrx.h.

Referenced by hdlcRx(), and hdlcRxConfig().

The documentation for this struct was generated from the following file:
  • hdlcrx.h


HDLC: hdlcTxInit_t Struct Reference

  • Data Structures
  • Data Fields

hdlcTxInit_t Struct Reference
[HDLC Transmitter]

#include <hdlctx.h>

Detailed Description

HDLC TX initialization structure.

The HDLC TX instance can be initialized into different modes as required. These modes allow the user to use big-endian or little-endian notation for the data that is being decoded or the decoded data. The user can also specify if encoded or decoded data bytes are packed or if they are unpacked (one byte of data per word).

Definition at line 150 of file hdlctx.h.

Data Fields

tint | minFlagsCnt
tint | encodedDataBytePerWord
tint | decodedDataBytePerWord
tbool | encodedDataBigEndian
tbool | decodedDataBigEndian

Field Documentation

tint hdlcTxInit_t::minFlagsCnt

minimum number of flags to be generated between frames

Definition at line 151 of file hdlctx.h.

Referenced by hdlcTxInit().

tint hdlcTxInit_t::encodedDataBytePerWord

Size of encoded data word (1 or 2 bytes per word)

Definition at line 153 of file hdlctx.h.

Referenced by hdlcTxInit().

tint hdlcTxInit_t::decodedDataBytePerWord

Size of the decoded data word (1 or 2 bytes per word)

Definition at line 154 of file hdlctx.h.

Referenced by hdlcTxInit().

tbool hdlcTxInit_t::encodedDataBigEndian

TRUE for big-endian byte notation.
FALSE for little-endian byte notation.

Definition at line 155 of file hdlctx.h.

tbool hdlcTxInit_t::decodedDataBigEndian

TRUE for big-endian byte notation.
FALSE for little-endian byte notation.

Definition at line 157 of file hdlctx.h.

The documentation for this struct was generated from the following file:
  • hdlctx.h


HDLC: hdlcTxInst_t Struct Reference

  • Data Structures
  • Data Fields

hdlcTxInst_t Struct Reference
[HDLC Transmitter]

#include <hdlctx.h>

Detailed Description

HDLC TX processing instance structure.

All variables for an HDLC channel transmit processing are in the instance. The instance is passed to all HDLC TX functions for encoding the HDLC data.

Definition at line 169 of file hdlctx.h.

Data Fields

tint | dataBufByteSize
tint | dataBufByteCnt
tword * | dataBufCurr
tuint | status
tulong | currOctet
tuint | currOctetBitCnt
tuint | fcs
tint | flagsCnt
tint | minFlagsCnt
tint | oneCnt
tint | encodedDataBytePerWord
tint | decodedDataBytePerWord
tuint | dataBufCnt

Field Documentation

tint hdlcTxInst_t::dataBufByteSize

number of data bytes that are remaining to be encoded in the provided buffer for encoded data

Definition at line 171 of file hdlctx.h.

Referenced by hdlcTxConfig(), and hdlcTxData().

tint hdlcTxInst_t::dataBufByteCnt

number of bytes encoded so far in the buffer so far

Definition at line 173 of file hdlctx.h.

Referenced by hdlcTxConfig(), and hdlcTxData().

tword* hdlcTxInst_t::dataBufCurr

pointer to the current location of the word we are writing to

Definition at line 175 of file hdlctx.h.

Referenced by hdlcTxConfig(), and hdlcTxData().

tuint hdlcTxInst_t::status

Definition at line 177 of file hdlctx.h.

Referenced by hdlcTxAbort(), hdlcTxConfig(), hdlcTxData(), hdlcTxFcs(), and hdlcTxInit().

tulong hdlcTxInst_t::currOctet

The status variable is used to report to the calling function the current state of processing data of the HDLC TX software. It is also used as the state variable to determine how the data will be encoded shift register used for the encoded data, when copy data to the encoded data buffer when we have atleast one byte of data in the currOctet

Definition at line 182 of file hdlctx.h.

Referenced by hdlcTxAbort(), hdlcTxData(), and hdlcTxFlags().

tuint hdlcTxInst_t::currOctetBitCnt

number of encoded bits in the currOctet

Definition at line 186 of file hdlctx.h.

Referenced by hdlcTxAbort(), hdlcTxData(), hdlcTxFlags(), and hdlcTxInit().

tuint hdlcTxInst_t::fcs

current encoded FCS

Definition at line 188 of file hdlctx.h.

Referenced by hdlcTxAbort(), hdlcTxData(), hdlcTxFcs(), hdlcTxFlags(), and hdlcTxInit().

tint hdlcTxInst_t::flagsCnt

number of flags generated so far

Definition at line 190 of file hdlctx.h.

Referenced by hdlcTxFcs(), and hdlcTxInit().

tint hdlcTxInst_t::minFlagsCnt

minimum number of flags that must be generated between frames

Definition at line 192 of file hdlctx.h.

Referenced by hdlcTxInit().

tint hdlcTxInst_t::oneCnt

counter to count the number of one bits that have been encoded so far

Definition at line 194 of file hdlctx.h.

Referenced by hdlcTxData(), hdlcTxFlags(), and hdlcTxInit().

tint hdlcTxInst_t::encodedDataBytePerWord

size of the encoded data word

Definition at line 196 of file hdlctx.h.

Referenced by hdlcTxInit().

tint hdlcTxInst_t::decodedDataBytePerWord

size of the decoded data word

Definition at line 198 of file hdlctx.h.

Referenced by hdlcTxInit().

tuint hdlcTxInst_t::dataBufCnt

byte offset is now included in the instance

Definition at line 200 of file hdlctx.h.

Referenced by hdlcTxConfig(), hdlcTxData(), and hdlcTxInit().

The documentation for this struct was generated from the following file:
  • hdlctx.h


HDLC Test: Data Structures

  • Data Structures
  • Data Fields

HDLC Test Data Structures

Here are the data structures with brief descriptions:
hdlcInst_t


HDLC Test: Unit Test Configuration and Execution

Unit Test Configuration and Execution

  1. Run the simulation to completion.
  2. The passed or failed result will be printed on the screen.


HDLC Test: doxygen.h File Reference

  • File List
  • Globals

doxygen.h File Reference

Go to the source code of this file.


HDLC Test: doxygen.h Source File

  • File List
  • Globals

doxygen.h

Go to the documentation of this file.
00001 /*
00002  * This is a little header file which doxygen parses to generate the main
00003  * documentation page
00004  */
00005


HDLC Test: File Index

  • File List
  • Globals

HDLC Test File List

Here is a list of all files with brief descriptions:
doxygen.h [code] |
hdlcsim.c [code] | Main routine for simulating HDLC processing


HDLC Test: Data Fields

  • Data Structures
  • Data Fields
  • All
  • Variables
Here is a list of all struct and union fields with links to the structures/unions they belong to:

  • hdlcRxInst : hdlcInst_t
  • hdlcTxInst : hdlcInst_t


HDLC Test: Data Fields - Variables

  • Data Structures
  • Data Fields
  • All
  • Variables

  • hdlcRxInst : hdlcInst_t
  • hdlcTxInst : hdlcInst_t


HDLC Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines
  • b
  • d
  • h
  • m
  • r
  • t

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- b -

  • bytesRx : hdlcsim.c
  • bytesSent : hdlcsim.c

- d -

  • dataBuf : hdlcsim.c

- h -

  • hdlc_TEST_DEC_BYTES_PER_WORD : hdlcsim.c
  • hdlc_TEST_ENC_BYTES_PER_WORD : hdlcsim.c
  • hdlc_TEST_FCS_SIZE_BYTES : hdlcsim.c
  • hdlc_TEST_MAX_NBYTES : hdlcsim.c
  • hdlc_TEST_NUM_FRAMES : hdlcsim.c
  • hdlc_TEST_NUMOF_ABORT_FLAGS : hdlcsim.c
  • hdlc_TEST_NUMOF_OPENING_FLAGS : hdlcsim.c
  • hdlc_TEST_SIM_DATA_BYTE_CNT : hdlcsim.c
  • hdlc_TEST_SIM_FCS_BAD : hdlcsim.c
  • hdlc_TEST_SIM_FCS_GOOD : hdlcsim.c
  • hdlc_TEST_SIM_FCS_UNKNOWN : hdlcsim.c
  • hdlc_TEST_TX_ABORT_BYTE : hdlcsim.c
  • hdlc_TEST_TX_BITSTUFF_CNT : hdlcsim.c
  • hdlc_TEST_TX_BYTE_SIZE : hdlcsim.c
  • hdlc_TEST_TX_FCS_INIT : hdlcsim.c
  • hdlc_TEST_TX_FLAGS_BYTE : hdlcsim.c
  • hdlc_TEST_TX_LSB_MASK : hdlcsim.c
  • hdlc_TEST_TX_MIN_FLAG_CNT : hdlcsim.c
  • hdlc_TEST_TX_MSB_MASK : hdlcsim.c
  • hdlcDecData : hdlcsim.c
  • hdlcEncData : hdlcsim.c
  • hdlcFcsTable : hdlcsim.c
  • hdlcInst : hdlcsim.c
  • hdlcProcessRx() : hdlcsim.c
  • hdlcProcessTx() : hdlcsim.c
  • hdlcRxInitCfg() : hdlcsim.c
  • hdlcTxInitCfg() : hdlcsim.c

- m -

  • main() : hdlcsim.c

- r -

  • rxHDLCFcsStatus : hdlcsim.c

- t -

  • txHDLCFcs : hdlcsim.c


HDLC Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines

  • hdlc_TEST_DEC_BYTES_PER_WORD : hdlcsim.c
  • hdlc_TEST_ENC_BYTES_PER_WORD : hdlcsim.c
  • hdlc_TEST_FCS_SIZE_BYTES : hdlcsim.c
  • hdlc_TEST_MAX_NBYTES : hdlcsim.c
  • hdlc_TEST_NUM_FRAMES : hdlcsim.c
  • hdlc_TEST_NUMOF_ABORT_FLAGS : hdlcsim.c
  • hdlc_TEST_NUMOF_OPENING_FLAGS : hdlcsim.c
  • hdlc_TEST_SIM_DATA_BYTE_CNT : hdlcsim.c
  • hdlc_TEST_SIM_FCS_BAD : hdlcsim.c
  • hdlc_TEST_SIM_FCS_GOOD : hdlcsim.c
  • hdlc_TEST_SIM_FCS_UNKNOWN : hdlcsim.c
  • hdlc_TEST_TX_ABORT_BYTE : hdlcsim.c
  • hdlc_TEST_TX_BITSTUFF_CNT : hdlcsim.c
  • hdlc_TEST_TX_BYTE_SIZE : hdlcsim.c
  • hdlc_TEST_TX_FCS_INIT : hdlcsim.c
  • hdlc_TEST_TX_FLAGS_BYTE : hdlcsim.c
  • hdlc_TEST_TX_LSB_MASK : hdlcsim.c
  • hdlc_TEST_TX_MIN_FLAG_CNT : hdlcsim.c
  • hdlc_TEST_TX_MSB_MASK : hdlcsim.c


HDLC Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines

  • hdlcProcessRx() : hdlcsim.c
  • hdlcProcessTx() : hdlcsim.c
  • hdlcRxInitCfg() : hdlcsim.c
  • hdlcTxInitCfg() : hdlcsim.c
  • main() : hdlcsim.c


HDLC Test: Data Fields

  • File List
  • Globals
  • All
  • Functions
  • Variables
  • Defines

  • bytesRx : hdlcsim.c
  • bytesSent : hdlcsim.c
  • dataBuf : hdlcsim.c
  • hdlcDecData : hdlcsim.c
  • hdlcEncData : hdlcsim.c
  • hdlcFcsTable : hdlcsim.c
  • hdlcInst : hdlcsim.c
  • rxHDLCFcsStatus : hdlcsim.c
  • txHDLCFcs : hdlcsim.c


HDLC Test: HDLCTEST

HDLCTEST

Detailed Description

Data Structures

struct | hdlcInst_t

Defines

#define | hdlc_TEST_MAX_NBYTES 64
#define | hdlc_TEST_SIM_DATA_BYTE_CNT 64
#define | hdlc_TEST_NUM_FRAMES (hdlc_TEST_SIM_DATA_BYTE_CNT/hdlc_TEST_N_BYTES)
#define | hdlc_TEST_NUMOF_OPENING_FLAGS 3
#define | hdlc_TEST_NUMOF_ABORT_FLAGS 4
#define | hdlc_TEST_ENC_BYTES_PER_WORD 1
#define | hdlc_TEST_DEC_BYTES_PER_WORD 1
#define | hdlc_TEST_FCS_SIZE_BYTES 2
#define | hdlc_TEST_TX_FCS_INIT 0xFFFF
#define | hdlc_TEST_TX_FLAGS_BYTE 0x007E
#define | hdlc_TEST_TX_ABORT_BYTE 0x00FE
#define | hdlc_TEST_TX_BYTE_SIZE 8
#define | hdlc_TEST_TX_MSB_MASK 0xFF00
#define | hdlc_TEST_TX_LSB_MASK 0x00FF
#define | hdlc_TEST_TX_MIN_FLAG_CNT 1
#define | hdlc_TEST_TX_BITSTUFF_CNT 5
#define | hdlc_TEST_SIM_FCS_UNKNOWN -1
#define | hdlc_TEST_SIM_FCS_GOOD 0
#define | hdlc_TEST_SIM_FCS_BAD 1

Functions

void | hdlcTxInitCfg (hdlcTxInit_t *init)
void | hdlcRxInitCfg (hdlcRxInit_t *init)
tuint | hdlcProcessTx (hdlcInst_t *inst, tword *srcBuf, tword *dstBuf)
tuint | hdlcProcessRx (hdlcInst_t *inst, tword *encBuf, tword *rawDataBuf, tint len)
void | main (void)

Variables

tword | dataBuf [hdlc_TEST_MAX_NBYTES]
tuint | txHDLCFcs = 0
tint | rxHDLCFcsStatus = hdlc_TEST_SIM_FCS_UNKNOWN
hdlcInst_t hdlcInst
const tuint | hdlcFcsTable []
tword | hdlcEncData [2 *hdlc_TEST_MAX_NBYTES]
tword | hdlcDecData [2 *hdlc_TEST_MAX_NBYTES]
tuint | bytesSent
tuint | bytesRx

Define Documentation

#define hdlc_TEST_MAX_NBYTES 64

Definition at line 84 of file hdlcsim.c.

Referenced by hdlcProcessRx(), hdlcProcessTx(), and main().

#define hdlc_TEST_SIM_DATA_BYTE_CNT 64

Definition at line 85 of file hdlcsim.c.

#define hdlc_TEST_NUM_FRAMES (hdlc_TEST_SIM_DATA_BYTE_CNT/hdlc_TEST_N_BYTES)

Definition at line 86 of file hdlcsim.c.

#define hdlc_TEST_NUMOF_OPENING_FLAGS 3

Definition at line 88 of file hdlcsim.c.

Referenced by hdlcTxInitCfg().

#define hdlc_TEST_NUMOF_ABORT_FLAGS 4

Definition at line 89 of file hdlcsim.c.

Referenced by hdlcProcessTx().

#define hdlc_TEST_ENC_BYTES_PER_WORD 1

Definition at line 90 of file hdlcsim.c.

Referenced by hdlcRxInitCfg(), and hdlcTxInitCfg().

#define hdlc_TEST_DEC_BYTES_PER_WORD 1

Definition at line 91 of file hdlcsim.c.

Referenced by hdlcRxInitCfg(), and hdlcTxInitCfg().

#define hdlc_TEST_FCS_SIZE_BYTES 2

Definition at line 93 of file hdlcsim.c.

Referenced by hdlcProcessTx().

#define hdlc_TEST_TX_FCS_INIT 0xFFFF

Definition at line 96 of file hdlcsim.c.

#define hdlc_TEST_TX_FLAGS_BYTE 0x007E

Definition at line 97 of file hdlcsim.c.

#define hdlc_TEST_TX_ABORT_BYTE 0x00FE

Definition at line 98 of file hdlcsim.c.

#define hdlc_TEST_TX_BYTE_SIZE 8

Definition at line 99 of file hdlcsim.c.

#define hdlc_TEST_TX_MSB_MASK 0xFF00

Definition at line 100 of file hdlcsim.c.

#define hdlc_TEST_TX_LSB_MASK 0x00FF

Definition at line 101 of file hdlcsim.c.

#define hdlc_TEST_TX_MIN_FLAG_CNT 1

Definition at line 102 of file hdlcsim.c.

#define hdlc_TEST_TX_BITSTUFF_CNT 5

Definition at line 103 of file hdlcsim.c.

#define hdlc_TEST_SIM_FCS_UNKNOWN -1

Definition at line 105 of file hdlcsim.c.

#define hdlc_TEST_SIM_FCS_GOOD 0

Definition at line 106 of file hdlcsim.c.

Referenced by hdlcProcessRx(), and main().

#define hdlc_TEST_SIM_FCS_BAD 1

Definition at line 107 of file hdlcsim.c.

Referenced by hdlcProcessRx(), and main().

Function Documentation

void hdlcTxInitCfg ( hdlcTxInit_t * init )

Definition at line 126 of file hdlcsim.c.

References hdlc_TEST_DEC_BYTES_PER_WORD, hdlc_TEST_ENC_BYTES_PER_WORD, hdlc_TEST_NUMOF_OPENING_FLAGS, hdlcInst, and hdlcInst_t::hdlcTxInst.

Referenced by main().

void hdlcRxInitCfg ( hdlcRxInit_t * init )

Definition at line 146 of file hdlcsim.c.

References hdlc_TEST_DEC_BYTES_PER_WORD, hdlc_TEST_ENC_BYTES_PER_WORD, hdlcInst, and hdlcInst_t::hdlcRxInst.

Referenced by main().

tuint hdlcProcessTx | ( | hdlcInst_t * | inst,
 |  | tword * | srcBuf,
 |  | tword * | dstBuf
 | ) |  |

Definition at line 157 of file hdlcsim.c.

References bytesSent, dataBuf, hdlc_TEST_FCS_SIZE_BYTES, hdlc_TEST_MAX_NBYTES, hdlc_TEST_NUMOF_ABORT_FLAGS, hdlcInst_t::hdlcTxInst, and txHDLCFcs.

Referenced by main().

tuint hdlcProcessRx | ( | hdlcInst_t * | inst,
 |  | tword * | encBuf,
 |  | tword * | rawDataBuf,
 |  | tint | len
 | ) |  |

Definition at line 206 of file hdlcsim.c.

References hdlc_TEST_MAX_NBYTES, hdlc_TEST_SIM_FCS_BAD, hdlc_TEST_SIM_FCS_GOOD, hdlcInst_t::hdlcRxInst, and rxHDLCFcsStatus.

Referenced by main().

void main ( void )

Definition at line 239 of file hdlcsim.c.

References bytesRx, bytesSent, dataBuf, hdlc_TEST_MAX_NBYTES, hdlc_TEST_SIM_FCS_BAD, hdlc_TEST_SIM_FCS_GOOD, hdlcDecData, hdlcEncData, hdlcInst, hdlcProcessRx(), hdlcProcessTx(), hdlcRxInitCfg(), hdlcTxInitCfg(), and rxHDLCFcsStatus.

Here is the call graph for this function:

Variable Documentation

tword dataBuf[hdlc_TEST_MAX_NBYTES]

Definition at line 116 of file hdlcsim.c.

Referenced by hdlcProcessTx(), and main().

tuint txHDLCFcs = 0

Definition at line 118 of file hdlcsim.c.

Referenced by hdlcProcessTx().

tint rxHDLCFcsStatus = hdlc_TEST_SIM_FCS_UNKNOWN

Definition at line 119 of file hdlcsim.c.

Referenced by hdlcProcessRx(), and main().

hdlcInst_t hdlcInst

Definition at line 121 of file hdlcsim.c.

Referenced by hdlcRxInitCfg(), hdlcTxInitCfg(), and main().

const tuint hdlcFcsTable[]

tword hdlcEncData[2 *hdlc_TEST_MAX_NBYTES]

Definition at line 237 of file hdlcsim.c.

Referenced by main().

tword hdlcDecData[2 *hdlc_TEST_MAX_NBYTES]

Definition at line 237 of file hdlcsim.c.

Referenced by main().

tuint bytesSent

Definition at line 238 of file hdlcsim.c.

Referenced by hdlcProcessTx(), and main().

tuint bytesRx

Definition at line 238 of file hdlcsim.c.

Referenced by main().


HDLC Test: hdlcsim.c File Reference

  • File List
  • Globals

hdlcsim.c File Reference

Detailed Description

Main routine for simulating HDLC processing.

Remarks:
This source file contains functions, variables, and processing code designed to provide a simulation of the HDLC software.
Copyright (c) 2007 – 2013 Texas Instruments Incorporated

All rights reserved not granted herein.

Limited License.

Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI (“TI Devices”). No hardware patent is licensed hereunder.

Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution

Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:

* No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.

* any redistribution and use are licensed by TI for use only with TI Devices.

* Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.

If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:

* any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.

* any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.

Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.

DISCLAIMER.

THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hdlcsim.c.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ti/mas/hdlc/hdlctx.h>
#include <ti/mas/hdlc/hdlcrx.h>
#include <ti/mas/util/pkt.h>
#include <ti/mas/util/utl.h>

Include dependency graph for hdlcsim.c:

Go to the source code of this file.

Data Structures

struct | hdlcInst_t

Defines

#define | hdlc_TEST_MAX_NBYTES 64
#define | hdlc_TEST_SIM_DATA_BYTE_CNT 64
#define | hdlc_TEST_NUM_FRAMES (hdlc_TEST_SIM_DATA_BYTE_CNT/hdlc_TEST_N_BYTES)
#define | hdlc_TEST_NUMOF_OPENING_FLAGS 3
#define | hdlc_TEST_NUMOF_ABORT_FLAGS 4
#define | hdlc_TEST_ENC_BYTES_PER_WORD 1
#define | hdlc_TEST_DEC_BYTES_PER_WORD 1
#define | hdlc_TEST_FCS_SIZE_BYTES 2
#define | hdlc_TEST_TX_FCS_INIT 0xFFFF
#define | hdlc_TEST_TX_FLAGS_BYTE 0x007E
#define | hdlc_TEST_TX_ABORT_BYTE 0x00FE
#define | hdlc_TEST_TX_BYTE_SIZE 8
#define | hdlc_TEST_TX_MSB_MASK 0xFF00
#define | hdlc_TEST_TX_LSB_MASK 0x00FF
#define | hdlc_TEST_TX_MIN_FLAG_CNT 1
#define | hdlc_TEST_TX_BITSTUFF_CNT 5
#define | hdlc_TEST_SIM_FCS_UNKNOWN -1
#define | hdlc_TEST_SIM_FCS_GOOD 0
#define | hdlc_TEST_SIM_FCS_BAD 1

Functions

void | hdlcTxInitCfg (hdlcTxInit_t *init)
void | hdlcRxInitCfg (hdlcRxInit_t *init)
tuint | hdlcProcessTx (hdlcInst_t *inst, tword *srcBuf, tword *dstBuf)
tuint | hdlcProcessRx (hdlcInst_t *inst, tword *encBuf, tword *rawDataBuf, tint len)
void | main (void)

Variables

tword | dataBuf [hdlc_TEST_MAX_NBYTES]
tuint | txHDLCFcs = 0
tint | rxHDLCFcsStatus = hdlc_TEST_SIM_FCS_UNKNOWN
hdlcInst_t hdlcInst
const tuint | hdlcFcsTable []
tword | hdlcEncData [2 *hdlc_TEST_MAX_NBYTES]
tword | hdlcDecData [2 *hdlc_TEST_MAX_NBYTES]
tuint | bytesSent
tuint | bytesRx


HDLC Test: hdlcsim.c Source File

  • File List
  • Globals

hdlcsim.c

Go to the documentation of this file.
00001
00073 /* @{ */
00074
00075 #include <stdio.h>
00076 #include <stdlib.h>
00077 #include <string.h>
00078 #include <ti/mas/hdlc/hdlctx.h>
00079 #include <ti/mas/hdlc/hdlcrx.h>
00080 #include <ti/mas/util/pkt.h>
00081 #include <ti/mas/util/utl.h>
00082
00083 #undef  hdlc_TEST_MAX_NBYTES
00084 #define hdlc_TEST_MAX_NBYTES            64
00085 #define hdlc_TEST_SIM_DATA_BYTE_CNT     64
00086 #define hdlc_TEST_NUM_FRAMES          (hdlc_TEST_SIM_DATA_BYTE_CNT/hdlc_TEST_N_BYTES)
00087 #undef  hdlc_TEST_NUMOF_OPENING_FLAGS
00088 #define hdlc_TEST_NUMOF_OPENING_FLAGS 3
00089 #define hdlc_TEST_NUMOF_ABORT_FLAGS   4
00090 #define hdlc_TEST_ENC_BYTES_PER_WORD  1
00091 #define hdlc_TEST_DEC_BYTES_PER_WORD  1
00092 #undef  hdlc_TEST_FCS_SIZE_BYTES
00093 #define hdlc_TEST_FCS_SIZE_BYTES      2
00094
00095 /* Do not Change the Following Definitions */
00096 #define hdlc_TEST_TX_FCS_INIT       0xFFFF
00097 #define hdlc_TEST_TX_FLAGS_BYTE     0x007E
00098 #define hdlc_TEST_TX_ABORT_BYTE     0x00FE
00099 #define hdlc_TEST_TX_BYTE_SIZE      8
00100 #define hdlc_TEST_TX_MSB_MASK       0xFF00
00101 #define hdlc_TEST_TX_LSB_MASK       0x00FF
00102 #define hdlc_TEST_TX_MIN_FLAG_CNT   1
00103 #define hdlc_TEST_TX_BITSTUFF_CNT   5
00104
00105 #define hdlc_TEST_SIM_FCS_UNKNOWN -1
00106 #define hdlc_TEST_SIM_FCS_GOOD     0
00107 #define hdlc_TEST_SIM_FCS_BAD      1
00108
00109 /* global variables */
00110 typedef struct {
00111    hdlcRxInst_t hdlcRxInst;
00112    hdlcTxInst_t hdlcTxInst;
00113 } hdlcInst_t;
00114
00115 /* data passed to the HDLC */
00116 tword dataBuf[hdlc_TEST_MAX_NBYTES];
00117
00118 tuint txHDLCFcs = 0;
00119 tint  rxHDLCFcsStatus = hdlc_TEST_SIM_FCS_UNKNOWN;
00120
00121 hdlcInst_t hdlcInst;
00122
00123 extern const tuint hdlcFcsTable[];
00124
00125  /* HDLC Tx init configuration  */
00126 void hdlcTxInitCfg(hdlcTxInit_t *init)
00127 {
00128    tbool BIND_MASK = TRUE;
00129
00130    /* Minimum 2 flags must be generated in order to
00131       play last byte when nothing to play */
00132    init->minFlagsCnt = hdlc_TEST_NUMOF_OPENING_FLAGS;
00133
00134    init->encodedDataBytePerWord = hdlc_TEST_ENC_BYTES_PER_WORD; /* # of encoded bytes per word */
00135    init->decodedDataBytePerWord = hdlc_TEST_DEC_BYTES_PER_WORD; /* # of decoded bytes per word */
00136
00137    init->encodedDataBigEndian = BIND_MASK;
00138    init->decodedDataBigEndian = BIND_MASK;
00139
00140    /* Initialize Tx part of HDLC */
00141    hdlcTxInit(&hdlcInst.hdlcTxInst, init);
00142
00143 } /* hdlcTxInitCfg */
00144
00145 /* HDLC Rx init configuration */
00146 void hdlcRxInitCfg(hdlcRxInit_t *init)
00147 {
00148    /* RX initialization */
00149    init->encodedDataBytePerWord = hdlc_TEST_ENC_BYTES_PER_WORD; /* # of encoded bytes per word */
00150    init->decodedDataBytePerWord = hdlc_TEST_DEC_BYTES_PER_WORD; /* # of decoded bytes per word */
00151
00152    /* Initialize Rx part of HDLC */
00153    hdlcRxInit(&hdlcInst.hdlcRxInst, init);
00154
00155 } /* hdlcRxInitCfg */
00156
00157 tuint hdlcProcessTx(hdlcInst_t *inst, tword *srcBuf, tword *dstBuf)
00158 {
00159    tuint hdlc_stat = 0, bytesSent = 0;
00160    tuint fillWord_idx = 0;
00161    tuint bytesCnt;
00162    tword temp[2*hdlc_TEST_MAX_NBYTES];
00163
00164    hdlc_stat  |= hdlcTxConfig (&inst->hdlcTxInst, &temp[0], (tuint)hdlc_TEST_NUMOF_ABORT_FLAGS);
00165    hdlcTxAbort(&inst->hdlcTxInst);
00166   /* Copy and unpack to Destination buffer */
00167    pktUnpackWordsIntoBytes(&temp[0],&dstBuf[bytesSent],hdlc_TEST_NUMOF_ABORT_FLAGS,0);
00168
00169    bytesSent = hdlc_TEST_NUMOF_ABORT_FLAGS;
00170
00171
00172    bytesCnt = sizeof(dataBuf);
00173    hdlc_stat |= hdlcTxConfig (&inst->hdlcTxInst, &temp[0],2*bytesCnt);
00174
00175    while(hdlc_stat & hdlc_TX_CONTINUE)
00176    {
00177     hdlc_stat = hdlcTxData (&inst->hdlcTxInst, srcBuf, &fillWord_idx, hdlc_TEST_MAX_NBYTES);
00178    /* Copy and unpack to Destination buffer */
00179     pktUnpackWordsIntoBytes(&temp[0],&dstBuf[bytesSent],inst->hdlcTxInst.dataBufByteCnt,0);
00180     bytesSent += inst->hdlcTxInst.dataBufByteCnt;
00181   if(fillWord_idx==bytesCnt)
00182    break;
00183    }
00184
00185
00186    printf("\n\n");
00187    printf("fillWord_idx : %d \n",fillWord_idx);
00188
00189    txHDLCFcs = inst->hdlcTxInst.fcs;
00190
00191    bytesCnt = hdlc_TEST_FCS_SIZE_BYTES + hdlc_TEST_NUMOF_ABORT_FLAGS;
00192    bytesCnt += (inst->hdlcTxInst.currOctetBitCnt + 7) >> 3;
00193    hdlc_stat |= hdlcTxConfig (&inst->hdlcTxInst, &temp[0], (tuint)bytesCnt);
00194    hdlcTxFcs (&inst->hdlcTxInst, TRUE);
00195    /* Copy and unpack to Destination buffer */
00196    pktUnpackWordsIntoBytes(&temp[0],&dstBuf[bytesSent],bytesCnt,0);
00197    bytesSent += bytesCnt;
00198
00199    /* Pack the dst buffer at the end */
00200   pktPackBytesIntoWords (dstBuf, dstBuf, bytesSent, 0);
00201
00202   return (bytesSent);
00203
00204 } /* hdlcProcessTx */
00205
00206 tuint hdlcProcessRx(hdlcInst_t *inst, tword *encBuf, tword *rawDataBuf, tint len)
00207 {
00208    tuint        bytesCnt = (tuint)len;
00209    tuint        status;
00210    tuint        TempBufCnt;
00211
00212    hdlcRxConfig (&inst->hdlcRxInst, encBuf, bytesCnt);
00213
00214
00215    bytesCnt = 0;
00216    do
00217    {
00218       TempBufCnt = 0 ;
00219       status = hdlcRx (&inst->hdlcRxInst, &rawDataBuf[bytesCnt], &TempBufCnt,hdlc_TEST_MAX_NBYTES);
00220     bytesCnt+=TempBufCnt;
00221
00222       /* check for end of frame and process it */
00223       if (status & (hdlc_RX_FRAME_ABORT | hdlc_RX_FRAME_END))
00224       {
00225          if (status & hdlc_RX_FRAME_GOOD)
00226             rxHDLCFcsStatus = hdlc_TEST_SIM_FCS_GOOD;
00227          else
00228             rxHDLCFcsStatus = hdlc_TEST_SIM_FCS_BAD;
00229
00230       }
00231
00232    } while ((status & hdlc_RX_BUFFER_END) == 0);
00233    return (bytesCnt);
00234
00235 } /* hdlcProcessRx */
00236
00237 tword        hdlcEncData[2*hdlc_TEST_MAX_NBYTES], hdlcDecData[2*hdlc_TEST_MAX_NBYTES];
00238 tuint        bytesSent, bytesRx;
00239 void main(void)
00240 {
00241    tint i;
00242    hdlcTxInit_t txInitCfg;
00243    hdlcRxInit_t rxInitCfg;
00244
00245    srand(1);
00246  /* Initialize the data for encoding */
00247    for(i=0;i<hdlc_TEST_MAX_NBYTES;i++)
00248    {
00249      dataBuf[i]=rand()%0xFF;
00250    }
00251
00252    printf ("Input data:");
00253    for (i = 0; i < sizeof(dataBuf); i++)
00254    {
00255         if ((i & 0xF) == 0)
00256            printf("\n");
00257         printf (" 0x%02X", dataBuf[i]);
00258    }
00259
00260
00261
00262    /* Zero out Encoder and Decoder  Buffers*/
00263    memset ((void *)hdlcEncData, 0, sizeof(hdlcEncData));
00264    memset ((void *)hdlcDecData, 0, sizeof(hdlcDecData));
00265
00266    /* HDLC Tx Initialization */
00267    hdlcTxInitCfg (&txInitCfg);
00268
00269    pktPackBytesIntoWords (dataBuf, dataBuf, sizeof(dataBuf), 0);
00270
00271    /* Encode data in HDLC frame */
00272    bytesSent = hdlcProcessTx (&hdlcInst, dataBuf, hdlcEncData);
00273
00274
00275    /* HDLC Rx Initialization */
00276    hdlcRxInitCfg (&rxInitCfg);
00277
00278    /* Decode HDLC frame */
00279    bytesRx = hdlcProcessRx (&hdlcInst, hdlcEncData, hdlcDecData, bytesSent);
00280
00281    /* Unpack the decoded bytes to words for display */
00282    pktUnpackWordsIntoBytes (hdlcDecData, dataBuf, bytesRx, 0);
00283
00284    /* Display the results */
00285      printf ("\n\nDecoded HDLC data:");
00286    for (i = 0; i < bytesRx; i++)
00287    {
00288        if ((i & 0xF) == 0)
00289          printf("\n");
00290       printf (" 0x%02X", dataBuf[i]);
00291    }
00292
00293    if (rxHDLCFcsStatus == hdlc_TEST_SIM_FCS_GOOD)
00294       printf ("\n\nResult:\n Good CRC is received.\n");
00295    else if (rxHDLCFcsStatus == hdlc_TEST_SIM_FCS_BAD)
00296       printf ("\n\nResult:\n Bad CRC is received!\n");
00297    else
00298       printf ("\n\nResult:\n HDLC processing failed!\n");
00299
00300 } /* main */
00301 /* @} */
00302 /* nothing past this point */


HDLC Test: HDLC Unit Test

HDLC Unit Test

Page Contents

  1. Description
  2. Building Unit Test
  3. Unit Test Procedures
  4. Dependent Packages

Description

This package contains a basic test for the HDLC. This is not a regression test, its purpose is to show how the HDLC module can be integrated into a system and to become familiar with the external API. The package also provides a means to experiment with changes to the configuration and observe the operational effect(s).

Building Unit Test

The HDLC Unit Test package can be compiled in the following manners:

  1. Apply the GNU Makefile build procedure to the test package.
  2. Load the HDLC Unit Test project into CCSV5 and build. All projects will reside in the hdlc\test\ccsProjects directory.

Notes:
  1. The GNU Makefile build procedure is described in detail in the main HDLC documentation.

Unit Test Procedures

The HDLC Unit Test package comes complete with a compiled CCS Project as well as a directly loadable test image. If the unit test code has been altered or enhanced, the Building Unit Test procedure above should be completed before moving forward.

Unit Test Image

The procedure to test using the unit test image is described below. Note that this procedure does not require CCS version 5.2 or above and may be used for those who haven't yet upgraded to CCS v5.2 or above.

  1. Open CCS
  2. Load the HDLC Unit Test image for the target of interest
    • Will reside in the hdlc\test\lnkr\<targ> directory
    • Will have the extension *.x<target>
  3. Run to the main() symbol
  4. Follow the Unit Test Configuration and Execution procedure

Unit Test Project

The procedure to test using the CCS project is described below. Note that this procedure requires CCS version 5.2 or above (Eclipse).

  1. Open CCS version 5.2 or above
  2. Load the HDLC project for the target of interest
    • Will be a subdirectory off the hdlc\test\ directory
    • Can be identified using the CCS menu options "Project"-->"Import Existing CCS/CCE Eclipse Project" and browsing the hdlc\test\ directory.
    • (Optional) Rebuild the project
  3. Open the proper Debug Target Configuration and load the build
    • Can be identified using the CCS menu options "Target"-->"Load Program" and selecting the "Browse Projects" button
    • (Optional) Run to the main() symbol
  4. Follow the Unit Test Configuration and Execution procedure

Dependent Packages

  • ti.mas.types (Common data type defintions)
  • ti.mas.util (Common utilities)
  • ti.mas.hdlc (HDLC API)
  • ti.mas.swtools (to build software)


HDLC Test: Module Index

HDLC Test Modules

Here is a list of all modules:
  • HDLCTEST


HDLC Test: Page Index

HDLC Test Related Pages

Here is a list of all related documentation pages:
  • Unit Test Configuration and Execution


HDLC Test: hdlcInst_t Struct Reference

  • Data Structures
  • Data Fields

hdlcInst_t Struct Reference
[HDLCTEST]

Detailed Description

Definition at line 110 of file hdlcsim.c.

Data Fields

hdlcRxInst_t | hdlcRxInst
hdlcTxInst_t | hdlcTxInst

Field Documentation

hdlcRxInst_t hdlcInst_t::hdlcRxInst

Definition at line 111 of file hdlcsim.c.

Referenced by hdlcProcessRx(), and hdlcRxInitCfg().

hdlcTxInst_t hdlcInst_t::hdlcTxInst

Definition at line 112 of file hdlcsim.c.

Referenced by hdlcProcessTx(), and hdlcTxInitCfg().

The documentation for this struct was generated from the following file:
  • hdlcsim.c