ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/marvell/services/mislic/api_lib/includes/vp886_api.h b/marvell/services/mislic/api_lib/includes/vp886_api.h
new file mode 100644
index 0000000..9e45814
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp886_api.h
@@ -0,0 +1,1196 @@
+/** \file vp886_api.h
+ * vp886_api.h
+ *
+ * Header file that defines all the commands for the Vp886 series devices.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12587 $
+ * $LastChangedDate: 2018-06-21 17:22:20 -0500 (Thu, 21 Jun 2018) $
+ */
+
+#ifndef VP886_API_H
+#define VP886_API_H
+
+#include "vp_api_cfg.h"
+#include "vp_hal.h"
+#include "vp_CSLAC_types.h"
+#include "vp_api_common.h"
+#include "vp_timer_queue.h"
+#ifdef VP886_INCLUDE_ADAPTIVE_RINGING
+#include "vp_adaptive_ringing.h"
+#endif
+
+#define VP886_MAX_NUM_CHANNELS 2
+
+#ifdef VP886_INCLUDE_TESTLINE_CODE
+#include "vp_api_test.h"
+#include "vp886_testline.h"
+#endif
+
+#include "vp886_registers.h"
+
+
+/* Enforce a minimum configurable event queue size */
+#define VP886_EVENT_QUEUE_MIN_SIZE 6
+#if VP886_EVENT_QUEUE_SIZE < VP886_EVENT_QUEUE_MIN_SIZE
+#error VP886_EVENT_QUEUE_SIZE configured below the minimum
+#endif
+/* Define a new event structure to use in the queue to reduce size. VpEventType
+ * contains several data members that are not necessary internally. */
+typedef struct {
+ uint8 channelId;
+ VpEventCategoryType eventCategory;
+ uint16 eventId;
+ uint16 eventData;
+ uint16 parmHandle;
+ bool hasResults;
+} Vp886QueuedEventType;
+
+typedef struct {
+ Vp886QueuedEventType events[VP886_EVENT_QUEUE_SIZE];
+ uint8 numQueued;
+ uint8 pushIndex;
+ uint8 popIndex;
+ bool overflowed;
+} Vp886EventQueueType;
+
+
+typedef struct {
+ VpOptionPulseType pulse; /* VP_DEVICE_OPTION_ID_PULSE */
+ VpOptionPulseType pulse2; /* VP_DEVICE_OPTION_ID_PULSE2 */
+ VpOptionCriticalFltType criticalFlt; /* VP_DEVICE_OPTION_ID_CRITICAL_FLT */
+ VpOptionDeviceIoType deviceIo; /* VP_DEVICE_OPTION_ID_DEVICE_IO */
+ VpOptionEventMaskType eventMask; /* VP_OPTION_ID_EVENT_MASK */
+ VpOptionAdaptiveRingingType adaptiveRinging; /* VP_DEVICE_OPTION_ID_ADAPTIVE_RINGING */
+ VpOptionRingPhaseSyncType ringPhaseSync; /* VP_DEVICE_OPTION_ID_RING_PHASE_SYNC */
+ VpOptionFsyncRateType fsyncRate; /* VP_DEVICE_OPTION_ID_FSYNC_RATE */
+ VpOptionAccessCtrlType accessCtrl; /* VP_DEVICE_OPTION_ID_ACCESS_CTRL */
+ VpOptionSpiErrorCtrlType spiErrorCtrl; /* VP_DEVICE_OPTION_ID_SPI_ERROR_CTRL */
+} Vp886DevOptionsCacheType;
+
+typedef struct {
+ VpOptionPulseModeType pulseMode; /* VP_OPTION_ID_PULSE_MODE */
+ VpOptionTimeslotType timeslot; /* VP_OPTION_ID_TIMESLOT */
+ VpOptionCodecType codec; /* VP_OPTION_ID_CODEC */
+ VpOptionLoopbackType loopback; /* VP_OPTION_ID_LOOPBACK */
+ VpOptionLineStateType lineState; /* VP_OPTION_ID_LINE_STATE */
+ VpOptionEventMaskType eventMask; /* VP_OPTION_ID_EVENT_MASK */
+ VpOptionRingControlType ringControl; /* VP_OPTION_ID_RING_CNTRL */
+ VpOptionPcmTxRxCntrlType pcmTxRxCntrl; /* VP_OPTION_ID_PCM_TXRX_CNTRL */
+ bool switcherCtrl; /* VP_OPTION_ID_SWITCHER_CTRL */
+ VpOptionAbsGainType absGain; /* VP_OPTION_ID_ABS_GAIN */
+ VpOptionGndFltProtType gndFltProt; /* VP_OPTION_ID_GND_FLT_PROTECTION */
+ VpOptionDtmfModeType dtmfMode; /* VP_OPTION_ID_DTMF_MODE */
+ uint16 ringTripConfirm; /* VP_OPTION_ID_RINGTRIP_CONFIRM */
+ VpOptionHighPassFilterType highPassFilter; /* VP_OPTION_ID_HIGHPASS_FILTER */
+ VpOptionDtmfParamsType dtmfParams; /* VP_OPTION_ID_DTMF_PARAMS */
+} Vp886LineOptionsCacheType;
+
+
+#define VP886_NUM_PROFILE_TYPES 9
+
+/* ABS Supply Configurations: Single, Slave, Master */
+typedef enum {
+ VP886_ABS_SUPP_CFG_SINGLE = 0,
+ VP886_ABS_SUPP_CFG_SLAVE = 1,
+ VP886_ABS_SUPP_CFG_MASTER = 2
+} Vp886AbsSuppCfgType;
+
+/* Charge Pump protection modes */
+typedef enum {
+ VP886_CP_PROT_UV_SHUTDOWN = 0,
+ VP886_CP_PROT_CYCLE_SKIP = 1,
+ VP886_CP_PROT_DISABLED = 2
+} Vp886CPProtectionModeType;
+
+/*
+ * Vp886DeviceProfileType -------------------------------- Vp886DeviceProfileType
+ */
+typedef struct {
+ uint8 profVersion;
+ uint16 pcmClkRate; /**< Used to verify valid TX/RX Timeslot setting */
+ uint8 devCfg;
+ uint8 devMode[2];
+ uint8 swyv;
+ uint8 swzv;
+ uint8 swyLimit;
+ uint8 swzLimit;
+ uint8 io2Use;
+ bool lowVoltOverride;
+ uint8 dialPulseCorrection;
+ uint8 swCfg;
+ uint8 swOCC[2];
+ uint8 blanking;
+ Vp886AbsSuppCfgType absSuppCfg;
+ uint8 adaptiveRingingMaxPower;
+ bool cpEnable;
+ Vp886CPProtectionModeType cpProtection;
+ uint8 vsw;
+ int8 vbhOffset;
+ int8 vbhOverhead;
+ uint8 swCtrlNormal;
+ uint8 swCtrlFreeRun;
+ uint8 swCtrlBattBackup;
+ uint8 batSelGpio;
+ bool vblUseMedTiming;
+} Vp886DeviceProfileType;
+
+/* Vp886InitDeviceSM() state variable. Setting constant values so that we don't
+ need to check debug logs against the exact API version being used. */
+typedef enum {
+ VP886_INIT_DEVICE_SWITCHER_PREP = 2,
+ VP886_INIT_DEVICE_CFAIL_CHECK_PREP = 3,
+ VP886_INIT_DEVICE_CFAIL_CHECK = 4,
+ VP886_INIT_DEVICE_ZSI_DETECT = 19,
+ VP886_INIT_DEVICE_ENABLE_VREF = 5,
+ VP886_INIT_DEVICE_VREF_CHECK = 6,
+ VP886_INIT_DEVICE_CP_ENABLE = 7,
+ VP886_INIT_DEVICE_CH1_CH2_DISC = 9,
+ VP886_INIT_DEVICE_CP_CHECK = 8,
+ VP886_INIT_DEVICE_CH1_CH2_SW_ENABLE = 10,
+ VP886_INIT_DEVICE_CAL_CODEC_START = 13,
+ VP886_INIT_DEVICE_CAL_CODEC = 14,
+ VP886_INIT_DEVICE_SW_ENABLE = 11,
+ VP886_INIT_DEVICE_ALARM_CHECK = 12,
+ VP886_INIT_DEVICE_INIT_LINES = 15,
+ VP886_INIT_DEVICE_LONG_CAL = 16,
+ VP886_INIT_DEVICE_GEN_EVENT = 17,
+ VP886_INIT_DEVICE_COMPLETE = 18
+} Vp886InitDeviceStateType;
+
+/* Vp886CalCodecSM() state variable */
+typedef enum {
+ VP886_CAL_CODEC_START = 0,
+ VP886_CAL_CODEC_PREPARE,
+ VP886_CAL_CODEC_SADC,
+ VP886_CAL_CODEC_SWY_SENSE,
+ VP886_CAL_CODEC_SWZ_SENSE,
+ VP886_CAL_CODEC_TIP_SENSE,
+ VP886_CAL_CODEC_RING_SENSE,
+ VP886_CAL_CODEC_IO2_SENSE,
+ VP886_CAL_CODEC_VOC_SENSE,
+ VP886_CAL_CODEC_FLOOR,
+ VP886_CAL_CODEC_BATTERY,
+ VP886_CAL_CODEC_BATTERY_SENSE,
+ VP886_CAL_CODEC_BATTERY_SAT,
+ VP886_CAL_CODEC_BATTERY_LIMIT,
+ VP886_CAL_CODEC_DISCONNECT,
+ VP886_CAL_CODEC_LONGITUDINAL,
+ VP886_CAL_CODEC_SYNC,
+ VP886_CAL_CODEC_CONCLUDE,
+ VP886_CAL_CODEC_GEN_EVENT,
+ VP886_CAL_CODEC_COMPLETE,
+ VP886_CAL_CODEC_FAILED
+} Vp886CalCodecStateType;
+
+/* CalCodec state variable */
+typedef enum {
+ VP886_SADC_INIT = 0,
+ VP886_SADC_ICAL_L,
+ VP886_SADC_ICAL_H,
+ VP886_SENSE_INIT,
+ VP886_SENSE_ICAL_L,
+ VP886_SENSE_ICAL_H,
+ VP886_VOC_S_INIT,
+ VP886_VOC_S_START,
+ VP886_VOC_S_ICAL_L,
+ VP886_VOC_S_ICAL_H,
+ VP886_FLOOR_INIT,
+ VP886_FLOOR_START,
+ VP886_FLOOR_LOW,
+ VP886_FLOOR_HIGH,
+ VP886_TRACKER_INIT,
+ VP886_TRACKER_VAB_START,
+ VP886_TRACKER_VAB_LOW,
+ VP886_TRACKER_VAB_HIGH,
+ VP886_TRACKER_VAS_LOW,
+ VP886_TRACKER_VAS_HIGH,
+ VP886_TRACKER_COMPUTE,
+ VP886_BAT_SENSE_INIT,
+ VP886_BAT_SENSE_LOW,
+ VP886_BAT_SENSE_HIGH,
+ VP886_BAT_SAT_INIT,
+ VP886_BAT_SAT_MEAS,
+ VP886_SW_LIM_INIT,
+ VP886_SW_LIM_LOW,
+ VP886_SW_LIM_HIGH,
+ VP886_LONG_INIT,
+ VP886_LONG_GET_MEAS,
+ VP886_LONG_GET_MEAS_RINGING
+} Vp886CalCodecSubStateType;
+
+/* CalLine state variable */
+typedef enum {
+ VP886_SADC_VMODE_INIT = 0,
+ VP886_SADC_VMODE_VOFF,
+ VP886_SADC_VMODE_VCAL,
+ VP886_VADC_INIT,
+ VP886_VADC_ICAL_L,
+ VP886_VADC_ICAL_H,
+ VP886_VAB_INIT,
+ VP886_VAB_START,
+ VP886_VAB_ICAL_L,
+ VP886_VAB_ICAL_H,
+ VP886_IMT_INIT,
+ VP886_IMT_START,
+ VP886_IMT_LOW,
+ VP886_IMT_HIGH,
+ VP886_VOC_INIT,
+ VP886_VOC_START,
+ VP886_VOC_LOW,
+ VP886_VOC_HIGH,
+ VP886_VOC_BUFFER,
+ VP886_RINGING_INIT,
+ VP886_RINGING_START,
+ VP886_RINGING_LOW,
+ VP886_RINGING_HIGH,
+ VP886_RINGING_BUFFER,
+ VP886_HOOK_DET_INIT,
+ VP886_HOOK_DET_METALIC,
+ VP886_HOOK_DET_COMPARATOR,
+ VP886_HOOK_DET_COMPUTE,
+ VP886_GND_KEY_INIT,
+ VP886_GND_KEY_LONG,
+ VP886_GND_KEY_COMPARATOR,
+ VP886_GND_KEY_COMPUTE,
+ VP886_ABS_INIT,
+ VP886_ABS_SWY_START,
+ VP886_ABS_CHECK_ICAL,
+ VP886_ABS_SWY,
+ VP886_ABS_BSW_START,
+ VP886_ABS_BSW_LOW,
+ VP886_ABS_BSW_HIGH
+} Vp886CalLineSubStateType;
+
+/* States for sense recalibration (Vp886QuickCalHandler()) */
+typedef enum {
+ VP886_QUICKCAL_INACTIVE = 0,
+ VP886_QUICKCAL_INIT,
+ VP886_QUICKCAL_SETUP_VA_VB_VAB,
+ VP886_QUICKCAL_READ_VA_VB_VAB,
+ VP886_QUICKCAL_SETUP_VABREV,
+ VP886_QUICKCAL_READ_VABREV,
+ VP886_QUICKCAL_SETUP_VABRING,
+ VP886_QUICKCAL_READ_VABRING,
+ VP886_QUICKCAL_FINISHED
+} Vp886QuickCalStateType;
+
+typedef struct Vp886QuickCalDataType {
+ Vp886QuickCalStateType state;
+ uint16 timerId;
+ uint32 timerHandle;
+ uint16 sadcFlag;
+ bool externalCall;
+} Vp886QuickCalDataType;
+
+/* Calibration registers scratch-pad */
+typedef struct {
+ uint8 dcFeed[VP886_R_DCFEED_LEN];
+ uint8 sysConfig[VP886_R_SSCFG_LEN];
+ uint8 ringGen[VP886_R_RINGGEN_LEN];
+ uint8 icr1[VP886_R_ICR1_LEN];
+ uint8 icr2[VP886_R_ICR2_LEN];
+ uint8 icr3[VP886_R_ICR3_LEN];
+ uint8 icr4[VP886_R_ICR4_LEN];
+ uint8 icr5[VP886_R_ICR5_LEN];
+ uint8 icr6[VP886_R_ICR6_LEN];
+ uint8 srp[VP886_R_SWPARAM_LEN];
+ uint8 devMode[VP886_R_DEVMODE_LEN];
+ uint8 normCal[VP886_R_NORMCAL_LEN];
+ uint8 revCal[VP886_R_REVCAL_LEN];
+ uint8 indCal[VP886_R_INDCAL_LEN];
+ uint8 opCond[VP886_R_OPCOND_LEN];
+ uint8 opFunc[VP886_R_OPFUNC_LEN];
+ uint8 loopSup[VP886_R_LOOPSUP_LEN];
+ uint8 slacState[VP886_R_STATE_LEN];
+ uint8 ioDir[VP886_R_IODIR_LEN];
+} Vp886RegPadType;
+
+/* Vp886CalLinecSM() state variable */
+typedef enum {
+ VP886_CAL_LINE_START,
+ VP886_CAL_LINE_VADC_ACTIVE_CAL,
+ VP886_CAL_LINE_SADC_VMODE_CAL,
+ VP886_CAL_LINE_VAB_SENSE_CAL,
+ VP886_CAL_LINE_IMT_CAL,
+ VP886_CAL_LINE_VOC_CAL,
+ VP886_CAL_LINE_RINGING_CAL,
+ VP886_CAL_LINE_HOOK_DETECTOR_CAL,
+ VP886_CAL_LINE_GROUND_KEY_CAL,
+ VP886_CAL_LINE_ABS_CAL,
+ VP886_CAL_LINE_RESTORE,
+ VP886_CAL_LINE_GEN_EVENT,
+ VP886_CAL_LINE_COMPLETE,
+ VP886_CAL_LINE_FAILED
+} Vp886CalLineStateType;
+
+/* IMPORTANT: Make sure to update the "stateInt" member of the device object if
+ the size of this type changes. There is no instance of this type itself. */
+typedef enum {
+ VP886_SYS_CAL_COMPLETE = 0x0001, /**< Set when the system calibration structure has been initialied */
+ /* This value is set when either Device Calibration (VpInitDevice()/VpCalCodec()
+ completes successfully, or when loaded values by Apply System Coeff. After
+ VpInitDevice() this should only be NOT SET if device calibration failed or
+ if null was passed to Apply System Coeff. */
+ VP886_DEVICE_CAL_COMPLETE = 0x0002,
+
+ VP886_DEVICE_ICAL_L_IN_USE = 0x0004, /* Low calibration current in use */
+ VP886_DEVICE_ICAL_H_IN_USE = 0x0008, /* High calibration current in use */
+
+ VP886_FORCE_FREE_RUN = 0x0010, /**< Set when app calls VpFreeRun() (start), cleared when called with stop.
+ * This prevents the VP-API-II from automatically exiting free run mode
+ * upon PCLK recovery.
+ */
+ VP886_ZSI_DETECTED = 0x0020,
+ VP886_SHARED_SUPPLY = 0x0040,
+ VP886_CONVERT_DEVICE_TYPE = 0x0080,
+ VP886_FREE_RUN = 0x0100,
+ VP886_BATTERY_BACKUP = 0x0200
+} Vp886DeviceStateIntType;
+
+/* Union of basic results types for Vp886. Does not include linetest,
+ * low level cmd, or result types not supported by Vp886. */
+typedef union {
+ VpLoopCondResultsType getLoopCond; /* VP_LINE_EVID_RD_LOOP */
+ VpDeviceIoAccessDataType deviceIoAccess; /* VP_DEV_EVID_IO_ACCESS_CMP */
+ VpLineIoAccessType lineIoAccess; /* VP_LINE_EVID_LINE_IO_RD_CMP */
+} Vp886BasicResultsType;
+
+#define VP886_MAX_BRANCH_DEPTH 5
+typedef struct Vp886SeqDataType {
+ VpProfilePtrType pActiveCadence; /* Currently Active Cadence */
+ VpProfilePtrType pCurrentPos; /* Current position in profile */
+
+ VpCadenceStatusType status;
+
+ uint8 index; /* Index in the the cadence table */
+ uint8 length; /* Length of executable cadence instructions */
+
+ uint8 branchCount[VP886_MAX_BRANCH_DEPTH];
+ uint8 branchIdx[VP886_MAX_BRANCH_DEPTH];
+ uint8 branchDepth;
+
+ uint8 toneType;
+
+ VpLineStateType lineState; /* Current line state set by the cadence */
+
+ /* Howler data */
+ uint8 regData[VP886_R_SIGAB_LEN];
+ uint16 startLevel;
+ uint16 stopLevel;
+ uint16 levelStep;
+} Vp886SeqDataType;
+
+/* Contains the information needed to process SendSignal sequences */
+typedef struct {
+ VpSendSignalType type;
+ bool active;
+ struct {
+ int8 voltage;
+ uint16 onTime;
+ uint16 offTime;
+ uint8 cycles;
+ bool on;
+ } msgWait;
+} Vp886SendSignalDataType;
+
+/* Contains the information needed to process metering sequences */
+typedef struct {
+ bool active;
+ bool on;
+ uint16 onTime; /* 10ms units */
+ uint16 offTime; /* 10ms units */
+ uint16 remaining;
+ uint16 completed;
+ bool abort;
+} Vp886MeteringDataType;
+
+typedef enum {
+ VP886_CID_ST_NEW_INSTR = 0,
+ VP886_CID_ST_ALERT_TONE = 100,
+ VP886_CID_ST_SILENT_INTERVAL = 200,
+ VP886_CID_ST_SILENT_HOOK_MASK_INTERVAL = 300,
+ VP886_CID_ST_DETECT_INTERVAL = 400,
+ VP886_CID_ST_MARK_OR_SEIZURE = 500,
+ VP886_CID_ST_MARK_OR_SEIZURE_ENDING = 501,
+ VP886_CID_ST_MESSAGE_FSK = 600,
+ VP886_CID_ST_MESSAGE_FSK_MARKOUT = 601,
+ VP886_CID_ST_MESSAGE_FSK_ENDING = 602,
+ VP886_CID_ST_MESSAGE_DTMF = 700
+} Vp886CidStateType;
+
+#define VP886_CID_BUFFER_SIZE 32
+typedef struct {
+ bool active;
+ VpProfilePtrType pProf;
+ uint8 profIdx;
+ Vp886CidStateType state;
+ uint8 msgBuf[VP886_CID_BUFFER_SIZE]; /* Circular message data buffer */
+ uint8 msgLen; /* Number of bytes currently valid in buffer */
+ uint8 msgIdx; /* Index of oldest valid byte in buffer */
+ uint8 checksum;
+ uint16 markOrSeizureBytes;
+ VpDigitType detectDigit1;
+ VpDigitType detectDigit2;
+ bool digitDetected;
+ bool fskEnabled;
+ bool dtmfEnabled;
+ bool mute;
+ bool needData;
+} Vp886CidDataType;
+
+typedef struct {
+ int16 gain;
+ int16 offset;
+} Vp886CalGainOffsetType;
+
+/* Common calibration structure */
+typedef struct {
+ /* Senses calibration -> accurate ADC readings */
+ Vp886CalGainOffsetType sadc;
+ Vp886CalGainOffsetType sadcVMode;
+ Vp886CalGainOffsetType vadcActive;
+ Vp886CalGainOffsetType swySense;
+ Vp886CalGainOffsetType swzSense;
+ Vp886CalGainOffsetType tipSense;
+ Vp886CalGainOffsetType ringSense;
+ Vp886CalGainOffsetType io2Sense;
+ Vp886CalGainOffsetType vabSenseNormal;
+ Vp886CalGainOffsetType vabSenseReverse;
+ Vp886CalGainOffsetType vabSenseRinging;
+
+ /* Features calibration -> the device generates accurate signals */
+ /* ILA */
+ Vp886CalGainOffsetType ilaNormal;
+ Vp886CalGainOffsetType ilaReverse;
+ /* VOC */
+ Vp886CalGainOffsetType vocNormal;
+ Vp886CalGainOffsetType vocReverse;
+ Vp886CalGainOffsetType vocBuffer;
+ /* Ringing */
+ Vp886CalGainOffsetType ringingGenerator;
+ Vp886CalGainOffsetType ringingBuffer;
+ /* VOC, Ringing shared */
+ Vp886CalGainOffsetType vocSenseNormal;
+ /* Fixed Battery voltage */
+ Vp886CalGainOffsetType fixedBat;
+ Vp886CalGainOffsetType batterySense;
+ /* Longitudinal point */
+ Vp886CalGainOffsetType longActive;
+ Vp886CalGainOffsetType longRinging;
+ Vp886CalGainOffsetType reserved_1;
+ Vp886CalGainOffsetType reserved_2;
+ /* Hook Detector (1 offset, 4 gains) */
+ Vp886CalGainOffsetType hookLPM;
+ Vp886CalGainOffsetType hookReverse;
+ Vp886CalGainOffsetType hookNormal;
+ /* Battery saturation (offset only) */
+ Vp886CalGainOffsetType batSat;
+ /* Switcher limit */
+ Vp886CalGainOffsetType swLimit50V;
+ Vp886CalGainOffsetType swLimit100V;
+ /* Ground Key detector */
+ Vp886CalGainOffsetType gndKeyLong;
+ /* Capacitance test tip/ring offsets (pF) */
+ int32 tipCapCal;
+ int32 ringCapCal;
+} Vp886CmnCalDeviceDataType;
+
+/* Tracker calibration structure */
+typedef struct {
+ /* Tracking battery */
+ Vp886CalGainOffsetType trackerVabNormal;
+ Vp886CalGainOffsetType trackerVabReverse;
+ Vp886CalGainOffsetType trackerVasNormal;
+ Vp886CalGainOffsetType trackerVasReverse;
+ Vp886CalGainOffsetType reserved_5;
+ Vp886CalGainOffsetType reserved_6;
+ Vp886CalGainOffsetType trackerBatSense;
+} Vp886TrkCalDeviceDataType;
+
+/* ABS calibration structure */
+typedef struct {
+ Vp886CalGainOffsetType absVabNormal;
+ Vp886CalGainOffsetType absVabReverse;
+ Vp886CalGainOffsetType reserved_7;
+ Vp886CalGainOffsetType reserved_8;
+ Vp886CalGainOffsetType reserved_5;
+ Vp886CalGainOffsetType reserved_6;
+ Vp886CalGainOffsetType absBatSense;
+} Vp886AbsCalDeviceDataType;
+
+typedef struct {
+ bool valid;
+ Vp886CmnCalDeviceDataType cmn;
+ union {
+ Vp886TrkCalDeviceDataType trk;
+ Vp886AbsCalDeviceDataType abs;
+ } spe;
+} Vp886CalDeviceDataType;
+
+typedef enum {
+ VP886_HOWLER_ST_ALIGNMENT = 0,
+ VP886_HOWLER_ST_AMP_STEPPING_UK_AUS = 100,
+ VP886_HOWLER_ST_AMP_STEPPING_NTT = 200
+} Vp886HowlerStateType;
+
+typedef enum {
+ VP886_GNDFLTPROT_ST_INACTIVE = 0,
+ VP886_GNDFLTPROT_ST_GKEY_DETECTED = 1,
+ VP886_GNDFLTPROT_ST_DISCONNECT = 2,
+ VP886_GNDFLTPROT_ST_TIP_OPEN = 3,
+ VP886_GNDFLTPROT_ST_RING_OPEN = 4
+} Vp886GroundFaultProtStateType;
+
+typedef enum {
+ VP886_GNDFLTPROT_INP_TIMER = 0,
+ VP886_GNDFLTPROT_INP_GKEY_DET = 1,
+ VP886_GNDFLTPROT_INP_GKEY_REL = 2,
+ VP886_GNDFLTPROT_INP_LINESTATE = 3,
+ VP886_GNDFLTPROT_INP_STOP = 4
+} Vp886GroundFaultProtInputType;
+
+typedef struct {
+ Vp886GroundFaultProtStateType state;
+ bool faultDeclared;
+ bool settingDisconnect;
+ uint16 iterations;
+} Vp886GroundFaultProtDataType;
+
+typedef enum {
+ VP886_ABS_POWER_REQ_LOW = 0,
+ VP886_ABS_POWER_REQ_MED = 1,
+ VP886_ABS_POWER_REQ_HIGH = 2,
+ VP886_ABS_POWER_REQ_OFF = 3
+} Vp886AbsPowerReqType;
+
+typedef struct {
+ bool sampling;
+ VpDigitType currentDigit;
+ VpDtmfDetectDataType detectData;
+ uint8 sadcCtrl[VP886_R_SADC_LEN];
+ bool useVadc;
+ bool initialSample;
+} Vp886DtmfType;
+
+typedef enum {
+ VP886_RINGSYNC_STATE_IDLE = 0,
+ VP886_RINGSYNC_STATE_PAUSING = 1, /* Line which is pausing its ringing */
+ VP886_RINGSYNC_STATE_DELAYING = 2, /* Line which is delaying its ringing */
+ VP886_RINGSYNC_STATE_FINISHING_PAUSE = 3,
+ VP886_RINGSYNC_STATE_FINISHING_DELAY = 4
+} Vp886RingSyncStateType;
+
+typedef enum {
+ VP886_IO_CAPABILITY_TWO_PER_CH = 0, /* 2 IOs per channel */
+ VP886_IO_CAPABILITY_NONE = 1, /* No IOs */
+ VP886_IO_CAPABILITY_CH0_IO2 = 2 /* IO2 on channel 0 only */
+} Vp886IoCapabilityType;
+
+/*
+ * Vp886LineObjectType -------------------------------------------------------- Vp886LineObjectType
+ */
+typedef struct {
+ uint8 channelId;
+ VpLineIdType lineId;
+ VpTermType termType;
+ uint8 ecVal;
+
+ bool isFxs;
+
+ /* These flags are used by Vp886ReadyStatus() to decide whether a line can be
+ accessed (i.e. is not "busy"). This is a bitmask of
+ Vp886LineBusyFlagsType values. */
+ uint16 busyFlags;
+
+ VpApiIntLineStateType lineState;
+
+ /* Cache for all line option settings */
+ Vp886LineOptionsCacheType options;
+
+ /* Set of VP_CSLAC_____ values defining which line conditions we are
+ currently ignoring (such as VP_CSLAC_HOOK | VP_CSLAC_GKEY) */
+ uint16 detectMasks;
+
+ /* State variable for the Vp886CalLine state machine. This is used
+ inside the Vp886CalLineSM function to keep track of the state
+ and specify which state (case) of the switch statement to enter. */
+ Vp886CalLineStateType calLineState;
+ Vp886CalLineSubStateType calLineSubState;
+
+ /* Info for the quick recalibration routine. */
+ Vp886QuickCalDataType quickCal;
+
+ /* Remember if the calibration registers have been programmed. They need to
+ be cleared before re-running VpCalLine(). */
+ bool calRegsProgrammed;
+
+ /* Vp886GetLoopCond() backups */
+ uint16 getLoopCondHandle;
+ bool getLoopCondRegsCached;
+ uint8 vadcConvConf[VP886_R_VADC_LEN];
+ uint8 getLoopIcr2[VP886_R_ICR2_LEN];
+ uint8 getLoopIcr3[VP886_R_ICR3_LEN];
+ uint8 getLoopIcr4[VP886_R_ICR4_LEN];
+
+ /* Pulse decoding state data */
+ VpPulseDecodeDataType pulseDecodeData;
+
+ /* Line Topology Info */
+ VpLineTopologyType lineTopology;
+
+#ifdef VP_CSLAC_SEQ_EN
+ /* Sequencer state information */
+ Vp886SeqDataType cadence;
+ Vp886HowlerStateType howlerState;
+ uint16 howlerLevel;
+
+ /* Ringing cadence set by VpInitRing() */
+ VpProfilePtrType pRingingCadence;
+
+ /* Caller ID state information */
+ Vp886CidDataType cid;
+
+ /* SendSignal state information */
+ Vp886SendSignalDataType sendSignal;
+
+ /* Metering state information */
+ Vp886MeteringDataType metering;
+#endif /* VP_CSLAC_SEQ_EN */
+
+ /* Keeps track of whether the internal test termination is applied */
+ bool intTestTermApplied;
+
+ bool ringExitInProgress;
+
+ /* State to end up in after the ring exit polrev workaround */
+ VpLineStateType ringExitCleanupState;
+
+ Vp886RingSyncStateType ringSyncState;
+
+ /* Stores the ringing state that was requested but delayed for the channel
+ that wants to start ringing. */
+ VpLineStateType ringSyncLineState;
+
+ /* Used for VP_OPTION_ID_RINGTRIP_CONFIRM */
+ struct {
+ bool confirming;
+ bool glitchCheck;
+ uint16 lastHookTimestamp;
+ } ringTripConfirm;
+
+#if (VP886_USER_TIMERS > 0)
+ /* Number of currently running user timers. Used to implement a limit
+ of VP886_USER_TIMERS */
+ int16 userTimers;
+#endif
+
+#ifdef VP886_INCLUDE_TESTLINE_CODE
+ VpRelayControlType relayState;
+#endif
+
+ /* Ringing parameters from the ringing profile, in register format. */
+ int16 ringBias;
+ int16 ringAmplitude;
+ int16 ringAmplitudeCal;
+ int16 ringFrequency;
+ bool ringSine;
+ int16 fixedRingBat;
+
+ /* Ringing mode: balanced (FALSE) or unbalanced (TRUE) */
+ bool unbalancedRinging;
+
+ /* Ring trip detection algorithm. Saved from the ringing profile
+ so that we can restore it after a msg waiting pulse signal or
+ any other potential operation that changes it on the fly */
+ uint8 ringTripAlg;
+
+ /* Number of cycles for ring trip (1 or 2), saved so that we can subtract
+ it from the ring trip confirm timer */
+ uint8 ringTripCycles;
+
+ /* Bit mask of the tones programmed by the most recent tone profile.
+ This is used to restrict which tones are enabled in VpSetLineTone() and
+ by cadence commands. */
+ uint8 toneGens;
+
+ /* Set based on the DC profile, this will determine whether
+ groundkey interrupts are interpreted as groundkey events (for
+ ground start applications) or DC fault events (loop start). */
+ bool reportDcFaults;
+
+ Vp886GroundFaultProtDataType gndFltProt;
+
+ /* Floor voltage in 1V steps */
+ uint8 floorVoltage;
+
+ /* Target VOC in 1V steps */
+ uint8 targetVoc;
+
+ uint16 gxBase; /**< Cached GX register, in 2.14 int format */
+ uint16 gxUserLevel; /**< User specified relative GX level (2.14) */
+ uint16 grBase; /**< Cached GR register, in 2.14 int format */
+ uint16 grUserLevel; /**< User specified relative GR level (2.14) */
+
+ /* Most recent non-QUIET settings for the ABS_GAIN option to support
+ VP_OPTION_ABS_GAIN_RESTORE. */
+ int16 absGxRestoreOption;
+ int16 absGrRestoreOption;
+ uint8 absGxRestoreReg[VP886_R_GX_LEN];
+ uint8 absGrRestoreReg[VP886_R_GR_LEN];
+
+ /* Event results for VpSetRelGain() */
+ VpRelGainResultsType setRelGainResults;
+
+ /* Keep track of IO2 status when it's configured as an interrupt */
+ bool io2State;
+
+ /* Set to TRUE if we're using the ila_fdrng bit of ICR2 to enable
+ ringing current limits below 50mA. This changes the way we have to
+ read the ringing current limit value for VP_OPTION_ID_RINGING_PARAMS.
+ It also changes how the VADC reads current, so ringing power management
+ and line test need to be aware of it. */
+ bool lowIlr;
+
+ /* Saved base value of RTTH. The low ILR workaround will double
+ the base value, but will be capped at the max register value, so we
+ need to remember the original to be able to restore it. */
+ uint8 rtth;
+
+ /* Data for VP_QUERY_ID_SW_DUTY_CYCLE */
+ struct {
+ /* Prevent it from being run again if it is already in progress */
+ bool inProgress;
+
+ /* Keep track of initial switcher mode, line state, and line conditions
+ (hook, gkey, etc) so that we can set the 'stateChanged' flag in the
+ results if anything changes */
+ uint8 switcherMode;
+ VpLineStateType lineState;
+ uint16 lineCondition;
+
+ /* A place to store the results so that we can read the switcher on-time
+ register in VpGetEvent() rather than waiting for VpGetResults() */
+ VpSwDutyCycleType result;
+ } swDutyCycle;
+
+ /* Handle for VP_QUERY_ID_TEMPERATURE */
+ uint16 queryTempHandle;
+
+ /* Result for VP_QUERY_ID_TEMPERATURE */
+ int16 queryTempResult;
+
+ /* Flag and value for mid battery compensation, to set the 60V clamp
+ calibration to help with onhook detection when using a mid battery below
+ 60V (such as 48V) */
+ bool midBatCompEnable;
+ uint8 midBatCompValue;
+
+#ifdef VP886_INCLUDE_DTMF_DETECT
+ /* Flags and data for DTMF detection */
+ Vp886DtmfType dtmf;
+#endif /* VP886_INCLUDE_DTMF_DETECT */
+
+#ifdef VP_HIGH_GAIN_MODE_SUPPORTED
+ bool inHighGainMode;
+ struct {
+ uint8 icr1[VP886_R_ICR1_LEN];
+ uint8 icr2[VP886_R_ICR2_LEN];
+ uint8 icr3[VP886_R_ICR3_LEN];
+ uint8 icr4[VP886_R_ICR4_LEN];
+ uint8 dcFeed[VP886_R_DCFEED_LEN];
+ uint8 vpGain[VP886_R_VPGAIN_LEN];
+ uint8 grValue[VP886_R_GR_LEN];
+ uint8 rValue[VP886_R_R_FILT_LEN];
+ uint8 disn[VP886_R_DISN_LEN];
+ uint8 opFunc[VP886_R_OPFUNC_LEN];
+ uint8 swParam[VP886_R_SWPARAM_LEN];
+ } highGainCache;
+#endif /* VP_HIGH_GAIN_MODE_SUPPORTED */
+
+ /* Cache for line-specific registers */
+ struct {
+ uint8 sysState[VP886_R_STATE_LEN];
+ uint8 loopSup[VP886_R_LOOPSUP_LEN];
+ uint8 opCond[VP886_R_OPCOND_LEN];
+ uint8 opFunc[VP886_R_OPFUNC_LEN];
+ uint8 swParam[VP886_R_SWPARAM_LEN];
+ uint8 calCtrl[VP886_R_CALCTRL_LEN];
+ uint8 icr1[VP886_R_ICR1_LEN];
+ uint8 icr2[VP886_R_ICR2_LEN];
+ uint8 icr3[VP886_R_ICR3_LEN];
+ uint8 icr4[VP886_R_ICR4_LEN];
+ uint8 dcFeed[VP886_R_DCFEED_LEN];
+ uint8 ssCfg[VP886_R_SSCFG_LEN];
+ uint8 indCal[VP886_R_INDCAL_LEN];
+ uint8 normCal[VP886_R_NORMCAL_LEN];
+ uint8 revCal[VP886_R_REVCAL_LEN];
+ uint8 ringCal[VP886_R_RINGCAL_LEN];
+ uint8 batCal[VP886_R_BATCAL_LEN];
+ uint8 ringDelay[VP886_R_RINGDELAY_LEN];
+ } registers;
+
+
+#ifdef VP886_INCLUDE_TESTLINE_CODE
+ /* Testing structure */
+ Vp886TestInfoType testInfo;
+
+ /* Test results structure */
+ VpTestResultType testResults;
+#endif
+
+ /* Setting this flag to TRUE will disable all automatic line state changes
+ performed by the API for this line. */
+ bool inLineTest;
+
+#ifdef VP886_INCLUDE_ADAPTIVE_RINGING
+
+ /* Data structure for ringing thermal management algorithms */
+ RingPowerAdaptModuleType ringPowerAdapt;
+
+ /* Running Thermal Adaptive Ringing mode: */
+ bool thermalRinging;
+
+ /* Ringing cadence started */
+ bool startRingingCadence;
+
+ /* To detect customer cadenced ringing "standby => ringing -> oht -> ringing..." */
+ bool wasStandby;
+#endif
+
+#ifdef VP_DEBUG
+ /* For runtime enabling of debug output: */
+ uint32 debugSelectMask;
+#endif /* VP_DEBUG */
+
+ /* Reference ringing battery voltage value requested via ringing profile
+ or the VP_OPTION_ID_RINGING_PARAMS option applies to tracking devices only */
+ uint8 refRingingBatV;
+
+} Vp886LineObjectType;
+
+
+typedef enum {
+ VP_NORMAL,
+ VP_POLREV,
+ VP_RINGING
+} VpPolarityType;
+/*
+ * Vp886DeviceObjectType ------------------------------------------------------ Vp886DeviceObjectType
+ */
+typedef struct {
+ /* Device identifier set by the application -- passed to the HAL */
+ VpDeviceIdType deviceId;
+
+ /* Silicon RCN/PCN and number of channels supported */
+ VpDeviceStaticInfoType staticInfo;
+
+ /* IO capabilities of this device */
+ Vp886IoCapabilityType ioCapability;
+
+ /* Weak attempt to put everything that changes during run-time into a
+ single structure. Good idea in principle, but in practice the devices
+ are too dis-similar to share many common structures.
+ This holds the "last channel checked" event information, clock fault,
+ and battery fault. */
+ VpDeviceDynamicInfoType dynamicInfo;
+
+ /* Variety of common device level status such as init/not init, init in
+ progress, test buffer read y/n?, etc.. Internally used by the VP-API-II
+ to communicate device state.
+ This is a bit-mask of VpDeviceBusyFlagsType values */
+ uint16 busyFlags;
+
+ /* Indicates whether an interrupt has been reported by the system service
+ layer. Used for backward compatibility with VpApiTick/VpVirtualISR */
+ bool pendingInterrupt;
+
+ /* Similar to common device level status, this is for 886 specific type of
+ device level information.
+ This is a bit-mask of Vp886DeviceStateIntType values */
+ uint16 stateInt;
+
+ /* EC value to be used when a device context is passed to Vp886SlacRegWrite,
+ Vp886SlacRegRead, or Vp886SlacBufSend. During normal operation, this
+ should be set to VP886_EC_GLOBAL. The exception is when a routine
+ within VpInitDevice() needs to write or read a channel register. Since
+ there is no requirement to have line contexts/objects defined at the time
+ of InitDevice, we can't pass a line context to our register write/read
+ functions. To access channel registers, set this value to VP886_EC_1 or
+ VP886_EC_2, do the command using the device context, and then set this
+ back to VP886_EC_GLOBAL. */
+ uint8 ecVal;
+
+ /* Flag indicates that a function which generates results has been called,
+ but VpGetResults() has not been called. The results are not necessarily
+ ready, but no more result-generating functions can run. This does not
+ apply to linetest results, which are handled per-line. */
+ bool getResultsRequired;
+
+ /* Union storage for a single basic (non-linetest) result */
+ Vp886BasicResultsType basicResults;
+
+ /* Device event queue */
+ Vp886EventQueueType eventQueue;
+
+ /* We cache the device timestamp so that we do not end up reading it
+ multiple times in quick succession. We use the flag
+ timestampValid so that Vp886GetTimestamp can decide whether to read
+ from the device or the cached value. This flag is set FALSE at the
+ beginning/end of each critical section, and TRUE when Vp886GetTimestamp
+ reads the register. */
+ uint16 timestamp;
+ bool timestampValid;
+
+ /* Count of timestamp rollovers that can be used to support long-duration
+ timers. These two variables are used together to keep the timestamp
+ and rollover count in sync. See Vp886GetTimestamp() for details */
+ uint16 rolloverCount;
+ int32 rolloverBuffer;
+
+ /* When pushing an event into the event, we may need to force an interrupt
+ to prompt the application to call VpGetEvent. If we are already in
+ a VpGetEvent call when pushing the event, there is no need to force the
+ interrupt. This flag is set at the beginning of Vp886GetEvent, and
+ cleared at the end. */
+ bool inGetEvent;
+
+ /* Indicates whether we still have a signaling register read remaining to
+ be processed in VpGetEvent(). This is useful for determining if we need
+ to force an interrupt to update status information when a detector mask
+ ends */
+ bool sigregReadPending;
+
+ struct {
+ /* Count of SPI errors for VP_DEVICE_OPTION_ID_SPI_ERROR_CTRL. */
+ uint16 count;
+ /* If the SPI error mode is BLOCK and the count exceeds the specified
+ threshold, this flag will be set to TRUE and will block most API
+ calls */
+ bool block;
+ /* This flag is set when a SPI error is detected to indicate that we
+ should send NOOPs to clear the MPI buffer before the next transaction */
+ bool clearMpi;
+ /* When VpGetEvent() returns a SPI error event, we want to break out of
+ the application-side "while(VpGetEvent==TRUE)" loop. This flag will
+ be set to cause the next VpGetEvent to return FALSE without reading
+ the sigreg. */
+ bool skipGetEvent;
+ } spiError;
+
+ /* Keep track of critical section depth. This is currently only used to
+ generate warnings if it goes above 1 (indicating nested critical
+ sections) or below 0. */
+ uint8 criticalDepth;
+
+#define VP886_TIMER_QUEUE_API_SIZE 8
+#if defined(VP886_USER_TIMERS)
+ #define VP886_TIMER_QUEUE_SIZE (VP886_TIMER_QUEUE_API_SIZE + VP886_USER_TIMERS)
+#else
+ #define VP886_TIMER_QUEUE_SIZE (VP886_TIMER_QUEUE_API_SIZE)
+#endif
+ /* Software timer queue, see vp_timer_queue.c/h */
+ VpTimerQueueInfoType timerQueueInfo;
+ VpTimerQueueNodeType timerQueueNodes[VP886_TIMER_QUEUE_SIZE];
+
+#if (VP886_USER_TIMERS > 0)
+ /* Number of currently running user timers. Used to implement a limit
+ of VP886_USER_TIMERS */
+ int16 userTimers;
+#endif
+
+ /* Cache for all device option settings */
+ Vp886DevOptionsCacheType options;
+
+ /* Soft values from the device profile that are used throughout the VP-API-II
+ (not only in Init). Note that other values may be provided by the device
+ profile, but are stored in other ways generally because they also may NOT
+ be provided in the device profile (i.e., API has default values). */
+ Vp886DeviceProfileType devProfileData;
+
+ /* This is the profile pointer table per the VP-API-II User's Guide. */
+ VpCSLACDeviceProfileTableType devProfileTable;
+
+ /* This is the structure indicating which profile table entries have been
+ initialized. If profile tables are disabled, this and the device profile
+ table (devProfileTable) can be removed. */
+ uint16 profTableEntryValid[VP886_NUM_PROFILE_TYPES];
+
+ /* Structure to support buffered writes */
+ VpSlacBufDataType slacBufData;
+
+ /* Flag to temporarily disable flushing the write buffer before performing
+ a read. By default, Vp886SlacRegRead() will send the contents of the
+ write buffer before performing the read to prevent issues with assumed
+ write->read operations. This flag can be set when it is known that the
+ read does not depend on any actions in the write buffer. The flag is set
+ back to FALSE on each read. */
+ bool dontFlushSlacBufOnRead;
+
+ /* Number of bytes sent/received to/from the device since the last
+ VP_QUERY_ID_DEV_TRAFFIC query */
+ uint32 trafficBytes;
+
+ /* These switcher parameters are from the user setting in the
+ device profile. They should never be changed except in Init (in case
+ the values provided are illegal). */
+ uint8 swParams[VP886_R_SWPARAM_LEN];
+
+ /* Switching Regulator Timings for normal, Free Run, and battery backup
+ modes */
+ uint8 swTimingParams[VP886_R_SWTIMING_LEN];
+ uint8 swTimingParamsFR[VP886_R_SWTIMING_LEN];
+ uint8 swTimingParamsBattBackup[VP886_R_SWTIMING_LEN];
+
+ /* The device profile contains switcher timing parameters for low power
+ mode (the first two bytes) that should only be applied if all lines are
+ low power termination type. The flag useLowPowerTiming begins TRUE,
+ but is set to FALSE if any non-lowpower line is initialized. As each
+ line is initialized, the switcher timing params are set based on this. */
+ bool useLowPowerTiming;
+ uint8 swTimingParamsLP[2];
+
+ /* Optionally use different low power params during the initial power supply
+ bringup to protect components. If softStartDuration is 0 this is
+ disabled, and we will use the normal params and the normal delay. */
+ uint8 softStartDuration; /* 5ms stepsize */
+ uint8 swTimingParamsSoftStart[VP886_R_SWTIMING_LEN];
+
+ /* State variable for the Vp886InitDevice state machine. This is used
+ inside the Vp886InitDeviceSM function to keep track of the state
+ and specify which state (case) of the switch statement to enter. */
+ Vp886InitDeviceStateType initDeviceState;
+
+ /* Current ABS power mode requirement for each channel. This is needed for
+ some cases where an operation on one line needs to know the current state
+ of the other line. For example, if one line is exiting ringing, we need
+ to know the state of the other line to know whether we can lower the
+ switcher power mode. */
+ Vp886AbsPowerReqType absPowerReq[VP886_MAX_NUM_CHANNELS];
+
+ /* When TRUE for a channel, indicates that the channel requires ringing
+ battery levels. This will be set by Vp886SetABSRingingBattFlag() each
+ time the line state changes. */
+ bool absRingingBattRequired[VP886_MAX_NUM_CHANNELS];
+
+ /* Peak ringing voltage (amplitude+bias) for each channel that must be
+ supported by the battery voltage */
+ uint8 absRingingPeak[VP886_MAX_NUM_CHANNELS];
+
+ /* Used by Adaptive Ringing to see if the other line is power limited */
+ bool isPowerLimited[2];
+
+ /* Current switcher voltage settings, which can change on the fly to support
+ different ringing voltages for ABS */
+ uint8 swyv;
+ uint8 swzv;
+
+ /* Indicates which channels are using the sampling timer (ch2 timer) so that
+ a line-specific function can know whether it is in use by the other line.
+ The value is the required timer setting in 0.5ms steps. */
+ uint8 samplingTimerReq[VP886_MAX_NUM_CHANNELS];
+
+ /* The current sampling timer period */
+ uint8 samplingTimerCurrent;
+
+ /* Current battery fault status, bitmask of VpBatFltEventDataType values */
+ uint16 battFltStatus;
+
+ /* Interval in ms that we are polling to check for battery fault changes */
+ uint16 battFltPollTime;
+
+ /* Indicates whether we think there's currently a switcher cycle skip
+ condition based on filtered processing of the interrupt */
+ bool swSkipPresent;
+
+ /* Timestamps of the most recent overcurrent interrupts, per channel.
+ We need to see two interrupts within a defined period to declare an
+ actual overcurrent event. */
+ uint32 overCurrentTimestamp[VP886_MAX_NUM_CHANNELS];
+
+ struct {
+ uint8 vsw;
+ uint8 swy;
+ int8 vbhOverhead;
+ } battBackup;
+
+ /* Keep track of the battery select GPIO state so we only need to write
+ it when it changes */
+ uint8 batSelGpioState;
+
+ /* State variable for the Vp886CalCodec state machine. This is used
+ inside the Vp886CalCodecSM function to keep track of the state
+ and specify which state (case) of the switch statement to enter. */
+ Vp886CalCodecStateType calCodecState[VP886_MAX_NUM_CHANNELS];
+
+ /* ChannelId of the line under test, 0->line1, 1->line2 */
+ bool channelCalBack[VP886_MAX_NUM_CHANNELS];
+ bool channelLocked[VP886_MAX_NUM_CHANNELS];
+
+ /* Calibration data */
+ int16 icalH;
+ int16 icalL;
+
+ VpPolarityType polarity[VP886_MAX_NUM_CHANNELS];
+
+ /* Calibration registers scratch-pad */
+ Vp886RegPadType regPad[VP886_MAX_NUM_CHANNELS];
+
+ /* Calibration profile structure */
+ Vp886CalDeviceDataType calData[VP886_MAX_NUM_CHANNELS];
+
+ /* CalCodec sub state machine variable */
+ Vp886CalCodecSubStateType calCodecSubState[VP886_MAX_NUM_CHANNELS];
+
+ /* Temporary SADC measurements */
+ /* Should be channel dependent for concurrent calibration (tmpResultX[VP886_MAX_NUM_CHANNELS]) */
+ int16 sadcSetting[VP886_MAX_NUM_CHANNELS];
+ int16 sadcSettingGp[VP886_MAX_NUM_CHANNELS][5];
+ int16 tmpResultA[VP886_MAX_NUM_CHANNELS];
+ int16 tmpResultB[VP886_MAX_NUM_CHANNELS];
+ int16 tmpResultC[VP886_MAX_NUM_CHANNELS];
+ int16 tmpResultD[VP886_MAX_NUM_CHANNELS];
+ int16 tmpResultE[VP886_MAX_NUM_CHANNELS];
+
+ /* Save pointers to the Device, AC, DC, and Ringing profiles.
+ These will be used for Vp886InitDevice() only and will only
+ be guaranteed valid until the end of the first state of the
+ Vp886InitDeviceSM() state machine. They will be used to send down
+ the profiles via Vp886ConfigLineInt() before the device bringup
+ sequence. */
+ VpProfilePtrType pDevProfile;
+ VpProfilePtrType pAcProfile;
+ VpProfilePtrType pDcProfile;
+ VpProfilePtrType pRingProfile;
+
+ /* Switcher mode during InitDevice. Transient value. */
+ uint8 initDevSwitcherMode;
+
+ /* Cache for global registers */
+ struct {
+ uint8 sigreg[VP886_R_SIGREG_LEN];
+ uint8 swCtrl[VP886_R_SWCTRL_LEN];
+ uint8 swTiming[VP886_R_SWTIMING_LEN];
+ uint8 intMask[VP886_R_INTMASK_LEN];
+ uint8 devCfg[VP886_R_DEVCFG_LEN];
+ uint8 fuse8[VP886_R_FUSE_REG_8_LEN];
+ } registers;
+
+#ifdef VP_DEBUG
+ /* For runtime enabling of debug output: */
+ uint32 debugSelectMask;
+
+#if (VP_CC_DEBUG_SELECT & VP_DBG_WARNING)
+ /* Array of function names to help debug nested critical section issues */
+ #define VP886_CRITSEC_STRING_NUM 3
+ #define VP886_CRITSEC_STRING_LENGTH 20
+ char critSecFuncs[VP886_CRITSEC_STRING_NUM][VP886_CRITSEC_STRING_LENGTH+1];
+#endif /* (VP_CC_DEBUG_SELECT & VP_DBG_WARNING) */
+
+#endif /* VP_DEBUG */
+
+ bool timerOverride;
+} Vp886DeviceObjectType;
+
+#endif /* VP886_API_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_CSLAC_types.h b/marvell/services/mislic/api_lib/includes/vp_CSLAC_types.h
new file mode 100644
index 0000000..9fbe556
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_CSLAC_types.h
@@ -0,0 +1,666 @@
+/** \file vp_CSLAC_types.h
+ * vp_CSLAC_types.h
+ *
+ * Header file for internal variables used in CSLAC type API.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 11488 $
+ * $LastChangedDate: 2014-07-14 16:56:02 -0500 (Mon, 14 Jul 2014) $
+ */
+
+#ifndef VP_CSLAC_TYPES_H
+#define VP_CSLAC_TYPES_H
+
+#include "vp_api_fxo_params.h"
+#include "vp_api_timer.h"
+#include "vp_api_common.h"
+
+#define VP_CSLAC_DEV_PROFILE_VERSION_INT_SW_CONFIG_FR 5
+#define VP_CSLAC_DEV_PROFILE_VERSION_INT_SW_CONFIG 4
+#define VP_CSLAC_DEV_PROFILE_VERSION_LINECARD_PARAM 3
+#define VP_CSLAC_DEV_PROFILE_VERSION_VBH_REG 2
+#define VP_CSLAC_DEV_PROFILE_VERSION_SW_CONFIG 1
+
+#define VP_CSLAC_FXO_VERSION_DTMF_LEVEL 1
+#define VP_CSLAC_FXO_VERSION_POH 2
+
+#define VP_CSLAC_DC_PROFILE_VERSION_890 1
+
+#define VP_CSLAC_RING_PROFILE_VERSION_890 1
+
+#define VP_CSLAC_TICKSTEP_0_5MS (0x80) /**< CSLAC Tickrate for 0.5mS */
+#define VP_CSLAC_TICKSTEP_1MS (0x100) /**< CSLAC Tickrate for 1mS */
+
+#define VP_CID_TIMESCALE 1 /**< Timescale in mS for CID time data */
+
+#define VP_CSLAC_DEV_PROF_TABLE_SIZE 1
+#define VP_CSLAC_AC_PROF_TABLE_SIZE 2
+#define VP_CSLAC_DC_PROF_TABLE_SIZE 2
+#define VP_CSLAC_RINGING_PROF_TABLE_SIZE 2
+#define VP_CSLAC_TONE_CADENCE_PROF_TABLE_SIZE 11
+#define VP_CSLAC_TONE_PROF_TABLE_SIZE 10
+#define VP_CSLAC_RING_CADENCE_PROF_TABLE_SIZE 4
+#define VP_CSLAC_METERING_PROF_TABLE_SIZE 2
+#define VP_CSLAC_CALLERID_PROF_TABLE_SIZE 2
+#define VP_CSLAC_FXO_CONFIG_PROF_TABLE_SIZE 1
+#define VP_CSLAC_CUSTOM_TERM_PROF_TABLE_SIZE 4
+
+/* Special Howler Bit-Mask 'xxx1 11xx' */
+#define VP_CSLAC_SPECIAL_TONE_MASK (0x1C)
+#define VP_CSLAC_STD_TONE (0x00)
+#define VP_CSLAC_HOWLER_TONE (0x04) /* UK BTNR 1080 Specification */
+#define VP_CSLAC_AUS_HOWLER_TONE (0x08)
+#define VP_CSLAC_NTT_HOWLER_TONE (0x0C)
+#define VP_CSLAC_UK_HOWLER_TONE_VER15 VP_CSLAC_HOWLER_TONE
+#define VP_CSLAC_UK_HOWLER_TONE_DRAFT_G (0x10)
+
+#define VP_CSLAC_TONE_TYPE 5
+
+#define VP_CSLAC_READ_RESPONSE_MASK (VP_LINE_EVID_LLCMD_RX_CMP \
+ | VP_LINE_EVID_RD_OPTION \
+ | VP_LINE_EVID_GAIN_CMP)
+
+typedef struct VpCSLACDeviceProfileTableType {
+ VpProfilePtrType pDevProfileTable[VP_CSLAC_DEV_PROF_TABLE_SIZE];
+ VpProfilePtrType pAcProfileTable[VP_CSLAC_AC_PROF_TABLE_SIZE];
+ VpProfilePtrType pDcProfileTable[VP_CSLAC_DC_PROF_TABLE_SIZE];
+ VpProfilePtrType pRingingProfileTable[VP_CSLAC_RINGING_PROF_TABLE_SIZE];
+ VpProfilePtrType pToneCadProfileTable[VP_CSLAC_TONE_CADENCE_PROF_TABLE_SIZE];
+ VpProfilePtrType pToneProfileTable[VP_CSLAC_TONE_PROF_TABLE_SIZE];
+ VpProfilePtrType pRingingCadProfileTable[VP_CSLAC_RING_CADENCE_PROF_TABLE_SIZE];
+ VpProfilePtrType pMeteringProfileTable[VP_CSLAC_METERING_PROF_TABLE_SIZE];
+ VpProfilePtrType pCallerIdProfileTable[VP_CSLAC_CALLERID_PROF_TABLE_SIZE];
+ VpProfilePtrType pFxoConfigProfileTable[VP_CSLAC_FXO_CONFIG_PROF_TABLE_SIZE];
+ VpProfilePtrType pCustomTermProfileTable[VP_CSLAC_CUSTOM_TERM_PROF_TABLE_SIZE];
+} VpCSLACDeviceProfileTableType;
+
+/**
+ * The following structure is used by the device as a bitmask indicating
+ * whether or not a given profile table entry is valid. In the bit location a
+ * value '1' = profile is current, '0' = profile is not current.
+ */
+typedef struct VpCSLACProfileTableEntryType {
+ uint16 devProfEntry;
+ uint16 acProfEntry;
+ uint16 dcProfEntry;
+ uint16 ringingProfEntry;
+ uint16 toneCadProfEntry;
+ uint16 toneProfEntry;
+ uint16 ringCadProfEntry;
+ uint16 meterProfEntry;
+ uint16 cidCadProfEntry;
+ uint16 fxoConfigProfEntry;
+ uint16 customTermProfEntry;
+} VpCSLACProfileTableEntryType;
+
+#define VP_PROF_ENTRY_INVALID 0
+#define VP_PROF_ENTRY_VALID 1
+
+typedef union VpGetResultsOptionsDataType {
+ VpOptionCriticalFltType criticalFaultOption;
+ VpOptionEventMaskType eventMaskOption;
+ VpOptionPulseModeType pulseModeOption;
+ VpOptionPulseType pulseTypeOption;
+ VpOptionRingControlType ringControlOption;
+ VpOptionZeroCrossType zeroCross;
+ VpOptionTimeslotType timeSlotOption;
+ VpOptionCodecType codecOption;
+ VpOptionPcmHwyType pcmHwyOption;
+ VpOptionLoopbackType loopBackOption;
+ VpOptionLineStateType lineStateOption;
+ VpOptionPcmTxRxCntrlType pcmTxRxCtrl;
+ VpDeviceIoAccessDataType deviceIoData;
+ VpOptionDeviceIoType deviceIo;
+ VpLoopCondResultsType loopCond;
+ bool autoShutdownEn;
+ VpOptionAbsGainType absGain;
+ VpOptionDcFeedParamsType dcFeedParams;
+ VpOptionRingingParamsType ringingParams;
+} VpGetResultsOptionsDataType;
+
+typedef struct VpGetResultsOptionsType {
+ VpGetResultsOptionsDataType optionData;
+ uint8 chanId;
+ VpOptionIdType optionType;
+} VpGetResultsOptionsType;
+
+/* Caller ID DTMF On/Off Intervals
+ * ================================
+ * The macros below are specified in ms with the following conditions to consider:
+ * - Minimum On/Off-Time in ETSI Standards (reference?) is 65ms defined as the time to transition
+ * from the 10% to 90% level and vise-versa. There's a contribution of the silicon to this time
+ * factor that should be taken into consideration.
+ * - VP-API-II Supports Host Processing Time/Jitter of up to 2ms. This is the limitation of the
+ * silicon hook-bit, test data, and caller id buffers.
+ *
+ * TECHNICAL: The theoretical minimum is 67ms in an ideal world - so 70ms is used primarily to
+ * increase room for error in non-ideal conditions. Since this requirement is a MIN value, the
+ * macro used must be MS_TO_TICKS_ROUND_UP. Applications using tickrates that result in (70/tick)
+ * to result in a non-integer value such as 8.33ms (e.g.) could generate output intervals as low
+ * as 66.7. Taking into account 2ms jitter reduces this to 64.7ms, below the >= 65ms requirement.
+ *
+ * SUMMARY: DTMF On/Off-Times both need to be generated with 70ms duration. Tick based devices
+ * must use the rounding up macro (MS_TO_TICKS_ROUND_UP) in order to avoid unexpected rounding low
+ * near the minimum threshold.
+ */
+#define VP_CID_DTMF_ON_TIME 70
+#define VP_CID_DTMF_OFF_TIME 70
+
+typedef enum VpCidGeneratorControlType {
+ VP_CID_GENERATOR_DATA,
+ VP_CID_GENERATOR_KEYED_CHAR,
+ VP_CID_SIGGEN_EOT,
+ VP_CID_NO_CHANGE, /**< Load tones only, do not change generator state */
+ VP_CID_GENERATOR_MARKOUT,
+ VP_CID_CTRL_TYPE_CNT,
+
+ VP_CID_GENC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpCidGeneratorControlType;
+
+/* Previously VpCidStatusFlagType values */
+#define VP_CID_RESET_VALUE (0x00000000L)
+
+#define VP_CID_IS_DEBOUNCE (0x00000001L) /**< Set when debounce has expired */
+#define VP_CID_CLIAWAITTONE (0x00000002L)
+#define VP_CID_REPEAT_MSG (0x00000004L)
+#define VP_CID_AWAIT_TONE (0x00000008L) /**< Set if waiting for CPE ACK Tone */
+
+#define VP_CID_TERM_FSK (0x00000010L) /**< Set if in a Mark or Channel Seizure Interval */
+#define VP_CID_END_OF_MSG (0x00000020L) /**< Set if API detects an end of
+ * message in the buffered data
+ */
+
+#define VP_CID_FSK_GEN_VALID (0x00000040L) /**< Set if FSK Generator is programmed
+ * for Caller ID signals.
+ */
+
+#define VP_CID_IN_PROGRESS (0x00000080L) /**< Set if Caller ID is in progress */
+#define VP_CID_ACTIVE_RING_SEQ (0x00000100L) /**< Set if active CID Ring sequence */
+
+#define VP_CID_PRIMARY_FULL (0x00000200L) /**< Set when primary buffer contains
+ * CID data
+ */
+#define VP_CID_SECONDARY_FULL (0x00000400L) /**< Set when secondary buffer contains
+ * CID data
+ */
+#define VP_CID_PRIMARY_IN_USE (0x00000800L) /**< Set when primary buffer in use */
+#define VP_CID_SECONDARY_IN_USE (0x00001000L) /**< Set when secondary buffer in use */
+#define VP_CID_WAIT_ON_ACTIVE (0x00002000L) /**< Set when a "wait on" mode is
+ * active. Should only be cleared in
+ * the timer function (since currently
+ * support only for Wait on CID or time
+ */
+#define VP_CID_MID_CHECKSUM (0x00004000L) /**< Set when a checksum value is being
+ * sent.
+ */
+#define VP_CID_MUTE_ON (0x00008000L) /**< Set when a "Mute On" CID operator
+ * is active.
+ */
+#define VP_CID_FSK_ACTIVE (0x00010000L) /**< Set while the FSK Generator is needed */
+
+
+typedef enum VpCidDtmfStatusType {
+ VP_CID_DTMF_RESET_VALUE = 0,
+ VP_CID_ACTIVE_ON_TIME = 1,
+ VP_CID_ACTIVE_OFF_TIME = 2
+} VpCidDtmfStatusType;
+
+/** Caller ID variables used by the line */
+typedef struct VpCallerIdType {
+ uint32 status; /**< 'OR'ed combination of VpCidStatusFlagType */
+
+ VpCidDtmfStatusType dtmfStatus; /**< Used only for DTMF CID Message Data */
+
+ uint16 cliTimer; /**< Time in increments of device ticks */
+ uint8 currentData; /**< Data to repeat on the line */
+ uint16 cidCheckSum; /**< Checksum to append to message data */
+
+ uint8 cliDebounceTime; /**< Hook debouce specified in device ticks */
+ VpProfilePtrType pCliProfile; /**< Currently running CID Profile */
+
+ VpDigitType cliDetectTone1;
+ VpDigitType cliDetectTone2;
+
+ uint8 cliMPIndex; /**< Current Index into primary message buffer */
+ uint8 cliMSIndex; /**< Current Index into secondary message buffer */
+
+ uint8 cliIndex; /**< Current Index into profile data */
+
+ uint8 primaryBuffer[VP_SIZEOF_CID_MSG_BUFFER];
+ uint8 secondaryBuffer[VP_SIZEOF_CID_MSG_BUFFER];
+
+ uint8 primaryMsgLen; /**< Length of data in the primary buffer */
+ uint8 secondaryMsgLen; /**< Length of data in the secondary buffer */
+ VpDigitType digitDet; /**< Stores the last DTMF digit detected during
+ * Caller ID (if enabled via tone detection).
+ */
+ uint8 messageDataRemain; /**< Tracks the total number of message bytes remaining */
+
+ /*
+ * At the end of FSK Message Data, some systems require a mark-out time. As
+ * specified in the Profile Wizard, this is defined in # of bytes with each
+ * byte corresponding to 8.33ms (1200 baud with 1 start + 1 stop + 8 data
+ * bits = 10/1200 = 8.33ms).
+ */
+ uint8 markOutByteCount; /* Retains the value specified in the profile */
+ uint8 markOutByteRemain; /* Current value remaining. Clean up when = 0 */
+} VpCallerIdType;
+
+typedef enum VpCadenceStatusType {
+ VP_CADENCE_RESET_VALUE = 0x0,
+ VP_CADENCE_STATUS_ACTIVE = 0x1,
+ VP_CADENCE_STATUS_BRANCHING = 0x2,
+ VP_CADENCE_STATUS_MID_TIMER = 0x4,
+ VP_CADENCE_STATUS_SENDSIG = 0x8,
+ VP_CADENCE_STATUS_METERING = 0x10,
+ VP_CADENCE_STATUS_BRANCHING_LVL2 = 0x20,
+ VP_CADENCE_STATUS_IGNORE_POLARITY = 0x40,
+ VP_CADENCE_STATUS_WAITING_ON_CID = 0x80
+} VpCadenceStatusType;
+
+/** Variables to control the cadence on the line using the Sequencer */
+#define VP_CSLAC_MAX_BRANCH_DEPTH 2
+#define VP_CSLAC_BRANCH_LVL_0 0
+#define VP_CSLAC_BRANCH_LVL_1 1
+
+typedef struct VpSeqDataType {
+ VpProfilePtrType pActiveCadence; /**< Currently Active Cadence */
+ VpProfilePtrType pCurrentPos; /**< Current position in profile */
+
+ VpCadenceStatusType status;
+
+ uint8 index; /**< Index in the the cadence table */
+ uint8 length; /**< Length of executable cadence instructions */
+
+ /* Branch status info */
+ uint8 count[VP_CSLAC_MAX_BRANCH_DEPTH];
+ uint8 branchAt;
+
+ uint16 timeRemain;
+ uint16 meteringBurst; /**< Tracks the number of metering pulses sent */
+ bool meterPendingAbort; /**< Indicates that metering should abort after the
+ * current pulse ends */
+ VpLineStateType meterAbortLineState; /**< The line state that should be set
+ * when metering aborts */
+
+ /* The following variables are for controlling signal generator ramp */
+#define VPCSLAC_MAX_GENERATOR_DATA 11
+ uint8 regData[VPCSLAC_MAX_GENERATOR_DATA]; /**< Scratchpad to reduce MPI
+ * traffic.
+ */
+ /*
+ * These values should correspond to device specific values for the
+ * freqency/level being set -- not a generic value.
+ */
+ uint16 startFreq;
+ bool isFreqIncrease;
+ uint16 stopFreq;
+ uint16 freqStep;
+
+ uint16 startLevel;
+ uint16 stopLevel;
+ uint16 levelStep;
+ uint8 toneType;
+} VpSeqDataType;
+/*
+ * Used to save values of registers that will be modified for Special Howler Tones. These
+ * tones require very high amplitude which can be done on VE880/890 using some back-door
+ * controls. Note that VE880/890 have the same command set in the case of these registers
+ */
+#define VP_CSLAC_ICR1_LEN (4)
+#define VP_CSLAC_ICR2_LEN (4)
+#define VP_CSLAC_ICR3_LEN (4)
+#define VP_CSLAC_ICR4_LEN (4)
+#define VP_CSLAC_DC_FEED_LEN (2)
+#define VP_CSLAC_VP_GAIN_LEN (1)
+#define VP_CSLAC_GR_LEN (2)
+#define VP_CSLAC_R_LEN (14)
+#define VP_CSLAC_DISN_LEN (1)
+#define VP_CSLAC_OP_FUNC_LEN (1)
+#define VP_CSLAC_SW_REG_LEN (3)
+
+#ifdef VP_HIGH_GAIN_MODE_SUPPORTED
+typedef struct VpHowlerModeCachedValues {
+ bool isInHowlerMode; /**< Set to TRUE when in Howler Mode and values below are good */
+
+ uint8 icr1Reg[VP_CSLAC_ICR1_LEN]; /**< ICR1 = 0xEC/ED */
+ uint8 icr2Reg[VP_CSLAC_ICR2_LEN]; /**< ICR2 = 0xEE/EF */
+ uint8 icr3Reg[VP_CSLAC_ICR3_LEN]; /**< ICR3 = 0xF2/F3 */
+ uint8 icr4Reg[VP_CSLAC_ICR4_LEN]; /**< ICR4 = 0xEC/ED */
+ uint8 dcFeed[VP_CSLAC_DC_FEED_LEN];
+
+ uint8 digitalRxLoss[VP_CSLAC_VP_GAIN_LEN]; /**< VP Gain Reg - only changing Digital RX Loss */
+ uint8 grValue[VP_CSLAC_GR_LEN];
+ uint8 rValue[VP_CSLAC_R_LEN];
+
+ uint8 disn[VP_CSLAC_DISN_LEN];
+
+ /*
+ * Z and B will be disabled using the Operating Function Register instead of writing
+ * "disable" coefficients. Obviously - less MPI traffic by at least 33 bytes
+ */
+ uint8 opFunc[VP_CSLAC_OP_FUNC_LEN]; /**< Only disabling Z and B Filters */
+
+ uint8 swReg[VP_CSLAC_SW_REG_LEN]; /**< Used to change Tracking floor voltge to -30V */
+} VpHowlerModeCachedValues;
+#endif
+
+/** Variables to control the CID sequence on the line using the CID Sequencer */
+typedef struct VpCidSeqDataType {
+ VpProfilePtrType pActiveCadence; /**< Currently Active Cadence */
+ VpProfilePtrType pCurrentPos; /**< Current position in profile */
+
+ uint8 index; /**< Index in the the cadence table */
+ uint16 timeRemain;
+} VpCidSeqDataType;
+
+typedef VpStatusType
+(*VpSeqInstructionFuncPtrType) (
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pSequenceData);
+
+/**< VP_SEQ_OPERATOR_MASK, VP_SEQ_SUBTYPE_MASK and VP_SEQUENCER_TICKRATE
+ * First two defines are bit-wise masks to be used with Profile Bytes. The last value
+ * VP_SEQUENCER_TICKRATE is a mathematical value of the time in deviceProfile tick scale of the
+ * time steps of the sequencer (5ms).
+ */
+#define VP_SEQ_OPERATOR_MASK 0xE0
+#define VP_SEQ_SUBTYPE_MASK 0x1F
+#define VP_SEQUENCER_TICKRATE 0x0500 /**< 5mS -> Per-Step time of the Profile Wizard "Time" Cmd
+ * scaled to the Device Tickrate */
+
+
+/**< The super commands are the upper 3 bits of the command byte and therefore should never be
+ * used with types exceeding 8-bit
+ */
+#define VP_SEQ_SPRCMD_COMMAND_INSTRUCTION (0x00)
+#define VP_SEQ_SPRCMD_TIME_INSTRUCTION (0x20)
+#define VP_SEQ_SPRCMD_BRANCH_INSTRUCTION (0x40)
+
+/**< The sub commands are the lower 5 bits of the command byte */
+#define VP_SEQ_SUBCMD_SIGGEN (0x00)
+#define VP_SEQ_SUBCMD_LINE_STATE (0x01)
+#define VP_SEQ_SUBCMD_START_CID (0x02)
+#define VP_SEQ_SUBCMD_WAIT_ON (0x07) /**< Wait for CID or time to continue */
+
+#define VP_SEQ_SUBCMD_RAMP_GENERATORS (0x08) /**< Forces frequency/amplitude change of the tone
+ * generator. Tone Cadence associated with this
+ * command must be specified as "ramp" type.
+ */
+
+ /**< API Internal Use only operators */
+#define VP_SEQ_SUBCMD_METERING (0x10) /**< Cadence Metering */
+
+ /**< Bit-Fields for Tone Generator Control (see Profile Wizard Spec). */
+#define VP_SEQ_SIGGEN_ALL_DISABLED (0x00)
+#define VP_SEQ_SIGGEN_A_EN (0x01)
+#define VP_SEQ_SIGGEN_B_EN (0x02)
+#define VP_SEQ_SIGGEN_C_EN (0x04)
+#define VP_SEQ_SIGGEN_D_EN (0x08)
+
+/**< Definition for the states in the Profile Wizard output. These must always be used/accessed
+ * as uint8 types. Do everything possible to create compiler errors if they're used any differently
+ */
+typedef uint8 VpProfileCadencerStateTypes;
+#define VP_PROFILE_CADENCE_STATE_STANDBY ((VpProfileCadencerStateTypes)0)
+#define VP_PROFILE_CADENCE_STATE_TIP_OPEN ((VpProfileCadencerStateTypes)1)
+#define VP_PROFILE_CADENCE_STATE_TALK ((VpProfileCadencerStateTypes)2)
+#define VP_PROFILE_CADENCE_STATE_ACTIVE ((VpProfileCadencerStateTypes)3)
+#define VP_PROFILE_CADENCE_STATE_RSVD ((VpProfileCadencerStateTypes)4)
+#define VP_PROFILE_CADENCE_STATE_OHT ((VpProfileCadencerStateTypes)5)
+#define VP_PROFILE_CADENCE_STATE_DISCONNECT ((VpProfileCadencerStateTypes)6)
+#define VP_PROFILE_CADENCE_STATE_RINGING ((VpProfileCadencerStateTypes)7)
+#define VP_PROFILE_CADENCE_STATE_POLREV_STANDBY ((VpProfileCadencerStateTypes)8)
+#define VP_PROFILE_CADENCE_STATE_POLREV_TIP_OPEN ((VpProfileCadencerStateTypes)9)
+#define VP_PROFILE_CADENCE_STATE_POLREV_TALK ((VpProfileCadencerStateTypes)10)
+#define VP_PROFILE_CADENCE_STATE_POLREV_ACTIVE ((VpProfileCadencerStateTypes)11)
+#define VP_PROFILE_CADENCE_STATE_POLREV_RSVD ((VpProfileCadencerStateTypes)12)
+#define VP_PROFILE_CADENCE_STATE_POLREV_OHT ((VpProfileCadencerStateTypes)13)
+#define VP_PROFILE_CADENCE_STATE_POLREV_DISCONNECT ((VpProfileCadencerStateTypes)14)
+#define VP_PROFILE_CADENCE_STATE_POLREV_RINGING ((VpProfileCadencerStateTypes)15)
+#define VP_PROFILE_CADENCE_STATE_FXO_OHT ((VpProfileCadencerStateTypes)16)
+#define VP_PROFILE_CADENCE_STATE_FXO_LOOP_OPEN ((VpProfileCadencerStateTypes)17)
+#define VP_PROFILE_CADENCE_STATE_FXO_LOOP_CLOSE ((VpProfileCadencerStateTypes)18)
+#define VP_PROFILE_CADENCE_STATE_FXO_LOOP_TALK ((VpProfileCadencerStateTypes)19)
+#define VP_PROFILE_CADENCE_STATE_MSG_WAIT_NORM ((VpProfileCadencerStateTypes)20)
+#define VP_PROFILE_CADENCE_STATE_MSG_WAIT_POLREV ((VpProfileCadencerStateTypes)21)
+#define VP_PROFILE_CADENCE_STATE_UNKNOWN ((VpProfileCadencerStateTypes)255)
+
+/* struct VpDialPulseDetectType is for FXS lines when detecting digits */
+typedef enum VpDialPulseDetectStatesType {
+ VP_DP_DETECT_STATE_LOOP_OPEN = 0,
+ VP_DP_DETECT_STATE_LOOP_CLOSE = 1,
+ VP_DP_DETECT_STATE_IDLE = 2
+} VpDialPulseDetectStatesType;
+
+typedef struct VpDialPulseDetectType {
+ int digits;
+ uint16 lo_time;
+ uint16 lc_time;
+ VpDialPulseDetectStatesType state; /**< Dial Pulse State Machine state */
+ bool hookSt;
+ uint8 signalingData;
+} VpDialPulseDetectType;
+
+/* struct VpDigitGenerationDataType is for FXO lines when generating digits */
+typedef struct VpDigitGenerationDataType {
+ uint16 dtmfOnTime;
+ uint16 dtmfOffTime;
+ uint8 breakTime;
+ uint8 makeTime;
+ uint16 flashTime;
+ uint16 dpInterDigitTime;
+ uint8 dtmfHighFreqLevel[2];
+ uint8 dtmfLowFreqLevel[2];
+} VpDigitGenerationDataType;
+
+/** Virtual Device Registers - Used to reduce MPI accesses to the Device */
+typedef struct VpVirtualDeviceReg {
+ uint8 sigRegMSB; /**< Signaling Register's Most Significant byte */
+ uint8 sigRegLSB; /**< Signaling Register's Least Significant byte */
+ uint8 iMaskMSB; /**< Interrupt mask for the current line */
+ uint8 iMaskLSB; /**< Interrupt mask for the current line */
+ uint8 iMaskMSBSP; /**< Interrupt mask for the current line */
+ uint8 iMaskLSBSP; /**< Interrupt mask for the current line */
+ uint8 ccR1SP;
+ uint8 ccR5SP; /**< Scratchpad for CCR5 used during metering */
+ uint8 ccR8SP; /**< Scratchpad for CCR8 used during calibration */
+ uint8 ioReg; /**< IO Register for QSLAC SLIC states */
+} VpVirtualDeviceReg;
+
+/**<
+ * IMPORTANT: Make sure to update the type used for "state" member inside
+ * objects, structs, and passed to functions where the comment states the value
+ * is a bit-mask of "VpDeviceBusyFlagsType". Seach by "VpDeviceBusyFlagsType".
+ * There are no instance of this type itself.
+ */
+typedef enum VpDeviceBusyFlagsType {
+ /**< Indicates if function is running from InitDevice. Not the same as in
+ * the middle of an initialization process (including calibration). Used to
+ * allow InitDevice function calling other functions to be enabled. Otherwise,
+ * some functions will return "Device Not Initialized" error.
+ */
+ VP_DEV_INIT_IN_PROGRESS = 0x0001,
+
+ VP_DEV_INIT_CMP = 0x0002, /**< Set if device has been initialized */
+ VP_DEV_IN_CAL = 0x0004, /**< Set if device is busy calibrating */
+ VP_DEV_PENDING_INT = 0x0008, /**< Set if there is a pending interrupt */
+
+ VP_DEV_ABS_BAT_CAL = 0x0010, /**< Set when running ABS (batt switch) Cal */
+ VP_DEV_ABV_CAL = 0x0020, /**< Set when running ABV Calibration on Tracker */
+ VP_DEV_ABV_CAL_ABS = 0x0040, /**< Set when running ABV Calibration on ABS */
+ VP_DEV_DISC_PENDING = 0x0080, /**< Set when a Disconnect Timer was suspsended */
+
+ VP_DEV_TEST_BUFFER_READ = 0x0100, /**< Set if test buffer was read this tick */
+
+ /**< Set if device in process of warm reboot. Note that warm reboot
+ * detection alone only helps skipping of VpCalCodec() because it is run
+ * with VpInitDevice(). But it does not ensure that VpCalLine() was
+ * previously run.
+ */
+ VP_DEV_WARM_REBOOT = 0x0200,
+
+ /* Set while performing VpImplementDefaultSettings(). This can be used to
+ avoid entering nested critical sections, or to take other necessary
+ precautions due to internally calling the top level VpSetOption(). */
+ VP_DEV_IMPL_DEFAULT_OPTIONS = 0x0400,
+
+ VP_TEMP_IGNORE_ALL_BUSY_FLAGS = 0x4000 /* Set to temporarily ignore all other flags */
+
+} VpDeviceBusyFlagsType;
+
+typedef struct VpCSLACDeviceStatusType {
+ uint16 state; /**< This is a bit-mask of VpDeviceBusyFlagsType values */
+ uint8 globStatReg; /**< Holds state of the device stat reg */
+ uint8 calibrating; /**< Calibration timer */
+ uint8 numIntServiced; /**< Max interrupts to be serviced during tick */
+} VpCSLACDeviceStatusType;
+
+#define VP_CSLAC_MAX_RCN_PCN_SIZE 2
+typedef struct VpDeviceStaticInfoType {
+ uint8 rcnPcn[VP_CSLAC_MAX_RCN_PCN_SIZE]; /**< Revision Code Number and
+ * Product Code Number as
+ * applicable
+ */
+ uint8 maxChannels; /**< How many lines supported by this device */
+} VpDeviceStaticInfoType;
+
+typedef struct VpDeviceDynamicInfoType {
+ uint8 lastChan; /**< The last line checked */
+ bool clkFault; /** TRUE if a clock fault is active */
+ bool bat1Fault; /** TRUE if a bat1 fault is active and device level */
+ bool bat2Fault; /** TRUE if a bat2 fault is active and device level */
+ bool bat3Fault; /** TRUE if a bat3 fault is active and device level */
+} VpDeviceDynamicInfoType;
+
+/** Line state variables used by the line (api internal) */
+#ifdef STRICT_SIGNED_ENUM_VALUES
+typedef uint16 VpCslacLineCondType;
+
+#define VP_CSLAC_STATUS_INVALID (0x0000)
+
+#define VP_CSLAC_CLEAR (0x0000)
+
+/* FXS Type Status */
+#define VP_CSLAC_HOOK (0x0001)
+#define VP_CSLAC_GKEY (0x0002)
+
+/* FXO Type Status */
+#define VP_CSLAC_RAW_DISC (0x0001)
+#define VP_CSLAC_RINGING (0x0004)
+#define VP_CSLAC_DISC (0x0008)
+
+#define VP_CSLAC_AC_FLT (0x0010)
+#define VP_CSLAC_DC_FLT (0x0020)
+#define VP_CSLAC_THERM_FLT (0x0040)
+#define VP_CSLAC_CAL_ENABLE (0x0080)
+
+#define VP_CSLAC_CAL_FAIL (0x0100)
+#define VP_CSLAC_POLREV (0x0200)
+#define VP_CSLAC_POLREV_REPORTED (0x0400)
+#define VP_CSLAC_LIU (0x0800)
+
+#define VP_CSLAC_LINE_LEAK_TEST (0x1000)
+#define VP_CSLAC_RING_AMP_DET (0x2000)
+#define VP_CSLAC_RINGING_EXIT (0x4000)
+#define VP_CSLAC_STATUS_VALID (0x8000)
+#else
+typedef enum VpCslacLineCondType {
+ VP_CSLAC_STATUS_INVALID = 0x0000,
+
+ VP_CSLAC_CLEAR = 0x0000,
+
+ /* FXS Type Status */
+ VP_CSLAC_HOOK = 0x0001,
+ VP_CSLAC_GKEY = 0x0002,
+
+ /* FXO Type Status */
+ VP_CSLAC_RAW_DISC = 0x0001, /*
+ * Set on 890 when device level disconnect
+ * status is set. Cleared otherwise.
+ */
+
+ VP_CSLAC_RINGING = 0x0004, /**< Set when Ringing detected on Line */
+ VP_CSLAC_DISC = 0x0008, /**< Set when Disconnect detected on Line */
+
+ VP_CSLAC_AC_FLT = 0x0010,
+ VP_CSLAC_DC_FLT = 0x0020,
+ VP_CSLAC_THERM_FLT = 0x0040,
+ VP_CSLAC_CAL_ENABLE = 0x0080, /**< Set when the line is in a state that
+ * will allow device calibration
+ */
+
+ VP_CSLAC_CAL_FAIL = 0x0100,
+ VP_CSLAC_POLREV = 0x0200,
+ VP_CSLAC_POLREV_REPORTED = 0x0400,
+ VP_CSLAC_LIU = 0x0800,
+
+ VP_CSLAC_LINE_LEAK_TEST = 0x1000, /**< Set when line is being tested for
+ * resistive leak. Clear when test is
+ * complete.
+ */
+ VP_CSLAC_RING_AMP_DET = 0x2000,
+ VP_CSLAC_RINGING_EXIT = 0x4000, /**< Set when FXS line is exiting Ringing */
+ VP_CSLAC_STATUS_VALID = 0x8000
+} VpCslacLineCondType;
+#endif
+
+typedef enum VpCslacCalType {
+ VP_CSLAC_CAL_NONE = 0x0,
+ VP_CSLAC_CAL_VOC,
+ VP_CSLAC_CAL_ABV
+} VpCslacCalType;
+
+typedef struct VpApiIntLineStateType {
+ VpLineStateType currentState; /**< Current state of the line */
+ VpLineStateType previous; /**< Previous sate of the line */
+ VpLineStateType usrCurrent; /**< Current user set state of the line */
+
+ /**< Differences between the usrCurrent state and currentState occur during most API internal
+ * line state control operations. E.g., Ringing Cadence and Calibration. When performing line
+ * state control functions on behalf of the Application (e.g., VpSendSignal()), these should
+ * be the same. For ex: if running a Forrward Disconnect Send Signal operation, for the duration
+ * the line is in VP_LINE_DISCONNECT the reported state using VpGetLineState() should be
+ * VP_LINE_DISCONNECT - not the state the line was in prior to performing VpSendSignal().
+ */
+
+ uint16 condition; /**< 'OR' Combination of VpCslacLineCondType */
+ VpCslacCalType calType;
+
+ bool thermFltDebounce;
+ uint16 thermFltDebounceTimestamp;
+} VpApiIntLineStateType;
+
+ /**< Indexes into the Custome Term Profile Type. #define instead of enums becuase the values
+ * must never be negative (many compilers treat enum = int type) and types larger than 8-bit is
+ * a waste.
+ */
+#define VP_CUSTOM_TERM_SLIC_TYPE (6)
+#define VP_CUSTOM_TERM_NUM_STATES (7)
+
+ /**< Indexes into the FXO/Dialing Profile Type. #define instead of enums becuase the values
+ * must never be negative (many compilers treat enum = int type) and types larger than 8-bit is
+ * a waste.
+ */
+#define VP_FXO_DIAL_PRFL_DTMF_ON_MSB (6)
+#define VP_FXO_DIAL_PRFL_DTMF_ON_LSB (7)
+#define VP_FXO_DIAL_PRFL_DTMF_OFF_MSB (8)
+#define VP_FXO_DIAL_PRFL_DTMF_OFF_LSB (9)
+#define VP_FXO_DIAL_PRFL_FLASH_HOOK_MSB (10)
+#define VP_FXO_DIAL_PRFL_FLASH_HOOK_LSB (11)
+#define VP_FXO_DIAL_PRFL_PULSE_BREAK (12)
+#define VP_FXO_DIAL_PRFL_PULSE_MAKE (13)
+#define VP_FXO_DIAL_PRFL_INTERDIG_MSB (14)
+#define VP_FXO_DIAL_PRFL_INTERDIG_LSB (15)
+#define VP_FXO_DIAL_PRFL_RING_PRD_MAX (16)
+#define VP_FXO_DIAL_PRFL_RING_PRD_MIN (17)
+#define VP_FXO_DIAL_PRFL_RING_VOLT_MIN (18)
+#define VP_FXO_DIAL_PRFL_DISC_VOLT_MIN (19)
+#define VP_FXO_DIAL_PRFL_LIU_THRESH_MIN (20)
+#define VP_FXO_DIAL_PRFL_RSVD (21)
+#endif
+
+
+
+
diff --git a/marvell/services/mislic/api_lib/includes/vp_adaptive_ringing.h b/marvell/services/mislic/api_lib/includes/vp_adaptive_ringing.h
new file mode 100644
index 0000000..5562649
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_adaptive_ringing.h
@@ -0,0 +1,116 @@
+/** \file vp_adaptive_ringing.h
+ * vp_adaptive_ringing.h
+ *
+ * Header file that defines the data structureds related to the
+ * adaptive ringing power management routines
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 9497 $
+ * $LastChangedDate: 2012-02-06 17:03:04 -0600 (Mon, 06 Feb 2012) $
+ */
+
+#ifndef VP_THERMAL_RINGING_H
+#define VP_THERMAL_RINGING_H
+
+#include "vp886_registers.h"
+
+/* Thermal Ringing Timer duration in ms. This needs to be short enough
+ * so that the SADC and VADC buffers are emptied often enough not
+ * to overflow. At the same time, the more often the timer fires,
+ * the greater amount of SPI traffic to read the buffers. It's
+ * a tradeoff that is system dependant. Choose wisely.
+ */
+#define VP_886_THERMAL_RINGING_TIMER_DURATION 10
+
+/* Timer to debounce any power adaptation steps. */
+#define VP_886_THERMAL_RINGING_DEBOUNCE_DURATION 160
+
+/* Specifies the sampling rate for the SADC and VADC */
+#define VP_886_THERMAL_RINGING_SADC_DRATE VP886_R_SADC_DRATE_GROUP_500HZ
+#define VP_886_THERMAL_RINGING_VADC_DRATE VP886_R_VADC_DRATE_500HZ
+
+/* In order to easily re-use the NGSLAC code, we scale the inputs to use
+ * that of the NGSLAC */
+#define VAB_INPUT_FULL_SCALE 240
+#define VAB_DESIRED_FULL_SCALE 400
+
+#define VBAT_INPUT_FULL_SCALE 240
+#define VBAT_DESIRED_FULL_SCALE 400
+
+#define IMT_INPUT_FULL_SCALE 1191
+#define IMT_DESIRED_FULL_SCALE 1000
+
+/* Full scale ringing gain */
+#define FULL_RINGING_GAIN 32767L
+
+/* Number of consecutive samples before taking a decision */
+#define DEB_COUNTER_MAX 4
+
+/* Size of data buffers used to hold data samples
+ * obtained from the ADCs. This is arbitrary at the
+ * moment and will likely be tweaked as necessary
+ * to avoid line object bloat while still holding
+ * enough samples for the algorithm to process.
+ * This could simply be just the size of the HW
+ * ADC buffers (12) or maybe some more just in-case
+ * a delay in processing is required.
+ */
+#define VP_886_THERMAL_RINGING_BUF_SIZE 32
+
+/* SLIC power calculation struct */
+typedef struct SlicPowerIntegratorStruct {
+ int16 samples;
+ int32 batPwr;
+ int32 loadPwr;
+ int32 imtSqr;
+} SlicPowerIntegrator;
+
+/* There will an instance on this struct in each line object */
+typedef struct RingPowerAdaptChannelDataStruct {
+ const unsigned short chan;
+ int16 halfCycCount;
+ int16 halfCycIdx;
+ SlicPowerIntegrator integrator;
+ SlicPowerIntegrator halfCyc[2];
+ int16 ringGain;
+} RingPowerAdaptChannelData;
+
+/* Need to define a struct that contains an instance of the above
+ * along with the necessary buffers and indicies for the SADC
+ * VADC data collection for Vring, Vbat, and IMT
+ */
+typedef struct RingPowerAdaptModuleStruct {
+ RingPowerAdaptChannelData rpaChanData;
+ int16 vtrBuf[VP_886_THERMAL_RINGING_BUF_SIZE];
+ int16 vbatBuf[VP_886_THERMAL_RINGING_BUF_SIZE];
+ int16 imtBuf[VP_886_THERMAL_RINGING_BUF_SIZE];
+ int16 vtrBufSWWrtIdx;
+ int16 vtrBufSWRdIdx;
+ int16 vbatBufSWWrtIdx;
+ int16 vbatBufSWRdIdx;
+ int16 imtBufSWWrtIdx;
+ int16 imtBufSWRdIdx;
+ int16 halfCycleTickCount;
+ int16 halfCycleTicks[2];
+ int16 rspt;
+ int16 rsptLow;
+ int16 rsptMid;
+ int16 rsptHigh;
+ int16 rtth;
+ int16 vtrDelay;
+ int16 vbatDelay;
+ int16 imtDelay;
+ uint16 rFuse;
+ int16 samplesAvail;
+ bool firstBufferThrownOut;
+ bool crunchTheNumbers;
+ uint8 ringGenParams[VP886_R_RINGGEN_LEN];
+ uint8 loopSup[VP886_R_LOOPSUP_LEN];
+ bool lowIlr;
+ bool debouncing;
+ uint8 debCounterHigh;
+ uint8 debCounterLow;
+} RingPowerAdaptModuleType;
+
+#endif /* VP_THERMAL_RINGING_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api.h b/marvell/services/mislic/api_lib/includes/vp_api.h
new file mode 100644
index 0000000..1f63426
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api.h
@@ -0,0 +1,148 @@
+/** \file vp_api.h
+ * vp_api.h
+ *
+ * Header file for the API-II c files.
+ *
+ * This file contains the all of the VoicePath API-II function prototypes. This
+ * file should be used to bring in the VP-API-II library modules that are
+ * necessary for a given application.
+ *
+ *****************************************************************************
+ * NOTE: Inclusion of only this file is sufficient to bring in the all the *
+ * necessary aspects of VP_API. *
+ *****************************************************************************
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12615 $
+ * $LastChangedDate: 2018-07-24 07:21:36 -0500 (Tue, 24 Jul 2018) $
+ */
+
+
+#ifndef VP_API_H
+#define VP_API_H
+
+/******************************************************************************
+ * VP-API Version *
+ *****************************************************************************/
+/*
+ * The following version number tag is updated at every release of the VP-API.
+ * Since the VP-API is a common interface that supports more than one device,
+ * version number change might occur when any aspect of the VP-API gets
+ * released.
+ */
+#define VP_API_VERSION_TAG (0x021B00)
+#define VP_API_VERSION_PATCH_NUM 0
+
+#define VP_API_VERSION_MAJOR_NUM (((VP_API_VERSION_TAG) & 0xFF0000) >> 16)
+#define VP_API_VERSION_MINOR_NUM (((VP_API_VERSION_TAG) & 0x00FF00) >> 8)
+#define VP_API_VERSION_MINI_NUM ((VP_API_VERSION_TAG) & 0x0000FF)
+
+
+/* First include various basic data types used in the API */
+#include "vp_api_types.h"
+
+/******************************************************************************
+ * Defines the configuration of VP-API library that needs to be built. *
+ * Please modify the following include file as per your VP-API library *
+ * requirement(s). *
+ ******************************************************************************/
+#include "vp_api_cfg.h"
+
+/******************************************************************************
+ * PLEASE DO NOT MODIFY BELOW THIS LINE *
+ ******************************************************************************/
+/* Include the main VP-API-Common file */
+#include "vp_api_common.h"
+
+/* Include the VP-API-Header file required for the CSLAC sequencer */
+#if defined (VP_CSLAC_SEQ_EN)
+#include "vp_api_cslac_seq.h"
+#endif
+
+/* Include the necessary files depending on the requirement of the project */
+#if defined (VP_CC_792_SERIES)
+#include "vp792_api.h" /* Vp792 device specific API functions and typedefs */
+#endif
+
+#if defined (VP_CC_880_SERIES)
+#include "vp880_api.h" /* Vp880 device specific API functions and typedefs */
+
+/*
+ * For 0823 LM, the FXO CID line is controlled by I/O3. For 0803 LM, it's
+ * controlled by I/O2. Control with I/O3 is better since I/O2 has more features
+ *
+ * #define VP880_FXO_CID_LINE VP880_IODATA_IO2 Use with 0803 ref
+ * #define VP880_FXO_CID_LINE VP880_IODATA_IO3 Use with 0823 ref
+ */
+#define VP880_FXO_CID_LINE VP880_IODATA_IO3
+#endif
+
+#if defined (VP_CC_890_SERIES)
+#include "vp890_api.h" /* Vp890 device specific API functions and typedefs */
+#endif
+
+#if defined (VP_CC_VCP_SERIES)
+#include "dvp_api.h" /* VCP device specific API functions and typedefs */
+#endif
+
+#if defined (VP_CC_VCP2_SERIES)
+#include "vcp2_api.h" /* VCP2 device specific API functions and typedefs */
+#endif
+
+#if defined (VP_CC_MELT_SERIES)
+#include "melt_api.h" /* VCP2-MeLT device specific API functions and typedefs */
+#endif
+
+#if defined (VP_CC_886_SERIES)
+#include "vp886_api.h" /* Vp886 device specific API functions and typedefs */
+#endif
+
+#if defined (VP_CC_MELT792_SERIES)
+#include "melt792_api.h" /* MeLT-792 device specific API functions and typedefs */
+#endif
+
+#if defined (VP_CC_KWRAP)
+#include "vp_kernel.h" /* KWRAP device specific API functions and typedefs */
+#endif
+
+/* Macros for calling a device-specific API function using the pointer in the
+ Device Context: */
+typedef void (*VpTempFuncPtrType) (void);
+
+#define VP_CALL_DEV_FUNC(func, args) \
+ (((pDevCtx->funPtrsToApiFuncs.func) == VP_NULL) ? VP_STATUS_FUNC_NOT_SUPPORTED : (pDevCtx->funPtrsToApiFuncs.func) args )
+
+/*
+ * Based on the existing structure of the include files the following def
+ * have been moved here.
+ */
+
+#if defined(VP_CC_880_SERIES) || defined(VP_CC_890_SERIES) || defined (VP_CC_886_SERIES)
+
+typedef union VpTestHeapType {
+ uint8 dummy; /* preventing an empty union */
+ #if defined(VP_CC_880_SERIES) && defined(VP880_INCLUDE_TESTLINE_CODE)
+ Vp880TestHeapType vpTestHeap880;
+ #define VP_TEST_HEAP_IS_REQUIRED
+ #endif
+
+ #if defined(VP_CC_890_SERIES) && defined(VP890_INCLUDE_TESTLINE_CODE)
+ Vp890TestHeapType vpTestHeap890;
+ #define VP_TEST_HEAP_IS_REQUIRED
+ #endif
+
+ #if defined(VP_CC_886_SERIES) && defined(VP886_INCLUDE_TESTLINE_CODE)
+ Vp886TestHeapType vpTestHeap886;
+ #define VP_TEST_HEAP_IS_REQUIRED
+ #endif
+} VpTestHeapType;
+#else
+typedef char VpTestHeapType;
+#endif
+
+#endif /* VP_API_H */
+
+
+
+
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_cfg.h b/marvell/services/mislic/api_lib/includes/vp_api_cfg.h
new file mode 100644
index 0000000..f522c53
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_cfg.h
@@ -0,0 +1,797 @@
+/** \file vp_api_cfg.h
+ * vp_api_cfg.h
+ *
+ * This file contains the configuration and compile time settings for
+ * building appropriate VP-API library modules needed for any application.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12408 $
+ * $LastChangedDate: 2017-06-08 16:48:24 -0500 (Thu, 08 Jun 2017) $
+ */
+
+#ifndef VP_API_CFG_H
+#define VP_API_CFG_H
+
+#include "vp_debug_masks.h"
+
+/**< NOTE Regarding compile-time settings to reduce code size. The values
+ * provided in these comments is for approximation and comparison purposes
+ * only. Specific savings will vary depending on the compiler and target
+ * processor.
+ */
+
+/**< VP_REDUCED_API_IF
+ * Define this to remove the I/F for unsupported functions. This reduces
+ * code size with the only limitation that the application cannot call
+ * functions that would return "Unsupported" for all devices used in the
+ * application. The specific functions removed will depend on the device and
+ * test packages compiled in.
+ */
+#define VP_REDUCED_API_IF
+
+/******************************************************************************
+ * COMPILE-TIME OPTIONS:: API DEBUG OUTPUT SELECTIONS *
+ *****************************************************************************/
+
+/**< VP_DEBUG
+ * If VP_DEBUG is undefined, then ALL debug messages will be compiled out. In
+ * this case, the code size will be smaller, but debug output CANNOT be enabled
+ * at runtime.
+ */
+#undef VP_DEBUG
+
+/**< VP_CC_DEBUG_SELECT
+ * Choose which types of debug messages to be compiled in. Only these message
+ * types can be enabled at runtime. See vp_debug_masks.h for a list of debug
+ * message types.
+ */
+#define VP_CC_DEBUG_SELECT (VP_DBG_ALL)
+
+/**< VP_OPTION_DEFAULT_DEBUG_SELECT
+ * The VP_OPTION_ID_DEBUG_SELECT option enables/disables debug output at
+ * runtime. Define the default value of this option here. The option will be
+ * automatically set to the default value at device initialization. See
+ * vp_debug_masks.h for a list of debug message types.
+ *
+ * Note: The VP_OPTION_ID_DEBUG_SELECT option can be changed with VpSetOption()
+ * only AFTER device initialization (VpInitDevice()). If you wish to
+ * see debug output messages during device initialization, you must set
+ * the default VP_OPTION_ID_DEBUG_SELECT value accordingly.
+ */
+#define VP_OPTION_DEFAULT_DEBUG_SELECT (VP_DBG_ERROR | VP_DBG_WARNING)
+
+/******************************************************************************
+ * COMPILE-TIME OPTIONS:: Conditionally-Compiled API Libraries *
+ *****************************************************************************/
+
+/*
+ * Define (or undefine) the appropriate compile time switches based on your
+ * application needs.
+ *
+ * NOTE: Such library selection compile time option(s) MUST be defined before
+ * including any other file from VoicePath library.
+ *
+ * NOTE: More than one Library modules can be built simultaneously (if needed).
+ */
+#ifndef ZARLINK_CFG_INTERNAL
+
+
+ /*
+ * Define the API libraries that will be included in this build
+ * only if the kernel wrapper library is not supported.
+ */
+
+ #undef VP_CC_792_SERIES /**< define to build 792 specific API library;
+ * undef to exclude this library. */
+
+ #undef VP_CC_880_SERIES /**< define to build 880 specific API library;
+ * undef to exclude this library. */
+
+ #define VP_CC_886_SERIES /**< define to build 886/887 specific API library;
+ * undef to exclude this library. */
+
+ #undef VP_CC_890_SERIES /**< define to build 890 specific API library;
+ * undef to exclude this library. */
+
+ /* VCP (VCP) library */
+ #undef VP_CC_VCP_SERIES /**< define to build VCP specific API library;
+ * undef to exclude this library. */
+ /* VCP2 library */
+ #undef VP_CC_VCP2_SERIES /**< define to build VCP2 specific API library;
+ * undef to exclude this library. */
+
+ #undef VP_CC_MELT_SERIES /**< define to build Melt specific API library;
+ * undef to exclude this library. */
+
+ #undef VP_CC_MELT792_SERIES /**< define to build Melt-792 specific API library;
+ * undef to exclude this library. */
+
+ #undef VP_CC_KWRAP
+
+ #if defined(VP_CC_KWRAP) && defined(__KWRAP__)
+ #error "VP_CC_KWRAP is only applicable to user space builds"
+ #endif
+
+#endif
+
+
+/******************************************************************************
+ * Include Files for the API *
+ *****************************************************************************/
+/* Include the API types for this architecture */
+#include "vp_api_types.h"
+
+/*
+ * Undef the following to remove the code necessary to run the API-II sequencer
+ * for CSLAC devices and to enable compile of API-II Lite. This is useful to
+ * reduce code space if the host is not using API-II "advanced" features.
+ */
+#if defined(VP_CC_880_SERIES) || defined(VP_CC_890_SERIES) || \
+ defined(VP_CC_886_SERIES)
+ /**< VP_CSLAC_SEQ_EN
+ * This is used to support all cadencing type operations on both FXO and
+ * FXS line types. This includes Ringing and Tone Cadencing, Metering
+ * Pulse, and VpSendSignal(). When set to #undef the VE890 code reduces by
+ * ~17K, the VE880 code reduces by ~20K. The ZL880 code reduces by ~13K.
+ */
+#define VP_CSLAC_SEQ_EN
+#endif
+
+#if defined(VP_CC_880_SERIES) || defined(VP_CC_886_SERIES) || defined(VP_CC_890_SERIES)
+ /**< VP_CSLAC_RUNTIME_CAL_ENABLED
+ * This is used to support run-time calibration via VpInitDevice() and
+ * VpCalLine(). With this #undef, System Coefficients MUST be applied
+ * using VpCal(). Set to #undef saves VE880 code size by ~19K bytes (if
+ * both Tracker and ABS are supported) and VE890 by ~10K bytes.
+ */
+ #define VP_CSLAC_RUNTIME_CAL_ENABLED
+
+ /**< VP_HIGH_GAIN_MODE_SUPPORTED
+ * This is used to support High Gain States VP_LINE_HOWLER and
+ * VP_LINE_HOWLER_POLREV. Set to #undef saves code size for VE880, ZL880 and
+ * VE890 by ~2K bytes.
+ */
+ #define VP_HIGH_GAIN_MODE_SUPPORTED
+
+ /**< UK Howler Tone Specifications
+ * VE880, ZL880, VE890 Applications only. The values below affect how UK
+ * Howler Tone will be provided on the line. To send UK Howler Tone the
+ * application must do the following:
+ *
+ * - Have the full version of VP_API-II (i.e., Le71SK0002)
+ * - Set VP_CLSAC_SEQ_EN to #define. Note: if setting VP_CLSAC_SEQ_EN
+ * to #define causes compiler errors, the Make process may either
+ * not be including the required *.c and *.h files or may be using
+ * the "Lite" version of the API (i.e., Le71SDKAPIL).
+ * - Create a Tone Cadence Profile with UK Howler Tone.
+ * - Provide this tone cadence to VpSetLineTone()
+ *
+ * There are two types of UK Howler Tones supported in the API:
+ *
+ * - VP_UK_HOWLER_BTNR_VER15
+ * The BTNR Version 15 Howler Tone will perform a frequency sweep
+ * between [800Hz to 3200Hz] at a 500ms period. Total sweep from
+ * [800-3200-800] will be nominal 1 second +/-166ms. At each 1
+ * second interval over a total duration of 12 seconds the tone
+ * level will increase by 3dB for total level increase of 36dB.
+ * The final level will be a nominal +14.5dBm @ 600ohm on T/R
+ * when also used with VP_LINE_HOWLER or VP_LINE_HOWLER_POLREV
+ * line states (see VpSetLineState() in API Reference Guide).
+ *
+ * - VP_UK_HOWLER_BTNR_DRAFT_G
+ * Draft 960-G Howler Tone is very similar to Version 15 with
+ * only a few differences. The frequency sweep is between [800Hz
+ * to 2500Hz] and the level varies by 3dB during the sweep
+ * interval such that the level at 2500Hz is ~3dB higher than the
+ * level at 800Hz. The total sweep time of 12 seconds is the same
+ * as well as the final output level of +14.5dBm @ 600ohm on T/R
+ * when also used with VP_LINE_HOWLER or VP_LINE_HOWLER_POLREV
+ * line states (see VpSetLineState() in API Reference Guide).
+ *
+ * The Application may choose which BTNR Specification to use when
+ * generating the UK Howler Tone by setting VP_UK_HOWLER_IN_USE value as
+ * follows:
+ *
+ * To use BTNR Version 15:
+ * #define VP_UK_HOWLER_IN_USE VP_UK_HOWLER_BTNR_VER15
+ *
+ * To use BTNR Draft-960 G:
+ * #define VP_UK_HOWLER_IN_USE VP_UK_HOWLER_BTNR_DRAFT_G
+ *
+ * Previous releases (P2.18.0 and earlier) provided UK Howler Tone
+ * per VP_UK_HOWLER_BTNR_VER15.
+ */
+ #define VP_UK_HOWLER_BTNR_VER15 0
+ #define VP_UK_HOWLER_BTNR_DRAFT_G 1
+ #define VP_UK_HOWLER_IN_USE VP_UK_HOWLER_BTNR_VER15
+
+#endif /* defined(VP_CC_880_SERIES) || defined(VP_CC_886_SERIES) || defined(VP_CC_890_SERIES) */
+
+/**< EXTENDED_FLASH_HOOK
+ * Define the following to include the onHookMin member in the
+ * VpOptionPulseType struct. Please note, this member (even if enabled here)
+ * is ignored in VCP1-790 applications.
+ */
+#define EXTENDED_FLASH_HOOK
+
+/**< VP_ENABLE_OFFHOOK_MIN
+ * Define the following to include the offHookMin member in the
+ * VpOptionPulseType struct for the VP_DEVICE_OPTION_ID_PULSE option to enable
+ * VP_LINE_EVID_HOOK_PREQUAL events.
+ */
+#define VP_ENABLE_OFFHOOK_MIN
+
+
+/******************************************************************************
+ * Library Specific COMPILE-TIME OPTIONS and defines *
+ *****************************************************************************/
+#ifdef VP_CC_792_SERIES
+
+#undef VP_COMMON_ADDRESS_SPACE /**< Define if all VP-API-II data
+ * structures (Line Objects, Line
+ * Contexts, Device Objects, Device
+ * Contexts, Profiles) are accessible
+ * at the same address in all processes
+ * (tasks) which call VP-API-II
+ * functions.
+ */
+
+#define VP_CC_792_GROUP /**< Define to include support for
+ * sharing an interrupt pin between
+ * multiple VP792 devices.
+ */
+
+#define VP792_MAILBOX_SPINWAIT 50000 /**< Number of times to poll the
+ * device's command mailbox before
+ * returning VP_STATUS_MAILBOX_BUSY.
+ */
+
+#define VP792_INCLUDE_TESTLINE_CODE /**< Defines whether or not to enable
+ * 792 line test capabilities
+ */
+
+#define VP792_SUPPORT_792388_REV_E_SILICON /**< Define this if you want to
+ * support Revision E of the
+ * Le792388 silicon. An appropriate
+ * SLAC firmware patch will be
+ * compiled in.
+ */
+#define VP792_SUPPORT_792388_REV_F_SILICON /**< Define this if you want to
+ * support Revision F of the
+ * Le792388 silicon. An appropriate
+ * SLAC firmware patch will be
+ * compiled in. */
+#define VP792_SUPPORT_792588_REV_A_SILICON /**< Define this if you want to
+ * support Revision A of the
+ * Le792588 silicon. An appropriate
+ * SLAC firmware patch will be
+ * compiled in.
+ */
+#define VP792_SUPPORT_792588_REV_B_SILICON /**< Define this if you want to
+ * support Revision B of the
+ * Le792588 silicon. An appropriate
+ * SLAC firmware patch will be
+ * compiled in.
+ */
+#endif /* VP_CC_792_SERIES */
+
+#ifdef VP_CC_MELT792_SERIES
+
+#define MELT792_MAILBOX_SPINWAIT 50000 /**< Number of times to poll the
+ * device's command mailbox before
+ * returning VP_STATUS_MAILBOX_BUSY.
+ */
+
+#define MELT792_SUPPORT_792588_REV_B_SILICON /**< Define this if you want to
+ * support Revision B of the
+ * Le792588 silicon. An appropriate
+ * SLAC firmware patch will be
+ * compiled in.
+ */
+#endif /* VP_CC_MELT792_SERIES */
+
+#ifdef VP_CC_880_SERIES
+
+/*******************************************************************************
+ * Applications can reduce VP-API-II driver size by changing the following for
+ * only the required silicon and termination types needed
+ *
+ * See VP-API-II User's Guide for Details.
+ ******************************************************************************/
+/**< Device Type Support.
+ * One of these MUST be defined if FXS Support is enabled. If you're not sure
+ * whether the silicon used in your application is ABS or Tracker, contact
+ * Microsemi customer support.
+ *
+ * Note that disabling either ABS or Tracker removes the associated calibration
+ * and line specific support (e.g., if disabling Tracker, then LPM also must be
+ * disabled).
+ */
+#define VP880_ABS_SUPPORT /**< VP880_ABS_SUPPORT
+ * #define this to support VE880 ABS type silicon.
+ * This includes but not limited to Le88266/86 and
+ * Le8822x/24x. When set to #undef reduces code
+ * size by ~9K bytes.
+ */
+
+#define VP880_TRACKER_SUPPORT /**< VP880_TRACKER_SUPPORT
+ * #define this to support VE880 Tracker type
+ * silicon. This includes but not limited to
+ * VE8820 Chipset and Le88276.
+ */
+
+/**< VE880 Termination Type Support.
+ *
+ * Note: Both ABS and Tracker can be #undef while FXO defined. This results in
+ * support for FXO only silicon, and FXO/FXS silicon support for the FXO
+ * termination type only. FXS support requires either ABS or Tracker support.
+ */
+#define VP880_FXO_SUPPORT
+#define VP880_FXS_SUPPORT
+
+/**< VP880_LP_SUPPORT
+ * When set to #undef, all of the code in the VE880 API that supports
+ * termination types VP_TERM_FXS_LOW_PWR, VP_TERM_FXS_SPLITTER_LP, and
+ * VP_TERM_FXS_ISOLATE_LP will be removed. When disabled, the VE880 code
+ * size is reduced by ~7K bytes.
+ */
+#define VP880_LP_SUPPORT
+
+/**< Specific FXO Algorithm support.
+ *
+ * The VP880_CLARE Ringing Detect algorithm uses features of the Clare and VE880
+ * silicon to provide maximum performance of signal detection on FXO lines.
+ * Alternative methods (with VP880_CLARE_RINGING_DETECT set to #undef) do not
+ * require connection of I/O4 to Clare device, but have the following drawbacks:
+ *
+ * 1. Ringing Signals MUST contain polarity reversal to be detected AND
+ * must exceed ~70V peak.
+ * 2. Line-In-Use is disabled.
+ * 3. Frequency Discriminaation is poor (limited to tickrate).
+ *
+ * It is recommended that all designs connect the CLARE Ringing output to IO4
+ * of the silicon. In that case, this value should be #define.
+ *
+ * Note: If FXO Support is disabled, this setting has no affect.
+ */
+#define VP880_CLARE_RINGING_DETECT
+
+/**< VP880_FXO_FULL_WAVE_RINGING
+ * Selects whether the Ringing input is 1/2-wave of full-wave. This must be
+ * set to #undef when using CPC5621 since this device provides only 1/2-wave
+ * ringing. For all other Clare devices, set to #define.
+ */
+#define VP880_FXO_FULL_WAVE_RINGING
+
+/**< VP880_ALWAYS_USE_INTERNAL_TEST_TERMINATION
+ * Define this option to always use the internal test termination for relay
+ * state VP_RELAY_BRIDGED_TEST, even for devices that have the test load
+ * switch. This is Microsemi's recommendation since the Internal Test
+ * Termination provides better isolation from the customer load and loop
+ * conditions when compared to the external test load.
+ */
+#undef VP880_ALWAYS_USE_INTERNAL_TEST_TERMINATION
+
+/* CSLAC library can be configured to handle the interrupt in four different
+ * configurations. Choose (only) one of the mechanisms by defining one of the
+ * following. */
+#define VP880_SIMPLE_POLLED_MODE /* Define to use simple polled interrupt
+ * handling mode */
+#undef VP880_EFFICIENT_POLLED_MODE /* Define to use efficient polled
+ * interrupt handling mode */
+#undef VP880_INTERRUPT_LEVTRIG_MODE /* Define to use level triggered
+ * interrupt handling mode */
+#undef VP880_INTERRUPT_EDGETRIG_MODE /* Define to use edge triggered
+ * interrupt handling mode */
+#undef VP880_INCLUDE_TESTLINE_CODE /* Defines whether or not to enable
+ * 880 line test capabilities */
+
+/**< VE880 Line Test Package Defines
+ * Defines all possible VE880 test line packages. There should be no reason to
+ * change these values. But if they are changed, they must be different from
+ * each other.
+ */
+#define VP880_LINE_TEST_AUDITOR 1
+#define VP880_LINE_TEST_PROFESSIONAL 2
+
+#ifdef VP880_INCLUDE_TESTLINE_CODE
+
+/**< VP880_INCLUDE_LINE_TEST_PACKAGE
+ * Selects the VE880 Line Test Package to include. Note that both Auditor and
+ * Professional cannot be included in the same build.
+ */
+#define VP880_INCLUDE_LINE_TEST_PACKAGE VP880_LINE_TEST_PROFESSIONAL
+
+/**< VP880_EZ_MPI_PCM_COLLECT
+ * #define this to have the api collect PCM samples via the MPI bus.
+ * If #undef, the Line Test code will expect the PCM samples from an
+ * external process (DSP or uProcessor) connected to the PCM BUS
+ */
+#define VP880_EZ_MPI_PCM_COLLECT
+
+/**< VP880_PCM_CALCULATION_TIME
+ * Define the maximum expected computation time to arrive at results for
+ * VpTestLineCallback() after having collected the necessary PCM samples.
+ */
+#define VP880_PCM_CALCULATION_TIME 1000 /* time is in ms */
+
+/**< VP880_INCLUDE_MPI_QUICK_TEST
+ * #define to enable a quick test of the MPI interface and HAL implementation
+ * during VpInitDevice(). This can be #undef to save on code size and MPI
+ * traffic at initialization after a design is proven to work.
+ */
+#define VP880_INCLUDE_MPI_QUICK_TEST
+
+#endif /* VP880_INCLUDE_TESTLINE_CODE */
+
+#endif /* VP_CC_880_SERIES */
+
+#ifdef VP_CC_890_SERIES
+
+/**< VE890 Generic Termination Type Support */
+#define VP890_FXO_SUPPORT
+#define VP890_FXS_SUPPORT
+
+/**< VP890_LP_SUPPORT
+ * When set to #undef, all of the code in the VE890 API that supports
+ * termination types VP_TERM_FXS_LOW_PWR, VP_TERM_FXS_SPLITTER_LP, and
+ * VP_TERM_FXS_ISOLATE_LP will be removed. When disabled, the VE890 code
+ * size is reduced by ~5K bytes.
+ */
+#define VP890_LP_SUPPORT
+
+#undef VP890_INCLUDE_TESTLINE_CODE /* Defines whether or not to enable
+ * 890 line test capabilities */
+#ifdef VP890_INCLUDE_TESTLINE_CODE
+
+/**< VE890 Line Test Package Defines
+ * Defines all possible VE890 test line packages. There should be no reason to
+ * change these values. But if they are changed, they must be different from
+ * each other.
+ */
+#define VP890_LINE_TEST_AUDITOR 1
+#define VP890_LINE_TEST_PROFESSIONAL 2
+
+/**< VP890_INCLUDE_LINE_TEST_PACKAGE
+ * Selects the VE890 Line Test Package to include. Note that both Auditor and
+ * Professional cannot be included in the same build.
+ */
+#define VP890_INCLUDE_LINE_TEST_PACKAGE VP890_LINE_TEST_PROFESSIONAL
+
+/**< VP890_EZ_MPI_PCM_COLLECT
+ * #define this to have the api collect PCM samples via the MPI bus.
+ * If #undef, the Line Test code will expect the PCM samples from an
+ * external process (DSP or uProcessor) connected to the PCM BUS
+ */
+#define VP890_EZ_MPI_PCM_COLLECT
+
+/**< VP890_PCM_CALCULATION_TIME
+ * Define the maximum expected computation time to arrive at results for
+ * Vp890TestLineCallback() after having collected the necessary PCM samples.
+ */
+#define VP890_PCM_CALCULATION_TIME 1000 /* time is in ms */
+
+#endif /* VP890_INCLUDE_TESTLINE_CODE */
+
+#define VP890_SIMPLE_POLLED_MODE /* Define to use simple polled interrupt
+ * handling mode */
+#undef VP890_EFFICIENT_POLLED_MODE /* Define to use efficient polled
+ * interrupt handling mode */
+#undef VP890_INTERRUPT_LEVTRIG_MODE /* Define to use Level Triggered
+ * interrupt handling mode */
+#undef VP890_INTERRUPT_EDGETRIG_MODE /* Define to use edge triggered
+ * interrupt handling mode */
+
+/**< VP890_INCLUDE_MPI_QUICK_TEST
+ * #define to enable a quick test of the MPI interface and HAL implementation
+ * during VpInitDevice(). This can be #undef to save on code size and MPI
+ * traffic at initialization after a design is proven to work.
+ */
+#define VP890_INCLUDE_MPI_QUICK_TEST
+
+#endif /* VP_CC_890_SERIES*/
+
+
+#ifdef VP_CC_886_SERIES
+
+#undef VP886_INCLUDE_TESTLINE_CODE /* Defines whether or not to enable
+ * 886 line test capabilities */
+
+/* Select one of the following four options which corresponds to the
+ application's interrupt handling mode. The selection made here will
+ determine which system service layer functions VpApiTick() calls. The
+ VP-API-II may also use this information to improve performance regardless of
+ whether the application uses VpApiTick().
+ NOTE: Applications which are triggered on interrupt edges MUST define
+ VP886_INTERRUPT_EDGETRIG_MODE, even if not using VpApiTick(). */
+#undef VP886_SIMPLE_POLLED_MODE /* Define to use simple polled interrupt
+ * handling mode */
+#define VP886_EFFICIENT_POLLED_MODE /* Define to use efficient polled
+ * interrupt handling mode */
+#undef VP886_INTERRUPT_LEVTRIG_MODE /* Define to use Level Triggered
+ * interrupt handling mode */
+#undef VP886_INTERRUPT_EDGETRIG_MODE /* Define to use edge triggered
+ * interrupt handling mode */
+/* Ensure that only one polling mode is selected */
+#if (defined(VP886_SIMPLE_POLLED_MODE) && defined(VP886_EFFICIENT_POLLED_MODE)) || \
+ (defined(VP886_SIMPLE_POLLED_MODE) && defined(VP886_INTERRUPT_LEVTRIG_MODE)) || \
+ (defined(VP886_SIMPLE_POLLED_MODE) && defined(VP886_INTERRUPT_EDGETRIG_MODE)) || \
+ (defined(VP886_EFFICIENT_POLLED_MODE) && defined(VP886_INTERRUPT_LEVTRIG_MODE)) || \
+ (defined(VP886_EFFICIENT_POLLED_MODE) && defined(VP886_INTERRUPT_EDGETRIG_MODE)) || \
+ (defined(VP886_INTERRUPT_LEVTRIG_MODE) && defined(VP886_INTERRUPT_EDGETRIG_MODE))
+#error "Only one VP886 polling mode may be defined."
+#endif
+
+#undef VP886_INCLUDE_ADAPTIVE_RINGING /* Define to enable Thermal
+ * Ringing Algorithm */
+
+#define VP886_EVENT_QUEUE_SIZE 6
+
+/* Set this to a value greater than 0 to allow use of the VpGenTimerCtrl()
+ function for VP886. The value will be the limit of USER timers allowed
+ per device. Larger values will result in larger device objects. */
+#define VP886_USER_TIMERS 2
+
+/* The VP-API-II sequencer code for older devices took one tick to process each
+ instruction in a cadence profile. This meant that delays were extended
+ by the number of instructions processed in between them. The ZL880/VP886
+ sequencer code, by default, can execute cadence profile instructions without
+ delay until it reaches a delay instruction. This causes a minor difference
+ in the how cadences play out. The VP886_LEGACY_SEQUENCER will force the
+ VP886 sequencer to insert a delay in between each cadence instruction to
+ emulate the old behavior.
+ This option should only be used if both of these conditions are true:
+ - The application is using cadence profiles that are specifically designed
+ to account for the tick delay.
+ - The application is polling at the same consistent tick rate as for the
+ older device.
+ This option may produce undesirable behavior if used in a non-ticked
+ interrupt-driven mode. */
+#undef VP886_LEGACY_SEQUENCER
+
+/* VP886_INCLUDE_MPI_QUICK_TEST
+ define to enable a quick test of the MPI interface and HAL implementation
+ during VpInitDevice(). This can be #undef to save on code size and MPI
+ traffic at initialization after a design is proven to work. */
+#define VP886_INCLUDE_MPI_QUICK_TEST
+
+/* VP886_INCLUDE_DTMF_DETECT
+ Define to include support for VP_OPTION_ID_DTMF_MODE for ZL880/miSLIC
+ devices. #undef to save on code size. */
+#define VP886_INCLUDE_DTMF_DETECT
+
+/* Set the DTMF detection sampling rate. 4kHz is recommended, as it requires
+ much less SPI traffic and processor time. 8kHz has not been tested as much,
+ and provides only minimally better detection.
+ One mode must be selected. */
+#define VP886_DTMF_DETECT_4KHZ_SAMPLING
+#undef VP886_DTMF_DETECT_8KHZ_SAMPLING
+
+/* Define to use non-continuous sampling mode. This relaxes all of the timing
+ requirements for functional DTMF detection. It also means that the time
+ taken to detect a change in digit status will increase, and will vary
+ depending on the tickrate or interrupt handling delay. In an interrupt
+ driven system this mode will use less MPI traffic. This mode allows for
+ tickrates slower than 10ms. Each detection block is 13.25ms, so an ideal
+ tick rate would be only slightly longer than that (e.g. 15ms) to minimize
+ the gaps between blocks.
+ Only works with 4kHz sampling. */
+#undef VP886_DTMF_DETECT_NONCONTINUOUS
+
+/* Error-checking of DTMF_DETECT definitions */
+#ifdef VP886_INCLUDE_DTMF_DETECT
+ #if defined(VP886_DTMF_DETECT_4KHZ_SAMPLING) && defined(VP886_DTMF_DETECT_8KHZ_SAMPLING)
+ #error Must not define both VP886_DTMF_DETECT_4KHZ_SAMPLING or VP886_DTMF_DETECT_8KHZ_SAMPLING
+ #elif !defined(VP886_DTMF_DETECT_4KHZ_SAMPLING) && !defined(VP886_DTMF_DETECT_8KHZ_SAMPLING)
+ #error Must define either VP886_DTMF_DETECT_4KHZ_SAMPLING or VP886_DTMF_DETECT_8KHZ_SAMPLING
+ #elif defined(VP886_DTMF_DETECT_NONCONTINUOUS) && !defined(VP886_DTMF_DETECT_4KHZ_SAMPLING)
+ #error Must define VP886_DTMF_DETECT_4KHZ_SAMPLING when using VP886_DTMF_DETECT_NONCONTINUOUS
+ #endif
+#endif
+
+#endif /* VP_CC_886_SERIES */
+
+
+/*
+ * The following lines include necessary compile time options/definitions that
+ * are required for boot loading VCP/VCP2 devices. By default, compression
+ * is not supported for boot images. If you would to use compressed boot
+ * images, the compile time options in the following lines need to be modified.
+ */
+
+#if !defined(VP_CC_VCP_SERIES) && !defined(VP_CC_VCP2_SERIES) && \
+ !defined(VP_CC_MELT_SERIES) && !defined(VP_CC_KWRAP)
+typedef uint8 VpScratchMemType;
+#else
+/* All the following definitions are necessary only for VCP/VCP2 devices */
+/******************************************************************************
+ * COMPILE-TIME OPTIONS:: Boot load compression method and size *
+ *****************************************************************************/
+#define VP_CLEAR_CODE_MEM
+ /*
+ * After VpBootLoad(), a VP_LINE_EVID_BOOT_CMP event is generated, and
+ * VpGetResults() is then used to retrieve the loadChkSum value, which is
+ * a checksum calculated over the VCP's code memory. VpCodeCheckSum()
+ * can then be called at any later time to verify that VCP code memory
+ * has not been corrupted.
+ *
+ * With VP_CLEAR_CODE_MEM defined, VpBootLoad() clears all VCP code memory
+ * to zeroes before loading the boot image.
+ * With VP_CLEAR_CODE_MEM disabled, unused VCP code memory is not
+ * initialized after a hardware reset. However, the loadChkSum is
+ * calculated over the entire VCP code memory space, including uninitialized
+ * parts. If it is important to you that the loadChkSum value stay the
+ * same after a hardware reset, then enable VP_CLEAR_CODE_MEM.
+ *
+ * This option adds a small amount of execution time to VpBootLoad(), when
+ * state = VP_BOOT_STATE_FIRST or VP_BOOT_STATE_FIRSTLAST.
+ */
+
+/*
+ * Options related to BootLoad() decompression
+ */
+#undef VP_NO_COMPRESS
+ /* Define this option to exclude all decompression code from VpBootLoad().*/
+#define VP_COMPRESS_FAST
+ /*
+ * Define this to include additional speed-optimized code to increase the
+ * speed of VpBootLoad().
+ */
+
+ /*
+ * On our test platform, code size is affected by the above options as
+ * shown:
+ * VP_NO_COMPRESS VP_COMPRESS_FAST added code size
+ * -------------- ---------------- ---------------
+ * #define (don't care) 0
+ * #undef #undef 9.6 kB
+ * #undef #define 12.2 kB
+ */
+
+ /*
+ * The following options determine the size of VpScratchMemType, and the
+ * speed of VpBootLoad() when using a compressed VCP image.
+ */
+#define VP_COMPRESS_WINDOW_BITS 8
+ /*
+ * There is no advantage in increasing this to a value greater than the
+ * value used when the VCP image was compressed. Setting it to less than
+ * the value used in compression will cause VpBootLoad() to fail. [The
+ * number of window bits used in compression is indicated in the VCP
+ * image's filename; for example, dvp.bin10z was compressed with 10 window
+ * bits, etc. If the number of bits is not indicated (*.binz), then
+ * 8 bits were used.] Higher values improve compression. Don't
+ * change this value unless you change the corresponding value used
+ * in compressing the VCP image. Adds (1 << VP_COMPRESS_WINDOW_BITS)
+ * bytes to sizeof(VpScratchMemType). This option can range from
+ * 8 to 15. */
+#define VP_COMPRESS_OUTBUF_PAGES 50
+ /*
+ * Size of the buffer for holding data after it is decompressed, and before
+ * it is sent to the HBI bus. Must be greater than 0 and less than 512.
+ * Larger values increase the speed of VpBootLoad(). If VP_COMPRESS_FAST
+ * is defined, VP_COMPRESS_OUTBUF_PAGES should be at least 3.
+ * Adds (128 * VP_COMPRESS_OUTBUF_PAGES) bytes to sizeof(VpScratchMemType).
+ */
+
+#ifndef VP_NO_COMPRESS
+#include "zstructs.h" /**< Components of VpScratchMemType */
+typedef struct {
+ struct VpZlibInflateStateType state;
+ VpZlibStreamType stream;
+ uint8 window[1 << VP_COMPRESS_WINDOW_BITS];
+ uint8 inflated[VP_COMPRESS_OUTBUF_PAGES * 128];
+} VpScratchMemType;
+#else /* VP_NO_COMPRESS */
+typedef uint8 VpScratchMemType;
+#endif /* VP_NO_COMPRESS */
+#endif /* !VP_CC_VCP_SERIES */
+
+/******************************************************************************
+ * VCP2 library specific other defines and conditional compile flags *
+ ******************************************************************************/
+/*
+ * Normally, when a VP-API function needs to write to the VCP2's command
+ * mailbox, it checks to see if the mailbox is busy, and if so, returns
+ * VP_STATUS_MAILBOX_BUSY. The application can then wait for a
+ * VP_DEV_EVID_DNSTR_MBOX ("mailbox free") event before retrying the VP-API
+ * function call.
+ *
+ * Use the following option to include code which spin-waits for the VCP2 to
+ * relinquish control of the command mailbox. In this case, the VP-API
+ * function will continuously poll the VCP2 device until the mailbox becomes
+ * available. The number of polling iterations is specified in the following
+ * option. If this option is 0, no spin-waiting occurs. If this option is
+ * nonzero, the VP-API functions will return VP_STATUS_MAILBOX_BUSY only if
+ * unable to acquire control of the mailbox after the specified number of
+ * polling iterations.
+ *
+ * Application programming may be simplified by defining this option to a
+ * conservative value and treating VP_STATUS_MAILBOX_BUSY as an error.
+ * However, this is at the expense of increased CPU utilization.
+ */
+#define VP_VCP2_MAILBOX_SPINWAIT 2000000UL
+
+/* When bootloading a VCP2-792, the API uses a special bootloading process to
+ * load the firmware for both the VCP2 and the 792 SLACs. This process
+ * spinwaits for the command mailbox between sending blocks of the SLAC image.
+ * The spinwait limit here should be a higher number than the general limit, and
+ * should not be zero because we actually expect to wait in this case, and a
+ * timeout aborts the SLAC bootloading. */
+#define VP_VCP2_BOOTLOAD_MAILBOX_SPINWAIT 20000000UL
+
+/* When spinwaiting for the command mailbox using either of the above
+ * parameters, the VP-API can exit and re-enter the critical section between
+ * each specified number of reads of the mailbox flags. Doing this should
+ * allow other threads to interrupt while spinwaiting. Set this value to 0
+ * to disable the exit/enter critical behavior. */
+#define VP_VCP2_SPINS_PER_CRITICAL_SEC 1
+
+/* When spinwaiting for the command mailbox, it may be desirable to detect a
+ * loss of communication with the VCP and exit the spinwait. If this option
+ * is enabled, the VP-API will perform a write-read HBI check along with
+ * reading the mailbox status flags. The function will return status code
+ * VP_STATUS_ERR_HBI if the check fails. */
+#undef VP_VCP2_MAILBOX_ACQUIRE_HBI_CHECK
+
+/*
+ * Define the following option to include some extra error checking in the
+ * VCP2 boot code. This is most useful to diagnose board problems during
+ * initial board bring-up.
+ */
+#define VP_VCP2_BOARD_BOOT_DEBUG
+
+/*
+ * Set this option to reflect the CLKSRC pin value. Possible values:
+ * 1 => crystal oscillator
+ * 0 => PCLK (worst case value)
+ */
+#define VP_VCP2_BOARD_CLKSRC 0
+#define VP_MELT_BOARD_CLKSRC 0
+/*
+ * Set these options to initialize the PCLKA_SEL and PCLKB_SEL registers. See
+ * the Le79114 data sheet for details. A safe value is 0xC000. These options
+ * are only relevant if VCP2_BOARD_CLKSRC = 0.
+ */
+#define VP_VCP2_BOARD_PCLKA_SEL 0xC000
+#define VP_VCP2_BOARD_PCLKB_SEL 0xC000
+
+/******************************************************************************
+ * VCP library specific other defines and conditional compile flags *
+ ******************************************************************************/
+
+/* Define the following to wait for certain amount of time for VCP mailbox
+ * to become available. By enabling this conditional compile time option,
+ * application would rarely have to handle the VP_STATUS_MAILBOX_BUSY error
+ * (assuimg configured properly; more later). Basically when this conditional
+ * compile option is defined, API repeats checking for mailbox ownership (if
+ * it already does not own). This checking continues until either mailbox
+ * ownership is acquired or maximum specified number of repetitions happen (in
+ * which case API throws an error).
+ * If this compile flag is undefined, API checks for mailbox only once.
+ */
+#define WAIT_TO_ACQUIRE_VCP_MB
+
+/* Define the number iterations host should wait for mailbox owenership */
+#define ITERATIONS_TO_WAIT_FOR_VCP_MB (100000)
+
+#ifdef VP_CC_MELT_SERIES
+/* These are Melt equivalents for some similarly named VCP2 defines so that we can
+ * keep the two api's separate.
+ */
+#define VP_MELT_MAILBOX_SPINWAIT 200000UL
+
+#define VP_MELT_BOOTLOAD_MAILBOX_SPINWAIT 2000000UL
+
+#define VP_MELT_BOARD_PCLKA_SEL 0xC000
+#define VP_MELT_BOARD_PCLKB_SEL 0xC000
+
+#endif /* VP_CC_MELT_SERIES */
+
+/* Include internal options required to build the VP-API-II library */
+#include "vp_api_cfg_int.h"
+
+#endif /* VP_API_CFG_H */
+
+
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_cfg_int.h b/marvell/services/mislic/api_lib/includes/vp_api_cfg_int.h
new file mode 100644
index 0000000..6a20c30
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_cfg_int.h
@@ -0,0 +1,1187 @@
+/** \file vp_api_cfg_int.h
+ * vp_api_cfg_int.h
+ *
+ * This file contains internal configuration and compile time settings for
+ * building appropriate VP-API library modules needed for any application.
+
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12587 $
+ * $LastChangedDate: 2018-06-21 17:22:20 -0500 (Thu, 21 Jun 2018) $
+ */
+
+#ifndef VP_API_CFG_INT_H
+#define VP_API_CFG_INT_H
+
+/**< STRICT_SIGNED_ENUM_VALUES
+ * Define this to avoid using enumerations with negative values (e.g., 0x8000). It should not be
+ * needed in compilers compliant with ANSII C89 or later. Setting it to #define also removes strict
+ * type checking in the API which is generally not preferred.
+ */
+#undef STRICT_SIGNED_ENUM_VALUES
+
+/******************************************************************************
+ * Device Context Size *
+ *****************************************************************************/
+/*
+ * Define the maximum number of lines per device in your system. Note that a
+ * system (i.e., all devices controlled by one instance of VP-API) could have
+ * more than one type of device, each of those devices may support different
+ * number of lines. For example in a system, device A might support 4 lines
+ * and device B might support 32 lines, in such a scenario, the following macro
+ * should be defined as 32. */
+#if defined(VP_CC_VCP2_SERIES) || defined(VP_CC_KERNEL_SERIES)
+ #define VP_MAX_LINES_PER_DEVICE (128)
+#elif defined(VP_CC_VCP_SERIES)
+ #define VP_MAX_LINES_PER_DEVICE (32)
+#elif defined(VP_CC_792_SERIES) || defined(VP_CC_MELT_SERIES) || defined(VP_CC_MELT792_SERIES)
+ #define VP_MAX_LINES_PER_DEVICE (8)
+#else /* VP_CC_880_SERIES + VP_CC_890_SERIES */
+ /*
+ * Note that for VE890 this value must be >=2 even when using the single
+ * FXO device. That's because the line context pointer in the device
+ * context is assigned to the "channelId" element of the line context
+ * pointer array. The FXO channelId = 1 so the array must be size >= 2.
+ */
+ #define VP_MAX_LINES_PER_DEVICE (2)
+#endif
+
+/**< Special Case for Kernel Wrapper: DO NOT TOUCH THESE VALUES */
+#if defined(VP_CC_KWRAP)
+ #undef VP_MAX_LINES_PER_DEVICE
+ #define VP_MAX_LINES_PER_DEVICE (128)
+#endif
+
+/**< CSLAC_GAIN_RELATIVE
+ * VE880 and VE890 applications only. This value affects whether or not the VE880/VE890 API will
+ * support VpSetRelGain() function. Setting to #undef reduces the API library size for each device
+ * by ~1K. Applications may choose to compile out VpSetRelGain() functionality and instead use
+ * the VP_OPTION_ID_ABS_GAIN feature (see CSLAC_GAIN_ABS).
+ *
+ * NOTE: The API has not been tested with this string set to #undef.
+ */
+#define CSLAC_GAIN_RELATIVE
+
+/**< CSLAC_GAIN_ABS
+ * VE880 and VE890 applications only. This value affects whether or not the VE880/VE890 API will
+ * support the VP_OPTION_ID_ABS_GAIN feature of the API. Setting to #undef reduces the API library
+ * size by ~1K independent of whether compiling only for VE880 or VE890, or compiling for both. The
+ * majority of the code used to support VP_OPTION_ID_ABS_GAIN is common for these devices.
+ * Applications are not likely to use both VP_OPTION_ID_ABS_GAIN and VpSetRelGain() features of the
+ * API (see CSLAC_GAIN_RELATIVE for VpSetRelGain() compile option).
+ *
+ * NOTE: The API has not been tested with this string set to #undef.
+ */
+#define CSLAC_GAIN_ABS
+
+/**< VP_ENABLE_PROD_TEST
+ * This value exists for test purposes only. DO NOT change to #define in production code.
+ * Unexpected or damaging behavior may occur.
+ */
+#undef VP_ENABLE_PROD_TEST
+
+/**< VP_CID_POLLING_ENABLED
+ * This value should only be defined for applications with <= 4 lines on the same MPI BUS and
+ * with 8.33ms tickrate. With VP_CID_POLLING_ENABLED set to #define, the API will consume an
+ * additional >= 500us per line for each tick (additional 1ms per tick for a 2-FXS device).
+ *
+ * For systems with tickrates = 8.33ms and using FSK CID with standard baud rate = 1200, for a
+ * per-byte line update rate of 8.33ms (same as the tickrate) it is possible on the VE880 and
+ * VE890 silicon that without this set to #define the CID message data on the line may
+ * corrupt. The error occurs when the API writes to the silicon at "exactly" the same time as
+ * the CID message on the line is changing from one byte to the next ("exact" in this context
+ * specifically refers to a window of 80ns). Repeated bulk call testing of 100,000 calls
+ * indicates that this error can occur in the range of [< 0.001% (>99.999% success) to 4%
+ * (96% success)]. Note however these numbers are application and system specific. The problem
+ * will occur 100% of the time IF the API write occurs within the 80ns window where the
+ * device/line CID message data byte is being updated, and will occur 0% of the time IF this
+ * precise timing is avoided.
+ *
+ * When this is set to #define the exact tick consumption to avoid this error is defined by
+ * VP_CID_NORMAL_MPI_CNT described below.
+ */
+#undef VP_CID_POLLING_ENABLED
+
+/**< VP_CID_NORMAL_INIT_CNT
+ * This count value is used at the start of sending FSK data in a CID sequence.
+ *
+ * The VE880 and VE890 silicon CID message buffer is 2+ bytes deep. That means the API can at a
+ * given time provide a little less than 3 bytes to the silicon. When CID FSK Data is initialized,
+ * the API writes one byte to the silicon. It takes the silicon 18us to update it's CID buffer
+ * management such that it will then accept another 2 bytes before indicating "Full". When "Full"
+ * the silicon will tolerate the maximum amount of VpApiTick() jitter without underrun of the CID
+ * message buffer.
+ *
+ * The exact value of VP_CID_NORMAL_INIT_CNT depends on the DCLK rate and CS-Off time assumed to be
+ * 8.192MHz and 2.5us respectively. The delay is implemented in the API by reading the CID State
+ * machine buffer where each call to VpMpiCmd() requires 4 bytes of MPI traffic. Therefore, one
+ * read will take a minimum of (4 * (2.5us + 8/8.192MHz)) = 13.90625us. In order to meet the minimum
+ * time of 18us then requires at least 2 reads. In systems with much longer CS Off times or slower
+ * DCLK rates, this count value could be reduced.
+ *
+ * NOTE: This value is used by the API independant of VP_CID_POLLING_ENABLED setting.
+ */
+#define VP_CID_NORMAL_INIT_CNT (2)
+
+/** VP_CID_NORMAL_MPI_CNT
+ * This count value is used by the API during normal CID FSK Data transmission (all FSK conditions
+ * except for the very first 3 bytes of initialization controlled by VP_CID_NORMAL_INIT_CNT). This
+ * value is set to provide a minimum 500us window where the API will monitor the silicon for a
+ * Caller ID Buffer update.
+ *
+ * When running a 8.33ms tickrate and 1200baud FSK, the silicon buffer should update very nearly
+ * when VpApiTick() is called. As mentioned above, if the API updates the silicon at almost exactly
+ * the same time as the silicon buffer update occurs, Caller ID on the line will be corrupted. The
+ * API avoids this by checking for the silicon buffer update before writing to the silicon. With
+ * a tickrate of 8.33ms + jitter, the siliocn update should occur either just before VpApiTick() is
+ * called or very nearly when VpApiTick() starts.
+ *
+ * The precise value (36) assumes DCLK = 8.192MHz and CS Off-Time of 2.5us. Each read of the CID
+ * state machine requires 4 bytes for total duration of (4 * (2.5us + 8/8.192MHz)) = 13.90625us.
+ * To meet the 500us minimum time requires (500 / 13.90625) ~ 36 reads. In systems with much longer
+ * CS Off times or slower DCLK rates, this count value could be reduced.
+ *
+ * NOTE: This value is used by the API ONLY if VP_CID_POLLING_ENABLED is set to #define.
+ */
+#define VP_CID_NORMAL_MPI_CNT (36)
+
+/**< VE8XX_LPM_LEAKY_LINE_CNT
+ * This count is for the numner of times during a Low Power Mode leaky line test the VP-API-II
+ * will retry using LPM state before "giving up".
+ */
+#define VE8XX_LPM_LEAKY_LINE_CNT (3)
+
+#ifdef VP_CC_880_SERIES
+
+/**< VP880_LPM_OVERRIDE
+ * Setting this to #define will force VE880 LPM Termination Types to SLIC Feed = IDLE when set to
+ * VP_LINE_STANDBY state. If set to #undef, then normal LPM SLIC Feed = Disconnect is used. This
+ * setting should be used if 48V is required for all on-hook load conditions. Note that when the
+ * line is in-service using VP_LINE_OHT for LPM, the T/R Voltage will be 48V regardless of this
+ * setting. This only affects the line voltage when the line is providing hook detect only service.
+ *
+ */
+#undef VP880_LPM_OVERRIDE
+
+/*
+ * Modifications to previous settings to correct for potential inconsistencies.
+ * DO NOT CHANGE anything below this line. All corrections should be made above
+ */
+#if !defined (VP880_TRACKER_SUPPORT) && defined (VP880_LP_SUPPORT)
+ #error "Invalid 880 Compiler Combination: Low Power Mode Requires Tracker defined"
+#endif
+
+#if defined (VP880_FXS_SUPPORT) && (!defined (VP880_ABS_SUPPORT) && !defined (VP880_TRACKER_SUPPORT))
+ #error "Invalid 880 Compiler Combination: FXS requires either ABS or Tracker defined"
+#endif
+
+#ifndef VP880_FXS_SUPPORT
+ #undef VP880_ABS_SUPPORT
+ #undef VP880_INCLUDE_TESTLINE_CODE
+ #undef VP880_LP_SUPPORT
+#endif
+
+#if !defined (VP880_FXS_SUPPORT) && !defined (VP880_FXO_SUPPORT)
+ #error "Invalid 880 Compiler Combination: Either FXS or FXO must be defined if using VE880 device"
+#endif
+
+/*
+ * Current Limiting option in the VP880 library limits the peak switcher current
+ * such that a 3REN load can be supported at 90V peak. Disable this option if
+ * 5REN is required.
+ */
+#undef VP880_CURRENT_LIMIT
+
+#if defined (VP880_INCLUDE_TESTLINE_CODE) || defined(VP_CC_KWRAP)
+
+ /*
+ * #defines used in unit conversion function
+ * All units are based on the following calculations
+ * Internal voltage unit = 480.0 / 2^31 Volts
+ * Internal current unit = 240e-3 / 2^31 Amps
+ * Internal freq uint = 12e3 / 2^31 Hz
+ */
+ #define VP880_UNIT_MV 4474 /* mV unit */
+ #define VP880_UNIT_MVRMS 6327 /* mVrms unit */
+ #define VP880_UNIT_ADC_VAB -32768 /* vab step from ADC */
+ #define VP880_UNIT_ADC_VAB_RMS 46341 /* vab step from ADC rms*/
+ #define VP880_UNIT_ADC_AC_VAB_RMS 664 /* vab step from ADC Metallic Vrms*/
+ #define VP880_UNIT_DAC_RING 21076 /* step due to DAC in ringing*/
+ #define VP880_UNIT_TRACK_SWZ 23091612 /* step used for tracking switching regulator Z */
+ #define VP880_UNIT_UA 8948 /* uA unit */
+ #define VP880_UNIT_ADC_IMET_NOR 16384 /* met I from ADC in normal VC */
+ #define VP880_UNIT_ADC_IMET_NOR_JA 15756 /* met I from ADC in normal JA*/
+ #define VP880_UNIT_ADC_IMET_RING 32768 /* met I from ADC in ringing*/
+ #define VP880_UNIT_ADC_ILG 11469 /* long current from ADC*/
+ #define VP880_UNIT_DECHZ 17896 /* Deci Hz*/
+ #define VP880_UNIT_MHZ 179 /* mHz */
+ #define VP880_UNIT_FREQ 65536 /* siggen freq step */
+ #define VP880_UNIT_RAMP_TIME 1365 /* Ramp time (-1/3) in ms*/
+
+ #define VP880_UNIT_CONVERT(DATA, I_UNIT, O_UNIT) (int32)(((int32)DATA * I_UNIT) / O_UNIT)
+
+ /* converts requested slope into SigGen Freq */
+ #define VP880_SLOPE_TO_FREQ(AMP,SLOPE) (int16)(((int32)SLOPE * (int32)VP880_UNIT_RAMP_TIME) / (int32)AMP)
+
+ #define VP880_AC_RLOOP_MAX_BAT_LVL 75000 /* mV */
+ #define VP880_AC_RLOOP_MAX_TEST_LVL ((VP880_AC_RLOOP_MAX_BAT_LVL - 5000) / 2)
+
+#endif /*VP880_INCLUDE_TESTLINE_CODE*/
+
+#endif /*VP_CC_880_SERIES*/
+
+
+#ifdef VP_CC_886_SERIES
+
+#define VP886_REL_GAIN_GX_LOW_LIMIT (0x500)
+#define VP886_REL_GAIN_GR_LOW_LIMIT (0x1000)
+
+/* VP886_TIMER_INTERRUPT_OVERRIDE
+ * Define this flag to set the timerOverride flag in the device object, which
+ * will cause the API to process elapsed time in the timer queue on every
+ * VpGetEvent() call, regardless of the status of the G_TIMER bit. This will
+ * result in more processing time and more MPI transactions in each VpGetEvent()
+ * call. This flag works around one of several problems that can arise in an
+ * application where the signaling register is read and cleared (0x4F read)
+ * outside of the API. */
+#undef VP886_TIMER_INTERRUPT_OVERRIDE
+
+/* VP886_VVMT_REMOVE
+ * Define this flag to strip the test primitives unused in VVMT */
+#undef VP886_VVMT_REMOVE
+
+#endif /* VP_CC_886_SERIES*/
+
+
+#ifdef VP_CC_890_SERIES
+
+#define VP890_REL_GAIN_GX_LOW_LIMIT (0x500)
+#define VP890_REL_GAIN_GR_LOW_LIMIT (0x1000)
+
+/**< VP890_LPM_OVERRIDE
+ * Setting this to #define will force VE890 LPM Termination Types to SLIC Feed = IDLE when set to
+ * VP_LINE_STANDBY state. If set to #undef, then normal LPM SLIC Feed = Disconnect is used. This
+ * setting should be used if 48V is required for all on-hook load conditions. Note that when the
+ * line is in-service using VP_LINE_OHT for LPM, the T/R Voltage will be 48V regardless of this
+ * setting. This only affects the line voltage when the line is providing hook detect only service.
+ *
+ */
+#undef VP890_LPM_OVERRIDE
+
+#ifndef VP890_FXS_SUPPORT
+ /*
+ * Tests (using testline) is supported only for FXS termination types. If
+ * line tests are required, make sure FXS support is enabled.
+ */
+ #undef VP890_INCLUDE_TESTLINE_CODE
+
+ /* LPM is an FXS termination type. FXS must be supported to support LPM. */
+ #undef VP890_LP_SUPPORT
+
+#endif
+
+/* Define this to attempt to reduce the level of the noise signal generated for
+ * adaptive balance B-Filter calibration. Reducing the level will increase the
+ * negative effect of outside noise on the line and can reduce performance */
+#undef VP890_REDUCE_BFILTER_CAL_SIGNAL_LEVEL
+
+#if defined (VP890_INCLUDE_TESTLINE_CODE) || defined(VP_CC_KWRAP)
+ /*
+ * #defines used in unit conversion function
+ * All units are based on the following calculations
+ * Internal voltage unit = 480.0 / 2^31 Volts
+ * Internal current unit = 240e-3 / 2^31 Amps
+ * Internal freq uint = 12e3 / 2^31 Hz
+ */
+ #define VP890_UNIT_MV 4474 /* mV unit */
+ #define VP890_UNIT_MVRMS 6327 /* mVrms unit */
+ #define VP890_UNIT_ADC_VAB -32768 /* vab step from ADC */
+ #define VP890_UNIT_ADC_VAB_RMS 46341 /* vab step from ADC rms*/
+ #define VP890_UNIT_ADC_AC_VAB_RMS 664 /* vab step from ADC Metallic Vrms*/
+ #define VP890_UNIT_DAC_RING 21076 /* step due to DAC in ringing*/
+ #define VP890_UNIT_TRACK_SWZ 23091612 /* step used for tracking switching regulator Z */
+ #define VP890_UNIT_UA 8948 /* uA unit */
+ #define VP890_UNIT_ADC_IMET_NOR 15756 /* met I from ADC in normal*/
+ #define VP890_UNIT_ADC_IMET_RING 32768 /* met I from ADC in ringing*/
+ #define VP890_UNIT_ADC_ILG 11469 /* long current from ADC*/
+ #define VP890_UNIT_DECHZ 17896 /* Deci Hz*/
+ #define VP890_UNIT_MHZ 179 /* mHz */
+ #define VP890_UNIT_FREQ 65536 /* siggen freq step */
+ #define VP890_UNIT_RAMP_TIME 1365 /* Ramp time (-1/3) in ms*/
+
+ #define VP890_UNIT_CONVERT(DATA, I_UNIT, O_UNIT) (int32)( ((int32)DATA * I_UNIT) / O_UNIT)
+
+ /* converts requested slope into SigGen Freq */
+ #define VP890_SLOPE_TO_FREQ(AMP,SLOPE) (int16) ( ((int32)SLOPE * (int32)VP890_UNIT_RAMP_TIME) / (int32)AMP)
+
+ #define VP890_AC_RLOOP_MAX_BAT_LVL 75000 /* mV */
+ #define VP890_AC_RLOOP_MAX_TEST_LVL ((VP890_AC_RLOOP_MAX_BAT_LVL - 5000) / 2)
+
+#endif /* VP890_INCLUDE_TESTLINE_CODE */
+
+#endif /* VP_CC_890_SERIES*/
+
+/******************************************************************************
+ * COMPILE-TIME OPTIONS:: Top level VP-API Default Device and Line Options *
+ *****************************************************************************/
+/*
+ * The following defines specify the default settings of the device and line
+ * options used in the API. The VP-API-II should generally take on the default
+ * settings set here at VpInitDevice()/VpInitLine() but is not guaranteed (i.e.,
+ * the combinations are not tested - VpInitDevice()/InitLine() could fail as a
+ * result of setting to unexpected values).
+ *
+ * Please consult Field or Applications support before changing any of
+ * these settings.
+ */
+#include "vp_api_option.h"
+#include "vp_api_event.h"
+
+/* Default Dial Pulse Options specified in units of 125micro sec */
+#define VP_OPTION_DEFAULT_DP_BREAK_MIN (33 * 8) /* == 33 ms */
+#define VP_OPTION_DEFAULT_DP_BREAK_MAX (100 * 8)
+#define VP_OPTION_DEFAULT_DP_MAKE_MIN (17 * 8)
+#define VP_OPTION_DEFAULT_DP_MAKE_MAX (75 * 8)
+#define VP_OPTION_DEFAULT_DP_INTER_DIG_MIN (250 * 8)
+#define VP_OPTION_DEFAULT_DP_FLASH_MIN (250 * 8)
+#define VP_OPTION_DEFAULT_DP_FLASH_MAX (1300 * 8)
+#define VP_OPTION_DEFAULT_DP_ON_HOOK_MIN VP_OPTION_DEFAULT_DP_FLASH_MAX
+#define VP_OPTION_DEFAULT_DP_OFF_HOOK_MIN 0
+
+/*
+ * Specification 2 is usefull if you need to detect between two non-overlapping
+ * dial pulse specifications.
+ */
+#define VP_OPTION_DEFAULT_DP_BREAK_MIN2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_BREAK_MAX2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_MAKE_MIN2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_MAKE_MAX2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_INTER_DIG_MIN2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_FLASH_MIN2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_FLASH_MAX2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_ON_HOOK_MIN2 (0 * 8)
+#define VP_OPTION_DEFAULT_DP_OFF_HOOK_MIN2 0
+
+/* Default setting for Critical fault option */
+#define VP_OPTION_DEFAULT_CF_AC_DIS_EN TRUE
+#define VP_OPTION_DEFAULT_CF_DC_DIS_EN TRUE
+#define VP_OPTION_DEFAULT_CF_THERMAL_DIS_EN TRUE
+/* CSLAC-880 and VCP-880 do not support the detection of AC, DC critical faults.
+ * So, The VP-API uses the following default values for those devices.
+ * Note that changing the following values will result in VpInitDevice()
+ * failure. */
+#define VP_OPTION_DEFAULT_CF_AC_DIS_EN_880 FALSE
+#define VP_OPTION_DEFAULT_CF_DC_DIS_EN_880 FALSE
+
+/* Default setting for Zero cross option */
+#define VP_OPTION_DEFAULT_ZERO_CROSS VP_OPTION_ZC_M4B
+
+/* Default setting for Ramp to standby option */
+#define VP_OPTION_DEFAULT_RAMP2STBY 0
+
+/* Default setting for Pulse mode option */
+#define VP_OPTION_DEFAULT_PULSE_MODE VP_OPTION_PULSE_DECODE_OFF
+
+/* Default CODEC Mode */
+#define VP_OPTION_DEFAULT_CODEC_MODE VP_OPTION_ALAW
+
+/* Default setting for PCM Highway option */
+#define VP_OPTION_DEFAULT_PCM_HWY VP_OPTION_HWY_A
+
+/* Default setting for Loop back option */
+#define VP_OPTION_DEFAULT_LOOP_BACK VP_OPTION_LB_OFF
+
+/* Default setting for Line state option */
+#define VP_OPTION_DEFAULT_LS_BAT_REV FALSE
+#define VP_OPTION_DEFAULT_LS_BAT VP_OPTION_BAT_AUTO
+
+/*
+ * Default Event Masks (VP_OPTION_ID_EVENT_MASK)
+ * The user can arbitrarily set the mask bits here as needed. A mask bit set to
+ * '0' means the event is not masked. Some events are non-maskable.
+ */
+#define VP_OPTION_DEFAULT_FAULT_EVENT_MASK (VP_EVENT_MASK_ALL & ~VP_API_NONMASK_FAULT_EVENTS)
+#define VP_OPTION_DEFAULT_SIGNALING_EVENT_MASK (VP_EVENT_MASK_ALL & ~VP_API_NONMASK_SIGNALING_EVENTS)
+#define VP_OPTION_DEFAULT_RESPONSE_EVENT_MASK (VP_EVENT_MASK_ALL & ~VP_API_NONMASK_RESPONSE_EVENTS)
+#define VP_OPTION_DEFAULT_TEST_EVENT_MASK (VP_EVENT_MASK_ALL & ~VP_API_NONMASK_TEST_EVENTS)
+#define VP_OPTION_DEFAULT_PROCESS_EVENT_MASK (VP_EVENT_MASK_ALL & ~VP_API_NONMASK_PROCESS_EVENTS)
+#define VP_OPTION_DEFAULT_FXO_EVENT_MASK (VP_EVENT_MASK_ALL & ~VP_API_NONMASK_FXO_EVENTS)
+#define VP_OPTION_DEFAULT_PACKET_EVENT_MASK (VP_EVENT_MASK_ALL & ~VP_API_NONMASK_PACKET_EVENTS)
+
+/* Default setting for Ring Control option */
+#define VP_OPTION_DEFAULT_RC_ZERO_CROSS VP_OPTION_ZC_M4B
+#define VP_OPTION_DEFAULT_RC_RING_EXIT_DBNC_VAL (100 * 8) /* 100ms */
+#define VP_OPTION_DEFAULT_RC_RING_EXIT_STATE VP_LINE_TALK
+
+/* Default setting for DTMF Mode option */
+#define VP_OPTION_DEFAULT_DM_DTMF_CONTROL_MODE VP_OPTION_DTMF_DECODE_OFF
+#define VP_OPTION_DEFAULT_DM_DIRECTION VP_DIRECTION_US
+
+/* Default setting for PCM TX/RX path control */
+#define VP_OPTION_DEFAULT_PCM_TXRX_CNTRL VP_OPTION_PCM_BOTH
+
+/* Default setting for DTMF Spec option */
+#define VP_OPTION_DEFAULT_DTMF_SPEC VP_OPTION_DTMF_SPEC_ATT
+
+/* Default setting for Park Mode option */
+#define VP_OPTION_DEFAULT_PARK_MODE_DISC 4 /* 2 seconds */
+#define VP_OPTION_DEFAULT_PARK_MODE_STANDBY 3 /* 300 ms */
+
+/* Default setting for DC Feed Slope option */
+#define VP_OPTION_DEFAULT_DCFEED_SLOPE 109 /* 4 V/ms */
+
+/* Default setting for hook detection mode option */
+#define VP_OPTION_DEFAULT_HOOK_DETECT_MODE VP_OPTION_HOOKDET_NORMAL
+
+/* Default settings for PCM highway signaling and control */
+#define VP_OPTION_DEFAULT_PCM_SIG_CTL_ENABLE FALSE
+#define VP_OPTION_DEFAULT_PCM_SIG_CTL_CTLTS 0
+#define VP_OPTION_DEFAULT_PCM_SIG_CTL_SIGTS 0
+
+/* Default setting for PCM highway lien state control mode */
+#define VP_OPTION_DEFAULT_LINESTATE_CTL_MODE VP_OPTION_LINESTATE_CTL_NORMAL
+
+/* Default settings for Auto Loop Conditions option */
+#define VP_OPTION_DEFAULT_AUTO_LOOP_COND_SELECT 0
+#define VP_OPTION_DEFAULT_AUTO_LOOP_COND_DELAY 0
+
+/* Default settings for Switcher Automatic Shutdown option */
+#define VP_OPTION_DEFAULT_SWITCHER_CTRL FALSE
+
+/* Default settings for Ground Fault Protection option */
+#define VP_OPTION_DEFAULT_GND_FLT_PROT_ENABLE FALSE
+#define VP_OPTION_DEFAULT_GND_FLT_PROT_CONFIRMTIME 100 /* 1000ms */
+#define VP_OPTION_DEFAULT_GND_FLT_PROT_POLLTIME 200 /* 2000ms */
+#define VP_OPTION_DEFAULT_GND_FLT_PROT_POLLNUM 0 /* infinite */
+
+/* Default settings for Ground Fault Protection option for shared supply configs */
+#define VP_OPTION_DEFAULT_SHARED_GND_FLT_PROT_ENABLE TRUE
+#define VP_OPTION_DEFAULT_SHARED_GND_FLT_PROT_CONFIRMTIME 0 /* immediate */
+#define VP_OPTION_DEFAULT_SHARED_GND_FLT_PROT_POLLTIME 200 /* 2000ms */
+#define VP_OPTION_DEFAULT_SHARED_GND_FLT_PROT_POLLNUM 0 /* infinite */
+
+/* Default settings for Adaptive Ringing option */
+#define VP_OPTION_DEFAULT_ADAPTIVE_RINGING_VALIDMASK VP_ADAPTIVE_RINGING_CFG_POWER | VP_ADAPTIVE_RINGING_CFG_MIN_V_PCT | VP_ADAPTIVE_RINGING_CFG_MODE
+#define VP_OPTION_DEFAULT_ADAPTIVE_RINGING_POWER VP_ADAPTIVE_RINGING_DISABLED
+#define VP_OPTION_DEFAULT_ADAPTIVE_RINGING_MIN_V_PCT 83
+#define VP_OPTION_DEFAULT_ADAPTIVE_RINGING_MODE VP_ADAPT_RING_SHARED_BB_ABS
+
+/* Default settings for Ring Trip Confirm option */
+#define VP_OPTION_DEFAULT_RINGTRIP_CONFIRM 0 /* Disabled */
+
+/* Default settings for Ring Phase Sync option */
+#define VP_OPTION_DEFAULT_RING_PHASE_SYNC VP_RING_PHASE_SYNC_DISABLE;
+
+/* Default settings for High Pass Filter option */
+#define VP_OPTION_DEFAULT_HIGHPASS_FILTER VP_HIGHPASS_FILTER_ENABLE;
+
+/* Default settings for DTMF Params option */
+#define VP_OPTION_DEFAULT_DTMF_PARAMS_VALIDMASK VP_OPTION_CFG_MIN_DETECT | VP_OPTION_CFG_ROW_TO_COL_LIMIT | VP_OPTION_CFG_COL_TO_ROW_LIMIT
+#define VP_OPTION_DEFAULT_DTMF_PARAMS_MIN_DETECT -300 /* -30dBm0 */
+#define VP_OPTION_DEFAULT_DTMF_PARAMS_ROW_TO_COL 95 /* 9.5dB */
+#define VP_OPTION_DEFAULT_DTMF_PARAMS_COL_TO_ROW 50 /* 5.0dB */
+
+/* Default settings for sealing current */
+#define VP_OPTION_DEFAULT_SEAL_SLOPL 0x0020
+#define VP_OPTION_DEFAULT_SEAL_APPLY_TIME 250 /* 250ms */
+#define VP_OPTION_DEFAULT_SEAL_OFF_TIME 30 /* 30 minutes */
+#define VP_OPTION_DEFAULT_SEAL_BATTERY_OFFSET 5 /* 5 volts */
+#define VP_OPTION_DEFAULT_SEAL_MASK 0xFFFFFFFF /* Disabled */
+
+/* Default settings for SPI Error Control */
+#define VP_OPTION_DEFAULT_SPI_ERROR_CTRL_MODE VP_SPI_ERROR_MODE_BLOCK
+#define VP_OPTION_DEFAULT_SPI_ERROR_CTRL_COUNT 1
+
+
+/******************************************************************************
+ * VCP2 library specific other defines and conditional compile flags *
+ ******************************************************************************/
+
+/* Specify the maximum number of SLACs which will be controlled by the VCP2 on
+ * each SPI bus.
+ *
+ * For VCP2-790, there are up to 8 SLACs (32 channels) on each SPI bus.
+ *
+ * For VCP2-792, with the Le79124 chipset, normally there are up to 4 SLACs (32
+ * channels) on the first SPI bus and up to 5 SLACs (40 channels) on the second
+ * SPI bus.
+ *
+ * For VCP2-792, with the Le79128 chipset, there are up to 8 SLACs on each SPI
+ * bus.
+ */
+#define VP_VCP2_MAX_NUM_SLACS_BUS0 8
+#define VP_VCP2_MAX_NUM_SLACS_BUS1 8
+
+/* Specify the maximum number of channels controlled by any individual SLAC.
+ * If you are controlling a VCP2-792 device, this should be 8. If you are
+ * controlling a VCP2-790 device, you can reduce this value to 4 to save
+ * memory. If you are controlling a VCP2-880 device, you can reduce this value
+ * to 2 to save memory. If you are controlling a combination of
+ * SLACs (unlikely), use the number corresponding to the SLAC with the most
+ * channels. */
+#define VP_VCP2_MAX_NUM_CHANS 8
+
+/* Set this option to support the VCP2 emulator. */
+#define VP_VCP2_EMU_SUPPORT
+
+/* Do not define this unless you know what you're doing. */
+#undef VP_VCP2_SUPPORT_UNDOCUMENTED_TESTS
+
+#define VP_SIZEOF_CID_MSG_BUFFER 16
+
+/******************************************************************************
+ * MELT library specific other defines and conditional compile flags *
+ ******************************************************************************/
+#define VP_MELT_MAX_NUM_SLACS 1
+#define VP_MELT_MAX_NUM_CHANS 8
+/******************************************************************************
+ * VCP library specific other defines and conditional compile flags *
+ ******************************************************************************/
+
+/* Define the following to enable debug print statements from the VCP API */
+#undef DEBUG_VCP_API
+
+#ifdef DEBUG_VCP_API
+#include <stdio.h>
+/* Define the following as necessary to redirect the debug output */
+#define term_printf printf
+
+/* Further classification enabling/disabling debug output */
+#define DEBUG_BOOTLOAD /* Debug bootload function */
+#define DEBUG_VCP_API_MB /* MailBox related debug output */
+#define DEBUG_VCP_API_EVENT /* Event masking related debug output */
+#define DEBUG_VCP_API_DEFLT_OPTN /* Default option debugging */
+#endif /* DEBUG_VCP_API */
+
+/******************************************************************************
+ * API Debug output redirection *
+ ******************************************************************************/
+#if defined(DEBUG_VCP_API)
+#ifndef term_printf
+#include <stdio.h>
+/* Define the following as necessary to redirect the debug output */
+#define term_printf printf
+#endif /* term_printf */
+#endif /* DEBUG_VCP_API */
+
+/******************************************************************************
+ * API Interface Conditional Compilation *
+ ******************************************************************************/
+/* The following VP_CC_ macros define whether each top-level API function,
+ * function pointer type, and function pointer table entry is compiled in. */
+
+/* vp_api_config.c functions */
+#if 1
+#define VP_CC_MAKE_DEVICE_OBJECT
+#endif
+
+#if 1
+#define VP_CC_MAKE_DEVICE_CTX
+#endif
+
+#if 1
+#define VP_CC_MAKE_LINE_OBJECT
+#endif
+
+#if 1
+#define VP_CC_MAKE_LINE_CTX
+#endif
+
+#if 1
+#define VP_CC_FREE_LINE_CTX
+#endif
+
+#if 1
+#define VP_CC_MAP_LINE_ID
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_MAP_SLAC_ID
+#endif
+
+
+/* vp_api_init.c functions */
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_BOOT_LOAD
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_BOOT_SLAC
+#endif
+
+#if 1
+#define VP_CC_INIT_DEVICE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_INIT_SLAC
+#endif
+
+#if 1
+#define VP_CC_INIT_LINE
+#endif
+
+#if 1
+#define VP_CC_CONFIG_LINE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SET_B_FILTER
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SET_BATTERIES
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || (defined(VP_CC_880_SERIES) && defined(VP_ENABLE_PROD_TEST)) \
+ || (defined(VP_CC_886_SERIES) && defined(VP_ENABLE_PROD_TEST)) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_CAL_CODEC
+#endif
+
+#if 1
+#define VP_CC_CAL_LINE
+#endif
+
+#if 1
+#define VP_CC_CAL
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CSLAC_SEQ_EN) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_INIT_RING
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CSLAC_SEQ_EN) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_INIT_CID
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CSLAC_SEQ_EN) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_INIT_METER
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_INIT_CUSTOM_TERM
+#endif
+
+#if 1
+#define VP_CC_INIT_PROFILE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SOFT_RESET
+#endif
+
+
+/* vp_api_control.c functions */
+#if 1
+#define VP_CC_SET_LINE_STATE
+#endif
+
+#if 1
+#define VP_CC_SET_LINE_TONE
+#endif
+
+#if 1
+#define VP_CC_SET_RELAY_STATE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SET_CAL_RELAY_STATE
+#endif
+
+#if 1
+#define VP_CC_SET_REL_GAIN
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CSLAC_SEQ_EN) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SEND_SIGNAL
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CSLAC_SEQ_EN) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SEND_CID
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CSLAC_SEQ_EN) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_CONTINUE_CID
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CSLAC_SEQ_EN) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_START_METER
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_GEN_TIMER_CTRL
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_START_METER_32Q
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_READ_CAL_FLAG
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SET_CAL_FLAG
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_ASSOC_DSL_LINE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SET_SEAL_CUR
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SEAL_CUR_CTRL
+#endif
+
+
+#if 1
+#define VP_CC_SET_OPTION
+#endif
+
+#if 1
+#define VP_CC_DEVICE_IO_ACCESS
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_DEVICE_IO_ACCESS_EXT
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_LINE_IO_ACCESS
+#endif
+
+#if 1
+#define VP_CC_VIRTUAL_ISR
+#endif
+
+#if 1
+#define VP_CC_API_TICK
+#endif
+
+#if 1
+#define VP_CC_FREE_RUN
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_BATTERY_BACKUP_MODE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SHUTDOWN_DEVICE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP) \
+ || defined(ZARLINK_CFG_INTERNAL))
+#define VP_CC_LOW_LEVEL_CMD
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_LOW_LEVEL_CMD_16
+#endif
+
+
+/* vp_api_query.c functions */
+#if 1
+#define VP_CC_GET_EVENT
+#endif
+
+#if 1
+#define VP_CC_GET_LINE_STATUS
+#endif
+
+#if 1
+#define VP_CC_GET_DEVICE_STATUS
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_GET_DEVICE_STATUS_EXT
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_GET_LOOP_COND
+#endif
+
+#if 1
+#define VP_CC_GET_OPTION
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_GET_OPTION_IMMEDIATE
+#endif
+
+#if 1
+#define VP_CC_GET_LINE_STATE
+#endif
+
+#if 1
+#define VP_CC_FLUSH_EVENTS
+#endif
+
+#if 1
+#define VP_CC_GET_RESULTS
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_CLEAR_RESULTS
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP) \
+ || (defined(VP_CC_880_SERIES) && defined (VP880_INCLUDE_TESTLINE_CODE)) \
+ || (defined(VP_CC_890_SERIES) && defined (VP890_INCLUDE_TESTLINE_CODE)) \
+ || (defined(VP_CC_886_SERIES) && defined (VP886_INCLUDE_TESTLINE_CODE)))
+#define VP_CC_GET_RELAY_STATE
+#endif
+
+#if 1
+#define VP_CC_GET_DEVICE_INFO
+#endif
+
+#if 1
+#define VP_CC_GET_LINE_INFO
+#endif
+
+#if 1
+#define VP_CC_DTMF_DIGIT_DETECTED
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_QUERY
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_QUERY_IMMEDIATE
+#endif
+
+
+/* vp_api_test.c functions */
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP) \
+ || (defined(VP_CC_880_SERIES) && defined (VP880_INCLUDE_TESTLINE_CODE)) \
+ || (defined(VP_CC_890_SERIES) && defined (VP890_INCLUDE_TESTLINE_CODE)) \
+ || (defined(VP_CC_886_SERIES) && defined (VP886_INCLUDE_TESTLINE_CODE)))
+#define VP_CC_TEST_LINE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP) \
+ || (defined(VP_CC_880_SERIES) && defined (VP880_INCLUDE_TESTLINE_CODE)) \
+ || (defined(VP_CC_890_SERIES) && defined (VP890_INCLUDE_TESTLINE_CODE)))
+#define VP_CC_TEST_LINE_INT
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP) \
+ || (defined(VP_CC_880_SERIES) && defined (VP880_INCLUDE_TESTLINE_CODE)) \
+ || (defined(VP_CC_890_SERIES) && defined (VP890_INCLUDE_TESTLINE_CODE)))
+#define VP_CC_TEST_LINE_CALLBACK
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_CODE_CHECKSUM
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SELF_TEST
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_FILL_TEST_BUF
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_792_SERIES) \
+ || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) \
+ || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_MELT792_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_READ_TEST_BUF
+#endif
+
+
+/* vp_api_debug.c functions */
+#if 1
+#define VP_CC_REGISTER_DUMP
+#endif
+
+#if 1
+#define VP_CC_OBJECT_DUMP
+#endif
+
+
+/* vp_api_common.c functions */
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SLAC_BUF_START
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SLAC_BUF_SEND
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SLAC_REG_WRITE
+#endif
+
+#if (!defined(VP_REDUCED_API_IF) \
+ || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_KWRAP))
+#define VP_CC_SLAC_REG_READ
+#endif
+
+
+
+#if defined (VP_CC_VCP_SERIES) || defined (VP_CC_VCP2_SERIES)
+/******************************************************************************
+ * Library Specific default options *
+ *****************************************************************************/
+/* VoicePath API provides a mechanism where individual library's default
+ * options could be different compared to top level API default options.
+ * If you need such a change please review the file included below.
+ */
+#include "vp_api_lib_cfg.h"
+#endif
+
+
+#endif /* VP_API_CFG_INT_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_common.h b/marvell/services/mislic/api_lib/includes/vp_api_common.h
new file mode 100644
index 0000000..70e499d
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_common.h
@@ -0,0 +1,2207 @@
+/** \file vp_api_common.h
+ * vp_api_common.h
+ *
+ * Header file for the VP-API-II c files.
+ *
+ * This file contains all of the VP-API-II declarations that are Voice
+ * Termination Device (VTD) family independent.
+ *
+ * $Revision: 12595 $
+ * $LastChangedDate: 2018-07-05 15:48:55 -0500 (Thu, 05 Jul 2018) $
+ */
+
+#ifndef VP_API_COMMON_H
+#define VP_API_COMMON_H
+
+#include "vp_api_types.h"
+#include "vp_api_dev_term.h"
+#include "vp_api_event.h"
+#include "vp_api_option.h"
+#include "vp_api_test.h"
+
+
+/******************************************************************************
+ * DEFINES *
+ ******************************************************************************/
+
+/*
+ * Profile Table Indexes
+ */
+#define VP_PTABLE_NULL (VpProfilePtrType)0
+#define VP_PTABLE_INDEX1 (VpProfilePtrType)1
+#define VP_PTABLE_INDEX2 (VpProfilePtrType)2
+#define VP_PTABLE_INDEX3 (VpProfilePtrType)3
+#define VP_PTABLE_INDEX4 (VpProfilePtrType)4
+#define VP_PTABLE_INDEX5 (VpProfilePtrType)5
+#define VP_PTABLE_INDEX6 (VpProfilePtrType)6
+#define VP_PTABLE_INDEX7 (VpProfilePtrType)7
+#define VP_PTABLE_INDEX8 (VpProfilePtrType)8
+#define VP_PTABLE_INDEX9 (VpProfilePtrType)9
+#define VP_PTABLE_INDEX10 (VpProfilePtrType)10
+#define VP_PTABLE_INDEX11 (VpProfilePtrType)11
+#define VP_PTABLE_INDEX12 (VpProfilePtrType)12
+#define VP_PTABLE_INDEX13 (VpProfilePtrType)13
+#define VP_PTABLE_INDEX14 (VpProfilePtrType)14
+#define VP_PTABLE_INDEX15 (VpProfilePtrType)15
+#define VP_PTABLE_NO_INDEX (VpProfilePtrType)99
+#define VP_PTABLE_MAX_INDEX VP_PTABLE_INDEX15
+#define VP_PTABLE_INDEX(n) (VpProfilePtrType)(n)
+
+
+/*
+ *Utility macros:
+ */
+#ifndef ABS
+ #define ABS(arg) ((arg) < 0 ? -(arg) : (arg))
+#endif
+
+#ifndef MAX
+ #define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+#ifndef MIN
+ #define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#ifndef MAX4
+ #define MAX4(a, b, c, d) MAX(MAX(a, b), MAX(c, d))
+#endif
+
+#ifndef MAX12
+ #define MAX12(a, b, c, d, e, f, g, h, i, j, k, l) \
+ MAX(MAX(MAX4(a, b, c, d), MAX4(e, f, g, h)), MAX4(i, j, k, l))
+#endif
+
+#define VP_ROUNDED_DIVIDE(x, y) (\
+ (((x) > 0 && (y) > 0) || ((x) <= 0 && (y) <= 0)) ? \
+ (((x) + ((y) / 2)) / (y)) : \
+ (((x) - ((y) / 2)) / (y)) \
+ )
+
+
+/******************************************************************************
+ * ENUMERATIONS AND NEW DATA TYPES *
+ ******************************************************************************/
+/** Standard return value for most API library functions. See the VP-API-II
+ Reference Guide for descriptions. */
+typedef enum VpStatusType {
+ VP_STATUS_SUCCESS = 0,
+ VP_STATUS_FAILURE = 1,
+ VP_STATUS_FUNC_NOT_SUPPORTED = 2,
+ VP_STATUS_INVALID_ARG = 3,
+ VP_STATUS_MAILBOX_BUSY = 4,
+ VP_STATUS_ERR_VTD_CODE = 5,
+ VP_STATUS_OPTION_NOT_SUPPORTED = 6,
+ VP_STATUS_ERR_VERIFY = 7,
+ VP_STATUS_DEVICE_BUSY = 8,
+ VP_STATUS_MAILBOX_EMPTY = 9,
+ VP_STATUS_ERR_MAILBOX_DATA = 10,
+ VP_STATUS_ERR_HBI = 11,
+ VP_STATUS_ERR_IMAGE = 12,
+ VP_STATUS_IN_CRTCL_SECTN = 13,
+ VP_STATUS_DEV_NOT_INITIALIZED = 14,
+ VP_STATUS_ERR_PROFILE = 15,
+ VP_STATUS_CUSTOM_TERM_NOT_CFG = 17,
+ VP_STATUS_DEDICATED_PINS = 18,
+ VP_STATUS_INVALID_LINE = 19,
+ VP_STATUS_LINE_NOT_CONFIG = 20,
+ VP_STATUS_ERR_SPI = 21,
+ VP_STATUS_ACCESS_BLOCKED = 22,
+ VP_STATUS_INPUT_PARAM_OOR, /* This enum value does not yet require to be a set value */
+ VP_STATUS_NUM_TYPES,
+ VP_STATUS_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpStatusType;
+
+/* Enumeration for Boot load Function */
+typedef enum VpBootStateType {
+ VP_BOOT_STATE_FIRST, /* First block to download */
+ VP_BOOT_STATE_CONTINUE, /* Additional block to download */
+ VP_BOOT_STATE_LAST, /* Last block to download */
+ VP_BOOT_STATE_FIRSTLAST, /* First and only block to download */
+ VP_NUM_BOOT_STATES,
+ VP_BOOT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpBootStateType;
+
+/* Enumeration for Boot load Function */
+typedef enum VpBootModeType {
+ VP_BOOT_MODE_NO_VERIFY, /* No write verification is performed */
+ VP_BOOT_MODE_VERIFY, /* Verify Load Image Checksum */
+ VP_NUM_BOOT_MODES,
+ VP_BOOT_MODE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpBootModeType;
+
+/* Version and checksum information for VCP */
+typedef struct VpVersionInfoType {
+ uint16 vtdRevCode; /* Silicon Revision for VTD */
+ uint8 swProductId; /* VTD Firmware ID */
+ uint8 swVerMajor; /* Major Revision for VTD Firmware */
+ uint8 swVerMinor; /* Minor Revision for VTD Firmware */
+} VpVersionInfoType;
+
+typedef struct VpChkSumType {
+ uint32 loadChecksum; /* Calculated Checksum for Code Image */
+ VpVersionInfoType vInfo; /* Version Information for VTD HW/SW */
+} VpChkSumType;
+
+typedef enum VpProfileType {
+ VP_PROFILE_DEVICE = 0, /* Device profile */
+ VP_PROFILE_AC = 1, /* AC profile */
+ VP_PROFILE_DC = 2, /* DC profile */
+ VP_PROFILE_RING = 3, /* Ring profile */
+ VP_PROFILE_RINGCAD = 4, /* Ringing cadence profile */
+ VP_PROFILE_TONE = 5, /* Tone profile */
+ VP_PROFILE_METER = 6, /* Metering profile */
+ VP_PROFILE_CID = 7, /* Caller ID profile */
+ VP_PROFILE_TONECAD = 8, /* Tone cadence profile */
+ VP_PROFILE_FXO_CONFIG, /* FXO configuration profile */
+ VP_PROFILE_CUSTOM_TERM, /* Custom Termination Type profile */
+ VP_PROFILE_CAL, /* Used for VpCal when passing calibration coefficients */
+ VP_NUM_PROFILE_TYPES,
+ VP_PROFILE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpProfileType;
+
+/**< typedef for VpCalCodec() function */
+typedef enum VpDeviceCalType {
+ VP_DEV_CAL_NOW = 0, /* Calibrate immediately */
+ VP_DEV_CAL_NBUSY = 1, /* Calibrate if all lines are "on-hook" */
+ VP_NUM_DEV_CAL_TYPES,
+ VP_DEV_CAL_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDeviceCalType;
+
+/* Valid line states for VpSetLineState() */
+/* Defined else where */
+
+/**< The following types are for VpSetLineTone() function */
+typedef struct VpDtmfToneGenType {
+ VpDigitType toneId; /* Identifies the DTMF tone to generated */
+ VpDirectionType dir; /* Direction in which DTMF tone needs to be
+ * generated */
+} VpDtmfToneGenType;
+
+typedef enum VpDigitGenerationType {
+ VP_DIGIT_GENERATION_DTMF, /* Generate DTMF digit */
+ VP_DIGIT_GENERATION_DIAL_PULSE, /* Generate pulse digit */
+ VP_DIGIT_GENERATION_DIAL_HOOK_FLASH, /* Generate hook flash */
+ VP_DIGIT_GEN_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDigitGenerationType;
+
+typedef enum VpBFilterModeType {
+ VP_BFILT_DIS = 0,
+ VP_BFILT_EN = 1,
+ VP_BFILT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpBFilterModeType;
+
+typedef enum VpBatteryModeType {
+ VP_BATT_MODE_DIS = 0,
+ VP_BATT_MODE_EN = 1,
+ VP_BATT_MODE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpBatteryModeType;
+
+typedef struct VpBatteryValuesType {
+ int16 batt1;
+ int16 batt2;
+ int16 batt3;
+} VpBatteryValuesType;
+
+/**< The following types are for VpSetRelayState() and VpGetRelayState() functions */
+typedef enum VpRelayControlType {
+ VP_RELAY_NORMAL = 0, /* No test access, ringing controlled
+ * by line state */
+ VP_RELAY_RESET = 1, /* LCAS all-off state, test-out released */
+ VP_RELAY_TESTOUT = 2, /* LCAS all-off state, test-out active */
+ VP_RELAY_TALK = 3, /* LCAS talk state, test-out released */
+ VP_RELAY_RINGING = 4, /* LCAS ringing state, test-out released */
+ VP_RELAY_TEST = 5, /* LCAS test state, test-out released */
+ VP_RELAY_BRIDGED_TEST = 6, /* LCAS test/monitor state,
+ * test-out released */
+ VP_RELAY_SPLIT_TEST = 7, /* LCAS test/monitor state,
+ * test-out active */
+ VP_RELAY_DISCONNECT = 8, /* LCAS talk state, test-out active */
+ VP_RELAY_RINGING_NOLOAD = 9, /* LCAS ringing state, test-out active */
+ VP_RELAY_RINGING_TEST = 10, /* LCAS test ringing state,
+ * test-out active */
+ VP_RELAY_LAMP_ON = 11, /* VCP2-790 FXS_TL_MW only */
+ VP_RELAY_IDLE = 12, /* All switches open, test switch off */
+ VP_RELAY_TEST_LOAD = 13, /* LCAS all-off state,
+ * test-out active */
+ VP_NUM_RELAY_STATES,
+ VP_RELAY_ENUM_RSVD = FORCE_SIGNED_ENUM,
+ VP_RELAY_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpRelayControlType;
+
+/**< The following types are for VpSetCalRelayState() function */
+typedef enum VpCalRelayControlType {
+ VP_CAL_RELAY_OPEN, /* Open circuit */
+ VP_CAL_RELAY_R_DIFF_LOW_TIP_RING, /* Res Tip-to-Ring: R_DIFF_LOW Ohms */
+ VP_CAL_RELAY_R_CM_REF_TIP_GND, /* Res Tip-to-Gnd: R_CM_REF Ohms */
+ VP_CAL_RELAY_V_CAL_REF_TIP_GND, /* Volt Tip: V_CAL_REF Volts */
+ VP_CAL_RELAY_SHORT_TIP_RING, /* Res Tip-to-Ring: short (0 Ohms) */
+ VP_CAL_RELAY_R_DIFF_HIGH_TIP_RING,/* Res Tip-to-Ring: R_DIFF_HIGH Ohms */
+ VP_CAL_RELAY_R_CM_REF_RING_GND, /* Res Ring-to-Gnd: R_CM_REF Ohms */
+ VP_CAL_RELAY_V_CAL_REF_RING_GND, /* Volt Ring: V_CAL_REF Volts */
+ VP_CAL_RELAY_NUM_STATES,
+ VP_CAL_RELAY_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpCalRelayControlType;
+
+/**< The following types are for VpSetRelGain() function */
+typedef enum VpGainResultType {
+ VP_GAIN_SUCCESS = 0, /* Gain setting adjusted successfully */
+ VP_GAIN_GR_OOR = 1, /* GR Gain setting overflowed (reset to default) */
+ VP_GAIN_GX_OOR = 2, /* GX Gain setting overflowed (reset to default) */
+ VP_GAIN_BOTH_OOR = 3, /* Both GR & GX overflowed (and reset to default) */
+ VP_GAIN_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpGainResultType;
+
+typedef struct VpRelGainResultsType {
+ VpGainResultType gResult; /* Success / Failure status return */
+ uint16 gxValue; /* new GX register abs value */
+ uint16 grValue; /* new GR register abs value */
+} VpRelGainResultsType;
+
+/* The number of 16 bits words used to define whether seal current
+ * should be applied to lines 0-127 */
+#define VP_SEAL_CURRENT_ARRAY_SIZE 8
+
+typedef struct VpSealCurType {
+ uint16 sealApplyTime;
+ uint16 sealCycleTime;
+ uint16 maxCurrent;
+ uint16 minCurrent;
+ uint16 sealMaskArray[VP_SEAL_CURRENT_ARRAY_SIZE];
+ uint16 batteryOffset;
+} VpSealCurType;
+
+typedef enum VpSealCurCtrlType {
+ VP_SEAL_CUR_START = 0,
+ VP_SEAL_CUR_STOP = 1,
+ VP_SEAL_CUR_RESUME = 2
+} VpSealCurCtrlType;
+
+typedef struct VpSealingCurrentType {
+ uint16 sealApplyTime;
+ uint16 sealOffTime;
+ uint16 batteryOffset;
+ uint32 selMask_31_0;
+ uint32 selMask_63_32;
+ uint32 selMask_95_64;
+ uint32 selMask_127_96;
+} VpSealingCurrentType;
+
+typedef struct VpLineTopologyType {
+ uint16 rInsideDcSense;
+ uint16 rOutsideDcSense;
+} VpLineTopologyType;
+
+typedef struct VpSealCurStatusType {
+ uint8 running;
+ uint8 currentLine;
+} VpSealCurStatusType;
+
+typedef enum VpSwPowerModeType {
+ VP_SW_POWER_MODE_OFF = 0,
+ VP_SW_POWER_MODE_LOW = 1,
+ VP_SW_POWER_MODE_MEDIUM = 2,
+ VP_SW_POWER_MODE_HIGH = 3,
+ VP_SW_POWER_MODE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpSwPowerModeType;
+
+typedef struct VpSwDutyCycleType {
+ uint16 onTime; /* in 6.144MHz ticks */
+ uint16 cycleCount;
+ uint16 avgDutyCycle; /* hundreths of percent */
+ VpSwPowerModeType powerMode;
+ uint16 switcherPeriod; /* in 24.576MHz ticks */
+ uint16 maxPulseWidth; /* in 24.576MHz ticks */
+ bool stateChanged;
+} VpSwDutyCycleType;
+
+/**< The following types are for the VpQuery() function */
+typedef enum VpQueryIdType {
+ VP_QUERY_ID_TEMPERATURE = 0,
+ VP_QUERY_ID_METER_COUNT = 1,
+ VP_QUERY_ID_LOOP_RES = 2,
+ VP_QUERY_ID_SEAL_CUR = 3,
+ VP_QUERY_ID_DEV_TRAFFIC = 4,
+ VP_QUERY_ID_LINE_CAL_COEFF = 5,
+ VP_QUERY_ID_TIMESTAMP = 6,
+ VP_QUERY_ID_LINE_TOPOLOGY = 7,
+ VP_QUERY_ID_SEAL_CUR_STATUS = 8,
+ VP_QUERY_ID_SW_DUTY_CYCLE = 9,
+ VP_NUM_QUERY_IDS,
+ VP_QUERY_ID_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpQueryIdType;
+
+typedef union VpQueryResultsType {
+ int16 temp;
+ uint16 meterCount;
+ uint16 rloop;
+ VpSealCurType sealCur;
+ uint32 trafficBytes;
+ uint8 calProf[256];
+ uint32 timestamp;
+ VpLineTopologyType lineTopology;
+ VpSealCurStatusType sealCurStatus;
+ VpSwDutyCycleType swDutyCycle;
+} VpQueryResultsType;
+
+/**< The following types are for VpLineIoAccess() function */
+typedef enum VpIoDirectionType {
+ VP_IO_WRITE = 0,
+ VP_IO_READ = 1,
+ VP_IO_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpIoDirectionType;
+
+typedef struct VpLineIoBitsType {
+ uint8 mask;
+ uint8 data;
+} VpLineIoBitsType;
+
+typedef struct VpLineIoAccessType {
+ VpIoDirectionType direction;
+ VpLineIoBitsType ioBits;
+} VpLineIoAccessType;
+
+/**< The following types are for VpDeviceIoAccess() function */
+typedef enum VpDeviceIoAccessType {
+ VP_DEVICE_IO_WRITE = 0, /* Perform device specific IO write access */
+ VP_DEVICE_IO_READ = 1, /* Perform device specific IO read access */
+ VP_DEVICE_IO_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDeviceIoAccessType;
+
+typedef enum VpDeviceIoAccessMask {
+ VP_DEVICE_IO_IGNORE = 0, /* Ignore I/O access */
+ VP_DEVICE_IO_ACCESS = 1, /* Perform I/O access */
+ VP_DEVUCE_IOA_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDeviceIoAccessMask;
+
+typedef struct VpDeviceIoAccessDataType {
+ VpDeviceIoAccessType accessType;/* Device I/O access type */
+ uint32 accessMask_31_0; /* I/O access mask (Pins 0 - 31) */
+ uint32 accessMask_63_32; /* I/O access mask (Pins 32 - 63) */
+ uint32 deviceIOData_31_0; /* Output pin data (Pins 0 - 31) */
+ uint32 deviceIOData_63_32; /* Output pin data (Pins 32 - 63) */
+} VpDeviceIoAccessDataType;
+
+/**< The following types are for VpDeviceIoAccessExt() function */
+
+typedef struct VpDeviceIoAccessExtType {
+ VpIoDirectionType direction;
+ VpLineIoBitsType lineIoBits[VP_MAX_LINES_PER_DEVICE];
+} VpDeviceIoAccessExtType;
+
+/**< The following types are for VpGetLineStatus() function */
+typedef enum VpInputType {
+ VP_INPUT_HOOK = 0, /* Hook Status (ignoring pulse & flash) */
+ VP_INPUT_RAW_HOOK = 1, /* Hook Status (include pulse & flash) */
+ VP_INPUT_GKEY = 2, /* Ground-Key/Fault Status */
+ VP_INPUT_THERM_FLT = 3, /* Thermal Fault Status */
+ VP_INPUT_CLK_FLT = 4, /* Clock Fault Status */
+ VP_INPUT_AC_FLT = 5, /* AC Fault Status */
+ VP_INPUT_DC_FLT = 6, /* DC Fault Status */
+ VP_INPUT_BAT1_FLT = 7, /* Battery 1 Fault Status */
+ VP_INPUT_BAT2_FLT = 8, /* Battery 2 Fault Status */
+ VP_INPUT_BAT3_FLT = 9, /* Battery 3 Fault Status */
+
+ VP_INPUT_RINGING, /* Ringing Status */
+ VP_INPUT_LIU, /* Line In Use Status */
+ VP_INPUT_FEED_DIS, /* Feed Disable Status */
+ VP_INPUT_FEED_EN, /* Feed Enable Status */
+ VP_INPUT_DISCONNECT, /* Feed Disconnect Status */
+ VP_INPUT_CONNECT, /* Feed Connect Status */
+ VP_INPUT_POLREV, /* Reverse Polarity if TRUE, Normal if FALSE */
+ VP_INPUT_RES_LEAK, /* Resistive Leakage on line if TRUE */
+
+ VP_NUM_INPUT_TYPES,
+ VP_INPUT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpInputType;
+
+/**< The following type is for the VpGetDeviceStatusExt() function: */
+typedef struct VpDeviceStatusType {
+ VpInputType input;
+ uint8 status[VP_LINE_FLAG_BYTES];
+} VpDeviceStatusType;
+
+/**< The following types are for VpGetLoopCond() function (return via
+ * VpGetResults())
+ */
+typedef enum VpBatteryType {
+ VP_BATTERY_UNDEFINED = 0, /* Battery being used is not known or feature
+ * not supported */
+ VP_BATTERY_1 = 1, /* Battery 1 */
+ VP_BATTERY_2 = 2, /* Battery 2 */
+ VP_BATTERY_3 = 3, /* Battery 3 */
+ VP_NUM_BATTERY_TYPES,
+ VP_BATTERY_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpBatteryType;
+
+typedef enum VpDcFeedRegionType {
+ VP_DF_UNDEFINED = 0, /* DC feed region not known or feature not
+ * supported */
+ VP_DF_ANTI_SAT_REG = 1, /* DC feed is in anti saturation region */
+ VP_DF_CNST_CUR_REG = 2, /* DC feed is in constant current region */
+ VP_DF_RES_FEED_REG = 3, /* DC feed is in resistive feed region */
+ VP_NUM_DC_FEED_TYPES,
+ VP_DC_FEED_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDcFeedRegionType;
+
+typedef struct VpLoopCondResultsType {
+ int16 rloop; /**< The loop resistance */
+ int16 ilg; /**< The longitudinal loop current */
+ int16 imt; /**< The metallic loop current */
+ int16 vsab; /**< The tip/ring voltage */
+ int16 vbat1; /**< The Battery 1 voltage */
+ int16 vbat2; /**< The Battery 2 voltage */
+ int16 vbat3; /**< The Battery 3 voltage */
+ int16 mspl; /**< Metering signal peak level */
+ VpBatteryType selectedBat; /**< Battery that is presently used for
+ * the DC feed */
+ VpDcFeedRegionType dcFeedReg; /**< DC feed region presently selected */
+} VpLoopCondResultsType;
+
+/**< The following types are used for the function VpSendSignal() */
+typedef enum VpSendSignalType {
+ VP_SENDSIG_MSG_WAIT_PULSE = 0,
+ VP_SENDSIG_DTMF_DIGIT = 1,
+ VP_SENDSIG_PULSE_DIGIT = 2,
+ VP_SENDSIG_HOOK_FLASH = 3,
+ VP_SENDSIG_FWD_DISCONNECT = 4,
+ VP_SENDSIG_POLREV_PULSE = 5,
+ VP_SENDSIG_MOMENTARY_LOOP_OPEN = 6,
+ VP_SENDSIG_TIP_OPEN_PULSE = 7,
+ VP_SENDSIG_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpSendSignalType;
+
+typedef struct VpSendMsgWaitType {
+ int8 voltage; /**< Voltage in Volts to apply to the line. A negative
+ * value means Tip is more Negative than Ring, a positive
+ * value means Ring is more Negative than Tip.
+ */
+ uint16 onTime; /**< Duration of pulse on-time in mS */
+ uint16 offTime; /**< Duration of pulse off-tim in mS. If the off-time is
+ * set to 0, the voltage is applied to the line continuously
+ */
+ uint8 cycles; /**< Number of pulses to send on the line. If set to 0, will
+ * repeat forever
+ */
+} VpSendMsgWaitType;
+
+/**< The following type is used for the function VpGenTimerCtrl() */
+typedef enum VpGenTimerCtrlType {
+ VP_GEN_TIMER_START = 0,
+ VP_GEN_TIMER_CANCEL = 1,
+ VP_GEN_TIMER_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpGenTimerCtrlType;
+
+/**< The enum is used by the system service layer pcmCollect() function */
+typedef enum VpPcmOperationBitType {
+ VP_PCM_OPERATION_AVERAGE = 0x0001, /* average PCM samples */
+ VP_PCM_OPERATION_RANGE = 0x0002, /* find pk to pk pcm sample data. */
+ VP_PCM_OPERATION_RMS = 0x0004, /* find rms value of pcm samples */
+ VP_PCM_OPERATION_MIN = 0x0008, /* find min pcm value of pcm samples */
+ VP_PCM_OPERATION_MAX = 0x0010, /* find max pcm value of pcm samples */
+ VP_PCM_OPERATION_APP_SPECIFIC = 0x0020, /* generic operation */
+ VP_PCM_OPERATION_FREQ = 0x0040, /* Measure frequency */
+ VP_PCM_OPERATION_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpPcmOperationBitType;
+
+typedef uint16 VpPcmOperationMaskType;
+
+typedef struct VpPcmOperationResultsType {
+ int16 average; /* Average value of all collected PCM samples */
+ int16 range; /* Maximum - minimum PCM value during operation time */
+ int16 rms; /* RMS result of all collected pcm samples */
+ int16 min; /* Maximum pcm value found */
+ int16 max; /* Minimum pcm value found */
+ void *pApplicationInfo; /* Any results that the implementation chooses to
+ * pass. This data is not interpreted neither
+ * by the VP-API nor the LT-API. LT-API passes
+ * this pointer back to the application as part
+ * of the test result
+ */
+ int32 freq; /* Measured average frequenny */
+
+ bool error; /* indication of PCM operation process (1 = failure) */
+} VpPcmOperationResultsType;
+
+/**< The enum is used by the cal function */
+typedef enum VpCalType {
+ VP_CAL_BFILTER = 1,
+ VP_CAL_APPLY_BFILTER = 2,
+ VP_CAL_MEASURE_BFILTER = 3,
+ VP_CAL_GET_SYSTEM_COEFF = 4,
+ VP_CAL_APPLY_SYSTEM_COEFF = 5,
+ VP_CAL_GET_LINE_COEFF = 6,
+ VP_CAL_APPLY_LINE_COEFF = 7,
+ VP_CAL_QUICKCAL = 8,
+ VP_CAL_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpCalType;
+
+typedef struct VpCalBFilterType {
+ uint16 vRms; /**< Customer Target Value in approximate vRms */
+ VpProfilePtrType pAcProfile;
+} VpCalBFilterType;
+
+typedef struct VpCalApplyBFilterType {
+ VpProfilePtrType pAcProfile;
+ uint16 index;
+} VpCalApplyBFilterType;
+
+typedef enum VpCalStatusType {
+ VP_CAL_SUCCESS,
+ VP_CAL_FAILURE,
+ VP_CAL_STATUS_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpCalStatusType;
+
+typedef enum VpLowLevelCmdType {
+ VP_LOWLEV_PAGE_WR = 0,
+ VP_LOWLEV_PAGE_RD = 1,
+ VP_LOWLEV_MBOX_WR = 2,
+ VP_LOWLEV_MBOX_RD = 3,
+ VP_LOWLEV_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpLowLevelCmdType;
+
+/* The following struct can be passed to VpGetResults() if the event ID is not
+ known at compile time, to ensure that the buffer is large enough regardless
+ of the result type. */
+typedef union VpResultsType {
+ VpChkSumType codeChecksum; /* VP_DEV_EVID_BOOT_CMP or
+ VP_DEV_EVID_CHKSUM */
+ VpRelGainResultsType setRelGain; /* VP_LINE_EVID_GAIN_CMP */
+ uint8 lowLevelCmd[256]; /* VP_LINE_EVID_LLCMD_RX_CMP */
+ VpLoopCondResultsType getLoopCond; /* VP_LINE_EVID_RD_LOOP */
+ VpOptionValueType getOption; /* VP_LINE_EVID_RD_OPTION */
+ VpTestResultType testLine; /* VP_LINE_EVID_TEST_CMP */
+ VpDeviceIoAccessDataType deviceIoAccess; /* VP_DEV_EVID_IO_ACCESS_CMP */
+ VpDeviceIoAccessExtType deviceIoAccessExt; /* VP_DEV_EVID_IO_ACCESS_CMP */
+ VpLineIoAccessType lineIoAccess; /* VP_LINE_EVID_LINE_IO_RD_CMP */
+ VpQueryResultsType query; /* VP_LINE_EVID_QUERY_CMP */
+} VpResultsType;
+
+typedef enum VpFreeRunModeType {
+ VP_FREE_RUN_START,
+ VP_FREE_RUN_STOP
+} VpFreeRunModeType;
+
+typedef enum VpBatteryBackupModeType {
+ VP_BATT_BACKUP_ENABLE = 0,
+ VP_BATT_BACKUP_DISABLE = 1
+} VpBatteryBackupModeType;
+
+#define VP_SLAC_MAX_BUF_WRT 250
+typedef struct {
+ bool buffering;
+ uint8 wrtBuf[VP_SLAC_MAX_BUF_WRT];
+ uint8 wrtLen;
+ uint8 firstEc;
+ uint8 currentEc;
+} VpSlacBufDataType;
+
+/* Timer queue structures */
+typedef struct {
+ uint16 id;
+ uint32 duration;
+ uint32 overrun;
+ bool active;
+ int16 next;
+ uint8 channelId;
+ uint32 handle;
+} VpTimerQueueNodeType;
+
+typedef struct {
+ int16 index;
+ int16 numNodes;
+ uint32 timestamp;
+ bool processing;
+} VpTimerQueueInfoType;
+
+typedef struct {
+ bool success;
+ bool firstTimerChanged;
+} VpTimerQueueStatusType;
+
+typedef enum {
+ VP_PULSE_DECODE_STATE_IDLE,
+ VP_PULSE_DECODE_STATE_OFFHOOK_PREQUAL,
+ VP_PULSE_DECODE_STATE_BREAK,
+ VP_PULSE_DECODE_STATE_MAKE,
+ VP_PULSE_DECODE_STATE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpPulseDecodeStateType;
+
+typedef enum {
+ VP_PULSE_DECODE_INPUT_ON_HOOK,
+ VP_PULSE_DECODE_INPUT_OFF_HOOK,
+ VP_PULSE_DECODE_INPUT_TIMER,
+ VP_PULSE_DECODE_INPUT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpPulseDecodeInputType;
+
+typedef struct {
+ VpPulseDecodeStateType state;
+ uint16 prevTimestamp;
+ uint8 digitCount;
+ bool digitValidSpec1;
+ bool digitValidSpec2;
+} VpPulseDecodeDataType;
+
+typedef enum {
+ VP_DTMF_SAMPLE_RATE_4KHZ,
+ VP_DTMF_SAMPLE_RATE_8KHZ,
+ VP_DTMF_SAMPLE_RATE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDtmfDetectSampleRateType;
+
+typedef struct {
+ int32 coeff;
+ uint8 size;
+ int32 v2;
+ int32 v3;
+ uint8 scale;
+ uint16 gainSqd;
+} VpDtmfDetectGoertzelType;
+
+typedef struct {
+ VpDtmfDetectSampleRateType sampleRate;
+ uint32 basicThreshold;
+ uint16 normalTwistFactor;
+ uint16 reverseTwistFactor;
+ uint16 relPeakRowFactor;
+ uint16 relPeakColFactor;
+ uint16 secondHarmRowFactor;
+ uint16 secondHarmColFactor;
+ uint16 totalEnergyFactor;
+ uint16 normalizeGain;
+ /* Frequency gains (squared) */
+ uint16 gainRow[4];
+ uint16 gainCol[4];
+ uint16 gain2ndRow[4];
+ uint16 gain2ndCol[4];
+ uint16 gainLowRowGap;
+ uint16 gainHighRowGap;
+ uint16 gainLowColGap;
+} VpDtmfDetectParamsType;
+
+typedef struct {
+ VpDtmfDetectGoertzelType grtzlRow[4];
+ VpDtmfDetectGoertzelType grtzlCol[4];
+ VpDtmfDetectGoertzelType grtzl2ndRow[4];
+ VpDtmfDetectGoertzelType grtzl2ndCol[4];
+ VpDtmfDetectGoertzelType grtzlLowRowGap;
+ VpDtmfDetectGoertzelType grtzlHighRowGap;
+ VpDtmfDetectGoertzelType grtzlLowColGap;
+
+ VpDtmfDetectParamsType params;
+ uint8 blockSize;
+ uint8 currentSample;
+ uint32 totalEnergy;
+ VpDigitType prevHit;
+
+ VpDigitType digitOutput;
+ uint32 peakEnergyRow;
+ uint32 peakEnergyCol;
+} VpDtmfDetectDataType;
+
+
+/* Polarity states */
+#define VP_POL_NORM 0
+#define VP_POL_REV 1
+#define VP_POL_NONE 2
+
+/* Defining a "high dynamic range" version of uint8 with a range from 0 to
+ 63000, similar to the range of a uint16, which retains precision at the low
+ end. This is done by defining the value as 10^A * B, where A comes from the
+ highest two bits (1, 10, 100, or 1000) and B comes from the lower 6 bits
+ (0-63). This does result in some redundant values, but is easier to
+ understand and decode than a more efficient encoding. */
+typedef uint8 uint8hdr;
+#define VP_UINT8HDR_TO_UINT16(x) ((uint16)(\
+ (x & 0x3F) * ((x & 0x80) ? 100L : 1L) * ((x & 0x40) ? 10L : 1L)\
+))
+#define VP_UINT16_TO_UINT8HDR(y) ((uint8hdr)(\
+ y > 63000 ? 0xFF :\
+ y > 6300 ? (0xC0 + (y / 1000)) :\
+ y > 630 ? (0x80 + (y / 100)) :\
+ y > 63 ? (0x40 + (y / 10)) :\
+ y\
+))
+
+
+/******************************************************************************
+ * DEVICE/LINE CONTEXT (SUPPORT) DEFINITION *
+ ******************************************************************************/
+/* The following function pointers are required to get around problem of
+ * what comes first? chicken or the egg? when dealing with declaration of
+ * device context, function pointer table and hence the following declarations.
+ */
+struct VpDevCtxType; /**< forward declaration */
+struct VpLineCtxType; /**< forward declaration */
+struct VpEventType; /**< forward declaration */
+struct VpDeviceInfoType;/**< forward declaration */
+
+/*
+ * System Configuration functions
+ */
+#ifdef VP_CC_MAKE_LINE_OBJECT
+typedef VpStatusType
+(*VpMakeLineObjectFuncPtrType) (
+ VpTermType termType,
+ uint8 channelId,
+ struct VpLineCtxType *pLineCtx,
+ void *pLineObj,
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_MAKE_LINE_OBJECT */
+
+/*
+ * Initialization functions
+ */
+#ifdef VP_CC_BOOT_LOAD
+typedef VpStatusType
+(*VpBootLoadFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpBootStateType state,
+ VpImagePtrType pImageBuffer,
+ uint32 bufferSize,
+ VpScratchMemType *pScratchMem,
+ VpBootModeType validation);
+#endif /* VP_CC_BOOT_LOAD */
+
+#ifdef VP_CC_BOOT_SLAC
+typedef VpStatusType
+(*VpBootSlacFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpImagePtrType pImageBuffer,
+ uint32 bufferSize);
+#endif /* VP_CC_BOOT_SLAC */
+
+#ifdef VP_CC_INIT_DEVICE
+typedef VpStatusType
+(*VpInitDeviceFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpProfilePtrType pDevProfile,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcProfile,
+ VpProfilePtrType pRingProfile,
+ VpProfilePtrType pFxoAcProfile,
+ VpProfilePtrType pFxoCfgProfile);
+#endif /* VP_CC_INIT_DEVICE */
+
+#ifdef VP_CC_INIT_SLAC
+typedef VpStatusType
+(*VpInitSlacFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpProfilePtrType pDevProfile,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcProfile,
+ VpProfilePtrType pRingProfile);
+#endif /* VP_CC_INIT_SLAC */
+
+#ifdef VP_CC_INIT_LINE
+typedef VpStatusType
+(*VpInitLineFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcFeedOrFxoCfgProfile,
+ VpProfilePtrType pRingProfile);
+#endif /* VP_CC_INIT_LINE */
+
+#ifdef VP_CC_CONFIG_LINE
+typedef VpStatusType
+(*VpConfigLineFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcFeedOrFxoCfgProfile,
+ VpProfilePtrType pRingProfile);
+#endif /* VP_CC_CONFIG_LINE */
+
+#ifdef VP_CC_SET_B_FILTER
+typedef VpStatusType
+(*VpSetBFilterFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpBFilterModeType bFiltMode,
+ VpProfilePtrType pAcProfile);
+#endif /* VP_CC_SET_B_FILTER */
+
+#ifdef VP_CC_SET_BATTERIES
+typedef VpStatusType
+(*VpSetBatteriesFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpBatteryModeType battMode,
+ VpBatteryValuesType *pBatt);
+#endif /* VP_CC_SET_BATTERIES */
+
+#ifdef VP_CC_CAL_CODEC
+typedef VpStatusType
+(*VpCalCodecFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpDeviceCalType mode);
+#endif /* VP_CC_CAL_CODEC */
+
+#ifdef VP_CC_CAL_LINE
+typedef VpStatusType
+(*VpCalLineFuncPtrType) (
+ struct VpLineCtxType *pLineCtx);
+#endif /* VP_CC_CAL_LINE */
+
+#ifdef VP_CC_CAL
+typedef VpStatusType
+(*VpCalFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpCalType calType,
+ void *inputArgs);
+#endif /* VP_CC_CAL */
+
+#ifdef VP_CC_INIT_RING
+typedef VpStatusType
+(*VpInitRingFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpProfilePtrType pCadProfile,
+ VpProfilePtrType pCidProfile);
+#endif /* VP_CC_INIT_RING */
+
+#ifdef VP_CC_INIT_CID
+typedef VpStatusType
+(*VpInitCidFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint8 length,
+ uint8p pCidData);
+#endif /* VP_CC_INIT_CID */
+
+#ifdef VP_CC_INIT_METER
+typedef VpStatusType
+(*VpInitMeterFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpProfilePtrType pMeterProfile);
+#endif /* VP_CC_INIT_METER */
+
+#ifdef VP_CC_INIT_CUSTOM_TERM
+typedef VpStatusType
+(*VpInitCustomTermTypeFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ struct VpLineCtxType *pLineCtx,
+ VpProfilePtrType pCustomTermProfile);
+#endif /* VP_CC_INIT_CUSTOM_TERM */
+
+#ifdef VP_CC_INIT_PROFILE
+typedef VpStatusType
+(*VpInitProfileFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpProfileType type,
+ VpProfilePtrType pProfileIndex,
+ VpProfilePtrType pProfile);
+#endif /* VP_CC_INIT_PROFILE */
+
+#ifdef VP_CC_SOFT_RESET
+typedef VpStatusType
+(*VpSoftResetFuncPtrType) (
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_SOFT_RESET */
+
+/*
+ * Control functions
+ */
+#ifdef VP_CC_SET_LINE_STATE
+typedef VpStatusType
+(*VpSetLineStateFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpLineStateType state);
+#endif /* VP_CC_SET_LINE_STATE */
+
+#ifdef VP_CC_SET_LINE_TONE
+typedef VpStatusType
+(*VpSetLineToneFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpProfilePtrType pToneProfile,
+ VpProfilePtrType pCadProfile,
+ VpDtmfToneGenType *pDtmfControl);
+#endif /* VP_CC_SET_LINE_TONE */
+
+#ifdef VP_CC_SET_RELAY_STATE
+typedef VpStatusType
+(*VpSetRelayStateFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpRelayControlType rState);
+#endif /* VP_CC_SET_RELAY_STATE */
+
+#ifdef VP_CC_SET_CAL_RELAY_STATE
+typedef VpStatusType
+(*VpSetCalRelayStateFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpCalRelayControlType rState);
+#endif /* VP_CC_SET_CAL_RELAY_STATE */
+
+#ifdef VP_CC_SET_REL_GAIN
+typedef VpStatusType
+(*VpSetRelGainFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint16 txLevel,
+ uint16 rxLevel,
+ uint16 handle);
+#endif /* VP_CC_SET_REL_GAIN */
+
+#ifdef VP_CC_SEND_SIGNAL
+typedef VpStatusType
+(*VpSendSignalFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpSendSignalType signalType,
+ void *pSignalData);
+#endif /* VP_CC_SEND_SIGNAL */
+
+#ifdef VP_CC_SEND_CID
+typedef VpStatusType
+(*VpSendCidFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint8 length,
+ VpProfilePtrType pCidProfile,
+ uint8p pCidData);
+#endif /* VP_CC_SEND_CID */
+
+#ifdef VP_CC_CONTINUE_CID
+typedef VpStatusType
+(*VpContinueCidFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint8 length,
+ uint8p pCidData);
+#endif /* VP_CC_CONTINUE_CID */
+
+#ifdef VP_CC_START_METER
+typedef VpStatusType
+(*VpStartMeterFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint16 onTime,
+ uint16 offTime,
+ uint16 numMeters);
+#endif /* VP_CC_START_METER */
+
+#ifdef VP_CC_GEN_TIMER_CTRL
+typedef VpStatusType
+(*VpGenTimerCtrlFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpGenTimerCtrlType timerCtrl,
+ uint32 duration,
+ uint16 handle);
+#endif /* VP_CC_GEN_TIMER_CTRL */
+
+#ifdef VP_CC_START_METER_32Q
+typedef VpStatusType
+(*VpStartMeter32QFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint32 minDelay,
+ uint32 onTime,
+ uint32 offTime,
+ uint16 numMeters,
+ uint16 eventRate);
+#endif /* VP_CC_START_METER_32Q */
+
+#ifdef VP_CC_ASSOC_DSL_LINE
+typedef VpStatusType
+(*VpAssocDslLineFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ bool connect,
+ uint8 line);
+#endif /* VP_CC_ASSOC_DSL_LINE */
+
+#ifdef VP_CC_SET_SEAL_CUR
+typedef VpStatusType
+(*VpSetSealCurFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ uint16 sealApplyTime,
+ uint16 sealCycleTime,
+ uint16 maxCurrent,
+ uint16 minCurrent,
+ uint16 *pSealArray,
+ uint16 batteryOffset);
+#endif /* VP_CC_SET_SEAL_CUR */
+
+#ifdef VP_CC_SEAL_CUR_CTRL
+typedef VpStatusType
+(*VpSealCurCtrlFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpSealCurCtrlType ctrl);
+#endif /* VP_CC_SEAL_CUR_CTRL */
+
+#ifdef VP_CC_SET_OPTION
+typedef VpStatusType
+(*VpSetOptionFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ struct VpDevCtxType *pDevCtx,
+ VpOptionIdType option,
+ void *pValue);
+#endif /* VP_CC_SET_OPTION */
+
+#ifdef VP_CC_DEVICE_IO_ACCESS
+typedef VpStatusType
+(*VpDeviceIoAccessFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpDeviceIoAccessDataType *pDeviceIoData);
+#endif /* VP_CC_DEVICE_IO_ACCESS */
+
+#ifdef VP_CC_DEVICE_IO_ACCESS_EXT
+typedef VpStatusType
+(*VpDeviceIoAccessExtFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpDeviceIoAccessExtType *pDeviceIoAccess);
+#endif /* VP_CC_DEVICE_IO_ACCESS_EXT */
+
+#ifdef VP_CC_LINE_IO_ACCESS
+typedef VpStatusType
+(*VpLineIoAccessFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpLineIoAccessType *pLineIoAccess,
+ uint16 handle);
+#endif /* VP_CC_LINE_IO_ACCESS */
+
+#ifdef VP_CC_VIRTUAL_ISR
+typedef VpStatusType
+(*VpVirtualISRFuncPtrType) (
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_VIRTUAL_ISR */
+
+#ifdef VP_CC_API_TICK
+typedef VpStatusType
+(*VpApiTickFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ bool *pEventStatus);
+#endif /* VP_CC_API_TICK */
+
+#ifdef VP_CC_FREE_RUN
+typedef VpStatusType
+(*VpFreeRunFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpFreeRunModeType freeRunMode);
+#endif /* VP_CC_FREE_RUN */
+
+#ifdef VP_CC_BATTERY_BACKUP_MODE
+typedef VpStatusType
+(*VpBatteryBackupModeFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpBatteryBackupModeType backupMode,
+ uint8 vsw);
+#endif /* VP_CC_BATTERY_BACKUP_MODE */
+
+#ifdef VP_CC_SHUTDOWN_DEVICE
+typedef VpStatusType
+(*VpShutdownDeviceFuncPtrType) (
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_SHUTDOWN_DEVICE */
+
+#ifdef VP_CC_LOW_LEVEL_CMD
+typedef VpStatusType
+(*VpLowLevelCmdFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint8 *pCmdData,
+ uint8 len,
+ uint16 handle);
+#endif /* VP_CC_LOW_LEVEL_CMD */
+
+#ifdef VP_CC_LOW_LEVEL_CMD_16
+typedef VpStatusType
+(*VpLowLevelCmd16FuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpLowLevelCmdType cmdType,
+ uint16 *writeWords,
+ uint8 numWriteWords,
+ uint8 numReadWords,
+ uint16 handle);
+#endif /* VP_CC_LOW_LEVEL_CMD_16 */
+
+/*
+ * Status and query functions
+ */
+#ifdef VP_CC_GET_EVENT
+typedef bool
+(*VpGetEventFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ struct VpEventType *pEvent);
+#endif /* VP_CC_GET_EVENT */
+
+#ifdef VP_CC_GET_LINE_STATUS
+typedef VpStatusType
+(*VpGetLineStatusFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpInputType input,
+ bool *pStatus);
+#endif /* VP_CC_GET_LINE_STATUS */
+
+#ifdef VP_CC_GET_DEVICE_STATUS
+typedef VpStatusType
+(*VpGetDeviceStatusFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpInputType input,
+ uint32 *pDeviceStatus);
+#endif /* VP_CC_GET_DEVICE_STATUS */
+
+#ifdef VP_CC_GET_DEVICE_STATUS_EXT
+typedef VpStatusType
+(*VpGetDeviceStatusExtFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ VpDeviceStatusType *pDeviceStatus);
+#endif /* VP_CC_GET_DEVICE_STATUS_EXT */
+
+#ifdef VP_CC_GET_DEVICE_INFO
+typedef VpStatusType
+(*VpGetDeviceInfoFuncPtrType) (
+ struct VpDeviceInfoType *pDeviceInfo);
+#endif /* VP_CC_GET_DEVICE_INFO */
+
+#ifdef VP_CC_GET_LOOP_COND
+typedef VpStatusType
+(*VpGetLoopCondFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint16 handle);
+#endif /* VP_CC_GET_LOOP_COND */
+
+#ifdef VP_CC_GET_OPTION
+typedef VpStatusType
+(*VpGetOptionFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ struct VpDevCtxType *pDevCtx,
+ VpOptionIdType option,
+ uint16 handle);
+#endif /* VP_CC_GET_OPTION */
+
+#ifdef VP_CC_GET_OPTION_IMMEDIATE
+typedef VpStatusType
+(*VpGetOptionImmediateFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ struct VpDevCtxType *pDevCtx,
+ VpOptionIdType option,
+ void *pResults);
+#endif /* VP_CC_GET_OPTION_IMMEDIATE */
+
+#ifdef VP_CC_GET_LINE_STATE
+typedef VpStatusType
+(*VpGetLineStateFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpLineStateType *pCurrentState);
+#endif /* VP_CC_GET_LINE_STATE */
+
+#ifdef VP_CC_FLUSH_EVENTS
+typedef VpStatusType
+(*VpFlushEventsFuncPtrType) (
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_FLUSH_EVENTS */
+
+#ifdef VP_CC_GET_RESULTS
+typedef VpStatusType
+(*VpGetResultsFuncPtrType) (
+ struct VpEventType *pEvent,
+ void *pResults);
+#endif /* VP_CC_GET_RESULTS */
+
+#ifdef VP_CC_CLEAR_RESULTS
+typedef VpStatusType
+(*VpClearResultsFuncPtrType) (
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_CLEAR_RESULTS */
+
+#ifdef VP_CC_GET_RELAY_STATE
+typedef VpStatusType
+(*VpGetRelayStateFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpRelayControlType *pRstate);
+#endif /* VP_CC_GET_RELAY_STATE */
+
+#ifdef VP_CC_OBJECT_DUMP
+typedef VpStatusType
+(*VpObjectDumpFuncPtrType)(
+ struct VpLineCtxType *pLineCtx,
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_OBJECT_DUMP */
+
+#ifdef VP_CC_REGISTER_DUMP
+typedef VpStatusType
+(*VpRegisterDumpFuncPtrType)(
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_REGISTER_DUMP */
+
+#ifdef VP_CC_DTMF_DIGIT_DETECTED
+typedef VpStatusType
+(*VpDtmfDigitDetectedFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpDigitType digit,
+ VpDigitSenseType sense);
+#endif
+
+#ifdef VP_CC_QUERY
+
+typedef VpStatusType
+(*VpQueryFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpQueryIdType queryId,
+ uint16 handle);
+#endif /* VP_CC_QUERY */
+
+#ifdef VP_CC_QUERY_IMMEDIATE
+typedef VpStatusType
+(*VpQueryImmediateFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpQueryIdType queryId,
+ void *pResults);
+#endif /* VP_CC_QUERY_IMMEDIATE */
+
+/*
+ * Test Functions
+ */
+#ifdef VP_CC_TEST_LINE
+typedef VpStatusType
+(*VpTestLineFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpTestIdType test,
+ const void *pArgs,
+ uint16 handle);
+#endif /* VP_CC_TEST_LINE */
+
+#ifdef VP_CC_TEST_LINE_INT
+typedef VpStatusType
+(*VpTestLineIntFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ VpTestIdType test,
+ const void *pArgs,
+ uint16 handle,
+ bool callback);
+#endif /* VP_CC_TEST_LINE_INT */
+
+#ifdef VP_CC_TEST_LINE_CALLBACK
+typedef VpStatusType
+(*VpTestLineCallbackType) (
+ struct VpLineCtxType *pLineCtx,
+ VpPcmOperationResultsType *pResults);
+#endif /* VP_CC_TEST_LINE_CALLBACK */
+
+#ifdef VP_CC_CODE_CHECKSUM
+typedef VpStatusType
+(*VpCodeCheckSumFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ uint16 handle);
+#endif /* VP_CC_CODE_CHECKSUM */
+
+#ifdef VP_CC_SELF_TEST
+typedef VpStatusType
+(*VpSelfTestFuncPtrType) (
+ struct VpLineCtxType *pLineCtx);
+#endif /* VP_CC_SELF_TEST */
+
+#ifdef VP_CC_FILL_TEST_BUF
+typedef VpStatusType
+(*VpFillTestBufFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint16 length,
+ VpVectorPtrType pData);
+#endif /* VP_CC_FILL_TEST_BUF */
+
+#ifdef VP_CC_READ_TEST_BUF
+typedef VpStatusType
+(*VpReadTestBufFuncPtrType) (
+ struct VpLineCtxType *pLineCtx,
+ uint16 length,
+ VpVectorPtrType pData);
+#endif /* VP_CC_READ_TEST_BUF */
+
+#ifdef VP_CC_SLAC_BUF_START
+typedef bool
+(*VpSlacBufStartFuncPtrType) (
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_SLAC_BUF_START */
+
+#ifdef VP_CC_SLAC_BUF_SEND
+typedef bool
+(*VpSlacBufSendFuncPtrType) (
+ struct VpDevCtxType *pDevCtx);
+#endif /* VP_CC_SLAC_BUF_SEND */
+
+#ifdef VP_CC_SLAC_REG_WRITE
+typedef bool
+(*VpSlacRegWriteFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ struct VpLineCtxType *pLineCtx,
+ uint8 cmd,
+ uint8 writeLen,
+ const uint8 *pWriteBuf);
+#endif /* VP_CC_SLAC_REG_WRITE */
+
+#ifdef VP_CC_SLAC_REG_READ
+typedef bool
+(*VpSlacRegReadFuncPtrType) (
+ struct VpDevCtxType *pDevCtx,
+ struct VpLineCtxType *pLineCtx,
+ uint8 cmd,
+ uint8 readLen,
+ uint8 *pReadBuf);
+#endif /* VP_CC_SLAC_REG_READ */
+
+
+/** ApiFunctionPointer Table to be used by Device Context */
+typedef struct ApiFunctions {
+ /* System Configuration Functions */
+ #ifdef VP_CC_MAKE_LINE_OBJECT
+ VpMakeLineObjectFuncPtrType MakeLineObject;
+ #endif
+
+ /* Initialization Functions */
+ #ifdef VP_CC_BOOT_LOAD
+ VpBootLoadFuncPtrType BootLoad;
+ #endif
+ #ifdef VP_CC_BOOT_SLAC
+ VpBootSlacFuncPtrType BootSlac;
+ #endif
+ #ifdef VP_CC_INIT_DEVICE
+ VpInitDeviceFuncPtrType InitDevice;
+ #endif
+ #ifdef VP_CC_INIT_SLAC
+ VpInitSlacFuncPtrType InitSlac;
+ #endif
+ #ifdef VP_CC_INIT_LINE
+ VpInitLineFuncPtrType InitLine;
+ #endif
+ #ifdef VP_CC_CONFIG_LINE
+ VpConfigLineFuncPtrType ConfigLine;
+ #endif
+ #ifdef VP_CC_SET_B_FILTER
+ VpSetBFilterFuncPtrType SetBFilter;
+ #endif
+ #ifdef VP_CC_SET_BATTERIES
+ VpSetBatteriesFuncPtrType SetBatteries;
+ #endif
+ #ifdef VP_CC_CAL_CODEC
+ VpCalCodecFuncPtrType CalCodec;
+ #endif
+ #ifdef VP_CC_CAL_LINE
+ VpCalLineFuncPtrType CalLine;
+ #endif
+ #ifdef VP_CC_CAL
+ VpCalFuncPtrType Cal;
+ #endif
+ #ifdef VP_CC_INIT_RING
+ VpInitRingFuncPtrType InitRing;
+ #endif
+ #ifdef VP_CC_INIT_CID
+ VpInitCidFuncPtrType InitCid;
+ #endif
+ #ifdef VP_CC_INIT_METER
+ VpInitMeterFuncPtrType InitMeter;
+ #endif
+ #ifdef VP_CC_INIT_CUSTOM_TERM
+ VpInitCustomTermTypeFuncPtrType InitCustomTerm;
+ #endif
+ #ifdef VP_CC_INIT_PROFILE
+ VpInitProfileFuncPtrType InitProfile;
+ #endif
+ #ifdef VP_CC_SOFT_RESET
+ VpSoftResetFuncPtrType SoftReset;
+ #endif
+
+ /* Control Functions */
+ #ifdef VP_CC_SET_LINE_STATE
+ VpSetLineStateFuncPtrType SetLineState;
+ #endif
+ #ifdef VP_CC_SET_LINE_TONE
+ VpSetLineToneFuncPtrType SetLineTone;
+ #endif
+ #ifdef VP_CC_SET_RELAY_STATE
+ VpSetRelayStateFuncPtrType SetRelayState;
+ #endif
+ #ifdef VP_CC_SET_CAL_RELAY_STATE
+ VpSetCalRelayStateFuncPtrType SetCalRelayState;
+ #endif
+ #ifdef VP_CC_SET_REL_GAIN
+ VpSetRelGainFuncPtrType SetRelGain;
+ #endif
+ #ifdef VP_CC_SEND_SIGNAL
+ VpSendSignalFuncPtrType SendSignal;
+ #endif
+ #ifdef VP_CC_SEND_CID
+ VpSendCidFuncPtrType SendCid;
+ #endif
+ #ifdef VP_CC_CONTINUE_CID
+ VpContinueCidFuncPtrType ContinueCid;
+ #endif
+ #ifdef VP_CC_START_METER
+ VpStartMeterFuncPtrType StartMeter;
+ #endif
+ #ifdef VP_CC_GEN_TIMER_CTRL
+ VpGenTimerCtrlFuncPtrType GenTimerCtrl;
+ #endif
+ #ifdef VP_CC_START_METER_32Q
+ VpStartMeter32QFuncPtrType StartMeter32Q;
+ #endif
+ #ifdef VP_CC_ASSOC_DSL_LINE
+ VpAssocDslLineFuncPtrType AssocDslLine;
+ #endif
+ #ifdef VP_CC_SET_SEAL_CUR
+ VpSetSealCurFuncPtrType SetSealCur;
+ #endif
+ #ifdef VP_CC_SEAL_CUR_CTRL
+ VpSealCurCtrlFuncPtrType SealCurCtrl;
+ #endif
+ #ifdef VP_CC_SET_OPTION
+ VpSetOptionFuncPtrType SetOption;
+ #endif
+ #ifdef VP_CC_DEVICE_IO_ACCESS
+ VpDeviceIoAccessFuncPtrType DeviceIoAccess;
+ #endif
+ #ifdef VP_CC_DEVICE_IO_ACCESS_EXT
+ VpDeviceIoAccessExtFuncPtrType DeviceIoAccessExt;
+ #endif
+ #ifdef VP_CC_LINE_IO_ACCESS
+ VpLineIoAccessFuncPtrType LineIoAccess;
+ #endif
+ #ifdef VP_CC_VIRTUAL_ISR
+ VpVirtualISRFuncPtrType VirtualISR;
+ #endif
+ #ifdef VP_CC_API_TICK
+ VpApiTickFuncPtrType ApiTick;
+ #endif
+ #ifdef VP_CC_FREE_RUN
+ VpFreeRunFuncPtrType FreeRun;
+ #endif
+ #ifdef VP_CC_BATTERY_BACKUP_MODE
+ VpBatteryBackupModeFuncPtrType BatteryBackupMode;
+ #endif
+ #ifdef VP_CC_SHUTDOWN_DEVICE
+ VpShutdownDeviceFuncPtrType ShutdownDevice;
+ #endif
+ #ifdef VP_CC_LOW_LEVEL_CMD
+ VpLowLevelCmdFuncPtrType LowLevelCmd;
+ #endif
+ #ifdef VP_CC_LOW_LEVEL_CMD_16
+ VpLowLevelCmd16FuncPtrType LowLevelCmd16;
+ #endif
+
+
+ /* Status and Query Functions */
+ /* -- Status and Query Functions common to all devices and VP-API-II configuration modes */
+ #ifdef VP_CC_GET_EVENT
+ VpGetEventFuncPtrType GetEvent;
+ #endif
+ #ifdef VP_CC_GET_LINE_STATUS
+ VpGetLineStatusFuncPtrType GetLineStatus;
+ #endif
+ #ifdef VP_CC_GET_DEVICE_STATUS
+ VpGetDeviceStatusFuncPtrType GetDeviceStatus;
+ #endif
+ #ifdef VP_CC_GET_DEVICE_STATUS_EXT
+ VpGetDeviceStatusExtFuncPtrType GetDeviceStatusExt;
+ #endif
+ #ifdef VP_CC_GET_DEVICE_INFO
+ VpGetDeviceInfoFuncPtrType GetDeviceInfo;
+ #endif
+ #ifdef VP_CC_GET_LOOP_COND
+ VpGetLoopCondFuncPtrType GetLoopCond;
+ #endif
+ #ifdef VP_CC_GET_OPTION
+ VpGetOptionFuncPtrType GetOption;
+ #endif
+ #ifdef VP_CC_GET_OPTION_IMMEDIATE
+ VpGetOptionImmediateFuncPtrType GetOptionImmediate;
+ #endif
+ #ifdef VP_CC_GET_LINE_STATE
+ VpGetLineStateFuncPtrType GetLineState;
+ #endif
+ #ifdef VP_CC_FLUSH_EVENTS
+ VpFlushEventsFuncPtrType FlushEvents;
+ #endif
+ #ifdef VP_CC_GET_RESULTS
+ VpGetResultsFuncPtrType GetResults;
+ #endif
+ #ifdef VP_CC_CLEAR_RESULTS
+ VpClearResultsFuncPtrType ClearResults;
+ #endif
+ #ifdef VP_CC_GET_RELAY_STATE
+ VpGetRelayStateFuncPtrType GetRelayState;
+ #endif
+ #ifdef VP_CC_DTMF_DIGIT_DETECTED
+ VpDtmfDigitDetectedFuncPtrType DtmfDigitDetected;
+ #endif
+ #ifdef VP_CC_QUERY
+ VpQueryFuncPtrType Query;
+ #endif
+ #ifdef VP_CC_QUERY_IMMEDIATE
+ VpQueryImmediateFuncPtrType QueryImmediate;
+ #endif
+
+ /* Test Functions */
+ #ifdef VP_CC_TEST_LINE
+ VpTestLineFuncPtrType TestLine;
+ #endif
+ #ifdef VP_CC_TEST_LINE_INT
+ VpTestLineIntFuncPtrType TestLineInt;
+ #endif
+ #ifdef VP_CC_TEST_LINE_CALLBACK
+ VpTestLineCallbackType TestLineCallback;
+ #endif
+ #ifdef VP_CC_CODE_CHECKSUM
+ VpCodeCheckSumFuncPtrType CodeCheckSum;
+ #endif
+ #ifdef VP_CC_SELF_TEST
+ VpSelfTestFuncPtrType SelfTest;
+ #endif
+ #ifdef VP_CC_FILL_TEST_BUF
+ VpFillTestBufFuncPtrType FillTestBuf;
+ #endif
+ #ifdef VP_CC_READ_TEST_BUF
+ VpReadTestBufFuncPtrType ReadTestBuf;
+ #endif
+
+ /* Debug Functions */
+ #ifdef VP_CC_REGISTER_DUMP
+ VpRegisterDumpFuncPtrType RegisterDump;
+ #endif
+ #ifdef VP_CC_OBJECT_DUMP
+ VpObjectDumpFuncPtrType ObjectDump;
+ #endif
+
+ /* Internal HAL Wrapper Functions */
+ #ifdef VP_CC_SLAC_BUF_START
+ VpSlacBufStartFuncPtrType SlacBufStart;
+ #endif
+ #ifdef VP_CC_SLAC_BUF_SEND
+ VpSlacBufSendFuncPtrType SlacBufSend;
+ #endif
+ #ifdef VP_CC_SLAC_REG_WRITE
+ VpSlacRegWriteFuncPtrType SlacRegWrite;
+ #endif
+ #ifdef VP_CC_SLAC_REG_READ
+ VpSlacRegReadFuncPtrType SlacRegRead;
+ #endif
+} ApiFunctions;
+
+/******************************************************************************
+ * DEVICE/LINE CONTEXT DEFINITION *
+ ******************************************************************************/
+/** Voice Path Line Context type */
+typedef struct VpLineCtxType {
+ struct VpDevCtxType *pDevCtx; /**< Pointer back Device Context */
+
+ void *pLineObj; /**< Pointer (forward) to Line Object */
+} VpLineCtxType;
+
+/** Voice Path Device Context type */
+typedef struct VpDevCtxType {
+ VpDeviceType deviceType; /**< What type is the device context (enum) */
+ void *pDevObj; /**< Pointer to device object */
+
+ ApiFunctions funPtrsToApiFuncs; /**< Pointers to API functions */
+
+ /**< Pointers to each line context associated with this device. Set size
+ * to max allowable per device in system
+ */
+ VpLineCtxType *pLineCtx[VP_MAX_LINES_PER_DEVICE];
+} VpDevCtxType;
+
+/******************************************************************************
+ * VP-API-II Definitions that use context *
+ ******************************************************************************/
+/** Event struct: Type reported by VpGetEvent(). */
+typedef struct VpEventType {
+ VpStatusType status; /**< Function return status */
+
+ uint8 channelId; /**< Channel that caused the event */
+
+ VpLineCtxType *pLineCtx; /**< Pointer to the line context (corresponding
+ * to the channel that caused the event) */
+
+ VpDeviceIdType deviceId; /**< device chip select ID corresponding to the
+ * device that caused the event */
+
+ VpDevCtxType *pDevCtx; /**< Pointer to the device context
+ * (corresponding to the device that caused
+ * the event) */
+
+ VpEventCategoryType eventCategory; /**< Event category. The event catagory
+ * is necessary because there are more
+ * events than can be specified by the
+ * size of "eventId */
+
+ uint16 eventId; /**< The event that occurred. Requires that the event
+ * catagory be known to interpret */
+
+ uint16 parmHandle; /**< EventÂ’s Parameter or Host Handle. This value is
+ * specified by the application only, not used by the
+ * API */
+
+ uint16 eventData; /**< Data associated with the event. Event Id specific*/
+
+ bool hasResults; /**< If TRUE indicates this event has results associated
+ * with it */
+
+ VpLineIdType lineId; /**< Application provide line Id to ease mapping of
+ * lines to specific line contexts.
+ */
+} VpEventType;
+
+/**< The following types are for VpGetDeviceInfo() and VpGetLineInfo()
+ * functions */
+
+typedef enum VpFeatureType {
+ VP_UNKNOWN,
+ VP_AVAILABLE,
+ VP_NOT_AVAILABLE
+} VpFeatureType;
+
+typedef struct VpFeatureListType {
+ VpFeatureType testLoadSwitch;
+ VpFeatureType internalTestTermination;
+} VpFeatureListType;
+
+typedef struct VpDeviceInfoType {
+ VpLineCtxType *pLineCtx; /* Pointer to Line Context */
+ VpDeviceIdType deviceId; /* Device identity */
+ VpDevCtxType *pDevCtx; /* Pointer to device Context */
+ VpDeviceType deviceType; /* Device Type */
+ VpFeatureListType featureList; /* Store the device features */
+ uint8 numLines; /* Number of lines */
+ uint8 revCode; /* Revision Code Number */
+ uint8 slacId; /* Unique ID associated with Device identity */
+ uint16 productCode; /* Number indicating features of the device.*/
+ uint32 intProductCode; /* Internal product code */
+} VpDeviceInfoType;
+
+typedef struct VpLineInfoType {
+ VpDevCtxType *pDevCtx; /* Pointer to device Context */
+ uint8 channelId; /* Channel identity */
+ VpLineCtxType *pLineCtx; /* Pointer to Line Context */
+ VpTermType termType; /* Termination Type */
+ VpLineIdType lineId; /* Application system wide line identifier */
+} VpLineInfoType;
+
+/******************************************************************************
+ * VP-API-II FUNCTION PROTOTYPES *
+ ******************************************************************************/
+/*
+ * System configuration functions
+ */
+EXTERN VpStatusType
+VpMakeDeviceObject(
+ VpDeviceType deviceType,
+ VpDeviceIdType deviceId,
+ VpDevCtxType *pDevCtx,
+ void *pDevObj);
+
+EXTERN VpStatusType
+VpMakeDeviceCtx(
+ VpDeviceType deviceType,
+ VpDevCtxType *pDevCtx,
+ void *pDevObj);
+
+EXTERN VpStatusType
+VpMakeLineObject(
+ VpTermType termType,
+ uint8 channelId,
+ VpLineCtxType *pLineCtx,
+ void *pLineObj,
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpMakeLineCtx(
+ VpLineCtxType *pLineCtx,
+ void *pLineObj,
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpFreeLineCtx(
+ VpLineCtxType *pLineCtx);
+
+EXTERN VpStatusType
+VpGetDeviceInfo(
+ VpDeviceInfoType *pDeviceInfo);
+
+EXTERN VpStatusType
+VpGetLineInfo(
+ VpLineInfoType *pLineInfo);
+
+/*
+ * Initialization functions
+ */
+EXTERN VpStatusType
+VpBootLoad(
+ VpDevCtxType *pDevCtx,
+ VpBootStateType state,
+ VpImagePtrType pImageBuffer,
+ uint32 bufferSize,
+ VpScratchMemType *pScratchMem,
+ VpBootModeType validation);
+
+EXTERN VpStatusType
+VpBootSlac(
+ VpLineCtxType *pLineCtx,
+ VpImagePtrType pImageBuffer,
+ uint32 bufferSize);
+
+EXTERN VpStatusType
+VpInitDevice(
+ VpDevCtxType *pDevCtx,
+ VpProfilePtrType pDevProfile,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcProfile,
+ VpProfilePtrType pRingProfile,
+ VpProfilePtrType pFxoAcProfile,
+ VpProfilePtrType pFxoCfgProfile);
+
+EXTERN VpStatusType
+VpInitSlac(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pDevProfile,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcProfile,
+ VpProfilePtrType pRingProfile);
+
+EXTERN VpStatusType
+VpInitLine(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcFeedOrFxoCfgProfile,
+ VpProfilePtrType pRingProfile);
+
+EXTERN VpStatusType
+VpConfigLine(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pAcProfile,
+ VpProfilePtrType pDcFeedOrFxoCfgProfile,
+ VpProfilePtrType pRingProfile);
+
+EXTERN VpStatusType
+VpCalCodec(
+ VpLineCtxType *pLineCtx,
+ VpDeviceCalType mode);
+
+EXTERN VpStatusType
+VpCalLine(
+ VpLineCtxType *pLineCtx);
+
+EXTERN VpStatusType
+VpCal(
+ VpLineCtxType *pLineCtx,
+ VpCalType calType,
+ void *inputArgs);
+
+EXTERN VpStatusType
+VpInitRing(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pCadProfile,
+ VpProfilePtrType pCidProfile);
+
+EXTERN VpStatusType
+VpInitCid(
+ VpLineCtxType *pLineCtx,
+ uint8 length,
+ uint8p pCidData);
+
+EXTERN VpStatusType
+VpInitMeter(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pMeterProfile);
+
+EXTERN VpStatusType
+VpInitCustomTermType (
+ VpDevCtxType *pDevCtx,
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pCustomTermProfile);
+
+EXTERN VpStatusType
+VpInitProfile(
+ VpDevCtxType *pDevCtx,
+ VpProfileType type,
+ VpProfilePtrType pProfileIndex,
+ VpProfilePtrType pProfile);
+
+EXTERN VpStatusType
+VpSoftReset(
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpSetBatteries(
+ VpLineCtxType *pLineCtx,
+ VpBatteryModeType battMode,
+ VpBatteryValuesType *pBatt);
+
+EXTERN VpStatusType
+VpSetBFilter(
+ VpLineCtxType *pLineCtx,
+ VpBFilterModeType bFiltMode,
+ VpProfilePtrType pAcProfile);
+
+/*
+ * Control functions
+ */
+EXTERN VpStatusType
+VpSetLineState(
+ VpLineCtxType *pLineCtx,
+ VpLineStateType state);
+
+EXTERN VpStatusType
+VpSetLineTone(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pToneProfile,
+ VpProfilePtrType pCadProfile,
+ VpDtmfToneGenType *pDtmfControl);
+
+EXTERN VpStatusType
+VpSetRelayState(
+ VpLineCtxType *pLineCtx,
+ VpRelayControlType rState);
+
+EXTERN VpStatusType
+VpSetCalRelayState(
+ VpDevCtxType *pDevCtx,
+ VpCalRelayControlType rState);
+
+EXTERN VpStatusType
+VpSetRelGain(
+ VpLineCtxType *pLineCtx,
+ uint16 txLevel,
+ uint16 rxLevel,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpSendSignal(
+ VpLineCtxType *pLineCtx,
+ VpSendSignalType signalType,
+ void *pSignalData);
+
+EXTERN VpStatusType
+VpSendCid(
+ VpLineCtxType *pLineCtx,
+ uint8 length,
+ VpProfilePtrType pCidProfile,
+ uint8p pCidData);
+
+EXTERN VpStatusType
+VpContinueCid(
+ VpLineCtxType *pLineCtx,
+ uint8 length,
+ uint8p pCidData);
+
+EXTERN VpStatusType
+VpStartMeter(
+ VpLineCtxType *pLineCtx,
+ uint16 onTime,
+ uint16 offTime,
+ uint16 numMeters);
+
+EXTERN VpStatusType
+VpStartMeter32Q(
+ VpLineCtxType *pLineCtx,
+ uint32 minDelay,
+ uint32 onTime,
+ uint32 offTime,
+ uint16 numMeters,
+ uint16 eventRate);
+
+EXTERN VpStatusType
+VpAssocDslLine(
+ VpLineCtxType *pLineCtx,
+ bool connect,
+ uint8 line);
+
+EXTERN VpStatusType
+VpSetSealCur(
+ VpDevCtxType *pDevCtx,
+ uint16 sealApplyTime,
+ uint16 sealCycleTime,
+ uint16 maxCurrent,
+ uint16 minCurrent,
+ uint16 *pSealArray,
+ uint16 batteryOffset);
+
+EXTERN VpStatusType
+VpSealCurCtrl(
+ VpDevCtxType *pDevCtx,
+ VpSealCurCtrlType ctrl);
+
+#define VpStartMeter32(pLineCtx, minDelay, onTime, offTime, numMeters) \
+ VpStartMeter32Q(pLineCtx, minDelay, onTime, offTime, numMeters, 1)
+
+EXTERN VpStatusType
+VpSetOption(
+ VpLineCtxType *pLineCtx,
+ VpDevCtxType *pDevCtx,
+ VpOptionIdType option,
+ void *pValue);
+
+EXTERN VpStatusType
+VpDeviceIoAccess(
+ VpDevCtxType *pDevCtx,
+ VpDeviceIoAccessDataType *pDeviceIoData);
+
+VpStatusType
+VpDeviceIoAccessExt(
+ VpDevCtxType *pDevCtx,
+ VpDeviceIoAccessExtType *pDeviceIoAccess);
+
+EXTERN VpStatusType
+VpLineIoAccess(
+ VpLineCtxType *pLineCtx,
+ VpLineIoAccessType *pLineIoAccess,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpVirtualISR(
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpApiTick(
+ VpDevCtxType *pDevCtx,
+ bool *pEventStatus);
+
+EXTERN VpStatusType
+VpLowLevelCmd(
+ VpLineCtxType *pLineCtx,
+ uint8 *pCmdData,
+ uint8 len,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpLowLevelCmd16(
+ VpLineCtxType *pLineCtx,
+ VpLowLevelCmdType cmdType,
+ uint16 *writeWords,
+ uint8 numWriteWords,
+ uint8 numReadWords,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpGenTimerCtrl(
+ VpLineCtxType *pLineCtx,
+ VpGenTimerCtrlType timerCtrl,
+ uint32 duration,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpFreeRun(
+ VpDevCtxType *pDevCtx,
+ VpFreeRunModeType freeRunMode);
+
+EXTERN VpStatusType
+VpBatteryBackupMode(
+ VpDevCtxType *pDevCtx,
+ VpBatteryBackupModeType backupMode,
+ uint8 vsw);
+
+EXTERN VpStatusType
+VpShutdownDevice(
+ VpDevCtxType *pDevCtx);
+
+/*
+ * Status and query functions
+ */
+EXTERN bool
+VpGetEvent(
+ VpDevCtxType *pDevCtx,
+ VpEventType *pEvent);
+
+EXTERN VpStatusType
+VpGetLineStatus(
+ VpLineCtxType *pLineCtx,
+ VpInputType input,
+ bool *pStatus);
+
+EXTERN VpStatusType
+VpGetDeviceStatus(
+ VpDevCtxType *pDevCtx,
+ VpInputType input,
+ uint32 *pDeviceStatus);
+
+EXTERN VpStatusType
+VpGetDeviceStatusExt(
+ VpDevCtxType *pDevCtx,
+ VpDeviceStatusType *pDeviceStatus);
+
+EXTERN VpStatusType
+VpGetLoopCond(
+ VpLineCtxType *pLineCtx,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpGetOption(
+ VpLineCtxType *pLineCtx,
+ VpDevCtxType *pDevCtx,
+ VpOptionIdType option,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpGetOptionImmediate(
+ VpLineCtxType *pLineCtx,
+ VpDevCtxType *pDevCtxParam,
+ VpOptionIdType option,
+ void *pResults);
+
+EXTERN VpStatusType
+VpGetLineState(
+ VpLineCtxType *pLineCtx,
+ VpLineStateType *pCurrentState);
+
+EXTERN VpStatusType
+VpFlushEvents(
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpGetResults(
+ VpEventType *pEvent,
+ void *pResults);
+
+EXTERN VpStatusType
+VpClearResults(
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpObjectDump(
+ VpLineCtxType *pLineCtx,
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpRegisterDump(
+ VpDevCtxType *pDevCtx);
+
+EXTERN VpStatusType
+VpDtmfDigitDetected(
+ VpLineCtxType *pLineCtx,
+ VpDigitType digit,
+ VpDigitSenseType sense);
+
+EXTERN VpStatusType
+VpQuery(
+ VpLineCtxType *pLineCtx,
+ VpQueryIdType queryId,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpQueryImmediate(
+ VpLineCtxType *pLineCtx,
+ VpQueryIdType queryId,
+ void *pResults);
+
+EXTERN VpStatusType
+VpGetRelayState(
+ VpLineCtxType *pLineCtx,
+ VpRelayControlType *pRstate);
+
+/*
+ * Test Functions
+ */
+EXTERN VpStatusType
+VpTestLine(
+ VpLineCtxType *pLineCtx,
+ VpTestIdType test,
+ const void *pArgs,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpTestLineCallback(
+ VpLineCtxType *pLineCtx,
+ VpPcmOperationResultsType *pResults);
+
+EXTERN VpStatusType
+VpCodeCheckSum(
+ VpDevCtxType *pDevCtx,
+ uint16 handle);
+
+EXTERN VpStatusType
+VpSelfTest(
+ VpLineCtxType *pLineCtx);
+
+EXTERN VpStatusType
+VpFillTestBuf(
+ VpLineCtxType *pLineCtx,
+ uint16 length,
+ VpVectorPtrType pData);
+
+EXTERN VpStatusType
+VpReadTestBuf(
+ VpLineCtxType *pLineCtx,
+ uint16 length,
+ VpVectorPtrType pData);
+
+
+EXTERN VpStatusType
+VpMapLineId(
+ VpLineCtxType *pLineCtx,
+ VpLineIdType lineId);
+
+#if !defined(VP_REDUCED_API_IF) || defined(VP_CC_792_SERIES) || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP)
+EXTERN VpStatusType
+VpMapSlacId(
+ VpDevCtxType *pDevCtx,
+ uint8 slacId);
+#endif
+
+EXTERN bool
+VpMemCpyCheck(
+ uint8 *dest,
+ uint8 *src,
+ uint16 count);
+
+EXTERN void *
+VpMemCpy(
+ void *dest,
+ const void *src,
+ uint16 count);
+
+EXTERN void *
+VpMemSet(
+ void * s,
+ int c,
+ uint32 count);
+
+EXTERN VpStatusType
+VpTypesTest(void);
+
+/*
+ * Undocumented external functions:
+ */
+#if !defined(VP_REDUCED_API_IF) || defined(VP_CC_792_SERIES) || defined(VP_CC_VCP_SERIES) \
+ || defined(VP_CC_VCP2_SERIES) || defined(VP_CC_MELT_SERIES) \
+ || defined(VP_CC_KWRAP) || defined(VP_CC_MELT792_SERIES)
+EXTERN void
+VpSetCalFlag(
+ VpLineCtxType *pLineCtx,
+ bool value);
+
+EXTERN bool
+VpReadCalFlag(
+ VpLineCtxType *pLineCtx);
+
+EXTERN VpStatusType
+Vcp2HbiCheck(
+ VpDevCtxType *pDevCtx);
+#endif
+
+EXTERN void
+VpMpiCmdWrapper(
+ VpDeviceIdType deviceId,
+ uint8 ecVal,
+ uint8 mpiCmd,
+ uint8 mpiCmdLen,
+ uint8 *dataBuffer);
+
+EXTERN uint8
+VpCSLACBuildMpiBuffer(
+ uint8 index,
+ uint8 *mpiBuffer,
+ uint8 mpiCmd,
+ uint8 mpiCmdLen,
+ const uint8 *mpiData);
+
+EXTERN bool
+VpSlacBufStart(
+ VpDevCtxType *pDevCtx);
+
+EXTERN bool
+VpSlacBufSend(
+ VpDevCtxType *pDevCtx);
+
+EXTERN bool
+VpSlacRegWrite(
+ VpDevCtxType *pDevCtx,
+ VpLineCtxType *pLineCtx,
+ uint8 cmd,
+ uint8 writeLen,
+ const uint8 *pWriteBuf);
+
+EXTERN bool
+VpSlacRegRead(
+ VpDevCtxType *pDevCtx,
+ VpLineCtxType *pLineCtx,
+ uint8 cmd,
+ uint8 readLen,
+ uint8 *pReadBuf);
+
+#endif /* VP_API_COMMON_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_cslac_seq.h b/marvell/services/mislic/api_lib/includes/vp_api_cslac_seq.h
new file mode 100644
index 0000000..b43a300
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_cslac_seq.h
@@ -0,0 +1,111 @@
+/** \file vp_api_cslac_seq.h
+ * vp_api_cslac_seq.h
+ *
+ * Header file for the API-II c files.
+ *
+ * This file contains the all of the VoicePath API-II function prototypes
+ * required to run the CSLAC sequencer.
+ *
+ * $Revision: 12408 $
+ * $LastChangedDate: 2017-06-08 16:48:24 -0500 (Thu, 08 Jun 2017) $
+ */
+
+#ifndef VP_API_CSLAC_SEQ_H
+#define VP_API_CSLAC_SEQ_H
+
+#include "vp_CSLAC_types.h"
+
+#ifdef VP_CSLAC_SEQ_EN
+
+/*
+ * Converting from bool to enumeration. So make sure there exists a string that
+ * maps directly to previous "FALSE" value. Other strings can take on any valid
+ * enumeration value.
+ */
+typedef enum VpCliEncodedDataType {
+ VP_CLI_ENCODE_END = 0,
+ VP_CLI_ENCODE_DATA = 1,
+ VP_CLI_ENCODE_MARKOUT = 2
+} VpCliEncodedDataType;
+
+VpStatusType
+VpSeq(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pProfile);
+
+VpStatusType
+VpBranchInstruction(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pSeqData);
+
+VpStatusType
+VpTimeInstruction(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pSeqData);
+
+#if (defined (VP_CC_890_SERIES) && defined (VP890_FXS_SUPPORT)) || \
+ (defined (VP_CC_880_SERIES) && defined (VP880_FXS_SUPPORT))
+bool
+VpCSLACHowlerInit(
+ VpSeqDataType *cadence,
+ uint16 tickRate);
+
+uint16
+VpDecimalMultiply(
+ uint16 value,
+ uint16 byteMask);
+
+bool
+VpCSLACProcessRampGenerators(
+ VpSeqDataType *cadence);
+#endif
+
+bool
+VpServiceSeq(
+ VpDevCtxType *pDevCtx);
+
+void
+VpCSLACInitCidStruct(
+ VpCallerIdType *pCidStruct,
+ uint8 sequenceData);
+
+VpStatusType
+VpCidSeq(
+ VpLineCtxType *pLineCtx);
+
+void
+VpCliStopCli(
+ VpLineCtxType *pLineCtx);
+
+VpCliEncodedDataType
+VpCSLACCliGetEncodedByte(
+ uint8 *pByte,
+ VpCallerIdType *pCidStruct,
+ uint16 *pProcessData,
+ VpOptionEventMaskType *pLineEvents,
+ uint8 checkSumIndex);
+
+VpStatusType
+VpCSLACInitMeter(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pMeterProfile);
+
+VpStatusType
+VpCSLACStartMeter(
+ VpLineCtxType *pLineCtx,
+ uint16 onTime,
+ uint16 offTime,
+ uint16 numMeters);
+
+#if defined (VP_CC_880_SERIES)
+VpStatusType
+Vp880CommandInstruction(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pSeqData);
+#endif
+
+#endif
+
+#endif
+
+
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_dev_term.h b/marvell/services/mislic/api_lib/includes/vp_api_dev_term.h
new file mode 100644
index 0000000..622ab17
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_dev_term.h
@@ -0,0 +1,87 @@
+/** \file vp_api_dev_term.h
+ * vp_api_dev_term.h
+ *
+ * This file contains declaration for VP-API Device and termination types.
+ *
+ * $Revision: 11965 $
+ * $LastChangedDate: 2016-03-07 16:29:43 -0600 (Mon, 07 Mar 2016) $
+ */
+
+#ifndef VP_API_DEV_TERM_H
+#define VP_API_DEV_TERM_H
+
+/******************************************************************************
+ * ENUMERATIONS *
+ ******************************************************************************/
+/* Valid Device Types supported by VP-API-II. For the corresponding part numbers
+ * supported by each device type please see VP-API-II documentation.
+ */
+typedef enum VpDeviceType {
+ VP_DEV_RSRVD1 = 0,
+ VP_DEV_580_SERIES,
+ VP_DEV_790_SERIES,
+ VP_DEV_VCP_SERIES,
+ VP_DEV_880_SERIES = 4, /* Fixed value to match calibration profile */
+ VP_DEV_RSVD_SERIES,
+ VP_DEV_VCP2_SERIES,
+ VP_DEV_KWRAP,
+ VP_DEV_890_SERIES = 8, /* Fixed value to match calibration profile */
+ VP_DEV_792_SERIES,
+ VP_DEV_MELT_SERIES,
+ VP_DEV_792_GROUP,
+ VP_DEV_886_SERIES = 12,
+ VP_DEV_887_SERIES = 13,
+ VP_DEV_MELT792_SERIES = 14,
+ VP_NUM_DEV_TYPES,
+ VP_DEV_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDeviceType;
+
+/**
+ * Deprecated name (VCP) based on older name for VCP. All new applications
+ * should use VCP instead
+ */
+#define VP_DEV_DVP_SERIES VP_DEV_VCP_SERIES
+
+/** Valid Termination Types (per line) supported by API-II. See the VP-API-II
+ Reference Guide for descriptions. */
+typedef enum VpTermType {
+ /* FXS */
+ VP_TERM_FXS_GENERIC = 0x00, VP_TERM_FXS_FIRST = VP_TERM_FXS_GENERIC,
+ VP_TERM_FXS_ISOLATE = 0x01,
+ VP_TERM_FXS_TITO_TL_R = 0x02,
+ VP_TERM_FXS_CO_TL = 0x03,
+ VP_TERM_FXS_75181 = 0x04,
+ VP_TERM_FXS_75282 = 0x05,
+ VP_TERM_FXS_RDT = 0x06,
+ VP_TERM_FXS_RR = 0x07,
+ VP_TERM_FXS_SPLITTER = 0x08,
+ VP_TERM_FXS_TO_TL = 0x09,
+ VP_TERM_FXS_LOW_PWR = 0x0A,
+ VP_TERM_FXS_TI = 0x0B,
+ VP_TERM_FXS_SPLITTER_LP = 0x0C,
+ VP_TERM_FXS_ISOLATE_LP = 0x0D,
+ VP_TERM_FXS_LCAS = 0x0E,
+ VP_TERM_FXS_RR_TI = 0x0F,
+ VP_TERM_FXS_CUSTOM = 0x10,
+ VP_TERM_FXS_TL_MW = 0x11,
+ VP_TERM_FXS_RR_MW = 0x12, VP_TERM_FXS_LAST = VP_TERM_FXS_RR_MW,
+
+ /* MeLT */
+ VP_TERM_MELT_RELAY_CAL_CT = 0x40, VP_TERM_MELT_FIRST = VP_TERM_MELT_RELAY_CAL_CT,
+ VP_TERM_MELT_RELAY_CAL_SPLIT = 0x41,
+ VP_TERM_MELT_RELAY_CAL_BRIDGED = 0x42,
+ VP_TERM_MELT_LTAS_CT = 0x43,
+ VP_TERM_MELT_RELAY_CT = 0x44,
+ VP_TERM_MELT_RELAY_SPLIT = 0x45,
+ VP_TERM_MELT_RELAY_BRIDGED = 0x46,
+ VP_TERM_MELT_LTAS_BRIDGED = 0x47, VP_TERM_MELT_LAST = VP_TERM_MELT_LTAS_BRIDGED,
+
+ /* FXO */
+ VP_TERM_FXO_GENERIC = 0x80, VP_TERM_FXO_FIRST = VP_TERM_FXO_GENERIC,
+ VP_TERM_FXO_DISC = 0x81,
+ VP_TERM_FXO_CUSTOM = 0x82, VP_TERM_FXO_LAST = VP_TERM_FXO_CUSTOM,
+
+ VP_TERM_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpTermType;
+
+#endif /* VP_API_DEV_TERM_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_event.h b/marvell/services/mislic/api_lib/includes/vp_api_event.h
new file mode 100644
index 0000000..327cc43
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_event.h
@@ -0,0 +1,672 @@
+/** \file vp_api_event.h
+ * vp_api_event.h
+ *
+ * This file contains declaration associated with VP-API events.
+ *
+ * $Revision: 12587 $
+ * $LastChangedDate: 2018-06-21 17:22:20 -0500 (Thu, 21 Jun 2018) $
+ */
+
+#ifndef VP_API_EVENT_H
+#define VP_API_EVENT_H
+
+#include "vp_api_types.h"
+
+#define VP_EVENT_MASK_ALL 0xFFFF
+
+/* Event category type */
+typedef enum VpEventCategoryType {
+ VP_EVCAT_FAULT = 0,
+ VP_EVCAT_SIGNALING = 1,
+ VP_EVCAT_RESPONSE = 2,
+ VP_EVCAT_TEST = 3,
+ VP_EVCAT_PROCESS = 4,
+ VP_EVCAT_FXO = 5,
+ VP_EVCAT_PACKET = 6,
+ VP_NUM_EVCATS,
+ VP_EVCAT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpEventCategoryType;
+
+typedef struct VpOptionEventMaskType {
+ uint16 faults; /**< Fault event mask */
+ uint16 signaling; /**< Signaling event mask */
+ uint16 response; /**< Mailbox response event mask */
+ uint16 test; /**< Test events */
+ uint16 process; /**< Call process related events */
+ uint16 fxo; /**< FXO events mask */
+ uint16 packet; /**< Packet events mask - no longer used */
+} VpOptionEventMaskType;
+
+#ifdef STRICT_SIGNED_ENUM_VALUES
+typedef uint16 VpFaultEventType;
+#define VP_DEV_EVID_BAT_FLT (0x0001)
+#define VP_DEV_EVID_CLK_FLT (0x0002)
+#define VP_LINE_EVID_THERM_FLT (0x0004)
+#define VP_LINE_EVID_DC_FLT (0x0008)
+#define VP_LINE_EVID_AC_FLT (0x0010)
+#define VP_LINE_EVID_SYNC_FLT (0x0020)
+#define VP_LINE_EVID_RES_LEAK_FLT (0x0040)
+#define VP_LINE_EVID_SEAL_CUR_FLT (0x0080)
+#define VP_LINE_EVID_GND_FLT (0x0100)
+#define VP_DEV_EVID_WDT_FLT (0x2000)
+#define VP_DEV_EVID_EVQ_OFL_FLT (0x4000)
+#define VP_DEV_EVID_SYSTEM_FLT (0x8000)
+
+
+/* The following fault events are device-specific, not line-specific */
+#define VP_EVCAT_FAULT_DEV_EVENTS (VP_DEV_EVID_BAT_FLT | \
+ VP_DEV_EVID_CLK_FLT | \
+ VP_LINE_EVID_SYNC_FLT | \
+ VP_LINE_EVID_DC_FLT | \
+ VP_LINE_EVID_AC_FLT | \
+ VP_DEV_EVID_EVQ_OFL_FLT | \
+ VP_DEV_EVID_WDT_FLT | \
+ VP_DEV_EVID_SYSTEM_FLT)
+
+/* Remaining undefined events should be masked to protect against future changes */
+#define VP_EVCAT_FAULT_UNDEFINED (~(VP_DEV_EVID_BAT_FLT | \
+ VP_DEV_EVID_CLK_FLT | \
+ VP_LINE_EVID_THERM_FLT | \
+ VP_LINE_EVID_DC_FLT | \
+ VP_LINE_EVID_AC_FLT | \
+ VP_LINE_EVID_SYNC_FLT | \
+ VP_LINE_EVID_RES_LEAK_FLT | \
+ VP_LINE_EVID_SEAL_CUR_FLT | \
+ VP_LINE_EVID_GND_FLT | \
+ VP_DEV_EVID_WDT_FLT | \
+ VP_DEV_EVID_EVQ_OFL_FLT | \
+ VP_DEV_EVID_SYSTEM_FLT))
+
+#define VP_EVCAT_FAULT_UNMASK_ALL (VP_EVENT_MASK_ALL & VP_EVCAT_FAULT_UNDEFINED)
+#define VP_EVCAT_FAULT_MASK_ALL (~VP_EVCAT_FAULT_UNDEFINED)
+#else
+typedef enum VpFaultEventType {
+ VP_DEV_EVID_BAT_FLT = 0x0001, /**< Device detected battery fault */
+ VP_DEV_EVID_CLK_FLT = 0x0002, /**< Device detected clock fault */
+ VP_LINE_EVID_THERM_FLT = 0x0004, /**< Thermal Overload condition */
+ VP_LINE_EVID_DC_FLT = 0x0008, /**< DC Fault detected on line */
+ VP_LINE_EVID_AC_FLT = 0x0010, /**< AC Fault detected on line */
+ VP_LINE_EVID_SYNC_FLT = 0x0020, /**< SLAC Synchronization fault */
+ VP_LINE_EVID_RES_LEAK_FLT = 0x0040, /**< Low loop resistance while on-hook */
+ VP_LINE_EVID_SEAL_CUR_FLT = 0x0080, /**< Sealing current error */
+ VP_LINE_EVID_GND_FLT = 0x0100, /**< Ground fault */
+ VP_DEV_EVID_WDT_FLT = 0x2000, /**< Watchdog timer fault */
+ VP_DEV_EVID_EVQ_OFL_FLT = 0x4000, /**< event queue overflow fault */
+ VP_DEV_EVID_SYSTEM_FLT = 0x8000, /**< VCP2 system fault */
+ /* The following fault events are device-specific, not line-specific */
+ VP_EVCAT_FAULT_DEV_EVENTS = (int)(VP_DEV_EVID_BAT_FLT |
+ VP_DEV_EVID_CLK_FLT |
+ VP_LINE_EVID_SYNC_FLT |
+ VP_LINE_EVID_DC_FLT |
+ VP_LINE_EVID_AC_FLT |
+ VP_DEV_EVID_EVQ_OFL_FLT |
+ VP_DEV_EVID_WDT_FLT |
+ VP_DEV_EVID_SYSTEM_FLT),
+ /* Remaining undefined events should be masked to protect against
+ * future changes */
+ VP_EVCAT_FAULT_UNDEFINED = (int)(~(VP_DEV_EVID_BAT_FLT |
+ VP_DEV_EVID_CLK_FLT |
+ VP_LINE_EVID_THERM_FLT |
+ VP_LINE_EVID_DC_FLT |
+ VP_LINE_EVID_AC_FLT |
+ VP_LINE_EVID_SYNC_FLT |
+ VP_LINE_EVID_RES_LEAK_FLT |
+ VP_LINE_EVID_SEAL_CUR_FLT |
+ VP_LINE_EVID_GND_FLT |
+ VP_DEV_EVID_WDT_FLT |
+ VP_DEV_EVID_EVQ_OFL_FLT |
+ VP_DEV_EVID_SYSTEM_FLT)), /* NOTES:
+ * The typecasting (int) is necessary in some compilers that have
+ * sizeof(enum) == sizeof(int) == 2bytes and also because of 'C' rules for
+ * hexadecimal constants. Hexadecimal constants are treated as unsigned and
+ * enum variables are of type signed int. Thus compilers generate warning
+ * when code attempts to assign number that is bigger than what a signed enum
+ * can hold */
+
+ VP_EVCAT_FAULT_UNMASK_ALL = (int)(VP_EVENT_MASK_ALL &
+ VP_EVCAT_FAULT_UNDEFINED),
+ VP_EVCAT_FAULT_MASK_ALL = (int)(~VP_EVCAT_FAULT_UNDEFINED),
+ VP_EVCAT_FAULT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpFaultEventType;
+#endif
+
+#ifdef STRICT_SIGNED_ENUM_VALUES
+typedef uint16 VpSignalingEventType;
+#define VP_LINE_EVID_HOOK_OFF (0x0001)
+#define VP_LINE_EVID_HOOK_ON (0x0002)
+#define VP_LINE_EVID_GKEY_DET (0x0004)
+#define VP_LINE_EVID_GKEY_REL (0x0008)
+#define VP_LINE_EVID_FLASH (0x0010)
+#define VP_LINE_EVID_STARTPULSE (0x0020)
+#define VP_LINE_EVID_DTMF_DIG (0x0040)
+#define VP_LINE_EVID_PULSE_DIG (0x0080)
+#define VP_LINE_EVID_MTONE (0x0100)
+#define VP_DEV_EVID_TS_ROLLOVER (0x0200)
+
+#define VP_LINE_EVID_BREAK_MAX (0x2000)
+#define VP_LINE_EVID_EXTD_FLASH (0x4000)
+#define VP_LINE_EVID_HOOK_PREQUAL (0x8000)
+
+/* The following signaling events are device-specific, not line-specific */
+#define VP_EVCAT_SIGNALING_DEV_EVENTS (VP_LINE_EVID_HOOK_OFF | \
+ VP_LINE_EVID_HOOK_ON | \
+ VP_LINE_EVID_GKEY_DET | \
+ VP_LINE_EVID_GKEY_REL | \
+ VP_LINE_EVID_FLASH | \
+ VP_LINE_EVID_STARTPULSE | \
+ VP_LINE_EVID_DTMF_DIG | \
+ VP_LINE_EVID_PULSE_DIG | \
+ VP_LINE_EVID_MTONE | \
+ VP_DEV_EVID_TS_ROLLOVER | \
+ VP_LINE_EVID_BREAK_MAX | \
+ VP_LINE_EVID_EXTD_FLASH | \
+ VP_LINE_EVID_HOOK_PREQUAL)
+
+/* Remaining undefined events should be masked to protect againstfuture changes */
+#define VP_EVCAT_SIGNALING_UNDEFINED (~(VP_LINE_EVID_HOOK_OFF | \
+ VP_LINE_EVID_HOOK_ON | \
+ VP_LINE_EVID_GKEY_DET | \
+ VP_LINE_EVID_GKEY_REL | \
+ VP_LINE_EVID_FLASH | \
+ VP_LINE_EVID_STARTPULSE | \
+ VP_LINE_EVID_DTMF_DIG | \
+ VP_LINE_EVID_PULSE_DIG | \
+ VP_LINE_EVID_MTONE | \
+ VP_DEV_EVID_TS_ROLLOVER | \
+ VP_LINE_EVID_BREAK_MAX | \
+ VP_LINE_EVID_EXTD_FLASH | \
+ VP_LINE_EVID_HOOK_PREQUAL))
+
+#define VP_EVCAT_SIGNALING_UNMASK_ALL (VP_EVENT_MASK_ALL & VP_EVCAT_SIGNALING_UNDEFINED)
+#define VP_EVCAT_SIGNALING_MASK_ALL (~VP_EVCAT_SIGNALING_UNDEFINED)
+#else
+typedef enum VpSignalingEventType {
+ VP_LINE_EVID_HOOK_OFF = 0x0001, /**< Off-Hook detected */
+ VP_LINE_EVID_HOOK_ON = 0x0002, /**< On-Hook detected */
+ VP_LINE_EVID_GKEY_DET = 0x0004, /**< Ground Key detected */
+ VP_LINE_EVID_GKEY_REL = 0x0008, /**< Ground Key release detected */
+ VP_LINE_EVID_FLASH = 0x0010, /**< Hook switch flash detected */
+ VP_LINE_EVID_STARTPULSE = 0x0020, /**< Start of a dial pulse detected */
+ VP_LINE_EVID_DTMF_DIG = 0x0040, /**< New DTMF digit detected */
+ VP_LINE_EVID_PULSE_DIG = 0x0080, /**< New pulse digit detected */
+ VP_LINE_EVID_MTONE = 0x0100, /**< Modem tone detected */
+ VP_DEV_EVID_TS_ROLLOVER = 0x0200, /**< Timestamp rollover */
+
+ VP_LINE_EVID_BREAK_MAX = 0x2000, /**< Break Max time has been exceeded */
+ VP_LINE_EVID_EXTD_FLASH = 0x4000, /**< Flash Hook between flash max and on-hook min */
+ VP_LINE_EVID_HOOK_PREQUAL = 0x8000, /**< debounced off/on hook detected, but < offHookMin */
+
+ /* The following signaling events are device-specific, not line-specific */
+ VP_EVCAT_SIGNALING_DEV_EVENTS = (int)(VP_LINE_EVID_HOOK_OFF | \
+ VP_LINE_EVID_HOOK_ON | \
+ VP_LINE_EVID_GKEY_DET | \
+ VP_LINE_EVID_GKEY_REL | \
+ VP_LINE_EVID_FLASH | \
+ VP_LINE_EVID_STARTPULSE | \
+ VP_LINE_EVID_DTMF_DIG | \
+ VP_LINE_EVID_PULSE_DIG | \
+ VP_LINE_EVID_MTONE | \
+ VP_DEV_EVID_TS_ROLLOVER | \
+ VP_LINE_EVID_BREAK_MAX | \
+ VP_LINE_EVID_EXTD_FLASH | \
+ VP_LINE_EVID_HOOK_PREQUAL),
+ /* Remaining undefined events should be masked to protect against
+ * future changes */
+ VP_EVCAT_SIGNALING_UNDEFINED = (int)(~(VP_LINE_EVID_HOOK_OFF |
+ VP_LINE_EVID_HOOK_ON |
+ VP_LINE_EVID_GKEY_DET |
+ VP_LINE_EVID_GKEY_REL |
+ VP_LINE_EVID_FLASH |
+ VP_LINE_EVID_STARTPULSE |
+ VP_LINE_EVID_DTMF_DIG |
+ VP_LINE_EVID_PULSE_DIG |
+ VP_LINE_EVID_MTONE |
+ VP_DEV_EVID_TS_ROLLOVER |
+ VP_LINE_EVID_BREAK_MAX |
+ VP_LINE_EVID_EXTD_FLASH |
+ VP_LINE_EVID_HOOK_PREQUAL)),
+
+ VP_EVCAT_SIGNALING_UNMASK_ALL = (int)(VP_EVENT_MASK_ALL &
+ VP_EVCAT_SIGNALING_UNDEFINED),
+ VP_EVCAT_SIGNALING_MASK_ALL = (int)(~VP_EVCAT_SIGNALING_UNDEFINED),
+ VP_EVCAT_SIG_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpSignalingEventType;
+#endif
+
+#ifdef STRICT_SIGNED_ENUM_VALUES
+typedef uint16 VpResponseEventType;
+#define VP_DEV_EVID_BOOT_CMP (0x0001)
+
+#define VP_LINE_EVID_LLCMD_TX_CMP (0x0002)
+#define VP_LINE_EVID_LLCMD_RX_CMP (0x0004)
+
+#define VP_DEV_EVID_DNSTR_MBOX (0x0008)
+#define VP_LINE_EVID_RD_OPTION (0x0010)
+#define VP_LINE_EVID_RD_LOOP (0x0020)
+
+#define VP_EVID_CAL_CMP (0x0040)
+#define VP_EVID_CAL_BUSY (0x0080)
+#define VP_LINE_EVID_GAIN_CMP (0x0100)
+#define VP_LINE_EVID_QUERY_CMP (0x0200)
+#define VP_DEV_EVID_DEV_INIT_CMP (0x0400)
+#define VP_LINE_EVID_LINE_INIT_CMP (0x0800)
+#define VP_DEV_EVID_IO_ACCESS_CMP (0x1000)
+#define VP_LINE_EVID_LINE_IO_RD_CMP (0x2000)
+#define VP_LINE_EVID_LINE_IO_WR_CMP (0x4000)
+#define VP_LINE_EVID_SLAC_INIT_CMP (0x8000)
+
+/* The following response events are device-specific, not line-specific */
+#define VP_EVCAT_RESPONSE_DEV_EVENTS (VP_DEV_EVID_BOOT_CMP | \
+ VP_DEV_EVID_DNSTR_MBOX | \
+ VP_DEV_EVID_DEV_INIT_CMP | \
+ VP_EVID_CAL_CMP | \
+ VP_DEV_EVID_IO_ACCESS_CMP)
+
+/* Remaining undefined events should be masked to protect against future changes */
+#define VP_EVCAT_RESPONSE_UNDEFINED (~(VP_DEV_EVID_BOOT_CMP | \
+ VP_LINE_EVID_LLCMD_TX_CMP | \
+ VP_LINE_EVID_LLCMD_RX_CMP | \
+ VP_DEV_EVID_DNSTR_MBOX | \
+ VP_LINE_EVID_RD_OPTION | \
+ VP_LINE_EVID_RD_LOOP | \
+ VP_EVID_CAL_CMP | \
+ VP_EVID_CAL_BUSY | \
+ VP_LINE_EVID_GAIN_CMP | \
+ VP_LINE_EVID_QUERY_CMP | \
+ VP_DEV_EVID_DEV_INIT_CMP | \
+ VP_LINE_EVID_LINE_INIT_CMP | \
+ VP_DEV_EVID_IO_ACCESS_CMP | \
+ VP_LINE_EVID_LINE_IO_RD_CMP | \
+ VP_LINE_EVID_LINE_IO_WR_CMP | \
+ VP_LINE_EVID_SLAC_INIT_CMP))
+
+#define VP_EVCAT_RESPONSE_UNMASK_ALL (VP_EVENT_MASK_ALL & VP_EVCAT_RESPONSE_UNDEFINED)
+#define VP_EVCAT_RESPONSE_MASK_ALL (~VP_EVCAT_RESPONSE_UNDEFINED)
+#else
+typedef enum VpResponseEventType {
+ VP_DEV_EVID_BOOT_CMP = 0x0001, /**< VCP Startup sequence has
+ * completed; Non-maskable
+ */
+ VP_LINE_EVID_LLCMD_TX_CMP = 0x0002, /**< Low level write transaction has
+ * completed
+ */
+ VP_LINE_EVID_LLCMD_RX_CMP = 0x0004, /**< Low Level read transaction has
+ * completed
+ */
+ VP_DEV_EVID_DNSTR_MBOX = 0x0008, /**< Dowstream Mailbox event ready */
+ VP_LINE_EVID_RD_OPTION = 0x0010, /**< Read Option request complete */
+ VP_LINE_EVID_RD_LOOP = 0x0020, /**< Read Loop Conditions is complete
+ */
+ VP_EVID_CAL_CMP = 0x0040, /**< Device or Line Calibration is
+ * complete
+ */
+ VP_EVID_CAL_BUSY = 0x0080, /**< Calibration not performed, line
+ * busy
+ */
+ VP_LINE_EVID_GAIN_CMP = 0x0100, /**< Gain Adjustment complete */
+ VP_LINE_EVID_QUERY_CMP = 0x0200, /**< Query complete */
+ VP_DEV_EVID_DEV_INIT_CMP = 0x0400, /**< Device Init complete */
+ VP_LINE_EVID_LINE_INIT_CMP = 0x0800, /**< Line Init complete */
+ VP_DEV_EVID_IO_ACCESS_CMP = 0x1000, /**< Device Access complete */
+ VP_LINE_EVID_LINE_IO_RD_CMP = 0x2000, /**< Line GPIO read complete */
+ VP_LINE_EVID_LINE_IO_WR_CMP = 0x4000, /**< Line GPIO write complete */
+ VP_LINE_EVID_SLAC_INIT_CMP = 0x8000, /**< SLAC Init complete */
+ /* The following response events are device-specific, not line-specific */
+ VP_EVCAT_RESPONSE_DEV_EVENTS = (int)(VP_DEV_EVID_BOOT_CMP |
+ VP_DEV_EVID_DNSTR_MBOX |
+ VP_DEV_EVID_DEV_INIT_CMP |
+ VP_EVID_CAL_CMP |
+ VP_DEV_EVID_IO_ACCESS_CMP),
+ /* Remaining undefined events should be masked to protect against
+ * future changes */
+ VP_EVCAT_RESPONSE_UNDEFINED = (int)(~(VP_DEV_EVID_BOOT_CMP |
+ VP_LINE_EVID_LLCMD_TX_CMP |
+ VP_LINE_EVID_LLCMD_RX_CMP |
+ VP_DEV_EVID_DNSTR_MBOX |
+ VP_LINE_EVID_RD_OPTION |
+ VP_LINE_EVID_RD_LOOP |
+ VP_EVID_CAL_CMP |
+ VP_EVID_CAL_BUSY |
+ VP_LINE_EVID_GAIN_CMP |
+ VP_LINE_EVID_QUERY_CMP |
+ VP_DEV_EVID_DEV_INIT_CMP |
+ VP_LINE_EVID_LINE_INIT_CMP |
+ VP_DEV_EVID_IO_ACCESS_CMP |
+ VP_LINE_EVID_LINE_IO_RD_CMP |
+ VP_LINE_EVID_LINE_IO_WR_CMP |
+ VP_LINE_EVID_SLAC_INIT_CMP)),
+
+ VP_EVCAT_RESPONSE_UNMASK_ALL = (int)(VP_EVENT_MASK_ALL &
+ VP_EVCAT_RESPONSE_UNDEFINED),
+ VP_EVCAT_RESPONSE_MASK_ALL = (int)(~VP_EVCAT_RESPONSE_UNDEFINED),
+ VP_EVCAT_RES_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpResponseEventType;
+#endif
+
+typedef enum VpTestEventType {
+ VP_LINE_EVID_TEST_CMP = 0x0001, /**< A requested test has been completed*/
+ VP_LINE_EVID_TEST_RSVD1 = 0x0002, /**< Reserved event */
+ VP_LINE_EVID_DTONE_DET = 0x0004, /**< Dial-Tone Test - Dialtone Detected */
+ VP_LINE_EVID_DTONE_LOSS = 0x0008, /**< Dial-Tone Test - Dialtone Lost */
+ VP_DEV_EVID_STEST_CMP = 0x0010, /**< Self Test Function complete */
+ VP_DEV_EVID_CHKSUM = 0x0020, /**< Code-space checksum is complete */
+ VP_LINE_EVID_ABORT = 0x0040, /**< Event requesting abort test */
+ /* The following test events are device-specific, not line-specific */
+ VP_EVCAT_TEST_DEV_EVENTS = (int)(VP_DEV_EVID_CHKSUM),
+ /* Remaining undefined events should be masked to protect against
+ * future changes */
+ VP_EVCAT_TEST_UNDEFINED = (int)(~(VP_LINE_EVID_TEST_CMP |
+ VP_LINE_EVID_DTONE_DET |
+ VP_LINE_EVID_DTONE_LOSS |
+ VP_DEV_EVID_STEST_CMP |
+ VP_DEV_EVID_CHKSUM |
+ VP_LINE_EVID_ABORT)),
+
+ VP_EVCAT_TEST_UNMASK_ALL = (int)(VP_EVENT_MASK_ALL &
+ VP_EVCAT_TEST_UNDEFINED),
+ VP_EVCAT_TEST_MASK_ALL = (int)(~VP_EVCAT_TEST_UNDEFINED),
+ VP_EVCAT_TEST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpTestEventType;
+
+typedef enum VpProcessEventType {
+ VP_LINE_EVID_MTR_CMP = 0x0001, /**< Metering Signal complete */
+ VP_LINE_EVID_MTR_ABORT = 0x0002, /**< Metering Signal aborted */
+ VP_LINE_EVID_CID_DATA = 0x0004, /**< Caller ID Transmission buffer is
+ * empty
+ */
+ VP_LINE_EVID_RING_CAD = 0x0008, /**< Ring Cadence State change
+ * information
+ */
+ VP_LINE_EVID_SIGNAL_CMP = 0x0010, /**< Signal Generation complete */
+ VP_LINE_EVID_MTR_CAD = 0x0020, /**< Metering cadence */
+
+ VP_LINE_EVID_TONE_CAD = 0x0040, /**< Tone Cadence complete */
+
+ VP_LINE_EVID_MTR_ROLLOVER = 0x0080, /**< Metering count rollover */
+ VP_LINE_EVID_GEN_TIMER = 0x0100, /**< Timer complete / canceled / error */
+ VP_LINE_EVID_USER = 0x0200, /**< User-defined event */
+ VP_LINE_EVID_AUTO_LOOP_COND = 0x0400, /**< VP_OPTION_ID_AUTO_LOOP_COND event */
+
+ VP_DEV_EVID_SEAL_CUR_OFF = 0x0800, /**< Sealing current removed event */
+
+ /* There are no device-specific process events */
+ VP_EVCAT_PROCESS_DEV_EVENTS = 0,
+
+ /* Remaining undefined events should be masked to protect against
+ * future changes */
+ VP_EVCAT_PROCESS_UNDEFINED = (int)(~(VP_LINE_EVID_MTR_CMP |
+ VP_LINE_EVID_MTR_ABORT |
+ VP_LINE_EVID_CID_DATA |
+ VP_LINE_EVID_RING_CAD |
+ VP_LINE_EVID_SIGNAL_CMP |
+ VP_LINE_EVID_MTR_CAD |
+ VP_LINE_EVID_TONE_CAD |
+ VP_LINE_EVID_MTR_ROLLOVER |
+ VP_LINE_EVID_GEN_TIMER |
+ VP_LINE_EVID_USER |
+ VP_LINE_EVID_AUTO_LOOP_COND |
+ VP_DEV_EVID_SEAL_CUR_OFF)),
+
+ VP_EVCAT_PROCESS_UNMASK_ALL = (int)(VP_EVENT_MASK_ALL &
+ VP_EVCAT_PROCESS_UNDEFINED),
+ VP_EVCAT_PROCESS_MASK_ALL = (int)(~VP_EVCAT_PROCESS_UNDEFINED),
+ VP_EVCAT_PRO_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpProcessEventType;
+
+typedef enum VpFxoEventType {
+ /* FXO API Event Types */
+ VP_LINE_EVID_RING_ON = 0x0001, /**< Ringing detected on line */
+ VP_LINE_EVID_RING_OFF = 0x0002, /**< Ringing previously detected has
+ * stopped
+ */
+ VP_LINE_EVID_LIU = 0x0004, /**< Line In Use by adjacent line off
+ * hook
+ */
+ VP_LINE_EVID_LNIU = 0x0008, /**< Line In Use by adjacent line on
+ * hook */
+ VP_LINE_EVID_FEED_DIS = 0x0010, /**< Line feed disabled (or too low) */
+ VP_LINE_EVID_FEED_EN = 0x0020, /**< Line feed enabled */
+ VP_LINE_EVID_DISCONNECT = 0x0040, /**< Line feed removed while loop close */
+ VP_LINE_EVID_RECONNECT = 0x0080, /**< Line feed connected while loop
+ * close
+ */
+ VP_LINE_EVID_POLREV = 0x0100, /**< Line polarity reversal has occurred*/
+ VP_LINE_EVID_POH = 0x0200, /**< Parallel line off-hook */
+ VP_LINE_EVID_PNOH = 0x0400, /**< Parallel line on-hook */
+
+ /* There are no device-specific FXO events */
+ VP_EVCAT_FXO_DEV_EVENTS = 0,
+ /* Remaining undefined events should be masked to protect against
+ * future changes */
+ VP_EVCAT_FXO_UNDEFINED = (int)(~(VP_LINE_EVID_RING_ON |
+ VP_LINE_EVID_RING_OFF |
+ VP_LINE_EVID_LIU |
+ VP_LINE_EVID_LNIU |
+ VP_LINE_EVID_FEED_DIS |
+ VP_LINE_EVID_FEED_EN |
+ VP_LINE_EVID_DISCONNECT |
+ VP_LINE_EVID_RECONNECT |
+ VP_LINE_EVID_POLREV |
+ VP_LINE_EVID_POH |
+ VP_LINE_EVID_PNOH)),
+
+ VP_EVCAT_FXO_UNMASK_ALL = (int)(VP_EVENT_MASK_ALL &
+ VP_EVCAT_FXO_UNDEFINED),
+ VP_EVCAT_FXO_MASK_ALL = (int)(~VP_EVCAT_FXO_UNDEFINED),
+ VP_EVCAT_FXO_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpFxoEventType;
+
+typedef enum VpPacketEventType {
+ VP_LINE_EVID_US_PKT_RDY = 0x0001, /**< Upstream Packet ready event */
+ VP_LINE_EVID_NEED_DS_PKT = 0x0002, /**< Need Downstream Packet event */
+ VP_LINE_EVID_PKT_ERROR = 0x0004, /**< Packet type error event */
+ VP_LINE_EVID_PKT_LOST = 0x0008, /**< Packet loss event */
+ VP_LINE_EVID_RD_PKT_STATS = 0x0010, /**< Read packet statistics complete*/
+ /* There are no device-specific packet events */
+ VP_EVCAT_PACKET_DEV_EVENTS = 0,
+ /* Remaining undefined events should be masked to protect against
+ * future changes */
+ VP_EVCAT_PACKET_UNDEFINED = (int)(~(VP_LINE_EVID_US_PKT_RDY |
+ VP_LINE_EVID_NEED_DS_PKT |
+ VP_LINE_EVID_PKT_ERROR |
+ VP_LINE_EVID_PKT_LOST |
+ VP_LINE_EVID_RD_PKT_STATS)),
+
+ VP_EVCAT_PACKET_UNMASK_ALL = (int)(VP_EVENT_MASK_ALL &
+ VP_EVCAT_PACKET_UNDEFINED),
+ VP_EVCAT_PACKET_MASK_ALL = (int)(~VP_EVCAT_PACKET_UNDEFINED),
+ VP_EVCAT_PKT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpPacketEventType;
+
+/* Enumerations for interpreting event data in the VpGetEvent() field */
+typedef enum VpBatFltEventDataType {
+ /* Generic battery fault codes */
+ VP_BAT_FLT_NONE = 0x00,
+ VP_BAT_FLT_BAT2 = 0x01,
+ VP_BAT_FLT_BAT1 = 0x02,
+ VP_BAT_FLT_BAT3 = 0x04,
+
+ /* Fault codes for ZL880/miSLIC */
+ VP_BAT_FLT_SWY_OV = 0x02, /* Switcher Y Over-Voltage */
+ VP_BAT_FLT_SWZ_OV = 0x01, /* Switcher Z Over-Voltage */
+ VP_BAT_FLT_CP_UV = 0x04, /* Charge Pump Under-Voltage */
+ VP_BAT_FLT_SWY_OC = 0x08, /* Switcher Y Over-Current */
+ VP_BAT_FLT_SWZ_OC = 0x10, /* Switcher Z Over-Current */
+ VP_BAT_FLT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpBatFltEventDataType;
+
+typedef enum VpRingCadEventDataType {
+ VP_RING_CAD_BREAK = 0,
+ VP_RING_CAD_MAKE = 1,
+ VP_RING_CAD_DONE = 2,
+ VP_RING_CAD_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpRingCadEventDataType;
+
+typedef enum VpCidDataEventDataType {
+ VP_CID_DATA_NEED_MORE_DATA = 0,
+ VP_CID_DATA_TX_DONE = 1,
+ VP_CID_DATA_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpCidDataEventDataType;
+
+typedef enum VpDigitType {
+ VP_DIG_1 = 0x01,
+ VP_DIG_2 = 0x02,
+ VP_DIG_3 = 0x03,
+ VP_DIG_4 = 0x04,
+ VP_DIG_5 = 0x05,
+ VP_DIG_6 = 0x06,
+ VP_DIG_7 = 0x07,
+ VP_DIG_8 = 0x08,
+ VP_DIG_9 = 0x09,
+ VP_DIG_10 = 0x0A, /* pulse only */
+ VP_DIG_11 = 0x0B, /* pulse only */
+ VP_DIG_12 = 0x0C, /* pulse only */
+ VP_DIG_13 = 0x0D, /* pulse only */
+ VP_DIG_14 = 0x0E, /* pulse only */
+ VP_DIG_15 = 0x0F, /* pulse only */
+ VP_DIG_ZERO = 0x0A, /* DTMF only */
+ VP_DIG_ASTER = 0x0B, /* DTMF only */
+ VP_DIG_POUND = 0x0C, /* DTMF only */
+ VP_DIG_A = 0x0D, /* DTMF only */
+ VP_DIG_B = 0x0E, /* DTMF only */
+ VP_DIG_C = 0x0F, /* DTMF only */
+ VP_DIG_D = 0x00, /* DTMF only */
+ VP_DIG_NONE = 0xFF,
+ VP_DIG_ENUM_RSVD = FORCE_SIGNED_ENUM,
+ VP_DIG_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDigitType;
+
+/*
+ * VpInitDevice Error Codes (bit mask) for the eventData field of VP_DEV_EVID_DEV_INIT_CMP
+ * for 886_SERIES and 887_SERIES.
+ */
+#define VP_DEV_INIT_CMP_SUCCESS 0x0000
+#define VP_DEV_INIT_CMP_FAIL 0x0001 /* Global failure flag */
+#define VP_DEV_INIT_CMP_CFAIL 0x0002 /* Clock Fault Observed */
+#define VP_DEV_INIT_CMP_LINE_FAIL 0x0004 /* Line initialization failed */
+#define VP_DEV_INIT_CMP_CAL_FAIL 0x0008 /* Error encountered during calibration */
+#define VP_DEV_INIT_CMP_VREF_FAIL 0x0010 /* Vref failure (Vref did not come up correctly) */
+#define VP_DEV_INIT_CMP_CP_FAIL 0x0020 /* Charge Pump Failure (Charge Pump Undervoltage */
+#define VP_DEV_INIT_CMP_SW_FAIL 0x0040 /* Switcher failure (Over-Current or Over-Voltage) */
+#define VP_DEV_INIT_CMP_CH1_SD 0x0080 /* Channel 1 Shutdown */
+#define VP_DEV_INIT_CMP_CH2_SD 0x0100 /* Channel 2 Shutdown */
+#define VP_DEV_INIT_CMP_CH1_OC 0x0080 /* Channel 1 Over-Current */
+#define VP_DEV_INIT_CMP_CH2_OC 0x0100 /* Channel 2 Over-Current */
+#define VP_DEV_INIT_CMP_CH1_OV 0x0200 /* Channel 1 Over-Voltage */
+#define VP_DEV_INIT_CMP_CH2_OV 0x0400 /* Channel 2 Over-Voltage */
+
+/*
+ * Indicates which set of Dial Pulse Specifications were met that is generating
+ * the dial pulse event.
+ */
+typedef enum VpDialPulseParamType {
+ VP_DP_PARAM1 = 0,
+ VP_DP_PARAM2 = 1,
+ VP_DP_PARAM_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDialPulseParamType;
+
+typedef enum VpDigitSenseType {
+ VP_DIG_SENSE_BREAK = 0x0000,
+ VP_DIG_SENSE_MAKE = 0x0010,
+ VP_DIG_SENSE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpDigitSenseType;
+
+typedef enum VpPolRevEventDataType {
+ VP_POLREV_NORMAL = 0, /* Line detected Reverse-to-Normal Transition */
+ VP_POLREV_REVERSE = 1, /* Line detected Normal-to-Reverse Transition */
+ VP_POLREV_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpPolRevEventDataType;
+
+typedef enum VpSyncFltEventDataType {
+ VP_SYNC_MB_ERR = 0x00,
+ VP_SYNC_SLAC_MISSING = 0x01, /* A SLAC that was previously detected is no longer responding*/
+ VP_SYNC_SEQ_BAD_INST = 0x81, /* Unknown instruction in sequence */
+ VP_SYNC_SEQ_BAD_BR = 0x82, /* Sequencer encountered bad branch (either
+ * a forward branch or too many nesting levels */
+ VP_SYNC_SLAC_DET = 0x8000,/* A new SLAC is detected and no firmware is loaded into that SLAC yet*/
+ VP_SYNC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpSyncFltEventDataType;
+
+typedef enum VpSysFltEventDataType {
+ /* VCP- and MELT-specific system fault codes are defined in vcp2_api.h and
+ melt_api.h. Avoiding using 0x0000 because it could be used to mean that
+ a fault was cleared. */
+ VP_SYS_FLT_SPI_ERROR = 0x0001,
+ VP_SYS_FLT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpSysFltEventDataType;
+
+typedef enum VpGenTimerStatusType {
+ VP_GEN_TIMER_STATUS_CMP = 0,
+ VP_GEN_TIMER_STATUS_CANCELED = 1,
+ VP_GEN_TIMER_STATUS_RESRC_NA = 2,
+ VP_GEN_TIMER_STATUS_UNKNOWN = 3,
+ VP_GEN_TIMER_STATUS_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpGenTimerStatusType;
+
+typedef enum VpFlashEventDataType {
+ VP_FLASH_ONLY = 0,
+ VP_FLASH_AND_DIGIT1 = 1
+} VpFlashEventDataType;
+
+typedef uint16 VpHookPrequalEventDataType;
+#define VP_HOOK_PREQUAL_START (0) /* Debounced off-hook detected, but offHookMin > 0 */
+#define VP_HOOK_PREQUAL_ABORT (1) /* Debounced on-hook detected, but duration < offHookMin */
+
+
+/**
+ * Non-maskable events are (with reasons):
+ *
+ * Boot Complete -- Cannot mask. Masking events requires that the boot has
+ * been completed.
+ * Read Option -- To modify mask interrupts requires that the current mask
+ * options can be read. The only way to know the read option
+ * is ready is via an unmasked Read Option Complete event.
+ * Device Init -- Fundamental event to know when device is initialized and
+ * remaining options/line configurations can be set. There
+ * is no other standard "timeout" mechanism to know when the
+ * device has been initialized properly.
+ * Line Init -- Fundamental event to know when a line is initialized and ready
+ * to be setup with remaining user defined options. There is no
+ * other standard "timeout" mechanism to know when the line has
+ * been initialized properly.
+ * Events that have responses -- These events are non-maskable. If an event
+ * that has a response is masked, and if the response is not
+ * read, in case of CSLAC devices, it blocks response buffer.
+ * In case of VCP class of devices, response mailbox is
+ * locked up. If this is followed by another command that
+ * requires the response mailbox, that command can't complete
+ * execution since the response mailbox is busy. Now no more
+ * commands can be issued because the previous command can't
+ * complete.
+ */
+
+#define VP_API_NONMASK_FAULT_EVENTS (VP_DEV_EVID_CLK_FLT | VP_LINE_EVID_SYNC_FLT | VP_LINE_EVID_DC_FLT | VP_LINE_EVID_AC_FLT)
+#define VP_API_NONMASK_SIGNALING_EVENTS (VP_LINE_EVID_HOOK_OFF | \
+ VP_LINE_EVID_HOOK_ON | \
+ VP_LINE_EVID_FLASH | \
+ VP_LINE_EVID_BREAK_MAX | \
+ VP_LINE_EVID_EXTD_FLASH | \
+ VP_LINE_EVID_GKEY_DET | \
+ VP_LINE_EVID_GKEY_REL)
+
+#define VP_API_NONMASK_RESPONSE_EVENTS (VP_DEV_EVID_BOOT_CMP \
+ | VP_LINE_EVID_LLCMD_RX_CMP \
+ | VP_LINE_EVID_RD_OPTION \
+ | VP_LINE_EVID_RD_LOOP \
+ | VP_LINE_EVID_GAIN_CMP \
+ | VP_LINE_EVID_QUERY_CMP \
+ | VP_DEV_EVID_DEV_INIT_CMP \
+ | VP_EVID_CAL_CMP \
+ | VP_LINE_EVID_LINE_INIT_CMP \
+ | VP_DEV_EVID_IO_ACCESS_CMP \
+ | VP_LINE_EVID_LINE_IO_RD_CMP \
+ | VP_LINE_EVID_SLAC_INIT_CMP)
+
+#define VP_API_NONMASK_TEST_EVENTS (VP_LINE_EVID_TEST_CMP \
+ | VP_DEV_EVID_CHKSUM)
+
+#define VP_API_NONMASK_PROCESS_EVENTS VP_LINE_EVID_GEN_TIMER
+#define VP_API_NONMASK_FXO_EVENTS 0x0000
+#define VP_API_NONMASK_PACKET_EVENTS 0x0000
+
+#endif /* VP_API_EVENT_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_fxo_params.h b/marvell/services/mislic/api_lib/includes/vp_api_fxo_params.h
new file mode 100644
index 0000000..60e53c1
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_fxo_params.h
@@ -0,0 +1,68 @@
+/** \file vp_api_fxo_params.h
+ * vp_api_fxo_params.h
+ *
+ * This file contains the approved system parameters for proper
+ * FXO operation on the reference designs
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 9115 $
+ * $LastChangedDate: 2011-11-15 15:25:17 -0600 (Tue, 15 Nov 2011) $
+ */
+
+#ifndef VP_API_FXO_PARAMS_H
+#define VP_API_FXO_PARAMS_H
+
+#define VP_FXO_DTMF_ON_DEFAULT 0x0027 /* DTMF On = 195mS */
+#define VP_FXO_DTMF_OFF_DEFAULT 0x0028 /* DTMF Off = 200mS */
+#define VP_FXO_FLASH_HOOK_DEFAULT 0x0078 /* Flash Hook = 600mS */
+#define VP_FXO_PULSE_BREAK_DEFAULT 0x0C /* Pulse Break = 60mS */
+#define VP_FXO_PULSE_MAKE_DEFAULT 0x08 /* Pulse Make = 40mS */
+#define VP_FXO_INTERDIG_DEFAULT 0x0028 /* Interdigit Period = 200mS */
+#define VP_FXO_RING_DET_MAX_DEFAULT 0xEB /* Ring Period Max = 58.75mS */
+#define VP_FXO_RING_DET_MIN_DEFAULT 0x79 /* Ring Period Min = 30.25mS */
+#define VP_FXO_RING_DET_VOLT_DEFAULT 0x02 /* Ring Voltage Min = 38V */
+#define VP_FXO_DISC_DET_MIN_DEFAULT 0x03 /* Disconnect Det Min = 4.2V */
+#define VP_FXO_LIU_DET_THRESH_DEFAULT 0x26 /* Line-In-Use Det Threshold = 38V */
+
+/* In ms, time that FXO detector activity is ignored after a state change */
+#define VP_FXO_STATE_CHANGE_DEBOUNCE (50)
+
+/* In ms, time that FXO detector activity is ignored after a ring trip */
+#define VP_FXO_RING_TRIP_DEBOUNCE (200)
+
+/* In ms, time that FXO disconnect detector is debounced */
+#define VP_FXO_DISCONNECT_DEBOUNCE (300)
+
+/* In ms, time that FXO will change to loop open if detecting disconnect */
+#define VP_FXO_DISC_TO_LOOP_OPEN (5000)
+
+typedef enum vp_fxo_dialingProfileParams {
+ VP_FXO_DIALING_PROFILE_DTMF_ON_MSB = 6,
+ VP_FXO_DIALING_PROFILE_DTMF_ON_LSB = 7,
+ VP_FXO_DIALING_PROFILE_DTMF_OFF_MSB = 8,
+ VP_FXO_DIALING_PROFILE_DTMF_OFF_LSB = 9,
+ VP_FXO_DIALING_PROFILE_FLASH_HOOK_MSB = 10,
+ VP_FXO_DIALING_PROFILE_FLASH_HOOK_LSB = 11,
+ VP_FXO_DIALING_PROFILE_PULSE_BREAK = 12,
+ VP_FXO_DIALING_PROFILE_PULSE_MAKE = 13,
+ VP_FXO_DIALING_PROFILE_INTERDIGIT_MSB = 14,
+ VP_FXO_DIALING_PROFILE_INTERDIGIT_LSB = 15,
+ VP_FXO_DIALING_PROFILE_RING_PERIOD_MAX = 16,
+ VP_FXO_DIALING_PROFILE_RING_PERIOD_MIN = 17,
+ VP_FXO_DIALING_PROFILE_RING_VOLTAGE_MIN = 18,
+ VP_FXO_DIALING_PROFILE_DISC_VOLTAGE_MIN = 19,
+ VP_FXO_DIALING_PROFILE_LIU_THRESHOLD_MIN = 20,
+ VP_FXO_DIALING_PROFILE_RING_PERIOD_MAX_ACT = 21,
+ VP_FXO_DIALING_PROFILE_DTMF_HIGH_LVL_MSB = 22,
+ VP_FXO_DIALING_PROFILE_DTMF_HIGH_LVL_LSB = 23,
+ VP_FXO_DIALING_PROFILE_DTMF_LOW_LVL_MSB = 24,
+ VP_FXO_DIALING_PROFILE_DTMF_LOW_LVL_LSB = 25,
+ VP_FXO_DIALING_PROFILE_POH_INT_TIME = 26,
+ VP_FXO_DIALING_PROFILE_POH_THRESHOLD = 27,
+ VP_FXO_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} vp_fxo_dialingProfileParams;
+#endif
+
+
+
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_int.h b/marvell/services/mislic/api_lib/includes/vp_api_int.h
new file mode 100644
index 0000000..ae5b9b9
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_int.h
@@ -0,0 +1,647 @@
+/** \file vp_api_int.h
+ * vp_api_int.h
+ *
+ * Header file for the API-II c files. This file contains the declarations
+ * and defintions required to implement the VTD specific VP-API. This file
+ * is used by VP-API internally. This file should not be included by the
+ * application.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12408 $
+ * $LastChangedDate: 2017-06-08 16:48:24 -0500 (Thu, 08 Jun 2017) $
+ */
+
+#ifndef VP_API_INT_H
+#define VP_API_INT_H
+
+#include "vp_api_cfg.h"
+#include "vp_api_types.h"
+#include "vp_api.h"
+#include "vp_api_option.h"
+
+#include "vp_debug.h"
+
+/******************************************************************************
+ * VP-API Defines *
+ ******************************************************************************/
+#define VP_ALL_LINES 0xFF /**< Internal constant used to identify
+ * all lines
+ */
+#define VP_ALL_SLACS 0xFFFF /**< Internal constant used to identify
+ * all SLACs
+ */
+
+/**< Profile types as defined by Profile Wizard */
+typedef enum VpProfileWizProfileType {
+ VP_PRFWZ_PROFILE_AC = 0x00,
+ VP_PRFWZ_PROFILE_DC = 0x01,
+ VP_PRFWZ_PROFILE_TONE = 0x02,
+ VP_PRFWZ_PROFILE_TONECAD = 0x03,
+ VP_PRFWZ_PROFILE_RING = 0x04,
+ VP_PRFWZ_PROFILE_CID_TYPE1 = 0x05,
+ VP_PRFWZ_PROFILE_CID_TYPE2 = 0x06,
+ VP_PRFWZ_PROFILE_METER = 0x07,
+ VP_PRFWZ_PROFILE_RINGCAD = 0x08,
+ VP_PRFWZ_PROFILE_CUSTOM_TERM = 0x09,
+ VP_PRFWZ_PROFILE_FXS_CTRL = 0x0B,
+ VP_PRFWZ_PROFILE_CAL = 0x0C,
+ VP_PRFWZ_PROFILE_METERING_GEN, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_HOOK_FLASH_DIG_GEN, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_DIAL_PULSE_DIG_GEN, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_DTMF_DIG_GEN, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_MSG_WAIT_PULSE_INT, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_LINE_CAL_INT, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_FWD_DISC_INT, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_POLREV_PULSE_INT, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_MOMENTARY_LOOP_OPEN_INT, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_TIP_OPEN_INT, /**< API Internal Profile Type */
+ VP_PRFWZ_PROFILE_NONE, /**< Indicates that internal
+ profile data is not valid */
+ VP_PRFWZ_PROFILE_FXO_CONFIG = 0xFE,
+ VP_PRFWZ_PROFILE_DEVICE = 0xFF,
+ VP_PRFWZ_PROFILE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE/* Portability Req.*/
+} VpProfileWizProfileType;
+
+typedef enum VpProfileWizCustomStateType {
+ VP_PRFWZ_CUSTOM_ST_STANDBY = 0x00,
+ VP_PRFWZ_CUSTOM_ST_ACTIVE = 0x02,
+ VP_PRFWZ_CUSTOM_ST_ACTIVE_PR = 0x03,
+ VP_PRFWZ_CUSTOM_ST_TIP_OPEN = 0x04,
+ VP_PRFWZ_CUSTOM_ST_OHT = 0x06,
+ VP_PRFWZ_CUSTOM_ST_OHT_PR = 0x07,
+ VP_PRFWZ_CUSTOM_ST_DISCONNECT = 0x08,
+ VP_PRFWZ_CUSTOM_ST_RINGING = 0x09,
+ VP_PRFWZ_CUSTOM_ST_DET_MAP = 0xFF,
+ VP_PRFWZ_CUSTOM_ST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE/* Portability Req.*/
+} VpProfileWizCustomStateType;
+
+/** These locations are common to all profiles used in the API */
+typedef enum VpProfileHeaderFieldType {
+ VP_PROFILE_TYPE_MSB = 0,
+ VP_PROFILE_TYPE_LSB = 1,
+ VP_PROFILE_INDEX = 2,
+ VP_PROFILE_LENGTH = 3,
+ VP_PROFILE_VERSION = 4,
+ VP_PROFILE_MPI_LEN = 5,
+ VP_PROFILE_DATA_START = 6,
+ VP_PROFILE_HDR_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpProfileHeaderFieldType;
+
+/* Define the Ringing Type (balanced/unbalanced) offset from end of MPI data */
+#define VP_PROFILE_RING_TYPE_OFFSET 1
+
+/** These are the locations of parameters in version 01 ringing profiles */
+typedef enum VpRingProfileFieldType {
+ VP_RING_PROFILE_RING_TRIP = 18,
+ VP_RING_PROFILE_CURRENT_LIM = 19,
+ VP_RING_PROFILE_MAX_RING_V = 20,
+ VP_RING_PROFILE_TRACK_MODE = 21,
+ VP_RING_PROFILE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req */
+} VpRingProfileFieldType;
+
+/** These are the locations of parameters in version 01 DC profiles */
+typedef enum VpDcProfileFieldType {
+ VP_DC_PROFILE_THRESHOLDS = 9,
+ VP_DC_PROFILE_DEBOUNCES = 10,
+ VP_DC_PROFILE_FLOOR_V = 11,
+ VP_DC_PROFILE_HOOK_HYST = 12,
+ VP_DC_PROFILE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req */
+} VpDcProfileFieldType;
+
+typedef enum VpCidProfileFieldType {
+ /*
+ * These parameters are the absolute locations of the specified value in
+ * the CID profile
+ */
+ VP_CID_PROFILE_FSK_PARAM_LEN = 6,
+ VP_CID_PROFILE_FSK_PARAM_CMD = 7,
+ VP_CID_PRFT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpCidProfileFieldType;
+
+/*
+ * These parameters are offset from the end of the FSK data to the value
+ * specified
+ */
+#define VP_CID_PROFILE_CHECKSUM_OFFSET_MSB (1)
+#define VP_CID_PROFILE_CHECKSUM_OFFSET_LSB (2)
+#define VP_CID_PROFILE_LENGTH_OF_ELEMENTS_MSB (3)
+#define VP_CID_PROFILE_LENGTH_OF_ELEMENTS_LSB (4)
+#define VP_CID_PROFILE_START_OF_ELEMENTS_MSB (5)
+#define VP_CID_PROFILE_START_OF_ELEMENTS_LSB (6)
+
+/** These locations are for Tone and Ringing Cadence (Sequencer) profiles */
+#define VP_PROFILE_TYPE_SEQUENCER_COUNT_MSB (6)
+#define VP_PROFILE_TYPE_SEQUENCER_COUNT_LSB (7)
+#define VP_PROFILE_TYPE_SEQUENCER_START (8)
+
+/** These locations are for Calibration profiles */
+#define VP_CAL_PROFILE_NUM_ENTRIES (6)
+#define VP_CAL_PROFILE_FIRST_ENTRY (8)
+
+/** Locations for v0 and v1 tone profiles */
+#define VP_TONE_PROFILE_AB_DATA (8)
+#define VP_TONE_PROFILE_CD_DATA (16)
+
+/** Definitions for v2 tone profiles */
+#define VP_TONE_PROFILE_V2_FM (0x80)
+#define VP_TONE_PROFILE_V2_WIDEBAND (0x40)
+#define VP_TONE_PROFILE_V2_GENS (0x1F)
+
+/******************************************************************************
+ * API Specific common FUNCTION PROTOTYPES *
+ ******************************************************************************/
+void
+VpImplementNonMaskEvents(
+ VpOptionEventMaskType *pLineEventsMask,
+ VpOptionEventMaskType *pDevEventsMask);
+
+VpStatusType
+VpImplementDefaultSettings(
+ VpDevCtxType *pDevCtx,
+ VpLineCtxType *pLineCtx);
+
+EXTERN int
+VpGetProfileIndex (
+ const VpProfilePtrType pProfile);
+
+EXTERN bool
+VpVerifyProfileType(
+ VpProfileType type,
+ VpProfilePtrType pProfile);
+
+EXTERN bool
+VpIsDigit(
+ VpDigitType digit);
+
+#if (defined (VP_CC_880_SERIES) || defined (VP_CC_890_SERIES))
+EXTERN VpStatusType
+VpCSLACSetDTMFGenValues(
+ uint8 *sigGenABParams,
+ VpDigitType digit);
+
+EXTERN bool
+VpCSLACHookMaskEnabled(
+ uint16 fxsTimers[VP_LINE_TIMER_LAST]);
+#endif
+
+/******************************************************************************
+ * VCP Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+#if defined (VP_CC_VCP_SERIES)
+VpStatusType
+VpMakeVcpDeviceObject(
+ VpDevCtxType *pDevCtx,
+ VpVcpDeviceObjectType *pDevObj);
+
+VpStatusType
+VpMakeVcpDeviceCtx(
+ VpDevCtxType *pDevCtx,
+ VpVcpDeviceObjectType *pDevObj);
+
+#endif /* VP_CC_VCP_SERIES */
+
+/******************************************************************************
+ * VCP2 Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+#if defined (VP_CC_VCP2_SERIES)
+VpStatusType
+Vcp2MakeDeviceObject(
+ VpDevCtxType *pDevCtx,
+ VpVcp2DeviceObjectType *pDevObj);
+
+VpStatusType
+Vcp2MakeDeviceCtx(
+ VpDevCtxType *pDevCtx,
+ VpVcp2DeviceObjectType *pDevObj);
+
+EXTERN bool
+Vcp2ReadCalFlag(
+ VpLineCtxType *pLineCtx);
+
+EXTERN void
+Vcp2SetCalFlag(
+ VpLineCtxType *pLineCtx,
+ bool value);
+
+#endif /* VP_CC_VCP2_SERIES */
+/******************************************************************************
+ * MELT Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+#if defined (VP_CC_MELT_SERIES)
+
+VpStatusType
+MeltMakeDeviceObject(
+ VpDevCtxType *pDevCtx,
+ VpMeltDeviceObjectType *pDevObj);
+
+VpStatusType
+MeltMakeDeviceCtx(
+ VpDevCtxType *pDevCtx,
+ VpMeltDeviceObjectType *pDevObj);
+
+EXTERN bool
+MeltReadCalFlag(
+ VpLineCtxType *pLineCtx);
+
+EXTERN void
+MeltSetCalFlag(
+ VpLineCtxType *pLineCtx,
+ bool value);
+
+#endif /* VP_CC_MELT_SERIES */
+
+/******************************************************************************
+ * MELT-792 Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+#if defined (VP_CC_MELT792_SERIES)
+
+VpStatusType
+Melt792MakeDeviceObject(
+ VpDevCtxType *pDevCtx,
+ VpMelt792DeviceObjectType *pDevObj);
+
+VpStatusType
+Melt792MakeDeviceCtx(
+ VpDevCtxType *pDevCtx,
+ VpMelt792DeviceObjectType *pDevObj);
+
+EXTERN bool
+Melt792ReadCalFlag(
+ VpLineCtxType *pLineCtx);
+
+EXTERN void
+Melt792SetCalFlag(
+ VpLineCtxType *pLineCtx,
+ bool value);
+
+#endif /* VP_CC_MELT792_SERIES */
+
+/******************************************************************************
+ * Kernel Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+#if defined (VP_CC_KWRAP)
+ #include "vp_kernel.h"
+#endif /* VP_CC_KWRAP */
+
+
+/******************************************************************************
+ * 792 Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+
+#if defined (VP_CC_792_SERIES)
+VpStatusType
+Vp792MakeDeviceObject(
+ VpDevCtxType *pDevCtx,
+ Vp792DeviceObjectType *pDevObj);
+
+VpStatusType
+Vp792MakeDeviceCtx(
+ VpDevCtxType *pDevCtx,
+ Vp792DeviceObjectType *pDevObj);
+
+#ifdef VP_CC_792_GROUP
+bool
+Vp792GroupGetEvent(
+ VpDevCtxType *pDevCtx,
+ VpEventType *pEvent);
+#endif
+#endif /* VP_CC_792_SERIES */
+
+/******************************************************************************
+ * 880 Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+#if defined (VP_CC_880_SERIES)
+
+#ifndef VP880_EC_CH1
+ #define VP880_EC_CH1 0x01
+ #define VP880_EC_CH2 0x02
+#endif
+
+#ifndef VP880_WIDEBAND_MODE
+ #define VP880_WIDEBAND_MODE 0x20
+#endif
+
+VpStatusType
+VpMakeVp880DeviceObject(
+ VpDevCtxType *pDevCtx,
+ Vp880DeviceObjectType *pDevObj);
+
+VpStatusType
+VpMakeVp880DeviceCtx(
+ VpDevCtxType *pDevCtx,
+ Vp880DeviceObjectType *pDevObj);
+
+void
+Vp880MuteChannel(
+ VpLineCtxType *pLineCtx,
+ bool mode);
+
+#if defined (VP_CSLAC_SEQ_EN) && defined (VP880_FXS_SUPPORT)
+bool
+Vp880FSKGeneratorReady(
+ VpLineCtxType *pLineCtx);
+
+VpCliEncodedDataType
+Vp880CliGetEncodedByte(
+ VpLineCtxType *pLineCtx,
+ uint8 *pByte);
+
+VpStatusType
+Vp880CtrlSetCliTone(
+ VpLineCtxType *pLineCtx,
+ bool mode);
+
+bool
+Vp880CtrlSetFSKGen(
+ VpLineCtxType *pLineCtx,
+ VpCidGeneratorControlType mode,
+ uint8 data);
+#endif
+
+VpStatusType
+Vp880SetDTMFGenerators(
+ VpLineCtxType *pLineCtx,
+ VpCidGeneratorControlType mode,
+ VpDigitType digit);
+
+VpStatusType
+Vp880SetLineStateInt(
+ VpLineCtxType *pLineCtx,
+ VpLineStateType state);
+
+VpStatusType
+Vp880SetLineTone(
+ VpLineCtxType *pLineCtx,
+ VpProfilePtrType pToneProfile,
+ VpProfilePtrType pCadProfile,
+ VpDtmfToneGenType *pDtmfControl);
+
+void
+Vp880LLSetSysState(
+ VpDeviceIdType deviceId,
+ VpLineCtxType *pLineCtx,
+ uint8 lineState,
+ bool writeToDevice);
+#endif /* VP_CC_880_SERIES */
+
+
+/******************************************************************************
+ * 890 Specific FUNCTION PROTOTYPES *
+ ******************************************************************************/
+#if defined (VP_CC_890_SERIES)
+ #include "vp890_api_int.h"
+#endif /* VP_CC_890_SERIES */
+
+
+/* Functions used internal to the API -- device dependent */
+#if defined (VP_CC_880_SERIES) \
+ || defined (VP_CC_886_SERIES) \
+ || defined (VP_CC_890_SERIES)
+
+/* Converts ms to units of API_TICKRATE */
+#define MS_TO_TICKRATE(MS, API_TICKRATE) \
+ ((uint16)(((((uint32)MS*256*2)/API_TICKRATE)+1)/2))
+#define TICKS_TO_MS(TICKS, API_TICKRATE) \
+ (uint16) (((uint32)API_TICKRATE * (uint32)TICKS) / 256)
+#define MS_TO_TICKS_ROUND_UP(MS, API_TICKRATE) \
+ ((uint16)(((((uint32)MS*256*2 + API_TICKRATE - 1)/API_TICKRATE)+1)/2))
+/* Gives frequency in units of 0.3662109375 Hz for signal generators */
+#define TICKRATE_TO_HZ(API_TICKRATE) \
+ ((uint16)((uint32)(0x80000000 / API_TICKRATE) / 0x0C00))
+
+#define NOOP_CMD 0x06 /**< Standard No operation comnmand for all devices */
+
+#define MAX_CFAIL_TEST 10
+#define CFAIL_TEST_INTERVAL 10
+
+/**< CallerID Profile Data structure definitions */
+#define VP_FSK_MARK_SIGNAL 0xFF
+#define VP_FSK_CHAN_SEIZURE 0x55
+#define VP_FSK_DATA 0x11 /* Anything NOT Mark or C.S is ok */
+#define VP_FSK_NONE 0x00 /* When FSK Generator is not being used */
+
+typedef enum VpApiElementsType {
+ VP_CLI_NULL = 0,
+ VP_CLI_POLREV = 0x01, /**< No Parameters */
+ VP_CLI_MUTEON = 0x02, /**< No Parameters */
+ VP_CLI_MUTEOFF = 0x03, /**< No Parameters */
+ VP_CLI_ALERTTONE = 0x04, /**< Duration/Tone definition parameters */
+ VP_CLI_ALERTTONE2 = 0x05, /**< Internal Alert Tone indicator */
+ VP_CLI_SILENCE = 0x06, /**< Duration Parameter */
+ VP_CLI_SILENCE_MASKHOOK = 0x07, /**< Duration/Masked-hook length parameters */
+ VP_CLI_DETECT = 0x08, /**< Tone and Timeout parameters */
+ VP_CLI_CHANSEIZURE = 0x09, /**< Duration Parameter */
+ VP_CLI_MARKSIGNAL = 0x0A, /**< Duration Parameter */
+ VP_CLI_MESSAGE = 0x0B, /**< No Parameters */
+ VP_CLI_USER_DEFINED = 0x0C, /**< Not supported in API-II */
+ VP_CLI_EOT = 0x0D, /**< No Parameters */
+ VP_CLI_DTMF_MESSAGE = 0x0E, /**< Message data to be sent in DTMF format */
+ VP_CLI_ELM_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpApiElementsType;
+
+/* VP API Function Prototypes - Not associated with a function pointer */
+#if defined (VP_CC_880_SERIES) \
+ || defined (VP_CC_886_SERIES) \
+ || defined (VP_CC_890_SERIES)
+
+#ifdef VP_CC_890_SERIES
+VpStatusType
+Vp890InitDevicePcnRcn(
+ Vp890DeviceObjectType *pDevObj,
+ VpDeviceIdType deviceId);
+#endif
+
+#ifdef VP_CC_880_SERIES
+VpStatusType
+Vp880InitDevicePcnRcn(
+ Vp880DeviceObjectType *pDevObj,
+ VpDeviceIdType deviceId);
+#endif
+
+#ifdef VP_CC_886_SERIES
+VpStatusType
+Vp886InitDevicePcnRcn(
+ VpDevCtxType *pDevCtx);
+#endif
+
+bool
+VpIsLowPowerTermType(
+ VpTermType termType);
+
+void
+VpCSLACClearMPIBuffer(
+ VpDeviceIdType deviceId);
+
+bool
+VpCSLACIsProfileValid(
+ VpProfileType profType,
+ int16 tableSize,
+ uint16 profEntry,
+ VpProfilePtrType *pProfTable,
+ VpProfilePtrType pProfileInput,
+ VpProfilePtrType *pProfileRslt);
+
+bool
+VpCSLACSetTimer(
+ uint16 *pTimer,
+ uint16 newValue);
+
+#endif
+
+int16
+VpConvertToInt16(
+ uint8 *dataPtr);
+
+int32
+VpConvertToInt32(
+ uint8 *dataPtr);
+
+#if defined(VP_CC_880_SERIES) || defined(VP_CC_890_SERIES) \
+ || defined(VP_CC_886_SERIES)
+VpStatusType
+VpCSLACSetAbsGain(
+ VpLineCtxType *pLineCtx,
+ VpOptionAbsGainType *gains);
+#endif /* defined(VP_CC_880_SERIES) || defined(VP_CC_890_SERIES)
+ || defined(VP_CC_886_SERIES) */
+
+#if defined(VP_CC_880_SERIES) || defined(VP_CC_890_SERIES)
+
+#if defined(VP880_FXS_SUPPORT) || defined(VP890_FXS_SUPPORT)
+/* Function only used for VP_LINE_HOWLER and VP_LINE_HOWLER_POLREV states */
+#ifdef VP_HIGH_GAIN_MODE_SUPPORTED
+void
+VpCLSACHighGainMode(
+ VpLineCtxType *pLineCtx,
+ bool highGainMode);
+
+VpStatusType
+VpCSLACHowlerStateMgmt(
+ VpLineCtxType *pLineCtx,
+ VpLineStateType fromState,
+ VpLineStateType toState,
+ VpLineStateType statePriorToHowler); /**< Used only when exiting Howler State */
+#endif
+
+bool
+VpCSLACIsSupportedFxsState(
+ VpDeviceType deviceType,
+ VpLineStateType state);
+#endif /* defined(VP880_FXS_SUPPORT) || defined(VP890_FXS_SUPPORT) */
+#endif /* defined(VP_CC_880_SERIES) || defined(VP_CC_890_SERIES) */
+
+VpProfileCadencerStateTypes
+ConvertApiState2PrfWizState(
+ const VpLineStateType state);
+
+VpLineStateType
+ConvertPrfWizState2ApiState(
+ uint8 state);
+
+void
+InitTimerVars(
+ VpLineCtxType *pLineCtx);
+
+bool
+VpUpdateDP(
+ uint16 tickRate,
+ VpOptionPulseType *pPulseSpecs,
+ VpDialPulseDetectType *pDpStruct,
+ VpOptionEventMaskType *pLineEvents);
+
+void
+VpInitDP(
+ VpDialPulseDetectType *pDpStruct);
+
+VpStatusType
+VpCSLACGetLineStatus(
+ VpLineCtxType *pLineCtx,
+ VpInputType input,
+ bool *pStatus);
+
+#if !defined(VP_REDUCED_API_IF)
+VpStatusType
+VpCSLACClearResults(
+ VpDevCtxType *pDevCtx);
+#endif
+
+VpStatusType
+VpCSLACDtmfDigitDetected(
+ VpLineCtxType *pLineCtx,
+ VpDigitType digit,
+ VpDigitSenseType sense);
+
+VpLineStateType
+VpGetReverseState(
+ VpLineStateType currentState);
+
+#if defined(VP_CC_880_SERIES) || defined(VP_CC_890_SERIES)
+void
+VpCSLACSetVas(
+ uint8 *dcFeed,
+ uint16 vasValue);
+
+bool
+VpCSLACGetCodecReg(
+ VpOptionCodecType codec,
+ uint8 *codecReg);
+#endif
+
+#ifdef CSLAC_GAIN_RELATIVE
+void
+VpConvertFixed2Csd(
+ uint16 fixed,
+ uint8 *csdBuf);
+
+uint16
+VpConvertCsd2Fixed(
+ uint8 *csdBuf);
+#endif
+#endif
+
+
+#if defined(VP_CC_880_SERIES) || defined(VP_CC_886_SERIES) \
+ || defined(VP_CC_890_SERIES) || defined(VP_CC_MELT792_SERIES)
+int32
+VpRoundedDivide(
+ int32 x,
+ int32 y);
+#endif
+
+#if defined (VP_CC_886_SERIES)
+
+VpStatusType
+VpMakeVp886DeviceObject(
+ VpDevCtxType *pDevCtx,
+ Vp886DeviceObjectType *pDevObj);
+
+VpStatusType
+VpMakeVp886DeviceCtx(
+ VpDevCtxType *pDevCtx,
+ Vp886DeviceObjectType *pDevObj);
+
+#endif
+
+uint16
+VpComputeSquareRoot(
+ uint32 number);
+
+#if defined(VP886_INCLUDE_DTMF_DETECT) || defined(VP886_INCLUDE_TESTLINE_CODE)
+int32
+VpCompute_ln(
+ uint16 number);
+
+int32
+VpCompute_log10(
+ uint16 number);
+
+int32
+VpTableInterpolate(
+ const int32 table[][2],
+ uint16 size,
+ int32 x,
+ bool reverse);
+#endif
+
+#endif /* VP_API_INT_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_option.h b/marvell/services/mislic/api_lib/includes/vp_api_option.h
new file mode 100644
index 0000000..8ecb505
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_option.h
@@ -0,0 +1,558 @@
+/** \file vp_api_option.h
+ * vp_api_option.h
+ *
+ * This file contains declaration associated with VP-API Options.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12587 $
+ * $LastChangedDate: 2018-06-21 17:22:20 -0500 (Thu, 21 Jun 2018) $
+ */
+
+#ifndef VP_API_OPTION
+#define VP_API_OPTION
+
+#include "vp_api_types.h"
+#include "vp_api_cfg.h"
+#include "vp_api_event.h"
+
+/* Option IDs. (See Options chapter in VP-API-2 Reference Guide.)
+ * Line-specific option IDs begin with "VP_OPTION_ID_". Device-specific
+ * option IDs begin with "VP_DEVICE_OPTION_ID_". When new option IDs are added,
+ * the VpOptionValueType struct (below) must be updated accordingly.
+ */
+typedef enum VpOptionIdType {
+ VP_DEVICE_OPTION_ID_PULSE = 0x00,
+ VP_DEVICE_OPTION_ID_CRITICAL_FLT = 0x01,
+ VP_OPTION_ID_ZERO_CROSS = 0x02,
+ VP_DEVICE_OPTION_ID_RAMP2STBY = 0x03,
+ VP_OPTION_ID_PULSE_MODE = 0x04,
+ VP_OPTION_ID_TIMESLOT = 0x05,
+ VP_OPTION_ID_CODEC = 0x06,
+ VP_OPTION_ID_PCM_HWY = 0x07,
+ VP_OPTION_ID_LOOPBACK = 0x08,
+ VP_OPTION_ID_LINE_STATE = 0x09,
+ VP_OPTION_ID_EVENT_MASK = 0x0A,
+ VP_OPTION_ID_RESERVED_1 = 0x0B,
+ VP_OPTION_ID_RING_CNTRL = 0x0C,
+ VP_OPTION_ID_RESERVED_2 = 0x0D,
+ VP_OPTION_ID_DTMF_MODE = 0x0E,
+ VP_DEVICE_OPTION_ID_DEVICE_IO = 0x0F,
+ VP_OPTION_ID_RESERVED_EVENT_MASK_VCP = 0x10,
+ VP_OPTION_ID_PCM_TXRX_CNTRL = 0x11,
+ VP_DEVICE_OPTION_ID_PULSE2 = 0x12,
+ VP_OPTION_ID_LINE_IO_CFG = 0x13,
+ VP_DEVICE_OPTION_ID_DEV_IO_CFG = 0x14,
+ VP_OPTION_ID_DTMF_SPEC = 0x15,
+ VP_DEVICE_OPTION_ID_PARK_MODE = 0x16,
+ VP_OPTION_ID_DCFEED_SLOPE = 0x17,
+ VP_OPTION_ID_SWITCHER_CTRL = 0x18,
+ VP_OPTION_ID_HOOK_DETECT_MODE = 0x19,
+ VP_OPTION_ID_AUTO_LOOP_COND = 0x1A,
+ VP_OPTION_ID_DCFEED_PARAMS = 0x1B,
+ VP_OPTION_ID_RINGING_PARAMS = 0x1C,
+ VP_OPTION_ID_GND_FLT_PROTECTION = 0x1D,
+ VP_DEVICE_OPTION_ID_ADAPTIVE_RINGING = 0x1E,
+ VP_OPTION_ID_RINGTRIP_CONFIRM = 0x1F,
+ VP_DEVICE_OPTION_ID_RING_PHASE_SYNC = 0x20,
+ VP_OPTION_ID_HIGHPASS_FILTER = 0x21,
+ VP_DEVICE_OPTION_ID_FSYNC_RATE = 0x22,
+ VP_OPTION_ID_DTMF_PARAMS = 0x23,
+ VP_OPTION_ID_PULSE = 0x24,
+ VP_OPTION_ID_DEBUG_SELECT = 0x25,
+ VP_OPTION_ID_ABS_GAIN = 0x26,
+ VP_DEVICE_OPTION_ID_PCM_SIG_CTL = 0x27,
+ VP_OPTION_ID_LINESTATE_CTL_MODE = 0x28,
+ VP_DEVICE_OPTION_ID_SEALING_CURRENT = 0x29,
+ VP_DEVICE_OPTION_ID_ACCESS_CTRL = 0x2A,
+ VP_DEVICE_OPTION_ID_SPI_ERROR_CTRL = 0x2B,
+
+ VP_NUM_OPTION_IDS
+} VpOptionIdType;
+
+/** Parameters for dial pulse, flash, and on-hook */
+typedef struct VpOptionPulseType {
+ uint16 breakMin; /**< Minimum pulse break time (in 125uS) */
+ uint16 breakMax; /**< Maximum pulse break time (in 125uS) */
+ uint16 makeMin; /**< Minimum pulse make time (in 125uS) */
+ uint16 makeMax; /**< Maximum pulse make time (in 125uS) */
+ uint16 interDigitMin; /**< Minimum pulse interdigit time (in 125uS) */
+ uint16 flashMin; /**< Minimum flash break time (in 125uS) */
+ uint16 flashMax; /**< Maximum flash break time (in 125uS) */
+#ifdef EXTENDED_FLASH_HOOK
+ uint16 onHookMin; /**< Minimum on-hook time (in 125uS) */
+#endif
+#ifdef VP_ENABLE_OFFHOOK_MIN
+ uint16 offHookMin; /**< Minimum off-hook time (in 125uS) */
+#endif
+} VpOptionPulseType;
+
+typedef struct VpOptionLinePulseType {
+ uint16 breakMin; /**< Minimum pulse break time (in 125uS) */
+ uint16 breakMax; /**< Maximum pulse break time (in 125uS) */
+ uint16 makeMin; /**< Minimum pulse make time (in 125uS) */
+ uint16 makeMax; /**< Maximum pulse make time (in 125uS) */
+ uint16 interDigitMin; /**< Minimum pulse interdigit time (in 125uS) */
+ uint16 flashMin; /**< Minimum flash break time (in 125uS) */
+ uint16 flashMax; /**< Maximum flash break time (in 125uS) */
+ uint16 onHookMin; /**< Minimum on-hook time (in 125uS) */
+ uint16 offHookMin; /**< Minimum off-hook time (in 125uS) */
+} VpOptionLinePulseType;
+
+/** Method for line control when critical faults are detected */
+typedef struct VpOptionCriticalFltType {
+ /**< The line is set to disconnect when the specified fault is active and
+ * the "En" bit is set TRUE
+ */
+ bool acFltDiscEn; /**< AC fault detected */
+ bool dcFltDiscEn; /**< DC fault detected */
+ bool thermFltDiscEn; /**< Thermal fault detected */
+} VpOptionCriticalFltType;
+
+/** Method for zero-cross control */
+typedef enum VpOptionZeroCrossType {
+ VP_OPTION_ZC_M4B = 0, /**< Zero-Cross On - Make before break */
+ VP_OPTION_ZC_B4M = 1, /**< Zero-Cross On - Break before make */
+ VP_OPTION_ZC_NONE = 2, /**< Turn Zero-Cross control off */
+ VP_OPTION_ZC_ENUM_RSVD = FORCE_SIGNED_ENUM,
+ VP_OPTION_ZC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */
+} VpOptionZeroCrossType;
+
+/** Dial Pulse decode enable/disable */
+typedef enum VpOptionPulseModeType {
+ VP_OPTION_PULSE_DECODE_OFF = 0, /**< Disable Pulse Decode */
+ VP_OPTION_PULSE_DECODE_ON = 1, /**< Enable Pulse Decode */
+ VP_OPTION_PULSE_DECODE_BRIDGING = 2, /**< Enable Pulse Decode (With Bridging) */
+ VP_OPTION_PULSE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionPulseModeType;
+
+/** Transmit/Receive Timeslot setting (timeslot and control) */
+typedef struct VpOptionTimeslotType {
+ uint8 tx; /**< 8-bit TX timeslot */
+ uint8 rx; /**< 8-bit RX timeslot */
+} VpOptionTimeslotType;
+
+typedef enum VpOptionCodecType {
+ VP_OPTION_ALAW = 0, /**< Select G.711 A-Law PCM encoding */
+ VP_OPTION_MLAW = 1, /**< Select G.711 Mu-Law PCM encoding */
+ VP_OPTION_LINEAR = 2, /**< Select Linear PCM encoding */
+ VP_OPTION_WIDEBAND = 3, /**< Select Wideband Linear PCM encoding */
+ VP_OPTION_LINEAR_WIDEBAND = VP_OPTION_WIDEBAND,
+ VP_OPTION_ALAW_WIDEBAND = 4, /**< Select Wideband A-Law PCM encoding */
+ VP_OPTION_MLAW_WIDEBAND = 5, /**< Select Wideband Mu-Law PCM encoding */
+ VP_NUM_OPTION_CODEC_TYPE_IDS,
+ VP_OPTION_CODEC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionCodecType;
+
+/** PCM Highway Selection (B valid on select devices only) */
+typedef enum VpOptionPcmHwyType {
+ VP_OPTION_HWY_A = 0, /**< Select the 'A' PCM Highway */
+ VP_OPTION_HWY_B = 1, /**< Select the 'B' PCM Highway */
+ VP_OPTION_HWY_TX_A_RX_B = 2, /**< Transmit on Highway A, receive on B */
+ VP_OPTION_HWY_TX_B_RX_A = 3, /**< Transmit on Highway A, receive on A */
+ VP_OPTION_HWY_TX_AB_RX_A = 4, /**< Transmit on Highway A and B, receive on A */
+ VP_OPTION_HWY_TX_AB_RX_B = 5, /**< Transmit on Highway A and B, receive on B */
+ VP_OPTION_HWY_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionPcmHwyType;
+
+/** Loopback option selection */
+typedef enum VpOptionLoopbackType {
+ VP_OPTION_LB_OFF = 0, /**< All loopbacks off */
+
+ /* Following loopback options are supported for CSLAC and VCP only */
+ VP_OPTION_LB_TIMESLOT = 1, /**< Perform a timeslot loopback */
+ VP_OPTION_LB_DIGITAL = 2, /**< Perform a full-digital loopback */
+ VP_OPTION_LB_CHANNELS = 3, /**< Connects FXO to FXS line on same device */
+ VP_OPTION_LB_TIMESLOT_WITH_DAC = 4, /**< Perform a timeslot loopback with DAC enabled */
+
+ VP_NUM_LB_OPTIONS,
+ VP_OPTION_LB_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionLoopbackType;
+
+/** Active Line State battery supply selection */
+typedef enum VpOptionBatType {
+ VP_OPTION_BAT_AUTO = 0, /**< Automatic Batery selection */
+ VP_OPTION_BAT_HIGH = 1, /**< Use High Batery */
+ VP_OPTION_BAT_LOW = 2, /**< Use Low Batery */
+ VP_OPTION_BAT_BOOST = 3, /**< Include Positive Batery */
+ VP_NUM_OPTION_BAT_IDS,
+ VP_OPTION_BAT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionBatType;
+
+/** Active Line State battery supply selection */
+typedef struct VpOptionLineStateType {
+ bool battRev; /**< Smooth/Abrupt Battery Reversal (TRUE = abrupt) */
+
+ VpOptionBatType bat; /**< Battery selection for Active line state */
+} VpOptionLineStateType;
+
+/** Ring control option */
+typedef enum VpLineStateType {
+
+ /* FXS */
+ VP_LINE_STANDBY = 0x00, /**< Low power line feed state */
+ VP_LINE_TIP_OPEN = 0x01, /**< Tip open circuit state */
+ VP_LINE_ACTIVE = 0x02, /**< Line Feed w/out VF */
+ VP_LINE_ACTIVE_POLREV = 0x03, /**< Polarity Reversal Line Feed w/out VF */
+ VP_LINE_TALK = 0x04, /**< Normal off-hook Active State; Voice Enabled */
+ VP_LINE_TALK_POLREV = 0x05, /**< Normal Active with reverse polarity; Voice Enabled */
+ VP_LINE_OHT = 0x06, /**< On-Hook tranmission state */
+ VP_LINE_OHT_POLREV = 0x07, /**< Polarity Reversal On-Hook tranmission state */
+ VP_LINE_DISCONNECT = 0x08, /**< Denial of service */
+ VP_LINE_RINGING = 0x09, /**< Ringing state */
+ VP_LINE_RINGING_POLREV = 0x0A, /**< Ringing w/Polarity Reversal */
+ VP_LINE_STANDBY_POLREV = 0x10, /**< Low power polrev line feed state */
+ VP_LINE_PARK = 0x11, /**< Park mode */
+ VP_LINE_RING_OPEN = 0x12, /**< Ring open */
+ VP_LINE_HOWLER = 0x13, /**< Howler */
+ VP_LINE_TESTING = 0x14, /**< Testing */
+ VP_LINE_DISABLED = 0x15, /**< Disabled */
+ VP_LINE_NULLFEED = 0x16, /**< Null-feed */
+ VP_LINE_HOWLER_PCM = 0x17, /**< Howler with PCM highway enabled */
+ VP_LINE_HOWLER_POLREV = 0x18, /**< Howler with Polarity Reversal */
+
+ /* FXO */
+ VP_LINE_FXO_OHT, /**< FXO Line providing Loop Open w/VF */
+ VP_LINE_FXO_LOOP_OPEN, /**< FXO Line providing Loop Open w/out VF */
+ VP_LINE_FXO_LOOP_CLOSE, /**< FXO Line providing Loop Close w/out VF */
+ VP_LINE_FXO_TALK, /**< FXO Line providing Loop Close w/VF */
+ VP_LINE_FXO_RING_GND, /**< FXO Line providing Ring Ground (GS only)*/
+
+ VP_NUM_LINE_STATES,
+ VP_LINE_STATE_ENUM_RSVD = FORCE_SIGNED_ENUM,
+ VP_LINE_STATE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpLineStateType;
+
+typedef struct VpOptionRingControlType {
+ VpOptionZeroCrossType zeroCross; /**< LCAS zero cross control */
+
+ uint16 ringExitDbncDur; /**< Ringing Exit Debounce Duration; Used during end
+ * of ON periods of ringing cadences; 125uS
+ * resolution
+ */
+
+ VpLineStateType ringTripExitSt; /**< State to automatically switch to upon
+ * ring trip
+ */
+} VpOptionRingControlType;
+
+/** DTMF detection option */
+typedef enum VpOptionDtmfModeControlType {
+ VP_OPTION_DTMF_DECODE_OFF = 0, /**< Disable DTMF Digit Decode */
+ VP_OPTION_DTMF_DECODE_ON = 1, /**< Enable DTMF Digit Decode */
+ VP_OPTION_DTMF_GET_STATUS = 2, /**< Do not change anything; Just get the DTMF status */
+ VP_NUM_OPTION_DTMF_IDS,
+ VP_OPTION_DTMF_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionDtmfModeControlType;
+
+/* Device I/O Option related definitions */
+typedef enum VpDeviceIoDirectionType {
+ VP_IO_INPUT_PIN = 0, /* Configure GPIO pin as input pin */
+ VP_IO_OUTPUT_PIN = 1, /* Configure GPIO pin as output pin */
+ VP_IO_DIR_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpDeviceIoDirectionType;
+
+typedef enum VpDeviceOutputPinType {
+ VP_OUTPUT_DRIVEN_PIN = 0, /* Configure as TTL/CMOS output pin */
+ VP_OUTPUT_OPEN_PIN = 1, /* Configure as open collector/drain output pin */
+ VP_OUTPUT_TYPE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpDeviceOutputPinType;
+
+typedef struct VpOptionDeviceIoType {
+ uint32 directionPins_31_0; /* Device specific IO pin direction
+ * (Pins 0 - 31) */
+ uint32 directionPins_63_32; /* Device specific IO pin direction
+ * (Pins 32 - 63) */
+
+ uint32 outputTypePins_31_0; /* Output pin type (Pins 0 - 31) */
+ uint32 outputTypePins_63_32; /* Output pin type (Pins 32 - 63) */
+} VpOptionDeviceIoType;
+
+/* Definition for line I/O config option */
+typedef struct VpOptionLineIoConfigType {
+ uint8 direction;
+ uint8 outputType;
+} VpOptionLineIoConfigType;
+
+/* Definition for device I/O config option */
+typedef struct VpOptionDeviceIoConfigType {
+ VpOptionLineIoConfigType lineIoConfig[VP_MAX_LINES_PER_DEVICE];
+} VpOptionDeviceIoConfigType;
+
+typedef enum VpOptionPcmTxRxCntrlType {
+ VP_OPTION_PCM_BOTH = 0, /* Enable both PCM transmit and receive paths */
+ VP_OPTION_PCM_RX_ONLY = 1, /* Enable PCM receive path only */
+ VP_OPTION_PCM_TX_ONLY = 2, /* Enable PCM transmit path only */
+ VP_OPTION_PCM_ALWAYS_ON = 3, /* Prevents disabling of PCM path */
+ VP_OPTION_PCM_OFF = 4, /* Disable both PCM transmit and receive */
+ VP_PCM_TXRX_CNTRL_ENUM_RSVD = FORCE_SIGNED_ENUM,
+ VP_PCM_TXRX_CNTRL_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionPcmTxRxCntrlType;
+
+/** Direction Specification */
+typedef enum VpDirectionType {
+ VP_DIRECTION_DS,
+ VP_DIRECTION_US,
+ VP_DIRECTION_INVALID, /**< Used by the API to determine if the direction
+ * field is valid */
+ VP_DIRECTION_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpDirectionType;
+
+#define VP_LINE_FLAG_BYTES ((VP_MAX_LINES_PER_DEVICE + 7) / 8)
+
+/** DTMF detection option control */
+typedef struct VpOptionDtmfModeType {
+ VpOptionDtmfModeControlType dtmfControlMode; /**< DTMF detection
+ * Enable/Disable */
+ VpDirectionType direction; /**< Detection direction */
+ uint32 dtmfDetectionSetting; /**< Indicates the DTMF
+ * detection setting for first
+ * 32 lines */
+ uint8 dtmfResourcesRemaining; /**< DTMF decoder resources
+ * remaining */
+ uint8 dtmfDetectionEnabled[VP_LINE_FLAG_BYTES];
+ /**< DTMF detection setting for
+ * lines 7-0, 15-8, etc. */
+} VpOptionDtmfModeType;
+
+/** Regional DTMF Specs */
+typedef enum VpOptionDtmfSpecType {
+ VP_OPTION_DTMF_SPEC_ATT = 0, /* Q.24 AT&T */
+ VP_OPTION_DTMF_SPEC_NTT = 1, /* Q.24 NTT */
+ VP_OPTION_DTMF_SPEC_AUS = 2, /* Q.24 Australian */
+ VP_OPTION_DTMF_SPEC_BRZL = 3, /* Q.24 Brazilian */
+ VP_OPTION_DTMF_SPEC_ETSI = 4, /* ETSI ES 201 235-3 v1.3.1 */
+ VP_OPTION_DTMF_SPEC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionDtmfSpecType;
+
+/**< The following types are for Park Mode options */
+typedef struct VpOptionParkModeType {
+ uint16 discTime; /**< Specified in 500ms increments, up to 8 seconds */
+ uint16 standbyTime; /**< Specified in 100ms increments, up to 8 seconds */
+} VpOptionParkModeType;
+
+/** Hook detection modes */
+typedef enum VpOptionHookDetectModeType {
+ VP_OPTION_HOOKDET_NORMAL = 0, /* normal hook detection behavior */
+ VP_OPTION_HOOKDET_DISC_IS_ONHOOK = 1, /* in the VP_LINE_DISCONNECT or VP_LINE_DISABLED
+ state, the hook status is always considered
+ to be on-hook */
+ VP_OPTION_HOOKDET_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionHookDetectModeType;
+
+/* Option value struct for VP_OPTION_ID_AUTO_LOOP_COND: */
+typedef enum VpLoopCondSelectType {
+ VP_LOOP_COND_NONE = 0x0000, /* feature disabled */
+ VP_LOOP_COND_RLOOP = 0x0001, /* read loop resistance */
+ VP_LOOP_COND_ILG = 0x0002, /* read longitudinal (common mode) current */
+ VP_LOOP_COND_IMT = 0x0004, /* read metallic (differential) current */
+ VP_LOOP_COND_VSAB = 0x0008, /* read metallic (differential) voltage */
+ VP_LOOP_COND_SELECTEDBAT = 0x0010, /* report currently-selected battery */
+ VP_LOOP_COND_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpLoopCondSelectType;
+
+typedef struct VpOptionAutoLoopCondType {
+ uint16 select; /* bitmask (multiple VpLoopCondSelectType values can be ORed
+ together */
+ uint16 delay; /* amount of time (in ms) after HOOK_OFF before
+ measurement(s) */
+} VpOptionAutoLoopCondType;
+
+/* Definition for Absolute Level option */
+typedef struct VpOptionAbsGainType {
+ int16 gain_AToD;
+ int16 gain_DToA;
+} VpOptionAbsGainType;
+
+#define VP_OPTION_ABS_GAIN_QUIET (-32767)
+#define VP_OPTION_ABS_GAIN_RESTORE (-32768)
+#define VP_OPTION_ABS_GAIN_NO_CHANGE (+32767)
+#define VP_ABS_GAIN_UNKNOWN (VP_OPTION_ABS_GAIN_NO_CHANGE - 1)
+
+/* Option value struct for VP_DEVICE_OPTION_ID_PCM_SIG_CTL: */
+typedef struct VpOptionPcmSigCtlType {
+ bool enable;
+ uint8 ctlTimeslot;
+ uint8 sigTimeslot;
+} VpOptionPcmSigCtlType;
+
+/* Option value struct for VP_OPTION_ID_LINESTATE_CTL_MODE: */
+typedef enum VpOptionLinestateCtlModeType {
+ VP_OPTION_LINESTATE_CTL_NORMAL = 0x0000,
+ VP_OPTION_LINESTATE_CTL_PCM = 0x0080
+} VpOptionLinestateCtlModeType;
+
+/* Option value struct for VP_OPTION_ID_DCFEED_PARAMS: */
+typedef struct VpOptionDcFeedParamsType {
+ uint32 validMask;
+ int32 voc;
+ int32 ila;
+ int32 hookThreshold;
+ int32 lpHookThreshold;
+ int32 gkeyThreshold;
+ int32 battFloor;
+} VpOptionDcFeedParamsType;
+
+#define VP_OPTION_CFG_VOC (0x00000001L)
+#define VP_OPTION_CFG_ILA (0x00000002L)
+#define VP_OPTION_CFG_HOOK_THRESHOLD (0x00000004L)
+#define VP_OPTION_CFG_LP_HOOK_THRESHOLD (0x00000008L)
+#define VP_OPTION_CFG_GKEY_THRESHOLD (0x00000010L)
+#define VP_OPTION_CFG_BATT_FLOOR (0x00000020L)
+
+/* Option value struct for VP_OPTION_ID_RINGING_PARAMS: */
+typedef struct VpOptionRingingParamsType {
+ uint32 validMask;
+ int32 frequency;
+ int32 amplitude;
+ int32 dcBias;
+ int32 ringTripThreshold;
+ int32 ringCurrentLimit;
+ int32 trapRiseTime;
+} VpOptionRingingParamsType;
+
+#define VP_OPTION_CFG_FREQUENCY (0x00000001L)
+#define VP_OPTION_CFG_AMPLITUDE (0x00000002L)
+#define VP_OPTION_CFG_DC_BIAS (0x00000004L)
+#define VP_OPTION_CFG_RINGTRIP_THRESHOLD (0x00000008L)
+#define VP_OPTION_CFG_RING_CURRENT_LIMIT (0x00000010L)
+#define VP_OPTION_CFG_TRAP_RISE_TIME (0x00000020L)
+
+/* Mode values for VP_DEVICE_OPTION_ID_ADAPTIVE_RINGING */
+typedef enum VpAdaptiveRingingModeType {
+ VP_ADAPT_RING_SHARED_TRACKER = 0x0, /* For shared tracker supplies */
+ VP_ADAPT_RING_SHARED_BB_ABS = 0x1, /* For Buck Boost ABS supplies */
+ VP_ADAPT_RING_SINGLE_BB_TRACKER = 0x2, /* For Buck Boost single channel tracker supplies */
+ VP_ADAPT_RING_FIXED_TRACKER = 0x3, /* For all fixed tracking supplies */
+ VP_ADAPT_RING_FULL_TRACKER = 0x4, /* For non-fixed tracking supplies */
+ VP_ADAPT_RING_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpAdaptiveRingingModeType;
+
+/* Option value struct for VP_DEVICE_OPTION_ID_ADAPTIVE_RINGING: */
+typedef struct VpOptionAdaptiveRingingType {
+ uint32 validMask;
+ uint8 power;
+ uint8 minVoltagePercent;
+ VpAdaptiveRingingModeType mode;
+} VpOptionAdaptiveRingingType;
+
+#define VP_ADAPTIVE_RINGING_CFG_POWER (0x0001L)
+#define VP_ADAPTIVE_RINGING_CFG_MIN_V_PCT (0x0002L)
+#define VP_ADAPTIVE_RINGING_CFG_MODE (0x0004L)
+
+/* To disable VP_DEVICE_OPTION_ID_ADAPTIVE_RINGING, 'power' can be set to 0xFF. */
+#define VP_ADAPTIVE_RINGING_DISABLED 0xFF
+
+/* Option value struct for VP_OPTION_ID_GND_FLT_PROTECTION: */
+typedef struct VpOptionGndFltProtType {
+ bool enable;
+ uint16 confirmTime; /* 10ms units */
+ uint16 pollTime; /* 10ms units */
+ uint16 pollNum;
+} VpOptionGndFltProtType;
+
+/* Option values for VP_DEVICE_OPTION_ID_RING_PHASE_SYNC: */
+typedef enum VpOptionRingPhaseSyncType {
+ VP_RING_PHASE_SYNC_DISABLE = 0,
+ VP_RING_PHASE_SYNC_90_OFFSET = 1 /* 90 degree offset between channels */
+} VpOptionRingPhaseSyncType;
+
+/* Option values for VP_OPTION_ID_HIGHPASS_FILTER: */
+typedef enum VpOptionHighPassFilterType {
+ VP_HIGHPASS_FILTER_DISABLE = 0,
+ VP_HIGHPASS_FILTER_ENABLE = 1
+} VpOptionHighPassFilterType;
+
+/* Option values for VP_DEVICE_OPTION_ID_FSYNC_RATE: */
+typedef enum VpOptionFsyncRateType {
+ VP_FSYNC_RATE_8KHZ = 0,
+ VP_FSYNC_RATE_16KHZ = 1
+} VpOptionFsyncRateType;
+
+/* Option values for VP_OPTION_ID_DTMF_PARAMS: */
+typedef struct VpOptionDtmfParamsType {
+ uint32 validMask;
+ int32 minDetect;
+ int32 rowToColLimit;
+ int32 colToRowLimit;
+} VpOptionDtmfParamsType;
+
+#define VP_OPTION_CFG_MIN_DETECT (0x00000001L)
+#define VP_OPTION_CFG_ROW_TO_COL_LIMIT (0x00000002L)
+#define VP_OPTION_CFG_COL_TO_ROW_LIMIT (0x00000004L)
+
+typedef struct {
+ uint16 sealApplyTime; /* on-time for sealing current */
+ uint16 sealOffTime; /* off-time for sealing current */
+ uint16 batteryOffset; /* Driver headroom from the power rail */
+ uint32 selMask_31_0; /* DSL line selection bitmask */
+ uint32 selMask_63_32; /* DSL line selection bitmask */
+ uint32 selMask_95_64; /* DSL line selection bitmask */
+ uint32 selMask_127_96; /* DSL line selection bitmask */
+} VpOptionSealingCurrentType;
+
+typedef enum {
+ VP_ACCESS_CTRL_NORMAL = 0, /* Do not block anything */
+ VP_ACCESS_CTRL_BLOCK_DEVICE = 1, /* Block all functions that access the device */
+
+ VP_ACCESS_CTRL_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpOptionAccessCtrlType;
+
+typedef enum {
+ VP_SPI_ERROR_MODE_BLOCK = 0,
+ VP_SPI_ERROR_MODE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpSpiErrorModeType;
+
+typedef struct {
+ VpSpiErrorModeType mode;
+ uint16 count;
+} VpOptionSpiErrorCtrlType;
+
+/* The following struct can be passed to VpGetResults() if the option ID is not
+ known at compile time, to ensure that the buffer is large enough regardless
+ of the option type. */
+typedef union VpOptionValueType {
+ VpOptionPulseType pulse; /* VP_DEVICE_OPTION_ID_PULSE */
+ /* VP_DEVICE_OPTION_ID_PULSE2 */
+ VpOptionCriticalFltType criticalFlt; /* VP_DEVICE_OPTION_ID_CRITICAL_FLT */
+ VpOptionZeroCrossType zeroCross; /* VP_OPTION_ID_ZERO_CROSS */
+ uint16 ramp2stby; /* VP_DEVICE_OPTION_ID_RAMP2STBY */
+ VpOptionPulseModeType pulseMode; /* VP_OPTION_ID_PULSE_MODE */
+ VpOptionTimeslotType timeslot; /* VP_OPTION_ID_TIMESLOT */
+ VpOptionCodecType codec; /* VP_OPTION_ID_CODEC */
+ VpOptionPcmHwyType pcmHwy; /* VP_OPTION_ID_PCM_HWY */
+ VpOptionLoopbackType loopback; /* VP_OPTION_ID_LOOPBACK */
+ VpOptionLineStateType lineState; /* VP_OPTION_ID_LINE_STATE */
+ VpOptionEventMaskType eventMask; /* VP_OPTION_ID_EVENT_MASK */
+ VpOptionRingControlType ringControl; /* VP_OPTION_ID_RING_CNTRL */
+ VpOptionDtmfModeType dtmfMode; /* VP_OPTION_ID_DTMF_MODE */
+ VpOptionDeviceIoType deviceIo; /* VP_DEVICE_OPTION_ID_DEVICE_IO */
+ VpOptionPcmTxRxCntrlType pcmTxRxCntrl; /* VP_OPTION_ID_PCM_TXRX_CNTRL */
+ VpOptionDeviceIoConfigType deviceIoConfig; /* VP_DEVICE_OPTION_ID_DEV_IO_CFG */
+ VpOptionLineIoConfigType lineIoConfig; /* VP_OPTION_ID_LINE_IO_CFG */
+ VpOptionDtmfSpecType dtmfSpec; /* VP_OPTION_ID_DTMF_SPEC */
+ VpOptionParkModeType parkMode; /* VP_DEVICE_OPTION_ID_PARK_MODE */
+ VpOptionLinePulseType linePulse; /* VP_OPTION_ID_PULSE */
+ uint16 dcFeedSlope; /* VP_OPTION_ID_DCFEED_SLOPE */
+ bool switcherCtrl; /* VP_OPTION_ID_SWITCHER_CTRL */
+ uint32 debugSelect; /* VP_OPTION_ID_DEBUG_SELECT */
+ VpOptionAbsGainType absGain; /* VP_OPTION_ID_ABS_GAIN */
+ VpOptionHookDetectModeType hookDetectMode; /* VP_OPTION_ID_HOOK_DETECT_MODE */
+ VpOptionPcmSigCtlType pcmSigCtl; /* VP_DEVICE_OPTION_ID_PCM_SIG_CTL */
+ VpOptionLinestateCtlModeType linestateCtlMode; /* VP_OPTION_ID_LINESTATE_CTL_MODE */
+ VpOptionAutoLoopCondType autoLoopCond; /* VP_OPTION_ID_AUTO_LOOP_COND */
+ VpOptionDcFeedParamsType dcFeedParams; /* VP_OPTION_ID_DCFEED_PARAMS */
+ VpOptionRingingParamsType ringingParams; /* VP_OPTION_ID_RINGING_PARAMS */
+ VpOptionGndFltProtType gndFltProt; /* VP_OPTION_ID_GND_FLT_PROTECTION */
+ VpOptionAdaptiveRingingType adaptiveRinging; /* VP_DEVICE_OPTION_ID_ADAPTIVE_RINGING */
+ uint16 ringTripConfirm; /* VP_OPTION_ID_RINGTRIP_CONFIRM */
+ VpOptionRingPhaseSyncType ringPhaseSync; /* VP_DEVICE_OPTION_ID_RING_PHASE_SYNC */
+ VpOptionHighPassFilterType highPassFilter; /* VP_OPTION_ID_HIGHPASS_FILTER */
+ VpOptionFsyncRateType fsyncRate; /* VP_DEVICE_OPTION_ID_FSYNC_RATE */
+ VpOptionDtmfParamsType dtmfParams; /* VP_OPTION_ID_DTMF_PARAMS */
+ VpOptionSealingCurrentType sealCurParams; /* VP_DEVICE_OPTION_ID_SEALING_CURRENT */
+ VpOptionAccessCtrlType accessCtrl; /* VP_DEVICE_OPTION_ID_ACCESS_CTRL */
+ VpOptionSpiErrorCtrlType spiErrorCtrl; /* VP_DEVICE_OPTION_ID_SPI_ERROR_CTRL */
+} VpOptionValueType;
+
+#endif /* VP_API_OPTION */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_test.h b/marvell/services/mislic/api_lib/includes/vp_api_test.h
new file mode 100644
index 0000000..d5e6df8
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_test.h
@@ -0,0 +1,1127 @@
+/** \file vp_api_test.h
+ * file vp_api_test.h
+ *
+ * This file contains declaration associated with VP-API Test features.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12194 $
+ * $LastChangedDate: 2016-10-06 09:34:42 -0500 (Thu, 06 Oct 2016) $
+ */
+
+#ifndef VP_API_TEST_H
+#define VP_API_TEST_H
+
+#include "vp_api_types.h"
+#include "vp_api_option.h"
+#include "vp_api_event.h" /* For VpDigitType */
+
+#define VP_TEST_NOT_MEASURED 0x8000 /* a value of -1 to indicate not measured */
+ /* chosen because it is an impermissible value in those tests where used */
+
+/** Tests supported by VpTestLine function */
+typedef enum VpTestIdType {
+ VP_TEST_ID_PREPARE = 0x00, /* Prepare for a test sequence */
+ VP_TEST_ID_CONCLUDE = 0x01, /* Conclude a test sequence */
+ VP_TEST_ID_SET_SENSE_GAIN = 0x02, /* Set ILG and IMT gains high or low */
+ VP_TEST_ID_OPEN_VDC = 0x03, /* Measure open DC voltage */
+ VP_TEST_ID_OPEN_VAC = 0x04, /* Measure open AC voltage */
+ VP_TEST_ID_DIFF_VAC = 0x05, /* Measure differential AC voltage */
+ VP_TEST_ID_DC_RLOOP = 0x06, /* Measure DC loop resistance */
+ VP_TEST_ID_AC_RLOOP = 0x07, /* Measure AC loop impedance */
+ VP_TEST_ID_NULL_IGND = 0x08, /* Null ground current */
+ VP_TEST_ID_3ELE_RES = 0x09, /* Measure 3-element insulation resistance */
+ VP_TEST_ID_3ELE_CAP = 0x0A, /* Measure 3-element capacitance */
+ VP_TEST_ID_IDC = 0x0B, /* Measure DC currents */
+ VP_TEST_ID_IAC = 0x0C, /* Measure AC currents */
+ VP_TEST_ID_KEYPAD = 0x0D, /* Keypad DTMF and Pulse dial test */
+ VP_TEST_ID_NOISE = 0x0E, /* Measure Active or Passive Noise 3, 3.4 & 15KhZ */
+ VP_TEST_ID_SNR_QDIST = 0x0F, /* Measure SNR and quantization distortion */
+ VP_TEST_ID_ARB_1TONE = 0x10, /* Measure arbitrary single tone */
+ VP_TEST_ID_TONE_GEN = 0x11, /* Generate a single/dual/quad-tone */
+ VP_TEST_ID_DIALTONE = 0x12, /* Detect and measure dial tone (Inward test) */
+ VP_TEST_ID_HYBRID_LOSS = 0x13, /* Measure trans-hybrid loss */
+ VP_TEST_ID_ALT_REN = 0x14, /* Alternative method used to measure REN */
+ VP_TEST_ID_HOOK_STATUS = 0x15, /* Check Hook Status (while in test mode) */
+ VP_TEST_ID_PCM_COLLECT = 0x16, /* Collect PCM samples */
+ VP_TEST_ID_AC_RLOOP_PHASE = 0x17, /* Rloop with Phase information */
+ VP_TEST_ID_SET_BATTERIES = 0x18, /* Select batteries for line testing */
+ VP_TEST_ID_MONITOR_IV = 0x19, /* Non-Intrusive Monitoring Test */
+ VP_TEST_ID_UNBAL_TONE = 0x1A, /* Generates an unbalanced tracing tone */
+ VP_TEST_ID_3ELE_RES_VMID = 0x1B, /* Measure 3-element insulation resistance with a specified vMid */
+ VP_TEST_ID_AC_TRANS = 0x1C, /* Measures digital-digital transmission characteristics */
+ VP_TEST_ID_GEN_TEST = 0x1D, /* Multi-functional primitive */
+ VP_TEST_ID_SLOPE_REN = 0x1E, /* REN test with a ramp instead of step */
+ /* Test IDs above this line are supported by one or more VCP devices.
+ Their values must not change. More VCP tests might be added above this
+ line in the future. */
+
+ VP_TEST_ID_RSVD_MIN = 0x23, /* Custom VCP tests (not currently used) */
+ VP_TEST_ID_RSVD_MAX = 0x23,
+
+ /* The values of the constants below this line can change from time to time. */
+
+ VP_TEST_ID_3ELE_RES_HG, /* Alternative 3-element resistance high gain */
+ VP_TEST_ID_3ELE_RES_LG, /* Alternative 3-element resistance low gain */
+ VP_TEST_ID_3ELE_CAP_CSLAC, /* CSLAC 3-element capacitance test */
+ VP_TEST_ID_MSOCKET_TYPE2, /* Master Socket test for UK termination */
+ VP_TEST_ID_XCONNECT, /* Cross Connect detection test */
+ VP_TEST_ID_LOOP_CONDITIONS, /* Measure current loop conditions */
+ VP_TEST_ID_LOOPBACK, /* Setup loopback conditions */
+ VP_TEST_ID_LINE_IMPD, /* Measure impedance at a frequency */
+ VP_TEST_ID_RING_TRIP, /* Test ability to detect ring trip */
+ VP_TEST_ID_LOOP_DETECT, /* Test ability to source current and detect
+ * off-hook */
+ VP_TEST_ID_CALIBRATE, /* Perform line calibration */
+ VP_TEST_ID_USE_LINE_CAL, /* Copy dev cal factors from lineObj to devObj */
+ VP_TEST_ID_OPEN_VXC, /* Measure both DC and AC voltages */
+
+ VP_TEST_ID_GR909_HEMF, /* Hazardous Potential Voltage Test for AC/DC
+ * Tip and Ring */
+ VP_TEST_ID_GR909_EMF, /* FEMF test for AC/DC Tip and Ring */
+ VP_TEST_ID_GR909_RES_FLT, /* Resistive Faults (T/R, T-Gnd, R-Gnd) */
+ VP_TEST_ID_GR909_OFF_HOOK, /* Receiver Off-Hook */
+ VP_TEST_ID_GR909_RINGERS, /* REN per FCC part 68 (1REN = 7Kohm) */
+ VP_TEST_ID_GR909_ALL, /* Run all GR909 tests */
+ VP_TEST_ID_DELAY, /* Implements non-blocking delay */
+ VP_TEST_ID_RAMP_INIT, /* Implements a ramp to voltage test init */
+ VP_TEST_ID_RAMP, /* Implements a ramp to voltage test */
+ VP_TEST_ID_FLT_DSCRM, /* Implements the Fault discrimination test (880 890 only)*/
+ VP_TEST_ID_PREPARE_EXT, /* Req'd for backward compatibility with
+ * VeriVoice P1.7.2 and earlier */
+ VP_TEST_ID_SET_SENSE_GAIN_792, /* Set Low/Normal/High sense gain for VCP792.
+ * The API translates this to the value of
+ * VP_TEST_ID_SET_SENSE_GAIN before sending
+ * it down to the VCP. */
+ VP_TEST_ID_VP_MPI_CMD, /* Primitive to allow for direct regsiter
+ * reads / writes similar to LowLevel
+ * Command */
+ VP_TEST_ID_GAIN_TLBX, /* Primitive to allow for direct gain measurements */
+ VP_TEST_ID_LOOP_CONDITIONS_EXT, /* Measure extended loop conditions */
+ VP_TEST_ID_DRAW_BREAK_DIALTONE, /* Draw and Break Dialtone test*/
+ VP_TEST_ID_ADC_TLBX, /* Primitive allowing direct access to the ZL880/miSLIC
+ * SADC measurement toolbox */
+ VP_TEST_ID_PCM4, /* PCM-4 style measurements */
+
+ VP_NUM_TEST_IDS,
+
+ VP_TEST_ID_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestIdType;
+
+/**< The following are test line error codes */
+typedef enum VpTestStatusType {
+ VP_TEST_STATUS_SUCCESS = 0, /**< Test Completed Successfully */
+ VP_TEST_STATUS_LINE_NOT_READY = 1, /**< Line Not in Test-mode (no VP_TEST_ID_PREPARE) */
+ VP_TEST_STATUS_RESOURCE_NA = 2, /**< Line Not available for Test (already in Test) */
+ VP_TEST_STATUS_TESTING = 3, /**< Test underway - not aborted */
+ VP_TEST_STATUS_VOUT_OOR = 4, /**< Voltage Out-of-range */
+ VP_TEST_STATUS_VAB_OOR = 5, /**< A-B Voltage is out-of-range */
+ VP_TEST_STATUS_ILG_OOR = 6, /**< Measured IILG is out-of-range */
+ VP_TEST_STATUS_VCM_OOR = 7, /**< Measured VCM is out-of-range */
+ VP_TEST_STATUS_IAHL_OOR = 8, /**< Measured current or voltage is out-of-range in Res or Cap test */
+ VP_TEST_STATUS_IBHL_OOR = 9, /**< " " */
+ VP_TEST_STATUS_IAHH_OOR = 10, /**< " " */
+ VP_TEST_STATUS_IBHH_OOR = 11, /**< " " */
+ VP_TEST_STATUS_VABHL_OOR = 12, /**< " " */
+ VP_TEST_STATUS_IALL_OOR = 13, /**< " " */
+ VP_TEST_STATUS_IBLL_OOR = 14, /**< " " */
+ VP_TEST_STATUS_IA_OOR = 15, /**< Measured Current is out-of-range */
+ VP_TEST_STATUS_IB_OOR = 16, /**< " " */
+ VP_TEST_STATUS_IMT_OOR = 17, /**< Measured IMT is out-of-range */
+ VP_TEST_STATUS_IMT_DC_OOR = 18, /**< " " */
+ VP_TEST_STATUS_15KHZ_ERROR = 19, /**< More than 1 15Khz Test requested */
+ VP_TEST_STATUS_TIMEOUT = 20, /**< Failed to complete in specified time */
+ VP_TEST_STATUS_ABORTED = 21, /**< Test aborted */
+ VP_TEST_STATUS_INTERNAL_ERROR = 22, /**< Internal error (SLAC integrator) */
+ VP_TEST_STATUS_NO_CONVERGENCE = 23, /**< NULL_IGND test failed to converge */
+ VP_TEST_STATUS_TEST_NOT_SUPPORTED = 24, /**< Requested test is not supported (due to device configuration) */
+ VP_TEST_STATUS_VTIPBIAS_OOR = 25, /**< Tip Bias Voltage Out of Range */
+ VP_TEST_STATUS_VRINGBIAS_OOR = 26, /**< Ring Bias Voltage Out of Range */
+ VP_TEST_STATUS_VMID_OOR = 27, /**< User specified vMid voltage is out of range */
+ VP_TEST_STATUS_GAIN_OOR = 28, /**< User specified gain is out of range */
+ VP_TEST_STATUS_VA_OOR = 29, /**< Measured Voltage is out-of-range */
+ VP_TEST_STATUS_VB_OOR = 30, /**< " " */
+ VP_TEST_STATUS_IMTOFFSET_OOR = 31,
+ VP_TEST_STATUS_BUF_OVERFLOW = 32, /* test would exceed the buffer storage available */
+ VP_TEST_STATUS_NUM_TYPES, /**< NOT an ERROR, Just used for coding purposes */
+ VP_TEST_STATUS_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestStatusType;
+
+typedef struct VpTestCalibrationDataType {
+ uint16 gMvErr;
+ int16 gMvOff;
+ uint16 gLvErr;
+ int16 gLvOff;
+ uint16 gMiErr;
+ int16 gMiOff;
+ uint16 gLiErr;
+ int16 gLiOff;
+ uint16 sAvErr;
+ int16 sAvOff;
+ uint16 sAiErr;
+ int16 sAiOff;
+ uint16 sBvErr;
+ int16 sBvOff;
+ uint16 sBiErr;
+ int16 sBiOff;
+
+ uint16 sABMvErr;
+ int16 sABMvOff;
+ uint16 sABMiErr;
+ int16 sABMiOff;
+
+ uint16 sABLvErr;
+ int16 sABLvOff;
+ uint16 sABLiErr;
+ int16 sABLiOff;
+
+ uint16 sABMHiErr;
+ int16 sABMHiOff;
+ uint16 sABLHiErr;
+ int16 sABLHiOff;
+} VpTestCalibrationDataType;
+
+/* Definitions used for VP_TEST_ID_DELAY */
+typedef struct VpTestTimerType {
+ uint16 timerVal; /* Value in 125uS steps */
+} VpTestTimerType;
+
+/* Definitions used for VP_TEST_ID_PREPARE */
+typedef struct VpTestPrepareType {
+ bool intrusive;
+} VpTestPrepareType;
+
+/* Definitions used for VP_TEST_ID_CONCLUDE */
+typedef struct VpTestConcludeType {
+ bool abortTest;
+} VpTestConcludeType;
+
+/* Definitions used for VP_TEST_ID_SET_SENSE_GAIN */
+typedef enum VpSenseGainType {
+ VP_SENSE_GAIN_HIGH = 0,
+ VP_SENSE_GAIN_LOW = 1,
+ VP_SENSE_GAIN_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpSenseGainType;
+
+typedef struct VpTestSetSenseGainType {
+ VpSenseGainType imt;
+ VpSenseGainType ilg;
+} VpTestSetSenseGainType;
+
+/* 792-specific definitions for VP_TEST_ID_SET_SENSE_GAIN_VP792 */
+typedef enum Vp792SenseGainType {
+ VP792_SENSE_GAIN_0dB_GAIN = 0x0000, /* absolute gain = 1 */
+ VP792_SENSE_GAIN_28dB_GAIN = 0x0010, /* absolute gain = 25 */
+ VP792_SENSE_GAIN_10dB_LOSS = 0x0020, /* absolute gain = 1/3 */
+ VP792_SENSE_GAIN_RSVD = 0x0030,
+ VP792_SENSE_GAIN_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} Vp792SenseGainType;
+
+typedef struct VpTestSet792SenseGainType {
+ Vp792SenseGainType senseGain;
+} VpTestSet792SenseGainType;
+
+/* Definitions used for VP_TEST_ID_SET_BATTERIES */
+typedef enum VpSetBatteriesType {
+ VP_BS_LOW = 0,
+ VP_BS_HIGH = 1,
+ VP_BS_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpSetBatteriesType;
+
+typedef struct VpTestSetBatteriesType {
+ VpSetBatteriesType bs1;
+ VpSetBatteriesType bs0;
+} VpTestSetBatteriesType;
+
+/* Definitions used for VP_TEST_ID_OPEN_VDC, VP_TEST_ID_OPEN_VAC */
+typedef enum VpTestTipSelectType {
+ VP_TEST_RING = 0,
+ VP_TEST_TIP = 1,
+ VP_TEST_TIP_RING = 2,
+ VP_TEST_TIP_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestTipSelectType;
+
+typedef struct VpTestOpenVType {
+ bool calMode;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ VpTestTipSelectType tip;
+} VpTestOpenVType;
+
+/* Definitions used for VP_TEST_ID_DIFF_VAC */
+typedef struct VpTestDiffVacType {
+ uint16 integrateTime; /* Integration time in units of 125us */
+ int16 gvsaCal;
+ int16 gvsbCal;
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+} VpTestDiffVacType;
+
+/* Definitions used for VP_TEST_IDC, VP_TEST_IAC */
+typedef struct VpTestIdcType {
+ bool calMode;
+ int16 vCm;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+} VpTestIdcType;
+
+typedef struct VpTestIacType {
+ int16 gimtCal;
+ int16 gilgCal;
+ int16 vCm;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+} VpTestIacType;
+
+typedef struct VpTestResultVixType {
+ int16 ia;
+ int16 ib;
+} VpTestResultVixType;
+
+/* Definitions used for VP_TEST_ID_DC_RLOOP */
+typedef struct VpTestDcRLoopType {
+ bool calMode;
+ int16 iTestLevel;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+} VpTestDcRLoopType;
+
+typedef struct VpTestResultDcRlType {
+ int16 vab;
+ int16 ilg;
+ bool currentSaturation;
+} VpTestResultDcRlType;
+
+/* Definitions used for VP_TEST_ID_AC_RLOOP */
+typedef struct VpTestAcRLoopType {
+ bool calMode;
+ uint16 freq;
+ int16 vTestLevel;
+ int16 vBias;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ VpTestTipSelectType tip; /* Used by VE880 only */
+} VpTestAcRLoopType;
+
+typedef struct VpTestResultAcRlType {
+ int16 imt;
+ int16 ilg;
+ int16 vab;
+ int32 freq;
+} VpTestResultAcRlType;
+
+/* Definition used for VP_TEST_ID_AC_RLOOP_PHASE (in addition to VpTestAcRLoopType) */
+typedef struct VpTestResultAcRlPhaseType {
+ int16 imt;
+ int16 ilg;
+ int16 phase;
+} VpTestResultAcRlPhaseType;
+
+/* Definitions used for VP_TEST_ID_LOOP_COND */
+typedef enum VpLoopCondTestType {
+ VP_LOOP_COND_TEST_VSAB = 1,
+ VP_LOOP_COND_TEST_VSAG = 2,
+ VP_LOOP_COND_TEST_VSBG = 3,
+ VP_LOOP_COND_TEST_RLOOP = 4,
+ VP_LOOP_COND_TEST_ILG = 5,
+ VP_LOOP_COND_TEST_IMT = 6,
+ VP_LOOP_COND_TEST_BAT1 = 7,
+ VP_LOOP_COND_TEST_BAT2 = 8,
+ VP_LOOP_COND_TEST_BAT3 = 9,
+ VP_LOOP_COND_TEST_METER = 10,
+ VP_LOOP_COND_TEST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpLoopCondTestType;
+
+typedef struct VpTestLoopCondType {
+ bool calMode;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ VpLoopCondTestType loopCond; /* Indicates which condition to measure */
+} VpTestLoopCondType;
+
+typedef struct VpTestResultLoopCondType {
+ VpLoopCondTestType condition;
+ int16 data;
+ bool calibrated;
+ int16 limit; /* Limit or target value */
+} VpTestResultLoopCondType;
+
+/* Definitions used for VP_TEST_ID_LOOP_COND_EXT */
+typedef enum VpLoopCondExtTestType {
+ VP_LOOP_COND_EXT_TEST_BATCH_32 = 1,
+ VP_LOOP_COND_EXT_TEST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpLoopCondExtTestType;
+
+typedef struct VpTestLoopCondExtType {
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ VpLoopCondExtTestType testType; /* Indicates which test type to run */
+} VpTestLoopCondExtType;
+
+typedef struct VpTestResultLoopCondExtType {
+ VpLoopCondExtTestType testType;
+ int16 imtDc; /* Mean */
+ int16 imtAc; /* RMS */
+ int16 imtMin;
+ int16 imtMax;
+ int16 ilgDc;
+ int16 ilgAc;
+ int16 ilgMin;
+ int16 ilgMax;
+ int16 vabDc;
+ int16 vabAc;
+ int16 vabMin;
+ int16 vabMax;
+ int16 vagDc;
+ int16 vagAc;
+ int16 vagMin;
+ int16 vagMax;
+ int16 vbgDc;
+ int16 vbgAc;
+ int16 vbgMin;
+ int16 vbgMax;
+ int16 vbat1Dc;
+ int16 vbat1Ac;
+ int16 vbat1Min;
+ int16 vbat1Max;
+ int16 vbat2Dc;
+ int16 vbat2Ac;
+ int16 vbat2Min;
+ int16 vbat2Max;
+ int16 vbat3Dc;
+ int16 vbat3Ac;
+ int16 vbat3Min;
+ int16 vbat3Max;
+} VpTestResultLoopCondExtType;
+
+/* Definitions used for VP_TEST_ID_DRAW_BREAK_DIALTONE */
+typedef struct VpTestDrawBreakDtType {
+ int16 drawWaitTime; /*
+ * Positive number indicates a settling time prior to a level measurement
+ * Negative number indicates a timeout until requested level is detected
+ */
+ uint16 freq1; /* Indicates first frequency level measurement */
+ uint16 freq2; /* Indicates second frequency level measurement */
+ VpDigitType breakDig; /* Digit to use to break dial tone */
+ int16 breakWaitTime; /*
+ * Positive number indicates a settling time prior to a level measurement
+ * Negative number indicates a timeout until requested level is detected
+ */
+ int16 drawLevelMin; /* if drawWaitTime is negative this is the requested draw level */
+ int16 breakLevelMax; /* if breakWaitTime is negative this is the requested break level */
+} VpTestDrawBreakDtType;
+
+typedef struct VpTestResultDrawBreakDtType {
+ int16 totalDrawLvl;
+ int16 freq1DrawLvl;
+ int16 freq2DrawLvl;
+ int16 drawTime;
+
+ int16 totalBreakLvl;
+ int16 freq1BreakLvl;
+ int16 freq2BreakLvl;
+ int16 breakTime;
+} VpTestResultDrawBreakDtType;
+
+/* Definitions used for VP_TEST_ID_XCONNECT */
+typedef enum VpXConnectType {
+ VP_XCONNECT_DISC_V = 0,
+ VP_XCONNECT_12VVOC_I = 1,
+ VP_XCONNECT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpXConnectType;
+
+typedef struct VpTestXConnectType {
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ VpXConnectType measReq; /* Indicates which measurement sequence to run */
+ bool isFeedPositive; /* VP_XCONNECT_12VVOC_I feed sign depends on measured EMF */
+ uint8 phase; /* Test phase number */
+} VpTestXConnectType;
+
+typedef struct VpTestResultXConnectType {
+ VpXConnectType condition;
+ int16 data;
+} VpTestResultXConnectType;
+
+/* Definitions used for VP_TEST_ID_LOOPBACK */
+typedef enum VpLoopbackTestType {
+ VP_LOOPBACK_TEST_CODEC = 1,
+ VP_LOOPBACK_TEST_ANALOG = 2,
+ VP_LOOPBACK_TEST_BFILTER = 3,
+ VP_LOOPBACK_TEST_TIMESLOT = 4,
+ VP_LOOPBACK_TEST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpLoopbackTestType;
+
+typedef struct VpTestLoopbackType {
+ uint16 waitTime; /* Indicates how long before collecting samples */
+ uint16 loopbackTime; /* Indicates Loopback duration in units of 125us */
+ VpLoopbackTestType loopback;/* Indicates which condition to setup */
+} VpTestLoopbackType;
+
+typedef struct VPTestResultLoopbackType {
+ VpLoopbackTestType loopback; /* Indicates which condition was setup*/
+ void *pApplicationInfo;
+} VPTestResultLoopbackType;
+
+/* Definitions used for VP_TEST_LINE_IMPD */
+typedef struct VpTestLineImpdType {
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ bool filterMode;
+ int16 vcm; /* Common mode voltage for measurement */
+ int16 vDiff; /* Differential voltage for measurement */
+ uint16 freq;
+ int16 amp;
+} VpTestLineImpdType;
+
+typedef struct VpTestResultLineImpdType {
+ bool iaOor; /* If set IA out of range */
+ bool ibOor; /* If set IB out of range */
+ uint16 iDiff; /* RMS differential current */
+} VpTestResultLineImpdType;
+
+/**< Typedefs for Advanced Tests */
+/* Definitions used for VP_TEST_TONE_GEN */
+typedef struct VpTestToneGenType {
+ uint16 duration;
+ uint16 freq1;
+ int16 amp1;
+ uint16 freq2;
+ int16 amp2;
+ uint16 freq3;
+ int16 amp3;
+ uint16 freq4;
+ int16 amp4;
+} VpTestToneGenType;
+
+/* Definitions used for VP_TEST_ALT_REN */
+typedef struct VpTestRenType {
+ uint16 integrateTime;
+ int16 vDiff;
+ uint16 chargeTime;
+} VpTestRenType;
+
+typedef struct VpTestResultRenType {
+ int16 imt;
+ int16 imtDc;
+} VpTestResultRenType;
+
+/* Definitions used for VP_TEST_ID_SLOPE_REN */
+typedef enum VpTestMathType {
+ VP_TEST_TYPE_UNDEFINED = 0,
+ VP_TEST_TYPE_AVG = 1,
+ VP_TEST_TYPE_RMS = 2,
+ VP_TEST_TYPE_DFT = 3,
+ VP_TEST_TYPE_RAW = 4,
+ VP_TEST_TYPE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestMathType;
+
+typedef enum VpTestDcbwSpeedType {
+ VP_TEST_SPEED_UNDEFINED = 0,
+ VP_TEST_SPEED_LOW = 1,
+ VP_TEST_SPEED_MED = 2,
+ VP_TEST_SPEED_HIGH = 3,
+ VP_TEST_SPEED_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestDcbwSpeedType;
+
+typedef struct VpTestSRenType {
+ uint16 slopeTime;
+ uint16 integrateTime;
+ uint16 settlingTime;
+ int16 vDiff;
+ VpTestMathType type;
+ VpTestDcbwSpeedType speed;
+} VpTestSRenType;
+
+typedef struct VpTestResultSRenType {
+ int16 imtOffset;
+ int16 imt;
+ int16 imtDc;
+} VpTestResultSRenType;
+
+/* Definitions used for VP_TEST_ID_3ELE_RES*/
+typedef struct VpTestResType {
+ bool calMode;
+ int16 vCm;
+ int16 vDiff;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+} VpTestResType;
+
+typedef struct VpTestResultResType {
+ int16 iahl;
+ int16 ibhl;
+ int16 iahh;
+ int16 ibhh;
+ int16 iall;
+ int16 ibll;
+ int16 vabhl;
+} VpTestResultResType;
+
+/* Definition used for VP_TEST_ID_3ELE_HG and LG */
+typedef struct VpTest3EleResAltResType {
+ int16 feedBias;
+ bool shiftZeroFeed;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+} VpTest3EleResAltResType;
+
+typedef struct VpTestResultAltResType {
+ bool highGain;
+ int16 vanf;
+ int16 vbnf;
+ int16 imnf;
+ int16 ilnf;
+ int16 varf;
+ int16 vbrf;
+ int16 imrf;
+ int16 ilrf;
+ int16 vazf;
+ int16 vbzf;
+ int16 imzf;
+ int16 ilzf;
+} VpTestResultAltResType;
+
+/* Definition used for VP_TEST_ID_MSOCKET_TYPE2 */
+typedef struct VpTestMSocketType {
+ uint8 dummy;
+} VpTestMSocketType;
+
+typedef struct VpTestResultMSockType {
+ int16 vanf;
+ int16 vbnf;
+ int16 imnf;
+ int16 varf1;
+ int16 vbrf1;
+ int16 imrf1;
+ int16 varf2;
+ int16 vbrf2;
+ int16 imrf2;
+ int16 varf3;
+ int16 vbrf3;
+ int16 imrf3;
+} VpTestResultMSockType;
+
+/* Definition used for VP_TEST_ID_3ELE_CAP_CSLAC */
+typedef struct VpTest3EleCapAltResType {
+ bool calMode; /* Enable calibration */
+ uint16 testAmp; /* Test signal amplitude (mV RMS) */
+ uint8 testFreq; /* Test signal frequency [0,4], 0=2666.016Hz -> 4=280.151Hz */
+ int16 bias; /* Signal generator bias (V) */
+} VpTest3EleCapAltResType;
+
+typedef struct VpTestResultAltCapType {
+ bool accuracyFlag;
+ uint8 freq;
+ int16 va;
+ int16 vb;
+ int16 im;
+ int16 il;
+ int32 tipCapCal;
+ int32 ringCapCal;
+} VpTestResultAltCapType;
+
+/* Definition used for VP_TEST_ID_3ELE_RES_VMID */
+typedef struct VpTestResVmidType {
+ bool calMode;
+ int16 vCm;
+ int16 vDiff;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ int16 vMid;
+} VpTestResVmidType;
+
+typedef struct VpTestResultVxcType {
+ int16 vdc;
+ int16 vac;
+} VpTestResultVxcType;
+
+/* Definitions used for VP_TEST_3ELE_CAP */
+typedef struct VpTestCapType {
+ bool calMode;
+ int16 vCm;
+ int16 vDiff;
+ uint16 freq;
+ int16 gimtCal;
+ int16 gilgCal;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+} VpTestCapType;
+
+typedef struct VpTestResultCapType {
+ int16 iahl;
+ int16 iahh;
+ int16 ibhh;
+ int16 iall;
+ int16 ibll;
+ int16 vabhl;
+} VpTestResultCapType;
+
+/* Definitions used for VP_TEST_NOISE */
+typedef enum VpTestFilterType {
+ VP_FILTER_NONE = 0,
+ VP_FILTER_3KHZ = 1,
+ VP_FILTER_CMSG = 2,
+ VP_FILTER_15KHZ = 3,
+ VP_FILTER_3_4KHZ = 4,
+ VP_FILTER_D = 5,
+ VP_FILTER_PSOPH = 6,
+ VP_FILTER_CMSG_HIRES = 7,
+ VP_NUM_TEST_FILTER_TYPES,
+ VP_FILTER_ENUM_RSVD = FORCE_SIGNED_ENUM,
+ VP_FILTER_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestFilterType;
+
+typedef struct VpTestNoiseType {
+ uint16 integrateTime;
+ VpTestFilterType filter;
+ int16 amp;
+ bool useBuffer;
+} VpTestNoiseType;
+
+/* Definitions used for VP_TEST_HYBRID_LOSS */
+typedef struct VpTestTransHybridLossType {
+ uint16 integrateTime;
+ uint16 freq;
+ int16 amp;
+ bool useBuffer;
+} VpTestTransHybridLossType;
+
+/* Definitions used for VP_TEST_ID_NULL_IGND */
+typedef struct VpTestNullIGndType {
+ int16 vTestLevel;
+ int16 iTarget;
+ VpTestTipSelectType tip;
+ uint16 settlingTime;
+} VpTestNullIGndType;
+
+/* Definitions used for VP_TEST_KEYPAD */
+typedef enum VpKeyTestType {
+ VP_KEY_TEST_DTMF = 0,
+ VP_KEY_TEST_PULSE = 1,
+ VP_KEY_TEST_BOTH = 2,
+ VP_NUM_KEY_TEST_TYPES,
+ VP_KEY_TEST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpKeyTestType;
+
+typedef struct VpTestKeypadType {
+ VpKeyTestType kTest;
+ uint16 timeout;
+ uint16 freq;
+ int16 amp;
+ uint16 fftSize;
+ uint16 threshold;
+ VpOptionPulseType pulseOpt;
+ bool useBuffer;
+} VpTestKeypadType;
+
+typedef enum VpKeyTestResultType {
+ VP_KT_DTMF_DET = 0,
+ VP_KT_DTMF_MES = 1,
+ VP_KT_PULSE = 2,
+ VP_KT_THRESH_DET = 3,
+ VP_NUM_KT_TYPES,
+ VP_KT_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpKeyTestResultType;
+
+typedef struct VpTestResultKeyType {
+ VpKeyTestResultType kTestResult;
+ VpDigitType digit;
+ uint16 lowFreq;
+ uint16 lowAmp;
+ uint16 highFreq;
+ uint16 highAmp;
+ uint16 fftSize;
+ uint16 minBreak;
+ uint16 maxBreak;
+ uint16 aveBreak;
+ uint16 pulsePerSec;
+ bool hookFlashDet;
+ uint16 hookFlashDuration;
+ bool disconnectDet;
+} VpTestResultKeyType;
+
+/* Definitions used for VP_TEST_SNR_QDIST */
+typedef struct VpTestSnrQDistorType {
+ uint16 integrateTime; /* Integration time in units of 125us */
+ int16 amp;
+ bool useBuffer;
+} VpTestSnrQDistorType;
+
+typedef struct VpTestResultSnrQDistorType {
+ uint16 vrmsNoise;
+ uint16 vrmsSignal;
+} VpTestResultSnrQDistorType;
+
+/* Definitions used for VP_TEST_ARB_1TONE */
+typedef struct VpTestArb1ToneType {
+ uint16 timeout;
+ uint16 fftSize;
+ uint16 threshold;
+ bool useBuffer;
+} VpTestArb1ToneType;
+
+/* Definitions used for VP_TEST_DIALTONE */
+typedef struct VpTestDialToneType {
+ bool inward;
+ uint16 timeout;
+ uint16 detectGran;
+ uint16 threshold;
+ uint16 fftSize;
+ uint16 duration;
+ bool useBuffer;
+} VpTestDialToneType;
+
+typedef struct VpTestResultToneType {
+ uint16 rmsPwr;
+ uint16 highFreq;
+ uint16 highAmp;
+ uint16 secFreq;
+ uint16 secAmp;
+ uint16 thdFreq;
+ uint16 thdAmp;
+} VpTestResultToneType;
+
+/**< The following types are for GR909 tests */
+/* Definitions used for */
+typedef struct VpTestResultGR909EmfType {
+ bool testFail;
+ bool acFault;
+ bool dcFault;
+ uint16 acVolt;
+ int16 dcVolt;
+} VpTestResultGR909EmfType;
+
+/* Definitions used for VP_TEST_ID_GR909_RES_FLT */
+typedef struct VpTestResultGR909ResFltType {
+ bool testFail;
+ bool rtrFlt;
+ bool rtgFlt;
+ bool rrgFlt;
+ uint16 rtr;
+ uint16 rtg;
+ uint16 rrg;
+} VpTestResultGR909ResFltType;
+
+/* Definitions used for VP_TEST_ID_GR909_OFF_HOOK */
+typedef struct VpTestResultGR909OffHookType {
+ bool offHook;
+} VpTestResultGR909OffHookType;
+
+/* Definitions used for VP_TEST_ID_GR909_RINGERS */
+typedef struct VpTestResultGR909RenType {
+ bool testFailed;
+ bool renHigh;
+ bool renLow;
+ uint16 ren;
+} VpTestResultGR909RenType;
+
+/* Definitions used for VP_TEST_ID_GR909_ALL */
+typedef struct VpTestResultGR909AllType {
+ bool testFailed;
+ bool hvFailed;
+ bool emfFailed;
+ bool resFailed;
+ bool offHook;
+ bool ringersFailed;
+} VpTestResultGR909AllType;
+
+/* Definitions used for VP_TEST_ID_RAMP_INIT */
+typedef struct VpTestRampInitType {
+ int16 dcVstart;
+ int16 dcVend;
+ int16 vRate;
+ int16 bias;
+ VpTestTipSelectType tip;
+} VpTestRampInitType;
+
+/* Definitions used for VP_TEST_ID_RAMP */
+typedef struct VpTestRampType {
+ int16 dcVoltage;
+ int16 vRate;
+ int16 bias;
+ VpTestTipSelectType tip;
+} VpTestRampType;
+
+typedef struct VpTestResultRampType {
+ int16 imt;
+ int16 vRate;
+} VpTestResultRampType;
+
+/* Definitions used for VP_TEST_ID_MONITOR_IV */
+typedef enum VpMonitorIvFilterType {
+ VP_TEST_TYPE_DC = 0,
+ VP_TEST_TYPE_AC = 1,
+ VP_TEST_TYPE_ACDC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpMonitorIvFilterType;
+
+typedef enum VpMonitorIvTestMeasurementType {
+ VP_TEST_MEAS_VA = 0,
+ VP_TEST_MEAS_VB = 1,
+ VP_TEST_MEAS_VAB = 2,
+ VP_TEST_MEAS_IMT = 3,
+ VP_TEST_MEAS_ILG = 4,
+ VP_TEST_MEAS_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpMonitorIvTestMeasurementType;
+
+typedef struct VpTestMonitorIvType {
+ bool calMode;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ VpMonitorIvFilterType filterType; /* Measurement Type (AC/DC) */
+ VpMonitorIvTestMeasurementType measurement; /* measurement source */
+} VpTestMonitorIvType;
+
+/* Definitions used for VP_TEST_ID_UNBAL_TONE */
+typedef struct VpTestUnbalToneType {
+ uint16 freq;
+ int16 vTestlevel;
+ int16 vTipBias;
+ int16 vRingBias;
+ uint16 duration;
+ VpTestTipSelectType tip;
+} VpTestUnbalToneType;
+
+/* Definitions used for VP_TEST_ID_PCM_COLLECT */
+typedef struct VpTestPcmCollectType {
+ uint16 sampleTime;
+} VpTestPcmCollectType;
+
+typedef struct VpTestResultPcmCollectType {
+ uint16 resultsSize;
+ uint16 samples;
+ VpOptionCodecType codec;
+ uint16 reserved;
+ uint32 address;
+} VpTestResultPcmCollectType;
+
+/* Definitions used for VP_FLT_DSCRM */
+typedef struct VpTestResultFltDscrmType {
+ int16 vtgFeed;
+ int16 vrgFeed;
+ int16 vtrFeed;
+ int16 vtrAC;
+ int16 vtoAC;
+ int16 vroAC;
+ int16 vtuBalAC;
+ int16 vruBalAC;
+ bool hookDet;
+ bool gnkDet;
+} VpTestResultFltDscrmType;
+
+/* Definitions for VP_TEST_ID_GEN_TEST */
+/* Generic Test Defines */
+typedef enum VpTestGenFilterType {
+ VP_TEST_FILTER_UNDEFINED = 0,
+ VP_TEST_FILTER_LPF = 1,
+ VP_TEST_FILTER_HPF = 2,
+ VP_TEST_FILTER_NONE = 3,
+ VP_TEST_FILTER_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestGenFilterType;
+
+typedef enum VpTestGenDriveType {
+ VP_TEST_DRIVE_UNDEFINED = 0,
+ VP_TEST_DRIVE_NONE = 1,
+ VP_TEST_DRIVE_A = 2,
+ VP_TEST_DRIVE_B = 3,
+ VP_TEST_DRIVE_BOTH = 4,
+ VP_TEST_DRIVE_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestGenDriveType;
+
+typedef enum VpTestGenSignalType {
+ VP_TEST_SIGNAL_UNDEFINED = 0,
+ VP_TEST_SIGNAL_A = 1,
+ VP_TEST_SIGNAL_B = 2,
+ VP_TEST_SIGNAL_CM = 3,
+ VP_TEST_SIGNAL_DIFF = 4,
+ VP_TEST_SIGNAL_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestGenSignalType;
+
+typedef enum VpTestGenGainType {
+ VP_TEST_MEAS_UNDEFINED = 0,
+ VP_TEST_MEAS_LOW_GAIN = 1,
+ VP_TEST_MEAS_NORM_GAIN = 2,
+ VP_TEST_MEAS_HIGH_GAIN = 3,
+ VP_TEST_MEAS_SKIP = 4,
+ VP_TEST_MEAS_IMT_NORM_GAIN = 5,
+ VP_TEST_MEAS_IMT_HIGH_GAIN = 6,
+ VP_TEST_MEAS_VAB_LOW_GAIN = 7,
+ VP_TEST_MEAS_VAB_NORM_GAIN = 8,
+ VP_TEST_MEAS_VAB_HIGH_GAIN = 9,
+ VP_TEST_MEAS_ILG_NORM_GAIN = 10,
+ VP_TEST_MEAS_ILG_HIGH_GAIN = 11,
+ VP_TEST_MEAS_GEN_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestGenGainType;
+
+typedef struct VpTestGenTestType {
+ VpTestGenFilterType filter;
+ VpTestMathType type;
+ VpTestGenDriveType driveMode;
+ VpTestGenSignalType signalMode;
+ int16 vTestLevel;
+ uint16 freq;
+ int16 vTipBias;
+ int16 vRingBias;
+ uint16 integrateTime; /* Integration time in units of 125us */
+ uint16 settlingTime; /* Filter settling time in units of 125us */
+ VpTestGenGainType iaMeas;
+ VpTestGenGainType vaMeas;
+ VpTestGenGainType ibMeas;
+ VpTestGenGainType vbMeas;
+} VpTestGenTestType;
+
+typedef struct VpTestResultGenTestType {
+ int16 iaReal;
+ int16 iaImag;
+ int16 vaReal;
+ int16 vaImag;
+ int16 ibReal;
+ int16 ibImag;
+ int16 vbReal;
+ int16 vbImag;
+} VpTestResultGenTestType;
+
+/* Definitions used for VP_TEST_ID_VP_MPI_CMD */
+typedef struct VpTestVpMpiCmdType {
+ uint8 cmd;
+ uint8 cmdLen;
+ uint8 buffer[128];
+} VpTestVpMpiCmdType;
+
+typedef struct VpTestResultVpMpiCmdType {
+ uint8 cmd;
+ uint8 cmdLen;
+ uint8 buffer[128];
+} VpTestResultVpMpiCmdType;
+
+/* Definitions used for VP_TEST_ID_GAIN_TLBX */
+typedef enum VpTestGainMeasType {
+ VP_TEST_GAIN_MEAS_ECHO = 0,
+ VP_TEST_GAIN_MEAS_IDLE = 1,
+ VP_TEST_GAIN_MEAS_LEVEL_ANALOG = 2,
+ VP_TEST_GAIN_MEAS_LEVEL_CODEC = 3,
+ VP_TEST_GAIN_MEAS_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestGainMeasType;
+
+/* Definitions used for VP_TEST_ID_GAIN_TLBX */
+typedef enum VpTestGainFilterType {
+ VP_TEST_GAIN_FILTER_NONE = 0,
+ VP_TEST_GAIN_FILTER_FLAT = 1,
+ VP_TEST_GAIN_FILTER_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestGainFilterType;
+
+typedef struct VpTestGainTlbxType {
+ VpTestGainMeasType measType;
+ VpTestGainFilterType filterType;
+ int16 settlingMs;
+ int16 numCycle;
+} VpTestGainTlbxType;
+
+typedef struct VpTestResultGainTlbxType {
+ int16 min;
+ int16 max;
+ uint16 rms;
+ uint16 dbRef;
+} VpTestResultGainTlbxType;
+
+typedef struct VpTestAdcTlbxType {
+ uint8 mode;
+ uint16 rate;
+ uint8 sig1;
+ uint8 sig2;
+ uint8 sig3;
+ uint8 sig4;
+ uint8 sig5;
+ uint16 skipSysFrames;
+ uint16 collectSysFrames;
+} VpTestAdcTlbxType;
+
+/* Definitions used for VP_TEST_ID_PCM4 */
+typedef enum VpTestPcm4TestType {
+ VP_TEST_PCM4_4WIRE_RETURN_LOSS = 0,
+ VP_TEST_PCM4_ATTENUATION_DISTORTION = 1,
+ VP_TEST_PCM4_GAIN_TRACKING = 2,
+ VP_TEST_PCM4_TEST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestPcm4TestType;
+
+typedef enum VpTestPcm4TestStepType {
+ VP_TEST_PCM4_STEP_SETUP = 0,
+ VP_TEST_PCM4_STEP_MEASURE = 1,
+ VP_TEST_PCM4_STEP_CLEANUP = 2,
+ VP_TEST_PCM4_TEST_STEP_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpTestPcm4TestStepType;
+
+typedef struct VpTestPcm4Type {
+ VpTestPcm4TestType testType;
+ VpTestPcm4TestStepType testStep;
+ int32 freq_mHz;
+ int32 amp_mdBm0;
+} VpTestPcm4Type;
+
+typedef struct VpTestResultPcm4Type {
+ uint16 rms;
+ int32 levelProgrammed;
+} VpTestResultPcm4Type;
+
+
+/* Definitions for Test results */
+typedef union VpTestResultsUnionType {
+ bool hstatus;
+ int16 sVout;
+ uint16 uVout;
+ int16 vcm;
+ uint16 vrms;
+ VpTestResultVxcType vxc;
+ VpTestResultDcRlType dcvab;
+ VpTestResultAcRlType acimt;
+ VpTestResultAcRlPhaseType acimtp;
+ VpTestResultVixType vix;
+ VpTestResultResType res;
+ VpTestResultAltResType resAlt;
+ VpTestResultMSockType mSock;
+ VpTestResultXConnectType xConnect;
+ VpTestResultAltCapType capAlt;
+ VpTestResultCapType cap;
+ VpTestResultKeyType keypad;
+ VpTestResultSnrQDistorType snrqd;
+ VpTestResultToneType tone;
+ VpTestResultRenType ren;
+ VpTestResultLoopCondType loopCond;
+ VpTestResultLoopCondExtType loopCondExt;
+ VPTestResultLoopbackType loopback;
+ VpTestResultDrawBreakDtType drawBreakDt;
+ VpTestResultPcm4Type pcm4;
+
+ bool calFailed;
+ bool ringTripFail;
+ bool loopFnd;
+ bool loopBackTestFail;
+ VpTestResultLineImpdType lineImpedance;
+ VpTestResultGR909EmfType emf;
+ VpTestResultGR909ResFltType resFault;
+ VpTestResultGR909OffHookType offHookFault;
+ VpTestResultGR909RenType ringers;
+ VpTestResultGR909AllType gr909All;
+ VpTestResultRampType ramp;
+ VpTestResultPcmCollectType pcmCollect;
+ VpTestResultFltDscrmType fltDscrm;
+ VpTestResultGenTestType gen;
+ VpTestResultSRenType sren;
+ VpTestResultVpMpiCmdType mpiCmd;
+ VpTestResultGainTlbxType gainTlbx;
+
+} VpTestResultsUnionType;
+
+typedef struct VpTestResultType {
+ VpTestIdType testId; /* Test identifier */
+ VpTestStatusType errorCode; /* Error code if Test Failed */
+ VpTestResultsUnionType result; /* Return Results Union */
+} VpTestResultType;
+
+/* The following enum is used for event associated with VpSelfTest() */
+typedef enum VpSelfTestResultIdType {
+ VP_STEST_SUCCESS = 0,
+ VP_STEST_FAIL = 1,
+ VP_STEST_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpSelfTestResultIdType;
+
+#endif /* VP_API_TEST_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_api_timer.h b/marvell/services/mislic/api_lib/includes/vp_api_timer.h
new file mode 100644
index 0000000..de8c3b6
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_api_timer.h
@@ -0,0 +1,201 @@
+/** \file vp_api_timer.h
+ * vp_api_timer.h
+ *
+ * Header file for all timer typedefs used in API-II (internal).
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12408 $
+ * $LastChangedDate: 2017-06-08 16:48:24 -0500 (Thu, 08 Jun 2017) $
+ */
+
+#ifndef VP_API_TIMER_H
+#define VP_API_TIMER_H
+
+/* IMT average for Voltage to Frequency (FXO) smoothing */
+#define VP_IMT_AVG_LENGTH 2 /* FXO variable, but need this to compile */
+
+#define VP_ACTIVATE_TIMER 0x8000
+#define VP_TIMER_TIME_MASK 0x7FFF
+
+/**************************************************************************************************
+ * Common Timer Values - all times in ms *
+ **************************************************************************************************/
+/**< VP_DEV_TIMER_EXIT_RINGING_SAMPLE
+ * Used on VE880 ABS only at the moment. This is the initial time to delay switching from High Power
+ * to medium Power when exiting Ringing. It should be longer than the longest silent interval in any
+ * Ringing Cadence ideally. If not, it just means the supply would be switched to Medium Power and
+ * then quickly set back to High Power. No big deal, but not preferred.
+ */
+#define VP_DEV_TIMER_EXIT_RINGING_SAMPLE (5000)
+
+/**< VP_DEV_TIMER_EXIT_RINGING_UPDATE
+ * Used on VE880 ABS only at the moment. This is the interval used to recheck for Ringing Exit after
+ * waiting the time specified by VP_DEV_TIMER_EXIT_RINGING_SAMPLE.
+ */
+#define VP_DEV_TIMER_EXIT_RINGING_UPDATE (1000)
+
+/**< VP_WB_CHANGE_MASK_TIME
+ * The time used to mask Clock Fault after changing to or from Wideband mode on VE880 or VE890
+ */
+#define VP_WB_CHANGE_MASK_TIME (20)
+
+/**< VP_DISCONNECT_RECOVERY_TIME
+ * Hook debounce time when exiting disconnect. This is to allow hook stability in case of high
+ * REN load conditions. Time of 100ms is sufficient for all normal field conditions, but if testing
+ * with 5REN per GR57 (40uF + 1386ohm) this time needs to be 120-130ms.
+ */
+#define VP_DISCONNECT_RECOVERY_TIME (100)
+
+/**< VP_POLREV_DEBOUNCE_TIME
+ * Debounce time to mask hook activity when reversing polarity on the FXS line. The value (120ms)
+ * is designed to prevent false off-hook from being reported when changing line polarity under
+ * load conditions of 5REN FCC Part 68 load with 16ms Switch Hook Debounce in the DC Feed Profile.
+ * Applications that require detection of hook changes after polarity reversal in less than 120ms
+ * will have to change this value. Applications that need to prevent spurious hook events for load
+ * conditions of GR57 5REN (see "Ringing Capability) using 40uf + 1386ohm may need to increase this
+ * value. Note however that 40uf + 1386ohm condition is for test purposes only, not representative
+ * of real-world conditions.
+ */
+#define VP_POLREV_DEBOUNCE_TIME (120)
+
+/**< Line Timer Definitions/Indexes
+ * Note that since the timer indexes themselves are generally used in incrememtal loops through
+ * the line timer array, these values must be sequential, unsigned type
+ */
+/**< VP_LINE_CID_DEBOUNCE: Hook debounce timer for conditions determined by the CID State Machine */
+#define VP_LINE_CID_DEBOUNCE 0
+
+/**< VP_LINE_TIMER_CID_DTMF: Timer for DTMF generation in CID */
+#define VP_LINE_TIMER_CID_DTMF (VP_LINE_CID_DEBOUNCE + 1)
+
+/**< VP_LINE_RING_EXIT_PROCESS: Timer used for Ringing Exit handing */
+#define VP_LINE_RING_EXIT_PROCESS (VP_LINE_TIMER_CID_DTMF + 1)
+
+ /**< VP_CSLAC_RINGING_EXIT_MAX
+ * This value sets the maximum time the API will wait for the sillicon to exit it's own internal
+ * Ringing Exit state (used for certain conditions) before forcing the line to a know value and
+ * giving up on the timer. This value is monitored in the VE880/890 VP_LINE_RING_EXIT_PROCESS
+ * timer management functions. The time specified is in mSec.
+ */
+ #define VP_CSLAC_RINGING_EXIT_MAX (100)
+
+/**< VP_LINE_HOOK_FREEZE:
+ * Hook Mask when making any line change that could cause spurious hook activity. This time should
+ * be used ONLY to mask hook activity, not as part of a control sequence. When it expires, the only
+ * action remaining should be to read the signaling register and process hook activity.
+ */
+#define VP_LINE_HOOK_FREEZE (VP_LINE_RING_EXIT_PROCESS + 1)
+
+/**< VP_LINE_DISCONNECT_EXIT: Line Debounce for Disconnect Recovery */
+#define VP_LINE_DISCONNECT_EXIT (VP_LINE_HOOK_FREEZE + 1)
+
+/**< VP_LINE_GND_START_TIMER: Timer for Recovery from Tip-Open */
+#define VP_LINE_GND_START_TIMER (VP_LINE_DISCONNECT_EXIT + 1)
+
+/**< VP_LINE_CAL_LINE_TIMER: Timer used to sequence the CID state machine */
+#define VP_LINE_CAL_LINE_TIMER (VP_LINE_GND_START_TIMER + 1)
+
+/**< VP_LINE_PING_TIMER: VE880 Rev VC only used to prevent phone "ping" when exiting disconnect */
+#define VP_LINE_PING_TIMER (VP_LINE_CAL_LINE_TIMER + 1)
+
+/**< VP_LINE_TRACKER_DISABLE: Used to disable switcher with low power termination type. */
+#define VP_LINE_TRACKER_DISABLE (VP_LINE_PING_TIMER + 1)
+
+/**< VP_LINE_INTERNAL_TESTTERM_TIMER: Timer for the internal test termination */
+#define VP_LINE_INTERNAL_TESTTERM_TIMER (VP_LINE_TRACKER_DISABLE + 1)
+
+/**< VP_LINE_SPEEDUP_RECOVERY_TIMER: Time used to manage the mettalic and battery speedup when
+ * making certain state transitions for VE880 and VE890
+ */
+#define VP_LINE_SPEEDUP_RECOVERY_TIMER (VP_LINE_INTERNAL_TESTTERM_TIMER + 1)
+
+/**< VP_LINE_TIMER_LAST: Place holder to indicate number of line timers */
+#define VP_LINE_TIMER_LAST (VP_LINE_SPEEDUP_RECOVERY_TIMER + 1)
+
+/**< Device Timer Definitions */
+/* Test line timer to ensure a more consistant MPI PCM collect routine, leave
+ * this timer as the first timer. */
+#define VP_DEV_TIMER_TESTLINE 0
+
+/* ABS Calibration timer */
+#define VP_DEV_TIMER_ABSCAL (VP_DEV_TIMER_TESTLINE + 1)
+
+/* Lower Power Mode Switcher Changes */
+#define VP_DEV_TIMER_LP_CHANGE (VP_DEV_TIMER_ABSCAL + 1)
+
+/* ABV Caibration device timers */
+#define VP_DEV_TIMER_ABV_CAL (VP_DEV_TIMER_LP_CHANGE + 1)
+
+/* In-rush limiting enter ringing device timers */
+#define VP_DEV_TIMER_ENTER_RINGING (VP_DEV_TIMER_ABV_CAL + 1)
+
+/* Used on VE880-ABS only to time switching of the Supply Mode from HP (in Ringing) to MP */
+#define VP_DEV_TIMER_EXIT_RINGING (VP_DEV_TIMER_ENTER_RINGING + 1)
+
+/* Used to mask clock faults */
+#define VP_DEV_TIMER_WB_MODE_CHANGE (VP_DEV_TIMER_EXIT_RINGING + 1)
+
+/* Place holder to indicate number of device timers */
+#define VP_DEV_TIMER_LAST (VP_DEV_TIMER_WB_MODE_CHANGE + 1)
+
+/** FXO specific timer variables to be used for FXO type lines only */
+typedef enum VpCslacTimerType {
+ VP_CSLAC_FXS_TIMER,
+ VP_CSLAC_FXO_TIMER,
+ VP_CSLAC_TIMER_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/
+} VpCslacTimerType;
+
+
+#if (defined (VP_CC_880_SERIES) && defined (VP880_FXO_SUPPORT)) || \
+ (defined (VP_CC_890_SERIES) && defined (VP890_FXO_SUPPORT)) || \
+ defined (VP_CC_KWRAP)
+typedef struct VpFXOTimerType {
+ uint16 highToLowTime; /**< Device timestamp of last high to low change */
+ uint16 prevHighToLowTime;
+ bool noCount; /**< TRUE when not counting - lack of activity */
+ bool lastState; /**< TRUE if last known high, FALSE if low */
+ uint16 timeLastPolRev; /**< Time in 0.25ms since polrev detected */
+ uint16 timePrevPolRev; /**< Time in 0.25ms since prev polrev detected */
+ uint8 maxPeriod; /**< Time in 0.25ms that ringing is detected */
+ uint16 lastStateChange; /**< Time in 1mS since last state change */
+ uint16 lastNotLiu; /**< Time in 1mS since last Not LIU detected */
+ uint16 disconnectDebounce; /**< Time in 1mS to debounce disconnect events */
+ uint16 disconnectDuration; /**< Time in ticks that disconnect is detected */
+ uint8 liuDebounce; /**< Time in 1mS to debounce LIU detection that
+ accompanies some kinds of ringing */
+ uint8 ringOffDebounce; /**< Time in 1mS to ignore disconnect after ring_off */
+ uint8 ringTimer; /**< When this timer expires, ringing is off */
+ uint8 cidCorrectionTimer; /**< 1mS increments for CID correction timing */
+ uint8 bCalTimer; /**< 1mS increments for BFilter sampling time */
+ uint16 fxoDiscIO2Change; /**< Countdown in 1ms since IO2 changed for FXO_DISC termType */
+ uint16 pllRecovery; /**< Timer in ticks to recover PLL when FXO Disconnect to OHT */
+ uint16 currentMonitorTimer;/**< Used to provide FXO line current buffer */
+ uint16 measureBFilterTimer;/**< 1mS increments for BFilter sampling time */
+ uint8 lowVoltageTimer; /**< Timer in ticks for the low voltage
+ disconnect/LIU distinction workaround */
+} VpFXOTimerType;
+#endif
+
+/** Union of FXO and FXS timers since only one type can exist for each line */
+typedef union VpCslacTimers {
+#if (defined (VP_CC_880_SERIES) && defined (VP880_FXO_SUPPORT)) || \
+ (defined (VP_CC_890_SERIES) && defined (VP890_FXO_SUPPORT)) || \
+ defined (VP_CC_KWRAP)
+ VpFXOTimerType fxoTimer;
+#endif
+ uint16 timer[VP_LINE_TIMER_LAST]; /**< FXS Array of timers */
+ uint16 trackingTime; /**< Used in VE880/VE890 to track the total time the Ring Exit Timer
+ * has been running. The Ring Exit Timer is restarted while waiting for
+ * the silicon to make it's internal SLIC state change (i.e., get out of
+ * the Ring Exit State). But in case the SLIC never makes the expected
+ * state change, we want to force the final change and terminate the
+ * timer.
+ */
+} VpCslacTimers;
+
+typedef struct VpCslacTimerStruct {
+ VpCslacTimerType type;
+ VpCslacTimers timers;
+} VpCslacTimerStruct;
+#endif
diff --git a/marvell/services/mislic/api_lib/includes/vp_debug.h b/marvell/services/mislic/api_lib/includes/vp_debug.h
new file mode 100644
index 0000000..117b012
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_debug.h
@@ -0,0 +1,521 @@
+/** \file vp_debug.h
+ * vp_debug.h
+ *
+ * This file contains the configuration and compile time settings for
+ * the VoicePath API debug statements.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 12408 $
+ * $LastChangedDate: 2017-06-08 16:48:24 -0500 (Thu, 08 Jun 2017) $
+ *
+ * As of svn 5835, no part of the VP-API-II uses the old VP_DOUT method.
+ */
+
+#ifndef VP_DEBUG_H
+#define VP_DEBUG_H
+
+#include "vp_api_cfg.h"
+#include "vp_api_types.h"
+#include "sys_service.h"
+
+/*
+ * These are not documented in the API-II and should be used for internal
+ * purposes only. Reserved range (0x00010000 to 0x80000000)
+ */
+#define DBG_EVENT_VERBOSE 0x00010000 /* Verbose event debug (792) */
+#define DBG_BOOT_WRITE 0x00020000 /* Displays all boot blocks */
+
+/* Define VP_DEBUG_COLOR to display ANSI X3.64 color codes in debug output. */
+#define VP_DEBUG_COLOR
+#include "vp_debug_colors.h"
+
+/* Colors for debug messages (if VP_DEBUG_COLOR is defined): */
+#define VP_DBG_ERROR_COLOR bright_red
+#define VP_DBG_WARNING_COLOR dark_yellow
+#define VP_DBG_INFO_COLOR dark_blue
+#define VP_DBG_API_FUNC_COLOR bright_cyan
+#define VP_DBG_API_FUNC_INT_COLOR dark_cyan
+#define VP_DBG_HAL_COLOR bright_white
+#define VP_DBG_SSL_COLOR dark_green
+#define VP_DBG_EVENT_COLOR bright_blue
+#define VP_DBG_CALIBRATION_COLOR bright_white
+#define VP_DBG_LINE_STATE_COLOR dark_yellow
+#define VP_DBG_HOOK_COLOR bright_cyan
+#define VP_DBG_TEST_COLOR bright_blue
+#define VP_DBG_TEST_FUNC_COLOR bright_yellow
+#define VP_DBG_FXO_FUNC_COLOR dark_green
+#define VP_DBG_SEQUENCER_COLOR dark_blue
+#define VP_DBG_CID_COLOR bright_white
+#define VP_DBG_TEST_PCM_COLOR bright_cyan
+#define VP_DBG_GAIN_COLOR dark_yellow
+#define VP_DBG_TIMER_COLOR bright_green
+#define VP_DBG_TEST_CALC_COLOR dark_yellow
+#define VP_DBG_ADP_RING_COLOR dark_green
+#define VP_DBG_INTERRUPT_COLOR dark_cyan
+#define VP_DBG_DTMF_COLOR dark_green
+#define VP_DBG_DTMF_DETAIL_COLOR dark_blue
+
+/* Define VP_DEBUG_LOC to include the location (file and line) in each debug message. */
+#undef VP_DEBUG_LOC
+
+#ifdef VP_DEBUG_LOC
+#define VP_SHOW_LOC() VpSysDebugPrintf(" (" __FILE__ ":%d)", __LINE__)
+#else
+#define VP_SHOW_LOC()
+#endif
+
+/* Basic debug output macro: */
+#define VP_DOUT_(msgType, msgColor, objType, pObj, printf_args) \
+ if (VpDebugEnabled_ ## objType (VP_DBG_ ## msgType, color_fg(msgColor) #msgType, pObj)) { \
+ VpSysDebugPrintf printf_args; \
+ VP_SHOW_LOC(); \
+ VpSysDebugPrintf(color_reset "\n"); \
+ }
+
+/* Conditionally compile in various types of debug messages: */
+#if !defined(VP_DEBUG) && defined(VP_CC_DEBUG_SELECT)
+#undef VP_CC_DEBUG_SELECT
+#endif
+#ifndef VP_CC_DEBUG_SELECT
+#define VP_CC_DEBUG_SELECT 0
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_ERROR)
+#define VP_ERROR(objType, pObj, printf_args) VP_DOUT_(ERROR, VP_DBG_ERROR_COLOR, objType, pObj, printf_args)
+#else
+#define VP_ERROR(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_WARNING)
+#define VP_WARNING(objType, pObj, printf_args) VP_DOUT_(WARNING, VP_DBG_WARNING_COLOR, objType, pObj, printf_args)
+#else
+#define VP_WARNING(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_INFO)
+#define VP_INFO(objType, pObj, printf_args) VP_DOUT_(INFO, VP_DBG_INFO_COLOR, objType, pObj, printf_args)
+#else
+#define VP_INFO(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_API_FUNC)
+#define VP_API_FUNC(objType, pObj, printf_args) VP_DOUT_(API_FUNC, VP_DBG_API_FUNC_COLOR, objType, pObj, printf_args)
+#else
+#define VP_API_FUNC(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_API_FUNC_INT)
+#define VP_API_FUNC_INT(objType, pObj, printf_args) VP_DOUT_(API_FUNC_INT, VP_DBG_API_FUNC_INT_COLOR, objType, pObj, printf_args)
+#else
+#define VP_API_FUNC_INT(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_CALIBRATION)
+#define VP_CALIBRATION(objType, pObj, printf_args) VP_DOUT_(CALIBRATION, VP_DBG_CALIBRATION_COLOR, objType, pObj, printf_args)
+#else
+#define VP_CALIBRATION(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_LINE_STATE)
+#define VP_LINE_STATE(objType, pObj, printf_args) VP_DOUT_(LINE_STATE, VP_DBG_LINE_STATE_COLOR, objType, pObj, printf_args)
+#else
+#define VP_LINE_STATE(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_HOOK)
+#define VP_HOOK(objType, pObj, printf_args) VP_DOUT_(HOOK, VP_DBG_HOOK_COLOR, objType, pObj, printf_args)
+#else
+#define VP_HOOK(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_TEST)
+#define VP_TEST(objType, pObj, printf_args) VP_DOUT_(TEST, VP_DBG_TEST_COLOR, objType, pObj, printf_args)
+#else
+#define VP_TEST(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_TEST_FUNC)
+#define VP_TEST_FUNC(objType, pObj, printf_args) VP_DOUT_(TEST_FUNC, VP_DBG_TEST_FUNC_COLOR, objType, pObj, printf_args)
+#else
+#define VP_TEST_FUNC(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_FXO_FUNC)
+#define VP_FXO_FUNC(objType, pObj, printf_args) VP_DOUT_(FXO_FUNC, VP_DBG_FXO_FUNC_COLOR, objType, pObj, printf_args)
+#else
+#define VP_FXO_FUNC(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_SEQUENCER)
+#define VP_SEQUENCER(objType, pObj, printf_args) VP_DOUT_(SEQUENCER, VP_DBG_SEQUENCER_COLOR, objType, pObj, printf_args)
+#else
+#define VP_SEQUENCER(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_CID)
+#define VP_CID(objType, pObj, printf_args) VP_DOUT_(CID, VP_DBG_CID_COLOR, objType, pObj, printf_args)
+#else
+#define VP_CID(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_TEST_PCM)
+#define VP_TEST_PCM(objType, pObj, printf_args) VP_DOUT_(TEST_PCM, VP_DBG_TEST_PCM_COLOR, objType, pObj, printf_args)
+#else
+#define VP_TEST_PCM(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_GAIN)
+#define VP_GAIN(objType, pObj, printf_args) VP_DOUT_(GAIN, VP_DBG_GAIN_COLOR, objType, pObj, printf_args)
+#else
+#define VP_GAIN(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_TIMER)
+#define VP_TIMER(objType, pObj, printf_args) VP_DOUT_(TIMER, VP_DBG_TIMER_COLOR, objType, pObj, printf_args)
+#else
+#define VP_TIMER(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_TEST_CALC)
+#define VP_TEST_CALC(objType, pObj, printf_args) VP_DOUT_(TEST_CALC, VP_DBG_TEST_CALC_COLOR, objType, pObj, printf_args)
+#else
+#define VP_TEST_CALC(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_ADP_RING)
+#define VP_ADP_RING(objType, pObj, printf_args) VP_DOUT_(ADP_RING, VP_DBG_ADP_RING_COLOR, objType, pObj, printf_args)
+#else
+#define VP_ADP_RING(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_INTERRUPT)
+#define VP_INTERRUPT(objType, pObj, printf_args) VP_DOUT_(INTERRUPT, VP_DBG_INTERRUPT_COLOR, objType, pObj, printf_args)
+#else
+#define VP_INTERRUPT(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_DTMF)
+#define VP_DTMF(objType, pObj, printf_args) VP_DOUT_(DTMF, VP_DBG_DTMF_COLOR, objType, pObj, printf_args)
+#else
+#define VP_DTMF(objType, pObj, printf_args)
+#endif
+#if (VP_CC_DEBUG_SELECT & VP_DBG_DTMF_DETAIL)
+#define VP_DTMF_DETAIL(objType, pObj, printf_args) VP_DOUT_(DTMF_DETAIL, VP_DBG_DTMF_DETAIL_COLOR, objType, pObj, printf_args)
+#else
+#define VP_DTMF_DETAIL(objType, pObj, printf_args)
+#endif
+
+
+#if (VP_CC_DEBUG_SELECT & VP_DBG_SSL)
+#define VP_SSL(objType, pObj, printf_args) VP_DOUT_(SSL, VP_DBG_SSL_COLOR, objType, pObj, printf_args)
+#define VP_SYS_ENTER_CRITICAL(deviceId, criticalSecType) VpSysEnterCriticalWrapper(deviceId, criticalSecType)
+#define VP_SYS_EXIT_CRITICAL(deviceId, criticalSecType) VpSysExitCriticalWrapper(deviceId, criticalSecType)
+#define VP_SYS_WAIT(time) \
+ (VP_SSL(None, VP_NULL, ("VpSysWait(%u frames = %u ms)", (time), ((time) + 7 / 8))), VpSysWait(time))
+#else
+#define VP_SSL(objType, pObj, printf_args)
+#define VP_SYS_ENTER_CRITICAL(deviceId, criticalSecType) VpSysEnterCritical(deviceId, criticalSecType)
+#define VP_SYS_EXIT_CRITICAL(deviceId, criticalSecType) VpSysExitCritical(deviceId, criticalSecType)
+#define VP_SYS_WAIT(time) VpSysWait(time)
+#endif
+
+#ifndef VP_HAL_DEVICE_TYPE
+#define VP_HAL_DEVICE_TYPE VP_DEV_VCP_SERIES
+#endif
+
+#if (VP_CC_DEBUG_SELECT & VP_DBG_HAL)
+#define VP_HAL(objType, pObj, printf_args) VP_DOUT_(HAL, VP_DBG_HAL_COLOR, objType, pObj, printf_args)
+#define VP_HAL_HBI_CMD(deviceId, cmd) \
+ (VpDisplayHbiCmd(VP_HAL_DEVICE_TYPE, deviceId, cmd), \
+ VpHalHbiCmd(deviceId, cmd))
+#define VP_HAL_HBI_WRITE(deviceId, cmd, numwords, data) \
+ (VpDisplayHbiCmd(VP_HAL_DEVICE_TYPE, deviceId, cmd), \
+ VpDisplayHbiData(deviceId, numwords + 1, data), \
+ VpHalHbiWrite(deviceId, cmd, numwords, data))
+#define VP_HAL_HBI_READ(deviceId, cmd, numwords, data) \
+ VpHalHbiReadWrapper(VP_HAL_DEVICE_TYPE, deviceId, cmd, numwords, data)
+#if (VP_CC_DEBUG_SELECT & DBG_BOOT_WRITE)
+#define VP_HAL_HBI_BOOT_WR(deviceId, numWords, data) \
+ (VpDisplayHbiAccess(VP_HAL_DEVICE_TYPE, deviceId, numWords + 1, (uint16p)(data)), \
+ VpHalHbiBootWr(deviceId, numWords, data))
+#else
+#define VP_HAL_HBI_BOOT_WR(deviceId, numWords, data) \
+ VpHalHbiBootWr(deviceId, numWords, data)
+#endif
+#else
+#define VP_HAL(objType, pObj, printf_args)
+#define VP_HAL_HBI_CMD(deviceId, cmd) \
+ VpHalHbiCmd(deviceId, cmd)
+#define VP_HAL_HBI_WRITE(deviceId, cmd, numwords, data) \
+ VpHalHbiWrite(deviceId, cmd, numwords, data)
+#define VP_HAL_HBI_READ(deviceId, cmd, numwords, data) \
+ VpHalHbiRead(deviceId, cmd, numwords, data)
+#define VP_HAL_HBI_BOOT_WR(deviceId, numWords, data) \
+ VpHalHbiBootWr(deviceId, numWords, data)
+#endif
+
+/* Basic assert macro: */
+#define VP_ASSERT(condition) \
+ if (!(condition)) { \
+ VP_ERROR(None, VP_NULL, ("Assertion failed: %s\n", #condition)); \
+ /* exit(-1); */ \
+ }
+
+#define VP_DOUT(msgType, printf_args)
+
+/* Global debug select mask (for messages that are not specific to a particular
+ line or device): */
+EXTERN uint32 vpDebugSelectMask;
+
+#ifdef VP_CC_VCP2_SERIES
+EXTERN bool
+VpDebugEnabled_VpVcp2DeviceObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpVcp2DeviceObjectType *pDevObj);
+
+EXTERN bool
+VpDebugEnabled_VpVcp2LineObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpVcp2LineObjectType *pLineObj);
+#endif
+
+#ifdef VP_CC_MELT_SERIES
+EXTERN bool
+VpDebugEnabled_VpMeltDeviceObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpMeltDeviceObjectType *pDevObj);
+
+EXTERN bool
+VpDebugEnabled_VpMeltLineObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpMeltLineObjectType *pLineObj);
+#endif
+
+#ifdef VP_CC_MELT792_SERIES
+EXTERN bool
+VpDebugEnabled_VpMelt792DeviceObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpMelt792DeviceObjectType *pDevObj);
+
+EXTERN bool
+VpDebugEnabled_VpMelt792LineObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpMelt792LineObjectType *pLineObj);
+#endif
+
+#ifdef VP_CC_890_SERIES
+EXTERN bool
+VpDebugEnabled_Vp890DeviceObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ Vp890DeviceObjectType *pDevObj);
+
+EXTERN bool
+VpDebugEnabled_Vp890LineObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ Vp890LineObjectType *pLineObj);
+#endif
+
+#ifdef VP_CC_880_SERIES
+EXTERN bool
+VpDebugEnabled_Vp880DeviceObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ Vp880DeviceObjectType *pDevObj);
+
+EXTERN bool
+VpDebugEnabled_Vp880LineObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ Vp880LineObjectType *pLineObj);
+#endif
+
+#ifdef VP_CC_886_SERIES
+EXTERN bool
+VpDebugEnabled_Vp886DeviceObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ Vp886DeviceObjectType *pDevObj);
+
+EXTERN bool
+VpDebugEnabled_Vp886LineObjectType(
+ uint32 msgType,
+ char *msgTypeStr,
+ Vp886LineObjectType *pLineObj);
+#endif
+
+EXTERN bool
+VpDebugEnabled_VpDeviceIdType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpDeviceIdType *pDeviceId);
+
+EXTERN bool
+VpDebugEnabled_VpLineIdType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpLineIdType *pLineId);
+
+EXTERN bool
+VpDebugEnabled_VpDevCtxType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpDevCtxType *pDevCtx);
+
+EXTERN bool
+VpDebugEnabled_VpLineCtxType(
+ uint32 msgType,
+ char *msgTypeStr,
+ VpLineCtxType *pLineCtx);
+
+EXTERN bool
+VpDebugEnabled_None(
+ uint32 msgType,
+ char *msgTypeStr,
+ void *nothing);
+
+EXTERN const char *
+VpGetString_VpStatusType(
+ VpStatusType status);
+
+EXTERN const char *
+ VpGetString_VpOptionIdType(
+ VpOptionIdType status);
+
+EXTERN const char *
+VpGetString_VpProfileType(
+ VpProfileType profType);
+
+EXTERN void
+VpDisplayEvent(
+ VpEventType *pEvent);
+
+EXTERN void
+VpDisplayResults(
+ VpEventType *pEvent,
+ void *pResult);
+
+EXTERN void
+VpDisplayHbiAccess(
+ VpDeviceType deviceType,
+ VpDeviceIdType deviceId,
+ unsigned bufLen,
+ uint16 *buf);
+
+EXTERN unsigned
+VpDisplayHbiCmd(
+ VpDeviceType deviceType,
+ VpDeviceIdType deviceId,
+ uint16 cmd);
+
+EXTERN void
+VpDisplayHbiData(
+ VpDeviceIdType deviceId,
+ unsigned bufLen,
+ uint16 *buf);
+
+EXTERN bool
+VpHalHbiReadWrapper(
+ VpDeviceType deviceType,
+ VpDeviceIdType deviceId,
+ uint16 cmd,
+ uint8 numwords,
+ uint16 *data);
+
+#if (VP_CC_DEBUG_SELECT & VP_DBG_SSL)
+EXTERN const char *
+VpGetString_VpCriticalSecType(
+ VpCriticalSecType criticalSecType);
+
+EXTERN uint8
+VpSysEnterCriticalWrapper(
+ VpDeviceIdType deviceId,
+ VpCriticalSecType criticalSecType);
+
+EXTERN uint8
+VpSysExitCriticalWrapper(
+ VpDeviceIdType deviceId,
+ VpCriticalSecType criticalSecType);
+#endif
+
+/* Derivative debug macros: */
+#define VP_API_ENTER(objType, pObj, funcName) \
+ VP_API_FUNC(objType, pObj, ("Vp%s():", funcName))
+#define VP_API_EXIT(objType, pObj, funcName, status) \
+ VP_API_FUNC(objType, pObj, ("Vp%s() = %s", funcName, VpGetString_VpStatusType(status)))
+#define VP_API_INT_ENTER(objType, pObj, funcName) \
+ VP_API_FUNC_INT(objType, pObj, ("%s():", funcName))
+#define VP_API_INT_EXIT(objType, pObj, funcName, status) \
+ VP_API_FUNC_INT(objType, pObj, ("%s() = %s", funcName, VpGetString_VpStatusType(status)))
+
+#if (VP_CC_DEBUG_SELECT & VP_DBG_INFO)
+void VpPrintVpApiVersion(void);
+#if defined (VP_CC_880_SERIES) || defined (VP_CC_890_SERIES) || defined (VP_CC_886_SERIES)
+void VpPrintTermType(VpTermType termType);
+void VpPrintLineStateType(VpLineStateType lineState, char *strLineState);
+void VpPrintOptionRingControlType(VpOptionRingControlType *ringCtrl);
+void VpPrintOptionZeroCrossType(VpOptionZeroCrossType zeroCross);
+void VpPrintRelayControlType(VpRelayControlType relayState);
+void VpPrintOptionCodecType(VpOptionCodecType codec);
+void VpPrintOptionPcmTxRxCntrlType(VpOptionPcmTxRxCntrlType pcmTxRxCtrl);
+void VpPrintDigitType(VpDigitType digit, char *name);
+void VpPrintCallerIdType(VpCallerIdType *callerId);
+void VpPrintCidSeqDataType(VpCidSeqDataType *cidSeq);
+void VpPrintSeqDataType(VpSeqDataType *cadence);
+void VpPrintVpCslacTimerStruct(VpCslacTimerStruct *lineTimers);
+
+
+void VpPrintApiIntLineState(VpApiIntLineStateType *lineState);
+void VpPrintDigitGenDataType(VpDigitGenerationDataType *digitGenStruct);
+
+
+void VpPrintDynamicInfoStruct(VpDeviceDynamicInfoType *dynamicInfo);
+void VpPrintStaticInfoStruct(VpDeviceStaticInfoType *staticInfo);
+
+/* Bit-wise values from VpDeviceBusyFlagsType */
+void VpPrintStateInformation(uint16 state);
+void
+VpPrintDeviceProfileStruct(
+ VpDeviceType deviceType,
+ void *devProfileData);
+
+void
+VpPrintEventMaskStruct(
+ bool isDeviceInfo,
+ bool isMask,
+ VpOptionEventMaskType *eventMask);
+
+void VpPrintCriticalFltStruct(VpOptionCriticalFltType *criticalFault);
+void VpPrintGetResultsOptionStruct(VpGetResultsOptionsType *resultsOption);
+void VpPrintRelGainResultsStruct(VpRelGainResultsType *relGainResults);
+
+#define VpPrintEventHandle(eventHandle) VpSysDebugPrintf("\n\n\rpDevObj->eventHandle = 0x%04X", eventHandle)
+#define VpPrintTimeStamp(timeStamp) VpSysDebugPrintf("\n\n\rpDevObj->timeStamp = 0x%04X", timeStamp)
+
+void VpPrintDeviceProfileTable(VpCSLACDeviceProfileTableType *devProfileTable);
+void VpPrintProfileTableEntry(VpCSLACProfileTableEntryType *profEntry);
+
+#if defined (VP890_FXS_SUPPORT) || defined (VP880_FXS_SUPPORT)
+void
+VpPrintPulseSpecs(
+ uint8 specNumber,
+ VpOptionPulseType *pulseSpecs);
+void
+VpPrintDPStateMachine(
+ uint8 stateMachineNum,
+ VpDialPulseDetectType *dpStruct);
+#endif
+
+void
+VpPrintDeviceTimers(
+ uint16 devTimer[VP_DEV_TIMER_LAST]);
+
+#define VpPrintResponseData(responseData) VpSysDebugPrintf("\n\n\rpDevObj->responseData = 0x%04X", responseData)
+#define VpPrintTxBufferRate(txBufferDataRate) VpSysDebugPrintf("\n\n\rpDevObj->txBufferDataRate = %d", txBufferDataRate)
+
+#if defined (VP_CC_886_SERIES)
+void VpPrintTimerQueue(VpTimerQueueInfoType *pInfo, VpTimerQueueNodeType *pNodes);
+void VpPrintPulseDecodeData(VpPulseDecodeDataType *pPulseDecode);
+void VpPrintSlacBufData(VpSlacBufDataType *pSlacBuf);
+#endif /* defined (VP_CC_886_SERIES) */
+
+
+#endif /* defined (VP_CC_880_SERIES) || defined (VP_CC_890_SERIES) || defined (VP_CC_886_SERIES) */
+#endif /* VP_CC_DEBUG_SELECT & VP_DBG_INFO */
+
+
+
+
+
+
+
+#endif /* VP_DEBUG_H */
+
diff --git a/marvell/services/mislic/api_lib/includes/vp_debug_colors.h b/marvell/services/mislic/api_lib/includes/vp_debug_colors.h
new file mode 100644
index 0000000..48e879e
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_debug_colors.h
@@ -0,0 +1,81 @@
+/* \file vp_debug_colors.h
+ * vp_debug_colors.h
+ *
+ * This file contains ANSI X3.64 codes for displaying colors.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 9129 $
+ * $LastChangedDate: 2011-11-17 11:03:13 -0600 (Thu, 17 Nov 2011) $
+ */
+
+#ifndef VP_DEBUG_COLORS_H
+#define VP_DEBUG_COLORS_H
+
+#include "vp_api_cfg.h"
+
+#ifdef VP_DEBUG_COLOR
+
+#define COLORS_begin "\x1b["
+#define COLORS_delim ";"
+#define COLORS_end "m"
+#define COLORS_reset "0"
+#define COLORS_bold "1"
+#define COLORS_nonbold "22"
+#define COLORS_fore "3"
+#define COLORS_back "4"
+
+#define COLORS_black "0"
+#define COLORS_red "1"
+#define COLORS_green "2"
+#define COLORS_yellow "3"
+#define COLORS_blue "4"
+#define COLORS_magenta "5"
+#define COLORS_cyan "6"
+#define COLORS_white "7"
+
+#define COLORS_bright_black COLORS_black COLORS_delim COLORS_bold
+#define COLORS_bright_red COLORS_red COLORS_delim COLORS_bold
+#define COLORS_bright_green COLORS_green COLORS_delim COLORS_bold
+#define COLORS_bright_yellow COLORS_yellow COLORS_delim COLORS_bold
+#define COLORS_bright_blue COLORS_blue COLORS_delim COLORS_bold
+#define COLORS_bright_magenta COLORS_magenta COLORS_delim COLORS_bold
+#define COLORS_bright_cyan COLORS_cyan COLORS_delim COLORS_bold
+#define COLORS_bright_white COLORS_white COLORS_delim COLORS_bold
+
+#define COLORS_dark_black COLORS_black COLORS_delim COLORS_nonbold
+#define COLORS_dark_red COLORS_red COLORS_delim COLORS_nonbold
+#define COLORS_dark_green COLORS_green COLORS_delim COLORS_nonbold
+#define COLORS_dark_yellow COLORS_yellow COLORS_delim COLORS_nonbold
+#define COLORS_dark_blue COLORS_blue COLORS_delim COLORS_nonbold
+#define COLORS_dark_magenta COLORS_magenta COLORS_delim COLORS_nonbold
+#define COLORS_dark_cyan COLORS_cyan COLORS_delim COLORS_nonbold
+#define COLORS_dark_white COLORS_white COLORS_delim COLORS_nonbold
+
+/*
+ * Usage example:
+ * printf( color_reset "this is white-on-black text"
+ * color(red, blue) "this is red-on-blue text"
+ * color_fg(green) "this is green-on-blue text"
+ * color_fg(bright_white) "this is bright-white-on-blue text"
+ * color_bg(black) "this is bright-white-on-black text"
+ * color_reset "this is white on black\n"
+ * );
+ * Note: Bright colors are only allowed in the foreground.
+ */
+
+#define color_fg(c) COLORS_begin COLORS_fore COLORS_ ## c COLORS_end
+#define color_bg(c) COLORS_begin COLORS_back COLORS_ ## c COLORS_end
+#define color(fore_c, back_c) COLORS_begin COLORS_fore COLORS_ ## fore_c COLORS_delim COLORS_back COLORS_ ## back_c COLORS_end
+#define color_reset COLORS_begin COLORS_reset COLORS_end
+
+#else /* !defined(VP_DEBUG_COLOR) */
+
+#define color_fg(c) ""
+#define color_bg(c) ""
+#define color(fore_c, back_c) ""
+#define color_reset ""
+
+#endif
+
+#endif /* VP_DEBUG_COLORS_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_debug_masks.h b/marvell/services/mislic/api_lib/includes/vp_debug_masks.h
new file mode 100644
index 0000000..2176074
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_debug_masks.h
@@ -0,0 +1,48 @@
+/** \file vp_debug_masks.h
+ * vp_debug_masks.h
+ *
+ * This file contains the debug masks for the VP-APi_II
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 11245 $
+ * $LastChangedDate: 2013-12-17 11:24:47 -0600 (Tue, 17 Dec 2013) $
+ */
+
+#ifndef VP_DEBUG_MASKS_H
+#define VP_DEBUG_MASKS_H
+
+/* VP-API debug message types: */
+#define VP_DBG_ERROR 0x00000001L /* Any error condition */
+#define VP_DBG_WARNING 0x00000002L /* Any warning condition */
+#define VP_DBG_INFO 0x00000004L /* Un-categorized information */
+#define VP_DBG_API_FUNC 0x00000008L /* API function entry/exit (except tick) */
+
+#define VP_DBG_API_FUNC_INT 0x00000010L /* Internal API function entry/exit */
+#define VP_DBG_HAL 0x00000020L /* HAL traffic */
+#define VP_DBG_SSL 0x00000040L /* SSL function entry/exit */
+#define VP_DBG_EVENT 0x00000080L /* Events/results from VpGetEvent()/VpGetResults() */
+
+#define VP_DBG_HOOK 0x00000100L /* Hook Based Code */
+#define VP_DBG_LINE_STATE 0x00000200L /* Set Line State Based Code */
+#define VP_DBG_CALIBRATION 0x00000400L /* VpCalCodec(), VpCalLine(), VpCal() */
+#define VP_DBG_TEST 0x00000800L /* Verbose test debug */
+
+#define VP_DBG_TEST_FUNC 0x00001000L /* Test I/F function enter and exit */
+#define VP_DBG_FXO_FUNC 0x00002000L /* FXO Detection Code */
+#define VP_DBG_SEQUENCER 0x00004000L /* Sequencer Based Code */
+#define VP_DBG_CID 0x00008000L /* Caller ID funcitons */
+
+#define VP_DBG_TEST_PCM 0x00010000L /* Verbose test pcm collection */
+#define VP_DBG_GAIN 0x00020000L /* VpSetRelGain() and VP_OPTION_ID_ABS_GAIN */
+#define VP_DBG_TIMER 0x00040000L /* API Timers */
+#define VP_DBG_TEST_CALC 0x00080000L /* Verbose test calculations */
+
+#define VP_DBG_ADP_RING 0x00100000L /* Adaptive Ringing */
+#define VP_DBG_INTERRUPT 0x00200000L /* Interrupts */
+#define VP_DBG_DTMF 0x00400000L /* DTMF Detection */
+#define VP_DBG_DTMF_DETAIL 0x00800000L /* Detailed DTMF Detection */
+
+#define VP_DBG_ALL 0xFFFFFFFFL
+
+#endif /* VP_DEBUG_MASKS_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_dtmf_detect.h b/marvell/services/mislic/api_lib/includes/vp_dtmf_detect.h
new file mode 100644
index 0000000..aa10de2
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_dtmf_detect.h
@@ -0,0 +1,75 @@
+/** \file vp_pulse_decode.h
+ * vp_pulse_decode.h
+ *
+ * Header file for the VP DTMF Detect Module c file.
+ *
+ * Copyright (c) 2013, Microsemi Corporation
+ *
+ * $Revision: 9734 $
+ * $LastChangedDate: 2012-03-30 16:37:31 -0500 (Fri, 30 Mar 2012) $
+ */
+
+#ifndef VP_DTMF_DETECT_H
+#define VP_DTMF_DETECT_H
+
+#include "vp_api.h"
+#include "vp_api_types.h"
+
+/* Use different block sizes to get near-integer k for each target frequency,
+ where k = (target / (sampleRate / blockSize)) */
+#define VP_DTMF_BLOCK_SIZE_4KHZ_MAX 53
+#define VP_DTMF_BLOCK_SIZE_4KHZ_697 52
+#define VP_DTMF_BLOCK_SIZE_4KHZ_770 52
+#define VP_DTMF_BLOCK_SIZE_4KHZ_852 52
+#define VP_DTMF_BLOCK_SIZE_4KHZ_941 51
+#define VP_DTMF_BLOCK_SIZE_4KHZ_1209 53
+#define VP_DTMF_BLOCK_SIZE_4KHZ_1336 51
+#define VP_DTMF_BLOCK_SIZE_4KHZ_1477 51
+#define VP_DTMF_BLOCK_SIZE_4KHZ_1633 51
+#define VP_DTMF_BLOCK_SIZE_4KHZ_625 51
+#define VP_DTMF_BLOCK_SIZE_4KHZ_1022 51
+#define VP_DTMF_BLOCK_SIZE_4KHZ_1119 50
+
+#define VP_DTMF_BLOCK_SIZE_8KHZ_MAX 106
+#define VP_DTMF_BLOCK_SIZE_8KHZ_697 103
+#define VP_DTMF_BLOCK_SIZE_8KHZ_770 104
+#define VP_DTMF_BLOCK_SIZE_8KHZ_852 103
+#define VP_DTMF_BLOCK_SIZE_8KHZ_941 102
+#define VP_DTMF_BLOCK_SIZE_8KHZ_1209 106
+#define VP_DTMF_BLOCK_SIZE_8KHZ_1336 102
+#define VP_DTMF_BLOCK_SIZE_8KHZ_1477 103
+#define VP_DTMF_BLOCK_SIZE_8KHZ_1633 103
+#define VP_DTMF_BLOCK_SIZE_8KHZ_625 102
+#define VP_DTMF_BLOCK_SIZE_8KHZ_1022 102
+#define VP_DTMF_BLOCK_SIZE_8KHZ_1119 100
+
+/* Block size to normalize results against */
+#define VP_DTMF_NORMAL_BLOCKSIZE 102
+
+/* Scale energy results down by this many bits */
+#define VP_DTMF_NORMAL_ENERGY_SCALE 16
+
+
+#ifdef VP886_INCLUDE_DTMF_DETECT
+
+void
+VpDtmfDetectReset(
+ VpLineCtxType *pLineCtx,
+ VpDtmfDetectDataType *pDtmfData,
+ bool freshStart);
+
+void
+VpDtmfDetectInit(
+ VpLineCtxType *pLineCtx,
+ VpDtmfDetectDataType *pDtmfData);
+
+VpDigitType
+VpDtmfDetectProcess(
+ VpLineCtxType *pLineCtx,
+ VpDtmfDetectDataType *pDtmfData,
+ int16 *pSamples,
+ uint8 numSamples);
+
+#endif /* VP886_INCLUDE_DTMF_DETECT */
+
+#endif /* VP_DTMF_DETECT_H */
diff --git a/marvell/services/mislic/api_lib/includes/vp_pulse_decode.h b/marvell/services/mislic/api_lib/includes/vp_pulse_decode.h
new file mode 100644
index 0000000..a3b1c51
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_pulse_decode.h
@@ -0,0 +1,31 @@
+/** \file vp_pulse_decode.h
+ * vp_pulse_decode.h
+ *
+ * Header file for the VP Pulse Decoder Module c file.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 9734 $
+ * $LastChangedDate: 2012-03-30 16:37:31 -0500 (Fri, 30 Mar 2012) $
+ */
+
+#ifndef VP_PULSE_DECODE_H
+#define VP_PULSE_DECODE_H
+
+#include "vp_api.h"
+#include "vp_api_types.h"
+#include "sys_service.h"
+
+EXTERN void
+VpPulseDecodeInit(
+ VpPulseDecodeDataType *pPulseData);
+
+EXTERN uint16
+VpPulseDecodeRun(
+ VpLineCtxType *pLineCtx,
+ VpPulseDecodeDataType *pPulseData,
+ VpPulseDecodeInputType input,
+ uint16 timestamp);
+
+#endif /* VP_PULSE_DECODE_H */
+
diff --git a/marvell/services/mislic/api_lib/includes/vp_timer_queue.h b/marvell/services/mislic/api_lib/includes/vp_timer_queue.h
new file mode 100644
index 0000000..fdceda5
--- /dev/null
+++ b/marvell/services/mislic/api_lib/includes/vp_timer_queue.h
@@ -0,0 +1,85 @@
+/** \file vp_timer_queue.h
+ * vp_timer_queue.h
+ *
+ * Header file for the VP Timer Queue Module c file.
+ *
+ * Copyright (c) 2011, Microsemi Corporation
+ *
+ * $Revision: 10976 $
+ * $LastChangedDate: 2013-05-21 18:08:34 -0500 (Tue, 21 May 2013) $
+ */
+
+#ifndef VP_TIMER_QUEUE_H
+#define VP_TIMER_QUEUE_H
+
+#include "vp_api.h"
+#include "vp_api_types.h"
+#include "sys_service.h"
+
+#define VP_END_OF_TIMER_QUEUE -1
+
+/* Note: The following functions may be called from
+ device specific timer function wrappers if necessary */
+EXTERN bool
+VpInitTimerQueue(
+ VpTimerQueueInfoType *pInfo,
+ VpTimerQueueNodeType *pNodes);
+
+EXTERN bool
+VpInsertTimer(
+ VpDevCtxType *pDevCtx,
+ VpTimerQueueInfoType *pInfo,
+ VpTimerQueueNodeType *pNodes,
+ uint16 timerId,
+ uint32 timerDuration,
+ uint8 channelId,
+ uint32 handle);
+
+EXTERN bool
+VpRemoveTimer(
+ VpDevCtxType *pDevCtx,
+ VpTimerQueueInfoType *pInfo,
+ VpTimerQueueNodeType *pNodes,
+ uint16 timerId,
+ uint8 channelId,
+ uint32 handle,
+ bool matchHandle);
+
+EXTERN bool
+VpRemoveChannelTimers(
+ VpDevCtxType *pDevCtx,
+ VpTimerQueueInfoType *pInfo,
+ VpTimerQueueNodeType *pNodes,
+ uint8 channelId);
+
+EXTERN bool
+VpRestartTimer(
+ VpDevCtxType *pDevCtx,
+ VpTimerQueueInfoType *pInfo,
+ VpTimerQueueNodeType *pNodes,
+ uint16 timerId,
+ uint32 timerDuration,
+ uint8 channelId,
+ uint32 handle);
+
+EXTERN bool
+VpExtendTimer(
+ VpDevCtxType *pDevCtx,
+ VpTimerQueueInfoType *pInfo,
+ VpTimerQueueNodeType *pNodes,
+ uint16 timerId,
+ uint32 timerDuration,
+ uint8 channelId,
+ uint32 handle);
+
+EXTERN void
+VpProcessTimers(
+ VpDevCtxType *pDevCtx,
+ VpTimerQueueInfoType *pInfo,
+ VpTimerQueueNodeType *pNodes);
+
+#endif /* VP_TIMER_QUEUE_H */
+
+
+
+