From f075b2449564809159cfed51a1f92e2f50ef0793 Mon Sep 17 00:00:00 2001 From: Alexander Abraham Date: Sun, 9 Jun 2019 18:55:03 +0530 Subject: [PATCH] Initial commit of DSL CPE Control Application source for prplwrt --- ABOUT-NLS | 0 AUTHORS | 0 COPYING | 0 ChangeLog | 1000 ++ LICENSE | 367 + Makefile.am | 52 + Makefile.in | 925 ++ NEWS | 0 README | 102 + TODO | 0 aclocal.m4 | 1153 ++ build_vxworks/control_dsl_cpe_api.wpj | 328 + build_win32/dsl_cpe_control_version.h | 25 + build_win32/vc7/dsl_cpe_control.sln | 62 + build_win32/vc7/dsl_cpe_control.vcproj | 515 + compile | 347 + configure | 11566 ++++++++++++++++++++ configure.in | 2169 ++++ depcomp | 791 ++ install-sh | 501 + missing | 215 + scripts/alias_dsl_cpe.sh | 19 + scripts/dsl_cpe_pipe.sh | 18 + src/Makefile.am | 207 + src/Makefile.in | 1163 ++ src/dsl_cpe_bnd_vrx.c | 868 ++ src/dsl_cpe_bnd_vrx.h | 172 + src/dsl_cpe_cli.c | 1372 +++ src/dsl_cpe_cli.h | 235 + src/dsl_cpe_cli_access.c | 13186 +++++++++++++++++++++++ src/dsl_cpe_cli_access2.c | 3516 ++++++ src/dsl_cpe_cli_autogen.c | 11451 ++++++++++++++++++++ src/dsl_cpe_cli_console.c | 664 ++ src/dsl_cpe_cli_console.h | 58 + src/dsl_cpe_cli_mib.c | 1986 ++++ src/dsl_cpe_cli_pipe.c | 402 + src/dsl_cpe_cli_vrx.c | 2972 +++++ src/dsl_cpe_config.h.in | 294 + src/dsl_cpe_control.c | 7553 +++++++++++++ src/dsl_cpe_control.h | 557 + src/dsl_cpe_debug.c | 1099 ++ src/dsl_cpe_debug.h | 388 + src/dsl_cpe_debug_vrx.c | 1649 +++ src/dsl_cpe_debug_vrx.h | 319 + src/dsl_cpe_dti.c | 527 + src/dsl_cpe_dti.h | 67 + src/dsl_cpe_dti_vrx.c | 3154 ++++++ src/dsl_cpe_dti_vrx_ctx.h | 92 + src/dsl_cpe_init_cfg.c | 230 + src/dsl_cpe_init_cfg.h | 96 + src/dsl_cpe_linux.c | 1639 +++ src/dsl_cpe_linux.h | 572 + src/dsl_cpe_os.h | 277 + src/dsl_cpe_os_lint_map.h | 628 ++ src/dsl_cpe_rtems.c | 68 + src/dsl_cpe_rtems.h | 66 + src/dsl_cpe_safec_wrapper.h | 30 + src/dsl_cpe_simulator.c | 200 + src/dsl_cpe_simulator.h | 33 + src/dsl_cpe_vxworks.c | 116 + src/dsl_cpe_vxworks.h | 90 + src/dsl_cpe_win32.c | 112 + src/dsl_cpe_win32.h | 129 + tools/pipe/Makefile.am | 32 + tools/pipe/Makefile.in | 685 ++ tools/pipe/dsl_cpe_safec_wrapper.h | 33 + tools/pipe/dsl_pipe_client.c | 489 + tools/pipe/dsl_pipe_client.h | 173 + tools/pipe/dsl_pipe_lib.c | 88 + 69 files changed, 79892 insertions(+) create mode 100644 ABOUT-NLS create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 LICENSE create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100644 build_vxworks/control_dsl_cpe_api.wpj create mode 100644 build_win32/dsl_cpe_control_version.h create mode 100644 build_win32/vc7/dsl_cpe_control.sln create mode 100644 build_win32/vc7/dsl_cpe_control.vcproj create mode 100755 compile create mode 100755 configure create mode 100644 configure.in create mode 100755 depcomp create mode 100755 install-sh create mode 100755 missing create mode 100644 scripts/alias_dsl_cpe.sh create mode 100755 scripts/dsl_cpe_pipe.sh create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/dsl_cpe_bnd_vrx.c create mode 100644 src/dsl_cpe_bnd_vrx.h create mode 100644 src/dsl_cpe_cli.c create mode 100644 src/dsl_cpe_cli.h create mode 100644 src/dsl_cpe_cli_access.c create mode 100644 src/dsl_cpe_cli_access2.c create mode 100644 src/dsl_cpe_cli_autogen.c create mode 100644 src/dsl_cpe_cli_console.c create mode 100644 src/dsl_cpe_cli_console.h create mode 100644 src/dsl_cpe_cli_mib.c create mode 100644 src/dsl_cpe_cli_pipe.c create mode 100644 src/dsl_cpe_cli_vrx.c create mode 100644 src/dsl_cpe_config.h.in create mode 100644 src/dsl_cpe_control.c create mode 100644 src/dsl_cpe_control.h create mode 100644 src/dsl_cpe_debug.c create mode 100644 src/dsl_cpe_debug.h create mode 100644 src/dsl_cpe_debug_vrx.c create mode 100644 src/dsl_cpe_debug_vrx.h create mode 100644 src/dsl_cpe_dti.c create mode 100644 src/dsl_cpe_dti.h create mode 100644 src/dsl_cpe_dti_vrx.c create mode 100644 src/dsl_cpe_dti_vrx_ctx.h create mode 100644 src/dsl_cpe_init_cfg.c create mode 100644 src/dsl_cpe_init_cfg.h create mode 100644 src/dsl_cpe_linux.c create mode 100644 src/dsl_cpe_linux.h create mode 100644 src/dsl_cpe_os.h create mode 100644 src/dsl_cpe_os_lint_map.h create mode 100644 src/dsl_cpe_rtems.c create mode 100644 src/dsl_cpe_rtems.h create mode 100644 src/dsl_cpe_safec_wrapper.h create mode 100644 src/dsl_cpe_simulator.c create mode 100644 src/dsl_cpe_simulator.h create mode 100644 src/dsl_cpe_vxworks.c create mode 100644 src/dsl_cpe_vxworks.h create mode 100644 src/dsl_cpe_win32.c create mode 100644 src/dsl_cpe_win32.h create mode 100644 tools/pipe/Makefile.am create mode 100644 tools/pipe/Makefile.in create mode 100644 tools/pipe/dsl_cpe_safec_wrapper.h create mode 100644 tools/pipe/dsl_pipe_client.c create mode 100644 tools/pipe/dsl_pipe_client.h create mode 100644 tools/pipe/dsl_pipe_lib.c diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..e69de29 diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..e69de29 diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..b50fef5 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,1000 @@ +NEXT VERSION + +V4.21.1 - 2018-10-29 +- VRX (DSLCPE_SW-1164) The configuration file for the DSL Subsystem + (dsl_web.cfg) is not written correctly + +V4.21.0 - 2018-08-17 +-.(DSLCPE_SW-1151) Using some CLI commands results in CLI interface stuck +- VRX (DSLCPE_SW-1153) Cleanup of banned functions + +V4.20.1 - 2018-06-28 +common: +- VRX (DSLCPE_SW-1147 ) KlocworkFixes + +V4.20.0 - 2018-05-30 +common: +- VRX (DSLCPE_SW-1068) Extended autoboot script file handling needs to support + dynamic line numbers +- VRX (DSLCPE_SW-1113) Temporary state machine stuck +- VRX (DSLCPE_SW-1125) [DSL_PHY] Power Saving for Disabled DSL Lines in VRX518 + +V4.19.3 - 2017-12-06 +- + +V4.19.2 - 2017-12-04 +common: +- VRX (DSLCPE_SW-1103) Usage of new BAR register for PPE frequency scaling + + Added handling for new suberror code LINIT_SUB_S_PP_CLOCK_NEW +- VRX (DSLCPE_SW-1086) Extend DSL CPE API to work with line state change events + instead of polling + + Updated CLI interface and related printouts + +V4.19.1 - 2017-10-26 +common: +- VRX (DSLCPE_SW-1071) Start processing of xdslrc.sh in the background +- VRX (DSLCPE_SW-1082) Extension of statistic counters for DSM (vectoring) +- VRX (DSLCPE_SW-1079) Support and cleanup functionality for ADSL PTM bonding + +V4.19.0 - 2017-06-08 +- + +V4.18.10 - 2017-04-21 +common: +- Klocwork rework cycle(s) for UGW-7.2 + +V4.18.9 - 2017-03-24 +common: +- VRX (DSLCPE_SW-1003) Automatic detection of available VRX devices +- VRX (DSLCPE_SW-1027) Problems with operating non-bonded CO line with bonded CPE + + fix disabling two lines if 2 FULL_INIT events are queued +- VRX (DSLCPE_SW-958) warn about format errors and fix them + + Corrected printf handling within DSL_CPE_debug_printf to avoid compilation + error +- VRX (DSLCPE_SW-1001) Extend API driver and Control Application with support + for R10 FW + + import mcat version 2.9 + + extend internal tables for 8192 carriers + +V4.18.8 - 2017-03-02 +common: +- VRX318/518 (DSLCPE_SW-1003) Automatic detection of available VRX devices + + Use number of lines / devices from MEI module initialization instead of + defines + + CLI working on single / bonding properly + +V4.18.7 - 2017-02-10 +- + +V4.18.6 - 2017-01-26 +common: +- VRX (DSLCPE_SW-1027) Problems with operating non-bonded CO line with bonded CPE + + fix disabling two lines if 2 FULL_INIT events are queued + +V4.18.5 - 2016-12-07 +common: +- VRX (DSLCPE_SW-1006) Extend vectoring configuration with automode + + Extended configuration also includes automode +- VRX (DSLCPE_SW-1001) Extend API driver and Control Application with support + for R10 FW + + import mcat version 2.9 + + extend internal tables for 8192 carriers + +V4.18.4 - 2016-09-05 +common: +- VRX (DSLCPE_SW-990) Extend API driver and Control Application for support of + new VRX518 device + + extended configuration option to make VR11 (VRX518) available +- VRX: FW download support integrated into built-in DTI agent +- VRX: Bonded devices support integrated into built-in DTI agent + +V4.18.3 - 2016-08-31 +- + +V4.18.2 - 2016-08-11 +common: +- (UGW_SW-8554) DSL Klockwork issues + + Fixed a warmings from Klockwork + +V4.18.1 - 2016-07-29 +common: +- VRX300 (DSLCPE_SW-995) Add workaround for "wrong hybrid type" issue + + Added full FW download on receiving suberror 0xF, S_FW_HYBRID from FW +- VRX (DSLCPE_SW-958) warn about format errors and fix them + + Fixed compilation -Wformat warnings + + Adjust DSL_CPE_sscanf to comply with gcc standard + + Change DSL_CPE_sscanf to sscanf +- VRX (DSLCPE_SW-997) Add possiblity to download CPE FW through DTI + + FW download support integrated into built-in DTI agent +- VRX (DSLCPE_SW-996) DTI interface does not work on second channel of + bonding CPEs + + Bonded devices support integrated into built-in DTI agent +- VRX (DSLCPE_SW-916) API Interface extensions to support calibration + configuration for US/DS PSD + + New commnad(s) added: + "pccg" / "PsdCalibrationConfigGet" + "pccs" / "PsdCalibrationConfigSet" +- VRX (DSLCPE_SW-976) DSL pipe gets hung randomly during reboot + + Correct a typo + +V4.18.0 - 2016-02-29 +common: +- VRX (DSLCPE_SW-959) [VRX] Extend DTI Standalone Agent with missing + initialization parts + - New build option added (--enable-dti-agent-st-alone-support) to enable + an additional pipe for the DTI stand-alone agent +- VRX (DSLCPE_SW-957) Bringup of VRX320 on Cougar Park V2.0 hardware + + fix build without DTI, but with debug +- VRX (DSLCPE_SW-953) [Debug] Usage of netlink ID -29 (NETLINK_DBG_MSG) + + DSL_DBG_MSG_NETLINK_ID can be configured via MEI driver configuration of + menuconfig +- VRX (DSLCPE_SW-913) Extend the interface for Script Notification Handling + with DELT notifications + + Supported interface status state "LDM_ACTIVE" and "LDM_COMPLETE" +- (DSLCPE_SW-942) Increase buffer size for CLI commands to accept messages + which reaches mailbox size + + Extended buffer size to 1024 for CLI commands executed from xdsl.scr +Bug fix(es): +- VRX (DSLCPE_SW-872) Problem with 32-bit oriented WinHost messages that + exceeds 256 bytes total message length + + Fixed TCP message parse endianness issue +CLI: +- (DSLCPE_SW-908) Complete/review parameters within DSL FAPI/Subystem + interface mapping + + New command(s) added: + "t1413xtuorg" / "T1413_XTUO_RevisionGet" + "t1413xturrg" / "T1413_XTUR_RevisionGet" + "t1413xtuovrg" / "T1413_XTUO_VendorRevisionGet" + "t1413xturvrg" / "T1413_XTUR_VendorRevisionGet" + + Extended command: + "g997upbosg" / "G997_UsPowerBackOffStatusGet" + + +V4.17.19 - 2015-12-01 +- Branch-off point for development only (no tarball) + +V4.17.18 - 2015-11-17 +common: +- VRX (DSLCPE_SW-934) [Debug] Extend DTI built-in version with full + functionality from DTI Standalone Agent: + + Implementations for the following handler added: + DTI_VRX_TraceBufferConfigSet, + DTI_VRX_TraceBufferReset, + DTI_VRX_TraceBufferStatusGet, + DTI_VRX_TraceBufferGet + + Interface name and board name modified (DSL-CPE, DSL CPE Board accordingly) +- VRX (DSLCPE_SW-911) Remove "Automatic detection from XTSE configuration" + for ActivationSequence + + Changed default activation sequence to Standard + + Mapped activation sequence Auto to defalut (Standard) for 'S' startup option + +V4.17.17 - 2015-10-13 +common: +- (DSLCPE_SW-927) Klocwork rework cycle(s) for UGW-7.1 + + Fixed warnings + +V4.17.16 - 2015-10-09 +- + +V4.17.15 - 2015-09-25 +common: +- (DSLCPE_SW-914) Remove SOAP implementation + + Removed SOAP related files + + Excluded SOAP related functionality + +V4.17.14 - 2015-09-02 +common: +- VRX (DSLCPE_SW-887) [Debug] Include support for handling of debug strings + wrt UGW-6.5 definitions/requirements + + Backward capability support added for the new logging macros + + New logging framework integrated for event strings + + Debug logger support added + + DBG_ModuleDestinationSet/Get CLI commands added to control DSL API debug + output destination ( DSL_DBG_DST_CONSOLE / DSL_DBG_DST_LOGGER ) + + CCA_DBG_ModuleDestinationSet/Get CLI commands added to control CCA debug + output destination ( DSL_CCA_DBG_DST_CONSOLE / DSL_CCA_DBG_DST_LOGGER ) +- VRX (DSLCPE_SW-889) API extension needed for 35b profile + + Extended help with profile 35b for "bpstg"/"BandPlanSTatusGet", + "vpcs", "VdslProfileConfigSet", "vpcg", "VdslProfileConfigGet" + +V4.17.13 - 2015-08-19 +- + +V4.17.12 - 2015-08-07 +common: +- (DSLCPE_SW-901) Rework open topics from integration within SL + + Fixed Klocwork warnings + +V4.17.11 - 2015-07-17 +- + +V4.17.10- 2015-07-10 +- VRX DSLCPE_SW-883 Implementation of TR-181 extensions for DSL FAPI (phase2) + + Extended "g997upbosg"/"G997_UsPowerBackOffStatusGet" with nKleRPb parameter + + Added "g997rasg"/"G997_RateAdaptationStatusGet" + +V4.17.9 - 2015-06-26 +common: +- Updated copyright header and "LICENSE" file + +V4.17.8 - 2015-06-19 +common: +- VRX (DSLCPE_SW-879) Correct implementation to use existing built-in DTI of + dsl_cpe_control + + Added module setup and configuration message DTI handler to configure + DTI client for the device packet handling + + Added 16/32-bit message DTI handler to send the messages to VRX device + via DTI client + + Added autonomous message DTI handler to send the autonomous messages + from VRX device to DTI client + + Added debug read/write DTI handler to get access to internal memory of + VRX device via DTI client + + Added register set/get DTI handler to get access to internal registers of + VRX device via DTI client + +V4.17.7 - 2015-03-16 +common: +- VRX320 (DSLCPE_SW-816) Merge changes from "vrx320_qca" to "default" branch + + added VRX320 device support +- VRX (DSLCPE_SW-854) Unify usage of additional extra c-flags via menuconfig + + supported extra c-flags handling + +V4.17.6 - 2015-03-02 +- + +V4.17.5 - 2015-01-23 +common: +- VRX - Initial version that supports GRX500 + + Included possibility to use external driver c-flags + +V4.17.4 - 2015-01-09 +Bug fix(es): +- VRX (DSLCPE_SW-770) Klocwork reworks/fixes for UGW-6.1(.x) +CLI: +- VRX (DSLCPE_SW-839) Changes related to Attainable Net Datarate (ATTNDR) + + Added "g997ansg"/"G997_AttainableNdrStatusGet" for ioctl + DSL_FIO_G997_ATTAINABLE_NDR_STATUS_GET +- VRX (DSLCPE_SW-841) Extend VersionInformationGet parameter "nHybrid" with + new definition + + extended "vig"/"VersionInformationGet" help printout + +V4.17.3 - 2014-12-05 +common: +- VRX (DSLCPE_SW-840) DSL API EVENT shows "DSL DOWN" when TC-sync-loss occurs + + toggeling between TC_SYNC and TC_NO_SYNC will *not* result in interface + status "DOWN" indication via script notification handling anymore + Related DSL Firmware Jira: XDSLRTFW-2050 +- VRX (DSLCPE_SW-837) API for FW R8 Release - Change of default configuration + values + + changed default value for XTSE AnnexA (excluded T1.413) +CLI: +- (DSLCPE_SW-823) Configure NE inventory with meaningful values based on CPE + platform and config + + fixed g997listrg/G997_LineInventorySTRingGet output format (print dots + instead of non-printable symbol) +- VRX (DSLCPE_SW-749) Rework Retransmission counter related API functions. + + fixed parameters check issue for pmrtt15ms, pmrtt1ds +- VRX (DSLCPE_SW-837) API for FW R8 Release - Change of default configuration + values + + extended lfcg/lfcs and rccg/rccs with nDslMode parameter +Bug fix(es): +- (DSLCPE_SW-834) Klocwork reworks/fixes for UGW-5.4 maintenance release + + fixed dsl pipe tool warning + +V4.17.2 - 2014-10-24 +common: +- VRX (DSLCPE_SW-798) VDSL/ATM mode issue with API 4.16.5-pd1 + + Extended system interface status handler to trigger current xDSL status via + firmware version (application code) instead of current XTSE status +CLI: +- VRX (DSLCPE_SW-810) CPE configuration of supported VDSL Profiles + + Added "vpcs"/"VdslProfileConfigSet" for ioctl DSL_FIO_VDSL_PROFILE_CONFIG_SET + + Added "vpcg"/"VdslProfileConfigGet" for ioctl DSL_FIO_VDSL_PROFILE_CONFIG_GET +- VRX (DSLCPE_SW-817) Extend interface of DSL Subsystem to configure PLL offset value) + + added "meipocg"/"MEI_PllOffsetConfigGet" for ioctl FIO_MEI_PLL_OFFSET_CONFIG_GET + + added "meipocs"/"MEI_PllOffsetConfigSet" for ioctl FIO_MEI_PLL_OFFSET_CONFIG_SET + +V4.17.1 - 2014-08-12 +- + +V4.17.0 - 2014-08-04 +common: +- VRX (DSLCPE_SW-781) Rework autoboot status handling in case of disabled autoboot. +- VRX (DSLCPE_SW-794) Optimize DSL Firmware download from performance point of view. + + extended DSL_FIO_AUTOBOOT_LOAD_FIRMWARE ioctl handling by bForceFwDownload flag + to control reuse chunks mode +CLI: +- VRX (DSLCPE_SW-745) Optimization for functions which returns per-subcarrier data + + Extended printouts (nToneIndex -> nGroupeIndex) for + "g997dsnrg"/"G997_DeltSNRGet" and "dsnrg"/"DeltSNRGet" + +V4.16.6 - 2014-04-16 +common: +- (DSLCPE_SW-793) Create a program (binary) that handles dsl_cpe pipes + + added dsp_cpe_pipe application handling within tools/pipe folder + + take max. number of pipes into account which are defined via c-flag +CLI: +- (DSLCPE_SW-784) State 0xff on CPE after activation of Debug messages + for mutlimode tests + + added "fdsg"/"FirmwareDownloadStatusGet" + +V4.16.5 - 2014-03-07 +- + +V4.16.4 - 2014-03-05 +common: +- VRX (DSLCPE_SW-770) Klocwork reworks/fixes for UGW-6.1 +- (DSLSPE_SW-771) Extend debugging functionality and take care that it is + working completely + + extended ccadbgmls/ccadbgmlsg (+ DSL_CCA_DBG_NOTIFICATIONS) + + extended dbgmls/dbgmlsg (+ DSL_DBG_NOTIFICATIONS) +- (DSLCPE_SW-748) TCP Message interface shall be configurable at runtime + + extended TCP debug server implementation (connection close functionality) + + fixed WinHost firnware reboot "rb" command handling +CLI: + + added "tcpmistart"/"TCPMessageInterfaceSTART" + + added "tcpmistop" /"TCPMessageInterfaceSTOP" + +V4.16.3 - 2014-01-29 +common: +- VRX (DSLCPE_SW-775) Automatically enable Telefonica mode in case of T1.413 is + configured at startup + + set activation auto sequence for default configuration +- (DSLCPE_SW-779) Autoboot handling should be not started automatically within + API initialization + + set default value for DSL_FIO_INIT as DSL_AUTOBOOT_CTRL_STOP + +V4.16.2 - 2014-01-16 +common: +- (DSLCPE_SW-770) Klocwork reworks/fixes for UGW-6.1. + + Correction for latest Klocwork fixes (compilation without debug symbols) + +V4.16.1 - 2014-01-15 +CLI: +- (DSLCPE_SW-776) Request of various CLI parameters is incorrect. + + Fixed wrong variable initialization. +common: +- (DSLCPE_SW-770) Klocwork reworks/fixes for UGW-6.1. + + Fixed build warnings + +V4.16.0 - 2014-01-10 +common: +- Updated copyright header (year 2014) + +V4.15.10 - 2013-12-19 +- + +V4.15.9 - 2013-12-06 +- + +V4.15.8 - 2013-12-05 +common: +- VRX (DSLCPE_SW-749) Rework Retransmission counter related API functions. + + Extended PM_ReTxCounters with nErrorFreeBits, nLeftr. + + Extended PM_LineSecCounters with nFECS. + +V4.15.7 - 2013-09-18 +- + +V4.15.6 - 2013-09-13 +common: +- (DSLCPE_SW-755) Extensions for G997_RateAdaptationConfigSet handling +- (DSLCPE_SW-734) Take care that DSL Subsystem is fully functional with + Linux kernel 3.8 + + Extended DTI dependence +- VRX (DSLCPE_SW-754) Using different DSL FW binaries for dual port + and single port mode. + + Extended fw download implementation with second firmware handling. +CLI: + + Extended "alf"/"AutobootLoadFirmware" with second firmware + +V4.15.5 - 2013-08-22 +Bug fix(es): +- (DSLCPE_SW-750) Usage of debug option "-D" results in segmentation fault. + + Wrong memset data size caused setting NULL pointer, fixed size. + +V4.15.4 - 2013-08-16 +common: +- (DSLCPE_SW-734) Take care that DSL Subsystem is fully functional with + Linux kernel 3.8. + + Extended source code for Danube to be compilable with linux kernel 3.8 + +V4.15.3 - 2013-08-09 +common: +- (DSLCPE_SW-734) Take care that DSL Subsystem is fully functional with + Linux kernel 3.8. + + Extended source code for VRX to be compilable with linux kernel 3.8 + + DTI is currently excluded + +V4.15.2 - 2013-07-29 +CLI: +- VRX (DSLCPE_SW-744) SNRpsds w/ and w/o virtual noise including bugfixes for + all per-tone/subcarrier functions. + New command(s) added: + + "dsnrg"/"DeltSnrGet" + +V4.15.1 - 2013-07-18 +common: +- VRX (DSLCPE_SW-740) Extend limit for DS datarate configuration to max. + possible value (245.76 MBitps) + +V4.15.0 - 2013-07-10 +common: +- VRX (DSLCPE_SW-729) Add FAST LOS suberror code to the known list of + SubErrorCodes + Added within DSL_EVENT_S_LINIT_FAILURE console printouts +- (DSLCPE_SW-704) Investigate error prints within autoboot stop/start sequence. + Updated return code handling for "acs"/"AutobootControlSet" (warnings support). +- Klocwork issues/warnings fixes. +- VRX (DSLCPE_SW-707) Extensions for Multimode State Machine (APS3). + + Added disable/enable second line within training for remote PAF disabled. + + Extended handling for paf-available line first reach FULL_INIT. +CLI: +- VRX (DSLCPE_SW-730) L2 exit according to G.992.3 Amendment 4. + New command(s) added: + + "g997lpmcs"/"G997_LowPowerModeConfigSet" + + "g997lpmcg"/"G997_LowPowerModeConfigGet" +Bug fix(es): +- Added missing printouts for data type DSL_G997_LineInitSubStatus_t within + CLI command "g997lisg"/"G997_LineInitStatusGet" and event handling + +V4.14.12 - 2013-04-05 +- + +V4.14.11 - 2013-04-02 +- + +V4.14.10 - 2013-03-25 +common: +- VRX (DSLCPE_SW-682) API for FW R6 Release - Support for unified multimode + state machine + + Added application startup options (re-used from 4.11.x branch) + - '-M' to configure 'NextMode' for special usage or debugging purpose + - '-S' to configure 'ActivationSequence' and 'ActivationStartMode' for + Telefonica switching mode configuration + + Added new application startup option + - '-R' to configure 'bRemember' flag for special usage or debugging purpose + +V4.14.9 - 2013-03-22 +User interface definition change(s): +- (DSLCPE_SW-701) Extend API interface for getting more fail state information + + Changed CLI commands: "lecg"/"LastExceptionCodesGet" +- VRX (DSLCPE_SW-667) API for FW R6 Release - New AELEM Feature to be added. + Changed nAeleMode type to enum DSL_G997_AeleMode_t. +common: +- (DSLCPE_SW-700) Extensions for "-T" option to configure TC-Layer at API init + time +- Improved debug possibilities for startup handling + + Redefined '-D' option to support separate common debug level for application + and driver. New format "-D{_}" + + Replaced some debug macros with "printf" because they are done before init + of debug settings itself + +V4.14.8 - 2013-03-04 +User interface definition change(s): +- VRX (DSLCPE_SW-679) API for FW R6 Release - Erasure decoding specific INP + report. Increased parameters for "g997csg"/"G997_ChannelStatusGet" + +V4.14.7 - 2013-02-27 +User interface definition change(s): +- VRX (DSLCPE_SW-678) API for FW R6 Release - Handling for new FW application + type (which supports G.Vector). Reduced paramaters for + "dsmcg"/"DsmConfigGet", "dsmcs"/"DsmConfigSet" +- VRX (DSLCPE_SW-686) Extensions for SystemInterfaceStatus handling + Added selection of DSL mode within "sicg/"SystemInterfaceConfigGet" +CLI: +- VRX (DSLCPE_SW-667) API for FW R6 Release - New AELEM Feature to be added. + New command(s) added: + + "g997upbosg"/"G997_UsPowerBackOffStatusGet" + +V4.14.6 - 2013-02-15 +Bug fix(es): +- Added missing value "DSL_ENHANCED_FRAMING_US" within *online help* of CLI + commands "locs/LineOptionsConfigSet" and "locg/LineOptionsConfigGet" + +V4.14.5 - 2013-02-05 +CLI: +- VRX318 [DSLCPE_SW-672] Extend autoboot handling with orderly link shutdown + handling. Updated "lsg/LineStateGet" help. + +V4.14.4 - 2013-01-25 +common: +- Changed default configuration of TC-Layer to DSL_TC_AUTO (to support xTM + multimode handling within context of (DSLCPE_SW-660)) + +V4.14.3 - 2012-12-03 +CLI: +- VRX - Renamed CLI commands for Digital Spectrum Management (usage of separate + namespace "DSM") +- Allow "help" command without device/line number in case of bonding. +- Added additional CLI help groups ("BND" and "DSM"). +common: +- Clean up for left over and not used SAR related CLI functionalities. + +V4.14.2 - 2012-11-26 +CLI: +- VRX - New command(s) added: + + "dcg"/"DsmConfigGet" + + "dcs"/"DsmConfigSet" + + "dsg"/"DsmStatusGet" + + "dstatg"/"DsmSTATisticsGet" + + "dmcg"/"DsmMacConfigGet" + + "dmcs"/"DsmMacConfigSet" + +V4.14.1 - 2012-09-14 +common: +- (DSLCPE_SW-637) [VRX200] API for FW R5.1 Release - Support for Virtual Noise. + Added default configuration for virtual noise US+DS "disabled". + +V4.14.0 - 2012-09-05 +common: +- VRX318 - First version that supports the new SmartPHY device + +V4.13.3 - 2012-09-04 +- + +V4.13.2 - 2012-08-16 +common: +- (DSLCPE_SW-630) Cleanup deprecated functionalities + Removed deprecated implementation related to LED and line failure counter + handling + +V4.13.1 - 2012-07-27 +CLI: +- VRX - New command(s) added: + + "bndpmss"/"BND_PortModeSyncSet" +- (Danube & VRX) ActualNetDataRate parameter added to: + + g997csg/G997_ChannelStatusGet +- VRX (DSLCPE_SW-610) [VRX200] Correct includation of ReTx functionality: + - rtsg/ReTxStatisticsGet command added +common: +- VRX - New IOCTL(s) added: + + DSL_FIO_BND_PORT_MODE_SYNC_SET +- Reduce changelog up to V4.0 +- (DSLCPE_SW-600) Remove unnecessary preprocessor options +Bug fix(es): +- VRX (DSLCPE_SW-603) [VRX200] VRX Onchip-Bonding FSM: Inconsistency after + transition from VDSL dual port to single port mode. Forced switching master + line to single mode in case of slave line switched to single by FSM logic. +- (DSLCPE_SW-626) Fixes needed for compiling DSL Subsystem with glibc/eglibc. + Fixed compile issues for C libraries eglibc/glibc according to + 011-fix-glibc-compilation.patch +- (DSLCPE_SW-624) Prints from DSL notific. script are not shown on the console. + Fixed echo problem (closed file descriptor for stdout). + +V4.13.0 - 2012-03-19 +- + +V4.12.3 - 2012-03-09 +CLI: +- VRX (DSLCPE_SW-598) [VRX200] Missing T1.413 related ModemState needs to be + added. T1.413 line state handling added to lsg/LineStateGet. +Bug fix(es): +- VRX (DSLCPE_SW-556)[VRX200] Bonding -- Handling of preprocessor definitions: + + Updated configure.in file + +V4.12.2 - 2012-01-20 +- + +V4.12.1 - 2012-01-17 +merge from 4.10.x: + V4.10.9 - 2011-10-xx + CLI: + - MultimodeFsmConfigSet/Get commands removed + - MultimodeFsmStatusGet command removed + common: + - "-M" startup option removed + - DSL_EVENT_S_MULTIMODE_FSM_STATUS event handling removed + + V4.10.8 - 2011-10-28 + CLI: + - g997lisg: paramaters updated + common: + - DSL_EVENT_S_LINIT_FAILURE event handling updated. + VRX: + - DSLCPE_SW-581: [VRX200] Bonding -- Implementation of new multimode FSM + Implementation added according to the specified requirements. + + V4.10.7 - 2011-10-13 + common: + - ARX300: + + Extended DSL_FirmwareFeatures_t struct with nPlatformId (major version of FW) + This is extracted from what string and therefore defines the running + platform before firmware download has been done. + + V4.10.6 - 2011-09-23 + - + + V4.10.5 - 2011-09-08 + common: + - DSLCPE_SW-563: [VRX200] ON-chip Bonding -- Usage of feature indication what + string + Implementation is generic but currently it is only used for indication of a + dual port mode (bonding) capable firmware. + - DSLCPE_SW-546: [VRX200] ON-chip Bonding -- Inter-module communication with PP + Corrected script notification handling (variable names) to be in sync with + definitions. + - DSLCPE_SW-566: [VRX200] Bonding -- Clear Aggregate Register with Remote + Discovery Register + + V4.10.4 - 2011-08-11 + common: + - VRX dbgtool "rb" command extended for multiple lines per device. + CLI: + - VRX "alf" command extended for multiple lines per device. + - VRX - New command(s) added: + + "bnddbgst"/"BND_DBG_StatusGet" + Bug fix(es): + - DSLCPE_SW-557: Accessing second line with no valid data creates lock at CLI. + DSL_CPE_FPrintf() output format fixed for several CLI commands. + - DSLCPE_SW-556: [VRX200] Bonding -- Handling of preprocessor definitions. + Handling extended. + + V4.10.3 - 2011-08-04 + Bug fix(es): + - CLI "g997xtusesg" command implementation fixed + + V4.10.2 - 2011-08-03 + common: + - New file(s) added + + dsl_cpe_bnd_vrx.c + + dsl_cpe_bnd_vrx.h + - File(s) removed: + + dsl_cpe_bnd.c + + dsl_cpe_bnd.h + VRX: + - On-chip bonding implementation added + +V4.12.0 - 2011-12-19 +common: +- Support Visual Studio 2010 Express building. + Added build_win32/vc10 directory with necessary files. +Bug fix(es): +- DSLCPE_SW-571: DTI and SOAP interface not working after restart of + dsl_cpe_control application. + Removed copy of all opended file descriptors during fork(); +CLI: +- VRX & Danube (DSLCPE_SW-539) Extend interface with OLR statistic counters. + "osg/OlrStatisticsGet" command added. +- VRX (DSLCPE_SW-584) Extensions for Microfilter detection. + Danube CLI commands extended for VRX: + "llsg/LoopLengthStatusGet" + "fddg/FilterDetectionDataGet" + "hsdg/HybridSelectionDataGet" + +V4.11.1 - 2011-10-26 +- + +V4.11.0 - 2011-09-26 +Bug fix(es): +- DSLCPE_SW-557: Accessing second line with no valid data creates lock at CLI. + DSL_CPE_FPrintf() output format fixed for several CLI commands. + +V4.10.1 - 2011-07-18 +- + +V4.10.0 - 2011-04-11 +Bug fix(es): +- Common (DSLCPE_SW-532) Control application unable to start when builded in a + "Lite" compilation model. + CLI support included in the Lite model. + +V4.9.2 - 2011-02-24 +- + +V4.9.1 - 2011-02-18 +CLI: +- Common (DSLCPE_SW-530) Multimode debugging capability. + New command line options added: + g - set debug level for driver modules + G - set debug level for application modules + New debug module added: DSL_CCA_DBG_MULTIMODE + VRX: + debug messages for multimode handling added. + +V4.9.0 - 2011-02-15 +- + +V4.8.12 - 2011-01-31 +- + +V4.8.11 - 2011-01-28 +CLI: +- VRX (DSLCPE_SW-485) Add information of which hybrid type (HW) is connected to + version command. + Hybrid type information added to the "vig" command printout. + +V4.8.10 - 2011-01-14 +CLI: +- Common (DSLCPE_SW-501) Handling of versioning for patches. + "vig" command printout include patch information. + preprocessor option DISABLE_DSL_PATCH_VERSION added to exclude patch + information handling. + +V4.8.9 - 2010-12-29 +- + +V4.8.8 - 2010-12-24 +Bug fix(es): +- VRX (DSLCPE_SW-520) Unconditional printout within TCP message. + Printout handled by DSL_CCA_DEBUG macro. +CLI: +- Common (DSLCPE_SW-518) New command(s) added: + + "dmms"/"DeviceMessageModifySend" + +V4.8.7 - 2010-12-02 +- + +V4.8.6 - 2010-12-01 +- + +V4.8.5 - 2010-11-26 +CLI: +- Danube + Added ip address and port settings to rtti command. + +V4.8.4 - 2010-11-13 +- + +V4.8.3 - 2010-11-01 +- New command(s) added: + + "hsdg"/"HybridSelectionDataGet" + + "fddg"/"FilterDetectionDataGet" +common: +- Added unit selector value in CLI command "llsg"/"LoopLengthStatusGet" to + choose between feet and meter for loop length status values. +- new configuration option(s) added: + + INCLUDE_DSL_FILTER_DETECTION + (--enable-dsl-filter-detection) + +V4.8.2 - 2010-10-15 +CLI: +- new command(s) added: + + "rtti"/"RTT_Init" + + "rttctrls"/"RTT_ConTRoLSet" + + "rttcg"/"RTT_ConfigGet" + + "rttcs"/"RTT_ConfigSet" + + "rttstatg"/"RTT_STATisticsGet" + + "rttsg"/"RTT_StatusGet" +- new event(s) added + + DSL_EVENT_S_RTT_STATUS +- new configuration option added to enable/disable RTT support + + --enable-real-time-trace (INCLUDE_REAL_TIME_TRACE) +CLI: +- Parameters nRxCorruptedTotal, nRxUncorrectedProtected, nRxRetransmitted, + nRxCorrected removed from: + + "pmrtc15mg" + + "pmrtc1dg" + + "pmrtcsg" + + "pmrtctg" + + "pmrtt15mg" + + "pmrtt15ms" + + "pmrtt1dg" + + "pmrtc1ds" + +V4.8.1 - 2010-10-10 +CLI: +- new command(s) added: + + "rtsg/ReTxStatisticsGet" +- command(s) extended with nEftrMin parameter: + + "pmrtc15mg" + + "pmrtc1dg" + + "pmrtcsg" + + "pmrtctg" + + "pmrtt15mg" + + "pmrtt15ms" + + "pmrtt1dg" + + "pmrtc1ds" + +V4.8.0 - 2010-09-17 +CLI: +- new command(s) added: + + "llsg/LoopLengthStatusGet" +- Danube (DSLCPE_SW-499) "lfcg/s LineFeatureConfigurationGet/Set" extended with + b20BitSupport +Bug fix(es): +- VRX (DSLCPE_SW-503) Default handshake tone configuration for multimode is + wrong. + Firmware features detections at init fixed. + +V4.7.3 - 2010-09-03 +- + +V4.7.2 - 2010-08-05 +common: +- VRX (DSLCPE_SW-480) Cleanup of LowLevelConfigSet/Get according to VirtualNoise + switch +- VRX: Added Annex J xDSL modes per default for overISDN binaries +CLI: +- VRX (DSLCPE_SW-475) Remove unused parameters from LowLevelConfigurationGet/Set + Paramters list for commands llcs and llcg reduced. +Bug fix(es): +- VRX (DSLCPE_SW-479) Default handshake tone sets + Extended interface and internal implementation as defined within jira issue. + +V4.7.1 - 2010-07-16 +- + +V4.7.0 - 2010-07-09 +Bug fix(es): +- Common (DSLCPE_SW-403) event handling over SOAP interface does not work at + all. + Connection timeout set to 1 second for SOAP client. + +V4.6.3 - 2010-07-02 +CLI: +- Online help extended/corrected for the following commands: + + MultimodeFsmConfigSet (mfcs) + + MultimodeFsmConfigGet (mfcg) + + MultimodeFsmStatusGet (mfsg) + + G997_LineInitStatusGet (g997lisg) + +V4.6.2 - 2010-07-01 +Bug fix(es): +- VRx (DSLCPE_SW-463) Disable/do not configure T1.413 mode on VR9 systems. + T1.413 mode setting excluded from the default XTSE configuration. + +V4.6.1 - 2010-06-25 +CLI: +- New commands added + + MultimodeFsmConfigSet (mfcs) + + MultimodeFsmConfigGet (mfcg) + + MultimodeFsmStatusGet (mfsg) +common: +- "dsl_cpe_config.h" configuration file handling added to configure process. +- New startup options added: + + multimode FSM: -M_ + + TC-Layer: -T__ +- New script notification type added: + + in case of DSL_EVENT_S_MULTIMODE_FSM_STATUS + +V4.6.0 - 2010-06-04 +Bug fix(es): +- Common (SMS01519208) Do not change acos bits within context of Winhost "rb" + command. + Changing of the "acos" bits placed under a special configure option (not + defined by default) "INCLUDE_SMS00976338". +- Common (SMS01517188) PilotTonesStatusGet - reformat output. + Command output corrected. +- Common (SMS01463849) variable DSL_debugModules_t nDbgModule (dec) has + multiple meanings. + "CCA_DBG_ModuleLevelGet/Set", "DBG_ModuleLevelGet/Set" commands online help + corrected. + +V4.5.0 - 2010-05-14 +common: +- "src/Makefile.am" adapted according to the latest changes within DTI Agent + library. +Bug fix(es): +- Common (SMS01466935) Correct CLI "online help" to support System Monitor + (DSL Tooling) auto detect functionality. + "ccadbgmlg", "ccadbgmls", "dbgmlg", "dbgmls", "rsss" CLI commands online help + corrected. + +V4.4.1 - 2010-04-09 +CLI: +- New command(s) added: + + "aufg"/"AutobootUsedFirmwareGet" +Bug fix(es): +- Common (SMS01444606) Provide CLI command to get information about used + firmware files. + CLI command added according to the suggested scheme. For more detailes please + refer to the corresponding UTP entry. + +V4.4.0 - 2010-04-02 +- + +V4.3.5 - 2010-03-29 +CLI: +- "g997lisg" command output parameter "nLineInitSubStatus" extended with + "opposite mode = 3". + +V4.3.4 - 2010-03-19 +common: +- Debug level for TCP debug tool printouts corrected. + +V4.3.3 - 2010-02-05 +- + +V4.3.2 - 2010-02-26 +common: +- KW cleanups. +- New startup option "-D <0=NO, 1=LOW, 2=NORMAL, 3=HIGH, 4=OFF>" added to + specify initial debug level common for all modules. +Bug fix(es): +- Common (SMS01406251) Extend control application to select debug levels on + startup. Control Application extended. For more details please refer to the + corresponding UTP entry. + +V4.3.1 - 2010-02-19 +CLI: +- "tmcs", "tmsg" commands extended with additional test mode "sleep = 6". +- new command(s) added: + + "rccs"/"RebootCriteriaConfigSet" + + "rccg"/"RebootCriteriaConfigGet" + +V4.3.0 - 2010-02-05 +Bug fix(es): +- Danube/VRx (SMS01379873) Support of Annex J (handling binaries with different + numbering scheme). + "What" string handling extended. + +V4.2.0 - 2010-01-13 +Bug fix(es): +- Common (SMS01360096) Extend Script notification handling to provide trigger + points for LED. + Notification script handling extended according to the provided concept. + For more details please refer to the corresponding UTP entry. + +V4.0.9 - 2009-12-29 +common: +- "what" string handling extended for the VRx firmware. + +V4.0.8 - 2009-12-03 +CLI: +- "lfsg"/"LineFeatureStatusGet" command extended with "bVirtualNoiseSupport" + parameter support. +Bug fix(es): +- Common (SMS01260387) LineFeatureStatusGet output does not contain + bVirtualNoiseSupport. + "bVirtualNoiseSupport" parameter support added. +- Common (SMS01260397) 5 minor online help issues. + Issues fixed. For more details please refer to the appropriate UTP entry. + +V4.0.7 - 2009-11-27 + +V4.0.6 - 2009-11-23 +CLI: +- New command(s) added: + + "g997rasg"/"G997_RateAdaptationStatusGet" + +V4.0.5 - 2009-11-20 +common: +- New configure option(s) added: + + "--enable-pilot-tones-status"/"INCLUDE_PILOT_TONES_STATUS" +CLI: +- New command(s) added: + + "ptsg"/"PilotTonesStatusGet" +Bug fix(es): +- Common (SMS00979307) no output for IOCTL cw if run via adsl_script. + "echo on"/"echo off" commands implemented according to the provided + concept. For more details please refer to the appropriate UTP entry. +- Common (SMS01240034) Increasing memory consumption by "dsl_cpe_control" + during Loop vs reach tests. + Workaround for the setenv() system function bug introduced by using putenv() + instead and allocationg environment variables on the control application + level. +- VRX (SMS01260636) Add CLI function "bpstg" to get data from + ioctl DSL_FIO_BAND_PLAN_STATUS_GET. + "bpstg" CLI command added. + +V4.0.4 - 2009-11-13 +common: +- VC6 project updated for the Win32 simulation. +Bug fix(es): +- Common (SMS01221259) PM_DataPathThresholds1DayGet output format broken. + CLI command format corrected. +- Common (SMS01241407) quit -h does not output help but quits the API. + Common handling for the "quit/Quit" CLI command added. + +V4.0.3 - 2009-11-12 +common: +- Changed copyright header to Lantiq version + +V4.0.2 - 2009-11-03 +common: +- VRx low-level configuration crosschecked. + +V4.0.1 - 2009-10-23 +- + +V4.0.0 - 2009-10-09 +common: +- New configuration option "--enable-vrx" added. +- "alf" CLI command splitted into device specific files. +- New file(s) added: + + dsl_cpe_cli_vrx.c +Bug fix(es): +- Common (SMS00979164) mibleg help needs to be adjusted. + CLI command online help format corrected. + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7eb9422 --- /dev/null +++ b/LICENSE @@ -0,0 +1,367 @@ +This source code is distributed under a dual license of GPL and BSD (2-clause). +Please choose the appropriate license for your intended usage. + +1. BSD license (2-clause BSD license) + +Copyright 2017, Intel Corporation + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +2. GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..7c933f1 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,52 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = foreign 1.9 nostdinc + +SUBDIRS = src tools/pipe + +DISTCHECK_CONFIGURE_FLAGS=@CONFIGURE_OPTIONS@ + +dsl_cpe_control_docdir = ${prefix}/doc/dsl_cpe_control + +dsl_cpe_control_doc_DATA = \ + ChangeLog + +EXTRA_DIST = $(dsl_cpe_control_doc_DATA) \ + build_vxworks/control_dsl_cpe_api.wpj \ + build_win32/dsl_cpe_control_version.h \ + build_win32/vc7/dsl_cpe_control.sln \ + build_win32/vc7/dsl_cpe_control.vcproj \ + README\ + AUTHORS\ + NEWS\ + TODO + +# Copy all the spec files. Of cource, only one is actually used. +dist-hook: + for specfile in *.spec; do \ + if test -f $$specfile; then \ + cp -p $$specfile $(distdir); \ + fi \ + done + +# Check for correct line ends (reduce scope to 'src' because Win32 files can have CRLF) +distcheck-hook: + chmod a+w $(distdir) + echo "Checking line ends ...!!!"; \ + find $(distdir)/src -type f -exec file {} \; | grep -e "CRLF" -e "Non-ISO" && exit 1; \ + echo "Checking line ends ... done." + +lint: + @target=lint; \ + list='$(SUBDIRS)'; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..0e48923 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,925 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/dsl_cpe_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(dsl_cpe_control_docdir)" +DATA = $(dsl_cpe_control_doc_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in ABOUT-NLS AUTHORS COPYING \ + ChangeLog NEWS README TODO compile depcomp install-sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ADD_APPL_CFLAGS = @ADD_APPL_CFLAGS@ +ADD_APPL_LDFLAGS = @ADD_APPL_LDFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTCHECK_CONFIGURE_PARAMS = @DISTCHECK_CONFIGURE_PARAMS@ +DSL_ADD_EXT_APPL_CFLAGS = @DSL_ADD_EXT_APPL_CFLAGS@ +DSL_CCA_DBG_MAX_LEVEL_PRE = @DSL_CCA_DBG_MAX_LEVEL_PRE@ +DSL_CCA_DBG_MAX_LEVEL_SET = @DSL_CCA_DBG_MAX_LEVEL_SET@ +DSL_CONFIG_MODEL_TYPE = @DSL_CONFIG_MODEL_TYPE@ +DSL_CPE_DEBUG_DISABLE = @DSL_CPE_DEBUG_DISABLE@ +DSL_DBG_MSG_NETLINK_ID = @DSL_DBG_MSG_NETLINK_ID@ +DSL_DEBUG_TOOL_INTERFACE = @DSL_DEBUG_TOOL_INTERFACE@ +DSL_DEVICE_DRIVER_INCL_PATH = @DSL_DEVICE_DRIVER_INCL_PATH@ +DSL_DEVICE_NAME = @DSL_DEVICE_NAME@ +DSL_DRIVER_INCL_PATH = @DSL_DRIVER_INCL_PATH@ +DSL_VRX_DEVICE_NAME = @DSL_VRX_DEVICE_NAME@ +DTI_INCL_PATH = @DTI_INCL_PATH@ +DTI_LIBRARY_PATH = @DTI_LIBRARY_PATH@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTRA_APP_CFLAGS = @EXTRA_APP_CFLAGS@ +GREP = @GREP@ +IFXOS_INCLUDE_PATH = @IFXOS_INCLUDE_PATH@ +IFXOS_LIBRARY_PATH = @IFXOS_LIBRARY_PATH@ +INCLUDE_DEPRECATED = @INCLUDE_DEPRECATED@ +INCLUDE_DEVICE_EXCEPTION_CODES = @INCLUDE_DEVICE_EXCEPTION_CODES@ +INCLUDE_DSL_ADSL_MIB = @INCLUDE_DSL_ADSL_MIB@ +INCLUDE_DSL_CEOC = @INCLUDE_DSL_CEOC@ +INCLUDE_DSL_CONFIG_GET = @INCLUDE_DSL_CONFIG_GET@ +INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT = @INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT@ +INCLUDE_DSL_CPE_CLI_SUPPORT = @INCLUDE_DSL_CPE_CLI_SUPPORT@ +INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH = @INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH@ +INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT = @INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT@ +INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT = @INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT@ +INCLUDE_DSL_CPE_DTI_SUPPORT = @INCLUDE_DSL_CPE_DTI_SUPPORT@ +INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT = @INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT@ +INCLUDE_DSL_CPE_IFXOS_SUPPORT = @INCLUDE_DSL_CPE_IFXOS_SUPPORT@ +INCLUDE_DSL_CPE_MISC_LINE_STATUS = @INCLUDE_DSL_CPE_MISC_LINE_STATUS@ +INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS@ +INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS@ +INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS = @INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_CONFIG = @INCLUDE_DSL_CPE_PM_CONFIG@ +INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS@ +INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS@ +INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS = @INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_HISTORY = @INCLUDE_DSL_CPE_PM_HISTORY@ +INCLUDE_DSL_CPE_PM_LINE_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_COUNTERS@ +INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS@ +INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS = @INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS = @INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS@ +INCLUDE_DSL_CPE_PM_RETX_COUNTERS = @INCLUDE_DSL_CPE_PM_RETX_COUNTERS@ +INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS = @INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS@ +INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS = @INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS@ +INCLUDE_DSL_CPE_TRACE_BUFFER = @INCLUDE_DSL_CPE_TRACE_BUFFER@ +INCLUDE_DSL_DELT = @INCLUDE_DSL_DELT@ +INCLUDE_DSL_EVENT_POLLING = @INCLUDE_DSL_EVENT_POLLING@ +INCLUDE_DSL_FILTER_DETECTION = @INCLUDE_DSL_FILTER_DETECTION@ +INCLUDE_DSL_FRAMING_PARAMETERS = @INCLUDE_DSL_FRAMING_PARAMETERS@ +INCLUDE_DSL_G997_ALARM = @INCLUDE_DSL_G997_ALARM@ +INCLUDE_DSL_G997_FRAMING_PARAMETERS = @INCLUDE_DSL_G997_FRAMING_PARAMETERS@ +INCLUDE_DSL_G997_LINE_INVENTORY = @INCLUDE_DSL_G997_LINE_INVENTORY@ +INCLUDE_DSL_G997_PER_TONE = @INCLUDE_DSL_G997_PER_TONE@ +INCLUDE_DSL_G997_STATUS = @INCLUDE_DSL_G997_STATUS@ +INCLUDE_DSL_PM = @INCLUDE_DSL_PM@ +INCLUDE_DSL_RESOURCE_STATISTICS = @INCLUDE_DSL_RESOURCE_STATISTICS@ +INCLUDE_DSL_SYSTEM_INTERFACE = @INCLUDE_DSL_SYSTEM_INTERFACE@ +INCLUDE_DTI_AGENT_STANDALONE_SUPPORT = @INCLUDE_DTI_AGENT_STANDALONE_SUPPORT@ +INCLUDE_FW_REQUEST_SUPPORT = @INCLUDE_FW_REQUEST_SUPPORT@ +INCLUDE_PILOT_TONES_STATUS = @INCLUDE_PILOT_TONES_STATUS@ +INCLUDE_REAL_TIME_TRACE = @INCLUDE_REAL_TIME_TRACE@ +INCLUDE_SCRIPT_NOTIFICATION = @INCLUDE_SCRIPT_NOTIFICATION@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SAFEC_INCL_PATH = @SAFEC_INCL_PATH@ +SAFEC_LIB_FUNC = @SAFEC_LIB_FUNC@ +SAFEC_LIB_NAME = @SAFEC_LIB_NAME@ +SAFEC_LIB_PATH = @SAFEC_LIB_PATH@ +SAFEC_SUPPORT = @SAFEC_SUPPORT@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign 1.9 nostdinc +SUBDIRS = src tools/pipe +DISTCHECK_CONFIGURE_FLAGS = @CONFIGURE_OPTIONS@ +dsl_cpe_control_docdir = ${prefix}/doc/dsl_cpe_control +dsl_cpe_control_doc_DATA = \ + ChangeLog + +EXTRA_DIST = $(dsl_cpe_control_doc_DATA) \ + build_vxworks/control_dsl_cpe_api.wpj \ + build_win32/dsl_cpe_control_version.h \ + build_win32/vc7/dsl_cpe_control.sln \ + build_win32/vc7/dsl_cpe_control.vcproj \ + README\ + AUTHORS\ + NEWS\ + TODO + +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +install-dsl_cpe_control_docDATA: $(dsl_cpe_control_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dsl_cpe_control_doc_DATA)'; test -n "$(dsl_cpe_control_docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dsl_cpe_control_docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dsl_cpe_control_docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dsl_cpe_control_docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dsl_cpe_control_docdir)" || exit $$?; \ + done + +uninstall-dsl_cpe_control_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dsl_cpe_control_doc_DATA)'; test -n "$(dsl_cpe_control_docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dsl_cpe_control_docdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(dsl_cpe_control_docdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dsl_cpe_control_docDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dsl_cpe_control_docDATA + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dsl_cpe_control_docDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + tags-am uninstall uninstall-am \ + uninstall-dsl_cpe_control_docDATA + +.PRECIOUS: Makefile + + +# Copy all the spec files. Of cource, only one is actually used. +dist-hook: + for specfile in *.spec; do \ + if test -f $$specfile; then \ + cp -p $$specfile $(distdir); \ + fi \ + done + +# Check for correct line ends (reduce scope to 'src' because Win32 files can have CRLF) +distcheck-hook: + chmod a+w $(distdir) + echo "Checking line ends ...!!!"; \ + find $(distdir)/src -type f -exec file {} \; | grep -e "CRLF" -e "Non-ISO" && exit 1; \ + echo "Checking line ends ... done." + +lint: + @target=lint; \ + list='$(SUBDIRS)'; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..2eee45f --- /dev/null +++ b/README @@ -0,0 +1,102 @@ +/****************************************************************************** + + Copyright 2017, Intel Corporation + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + + +1. CONTENT OF DELIVERY + +1.1 SOURCE CODE CONTENT + +The DSL CPE API is designed to fulfill a wide spectrum of applications. +Support for both low footprint as well as premium applications results in a +comprehensive source code content/structure. However please note that depending +on the used configuration +a) there are files available that you might not need at all + (for example OS specific files) +b) even the needed files includes various configuration specific parts that + might be not used for the selected configuration +As a result the lines of code (LOC) that are finally compiled/used are usually +much smaller than the available LOC. +For more details please also refer to chapter "3. Getting Started" within +"User's Manual Programmers Reference" (UMPR) of the DSL CPE API + + +1.2 SOURCE TREE STRUCTURE + +Source tree structure for the DSL CPE Control application. + +Please note that +a) the following tree does not include ALL files, it is just to get an easier + overview about which parts might be important for the needed configuration +b) the usage of "" indicates that a device specific file will be + available according to the used source code delivery type. + Currently there are deliveries as follows + - "danube": Danube Family (includes Danube, Amazon-SE and ARX100) + - "vrx": VRX200 Family + +dsl_cpe_control\ +M:. +¦ AUTHORS +¦ ChangeLog +¦ Makefile.am +¦ NEWS +¦ TODO +¦ configure.in +¦ dsl_cpe_control.pjt +¦ LICENSE +¦ README +¦ ++---src // ALL sources including header files +¦ ¦ Makefile.am +¦ ¦ dsl_cpe_control.c +¦ ¦ dsl_cpe_control.h +¦ ¦ dsl_cpe_init_cfg.c +¦ ¦ dsl_cpe_init_cfg.h +¦ ¦ dsl_cpe_cli_.c +¦ ¦ dsl_cpe_os.h \ +¦ ¦ dsl_cpe_linux.c | +¦ ¦ dsl_cpe_linux.h | +¦ ¦ dsl_cpe_win32.c | API internal OS abstraction for +¦ ¦ dsl_cpe_win32.h + different OS in case of not using +¦ ¦ dsl_cpe_rtems.c | ifx_os +¦ ¦ dsl_cpe_rtems.h | +¦ ¦ dsl_cpe_vxworks.c | +¦ ¦ dsl_cpe_vxworks.h / + +¦ ¦ dsl_cpe_simulator.c +¦ ¦ dsl_cpe_simulator.h +¦ ¦ dsl_cpe_cli.c +¦ ¦ dsl_cpe_cli.h +¦ ¦ dsl_cpe_cli_access.c +¦ ¦ dsl_cpe_cli_console.c +¦ ¦ dsl_cpe_cli_console.h +¦ ¦ dsl_cpe_debug.c +¦ ¦ dsl_cpe_debug.h +¦ ¦ dsl_cpe_cli_pipe.c +¦ ¦ dsl_cpe_debug_.c +¦ ¦ dsl_cpe_debug_.h +¦ ¦ dsl_cpe_os_lint_map.h +¦ ¦ dsl_cpe_cli_mib.c +¦ ¦ LLCfg.txt +¦ ¦ Makefile.in +¦ ¦ ++---build_win32 +¦ ¦ dsl_cpe_control_version.h +¦ ¦ drv_danube_api_intern.h +¦ ¦ dsl_cpe_simulator_config.h +¦ ¦ +¦ +---vc7 +¦ ¦ +¦ +---vc6 +¦ ++---scripts +¦ dsl_cpe_pipe.sh +¦ alias_dsl_cpe.sh +¦ ++---build_vxworks + control_dsl_cpe_api.wpj diff --git a/TODO b/TODO new file mode 100644 index 0000000..e69de29 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..d99276a --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1153 @@ +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +#if test $am_cv_make_support_nested_variables = yes; then +if false; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/build_vxworks/control_dsl_cpe_api.wpj b/build_vxworks/control_dsl_cpe_api.wpj new file mode 100644 index 0000000..91b48d0 --- /dev/null +++ b/build_vxworks/control_dsl_cpe_api.wpj @@ -0,0 +1,328 @@ +Document file - DO NOT EDIT + + BUILD_PPC860gnu_BUILDRULE +archive + + + BUILD_PPC860gnu_MACRO_AR +arppc + + + BUILD_PPC860gnu_MACRO_ARCHIVE +$(PRJ_DIR)/PPC860gnu/control_dsl_cpe_api.a + + + BUILD_PPC860gnu_MACRO_AS +ccppc + + + BUILD_PPC860gnu_MACRO_CC +ccppc + + + BUILD_PPC860gnu_MACRO_CFLAGS +-g \ + -DINCLUDE_DSL_CPE_CLI_SUPPORT \ + -DINCLUDE_DSL_API_CONSOLE \ + -DINCLUDE_DSL_API_CONSOLE_EXTRA \ + -DDSL_CPE_REMOVE_PIPE_SUPPORT \ + -DINCLUDE_DSL_PM \ + -DDSL_DEBUG_TOOL_INTERFACE \ + -DINCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS \ + -DINCLUDE_DSL_CPE_PM_LINE_COUNTERS \ + -DINCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS \ + -DINCLUDE_DSL_CPE_PM_HISTORY \ + -DINCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS \ + -DDSL_CHANNELS_PER_LINE=1 \ + -DINCLUDE_DSL_CPE_API_VINAX \ + -O0 \ + -mcpu=860 \ + -ansi \ + -nostdinc \ + -DRW_MULTI_THREAD \ + -D_REENTRANT \ + -fvolatile \ + -fno-builtin \ + -fno-for-scope \ + -DCPU=PPC860 \ + -DVXWORKS \ + -DUSE_LIB_IFXOS=1 \ + -D__PROTOTYPE_5_0 \ + -Wall \ + -I$(WIND_BASE)/target/h \ + -I$(PRJ_DIR) \ + -I$(PRJ_DIR)/../src \ + -I$(PRJ_DIR)/../../../../../comacsd_lib/lib_ifxos/src/include \ + -I$(PRJ_DIR)/../../../driver/src/include \ + -I$(PRJ_DIR)/../../../../drv_vdsl2_dfe/src + + + BUILD_PPC860gnu_MACRO_CFLAGS_AS +-g \ + -mcpu=860 \ + -ansi \ + -nostdinc \ + -fvolatile \ + -fno-builtin \ + -fno-for-scope \ + -P \ + -x \ + assembler-with-cpp \ + -I. \ + -I$(WIND_BASE)/target/h \ + -DCPU=PPC860 + + + BUILD_PPC860gnu_MACRO_CPP +ccppc -E -P -xc + + + BUILD_PPC860gnu_MACRO_LD +ldppc + + + BUILD_PPC860gnu_MACRO_LDDEPS + + + + BUILD_PPC860gnu_MACRO_LDFLAGS +-X -N + + + BUILD_PPC860gnu_MACRO_LD_PARTIAL_FLAGS +-X -r + + + BUILD_PPC860gnu_MACRO_MAKEFLAGS +-ws + + + BUILD_PPC860gnu_MACRO_NM +nmppc + + + BUILD_PPC860gnu_MACRO_OPTION_DEFINE_MACRO +-D + + + BUILD_PPC860gnu_MACRO_OPTION_INCLUDE_DIR +-I + + + BUILD_PPC860gnu_MACRO_POST_BUILD_RULE + + + + BUILD_PPC860gnu_MACRO_PRJ_LIBS + + + + BUILD_PPC860gnu_MACRO_SIZE +sizeppc + + + BUILD_PPC860gnu_RO_DEPEND_PATH +{$(WIND_BASE)/target/h/} {$(WIND_BASE)/target/src/} + + + BUILD_PPC860gnu_TC +::tc_PPC860gnu + + + BUILD_RULE_archive + + + + BUILD_RULE_control_dsl_cpe_api.out + + + + BUILD_RULE_objects + + + + BUILD__CURRENT +PPC860gnu + + + BUILD__LIST +PPC860gnu + + + CORE_INFO_TYPE +::prj_vxApp + + + CORE_INFO_VERSION +2.0 + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli.c_objects +dsl_cpe_cli.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_access.c_objects +dsl_cpe_cli_access.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_access.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_console.c_objects +dsl_cpe_cli_console.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_console.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_danube.c_objects +dsl_cpe_cli_danube.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_danube.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_pipe.c_objects +dsl_cpe_cli_pipe.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_pipe.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_vinax.c_objects +dsl_cpe_cli_vinax.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_vinax.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_control.c_objects +dsl_cpe_control.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_control.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_debug.c_objects +dsl_cpe_debug.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_debug.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_danube.c_objects +dsl_cpe_debug_danube.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_danube.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_vinax.c_objects +dsl_cpe_debug_vinax.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_vinax.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_init_cfg.c_objects +dsl_cpe_init_cfg.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_init_cfg.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_legacy.c_objects +dsl_cpe_legacy.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_legacy.c_tool +C/C++ compiler + + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_linux.c_objects +dsl_cpe_linux.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_linux.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_simulator.c_objects +dsl_cpe_simulator.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_simulator.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_vxworks.c_objects +dsl_cpe_vxworks.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_vxworks.c_tool +C/C++ compiler + + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_win32.c_objects +dsl_cpe_win32.o + + + FILE_$(PRJ_DIR)/../src/dsl_cpe_win32.c_tool +C/C++ compiler + + + + PROJECT_FILES +$(PRJ_DIR)/../src/dsl_cpe_cli.c \ + $(PRJ_DIR)/../src/dsl_cpe_cli_access.c \ + $(PRJ_DIR)/../src/dsl_cpe_cli_console.c \ + $(PRJ_DIR)/../src/dsl_cpe_cli_danube.c \ + $(PRJ_DIR)/../src/dsl_cpe_cli_pipe.c \ + $(PRJ_DIR)/../src/dsl_cpe_cli_vinax.c \ + $(PRJ_DIR)/../src/dsl_cpe_control.c \ + $(PRJ_DIR)/../src/dsl_cpe_debug.c \ + $(PRJ_DIR)/../src/dsl_cpe_debug_danube.c \ + $(PRJ_DIR)/../src/dsl_cpe_debug_vinax.c \ + $(PRJ_DIR)/../src/dsl_cpe_init_cfg.c \ + $(PRJ_DIR)/../src/dsl_cpe_legacy.c \ + $(PRJ_DIR)/../src/dsl_cpe_linux.c \ + $(PRJ_DIR)/../src/dsl_cpe_simulator.c \ + $(PRJ_DIR)/../src/dsl_cpe_win32.c \ + $(PRJ_DIR)/../src/dsl_cpe_vxworks.c + + + userComments +DSL CPE API control application + + diff --git a/build_win32/dsl_cpe_control_version.h b/build_win32/dsl_cpe_control_version.h new file mode 100644 index 0000000..2e2fac0 --- /dev/null +++ b/build_win32/dsl_cpe_control_version.h @@ -0,0 +1,25 @@ +#ifndef LIB_DSL_VERSION_H_ +#define LIB_DSL_VERSION_H_ + +/* Name of package */ +#define PACKAGE "dsl_cpe_control" + +/* Version number of package */ +#define VERSION "4.21.1" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION VERSION + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "DSL CPE Control" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING PACKAGE_NAME " " VERSION + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "dsl_cpe_control" + +#endif /*LIB_DSL_VERSION_H_*/ diff --git a/build_win32/vc7/dsl_cpe_control.sln b/build_win32/vc7/dsl_cpe_control.sln new file mode 100644 index 0000000..ee79e46 --- /dev/null +++ b/build_win32/vc7/dsl_cpe_control.sln @@ -0,0 +1,62 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsl_cpe_control", "dsl_cpe_control.vcproj", "{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}" + ProjectSection(ProjectDependencies) = postProject + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670} = {0BE28B50-BAFF-4849-A060-6BD4A5B2C670} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_ifxos", "..\..\..\..\..\..\comacsd_lib\lib_ifxos\build_win32\vc7\lib_ifxos.vcproj", "{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Danube Debug = Danube Debug + Danube Release = Danube Release + Debug - Nucleus Plus = Debug - Nucleus Plus + Debug - SV CPP = Debug - SV CPP + Debug - Win32 = Debug - Win32 + Release - Win32 = Release - Win32 + VRX Debug = VRX Debug + VRX Release = VRX Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Debug.ActiveCfg = Danube Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Debug.Build.0 = Danube Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Release.ActiveCfg = Danube Release|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Release.Build.0 = Danube Release|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Nucleus Plus.ActiveCfg = Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Nucleus Plus.Build.0 = Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - SV CPP.ActiveCfg = Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - SV CPP.Build.0 = Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Win32.ActiveCfg = Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Win32.Build.0 = Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Release - Win32.ActiveCfg = Release|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Release - Win32.Build.0 = Release|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Debug.ActiveCfg = VRX Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Debug.Build.0 = VRX Debug|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Release.ActiveCfg = VRX Release|Win32 + {F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Release.Build.0 = VRX Release|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Debug.ActiveCfg = Debug - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Debug.Build.0 = Debug - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Release.ActiveCfg = Debug - Nucleus Plus|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Release.Build.0 = Debug - Nucleus Plus|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Nucleus Plus.ActiveCfg = Debug - Nucleus Plus|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Nucleus Plus.Build.0 = Debug - Nucleus Plus|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - SV CPP.ActiveCfg = Debug - Nucleus Plus|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - SV CPP.Build.0 = Debug - Nucleus Plus|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Win32.ActiveCfg = Debug - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Win32.Build.0 = Debug - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Release - Win32.ActiveCfg = Release - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Release - Win32.Build.0 = Release - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Debug.ActiveCfg = Debug - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Debug.Build.0 = Debug - Win32|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Release.ActiveCfg = Debug - Nucleus Plus|Win32 + {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Release.Build.0 = Debug - Nucleus Plus|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/build_win32/vc7/dsl_cpe_control.vcproj b/build_win32/vc7/dsl_cpe_control.vcproj new file mode 100644 index 0000000..a949151 --- /dev/null +++ b/build_win32/vc7/dsl_cpe_control.vcproj @@ -0,0 +1,515 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/compile b/compile new file mode 100755 index 0000000..a85b723 --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..dc89559 --- /dev/null +++ b/configure @@ -0,0 +1,11566 @@ +#! /bin/sh +# From configure.in Revision: 1.173 . +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for DSL CPE Control application 4.21.1. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='DSL CPE Control application' +PACKAGE_TARNAME='dsl_cpe_control' +PACKAGE_VERSION='4.21.1' +PACKAGE_STRING='DSL CPE Control application 4.21.1' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/Makefile.am" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +DISTCHECK_CONFIGURE_PARAMS +SAFEC_LIB_PATH +SAFEC_INCL_PATH +SAFEC_LIB_FUNC +SAFEC_LIB_NAME +SAFEC_SUPPORT +SAFEC_SUPPORT_FALSE +SAFEC_SUPPORT_TRUE +INCLUDE_DTI_AGENT_STANDALONE_SUPPORT +INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE +INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE +DSL_DBG_MSG_NETLINK_ID +INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE +INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE +INCLUDE_REAL_TIME_TRACE +INCLUDE_REAL_TIME_TRACE_FALSE +INCLUDE_REAL_TIME_TRACE_TRUE +INCLUDE_DSL_CEOC +INCLUDE_DSL_CEOC_FALSE +INCLUDE_DSL_CEOC_TRUE +INCLUDE_PILOT_TONES_STATUS +INCLUDE_PILOT_TONES_STATUS_FALSE +INCLUDE_PILOT_TONES_STATUS_TRUE +DTI_LIBRARY_PATH +DTI_INCL_PATH +INCLUDE_DSL_CPE_DTI_SUPPORT +INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE +INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE +DSL_DEBUG_TOOL_INTERFACE +DSL_DEBUG_TOOL_INTERFACE_FALSE +DSL_DEBUG_TOOL_INTERFACE_TRUE +INCLUDE_DSL_ADSL_MIB +INCLUDE_DSL_ADSL_MIB_FALSE +INCLUDE_DSL_ADSL_MIB_TRUE +INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT +INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE +INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE +INCLUDE_DSL_CPE_CLI_SUPPORT +INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE +INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE +INCLUDE_SCRIPT_NOTIFICATION +INCLUDE_SCRIPT_NOTIFICATION_FALSE +INCLUDE_SCRIPT_NOTIFICATION_TRUE +INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH +INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE +INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE +INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE +INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE +INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE +INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE +INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_HISTORY +INCLUDE_DSL_CPE_PM_HISTORY_FALSE +INCLUDE_DSL_CPE_PM_HISTORY_TRUE +INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE +INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE +INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS +INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE +INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE +INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS +INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE +INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE +INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS +INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE +INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE +INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_LINE_COUNTERS +INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS +INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_RETX_COUNTERS +INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS +INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE +INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE +INCLUDE_DSL_CPE_PM_CONFIG +INCLUDE_DSL_CPE_PM_CONFIG_FALSE +INCLUDE_DSL_CPE_PM_CONFIG_TRUE +INCLUDE_DSL_PM +INCLUDE_DSL_PM_FALSE +INCLUDE_DSL_PM_TRUE +INCLUDE_DSL_FILTER_DETECTION +INCLUDE_DSL_FILTER_DETECTION_FALSE +INCLUDE_DSL_FILTER_DETECTION_TRUE +INCLUDE_DSL_DELT +INCLUDE_DSL_DELT_FALSE +INCLUDE_DSL_DELT_TRUE +INCLUDE_DSL_G997_ALARM +INCLUDE_DSL_G997_ALARM_FALSE +INCLUDE_DSL_G997_ALARM_TRUE +INCLUDE_DSL_G997_STATUS +INCLUDE_DSL_G997_STATUS_FALSE +INCLUDE_DSL_G997_STATUS_TRUE +INCLUDE_DSL_G997_PER_TONE +INCLUDE_DSL_G997_PER_TONE_FALSE +INCLUDE_DSL_G997_PER_TONE_TRUE +INCLUDE_DSL_G997_FRAMING_PARAMETERS +INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE +INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE +INCLUDE_DSL_FRAMING_PARAMETERS +INCLUDE_DSL_FRAMING_PARAMETERS_FALSE +INCLUDE_DSL_FRAMING_PARAMETERS_TRUE +INCLUDE_DSL_G997_LINE_INVENTORY +INCLUDE_DSL_G997_LINE_INVENTORY_FALSE +INCLUDE_DSL_G997_LINE_INVENTORY_TRUE +INCLUDE_DSL_RESOURCE_STATISTICS +INCLUDE_DSL_RESOURCE_STATISTICS_FALSE +INCLUDE_DSL_RESOURCE_STATISTICS_TRUE +INCLUDE_DSL_SYSTEM_INTERFACE +INCLUDE_DSL_SYSTEM_INTERFACE_FALSE +INCLUDE_DSL_SYSTEM_INTERFACE_TRUE +INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE +INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE +INCLUDE_DSL_CONFIG_GET +INCLUDE_DSL_CONFIG_GET_FALSE +INCLUDE_DSL_CONFIG_GET_TRUE +INCLUDE_DSL_CPE_TRACE_BUFFER +INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE +INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE +INCLUDE_DSL_CPE_MISC_LINE_STATUS +INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE +INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE +INCLUDE_DSL_EVENT_POLLING +INCLUDE_DSL_EVENT_POLLING_FALSE +INCLUDE_DSL_EVENT_POLLING_TRUE +INCLUDE_DEVICE_EXCEPTION_CODES +INCLUDE_DEVICE_EXCEPTION_CODES_FALSE +INCLUDE_DEVICE_EXCEPTION_CODES_TRUE +INCLUDE_DEPRECATED +INCLUDE_DEPRECATED_FALSE +INCLUDE_DEPRECATED_TRUE +INCLUDE_FW_REQUEST_SUPPORT +INCLUDE_FW_REQUEST_SUPPORT_FALSE +INCLUDE_FW_REQUEST_SUPPORT_TRUE +INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +DSL_CCA_DBG_MAX_LEVEL_PRE +DSL_CCA_DBG_MAX_LEVEL_SET +DSL_CPE_DEBUG_DISABLE +DSL_CCA_DBG_MAX_LEVEL_SET_FALSE +DSL_CCA_DBG_MAX_LEVEL_SET_TRUE +IFXOS_INCLUDE_PATH +IFXOS_LIBRARY_PATH +INCLUDE_DSL_CPE_IFXOS_SUPPORT +INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE +INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE +DSL_DEVICE_DRIVER_INCL_PATH +DSL_DRIVER_INCL_PATH +DSL_CPE_STATIC_LINKING_FALSE +DSL_CPE_STATIC_LINKING_TRUE +DSL_ADD_EXT_APPL_CFLAGS +CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_FALSE +CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE +ADD_APPL_LDFLAGS +ADD_APPL_LDFLAGS_SET_FALSE +ADD_APPL_LDFLAGS_SET_TRUE +ADD_APPL_CFLAGS +ADD_APPL_CFLAGS_SET_FALSE +ADD_APPL_CFLAGS_SET_TRUE +EXTRA_APP_CFLAGS +DSL_CONFIG_MODEL_TYPE +DSL_VRX_DEVICE_NAME +DSL_DEVICE_NAME +DEVICE_VRX_LAYER_FALSE +DEVICE_VRX_LAYER_TRUE +DEVICE_VRX_FALSE +DEVICE_VRX_TRUE +DEVICE_DANUBE_FALSE +DEVICE_DANUBE_TRUE +CONFIGURE_OPTIONS +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_danube +enable_vrx +enable_vrx_device +enable_model +enable_debug +enable_add_appl_cflags +enable_add_appl_ldflags +enable_add_ext_appl_cflags +enable_static +enable_driver_include +enable_device_driver_include +enable_ifxos +enable_ifxos_library +enable_ifxos_include +enable_debug_prints +enable_dsl_fw_request +enable_deprecated +enable_device_exception_codes +enable_dsl_event_polling +enable_dsl_misc_line_status +enable_adsl_trace +enable_dsl_config_get +enable_dsl_filesystem +enable_dsl_system_interface +enable_dsl_resource_statistics +enable_dsl_g997_line_inventory +enable_dsl_framing_parameters +enable_dsl_g997_framing_parameters +enable_dsl_g997_per_tone +enable_dsl_g997_status +enable_dsl_g997_alarm +enable_dsl_delt +enable_dsl_filter_detection +enable_dsl_pm +enable_dsl_pm_config +enable_dsl_pm_channel_counters +enable_dsl_pm_channel_ext_counters +enable_dsl_pm_datapath_counters +enable_dsl_pm_retx_counters +enable_dsl_pm_datapath_failure_counters +enable_dsl_pm_line_counters +enable_dsl_pm_line_event_showtime_counters +enable_dsl_pm_channel_thresholds +enable_dsl_pm_datapath_thresholds +enable_dsl_pm_retx_thresholds +enable_dsl_pm_line_thresholds +enable_dsl_pm_total +enable_dsl_pm_history +enable_dsl_pm_showtime +enable_dsl_pm_optional_parameters +enable_cmv_scripts +enable_cmv_scripts_math +enable_script_notification +enable_cli_support +enable_cli_autogen_support +enable_adsl_mib_support +enable_debug_tool_interface +enable_dti +enable_dti_include +enable_dti_library +enable_pilot_tones_status +enable_dsl_ceoc +enable_real_time_trace +enable_debug_logger_support +with_dbg_netlink_id +enable_dti_agent_st_alone_support +enable_safec_support +enable_safec_include +enable_safec_library +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures DSL CPE Control application 4.21.1 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/dsl_cpe_control] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of DSL CPE Control application 4.21.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-danube Add DANUBE Family support. + --enable-vrx Add VRX support. + --enable-vrx-device=vr9 | vr10 | vr10_320 | vr11 + Select VRX Device + --enable-model=model Select configure model + (lite|footprint|typical|full|debug) + --enable-debug,Enable debug info + + + --enable-add-appl-cflags=x + Set add appl cflags + --enable-add-appl-ldflags=x + Set add appl ldflags + --enable-add_ext_appl_cflags=x + Set add external appl cflags + --enable-static Enable static linking of the application + --enable-driver-include=-I/path/to/your/driver + Set the DSL DRIVER driver include path + --enable-device-driver-include=-I/path/to/your/driver + Set the DSL DEVICE DRIVER driver include path + --enable-ifxos Include IFXOS support + --enable-ifxos-library=-L/path/to/your/lib_ifxos/src + Set the lib_ifxos library path. In this location the + libifxos.a should be found + --enable-ifxos-include=-I/path/to/your/lib_ifxos/src/include + Set the lib_ifxos include path. + --enable-debug-prints=level + Enable debug printouts (default: + yes/err|none/no|prn|err|wrn|msg|local) + --enable-dsl-fw-request Include FW request support + --enable-deprecated Include deprecated functions + --enable-device-exception-codes + Include Device Exception Codes + --enable-dsl-event-polling + Include Event Polling support + --enable-dsl-misc-line-status + Include Misc Line Status support + --enable-adsl-trace Include showtime event logging support + --enable-dsl-config-get Include configuration get support + --enable-dsl-filesystem Include filesystem support + --enable-dsl-system-interface + Include System Interface configuration support + --enable-dsl-resource-statistics + Include Resource Statistics support + --enable-dsl-g997-line-inventory + Include G997 Line Inventory support + --enable-dsl-framing-parameters + Include Framing Parameters support + --enable-dsl-g997-framing-parameters + Include G997 Framing Parameters support + --enable-dsl-g997-per-tone + Include G997 per tone values support + --enable-dsl-g997-status + Include G997 status support + --enable-dsl-g997-alarm Include G997 alarm support + --enable-dsl-delt Include DELT support + --enable-dsl-filter-detection + Include Filter Detection support + --enable-dsl-pm Include DSL PM support + --enable-dsl-pm-config Include PM config support + --enable-dsl-pm-channel-counters + Include DSL PM channel counters support + --enable-dsl-pm-channel-ext-counters + Include DSL PM channel extended counters support + --enable-dsl-pm-datapath-counters + Include DSL PM datapath counters support + --enable-dsl-pm-retx-counters + Include DSL PM retransmission counters support + --enable-dsl-pm-datapath-failure-counters + Include DSL PM datapath failure counters support + --enable-dsl-pm-line-counters + Include DSL PM line counters support + --enable-dsl-pm-line-event-showtime-counters + Include DSL PM line event showtime counters support + --enable-dsl-pm-channel-thresholds + Include DSL PM channel thresholds support + --enable-dsl-pm-datapath-thresholds + Include DSL PM datapath thresholds support + --enable-dsl-pm-retx-thresholds + Include DSL PM retransmission thresholds support + --enable-dsl-pm-line-thresholds + Include DSL PM line thresholds support + --enable-dsl-pm-total Include DSL PM total counters support + --enable-dsl-pm-history Include DSL PM history support + --enable-dsl-pm-showtime + Include DSL PM showtime counters support + --enable-dsl-pm-optional-parameters + Include DSL PM optional parameters support + --enable-cmv-scripts Enable CMV scripts parser support. + --enable-cmv-scripts-math + Enable CMV scripts math support. + --enable-script-notification + Enable script notification support. + --enable-cli-support Enable CLI support. + --enable-cli-autogen-support + Enable Autogen CLI support. + --enable-adsl-mib-support + Enable MIB support. + --enable-debug-tool-interface + Include DSL TCP debug support + --enable-dti Include DTI support + --enable-dti-include= -I/path/to/your/DTI/include + Set the DTI include path + --enable-dti-library= -L/path/to/your/DTI/library + Set the DTI library path. In this location the + libdti_agent.a should be found + --enable-pilot-tones-status + Pilot Tones Status support + --enable-dsl-ceoc Include DSL CEOC support + --enable-real-time-trace + Include DSL RTT support + --enable-debug-logger-support=x + Enable debug logger support + --enable-dti-agent-st-alone-support=x + Enable debug logger support + --enable-safec-support=x + Enable SAFE C support + --enable-safec-include= -I./STAGING_DIR/usr/include + Set the SAFE C include path + --enable-safec-library= -L./STAGING_DIR/usr/lib + Set the SAFE C library path + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-dbg-netlink-id=value + Debug netlink ID number. + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +DSL CPE Control application configure 4.21.1 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by DSL CPE Control application $as_me 4.21.1, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +am__api_version='1.15' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +#if test $am_cv_make_support_nested_variables = yes; then +if false; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='dsl_cpe_control' + VERSION='4.21.1' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 +$as_echo_n "checking how to create a pax tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_pax-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=posix -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=posix -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x pax -w "$$tardir"' + am__tar_='pax -L -x pax -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H pax -L' + am__tar_='find "$tardir" -print | cpio -o -H pax -L' + am__untar='cpio -i -H pax -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_pax}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if ${am_cv_prog_tar_pax+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_pax=$_am_tool +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5 +$as_echo "$am_cv_prog_tar_pax" >&6; } + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +ac_config_headers="$ac_config_headers src/dsl_cpe_config.h" + + + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +# Checks for libraries. + +# Checks for header files. + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in arpa/inet.h fcntl.h float.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/ioctl.h sys/socket.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + +if test $ac_cv_header_stdbool_h = yes; then + +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } +if ${ac_cv_c_volatile+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +volatile int x; +int * volatile y = (int *) 0; +return !x && !y; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_volatile=yes +else + ac_cv_c_volatile=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +$as_echo "$ac_cv_c_volatile" >&6; } +if test $ac_cv_c_volatile = no; then + +$as_echo "#define volatile /**/" >>confdefs.h + +fi + + +# Checks for library functions. +#AC_PROG_GCC_TRADITIONAL +#AC_FUNC_MKTIME +#AC_FUNC_SELECT_ARGTYPES +#AC_FUNC_STRFTIME +#AC_FUNC_STRTOD +#AC_CHECK_FUNCS([ftime gethostbyname gettimeofday localtime_r memset select socket strchr strerror strstr strtoull]) + +# +# save the configure arguments +# +CONFIGURE_OPTIONS="$ac_configure_args" + + + if false; then + DEVICE_DANUBE_TRUE= + DEVICE_DANUBE_FALSE='#' +else + DEVICE_DANUBE_TRUE='#' + DEVICE_DANUBE_FALSE= +fi + + if false; then + DEVICE_VRX_TRUE= + DEVICE_VRX_FALSE='#' +else + DEVICE_VRX_TRUE='#' + DEVICE_VRX_FALSE= +fi + + if false; then + DEVICE_VRX_LAYER_TRUE= + DEVICE_VRX_LAYER_FALSE='#' +else + DEVICE_VRX_LAYER_TRUE='#' + DEVICE_VRX_LAYER_FALSE= +fi + + +PREDEFINED_CONF_EXTRA_APP_CFLAGS="-Os" + +PREDEFINED_CONF_INCLUDE_DSL_EVENT_POLLING="no" +PREDEFINED_CONF_INCLUDE_DEPRECATED="yes" +PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="no" +PREDEFINED_CONF_INCLUDE_FW_REQUEST_SUPPORT="yes" +PREDEFINED_CONF_DSL_CCA_DBG_MAX_LEVEL_PRE="no" +PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="no" +PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="no" +PREDEFINED_CONF_INCLUDE_DSL_DELT="yes" +PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="no" +PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB="no" +PREDEFINED_CONF_INCLUDE_DSL_CEOC="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="no" +PREDEFINED_CONF_INCLUDE_DSL_CONFIG_GET="yes" +PREDEFINED_CONF_INCLUDE_DSL_SYSTEM_INTERFACE="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS="no" +PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS="yes" +PREDEFINED_CONF_INCLUDE_DSL_FRAMING_PARAMETERS="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_LINE_INVENTORY="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_FRAMING_PARAMETERS="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_PER_TONE="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_STATUS="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_ALARM="yes" +PREDEFINED_CONF_INCLUDE_DSL_PM="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CONFIG="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_DTI_SUPPORT="yes" +PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS="yes" +PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DTI_AGENT_STANDALONE_SUPPORT="no" + +# Check whether --enable-danube was given. +if test "${enable_danube+set}" = set; then : + enableval=$enable_danube; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_API_DANUBE /**/" >>confdefs.h + + if true; then + DEVICE_DANUBE_TRUE= + DEVICE_DANUBE_FALSE='#' +else + DEVICE_DANUBE_TRUE='#' + DEVICE_DANUBE_FALSE= +fi + + DSL_DEVICE_NAME=Danube_Family + + fi + + +fi + + +# Check whether --enable-vrx was given. +if test "${enable_vrx+set}" = set; then : + enableval=$enable_vrx; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_API_VRX /**/" >>confdefs.h + + if true; then + DEVICE_VRX_TRUE= + DEVICE_VRX_FALSE='#' +else + DEVICE_VRX_TRUE='#' + DEVICE_VRX_FALSE= +fi + + if true; then + DEVICE_VRX_LAYER_TRUE= + DEVICE_VRX_LAYER_FALSE='#' +else + DEVICE_VRX_LAYER_TRUE='#' + DEVICE_VRX_LAYER_FALSE= +fi + + DSL_DEVICE_NAME=VRX + + fi + + +fi + + +# This selects the sub-device for VRX Family (only valid in case of VRX enabled) +if test -z "${DEVICE_VRX_TRUE}"; then +# Check whether --enable-vrx-device was given. +if test "${enable_vrx_device+set}" = set; then : + enableval=$enable_vrx_device; + echo Set VRX Device = $enableval + case $enableval in + vr9) + +$as_echo "#define DSL_VRX_DEVICE_VR9 /**/" >>confdefs.h + + DSL_VRX_DEVICE_NAME=VR9 + + ;; + vr10) + +$as_echo "#define DSL_VRX_DEVICE_VR10 /**/" >>confdefs.h + + DSL_VRX_DEVICE_NAME=VR10 + + ;; + vr10_320) + +$as_echo "#define DSL_VRX_DEVICE_VR10_320 /**/" >>confdefs.h + + DSL_VRX_DEVICE_NAME=VR10_320 + + ;; + vr11) + +$as_echo "#define DSL_VRX_DEVICE_VR11 /**/" >>confdefs.h + + DSL_VRX_DEVICE_NAME=VR11 + + ;; + *) as_fn_error $? " Select VRX Device, use vr9 | vr10 | vr10_320 | vr11" "$LINENO" 5; + ;; + esac + + +fi + +fi + + +# Check whether --enable-model was given. +if test "${enable_model+set}" = set; then : + enableval=$enable_model; + case "$enableval" in + lite ) + DSL_CONFIG_MODEL_TYPE=Lite + + PREDEFINED_CONF_INCLUDE_DEPRECATED="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT="no" + PREDEFINED_CONF_INCLUDE_DSL_CONFIG_GET="no" + PREDEFINED_CONF_INCLUDE_DSL_SYSTEM_INTERFACE="no" + PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS="no" + PREDEFINED_CONF_INCLUDE_DSL_FRAMING_PARAMETERS="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_LINE_INVENTORY="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_FRAMING_PARAMETERS="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_PER_TONE="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_STATUS="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_ALARM="no" + PREDEFINED_CONF_INCLUDE_DSL_DELT="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CONFIG="no" + PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DTI_SUPPORT="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" + ;; + footprint ) + DSL_CONFIG_MODEL_TYPE=Footprint + + PREDEFINED_CONF_INCLUDE_DEPRECATED="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS="no" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + typical ) + DSL_CONFIG_MODEL_TYPE=Typical + + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="yes" + + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="yes" + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + full ) + DSL_CONFIG_MODEL_TYPE=Full + + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS="yes" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="yes" + + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + debug ) + PREDEFINED_CONF_EXTRA_APP_CFLAGS="-O2 -g0" + DSL_CONFIG_MODEL_TYPE=Debug + + PREDEFINED_CONF_DSL_CCA_DBG_MAX_LEVEL_PRE="msg" + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS="yes" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="yes" + + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + * ) + echo "error: invalid selection for --enable-model=$enableval" + exit 1 ;; + esac + +else + + DSL_CONFIG_MODEL_TYPE=None selected + + + +fi + + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; + if test "$enableval" = yes; then + EXTRA_APP_CFLAGS="-O2 -g0" + + else + EXTRA_APP_CFLAGS="-Os" + + fi + +else + + EXTRA_APP_CFLAGS=$PREDEFINED_CONF_EXTRA_APP_CFLAGS + + + +fi + + + if false; then + ADD_APPL_CFLAGS_SET_TRUE= + ADD_APPL_CFLAGS_SET_FALSE='#' +else + ADD_APPL_CFLAGS_SET_TRUE='#' + ADD_APPL_CFLAGS_SET_FALSE= +fi + +# Check whether --enable-add-appl-cflags was given. +if test "${enable_add_appl_cflags+set}" = set; then : + enableval=$enable_add_appl_cflags; + if test -n "$enableval"; then + echo Set add appl compile flags = $enableval + if true; then + ADD_APPL_CFLAGS_SET_TRUE= + ADD_APPL_CFLAGS_SET_FALSE='#' +else + ADD_APPL_CFLAGS_SET_TRUE='#' + ADD_APPL_CFLAGS_SET_FALSE= +fi + + ADD_APPL_CFLAGS=$enableval + + fi + + +fi + + + if false; then + ADD_APPL_LDFLAGS_SET_TRUE= + ADD_APPL_LDFLAGS_SET_FALSE='#' +else + ADD_APPL_LDFLAGS_SET_TRUE='#' + ADD_APPL_LDFLAGS_SET_FALSE= +fi + +# Check whether --enable-add-appl-ldflags was given. +if test "${enable_add_appl_ldflags+set}" = set; then : + enableval=$enable_add_appl_ldflags; + if test -n "$enableval"; then + echo Set add appl ldflags = $enableval + if true; then + ADD_APPL_LDFLAGS_SET_TRUE= + ADD_APPL_LDFLAGS_SET_FALSE='#' +else + ADD_APPL_LDFLAGS_SET_TRUE='#' + ADD_APPL_LDFLAGS_SET_FALSE= +fi + + ADD_APPL_LDFLAGS=$enableval + + fi + + +fi + + + if false; then + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE= + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_FALSE='#' +else + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE='#' + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_FALSE= +fi + +# Check whether --enable-add_ext_appl_cflags was given. +if test "${enable_add_ext_appl_cflags+set}" = set; then : + enableval=$enable_add_ext_appl_cflags; + if test -n "$enableval"; then + echo Set add ext appl cflags = $enableval + if true; then + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE= + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_FALSE='#' +else + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE='#' + CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_FALSE= +fi + + DSL_ADD_EXT_APPL_CFLAGS=$enableval + + fi + + +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; + if test "$enableval" = yes; then + if true; then + DSL_CPE_STATIC_LINKING_TRUE= + DSL_CPE_STATIC_LINKING_FALSE='#' +else + DSL_CPE_STATIC_LINKING_TRUE='#' + DSL_CPE_STATIC_LINKING_FALSE= +fi + + else + if false; then + DSL_CPE_STATIC_LINKING_TRUE= + DSL_CPE_STATIC_LINKING_FALSE='#' +else + DSL_CPE_STATIC_LINKING_TRUE='#' + DSL_CPE_STATIC_LINKING_FALSE= +fi + + fi + +else + + if false; then + DSL_CPE_STATIC_LINKING_TRUE= + DSL_CPE_STATIC_LINKING_FALSE='#' +else + DSL_CPE_STATIC_LINKING_TRUE='#' + DSL_CPE_STATIC_LINKING_FALSE= +fi + + + +fi + + +DEFAULT_DSL_DRIVER_INCL_PATH='' +# Check whether --enable-driver-include was given. +if test "${enable_driver_include+set}" = set; then : + enableval=$enable_driver_include; + if test -n "$enableval"; then + echo Set the DSL CE API driver include path to $enableval + DSL_DRIVER_INCL_PATH=$enableval + + else + echo Set the default DSL DRIVER driver include path $DEFAULT_DSL_DRIVER_INCL_PATH + DSL_DRIVER_INCL_PATH=$DEFAULT_DSL_DRIVER_INCL_PATH + + fi + + +fi + + +DEFAULT_DSL_DEVICE_DRIVER_INCL_PATH='' +# Check whether --enable-device-driver-include was given. +if test "${enable_device_driver_include+set}" = set; then : + enableval=$enable_device_driver_include; + if test -n "$enableval"; then + echo Set the DSL DEVICE driver include path to $enableval + DSL_DEVICE_DRIVER_INCL_PATH=$enableval + + else + echo Set the default DSL DEVICE DRIVER driver include path $DEFAULT_DSL_DEVICE_DRIVER_INCL_PATH + DSL_DEVICE_DRIVER_INCL_PATH=$DEFAULT_DSL_DEVICE_DRIVER_INCL_PATH + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE= + INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE= +fi + +# Check whether --enable-ifxos was given. +if test "${enable_ifxos+set}" = set; then : + enableval=$enable_ifxos; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_IFXOS_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE= + INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_IFXOS_SUPPORT=yes + + else + INCLUDE_DSL_CPE_IFXOS_SUPPORT=no + + fi + +else + + INCLUDE_DSL_CPE_IFXOS_SUPPORT=no + + + +fi + + +DEFAULT_IFXOS_LIBRARY_PATH='.' +# Check whether --enable-ifxos-library was given. +if test "${enable_ifxos_library+set}" = set; then : + enableval=$enable_ifxos_library; + if test -n "$enableval"; then + echo Set the libifxos.a library path to $enableval + IFXOS_LIBRARY_PATH=$enableval + + else + echo Set the lib_board_config library path $DEFAULT_IFXOS_LIBRARY_PATH + IFXOS_LIBRARY_PATH=$DEFAULT_IFXOS_LIBRARY_PATH + + fi + +else + + echo Set the libifxos.a library path $DEFAULT_IFXOS_LIBRARY_PATH + IFXOS_LIBRARY_PATH=$DEFAULT_IFXOS_LIBRARY_PATH + + + +fi + + +DEFAULT_IFXOS_INCLUDE_PATH='-I./lib_ifxos/src/include' +# Check whether --enable-ifxos-include was given. +if test "${enable_ifxos_include+set}" = set; then : + enableval=$enable_ifxos_include; + if test -n "$enableval"; then + echo Set the lib_ifxos include path $enableval + IFXOS_INCLUDE_PATH=$enableval + + else + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + IFXOS_INCLUDE_PATH=$DEFAULT_IFXOS_INCLUDE_PATH + + fi + +else + + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + IFXOS_INCLUDE_PATH=$DEFAULT_IFXOS_INCLUDE_PATH + + + +fi + + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + +# Check whether --enable-debug-prints was given. +if test "${enable_debug_prints+set}" = set; then : + enableval=$enable_debug_prints; + case "$enableval" in + yes ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=no + + + DSL_CCA_DBG_MAX_LEVEL_PRE=n/a + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + no | none ) + +$as_echo "#define DSL_CPE_DEBUG_DISABLE /**/" >>confdefs.h + + DSL_CPE_DEBUG_DISABLE=yes + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=no + + + DSL_CCA_DBG_MAX_LEVEL_PRE=n/a + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=no + + ;; + prn | 0x1 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x1 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x1 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + err | 0x2 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x2 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x2 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + wrn | 0x40 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_PRE=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x40 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x40 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + msg | 0x80 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x80 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x80 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + local | 0xFF ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0xFF +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0xFF + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + * ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=no + + + DSL_CCA_DBG_MAX_LEVEL_PRE=n/a + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + esac + +else + + case "$PREDEFINED_CONF_DSL_CCA_DBG_MAX_LEVEL_PRE" in + yes ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=no + + + DSL_CCA_DBG_MAX_LEVEL_PRE=n/a + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + no | none ) + +$as_echo "#define DSL_CPE_DEBUG_DISABLE /**/" >>confdefs.h + + DSL_CPE_DEBUG_DISABLE=yes + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=no + + + DSL_CCA_DBG_MAX_LEVEL_PRE=n/a + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=no + + ;; + prn | 0x1 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x1 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x1 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + err | 0x2 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x2 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x2 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + wrn | 0x40 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_PRE=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x40 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x40 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + msg | 0x80 ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0x80 +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0x80 + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + local | 0xFF ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if true; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=yes + + + +cat >>confdefs.h <<_ACEOF +#define DSL_CCA_DBG_MAX_LEVEL_PRE 0xFF +_ACEOF + + DSL_CCA_DBG_MAX_LEVEL_PRE=0xFF + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + ;; + * ) + DSL_CPE_DEBUG_DISABLE=no + + + +$as_echo "#define DSL_CCA_DBG_MAX_LEVEL_SET /**/" >>confdefs.h + + if false; then + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE= + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE='#' +else + DSL_CCA_DBG_MAX_LEVEL_SET_TRUE='#' + DSL_CCA_DBG_MAX_LEVEL_SET_FALSE= +fi + + DSL_CCA_DBG_MAX_LEVEL_SET=no + + + DSL_CCA_DBG_MAX_LEVEL_PRE=n/a + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + esac + + +fi + + + if false; then + INCLUDE_FW_REQUEST_SUPPORT_TRUE= + INCLUDE_FW_REQUEST_SUPPORT_FALSE='#' +else + INCLUDE_FW_REQUEST_SUPPORT_TRUE='#' + INCLUDE_FW_REQUEST_SUPPORT_FALSE= +fi + +# Check whether --enable-dsl_fw_request was given. +if test "${enable_dsl_fw_request+set}" = set; then : + enableval=$enable_dsl_fw_request; + if test "$enableval" = no; then + if false; then + INCLUDE_FW_REQUEST_SUPPORT_TRUE= + INCLUDE_FW_REQUEST_SUPPORT_FALSE='#' +else + INCLUDE_FW_REQUEST_SUPPORT_TRUE='#' + INCLUDE_FW_REQUEST_SUPPORT_FALSE= +fi + + INCLUDE_FW_REQUEST_SUPPORT=no + + else + +$as_echo "#define INCLUDE_FW_REQUEST_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_FW_REQUEST_SUPPORT_TRUE= + INCLUDE_FW_REQUEST_SUPPORT_FALSE='#' +else + INCLUDE_FW_REQUEST_SUPPORT_TRUE='#' + INCLUDE_FW_REQUEST_SUPPORT_FALSE= +fi + + INCLUDE_FW_REQUEST_SUPPORT=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_FW_REQUEST_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_FW_REQUEST_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_FW_REQUEST_SUPPORT_TRUE= + INCLUDE_FW_REQUEST_SUPPORT_FALSE='#' +else + INCLUDE_FW_REQUEST_SUPPORT_TRUE='#' + INCLUDE_FW_REQUEST_SUPPORT_FALSE= +fi + + INCLUDE_FW_REQUEST_SUPPORT=yes + + else + INCLUDE_FW_REQUEST_SUPPORT=no + + fi + + +fi + + + if false; then + INCLUDE_DEPRECATED_TRUE= + INCLUDE_DEPRECATED_FALSE='#' +else + INCLUDE_DEPRECATED_TRUE='#' + INCLUDE_DEPRECATED_FALSE= +fi + +# Check whether --enable-deprecated was given. +if test "${enable_deprecated+set}" = set; then : + enableval=$enable_deprecated; + if test "$enableval" = no; then + if false; then + INCLUDE_DEPRECATED_TRUE= + INCLUDE_DEPRECATED_FALSE='#' +else + INCLUDE_DEPRECATED_TRUE='#' + INCLUDE_DEPRECATED_FALSE= +fi + + INCLUDE_DEPRECATED=no + + else + +$as_echo "#define INCLUDE_DEPRECATED /**/" >>confdefs.h + + if true; then + INCLUDE_DEPRECATED_TRUE= + INCLUDE_DEPRECATED_FALSE='#' +else + INCLUDE_DEPRECATED_TRUE='#' + INCLUDE_DEPRECATED_FALSE= +fi + + INCLUDE_DEPRECATED=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DEPRECATED" = yes; then + +$as_echo "#define INCLUDE_DEPRECATED /**/" >>confdefs.h + + if true; then + INCLUDE_DEPRECATED_TRUE= + INCLUDE_DEPRECATED_FALSE='#' +else + INCLUDE_DEPRECATED_TRUE='#' + INCLUDE_DEPRECATED_FALSE= +fi + + INCLUDE_DEPRECATED=yes + + else + INCLUDE_DEPRECATED=no + + fi + + +fi + + + if false; then + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE= + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE='#' +else + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE='#' + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE= +fi + +# Check whether --enable-device_exception_codes was given. +if test "${enable_device_exception_codes+set}" = set; then : + enableval=$enable_device_exception_codes; + if test "$enableval" = no; then + if false; then + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE= + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE='#' +else + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE='#' + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE= +fi + + INCLUDE_DEVICE_EXCEPTION_CODES=no + + else + +$as_echo "#define INCLUDE_DEVICE_EXCEPTION_CODES /**/" >>confdefs.h + + if true; then + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE= + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE='#' +else + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE='#' + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE= +fi + + INCLUDE_DEVICE_EXCEPTION_CODES=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES" = yes; then + +$as_echo "#define INCLUDE_DEVICE_EXCEPTION_CODES /**/" >>confdefs.h + + if true; then + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE= + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE='#' +else + INCLUDE_DEVICE_EXCEPTION_CODES_TRUE='#' + INCLUDE_DEVICE_EXCEPTION_CODES_FALSE= +fi + + INCLUDE_DEVICE_EXCEPTION_CODES=yes + + else + INCLUDE_DEVICE_EXCEPTION_CODES=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_EVENT_POLLING_TRUE= + INCLUDE_DSL_EVENT_POLLING_FALSE='#' +else + INCLUDE_DSL_EVENT_POLLING_TRUE='#' + INCLUDE_DSL_EVENT_POLLING_FALSE= +fi + +# Check whether --enable-dsl_event_polling was given. +if test "${enable_dsl_event_polling+set}" = set; then : + enableval=$enable_dsl_event_polling; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_EVENT_POLLING_TRUE= + INCLUDE_DSL_EVENT_POLLING_FALSE='#' +else + INCLUDE_DSL_EVENT_POLLING_TRUE='#' + INCLUDE_DSL_EVENT_POLLING_FALSE= +fi + + INCLUDE_DSL_EVENT_POLLING=no + + else + +$as_echo "#define INCLUDE_DSL_EVENT_POLLING /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_EVENT_POLLING_TRUE= + INCLUDE_DSL_EVENT_POLLING_FALSE='#' +else + INCLUDE_DSL_EVENT_POLLING_TRUE='#' + INCLUDE_DSL_EVENT_POLLING_FALSE= +fi + + INCLUDE_DSL_EVENT_POLLING=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_EVENT_POLLING" = yes; then + +$as_echo "#define INCLUDE_DSL_EVENT_POLLING /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_EVENT_POLLING_TRUE= + INCLUDE_DSL_EVENT_POLLING_FALSE='#' +else + INCLUDE_DSL_EVENT_POLLING_TRUE='#' + INCLUDE_DSL_EVENT_POLLING_FALSE= +fi + + INCLUDE_DSL_EVENT_POLLING=yes + + else + INCLUDE_DSL_EVENT_POLLING=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE= + INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE='#' +else + INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE='#' + INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE= +fi + +# Check whether --enable-dsl_misc_line_status was given. +if test "${enable_dsl_misc_line_status+set}" = set; then : + enableval=$enable_dsl_misc_line_status; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_MISC_LINE_STATUS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE= + INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE='#' +else + INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE='#' + INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE= +fi + + INCLUDE_DSL_CPE_MISC_LINE_STATUS=yes + + else + INCLUDE_DSL_CPE_MISC_LINE_STATUS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_MISC_LINE_STATUS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE= + INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE='#' +else + INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE='#' + INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE= +fi + + INCLUDE_DSL_CPE_MISC_LINE_STATUS=yes + + else + INCLUDE_DSL_CPE_MISC_LINE_STATUS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE= + INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE='#' +else + INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE='#' + INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE= +fi + +# Check whether --enable-adsl_trace was given. +if test "${enable_adsl_trace+set}" = set; then : + enableval=$enable_adsl_trace; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_TRACE_BUFFER /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE= + INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE='#' +else + INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE='#' + INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE= +fi + + INCLUDE_DSL_CPE_TRACE_BUFFER=yes + + else + INCLUDE_DSL_CPE_TRACE_BUFFER=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_TRACE_BUFFER /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE= + INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE='#' +else + INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE='#' + INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE= +fi + + INCLUDE_DSL_CPE_TRACE_BUFFER=yes + + else + INCLUDE_DSL_CPE_TRACE_BUFFER=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CONFIG_GET_TRUE= + INCLUDE_DSL_CONFIG_GET_FALSE='#' +else + INCLUDE_DSL_CONFIG_GET_TRUE='#' + INCLUDE_DSL_CONFIG_GET_FALSE= +fi + +# Check whether --enable-dsl_config_get was given. +if test "${enable_dsl_config_get+set}" = set; then : + enableval=$enable_dsl_config_get; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_CONFIG_GET_TRUE= + INCLUDE_DSL_CONFIG_GET_FALSE='#' +else + INCLUDE_DSL_CONFIG_GET_TRUE='#' + INCLUDE_DSL_CONFIG_GET_FALSE= +fi + + INCLUDE_DSL_CONFIG_GET=no + + else + +$as_echo "#define INCLUDE_DSL_CONFIG_GET /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CONFIG_GET_TRUE= + INCLUDE_DSL_CONFIG_GET_FALSE='#' +else + INCLUDE_DSL_CONFIG_GET_TRUE='#' + INCLUDE_DSL_CONFIG_GET_FALSE= +fi + + INCLUDE_DSL_CONFIG_GET=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CONFIG_GET" = yes; then + +$as_echo "#define INCLUDE_DSL_CONFIG_GET /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CONFIG_GET_TRUE= + INCLUDE_DSL_CONFIG_GET_FALSE='#' +else + INCLUDE_DSL_CONFIG_GET_TRUE='#' + INCLUDE_DSL_CONFIG_GET_FALSE= +fi + + INCLUDE_DSL_CONFIG_GET=yes + + else + INCLUDE_DSL_CONFIG_GET=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE= + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE= +fi + +# Check whether --enable-dsl_filesystem was given. +if test "${enable_dsl_filesystem+set}" = set; then : + enableval=$enable_dsl_filesystem; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE= + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT=no + + else + +$as_echo "#define INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE= + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE= + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT=yes + + else + INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE= + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE='#' +else + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE='#' + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE= +fi + +# Check whether --enable-dsl_system_interface was given. +if test "${enable_dsl_system_interface+set}" = set; then : + enableval=$enable_dsl_system_interface; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE= + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE='#' +else + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE='#' + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE= +fi + + INCLUDE_DSL_SYSTEM_INTERFACE=no + + else + +$as_echo "#define INCLUDE_DSL_SYSTEM_INTERFACE /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE= + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE='#' +else + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE='#' + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE= +fi + + INCLUDE_DSL_SYSTEM_INTERFACE=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_SYSTEM_INTERFACE" = yes; then + +$as_echo "#define INCLUDE_DSL_SYSTEM_INTERFACE /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE= + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE='#' +else + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE='#' + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE= +fi + + INCLUDE_DSL_SYSTEM_INTERFACE=yes + + else + if false; then + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE= + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE='#' +else + INCLUDE_DSL_SYSTEM_INTERFACE_TRUE='#' + INCLUDE_DSL_SYSTEM_INTERFACE_FALSE= +fi + + INCLUDE_DSL_SYSTEM_INTERFACE=no + + fi + + +fi + + + + if false; then + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE= + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE='#' +else + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE='#' + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE= +fi + +# Check whether --enable-dsl_resource_statistics was given. +if test "${enable_dsl_resource_statistics+set}" = set; then : + enableval=$enable_dsl_resource_statistics; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE= + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE='#' +else + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE='#' + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE= +fi + + INCLUDE_DSL_RESOURCE_STATISTICS=no + + else + +$as_echo "#define INCLUDE_DSL_RESOURCE_STATISTICS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE= + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE='#' +else + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE='#' + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE= +fi + + INCLUDE_DSL_RESOURCE_STATISTICS=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS" = yes; then + +$as_echo "#define INCLUDE_DSL_RESOURCE_STATISTICS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE= + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE='#' +else + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE='#' + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE= +fi + + INCLUDE_DSL_RESOURCE_STATISTICS=yes + + else + if false; then + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE= + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE='#' +else + INCLUDE_DSL_RESOURCE_STATISTICS_TRUE='#' + INCLUDE_DSL_RESOURCE_STATISTICS_FALSE= +fi + + INCLUDE_DSL_RESOURCE_STATISTICS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE= + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE='#' +else + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE='#' + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE= +fi + +# Check whether --enable-dsl_g997_line_inventory was given. +if test "${enable_dsl_g997_line_inventory+set}" = set; then : + enableval=$enable_dsl_g997_line_inventory; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE= + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE='#' +else + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE='#' + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE= +fi + + INCLUDE_DSL_G997_LINE_INVENTORY=no + + else + +$as_echo "#define INCLUDE_DSL_G997_LINE_INVENTORY /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE= + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE='#' +else + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE='#' + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE= +fi + + INCLUDE_DSL_G997_LINE_INVENTORY=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_LINE_INVENTORY" = yes; then + +$as_echo "#define INCLUDE_DSL_G997_LINE_INVENTORY /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE= + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE='#' +else + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE='#' + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE= +fi + + INCLUDE_DSL_G997_LINE_INVENTORY=yes + + else + if false; then + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE= + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE='#' +else + INCLUDE_DSL_G997_LINE_INVENTORY_TRUE='#' + INCLUDE_DSL_G997_LINE_INVENTORY_FALSE= +fi + + INCLUDE_DSL_G997_LINE_INVENTORY=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE= +fi + +# Check whether --enable-dsl_framing_parameters was given. +if test "${enable_dsl_framing_parameters+set}" = set; then : + enableval=$enable_dsl_framing_parameters; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_FRAMING_PARAMETERS=no + + else + +$as_echo "#define INCLUDE_DSL_FRAMING_PARAMETERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_FRAMING_PARAMETERS=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_FRAMING_PARAMETERS" = yes; then + +$as_echo "#define INCLUDE_DSL_FRAMING_PARAMETERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_FRAMING_PARAMETERS=yes + + else + if false; then + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_FRAMING_PARAMETERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE= +fi + +# Check whether --enable-dsl_g997_framing_parameters was given. +if test "${enable_dsl_g997_framing_parameters+set}" = set; then : + enableval=$enable_dsl_g997_framing_parameters; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_G997_FRAMING_PARAMETERS=no + + else + +$as_echo "#define INCLUDE_DSL_G997_FRAMING_PARAMETERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_G997_FRAMING_PARAMETERS=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_FRAMING_PARAMETERS" = yes; then + +$as_echo "#define INCLUDE_DSL_G997_FRAMING_PARAMETERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_G997_FRAMING_PARAMETERS=yes + + else + if false; then + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE= + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE='#' + INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_G997_FRAMING_PARAMETERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_G997_PER_TONE_TRUE= + INCLUDE_DSL_G997_PER_TONE_FALSE='#' +else + INCLUDE_DSL_G997_PER_TONE_TRUE='#' + INCLUDE_DSL_G997_PER_TONE_FALSE= +fi + +# Check whether --enable-dsl_g997_per_tone was given. +if test "${enable_dsl_g997_per_tone+set}" = set; then : + enableval=$enable_dsl_g997_per_tone; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_G997_PER_TONE_TRUE= + INCLUDE_DSL_G997_PER_TONE_FALSE='#' +else + INCLUDE_DSL_G997_PER_TONE_TRUE='#' + INCLUDE_DSL_G997_PER_TONE_FALSE= +fi + + INCLUDE_DSL_G997_PER_TONE=no + + else + +$as_echo "#define INCLUDE_DSL_G997_PER_TONE /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_PER_TONE_TRUE= + INCLUDE_DSL_G997_PER_TONE_FALSE='#' +else + INCLUDE_DSL_G997_PER_TONE_TRUE='#' + INCLUDE_DSL_G997_PER_TONE_FALSE= +fi + + INCLUDE_DSL_G997_PER_TONE=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_PER_TONE" = yes; then + +$as_echo "#define INCLUDE_DSL_G997_PER_TONE /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_PER_TONE_TRUE= + INCLUDE_DSL_G997_PER_TONE_FALSE='#' +else + INCLUDE_DSL_G997_PER_TONE_TRUE='#' + INCLUDE_DSL_G997_PER_TONE_FALSE= +fi + + INCLUDE_DSL_G997_PER_TONE=yes + + else + if false; then + INCLUDE_DSL_G997_PER_TONE_TRUE= + INCLUDE_DSL_G997_PER_TONE_FALSE='#' +else + INCLUDE_DSL_G997_PER_TONE_TRUE='#' + INCLUDE_DSL_G997_PER_TONE_FALSE= +fi + + INCLUDE_DSL_G997_PER_TONE=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_G997_STATUS_TRUE= + INCLUDE_DSL_G997_STATUS_FALSE='#' +else + INCLUDE_DSL_G997_STATUS_TRUE='#' + INCLUDE_DSL_G997_STATUS_FALSE= +fi + +# Check whether --enable-dsl_g997_status was given. +if test "${enable_dsl_g997_status+set}" = set; then : + enableval=$enable_dsl_g997_status; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_G997_STATUS_TRUE= + INCLUDE_DSL_G997_STATUS_FALSE='#' +else + INCLUDE_DSL_G997_STATUS_TRUE='#' + INCLUDE_DSL_G997_STATUS_FALSE= +fi + + INCLUDE_DSL_G997_STATUS=no + + else + +$as_echo "#define INCLUDE_DSL_G997_STATUS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_STATUS_TRUE= + INCLUDE_DSL_G997_STATUS_FALSE='#' +else + INCLUDE_DSL_G997_STATUS_TRUE='#' + INCLUDE_DSL_G997_STATUS_FALSE= +fi + + INCLUDE_DSL_G997_STATUS=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_STATUS" = yes; then + +$as_echo "#define INCLUDE_DSL_G997_STATUS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_STATUS_TRUE= + INCLUDE_DSL_G997_STATUS_FALSE='#' +else + INCLUDE_DSL_G997_STATUS_TRUE='#' + INCLUDE_DSL_G997_STATUS_FALSE= +fi + + INCLUDE_DSL_G997_STATUS=yes + + else + if false; then + INCLUDE_DSL_G997_STATUS_TRUE= + INCLUDE_DSL_G997_STATUS_FALSE='#' +else + INCLUDE_DSL_G997_STATUS_TRUE='#' + INCLUDE_DSL_G997_STATUS_FALSE= +fi + + INCLUDE_DSL_G997_STATUS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_G997_ALARM_TRUE= + INCLUDE_DSL_G997_ALARM_FALSE='#' +else + INCLUDE_DSL_G997_ALARM_TRUE='#' + INCLUDE_DSL_G997_ALARM_FALSE= +fi + +# Check whether --enable-dsl_g997_alarm was given. +if test "${enable_dsl_g997_alarm+set}" = set; then : + enableval=$enable_dsl_g997_alarm; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_G997_ALARM_TRUE= + INCLUDE_DSL_G997_ALARM_FALSE='#' +else + INCLUDE_DSL_G997_ALARM_TRUE='#' + INCLUDE_DSL_G997_ALARM_FALSE= +fi + + INCLUDE_DSL_G997_ALARM=no + + else + +$as_echo "#define INCLUDE_DSL_G997_ALARM /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_ALARM_TRUE= + INCLUDE_DSL_G997_ALARM_FALSE='#' +else + INCLUDE_DSL_G997_ALARM_TRUE='#' + INCLUDE_DSL_G997_ALARM_FALSE= +fi + + INCLUDE_DSL_G997_ALARM=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_ALARM" = yes; then + +$as_echo "#define INCLUDE_DSL_G997_ALARM /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_G997_ALARM_TRUE= + INCLUDE_DSL_G997_ALARM_FALSE='#' +else + INCLUDE_DSL_G997_ALARM_TRUE='#' + INCLUDE_DSL_G997_ALARM_FALSE= +fi + + INCLUDE_DSL_G997_ALARM=yes + + else + if false; then + INCLUDE_DSL_G997_ALARM_TRUE= + INCLUDE_DSL_G997_ALARM_FALSE='#' +else + INCLUDE_DSL_G997_ALARM_TRUE='#' + INCLUDE_DSL_G997_ALARM_FALSE= +fi + + INCLUDE_DSL_G997_ALARM=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_DELT_TRUE= + INCLUDE_DSL_DELT_FALSE='#' +else + INCLUDE_DSL_DELT_TRUE='#' + INCLUDE_DSL_DELT_FALSE= +fi + +# Check whether --enable-dsl_delt was given. +if test "${enable_dsl_delt+set}" = set; then : + enableval=$enable_dsl_delt; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_DELT_TRUE= + INCLUDE_DSL_DELT_FALSE='#' +else + INCLUDE_DSL_DELT_TRUE='#' + INCLUDE_DSL_DELT_FALSE= +fi + + INCLUDE_DSL_DELT=no + + else + +$as_echo "#define INCLUDE_DSL_DELT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_DELT_TRUE= + INCLUDE_DSL_DELT_FALSE='#' +else + INCLUDE_DSL_DELT_TRUE='#' + INCLUDE_DSL_DELT_FALSE= +fi + + INCLUDE_DSL_DELT=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_DELT" = yes; then + +$as_echo "#define INCLUDE_DSL_DELT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_DELT_TRUE= + INCLUDE_DSL_DELT_FALSE='#' +else + INCLUDE_DSL_DELT_TRUE='#' + INCLUDE_DSL_DELT_FALSE= +fi + + INCLUDE_DSL_DELT=yes + + else + INCLUDE_DSL_DELT=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_FILTER_DETECTION_TRUE= + INCLUDE_DSL_FILTER_DETECTION_FALSE='#' +else + INCLUDE_DSL_FILTER_DETECTION_TRUE='#' + INCLUDE_DSL_FILTER_DETECTION_FALSE= +fi + +# Check whether --enable-dsl_filter_detection was given. +if test "${enable_dsl_filter_detection+set}" = set; then : + enableval=$enable_dsl_filter_detection; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_FILTER_DETECTION_TRUE= + INCLUDE_DSL_FILTER_DETECTION_FALSE='#' +else + INCLUDE_DSL_FILTER_DETECTION_TRUE='#' + INCLUDE_DSL_FILTER_DETECTION_FALSE= +fi + + INCLUDE_DSL_FILTER_DETECTION=no + + else + +$as_echo "#define INCLUDE_DSL_FILTER_DETECTION /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_FILTER_DETECTION_TRUE= + INCLUDE_DSL_FILTER_DETECTION_FALSE='#' +else + INCLUDE_DSL_FILTER_DETECTION_TRUE='#' + INCLUDE_DSL_FILTER_DETECTION_FALSE= +fi + + INCLUDE_DSL_FILTER_DETECTION=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION" = yes; then + +$as_echo "#define INCLUDE_DSL_FILTER_DETECTION /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_FILTER_DETECTION_TRUE= + INCLUDE_DSL_FILTER_DETECTION_FALSE='#' +else + INCLUDE_DSL_FILTER_DETECTION_TRUE='#' + INCLUDE_DSL_FILTER_DETECTION_FALSE= +fi + + INCLUDE_DSL_FILTER_DETECTION=yes + + else + INCLUDE_DSL_FILTER_DETECTION=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_PM_TRUE= + INCLUDE_DSL_PM_FALSE='#' +else + INCLUDE_DSL_PM_TRUE='#' + INCLUDE_DSL_PM_FALSE= +fi + +# Check whether --enable-dsl_pm was given. +if test "${enable_dsl_pm+set}" = set; then : + enableval=$enable_dsl_pm; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_PM /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_PM_TRUE= + INCLUDE_DSL_PM_FALSE='#' +else + INCLUDE_DSL_PM_TRUE='#' + INCLUDE_DSL_PM_FALSE= +fi + + INCLUDE_DSL_PM=yes + + else + INCLUDE_DSL_PM=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_PM" = yes; then + +$as_echo "#define INCLUDE_DSL_PM /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_PM_TRUE= + INCLUDE_DSL_PM_FALSE='#' +else + INCLUDE_DSL_PM_TRUE='#' + INCLUDE_DSL_PM_FALSE= +fi + + INCLUDE_DSL_PM=yes + + else + INCLUDE_DSL_PM=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_CONFIG_TRUE= + INCLUDE_DSL_CPE_PM_CONFIG_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CONFIG_TRUE='#' + INCLUDE_DSL_CPE_PM_CONFIG_FALSE= +fi + +# Check whether --enable-dsl_pm_config was given. +if test "${enable_dsl_pm_config+set}" = set; then : + enableval=$enable_dsl_pm_config; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_CPE_PM_CONFIG_TRUE= + INCLUDE_DSL_CPE_PM_CONFIG_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CONFIG_TRUE='#' + INCLUDE_DSL_CPE_PM_CONFIG_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CONFIG=no + + else + +$as_echo "#define INCLUDE_DSL_CPE_PM_CONFIG /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CONFIG_TRUE= + INCLUDE_DSL_CPE_PM_CONFIG_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CONFIG_TRUE='#' + INCLUDE_DSL_CPE_PM_CONFIG_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CONFIG=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CONFIG" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_CONFIG /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CONFIG_TRUE= + INCLUDE_DSL_CPE_PM_CONFIG_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CONFIG_TRUE='#' + INCLUDE_DSL_CPE_PM_CONFIG_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CONFIG=yes + + else + if false; then + INCLUDE_DSL_CPE_PM_CONFIG_TRUE= + INCLUDE_DSL_CPE_PM_CONFIG_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CONFIG_TRUE='#' + INCLUDE_DSL_CPE_PM_CONFIG_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CONFIG=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_channel_counters was given. +if test "${enable_dsl_pm_channel_counters+set}" = set; then : + enableval=$enable_dsl_pm_channel_counters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_channel_ext_counters was given. +if test "${enable_dsl_pm_channel_ext_counters+set}" = set; then : + enableval=$enable_dsl_pm_channel_ext_counters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_datapath_counters was given. +if test "${enable_dsl_pm_datapath_counters+set}" = set; then : + enableval=$enable_dsl_pm_datapath_counters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_retx_counters was given. +if test "${enable_dsl_pm_retx_counters+set}" = set; then : + enableval=$enable_dsl_pm_retx_counters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_RETX_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_RETX_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_RETX_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_RETX_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_RETX_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_RETX_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_datapath_failure_counters was given. +if test "${enable_dsl_pm_datapath_failure_counters+set}" = set; then : + enableval=$enable_dsl_pm_datapath_failure_counters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_line_counters was given. +if test "${enable_dsl_pm_line_counters+set}" = set; then : + enableval=$enable_dsl_pm_line_counters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_LINE_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_LINE_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_LINE_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_LINE_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_LINE_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_LINE_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_line_event_showtime_counters was given. +if test "${enable_dsl_pm_line_event_showtime_counters+set}" = set; then : + enableval=$enable_dsl_pm_line_event_showtime_counters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE= +fi + +# Check whether --enable-dsl_pm_channel_thresholds was given. +if test "${enable_dsl_pm_channel_thresholds+set}" = set; then : + enableval=$enable_dsl_pm_channel_thresholds; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE= +fi + +# Check whether --enable-dsl_pm_datapath_thresholds was given. +if test "${enable_dsl_pm_datapath_thresholds+set}" = set; then : + enableval=$enable_dsl_pm_datapath_thresholds; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE= +fi + +# Check whether --enable-dsl_pm_retx_thresholds was given. +if test "${enable_dsl_pm_retx_thresholds+set}" = set; then : + enableval=$enable_dsl_pm_retx_thresholds; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE= +fi + +# Check whether --enable-dsl_pm_line_thresholds was given. +if test "${enable_dsl_pm_line_thresholds+set}" = set; then : + enableval=$enable_dsl_pm_line_thresholds; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE= + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE='#' + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS=yes + + else + INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_total was given. +if test "${enable_dsl_pm_total+set}" = set; then : + enableval=$enable_dsl_pm_total; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_HISTORY_TRUE= + INCLUDE_DSL_CPE_PM_HISTORY_FALSE='#' +else + INCLUDE_DSL_CPE_PM_HISTORY_TRUE='#' + INCLUDE_DSL_CPE_PM_HISTORY_FALSE= +fi + +# Check whether --enable-dsl_pm_history was given. +if test "${enable_dsl_pm_history+set}" = set; then : + enableval=$enable_dsl_pm_history; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_HISTORY /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_HISTORY_TRUE= + INCLUDE_DSL_CPE_PM_HISTORY_FALSE='#' +else + INCLUDE_DSL_CPE_PM_HISTORY_TRUE='#' + INCLUDE_DSL_CPE_PM_HISTORY_FALSE= +fi + + INCLUDE_DSL_CPE_PM_HISTORY=yes + + else + INCLUDE_DSL_CPE_PM_HISTORY=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_HISTORY /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_HISTORY_TRUE= + INCLUDE_DSL_CPE_PM_HISTORY_FALSE='#' +else + INCLUDE_DSL_CPE_PM_HISTORY_TRUE='#' + INCLUDE_DSL_CPE_PM_HISTORY_FALSE= +fi + + INCLUDE_DSL_CPE_PM_HISTORY=yes + + else + INCLUDE_DSL_CPE_PM_HISTORY=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE= +fi + +# Check whether --enable-dsl_pm_showtime was given. +if test "${enable_dsl_pm_showtime+set}" = set; then : + enableval=$enable_dsl_pm_showtime; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE= + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE='#' + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS=yes + + else + INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE= + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE='#' + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE= +fi + +# Check whether --enable-dsl_pm_optional_parameters was given. +if test "${enable_dsl_pm_optional_parameters+set}" = set; then : + enableval=$enable_dsl_pm_optional_parameters; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE= + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE='#' + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS=yes + + else + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE= + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE='#' +else + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE='#' + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE= +fi + + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS=yes + + else + INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE= +fi + +# Check whether --enable-cmv-scripts was given. +if test "${enable_cmv_scripts+set}" = set; then : + enableval=$enable_cmv_scripts; + if test "$enableval" = no; then + if false; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT=no + + else + +$as_echo "#define INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT=yes + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT=yes + + else + if false; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT=no + + fi + + +fi + + +# Check whether --enable-cmv-scripts-math was given. +if test "${enable_cmv_scripts_math+set}" = set; then : + enableval=$enable_cmv_scripts_math; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH=yes + + else + if false; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH=yes + + else + if false; then + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE= + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE='#' +else + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE='#' + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE= +fi + + INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH=no + + fi + + +fi + + +# Check whether --enable-script-notification was given. +if test "${enable_script_notification+set}" = set; then : + enableval=$enable_script_notification; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_SCRIPT_NOTIFICATION /**/" >>confdefs.h + + if true; then + INCLUDE_SCRIPT_NOTIFICATION_TRUE= + INCLUDE_SCRIPT_NOTIFICATION_FALSE='#' +else + INCLUDE_SCRIPT_NOTIFICATION_TRUE='#' + INCLUDE_SCRIPT_NOTIFICATION_FALSE= +fi + + INCLUDE_SCRIPT_NOTIFICATION=yes + + else + if false; then + INCLUDE_SCRIPT_NOTIFICATION_TRUE= + INCLUDE_SCRIPT_NOTIFICATION_FALSE='#' +else + INCLUDE_SCRIPT_NOTIFICATION_TRUE='#' + INCLUDE_SCRIPT_NOTIFICATION_FALSE= +fi + + INCLUDE_SCRIPT_NOTIFICATION=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION" = yes; then + +$as_echo "#define INCLUDE_SCRIPT_NOTIFICATION /**/" >>confdefs.h + + if true; then + INCLUDE_SCRIPT_NOTIFICATION_TRUE= + INCLUDE_SCRIPT_NOTIFICATION_FALSE='#' +else + INCLUDE_SCRIPT_NOTIFICATION_TRUE='#' + INCLUDE_SCRIPT_NOTIFICATION_FALSE= +fi + + INCLUDE_SCRIPT_NOTIFICATION=yes + + else + if false; then + INCLUDE_SCRIPT_NOTIFICATION_TRUE= + INCLUDE_SCRIPT_NOTIFICATION_FALSE='#' +else + INCLUDE_SCRIPT_NOTIFICATION_TRUE='#' + INCLUDE_SCRIPT_NOTIFICATION_FALSE= +fi + + INCLUDE_SCRIPT_NOTIFICATION=no + + fi + + +fi + + +# Check whether --enable-cli-support was given. +if test "${enable_cli_support+set}" = set; then : + enableval=$enable_cli_support; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_CLI_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_SUPPORT=yes + + else + if false; then + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_SUPPORT=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_CLI_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_SUPPORT=yes + + else + if false; then + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_SUPPORT=no + + fi + + +fi + + +# Check whether --enable-cli-autogen-support was given. +if test "${enable_cli_autogen_support+set}" = set; then : + enableval=$enable_cli_autogen_support; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT=yes + + else + if false; then + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT=yes + + else + if false; then + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE= + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT=no + + fi + + +fi + + +# Check whether --enable-adsl-mib-support was given. +if test "${enable_adsl_mib_support+set}" = set; then : + enableval=$enable_adsl_mib_support; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_ADSL_MIB /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_ADSL_MIB_TRUE= + INCLUDE_DSL_ADSL_MIB_FALSE='#' +else + INCLUDE_DSL_ADSL_MIB_TRUE='#' + INCLUDE_DSL_ADSL_MIB_FALSE= +fi + + INCLUDE_DSL_ADSL_MIB=yes + + else + if false; then + INCLUDE_DSL_ADSL_MIB_TRUE= + INCLUDE_DSL_ADSL_MIB_FALSE='#' +else + INCLUDE_DSL_ADSL_MIB_TRUE='#' + INCLUDE_DSL_ADSL_MIB_FALSE= +fi + + INCLUDE_DSL_ADSL_MIB=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB" = yes; then + +$as_echo "#define INCLUDE_DSL_ADSL_MIB /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_ADSL_MIB_TRUE= + INCLUDE_DSL_ADSL_MIB_FALSE='#' +else + INCLUDE_DSL_ADSL_MIB_TRUE='#' + INCLUDE_DSL_ADSL_MIB_FALSE= +fi + + INCLUDE_DSL_ADSL_MIB=yes + + else + if false; then + INCLUDE_DSL_ADSL_MIB_TRUE= + INCLUDE_DSL_ADSL_MIB_FALSE='#' +else + INCLUDE_DSL_ADSL_MIB_TRUE='#' + INCLUDE_DSL_ADSL_MIB_FALSE= +fi + + INCLUDE_DSL_ADSL_MIB=no + + fi + + +fi + + + if false; then + DSL_DEBUG_TOOL_INTERFACE_TRUE= + DSL_DEBUG_TOOL_INTERFACE_FALSE='#' +else + DSL_DEBUG_TOOL_INTERFACE_TRUE='#' + DSL_DEBUG_TOOL_INTERFACE_FALSE= +fi + +# Check whether --enable-debug-tool-interface was given. +if test "${enable_debug_tool_interface+set}" = set; then : + enableval=$enable_debug_tool_interface; + if test "$enableval" = yes; then + +$as_echo "#define DSL_DEBUG_TOOL_INTERFACE /**/" >>confdefs.h + + if true; then + DSL_DEBUG_TOOL_INTERFACE_TRUE= + DSL_DEBUG_TOOL_INTERFACE_FALSE='#' +else + DSL_DEBUG_TOOL_INTERFACE_TRUE='#' + DSL_DEBUG_TOOL_INTERFACE_FALSE= +fi + + DSL_DEBUG_TOOL_INTERFACE=yes + + else + DSL_DEBUG_TOOL_INTERFACE=no + + fi + +else + + if test "$PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE" = yes; then + +$as_echo "#define DSL_DEBUG_TOOL_INTERFACE /**/" >>confdefs.h + + if true; then + DSL_DEBUG_TOOL_INTERFACE_TRUE= + DSL_DEBUG_TOOL_INTERFACE_FALSE='#' +else + DSL_DEBUG_TOOL_INTERFACE_TRUE='#' + DSL_DEBUG_TOOL_INTERFACE_FALSE= +fi + + DSL_DEBUG_TOOL_INTERFACE=yes + + else + DSL_DEBUG_TOOL_INTERFACE=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE= + INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE= +fi + +# Check whether --enable-dti was given. +if test "${enable_dti+set}" = set; then : + enableval=$enable_dti; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_DTI_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE= + INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_DTI_SUPPORT=yes + + else + INCLUDE_DSL_CPE_DTI_SUPPORT=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_DTI_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_DTI_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE= + INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_DTI_SUPPORT=yes + + else + INCLUDE_DSL_CPE_DTI_SUPPORT=no + + fi + + +fi + + +DEFAULT_DTI_INCL_PATH='' +# Check whether --enable-dti-include was given. +if test "${enable_dti_include+set}" = set; then : + enableval=$enable_dti_include; + if test -n "$enableval"; then + echo Set the dti_agent include path to $enableval + DTI_INCL_PATH=$enableval + + else + echo Set the dti_agent include path to $DEFAULT_DTI_INCL_PATH + DTI_INCL_PATH=$DEFAULT_DTI_INCL_PATH + + fi + +else + + if test "$INCLUDE_DSL_CPE_DTI_SUPPORT" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please provide include path to DTI Agent!" >&5 +$as_echo "$as_me: WARNING: Please provide include path to DTI Agent!" >&2;} + fi + + +fi + + +DEFAULT_DTI_LIBRARY_PATH='' +# Check whether --enable-dti-library was given. +if test "${enable_dti_library+set}" = set; then : + enableval=$enable_dti_library; + if test -n "$enableval"; then + echo Set the libdti_agent.a library path to $enableval + DTI_LIBRARY_PATH=$enableval + + else + echo Set the libdti_agent.a library path $DEFAULT_DTI_LIBRARY_PATH + DTI_LIBRARY_PATH=$DEFAULT_DTI_LIBRARY_PATH + + fi + +else + + if test "$INCLUDE_DSL_CPE_DTI_SUPPORT" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please provide the path to libdti_agent.a, otherwise linking might not work!" >&5 +$as_echo "$as_me: WARNING: Please provide the path to libdti_agent.a, otherwise linking might not work!" >&2;} + fi + + +fi + + + if false; then + INCLUDE_PILOT_TONES_STATUS_TRUE= + INCLUDE_PILOT_TONES_STATUS_FALSE='#' +else + INCLUDE_PILOT_TONES_STATUS_TRUE='#' + INCLUDE_PILOT_TONES_STATUS_FALSE= +fi + +# Check whether --enable-pilot-tones-status was given. +if test "${enable_pilot_tones_status+set}" = set; then : + enableval=$enable_pilot_tones_status; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_PILOT_TONES_STATUS /**/" >>confdefs.h + + if true; then + INCLUDE_PILOT_TONES_STATUS_TRUE= + INCLUDE_PILOT_TONES_STATUS_FALSE='#' +else + INCLUDE_PILOT_TONES_STATUS_TRUE='#' + INCLUDE_PILOT_TONES_STATUS_FALSE= +fi + + INCLUDE_PILOT_TONES_STATUS=yes + + else + INCLUDE_PILOT_TONES_STATUS=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS" = yes; then + +$as_echo "#define INCLUDE_PILOT_TONES_STATUS /**/" >>confdefs.h + + if true; then + INCLUDE_PILOT_TONES_STATUS_TRUE= + INCLUDE_PILOT_TONES_STATUS_FALSE='#' +else + INCLUDE_PILOT_TONES_STATUS_TRUE='#' + INCLUDE_PILOT_TONES_STATUS_FALSE= +fi + + INCLUDE_PILOT_TONES_STATUS=yes + + else + INCLUDE_PILOT_TONES_STATUS=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CEOC_TRUE= + INCLUDE_DSL_CEOC_FALSE='#' +else + INCLUDE_DSL_CEOC_TRUE='#' + INCLUDE_DSL_CEOC_FALSE= +fi + +# Check whether --enable-dsl-ceoc was given. +if test "${enable_dsl_ceoc+set}" = set; then : + enableval=$enable_dsl_ceoc; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CEOC /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CEOC_TRUE= + INCLUDE_DSL_CEOC_FALSE='#' +else + INCLUDE_DSL_CEOC_TRUE='#' + INCLUDE_DSL_CEOC_FALSE= +fi + + INCLUDE_DSL_CEOC=yes + + else + INCLUDE_DSL_CEOC=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CEOC" = yes; then + +$as_echo "#define INCLUDE_DSL_CEOC /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CEOC_TRUE= + INCLUDE_DSL_CEOC_FALSE='#' +else + INCLUDE_DSL_CEOC_TRUE='#' + INCLUDE_DSL_CEOC_FALSE= +fi + + INCLUDE_DSL_CEOC=yes + + else + INCLUDE_DSL_CEOC=no + + fi + + +fi + + + if false; then + INCLUDE_REAL_TIME_TRACE_TRUE= + INCLUDE_REAL_TIME_TRACE_FALSE='#' +else + INCLUDE_REAL_TIME_TRACE_TRUE='#' + INCLUDE_REAL_TIME_TRACE_FALSE= +fi + +# Check whether --enable-real-time-trace was given. +if test "${enable_real_time_trace+set}" = set; then : + enableval=$enable_real_time_trace; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_REAL_TIME_TRACE /**/" >>confdefs.h + + if true; then + INCLUDE_REAL_TIME_TRACE_TRUE= + INCLUDE_REAL_TIME_TRACE_FALSE='#' +else + INCLUDE_REAL_TIME_TRACE_TRUE='#' + INCLUDE_REAL_TIME_TRACE_FALSE= +fi + + INCLUDE_REAL_TIME_TRACE=yes + + else + INCLUDE_REAL_TIME_TRACE=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_REAL_TIME_TRACE /**/" >>confdefs.h + + if true; then + INCLUDE_REAL_TIME_TRACE_TRUE= + INCLUDE_REAL_TIME_TRACE_FALSE='#' +else + INCLUDE_REAL_TIME_TRACE_TRUE='#' + INCLUDE_REAL_TIME_TRACE_FALSE= +fi + + INCLUDE_REAL_TIME_TRACE=yes + + else + INCLUDE_REAL_TIME_TRACE=no + + fi + + +fi + + + if false; then + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE= + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE= +fi + +# Check whether --enable-debug-logger-support was given. +if test "${enable_debug_logger_support+set}" = set; then : + enableval=$enable_debug_logger_support; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE= + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + else + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE= + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE='#' +else + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE='#' + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE= +fi + + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=yes + + else + INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT=no + + fi + + +fi + + + +# Check whether --with-dbg-netlink-id was given. +if test "${with_dbg_netlink_id+set}" = set; then : + withval=$with_dbg_netlink_id; + + if test -n $withval; then + +cat >>confdefs.h <<_ACEOF +#define DSL_DBG_MSG_NETLINK_ID $withval +_ACEOF + + DSL_DBG_MSG_NETLINK_ID=$withval + + fi + + +fi + + + if false; then + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE= + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE='#' +else + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE='#' + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE= +fi + +# Check whether --enable-dti-agent-st-alone-support was given. +if test "${enable_dti_agent_st_alone_support+set}" = set; then : + enableval=$enable_dti_agent_st_alone_support; + if test "$enableval" = yes; then + +$as_echo "#define INCLUDE_DTI_AGENT_STANDALONE_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE= + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE='#' +else + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE='#' + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE= +fi + + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT=yes + + else + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT=no + + fi + +else + + if test "$PREDEFINED_CONF_INCLUDE_DTI_AGENT_STANDALONE_SUPPORT" = yes; then + +$as_echo "#define INCLUDE_DTI_AGENT_STANDALONE_SUPPORT /**/" >>confdefs.h + + if true; then + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE= + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE='#' +else + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE='#' + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE= +fi + + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT=yes + + else + INCLUDE_DTI_AGENT_STANDALONE_SUPPORT=no + + fi + + +fi + + + if false; then + SAFEC_SUPPORT_TRUE= + SAFEC_SUPPORT_FALSE='#' +else + SAFEC_SUPPORT_TRUE='#' + SAFEC_SUPPORT_FALSE= +fi + +SAFEC_SUPPORT=no + +# Check whether --enable-safec-support was given. +if test "${enable_safec_support+set}" = set; then : + enableval=$enable_safec_support; + if test "$enableval" = yes; then + for ac_header in safe_lib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "safe_lib.h" "ac_cv_header_safe_lib_h" "$ac_includes_default" +if test "x$ac_cv_header_safe_lib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SAFE_LIB_H 1 +_ACEOF + safec_header_support=yes; break; +fi + +done + + SAFEC_LIB_NAME=safec-1.0 + + SAFEC_LIB_FUNC=strcat_s + + as_ac_Lib=`$as_echo "ac_cv_lib_$SAFEC_LIB_NAME''_$SAFEC_LIB_FUNC" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SAFEC_LIB_FUNC in -l$SAFEC_LIB_NAME" >&5 +$as_echo_n "checking for $SAFEC_LIB_FUNC in -l$SAFEC_LIB_NAME... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$SAFEC_LIB_NAME $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $SAFEC_LIB_FUNC (); +int +main () +{ +return $SAFEC_LIB_FUNC (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + safec_lib_support=yes; break; +fi + + + if test "x$safec_header_support" = "xyes"; then + if test "x$safec_lib_support" = "xyes"; then + +$as_echo "#define SAFEC_SUPPORT 1" >>confdefs.h + + if true; then + SAFEC_SUPPORT_TRUE= + SAFEC_SUPPORT_FALSE='#' +else + SAFEC_SUPPORT_TRUE='#' + SAFEC_SUPPORT_FALSE= +fi + + SAFEC_SUPPORT=yes + + fi + fi + fi + +fi + + +DEFAULT_SAFEC_INCL_PATH='' +# Check whether --enable-safec-include was given. +if test "${enable_safec_include+set}" = set; then : + enableval=$enable_safec_include; + if test -n "$enableval"; then + echo Set the SAFE C include path to $enableval + SAFEC_INCL_PATH=$enableval + + + else + SAFEC_INCL_PATH=$DEFAULT_SAFEC_INCL_PATH + + fi + +else + + SAFEC_INCL_PATH=$DEFAULT_SAFEC_INCL_PATH + + + +fi + + +DEFAULT_SAFEC_LIB_PATH='' +# Check whether --enable-safec-library was given. +if test "${enable_safec_library+set}" = set; then : + enableval=$enable_safec_library; + if test -n "$enableval"; then + echo Set the SAFE C library path to $enableval + SAFEC_LIB_PATH=$enableval + + + else + SAFEC_LIB_PATH=$DEFAULT_SAFEC_LIB_PATH + + fi + +else + + SAFEC_LIB_PATH=$DEFAULT_SAFEC_LIB_PATH + + + +fi + + + + +DISTCHECK_CONFIGURE_PARAMS=$CONFIGURE_OPTIONS + + + + +ac_config_files="$ac_config_files Makefile src/Makefile tools/pipe/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_DANUBE_TRUE}" && test -z "${DEVICE_DANUBE_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_DANUBE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_VRX_TRUE}" && test -z "${DEVICE_VRX_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_VRX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_VRX_LAYER_TRUE}" && test -z "${DEVICE_VRX_LAYER_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_VRX_LAYER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_DANUBE_TRUE}" && test -z "${DEVICE_DANUBE_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_DANUBE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_VRX_TRUE}" && test -z "${DEVICE_VRX_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_VRX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_VRX_LAYER_TRUE}" && test -z "${DEVICE_VRX_LAYER_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_VRX_LAYER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ADD_APPL_CFLAGS_SET_TRUE}" && test -z "${ADD_APPL_CFLAGS_SET_FALSE}"; then + as_fn_error $? "conditional \"ADD_APPL_CFLAGS_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ADD_APPL_CFLAGS_SET_TRUE}" && test -z "${ADD_APPL_CFLAGS_SET_FALSE}"; then + as_fn_error $? "conditional \"ADD_APPL_CFLAGS_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ADD_APPL_LDFLAGS_SET_TRUE}" && test -z "${ADD_APPL_LDFLAGS_SET_FALSE}"; then + as_fn_error $? "conditional \"ADD_APPL_LDFLAGS_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ADD_APPL_LDFLAGS_SET_TRUE}" && test -z "${ADD_APPL_LDFLAGS_SET_FALSE}"; then + as_fn_error $? "conditional \"ADD_APPL_LDFLAGS_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE}" && test -z "${CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_FALSE}"; then + as_fn_error $? "conditional \"CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE}" && test -z "${CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_FALSE}"; then + as_fn_error $? "conditional \"CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CPE_STATIC_LINKING_TRUE}" && test -z "${DSL_CPE_STATIC_LINKING_FALSE}"; then + as_fn_error $? "conditional \"DSL_CPE_STATIC_LINKING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CPE_STATIC_LINKING_TRUE}" && test -z "${DSL_CPE_STATIC_LINKING_FALSE}"; then + as_fn_error $? "conditional \"DSL_CPE_STATIC_LINKING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CPE_STATIC_LINKING_TRUE}" && test -z "${DSL_CPE_STATIC_LINKING_FALSE}"; then + as_fn_error $? "conditional \"DSL_CPE_STATIC_LINKING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_IFXOS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_IFXOS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_TRUE}" && test -z "${DSL_CCA_DBG_MAX_LEVEL_SET_FALSE}"; then + as_fn_error $? "conditional \"DSL_CCA_DBG_MAX_LEVEL_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_FW_REQUEST_SUPPORT_TRUE}" && test -z "${INCLUDE_FW_REQUEST_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_FW_REQUEST_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_FW_REQUEST_SUPPORT_TRUE}" && test -z "${INCLUDE_FW_REQUEST_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_FW_REQUEST_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_FW_REQUEST_SUPPORT_TRUE}" && test -z "${INCLUDE_FW_REQUEST_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_FW_REQUEST_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_FW_REQUEST_SUPPORT_TRUE}" && test -z "${INCLUDE_FW_REQUEST_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_FW_REQUEST_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEPRECATED_TRUE}" && test -z "${INCLUDE_DEPRECATED_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEPRECATED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEPRECATED_TRUE}" && test -z "${INCLUDE_DEPRECATED_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEPRECATED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEPRECATED_TRUE}" && test -z "${INCLUDE_DEPRECATED_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEPRECATED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEPRECATED_TRUE}" && test -z "${INCLUDE_DEPRECATED_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEPRECATED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_TRUE}" && test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEVICE_EXCEPTION_CODES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_TRUE}" && test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEVICE_EXCEPTION_CODES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_TRUE}" && test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEVICE_EXCEPTION_CODES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_TRUE}" && test -z "${INCLUDE_DEVICE_EXCEPTION_CODES_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DEVICE_EXCEPTION_CODES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_EVENT_POLLING_TRUE}" && test -z "${INCLUDE_DSL_EVENT_POLLING_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_EVENT_POLLING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_EVENT_POLLING_TRUE}" && test -z "${INCLUDE_DSL_EVENT_POLLING_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_EVENT_POLLING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_EVENT_POLLING_TRUE}" && test -z "${INCLUDE_DSL_EVENT_POLLING_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_EVENT_POLLING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_EVENT_POLLING_TRUE}" && test -z "${INCLUDE_DSL_EVENT_POLLING_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_EVENT_POLLING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE}" && test -z "${INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_MISC_LINE_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE}" && test -z "${INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_MISC_LINE_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_MISC_LINE_STATUS_TRUE}" && test -z "${INCLUDE_DSL_CPE_MISC_LINE_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_MISC_LINE_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE}" && test -z "${INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_TRACE_BUFFER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE}" && test -z "${INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_TRACE_BUFFER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_TRACE_BUFFER_TRUE}" && test -z "${INCLUDE_DSL_CPE_TRACE_BUFFER_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_TRACE_BUFFER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CONFIG_GET_TRUE}" && test -z "${INCLUDE_DSL_CONFIG_GET_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CONFIG_GET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CONFIG_GET_TRUE}" && test -z "${INCLUDE_DSL_CONFIG_GET_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CONFIG_GET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CONFIG_GET_TRUE}" && test -z "${INCLUDE_DSL_CONFIG_GET_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CONFIG_GET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CONFIG_GET_TRUE}" && test -z "${INCLUDE_DSL_CONFIG_GET_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CONFIG_GET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_TRUE}" && test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_SYSTEM_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_TRUE}" && test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_SYSTEM_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_TRUE}" && test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_SYSTEM_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_TRUE}" && test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_SYSTEM_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_TRUE}" && test -z "${INCLUDE_DSL_SYSTEM_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_SYSTEM_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_TRUE}" && test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_RESOURCE_STATISTICS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_TRUE}" && test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_RESOURCE_STATISTICS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_TRUE}" && test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_RESOURCE_STATISTICS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_TRUE}" && test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_RESOURCE_STATISTICS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_TRUE}" && test -z "${INCLUDE_DSL_RESOURCE_STATISTICS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_RESOURCE_STATISTICS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_TRUE}" && test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_LINE_INVENTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_TRUE}" && test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_LINE_INVENTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_TRUE}" && test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_LINE_INVENTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_TRUE}" && test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_LINE_INVENTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_TRUE}" && test -z "${INCLUDE_DSL_G997_LINE_INVENTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_LINE_INVENTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_G997_FRAMING_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_FRAMING_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_PER_TONE_TRUE}" && test -z "${INCLUDE_DSL_G997_PER_TONE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_PER_TONE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_PER_TONE_TRUE}" && test -z "${INCLUDE_DSL_G997_PER_TONE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_PER_TONE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_PER_TONE_TRUE}" && test -z "${INCLUDE_DSL_G997_PER_TONE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_PER_TONE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_PER_TONE_TRUE}" && test -z "${INCLUDE_DSL_G997_PER_TONE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_PER_TONE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_PER_TONE_TRUE}" && test -z "${INCLUDE_DSL_G997_PER_TONE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_PER_TONE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_STATUS_TRUE}" && test -z "${INCLUDE_DSL_G997_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_STATUS_TRUE}" && test -z "${INCLUDE_DSL_G997_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_STATUS_TRUE}" && test -z "${INCLUDE_DSL_G997_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_STATUS_TRUE}" && test -z "${INCLUDE_DSL_G997_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_STATUS_TRUE}" && test -z "${INCLUDE_DSL_G997_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_ALARM_TRUE}" && test -z "${INCLUDE_DSL_G997_ALARM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_ALARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_ALARM_TRUE}" && test -z "${INCLUDE_DSL_G997_ALARM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_ALARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_ALARM_TRUE}" && test -z "${INCLUDE_DSL_G997_ALARM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_ALARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_ALARM_TRUE}" && test -z "${INCLUDE_DSL_G997_ALARM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_ALARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_G997_ALARM_TRUE}" && test -z "${INCLUDE_DSL_G997_ALARM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_G997_ALARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_DELT_TRUE}" && test -z "${INCLUDE_DSL_DELT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_DELT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_DELT_TRUE}" && test -z "${INCLUDE_DSL_DELT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_DELT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_DELT_TRUE}" && test -z "${INCLUDE_DSL_DELT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_DELT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_DELT_TRUE}" && test -z "${INCLUDE_DSL_DELT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_DELT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FILTER_DETECTION_TRUE}" && test -z "${INCLUDE_DSL_FILTER_DETECTION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FILTER_DETECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FILTER_DETECTION_TRUE}" && test -z "${INCLUDE_DSL_FILTER_DETECTION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FILTER_DETECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FILTER_DETECTION_TRUE}" && test -z "${INCLUDE_DSL_FILTER_DETECTION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FILTER_DETECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_FILTER_DETECTION_TRUE}" && test -z "${INCLUDE_DSL_FILTER_DETECTION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_FILTER_DETECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_PM_TRUE}" && test -z "${INCLUDE_DSL_PM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_PM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_PM_TRUE}" && test -z "${INCLUDE_DSL_PM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_PM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_PM_TRUE}" && test -z "${INCLUDE_DSL_PM_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_PM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CONFIG_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CONFIG_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CONFIG_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CONFIG_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CONFIG_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CONFIG_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CONFIG_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CONFIG_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CONFIG_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CONFIG_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_RETX_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_RETX_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_RETX_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_RETX_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_RETX_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_HISTORY_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_HISTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_HISTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_HISTORY_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_HISTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_HISTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_HISTORY_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_HISTORY_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_HISTORY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_TRUE}" && test -z "${INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_TRUE}" && test -z "${INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_SCRIPT_NOTIFICATION_TRUE}" && test -z "${INCLUDE_SCRIPT_NOTIFICATION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_SCRIPT_NOTIFICATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_SCRIPT_NOTIFICATION_TRUE}" && test -z "${INCLUDE_SCRIPT_NOTIFICATION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_SCRIPT_NOTIFICATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_SCRIPT_NOTIFICATION_TRUE}" && test -z "${INCLUDE_SCRIPT_NOTIFICATION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_SCRIPT_NOTIFICATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_SCRIPT_NOTIFICATION_TRUE}" && test -z "${INCLUDE_SCRIPT_NOTIFICATION_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_SCRIPT_NOTIFICATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_ADSL_MIB_TRUE}" && test -z "${INCLUDE_DSL_ADSL_MIB_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_ADSL_MIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_ADSL_MIB_TRUE}" && test -z "${INCLUDE_DSL_ADSL_MIB_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_ADSL_MIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_ADSL_MIB_TRUE}" && test -z "${INCLUDE_DSL_ADSL_MIB_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_ADSL_MIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_ADSL_MIB_TRUE}" && test -z "${INCLUDE_DSL_ADSL_MIB_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_ADSL_MIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_DEBUG_TOOL_INTERFACE_TRUE}" && test -z "${DSL_DEBUG_TOOL_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"DSL_DEBUG_TOOL_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_DEBUG_TOOL_INTERFACE_TRUE}" && test -z "${DSL_DEBUG_TOOL_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"DSL_DEBUG_TOOL_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DSL_DEBUG_TOOL_INTERFACE_TRUE}" && test -z "${DSL_DEBUG_TOOL_INTERFACE_FALSE}"; then + as_fn_error $? "conditional \"DSL_DEBUG_TOOL_INTERFACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_DTI_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_DTI_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_DTI_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_PILOT_TONES_STATUS_TRUE}" && test -z "${INCLUDE_PILOT_TONES_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_PILOT_TONES_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_PILOT_TONES_STATUS_TRUE}" && test -z "${INCLUDE_PILOT_TONES_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_PILOT_TONES_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_PILOT_TONES_STATUS_TRUE}" && test -z "${INCLUDE_PILOT_TONES_STATUS_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_PILOT_TONES_STATUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CEOC_TRUE}" && test -z "${INCLUDE_DSL_CEOC_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CEOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CEOC_TRUE}" && test -z "${INCLUDE_DSL_CEOC_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CEOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CEOC_TRUE}" && test -z "${INCLUDE_DSL_CEOC_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CEOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_REAL_TIME_TRACE_TRUE}" && test -z "${INCLUDE_REAL_TIME_TRACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_REAL_TIME_TRACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_REAL_TIME_TRACE_TRUE}" && test -z "${INCLUDE_REAL_TIME_TRACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_REAL_TIME_TRACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_REAL_TIME_TRACE_TRUE}" && test -z "${INCLUDE_REAL_TIME_TRACE_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_REAL_TIME_TRACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_TRUE}" && test -z "${INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE}" && test -z "${INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DTI_AGENT_STANDALONE_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE}" && test -z "${INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DTI_AGENT_STANDALONE_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_TRUE}" && test -z "${INCLUDE_DTI_AGENT_STANDALONE_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"INCLUDE_DTI_AGENT_STANDALONE_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SAFEC_SUPPORT_TRUE}" && test -z "${SAFEC_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"SAFEC_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SAFEC_SUPPORT_TRUE}" && test -z "${SAFEC_SUPPORT_FALSE}"; then + as_fn_error $? "conditional \"SAFEC_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +echo -e "------------------------------------------------------------------------" +echo -e " Configuration for dsl_cpe_control:" +echo -e " DSL device: $DSL_DEVICE_NAME" +if test -z "${DEVICE_VRX_TRUE}"; then + echo -e " DSL VRX device type: $DSL_VRX_DEVICE_NAME" +fi +echo -e " Configure model type: $DSL_CONFIG_MODEL_TYPE" +echo -e " Source code location: $srcdir" +echo -e " Compiler: $CC" +echo -e " Compiler c-flags: $CFLAGS" +echo -e " Extra compiler c-flags: $EXTRA_APP_CFLAGS" +echo -e " External compiler c-flags : $DSL_ADD_EXT_APPL_CFLAGS" +echo -e " Host System Type: $host" +echo -e " Install path: $prefix" +echo -e " Driver Include Path: $DSL_DRIVER_INCL_PATH" +echo -e " Device Driver Include Path: $DSL_DEVICE_DRIVER_INCL_PATH" +echo -e " Include IFXOS: $INCLUDE_DSL_CPE_IFXOS_SUPPORT" +echo -e " IFXOS library path: $IFXOS_LIBRARY_PATH" +echo -e " IFXOS include path: $IFXOS_INCLUDE_PATH" +echo -e " Include DTI: $INCLUDE_DSL_CPE_DTI_SUPPORT" +echo -e " DTI include path: $DTI_INCL_PATH" +echo -e " DTI library path: $DTI_LIBRARY_PATH" +echo -e " Disable debug prints: $DSL_CPE_DEBUG_DISABLE" +echo -e " Preselection of max. debug level: $DSL_CCA_DBG_MAX_LEVEL_SET" +echo -e " Preselected max. debug level: $DSL_CCA_DBG_MAX_LEVEL_PRE" +echo -e " Enable static build: $DSL_CPE_STATIC_LINKING" +echo -e " Include Event Polling support: $INCLUDE_DSL_EVENT_POLLING" +echo -e " Include deprecated functions: $INCLUDE_DEPRECATED" +echo -e " Include Device Exception Codes: $INCLUDE_DEVICE_EXCEPTION_CODES" +echo -e " Include FW request support: $INCLUDE_FW_REQUEST_SUPPORT" +echo -e " Include trace buffer support: $INCLUDE_DSL_CPE_TRACE_BUFFER" +echo -e " Include Filesystem: $INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT" +echo -e " Include CMV scripts: $INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT" +echo -e " Include CMV scripts math: $INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH" +echo -e " Include scripts notification: $INCLUDE_SCRIPT_NOTIFICATION" +echo -e " Include CLI: $INCLUDE_DSL_CPE_CLI_SUPPORT" +echo -e " Include Autogen CLI: $INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT" +echo -e " Include MIB: $INCLUDE_DSL_ADSL_MIB" +echo -e " Include CEOC: $INCLUDE_DSL_CEOC" +echo -e " Include config. get support: $INCLUDE_DSL_CONFIG_GET" +echo -e " Include System i/f configuration: $INCLUDE_DSL_SYSTEM_INTERFACE" +echo -e " Include Resource Statistics: $INCLUDE_DSL_RESOURCE_STATISTICS" +echo -e " Include Framing Parameters: $INCLUDE_DSL_FRAMING_PARAMETERS" +echo -e " Include G997 Line Inventory: $INCLUDE_DSL_G997_LINE_INVENTORY" +echo -e " Include G997 Framing Parameters: $INCLUDE_DSL_G997_FRAMING_PARAMETERS" +echo -e " Include G997 per tone data: $INCLUDE_DSL_G997_PER_TONE" +echo -e " Include G997 status: $INCLUDE_DSL_G997_STATUS" +echo -e " Include G997 alarm: $INCLUDE_DSL_G997_ALARM" +echo -e " Include Pilot Tones Status: $INCLUDE_PILOT_TONES_STATUS" +echo -e " Include Misc Line Status: $INCLUDE_DSL_CPE_MISC_LINE_STATUS" +echo -e " Include DELT: $INCLUDE_DSL_DELT" +echo -e " Include Filter Detection: $INCLUDE_DSL_FILTER_DETECTION" +echo -e " Include PM: $INCLUDE_DSL_PM" +echo -e " Include PM config: $INCLUDE_DSL_CPE_PM_CONFIG" +echo -e " Include PM total: $INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS" +echo -e " Include PM history: $INCLUDE_DSL_CPE_PM_HISTORY" +echo -e " Include PM showtime: $INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS" +echo -e " Include PM optional: $INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS" +echo -e " Include PM line: $INCLUDE_DSL_CPE_PM_LINE_COUNTERS" +echo -e " Include PM line event showtime: $INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS" +echo -e " Include PM channel: $INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS" +echo -e " Include PM channel extended: $INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS" +echo -e " Include PM data path: $INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS" +echo -e " Include PM data path failure: $INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS" +echo -e " Include PM ReTx: $INCLUDE_DSL_CPE_PM_RETX_COUNTERS" +echo -e " Include PM line threshold: $INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS" +echo -e " Include PM channel threshold: $INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS" +echo -e " Include PM data path threshold: $INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS" +echo -e " Include PM ReTx threshold: $INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS" +echo -e " Include TCP debug support: $DSL_DEBUG_TOOL_INTERFACE" +echo -e " Include real time trace support: $INCLUDE_REAL_TIME_TRACE" +echo -e " Include debug logger support: $INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT" +echo -e " Netlink ID of the debug messages: $DSL_DBG_MSG_NETLINK_ID" +echo -e " Include DTI agent stand-alone: $INCLUDE_DTI_AGENT_STANDALONE_SUPPORT" +echo -e " Safe-C support: $SAFEC_SUPPORT" +echo -e " Safe-C include path: $SAFEC_INCL_PATH" +echo -e " Safe-C library path: $SAFEC_LIB_PATH" +echo -e " Safe-C library: $SAFEC_LIB_NAME" +echo -e "----------------------- deprectated ! ----------------------------------" +echo -e " currently no such functions" +echo -e "------------------------------------------------------------------------" +echo -e " Settings:" +echo -e " Configure options: $CONFIGURE_OPTIONS" +echo -e "------------------------------------------------------------------------" + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by DSL CPE Control application $as_me 4.21.1, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +DSL CPE Control application config.status 4.21.1 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/dsl_cpe_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/dsl_cpe_config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tools/pipe/Makefile") CONFIG_FILES="$CONFIG_FILES tools/pipe/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..2677225 --- /dev/null +++ b/configure.in @@ -0,0 +1,2169 @@ +AC_REVISION($Revision: 1.173 $) + +AC_INIT([DSL CPE Control application],[4.21.1],[],[dsl_cpe_control]) +AC_CONFIG_SRCDIR(src/Makefile.am) +AM_INIT_AUTOMAKE([tar-pax]) + +AC_CONFIG_HEADER(src/dsl_cpe_config.h) +AH_TOP([ +#ifndef _DSL_CPE_CONFIG_H +#define _DSL_CPE_CONFIG_H]) +AH_BOTTOM([ +#endif /* _DSL_CPE_CONFIG_H */]) + +# Checks for programs. +AC_PROG_CC +AM_PROG_CC_C_O + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/ioctl.h sys/socket.h sys/time.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_CONST +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_STRUCT_TM +AC_C_VOLATILE + +# Checks for library functions. +#AC_PROG_GCC_TRADITIONAL +#AC_FUNC_MKTIME +#AC_FUNC_SELECT_ARGTYPES +#AC_FUNC_STRFTIME +#AC_FUNC_STRTOD +#AC_CHECK_FUNCS([ftime gethostbyname gettimeofday localtime_r memset select socket strchr strerror strstr strtoull]) + +# +# save the configure arguments +# +CONFIGURE_OPTIONS="$ac_configure_args" +AC_SUBST(CONFIGURE_OPTIONS) + +AM_CONDITIONAL(DEVICE_DANUBE, false) +AM_CONDITIONAL(DEVICE_VRX, false) +AM_CONDITIONAL(DEVICE_VRX_LAYER, false) + +PREDEFINED_CONF_EXTRA_APP_CFLAGS="-Os" + +PREDEFINED_CONF_INCLUDE_DSL_EVENT_POLLING="no" +PREDEFINED_CONF_INCLUDE_DEPRECATED="yes" +PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="no" +PREDEFINED_CONF_INCLUDE_FW_REQUEST_SUPPORT="yes" +PREDEFINED_CONF_DSL_CCA_DBG_MAX_LEVEL_PRE="no" +PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="no" +PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="no" +PREDEFINED_CONF_INCLUDE_DSL_DELT="yes" +PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="no" +PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB="no" +PREDEFINED_CONF_INCLUDE_DSL_CEOC="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="no" +PREDEFINED_CONF_INCLUDE_DSL_CONFIG_GET="yes" +PREDEFINED_CONF_INCLUDE_DSL_SYSTEM_INTERFACE="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS="no" +PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS="yes" +PREDEFINED_CONF_INCLUDE_DSL_FRAMING_PARAMETERS="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_LINE_INVENTORY="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_FRAMING_PARAMETERS="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_PER_TONE="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_STATUS="yes" +PREDEFINED_CONF_INCLUDE_DSL_G997_ALARM="yes" +PREDEFINED_CONF_INCLUDE_DSL_PM="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CONFIG="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT="yes" +PREDEFINED_CONF_INCLUDE_DSL_CPE_DTI_SUPPORT="yes" +PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS="yes" +PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" +PREDEFINED_CONF_INCLUDE_DTI_AGENT_STANDALONE_SUPPORT="no" + +dnl enable DANUBE support +AC_ARG_ENABLE(danube, + AC_HELP_STRING( + [--enable-danube],[Add DANUBE Family support.] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_API_DANUBE,,[Add DANUBE support]) + AM_CONDITIONAL(DEVICE_DANUBE, true) + AC_SUBST([DSL_DEVICE_NAME],[Danube_Family]) + fi + ] +) + +dnl enable VRX support +AC_ARG_ENABLE(vrx, + AC_HELP_STRING( + [--enable-vrx],[Add VRX support.] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_API_VRX,,[Add VRX support]) + AM_CONDITIONAL(DEVICE_VRX, true) + AM_CONDITIONAL(DEVICE_VRX_LAYER, true) + AC_SUBST([DSL_DEVICE_NAME],[VRX]) + fi + ] +) + +# This selects the sub-device for VRX Family (only valid in case of VRX enabled) +if test -z "${DEVICE_VRX_TRUE}"; then +dnl Select VRX device type +AC_ARG_ENABLE(vrx-device, + AC_HELP_STRING([--enable-vrx-device=vr9 | vr10 | vr10_320 | vr11],[Select VRX Device]), + [ + echo Set VRX Device = $enableval + case $enableval in + vr9) + AC_DEFINE(DSL_VRX_DEVICE_VR9,,[Add VR9 support]) + AC_SUBST([DSL_VRX_DEVICE_NAME],[VR9]) + ;; + vr10) + AC_DEFINE(DSL_VRX_DEVICE_VR10,,[Add VR10 support]) + AC_SUBST([DSL_VRX_DEVICE_NAME],[VR10]) + ;; + vr10_320) + AC_DEFINE(DSL_VRX_DEVICE_VR10_320,,[Add VR10_320 support]) + AC_SUBST([DSL_VRX_DEVICE_NAME],[VR10_320]) + ;; + vr11) + AC_DEFINE(DSL_VRX_DEVICE_VR11,,[Add VR11 support]) + AC_SUBST([DSL_VRX_DEVICE_NAME],[VR11]) + ;; + *) AC_MSG_ERROR([ Select VRX Device, use vr9 | vr10 | vr10_320 | vr11]); + ;; + esac + ] +) +fi + + +dnl Select configure model +AC_ARG_ENABLE(model, + AC_HELP_STRING( + [--enable-model[=model]],[Select configure model (lite|footprint|typical|full|debug)] + ), + [ + case "$enableval" in + lite ) + AC_SUBST([DSL_CONFIG_MODEL_TYPE],[Lite]) + PREDEFINED_CONF_INCLUDE_DEPRECATED="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT="no" + PREDEFINED_CONF_INCLUDE_DSL_CONFIG_GET="no" + PREDEFINED_CONF_INCLUDE_DSL_SYSTEM_INTERFACE="no" + PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS="no" + PREDEFINED_CONF_INCLUDE_DSL_FRAMING_PARAMETERS="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_LINE_INVENTORY="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_FRAMING_PARAMETERS="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_PER_TONE="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_STATUS="no" + PREDEFINED_CONF_INCLUDE_DSL_G997_ALARM="no" + PREDEFINED_CONF_INCLUDE_DSL_DELT="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CONFIG="no" + PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DTI_SUPPORT="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" + ;; + footprint ) + AC_SUBST([DSL_CONFIG_MODEL_TYPE],[Footprint]) + PREDEFINED_CONF_INCLUDE_DEPRECATED="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS="no" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS="no" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + typical ) + AC_SUBST([DSL_CONFIG_MODEL_TYPE],[Typical]) + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="yes" + + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="yes" + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + full ) + AC_SUBST([DSL_CONFIG_MODEL_TYPE],[Full]) + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS="yes" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="yes" + + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + debug ) + PREDEFINED_CONF_EXTRA_APP_CFLAGS="-O2 -g0" + AC_SUBST([DSL_CONFIG_MODEL_TYPE],[Debug]) + PREDEFINED_CONF_DSL_CCA_DBG_MAX_LEVEL_PRE="msg" + PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH="yes" + PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE="yes" + PREDEFINED_CONF_INCLUDE_DSL_CEOC="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS="yes" + PREDEFINED_CONF_INCLUDE_DSL_PM="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS="yes" + PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="yes" + + # enable device specific options + if test -z "${DEVICE_DANUBE_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER="yes" + PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS="yes" + PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT="yes" + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + if test -z "${DEVICE_VRX_TRUE}"; then + PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION="yes" + fi + ;; + * ) + echo "error: invalid selection for --enable-model=$enableval" + exit 1 ;; + esac + ], + [ + AC_SUBST([DSL_CONFIG_MODEL_TYPE],[None selected]) + ] +) + +dnl Enable debugging mode +AC_ARG_ENABLE(debug, + AC_HELP_STRING( + [--enable-debug,Enable debug info] + ), + [ + if test "$enableval" = yes; then + AC_SUBST([EXTRA_APP_CFLAGS],["-O2 -g0"]) + else + AC_SUBST([EXTRA_APP_CFLAGS],["-Os"]) + fi + ], + [ + AC_SUBST([EXTRA_APP_CFLAGS],[$PREDEFINED_CONF_EXTRA_APP_CFLAGS]) + ] +) + +dnl Set target application cflags +AM_CONDITIONAL(ADD_APPL_CFLAGS_SET, false) +AC_ARG_ENABLE(add-appl-cflags, + AS_HELP_STRING(--enable-add-appl-cflags=x,Set add appl cflags), + [ + if test -n "$enableval"; then + echo Set add appl compile flags = $enableval + AM_CONDITIONAL(ADD_APPL_CFLAGS_SET, true) + AC_SUBST([ADD_APPL_CFLAGS],[$enableval]) + fi + ] +) + +dnl Set target application ldflags +AM_CONDITIONAL(ADD_APPL_LDFLAGS_SET, false) +AC_ARG_ENABLE(add-appl-ldflags, + AS_HELP_STRING(--enable-add-appl-ldflags=x,Set add appl ldflags), + [ + if test -n "$enableval"; then + echo Set add appl ldflags = $enableval + AM_CONDITIONAL(ADD_APPL_LDFLAGS_SET, true) + AC_SUBST([ADD_APPL_LDFLAGS],[$enableval]) + fi + ] +) + +dnl Set additional external control application cflags +AM_CONDITIONAL(CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS, false) +AC_ARG_ENABLE(add_ext_appl_cflags, + AC_HELP_STRING([--enable-add_ext_appl_cflags=x],[Set add external appl cflags]), + [ + if test -n "$enableval"; then + echo Set add ext appl cflags = $enableval + AM_CONDITIONAL(CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS, true) + AC_SUBST([DSL_ADD_EXT_APPL_CFLAGS],[$enableval]) + fi + ] +) + +AC_ARG_ENABLE(static, + AS_HELP_STRING(--enable-static,Enable static linking of the application), + [ + if test "$enableval" = yes; then + AM_CONDITIONAL(DSL_CPE_STATIC_LINKING, true) + else + AM_CONDITIONAL(DSL_CPE_STATIC_LINKING, false) + fi + ], + [ + AM_CONDITIONAL(DSL_CPE_STATIC_LINKING, false) + ] +) + +dnl set DSL DRIVER driver include path +DEFAULT_DSL_DRIVER_INCL_PATH='' +AC_ARG_ENABLE(driver-include, + AC_HELP_STRING(--enable-driver-include=-I/path/to/your/driver,Set the DSL DRIVER driver include path), + [ + if test -n "$enableval"; then + echo Set the DSL CE API driver include path to $enableval + AC_SUBST([DSL_DRIVER_INCL_PATH],[$enableval]) + else + echo Set the default DSL DRIVER driver include path $DEFAULT_DSL_DRIVER_INCL_PATH + AC_SUBST([DSL_DRIVER_INCL_PATH],[$DEFAULT_DSL_DRIVER_INCL_PATH]) + fi + ] +) + +dnl set DSL DEVICE DRIVER driver include path +DEFAULT_DSL_DEVICE_DRIVER_INCL_PATH='' +AC_ARG_ENABLE(device-driver-include, + AC_HELP_STRING(--enable-device-driver-include=-I/path/to/your/driver,Set the DSL DEVICE DRIVER driver include path), + [ + if test -n "$enableval"; then + echo Set the DSL DEVICE driver include path to $enableval + AC_SUBST([DSL_DEVICE_DRIVER_INCL_PATH],[$enableval]) + else + echo Set the default DSL DEVICE DRIVER driver include path $DEFAULT_DSL_DEVICE_DRIVER_INCL_PATH + AC_SUBST([DSL_DEVICE_DRIVER_INCL_PATH],[$DEFAULT_DSL_DEVICE_DRIVER_INCL_PATH]) + fi + ] +) + +dnl enable IFXOS support +AM_CONDITIONAL(INCLUDE_DSL_CPE_IFXOS_SUPPORT, false) +AC_ARG_ENABLE(ifxos, + AC_HELP_STRING( + [--enable-ifxos],[Include IFXOS support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_IFXOS_SUPPORT,,[Include IFXOS support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_IFXOS_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_IFXOS_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_IFXOS_SUPPORT],[no]) + fi + ], + [ + AC_SUBST([INCLUDE_DSL_CPE_IFXOS_SUPPORT],[no]) + ] +) + +dnl set libifxos.a library path +DEFAULT_IFXOS_LIBRARY_PATH='.' +AC_ARG_ENABLE(ifxos-library, + AS_HELP_STRING([--enable-ifxos-library=-L/path/to/your/lib_ifxos/src] , [Set the lib_ifxos library path. In this location the libifxos.a should be found]), + [ + if test -n "$enableval"; then + echo Set the libifxos.a library path to $enableval + AC_SUBST([IFXOS_LIBRARY_PATH],[$enableval]) + else + echo Set the lib_board_config library path $DEFAULT_IFXOS_LIBRARY_PATH + AC_SUBST([IFXOS_LIBRARY_PATH],[$DEFAULT_IFXOS_LIBRARY_PATH]) + fi + ], + [ + echo Set the libifxos.a library path $DEFAULT_IFXOS_LIBRARY_PATH + AC_SUBST([IFXOS_LIBRARY_PATH],[$DEFAULT_IFXOS_LIBRARY_PATH]) + ] +) + +dnl set lib_ifxos include path +DEFAULT_IFXOS_INCLUDE_PATH='-I./lib_ifxos/src/include' +AC_ARG_ENABLE(ifxos-include, + AC_HELP_STRING([--enable-ifxos-include=-I/path/to/your/lib_ifxos/src/include], [Set the lib_ifxos include path.]), + [ + if test -n "$enableval"; then + echo Set the lib_ifxos include path $enableval + AC_SUBST([IFXOS_INCLUDE_PATH],[$enableval]) + else + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH]) + fi + ], + [ + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH]) + ] +) + +dnl Enable debug printouts +AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) +AC_ARG_ENABLE(debug-prints, + AC_HELP_STRING( + [--enable-debug-prints[=level]],[Enable debug printouts (default: yes/err|none/no|prn|err|wrn|msg|local)] + ), + [ + case "$enableval" in + yes ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = no (using default)]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[no]) + + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[n/a]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) + PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT="no" + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + no | none ) + AC_DEFINE(DSL_CPE_DEBUG_DISABLE,,[Disabled debug prints]) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[yes]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = n/a]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[no]) + + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[n/a]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[no]) + ;; + prn | 0x1 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x1, [Debug level = print (prn)]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x1]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + err | 0x2 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x2, [Debug level = error (err)]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x2]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + wrn | 0x40 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x40, [Debug level = warning (wrn)]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x40]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + msg | 0x80 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x80, [Debug level = local]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x80]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + local | 0xFF ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0xFF, [Debug level = local]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0xFF]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + * ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = no (using default)]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[no]) + + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[n/a]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + esac + ], + [ + case "$PREDEFINED_CONF_DSL_CCA_DBG_MAX_LEVEL_PRE" in + yes ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = no (using default)]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[no]) + + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[n/a]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + no | none ) + AC_DEFINE(DSL_CPE_DEBUG_DISABLE,,[Disabled debug prints]) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[yes]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = n/a]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[no]) + + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[n/a]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[no]) + ;; + prn | 0x1 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x1, [Debug level = print (prn)]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x1]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + err | 0x2 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x2, [Debug level = error (err)]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x2]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + wrn | 0x40 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x40, [Debug level = warning (wrn)]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x40]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + msg | 0x80 ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0x80, [Debug level = local]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0x80]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + local | 0xFF ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = yes]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, true) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[yes]) + + AC_DEFINE_UNQUOTED(DSL_CCA_DBG_MAX_LEVEL_PRE,0xFF, [Debug level = local]) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[0xFF]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + ;; + * ) + AC_SUBST([DSL_CPE_DEBUG_DISABLE],[no]) + + AC_DEFINE(DSL_CCA_DBG_MAX_LEVEL_SET,,[Preselection of max. debug level = no (using default)]) + AM_CONDITIONAL(DSL_CCA_DBG_MAX_LEVEL_SET, false) + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_SET],[no]) + + AC_SUBST([DSL_CCA_DBG_MAX_LEVEL_PRE],[n/a]) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + esac + ] +) + +dnl enable FW request support +AM_CONDITIONAL(INCLUDE_FW_REQUEST_SUPPORT, false) +AC_ARG_ENABLE(dsl_fw_request, + AC_HELP_STRING( + [--enable-dsl-fw-request],[Include FW request support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_FW_REQUEST_SUPPORT, false) + AC_SUBST([INCLUDE_FW_REQUEST_SUPPORT],[no]) + else + AC_DEFINE(INCLUDE_FW_REQUEST_SUPPORT,,[Include FW request support]) + AM_CONDITIONAL(INCLUDE_FW_REQUEST_SUPPORT, true) + AC_SUBST([INCLUDE_FW_REQUEST_SUPPORT],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_FW_REQUEST_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_FW_REQUEST_SUPPORT,,[Include FW request support]) + AM_CONDITIONAL(INCLUDE_FW_REQUEST_SUPPORT, true) + AC_SUBST([INCLUDE_FW_REQUEST_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_FW_REQUEST_SUPPORT],[no]) + fi + ] +) + +dnl enable includation of deprecated functions +AM_CONDITIONAL(INCLUDE_DEPRECATED, false) +AC_ARG_ENABLE(deprecated, + AC_HELP_STRING( + [--enable-deprecated],[Include deprecated functions] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DEPRECATED, false) + AC_SUBST([INCLUDE_DEPRECATED],[no]) + else + AC_DEFINE(INCLUDE_DEPRECATED,,[Include deprecated functions]) + AM_CONDITIONAL(INCLUDE_DEPRECATED, true) + AC_SUBST([INCLUDE_DEPRECATED],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DEPRECATED" = yes; then + AC_DEFINE(INCLUDE_DEPRECATED,,[Include deprecated functions]) + AM_CONDITIONAL(INCLUDE_DEPRECATED, true) + AC_SUBST([INCLUDE_DEPRECATED],[yes]) + else + AC_SUBST([INCLUDE_DEPRECATED],[no]) + fi + ] +) + +dnl enable Device Exception Codes Support +AM_CONDITIONAL(INCLUDE_DEVICE_EXCEPTION_CODES, false) +AC_ARG_ENABLE(device_exception_codes, + AC_HELP_STRING( + [--enable-device-exception-codes],[Include Device Exception Codes] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DEVICE_EXCEPTION_CODES, false) + AC_SUBST([INCLUDE_DEVICE_EXCEPTION_CODES],[no]) + else + AC_DEFINE(INCLUDE_DEVICE_EXCEPTION_CODES,,[Include Device Exception Codes]) + AM_CONDITIONAL(INCLUDE_DEVICE_EXCEPTION_CODES, true) + AC_SUBST([INCLUDE_DEVICE_EXCEPTION_CODES],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DEVICE_EXCEPTION_CODES" = yes; then + AC_DEFINE(INCLUDE_DEVICE_EXCEPTION_CODES,,[Include Device Exception Codes]) + AM_CONDITIONAL(INCLUDE_DEVICE_EXCEPTION_CODES, true) + AC_SUBST([INCLUDE_DEVICE_EXCEPTION_CODES],[yes]) + else + AC_SUBST([INCLUDE_DEVICE_EXCEPTION_CODES],[no]) + fi + ] +) + +dnl enable Event Polling support +AM_CONDITIONAL(INCLUDE_DSL_EVENT_POLLING, false) +AC_ARG_ENABLE(dsl_event_polling, + AC_HELP_STRING( + [--enable-dsl-event-polling],[Include Event Polling support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_EVENT_POLLING, false) + AC_SUBST([INCLUDE_DSL_EVENT_POLLING],[no]) + else + AC_DEFINE(INCLUDE_DSL_EVENT_POLLING,,[Include Event Polling support]) + AM_CONDITIONAL(INCLUDE_DSL_EVENT_POLLING, true) + AC_SUBST([INCLUDE_DSL_EVENT_POLLING],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_EVENT_POLLING" = yes; then + AC_DEFINE(INCLUDE_DSL_EVENT_POLLING,,[Include FW request support]) + AM_CONDITIONAL(INCLUDE_DSL_EVENT_POLLING, true) + AC_SUBST([INCLUDE_DSL_EVENT_POLLING],[yes]) + else + AC_SUBST([INCLUDE_DSL_EVENT_POLLING],[no]) + fi + ] +) + +dnl enable Misc Line Status support +AM_CONDITIONAL(INCLUDE_DSL_CPE_MISC_LINE_STATUS, false) +AC_ARG_ENABLE(dsl_misc_line_status, + AC_HELP_STRING( + [--enable-dsl-misc-line-status],[Include Misc Line Status support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_MISC_LINE_STATUS,,[Include Misc Line Status support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_MISC_LINE_STATUS, true) + AC_SUBST([INCLUDE_DSL_CPE_MISC_LINE_STATUS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_MISC_LINE_STATUS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_MISC_LINE_STATUS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_MISC_LINE_STATUS,,[Include Misc Line Status support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_MISC_LINE_STATUS, true) + AC_SUBST([INCLUDE_DSL_CPE_MISC_LINE_STATUS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_MISC_LINE_STATUS],[no]) + fi + ] +) + +dnl enable Showtime event handling +AM_CONDITIONAL(INCLUDE_DSL_CPE_TRACE_BUFFER, false) +AC_ARG_ENABLE(adsl_trace, + AC_HELP_STRING( + [--enable-adsl-trace],[Include showtime event logging support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_TRACE_BUFFER,,[Include ADSL showtime event logging support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_TRACE_BUFFER, true) + AC_SUBST([INCLUDE_DSL_CPE_TRACE_BUFFER],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_TRACE_BUFFER],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_TRACE_BUFFER" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_TRACE_BUFFER,,[Include ADSL showtime event logging support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_TRACE_BUFFER, true) + AC_SUBST([INCLUDE_DSL_CPE_TRACE_BUFFER],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_TRACE_BUFFER],[no]) + fi + ] +) + +dnl enable configuration get support +AM_CONDITIONAL(INCLUDE_DSL_CONFIG_GET, false) +AC_ARG_ENABLE(dsl_config_get, + AC_HELP_STRING( + [--enable-dsl-config-get],[Include configuration get support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_CONFIG_GET, false) + AC_SUBST([INCLUDE_DSL_CONFIG_GET],[no]) + else + AC_DEFINE(INCLUDE_DSL_CONFIG_GET,,[Include configuration get support]) + AM_CONDITIONAL(INCLUDE_DSL_CONFIG_GET, true) + AC_SUBST([INCLUDE_DSL_CONFIG_GET],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CONFIG_GET" = yes; then + AC_DEFINE(INCLUDE_DSL_CONFIG_GET,,[Include configuration get support]) + AM_CONDITIONAL(INCLUDE_DSL_CONFIG_GET, true) + AC_SUBST([INCLUDE_DSL_CONFIG_GET],[yes]) + else + AC_SUBST([INCLUDE_DSL_CONFIG_GET],[no]) + fi + ] +) + +dnl enable filesystem support +AM_CONDITIONAL(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT, false) +AC_ARG_ENABLE(dsl_filesystem, + AC_HELP_STRING( + [--enable-dsl-filesystem],[Include filesystem support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT, false) + AC_SUBST([INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT],[no]) + else + AC_DEFINE(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT,,[Include filesystem support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT,,[Include filesystem support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT],[no]) + fi + ] +) + +dnl enable System Interface config support +AM_CONDITIONAL(INCLUDE_DSL_SYSTEM_INTERFACE, false) +AC_ARG_ENABLE(dsl_system_interface, + AC_HELP_STRING( + [--enable-dsl-system-interface],[Include System Interface configuration support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_SYSTEM_INTERFACE, false) + AC_SUBST([INCLUDE_DSL_SYSTEM_INTERFACE],[no]) + else + AC_DEFINE(INCLUDE_DSL_SYSTEM_INTERFACE,,[Include System Interface configuration support]) + AM_CONDITIONAL(INCLUDE_DSL_SYSTEM_INTERFACE, true) + AC_SUBST([INCLUDE_DSL_SYSTEM_INTERFACE],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_SYSTEM_INTERFACE" = yes; then + AC_DEFINE(INCLUDE_DSL_SYSTEM_INTERFACE,,[Include System Interface configuration support]) + AM_CONDITIONAL(INCLUDE_DSL_SYSTEM_INTERFACE, true) + AC_SUBST([INCLUDE_DSL_SYSTEM_INTERFACE],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_SYSTEM_INTERFACE, false) + AC_SUBST([INCLUDE_DSL_SYSTEM_INTERFACE],[no]) + fi + ] +) + + +dnl enable Resource Statistics support +AM_CONDITIONAL(INCLUDE_DSL_RESOURCE_STATISTICS, false) +AC_ARG_ENABLE(dsl_resource_statistics, + AC_HELP_STRING( + [--enable-dsl-resource-statistics],[Include Resource Statistics support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_RESOURCE_STATISTICS, false) + AC_SUBST([INCLUDE_DSL_RESOURCE_STATISTICS],[no]) + else + AC_DEFINE(INCLUDE_DSL_RESOURCE_STATISTICS,,[Include Resource Statistics support]) + AM_CONDITIONAL(INCLUDE_DSL_RESOURCE_STATISTICS, true) + AC_SUBST([INCLUDE_DSL_RESOURCE_STATISTICS],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_RESOURCE_STATISTICS" = yes; then + AC_DEFINE(INCLUDE_DSL_RESOURCE_STATISTICS,,[Include Resource Statistics support]) + AM_CONDITIONAL(INCLUDE_DSL_RESOURCE_STATISTICS, true) + AC_SUBST([INCLUDE_DSL_RESOURCE_STATISTICS],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_RESOURCE_STATISTICS, false) + AC_SUBST([INCLUDE_DSL_RESOURCE_STATISTICS],[no]) + fi + ] +) + +dnl enable G997 Line Inventory support +AM_CONDITIONAL(INCLUDE_DSL_G997_LINE_INVENTORY, false) +AC_ARG_ENABLE(dsl_g997_line_inventory, + AC_HELP_STRING( + [--enable-dsl-g997-line-inventory],[Include G997 Line Inventory support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_G997_LINE_INVENTORY, false) + AC_SUBST([INCLUDE_DSL_G997_LINE_INVENTORY],[no]) + else + AC_DEFINE(INCLUDE_DSL_G997_LINE_INVENTORY,,[Include G997 Line Inventory support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_LINE_INVENTORY, true) + AC_SUBST([INCLUDE_DSL_G997_LINE_INVENTORY],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_LINE_INVENTORY" = yes; then + AC_DEFINE(INCLUDE_DSL_G997_LINE_INVENTORY,,[Include G997 Line Inventory support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_LINE_INVENTORY, true) + AC_SUBST([INCLUDE_DSL_G997_LINE_INVENTORY],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_G997_LINE_INVENTORY, false) + AC_SUBST([INCLUDE_DSL_G997_LINE_INVENTORY],[no]) + fi + ] +) + +dnl enable Framing Parameters support +AM_CONDITIONAL(INCLUDE_DSL_FRAMING_PARAMETERS, false) +AC_ARG_ENABLE(dsl_framing_parameters, + AC_HELP_STRING( + [--enable-dsl-framing-parameters],[Include Framing Parameters support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_FRAMING_PARAMETERS, false) + AC_SUBST([INCLUDE_DSL_FRAMING_PARAMETERS],[no]) + else + AC_DEFINE(INCLUDE_DSL_FRAMING_PARAMETERS,,[Include Framing Parameters support]) + AM_CONDITIONAL(INCLUDE_DSL_FRAMING_PARAMETERS, true) + AC_SUBST([INCLUDE_DSL_FRAMING_PARAMETERS],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_FRAMING_PARAMETERS" = yes; then + AC_DEFINE(INCLUDE_DSL_FRAMING_PARAMETERS,,[Include Framing Parameters support]) + AM_CONDITIONAL(INCLUDE_DSL_FRAMING_PARAMETERS, true) + AC_SUBST([INCLUDE_DSL_FRAMING_PARAMETERS],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_FRAMING_PARAMETERS, false) + AC_SUBST([INCLUDE_DSL_FRAMING_PARAMETERS],[no]) + fi + ] +) + +dnl enable G997 Framing Parameters support +AM_CONDITIONAL(INCLUDE_DSL_G997_FRAMING_PARAMETERS, false) +AC_ARG_ENABLE(dsl_g997_framing_parameters, + AC_HELP_STRING( + [--enable-dsl-g997-framing-parameters],[Include G997 Framing Parameters support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_G997_FRAMING_PARAMETERS, false) + AC_SUBST([INCLUDE_DSL_G997_FRAMING_PARAMETERS],[no]) + else + AC_DEFINE(INCLUDE_DSL_G997_FRAMING_PARAMETERS,,[Include G997 Framing Parameters support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_FRAMING_PARAMETERS, true) + AC_SUBST([INCLUDE_DSL_G997_FRAMING_PARAMETERS],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_FRAMING_PARAMETERS" = yes; then + AC_DEFINE(INCLUDE_DSL_G997_FRAMING_PARAMETERS,,[Include G997 Framing Parameters support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_FRAMING_PARAMETERS, true) + AC_SUBST([INCLUDE_DSL_G997_FRAMING_PARAMETERS],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_G997_FRAMING_PARAMETERS, false) + AC_SUBST([INCLUDE_DSL_G997_FRAMING_PARAMETERS],[no]) + fi + ] +) + +dnl enable G997 per tone values support +AM_CONDITIONAL(INCLUDE_DSL_G997_PER_TONE, false) +AC_ARG_ENABLE(dsl_g997_per_tone, + AC_HELP_STRING( + [--enable-dsl-g997-per-tone],[Include G997 per tone values support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_G997_PER_TONE, false) + AC_SUBST([INCLUDE_DSL_G997_PER_TONE],[no]) + else + AC_DEFINE(INCLUDE_DSL_G997_PER_TONE,,[Include G997 per tone values support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_PER_TONE, true) + AC_SUBST([INCLUDE_DSL_G997_PER_TONE],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_PER_TONE" = yes; then + AC_DEFINE(INCLUDE_DSL_G997_PER_TONE,,[Include G997 per tone values support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_PER_TONE, true) + AC_SUBST([INCLUDE_DSL_G997_PER_TONE],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_G997_PER_TONE, false) + AC_SUBST([INCLUDE_DSL_G997_PER_TONE],[no]) + fi + ] +) + +dnl enable G997 status support +AM_CONDITIONAL(INCLUDE_DSL_G997_STATUS, false) +AC_ARG_ENABLE(dsl_g997_status, + AC_HELP_STRING( + [--enable-dsl-g997-status],[Include G997 status support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_G997_STATUS, false) + AC_SUBST([INCLUDE_DSL_G997_STATUS],[no]) + else + AC_DEFINE(INCLUDE_DSL_G997_STATUS,,[Include G997 status support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_STATUS, true) + AC_SUBST([INCLUDE_DSL_G997_STATUS],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_STATUS" = yes; then + AC_DEFINE(INCLUDE_DSL_G997_STATUS,,[Include G997 status support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_STATUS, true) + AC_SUBST([INCLUDE_DSL_G997_STATUS],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_G997_STATUS, false) + AC_SUBST([INCLUDE_DSL_G997_STATUS],[no]) + fi + ] +) + +dnl enable G997 alarm support +AM_CONDITIONAL(INCLUDE_DSL_G997_ALARM, false) +AC_ARG_ENABLE(dsl_g997_alarm, + AC_HELP_STRING( + [--enable-dsl-g997-alarm],[Include G997 alarm support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_G997_ALARM, false) + AC_SUBST([INCLUDE_DSL_G997_ALARM],[no]) + else + AC_DEFINE(INCLUDE_DSL_G997_ALARM,,[Include G997 alarm support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_ALARM, true) + AC_SUBST([INCLUDE_DSL_G997_ALARM],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_G997_ALARM" = yes; then + AC_DEFINE(INCLUDE_DSL_G997_ALARM,,[Include G997 alarm support]) + AM_CONDITIONAL(INCLUDE_DSL_G997_ALARM, true) + AC_SUBST([INCLUDE_DSL_G997_ALARM],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_G997_ALARM, false) + AC_SUBST([INCLUDE_DSL_G997_ALARM],[no]) + fi + ] +) + +dnl enable DELT support +AM_CONDITIONAL(INCLUDE_DSL_DELT, false) +AC_ARG_ENABLE(dsl_delt, + AC_HELP_STRING( + [--enable-dsl-delt],[Include DELT support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_DELT, false) + AC_SUBST([INCLUDE_DSL_DELT],[no]) + else + AC_DEFINE(INCLUDE_DSL_DELT,,[Include DELT support]) + AM_CONDITIONAL(INCLUDE_DSL_DELT, true) + AC_SUBST([INCLUDE_DSL_DELT],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_DELT" = yes; then + AC_DEFINE(INCLUDE_DSL_DELT,,[Include DELT support]) + AM_CONDITIONAL(INCLUDE_DSL_DELT, true) + AC_SUBST([INCLUDE_DSL_DELT],[yes]) + else + AC_SUBST([INCLUDE_DSL_DELT],[no]) + fi + ] +) + +dnl enable Filter Detection support +AM_CONDITIONAL(INCLUDE_DSL_FILTER_DETECTION, false) +AC_ARG_ENABLE(dsl_filter_detection, + AC_HELP_STRING( + [--enable-dsl-filter-detection],[Include Filter Detection support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_FILTER_DETECTION, false) + AC_SUBST([INCLUDE_DSL_FILTER_DETECTION],[no]) + else + AC_DEFINE(INCLUDE_DSL_FILTER_DETECTION,,[Include Filter Detection support]) + AM_CONDITIONAL(INCLUDE_DSL_FILTER_DETECTION, true) + AC_SUBST([INCLUDE_DSL_FILTER_DETECTION],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_FILTER_DETECTION" = yes; then + AC_DEFINE(INCLUDE_DSL_FILTER_DETECTION,,[Include Filter Detection support]) + AM_CONDITIONAL(INCLUDE_DSL_FILTER_DETECTION, true) + AC_SUBST([INCLUDE_DSL_FILTER_DETECTION],[yes]) + else + AC_SUBST([INCLUDE_DSL_FILTER_DETECTION],[no]) + fi + ] +) + +dnl enable PM support +AM_CONDITIONAL(INCLUDE_DSL_PM, false) +AC_ARG_ENABLE(dsl_pm, + AC_HELP_STRING( + [--enable-dsl-pm],[Include DSL PM support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_PM,,[Include DSL PM support]) + AM_CONDITIONAL(INCLUDE_DSL_PM, true) + AC_SUBST([INCLUDE_DSL_PM],[yes]) + else + AC_SUBST([INCLUDE_DSL_PM],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_PM" = yes; then + AC_DEFINE(INCLUDE_DSL_PM,,[Include DSL PM support]) + AM_CONDITIONAL(INCLUDE_DSL_PM, true) + AC_SUBST([INCLUDE_DSL_PM],[yes]) + else + AC_SUBST([INCLUDE_DSL_PM],[no]) + fi + ] +) + +dnl enable PM config support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CONFIG, false) +AC_ARG_ENABLE(dsl_pm_config, + AC_HELP_STRING( + [--enable-dsl-pm-config],[Include PM config support] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CONFIG, false) + AC_SUBST([INCLUDE_DSL_CPE_PM_CONFIG],[no]) + else + AC_DEFINE(INCLUDE_DSL_CPE_PM_CONFIG,,[Include PM config support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CONFIG, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CONFIG],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CONFIG" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_CONFIG,,[Include PM config support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CONFIG, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CONFIG],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CONFIG, false) + AC_SUBST([INCLUDE_DSL_CPE_PM_CONFIG],[no]) + fi + ] +) + +dnl enable PM channel counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_channel_counters, + AC_HELP_STRING( + [--enable-dsl-pm-channel-counters],[Include DSL PM channel counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS,,[Include DSL PM channel counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS,,[Include DSL PM channel counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS],[no]) + fi + ] +) + +dnl enable PM channel extended counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_channel_ext_counters, + AC_HELP_STRING( + [--enable-dsl-pm-channel-ext-counters],[Include DSL PM channel extended counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS,,[Include DSL PM channel extended counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS,,[Include DSL PM channel extended counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS],[no]) + fi + ] +) + +dnl enable PM datapath counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_datapath_counters, + AC_HELP_STRING( + [--enable-dsl-pm-datapath-counters],[Include DSL PM datapath counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS,,[Include DSL PM datapath counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS,,[Include DSL PM datapath counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS],[no]) + fi + ] +) + +dnl enable PM retransmission counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_RETX_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_retx_counters, + AC_HELP_STRING( + [--enable-dsl-pm-retx-counters],[Include DSL PM retransmission counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_RETX_COUNTERS,,[Include DSL PM retransmission counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_RETX_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_RETX_COUNTERS,,[Include DSL PM retransmission counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_RETX_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_COUNTERS],[no]) + fi + ] +) + +dnl enable PM datapath failure counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_datapath_failure_counters, + AC_HELP_STRING( + [--enable-dsl-pm-datapath-failure-counters],[Include DSL PM datapath failure counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS,,[Include DSL PM datapath failure counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS,,[Include DSL PM datapath failure counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS],[no]) + fi + ] +) + +dnl enable PM line counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_line_counters, + AC_HELP_STRING( + [--enable-dsl-pm-line-counters],[Include DSL PM line counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_LINE_COUNTERS,,[Include DSL PM line counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_LINE_COUNTERS,,[Include DSL PM line counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_COUNTERS],[no]) + fi + ] +) + +dnl enable PM line event showtime counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_line_event_showtime_counters, + AC_HELP_STRING( + [--enable-dsl-pm-line-event-showtime-counters],[Include DSL PM line event showtime counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS,,[Include DSL PM line event showtime counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS,,[Include DSL PM line event showtime counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS],[no]) + fi + ] +) + +dnl enable PM channel thresholds support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS, false) +AC_ARG_ENABLE(dsl_pm_channel_thresholds, + AC_HELP_STRING( + [--enable-dsl-pm-channel-thresholds],[Include DSL PM channel thresholds support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS,,[Include DSL PM channel thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS,,[Include DSL PM channel thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS],[no]) + fi + ] +) + +dnl enable PM datapath thresholds support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS, false) +AC_ARG_ENABLE(dsl_pm_datapath_thresholds, + AC_HELP_STRING( + [--enable-dsl-pm-datapath-thresholds],[Include DSL PM datapath thresholds support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS,,[Include DSL PM datapath thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS,,[Include DSL PM datapath thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS],[no]) + fi + ] +) + +dnl enable PM retransmission thresholds support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS, false) +AC_ARG_ENABLE(dsl_pm_retx_thresholds, + AC_HELP_STRING( + [--enable-dsl-pm-retx-thresholds],[Include DSL PM retransmission thresholds support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS,,[Include DSL PM retransmission thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS,,[Include DSL PM retransmission thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS],[no]) + fi + ] +) + +dnl enable PM line thresholds support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS, false) +AC_ARG_ENABLE(dsl_pm_line_thresholds, + AC_HELP_STRING( + [--enable-dsl-pm-line-thresholds],[Include DSL PM line thresholds support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS,,[Include DSL PM line thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS,,[Include DSL PM line thresholds support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS],[no]) + fi + ] +) + +dnl enable PM total counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_total, + AC_HELP_STRING( + [--enable-dsl-pm-total],[Include DSL PM total counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS,,[Include DSL PM total counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS,,[Include DSL PM total counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS],[no]) + fi + ] +) + +dnl enable PM history support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_HISTORY, false) +AC_ARG_ENABLE(dsl_pm_history, + AC_HELP_STRING( + [--enable-dsl-pm-history],[Include DSL PM history support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_HISTORY,,[Include DSL PM history support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_HISTORY, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_HISTORY],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_HISTORY],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_HISTORY" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_HISTORY,,[Include DSL PM history support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_HISTORY, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_HISTORY],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_HISTORY],[no]) + fi + ] +) + +dnl enable PM showtime counters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS, false) +AC_ARG_ENABLE(dsl_pm_showtime, + AC_HELP_STRING( + [--enable-dsl-pm-showtime],[Include DSL PM showtime counters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS,,[Include DSL PM showtime counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS,,[Include DSL PM showtime counters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS],[no]) + fi + ] +) + +dnl enable PM optional parameters support +AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS, false) +AC_ARG_ENABLE(dsl_pm_optional_parameters, + AC_HELP_STRING( + [--enable-dsl-pm-optional-parameters],[Include DSL PM optional parameters support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS,,[Include DSL PM optional parameters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS,,[Include DSL PM optional parameters support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS, true) + AC_SUBST([INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS],[no]) + fi + ] +) + +dnl enable CMV test scripts parser support +AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT, false) +AC_ARG_ENABLE(cmv-scripts, + AS_HELP_STRING( + [--enable-cmv-scripts],[Enable CMV scripts parser support.] + ), + [ + if test "$enableval" = no; then + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT, false) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT],[no]) + else + AC_DEFINE(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT,,[Enable CMV scripts parser support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT],[yes]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT,,[Enable CMV scripts parser support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT, false) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT],[no]) + fi + ] +) + +dnl enable CMV test scripts math support +AC_ARG_ENABLE(cmv-scripts-math, + AS_HELP_STRING( + [--enable-cmv-scripts-math],[Enable CMV scripts math support.] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH,,[Enable CMV scripts math support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH, true) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH, false) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH,,[Enable CMV scripts math support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH, true) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH, false) + AC_SUBST([INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH],[no]) + fi + ] +) + +dnl enable script notification support +AC_ARG_ENABLE(script-notification, + AS_HELP_STRING( + [--enable-script-notification],[Enable script notification support.] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_SCRIPT_NOTIFICATION,,[Enable script notification support]) + AM_CONDITIONAL(INCLUDE_SCRIPT_NOTIFICATION, true) + AC_SUBST([INCLUDE_SCRIPT_NOTIFICATION],[yes]) + else + AM_CONDITIONAL(INCLUDE_SCRIPT_NOTIFICATION, false) + AC_SUBST([INCLUDE_SCRIPT_NOTIFICATION],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_SCRIPT_NOTIFICATION" = yes; then + AC_DEFINE(INCLUDE_SCRIPT_NOTIFICATION,,[Enable script notification support]) + AM_CONDITIONAL(INCLUDE_SCRIPT_NOTIFICATION, true) + AC_SUBST([INCLUDE_SCRIPT_NOTIFICATION],[yes]) + else + AM_CONDITIONAL(INCLUDE_SCRIPT_NOTIFICATION, false) + AC_SUBST([INCLUDE_SCRIPT_NOTIFICATION],[no]) + fi + ] +) + +dnl enable the CLI support +AC_ARG_ENABLE(cli-support, + AS_HELP_STRING( + [--enable-cli-support],[Enable CLI support.] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_CLI_SUPPORT,,[Enable CLI support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_CLI_SUPPORT],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_SUPPORT, false) + AC_SUBST([INCLUDE_DSL_CPE_CLI_SUPPORT],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_CLI_SUPPORT,,[Enable CLI support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_CLI_SUPPORT],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_SUPPORT, false) + AC_SUBST([INCLUDE_DSL_CPE_CLI_SUPPORT],[no]) + fi + ] +) + +dnl enable the Autogen CLI support +AC_ARG_ENABLE(cli-autogen-support, + AS_HELP_STRING( + [--enable-cli-autogen-support],[Enable Autogen CLI support.] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT,,[Enable Autogen CLI support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT, false) + AC_SUBST([INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT,,[Enable Autogen CLI support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT, false) + AC_SUBST([INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT],[no]) + fi + ] +) + +dnl enable ADSL MIB support +AC_ARG_ENABLE(adsl-mib-support, + AS_HELP_STRING( + [--enable-adsl-mib-support],[Enable MIB support.] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_ADSL_MIB,,[Enable MIB support]) + AM_CONDITIONAL(INCLUDE_DSL_ADSL_MIB, true) + AC_SUBST([INCLUDE_DSL_ADSL_MIB],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_ADSL_MIB, false) + AC_SUBST([INCLUDE_DSL_ADSL_MIB],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_ADSL_MIB" = yes; then + AC_DEFINE(INCLUDE_DSL_ADSL_MIB,,[Include ADSL MIB support]) + AM_CONDITIONAL(INCLUDE_DSL_ADSL_MIB, true) + AC_SUBST([INCLUDE_DSL_ADSL_MIB],[yes]) + else + AM_CONDITIONAL(INCLUDE_DSL_ADSL_MIB, false) + AC_SUBST([INCLUDE_DSL_ADSL_MIB],[no]) + fi + ] +) + +dnl enable TCP debug support +AM_CONDITIONAL(DSL_DEBUG_TOOL_INTERFACE, false) +AC_ARG_ENABLE(debug-tool-interface, + AC_HELP_STRING( + [--enable-debug-tool-interface],[Include DSL TCP debug support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(DSL_DEBUG_TOOL_INTERFACE,,[Include DSL TCP debug support]) + AM_CONDITIONAL(DSL_DEBUG_TOOL_INTERFACE, true) + AC_SUBST([DSL_DEBUG_TOOL_INTERFACE],[yes]) + else + AC_SUBST([DSL_DEBUG_TOOL_INTERFACE],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_DSL_DEBUG_TOOL_INTERFACE" = yes; then + AC_DEFINE(DSL_DEBUG_TOOL_INTERFACE,,[Include DSL TCP debug support]) + AM_CONDITIONAL(DSL_DEBUG_TOOL_INTERFACE, true) + AC_SUBST([DSL_DEBUG_TOOL_INTERFACE],[yes]) + else + AC_SUBST([DSL_DEBUG_TOOL_INTERFACE],[no]) + fi + ] +) + +dnl enable Debug and Trace Interface support +AM_CONDITIONAL(INCLUDE_DSL_CPE_DTI_SUPPORT, false) +AC_ARG_ENABLE(dti, + AC_HELP_STRING( + [--enable-dti],[Include DTI support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_DTI_SUPPORT,,[Include DTI support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_DTI_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_DTI_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_DTI_SUPPORT],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_DTI_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_DTI_SUPPORT,,[Include DTI support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_DTI_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_DTI_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_DTI_SUPPORT],[no]) + fi + ] +) + +dnl set Debug and Trace Interface (DTI) include path +DEFAULT_DTI_INCL_PATH='' +AC_ARG_ENABLE(dti-include, + AS_HELP_STRING( + [--enable-dti-include= -I/path/to/your/DTI/include],[Set the DTI include path] + ), + [ + if test -n "$enableval"; then + echo Set the dti_agent include path to $enableval + AC_SUBST([DTI_INCL_PATH],[$enableval]) + else + echo Set the dti_agent include path to $DEFAULT_DTI_INCL_PATH + AC_SUBST([DTI_INCL_PATH],[$DEFAULT_DTI_INCL_PATH]) + fi + ], + [ + if test "$INCLUDE_DSL_CPE_DTI_SUPPORT" = yes; then + AC_MSG_WARN([Please provide include path to DTI Agent!]) + fi + ] +) + +dnl set DTI agent library path +DEFAULT_DTI_LIBRARY_PATH='' +AC_ARG_ENABLE(dti-library, + AS_HELP_STRING([--enable-dti-library= -L/path/to/your/DTI/library], + [Set the DTI library path. In this location the libdti_agent.a should be found] + ), + [ + if test -n "$enableval"; then + echo Set the libdti_agent.a library path to $enableval + AC_SUBST([DTI_LIBRARY_PATH],[$enableval]) + else + echo Set the libdti_agent.a library path $DEFAULT_DTI_LIBRARY_PATH + AC_SUBST([DTI_LIBRARY_PATH],[$DEFAULT_DTI_LIBRARY_PATH]) + fi + ], + [ + if test "$INCLUDE_DSL_CPE_DTI_SUPPORT" = yes; then + AC_MSG_WARN([Please provide the path to libdti_agent.a, otherwise linking might not work!]) + fi + ] +) + +dnl enable Pilot Tones Status support +AM_CONDITIONAL(INCLUDE_PILOT_TONES_STATUS, false) +AC_ARG_ENABLE(pilot-tones-status, + AC_HELP_STRING( + [--enable-pilot-tones-status],[Pilot Tones Status support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_PILOT_TONES_STATUS,,[Pilot Tones Status support]) + AM_CONDITIONAL(INCLUDE_PILOT_TONES_STATUS, true) + AC_SUBST([INCLUDE_PILOT_TONES_STATUS],[yes]) + else + AC_SUBST([INCLUDE_PILOT_TONES_STATUS],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_PILOT_TONES_STATUS" = yes; then + AC_DEFINE(INCLUDE_PILOT_TONES_STATUS,,[Pilot Tones Status support]) + AM_CONDITIONAL(INCLUDE_PILOT_TONES_STATUS, true) + AC_SUBST([INCLUDE_PILOT_TONES_STATUS],[yes]) + else + AC_SUBST([INCLUDE_PILOT_TONES_STATUS],[no]) + fi + ] +) + +dnl enable DSL CEOC support +AM_CONDITIONAL(INCLUDE_DSL_CEOC, false) +AC_ARG_ENABLE(dsl-ceoc, + AC_HELP_STRING( + [--enable-dsl-ceoc],[Include DSL CEOC support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CEOC,,[Include DSL CEOC support]) + AM_CONDITIONAL(INCLUDE_DSL_CEOC, true) + AC_SUBST([INCLUDE_DSL_CEOC],[yes]) + else + AC_SUBST([INCLUDE_DSL_CEOC],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CEOC" = yes; then + AC_DEFINE(INCLUDE_DSL_CEOC,,[Include DSL CEOC support]) + AM_CONDITIONAL(INCLUDE_DSL_CEOC, true) + AC_SUBST([INCLUDE_DSL_CEOC],[yes]) + else + AC_SUBST([INCLUDE_DSL_CEOC],[no]) + fi + ] +) + +dnl enable DSL RTT support +AM_CONDITIONAL(INCLUDE_REAL_TIME_TRACE, false) +AC_ARG_ENABLE(real-time-trace, + AC_HELP_STRING( + [--enable-real-time-trace],[Include DSL RTT support] + ), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_REAL_TIME_TRACE,,[Include DSL RTT support]) + AM_CONDITIONAL(INCLUDE_REAL_TIME_TRACE, true) + AC_SUBST([INCLUDE_REAL_TIME_TRACE],[yes]) + else + AC_SUBST([INCLUDE_REAL_TIME_TRACE],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_REAL_TIME_TRACE_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_REAL_TIME_TRACE,,[Include DSL RTT support]) + AM_CONDITIONAL(INCLUDE_REAL_TIME_TRACE, true) + AC_SUBST([INCLUDE_REAL_TIME_TRACE],[yes]) + else + AC_SUBST([INCLUDE_REAL_TIME_TRACE],[no]) + fi + ] +) + +dnl enable Debug Logger support +AM_CONDITIONAL(INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT, false) +AC_ARG_ENABLE(debug-logger-support, + AC_HELP_STRING([--enable-debug-logger-support=x],[Enable debug logger support]), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT,,[Enable debug logger support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT,,[Enable debug logger support]) + AM_CONDITIONAL(INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT, true) + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT],[no]) + fi + ] +) + +dnl set the ID of netlink debug messages channel +AC_ARG_WITH(dbg-netlink-id, + AC_HELP_STRING([--with-dbg-netlink-id=value],[Debug netlink ID number.]), + [ + + if test -n $withval; then + AC_DEFINE_UNQUOTED(DSL_DBG_MSG_NETLINK_ID,$withval,[Debug netlink ID number.]) + AC_SUBST([DSL_DBG_MSG_NETLINK_ID],[$withval]) + fi + ] +) + +dnl enable DTI stand-alone agent support +AM_CONDITIONAL(INCLUDE_DTI_AGENT_STANDALONE_SUPPORT, false) +AC_ARG_ENABLE(dti-agent-st-alone-support, + AC_HELP_STRING([--enable-dti-agent-st-alone-support=x],[Enable debug logger support]), + [ + if test "$enableval" = yes; then + AC_DEFINE(INCLUDE_DTI_AGENT_STANDALONE_SUPPORT,,[Enable DTI stand-alone agent support]) + AM_CONDITIONAL(INCLUDE_DTI_AGENT_STANDALONE_SUPPORT, true) + AC_SUBST([INCLUDE_DTI_AGENT_STANDALONE_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DTI_AGENT_STANDALONE_SUPPORT],[no]) + fi + ], + [ + if test "$PREDEFINED_CONF_INCLUDE_DTI_AGENT_STANDALONE_SUPPORT" = yes; then + AC_DEFINE(INCLUDE_DTI_AGENT_STANDALONE_SUPPORT,,[Enable DTI stand-alone agent support]) + AM_CONDITIONAL(INCLUDE_DTI_AGENT_STANDALONE_SUPPORT, true) + AC_SUBST([INCLUDE_DTI_AGENT_STANDALONE_SUPPORT],[yes]) + else + AC_SUBST([INCLUDE_DTI_AGENT_STANDALONE_SUPPORT],[no]) + fi + ] +) + +dnl enable SAFE C support +AM_CONDITIONAL(SAFEC_SUPPORT, false) +AC_SUBST([SAFEC_SUPPORT],[no]) +AC_ARG_ENABLE(safec-support, + AC_HELP_STRING([--enable-safec-support=x],[Enable SAFE C support]), + [ + if test "$enableval" = yes; then + AC_CHECK_HEADERS([safe_lib.h],[safec_header_support=yes; break;],,) + AC_SUBST([SAFEC_LIB_NAME],[safec-1.0]) + AC_SUBST([SAFEC_LIB_FUNC],[strcat_s]) + AC_CHECK_LIB($SAFEC_LIB_NAME, $SAFEC_LIB_FUNC,[safec_lib_support=yes; break;],,,) + + if test "x$safec_header_support" = "xyes"; then + if test "x$safec_lib_support" = "xyes"; then + AC_DEFINE([SAFEC_SUPPORT], [1], [Safe-C supported]) + AM_CONDITIONAL(SAFEC_SUPPORT, true) + AC_SUBST([SAFEC_SUPPORT],[yes]) + fi + fi + fi + ], +) + +dnl set system SAFE C include path +DEFAULT_SAFEC_INCL_PATH='' +AC_ARG_ENABLE(safec-include, + AS_HELP_STRING( + [--enable-safec-include= -I./STAGING_DIR/usr/include],[Set the SAFE C include path] + ), + [ + if test -n "$enableval"; then + echo Set the SAFE C include path to $enableval + AC_SUBST([SAFEC_INCL_PATH],[$enableval]) + + else + AC_SUBST([SAFEC_INCL_PATH],[$DEFAULT_SAFEC_INCL_PATH]) + fi + ], + [ + AC_SUBST([SAFEC_INCL_PATH],[$DEFAULT_SAFEC_INCL_PATH]) + ] +) + +dnl set system SAFE C library path +DEFAULT_SAFEC_LIB_PATH='' +AC_ARG_ENABLE(safec-library, + AS_HELP_STRING( + [--enable-safec-library= -L./STAGING_DIR/usr/lib],[Set the SAFE C + library path] + ), + [ + if test -n "$enableval"; then + echo Set the SAFE C library path to $enableval + AC_SUBST([SAFEC_LIB_PATH],[$enableval]) + + else + AC_SUBST([SAFEC_LIB_PATH],[$DEFAULT_SAFEC_LIB_PATH]) + fi + ], + [ + AC_SUBST([SAFEC_LIB_PATH],[$DEFAULT_SAFEC_LIB_PATH]) + ] +) + + +dnl Set the configure params for dist check + +AC_SUBST([DISTCHECK_CONFIGURE_PARAMS],[$CONFIGURE_OPTIONS]) + +AC_CONFIG_COMMANDS_PRE([ +echo -e "------------------------------------------------------------------------" +echo -e " Configuration for dsl_cpe_control:" +echo -e " DSL device: $DSL_DEVICE_NAME" +if test -z "${DEVICE_VRX_TRUE}"; then + echo -e " DSL VRX device type: $DSL_VRX_DEVICE_NAME" +fi +echo -e " Configure model type: $DSL_CONFIG_MODEL_TYPE" +echo -e " Source code location: $srcdir" +echo -e " Compiler: $CC" +echo -e " Compiler c-flags: $CFLAGS" +echo -e " Extra compiler c-flags: $EXTRA_APP_CFLAGS" +echo -e " External compiler c-flags : $DSL_ADD_EXT_APPL_CFLAGS" +echo -e " Host System Type: $host" +echo -e " Install path: $prefix" +echo -e " Driver Include Path: $DSL_DRIVER_INCL_PATH" +echo -e " Device Driver Include Path: $DSL_DEVICE_DRIVER_INCL_PATH" +echo -e " Include IFXOS: $INCLUDE_DSL_CPE_IFXOS_SUPPORT" +echo -e " IFXOS library path: $IFXOS_LIBRARY_PATH" +echo -e " IFXOS include path: $IFXOS_INCLUDE_PATH" +echo -e " Include DTI: $INCLUDE_DSL_CPE_DTI_SUPPORT" +echo -e " DTI include path: $DTI_INCL_PATH" +echo -e " DTI library path: $DTI_LIBRARY_PATH" +echo -e " Disable debug prints: $DSL_CPE_DEBUG_DISABLE" +echo -e " Preselection of max. debug level: $DSL_CCA_DBG_MAX_LEVEL_SET" +echo -e " Preselected max. debug level: $DSL_CCA_DBG_MAX_LEVEL_PRE" +echo -e " Enable static build: $DSL_CPE_STATIC_LINKING" +echo -e " Include Event Polling support: $INCLUDE_DSL_EVENT_POLLING" +echo -e " Include deprecated functions: $INCLUDE_DEPRECATED" +echo -e " Include Device Exception Codes: $INCLUDE_DEVICE_EXCEPTION_CODES" +echo -e " Include FW request support: $INCLUDE_FW_REQUEST_SUPPORT" +echo -e " Include trace buffer support: $INCLUDE_DSL_CPE_TRACE_BUFFER" +echo -e " Include Filesystem: $INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT" +echo -e " Include CMV scripts: $INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT" +echo -e " Include CMV scripts math: $INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH" +echo -e " Include scripts notification: $INCLUDE_SCRIPT_NOTIFICATION" +echo -e " Include CLI: $INCLUDE_DSL_CPE_CLI_SUPPORT" +echo -e " Include Autogen CLI: $INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT" +echo -e " Include MIB: $INCLUDE_DSL_ADSL_MIB" +echo -e " Include CEOC: $INCLUDE_DSL_CEOC" +echo -e " Include config. get support: $INCLUDE_DSL_CONFIG_GET" +echo -e " Include System i/f configuration: $INCLUDE_DSL_SYSTEM_INTERFACE" +echo -e " Include Resource Statistics: $INCLUDE_DSL_RESOURCE_STATISTICS" +echo -e " Include Framing Parameters: $INCLUDE_DSL_FRAMING_PARAMETERS" +echo -e " Include G997 Line Inventory: $INCLUDE_DSL_G997_LINE_INVENTORY" +echo -e " Include G997 Framing Parameters: $INCLUDE_DSL_G997_FRAMING_PARAMETERS" +echo -e " Include G997 per tone data: $INCLUDE_DSL_G997_PER_TONE" +echo -e " Include G997 status: $INCLUDE_DSL_G997_STATUS" +echo -e " Include G997 alarm: $INCLUDE_DSL_G997_ALARM" +echo -e " Include Pilot Tones Status: $INCLUDE_PILOT_TONES_STATUS" +echo -e " Include Misc Line Status: $INCLUDE_DSL_CPE_MISC_LINE_STATUS" +echo -e " Include DELT: $INCLUDE_DSL_DELT" +echo -e " Include Filter Detection: $INCLUDE_DSL_FILTER_DETECTION" +echo -e " Include PM: $INCLUDE_DSL_PM" +echo -e " Include PM config: $INCLUDE_DSL_CPE_PM_CONFIG" +echo -e " Include PM total: $INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS" +echo -e " Include PM history: $INCLUDE_DSL_CPE_PM_HISTORY" +echo -e " Include PM showtime: $INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS" +echo -e " Include PM optional: $INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS" +echo -e " Include PM line: $INCLUDE_DSL_CPE_PM_LINE_COUNTERS" +echo -e " Include PM line event showtime: $INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS" +echo -e " Include PM channel: $INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS" +echo -e " Include PM channel extended: $INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS" +echo -e " Include PM data path: $INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS" +echo -e " Include PM data path failure: $INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS" +echo -e " Include PM ReTx: $INCLUDE_DSL_CPE_PM_RETX_COUNTERS" +echo -e " Include PM line threshold: $INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS" +echo -e " Include PM channel threshold: $INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS" +echo -e " Include PM data path threshold: $INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS" +echo -e " Include PM ReTx threshold: $INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS" +echo -e " Include TCP debug support: $DSL_DEBUG_TOOL_INTERFACE" +echo -e " Include real time trace support: $INCLUDE_REAL_TIME_TRACE" +echo -e " Include debug logger support: $INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT" +echo -e " Netlink ID of the debug messages: $DSL_DBG_MSG_NETLINK_ID" +echo -e " Include DTI agent stand-alone: $INCLUDE_DTI_AGENT_STANDALONE_SUPPORT" +echo -e " Safe-C support: $SAFEC_SUPPORT" +echo -e " Safe-C include path: $SAFEC_INCL_PATH" +echo -e " Safe-C library path: $SAFEC_LIB_PATH" +echo -e " Safe-C library: $SAFEC_LIB_NAME" +echo -e "----------------------- deprectated ! ----------------------------------" +echo -e " currently no such functions" +echo -e "------------------------------------------------------------------------" +echo -e " Settings:" +echo -e " Configure options: $CONFIGURE_OPTIONS" +echo -e "------------------------------------------------------------------------" +]) + +AC_CONFIG_FILES([Makefile src/Makefile tools/pipe/Makefile]) +AC_OUTPUT diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..fc98710 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..0b0fdcb --- /dev/null +++ b/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2013-12-25.23; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/missing b/missing new file mode 100755 index 0000000..f62bbae --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/scripts/alias_dsl_cpe.sh b/scripts/alias_dsl_cpe.sh new file mode 100644 index 0000000..f032366 --- /dev/null +++ b/scripts/alias_dsl_cpe.sh @@ -0,0 +1,19 @@ +# +# alias definitions for the "DSL CPE Control Application" +# to simplify the usage of the pipe interface +# + +echo ... run alias defs for dsl_cpe_control application + +if [ "$DSL_CPE_DIR" = "" ]; then + DSL_CPE_DIR="/opt/ifx" +fi + +# main alias to send commands +alias cpe="$DSL_CPE_DIR/dsl_cpe_pipe.sh" + +# definitions for message-dumps and events +alias cpe_log_dump_cout='tail -f /tmp/pipe/dsl_cpe0_dump &' +alias cpe_log_dump='tail -f /tmp/pipe/dsl_cpe0_dump > dump.txt &' +alias cpe_log_event_cout='tail -f /tmp/pipe/dsl_cpe0_event &' +alias cpe_log_event='tail -f /tmp/pipe/dsl_cpe0_event > event.txt &' diff --git a/scripts/dsl_cpe_pipe.sh b/scripts/dsl_cpe_pipe.sh new file mode 100755 index 0000000..2de6072 --- /dev/null +++ b/scripts/dsl_cpe_pipe.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +pipe_no=0 + +# use specified pipe no +case "$1" in + 0|1|2) + pipe_no=$1; shift; ;; +esac + + +#echo "Call dsl_pipe with $*" +echo $* > /tmp/pipe/dsl_cpe${pipe_no}_cmd +result=`cat /tmp/pipe/dsl_cpe${pipe_no}_ack` + +echo "$result" + + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..2e92490 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,207 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = dsl_cpe_control + +AM_CPPFLAGS = -I@srcdir@ @DSL_DRIVER_INCL_PATH@ @DSL_DEVICE_DRIVER_INCL_PATH@ @IFXOS_INCLUDE_PATH@ @DTI_INCL_PATH@ + + +if DSL_CPE_STATIC_LINKING +dsl_cpe_control_common_ldflags = -static +else +dsl_cpe_control_common_ldflags = +endif + +dsl_cpe_control_LDADD = -lpthread -lrt + +if INCLUDE_DSL_CPE_DTI_SUPPORT + dsl_cpe_control_LDADD += -ldti_agent + dsl_cpe_control_LDADD += -lifxos +endif + +if INCLUDE_DSL_CPE_IFXOS_SUPPORT + dsl_cpe_control_LDADD += -lifxos +endif + +if SAFEC_SUPPORT +AM_CPPFLAGS += @SAFEC_INCL_PATH@ +dsl_cpe_control_LDADD += -l@SAFEC_LIB_NAME@ +endif + +bin_SCRIPTS = ../scripts/alias_dsl_cpe.sh + +if DEVICE_VRX +dsl_cpe_control_bnd_sources = \ + dsl_cpe_bnd_vrx.c +endif + +dsl_cpe_control_cli_sources = \ + dsl_cpe_cli.c \ + dsl_cpe_cli_pipe.c \ + dsl_cpe_cli_access.c \ + dsl_cpe_cli_console.c + +dsl_cpe_control_cli_autogen_sources = \ + dsl_cpe_cli_access2.c \ + dsl_cpe_cli_autogen.c + +dsl_cpe_control_cli_danube_sources = \ + dsl_cpe_cli_danube.c \ + dsl_cpe_cli_mib.c + +dsl_cpe_control_cli_vrx_sources = \ + dsl_cpe_cli_vrx.c + +dsl_cpe_control_debug_danube_sources = \ + dsl_cpe_debug_danube.c + +dsl_cpe_control_debug_vrx_sources = \ + dsl_cpe_debug_vrx.c + +if INCLUDE_DSL_CPE_DTI_SUPPORT +dsl_cpe_control_dti_sources = \ + dsl_cpe_dti.c \ + dsl_cpe_dti_vrx.c +else +dsl_cpe_control_dti_sources = +endif + +dsl_cpe_control_SOURCES = \ + dsl_cpe_control.c \ + dsl_cpe_init_cfg.c \ + dsl_cpe_linux.c \ + dsl_cpe_debug.c + +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_dti_sources) + +if DEVICE_DANUBE +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_debug_danube_sources) +endif + +if DEVICE_VRX_LAYER +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_debug_vrx_sources) +endif + +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_bnd_sources) + +if INCLUDE_DSL_CPE_CLI_SUPPORT +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_cli_sources) + +if INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_cli_autogen_sources) +endif + +if DEVICE_DANUBE +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_cli_danube_sources) +endif + +if DEVICE_VRX +dsl_cpe_control_SOURCES += \ + $(dsl_cpe_control_cli_vrx_sources) +endif +endif + + +EXTRA_DIST = \ + ../LICENSE \ + $(dsl_cpe_control_bnd_sources) \ + $(dsl_cpe_control_cli_sources) \ + $(dsl_cpe_control_dti_sources) \ + $(dsl_cpe_control_cli_danube_sources) \ + $(dsl_cpe_control_cli_vrx_sources) \ + $(dsl_cpe_control_debug_danube_sources) \ + $(dsl_cpe_control_debug_vrx_sources) \ + dsl_cpe_control.h \ + dsl_cpe_init_cfg.h \ + dsl_cpe_cli.h \ + dsl_cpe_dti.h \ + dsl_cpe_dti_vrx_ctx.h \ + dsl_cpe_bnd_vrx.h \ + dsl_cpe_cli_console.h \ + dsl_cpe_simulator.c \ + dsl_cpe_simulator.h \ + dsl_cpe_win32.c \ + dsl_cpe_win32.h \ + dsl_cpe_os.h \ + dsl_cpe_os_lint_map.h \ + dsl_cpe_linux.h \ + dsl_cpe_vxworks.c \ + dsl_cpe_vxworks.h \ + dsl_cpe_rtems.c \ + dsl_cpe_rtems.h \ + dsl_cpe_debug.h \ + dsl_cpe_debug_danube.h \ + dsl_cpe_debug_vrx.h \ + ../scripts/alias_dsl_cpe.sh \ + ../scripts/dsl_cpe_pipe.sh \ + ../tools/pipe/dsl_pipe_client.h \ + dsl_cpe_safec_wrapper.h + +if ADD_APPL_CFLAGS_SET +dsl_cpe_control_cflags = $(ADD_APPL_CFLAGS) +else +dsl_cpe_control_cflags = +endif + +if ADD_APPL_LDFLAGS_SET +dsl_cpe_control_ldflags = $(ADD_APPL_LDFLAGS) +else +dsl_cpe_control_ldflags = +endif + +if INCLUDE_DSL_CPE_IFXOS_SUPPORT +dsl_cpe_control_ifxos_ldflags = @IFXOS_LIBRARY_PATH@ +else +dsl_cpe_control_ifxos_ldflags = +endif + +if INCLUDE_DSL_CPE_DTI_SUPPORT +dsl_cpe_control_dti_ldflags = @DTI_LIBRARY_PATH@ +else +dsl_cpe_control_dti_ldflags = +endif + +if SAFEC_SUPPORT +dsl_cpe_control_safec_ldflags = @SAFEC_LIB_PATH@ +else +dsl_cpe_control_safec_ldflags = +endif + +dsl_cpe_control_common_cflags = -Wall -Wimplicit -Wreturn-type -Wunused -Wundef \ + -Wswitch -Wno-format -Wcomment -Wuninitialized -DLINUX -g3 + +# compile cflags +dsl_cpe_control_compile_cflags = $(EXTRA_APP_CFLAGS) + +if DSL_CCA_DBG_MAX_LEVEL_SET +dsl_cpe_control_common_cflags += -DDSL_CCA_DBG_MAX_LEVEL=$(DSL_CCA_DBG_MAX_LEVEL_PRE) +endif + +if CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS +dsl_cpe_control_external_cflags= $(DSL_ADD_EXT_APPL_CFLAGS) +endif + +dsl_cpe_control_CFLAGS = $(dsl_cpe_control_common_cflags) \ + $(dsl_cpe_control_cflags) \ + $(dsl_cpe_control_compile_cflags) \ + $(dsl_cpe_control_external_cflags) + +dsl_cpe_control_LDFLAGS = $(dsl_cpe_control_common_ldflags) \ + $(dsl_cpe_control_ldflags) \ + $(dsl_cpe_control_compile_cflags) \ + $(dsl_cpe_control_ifxos_ldflags) \ + $(dsl_cpe_control_dti_ldflags) \ + $(dsl_cpe_control_safec_ldflags) + + +lint: + @flint +b -vm \ + -i$(shell dirname `$(CC) -print-file-name=include`)/include \ + -i@top_srcdir@ std_lx.lnt env-cw6.lnt -i@srcdir@ \ + $(DEFS) $(AM_CPPFLAGS) $(CFLAGS) -D__LINUX__ -DLINUX $(dsl_cpe_control_SOURCES) diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..cde9594 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,1163 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = dsl_cpe_control$(EXEEXT) +@INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE@am__append_1 = -ldti_agent -lifxos +@INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE@am__append_2 = -lifxos +@SAFEC_SUPPORT_TRUE@am__append_3 = @SAFEC_INCL_PATH@ +@SAFEC_SUPPORT_TRUE@am__append_4 = -l@SAFEC_LIB_NAME@ +@DEVICE_DANUBE_TRUE@am__append_5 = \ +@DEVICE_DANUBE_TRUE@ $(dsl_cpe_control_debug_danube_sources) + +@DEVICE_VRX_LAYER_TRUE@am__append_6 = \ +@DEVICE_VRX_LAYER_TRUE@ $(dsl_cpe_control_debug_vrx_sources) + +@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__append_7 = \ +@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@ $(dsl_cpe_control_cli_sources) + +@INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__append_8 = \ +@INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@ $(dsl_cpe_control_cli_autogen_sources) + +@DEVICE_DANUBE_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__append_9 = \ +@DEVICE_DANUBE_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@ $(dsl_cpe_control_cli_danube_sources) + +@DEVICE_VRX_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__append_10 = \ +@DEVICE_VRX_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@ $(dsl_cpe_control_cli_vrx_sources) + +@DSL_CCA_DBG_MAX_LEVEL_SET_TRUE@am__append_11 = -DDSL_CCA_DBG_MAX_LEVEL=$(DSL_CCA_DBG_MAX_LEVEL_PRE) +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = dsl_cpe_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am__dsl_cpe_control_SOURCES_DIST = dsl_cpe_control.c \ + dsl_cpe_init_cfg.c dsl_cpe_linux.c dsl_cpe_debug.c \ + dsl_cpe_dti.c dsl_cpe_dti_vrx.c dsl_cpe_debug_danube.c \ + dsl_cpe_debug_vrx.c dsl_cpe_bnd_vrx.c dsl_cpe_cli.c \ + dsl_cpe_cli_pipe.c dsl_cpe_cli_access.c dsl_cpe_cli_console.c \ + dsl_cpe_cli_access2.c dsl_cpe_cli_autogen.c \ + dsl_cpe_cli_danube.c dsl_cpe_cli_mib.c dsl_cpe_cli_vrx.c +@INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE@am__objects_1 = dsl_cpe_control-dsl_cpe_dti.$(OBJEXT) \ +@INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE@ dsl_cpe_control-dsl_cpe_dti_vrx.$(OBJEXT) +am__objects_2 = dsl_cpe_control-dsl_cpe_debug_danube.$(OBJEXT) +@DEVICE_DANUBE_TRUE@am__objects_3 = $(am__objects_2) +am__objects_4 = dsl_cpe_control-dsl_cpe_debug_vrx.$(OBJEXT) +@DEVICE_VRX_LAYER_TRUE@am__objects_5 = $(am__objects_4) +@DEVICE_VRX_TRUE@am__objects_6 = \ +@DEVICE_VRX_TRUE@ dsl_cpe_control-dsl_cpe_bnd_vrx.$(OBJEXT) +am__objects_7 = dsl_cpe_control-dsl_cpe_cli.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_cli_pipe.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_cli_access.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_cli_console.$(OBJEXT) +@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__objects_8 = $(am__objects_7) +am__objects_9 = dsl_cpe_control-dsl_cpe_cli_access2.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_cli_autogen.$(OBJEXT) +@INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__objects_10 = $(am__objects_9) +am__objects_11 = dsl_cpe_control-dsl_cpe_cli_danube.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_cli_mib.$(OBJEXT) +@DEVICE_DANUBE_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__objects_12 = $(am__objects_11) +am__objects_13 = dsl_cpe_control-dsl_cpe_cli_vrx.$(OBJEXT) +@DEVICE_VRX_TRUE@@INCLUDE_DSL_CPE_CLI_SUPPORT_TRUE@am__objects_14 = $(am__objects_13) +am_dsl_cpe_control_OBJECTS = \ + dsl_cpe_control-dsl_cpe_control.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_init_cfg.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_linux.$(OBJEXT) \ + dsl_cpe_control-dsl_cpe_debug.$(OBJEXT) $(am__objects_1) \ + $(am__objects_3) $(am__objects_5) $(am__objects_6) \ + $(am__objects_8) $(am__objects_10) $(am__objects_12) \ + $(am__objects_14) +dsl_cpe_control_OBJECTS = $(am_dsl_cpe_control_OBJECTS) +am__DEPENDENCIES_1 = +dsl_cpe_control_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +dsl_cpe_control_LINK = $(CCLD) $(dsl_cpe_control_CFLAGS) $(CFLAGS) \ + $(dsl_cpe_control_LDFLAGS) $(LDFLAGS) -o $@ +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +SCRIPTS = $(bin_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(dsl_cpe_control_SOURCES) +DIST_SOURCES = $(am__dsl_cpe_control_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)dsl_cpe_config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/dsl_cpe_config.h.in \ + $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADD_APPL_CFLAGS = @ADD_APPL_CFLAGS@ +ADD_APPL_LDFLAGS = @ADD_APPL_LDFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTCHECK_CONFIGURE_PARAMS = @DISTCHECK_CONFIGURE_PARAMS@ +DSL_ADD_EXT_APPL_CFLAGS = @DSL_ADD_EXT_APPL_CFLAGS@ +DSL_CCA_DBG_MAX_LEVEL_PRE = @DSL_CCA_DBG_MAX_LEVEL_PRE@ +DSL_CCA_DBG_MAX_LEVEL_SET = @DSL_CCA_DBG_MAX_LEVEL_SET@ +DSL_CONFIG_MODEL_TYPE = @DSL_CONFIG_MODEL_TYPE@ +DSL_CPE_DEBUG_DISABLE = @DSL_CPE_DEBUG_DISABLE@ +DSL_DBG_MSG_NETLINK_ID = @DSL_DBG_MSG_NETLINK_ID@ +DSL_DEBUG_TOOL_INTERFACE = @DSL_DEBUG_TOOL_INTERFACE@ +DSL_DEVICE_DRIVER_INCL_PATH = @DSL_DEVICE_DRIVER_INCL_PATH@ +DSL_DEVICE_NAME = @DSL_DEVICE_NAME@ +DSL_DRIVER_INCL_PATH = @DSL_DRIVER_INCL_PATH@ +DSL_VRX_DEVICE_NAME = @DSL_VRX_DEVICE_NAME@ +DTI_INCL_PATH = @DTI_INCL_PATH@ +DTI_LIBRARY_PATH = @DTI_LIBRARY_PATH@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTRA_APP_CFLAGS = @EXTRA_APP_CFLAGS@ +GREP = @GREP@ +IFXOS_INCLUDE_PATH = @IFXOS_INCLUDE_PATH@ +IFXOS_LIBRARY_PATH = @IFXOS_LIBRARY_PATH@ +INCLUDE_DEPRECATED = @INCLUDE_DEPRECATED@ +INCLUDE_DEVICE_EXCEPTION_CODES = @INCLUDE_DEVICE_EXCEPTION_CODES@ +INCLUDE_DSL_ADSL_MIB = @INCLUDE_DSL_ADSL_MIB@ +INCLUDE_DSL_CEOC = @INCLUDE_DSL_CEOC@ +INCLUDE_DSL_CONFIG_GET = @INCLUDE_DSL_CONFIG_GET@ +INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT = @INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT@ +INCLUDE_DSL_CPE_CLI_SUPPORT = @INCLUDE_DSL_CPE_CLI_SUPPORT@ +INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH = @INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH@ +INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT = @INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT@ +INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT = @INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT@ +INCLUDE_DSL_CPE_DTI_SUPPORT = @INCLUDE_DSL_CPE_DTI_SUPPORT@ +INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT = @INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT@ +INCLUDE_DSL_CPE_IFXOS_SUPPORT = @INCLUDE_DSL_CPE_IFXOS_SUPPORT@ +INCLUDE_DSL_CPE_MISC_LINE_STATUS = @INCLUDE_DSL_CPE_MISC_LINE_STATUS@ +INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS@ +INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS@ +INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS = @INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_CONFIG = @INCLUDE_DSL_CPE_PM_CONFIG@ +INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS@ +INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS@ +INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS = @INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_HISTORY = @INCLUDE_DSL_CPE_PM_HISTORY@ +INCLUDE_DSL_CPE_PM_LINE_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_COUNTERS@ +INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS@ +INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS = @INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS = @INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS@ +INCLUDE_DSL_CPE_PM_RETX_COUNTERS = @INCLUDE_DSL_CPE_PM_RETX_COUNTERS@ +INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS = @INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS@ +INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS = @INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS@ +INCLUDE_DSL_CPE_TRACE_BUFFER = @INCLUDE_DSL_CPE_TRACE_BUFFER@ +INCLUDE_DSL_DELT = @INCLUDE_DSL_DELT@ +INCLUDE_DSL_EVENT_POLLING = @INCLUDE_DSL_EVENT_POLLING@ +INCLUDE_DSL_FILTER_DETECTION = @INCLUDE_DSL_FILTER_DETECTION@ +INCLUDE_DSL_FRAMING_PARAMETERS = @INCLUDE_DSL_FRAMING_PARAMETERS@ +INCLUDE_DSL_G997_ALARM = @INCLUDE_DSL_G997_ALARM@ +INCLUDE_DSL_G997_FRAMING_PARAMETERS = @INCLUDE_DSL_G997_FRAMING_PARAMETERS@ +INCLUDE_DSL_G997_LINE_INVENTORY = @INCLUDE_DSL_G997_LINE_INVENTORY@ +INCLUDE_DSL_G997_PER_TONE = @INCLUDE_DSL_G997_PER_TONE@ +INCLUDE_DSL_G997_STATUS = @INCLUDE_DSL_G997_STATUS@ +INCLUDE_DSL_PM = @INCLUDE_DSL_PM@ +INCLUDE_DSL_RESOURCE_STATISTICS = @INCLUDE_DSL_RESOURCE_STATISTICS@ +INCLUDE_DSL_SYSTEM_INTERFACE = @INCLUDE_DSL_SYSTEM_INTERFACE@ +INCLUDE_DTI_AGENT_STANDALONE_SUPPORT = @INCLUDE_DTI_AGENT_STANDALONE_SUPPORT@ +INCLUDE_FW_REQUEST_SUPPORT = @INCLUDE_FW_REQUEST_SUPPORT@ +INCLUDE_PILOT_TONES_STATUS = @INCLUDE_PILOT_TONES_STATUS@ +INCLUDE_REAL_TIME_TRACE = @INCLUDE_REAL_TIME_TRACE@ +INCLUDE_SCRIPT_NOTIFICATION = @INCLUDE_SCRIPT_NOTIFICATION@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SAFEC_INCL_PATH = @SAFEC_INCL_PATH@ +SAFEC_LIB_FUNC = @SAFEC_LIB_FUNC@ +SAFEC_LIB_NAME = @SAFEC_LIB_NAME@ +SAFEC_LIB_PATH = @SAFEC_LIB_PATH@ +SAFEC_SUPPORT = @SAFEC_SUPPORT@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -I@srcdir@ @DSL_DRIVER_INCL_PATH@ \ + @DSL_DEVICE_DRIVER_INCL_PATH@ @IFXOS_INCLUDE_PATH@ \ + @DTI_INCL_PATH@ $(am__append_3) +@DSL_CPE_STATIC_LINKING_FALSE@dsl_cpe_control_common_ldflags = +@DSL_CPE_STATIC_LINKING_TRUE@dsl_cpe_control_common_ldflags = -static +dsl_cpe_control_LDADD = -lpthread -lrt $(am__append_1) $(am__append_2) \ + $(am__append_4) +bin_SCRIPTS = ../scripts/alias_dsl_cpe.sh +@DEVICE_VRX_TRUE@dsl_cpe_control_bnd_sources = \ +@DEVICE_VRX_TRUE@ dsl_cpe_bnd_vrx.c + +dsl_cpe_control_cli_sources = \ + dsl_cpe_cli.c \ + dsl_cpe_cli_pipe.c \ + dsl_cpe_cli_access.c \ + dsl_cpe_cli_console.c + +dsl_cpe_control_cli_autogen_sources = \ + dsl_cpe_cli_access2.c \ + dsl_cpe_cli_autogen.c + +dsl_cpe_control_cli_danube_sources = \ + dsl_cpe_cli_danube.c \ + dsl_cpe_cli_mib.c + +dsl_cpe_control_cli_vrx_sources = \ + dsl_cpe_cli_vrx.c + +dsl_cpe_control_debug_danube_sources = \ + dsl_cpe_debug_danube.c + +dsl_cpe_control_debug_vrx_sources = \ + dsl_cpe_debug_vrx.c + +@INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE@dsl_cpe_control_dti_sources = +@INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE@dsl_cpe_control_dti_sources = \ +@INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE@ dsl_cpe_dti.c \ +@INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE@ dsl_cpe_dti_vrx.c + +dsl_cpe_control_SOURCES = dsl_cpe_control.c dsl_cpe_init_cfg.c \ + dsl_cpe_linux.c dsl_cpe_debug.c $(dsl_cpe_control_dti_sources) \ + $(am__append_5) $(am__append_6) $(dsl_cpe_control_bnd_sources) \ + $(am__append_7) $(am__append_8) $(am__append_9) \ + $(am__append_10) +EXTRA_DIST = \ + ../LICENSE \ + $(dsl_cpe_control_bnd_sources) \ + $(dsl_cpe_control_cli_sources) \ + $(dsl_cpe_control_dti_sources) \ + $(dsl_cpe_control_cli_danube_sources) \ + $(dsl_cpe_control_cli_vrx_sources) \ + $(dsl_cpe_control_debug_danube_sources) \ + $(dsl_cpe_control_debug_vrx_sources) \ + dsl_cpe_control.h \ + dsl_cpe_init_cfg.h \ + dsl_cpe_cli.h \ + dsl_cpe_dti.h \ + dsl_cpe_dti_vrx_ctx.h \ + dsl_cpe_bnd_vrx.h \ + dsl_cpe_cli_console.h \ + dsl_cpe_simulator.c \ + dsl_cpe_simulator.h \ + dsl_cpe_win32.c \ + dsl_cpe_win32.h \ + dsl_cpe_os.h \ + dsl_cpe_os_lint_map.h \ + dsl_cpe_linux.h \ + dsl_cpe_vxworks.c \ + dsl_cpe_vxworks.h \ + dsl_cpe_rtems.c \ + dsl_cpe_rtems.h \ + dsl_cpe_debug.h \ + dsl_cpe_debug_danube.h \ + dsl_cpe_debug_vrx.h \ + ../scripts/alias_dsl_cpe.sh \ + ../scripts/dsl_cpe_pipe.sh \ + ../tools/pipe/dsl_pipe_client.h \ + dsl_cpe_safec_wrapper.h + +@ADD_APPL_CFLAGS_SET_FALSE@dsl_cpe_control_cflags = +@ADD_APPL_CFLAGS_SET_TRUE@dsl_cpe_control_cflags = $(ADD_APPL_CFLAGS) +@ADD_APPL_LDFLAGS_SET_FALSE@dsl_cpe_control_ldflags = +@ADD_APPL_LDFLAGS_SET_TRUE@dsl_cpe_control_ldflags = $(ADD_APPL_LDFLAGS) +@INCLUDE_DSL_CPE_IFXOS_SUPPORT_FALSE@dsl_cpe_control_ifxos_ldflags = +@INCLUDE_DSL_CPE_IFXOS_SUPPORT_TRUE@dsl_cpe_control_ifxos_ldflags = @IFXOS_LIBRARY_PATH@ +@INCLUDE_DSL_CPE_DTI_SUPPORT_FALSE@dsl_cpe_control_dti_ldflags = +@INCLUDE_DSL_CPE_DTI_SUPPORT_TRUE@dsl_cpe_control_dti_ldflags = @DTI_LIBRARY_PATH@ +@SAFEC_SUPPORT_FALSE@dsl_cpe_control_safec_ldflags = +@SAFEC_SUPPORT_TRUE@dsl_cpe_control_safec_ldflags = @SAFEC_LIB_PATH@ +dsl_cpe_control_common_cflags = -Wall -Wimplicit -Wreturn-type \ + -Wunused -Wundef -Wswitch -Wno-format -Wcomment \ + -Wuninitialized -DLINUX -g3 $(am__append_11) + +# compile cflags +dsl_cpe_control_compile_cflags = $(EXTRA_APP_CFLAGS) +@CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS_TRUE@dsl_cpe_control_external_cflags = $(DSL_ADD_EXT_APPL_CFLAGS) +dsl_cpe_control_CFLAGS = $(dsl_cpe_control_common_cflags) \ + $(dsl_cpe_control_cflags) \ + $(dsl_cpe_control_compile_cflags) \ + $(dsl_cpe_control_external_cflags) + +dsl_cpe_control_LDFLAGS = $(dsl_cpe_control_common_ldflags) \ + $(dsl_cpe_control_ldflags) \ + $(dsl_cpe_control_compile_cflags) \ + $(dsl_cpe_control_ifxos_ldflags) \ + $(dsl_cpe_control_dti_ldflags) \ + $(dsl_cpe_control_safec_ldflags) + +all: dsl_cpe_config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +dsl_cpe_config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/dsl_cpe_config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status src/dsl_cpe_config.h +$(srcdir)/dsl_cpe_config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f dsl_cpe_config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +dsl_cpe_control$(EXEEXT): $(dsl_cpe_control_OBJECTS) $(dsl_cpe_control_DEPENDENCIES) $(EXTRA_dsl_cpe_control_DEPENDENCIES) + @rm -f dsl_cpe_control$(EXEEXT) + $(AM_V_CCLD)$(dsl_cpe_control_LINK) $(dsl_cpe_control_OBJECTS) $(dsl_cpe_control_LDADD) $(LIBS) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_bnd_vrx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_autogen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_console.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_danube.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_mib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_pipe.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_vrx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_debug.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_danube.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_vrx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_dti.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_dti_vrx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_init_cfg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_control-dsl_cpe_linux.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +dsl_cpe_control-dsl_cpe_control.o: dsl_cpe_control.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_control.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_control.Tpo -c -o dsl_cpe_control-dsl_cpe_control.o `test -f 'dsl_cpe_control.c' || echo '$(srcdir)/'`dsl_cpe_control.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_control.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_control.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_control.c' object='dsl_cpe_control-dsl_cpe_control.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_control.o `test -f 'dsl_cpe_control.c' || echo '$(srcdir)/'`dsl_cpe_control.c + +dsl_cpe_control-dsl_cpe_control.obj: dsl_cpe_control.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_control.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_control.Tpo -c -o dsl_cpe_control-dsl_cpe_control.obj `if test -f 'dsl_cpe_control.c'; then $(CYGPATH_W) 'dsl_cpe_control.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_control.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_control.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_control.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_control.c' object='dsl_cpe_control-dsl_cpe_control.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_control.obj `if test -f 'dsl_cpe_control.c'; then $(CYGPATH_W) 'dsl_cpe_control.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_control.c'; fi` + +dsl_cpe_control-dsl_cpe_init_cfg.o: dsl_cpe_init_cfg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_init_cfg.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_init_cfg.Tpo -c -o dsl_cpe_control-dsl_cpe_init_cfg.o `test -f 'dsl_cpe_init_cfg.c' || echo '$(srcdir)/'`dsl_cpe_init_cfg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_init_cfg.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_init_cfg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_init_cfg.c' object='dsl_cpe_control-dsl_cpe_init_cfg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_init_cfg.o `test -f 'dsl_cpe_init_cfg.c' || echo '$(srcdir)/'`dsl_cpe_init_cfg.c + +dsl_cpe_control-dsl_cpe_init_cfg.obj: dsl_cpe_init_cfg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_init_cfg.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_init_cfg.Tpo -c -o dsl_cpe_control-dsl_cpe_init_cfg.obj `if test -f 'dsl_cpe_init_cfg.c'; then $(CYGPATH_W) 'dsl_cpe_init_cfg.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_init_cfg.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_init_cfg.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_init_cfg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_init_cfg.c' object='dsl_cpe_control-dsl_cpe_init_cfg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_init_cfg.obj `if test -f 'dsl_cpe_init_cfg.c'; then $(CYGPATH_W) 'dsl_cpe_init_cfg.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_init_cfg.c'; fi` + +dsl_cpe_control-dsl_cpe_linux.o: dsl_cpe_linux.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_linux.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_linux.Tpo -c -o dsl_cpe_control-dsl_cpe_linux.o `test -f 'dsl_cpe_linux.c' || echo '$(srcdir)/'`dsl_cpe_linux.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_linux.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_linux.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_linux.c' object='dsl_cpe_control-dsl_cpe_linux.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_linux.o `test -f 'dsl_cpe_linux.c' || echo '$(srcdir)/'`dsl_cpe_linux.c + +dsl_cpe_control-dsl_cpe_linux.obj: dsl_cpe_linux.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_linux.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_linux.Tpo -c -o dsl_cpe_control-dsl_cpe_linux.obj `if test -f 'dsl_cpe_linux.c'; then $(CYGPATH_W) 'dsl_cpe_linux.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_linux.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_linux.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_linux.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_linux.c' object='dsl_cpe_control-dsl_cpe_linux.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_linux.obj `if test -f 'dsl_cpe_linux.c'; then $(CYGPATH_W) 'dsl_cpe_linux.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_linux.c'; fi` + +dsl_cpe_control-dsl_cpe_debug.o: dsl_cpe_debug.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_debug.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug.Tpo -c -o dsl_cpe_control-dsl_cpe_debug.o `test -f 'dsl_cpe_debug.c' || echo '$(srcdir)/'`dsl_cpe_debug.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_debug.c' object='dsl_cpe_control-dsl_cpe_debug.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_debug.o `test -f 'dsl_cpe_debug.c' || echo '$(srcdir)/'`dsl_cpe_debug.c + +dsl_cpe_control-dsl_cpe_debug.obj: dsl_cpe_debug.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_debug.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug.Tpo -c -o dsl_cpe_control-dsl_cpe_debug.obj `if test -f 'dsl_cpe_debug.c'; then $(CYGPATH_W) 'dsl_cpe_debug.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_debug.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_debug.c' object='dsl_cpe_control-dsl_cpe_debug.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_debug.obj `if test -f 'dsl_cpe_debug.c'; then $(CYGPATH_W) 'dsl_cpe_debug.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_debug.c'; fi` + +dsl_cpe_control-dsl_cpe_dti.o: dsl_cpe_dti.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_dti.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti.Tpo -c -o dsl_cpe_control-dsl_cpe_dti.o `test -f 'dsl_cpe_dti.c' || echo '$(srcdir)/'`dsl_cpe_dti.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_dti.c' object='dsl_cpe_control-dsl_cpe_dti.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_dti.o `test -f 'dsl_cpe_dti.c' || echo '$(srcdir)/'`dsl_cpe_dti.c + +dsl_cpe_control-dsl_cpe_dti.obj: dsl_cpe_dti.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_dti.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti.Tpo -c -o dsl_cpe_control-dsl_cpe_dti.obj `if test -f 'dsl_cpe_dti.c'; then $(CYGPATH_W) 'dsl_cpe_dti.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_dti.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_dti.c' object='dsl_cpe_control-dsl_cpe_dti.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_dti.obj `if test -f 'dsl_cpe_dti.c'; then $(CYGPATH_W) 'dsl_cpe_dti.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_dti.c'; fi` + +dsl_cpe_control-dsl_cpe_dti_vrx.o: dsl_cpe_dti_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_dti_vrx.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_dti_vrx.o `test -f 'dsl_cpe_dti_vrx.c' || echo '$(srcdir)/'`dsl_cpe_dti_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_dti_vrx.c' object='dsl_cpe_control-dsl_cpe_dti_vrx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_dti_vrx.o `test -f 'dsl_cpe_dti_vrx.c' || echo '$(srcdir)/'`dsl_cpe_dti_vrx.c + +dsl_cpe_control-dsl_cpe_dti_vrx.obj: dsl_cpe_dti_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_dti_vrx.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_dti_vrx.obj `if test -f 'dsl_cpe_dti_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_dti_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_dti_vrx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_dti_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_dti_vrx.c' object='dsl_cpe_control-dsl_cpe_dti_vrx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_dti_vrx.obj `if test -f 'dsl_cpe_dti_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_dti_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_dti_vrx.c'; fi` + +dsl_cpe_control-dsl_cpe_debug_danube.o: dsl_cpe_debug_danube.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_debug_danube.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_danube.Tpo -c -o dsl_cpe_control-dsl_cpe_debug_danube.o `test -f 'dsl_cpe_debug_danube.c' || echo '$(srcdir)/'`dsl_cpe_debug_danube.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_danube.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_danube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_debug_danube.c' object='dsl_cpe_control-dsl_cpe_debug_danube.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_debug_danube.o `test -f 'dsl_cpe_debug_danube.c' || echo '$(srcdir)/'`dsl_cpe_debug_danube.c + +dsl_cpe_control-dsl_cpe_debug_danube.obj: dsl_cpe_debug_danube.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_debug_danube.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_danube.Tpo -c -o dsl_cpe_control-dsl_cpe_debug_danube.obj `if test -f 'dsl_cpe_debug_danube.c'; then $(CYGPATH_W) 'dsl_cpe_debug_danube.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_debug_danube.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_danube.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_danube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_debug_danube.c' object='dsl_cpe_control-dsl_cpe_debug_danube.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_debug_danube.obj `if test -f 'dsl_cpe_debug_danube.c'; then $(CYGPATH_W) 'dsl_cpe_debug_danube.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_debug_danube.c'; fi` + +dsl_cpe_control-dsl_cpe_debug_vrx.o: dsl_cpe_debug_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_debug_vrx.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_debug_vrx.o `test -f 'dsl_cpe_debug_vrx.c' || echo '$(srcdir)/'`dsl_cpe_debug_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_debug_vrx.c' object='dsl_cpe_control-dsl_cpe_debug_vrx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_debug_vrx.o `test -f 'dsl_cpe_debug_vrx.c' || echo '$(srcdir)/'`dsl_cpe_debug_vrx.c + +dsl_cpe_control-dsl_cpe_debug_vrx.obj: dsl_cpe_debug_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_debug_vrx.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_debug_vrx.obj `if test -f 'dsl_cpe_debug_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_debug_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_debug_vrx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_debug_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_debug_vrx.c' object='dsl_cpe_control-dsl_cpe_debug_vrx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_debug_vrx.obj `if test -f 'dsl_cpe_debug_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_debug_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_debug_vrx.c'; fi` + +dsl_cpe_control-dsl_cpe_bnd_vrx.o: dsl_cpe_bnd_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_bnd_vrx.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_bnd_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_bnd_vrx.o `test -f 'dsl_cpe_bnd_vrx.c' || echo '$(srcdir)/'`dsl_cpe_bnd_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_bnd_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_bnd_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_bnd_vrx.c' object='dsl_cpe_control-dsl_cpe_bnd_vrx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_bnd_vrx.o `test -f 'dsl_cpe_bnd_vrx.c' || echo '$(srcdir)/'`dsl_cpe_bnd_vrx.c + +dsl_cpe_control-dsl_cpe_bnd_vrx.obj: dsl_cpe_bnd_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_bnd_vrx.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_bnd_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_bnd_vrx.obj `if test -f 'dsl_cpe_bnd_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_bnd_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_bnd_vrx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_bnd_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_bnd_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_bnd_vrx.c' object='dsl_cpe_control-dsl_cpe_bnd_vrx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_bnd_vrx.obj `if test -f 'dsl_cpe_bnd_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_bnd_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_bnd_vrx.c'; fi` + +dsl_cpe_control-dsl_cpe_cli.o: dsl_cpe_cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli.Tpo -c -o dsl_cpe_control-dsl_cpe_cli.o `test -f 'dsl_cpe_cli.c' || echo '$(srcdir)/'`dsl_cpe_cli.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli.c' object='dsl_cpe_control-dsl_cpe_cli.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli.o `test -f 'dsl_cpe_cli.c' || echo '$(srcdir)/'`dsl_cpe_cli.c + +dsl_cpe_control-dsl_cpe_cli.obj: dsl_cpe_cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli.Tpo -c -o dsl_cpe_control-dsl_cpe_cli.obj `if test -f 'dsl_cpe_cli.c'; then $(CYGPATH_W) 'dsl_cpe_cli.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli.c' object='dsl_cpe_control-dsl_cpe_cli.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli.obj `if test -f 'dsl_cpe_cli.c'; then $(CYGPATH_W) 'dsl_cpe_cli.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_pipe.o: dsl_cpe_cli_pipe.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_pipe.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_pipe.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_pipe.o `test -f 'dsl_cpe_cli_pipe.c' || echo '$(srcdir)/'`dsl_cpe_cli_pipe.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_pipe.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_pipe.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_pipe.c' object='dsl_cpe_control-dsl_cpe_cli_pipe.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_pipe.o `test -f 'dsl_cpe_cli_pipe.c' || echo '$(srcdir)/'`dsl_cpe_cli_pipe.c + +dsl_cpe_control-dsl_cpe_cli_pipe.obj: dsl_cpe_cli_pipe.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_pipe.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_pipe.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_pipe.obj `if test -f 'dsl_cpe_cli_pipe.c'; then $(CYGPATH_W) 'dsl_cpe_cli_pipe.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_pipe.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_pipe.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_pipe.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_pipe.c' object='dsl_cpe_control-dsl_cpe_cli_pipe.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_pipe.obj `if test -f 'dsl_cpe_cli_pipe.c'; then $(CYGPATH_W) 'dsl_cpe_cli_pipe.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_pipe.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_access.o: dsl_cpe_cli_access.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_access.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_access.o `test -f 'dsl_cpe_cli_access.c' || echo '$(srcdir)/'`dsl_cpe_cli_access.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_access.c' object='dsl_cpe_control-dsl_cpe_cli_access.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_access.o `test -f 'dsl_cpe_cli_access.c' || echo '$(srcdir)/'`dsl_cpe_cli_access.c + +dsl_cpe_control-dsl_cpe_cli_access.obj: dsl_cpe_cli_access.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_access.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_access.obj `if test -f 'dsl_cpe_cli_access.c'; then $(CYGPATH_W) 'dsl_cpe_cli_access.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_access.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_access.c' object='dsl_cpe_control-dsl_cpe_cli_access.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_access.obj `if test -f 'dsl_cpe_cli_access.c'; then $(CYGPATH_W) 'dsl_cpe_cli_access.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_access.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_console.o: dsl_cpe_cli_console.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_console.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_console.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_console.o `test -f 'dsl_cpe_cli_console.c' || echo '$(srcdir)/'`dsl_cpe_cli_console.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_console.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_console.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_console.c' object='dsl_cpe_control-dsl_cpe_cli_console.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_console.o `test -f 'dsl_cpe_cli_console.c' || echo '$(srcdir)/'`dsl_cpe_cli_console.c + +dsl_cpe_control-dsl_cpe_cli_console.obj: dsl_cpe_cli_console.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_console.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_console.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_console.obj `if test -f 'dsl_cpe_cli_console.c'; then $(CYGPATH_W) 'dsl_cpe_cli_console.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_console.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_console.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_console.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_console.c' object='dsl_cpe_control-dsl_cpe_cli_console.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_console.obj `if test -f 'dsl_cpe_cli_console.c'; then $(CYGPATH_W) 'dsl_cpe_cli_console.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_console.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_access2.o: dsl_cpe_cli_access2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_access2.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access2.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_access2.o `test -f 'dsl_cpe_cli_access2.c' || echo '$(srcdir)/'`dsl_cpe_cli_access2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access2.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_access2.c' object='dsl_cpe_control-dsl_cpe_cli_access2.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_access2.o `test -f 'dsl_cpe_cli_access2.c' || echo '$(srcdir)/'`dsl_cpe_cli_access2.c + +dsl_cpe_control-dsl_cpe_cli_access2.obj: dsl_cpe_cli_access2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_access2.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access2.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_access2.obj `if test -f 'dsl_cpe_cli_access2.c'; then $(CYGPATH_W) 'dsl_cpe_cli_access2.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_access2.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access2.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_access2.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_access2.c' object='dsl_cpe_control-dsl_cpe_cli_access2.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_access2.obj `if test -f 'dsl_cpe_cli_access2.c'; then $(CYGPATH_W) 'dsl_cpe_cli_access2.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_access2.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_autogen.o: dsl_cpe_cli_autogen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_autogen.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_autogen.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_autogen.o `test -f 'dsl_cpe_cli_autogen.c' || echo '$(srcdir)/'`dsl_cpe_cli_autogen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_autogen.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_autogen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_autogen.c' object='dsl_cpe_control-dsl_cpe_cli_autogen.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_autogen.o `test -f 'dsl_cpe_cli_autogen.c' || echo '$(srcdir)/'`dsl_cpe_cli_autogen.c + +dsl_cpe_control-dsl_cpe_cli_autogen.obj: dsl_cpe_cli_autogen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_autogen.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_autogen.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_autogen.obj `if test -f 'dsl_cpe_cli_autogen.c'; then $(CYGPATH_W) 'dsl_cpe_cli_autogen.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_autogen.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_autogen.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_autogen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_autogen.c' object='dsl_cpe_control-dsl_cpe_cli_autogen.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_autogen.obj `if test -f 'dsl_cpe_cli_autogen.c'; then $(CYGPATH_W) 'dsl_cpe_cli_autogen.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_autogen.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_danube.o: dsl_cpe_cli_danube.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_danube.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_danube.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_danube.o `test -f 'dsl_cpe_cli_danube.c' || echo '$(srcdir)/'`dsl_cpe_cli_danube.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_danube.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_danube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_danube.c' object='dsl_cpe_control-dsl_cpe_cli_danube.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_danube.o `test -f 'dsl_cpe_cli_danube.c' || echo '$(srcdir)/'`dsl_cpe_cli_danube.c + +dsl_cpe_control-dsl_cpe_cli_danube.obj: dsl_cpe_cli_danube.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_danube.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_danube.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_danube.obj `if test -f 'dsl_cpe_cli_danube.c'; then $(CYGPATH_W) 'dsl_cpe_cli_danube.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_danube.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_danube.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_danube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_danube.c' object='dsl_cpe_control-dsl_cpe_cli_danube.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_danube.obj `if test -f 'dsl_cpe_cli_danube.c'; then $(CYGPATH_W) 'dsl_cpe_cli_danube.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_danube.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_mib.o: dsl_cpe_cli_mib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_mib.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_mib.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_mib.o `test -f 'dsl_cpe_cli_mib.c' || echo '$(srcdir)/'`dsl_cpe_cli_mib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_mib.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_mib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_mib.c' object='dsl_cpe_control-dsl_cpe_cli_mib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_mib.o `test -f 'dsl_cpe_cli_mib.c' || echo '$(srcdir)/'`dsl_cpe_cli_mib.c + +dsl_cpe_control-dsl_cpe_cli_mib.obj: dsl_cpe_cli_mib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_mib.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_mib.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_mib.obj `if test -f 'dsl_cpe_cli_mib.c'; then $(CYGPATH_W) 'dsl_cpe_cli_mib.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_mib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_mib.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_mib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_mib.c' object='dsl_cpe_control-dsl_cpe_cli_mib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_mib.obj `if test -f 'dsl_cpe_cli_mib.c'; then $(CYGPATH_W) 'dsl_cpe_cli_mib.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_mib.c'; fi` + +dsl_cpe_control-dsl_cpe_cli_vrx.o: dsl_cpe_cli_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_vrx.o -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_vrx.o `test -f 'dsl_cpe_cli_vrx.c' || echo '$(srcdir)/'`dsl_cpe_cli_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_vrx.c' object='dsl_cpe_control-dsl_cpe_cli_vrx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_vrx.o `test -f 'dsl_cpe_cli_vrx.c' || echo '$(srcdir)/'`dsl_cpe_cli_vrx.c + +dsl_cpe_control-dsl_cpe_cli_vrx.obj: dsl_cpe_cli_vrx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -MT dsl_cpe_control-dsl_cpe_cli_vrx.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_vrx.Tpo -c -o dsl_cpe_control-dsl_cpe_cli_vrx.obj `if test -f 'dsl_cpe_cli_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_cli_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_vrx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_vrx.Tpo $(DEPDIR)/dsl_cpe_control-dsl_cpe_cli_vrx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_cpe_cli_vrx.c' object='dsl_cpe_control-dsl_cpe_cli_vrx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_control_CFLAGS) $(CFLAGS) -c -o dsl_cpe_control-dsl_cpe_cli_vrx.obj `if test -f 'dsl_cpe_cli_vrx.c'; then $(CYGPATH_W) 'dsl_cpe_cli_vrx.c'; else $(CYGPATH_W) '$(srcdir)/dsl_cpe_cli_vrx.c'; fi` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) dsl_cpe_config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-binSCRIPTS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS + +.MAKE: all install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-binSCRIPTS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS + +.PRECIOUS: Makefile + + +lint: + @flint +b -vm \ + -i$(shell dirname `$(CC) -print-file-name=include`)/include \ + -i@top_srcdir@ std_lx.lnt env-cw6.lnt -i@srcdir@ \ + $(DEFS) $(AM_CPPFLAGS) $(CFLAGS) -D__LINUX__ -DLINUX $(dsl_cpe_control_SOURCES) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/dsl_cpe_bnd_vrx.c b/src/dsl_cpe_bnd_vrx.c new file mode 100644 index 0000000..c4e934a --- /dev/null +++ b/src/dsl_cpe_bnd_vrx.c @@ -0,0 +1,868 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#include "dsl_cpe_control.h" + +#if defined(INCLUDE_DSL_CPE_API_VRX) + +#include "dsl_cpe_bnd_vrx.h" + +#include "drv_dsl_cpe_api_ioctl.h" + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP + +static DSL_Error_t DSL_CPE_BND_BondingCheck( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t fd, + DSL_uint16_t nPort) +{ + DSL_int_t ret = 0, i, j; + DSL_BND_HsStatusGet_t status; + DSL_BND_HsContinue_t HsContinue; + + /* read bonding status */ + memset (&status, 0, sizeof(DSL_BND_HsStatusGet_t)); + + ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_HS_STATUS_GET, (DSL_int_t)&status); + + if ((ret < 0) || (status.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - DSL_FIO_BND_HS_STATUS_GET ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + /* Set RemotePafAvailable */ + pBndCtx->lineMonitorStateMachine[nPort].RemotePafAvailable = + (DSL_uint16_t)status.data.nRemotePafSupported; + + /* clear if same */ + if ((status.data.nActivationMode & DSL_BND_DISCOVERY_CLEAR_IF_SAME)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Clear If Same Command Received" DSL_CPE_CRLF)); + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF, + pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1], + pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3], + pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5])); + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF, + status.data.nDiscoveryCode[0], status.data.nDiscoveryCode[1], + status.data.nDiscoveryCode[2], status.data.nDiscoveryCode[3], + status.data.nDiscoveryCode[4], status.data.nDiscoveryCode[5])); + + /* if received discovery code = current Remote Discovery Register, + then clear the Remote Discovery and Aggregate Register */ + for (i = 0; i < 6; i++) + { + if (status.data.nDiscoveryCode[i] != pBndCtx->remoteDiscoveryCode[i]) + break; + } + + if (i == 6) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Update Remote Discovery code" DSL_CPE_CRLF)); + + memset(pBndCtx->remoteDiscoveryCode, 0x0, 6); + + pBndCtx->aggregateReg = 0; + for (j = 0; j < DSL_CPE_DSL_ENTITIES; j++) + { + pBndCtx->lineMonitorStateMachine[j].PafAggregate = 0; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF, + pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1], + pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3], + pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5])); + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Aggregation Register: 0x%X" DSL_CPE_CRLF, + pBndCtx->aggregateReg)); + } + } + + /* set if clear */ + if ((status.data.nActivationMode & DSL_BND_DISCOVERY_SET_IF_CLEAR)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Set If Clear Command Received" DSL_CPE_CRLF)); + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF, + pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1], + pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3], + pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5])); + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF, + status.data.nDiscoveryCode[0], status.data.nDiscoveryCode[1], + status.data.nDiscoveryCode[2], status.data.nDiscoveryCode[3], + status.data.nDiscoveryCode[4], status.data.nDiscoveryCode[5])); + + /* if current Remote Discovery Register is 0, + then set the Remote Discovery Register to received discovery code */ + for (i = 0; i < 6; i++) + { + if (pBndCtx->remoteDiscoveryCode[i] != 0) + break; + } + + if (i == 6) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Update Remote Discovery code" DSL_CPE_CRLF)); + + cpe_control_memcpy_s(pBndCtx->remoteDiscoveryCode, sizeof(pBndCtx->remoteDiscoveryCode), + status.data.nDiscoveryCode, sizeof(status.data.nDiscoveryCode)); + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF, + pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1], + pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3], + pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5])); + } + } + + /* aggregate set */ + if ((status.data.nActivationMode & DSL_BND_AGGREGATE_SET)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - AggregateSet Command Received" DSL_CPE_CRLF)); + + pBndCtx->aggregateReg |= (1 << nPort); + pBndCtx->lineMonitorStateMachine[nPort].PafAggregate = 1; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Aggregation Register: 0x%X" DSL_CPE_CRLF, + pBndCtx->aggregateReg)); + } + + /* aggregate clear */ + if ((status.data.nActivationMode & DSL_BND_AGGREGATE_CLR) != 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - AggregateClr Command Received" DSL_CPE_CRLF)); + + pBndCtx->aggregateReg &= (~(1 << nPort)); + pBndCtx->lineMonitorStateMachine[nPort].PafAggregate = 0; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Aggregation Register: 0x%X" DSL_CPE_CRLF, + pBndCtx->aggregateReg)); + } + + /* set continue flag after bonding registers processed */ + + memset (&HsContinue, 0, sizeof(DSL_BND_HsContinue_t)); + + cpe_control_memcpy_s(HsContinue.data.nDiscoveryCode, sizeof(HsContinue.data.nDiscoveryCode), + pBndCtx->remoteDiscoveryCode, sizeof(pBndCtx->remoteDiscoveryCode)); + HsContinue.data.nAggregateData = pBndCtx->aggregateReg; + + ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_HS_CONTINUE, (DSL_int_t)&HsContinue); + + if ((ret < 0) || (HsContinue.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - DSL_FIO_BND_HS_CONTINUE ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_BND_RemotePafAvailableCheck( + DSL_int_t fd, + DSL_uint16_t *pRemotePafAvailable) +{ + DSL_int_t ret = 0; + DSL_BND_HsStatusGet_t status; + + /* read bonding status */ + memset (&status, 0, sizeof(DSL_BND_HsStatusGet_t)); + + ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_HS_STATUS_GET, (DSL_int_t)&status); + + if ((ret < 0) || (status.accessCtl.nReturn < DSL_SUCCESS)) + { + if (status.accessCtl.nReturn != DSL_ERR_NOT_SUPPORTED_BY_FIRMWARE) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - DSL_FIO_BND_HS_STATUS_GET ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + } + + /* Set RemotePafAvailable */ + *pRemotePafAvailable = (DSL_uint16_t)status.data.nRemotePafSupported; + + return DSL_SUCCESS; +} + +static DSL_Error_t DSL_CPE_BND_LocalPafAvailableCheck( + DSL_int_t fd, + DSL_uint16_t *pLocalPafAvailable) +{ + DSL_int_t ret = 0; + DSL_BND_ConfigGet_t bndConfig; + + /* read bonding status */ + memset (&bndConfig, 0, sizeof(DSL_BND_ConfigGet_t)); + + ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_CONFIG_GET, (DSL_int_t)&bndConfig); + + if ((ret < 0) || (bndConfig.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - DSL_FIO_BND_CONFIG_GET ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + *pLocalPafAvailable = (DSL_uint16_t)bndConfig.data.bPafEnable; + + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_BND_AutobootStatusRestartWait( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_uint_t nDevice) +{ + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_BND_DeviceFirmwareDownload( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t nDevice, + DSL_FirmwareRequestType_t nFwReqType, + DSL_PortMode_t nPortMode, + DSL_boolean_t bMaster, + DSL_boolean_t bSlave) +{ + DSL_Error_t nErrorCode = DSL_SUCCESS; + DSL_CPE_Control_Context_t *pContext = pBndCtx->pCtrlCtx; + + if (bMaster) + { + /* Download MASTER*/ + nErrorCode = DSL_CPE_DownloadFirmware(pContext->fd[0], nDevice, nFwReqType, + nPortMode, DSL_NULL, DSL_NULL); + if (nErrorCode != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Master line FW download failed!" DSL_CPE_CRLF)); + return nErrorCode; + } + } + + if (bSlave) + { + /* Download MASTER*/ + nErrorCode = DSL_CPE_DownloadFirmware(pContext->fd[1], nDevice, nFwReqType, + nPortMode, DSL_NULL, DSL_NULL); + if (nErrorCode != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Slave line FW download failed!" DSL_CPE_CRLF)); + return nErrorCode; + } + } + + return nErrorCode; +} + +#define DSL_CPE_SLAVE_READY_WAIT_CNT_MAX 10 +DSL_Error_t DSL_CPE_BND_SyncDownloadFirmware( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t nDevice, + DSL_FirmwareRequestType_t nFwReqType, + DSL_PortMode_t nPortMode) +{ + DSL_Error_t nErrorCode = DSL_SUCCESS; + DSL_CPE_Control_Context_t *pContext = pBndCtx->pCtrlCtx; + DSL_AutobootControl_t pAcs; + DSL_boolean_t bSlavePort; + DSL_uint32_t nMasterDevNum, nSlaveDevNum, wait_cnt; + DSL_int_t ret; + DSL_AutobootStatus_t nAutobootStatus; + DSL_BND_PortModeSync_t PortModeSync; + + bSlavePort = nDevice % DSL_CPE_LINES_PER_DEVICE ? DSL_TRUE : DSL_FALSE; + + nMasterDevNum = bSlavePort ? nDevice - 1 : nDevice; + nSlaveDevNum = bSlavePort ? nDevice : nDevice + 1; + + if (nPortMode == DSL_PORT_MODE_DUAL) + { + if (!pBndCtx->bInitialFwRequestHandled) + { + pBndCtx->bFwRequested[nDevice] = DSL_TRUE; + + if (pBndCtx->bFwRequested[nMasterDevNum] && pBndCtx->bFwRequested[nSlaveDevNum]) + { + /* Download firmware for MASTER and SLAVE*/ + nErrorCode = DSL_CPE_BND_DeviceFirmwareDownload( + pBndCtx, nDevice, nFwReqType, nPortMode, DSL_TRUE, DSL_TRUE); + if (nErrorCode != DSL_SUCCESS) + { + return nErrorCode; + } + + pBndCtx->bInitialFwRequestHandled = DSL_TRUE; + return nErrorCode; + } + else + { + return nErrorCode; + } + } + + if (bSlavePort) + { + /* restart MASTER*/ + pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL; + DSL_CPE_Ioctl(pContext->fd[nMasterDevNum], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs); + } + else + { + memset (&nAutobootStatus, 0, sizeof(DSL_AutobootStatus_t)); + ret = DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum], DSL_FIO_AUTOBOOT_STATUS_GET, (DSL_int_t)&nAutobootStatus); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - line %d Autoboot Status get failed!" DSL_CPE_CRLF, nSlaveDevNum)); + return DSL_ERROR; + } + + /* check SLAVE status*/ + if (nAutobootStatus.data.nStatus != DSL_AUTOBOOT_STATUS_FW_WAIT) + { + /* restart SLAVE*/ + pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL; + DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs); + return DSL_SUCCESS; + } + + /* Download firmware for MASTER and SLAVE*/ + nErrorCode = DSL_CPE_BND_DeviceFirmwareDownload( + pBndCtx, nDevice, nFwReqType, nPortMode, DSL_TRUE, DSL_TRUE); + if (nErrorCode != DSL_SUCCESS) + { + return nErrorCode; + } + } + } + else + { + pBndCtx->bFwRequested[nDevice] = DSL_TRUE; + + /* Disable SLAVE*/ + pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_DISABLE; + DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum], DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs); + + /* wait for the disabled SLAVE*/ + for (wait_cnt = 0; wait_cnt < DSL_CPE_SLAVE_READY_WAIT_CNT_MAX; wait_cnt++) + { + memset (&nAutobootStatus, 0, sizeof(DSL_AutobootStatus_t)); + + ret = DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum], DSL_FIO_AUTOBOOT_STATUS_GET, (DSL_int_t)&nAutobootStatus); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - line %d Autoboot Status get failed!" DSL_CPE_CRLF, nSlaveDevNum)); + return DSL_ERROR; + } + + if (nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_STOPPED || + nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_DISABLED || + nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_FW_WAIT) + { + break; + } + + DSL_CPE_Sleep(1); + } + + if (wait_cnt >= DSL_CPE_SLAVE_READY_WAIT_CNT_MAX) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - line %d disable failed!" DSL_CPE_CRLF, nSlaveDevNum)); + return DSL_ERROR; + } + + if (!bSlavePort) + { + /* Download firmware for MASTER*/ + nErrorCode = DSL_CPE_BND_DeviceFirmwareDownload( + pBndCtx, nDevice, nFwReqType, nPortMode, DSL_TRUE, DSL_FALSE); + if (nErrorCode != DSL_SUCCESS) + { + return nErrorCode; + } + } + else + { + /* Set MASTER Port Mode sync*/ + memset(&PortModeSync, 0, sizeof(PortModeSync)); + PortModeSync.data.nPortMode = DSL_PORT_MODE_SINGLE; + ret = DSL_CPE_Ioctl(pContext->fd[nMasterDevNum], DSL_FIO_BND_PORT_MODE_SYNC_SET, (DSL_int_t)&PortModeSync); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - line %d Port Mode sync set failed!" DSL_CPE_CRLF, nMasterDevNum)); + return DSL_ERROR; + } + + /* restart MASTER*/ + pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL; + ret = DSL_CPE_Ioctl(pContext->fd[nMasterDevNum], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - line %d full restart failed failed!" DSL_CPE_CRLF, nMasterDevNum)); + return DSL_ERROR; + } + } + } + + return nErrorCode; +} + +DSL_Error_t DSL_CPE_BND_SystemInterfaceStatusHandle( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t fd, + DSL_uint_t nDevice) +{ + DSL_Error_t nErrorCode = DSL_SUCCESS; + DSL_uint32_t nCurrentLine, nOppositeLine, nLine; + DSL_AutobootControl_t nAcs; + DSL_boolean_t bDisableLine = DSL_FALSE; + + nCurrentLine = nDevice % DSL_CPE_DSL_ENTITIES; + nOppositeLine = (nDevice + 1) % DSL_CPE_DSL_ENTITIES; + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + nErrorCode = DSL_CPE_SetEnv("DSL_BONDING_STATUS", + pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable ? "ACTIVE" : "INACTIVE"); + if (nErrorCode != DSL_SUCCESS) + { + return nErrorCode; + } +#endif + + if(!pBndCtx->lineBondingConfig[nCurrentLine].nPafLineDisabled && + !pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled) + { + /** + * One bonding and one non-bonding lines (CO) are connected to a + * bonding (CPE) board + */ + if(pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached && + pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable && + pBndCtx->lineBondingConfig[nOppositeLine].nFullInitReached && + !pBndCtx->lineBondingConfig[nOppositeLine].nRemotePafAvailable) + { + bDisableLine = DSL_TRUE; + nLine = nOppositeLine; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d PAF mismatch #2a (disable #%d)" + DSL_CPE_CRLF, nCurrentLine, nLine)); + } + else if(pBndCtx->lineBondingConfig[nOppositeLine].nFullInitReached && + pBndCtx->lineBondingConfig[nOppositeLine].nRemotePafAvailable && + pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached && + !pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable) + { + bDisableLine = DSL_TRUE; + nLine = nCurrentLine; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d PAF mismatch #2b (disable #%d)" + DSL_CPE_CRLF, nCurrentLine, nLine)); + } + /** + * 2 non-bonded CO lines are connected to a bonding (CPE) board + */ + else if(pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached && + !pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable) + { + bDisableLine = DSL_TRUE; + nLine = nOppositeLine; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d PAF mismatch #1a (disable #%d)" + DSL_CPE_CRLF, nCurrentLine, nLine)); + } + else if(pBndCtx->lineBondingConfig[nOppositeLine].nFullInitReached && + !pBndCtx->lineBondingConfig[nOppositeLine].nRemotePafAvailable) + { + bDisableLine = DSL_TRUE; + nLine = nCurrentLine; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d PAF mismatch #1b (disable #%d)" + DSL_CPE_CRLF, nCurrentLine, nLine)); + } + } + + if(bDisableLine) + { + pBndCtx->lineBondingConfig[nLine].nPafLineDisabled = 1; + + memset(&nAcs, 0x0, sizeof(DSL_AutobootControl_t)); + nAcs.data.nCommand = DSL_AUTOBOOT_CTRL_DISABLE; + + nErrorCode = DSL_CPE_Ioctl(pBndCtx->pCtrlCtx->fd[nLine], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &nAcs); + if ((nErrorCode < 0) || (nAcs.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_FIO_AUTOBOOT_CONTROL_SET ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + } + + return nErrorCode; +} + +DSL_Error_t DSL_CPE_BND_LineStateHandle( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t fd, + DSL_uint_t nDevice, + DSL_LineStateValue_t nLineState, + DSL_LineStateValue_t nPrevLineState) +{ + DSL_Error_t nErrorCode = DSL_SUCCESS; + DSL_uint32_t nCurrentLine, nOppositeLine; + DSL_AutobootControl_t nAcs; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d nLineState=0x%x nPrevLineState=0x%x" DSL_CPE_CRLF, + nDevice, nLineState,nPrevLineState)); + + nCurrentLine = nDevice % DSL_CPE_DSL_ENTITIES; + nOppositeLine = (nDevice + 1) % DSL_CPE_DSL_ENTITIES; + + if (nLineState == DSL_LINESTATE_FULL_INIT) + { + pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached = 1; + + nErrorCode = DSL_CPE_BND_RemotePafAvailableCheck(fd, + (DSL_uint16_t *)&(pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable)); + if (nErrorCode != DSL_SUCCESS) + { + return nErrorCode; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Device=%d remote PAF is %ssupported" + DSL_CPE_CRLF, nCurrentLine, + pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable ? "" : "not ")); + } + + /* Link drop condition */ + if ((nLineState == DSL_LINESTATE_EXCEPTION) && + (nPrevLineState >= DSL_LINESTATE_IDLE)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d link DROP detected" + DSL_CPE_CRLF, nCurrentLine)); + + pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached = 0; + pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable = 0; + + if (pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d Try to enable opposite line(%d)" + DSL_CPE_CRLF, nCurrentLine, nOppositeLine)); + + memset(&nAcs, 0x0, sizeof(DSL_AutobootControl_t)); + nAcs.data.nCommand = DSL_AUTOBOOT_CTRL_ENABLE; + + nErrorCode = DSL_CPE_Ioctl(pBndCtx->pCtrlCtx->fd[nOppositeLine], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &nAcs); + if ((nErrorCode < 0) || (nAcs.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_FIO_AUTOBOOT_CONTROL_SET ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled = 0; + } + } + + /** + * One bonding line 0 and one non-bonding line 1 connected to the board. + * See: DSLCPE_SW-707 Test B Scenario 2 + */ + if (nLineState == DSL_LINESTATE_SILENT) + { + if (pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d Try to enable opposite line(%d)" + DSL_CPE_CRLF, nCurrentLine, nOppositeLine)); + + memset(&nAcs, 0x0, sizeof(DSL_AutobootControl_t)); + nAcs.data.nCommand = DSL_AUTOBOOT_CTRL_ENABLE; + + nErrorCode = DSL_CPE_Ioctl(pBndCtx->pCtrlCtx->fd[nOppositeLine], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &nAcs); + if ((nErrorCode < 0) || (nAcs.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_FIO_AUTOBOOT_CONTROL_SET ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled = 0; + } + } + + /* BONDING CLR state*/ + if (nLineState == DSL_LINESTATE_BONDING_CLR) + { + nErrorCode = DSL_CPE_BND_BondingCheck(pBndCtx, fd, nDevice); + + if (nErrorCode != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Bonding Check failed, Device=%d" DSL_CPE_CRLF, nDevice)); + return nErrorCode; + } + } + + /* Entry to SHOWTIME */ + if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && + (nPrevLineState != DSL_LINESTATE_SHOWTIME_TC_SYNC) ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d entering SHOWTIME_TC_SYNC" DSL_CPE_CRLF, nDevice)); + + /* Check CL information for RemotePafAvailable */ + nErrorCode = DSL_CPE_BND_RemotePafAvailableCheck( + fd, + &(pBndCtx->lineMonitorStateMachine[nDevice].RemotePafAvailable)); + + if (nErrorCode != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Remote Paf Check failed, Device=%d" DSL_CPE_CRLF, nDevice)); + return nErrorCode; + } + + /* Check CL information for PafAvailable */ + nErrorCode = DSL_CPE_BND_LocalPafAvailableCheck( + fd, + &(pBndCtx->lineMonitorStateMachine[nDevice].PafAvailable)); + + if (nErrorCode != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Local Paf Check failed, Device=%d" DSL_CPE_CRLF, nDevice)); + return nErrorCode; + } + + /* enable/disable bonding */ + if ((pBndCtx->lineMonitorStateMachine[nDevice].PafAvailable) && + (pBndCtx->lineMonitorStateMachine[nDevice].RemotePafAvailable == 1) && + (pBndCtx->lineMonitorStateMachine[nDevice].PafAggregate == 1) ) + { + pBndCtx->lineMonitorStateMachine[nDevice].PafEnable = 1; + } + else + { + pBndCtx->lineMonitorStateMachine[nDevice].PafEnable = 0; + } + + + /* Check M/S status*/ + if (pBndCtx->lineMonitorStateMachine[1-nDevice].MsStatus == DSL_BND_SLAVE) + { + pBndCtx->lineMonitorStateMachine[nDevice].MsStatus = DSL_BND_MASTER; + } + else + { + if (pBndCtx->lineMonitorStateMachine[1-nDevice].PafEnable != 1) + { + return DSL_SUCCESS; + } + + if (pBndCtx->lineMonitorStateMachine[nDevice].PafEnable != 1) + { + return DSL_SUCCESS; + } + } + } + else if ((nLineState != DSL_LINESTATE_SHOWTIME_TC_SYNC) && + (nPrevLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) ) + { + /* Exit from SHOWTIME */ + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "BND - Device=%d leaving SHOWTIME_TC_SYNC" DSL_CPE_CRLF, nDevice)); + + pBndCtx->lineMonitorStateMachine[nDevice].RemotePafAvailable = 0; + + if (pBndCtx->lineMonitorStateMachine[nDevice].MsStatus == DSL_BND_MASTER) + { + pBndCtx->lineMonitorStateMachine[nDevice].MsStatus = DSL_BND_SLAVE; + + if ((pBndCtx->lineMonitorStateMachine[nDevice].PafEnable == 1) && + (pBndCtx->lineMonitorStateMachine[1-nDevice].PafEnable == 1) ) + { + /* Exchange line mastership*/ + pBndCtx->lineMonitorStateMachine[1-nDevice].MsStatus = DSL_BND_MASTER; + } + } + else + { + if (pBndCtx->lineMonitorStateMachine[nDevice].PafEnable != 1) + { + return DSL_SUCCESS; + } + + if (pBndCtx->lineMonitorStateMachine[1-nDevice].PafEnable != 1) + { + return DSL_SUCCESS; + } + } + } + + return DSL_SUCCESS; +} + +static DSL_Error_t DSL_CPE_BND_HwInit( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t fd) +{ + DSL_int_t ret = 0; + DSL_BND_HwInit_t bndHwInit; + + if (pBndCtx == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - HW init: expecting non-zero bonding context pointer!" DSL_CPE_CRLF)); + return DSL_ERROR; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + "dsl_cpe_control - VDSL BONDING version!" DSL_CPE_CRLF)); + + memset(&bndHwInit, 0x0, sizeof(DSL_BND_HwInit_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_HW_INIT, (int) &bndHwInit); + + if ((ret < 0) || (bndHwInit.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - DSL_FIO_BND_HW_INIT ioctl call failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_BND_Start( + DSL_CPE_Control_Context_t *pCtrlCtx, + DSL_int_t fd) +{ + DSL_Error_t ret = DSL_SUCCESS; + DSL_int_t i; + DSL_CPE_BND_Context_t *pBndCtx = DSL_NULL; + + if (pCtrlCtx == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - missing CPE context pointer pCtrlCtx!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + pBndCtx = DSL_CPE_Malloc(sizeof(DSL_CPE_BND_Context_t)); + + if (pBndCtx == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Bonding context memory allocation failed!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + pBndCtx->lineMonitorStateMachine[0].Port = 0; + pBndCtx->lineMonitorStateMachine[1].Port = 1; + + for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++) + { + pBndCtx->lineMonitorStateMachine[i].PafAvailable = -1; + pBndCtx->lineMonitorStateMachine[i].RemotePafAvailable = -1; + pBndCtx->lineMonitorStateMachine[i].PafAggregate = -1; + pBndCtx->lineMonitorStateMachine[i].PafEnable = 0; + pBndCtx->lineMonitorStateMachine[i].TxDataRate = 0; + + pBndCtx->lineMonitorStateMachine[i].MsStatus = DSL_BND_SLAVE; + + pBndCtx->lineBondingConfig[i].nFullInitReached = 0; + pBndCtx->lineBondingConfig[i].nRemotePafAvailable = 0; + pBndCtx->lineBondingConfig[i].nPafLineDisabled = 0; + } + + memset(&(pBndCtx->remoteDiscoveryCode), 0x0, 6); + + pBndCtx->aggregateReg = 0; + pBndCtx->nPafLineHandled = -1; + pBndCtx->nPafLineDisabled = -1; + pBndCtx->pCtrlCtx = pCtrlCtx; + + /* Initialize Bonding HW*/ + ret = DSL_CPE_BND_HwInit(pBndCtx, fd); + + if (ret < DSL_SUCCESS) + { + DSL_CPE_Free(pBndCtx); + pCtrlCtx->pBnd = DSL_NULL; + } + else + { + pCtrlCtx->pBnd = (DSL_void_t*)pBndCtx; + } + + return ret; +} + +DSL_void_t DSL_CPE_BND_Stop( + DSL_CPE_BND_Context_t *pBndContext) +{ + if (pBndContext != DSL_NULL) + { + DSL_CPE_Free(pBndContext); + } + + return; +} + +#endif /* INCLUDE_DSL_BONDING*/ diff --git a/src/dsl_cpe_bnd_vrx.h b/src/dsl_cpe_bnd_vrx.h new file mode 100644 index 0000000..7cbf8d7 --- /dev/null +++ b/src/dsl_cpe_bnd_vrx.h @@ -0,0 +1,172 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +*******************************************************************************/ + +#ifndef _DSL_CPE_BND_VRX_H_ +#define _DSL_CPE_BND_VRX_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \file + Bonding implementation/interface for CPE Control Application +*/ + +#define DSL_CPE_BND_TX_RATE_RATIO_UNITY (0x0100) + +typedef enum +{ + DSL_BND_MASTER = 0, + DSL_BND_SLAVE = 1 +} DSL_CPE_BND_MsStatus_t; + +/* + LineMonitorStateMachine +*/ +typedef struct { + DSL_uint16_t Port; + DSL_uint16_t PafAvailable; + DSL_uint16_t RemotePafAvailable; + DSL_uint16_t PafAggregate; + DSL_uint16_t PafEnable; + DSL_uint32_t TxDataRate; + DSL_CPE_BND_MsStatus_t MsStatus; +} DSL_CPE_BND_LineMonitorStateMachine_t; + +/* + LineBondingConfiguration +*/ +typedef struct { + /** + Indicates that a line has reached FULL_INIT during link activation handling. + SET : It will be set (to 1) for the current line in case of current line + reaches FULL_INIT line state (0x380). + RESET: It will be (unconditionally) reset (to 0) for the current line in + case of link drop happens on current line. + \note Link drop condition will be detected at its earliest possible + link activation handling state. */ + DSL_boolean_t nFullInitReached; + /** + Indicates that a line received information from CO side that PAF is supported + SET : It will be set (to 1) for the current line if nFullInitReached for + the current line equals 1 and RemotePafAvailableCheck indicates that + the CO supports PAF (bonding) + RESET: It will be (unconditionally) reset (to 0) for the current line in + case of link drop happens on current line. + \note Link drop condition will be detected at its earliest possible + link activation handling state. */ + DSL_boolean_t nRemotePafAvailable; + /** + Indicates that a line was disabled due to PAF configuration mismatch between both lines. + SET : It will be set (to 1) for a line in case of PAF (bonding) mismatch is + detected. Depending on the current line activation process it could + be applied to the current or the opposite line. The line for which + this flag is set will be also disabled. + RESET: It will be (unconditionally) reset (to 0) for the opposite line in + case of linkdrop happens on current line. In case of opposite line is + currently disabled it will be re-activated again. + \note Link drop condition will be detected at its earliest possible + link activation handling state. */ + DSL_boolean_t nPafLineDisabled; +} DSL_CPE_BND_LineBondingConfiguration_t; + +/** + Bonding Context +*/ +typedef struct +{ + /** + Line Monitor SM data*/ + DSL_CPE_BND_LineMonitorStateMachine_t + lineMonitorStateMachine[DSL_CPE_MAX_DSL_ENTITIES]; + /** + Remote discovery code*/ + DSL_uint8_t remoteDiscoveryCode[6]; + /** + Aggregate data state*/ + DSL_uint32_t aggregateReg; + /** + CPE API Control Context*/ + DSL_CPE_Control_Context_t *pCtrlCtx; + /** + TBD*/ + DSL_PortMode_t nPortMode; + /** + TBD*/ + DSL_boolean_t bFwRequested[DSL_CPE_MAX_DSL_ENTITIES]; + /** + TBD*/ + DSL_boolean_t bInitialFwRequestHandled; + /** + Paf line num firts reach FULL_INIT*/ + DSL_int8_t nPafLineHandled; + /** + Line num was disabled by absent Paf*/ + DSL_int8_t nPafLineDisabled; + DSL_CPE_BND_LineBondingConfiguration_t lineBondingConfig[DSL_CPE_MAX_DSL_ENTITIES]; +} DSL_CPE_BND_Context_t; + +/* + Function to start Bonding handling +*/ +DSL_Error_t DSL_CPE_BND_Start( + DSL_CPE_Control_Context_t *pCtrlCtx, + DSL_int_t fd); + +/* + Function to stop Bonding handling +*/ +DSL_void_t DSL_CPE_BND_Stop( + DSL_CPE_BND_Context_t *pBndContext); + +/* + Function to check the remote PAF status +*/ +DSL_Error_t DSL_CPE_BND_RemotePafAvailableCheck( + DSL_int_t fd, + DSL_uint16_t *pRemotePafAvailable); +/* + Bonding handling for the Autoboot Restart Wait state +*/ +DSL_Error_t DSL_CPE_BND_AutobootStatusRestartWait( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_uint_t nDevice); + +/* + Firmware Download for bonding +*/ +DSL_Error_t DSL_CPE_BND_SyncDownloadFirmware( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t nDevice, + DSL_FirmwareRequestType_t nFwReqType, + DSL_PortMode_t nPortMode); + +/* + Bonding handling for the Line State change +*/ +DSL_Error_t DSL_CPE_BND_LineStateHandle( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t fd, DSL_uint_t nDevice, + DSL_LineStateValue_t nLineState, + DSL_LineStateValue_t nPrevLineState); + +/* + Bonding handling for the System Interface status notification +*/ +DSL_Error_t DSL_CPE_BND_SystemInterfaceStatusHandle( + DSL_CPE_BND_Context_t *pBndCtx, + DSL_int_t fd, + DSL_uint_t nDevice); + +#ifdef __cplusplus +} +#endif + +#endif /* _DSL_CPE_BND_VRX_H_ */ diff --git a/src/dsl_cpe_cli.c b/src/dsl_cpe_cli.c new file mode 100644 index 0000000..75ffefb --- /dev/null +++ b/src/dsl_cpe_cli.c @@ -0,0 +1,1372 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL daemon command line interface +*/ + +/*#define DSL_INTERN*/ + +#include "dsl_cpe_control.h" +#include "dsl_cpe_os.h" +#include "dsl_cpe_cli.h" +#ifdef LOGGING_ID + #include "ulogging.h" + + #ifndef LOG_LEVEL + uint16_t LOGLEVEL = SYS_LOG_DEBUG + 1; + #else + uint16_t LOGLEVEL = LOG_LEVEL + 1; + #endif + + #ifndef LOG_TYPE + uint16_t LOGTYPE = SYS_LOG_TYPE_FILE; + #else + uint16_t LOGTYPE = LOG_TYPE; + #endif +#else /* LOGGING_ID */ + #define LOGF_LOG_INFO(...) +#endif /* LOGGING_ID */ + +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) && !defined(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT) + #include "drv_dsl_cpe_api_ioctl.h" +#endif + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CLI + + +static DSL_void_t DSL_CPE_CLI_Cleanup(void); + +static DSL_Error_t DSL_CPE_CLI_PrintHelp +( + const DSL_char_t *psHelp, + DSL_char_t *psCmdLong, + DSL_char_t *psCmdShort, + DSL_uint32_t nCmdMask, + DSL_CPE_CLI_PrintHelpCallback_t pFct, + DSL_CPE_File_t *out +); + +/** 'less then' defintion for binary tree, (a < b)*/ +#define compLT(a,b) (strcmp(a,b) < 0) +/** 'equal' defintion for binary tree, (a == b)*/ +#define compEQ(a,b) (strcmp(a,b) == 0) + +#define DSL_CLI_HELP_NOT_AVAILABLE "nReturn=-1 (wrong number of parameters/help not available) \n" +#define DSL_CLI_HELP_MEMORY_ERROR "nReturn=-1 (help string memory allocation error) \n" + +#define DSL_CLI_HELP_NOTE_FUNCTION_DEPRECATED "Note: This function is deprecated! \n" + +/** implementation dependend declarations */ +typedef enum +{ + DSL_CPE_STATUS_OK, + DSL_CPE_STATUS_MEM_EXHAUSTED, + DSL_CPE_STATUS_DUPLICATE_KEY, + DSL_CPE_STATUS_KEY_NOT_FOUND, + DSL_CPE_STATUS_KEY_INVALID +} DSL_CPE_statusEnum; + +/** type of key */ +typedef char* DSL_CPE_keyType; + +/** user data stored in tree */ +typedef struct +{ + DSL_char_t *sCmdShort; + DSL_char_t *sCmdLong; + const DSL_char_t *psHelp; + unsigned int mask; + DSL_int_t (*func)(DSL_int_t, DSL_char_t*, DSL_CPE_File_t*); + DSL_CPE_CLI_PrintHelpCallback_t printFunc; +} DSL_CPE_recType; + +typedef struct DSL_CPE_nodeTag +{ + /* left child */ + struct DSL_CPE_nodeTag *left; + /** right child */ + struct DSL_CPE_nodeTag *right; + /** parent */ + struct DSL_CPE_nodeTag *parent; + /** key used for searching */ + DSL_CPE_keyType key; + /** user data */ + DSL_CPE_recType rec; +} DSL_CPE_nodeType; + +static DSL_CPE_statusEnum DSL_CPE_keyInsert +( + DSL_CPE_keyType key, + DSL_CPE_recType *rec +); + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +static void DSL_CPE_treeResourceUsageGet +( + DSL_CPE_nodeType *node, + unsigned int *pResStatic, + unsigned int *pResDynamic +); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +static DSL_CPE_statusEnum DSL_CPE_keyDelete +( + DSL_CPE_keyType key +); + +DSL_CPE_statusEnum DSL_CPE_keyFind +( + DSL_CPE_keyType key, + DSL_CPE_recType *rec +); + +static void DSL_CPE_treePrint +( + DSL_CPE_nodeType *node, + unsigned int mask, + DSL_CPE_File_t * +); + +static void DSL_CPE_treeDelete +( + DSL_CPE_nodeType *node +); + +static void DSL_CPE_nodeDelete +( + DSL_CPE_nodeType *node +); + +/** root of binary tree */ +DSL_CPE_nodeType *root_node = DSL_NULL; + +struct DSL_CLI_Context +{ + /** + pointer for list */ + DSL_CLI_Context_t *next; + /** + Context for CLI Callbacks */ + DSL_void_t *pCBContext; + /** + Callback for CLI Shutdown */ + DSL_CPE_Exit_Callback_t pExitCallback; + /** + DSL_CPE_API Event Callback, may be DSL_NULL */ + DSL_CLI_Event_Callback_t pEventCallback; +}; + +DSL_char_t CLI_EventText[16000]; + +static DSL_CLI_Context_t *CLI_List_head = DSL_NULL; + +/** indicates if the CLI already initialized */ +static DSL_boolean_t bCLI_Init = DSL_FALSE; + +static const DSL_char_t g_sQuit[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Quits DSL CPE API Control Application" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +static DSL_int_t DSL_CPE_CLI_Quit( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + DSL_CPE_FPrintf (out, + "DSL CPE API Control Application termination started..."DSL_CPE_CRLF); + + return 0; +} + +/******************************************************************************/ + +DSL_Error_t DSL_CPE_CLI_Init(DSL_void_t) +{ + if(bCLI_Init == DSL_FALSE) + { + DSL_CPE_CLI_CMD_ADD_COMM("help", "Help", DSL_CPE_CLI_HelpPrint, DSL_NULL); + DSL_CPE_CLI_CMD_ADD_COMM("quit", "Quit", DSL_CPE_CLI_Quit, g_sQuit); + DSL_CPE_CLI_AccessCommandsRegister(); + + bCLI_Init = DSL_TRUE; + } + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_CLI_Shutdown(DSL_void_t) +{ + DSL_CPE_CLI_CommandClear(); + + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "Goodbye from DSL CPE API CLI " + "interface" DSL_CPE_CRLF ); + + bCLI_Init = DSL_FALSE; + + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_CLI_HandleEvent(DSL_char_t *pMsg) +{ + DSL_CLI_Context_t *pCLIList = CLI_List_head; + + /* Using logging framework for event data content */ + LOGF_LOG_INFO("%s", pMsg); + + while (pCLIList != DSL_NULL) + { + if (pCLIList->pEventCallback != DSL_NULL) + { + (void)pCLIList->pEventCallback(pCLIList->pCBContext, CLI_EventText); + } + pCLIList = pCLIList->next; + }; + + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_CLI_Register( + DSL_CLI_Context_t **pNewCLIContext, + DSL_void_t *pCBContext, + DSL_CPE_Exit_Callback_t pExitCallback, + DSL_CLI_Event_Callback_t pEventCallback) +{ + DSL_CLI_Context_t *pCLIContext; + + if(*pNewCLIContext != DSL_NULL) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "expecting zero context pointer " + "'*pNewCLIContext'" DSL_CPE_CRLF); + return DSL_ERROR; + } + + *pNewCLIContext = malloc(sizeof(DSL_CLI_Context_t)); + if(*pNewCLIContext == DSL_NULL) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "no memory for '*pNewCLIContext'" + DSL_CPE_CRLF); + return DSL_ERROR; + } + pCLIContext = *pNewCLIContext; + + memset(pCLIContext, 0x00, sizeof(*pCLIContext)); + + pCLIContext->next = DSL_NULL; + pCLIContext->pCBContext = pCBContext; + pCLIContext->pExitCallback = pExitCallback; + pCLIContext->pEventCallback = pEventCallback; + + if (CLI_List_head == DSL_NULL) + CLI_List_head = pCLIContext; + else + { + DSL_CLI_Context_t *pCLI_List = CLI_List_head; + while (pCLI_List->next != DSL_NULL) + { + pCLI_List = pCLI_List->next; + } + pCLI_List->next = pCLIContext; + } + + return DSL_SUCCESS; +} + +#if defined(INCLUDE_DSL_API_CONSOLE_EXTRA) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_Error_t DSL_CPE_CLI_Unregister(DSL_CLI_Context_t *pCLIContext) +{ + DSL_CLI_Context_t *pCLIList=DSL_NULL; + + if(pCLIContext == DSL_NULL) + { + return DSL_SUCCESS; + } + + if (CLI_List_head == pCLIContext) + { + CLI_List_head = pCLIContext->next; + return DSL_SUCCESS; + } + else + { + pCLIList = CLI_List_head; + while (pCLIList != DSL_NULL) + { + if (pCLIList->next == pCLIContext) + { + /* entry found, remove from list */ + pCLIList->next = pCLIContext->next; + return DSL_SUCCESS; + } + pCLIList = pCLIList->next; + } + } + + return DSL_ERROR; +} +#endif /* #if defined(INCLUDE_DSL_API_CONSOLE_EXTRA) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +/** + Cleanup the CLI (and stop the DSL CPE API) +*/ +static DSL_void_t DSL_CPE_CLI_Cleanup(void) +{ + DSL_CLI_Context_t *pCLIList = CLI_List_head; + DSL_CLI_Context_t *pCLI_del; + + CLI_List_head = DSL_NULL; + while (pCLIList != DSL_NULL) + { + if (pCLIList->pExitCallback != DSL_NULL) + { + /*DSL_CPE_FPrintf(DSL_CPE_STDERR, "CLI: calling pExitCallback()" DSL_CPE_CRLF );*/ + (void)pCLIList->pExitCallback(pCLIList->pCBContext); + } + pCLI_del = pCLIList; + pCLIList = pCLIList->next; + free(pCLI_del); + }; +} + +/** + Checks if the command string includes option to display help text. + + \param pCommands + user command line arguments + + \return + returns 0 in case of no help request or any other value if help is + requested from user. +*/ +DSL_int_t DSL_CPE_CLI_CheckHelp (const DSL_char_t * pCommands) +{ + if (pCommands && (strstr (pCommands, "-h") || strstr (pCommands, "--help") || + strstr (pCommands, "/h") || strstr (pCommands, "-?"))) + { + return -1; + } + return 0; +} + +static DSL_Error_t DSL_CPE_CLI_PrintHelp( + const DSL_char_t *psHelp, + DSL_char_t *psCmdLong, + DSL_char_t *psCmdShort, + DSL_uint32_t nCmdMask, + DSL_CPE_CLI_PrintHelpCallback_t pFct, + DSL_CPE_File_t *out) +{ +#ifndef DSL_CPE_DEBUG_DISABLE + DSL_char_t *sHelp = DSL_NULL; + + if (psHelp == DSL_NULL) + { + return DSL_ERROR; + } + + if (nCmdMask & DSL_CPE_MASK_DEPRECATED) + { + DSL_CPE_FPrintf (out, DSL_CLI_HELP_NOTE_FUNCTION_DEPRECATED); + } + + if (pFct != NULL) + { + return pFct(psHelp, psCmdLong, psCmdShort, nCmdMask,out); + } + else + { + sHelp = (DSL_char_t*)DSL_CPE_Malloc(4096); + if (sHelp == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CLI_HELP_MEMORY_ERROR); + return DSL_ERROR; + } + snprintf(sHelp, 4096, psHelp, psCmdLong, psCmdShort); + + DSL_CPE_FPrintf (out, "%s", sHelp); + + DSL_CPE_Free(sHelp); + } +#else + DSL_CPE_FPrintf (out, DSL_CLI_HELP_NOT_AVAILABLE); +#endif /* DSL_CPE_DEBUG_DISABLE */ + + return DSL_SUCCESS; +} + +/** + Checks a given command list (string) according to the included number of + parameter. + + \param pCommands + specifies a pointer to a list of parameters + \param nParams + specifies the expected number of parameters that has to be included + within the command list + + \return + Returns DSL_TRUE if the number of scanned parameters equals to the + given value of nParams otherwise returns DSL_FALSE +*/ +DSL_boolean_t DSL_CPE_CLI_CheckParamNumber( + DSL_char_t *pCommands, + DSL_int_t nParams, + DSL_CLI_ParamCheckType_t nCheckType) +{ + DSL_char_t string[256] = { 0 }; + DSL_char_t seps[] = " "; + DSL_boolean_t bRet = DSL_FALSE; + DSL_char_t *token; + DSL_int_t i = 0; + + cpe_control_strncpy_s(string, sizeof(string)-1, pCommands, strlen(pCommands)); + string[sizeof(string)-1]=0; + + /* Get first token */ + token = strtok (string, seps); + if (token != DSL_NULL) + { + for (i = 1; ; i++) + { + /* Get next token */ + token = strtok(DSL_NULL, seps); + + /* Exit scanning if no further information is included */ + if (token == DSL_NULL) + { + break; + } + } + } + + bRet = DSL_FALSE; + switch (nCheckType) + { + case DSL_CLI_EQUALS: + if (i == nParams) bRet =DSL_TRUE; + break; + case DSL_CLI_MIN: + if (i >= nParams) bRet = DSL_TRUE; + break; + case DSL_CLI_MAX: + if (i <= nParams) bRet = DSL_TRUE; + break; + default: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX "DSL_CPE_CLI_CheckParamNumber: " + "unknown check type" DSL_CPE_CRLF); + break; + } + + return bRet; +} + +/** + Inform the user about the built in commands. + + \param command not used +*/ +DSL_int_t DSL_CPE_CLI_HelpPrint( + DSL_int_t fd, + DSL_char_t *command, + DSL_CPE_File_t *out) +{ + unsigned int mask = 0; + DSL_CPE_File_t *target = out; + #ifdef WIN32 + DSL_CPE_File_t *file = DSL_NULL; + #endif + + if( (command != DSL_NULL) && ( strstr(command,"--help") || + strstr(command,"-h")) ) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "help [-h | --help" + #ifdef DSL_CPE_MASK_LONG + " | -l | --long |" + #endif + #ifdef WIN32 + " | file |" + #endif + " all | device | g997 | pm | bnd | dsm" + #ifdef INCLUDE_DEPRECATED + " deprecated |" + #endif + " detailed]" DSL_CPE_CRLF ); + + return 0; + } + + if(command) + { + #ifdef WIN32 + if(strstr(command, "file") != 0) + { + file = DSL_CPE_FOpen("cli_help.txt","a+"); + target = file; + } + #endif + + #ifdef DSL_CPE_MASK_LONG + if((strstr(command, "-l") != 0) || (strstr(command, "--long") != 0) ) + mask = DSL_CPE_MASK_LONG; + #endif + if(strstr(command, "detailed") != 0) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "detailed information" DSL_CPE_CRLF ); + mask |= DSL_CPE_MASK_DETAILED; + } + #ifdef INCLUDE_DEPRECATED + if(strstr(command, "deprecated") != 0) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "deprecated functions" DSL_CPE_CRLF ); + mask |= DSL_CPE_MASK_DEPRECATED; + } + #endif + if(strstr(command, "device") != 0) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "device related functions" DSL_CPE_CRLF ); + DSL_CPE_treePrint(root_node, mask | DSL_CPE_MASK_DEVICE, target); + } + if(strstr(command, "g997") != 0) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "G997 related functions" DSL_CPE_CRLF ); + DSL_CPE_treePrint(root_node, mask | DSL_CPE_MASK_G997, target); + } + if(strstr(command, "pm") != 0) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "performance related functions" DSL_CPE_CRLF ); + DSL_CPE_treePrint(root_node, mask | DSL_CPE_MASK_PM, target); + } + if(strstr(command, "bnd") != 0) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "Bonding related functions" DSL_CPE_CRLF ); + DSL_CPE_treePrint(root_node, mask | DSL_CPE_MASK_BND, target); + } + if(strstr(command, "dsm") != 0) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX + "(D)igital (S)pectrum (M)anagement (vectoring) related functions" DSL_CPE_CRLF ); + DSL_CPE_treePrint(root_node, mask | DSL_CPE_MASK_DSM, target); + } + if(strlen(command)==0 || strstr(command, "all") != 0) + { + DSL_CPE_treePrint(root_node, mask | DSL_CPE_MASK_ALL, target); + } + } + else + { + DSL_CPE_treePrint(root_node, DSL_CPE_MASK_ALL | mask, target); + } + + #ifdef WIN32 + if(file != DSL_NULL) + DSL_CPE_FClose(file); + #endif + + return 0; +} + +DSL_boolean_t DSL_CPE_CLI_CheckPowerDown( + DSL_int_t fd, + DSL_CPE_File_t *out) +{ + DSL_boolean_t retVal = DSL_FALSE; + DSL_int_t ret = 0; + DSL_AutobootStatus_t nAutobootStatus; + + memset (&nAutobootStatus, 0, sizeof(DSL_AutobootStatus_t)); + ret = DSL_CPE_Ioctl(fd, DSL_FIO_AUTOBOOT_STATUS_GET, (DSL_int_t)&nAutobootStatus); + + if ((ret < 0) && (nAutobootStatus.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, "nReturn=%d%s", DSL_CPE_RET_VAL(nAutobootStatus.accessCtl.nReturn)); + } + else if (nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_SHUTDOWN_PD || + nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_STOPPED_PD) + { + retVal = DSL_TRUE; + } + + return retVal; +} + +/** + Execute command. + + \param name Command name + \param command Command line (optional parameters) +*/ +DSL_int_t DSL_CPE_CLI_CommandExecute( + DSL_int_t fd, + DSL_char_t *cmd, + DSL_char_t *arg, + DSL_CPE_File_t *out) +{ + DSL_CPE_recType rec = {DSL_NULL, DSL_NULL, DSL_NULL, 0, DSL_NULL}; + DSL_char_t dummy_arg[10] = ""; + DSL_boolean_t bCallable = DSL_TRUE; + DSL_int_t nQuit = 0; + + if(cmd == DSL_NULL) + { + DSL_CPE_CLI_HelpPrint (fd, "all", out); + return -1; + } + + cmd = DSL_CPE_CLI_WhitespaceRemove(cmd); + if(arg != DSL_NULL) + { + arg = DSL_CPE_CLI_WhitespaceRemove(arg); + } + else + { + arg = dummy_arg; + } + + switch(DSL_CPE_keyFind(cmd, &rec)) + { + case DSL_CPE_STATUS_OK: + if(rec.func == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_CRLF "Error: command \"%s\" without callback" DSL_CPE_CRLF ,cmd); + } + else + { + if ((rec.psHelp != DSL_NULL) && (DSL_CPE_CLI_CheckHelp(arg) != 0)) + { + DSL_CPE_CLI_PrintHelp(rec.psHelp, rec.sCmdLong, rec.sCmdShort, rec.mask, rec.printFunc, out); + } + else + { + nQuit = strcmp(cmd, "quit"); + + if (DSL_CPE_CLI_CheckPowerDown(fd, out) == DSL_TRUE) + { + if(!(rec.mask & DSL_CPE_MASK_AFTER_POWER_DOWN) && nQuit != 0) + { + bCallable = DSL_FALSE; + } + } + + if (bCallable == DSL_TRUE) + { + if(rec.func(fd, arg, out) != 0) + { + DSL_CPE_CLI_PrintHelp(rec.psHelp, rec.sCmdLong, rec.sCmdShort, rec.mask, rec.printFunc, out); + } + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_NOT_SUPPORTED_IN_CURRENT_AUTOBOOT_STATE)); + } + + if (nQuit == 0) + { + DSL_CPE_CLI_Cleanup(); + /* main() will execute exit */ + return 1; + } + } + } + break; + + default: +#if 0 /* #ifdef LINUX */ +/* FIXME: This leads into a crash on the RefBoard */ + { + DSL_int_t k=0; + DSL_char_t *argv[DSL_MAX_ARGS]; + DSL_char_t *ptr; + DSL_char_t file_name[64], *brkt; + DSL_int_t status; + + /* try to call external utility */ + argv[k++] = cmd; + + ptr = strtok_r(arg, " ", &brkt); + + while(ptr && (k<(DSL_MAX_ARGS-1))) + { + argv[k++] = ptr; + ptr = strtok_r(DSL_NULL, " ", &brkt); + } + + argv[k] = DSL_NULL; + + switch (fork()) + { + case -1: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX "fork failed" DSL_CPE_CRLF ); + break; + + case 0: + snprintf(file_name, sizeof(file_name),"/bin/%s",cmd); + execv(file_name,argv); + + snprintf(file_name, sizeof(file_name),"/usr/bin/%s",cmd); + execv(file_name,argv); + + snprintf(file_name, sizeof(file_name),"/opt/ifx/%s",cmd); + execv(file_name,argv); + + DSL_CPE_FPrintf(DSL_CPE_STDERR, "%s: command not found" DSL_CPE_CRLF,cmd); + exit(1); + break; + + default: + wait(&status); + break; + } + } + return 0; +#else + DSL_CPE_FPrintf(out, "%s: command not found" DSL_CPE_CRLF, cmd); + DSL_CPE_CLI_HelpPrint (fd, "all", out); + return -1; +#endif /* LINUX */ + } + return 0; +} + +/** + Add a command to the static list. + + \param name Command name + \param help Help string + \param func Command entry point + + \return + DSL_ERROR no more space left in command table + DSL_SUCCESS command added to the command table +*/ +DSL_Error_t DSL_CPE_CLI_CommandAdd( + DSL_char_t *name, + DSL_char_t *long_name, + DSL_int_t (*func)(DSL_int_t, DSL_char_t*, DSL_CPE_File_t*), + const DSL_char_t *psHelp, + DSL_uint32_t nCmdSortMask, + DSL_CPE_CLI_PrintHelpCallback_t printCallback) +{ + DSL_CPE_recType rec; + DSL_char_t buf[64+1]=""; + DSL_uint8_t i=0,k=0; + + rec.mask = 0; + + if(name == DSL_NULL) + { + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " name pointer is invalid" DSL_CPE_CRLF ); + return DSL_ERROR; + } + + if(long_name == DSL_NULL) + { + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " long_name pointer is invalid" DSL_CPE_CRLF ); + return DSL_ERROR; + } + + for(i = 0; (i < strlen(long_name)) && (k < sizeof(buf)/sizeof(buf[0]) - 1); i++) + { + if(long_name[i] >= 'A' && long_name[i] <= 'Z') + { + buf[k++] = 'a' + (long_name[i] - 'A'); + } + else if(long_name[i] >= '0' && long_name[i] <= '9') + { + buf[k++] = long_name[i]; + } + } + buf[k] = 0; + + if(strcmp(buf, name) != 0) + { + if( ! ((strcmp(long_name,"Help") == 0) || (strcmp(long_name,"Quit") == 0)) ) + { + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " CLI short name mismatch %s / %s / %s " DSL_CPE_CRLF, name, buf, long_name ); + } + } + + rec.func = func; + + if(strstr(name, "g997") != 0) + { + rec.mask |= DSL_CPE_MASK_G997; + + if(strstr(name, "g997lis") != 0) + rec.mask |= DSL_CPE_MASK_AFTER_POWER_DOWN; + } + else if(long_name[0] == 'P' && long_name[1] == 'M') + { + rec.mask |= DSL_CPE_MASK_PM; + } + else if(strstr(name, "bnd") != 0) + { + rec.mask |= DSL_CPE_MASK_BND; + } + else if(strstr(name, "dsm") != 0) + { + rec.mask |= DSL_CPE_MASK_DSM; + } + else if( + strstr(name, "esmcs") != 0 || + strstr(name, "lfcg") != 0 || + strstr(name, "lfcs") != 0 || + strstr(name, "fdsg") != 0 || + strstr(name, "acs") != 0 || + strstr(name, "help") != 0 || + strstr(name, "vig") != 0 || + strstr(name, "asg") != 0 || + strstr(name, "dbgmls") != 0 || + strstr(name, "dbgmlg") != 0 || + strstr(name, "ccadbgmls") != 0 || + strstr(name, "ccadbgmlg") != 0) + { + rec.mask |= DSL_CPE_MASK_AFTER_POWER_DOWN; + } + else + { + rec.mask |= DSL_CPE_MASK_DEVICE; + } + + rec.mask |= nCmdSortMask; + + rec.sCmdShort = malloc(strlen(name)+1); + if(rec.sCmdShort) + { + cpe_control_strncpy_s(rec.sCmdShort, strlen(name)+1, name, strlen(name)+1); + rec.sCmdShort[strlen(name)] = 0; + } + + rec.sCmdLong = malloc(strlen(long_name)+1); + if(rec.sCmdLong) + { + cpe_control_strncpy_s(rec.sCmdLong, strlen(long_name)+1, long_name, strlen(long_name)); + rec.sCmdLong[strlen(long_name)] = 0; + } + + if(rec.sCmdShort == DSL_NULL || rec.sCmdLong == DSL_NULL) + { + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + } + + rec.psHelp = psHelp; + rec.printFunc = printCallback; + + switch(DSL_CPE_keyInsert(rec.sCmdShort, &rec)) + { + case DSL_CPE_STATUS_KEY_INVALID: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " invalid key %s for %s" DSL_CPE_CRLF , rec.sCmdShort, rec.sCmdLong); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + + case DSL_CPE_STATUS_DUPLICATE_KEY: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " duplicate key %s for %s" DSL_CPE_CRLF , rec.sCmdShort, rec.sCmdLong); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + + case DSL_CPE_STATUS_MEM_EXHAUSTED: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " memory error" DSL_CPE_CRLF ); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + + case DSL_CPE_STATUS_OK: + break; + + default: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " insert key aborted" DSL_CPE_CRLF ); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + } + +#ifdef DSL_CPE_MASK_LONG + rec.mask |= DSL_CPE_MASK_LONG; + + switch(DSL_CPE_keyInsert(rec.sCmdLong, &rec)) + { + case DSL_CPE_STATUS_KEY_INVALID: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " invalid key %s for %s" DSL_CPE_CRLF , rec.sCmdShort, rec.sCmdLong); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + + case DSL_CPE_STATUS_DUPLICATE_KEY: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " duplicate key %s for %s" DSL_CPE_CRLF , rec.sCmdShort, rec.sCmdLong); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + + case DSL_CPE_STATUS_MEM_EXHAUSTED: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " memory error" DSL_CPE_CRLF ); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + + case DSL_CPE_STATUS_OK: + break; + + default: + DSL_CPE_FPrintf(DSL_CPE_STDERR, DSL_CPE_PREFIX " insert key aborted" DSL_CPE_CRLF ); + free(rec.sCmdShort); + free(rec.sCmdLong); + return DSL_ERROR; + } +#endif + + return DSL_SUCCESS; +} + + +/** + Clean command list. + + \return + DSL_SUCCESS successfull operation +*/ +DSL_Error_t DSL_CPE_CLI_CommandClear(DSL_void_t) +{ + DSL_CPE_nodeType *tmp_root = root_node; + + /*root_node = DSL_NULL;*/ + DSL_CPE_treeDelete(tmp_root); + + return DSL_SUCCESS; +} + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_CLI_ResourceUsageGet( + DSL_CLI_ResourceUsageStatisticsData_t *pData) +{ + DSL_Error_t ret = DSL_SUCCESS; + unsigned int ResStatic = 0, ResDynamic = 0; + + if (pData == DSL_NULL) + { + return DSL_ERROR; + } + + pData->staticMemUsage = 0; + pData->dynamicMemUsage = 0; + + pData->staticMemUsage += sizeof(CLI_EventText) ; + + DSL_CPE_treeResourceUsageGet(root_node, &ResStatic, &ResDynamic); + + pData->staticMemUsage += ResStatic; + pData->dynamicMemUsage += ResDynamic; + + return ret; +} + +static void DSL_CPE_treeResourceUsageGet( + DSL_CPE_nodeType *node, + unsigned int *pResStatic, + unsigned int *pResDynamic) +{ + if(node == DSL_NULL) + return; + + DSL_CPE_treeResourceUsageGet(node->left, pResStatic, pResDynamic); + + if (node->rec.psHelp) + { + *pResStatic += strlen(node->rec.psHelp); + } + + *pResDynamic += sizeof(DSL_CPE_nodeType); + if (node->key) + { + *pResDynamic += strlen(node->key); + } + + if (node->rec.sCmdShort) + { + *pResDynamic += strlen(node->rec.sCmdShort); + } + + if (node->rec.sCmdLong) + { + *pResDynamic += strlen(node->rec.sCmdLong); + } + + DSL_CPE_treeResourceUsageGet(node->right, pResStatic, pResDynamic); + + return; +} +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +/** + allocate node for data and insert in tree +*/ +static DSL_CPE_statusEnum DSL_CPE_keyInsert(DSL_CPE_keyType key, DSL_CPE_recType *rec) +{ + DSL_CPE_nodeType *x, *current, *parent; + + if(key == DSL_NULL) + return DSL_CPE_STATUS_KEY_INVALID; + + /* find future parent */ + current = root_node; + parent = 0; + while (current) { + if (compEQ(key, current->key)) + return DSL_CPE_STATUS_DUPLICATE_KEY; + parent = current; + current = compLT(key, current->key) ? + current->left : current->right; + } + + /* setup new node */ + if ((x = malloc(sizeof(*x))) == 0) { + return DSL_CPE_STATUS_MEM_EXHAUSTED; + } + x->parent = parent; + x->left = DSL_NULL; + x->right = DSL_NULL; + x->key = key; + cpe_control_memcpy_s((void *)&x->rec, sizeof(DSL_CPE_recType), (void *)rec, sizeof(DSL_CPE_recType)); + + /* insert x in tree */ + if(parent) + if(compLT(x->key, parent->key)) + parent->left = x; + else + parent->right = x; + else + root_node = x; + + return DSL_CPE_STATUS_OK; +} + +/** + delete node from tree +*/ +static DSL_CPE_statusEnum DSL_CPE_keyDelete(DSL_CPE_keyType key) +{ + DSL_CPE_nodeType *x, *y, *z; + + /* find node in tree */ + z = root_node; + + while(z != DSL_NULL) { + if(compEQ(key, z->key)) + break; + else + z = compLT(key, z->key) ? z->left : z->right; + } + + if (!z) return DSL_CPE_STATUS_KEY_NOT_FOUND; + + /* find tree successor */ + if (z->left == DSL_NULL || z->right == DSL_NULL) + y = z; + else { + y = z->right; + while (y->left != DSL_NULL) y = y->left; + } + + /* x is y's only child */ + if (y->left != DSL_NULL) + x = y->left; + else + x = y->right; + + /* remove y from the parent chain */ + if (x) x->parent = y->parent; + if (y->parent) + if (y == y->parent->left) + y->parent->left = x; + else + y->parent->right = x; + else + root_node = x; + + /* if z and y are not the same, replace z with y. */ + if (y != z) { + y->left = z->left; + if (y->left) y->left->parent = y; + y->right = z->right; + if (y->right) y->right->parent = y; + y->parent = z->parent; + if (z->parent) + if (z == z->parent->left) + z->parent->left = y; + else + z->parent->right = y; + else + root_node = y; + DSL_CPE_nodeDelete(z); + } else { + DSL_CPE_nodeDelete(y); + } + + return DSL_CPE_STATUS_OK; +} + +/** + find node containing data +*/ +DSL_CPE_statusEnum DSL_CPE_keyFind(DSL_CPE_keyType key, DSL_CPE_recType *rec) +{ + DSL_CPE_nodeType *current = root_node; + while(current != DSL_NULL) + { + if(compEQ(key, current->key)) + { + cpe_control_memcpy_s((void *)rec, sizeof(DSL_CPE_recType), (void *)¤t->rec, sizeof(DSL_CPE_recType)); + + return DSL_CPE_STATUS_OK; + } + else + { + current = compLT(key, current->key) ? + current->left : current->right; + } + } + return DSL_CPE_STATUS_KEY_NOT_FOUND; +} + + +/** + print binary tree +*/ +static void DSL_CPE_treePrint( + DSL_CPE_nodeType *node, + unsigned int mask, + DSL_CPE_File_t *out) +{ + DSL_int_t j = 0; + DSL_int_t nChar = 0, nFillChar = 0; + DSL_int_t nHelpClm = 18; + + if(node == DSL_NULL) + return; + + DSL_CPE_treePrint(node->left, mask, out); + + while(1) + { +#ifdef INCLUDE_DEPRECATED + if ( (mask & DSL_CPE_MASK_DEPRECATED) && !(node->rec.mask & DSL_CPE_MASK_DEPRECATED) ) + break; +#endif /* INCLUDE_DEPRECATED*/ + + if(node->rec.mask & (mask & (~DSL_CPE_MASK_DEPRECATED))) + { + if((mask & DSL_CPE_MASK_DETAILED) == DSL_CPE_MASK_DETAILED) + { + if(node->rec.func) + { + #ifndef DSL_CPE_DEBUG_DISABLE + + #ifdef DSL_CPE_MASK_LONG + if((node->rec.mask & DSL_CPE_MASK_LONG) == DSL_CPE_MASK_LONG) + #endif + DSL_CPE_CLI_PrintHelp(node->rec.psHelp, node->rec.sCmdLong, + node->rec.sCmdShort, node->rec.mask, node->rec.printFunc, out); + #else + DSL_CPE_FPrintf (out, DSL_CLI_HELP_NOT_AVAILABLE); + #endif /* DSL_CPE_DEBUG_DISABLE */ + } + } + else + { + #ifdef DSL_CPE_MASK_LONG + /* + if(node->rec.mask & DSL_CPE_MASK_LONG) + nHelpClm *= 3; + */ + + /*if((node->rec.mask & DSL_CPE_MASK_LONG) == (mask & DSL_CPE_MASK_LONG))*/ + if((node->rec.mask & DSL_CPE_MASK_LONG) == DSL_CPE_MASK_LONG) + #endif + { + /*nChar = DSL_CPE_FPrintf(out, " %s,", node->key);*/ + nChar = DSL_CPE_FPrintf(out, " %s,", node->rec.sCmdShort); + nFillChar = nHelpClm - nChar; + if (nFillChar > 0) + { + for (j = 0; j < nFillChar; j++) DSL_CPE_FPrintf(out, " "); + } + DSL_CPE_FPrintf(out, "%s" DSL_CPE_CRLF , node->rec.sCmdLong); + } + } + } + + break; + } /* while(1)*/ + + DSL_CPE_treePrint(node->right, mask, out); + return; +} + +/** + delete complete binary tree +*/ +static void DSL_CPE_treeDelete(DSL_CPE_nodeType *node) +{ + if(node != DSL_NULL) + { + DSL_CPE_treeDelete(node->left); + DSL_CPE_treeDelete(node->right); + DSL_CPE_keyDelete(node->key); + } +} + +/** + delete node of binary tree +*/ +static void DSL_CPE_nodeDelete(DSL_CPE_nodeType *node) +{ + if(node != DSL_NULL) + { + if (node->key == node->rec.sCmdLong) + { + free(node->rec.sCmdLong); + } + else if (node->key == node->rec.sCmdShort) + { + free(node->rec.sCmdShort); + } + + free(node); + } +} + + +/** + Remove leading, tailing and double whitespaces + Arguments has to have only one space in between to get sure that the CLI + comments are working correctly. +*/ +char *DSL_CPE_CLI_WhitespaceRemove(char *str) +{ + char *buf; + char *pRead, *pWrite; + int i = 0; + + /* remove leading whitespaces */ + for (buf = str; buf && *buf && isspace((int)(*buf)); ++buf) + { + ; + } + + /* remove double spaces in between and at the end */ + pRead = buf; + pWrite = buf; + for( i = 0; pWrite && pRead && *pRead != '\0'; ++pRead ) + { + if (isspace((int)(*pRead))) + { + if ( (i == 0) && (*(pRead + 1) != '\0') ) + { + *pWrite = *pRead; + pWrite++; + i++; + } + } + else + { + i = 0; + *pWrite = *pRead; + pWrite++; + } + } + + /* Write string termination */ + if (pWrite && (pWrite != pRead)) + *pWrite = '\0'; + + return buf; +} + + +DSL_Error_t DSL_CPE_CLI_PrintHelpDevice( + const DSL_char_t *psHelp, + DSL_char_t *psCmdLong, + DSL_char_t *psCmdShort, + DSL_uint32_t nCmdMask, + DSL_CPE_File_t *out) +{ + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_CPE_GetGlobalContext(); + DSL_char_t *sDeviceHelp = "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF; + DSL_char_t *sHelp = DSL_NULL; + sHelp = (DSL_char_t*)DSL_CPE_Malloc(4096); + if (sHelp == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CLI_HELP_MEMORY_ERROR); + return DSL_ERROR; + } + if (!pCtrlCtx->bBackwardCompMode) + { + snprintf(sHelp, 4096, psHelp, psCmdLong, psCmdShort, sDeviceHelp, sDeviceHelp); + } + else + { + snprintf(sHelp, 4096, psHelp, psCmdLong, psCmdShort, "",""); + } + DSL_CPE_FPrintf(out, "%s", sHelp); + DSL_CPE_Free(sHelp); + return DSL_SUCCESS; +} +DSL_Error_t DSL_CPE_CLI_PrintHelpDevice1Arg( + const DSL_char_t *psHelp, + DSL_char_t *psCmdLong, + DSL_char_t *psCmdShort, + DSL_uint32_t nCmdMask, + DSL_CPE_File_t *out) +{ + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_CPE_GetGlobalContext(); + DSL_char_t *sDeviceHelp = "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF; + DSL_char_t *sDeviceHelpInput = "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF; + DSL_char_t *sHelp = DSL_NULL; + sHelp = (DSL_char_t*)DSL_CPE_Malloc(4096); + if (sHelp == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CLI_HELP_MEMORY_ERROR); + return DSL_ERROR; + } + if (!pCtrlCtx->bBackwardCompMode) + { + snprintf(sHelp, 4096, psHelp, psCmdLong, psCmdShort, sDeviceHelpInput, sDeviceHelp); + } + else + { + snprintf(sHelp, 4096, psHelp, psCmdLong, psCmdShort, "",""); + } + DSL_CPE_FPrintf(out, "%s", sHelp); + + DSL_CPE_Free(sHelp); + return DSL_SUCCESS; +} + +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ diff --git a/src/dsl_cpe_cli.h b/src/dsl_cpe_cli.h new file mode 100644 index 0000000..89ac6e5 --- /dev/null +++ b/src/dsl_cpe_cli.h @@ -0,0 +1,235 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef DSL_CPE_CLI_H +#define DSL_CPE_CLI_H + +/** \file + DSL CPE API command line interface +*/ +#include "drv_dsl_cpe_api_error.h" +#include "dsl_cpe_safec_wrapper.h" + +/** maximum arguments, used for spawning a shell with external commands */ +#define DSL_MAX_ARGS 16 + +#ifdef DSL_CPE_DEBUG_DISABLE +#define USAGE "" DSL_CPE_CRLF +#endif /* DSL_CPE_DEBUG_DISABLE */ + +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) | 1 + +/** device mask */ +#define DSL_CPE_MASK_DEVICE 0x0001 +/** g997 mask */ +#define DSL_CPE_MASK_G997 0x0002 +/** PM mask */ +#define DSL_CPE_MASK_PM 0x0004 +/** BND (bonding) mask */ +#define DSL_CPE_MASK_BND 0x0080 +/** DSM (Digital Spectrum Management/vectoring) mask */ +#define DSL_CPE_MASK_DSM 0x0010 + +#define DSL_CPE_MASK_ALL (DSL_CPE_MASK_DEVICE | DSL_CPE_MASK_G997 | \ + DSL_CPE_MASK_PM | DSL_CPE_MASK_BND | \ + DSL_CPE_MASK_DSM) + +/** detailed information (-h) */ +#define DSL_CPE_MASK_DETAILED 0x4000 +/** long form of the command */ +#define DSL_CPE_MASK_LONG 0x8000 +/** Deprecated CLI functions */ +#define DSL_CPE_MASK_DEPRECATED 0x10000 +/** Commands available after Power Down mask */ +#define DSL_CPE_MASK_AFTER_POWER_DOWN 0x20000 + +#define DSL_CPE_CLI_CMD_ADD_COMM(short_name, long_name, pFunc, pHelp) \ + DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, 0x0, NULL) + +#define DSL_CPE_CLI_CMD_ADD_DEVICE(short_name, long_name, pFunc, pHelp) \ + DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, 0x0, DSL_CPE_CLI_PrintHelpDevice) + +#define DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG(short_name, long_name, pFunc, pHelp) \ + DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, 0x0, DSL_CPE_CLI_PrintHelpDevice1Arg) + +#define DSL_CPE_CLI_CMD_ADD_DEPR(short_name, long_name, pFunc, pHelp) \ + DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, DSL_CPE_MASK_DEPRECATED) + +#define DSL_CPE_RET "nReturn=%d%s " +#define DSL_CPE_RET_VAL(ret) ret, DSL_CPE_Fd2DevStr(fd) +/** Callback for custom Help display **/ +typedef DSL_Error_t (* DSL_CPE_CLI_PrintHelpCallback_t)(const DSL_char_t *psHelp, + DSL_char_t *psCmdLong, + DSL_char_t *psCmdShort, + DSL_uint32_t nCmdMask, + DSL_CPE_File_t *out); + +/** Context for a registered CLI */ +typedef struct DSL_CLI_Context DSL_CLI_Context_t; +/** buffer for preparing event text decoding */ +extern DSL_char_t CLI_EventText[16000]; + +/** Exit callback with private pointer. + (pointer can be defined with \ref DSL_CPE_CLI_Register) */ +typedef DSL_Error_t (*DSL_CPE_Exit_Callback_t) ( DSL_void_t* ); +/** Event callback with private pointer (from \ref DSL_CPE_CLI_Register) + and text of decoded event */ +typedef DSL_Error_t (*DSL_CLI_Event_Callback_t) ( DSL_void_t*, DSL_char_t* ); + +DSL_Error_t DSL_CPE_CLI_CommandAdd +( + DSL_char_t *name, + DSL_char_t *long_form, + DSL_int_t (*func)(DSL_int_t, DSL_char_t*, DSL_CPE_File_t*), + const DSL_char_t *psHelp, + DSL_uint32_t nCmdSortMask, + DSL_CPE_CLI_PrintHelpCallback_t printCallback +); + +DSL_Error_t DSL_CPE_CLI_CommandClear(DSL_void_t); + +DSL_void_t DSL_CPE_CLI_AccessCommandsRegister(DSL_void_t); + +DSL_int_t DSL_CPE_CLI_CommandExecute +( + DSL_int_t fd, + DSL_char_t *cmd, + DSL_char_t *arg, + DSL_CPE_File_t *out +); + +char *DSL_CPE_CLI_WhitespaceRemove(char *str); + +/** + Checks if the command string includes option to display help text. + + \param pCommands + user command line arguments + + \return + returns 0 in case of no help request or any other value if help is + requested from user. +*/ +DSL_int_t DSL_CPE_CLI_CheckHelp (const DSL_char_t * pCommands); + +DSL_int_t DSL_CPE_CLI_HelpPrint +( + DSL_int_t fd, + DSL_char_t *, + DSL_CPE_File_t* +); + +typedef enum +{ + DSL_CLI_EQUALS = 0, + DSL_CLI_MIN, + DSL_CLI_MAX +} DSL_CLI_ParamCheckType_t; + +/** + This structure is used to get resource usage statistics + data +*/ +typedef struct +{ + /** + Total memory allocated statically (bytes) */ + DSL_uint32_t staticMemUsage; + /** + Total memory allocated dynamically (bytes) */ + DSL_uint32_t dynamicMemUsage; +} DSL_CLI_ResourceUsageStatisticsData_t; + + +DSL_boolean_t DSL_CPE_CLI_CheckParamNumber +( + DSL_char_t *pCommands, + DSL_int_t nParams, + DSL_CLI_ParamCheckType_t nCheckType +); + +DSL_Error_t DSL_CPE_CLI_Init(DSL_void_t); +DSL_Error_t DSL_CPE_CLI_Shutdown(DSL_void_t); +DSL_Error_t DSL_CPE_CLI_HandleEvent(DSL_char_t *pMsg); +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_CLI_ResourceUsageGet( + DSL_CLI_ResourceUsageStatisticsData_t *pData); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +DSL_Error_t DSL_CPE_CLI_Register +( + DSL_CLI_Context_t **pNewCLIContext, + DSL_void_t *pCBContext, + DSL_CPE_Exit_Callback_t pExitCallback, + DSL_CLI_Event_Callback_t pEventCallback +); + +#if defined(INCLUDE_DSL_API_CONSOLE_EXTRA) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_Error_t DSL_CPE_CLI_Unregister(DSL_CLI_Context_t *pCLIContext); +#endif /* #if defined(INCLUDE_DSL_API_CONSOLE_EXTRA) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +/** + Read the firmware binary from file system. + + \param sFirmwareName Firmware binary file name [I] + \param pFirmware Firmware binary data [O] + \param nFirmwareSize Firmware size [O] + + \remark + The data memory will be allocated via DSL_CPE_Malloc() . + It should be freed after usage with DSL_CPE_Free() . + + \return + - DSL_ERROR On error + - DSL_SUCCESS Binary loaded successfully into the memory +*/ +DSL_Error_t DSL_FirmwareLoad +( + DSL_char_t const *sFirmwareName, + DSL_uint8_t **pFirmware, + DSL_uint32_t *nFirmwareSize +); + +/** + Write a binary to the file system. + + \param sFirmwareName Firmware binary file name [I] + \param pFirmware Firmware binary data [I] + \param nFirmwareSize Firmware size [I] + + \return + - DSL_ERROR On error + - DSL_SUCCESS Binary loaded successfully into the memory +*/ +DSL_Error_t DSL_FirmwareWrite +( + DSL_char_t const *sFirmwareName, + DSL_uint8_t *pFirmware, + DSL_uint32_t nFirmwareSize +); + +DSL_Error_t DSL_CPE_CLI_PrintHelpDevice( + const DSL_char_t *psHelp, + DSL_char_t *psCmdLong, + DSL_char_t *psCmdShort, + DSL_uint32_t nCmdMask, + DSL_CPE_File_t *out); +DSL_Error_t DSL_CPE_CLI_PrintHelpDevice1Arg( + const DSL_char_t *psHelp, + DSL_char_t *psCmdLong, + DSL_char_t *psCmdShort, + DSL_uint32_t nCmdMask, + DSL_CPE_File_t *out); +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#endif /* DSL_CPE_CLI_H */ + diff --git a/src/dsl_cpe_cli_access.c b/src/dsl_cpe_cli_access.c new file mode 100644 index 0000000..b407faf --- /dev/null +++ b/src/dsl_cpe_cli_access.c @@ -0,0 +1,13186 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL CLI, access function implementation +*/ + +#include "dsl_cpe_control.h" +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) && !defined(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT) + +#include "dsl_cpe_cli.h" +#include "dsl_cpe_cli_console.h" +#include "dsl_cpe_debug.h" +#include "drv_dsl_cpe_api.h" +#include "drv_dsl_cpe_api_ioctl.h" + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +#include "dsl_cpe_dti.h" +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CLI + + +/* for debugging: */ +#ifdef DSL_CLI_LOCAL +#undef DSL_CLI_LOCAL +#endif +#if 1 +#define DSL_CLI_LOCAL +#else +#define DSL_CLI_LOCAL static +#endif + +DSL_void_t DSL_CPE_CLI_DeviceCommandsRegister ( DSL_void_t ); +#ifdef INCLUDE_DSL_ADSL_MIB +DSL_void_t DSL_CPE_CLI_MibCommandsRegister ( DSL_void_t ); +#endif /* INCLUDE_DSL_ADSL_MIB*/ + +const char *sFailureReturn = "nReturn=%d%s"; + +#ifndef DSL_CPE_DEBUG_DISABLE +static const DSL_char_t g_sCcaDbgmlg[] = + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_CCA_debugModules_t nCcaDbgModule (dec)" DSL_CPE_CRLF + " DSL_CCA_DBG_APP = 1" DSL_CPE_CRLF + " DSL_CCA_DBG_OS = 2" DSL_CPE_CRLF + " DSL_CCA_DBG_CLI = 3" DSL_CPE_CRLF + " DSL_CCA_DBG_PIPE = 4" DSL_CPE_CRLF + " DSL_CCA_DBG_CONSOLE = 6" DSL_CPE_CRLF + " DSL_CCA_DBG_TCPMSG = 7" DSL_CPE_CRLF + " DSL_CCA_DBG_MULTIMODE = 8" DSL_CPE_CRLF + " DSL_CCA_DBG_NOTIFICATIONS = 9" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_CCA_debugLevels_t nDbgLevel (hex)" DSL_CPE_CRLF + " DSL_CCA_DBG_NONE = 0x00" DSL_CPE_CRLF + " DSL_CCA_DBG_PRN = 0x01" DSL_CPE_CRLF + " DSL_CCA_DBG_ERR = 0x02" DSL_CPE_CRLF + " DSL_CCA_DBG_WRN = 0x40" DSL_CPE_CRLF + " DSL_CCA_DBG_MSG = 0x80" DSL_CPE_CRLF + " DSL_CCA_DBG_LOCAL = 0xFF" DSL_CPE_CRLF + DSL_CPE_CRLF ""; + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_CCA_DBG_ModuleLevelGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_CCA_debugLevels_t nDbgLvl = DSL_CCA_DBG_NONE; + DSL_CCA_debugModules_t nDbgModule = DSL_CCA_DBG_NO_BLOCK; + int intDbgModule = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &intDbgModule); + nDbgModule = intDbgModule; + + if ((nDbgModule > DSL_CCA_DBG_NO_BLOCK) && (nDbgModule < DSL_CCA_DBG_LAST_BLOCK)) + { + nDbgLvl = DSL_CCA_g_dbgLvl[nDbgModule].nDbgLvl; + } + else + { + ret = -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDbgLevel=%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), nDbgLvl); + + return 0; +} +#endif + +#ifndef DSL_CPE_DEBUG_DISABLE +static const DSL_char_t g_sCcaDbgmls[] = + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_CCA_debugModules_t nCcaDbgModule (dec)" DSL_CPE_CRLF + " DSL_CCA_DBG_APP = 1" DSL_CPE_CRLF + " DSL_CCA_DBG_OS = 2" DSL_CPE_CRLF + " DSL_CCA_DBG_CLI = 3" DSL_CPE_CRLF + " DSL_CCA_DBG_PIPE = 4" DSL_CPE_CRLF + " DSL_CCA_DBG_CONSOLE = 6" DSL_CPE_CRLF + " DSL_CCA_DBG_TCPMSG = 7" DSL_CPE_CRLF + " DSL_CCA_DBG_MULTIMODE = 8" DSL_CPE_CRLF + " DSL_CCA_DBG_NOTIFICATIONS = 9" DSL_CPE_CRLF + "- DSL_CCA_debugLevels_t nDbgLevel (hex)" DSL_CPE_CRLF + " DSL_CCA_DBG_NONE = 0x00" DSL_CPE_CRLF + " DSL_CCA_DBG_PRN = 0x01" DSL_CPE_CRLF + " DSL_CCA_DBG_ERR = 0x02" DSL_CPE_CRLF + " DSL_CCA_DBG_WRN = 0x40" DSL_CPE_CRLF + " DSL_CCA_DBG_MSG = 0x80" DSL_CPE_CRLF + " DSL_CCA_DBG_LOCAL = 0xFF" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_CCA_DBG_ModuleLevelSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_CCA_debugLevels_t nDbgLvl = DSL_CCA_DBG_NONE; + DSL_CCA_debugModules_t nDbgModule = DSL_CCA_DBG_NO_BLOCK; + int intDbgModule = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %x", &intDbgModule, &nDbgLvl); + nDbgModule = intDbgModule; + + if ((nDbgModule > DSL_CCA_DBG_NO_BLOCK) && (nDbgModule < DSL_CCA_DBG_LAST_BLOCK)) + { + if ((nDbgLvl == DSL_CCA_DBG_PRN) || (nDbgLvl == DSL_CCA_DBG_ERR) || + (nDbgLvl == DSL_CCA_DBG_WRN) || (nDbgLvl == DSL_CCA_DBG_MSG) || + (nDbgLvl == DSL_CCA_DBG_LOCAL)) + { + DSL_CCA_g_dbgLvl[nDbgModule].nDbgLvl = nDbgLvl; + } + else + { + ret = -1; + } + } + else + { + ret = -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDbgLevel=%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), nDbgLvl); + + return 0; +} +#endif + +static const DSL_char_t g_sDBGmlg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_debugModules_t nDbgModule (dec)" DSL_CPE_CRLF + " DSL_DBG_CPE_API = 1" DSL_CPE_CRLF + " DSL_DBG_G997 = 2" DSL_CPE_CRLF + " DSL_DBG_PM = 3" DSL_CPE_CRLF + " DSL_DBG_MIB = 4" DSL_CPE_CRLF + " DSL_DBG_CEOC = 5" DSL_CPE_CRLF + " DSL_DBG_LED = 6 (not used anymore!)" DSL_CPE_CRLF + " DSL_DBG_SAR = 7 (not used anymore!)" DSL_CPE_CRLF + " DSL_DBG_DEVICE = 8" DSL_CPE_CRLF + " DSL_DBG_AUTOBOOT_THREAD = 9" DSL_CPE_CRLF + " DSL_DBG_OS = 10" DSL_CPE_CRLF + " DSL_DBG_CALLBACK = 11" DSL_CPE_CRLF + " DSL_DBG_MESSAGE_DUMP = 12" DSL_CPE_CRLF + " DSL_DBG_LOW_LEVEL_DRIVER = 13" DSL_CPE_CRLF + " DSL_DBG_MULTIMODE = 14" DSL_CPE_CRLF + " DSL_DBG_NOTIFICATIONS = 15" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_debugLevels_t nDbgLevel (hex)" DSL_CPE_CRLF + " DSL_DBG_NONE = 0x00" DSL_CPE_CRLF + " DSL_DBG_PRN = 0x01" DSL_CPE_CRLF + " DSL_DBG_ERR = 0x02" DSL_CPE_CRLF + " DSL_DBG_WRN = 0x40" DSL_CPE_CRLF + " DSL_DBG_MSG = 0x80" DSL_CPE_CRLF + " DSL_DBG_LOCAL = 0xFF" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_ModuleLevelGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_DBG_ModuleLevel_t pData; + unsigned int nDbgModule = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_DBG_ModuleLevel_t)); + + sscanf (pCommands, "%u", &nDbgModule); + + pData.data.nDbgModule = nDbgModule; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_LEVEL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDbgLevel=%x" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nDbgLevel); + } + + return 0; +} + +static const DSL_char_t g_sDBGmls[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_debugModules_t nDbgModule (dec)" DSL_CPE_CRLF + " DSL_DBG_NO_BLOCK = 0 (set all)" DSL_CPE_CRLF + " DSL_DBG_CPE_API = 1" DSL_CPE_CRLF + " DSL_DBG_G997 = 2" DSL_CPE_CRLF + " DSL_DBG_PM = 3" DSL_CPE_CRLF + " DSL_DBG_MIB = 4" DSL_CPE_CRLF + " DSL_DBG_CEOC = 5" DSL_CPE_CRLF + " DSL_DBG_LED = 6 (not used anymore!)" DSL_CPE_CRLF + " DSL_DBG_SAR = 7 (not used anymore!)" DSL_CPE_CRLF + " DSL_DBG_DEVICE = 8" DSL_CPE_CRLF + " DSL_DBG_AUTOBOOT_THREAD = 9" DSL_CPE_CRLF + " DSL_DBG_OS = 10" DSL_CPE_CRLF + " DSL_DBG_CALLBACK = 11" DSL_CPE_CRLF + " DSL_DBG_MESSAGE_DUMP = 12" DSL_CPE_CRLF + " DSL_DBG_LOW_LEVEL_DRIVER = 13" DSL_CPE_CRLF + " DSL_DBG_MULTIMODE = 14" DSL_CPE_CRLF + " DSL_DBG_NOTIFICATIONS = 15" DSL_CPE_CRLF + "- DSL_debugLevels_t nDbgLevel (hex)" DSL_CPE_CRLF + " DSL_DBG_NONE = 0x00" DSL_CPE_CRLF + " DSL_DBG_PRN = 0x01" DSL_CPE_CRLF + " DSL_DBG_ERR = 0x02" DSL_CPE_CRLF + " DSL_DBG_WRN = 0x40" DSL_CPE_CRLF + " DSL_DBG_MSG = 0x80" DSL_CPE_CRLF + " DSL_DBG_LOCAL = 0xFF" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_ModuleLevelSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_DBG_ModuleLevel_t pData; + unsigned int nDbgModule = 0; + unsigned int nDbgLevel = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_DBG_ModuleLevel_t)); + + sscanf (pCommands, "%u %x", &nDbgModule, &nDbgLevel); + + pData.data.nDbgModule = nDbgModule; + pData.data.nDbgLevel = nDbgLevel; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_LEVEL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +#ifndef DSL_CPE_DEBUG_DISABLE +static const DSL_char_t g_sCcaDbgmdg[] = + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_CCA_debugDestinations_t nDbgDestination" DSL_CPE_CRLF + " DSL_CCA_DBG_DST_CONSOLE = 0" DSL_CPE_CRLF + " DSL_CCA_DBG_DST_LOGGER = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_CCA_DBG_ModuleDestinationGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_CCA_debugDestinations_t nDbgDestination = DSL_CCA_DBG_DST_CONSOLE; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + nDbgDestination = DSL_CCA_g_dbgDestination; + + DSL_CPE_FPrintf (out, DSL_CPE_RET "nDbgDestination=%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), nDbgDestination); + + return 0; +} +#endif + +#ifndef DSL_CPE_DEBUG_DISABLE +static const DSL_char_t g_sCcaDbgmds[] = + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_CCA_debugDestinations_t nDbgDestination" DSL_CPE_CRLF + " DSL_CCA_DBG_DST_CONSOLE = 0" DSL_CPE_CRLF + " DSL_CCA_DBG_DST_LOGGER = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_CCA_DBG_ModuleDestinationSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_CCA_debugDestinations_t nDbgDestination = DSL_CCA_DBG_DST_CONSOLE; + int dbgDestination = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &dbgDestination); + nDbgDestination = dbgDestination; + + DSL_CCA_g_dbgDestination = nDbgDestination; + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDbgDestination=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), nDbgDestination); + + return 0; +} +#endif + +static const DSL_char_t g_sDBGmdg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_debugDestinations_t nDbgDestination" DSL_CPE_CRLF + " DSL_DBG_DST_CONSOLE = 0" DSL_CPE_CRLF + " DSL_DBG_DST_LOGGER = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_ModuleDestinationGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_DBG_ModuleDestination_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_DBG_ModuleDestination_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_DESTINATION_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDbgDestination=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nDbgDestination); + } + + return 0; +} + +static const DSL_char_t g_sDBGmds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_debugDestinations_t nDbgDestination" DSL_CPE_CRLF + " DSL_DBG_DST_CONSOLE = 0" DSL_CPE_CRLF + " DSL_DBG_DST_LOGGER = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_ModuleDestinationSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_DBG_ModuleDestination_t pData; + int dbgDestination = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_DBG_ModuleDestination_t)); + + sscanf (pCommands, "%d", &dbgDestination); + pData.data.nDbgDestination = dbgDestination; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_DESTINATION_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORTs */ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +static const DSL_char_t g_sNsecs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_char_t notify_script[1-256] (Attention: Use absolute firmware path only!)" + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_NotificationScriptExecuteConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sNotifyScript[256] = { 0 }; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%256s", sNotifyScript); + + /* Get ADSL script file */ + if ( strlen(sNotifyScript) > 0 ) + { + if (DSL_CPE_IsFileExists(sNotifyScript)) + { + if (g_sRcScript) + { + DSL_CPE_Free(g_sRcScript); + g_sRcScript = DSL_NULL; + } + + g_sRcScript = DSL_CPE_Malloc (strlen (sNotifyScript) + 1); + + if (g_sRcScript) + { + cpe_control_strncpy_s(g_sRcScript, strlen (sNotifyScript) + 1, sNotifyScript, strlen (sNotifyScript)); + } + } + else + { + ret = -1; + } + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + if (ret < 0) + { + DSL_CPE_FPrintf(out, " (Have you used absolute script path?)" DSL_CPE_CRLF); + } + + return 0; +} +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +static const DSL_char_t g_sNsecg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_char_t notify_script[256]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_NotificationScriptExecuteConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + + if(g_sRcScript != DSL_NULL) + { + DSL_CPE_FPrintf (out, " notify_script=%s", g_sRcScript); + } + else + { + DSL_CPE_FPrintf (out, " notify_script=n/a"); + } + + DSL_CPE_FPrintf (out, DSL_CPE_CRLF); + + return 0; +} +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAsecg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_char_t adsl_script[256]" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_char_t vdsl_script[256]" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootScriptExecuteConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + + if(g_sAdslScript != DSL_NULL) + { + DSL_CPE_FPrintf (out, " adsl_script=%s", g_sAdslScript); + } + else + { + DSL_CPE_FPrintf (out, " adsl_script=n/a"); + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if(g_sVdslScript != DSL_NULL) + { + DSL_CPE_FPrintf (out, " vdsl_script=%s", g_sVdslScript); + } + else + { + DSL_CPE_FPrintf (out, " vdsl_script=n/a"); + } +#endif + + DSL_CPE_FPrintf (out, DSL_CPE_CRLF); + + return 0; +} +#endif +#endif + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAsecs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_char_t adsl_script[1-256]" +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 0) + " (let empty to clear currently set value," + " adsl_script must include the full path to the script)" DSL_CPE_CRLF +#else + " (enter '.' to let adsl script unchanged)" DSL_CPE_CRLF + "- DSL_char_t vdsl_script[1-256]" + " (enter '.' to let vdsl script unchanged, or let empty to clear currently set value," + " let both parameters empty to clear currently set values" + " vdsl_script must include the full path to the script)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootScriptExecuteConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sAdslScript[256] = { 0 }; +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_char_t sVdslScript[256] = { 0 }; +#endif + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_MAX) == DSL_FALSE) +#else + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MAX) == DSL_FALSE) +#endif + { + return -1; + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + sscanf (pCommands, "%256s %256s", sAdslScript, sVdslScript); +#else + sscanf (pCommands, "%256s", &sAdslScript); +#endif + + /* Get ADSL script file */ + if ( strlen(sAdslScript) > 0 ) + { + if ( strcmp(sAdslScript, ".") != 0 ) + { + if (DSL_CPE_IsFileExists(sAdslScript)) + { + if (g_sAdslScript) + { + DSL_CPE_Free(g_sAdslScript); + g_sAdslScript = DSL_NULL; + } + g_sAdslScript = DSL_CPE_Malloc (strlen (sAdslScript) + 1); + if (g_sAdslScript) + { + cpe_control_strncpy_s(g_sAdslScript, strlen (sAdslScript) + 1, sAdslScript, strlen (sAdslScript)); + } + } + else + { + ret = -1; + } + } + } + else + { + DSL_CPE_Free(g_sAdslScript); + g_sAdslScript = DSL_NULL; + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + /* Get VDSL script file */ + if (strlen(sVdslScript) > 0) + { + if ( strcmp(sVdslScript, ".") != 0 ) + { + if (DSL_CPE_IsFileExists(sVdslScript)) + { + if (g_sVdslScript) + { + DSL_CPE_Free(g_sVdslScript); + g_sVdslScript = DSL_NULL; + } + g_sVdslScript = DSL_CPE_Malloc (strlen (sVdslScript) + 1); + if (g_sVdslScript) + { + cpe_control_strncpy_s(g_sVdslScript, strlen (sVdslScript) + 1, sVdslScript, strlen (sVdslScript)); + } + } + else + { + ret = -1; + } + } + } + else + { + DSL_CPE_Free(g_sVdslScript); + g_sVdslScript = DSL_NULL; + } +#endif + + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + if (ret < 0) + { + DSL_CPE_FPrintf(out, " (Have you used absolute script path?)" DSL_CPE_CRLF); + } + + return 0; +} +#endif +#endif + +static const DSL_char_t g_sAcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AutobootCtrlSet_t nCommand" DSL_CPE_CRLF + " stop = 0" DSL_CPE_CRLF + " start = 1" DSL_CPE_CRLF + " restart = 2" DSL_CPE_CRLF + " continue = 3" DSL_CPE_CRLF + " disable = 4" DSL_CPE_CRLF + " enable = 5" DSL_CPE_CRLF + " restart full = 6" DSL_CPE_CRLF + " power down = 7" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootControlSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_AutobootControl_t pData; + unsigned int nCommand = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_AutobootControl_t)); + + sscanf (pCommands, "%u", &nCommand); + + pData.data.nCommand = nCommand; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONTROL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAcfgs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bWaitBeforeConfigWrite" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeLinkActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeRestart" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeConfigWrite (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeLinkActivation (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeRestart (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootConfigOptionSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_boolean_t bAdsl = DSL_FALSE, bVdsl = DSL_FALSE; + DSL_boolean_t bAutoContinueWaitBeforeLinkActivation = DSL_TRUE, + bAutoContinueWaitBeforeConfigWrite = DSL_TRUE, + bAutoContinueWaitBeforeRestart = DSL_TRUE, + bWaitBeforeLinkActivation = DSL_FALSE, + bWaitBeforeConfigWrite = DSL_FALSE, bWaitBeforeRestart = DSL_FALSE; + DSL_AutobootConfig_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + unsigned int nAutoContinueWaitBeforeLinkActivation; + unsigned int nAutoContinueWaitBeforeConfigWrite; + unsigned int nAutoContinueWaitBeforeRestart; + unsigned int nWaitBeforeLinkActivation; + unsigned int nWaitBeforeConfigWrite; + unsigned int nWaitBeforeRestart; + DSL_uint32_t nDevice = 0; + DSL_int_t nDeviceNum = -1; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 6, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_AutobootConfig_t)); + + sscanf (pCommands, "%u %u %u %u %u %u", + &nWaitBeforeConfigWrite, &nWaitBeforeLinkActivation, &nWaitBeforeRestart, + &nAutoContinueWaitBeforeConfigWrite, &nAutoContinueWaitBeforeLinkActivation, + &nAutoContinueWaitBeforeRestart); + + + bWaitBeforeConfigWrite = nWaitBeforeConfigWrite; + bWaitBeforeLinkActivation = nWaitBeforeLinkActivation; + bWaitBeforeRestart = nWaitBeforeRestart; + bAutoContinueWaitBeforeConfigWrite = nAutoContinueWaitBeforeConfigWrite; + bAutoContinueWaitBeforeLinkActivation = nAutoContinueWaitBeforeLinkActivation; + bAutoContinueWaitBeforeRestart = nAutoContinueWaitBeforeRestart; + + if ((g_sAdslScript != DSL_NULL) && (strlen(g_sAdslScript) > 0)) + { + bAdsl = DSL_TRUE; + } + + if ((g_sVdslScript != DSL_NULL) && (strlen(g_sVdslScript) > 0)) + { + bVdsl = DSL_TRUE; + } + + if ( (bAdsl == DSL_TRUE) || (bVdsl == DSL_TRUE) ) + { + if (!bWaitBeforeLinkActivation && !bWaitBeforeConfigWrite && !bWaitBeforeRestart) + { + DSL_CPE_FPrintf (out, "Warning: bWaitBeforeConfigWrite, bWaitBeforeLinkActivation and " + "bWaitBeforeRestart were set to false " + "but an autostart script was selected (autostart script " + "handling only works when one these settings is set to true)" DSL_CPE_CRLF); + DSL_CPE_FPrintf (out, "Set bWaitBeforeConfigWrite = DSL_TRUE, " + "bWaitBeforeLinkActivation = DSL_TRUE, bWaitBeforeRestart = DSL_TRUE!" DSL_CPE_CRLF); + bWaitBeforeConfigWrite = DSL_TRUE; + bWaitBeforeLinkActivation = DSL_TRUE; + bWaitBeforeRestart = DSL_TRUE; + } + } + + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if (pCtx->bBackwardCompMode) + { + nDeviceNum = pCtx->nDevNum; + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + if(pCtx->fd[nDevice] == fd) + { + nDeviceNum = nDevice; + break; + } + } + } + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + if (nDeviceNum == -1) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + g_bWaitBeforeConfigWrite[nDeviceNum] = bWaitBeforeConfigWrite; + g_bWaitBeforeLinkActivation[nDeviceNum] = bWaitBeforeLinkActivation; + g_bWaitBeforeRestart[nDeviceNum] = bWaitBeforeRestart; + + g_bAutoContinueWaitBeforeConfigWrite[nDeviceNum] = bAutoContinueWaitBeforeConfigWrite; + g_bAutoContinueWaitBeforeLinkActivation[nDeviceNum] = bAutoContinueWaitBeforeLinkActivation; + g_bAutoContinueWaitBeforeRestart[nDeviceNum] = bAutoContinueWaitBeforeRestart; + + pData.data.nStateMachineOptions.bWaitBeforeConfigWrite = + bWaitBeforeConfigWrite; + + pData.data.nStateMachineOptions.bWaitBeforeLinkActivation = + bWaitBeforeLinkActivation; + + pData.data.nStateMachineOptions.bWaitBeforeRestart = + bWaitBeforeRestart; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + return 0; +} +#endif + +#ifdef INCLUDE_DSL_CONFIG_GET +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAcfgg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bWaitBeforeConfigWrite" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeLinkActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeRestart" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeConfigWrite (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeLinkActivation (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeRestart (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootConfigOptionGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_AutobootConfig_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + DSL_uint32_t nDevice = 0; + DSL_int_t nDeviceNum = -1; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_AutobootConfig_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if (pCtx->bBackwardCompMode) + { + nDeviceNum = pCtx->nDevNum; + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + if(pCtx->fd[nDevice] == fd) + { + nDeviceNum = nDevice; + break; + } + } + } + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + if (nDeviceNum == -1) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + + g_bWaitBeforeConfigWrite[nDeviceNum] = + pData.data.nStateMachineOptions.bWaitBeforeConfigWrite; + g_bWaitBeforeLinkActivation[nDeviceNum] = + pData.data.nStateMachineOptions.bWaitBeforeLinkActivation; + g_bWaitBeforeRestart[nDeviceNum] = + pData.data.nStateMachineOptions.bWaitBeforeRestart; + + DSL_CPE_FPrintf (out, DSL_CPE_RET"bWaitBeforeConfigWrite=%d " + "bWaitBeforeLinkActivation=%d bWaitBeforeRestart=%d bAutoContinueWaitBeforeConfigWrite=%d " + "bAutoContinueWaitBeforeLinkActivation=%d bAutoContinueWaitBeforeRestart=%d" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), g_bWaitBeforeConfigWrite[nDeviceNum], + g_bWaitBeforeLinkActivation[nDeviceNum], g_bWaitBeforeRestart[nDeviceNum], + g_bAutoContinueWaitBeforeConfigWrite[nDeviceNum], g_bAutoContinueWaitBeforeLinkActivation[nDeviceNum], + g_bAutoContinueWaitBeforeRestart[nDeviceNum]); + } + + return 0; +} +#endif +#endif + +static const DSL_char_t g_sAsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AutobootStatus_t nStatus" DSL_CPE_CRLF + " stopped = 0" DSL_CPE_CRLF + " starting = 1" DSL_CPE_CRLF + " running = 2" DSL_CPE_CRLF + " fw wait = 3" DSL_CPE_CRLF + " config write wait = 4" DSL_CPE_CRLF + " link activation wait = 5" DSL_CPE_CRLF + " restart wait = 6" DSL_CPE_CRLF + " disabled = 7" DSL_CPE_CRLF + " shutdown (powering down) = 8" DSL_CPE_CRLF + " stopped (powered down) = 9" DSL_CPE_CRLF + "- DSL_FirmwareRequestType_t nFirmwareRequestType" DSL_CPE_CRLF + " fw request na = 0" DSL_CPE_CRLF + " fw request adsl = 1" DSL_CPE_CRLF + " fw request vdsl = 2" DSL_CPE_CRLF + " fw request xdsl = 3" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_AutobootStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_AutobootStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nStatus=%d nFirmwareRequestType=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nStatus, pData.data.nFirmwareRequestType); + } + + return 0; +} + +static const DSL_char_t g_sLsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_LineState_t nLineState (hex)" DSL_CPE_CRLF + " not initialized = 0x00000000" DSL_CPE_CRLF + " exception = 0x00000001" DSL_CPE_CRLF + " not updated = 0x00000010" DSL_CPE_CRLF + " disabled = 0x00000020" DSL_CPE_CRLF + " idle request = 0x000000ff" DSL_CPE_CRLF + " idle = 0x00000100" DSL_CPE_CRLF + " silent request = 0x000001ff" DSL_CPE_CRLF + " silent = 0x00000200" DSL_CPE_CRLF + " handshake = 0x00000300" DSL_CPE_CRLF + " bonding clr = 0x00000310" DSL_CPE_CRLF + " t1413 = 0x00000370" DSL_CPE_CRLF + " full_init = 0x00000380" DSL_CPE_CRLF + " discovery = 0x00000400" DSL_CPE_CRLF + " training = 0x00000500" DSL_CPE_CRLF + " analysis = 0x00000600" DSL_CPE_CRLF + " exchange = 0x00000700" DSL_CPE_CRLF + " showtime_no_sync = 0x00000800" DSL_CPE_CRLF + " showtime_tc_sync = 0x00000801" DSL_CPE_CRLF + " orderly_shutdown_request = 0x0000085F" DSL_CPE_CRLF + " orderly_shutdown = 0x00000860" DSL_CPE_CRLF + " fastretrain = 0x00000900" DSL_CPE_CRLF + " lowpower_l2 = 0x00000a00" DSL_CPE_CRLF + " loopdiagnostic active = 0x00000b00" DSL_CPE_CRLF + " loopdiagnostic data exchange = 0x00000b10" DSL_CPE_CRLF + " loopdiagnostic data request = 0x00000b20" DSL_CPE_CRLF + " loopdiagnostic complete = 0x00000c00" DSL_CPE_CRLF +#ifdef INCLUDE_DSL_FILTER_DETECTION + " filter detection active = 0x01000050" DSL_CPE_CRLF + " filter detection complete = 0x01000060" DSL_CPE_CRLF +#endif + " test = 0x01000000" DSL_CPE_CRLF + " resync = 0x00000d00" DSL_CPE_CRLF + " short init entry = 0x000003c0" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineStateGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineState_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LineState_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_STATE_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nLineState=0x%x" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nLineState); + } + + return 0; +} + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +static const DSL_char_t g_sRusg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t drvStaticMemUsage" DSL_CPE_CRLF + "- DSL_uint32_t drvDynamicMemUsage" DSL_CPE_CRLF + "- DSL_uint32_t appStaticMemUsage" DSL_CPE_CRLF + "- DSL_uint32_t appDynamicMemUsage" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_ResourceUsageStatisticsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_ResourceUsageStatistics_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + DSL_CPE_ResourceUsageStatisticsData_t resourceUsageStatisticsData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_ResourceUsageStatistics_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_RESOURCE_USAGE_STATISTICS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + ret = DSL_CPE_ResourceUsageStatisticsGet( + pCtx, &resourceUsageStatisticsData); + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"drvStaticMemUsage=%d drvDynamicMemUsage=%d " + "appStaticMemUsage=%d appDynamicMemUsage=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.staticMemUsage, pData.data.dynamicMemUsage, + resourceUsageStatisticsData.staticMemUsage, + resourceUsageStatisticsData.dynamicMemUsage); + } + } + else + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + } + } + + return 0; +} +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sEsmcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_EventType_t nEventType (dec)" DSL_CPE_CRLF + " linit failure = 7" DSL_CPE_CRLF + " line state = 8" DSL_CPE_CRLF + " line powermanagement state = 9" DSL_CPE_CRLF + " channel datarate = 10" DSL_CPE_CRLF + " firmware error = 11" DSL_CPE_CRLF + " init ready = 12" DSL_CPE_CRLF + " fe inventory available = 13" DSL_CPE_CRLF + " system status = 14" DSL_CPE_CRLF + " pm sync = 15" DSL_CPE_CRLF + " line transmission status = 16" DSL_CPE_CRLF + " showtime logging = 17" DSL_CPE_CRLF + " firmware request = 18" DSL_CPE_CRLF + " snmp message available = 19" DSL_CPE_CRLF + " system interface status = 20" DSL_CPE_CRLF + " firmware download status = 21" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bMask" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_EventStatusMaskConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_EventStatusMask_t pData; + unsigned int nEventType = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_EventStatusMask_t)); + + sscanf (pCommands, "%u", &nEventType); + + pData.data.nEventType = nEventType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_EVENT_STATUS_MASK_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"bMask=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.bMask); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +static const DSL_char_t g_sEsmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_EventType_t nEventType (dec)" DSL_CPE_CRLF + " linit failure = 7" DSL_CPE_CRLF + " line state = 8" DSL_CPE_CRLF + " line powermanagement state = 9" DSL_CPE_CRLF + " channel datarate = 10" DSL_CPE_CRLF + " firmware error = 11" DSL_CPE_CRLF + " init ready = 12" DSL_CPE_CRLF + " fe inventory available = 13" DSL_CPE_CRLF + " system status = 14" DSL_CPE_CRLF + " pm sync = 15" DSL_CPE_CRLF + " line transmission status = 16" DSL_CPE_CRLF + " showtime logging = 17" DSL_CPE_CRLF + " firmware request = 18" DSL_CPE_CRLF + " snmp message available = 19" DSL_CPE_CRLF + " system interface status = 20" DSL_CPE_CRLF + " firmware download status = 21" DSL_CPE_CRLF + "- DSL_boolean_t bMask" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_EventStatusMaskConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_EventStatusMask_t pData; + unsigned int nEventType = 0; + unsigned int bMask = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_EventStatusMask_t)); + + sscanf (pCommands, "%u %u", &nEventType, &bMask); + + pData.data.nEventType = nEventType; + pData.data.bMask = bMask; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_EVENT_STATUS_MASK_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#ifdef INCLUDE_DSL_FRAMING_PARAMETERS +static const DSL_char_t g_sFpsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nTp" DSL_CPE_CRLF + "- DSL_uint16_t nMp" DSL_CPE_CRLF + "- DSL_uint16_t nSEQ" DSL_CPE_CRLF + "- DSL_uint16_t nBP" DSL_CPE_CRLF + "- DSL_uint16_t nMSGC" DSL_CPE_CRLF + "- DSL_uint16_t nMSGLP" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_FramingParameterStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_FramingParameterStatus_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_FramingParameterStatus_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_FRAMING_PARAMETER_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nTp=%hu nMp=%hu nSEQ=%hu " + "nBP=%hu nMSGC=%hu nMSGLP=%hu" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nTp, pData.data.nMp, pData.data.nSEQ, pData.data.nBP, + pData.data.nMSGC, pData.data.nMSGLP); + } + + return 0; +} +#endif /* INCLUDE_DSL_FRAMING_PARAMETERS*/ + +static const DSL_char_t g_sIsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bEventActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_BF_ResourceActivationType_t nResourceActivationMask (hex)" DSL_CPE_CRLF + " cleaned = 0x00000000" DSL_CPE_CRLF + " snmp = 0x00000001" DSL_CPE_CRLF + "- DSL_boolean_t bFwEventActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_InstanceStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_InstanceStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_InstanceStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_INSTANCE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"bEventActivation=%d nEventActivationMask=0x%x " + "bFwEventActivation=%d"DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.bEventActivation, pData.data.nResourceActivationMask, + pData.data.bFwEventActivation); + } + + return 0; +} + +static const DSL_char_t g_sIcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bEventActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_BF_ResourceActivationType_t nResourceActivationMask (hex)" DSL_CPE_CRLF + " cleaned = 0x00000000" DSL_CPE_CRLF + " snmp = 0x00000001" DSL_CPE_CRLF + "- DSL_boolean_t bFwEventActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_InstanceControlSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_InstanceControl_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + unsigned int bEventActivation = 0; + unsigned int nResourceActivationMask = 0; + unsigned int bFwEventActivation = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_InstanceControl_t)); + + sscanf (pCommands, "%u %x %u", &bEventActivation, + &nResourceActivationMask, &bFwEventActivation); + + pData.data.bEventActivation = bEventActivation; + pData.data.nResourceActivationMask = nResourceActivationMask; + pData.data.bFwEventActivation = bFwEventActivation; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_INSTANCE_CONTROL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if (pData.data.bEventActivation) + { + DSL_CPE_FPrintf (out, "STARTING_1" DSL_CPE_CRLF); + + if (!pCtx->bEvtRun) + { + DSL_CPE_FPrintf (out, "STARTING_2" DSL_CPE_CRLF); + /* Start event thread*/ + DSL_CPE_EventHandlerStart(pCtx); + } + } + else + { + if (pCtx->bEvtRun) + { + pCtx->bEvtRun = DSL_FALSE; + /* wait while CPE Event handler thread ends */ + DSL_CPE_ThreadShutdown (&pCtx->EventControl, 1000); + } + } + } + else + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + } + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sLfcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_boolean_t bTrellisEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bBitswapEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bReTxEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bVirtualNoiseSupport" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_FeatureSupport_t b20BitSupport" DSL_CPE_CRLF + " DSL_FEATURE_NA = -1" DSL_CPE_CRLF + " DSL_FEATURE_DISABLED = 0" DSL_CPE_CRLF + " DSL_FEATURE_ENABLED = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineFeatureConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineFeature_t pData; + int nDslMode = 0; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LineFeature_t)); + + sscanf (pCommands, "%d %d", &nDslMode, &nDirection); + + pData.nDslMode = nDslMode; + pData.nDirection = nDirection; + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_FEATURE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u nDirection=%u " + "bTrellisEnable=%u bBitswapEnable=%u bReTxEnable=%u " + "bVirtualNoiseSupport=%u b20BitSupport=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode, + pData.nDirection, pData.data.bTrellisEnable, pData.data.bBitswapEnable, + pData.data.bReTxEnable, pData.data.bVirtualNoiseSupport, + pData.data.b20BitSupport); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +static const DSL_char_t g_sLfcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_boolean_t bTrellisEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bBitswapEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bReTxEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bVirtualNoiseSupport" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_FeatureSupport_t b20BitSupport" DSL_CPE_CRLF + " DSL_FEATURE_NA = -1" DSL_CPE_CRLF + " DSL_FEATURE_DISABLED = 0" DSL_CPE_CRLF + " DSL_FEATURE_ENABLED = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineFeatureConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineFeature_t pData; + int nDslMode = 0; + int nDirection = 0; + unsigned int bTrellisEnable; + unsigned int bBitswapEnable; + unsigned int bReTxEnable; + unsigned int bVirtualNoiseSupport; + int b20BitSupport; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 7, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LineFeature_t)); + + sscanf (pCommands, "%d %d %u %u %u %u %d", &nDslMode, &nDirection, + &bTrellisEnable, &bBitswapEnable, + &bReTxEnable, &bVirtualNoiseSupport, &b20BitSupport); + + pData.nDslMode = nDslMode; + pData.nDirection = nDirection; + pData.data.bTrellisEnable = bTrellisEnable; + pData.data.bBitswapEnable = bBitswapEnable; + pData.data.bReTxEnable = bReTxEnable; + pData.data.bVirtualNoiseSupport = bVirtualNoiseSupport; + pData.data.b20BitSupport = b20BitSupport; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_FEATURE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode, + pData.nDirection); + } + + return 0; +} + +static const DSL_char_t g_sLfsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_boolean_t bTrellisEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bBitswapEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bReTxEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bVirtualNoiseSupport" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_FeatureSupport_t b20BitSupport" DSL_CPE_CRLF + " DSL_FEATURE_NA = -1" DSL_CPE_CRLF + " DSL_FEATURE_DISABLED = 0" DSL_CPE_CRLF + " DSL_FEATURE_ENABLED = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineFeatureStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineFeature_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LineFeature_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_FEATURE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u bTrellisEnable=%u " + "bBitswapEnable=%u bReTxEnable=%u bVirtualNoiseSupport=%u b20BitSupport=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.bTrellisEnable, pData.data.bBitswapEnable, + pData.data.bReTxEnable, pData.data.bVirtualNoiseSupport, pData.data.b20BitSupport); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sSe[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_char_t sFileName[1-" _MKSTR(DSL_MAX_COMMAND_LINE_LENGTH) "] (full path to the script)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_ScriptExecute( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sFileName[DSL_MAX_COMMAND_LINE_LENGTH] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%"_MKSTR(DSL_MAX_COMMAND_LINE_LENGTH)"s", sFileName); + + if ((ret = DSL_CPE_ScriptFileParse(DSL_CPE_GetGlobalContext(), -1, sFileName, + DSL_SCRIPT_SECTION_COMMON)) < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT */ +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ + +#ifdef INCLUDE_DSL_SYSTEM_INTERFACE +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sSicg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_TcLayerSelection_t nTcLayer" DSL_CPE_CRLF + " tc unknown = 0" DSL_CPE_CRLF + " tc atm = 1" DSL_CPE_CRLF + " tc efm = 2" DSL_CPE_CRLF + " tc hdlc = 3" DSL_CPE_CRLF + " tc auto = 4" DSL_CPE_CRLF + " tc efm forced = 5" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex)" DSL_CPE_CRLF + " efm tc cleaned = 0x00000000" DSL_CPE_CRLF + " efm tc normal = 0x00000001" DSL_CPE_CRLF + " efm tc pre emption = 0x00000002" DSL_CPE_CRLF + " efm tc short packets = 0x00000004" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigDs" DSL_CPE_CRLF + " efm tc cleaned = 0x00000000" DSL_CPE_CRLF + " efm tc normal = 0x00000001" DSL_CPE_CRLF + " efm tc pre emption = 0x00000002" DSL_CPE_CRLF + " efm tc short packets = 0x00000004" DSL_CPE_CRLF + "- DSL_CPE_SystemInterfaceSelection_t nSystemIf" DSL_CPE_CRLF + " systemif unknown = 0" DSL_CPE_CRLF + " systemif utopia = 1" DSL_CPE_CRLF + " systemif posphy = 2" DSL_CPE_CRLF + " systemif mii = 3" DSL_CPE_CRLF + " systemif undefined = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_SystemInterfaceConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_SystemInterfaceConfig_t pData; + int nDslMode = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_SystemInterfaceConfig_t)); + + sscanf (pCommands, "%d", &nDslMode); + + pData.nDslMode = nDslMode; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_SYSTEM_INTERFACE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u nTcLayer=%u " + "nEfmTcConfigUs=0x%x nEfmTcConfigDs=0x%x nSystemIf=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode, + pData.data.nTcLayer, pData.data.nEfmTcConfigUs, + pData.data.nEfmTcConfigDs, pData.data.nSystemIf); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ +#endif /* INCLUDE_DSL_SYSTEM_INTERFACE*/ + +#ifdef INCLUDE_DSL_SYSTEM_INTERFACE +static const DSL_char_t g_sSics[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_TcLayerSelection_t nTcLayer" DSL_CPE_CRLF + " tc unknown = 0" DSL_CPE_CRLF + " tc atm = 1" DSL_CPE_CRLF + " tc efm = 2" DSL_CPE_CRLF + " tc hdlc = 3" DSL_CPE_CRLF + " tc auto = 4" DSL_CPE_CRLF + " tc efm forced = 5" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex)" DSL_CPE_CRLF + " efm tc cleaned = 0x00000000" DSL_CPE_CRLF + " efm tc normal = 0x00000001" DSL_CPE_CRLF + " efm tc pre emption = 0x00000002" DSL_CPE_CRLF + " efm tc short packets = 0x00000004" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex)" DSL_CPE_CRLF + " efm tc cleaned = 0x00000000" DSL_CPE_CRLF + " efm tc normal = 0x00000001" DSL_CPE_CRLF + " efm tc pre emption = 0x00000002" DSL_CPE_CRLF + " efm tc short packets = 0x00000004" DSL_CPE_CRLF + "- DSL_CPE_SystemInterfaceSelection_t nSystemIf" DSL_CPE_CRLF + " systemif unknown = 0" DSL_CPE_CRLF + " systemif utopia = 1" DSL_CPE_CRLF + " systemif posphy = 2" DSL_CPE_CRLF + " systemif mii = 3" DSL_CPE_CRLF + " systemif undefined = 4" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_SystemInterfaceConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_SystemInterfaceConfig_t pData; + int nDslMode = 0; + unsigned int nTcLayer = 0; + unsigned int nEfmTcConfigUs = 0; + unsigned int nEfmTcConfigDs = 0; + unsigned int nSystemIf = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 5, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_SystemInterfaceConfig_t)); + + sscanf (pCommands, "%d %u %x %x %u", &nDslMode, + &nTcLayer, &nEfmTcConfigUs, + &nEfmTcConfigDs, &nSystemIf); + + pData.nDslMode = nDslMode; + pData.data.nTcLayer = nTcLayer; + pData.data.nEfmTcConfigUs = nEfmTcConfigUs; + pData.data.nEfmTcConfigDs = nEfmTcConfigDs; + pData.data.nSystemIf = nSystemIf; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_SYSTEM_INTERFACE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode); + } + + return 0; +} +#endif /* INCLUDE_DSL_SYSTEM_INTERFACE*/ + +#ifdef INCLUDE_DSL_SYSTEM_INTERFACE +static const DSL_char_t g_sSisg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_TcLayerSelection_t nTcLayer" DSL_CPE_CRLF + " tc unknown = 0" DSL_CPE_CRLF + " tc atm = 1" DSL_CPE_CRLF + " tc efm = 2" DSL_CPE_CRLF + " tc hdlc = 3" DSL_CPE_CRLF + " tc auto = 4" DSL_CPE_CRLF + " tc efm forced = 5" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex)" DSL_CPE_CRLF + " efm tc cleaned = 0x00000000" DSL_CPE_CRLF + " efm tc normal = 0x00000001" DSL_CPE_CRLF + " efm tc pre emption = 0x00000002" DSL_CPE_CRLF + " efm tc short packets = 0x00000004" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex)" DSL_CPE_CRLF + " efm tc cleaned = 0x00000000" DSL_CPE_CRLF + " efm tc normal = 0x00000001" DSL_CPE_CRLF + " efm tc pre emption = 0x00000002" DSL_CPE_CRLF + " efm tc short packets = 0x00000004" DSL_CPE_CRLF + "- DSL_CPE_SystemInterfaceSelection_t nSystemIf" DSL_CPE_CRLF + " systemif unknown = 0" DSL_CPE_CRLF + " systemif utopia = 1" DSL_CPE_CRLF + " systemif posphy = 2" DSL_CPE_CRLF + " systemif mii = 3" DSL_CPE_CRLF + " systemif undefined = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_SystemInterfaceStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_SystemInterfaceStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_SystemInterfaceStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_SYSTEM_INTERFACE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nTcLayer=%u nEfmTcConfigUs=0x%x " + "nEfmTcConfigDs=0x%x nSystemIf=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nTcLayer, pData.data.nEfmTcConfigUs, + pData.data.nEfmTcConfigDs, pData.data.nSystemIf); + } + + return 0; +} +#endif /* INCLUDE_DSL_SYSTEM_INTERFACE*/ + +static const DSL_char_t g_sTmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_TestModeControlSet_t nTestMode" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + " showtime_lock = 1" DSL_CPE_CRLF + " quiet = 2" DSL_CPE_CRLF + " training lock = 3" DSL_CPE_CRLF + " lock = 4" DSL_CPE_CRLF + " unlock = 5" DSL_CPE_CRLF + " sleep = 6" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_TestModeControlSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_TestModeControl_t pData; + unsigned int nTestMode; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_TestModeControl_t)); + + sscanf (pCommands, "%u", &nTestMode); + + pData.data.nTestMode = nTestMode; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_TEST_MODE_CONTROL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sTmsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_TestModeStatus_t nTestMode" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + " showtime_lock = 1" DSL_CPE_CRLF + " quiet = 2" DSL_CPE_CRLF + " training lock = 3" DSL_CPE_CRLF + " lock = 4" DSL_CPE_CRLF + " unlock = 5" DSL_CPE_CRLF + " sleep = 6" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_TestModeStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_TestModeStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_TestModeStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_TEST_MODE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nTestMode=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nTestMode); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CPE_MISC_LINE_STATUS +static const DSL_char_t g_sBbsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint16_t nBandIndex" DSL_CPE_CRLF + "- DSL_uint16_t nLimit_firstToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nLimit_lastToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nBorder_firstToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nBorder_lastToneIndex" DSL_CPE_CRLF + "- ... nParamNr[5] nCount[" _MKSTR(DSL_G997_MAX_NUMBER_OF_BANDS) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BandBorderStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t nBand = 0; + DSL_BandBorderStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BandBorderStatus_t)); + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BAND_BORDER_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%d nNumData=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.nNumData); + DSL_CPE_FPrintf (out, + "nFormat=(nBandIndex, (nLimit_firstToneIndex, nLimit_lastToneIndex), " + "(nBorder_firstToneIndex, nBorder_lastToneIndex)) nData=\"" DSL_CPE_CRLF); + + for (nBand = 0; nBand < pData.data.nNumData; nBand++) + { + DSL_CPE_FPrintf (out, "(%02d,(%04d,%04d),(%04d,%04d))"DSL_CPE_CRLF, nBand, + pData.data.nBandLimits[nBand].nFirstToneIndex, pData.data.nBandLimits[nBand].nLastToneIndex, + pData.data.nBandBorder[nBand].nFirstToneIndex, pData.data.nBandBorder[nBand].nLastToneIndex); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_MISC_LINE_STATUS*/ + +#ifdef INCLUDE_DSL_CPE_MISC_LINE_STATUS +static const DSL_char_t g_sMlsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_MiscLineStatusSelector_t nStatusSelector" DSL_CPE_CRLF + " ATTNDR_CODING_GAIN_DS = 0" DSL_CPE_CRLF + " ATTNDR_MAX_BITS_PER_SYMBOL_DS = 1" DSL_CPE_CRLF + " DUAL_LATENCY_ON_US = 2" DSL_CPE_CRLF + " DUAL_LATENCY_ON_DS = 3" DSL_CPE_CRLF + " INIT_SNR_DS = 4" DSL_CPE_CRLF + " NOMPSD_US = 5" DSL_CPE_CRLF + " NOMPSD_DS = 6" DSL_CPE_CRLF + " LINE_RATE_US = 7" DSL_CPE_CRLF + " LINE_RATE_DS = 8" DSL_CPE_CRLF + " NET_RATE_US = 9" DSL_CPE_CRLF + " NET_RATE_DS = 10" DSL_CPE_CRLF + " TOTAL_DATA_RATE_US = 11" DSL_CPE_CRLF + " TOTAL_DATA_RATE_DS = 12" DSL_CPE_CRLF + " AGGREGATE_DATA_RATE_US = 13" DSL_CPE_CRLF + " AGGREGATE_DATA_RATE_DS = 14" DSL_CPE_CRLF + " MIN_INP_IP_LP0_DS = 15" DSL_CPE_CRLF + " MIN_INP_FP_LP1_DS = 16" DSL_CPE_CRLF + " ATT_AGGREGATE_DATA_RATE_US = 17" DSL_CPE_CRLF + " ATT_AGGREGATE_DATA_RATE_DS = 18" DSL_CPE_CRLF + " DSL_MLS_ATT_LINE_DATA_RATE_US = 19" DSL_CPE_CRLF + " DSL_MLS_ATT_LINE_DATA_RATE_DS = 20" DSL_CPE_CRLF + " DSL_MLS_ATT_TOTAL_DATA_RATE_US = 21" DSL_CPE_CRLF + " DSL_MLS_ATT_TOTAL_DATA_RATE_DS = 22" DSL_CPE_CRLF + " DSL_MLS_MASK_ANNEX_M_J_US = 23" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_int32_t nStatusValue" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MiscLineStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_MiscLineStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_MiscLineStatus_t)); + + sscanf (pCommands, "%u", &pData.data.nStatusSelector); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MISC_LINE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nStatusValue=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nStatusValue); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_MISC_LINE_STATUS*/ + +static const DSL_char_t g_sRaCs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_G997_RA_MODE_t RA_MODE" DSL_CPE_CRLF + " at init = 2" DSL_CPE_CRLF + " dynamic = 3" DSL_CPE_CRLF + " dynamic SOS = 4" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_RateAdaptationConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_RateAdaptationConfig_t pData; + int nDslMode = 0; + int nDirection = 0; + unsigned int nRA_MODE = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_RateAdaptationConfig_t)); + + sscanf (pCommands, "%d %d %u", &nDslMode, &nDirection, + &nRA_MODE); + + pData.nDslMode = nDslMode; + pData.nDirection = nDirection; + pData.data.RA_MODE = nRA_MODE; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_RATE_ADAPTATION_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u nDirection=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode, + pData.nDirection); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sRaCg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_G997_RA_MODE_t RA_MODE" DSL_CPE_CRLF + " at init = 2" DSL_CPE_CRLF + " dynamic = 3" DSL_CPE_CRLF + " dynamic SOS = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_RateAdaptationConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_RateAdaptationConfig_t pData; + int nDslMode = 0; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_RateAdaptationConfig_t)); + + sscanf (pCommands, "%d %d", &nDslMode, &nDirection); + + pData.nDslMode = nDslMode; + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_RATE_ADAPTATION_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u nDirection=%hu RA_MODE=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode, + pData.nDirection, pData.data.RA_MODE); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_G997_ALARM +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sG997amdpfcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex)" DSL_CPE_CRLF + " ncd = 0x00000001" DSL_CPE_CRLF + " lcd = 0x00000002" DSL_CPE_CRLF + " oos = 0x00000004" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_AlarmMaskDataPathFailuresConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DataPathFailures_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_DataPathFailures_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_DATA_PATH_FAILURES_CONFIG_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nDataPathFailures=0x%x" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.data.nDataPathFailures); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ +#endif /* INCLUDE_DSL_G997_ALARM*/ + +#ifdef INCLUDE_DSL_G997_ALARM +static const DSL_char_t g_sG997amdpfcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex)" DSL_CPE_CRLF + " ncd = 0x00000001" DSL_CPE_CRLF + " lcd = 0x00000002" DSL_CPE_CRLF + " oos = 0x00000004" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_AlarmMaskDataPathFailuresConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DataPathFailures_t pData; + int nDirection = 0; + unsigned int nDataPathFailures = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_DataPathFailures_t)); + + sscanf (pCommands, "%hhu %d %x", &pData.nChannel, &nDirection, + &nDataPathFailures); + + pData.nDirection = nDirection; + pData.data.nDataPathFailures = nDataPathFailures; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_DATA_PATH_FAILURES_CONFIG_SET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ + +#ifdef INCLUDE_DSL_G997_ALARM +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sG997amlfcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_G997_BF_LineFailures_t nLineFailures (hex)" DSL_CPE_CRLF + " lpr = 0x00000001" DSL_CPE_CRLF + " lof = 0x00000002" DSL_CPE_CRLF + " los = 0x00000004" DSL_CPE_CRLF + " lom = 0x00000008" DSL_CPE_CRLF + " lol = 0x00000010" DSL_CPE_CRLF + " ese = 0x00000020" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_AlarmMaskLineFailuresConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineFailures_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineFailures_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_LINE_FAILURES_CONFIG_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nLineFailures=0x%x" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.nLineFailures); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ +#endif /* INCLUDE_DSL_G997_ALARM*/ + +#ifdef INCLUDE_DSL_G997_ALARM +static const DSL_char_t g_sG997amlfcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_G997_BF_LineFailures_t nLineFailures (hex)" DSL_CPE_CRLF + " lpr = 0x00000001" DSL_CPE_CRLF + " lof = 0x00000002" DSL_CPE_CRLF + " los = 0x00000004" DSL_CPE_CRLF + " lom = 0x00000008" DSL_CPE_CRLF + " lol = 0x00000010" DSL_CPE_CRLF + " ese = 0x00000020" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_AlarmMaskLineFailuresConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineFailures_t pData; + int nDirection = 0; + unsigned int nLineFailures = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineFailures_t)); + + sscanf (pCommands, "%d %x", &nDirection, &nLineFailures); + + pData.nDirection = nDirection; + pData.data.nLineFailures = nLineFailures; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_LINE_FAILURES_CONFIG_SET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ + +#ifdef INCLUDE_DSL_G997_PER_TONE +static const DSL_char_t g_sG997bang[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint8_t nBit (hex)"DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_BitAllocationNscGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0, nSkipped = 0; + DSL_uint16_t nUsedNumData = 0; + unsigned char *pResult, *pParse, Num; + DSL_G997_BitAllocationNsc_t *pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_BitAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, "nReturn=%d" DSL_CPE_CRLF, DSL_ERR_MEMORY); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_BitAllocationNsc_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData->nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_BIT_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + /* Get the number of actually used tones*/ + for (i = 0; (i < pData->data.bitAllocationNsc.nNumData) && (i < DSL_MAX_NSC); i++) + { + if (pData->data.bitAllocationNsc.nNSCData[i]) + { + nUsedNumData++; + } + } + + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + nUsedNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nBit(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.bitAllocationNsc.nNumData)*10 + + (pData->data.bitAllocationNsc.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; (i < pData->data.bitAllocationNsc.nNumData) && (i < DSL_MAX_NSC); i++) + { + /* skip the printout when 0 */ + if (pData->data.bitAllocationNsc.nNSCData[i] == 0) + { + /* do a separator only when starting to skip */ + if (!nSkipped) + { + nSkipped = 1; + *pParse++ = '\r'; + *pParse++ = '\n'; + } + continue; + } + + nSkipped = 0; + + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\r'; + *pParse++ = '\n'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.bitAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.bitAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF, pResult ); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997bansg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint8_t nBit (hex)"DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_BitAllocationNscShortGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, i = 0; + DSL_G997_BitAllocationNsc_t *pData; + unsigned char *pResult, *pParse, Num; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_BitAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF , DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_BitAllocationNsc_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData->nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_BIT_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->data.bitAllocationNsc.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=nBit(hex) nData=\"" DSL_CPE_CRLF); + + /* use own encoding for performance reasons */ + pResult = malloc((pData->data.bitAllocationNsc.nNumData)*3+10); + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; (i < pData->data.bitAllocationNsc.nNumData) && (i < DSL_MAX_NSC); i++) + { + Num = ((pData->data.bitAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.bitAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF,pResult ); + free(pResult); + } + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_G997_PER_TONE*/ + +#ifdef INCLUDE_DSL_CONFIG_GET +#ifdef INCLUDE_DSL_G997_ALARM +static const DSL_char_t g_sG997cdrtcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdUpshift" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdDownshift" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_ChannelDataRateThresholdConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_ChannelDataRateThreshold_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_ChannelDataRateThreshold_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_CHANNEL_DATA_RATE_THRESHOLD_CONFIG_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nDataRateThresholdUpshift=%u " + "nDataRateThresholdDownshift=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.data.nDataRateThresholdUpshift, + (DSL_uint32_t)pData.data.nDataRateThresholdDownshift); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_G997_ALARM +static const DSL_char_t g_sG997cdrtcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdUpshift" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdDownshift" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_ChannelDataRateThresholdConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_ChannelDataRateThreshold_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_ChannelDataRateThreshold_t)); + + sscanf (pCommands, "%hhu %d %u %u", &pData.nChannel, &nDirection, + &pData.data.nDataRateThresholdUpshift, + &pData.data.nDataRateThresholdDownshift); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_CHANNEL_DATA_RATE_THRESHOLD_CONFIG_SET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ + +static const DSL_char_t g_sG997csg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint32_t ActualDataRate" DSL_CPE_CRLF + "- DSL_uint32_t PreviousDataRate" DSL_CPE_CRLF + "- DSL_uint32_t ActualInterleaveDelay" DSL_CPE_CRLF + "- DSL_uint16_t ActualImpulseNoiseProtection" DSL_CPE_CRLF + "- DSL_uint32_t ActualNetDataRate" DSL_CPE_CRLF + "- DSL_uint16_t ActualImpulseNoiseProtectionRein" DSL_CPE_CRLF + "- DSL_uint16_t ActualImpulseNoiseProtectionNoErasure" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_ChannelStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_ChannelStatus_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_ChannelStatus_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_CHANNEL_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u ActualDataRate=%u " + "PreviousDataRate=%u ActualInterleaveDelay=%u " + "ActualImpulseNoiseProtection=%hu ActualNetDataRate=%u " + "ActualImpulseNoiseProtectionRein=%hu " + "ActualImpulseNoiseProtectionNoErasure=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.data.ActualDataRate,(DSL_uint32_t) pData.data.PreviousDataRate, + (DSL_uint32_t)pData.data.ActualInterleaveDelay, + (DSL_uint32_t)pData.data.ActualImpulseNoiseProtection, + (DSL_uint32_t)pData.data.ActualNetDataRate, + (DSL_uint32_t)pData.data.ActualImpulseNoiseProtectionRein, + (DSL_uint32_t)pData.data.ActualImpulseNoiseProtectionNoErasure); + } + + return 0; +} + +static const DSL_char_t g_sG997dpfsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex)" DSL_CPE_CRLF + " datapathfailure cleaned = 0x00000000" DSL_CPE_CRLF + " datapathfailure ncd = 0x00000001" DSL_CPE_CRLF + " datapathfailure lcd = 0x00000002" DSL_CPE_CRLF + " datapathfailure oos = 0x00000004" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DataPathFailuresStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DataPathFailures_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_DataPathFailures_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DATA_PATH_FAILURES_STATUS_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nChannel=%hu nDirection=%u nDataPathFailures=%x" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nDataPathFailures); + } + + return 0; +} + +#ifdef INCLUDE_DSL_G997_FRAMING_PARAMETERS +static const DSL_char_t g_sG997fpsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNFEC" DSL_CPE_CRLF + "- DSL_uint16_t nRFEC" DSL_CPE_CRLF + "- DSL_uint16_t nLSYMB" DSL_CPE_CRLF + "- DSL_uint16_t nINTLVDEPTH" DSL_CPE_CRLF + "- DSL_uint16_t nINTLVBLOCK" DSL_CPE_CRLF + "- DSL_uint8_t nLPATH" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_FramingParameterStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_FramingParameterStatus_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_FramingParameterStatus_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_FRAMING_PARAMETER_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nNFEC=%hu nRFEC=%hu nLSYMB=%u " + "nINTLVDEPTH=%hu nINTLVBLOCK=%hu nLPATH=%hu" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nNFEC, pData.data.nRFEC, pData.data.nLSYMB, + pData.data.nINTLVDEPTH, pData.data.nINTLVBLOCK, pData.data.nLPATH); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_FRAMING_PARAMETERS*/ + +#ifdef INCLUDE_DSL_G997_PER_TONE +static const DSL_char_t g_sG997gang[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nGain (hex, linear, represented as multiple of 1/512: 20*log[gain/512])"DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_GainAllocationNscGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0, nSkipped = 0, nUsedNumData=0; + DSL_G997_GainAllocationNsc_t *pData; + unsigned char *pResult, *pParse, Num; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_GainAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_GainAllocationNsc_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData->nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_GAIN_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + /* Get the number of actually used tones*/ + for (i = 0; i < pData->data.gainAllocationNsc.nNumData; i++) + { + if (pData->data.gainAllocationNsc.nNSCData[i]) + { + nUsedNumData++; + } + } + + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn),pData->nDirection, + nUsedNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nGain(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.gainAllocationNsc.nNumData)*12 + + (pData->data.gainAllocationNsc.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; (i < pData->data.gainAllocationNsc.nNumData) && (i < DSL_MAX_NSC); i++) + { + /* skip the printout when 0 */ + if (pData->data.gainAllocationNsc.nNSCData[i] == 0) + { + /* do a separator only when starting to skip */ + if (!nSkipped) + { + nSkipped = 1; + *pParse++ = '\r'; + *pParse++ = '\n'; + } + continue; + } + + nSkipped = 0; + + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\r'; + *pParse++ = '\n'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.gainAllocationNsc.nNSCData[i] & 0xf000)>>12); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.gainAllocationNsc.nNSCData[i] & 0x0f00)>>8); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.gainAllocationNsc.nNSCData[i] & 0x00f0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.gainAllocationNsc.nNSCData[i] & 0x000f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF, pResult); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997gansg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint16_t nGain (hex, linear, represented as multiple of 1/512: 20*log[gain/512])"DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_GainAllocationNscShortGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_GainAllocationNsc_t *pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_GainAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_GainAllocationNsc_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData->nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_GAIN_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->data.gainAllocationNsc.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=nGain(hex) nData=\"" DSL_CPE_CRLF); + + for (i = 0; (i < pData->data.gainAllocationNsc.nNumData) && (i < DSL_MAX_NSC); i++) + { + DSL_CPE_FPrintf(out, "%04X ", (DSL_int_t)pData->data.gainAllocationNsc.nNSCData[i]); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_G997_PER_TONE*/ + +#ifdef INCLUDE_DSL_G997_STATUS +static const DSL_char_t g_sG997lstg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nLastStateTransmitted" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LastStateTransmittedGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LastStateTransmitted_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LastStateTransmitted_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LAST_STATE_TRANSMITTED_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nLastStateTransmitted=%hd" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.data.nLastStateTransmitted); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_STATUS*/ + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sG997lacg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_G997_LDSF_t nLDSF" DSL_CPE_CRLF + " inhibit ldsf = 0" DSL_CPE_CRLF + " force ldsf = 1" DSL_CPE_CRLF + " auto ldsf = 2" DSL_CPE_CRLF + " force filter detection = 3" DSL_CPE_CRLF + " auto filter detection = 4" DSL_CPE_CRLF + "- DSL_G997_ACSF_t nACSF" DSL_CPE_CRLF + " inhibit acsf = 0" DSL_CPE_CRLF + " force acsf = 1" DSL_CPE_CRLF + "- DSL_G997_StartupMode_t nStartupMode" DSL_CPE_CRLF + " normal startup = 0" DSL_CPE_CRLF + " force short startup = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineActivateConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineActivate_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineActivate_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_ACTIVATE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nLDSF=%d nACSF=%d nStartupMode=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nLDSF, pData.data.nACSF, + pData.data.nStartupMode); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +static const DSL_char_t g_sG997lacs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_G997_LDSF_t nLDSF" DSL_CPE_CRLF + " inhibit ldsf = 0" DSL_CPE_CRLF + " force ldsf = 1" DSL_CPE_CRLF + " auto ldsf = 2" DSL_CPE_CRLF + " force filter detection = 3" DSL_CPE_CRLF + " auto filter detection = 4" DSL_CPE_CRLF + "- DSL_G997_ACSF_t nACSF" DSL_CPE_CRLF + " inhibit acsf = 0" DSL_CPE_CRLF + " force acsf = 1" DSL_CPE_CRLF + "- DSL_G997_StartupMode_t nStartupMode" DSL_CPE_CRLF + " normal startup = 0" DSL_CPE_CRLF + " force short startup = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineActivateConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineActivate_t pData; + unsigned int nLDSF = 0; + unsigned int nACSF = 0; + unsigned int nStartupMode = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineActivate_t)); + + sscanf (pCommands, "%u %u %u", &nLDSF, + &nACSF, &nStartupMode); + + pData.data.nLDSF = nLDSF; + pData.data.nACSF = nACSF; + pData.data.nStartupMode = nStartupMode; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_ACTIVATE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sG997lfsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_G997_BF_LineFailures_t nLineFailures (hex)" DSL_CPE_CRLF + " linefailure cleaned = 0x00000000" DSL_CPE_CRLF + " linefailure lpr = 0x00000001" DSL_CPE_CRLF + " linefailure lof = 0x00000002" DSL_CPE_CRLF + " linefailure los = 0x00000004" DSL_CPE_CRLF + " linefailure lom = 0x00000008" DSL_CPE_CRLF + " linefailure lol = 0x00000010" DSL_CPE_CRLF + " linefailure ese = 0x00000020" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineFailureStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineFailures_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineFailures_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_FAILURES_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nLineFailures=0x%x" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.nLineFailures); + } + + return 0; +} + +#ifdef INCLUDE_DSL_G997_STATUS +static const DSL_char_t g_sG997lisg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_G997_LineInit_t nLineInitStatus" DSL_CPE_CRLF + " successful = 0" DSL_CPE_CRLF + " config error = 1" DSL_CPE_CRLF + " config not feasible = 2" DSL_CPE_CRLF + " communication problem = 3" DSL_CPE_CRLF + " no peer xtu = 4" DSL_CPE_CRLF + " unknown = 5" DSL_CPE_CRLF + "- DSL_G997_LineInitSubStatus_t nLineInitSubStatus" DSL_CPE_CRLF + " LINIT_SUB_NONE = 0" DSL_CPE_CRLF + " LINIT_SUB_UNKNOWN = 1" DSL_CPE_CRLF + " LINIT_SUB_NO_COMMON_MODE = 2" DSL_CPE_CRLF + " LINIT_SUB_OPP_MODE = 3" DSL_CPE_CRLF + " LINIT_SUB_FW_RETRY = 4" DSL_CPE_CRLF + " LINIT_SUB_FW_HYBRID = 5" DSL_CPE_CRLF + " LINIT_SUB_PORT_MODE = 6" DSL_CPE_CRLF + " LINIT_SUB_S_PP_DRIVER = 7" DSL_CPE_CRLF + " LINIT_SUB_S_INTENDED_LOCAL_SHUTDOWN = 8" DSL_CPE_CRLF + " LINIT_SUB_TIMEOUT = 9" DSL_CPE_CRLF + " LINIT_SUB_S_PP_CLOCK_NEW = 12" DSL_CPE_CRLF + " LINIT_SUB_S_PP_ERB_INIT = 13" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineInitStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInitStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineInitStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INIT_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nLineInitStatus=%d nLineInitSubStatus=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nLineInitStatus, + pData.data.nLineInitSubStatus ); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_STATUS*/ + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY +static const DSL_char_t g_sG997lig[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint8_t G994VendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_uint8_t SystemVendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_uint8_t VersionNumber[" _MKSTR(DSL_G997_LI_MAXLEN_VERSION) "]" DSL_CPE_CRLF + "- DSL_uint8_t SerialNumber[" _MKSTR(DSL_G997_LI_MAXLEN_SERIAL) "]" DSL_CPE_CRLF + "- DSL_uint32_t SelfTestResult" DSL_CPE_CRLF + "- DSL_uint8_t XTSECapabilities[" _MKSTR(DSL_G997_NUM_XTSE_OCTETS) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineInventoryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInventory_t pData; + DSL_char_t buf[256]; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineInventory_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INVENTORY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u ", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + + DSL_CPE_ArraySPrintF(buf, pData.data.G994VendorID, + sizeof(pData.data.G994VendorID), sizeof(pData.data.G994VendorID[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "G994VendorID=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.data.SystemVendorID, + sizeof(pData.data.SystemVendorID), sizeof(pData.data.SystemVendorID[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "SystemVendorID=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.data.VersionNumber, + sizeof(pData.data.VersionNumber), sizeof(pData.data.VersionNumber[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "VersionNumber=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.data.SerialNumber, + sizeof(pData.data.SerialNumber), sizeof(pData.data.SerialNumber[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "SerialNumber=%s ", buf); + + DSL_CPE_FPrintf(out, "SelfTestResult=%u ", (DSL_uint32_t)pData.data.SelfTestResult); + + DSL_CPE_ArraySPrintF(buf, pData.data.XTSECapabilities, + sizeof(pData.data.XTSECapabilities), sizeof(pData.data.XTSECapabilities[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "XTSECapabilities=%s" DSL_CPE_CRLF, buf); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY +static const DSL_char_t g_sG997listrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_char_t G994VendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_char_t SystemVendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_char_t VersionNumber[" _MKSTR(DSL_G997_LI_MAXLEN_VERSION) "]" DSL_CPE_CRLF + "- DSL_char_t SerialNumber[" _MKSTR(DSL_G997_LI_MAXLEN_SERIAL) "]" DSL_CPE_CRLF + "- DSL_uint32_t SelfTestResult" DSL_CPE_CRLF + "- DSL_char_t XTSECapabilities[" _MKSTR(DSL_G997_NUM_XTSE_OCTETS) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineInventoryStringGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInventory_t pData; + DSL_char_t buf[256]; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineInventory_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INVENTORY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u ", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + + DSL_CPE_ArraySPrintF(buf, pData.data.G994VendorID, + sizeof(pData.data.G994VendorID), sizeof(pData.data.G994VendorID[0]), + DSL_ARRAY_FORMAT_PRINT_STRING); + DSL_CPE_FPrintf(out, "G994VendorID=\"%s\" ", buf); + buf[0] = '\0'; + + DSL_CPE_ArraySPrintF(buf, pData.data.SystemVendorID, + sizeof(pData.data.SystemVendorID), sizeof(pData.data.SystemVendorID[0]), + DSL_ARRAY_FORMAT_PRINT_STRING); + DSL_CPE_FPrintf(out, "SystemVendorID=\"%s\" ", buf); + buf[0] = '\0'; + + DSL_CPE_ArraySPrintF(buf, pData.data.VersionNumber, + sizeof(pData.data.VersionNumber), sizeof(pData.data.VersionNumber[0]), + DSL_ARRAY_FORMAT_STRING); + DSL_CPE_FPrintf(out, "VersionNumber=\"%s\" ", buf); + buf[0] = '\0'; + + DSL_CPE_ArraySPrintF(buf, pData.data.SerialNumber, + sizeof(pData.data.SerialNumber), sizeof(pData.data.SerialNumber[0]), + DSL_ARRAY_FORMAT_STRING); + DSL_CPE_FPrintf(out, "SerialNumber=\"%s\" ", buf); + buf[0] = '\0'; + + DSL_CPE_FPrintf(out, "SelfTestResult=%u ", (DSL_uint32_t)pData.data.SelfTestResult); + + DSL_CPE_ArraySPrintF(buf, pData.data.XTSECapabilities, + sizeof(pData.data.XTSECapabilities), sizeof(pData.data.XTSECapabilities[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "XTSECapabilities=%s" DSL_CPE_CRLF, buf); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + #define DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS 4 +#else + #define DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS 3 +#endif + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY +static const DSL_char_t g_sG997lis[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t SystemVendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_uint8_t VersionNumber[" _MKSTR(DSL_G997_LI_MAXLEN_VERSION) "]" DSL_CPE_CRLF + "- DSL_uint8_t SerialNumber[" _MKSTR(DSL_G997_LI_MAXLEN_SERIAL) "]" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint8_t Auxiliary[0-" _MKSTR(DSL_G993_LI_MAXLEN_AUX) "]" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineInventorySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInventoryNe_t pData; + DSL_char_t string[256] = { 0 }; + DSL_char_t seps[] = " "; + DSL_char_t *token; + DSL_uint16_t i = 0, nIdx = 0; + DSL_int_t nParams = 0; + DSL_int_t nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS] = { 0 }; + + for (i = 0; i < DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS; i++) + { + switch (i) + { + case 0: + nParamList[i] = DSL_G997_LI_MAXLEN_VENDOR_ID; + break; + case 1: + nParamList[i] = nParamList[i - 1] + DSL_G997_LI_MAXLEN_VERSION; + break; + case 2: + nParamList[i] = nParamList[i - 1] + DSL_G997_LI_MAXLEN_SERIAL; + break; +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + case 3: + nParamList[i] = nParamList[i - 1] + DSL_G993_LI_MAXLEN_AUX; + break; +#endif + default: + DSL_CPE_FPrintf(out, "nReturn=-1 (interanl error)" DSL_CPE_CRLF); + return 0; + } + } + + nParams = nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS - 1]; + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (DSL_CPE_CLI_CheckParamNumber( + pCommands, + nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS - 2], DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + if (DSL_CPE_CLI_CheckParamNumber(pCommands, nParams, DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } +#else + if (DSL_CPE_CLI_CheckParamNumber(pCommands, nParams, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } +#endif + + memset (&pData, 0, sizeof(DSL_G997_LineInventoryNe_t)); + + cpe_control_strncpy_s(string, sizeof(string)-1, pCommands, strlen(pCommands)); + string[sizeof(string)-1]=0; + + /* Get first token */ + token = strtok (string, seps); + if (token != DSL_NULL) + { + for (i = 0; i < nParams; i++) + { + if (i < nParamList[0]) + { + nIdx = i; + sscanf (token, "%hhx", (unsigned char *)&(pData.data.SystemVendorID[nIdx])); + } + else if (i < nParamList[1]) + { + nIdx = (DSL_uint16_t)(i - nParamList[0]); + sscanf (token, "%hhx", (unsigned char *)&(pData.data.VersionNumber[nIdx])); + } + else if (i < nParamList[2]) + { + nIdx = (DSL_uint16_t)(i - nParamList[1]); + sscanf (token, "%hhx", (unsigned char *)&(pData.data.SerialNumber[nIdx])); + } +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + else if (i < nParamList[3]) + { + nIdx = (DSL_uint16_t)(i - nParamList[2]); + sscanf (token, "%hhx", (unsigned char *)&(pData.data.Auxiliary.pData[nIdx])); + } +#endif + else + { + DSL_CPE_FPrintf(out, "nReturn=-1 (interanl error)" DSL_CPE_CRLF); + return 0; + } + + /* Get next token */ + token = strtok(DSL_NULL, seps); + + /* Exit scanning if no further information is included */ + if (token == DSL_NULL) + { + break; + } + } + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + pData.data.Auxiliary.nLength = + (DSL_uint32_t)(i + 1 - nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS - 2]); +#endif + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INVENTORY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +static const DSL_char_t g_sG997lsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_int16_t LATN" DSL_CPE_CRLF + "- DSL_int16_t SATN" DSL_CPE_CRLF + "- DSL_int16_t SNR" DSL_CPE_CRLF + "- DSL_uint32_t ATTNDR" DSL_CPE_CRLF + "- DSL_int16_t ACTPS" DSL_CPE_CRLF + "- DSL_int16_t ACTATP" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineStatus_t pData; + int nDirection = 0; + unsigned int nDeltDataType = 0; + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineStatus_t)); + + sscanf (pCommands, "%d %u", &nDirection, &nDeltDataType); + + pData.nDirection = nDirection; + pData.nDeltDataType = nDeltDataType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u LATN=%hd SATN=%hd SNR=%hd " + "ATTNDR=%u ACTPS=%hd ACTATP=%hd" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.nDeltDataType, pData.data.LATN, + (DSL_int32_t)pData.data.SATN, (DSL_int32_t)pData.data.SNR, (DSL_uint32_t)pData.data.ATTNDR, (DSL_int32_t)pData.data.ACTPS, + (DSL_int32_t)pData.data.ACTATP); + } + + return 0; +} + +#ifdef INCLUDE_DSL_G997_STATUS +static const DSL_char_t g_sG997ltsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_G997_LineTransmission_t nLineTransmissionStatus" DSL_CPE_CRLF + " available = 0" DSL_CPE_CRLF + " not available = 1" DSL_CPE_CRLF + " not supported = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineTransmissionStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineTransmissionStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineTransmissionStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_TRANSMISSION_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nLineTransmissionStatus=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nLineTransmissionStatus); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_STATUS*/ + +static const DSL_char_t g_sG997pmsft[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_G997_PowerManagementStateForce_t nPowerManagementState" DSL_CPE_CRLF + " pmsf l3 to l0 = 0" DSL_CPE_CRLF + " pmsf l0 to l2 = 2" DSL_CPE_CRLF + " pmsf lx to l3 = 3" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_PowerManagementStateForcedTrigger( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_PowerManagementStateForcedTrigger_t pData; + unsigned int nPowerManagementState; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_PowerManagementStateForcedTrigger_t)); + + sscanf (pCommands, "%u", &nPowerManagementState); + + pData.data.nPowerManagementState = nPowerManagementState; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_POWER_MANAGEMENT_STATE_FORCED_TRIGGER, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + return 0; +} + +static const DSL_char_t g_sG997pmsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_G997_PowerManagementStatus_t nPowerManagementStatus" DSL_CPE_CRLF + " pms na = -1" DSL_CPE_CRLF + " pms l0 = 0" DSL_CPE_CRLF + " pms l1 = 1" DSL_CPE_CRLF + " pms l2 = 2" DSL_CPE_CRLF + " pms l3 = 3" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_PowerManagementStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_PowerManagementStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_PowerManagementStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_POWER_MANAGEMENT_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nPowerManagementStatus=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), pData.data.nPowerManagementStatus); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CEOC +static const DSL_char_t g_sG997sms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nMessageData[1-" _MKSTR(DSL_G997_SNMP_MESSAGE_LENGTH) "]" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnmpMessageSend( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint32_t nVal = 0; + DSL_int_t i = 0; + DSL_char_t *pChar = DSL_NULL, *pTmp = DSL_NULL; + DSL_G997_Snmp_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, DSL_G997_SNMP_MESSAGE_LENGTH, + DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0, sizeof(DSL_G997_Snmp_t)); + + pTmp = pCommands; + pChar = pCommands; + + for (i = 0; i < DSL_G997_SNMP_MESSAGE_LENGTH; i++) + { + if ( pChar == DSL_NULL ) + { + /* no more entries, leave the loop */ + break; + } + + ret = sscanf(pChar, "%x", &nVal); + + if ( ret != 1 ) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "invalid SNMP data!" DSL_CPE_CRLF); + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERROR)); + return 0; + } + + pData.data.nMessageData[i] = (DSL_uint8_t)nVal; + + ret = DSL_CPE_MoveCharPtr(pTmp, 1, " ", &pChar); + if ( (pTmp == pChar) || (ret != DSL_SUCCESS) ) + { + i++; + break; + } + else + { + pTmp = pChar; + } + } + + /* Set current length of SNMP message */ + pData.data.nMessageLength = (DSL_uint16_t)i; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNMP_MESSAGE_SEND, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CEOC */ + +#ifdef INCLUDE_DSL_CEOC +static const DSL_char_t g_sG997smr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nMessageLength" DSL_CPE_CRLF + "- DSL_uint8_t nMessageData[" _MKSTR(DSL_G997_SNMP_MESSAGE_LENGTH) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnmpMessageReceive( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_Snmp_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0, sizeof(DSL_G997_Snmp_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNMP_MESSAGE_RECEIVE, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nMessageLength=%hu nData(hex)=\"" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nMessageLength); + + /* Print only the number of values that are returned */ + for (i = 0; (i < pData.data.nMessageLength) && (i < DSL_G997_SNMP_MESSAGE_LENGTH); i++) + { + DSL_CPE_FPrintf(out, "0x%02X ", (DSL_int_t)(pData.data.nMessageData[i])); + } + + DSL_CPE_FPrintf (out, "\"" DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CEOC */ + +#ifdef INCLUDE_DSL_G997_PER_TONE +static const DSL_char_t g_sG997sang[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint8_t nSnr ( represented as -32 + SNR(nToneIndex)/2, nSnr(nToneIndex)=255 indicates that " + "no measurement could be done for the subcarrier)" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnrAllocationNscGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0, nSkipped = 0, nUsedNumData = 0; + unsigned char *pResult, *pParse, Num; + DSL_G997_SnrAllocationNsc_t *pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_SnrAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_SnrAllocationNsc_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData->nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNR_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + if (pData->data.snrAllocationNsc.nNumData > DSL_MAX_NSC) + { + pData->data.snrAllocationNsc.nNumData = DSL_MAX_NSC; + } + + /* Get the number of actually used tones*/ + for (i = 0; i < pData->data.snrAllocationNsc.nNumData; i++) + { + if (pData->data.snrAllocationNsc.nNSCData[i] != 0xFF) + { + nUsedNumData++; + } + } + + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + nUsedNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nSnr(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.snrAllocationNsc.nNumData)*10 + + (pData->data.snrAllocationNsc.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.snrAllocationNsc.nNumData; i++) + { + /* skip the printout when 0xff */ + if (pData->data.snrAllocationNsc.nNSCData[i] == 0xFF) + { + /* do a separator only when starting to skip */ + if (!nSkipped) + { + nSkipped = 1; + *pParse++ = '\r'; + *pParse++ = '\n'; + } + continue; + } + + nSkipped = 0; + + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\n'; + *pParse++ = '\r'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.snrAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.snrAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF,pResult ); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997sansg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint8_t nSnr (hex, represented as -32 + SNR(nToneIndex)/2, nSnr(nToneIndex)=255 indicates that " + "no measurement could be done for the subcarrier)" DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnrAllocationNscShortGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + unsigned char *pResult, *pParse, Num; + DSL_G997_SnrAllocationNsc_t *pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_SnrAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_SnrAllocationNsc_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData->nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNR_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu ", + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->data.snrAllocationNsc.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=nSnr(hex) nData=\"" DSL_CPE_CRLF); + + /* use own encoding for performance reasons */ + pResult = malloc(pData->data.snrAllocationNsc.nNumData*3+10); + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; (i < pData->data.snrAllocationNsc.nNumData) && (i < DSL_MAX_NSC); i++) + { + Num = ((pData->data.snrAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.snrAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s" DSL_CPE_CRLF, pResult); + free(pResult); + } + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_G997_PER_TONE*/ + +#ifdef INCLUDE_DSL_DELT +static const DSL_char_t g_sg997dfr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltFreeResources( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DeltFreeResources_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_DeltFreeResources_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_FREE_RESOURCES, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sG997dhling[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nHlin_real (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nHlin_imag (hex)" DSL_CPE_CRLF + "- ... nParamNr[3] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltHLINGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_DeltHlin_t *pData; + unsigned char *pResult, *pParse, Num; + int nDirection = 0; + unsigned int nDeltDataType = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltHlin_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltHlin_t)); + + sscanf (pCommands, "%d %u", &nDirection, &nDeltDataType); + + pData->nDirection = nDirection; + pData->nDeltDataType = nDeltDataType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_HLIN_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u" + " nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->nDeltDataType, pData->data.nMeasurementTime, + pData->data.nGroupSize, pData->data.deltHlin.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nHlin_real(hex),nHlin_imag(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.deltHlin.nNumData)*24 + + (pData->data.deltHlin.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; (i < pData->data.deltHlin.nNumData) && (i < DSL_MAX_NSC); i++) + { + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\r'; + *pParse++ = '\n'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nReal & 0xf000)>>12); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nReal & 0x0f00)>>8); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nReal & 0x00f0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.deltHlin.nNSCComplexData[i].nReal & 0x000f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ','; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nImag & 0xf000)>>12); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nImag & 0x0f00)>>8); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nImag & 0x00f0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.deltHlin.nNSCComplexData[i].nImag & 0x000f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF, pResult); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997dhlinsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nDeltHlinScale" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltHLINScaleGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DeltHlinScale_t *pData; + int nDirection = 0; + unsigned int nDeltDataType = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltHlinScale_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltHlinScale_t)); + + sscanf (pCommands, "%d %u", &nDirection, &nDeltDataType); + + pData->nDirection = nDirection; + pData->nDeltDataType = nDeltDataType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_HLIN_SCALE_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf( out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nDeltHlinScale=%hu"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, pData->nDeltDataType, + pData->data.nDeltHlinScale ); + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997dhlogg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nHlog" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltHLOGGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; +#if 0 + DSL_char_t *pResult, *pParse, Num; +#endif + DSL_G997_DeltHlog_t *pData; + int nDirection = 0; + unsigned int nDeltDataType = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltHlog_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltHlog_t)); + + sscanf (pCommands, "%d %u", &nDirection, &nDeltDataType); + + pData->nDirection = nDirection; + pData->nDeltDataType = nDeltDataType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_HLOG_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), + pData->nDirection, pData->nDeltDataType, + pData->data.nMeasurementTime, pData->data.nGroupSize, + pData->data.deltHlog.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nHlog(dec)) nData=\""); + + for (i = 0; i < pData->data.deltHlog.nNumData; i++) + { + if (i >= DSL_MAX_NSC) + { + break; + } + + if (i%10 == 0) DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + DSL_CPE_FPrintf(out, "(%04d,%04d) ", i, pData->data.deltHlog.nNSCData[i] ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + +#if 0 + DSL_CPE_FPrintf(out, "nFormat=(tone(dec),hlog(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.deltHlog.nNumData)*10 + + (pData->data.deltHlog.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; (i < pData->data.deltHlog.nNumData) && (i < DSL_MAX_NSC); i++) + { + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\n'; + *pParse++ = '\r'; + } + *pParse++ = '('; + *pParse++ = '0' + i/1000; + *pParse++ = '0' + (i%1000)/100; + *pParse++ = '0' + (i%100)/10; + *pParse++ = '0' + (i%10); + *pParse++ = ','; + Num = ((pData->data.deltHlog.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.deltHlog.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF,pResult ); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } +#endif + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997dqlng[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nQln" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltQLNGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_DeltQln_t *pData; + int nDirection = 0; + unsigned int nDeltDataType = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltQln_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltQln_t)); + + sscanf (pCommands, "%d %u", &nDirection, &nDeltDataType); + + pData->nDirection = nDirection; + pData->nDeltDataType = nDeltDataType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_QLN_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, pData->nDeltDataType, + pData->data.nMeasurementTime, pData->data.nGroupSize, + pData->data.deltQln.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nQln(dec)) nData=\""); + for (i = 0; (i < pData->data.deltQln.nNumData) && (i < DSL_MAX_NSC); i++) + { + if (i%10 == 0) DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + DSL_CPE_FPrintf(out, "(%04d,%03d) ", i, pData->data.deltQln.nNSCData[i] ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997dsnrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nGroupIndex" DSL_CPE_CRLF + "- DSL_uint16_t nSnr" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltSNRGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_DeltSnr_t *pData; + int nDirection = 0; + unsigned int nDeltDataType = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltSnr_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltSnr_t)); + + sscanf (pCommands, "%d %u", &nDirection, &nDeltDataType); + + pData->nDirection = nDirection; + pData->nDeltDataType = nDeltDataType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_SNR_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), + pData->nDirection, pData->nDeltDataType, + pData->data.nMeasurementTime, pData->data.nGroupSize, + pData->data.deltSnr.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nGroupIndex(dec),nSnr(dec)) nData=\""); + for (i = 0; (i < pData->data.deltSnr.nNumData) && (i < DSL_MAX_NSC); i++) + { + if (i%10 == 0) DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + DSL_CPE_FPrintf(out, "(%04d,%03d) ", i, pData->data.deltSnr.nNSCData[i] ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_DELT*/ + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sG997xtusecg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t XTSE1 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE2 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE3 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE4 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE5 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE6 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE7 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE8 (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_XTUSystemEnablingConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t i = 0; + DSL_int_t ret = 0; + DSL_G997_XTUSystemEnabling_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_XTUSystemEnabling_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_XTU_SYSTEM_ENABLING_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + + for (i = 0; i < DSL_G997_NUM_XTSE_OCTETS; i++) + { + DSL_CPE_FPrintf(out, "XTSE%d=0x%x ", i + 1, (DSL_int_t)(pData.data.XTSE[i]) ); + } + DSL_CPE_FPrintf(out, DSL_CPE_CRLF ); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +static const DSL_char_t g_sG997xtusecs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint8_t XTSE1 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE2 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE3 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE4 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE5 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE6 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE7 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE8 (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_XTUSystemEnablingConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_int_t i = 0; + DSL_G997_XTUSystemEnabling_t pData; + DSL_uint32_t nParam[DSL_G997_NUM_XTSE_OCTETS] = { 0 }; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 8, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_XTUSystemEnabling_t)); + + sscanf ( pCommands, "%x %x %x %x %x %x %x %x", + &(nParam[0]), &(nParam[1]), &(nParam[2]), &(nParam[3]), &(nParam[4]), + &(nParam[5]), &(nParam[6]), &(nParam[7])); + + for (i = 0; i < DSL_G997_NUM_XTSE_OCTETS; i++) + { + pData.data.XTSE[i] = (DSL_uint8_t) nParam[i]; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_XTU_SYSTEM_ENABLING_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sG997xtusesg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t XTSE1 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE2 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE3 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE4 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE5 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE6 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE7 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE8 (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_XTUSystemEnablingStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_XTUSystemEnabling_t pData; + DSL_int_t i = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_XTUSystemEnabling_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_XTU_SYSTEM_ENABLING_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + + for (i = 0; i < DSL_G997_NUM_XTSE_OCTETS; i++) + { + DSL_CPE_FPrintf(out, "XTSE%d=0x%x ", i + 1, (DSL_int_t)(pData.data.XTSE[i]) ); + } + DSL_CPE_FPrintf(out, DSL_CPE_CRLF ); + } + + return 0; +} + +static const DSL_char_t g_sLocs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_LineOptionsSelector_t nConfigSelector (dec)" DSL_CPE_CRLF + " DSL_OPT_NOISE_MARGIN_DELTA_DS = 0" DSL_CPE_CRLF + " DSL_ERASURE_DECODING_TYPE_DS = 1" DSL_CPE_CRLF + " DSL_TRUST_ME_BIT = 2" DSL_CPE_CRLF + " DSL_INBAND_SPECTRAL_SHAPING_US = 3" DSL_CPE_CRLF + " DSL_ENHANCED_FRAMING_US = 4" DSL_CPE_CRLF + "- DSL_int32_t nConfigValue (dec)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineOptionsConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineOptionsConfig_t pData; + unsigned int nConfigSelector = 0; + int nConfigValue = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LineOptionsConfig_t)); + + sscanf (pCommands, "%u %d", + &nConfigSelector, &nConfigValue); + + pData.data.nConfigSelector = nConfigSelector; + pData.data.nConfigValue = nConfigValue; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_OPTIONS_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sLocg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_LineOptionsSelector_t nConfigSelector (dec)" DSL_CPE_CRLF + " DSL_OPT_NOISE_MARGIN_DELTA_DS = 0" DSL_CPE_CRLF + " DSL_ERASURE_DECODING_TYPE_DS = 1" DSL_CPE_CRLF + " DSL_TRUST_ME_BIT = 2" DSL_CPE_CRLF + " DSL_INBAND_SPECTRAL_SHAPING_US = 3" DSL_CPE_CRLF + " DSL_ENHANCED_FRAMING_US = 4" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_int32_t nConfigValue (dec)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineOptionsConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineOptionsConfig_t pData; + unsigned int nConfigSelector; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LineOptionsConfig_t)); + + sscanf (pCommands, "%u", &nConfigSelector); + + pData.data.nConfigSelector = nConfigSelector; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_OPTIONS_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nConfigValue=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nConfigValue); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CONFIG +static const DSL_char_t g_sPMcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bNePollingOff" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bFePollingOff" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_uint8_t nBasicUpdateCycle" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactor" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactorL2" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_Config_t pData; + unsigned int bNePollingOff = 0; + unsigned int bFePollingOff = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 5, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_Config_t)); + + sscanf (pCommands, "%u %u %hhu %hhu %hhu", &bNePollingOff, + &bFePollingOff, &pData.data.nBasicUpdateCycle, + &pData.data.nFeUpdateCycleFactor, &pData.data.nFeUpdateCycleFactorL2); + + pData.data.bNePollingOff = bNePollingOff; + pData.data.bFePollingOff = bFePollingOff; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_CONFIG*/ +#endif /* INCLUDE_DSL_PM*/ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CONFIG +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sPMcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bNePollingOff" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bFePollingOff" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_uint8_t nBasicUpdateCycle" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactor" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactorL2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_Config_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_Config_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"bNePollingOff=%u bFePollingOff=%u " + "nBasicUpdateCycle=%u nFeUpdateCycleFactor=%u nFeUpdateCycleFactorL2=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.bNePollingOff, pData.data.bFePollingOff, + pData.data.nBasicUpdateCycle, pData.data.nFeUpdateCycleFactor, pData.data.nFeUpdateCycleFactorL2); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ +#endif /* INCLUDE_DSL_CPE_PM_CONFIG*/ +#endif /* INCLUDE_DSL_PM*/ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPM15meet[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bOneDayElapsed" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_15MinElapsedExtTrigger( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ElapsedExtTrigger_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ElapsedExtTrigger_t)); + + sscanf (pCommands, "%u", &pData.data.bOneDayElapsed); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_15MIN_ELAPSED_EXT_TRIGGER, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMbms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bActivate" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPmTick" DSL_CPE_CRLF + "- DSL_uint32_t nPm15Min" DSL_CPE_CRLF + "- DSL_uint32_t nPm15MinPerDay" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_BurninModeSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_BurninMode_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_BurninMode_t)); + + sscanf (pCommands, "%u %u %u %u", &pData.data.bActivate, + &pData.data.nMode.nPmTick, &pData.data.nMode.nPm15Min, + &pData.data.nMode.nPm15MinPerDay); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_BURNIN_MODE_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMetr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ElapsedTimeReset( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ElapsedTimeReset_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ElapsedTimeReset_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_ELAPSED_TIME_RESET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +static const DSL_char_t g_sPMr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_PM_ResetTypes_t nResetType" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1" DSL_CPE_CRLF + " total = 2" DSL_CPE_CRLF + " all = 3" DSL_CPE_CRLF + " current showtime = 4" DSL_CPE_CRLF + " history showtime = 5" DSL_CPE_CRLF + "- DSL_boolean_t bUseDetailedReset (optional, used only in conjunction with the next parameter)" DSL_CPE_CRLF + " do not use detailed reset = 0" DSL_CPE_CRLF + " use detailed reset = 1" DSL_CPE_CRLF + "- DSL_PM_BF_ResetMask_t nResetMask (hex, optional, used only if detailed reset was specified)" DSL_CPE_CRLF + " cleaned = 0x00000000" DSL_CPE_CRLF + " line init counters = 0x00000001" DSL_CPE_CRLF + " line sec counters = 0x00000002" DSL_CPE_CRLF + " line failure counters = 0x00000004" DSL_CPE_CRLF + " line event showtime counters = 0x00000008" DSL_CPE_CRLF + " channel counters = 0x00000100" DSL_CPE_CRLF + " data path counters = 0x00001000" DSL_CPE_CRLF + " data path failure counters = 0x00002000" DSL_CPE_CRLF + " retx counters = 0x00010000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_Reset( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_Reset_t pData; + unsigned int nResetType = 0; + unsigned int bUseDetailedReset = 0; + unsigned int nResetMask = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_PM_Reset_t)); + + sscanf (pCommands, "%u %u %x", + &nResetType, &bUseDetailedReset, &nResetMask); + + pData.data.nResetType = nResetType; + pData.data.bUseDetailedReset = bUseDetailedReset; + pData.data.nResetMask = nResetMask; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RESET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_PM */ + + + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMsms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_PM_SyncModeType_t nMode" DSL_CPE_CRLF + " free = 0" DSL_CPE_CRLF + " sys time = 1" DSL_CPE_CRLF + " external = 2" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_SyncModeSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_SyncMode_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_SyncMode_t)); + + sscanf (pCommands, "%u", &pData.data.nMode); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_SYNC_MODE_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sPMsmg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_PM_SyncModeType_t nMode" DSL_CPE_CRLF + " free = 0" DSL_CPE_CRLF + " sys time = 1" DSL_CPE_CRLF + " external = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_SyncModeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_SyncMode_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_SyncMode_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_SYNC_MODE_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nMode=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nMode); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CONFIG_GET*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMcc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_CHANNEL_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_CHANNEL_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelCounters_t)); + + sscanf (pCommands, "%hhu %u %u", &pData.nChannel, &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.nHistoryInterval, pData.interval.nElapsedTime, + pData.interval.bValid, pData.data.nCodeViolations, + pData.data.nFEC); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMcc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_CHANNEL_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_CHANNEL_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelCounters_t)); + + sscanf (pCommands, "%hhu %u %u", &pData.nChannel, &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.nHistoryInterval, pData.interval.nElapsedTime, + pData.interval.bValid, pData.data.nCodeViolations, + pData.data.nFEC); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMchs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMchs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +static const DSL_char_t g_sPMcctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCountersTotal_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelCountersTotal_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nElapsedTime=%u bValid=%u nCodeViolations=%u " + "nFEC=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.total.nElapsedTime, pData.total.bValid, pData.data.nCodeViolations, + pData.data.nFEC); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +static const DSL_char_t g_sPMccsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_CHANNEL_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_CHANNEL_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCounters_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelCounters_t)); + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &nDirection, + &pData.nHistoryInterval); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.nHistoryInterval, pData.interval.nElapsedTime, + pData.interval.bValid, pData.data.nCodeViolations, + pData.data.nFEC); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMct15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelThreshold_t)); + + DSL_uint32_t direction = 0; + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMct15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelThreshold_t)); + + sscanf (pCommands, "%hhu %u %u %u", &pData.nChannel, &direction, + &pData.data.nCodeViolations, &pData.data.nFEC); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMct1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelThreshold_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMct1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ChannelThreshold_t)); + + sscanf (pCommands, "%hhu %u %u %u", &pData.nChannel, &direction, + &pData.data.nCodeViolations, &pData.data.nFEC); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMdpc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathCounters_t)); + + sscanf (pCommands, "%hhu %u %u", &pData.nChannel, &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nHEC=%u nTotalCells=%u nUserTotalCells=%u " + "nIBE=%u nTxUserTotalCells=%u nTxIBE=%u", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nHEC, (DSL_uint32_t)pData.data.nTotalCells, + (DSL_uint32_t)pData.data.nUserTotalCells, (DSL_uint32_t)pData.data.nIBE, + (DSL_uint32_t)pData.data.nTxUserTotalCells, (DSL_uint32_t)pData.data.nTxIBE); +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_CPE_FPrintf (out, + " nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u", + (DSL_uint32_t)pData.data.nCRC_P, (DSL_uint32_t)pData.data.nCRCP_P, (DSL_uint32_t)pData.data.nCV_P, + (DSL_uint32_t)pData.data.nCVP_P); +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMdpc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathCounters_t)); + + sscanf (pCommands, "%hhu %u %u", &pData.nChannel, &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nHEC=%u nTotalCells=%u nUserTotalCells=%u " + "nIBE=%u nTxUserTotalCells=%u nTxIBE=%u", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nHEC, (DSL_uint32_t)pData.data.nTotalCells, + (DSL_uint32_t)pData.data.nUserTotalCells, (DSL_uint32_t)pData.data.nIBE, + (DSL_uint32_t)pData.data.nTxUserTotalCells, (DSL_uint32_t)pData.data.nTxIBE); +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_CPE_FPrintf (out, + " nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u", + (DSL_uint32_t)pData.data.nCRC_P, (DSL_uint32_t)pData.data.nCRCP_P, (DSL_uint32_t)pData.data.nCV_P, + (DSL_uint32_t)pData.data.nCVP_P); +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdphs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_HISTORY_STATS_15MIN_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdphs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_HISTORY_STATS_1DAY_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +static const DSL_char_t g_sPMdpctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCountersTotal_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathCountersTotal_t)); + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nElapsedTime=%u bValid=%u nHEC=%u " + "nTotalCells=%u nUserTotalCells=%u nIBE=%u nTxUserTotalCells=%u nTxIBE=%u", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.total.nElapsedTime, pData.total.bValid, pData.data.nHEC, pData.data.nTotalCells, + pData.data.nUserTotalCells, pData.data.nIBE, + pData.data.nTxUserTotalCells, pData.data.nTxIBE); +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_CPE_FPrintf (out, + " nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u", + pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, + pData.data.nCVP_P); +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +static const DSL_char_t g_sPMdpcsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_DATAPATH_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_DATAPATH_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCounters_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathCounters_t)); + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &nDirection, + &pData.nHistoryInterval); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nHEC=%u nTotalCells=%u nUserTotalCells=%u " + "nIBE=%u nTxUserTotalCells=%u nTxIBE=%u", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nHEC, (DSL_uint32_t)pData.data.nTotalCells, + (DSL_uint32_t)pData.data.nUserTotalCells, (DSL_uint32_t)pData.data.nIBE, + (DSL_uint32_t)pData.data.nTxUserTotalCells, (DSL_uint32_t)pData.data.nTxIBE); +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_CPE_FPrintf (out, + " nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u", + (DSL_uint32_t)pData.data.nCRC_P, (DSL_uint32_t)pData.data.nCRCP_P, (DSL_uint32_t)pData.data.nCV_P, + (DSL_uint32_t)pData.data.nCVP_P); +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdpt15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathThreshold_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHEC=%u nTotalCells=%u " + "nUserTotalCells=%u nIBE=%u nTxUserTotalCells=%u nTxIBE=%u", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, + pData.data.nIBE, pData.data.nTxUserTotalCells, pData.data.nTxIBE); +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_CPE_FPrintf (out, + " nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u", + pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, + pData.data.nCVP_P); +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdpt15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + DSL_uint32_t direction = 0; + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 12, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathThreshold_t)); + + sscanf (pCommands, "%hhu %u %u %u %u %u %u %u %u %u %u %u", &pData.nChannel, + &direction, &pData.data.nHEC, &pData.data.nTotalCells, + &pData.data.nUserTotalCells, &pData.data.nIBE, + &pData.data.nTxUserTotalCells, &pData.data.nTxIBE, &pData.data.nCRC_P, + &pData.data.nCRCP_P, &pData.data.nCV_P, &pData.data.nCVP_P); + pData.nDirection = direction; +#else + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 8, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathThreshold_t)); + + sscanf (pCommands, "%hhu %u %u %u %u %u %u %u", &pData.nChannel, + &direction, &pData.data.nHEC, &pData.data.nTotalCells, + &pData.data.nUserTotalCells, &pData.data.nIBE, &pData.data.nTxUserTotalCells, + &pData.data.nTxIBE); + pData.nDirection = direction; +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdpt1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathThreshold_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHEC=%u nTotalCells=%u " + "nUserTotalCells=%u nIBE=%u nTxUserTotalCells=%u nTxIBE=%u", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, + pData.data.nIBE, pData.data.nTxUserTotalCells, pData.data.nTxIBE); +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_CPE_FPrintf (out, + " nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u", + pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, + pData.data.nCVP_P); +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdpt1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + DSL_uint32_t direction = 0; + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 12, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathThreshold_t)); + + sscanf (pCommands, "%hhu %u %u %u %u %u %u %u %u %u %u %u", &pData.nChannel, + &direction, &pData.data.nHEC, &pData.data.nTotalCells, + &pData.data.nUserTotalCells, &pData.data.nIBE, + &pData.data.nTxUserTotalCells, &pData.data.nTxIBE, + &pData.data.nCRC_P, &pData.data.nCRCP_P, &pData.data.nCV_P, &pData.data.nCVP_P); + pData.nDirection = direction; +#else + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 8, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathThreshold_t)); + + sscanf (pCommands, "%hhu %u %u %u %u %u %u %u", &pData.nChannel, + &pData.nDirection, &pData.data.nHEC, &pData.data.nTotalCells, + &pData.data.nUserTotalCells, &pData.data.nIBE, + &pData.data.nTxUserTotalCells, &pData.data.nTxIBE); +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) */ + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMrtc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_RETX_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_RETX_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxCounters_t)); + + + sscanf (pCommands, "%u %u", &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u " + "nEftrMin=%u nErrorFreeBits=%u nLeftr=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nEftrMin, (DSL_uint32_t)pData.data.nErrorFreeBits, + (DSL_uint32_t)pData.data.nLeftr); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMrtc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_RETX_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_RETX_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxCounters_t)); + + sscanf (pCommands, "%u %u", &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u " + "nEftrMin=%u nErrorFreeBits=%u nLeftr=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nEftrMin, (DSL_uint32_t)pData.data.nErrorFreeBits, + (DSL_uint32_t)pData.data.nLeftr); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMrths15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_HISTORY_STATS_15MIN_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMrths1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_HISTORY_STATS_1DAY_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +static const DSL_char_t g_sPMrtctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCountersTotal_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxCountersTotal_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nElapsedTime=%u bValid=%u " + "nEftrMin=%u nErrorFreeBits=%u nLeftr=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + (DSL_uint32_t)pData.total.nElapsedTime, (DSL_uint32_t)pData.total.bValid, + (DSL_uint32_t)pData.data.nEftrMin, (DSL_uint32_t)pData.data.nErrorFreeBits, + (DSL_uint32_t)pData.data.nLeftr); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +static const DSL_char_t g_sPMrtcsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_RETX_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_RETX_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxCounters_t)); + + sscanf (pCommands, "%u %u", &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u " + "nEftrMin=%u nErrorFreeBits=%u nLeftr=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nEftrMin, (DSL_uint32_t)pData.data.nErrorFreeBits, + (DSL_uint32_t)pData.data.nLeftr); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMrtt15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxThreshold_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u " + "nEftrMin=%u nErrorFreeBits=%u nLeftr=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.data.nEftrMin, pData.data.nErrorFreeBits, + pData.data.nLeftr); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMrtt15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxThreshold_t)); + + sscanf (pCommands, "%u %u %u %u", + &direction, + &pData.data.nEftrMin, &pData.data.nErrorFreeBits, &pData.data.nLeftr); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMrtt1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxThreshold_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u " + "nEftrMin=%u nErrorFreeBits=%u nLeftr=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.data.nEftrMin, pData.data.nErrorFreeBits, pData.data.nLeftr); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMrtt1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nEftrMin" DSL_CPE_CRLF + "- DSL_uint32_t nErrorFreeBits" DSL_CPE_CRLF + "- DSL_uint32_t nLeftr" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ReTxThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_ReTxThreshold_t)); + + sscanf (pCommands, "%u %u %u %u", + &direction, + &pData.data.nEftrMin, &pData.data.nErrorFreeBits, &pData.data.nLeftr); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMdpfc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_FAILURE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_FAILURE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathFailureCounters_t)); + + sscanf (pCommands, "%hhu %u %u", &pData.nChannel, &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nNCD=%u nLCD=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nNCD, (DSL_uint32_t)pData.data.nLCD); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMdpfc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_FAILURE_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_DATAPATH_FAILURE_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathFailureCounters_t)); + + sscanf (pCommands, "%hhu %u %u", &pData.nChannel, &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nNCD=%u nLCD=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nNCD, + (DSL_uint32_t)pData.data.nLCD); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdpfhs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_HISTORY_STATS_15MIN_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMdpfhs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_HISTORY_STATS_1DAY_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nChannel, pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +static const DSL_char_t g_sPMdpfctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCountersTotal_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathFailureCountersTotal_t)); + + sscanf (pCommands, "%hhu %u", &pData.nChannel, &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nElapsedTime=%u bValid=%u nNCD=%u nLCD=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + pData.total.nElapsedTime, pData.total.bValid, pData.data.nNCD, pData.data.nLCD); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +static const DSL_char_t g_sPMdpfcsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_DATAPATH_FAILURE_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_DATAPATH_FAILURE_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_DataPathFailureCounters_t)); + + sscanf (pCommands, "%hhu %u %u", &pData.nChannel, &direction, + &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nChannel=%hu nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nNCD=%u nLCD=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nNCD, + (DSL_uint32_t)pData.data.nLCD); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMlic15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitCounters_t)); + + sscanf (pCommands, "%u", &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nHistoryInterval=%u nElapsedTime=%u bValid=%u nFullInits=%u " + "nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nFullInits, (DSL_uint32_t)pData.data.nFailedFullInits, + (DSL_uint32_t)pData.data.nShortInits, (DSL_uint32_t)pData.data.nFailedShortInits); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMlic1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitCounters_t)); + + sscanf (pCommands, "%u", &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nHistoryInterval=%u nElapsedTime=%u bValid=%u nFullInits=%u " + "nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nFullInits, (DSL_uint32_t)pData.data.nFailedFullInits, + (DSL_uint32_t)pData.data.nShortInits, (DSL_uint32_t)pData.data.nFailedShortInits); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlihs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStats_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStats_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_HISTORY_STATS_15MIN_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlihs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStats_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStats_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_HISTORY_STATS_1DAY_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +static const DSL_char_t g_sPMlictg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCountersTotal_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitCountersTotal_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nElapsedTime=%u bValid=%u nFullInits=%u nFailedFullInits=%u " + "nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.total.nElapsedTime, pData.total.bValid, + pData.data.nFullInits, pData.data.nFailedFullInits, + pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +static const DSL_char_t g_sPMlicsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_LINE_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_LINE_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitCounters_t)); + + sscanf (pCommands, "%u", &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nHistoryInterval=%u nElapsedTime=%u bValid=%u nFullInits=%u " + "nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nFullInits, (DSL_uint32_t)pData.data.nFailedFullInits, + (DSL_uint32_t)pData.data.nShortInits, (DSL_uint32_t)pData.data.nFailedShortInits); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlit15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitThreshold_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nFullInits=%u nFailedFullInits=%u nShortInits=%u " + "nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nFullInits, pData.data.nFailedFullInits, + pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlit15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitThreshold_t)); + + sscanf (pCommands, "%u %u %u %u", &pData.data.nFullInits, + &pData.data.nFailedFullInits, &pData.data.nShortInits, + &pData.data.nFailedShortInits); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlit1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitThreshold_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nFullInits=%u nFailedFullInits=%u nShortInits=%u " + "nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nFullInits, pData.data.nFailedFullInits, + pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlit1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineInitThreshold_t)); + + sscanf (pCommands, "%u %u %u %u", &pData.data.nFullInits, + &pData.data.nFailedFullInits, &pData.data.nShortInits, + &pData.data.nFailedShortInits); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMlsc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecCounters_t)); + + sscanf (pCommands, "%u %u", &direction, &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u nElapsedTime=%u bValid=%u " + "nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u nFECS=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, (DSL_uint32_t)pData.nHistoryInterval, + (DSL_uint32_t)pData.interval.nElapsedTime, (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nES, (DSL_uint32_t)pData.data.nSES, + (DSL_uint32_t)pData.data.nLOSS, (DSL_uint32_t)pData.data.nUAS, + (DSL_uint32_t)pData.data.nLOFS, (DSL_uint32_t)pData.data.nFECS); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMlsc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecCounters_t)); + + sscanf (pCommands, "%u %u", &direction, &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u nElapsedTime=%u bValid=%u " + "nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u nFECS=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, (DSL_uint32_t)pData.nHistoryInterval, + (DSL_uint32_t)pData.interval.nElapsedTime, (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nES, (DSL_uint32_t)pData.data.nSES, + (DSL_uint32_t)pData.data.nLOSS, (DSL_uint32_t)pData.data.nUAS, + (DSL_uint32_t)pData.data.nLOFS, (DSL_uint32_t)pData.data.nFECS); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlshs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsDir_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_HISTORY_STATS_15MIN_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection,pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlshs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsDir_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_HISTORY_STATS_1DAY_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection,pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +static const DSL_char_t g_sPMlsctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCountersTotal_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecCountersTotal_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nElapsedTime=%u bValid=%u nES=%u nSES=%u nLOSS=%u " + "nUAS=%u nLOFS=%u nFECS=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.total.nElapsedTime, pData.total.bValid, + pData.data.nES, pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, + pData.data.nLOFS, pData.data.nFECS); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +static const DSL_char_t g_sPMlscsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_LINE_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_LINE_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCounters_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecCounters_t)); + + sscanf (pCommands, "%d %u", &nDirection, &pData.nHistoryInterval); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u nElapsedTime=%u bValid=%u " + "nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u nFECS=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, (DSL_uint32_t)pData.nHistoryInterval, + (DSL_uint32_t)pData.interval.nElapsedTime, (DSL_uint32_t)pData.interval.bValid, + (DSL_uint32_t)pData.data.nES, (DSL_uint32_t)pData.data.nSES, + (DSL_uint32_t)pData.data.nLOSS, (DSL_uint32_t)pData.data.nUAS, + (DSL_uint32_t)pData.data.nLOFS, (DSL_uint32_t)pData.data.nFECS); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlst15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecThreshold_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u nES=%u nSES=%u nLOSS=%u" + "nUAS=%u nLOFS=%u nFECS=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nES, + pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, pData.data.nLOFS, + pData.data.nFECS); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlst15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 6, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecThreshold_t)); + + sscanf (pCommands, "%u %u %u %u %u %u %u", &direction, &pData.data.nES, + &pData.data.nSES, &pData.data.nLOSS, &pData.data.nUAS, &pData.data.nLOFS, + &pData.data.nFECS); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlst1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecThreshold_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u nES=%u nSES=%u nLOSS=%u" + "nUAS=%u nLOFS=%u nFECS=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.nES, pData.data.nSES, pData.data.nLOSS, + pData.data.nUAS, pData.data.nLOFS, pData.data.nFECS); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMlst1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + "- DSL_uint32_t nFECS" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 6, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineSecThreshold_t)); + + sscanf (pCommands, "%u %u %u %u %u %u %u", &direction, &pData.data.nES, + &pData.data.nSES, &pData.data.nLOSS, &pData.data.nUAS, &pData.data.nLOFS, + &pData.data.nFECS); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMlesc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_EVENT_SHOWTIME_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_EVENT_SHOWTIME_15MIN_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineEventShowtimeCounters_t)); + + sscanf (pCommands, "%u %u", &direction, &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nLOF=%u nLOS=%u nLPR=%u nLOM=%u nSosSuccess=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nLOF, (DSL_uint32_t)pData.data.nLOS, + (DSL_uint32_t)pData.data.nLPR, (DSL_uint32_t)pData.data.nLOM, + (DSL_uint32_t)pData.data.nSosSuccess); + } + + return 0; +} + +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sPMlesc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_EVENT_SHOWTIME_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1.." _MKSTR(DSL_PM_LINE_EVENT_SHOWTIME_1DAY_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineEventShowtimeCounters_t)); + + sscanf (pCommands, "%u %u", &direction, &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nLOF=%u nLOS=%u nLPR=%u nLOM=%u nSosSuccess=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nLOF, + (DSL_uint32_t)pData.data.nLOS, (DSL_uint32_t)pData.data.nLPR, + (DSL_uint32_t)pData.data.nLOM, (DSL_uint32_t)pData.data.nSosSuccess); + } + + return 0; +} + +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMleshs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_HISTORY_STATS_15MIN_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +static const DSL_char_t g_sPMleshs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_HistoryStatsChDir_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_HISTORY_STATS_1DAY_GET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nPrevIvs=%u nPrevInvalidIvs=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_LINE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +static const DSL_char_t g_sPMlesctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCountersTotal_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineEventShowtimeCountersTotal_t)); + + sscanf (pCommands, "%u", &direction); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nElapsedTime=%u bValid=%u nLOF=%u nLOS=%u nLPR=%u nLOM=%u " + "nSosSuccess=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.total.nElapsedTime, pData.total.bValid, pData.data.nLOF, pData.data.nLOS, pData.data.nLPR, + pData.data.nLOM, pData.data.nSosSuccess); + } + + return 0; +} + +#endif /* INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +static const DSL_char_t g_sPMlescsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_LINE_EVENT_SHOWTIME_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + " most recent showtime = 0" DSL_CPE_CRLF + " former most recent showtime = 1.." _MKSTR(DSL_PM_LINE_EVENT_SHOWTIME_SHOWTIME_RECORDS_NUM) "" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCounters_t pData; + DSL_uint32_t direction = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PM_LineEventShowtimeCounters_t)); + + sscanf (pCommands, "%u %u", &direction, &pData.nHistoryInterval); + pData.nDirection = direction; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nHistoryInterval=%u " + "nElapsedTime=%u bValid=%u nLOF=%u nLOS=%u nLPR=%u nLOM=%u nSosSuccess=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + (DSL_uint32_t)pData.nHistoryInterval, (DSL_uint32_t)pData.interval.nElapsedTime, + (DSL_uint32_t)pData.interval.bValid, (DSL_uint32_t)pData.data.nLOF, + (DSL_uint32_t)pData.data.nLOS, (DSL_uint32_t)pData.data.nLPR, + (DSL_uint32_t)pData.data.nLOM, (DSL_uint32_t)pData.data.nSosSuccess); + } + + return 0; +} + +#endif /* INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef DSL_DEBUG_TOOL_INTERFACE +static const DSL_char_t g_sTcpStart[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "- DSL_char_t sTcpMsgServerIp" DSL_CPE_CRLF + "- DSL_uint16_t nTcpMsgServerPort (optional, default: 2000)" DSL_CPE_CRLF + "- DSL_boolean_t bEnableTcpCli (optional, default: enabled)" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_TCPMessageInterfaceSTART( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = DSL_SUCCESS; + DSL_boolean_t bEnableTcpCli = DSL_FALSE; + DSL_uint16_t tcpIpPort; + DSL_char_t tcpIpAddr[32]; + unsigned char nEnableTcpCli = 0; + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf ( pCommands, "%32s %hu %hhu", + tcpIpAddr, &tcpIpPort, &nEnableTcpCli); + + bEnableTcpCli = nEnableTcpCli; + + if (DSL_CPE_TcpDebugMessageIntfStart(DSL_CPE_GetGlobalContext(), + tcpIpPort, tcpIpAddr) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug messages interface start failed!" DSL_CPE_CRLF)); + + ret = DSL_ERROR; + } +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (DSL_CPE_TcpDebugCliIntfStart(DSL_CPE_GetGlobalContext(), bEnableTcpCli) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug CLI interface start failed!" DSL_CPE_CRLF)); + + ret = DSL_ERROR; + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + + DSL_CPE_FPrintf (out, "nReturn=%d", ret); + + return 0; +} + +static const DSL_char_t g_sTcpStop[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_TCPMessageInterfaceSTOP( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = DSL_SUCCESS; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (DSL_CPE_TcpDebugCliIntfStop(DSL_CPE_GetGlobalContext()) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug CLI interface stop failed!" DSL_CPE_CRLF)); + + ret = DSL_ERROR; + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + if (DSL_CPE_TcpDebugMessageIntfStop(DSL_CPE_GetGlobalContext()) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug messages interface stop failed!" DSL_CPE_CRLF)); + + ret = DSL_ERROR; + } + + DSL_CPE_FPrintf (out, "nReturn=%d", ret); + + return 0; +} +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +static const DSL_char_t g_sDtiStart[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint16_t numOfPhyDevices" DSL_CPE_CRLF + "- DSL_uint16_t numOfLinesPerPhyDevice" DSL_CPE_CRLF + "- DSL_char_t sDtiServerIp" DSL_CPE_CRLF + "- DSL_uint16_t DTI Server Port" DSL_CPE_CRLF + "- DSL_boolean_t bEnableCliAutoMsg" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + "- DSL_boolean_t bEnableDevAutoMsg" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + "- DSL_boolean_t bEnableSingleThreadMode" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DebugTraceInterfaceSTART( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_boolean_t bEnableCliAutoMsg = DSL_FALSE, bEnableDevAutoMsg = DSL_FALSE, bEnableSingleThrMode = DSL_FALSE; + DSL_uint16_t numOfDevs, portsPerDev, dtiIpPort; + DSL_char_t dtiIpAddr[32]; + unsigned char nEnableCliAutoMsg = 0; + unsigned char nEnableDevAutoMsg = 0; + unsigned char nEnableSingleThrMode = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 7, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf ( pCommands, "%hu %hu %32s %hu %hhu %hhu %hhu", + &numOfDevs, &portsPerDev, dtiIpAddr, &dtiIpPort, + &nEnableCliAutoMsg, &nEnableDevAutoMsg, &nEnableSingleThrMode); + + bEnableCliAutoMsg = nEnableCliAutoMsg; + bEnableDevAutoMsg = nEnableDevAutoMsg; + bEnableSingleThrMode = nEnableSingleThrMode; + + /* start DTI agent */ + ret = DSL_CPE_Dti_Start( + DSL_CPE_GetGlobalContext(), numOfDevs, portsPerDev, dtiIpPort, dtiIpAddr, + (bEnableCliAutoMsg) ? DSL_TRUE : DSL_FALSE, + (bEnableDevAutoMsg) ? DSL_TRUE : DSL_FALSE, + (bEnableSingleThrMode) ? DSL_TRUE : DSL_FALSE); + + DSL_CPE_FPrintf (out, "nReturn=%d", ret); + + return 0; +} + +static const DSL_char_t g_sDtiStop[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DebugTraceInterfaceSTOP( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + /* stop DTI agent */ + ret = DSL_CPE_Dti_Stop(DSL_CPE_GetGlobalContext()); + + DSL_CPE_FPrintf (out, "nReturn=%d", ret); + + return 0; +} +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +#ifdef INCLUDE_PILOT_TONES_STATUS +static const DSL_char_t g_sPtsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint16_t nPilotTone" DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(MAX_NUMBER_OF_PILOT_TONES) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PilotTonesStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint8_t nPilot; + DSL_PilotTonesStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PilotTonesStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PILOT_TONES_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nNumData=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nNumData); + DSL_CPE_FPrintf (out, + "nFormat=(nPilotNum(dec),nPilotIndex(dec)) nData=\"" DSL_CPE_CRLF); + + for (nPilot = 0; nPilot < pData.data.nNumData; nPilot++) + { + DSL_CPE_FPrintf (out, "(%02d,%05d)"DSL_CPE_CRLF, nPilot, pData.data.nPilotTone[nPilot]); + } + + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + + return 0; +} +#endif /* #ifdef INCLUDE_PILOT_TONES_STATUS*/ + +static const DSL_char_t g_sRccs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_BF_RebootCriteriaConfigData_t nRebootCriteria (hex)" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LOM = 0x00000001" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LOF = 0x00000002" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LOS = 0x00000004" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_ESE = 0x00000008" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_ESX = 0x00000010" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_SESX = 0x00000020" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_NEGATIVE_MARGIN = 0x00000040" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_OOS_BC0 = 0x00000080" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_OOS_BC1 = 0x00000100" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_NCD_BC0 = 0x00000200" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_NCD_BC1 = 0x00000400" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LCD_BC0 = 0x00000800" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LCD_BC1 = 0x00001000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RebootCriteriaConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RebootCriteriaConfig_t pData; + int nDslMode = 0; + unsigned int nRebootCriteria = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_RebootCriteriaConfig_t)); + + sscanf (pCommands, "%d %x", &nDslMode, &nRebootCriteria); + + pData.nDslMode = nDslMode; + pData.data.nRebootCriteria = nRebootCriteria; + ret = DSL_CPE_Ioctl (fd, DSL_FIO_REBOOT_CRITERIA_CONFIG_SET, + (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sRccg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_BF_RebootCriteriaConfigData_t nRebootCriteria (hex)" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LOM = 0x00000001" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LOF = 0x00000002" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LOS = 0x00000004" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_ESE = 0x00000008" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_ESX = 0x00000010" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_SESX = 0x00000020" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_NEGATIVE_MARGIN = 0x00000040" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_OOS_BC0 = 0x00000080" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_OOS_BC1 = 0x00000100" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_NCD_BC0 = 0x00000200" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_NCD_BC1 = 0x00000400" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LCD_BC0 = 0x00000800" DSL_CPE_CRLF + " DSL_REBOOT_CRITERIA_LCD_BC1 = 0x00001000" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RebootCriteriaConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RebootCriteriaConfig_t pData; + int nDslMode = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_RebootCriteriaConfig_t)); + + sscanf (pCommands, "%d", &nDslMode); + + pData.nDslMode = nDslMode; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_REBOOT_CRITERIA_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDslMode=%u nRebootCriteria=0x%08X" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode, + pData.data.nRebootCriteria); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DEVICE_EXCEPTION_CODES +static const DSL_char_t g_sLecg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "- DSL_uint32_t nErrorCode1 (hex)" DSL_CPE_CRLF + "- DSL_uint32_t nSubErrorCode1 (hex)" DSL_CPE_CRLF + "- DSL_uint32_t nFwErrorCode1 (dec)" DSL_CPE_CRLF + "- DSL_uint32_t nErrorCode2 (hex)" DSL_CPE_CRLF + "- DSL_uint32_t nSubErrorCode2 (hex)" DSL_CPE_CRLF + "- DSL_uint32_t nFwErrorCode2 (dec)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LastExceptionCodesGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LastExceptionCodes_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LastExceptionCodes_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LAST_EXCEPTION_CODES_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET + "nErrorCode1=0x%02X nSubErrorCode1=0x%02X nFwErrorCode1=%u " + "nErrorCode2=0x%02X nSubErrorCode2=0x%02X nFwErrorCode2=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nErrorCode1, pData.data.nSubErrorCode1, pData.data.nFwErrorCode1, + pData.data.nErrorCode2, pData.data.nSubErrorCode2, pData.data.nFwErrorCode2); + } + + return 0; +} +#endif /* INCLUDE_DEVICE_EXCEPTION_CODES*/ + +#ifdef INCLUDE_REAL_TIME_TRACE +static const DSL_char_t g_sRtti[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_char_t IP address and port (xxx.xxx.xxx.xxx:xxx)" DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RTT_Init( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RTT_Init_t pData; + DSL_int_t ip1, ip2, ip3, ip4, port; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_RTT_Init_t)); + + sscanf( pCommands, "%d.%d.%d.%d:%d", &ip1, &ip2, &ip3, &ip4, &port); + + if (ip1 < 0 || ip1 > 255 || + ip2 < 0 || ip2 > 255 || + ip3 < 0 || ip3 > 255 || + ip4 < 0 || ip4 > 255 || + port < 0 || port > 65535) + { + return -1; + } + + pData.data.nIpAddress[0] = ip1; + pData.data.nIpAddress[1] = ip2; + pData.data.nIpAddress[2] = ip3; + pData.data.nIpAddress[3] = ip4; + pData.data.nPort = port; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_RTT_INIT, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sRttcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nStartIndex" DSL_CPE_CRLF + "- DSL_uint16_t nSize" DSL_CPE_CRLF + "- DSL_RTT_ModeControlSet_t nRttMode" DSL_CPE_CRLF + " DSL_RTT_MODE_SHOWTIME = 0" DSL_CPE_CRLF + "- DSL_uint16_t nStopCriteria" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RTT_ConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RTT_Config_t pData; + DSL_int_t nStartIndex, nSize, nRttMode, nStopCriteria; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_RTT_Config_t)); + + sscanf(pCommands,"%u %u %u %u",&nStartIndex, + &nSize, + &nRttMode, + &nStopCriteria); + + pData.data.nStartIndex = nStartIndex; + pData.data.nSize = nSize; + pData.data.nRttMode = nRttMode; + pData.data.nStopCriteria = nStopCriteria; + + ret = ioctl(fd, DSL_FIO_RTT_CONFIG_SET, &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sRttcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nStartIndex" DSL_CPE_CRLF + "- DSL_uint16_t nSize" DSL_CPE_CRLF + "- DSL_RTT_ModeControlSet_t nRttMode" DSL_CPE_CRLF + " DSL_RTT_MODE_SHOWTIME = 0" DSL_CPE_CRLF + "- DSL_uint16_t nStopCriteria" DSL_CPE_CRLF + DSL_CPE_CRLF; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RTT_ConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RTT_Config_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_RTT_Config_t)); + + ret = ioctl(fd, DSL_FIO_RTT_CONFIG_GET, &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nStartIndex=%u nSize=%u nRttMode=%u nStopcriteria=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nStartIndex, pData.data.nSize, + pData.data.nRttMode, pData.data.nStopCriteria); + } + + return 0; +} + +static const DSL_char_t g_sRttsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_RTT_FwStatus_t nFwStatus" DSL_CPE_CRLF + " DSL_RTT_FW_STATUS_IDLE = 0" DSL_CPE_CRLF + " DSL_RTT_FW_STATUS_IN_PROGRESS = 1" DSL_CPE_CRLF + " DSL_RTT_FW_STATUS_COMPLETED = 2" DSL_CPE_CRLF + " DSL_RTT_FW_STATUS_ABORTED = 3" DSL_CPE_CRLF + "- DSL_RTT_FwFailreason_t nFwFailReason" DSL_CPE_CRLF + " DSL_RTT_FW_FAIL_REASON_NONE = 0" DSL_CPE_CRLF + " DSL_RTT_FW_FAIL_REASON_INVALID_CONFIG = 1" DSL_CPE_CRLF + " DSL_RTT_FW_FAIL_REASON_NOT_SUPPORTED = 2" DSL_CPE_CRLF + "- DSL_Error_t nSwErrorCode" DSL_CPE_CRLF + DSL_CPE_CRLF; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RTT_StatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RTT_Status_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_RTT_Status_t)); + + ret = ioctl(fd, DSL_FIO_RTT_STATUS_GET, &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nFwStatus=%u nFwFailReason=%u nSwErrorCode=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nFwStatus, pData.data.nFwFailReason, + pData.data.nSwErrorCode); + } + + return 0; +} + +static const DSL_char_t g_sRttctrls[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_boolean_t bRttEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RTT_ControlSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RTT_Control_t pData; + DSL_uint32_t nRttEnable; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_RTT_Control_t)); + + sscanf(pCommands,"%u",&nRttEnable); + + pData.data.nRttEnable = (nRttEnable == 1) ? 1 : 0; + + ret = ioctl(fd, DSL_FIO_RTT_CONTROL_SET, &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sRttstatg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nFwPacketsSend" DSL_CPE_CRLF + "- DSL_uint32_t nFwPacketsDropped" DSL_CPE_CRLF + "- DSL_uint32_t nSwPacketsSend" DSL_CPE_CRLF + "- DSL_uint32_t nSwPacketsDropped" DSL_CPE_CRLF + DSL_CPE_CRLF; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_RTT_StatisticsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_RTT_Statistics_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_RTT_Statistics_t)); + + ret = ioctl(fd, DSL_FIO_RTT_STATISTICS_GET, &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nFwPacketsSend=%u nFwPacketsDropped=%u nSwPacketsSend=%u nSwPacketsDropped=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nFwPacketsSend, pData.data.nFwPacketsDropped, + pData.data.nSwPacketsSend, pData.data.nSwPacketsDropped); + } + + return 0; +} +#endif /* #ifdef INCLUDE_REAL_TIME_TRACE */ + +static const DSL_char_t g_sOsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint16_t nBitswapRequested" DSL_CPE_CRLF + "- DSL_uint16_t nExtBitswapRequested" DSL_CPE_CRLF + "- DSL_uint16_t nBitswapExecuted" DSL_CPE_CRLF + "- DSL_uint16_t nBitswapRejected" DSL_CPE_CRLF + "- DSL_uint16_t nBitswapTimeout" DSL_CPE_CRLF + "- DSL_uint16_t nSraRequested" DSL_CPE_CRLF + "- DSL_uint16_t nSraExecuted" DSL_CPE_CRLF + "- DSL_uint16_t nSraRejected" DSL_CPE_CRLF + "- DSL_uint16_t nSraTimeout" DSL_CPE_CRLF + "- DSL_uint16_t nSosRequested" DSL_CPE_CRLF + "- DSL_uint16_t nSosExecuted" DSL_CPE_CRLF + "- DSL_uint16_t nSosRejected" DSL_CPE_CRLF + "- DSL_uint16_t nSosTimeout" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_OlrStatisticsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_OlrStatistics_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_OlrStatistics_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_OLR_STATISTICS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nBitswapRequested=%hu " + "nExtBitswapRequested=%hu nBitswapExecuted=%hu nBitswapRejected=%hu " + "nBitswapTimeout=%hu nSraRequested=%hu nSraExecuted=%hu " + "nSraRejected=%hu nSraTimeout=%hu nSosRequested=%hu " + "nSosExecuted=%hu nSosRejected=%hu nSosTimeout=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection,pData.data.nBitswapRequested, + pData.data.nExtBitswapRequested,pData.data.nBitswapExecuted, + pData.data.nBitswapRejected,pData.data.nBitswapTimeout, + pData.data.nSraRequested,pData.data.nSraExecuted, + pData.data.nSraRejected,pData.data.nSraTimeout, + pData.data.nSosRequested,pData.data.nSosExecuted, + pData.data.nSosRejected,pData.data.nSosTimeout); + } + + return 0; +} + +static const DSL_char_t g_sLlsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_UnitSelector_t nUnit" DSL_CPE_CRLF + " feet = 0" DSL_CPE_CRLF + " meter = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_UnitSelector_t nUnit" DSL_CPE_CRLF + " feet = 0" DSL_CPE_CRLF + " meter = 1" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "- DSL_uint32_t nLength_Awg26" DSL_CPE_CRLF + "- DSL_uint32_t nLength_Awg24" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LoopLengthStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LoopLengthStatus_t pData; + unsigned int nUnit = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LoopLengthStatus_t)); + + sscanf (pCommands, "%u", &nUnit); + + pData.nUnit = nUnit; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LOOP_LENGTH_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, "nReturn=%d"DSL_CPE_CRLF, pData.accessCtl.nReturn); + } + else + { + DSL_CPE_FPrintf (out, "nReturn=%d nUnit=%u nLength_Awg26=%u nLength_Awg24=%u" + DSL_CPE_CRLF, pData.accessCtl.nReturn, pData.nUnit, + pData.data.nLength_Awg26, + pData.data.nLength_Awg24); + } + + return 0; +} + +#ifdef INCLUDE_DSL_FILTER_DETECTION +static const DSL_char_t g_sFddg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "- DSL_uint8_t nNoiseLevel" DSL_CPE_CRLF + "- DSL_BridgeTapLength_t nBridgeTapFlag" DSL_CPE_CRLF + " DSL_BRIDGE_TAP_NONE = 0" DSL_CPE_CRLF + " DSL_BRIDGE_TAP_SHORT = 1" DSL_CPE_CRLF + " DSL_BRIDGE_TAP_1KFT = 2" DSL_CPE_CRLF + " DSL_BRIDGE_TAP_LONG = 3" DSL_CPE_CRLF + "- DSL_boolean_t bNoConfidence" DSL_CPE_CRLF + "- DSL_int16_t nNonLinearEchoMetric1" DSL_CPE_CRLF + "- DSL_int16_t nNonLinearEchoMetric2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_FilterDetectionDataGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_FilterDetection_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_FilterDetection_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_FILTER_DETECTION_DATA_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, "nReturn=%d nNoiseLevel=%hu nBridgeTapFlag=%u " + "bNoConfidence=%u nNonLinearEchoMetric1=%hd nNonLinearEchoMetric2=%hd" + DSL_CPE_CRLF, pData.accessCtl.nReturn, + pData.data.nNoiseLevel, + pData.data.nBridgeTapFlag, + pData.data.bNoConfidence, + pData.data.nNonLinearEchoMetric1, + pData.data.nNonLinearEchoMetric2); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_FILTER_DETECTION*/ + +static const DSL_char_t g_sHsdg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_int16_t nHybridIndex" DSL_CPE_CRLF + "- DSL_uint16_t nHybridMetric" DSL_CPE_CRLF + "- ... 3 times previous 2 params (act seleted, second best, FD act selected, " + "FD second best)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_HybridSelectionDataGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_HybridSelection_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_HybridSelection_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_HYBRID_SELECTION_DATA_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, "nReturn=%d " DSL_CPE_CRLF, pData.accessCtl.nReturn); + DSL_CPE_FPrintf (out, "nFormat=(nHybridIndex(dec),nHybridMetric(hex)) nData=\"" DSL_CPE_CRLF); + DSL_CPE_FPrintf (out, "(%hd,0x%04X) (%hd,0x%04X) (%hd,0x%04X) (%hd,0x%04X)" DSL_CPE_CRLF, + pData.data.actualSelection.nHybridIndex, + pData.data.actualSelection.nHybridMetric, + pData.data.secondBestSelection.nHybridIndex, + pData.data.secondBestSelection.nHybridMetric, + pData.data.fdActualSelection.nHybridIndex, + pData.data.fdActualSelection.nHybridMetric, + pData.data.fdSecondBestSelection.nHybridIndex, + pData.data.fdSecondBestSelection.nHybridMetric); + DSL_CPE_FPrintf (out, "\"" DSL_CPE_CRLF); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS +static const DSL_char_t g_sRtsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + "- DSL_uint32_t nTxRetransmitted" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_ReTxStatisticsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_ReTxStatistics_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_ReTxStatistics_t)); + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_RETX_STATISTICS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nDirection=%u nRxCorruptedTotal=%u " + "nRxUncorrectedProtected=%u nRxRetransmitted=%u nRxCorrected=%u " + "nTxRetransmitted=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, + pData.data.nRxCorruptedTotal, pData.data.nRxUncorrectedProtected, + pData.data.nRxRetransmitted, pData.data.nRxCorrected, pData.data.nTxRetransmitted); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS */ + +static const DSL_char_t g_sDsnrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nGroupIndex" DSL_CPE_CRLF + "- DSL_uint16_t nSnr" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DeltSNRGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_DeltSnr_t *pData; + int nDirection = 0; + unsigned int nDeltDataType = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltSnr_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltSnr_t)); + + sscanf (pCommands, "%d %u", &nDirection, &nDeltDataType); + + pData->nDirection = nDirection; + pData->nDeltDataType = nDeltDataType; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DELT_SNR_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), + pData->nDirection, pData->nDeltDataType, + pData->data.nMeasurementTime, pData->data.nGroupSize, + pData->data.deltSnr.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nGroupIndex(dec),nSnr(dec)) nData=\""); + for (i = 0; (i < pData->data.deltSnr.nNumData) && (i < DSL_MAX_NSC); i++) + { + if (i%10 == 0) DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + DSL_CPE_FPrintf(out, "(%04d,%03d) ", i, pData->data.deltSnr.nNSCData[i] ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + + } + free(pData); + return 0; +} + +static const DSL_char_t g_sFdsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_FirmwareDownloadStatusType_t nStatus" DSL_CPE_CRLF + " DSL_FW_DWNLD_STATUS_NA = 0" DSL_CPE_CRLF + " DSL_FW_DWNLD_STATUS_PENDING = 1" DSL_CPE_CRLF + " DSL_FW_DWNLD_STATUS_READY = 2" DSL_CPE_CRLF + " DSL_FW_DWNLD_STATUS_FAILED = 3" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_FirmwareDownloadStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_FirmwareDownloadStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_FirmwareDownloadStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_FIRMWARE_DOWNLOAD_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nStatus=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nStatus); + } + + return 0; +} + +static const DSL_char_t g_sT1413XTUOrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_T1413_Revision_t nRevision" DSL_CPE_CRLF + " DSL_T1413_REV1 = 0" DSL_CPE_CRLF + " DSL_T1413_REV2 = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_T1413_XTUO_RevisionGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_T1413RevisionStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_T1413RevisionStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_T1413_XTUO_REVISION_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nRevision=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nT1413RevisionNum); + } + + return 0; +} + +static const DSL_char_t g_sT1413XTURrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_T1413_Revision_t nRevision" DSL_CPE_CRLF + " DSL_T1413_REV1 = 0" DSL_CPE_CRLF + " DSL_T1413_REV2 = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_T1413_XTUR_RevisionGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_T1413RevisionStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_T1413RevisionStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_T1413_XTUR_REVISION_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nRevision=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nT1413RevisionNum); + } + + return 0; +} + +static const DSL_char_t g_sT1413XTUOvrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nRevision" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_T1413_XTUO_VendorRevisionGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_T1413VendorRevisionStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_T1413VendorRevisionStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_T1413_XTUO_VENDOR_REVISION_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nRevision=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nT1413VendorRevisionNum); + } + + return 0; +} + +static const DSL_char_t g_sT1413XTURvrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nRevision" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_T1413_XTUR_VendorRevisionGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_T1413VendorRevisionStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_T1413VendorRevisionStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_T1413_XTUR_VENDOR_REVISION_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nRevision=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nT1413VendorRevisionNum); + } + + return 0; +} + +static const DSL_char_t g_sPccg[] = +#ifndef DSL_CPE_DEBUG_DISABLE +"Long Form: %s" DSL_CPE_CRLF +"Short Form: %s" DSL_CPE_CRLF +DSL_CPE_CRLF +"Input Parameter" DSL_CPE_CRLF +"- DSL_AccessDir_t nDirection" DSL_CPE_CRLF +" upstream = 0" DSL_CPE_CRLF +" downstream = 1" DSL_CPE_CRLF +DSL_CPE_CRLF +"Output Parameter" DSL_CPE_CRLF +"- DSL_uint16_t NumBreakPts" +"- DSL_IN DSL_uint16_t toneIndex" +"- DSL_IN DSL_uint16_t level" +"- ... n times previous 2 params[0 <= n <= "_MKSTR(DSL_PSD_US_MAX_CALIB_POINTS)"]" +"- DSL_Error_t nReturn" DSL_CPE_CRLF +DSL_CPE_CRLF ""; +#else +""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PSDCalibrationConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_PSDCalibration_t *pData; + DSL_uint16_t i = 0; + DSL_int_t ret = 0; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_PSDCalibration_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + + memset(pData, 0, sizeof(DSL_PSDCalibration_t)); + sscanf (pCommands, "%d ", &nDirection); + + pData->nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PSD_CALIBRATION_CONFIG_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + + DSL_CPE_FPrintf (out, " NumBreakPts=0x%04X nData(hex)=\"" DSL_CPE_CRLF, pData->data.NumBreakPts); + /* Print only the number of values that are returned */ + for (i = 0; (i < pData->data.NumBreakPts); i++) + { + DSL_CPE_FPrintf(out, "(0x%04X 0x%04X)", (DSL_int_t)(pData->data.breakpoint[i].toneIndex), (DSL_int_t)(pData->data.breakpoint[i].level)); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + free(pData); + return 0; +} + +static const DSL_char_t g_sPccs[] = +#ifndef DSL_CPE_DEBUG_DISABLE +"Long Form: %s" DSL_CPE_CRLF +"Short Form: %s" DSL_CPE_CRLF +DSL_CPE_CRLF +"Input Parameter" DSL_CPE_CRLF +"- DSL_AccessDir_t nDirection" DSL_CPE_CRLF +" upstream = 0" DSL_CPE_CRLF +" downstream = 1" DSL_CPE_CRLF +"- DSL_uint16_t NumBreakPts" +"- DSL_IN DSL_uint16_t toneIndex" +"- DSL_IN DSL_uint16_t level" +"- ... n times previous 2 params[0 <= n <= "_MKSTR(DSL_PSD_US_MAX_CALIB_POINTS)"]" +DSL_CPE_CRLF +"Output Parameter" DSL_CPE_CRLF +"- DSL_Error_t nReturn" DSL_CPE_CRLF +DSL_CPE_CRLF ""; +#else +""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PSDCalibrationConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_int_t i = 0; + DSL_char_t *pChar = DSL_NULL; + DSL_PSDCalibration_t pData; + DSL_uint32_t ntoneIndex=0; + DSL_uint32_t nlevel=0; + DSL_uint32_t nMaxBreakpoints=0; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_PSDCalibration_t)); + + pChar = pCommands; + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + if (pData.nDirection == DSL_UPSTREAM) + { + nMaxBreakpoints = DSL_PSD_US_MAX_CALIB_POINTS; + } + if (pData.nDirection == DSL_DOWNSTREAM) + { + nMaxBreakpoints = DSL_PSD_DS_MAX_CALIB_POINTS; + } + ret = DSL_CPE_MoveCharPtr(pChar, 1, " ", &pChar); + if (ret != DSL_SUCCESS) + { + /* No breakpoints available*/ + pChar = DSL_NULL; + } + + for (i = 0; i < nMaxBreakpoints; i++) + { + if ( pChar == DSL_NULL) + { + /* no more entries, leave the loop */ + break; + } + + ret = sscanf(pChar, "%x %x", &ntoneIndex, &nlevel); + if ( ret != 2 ) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "invalid breakpoint data!" DSL_CPE_CRLF); + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERROR)); + return 0; + } + + pData.data.breakpoint[i].toneIndex = (DSL_uint16_t)ntoneIndex; + pData.data.breakpoint[i].level = (DSL_uint16_t)nlevel; + + ret = DSL_CPE_MoveCharPtr(pChar, 2, " ", &pChar); + if (ret != DSL_SUCCESS) + { + pChar = DSL_NULL; + } + } + if (pChar != DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "Too many brekpoints!" DSL_CPE_CRLF); + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERROR)); + return 0; + } + + /* Set current number of breakpoints */ + pData.data.NumBreakPts = (DSL_uint16_t)i; + + DSL_CPE_FPrintf (out, " NumBreakPts=0x%04X nData(int)=\"" DSL_CPE_CRLF, pData.data.NumBreakPts); + /* Print only the number of values that are returned */ + for (i = 0; (i < pData.data.NumBreakPts); i++) + { + DSL_CPE_FPrintf(out, "(0x%04X 0x%04X)", (DSL_int_t)(pData.data.breakpoint[i].toneIndex), (DSL_int_t)(pData.data.breakpoint[i].level)); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PSD_CALIBRATION_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +/** + Register the CLI commands. + + \param pContext Pointer to dsl library context structure, [I] + \param command optional parameters [I] +*/ +DSL_void_t DSL_CPE_CLI_AccessCommandsRegister(DSL_void_t) +{ + /* Debug functionalities */ +#ifndef DSL_CPE_DEBUG_DISABLE + DSL_CPE_CLI_CMD_ADD_DEVICE ("ccadbgmlg", "CCA_DBG_ModuleLevelGet", DSL_CPE_CLI_CCA_DBG_ModuleLevelGet, g_sCcaDbgmlg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("ccadbgmls", "CCA_DBG_ModuleLevelSet", DSL_CPE_CLI_CCA_DBG_ModuleLevelSet, g_sCcaDbgmls); +#endif + DSL_CPE_CLI_CMD_ADD_DEVICE ("dbgmlg", "DBG_ModuleLevelGet", DSL_CPE_CLI_DBG_ModuleLevelGet, g_sDBGmlg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("dbgmls", "DBG_ModuleLevelSet", DSL_CPE_CLI_DBG_ModuleLevelSet, g_sDBGmls); + +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT + /* Debug functionalities */ +#ifndef DSL_CPE_DEBUG_DISABLE + DSL_CPE_CLI_CMD_ADD_DEVICE ("ccadbgmdg", "CCA_DBG_ModuleDestinationGet", DSL_CPE_CLI_CCA_DBG_ModuleDestinationGet, g_sCcaDbgmdg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("ccadbgmds", "CCA_DBG_ModuleDestinationSet", DSL_CPE_CLI_CCA_DBG_ModuleDestinationSet, g_sCcaDbgmds); +#endif + DSL_CPE_CLI_CMD_ADD_DEVICE ("dbgmdg", "DBG_ModuleDestinationGet", DSL_CPE_CLI_DBG_ModuleDestinationGet, g_sDBGmdg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("dbgmds", "DBG_ModuleDestinationSet", DSL_CPE_CLI_DBG_ModuleDestinationSet, g_sDBGmds); +#endif /* INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT */ + + /* Common functionalities */ +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +#ifdef INCLUDE_DSL_CONFIG_GET +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("asecg", "AutobootScriptExecuteConfigGet", DSL_CPE_CLI_AutobootScriptExecuteConfigGet, g_sAsecg); +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("acog", "AutobootConfigOptionGet", DSL_CPE_CLI_AutobootConfigOptionGet, g_sAcfgg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + DSL_CPE_CLI_CMD_ADD_DEVICE ("se", "ScriptExecute", DSL_CPE_CLI_ScriptExecute, g_sSe); + DSL_CPE_CLI_CMD_ADD_DEVICE ("asecs", "AutobootScriptExecuteConfigSet", DSL_CPE_CLI_AutobootScriptExecuteConfigSet, g_sAsecs); +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("acos", "AutobootConfigOptionSet", DSL_CPE_CLI_AutobootConfigOptionSet, g_sAcfgs); +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("nsecg", "NotificationScriptExecuteConfigGet", DSL_CPE_CLI_NotificationScriptExecuteConfigGet, g_sNsecg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("nsecs", "NotificationScriptExecuteConfigSet", DSL_CPE_CLI_NotificationScriptExecuteConfigSet, g_sNsecs); +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + + DSL_CPE_CLI_CMD_ADD_DEVICE ("acs", "AutobootControlSet", DSL_CPE_CLI_AutobootControlSet, g_sAcs); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("asg", "AutobootStatusGet", DSL_CPE_CLI_AutobootStatusGet, g_sAsg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("lsg", "LineStateGet", DSL_CPE_CLI_LineStateGet, g_sLsg); +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("rusg", "ResourceUsageStatisticsGet", DSL_CPE_CLI_ResourceUsageStatisticsGet, g_sRusg); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("esmcg", "EventStatusMaskConfigGet", DSL_CPE_CLI_EventStatusMaskConfigGet, g_sEsmcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("esmcs", "EventStatusMaskConfigSet", DSL_CPE_CLI_EventStatusMaskConfigSet, g_sEsmcs); +#ifdef INCLUDE_DSL_FRAMING_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("fpsg", "FramingParameterStatusGet", DSL_CPE_CLI_FramingParameterStatusGet, g_sFpsg); +#endif /* INCLUDE_DSL_FRAMING_PARAMETERS*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("ics", "InstanceControlSet", DSL_CPE_CLI_InstanceControlSet, g_sIcs); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("isg", "InstanceStatusGet", DSL_CPE_CLI_InstanceStatusGet, g_sIsg); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("lfcg", "LineFeatureConfigGet", DSL_CPE_CLI_LineFeatureConfigGet, g_sLfcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("lfcs", "LineFeatureConfigSet", DSL_CPE_CLI_LineFeatureConfigSet, g_sLfcs); + DSL_CPE_CLI_CMD_ADD_DEVICE ("lfsg", "LineFeatureStatusGet", DSL_CPE_CLI_LineFeatureStatusGet, g_sLfsg); +#ifdef INCLUDE_DSL_SYSTEM_INTERFACE +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("sicg", "SystemInterfaceConfigGet", DSL_CPE_CLI_SystemInterfaceConfigGet, g_sSicg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("sics", "SystemInterfaceConfigSet", DSL_CPE_CLI_SystemInterfaceConfigSet, g_sSics); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("sisg", "SystemInterfaceStatusGet", DSL_CPE_CLI_SystemInterfaceStatusGet, g_sSisg); +#endif /* INCLUDE_DSL_SYSTEM_INTERFACE*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("tmcs", "TestModeControlSet", DSL_CPE_CLI_TestModeControlSet, g_sTmcs); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("tmsg", "TestModeStatusGet", DSL_CPE_CLI_TestModeStatusGet, g_sTmsg); +#ifdef INCLUDE_DSL_CPE_MISC_LINE_STATUS + DSL_CPE_CLI_CMD_ADD_DEVICE ("bbsg", "BandBorderStatusGet", DSL_CPE_CLI_BandBorderStatusGet, g_sBbsg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mlsg", "MiscLineStatusGet", DSL_CPE_CLI_MiscLineStatusGet, g_sMlsg); +#endif /* INCLUDE_DSL_CPE_MISC_LINE_STATUS*/ + /* G.997.1 related functionlities */ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997racs", "G997_RateAdaptationConfigSet", DSL_CPE_CLI_G997_RateAdaptationConfigSet, g_sRaCs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997racg", "G997_RateAdaptationConfigGet", DSL_CPE_CLI_G997_RateAdaptationConfigGet, g_sRaCg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ +#ifdef INCLUDE_DSL_G997_ALARM +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997amdpfcg", "G997_AlarmMaskDataPathFailuresConfigGet", DSL_CPE_CLI_G997_AlarmMaskDataPathFailuresConfigGet, g_sG997amdpfcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997amdpfcs", "G997_AlarmMaskDataPathFailuresConfigSet", DSL_CPE_CLI_G997_AlarmMaskDataPathFailuresConfigSet, g_sG997amdpfcs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997amlfcg", "G997_AlarmMaskLineFailuresConfigGet", DSL_CPE_CLI_G997_AlarmMaskLineFailuresConfigGet, g_sG997amlfcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997amlfcs", "G997_AlarmMaskLineFailuresConfigSet", DSL_CPE_CLI_G997_AlarmMaskLineFailuresConfigSet, g_sG997amlfcs); +#endif /* INCLUDE_DSL_G997_ALARM*/ +#ifdef INCLUDE_DSL_G997_PER_TONE + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997bang", "G997_BitAllocationNscGet", DSL_CPE_CLI_G997_BitAllocationNscGet, g_sG997bang); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997bansg", "G997_BitAllocationNscShortGet", DSL_CPE_CLI_G997_BitAllocationNscShortGet, g_sG997bansg); +#endif /* INCLUDE_DSL_G997_PER_TONE*/ +#ifdef INCLUDE_DSL_G997_ALARM +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997cdrtcg", "G997_ChannelDataRateThresholdConfigGet", DSL_CPE_CLI_G997_ChannelDataRateThresholdConfigGet, g_sG997cdrtcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997cdrtcs", "G997_ChannelDataRateThresholdConfigSet", DSL_CPE_CLI_G997_ChannelDataRateThresholdConfigSet, g_sG997cdrtcs); +#endif /* INCLUDE_DSL_G997_ALARM*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997csg", "G997_ChannelStatusGet", DSL_CPE_CLI_G997_ChannelStatusGet, g_sG997csg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997dpfsg", "G997_DataPathFailuresStatusGet", DSL_CPE_CLI_G997_DataPathFailuresStatusGet, g_sG997dpfsg); +#ifdef INCLUDE_DSL_G997_FRAMING_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997fpsg", "G997_FramingParameterStatusGet", DSL_CPE_CLI_G997_FramingParameterStatusGet, g_sG997fpsg); +#endif /* INCLUDE_DSL_G997_FRAMING_PARAMETERS*/ +#ifdef INCLUDE_DSL_G997_PER_TONE + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997gang", "G997_GainAllocationNscGet", DSL_CPE_CLI_G997_GainAllocationNscGet, g_sG997gang); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997gansg", "G997_GainAllocationNscShortGet", DSL_CPE_CLI_G997_GainAllocationNscShortGet, g_sG997gansg); +#endif /* INCLUDE_DSL_G997_PER_TONE*/ +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997lacg", "G997_LineActivateConfigGet", DSL_CPE_CLI_G997_LineActivateConfigGet, g_sG997lacg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lacs", "G997_LineActivateConfigSet", DSL_CPE_CLI_G997_LineActivateConfigSet, g_sG997lacs); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lfsg", "G997_LineFailureStatusGet", DSL_CPE_CLI_G997_LineFailureStatusGet, g_sG997lfsg); +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lig", "G997_LineInventoryGet", DSL_CPE_CLI_G997_LineInventoryGet, g_sG997lig); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lis", "G997_LineInventorySet", DSL_CPE_CLI_G997_LineInventorySet, g_sG997lis); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997listrg", "G997_LineInventorySTRingGet", DSL_CPE_CLI_G997_LineInventoryStringGet, g_sG997listrg); +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lsg", "G997_LineStatusGet", DSL_CPE_CLI_G997_LineStatusGet, g_sG997lsg); +#ifdef INCLUDE_DSL_G997_STATUS + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997ltsg", "G997_LineTransmissionStatusGet", DSL_CPE_CLI_G997_LineTransmissionStatusGet, g_sG997ltsg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997lisg", "G997_LineInitStatusGet", DSL_CPE_CLI_G997_LineInitStatusGet, g_sG997lisg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lstg", "G997_LastStateTransmittedGet", DSL_CPE_CLI_G997_LastStateTransmittedGet, g_sG997lstg); +#endif /* INCLUDE_DSL_G997_STATUS*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997pmsft", "G997_PowerManagementStateForcedTrigger", DSL_CPE_CLI_G997_PowerManagementStateForcedTrigger, g_sG997pmsft); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997pmsg", "G997_PowerManagementStatusGet", DSL_CPE_CLI_G997_PowerManagementStatusGet, g_sG997pmsg); +#ifdef INCLUDE_DSL_CEOC + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997sms", "G997_SnmpMessageSend", DSL_CPE_CLI_G997_SnmpMessageSend, g_sG997sms); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997smr", "G997_SnmpMessageReceive", DSL_CPE_CLI_G997_SnmpMessageReceive, g_sG997smr); +#endif /* INCLUDE_DSL_CEOC */ +#ifdef INCLUDE_DSL_G997_PER_TONE + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997sang", "G997_SnrAllocationNscGet", DSL_CPE_CLI_G997_SnrAllocationNscGet, g_sG997sang); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997sansg", "G997_SnrAllocationNscShortGet", DSL_CPE_CLI_G997_SnrAllocationNscShortGet, g_sG997sansg); +#endif /* INCLUDE_DSL_G997_PER_TONE*/ +#ifdef INCLUDE_DSL_DELT + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997dfr", "G997_DeltFreeResources", DSL_CPE_CLI_G997_DeltFreeResources, g_sg997dfr); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997dhling", "G997_DeltHLINGet", DSL_CPE_CLI_G997_DeltHLINGet, g_sG997dhling); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997dhlinsg", "G997_DeltHLINScaleGet", DSL_CPE_CLI_G997_DeltHLINScaleGet, g_sG997dhlinsg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997dhlogg", "G997_DeltHLOGGet", DSL_CPE_CLI_G997_DeltHLOGGet,g_sG997dhlogg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997dqlng", "G997_DeltQLNGet", DSL_CPE_CLI_G997_DeltQLNGet,g_sG997dqlng); + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997dsnrg", "G997_DeltSNRGet", DSL_CPE_CLI_G997_DeltSNRGet,g_sG997dsnrg); +#endif /* INCLUDE_DSL_DELT*/ +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997xtusecg", "G997_XTUSystemEnablingConfigGet", DSL_CPE_CLI_G997_XTUSystemEnablingConfigGet, g_sG997xtusecg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997xtusecs", "G997_XTUSystemEnablingConfigSet", DSL_CPE_CLI_G997_XTUSystemEnablingConfigSet, g_sG997xtusecs); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997xtusesg", "G997_XTUSystemEnablingStatusGet", DSL_CPE_CLI_G997_XTUSystemEnablingStatusGet, g_sG997xtusesg); + + DSL_CPE_CLI_CMD_ADD_DEVICE ("locs", "LineOptionsConfigSet", DSL_CPE_CLI_LineOptionsConfigSet, g_sLocs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("locg", "LineOptionsConfigGet", DSL_CPE_CLI_LineOptionsConfigGet, g_sLocg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_CONFIG + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmcs", "PM_ConfigSet", DSL_CPE_CLI_PM_ConfigSet, g_sPMcs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("pmcg", "PM_ConfigGet", DSL_CPE_CLI_PM_ConfigGet, g_sPMcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ +#endif /* INCLUDE_DSL_CPE_PM_CONFIG*/ + /* PM related functionalities */ +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pm15meet", "PM_15MinElapsedExtTrigger", DSL_CPE_CLI_PM_15MinElapsedExtTrigger, g_sPM15meet); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmbms", "PM_BurninModeSet", DSL_CPE_CLI_PM_BurninModeSet, g_sPMbms); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("pmetr", "PM_ElapsedTimeReset", DSL_CPE_CLI_PM_ElapsedTimeReset, g_sPMetr); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmsms", "PM_SyncModeSet", DSL_CPE_CLI_PM_SyncModeSet, g_sPMsms); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmsmg", "PM_SyncModeGet", DSL_CPE_CLI_PM_SyncModeGet, g_sPMsmg); +#endif /* #ifdef INCLUDE_DSL_CONFIG_GET*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmr", "PM_Reset", DSL_CPE_CLI_PM_Reset, g_sPMr); + +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS + /* Channel related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmcc15mg", "PM_ChannelCounters15MinGet", DSL_CPE_CLI_PM_ChannelCounters15MinGet, g_sPMcc15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmcc1dg", "PM_ChannelCounters1DayGet", DSL_CPE_CLI_PM_ChannelCounters1DayGet, g_sPMcc1dg); +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmchs15mg", "PM_ChannelHistoryStats15MinGet", DSL_CPE_CLI_PM_ChannelHistoryStats15MinGet, g_sPMchs15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmchs1dg", "PM_ChannelHistoryStats1DayGet", DSL_CPE_CLI_PM_ChannelHistoryStats1DayGet, g_sPMchs1dg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmcctg", "PM_ChannelCountersTotalGet", DSL_CPE_CLI_PM_ChannelCountersTotalGet, g_sPMcctg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmccsg", "PM_ChannelCountersShowtimeGet", DSL_CPE_CLI_PM_ChannelCountersShowtimeGet, g_sPMccsg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmct15mg", "PM_ChannelThresholds15MinGet", DSL_CPE_CLI_PM_ChannelThresholds15MinGet, g_sPMct15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmct15ms", "PM_ChannelThresholds15MinSet", DSL_CPE_CLI_PM_ChannelThresholds15MinSet, g_sPMct15ms); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmct1dg", "PM_ChannelThresholds1DayGet", DSL_CPE_CLI_PM_ChannelThresholds1DayGet, g_sPMct1dg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmct1ds", "PM_ChannelThresholds1DaySet", DSL_CPE_CLI_PM_ChannelThresholds1DaySet, g_sPMct1ds); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS */ + +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS + /* Data path related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpc15mg", "PM_DataPathCounters15MinGet", DSL_CPE_CLI_PM_DataPathCounters15MinGet, g_sPMdpc15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpc1dg", "PM_DataPathCounters1DayGet", DSL_CPE_CLI_PM_DataPathCounters1DayGet, g_sPMdpc1dg); +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdphs15mg", "PM_DataPathHistoryStats15MinGet", DSL_CPE_CLI_PM_DataPathHistoryStats15MinGet, g_sPMdphs15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdphs1dg", "PM_DataPathHistoryStats1DayGet", DSL_CPE_CLI_PM_DataPathHistoryStats1DayGet, g_sPMdphs1dg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpctg", "PM_DataPathCountersTotalGet", DSL_CPE_CLI_PM_DataPathCountersTotalGet, g_sPMdpctg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpcsg", "PM_DataPathCountersShowtimeGet", DSL_CPE_CLI_PM_DataPathCountersShowtimeGet, g_sPMdpcsg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpt15mg", "PM_DataPathThresholds15MinGet", DSL_CPE_CLI_PM_DataPathThresholds15MinGet, g_sPMdpt15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpt15ms", "PM_DataPathThresholds15MinSet", DSL_CPE_CLI_PM_DataPathThresholds15MinSet, g_sPMdpt15ms); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpt1dg", "PM_DataPathThresholds1DayGet", DSL_CPE_CLI_PM_DataPathThresholds1DayGet, g_sPMdpt1dg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpt1ds", "PM_DataPathThresholds1DaySet", DSL_CPE_CLI_PM_DataPathThresholds1DaySet, g_sPMdpt1ds); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS */ + +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS + /* ReTx related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtc15mg", "PM_ReTxCounters15MinGet", DSL_CPE_CLI_PM_ReTxCounters15MinGet, g_sPMrtc15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtc1dg", "PM_ReTxCounters1DayGet", DSL_CPE_CLI_PM_ReTxCounters1DayGet, g_sPMrtc1dg); +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrths15mg", "PM_ReTxHistoryStats15MinGet", DSL_CPE_CLI_PM_ReTxHistoryStats15MinGet, g_sPMrths15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrths1dg", "PM_ReTxHistoryStats1DayGet", DSL_CPE_CLI_PM_ReTxHistoryStats1DayGet, g_sPMrths1dg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtctg", "PM_ReTxCountersTotalGet", DSL_CPE_CLI_PM_ReTxCountersTotalGet, g_sPMrtctg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtcsg", "PM_ReTxCountersShowtimeGet", DSL_CPE_CLI_PM_ReTxCountersShowtimeGet, g_sPMrtcsg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtt15mg", "PM_ReTxThresholds15MinGet", DSL_CPE_CLI_PM_ReTxThresholds15MinGet, g_sPMrtt15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtt15ms", "PM_ReTxThresholds15MinSet", DSL_CPE_CLI_PM_ReTxThresholds15MinSet, g_sPMrtt15ms); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtt1dg", "PM_ReTxThresholds1DayGet", DSL_CPE_CLI_PM_ReTxThresholds1DayGet, g_sPMrtt1dg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmrtt1ds", "PM_ReTxThresholds1DaySet", DSL_CPE_CLI_PM_ReTxThresholds1DaySet, g_sPMrtt1ds); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ + +#ifdef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS + /* Data path related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpfc15mg", "PM_DataPathFailureCounters15MinGet", DSL_CPE_CLI_PM_DataPathFailureCounters15MinGet, g_sPMdpfc15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpfc1dg", "PM_DataPathFailureCounters1DayGet", DSL_CPE_CLI_PM_DataPathFailureCounters1DayGet, g_sPMdpfc1dg); +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpfhs15mg", "PM_DataPathFailureHistoryStats15MinGet", DSL_CPE_CLI_PM_DataPathFailureHistoryStats15MinGet, g_sPMdpfhs15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpfhs1dg", "PM_DataPathFailureHistoryStats1DayGet", DSL_CPE_CLI_PM_DataPathFailureHistoryStats1DayGet, g_sPMdpfhs1dg); +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpfctg", "PM_DataPathFailureCountersTotalGet", DSL_CPE_CLI_PM_DataPathFailureCountersTotalGet, g_sPMdpfctg); +#endif /* INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmdpfcsg", "PM_DataPathFailureCountersShowtimeGet", DSL_CPE_CLI_PM_DataPathFailureCountersShowtimeGet, g_sPMdpfcsg); +#endif /* INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS */ + +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS + /* Data path related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlesc15mg", "PM_LineEventShowtimeCounters15MinGet", DSL_CPE_CLI_PM_LineEventShowtimeCounters15MinGet, g_sPMlesc15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlesc1dg", "PM_LineEventShowtimeCounters1DayGet", DSL_CPE_CLI_PM_LineEventShowtimeCounters1DayGet, g_sPMlesc1dg); +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmleshs15mg", "PM_LineEventShowtimeHistoryStats15MinGet", DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats15MinGet, g_sPMleshs15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmleshs1dg", "PM_LineEventShowtimeHistoryStats1DayGet", DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats1DayGet, g_sPMleshs1dg); +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlesctg", "PM_LineEventShowtimeCountersTotalGet", DSL_CPE_CLI_PM_LineEventShowtimeCountersTotalGet, g_sPMlesctg); +#endif /* INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlescsg", "PM_LineEventShowtimeCountersShowtimeGet", DSL_CPE_CLI_PM_LineEventShowtimeCountersShowtimeGet, g_sPMlescsg); +#endif /* INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ + +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS + /* Line init related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlic15mg", "PM_LineInitCounters15MinGet", DSL_CPE_CLI_PM_LineInitCounters15MinGet, g_sPMlic15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlic1dg", "PM_LineInitCounters1DayGet", DSL_CPE_CLI_PM_LineInitCounters1DayGet, g_sPMlic1dg); +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("pmlihs15mg", "PM_LineInitHistoryStats15MinGet", DSL_CPE_CLI_PM_LineInitHistoryStats15MinGet, g_sPMlihs15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("pmlihs1dg", "PM_LineInitHistoryStats1DayGet", DSL_CPE_CLI_PM_LineInitHistoryStats1DayGet, g_sPMlihs1dg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("pmlictg", "PM_LineInitCountersTotalGet", DSL_CPE_CLI_PM_LineInitCountersTotalGet, g_sPMlictg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlicsg", "PM_LineInitCountersShowtimeGet", DSL_CPE_CLI_PM_LineInitCountersShowtimeGet, g_sPMlicsg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("pmlit15mg", "PM_LineInitThresholds15MinGet", DSL_CPE_CLI_PM_LineInitThresholds15MinGet, g_sPMlit15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlit15ms", "PM_LineInitThresholds15MinSet", DSL_CPE_CLI_PM_LineInitThresholds15MinSet, g_sPMlit15ms); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("pmlit1dg", "PM_LineInitThresholds1DayGet", DSL_CPE_CLI_PM_LineInitThresholds1DayGet, g_sPMlit1dg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlit1ds", "PM_LineInitThresholds1DaySet", DSL_CPE_CLI_PM_LineInitThresholds1DaySet, g_sPMlit1ds); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ + + /* Line seconds related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlsc15mg", "PM_LineSecCounters15MinGet", DSL_CPE_CLI_PM_LineSecCounters15MinGet, g_sPMlsc15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlsc1dg", "PM_LineSecCounters1DayGet", DSL_CPE_CLI_PM_LineSecCounters1DayGet, g_sPMlsc1dg); +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlshs15mg", "PM_LineSecHistoryStats15MinGet", DSL_CPE_CLI_PM_LineSecHistoryStats15MinGet, g_sPMlshs15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlshs1dg", "PM_LineSecHistoryStats1DayGet", DSL_CPE_CLI_PM_LineSecHistoryStats1DayGet, g_sPMlshs1dg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlsctg", "PM_LineSecCountersTotalGet", DSL_CPE_CLI_PM_LineSecCountersTotalGet, g_sPMlsctg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlscsg", "PM_LineSecCountersShowtimeGet", DSL_CPE_CLI_PM_LineSecCountersShowtimeGet, g_sPMlscsg); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlst15mg", "PM_LineSecThresholds15MinGet", DSL_CPE_CLI_PM_LineSecThresholds15MinGet, g_sPMlst15mg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlst15ms", "PM_LineSecThresholds15MinSet", DSL_CPE_CLI_PM_LineSecThresholds15MinSet, g_sPMlst15ms); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlst1dg", "PM_LineSecThresholds1DayGet", DSL_CPE_CLI_PM_LineSecThresholds1DayGet, g_sPMlst1dg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pmlst1ds", "PM_LineSecThresholds1DaySet", DSL_CPE_CLI_PM_LineSecThresholds1DaySet, g_sPMlst1ds); +#endif /* #ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS */ +#endif /* #ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS */ + +#endif /* #ifdef INCLUDE_DSL_PM */ + +#ifdef DSL_DEBUG_TOOL_INTERFACE + DSL_CPE_CLI_CMD_ADD_DEVICE ("tcpmistart", "TCPMessageInterfaceSTART", DSL_CPE_CLI_TCPMessageInterfaceSTART, g_sTcpStart); + DSL_CPE_CLI_CMD_ADD_DEVICE ("tcpmistop", "TCPMessageInterfaceSTOP", DSL_CPE_CLI_TCPMessageInterfaceSTOP, g_sTcpStop); +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) + DSL_CPE_CLI_CMD_ADD_DEVICE ("dtistart", "DebugTraceInterfaceSTART", DSL_CPE_CLI_DebugTraceInterfaceSTART, g_sDtiStart); + DSL_CPE_CLI_CMD_ADD_DEVICE ("dtistop", "DebugTraceInterfaceSTOP", DSL_CPE_CLI_DebugTraceInterfaceSTOP, g_sDtiStop); +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +#ifdef INCLUDE_PILOT_TONES_STATUS + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("ptsg", "PilotTonesStatusGet", DSL_CPE_CLI_PilotTonesStatusGet, g_sPtsg); +#endif /* #ifdef INCLUDE_PILOT_TONES_STATUS*/ + + DSL_CPE_CLI_CMD_ADD_DEVICE ("rccs", "RebootCriteriaConfigSet", DSL_CPE_CLI_RebootCriteriaConfigSet, g_sRccs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("rccg", "RebootCriteriaConfigGet", DSL_CPE_CLI_RebootCriteriaConfigGet, g_sRccg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DEVICE_EXCEPTION_CODES + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("lecg", "LastExceptionCodesGet", DSL_CPE_CLI_LastExceptionCodesGet, g_sLecg); +#endif /* #ifdef INCLUDE_DEVICE_EXCEPTION_CODES*/ + +#ifdef INCLUDE_REAL_TIME_TRACE + DSL_CPE_CLI_CMD_ADD_DEVICE ("rtti", "RTT_Init", DSL_CPE_CLI_RTT_Init, g_sRtti); + DSL_CPE_CLI_CMD_ADD_DEVICE ("rttcs", "RTT_ConfigSet", DSL_CPE_CLI_RTT_ConfigSet, g_sRttcs); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("rttcg", "RTT_ConfigGet", DSL_CPE_CLI_RTT_ConfigGet, g_sRttcg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("rttsg", "RTT_StatusGet", DSL_CPE_CLI_RTT_StatusGet, g_sRttsg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("rttctrls", "RTT_ConTRoLSet", DSL_CPE_CLI_RTT_ControlSet, g_sRttctrls); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("rttstatg", "RTT_STATisticsGet", DSL_CPE_CLI_RTT_StatisticsGet, g_sRttstatg); +#endif /*#ifdef INCLUDE_REAL_TIME_TRACE*/ + + DSL_CPE_CLI_CMD_ADD_DEVICE ("osg", "OlrStatisticsGet", DSL_CPE_CLI_OlrStatisticsGet, g_sOsg); + + DSL_CPE_CLI_CMD_ADD_DEVICE ("llsg", "LoopLengthStatusGet", DSL_CPE_CLI_LoopLengthStatusGet, g_sLlsg); + +#ifdef INCLUDE_DSL_FILTER_DETECTION + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("fddg", "FilterDetectionDataGet", DSL_CPE_CLI_FilterDetectionDataGet, g_sFddg); +#endif /* #ifdef INCLUDE_DSL_FILTER_DETECTION*/ + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("hsdg", "HybridSelectionDataGet", DSL_CPE_CLI_HybridSelectionDataGet, g_sHsdg); + + DSL_CPE_CLI_DeviceCommandsRegister(); + +#ifdef INCLUDE_DSL_ADSL_MIB + DSL_CPE_CLI_MibCommandsRegister(); +#endif /* INCLUDE_DSL_ADSL_MIB*/ + +#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS + DSL_CPE_CLI_CMD_ADD_DEVICE ("rtsg", "ReTxStatisticsGet", DSL_CPE_CLI_ReTxStatisticsGet, g_sRtsg); +#endif /* INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS */ +#endif /* INCLUDE_DSL_CPE_PM_RETX_COUNTERS */ + + DSL_CPE_CLI_CMD_ADD_DEVICE ("dsnrg", "DeltSNRGet", DSL_CPE_CLI_DeltSNRGet,g_sDsnrg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("fdsg", "FirmwareDownloadStatusGet", DSL_CPE_CLI_FirmwareDownloadStatusGet, g_sFdsg); + + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("t1413xtuorg", "T1413_XTUO_RevisionGet", DSL_CPE_CLI_T1413_XTUO_RevisionGet, g_sT1413XTUOrg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("t1413xturrg", "T1413_XTUR_RevisionGet", DSL_CPE_CLI_T1413_XTUR_RevisionGet, g_sT1413XTURrg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("t1413xtuovrg", "T1413_XTUO_VendorRevisionGet", DSL_CPE_CLI_T1413_XTUO_VendorRevisionGet, g_sT1413XTUOvrg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("t1413xturvrg", "T1413_XTUR_VendorRevisionGet", DSL_CPE_CLI_T1413_XTUR_VendorRevisionGet, g_sT1413XTURvrg); + + DSL_CPE_CLI_CMD_ADD_DEVICE ("pccg", "PsdCalibrationConfigGet", DSL_CPE_CLI_PSDCalibrationConfigGet, g_sPccg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("pccs", "PsdCalibrationConfigSet", DSL_CPE_CLI_PSDCalibrationConfigSet, g_sPccs); +} + +#endif /* defined(INCLUDE_DSL_CPE_CLI_SUPPORT) && !defined(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT) */ diff --git a/src/dsl_cpe_cli_access2.c b/src/dsl_cpe_cli_access2.c new file mode 100644 index 0000000..26e7baf --- /dev/null +++ b/src/dsl_cpe_cli_access2.c @@ -0,0 +1,3516 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL CLI, access function implementation +*/ + +#include "dsl_cpe_control.h" +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) && defined(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT) + +#include "dsl_cpe_cli.h" +#include "dsl_cpe_cli_console.h" +#include "dsl_cpe_debug.h" +#include "drv_dsl_cpe_api.h" +#include "drv_dsl_cpe_api_ioctl.h" + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +#include "dsl_cpe_dti.h" +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CLI + + +/* for debugging: */ +#ifdef DSL_CLI_LOCAL +#undef DSL_CLI_LOCAL +#endif +#if 1 +#define DSL_CLI_LOCAL +#else +#define DSL_CLI_LOCAL static +#endif + +DSL_void_t DSL_CPE_CLI_AutogenCommandsRegister (DSL_void_t); + +DSL_void_t DSL_CPE_CLI_DeviceCommandsRegister ( DSL_void_t ); +#ifdef INCLUDE_DSL_ADSL_MIB +DSL_void_t DSL_CPE_CLI_MibCommandsRegister ( DSL_void_t ); +#endif /* INCLUDE_DSL_ADSL_MIB*/ + +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) +const char *sFailureReturn = "nReturn=%d%s"; +#else +const char *sFailureReturn = "nReturn=%d"; +#endif + +#ifndef DSL_CPE_DEBUG_DISABLE +static const DSL_char_t g_sCcaDbgmlg[] = + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_CCA_debugModules_t nCcaDbgModule (dec)" DSL_CPE_CRLF + " DSL_CCA_DBG_APP = 1" DSL_CPE_CRLF + " DSL_CCA_DBG_OS = 2" DSL_CPE_CRLF + " DSL_CCA_DBG_CLI = 3" DSL_CPE_CRLF + " DSL_CCA_DBG_PIPE = 4" DSL_CPE_CRLF + " DSL_CCA_DBG_CONSOLE = 6" DSL_CPE_CRLF + " DSL_CCA_DBG_TDPMSG = 7" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_debugLevels_t nDbgLevel (hex)" DSL_CPE_CRLF + " DSL_CCA_DBG_NONE = 0" DSL_CPE_CRLF + " DSL_CCA_DBG_PRN = 1" DSL_CPE_CRLF + " DSL_CCA_DBG_ERR = 2" DSL_CPE_CRLF + " DSL_CCA_DBG_WRN = 40" DSL_CPE_CRLF + " DSL_CCA_DBG_MSG = 80" DSL_CPE_CRLF + " DSL_CCA_DBG_LOCAL = FF" DSL_CPE_CRLF + DSL_CPE_CRLF ""; + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_CCA_DBG_ModuleLevelGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_CCA_debugLevels_t nDbgLvl = DSL_CCA_DBG_NONE; + DSL_CCA_debugModules_t nDbgModule = DSL_CCA_DBG_NO_BLOCK; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &nDbgModule); + + if ((nDbgModule > DSL_CCA_DBG_NO_BLOCK) && (nDbgModule < DSL_CCA_DBG_LAST_BLOCK)) + { + nDbgLvl = DSL_CCA_g_dbgLvl[nDbgModule].nDbgLvl; + } + else + { + ret = -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDbgLevel=%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), nDbgLvl); + + return 0; +} +#endif + +#ifndef DSL_CPE_DEBUG_DISABLE +static const DSL_char_t g_sCcaDbgmls[] = + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_CCA_debugModules_t nCcaDbgModule (dec)" DSL_CPE_CRLF + " DSL_CCA_DBG_APP = 1" DSL_CPE_CRLF + " DSL_CCA_DBG_OS = 2" DSL_CPE_CRLF + " DSL_CCA_DBG_CLI = 3" DSL_CPE_CRLF + " DSL_CCA_DBG_PIPE = 4" DSL_CPE_CRLF + " DSL_CCA_DBG_CONSOLE = 6" DSL_CPE_CRLF + " DSL_CCA_DBG_TCPMSG = 7" DSL_CPE_CRLF + "- DSL_CCA_debugLevels_t nDbgLevel (hex)" DSL_CPE_CRLF + " DSL_CCA_DBG_NONE = 0" DSL_CPE_CRLF + " DSL_CCA_DBG_PRN = 1" DSL_CPE_CRLF + " DSL_CCA_DBG_ERR = 2" DSL_CPE_CRLF + " DSL_CCA_DBG_WRN = 40" DSL_CPE_CRLF + " DSL_CCA_DBG_MSG = 80" DSL_CPE_CRLF + " DSL_CCA_DBG_LOCAL = FF" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_CCA_DBG_ModuleLevelSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_CCA_debugLevels_t nDbgLvl = DSL_CCA_DBG_NONE; + DSL_CCA_debugModules_t nDbgModule = DSL_CCA_DBG_NO_BLOCK; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %x", &nDbgModule, &nDbgLvl); + + if ((nDbgModule > DSL_CCA_DBG_NO_BLOCK) && (nDbgModule < DSL_CCA_DBG_LAST_BLOCK)) + { + if ((nDbgLvl == DSL_CCA_DBG_PRN) || (nDbgLvl == DSL_CCA_DBG_ERR) || + (nDbgLvl == DSL_CCA_DBG_WRN) || (nDbgLvl == DSL_CCA_DBG_MSG) || + (nDbgLvl == DSL_CCA_DBG_LOCAL)) + { + DSL_CCA_g_dbgLvl[nDbgModule].nDbgLvl = nDbgLvl; + } + else + { + ret = -1; + } + } + else + { + ret = -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDbgLevel=%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), nDbgLvl); + + return 0; +} +#endif + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +static const DSL_char_t g_sNsecs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_char_t notify_script[1-256] (Attention: Use absolute firmware path only!)" + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_NotificationScriptExecuteConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sNotifyScript[256] = { 0 }; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%s", &sNotifyScript); + + /* Get ADSL script file */ + if ( strlen(sNotifyScript) > 0 ) + { + if (DSL_CPE_IsFileExists(sNotifyScript)) + { + if (g_sRcScript) + { + DSL_CPE_Free(g_sRcScript); + g_sRcScript = DSL_NULL; + } + + g_sRcScript = DSL_CPE_Malloc (strlen (sNotifyScript) + 1); + + if (g_sRcScript) + { + cpe_control_strncpy_s(g_sRcScript, strlen (sNotifyScript) + 1, sNotifyScript, strlen (sNotifyScript)); + } + } + else + { + ret = -1; + } + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + if (ret < 0) + { + DSL_CPE_FPrintf(out, " (Have you used absolute script path?)" DSL_CPE_CRLF); + } + + return 0; +} +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +static const DSL_char_t g_sNsecg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_char_t notify_script[256]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_NotificationScriptExecuteConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + + if(g_sRcScript != DSL_NULL) + { + DSL_CPE_FPrintf (out, " notify_script=%s", g_sRcScript); + } + else + { + DSL_CPE_FPrintf (out, " notify_script=n/a"); + } + + DSL_CPE_FPrintf (out, DSL_CPE_CRLF); + + return 0; +} +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAsecg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_char_t adsl_script[256]" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_char_t vdsl_script[256]" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootScriptExecuteConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + + if(g_sAdslScript != DSL_NULL) + { + DSL_CPE_FPrintf (out, " adsl_script=%s", g_sAdslScript); + } + else + { + DSL_CPE_FPrintf (out, " adsl_script=n/a"); + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if(g_sVdslScript != DSL_NULL) + { + DSL_CPE_FPrintf (out, " vdsl_script=%s", g_sVdslScript); + } + else + { + DSL_CPE_FPrintf (out, " vdsl_script=n/a"); + } +#endif + + DSL_CPE_FPrintf (out, DSL_CPE_CRLF); + + return 0; +} +#endif +#endif + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAsecs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_char_t adsl_script[1-256]" +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 0) + " (let empty to clear currently set value," + " adsl_script must include the full path to the script)" DSL_CPE_CRLF +#else + " (enter '.' to let adsl script unchanged)" DSL_CPE_CRLF + "- DSL_char_t vdsl_script[1-256]" + " (enter '.' to let vdsl script unchanged, or let empty to clear currently set value," + " let both parameters empty to clear currently set values" + " vdsl_script must include the full path to the script)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootScriptExecuteConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sAdslScript[256] = { 0 }; +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_char_t sVdslScript[256] = { 0 }; +#endif + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_MAX) == DSL_FALSE) +#else + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MAX) == DSL_FALSE) +#endif + { + return -1; + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + sscanf (pCommands, "%s %s", &sAdslScript, &sVdslScript); +#else + sscanf (pCommands, "%s", &sAdslScript); +#endif + + /* Get ADSL script file */ + if ( strlen(sAdslScript) > 0 ) + { + if ( strcmp(sAdslScript, ".") != 0 ) + { + if (DSL_CPE_IsFileExists(sAdslScript)) + { + if (g_sAdslScript) + { + DSL_CPE_Free(g_sAdslScript); + g_sAdslScript = DSL_NULL; + } + g_sAdslScript = DSL_CPE_Malloc (strlen (sAdslScript) + 1); + if (g_sAdslScript) + { + cpe_control_strncpy_s(g_sAdslScript, strlen (sAdslScript) + 1, sAdslScript, strlen (sAdslScript)); + } + } + else + { + ret = -1; + } + } + } + else + { + DSL_CPE_Free(g_sAdslScript); + g_sAdslScript = DSL_NULL; + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + /* Get VDSL script file */ + if (strlen(sVdslScript) > 0) + { + if ( strcmp(sVdslScript, ".") != 0 ) + { + if (DSL_CPE_IsFileExists(sVdslScript)) + { + if (g_sVdslScript) + { + DSL_CPE_Free(g_sVdslScript); + g_sVdslScript = DSL_NULL; + } + g_sVdslScript = DSL_CPE_Malloc (strlen (sVdslScript) + 1); + if (g_sVdslScript) + { + cpe_control_strncpy_s(g_sVdslScript, strlen (sVdslScript) + 1, sVdslScript, strlen (sVdslScript)); + } + } + else + { + ret = -1; + } + } + } + else + { + DSL_CPE_Free(g_sVdslScript); + g_sVdslScript = DSL_NULL; + } +#endif + + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + if (ret < 0) + { + DSL_CPE_FPrintf(out, " (Have you used absolute script path?)" DSL_CPE_CRLF); + } + + return 0; +} +#endif +#endif + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAcfgs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bWaitBeforeConfigWrite" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeLinkActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeRestart" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeConfigWrite (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeLinkActivation (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeRestart (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootConfigOptionSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_boolean_t bAdsl = DSL_FALSE, bVdsl = DSL_FALSE; + DSL_boolean_t bAutoContinueWaitBeforeLinkActivation = DSL_TRUE, + bAutoContinueWaitBeforeConfigWrite = DSL_TRUE, + bAutoContinueWaitBeforeRestart = DSL_TRUE, + bWaitBeforeLinkActivation = DSL_FALSE, + bWaitBeforeConfigWrite = DSL_FALSE, bWaitBeforeRestart = DSL_FALSE; + DSL_AutobootConfig_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + DSL_uint32_t nDevice = 0; + DSL_int_t nDeviceNum = -1; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 6, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u %u %u %u %u %u", + &bWaitBeforeConfigWrite, &bWaitBeforeLinkActivation, &bWaitBeforeRestart, + &bAutoContinueWaitBeforeConfigWrite, &bAutoContinueWaitBeforeLinkActivation, + &bAutoContinueWaitBeforeRestart); + + if ((g_sAdslScript != DSL_NULL) && (strlen(g_sAdslScript) > 0)) + { + bAdsl = DSL_TRUE; + } + + if ((g_sVdslScript != DSL_NULL) && (strlen(g_sVdslScript) > 0)) + { + bVdsl = DSL_TRUE; + } + + if ( (bAdsl == DSL_TRUE) || (bVdsl == DSL_TRUE) ) + { + if (!bWaitBeforeLinkActivation && !bWaitBeforeConfigWrite && !bWaitBeforeRestart) + { + DSL_CPE_FPrintf (out, "Warning: bWaitBeforeConfigWrite, bWaitBeforeLinkActivation and " + "bWaitBeforeRestart were set to false " + "but an autostart script was selected (autostart script " + "handling only works when one these settings is set to true)" DSL_CPE_CRLF); + DSL_CPE_FPrintf (out, "Set bWaitBeforeConfigWrite = DSL_TRUE, " + "bWaitBeforeLinkActivation = DSL_TRUE, bWaitBeforeRestart = DSL_TRUE!" DSL_CPE_CRLF); + bWaitBeforeConfigWrite = DSL_TRUE; + bWaitBeforeLinkActivation = DSL_TRUE; + bWaitBeforeRestart = DSL_TRUE; + } + } + + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if (pCtx->bBackwardCompMode) + { + nDeviceNum = pCtx->nDevNum; + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + if(pCtx->fd[nDevice] == fd) + { + nDeviceNum = nDevice; + break; + } + } + } + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + if (nDeviceNum == -1) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + g_bWaitBeforeConfigWrite[nDeviceNum] = bWaitBeforeConfigWrite; + g_bWaitBeforeLinkActivation[nDeviceNum] = bWaitBeforeLinkActivation; + g_bWaitBeforeRestart[nDeviceNum] = bWaitBeforeRestart; + + g_bAutoContinueWaitBeforeConfigWrite[nDeviceNum] = bAutoContinueWaitBeforeConfigWrite; + g_bAutoContinueWaitBeforeLinkActivation[nDeviceNum] = bAutoContinueWaitBeforeLinkActivation; + g_bAutoContinueWaitBeforeRestart[nDeviceNum] = bAutoContinueWaitBeforeRestart; + + pData.data.nStateMachineOptions.bWaitBeforeConfigWrite = + bWaitBeforeConfigWrite; + + pData.data.nStateMachineOptions.bWaitBeforeLinkActivation = + bWaitBeforeLinkActivation; + + pData.data.nStateMachineOptions.bWaitBeforeRestart = + bWaitBeforeRestart; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + return 0; +} +#endif + +#ifdef INCLUDE_DSL_CONFIG_GET +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sAcfgg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bWaitBeforeConfigWrite" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeLinkActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bWaitBeforeRestart" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeConfigWrite (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeLinkActivation (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_boolean_t bAutoContinueWaitBeforeRestart (dsl_cpe_control)" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootConfigOptionGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_AutobootConfig_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + DSL_uint32_t nDevice = 0; + DSL_int_t nDeviceNum = -1; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if (pCtx->bBackwardCompMode) + { + nDeviceNum = pCtx->nDevNum; + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + if(pCtx->fd[nDevice] == fd) + { + nDeviceNum = nDevice; + break; + } + } + } + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + if (nDeviceNum == -1) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + + g_bWaitBeforeConfigWrite[nDeviceNum] = + pData.data.nStateMachineOptions.bWaitBeforeConfigWrite; + g_bWaitBeforeLinkActivation[nDeviceNum] = + pData.data.nStateMachineOptions.bWaitBeforeLinkActivation; + g_bWaitBeforeRestart[nDeviceNum] = + pData.data.nStateMachineOptions.bWaitBeforeRestart; + + DSL_CPE_FPrintf (out, DSL_CPE_RET"bWaitBeforeConfigWrite=%d " + "bWaitBeforeLinkActivation=%d bWaitBeforeRestart=%d bAutoContinueWaitBeforeConfigWrite=%d " + "bAutoContinueWaitBeforeLinkActivation=%d bAutoContinueWaitBeforeRestart=%d" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), g_bWaitBeforeConfigWrite[nDeviceNum], + g_bWaitBeforeLinkActivation[nDeviceNum], g_bWaitBeforeRestart[nDeviceNum], + g_bAutoContinueWaitBeforeConfigWrite[nDeviceNum], g_bAutoContinueWaitBeforeLinkActivation[nDeviceNum], + g_bAutoContinueWaitBeforeRestart[nDeviceNum]); + } + + return 0; +} +#endif +#endif + +static const DSL_char_t g_sAlf[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif +#if defined(INCLUDE_DSL_CPE_API_DANUBE) + "- DSL_char_t adsl_firmware[1-256] (Attention: Use absolute firmware path only," +#else + "- DSL_char_t firmware1[1-256] (Attention: Use absolute firmware path only," +#endif +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + " enter '.' to let empty, to specify adsl_firmware only)" DSL_CPE_CRLF + "- DSL_char_t adsl_firmware[1-256] (Attention: Use absolute firmware path only!)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootLoadFirmware( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sFirmwareName1[256] = { 0 }; + DSL_char_t *pcFw = DSL_NULL; +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_char_t *pcFw2 = DSL_NULL; +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) || !defined(INCLUDE_FW_REQUEST_SUPPORT)*/ +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + DSL_char_t sFirmwareName2[256] = { 0 }; +#endif +#ifdef INCLUDE_FW_REQUEST_SUPPORT +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } +#else + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } +#endif + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + sscanf (pCommands, "%s %s", sFirmwareName1, sFirmwareName2); +#else + sscanf (pCommands, "%s", sFirmwareName1); +#endif + + /* Get Firmware binary 1 */ + if ((strlen(sFirmwareName1) > 0) && (strcmp(sFirmwareName1, ".") != 0)) + { + pcFw = &sFirmwareName1[0]; + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + /* Get Firmware binary 2 */ + if (strlen(sFirmwareName2) > 0) + { + pcFw2 = &sFirmwareName2[0]; + } +#endif + + /* Update links to the FW binaries */ + if (pcFw) + { + if (g_sFirmwareName1 != DSL_NULL) + { + DSL_CPE_Free(g_sFirmwareName1); + } + + g_sFirmwareName1 = DSL_CPE_Malloc (strlen (pcFw) + 1); + if (g_sFirmwareName1) + { + cpe_control_strncpy_s(g_sFirmwareName1, strlen (pcFw) + 1, pcFw, strlen (pcFw)); + } + DSL_CPE_FwFeaturesGet(g_sFirmwareName1, &g_nFwFeatures1); + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (pcFw2) + { + if (g_sFirmwareName2 != DSL_NULL) + { + DSL_CPE_Free(g_sFirmwareName2); + } + + g_sFirmwareName2 = DSL_CPE_Malloc (strlen (pcFw2) + 1); + if (g_sFirmwareName2) + { + cpe_control_strncpy_s(g_sFirmwareName2, strlen (pcFw2) + 1, pcFw2, strlen (pcFw2)); + } + DSL_CPE_FwFeaturesGet(g_sFirmwareName2, &g_nFwFeatures2); + } +#endif /* (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1)*/ + +#ifdef INCLUDE_FW_REQUEST_SUPPORT + +#if defined(INCLUDE_DSL_CPE_API_DANUBE) + ret = DSL_CPE_DownloadFirmware(fd, DSL_FW_REQUEST_NA, pcFw, DSL_NULL); + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + if (ret < DSL_SUCCESS) + { + DSL_CPE_FPrintf(out, " (Have you used absolute firmware path?)" DSL_CPE_CRLF); + } +#else + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_STATUS_GET, (int) &AutobootStatus); + + if ((ret < 0) && (AutobootStatus.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(autobootCtrl.accessCtl.nReturn)); + return 0; + } + + if (AutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_FW_WAIT) + { + ret = DSL_CPE_DownloadFirmware(fd, AutobootStatus.data.nFirmwareRequestType, pcFw, pcFw2); + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + if (ret < DSL_SUCCESS) + { + DSL_CPE_FPrintf(out, " (Have you used absolute firmware path?)" DSL_CPE_CRLF); + } + } + else + { + /* Trigger Autoboot restart sequence. FW binary will be requested + from the DSL CPE API driver later*/ + autobootCtrl.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONTROL_SET, (int) &autobootCtrl); + + if ((ret < 0) && (autobootCtrl.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, autobootCtrl.accessCtl.nReturn); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + } +#endif /* defined(INCLUDE_DSL_CPE_API_DANUBE) && !defined(DSL_FIRMWARE_MEMORY_FREE_ENABLED)*/ + +#else + ret = DSL_CPE_DownloadFirmware(fd, DSL_FW_REQUEST_NA, pcFw, pcFw2); + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + if (ret < DSL_SUCCESS) + { + DSL_CPE_FPrintf(out, " (Have you used absolute firmware path?)" DSL_CPE_CRLF); + } +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + + return 0; +} + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +static const DSL_char_t g_sRusg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t drvStaticMemUsage" DSL_CPE_CRLF + "- DSL_uint32_t drvDynamicMemUsage" DSL_CPE_CRLF + "- DSL_uint32_t appStaticMemUsage" DSL_CPE_CRLF + "- DSL_uint32_t appDynamicMemUsage" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_ResourceUsageStatisticsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_ResourceUsageStatistics_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + DSL_CPE_ResourceUsageStatisticsData_t resourceUsageStatisticsData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_RESOURCE_USAGE_STATISTICS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + ret = DSL_CPE_ResourceUsageStatisticsGet( + pCtx, &resourceUsageStatisticsData); + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, ret); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"drvStaticMemUsage=%d drvDynamicMemUsage=%d " + "appStaticMemUsage=%d appDynamicMemUsage=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.staticMemUsage, pData.data.dynamicMemUsage, + resourceUsageStatisticsData.staticMemUsage, + resourceUsageStatisticsData.dynamicMemUsage); + } + } + else + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + } + } + + return 0; +} +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +static const DSL_char_t g_sIcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bEventActivation" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- DSL_BF_ResourceActivationType_t nResourceActivationMask (hex)" DSL_CPE_CRLF + " cleaned = 0x00000000" DSL_CPE_CRLF + " snmp = 0x00000001" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_InstanceControlSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_InstanceControl_t pData; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u %x", &(pData.data.bEventActivation), + &(pData.data.nResourceActivationMask)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_INSTANCE_CONTROL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if (pData.data.bEventActivation) + { + if (!pCtx->bEvtRun) + { + /* Start event thread*/ + DSL_CPE_EventHandlerStart(pCtx); + } + } + else + { + if (pCtx->bEvtRun) + { + pCtx->bEvtRun = DSL_FALSE; + /* wait while CPE Event handler thread ends */ + DSL_CPE_ThreadShutdown (&pCtx->EventControl, 1000); + } + } + } + else + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + } + } + + return 0; +} + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +static const DSL_char_t g_sSe[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_char_t sFileName[1-" _MKSTR(DSL_MAX_COMMAND_LINE_LENGTH) "] (full path to the script)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_ScriptExecute( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sFileName[DSL_MAX_COMMAND_LINE_LENGTH] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%s", sFileName); + + if ((ret = DSL_CPE_ScriptFileParse(DSL_CPE_GetGlobalContext(), -1, sFileName, + DSL_SCRIPT_SECTION_COMMON)) < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT */ +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_MISC_LINE_STATUS +static const DSL_char_t g_sBbsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint16_t nBandIndex" DSL_CPE_CRLF + "- DSL_uint16_t nLimit_firstToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nLimit_lastToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nBorder_firstToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nBorder_lastToneIndex" DSL_CPE_CRLF + "- ... nParamNr[5] nCount[" _MKSTR(DSL_G997_MAX_NUMBER_OF_BANDS) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BandBorderStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t nBand = 0; + DSL_BandBorderStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BandBorderStatus_t)); + + sscanf (pCommands, "%u", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BAND_BORDER_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%d nNumData=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.nNumData); + DSL_CPE_FPrintf (out, + "nFormat=(nBandIndex, (nLimit_firstToneIndex, nLimit_lastToneIndex), " + "(nBorder_firstToneIndex, nBorder_lastToneIndex)) nData=\"" DSL_CPE_CRLF); + + for (nBand = 0; nBand < pData.data.nNumData; nBand++) + { + DSL_CPE_FPrintf (out, "(%02d,(%04d,%04d),(%04d,%04d))"DSL_CPE_CRLF, nBand, + pData.data.nBandLimits[nBand].nFirstToneIndex, pData.data.nBandLimits[nBand].nLastToneIndex, + pData.data.nBandBorder[nBand].nFirstToneIndex, pData.data.nBandBorder[nBand].nLastToneIndex); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + + } + + return 0; +} +#endif /* INCLUDE_DSL_CPE_MISC_LINE_STATUS*/ + +#ifdef INCLUDE_DSL_G997_PER_TONE +static const DSL_char_t g_sG997bang[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint8_t nBit (hex)"DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_BitAllocationNscGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0, nSkipped = 0; + DSL_uint16_t nUsedNumData = 0; + unsigned char *pResult, *pParse, Num; + DSL_G997_BitAllocationNsc_t *pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_BitAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, "nReturn=%d" DSL_CPE_CRLF, DSL_ERR_MEMORY); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_BitAllocationNsc_t)); + + sscanf (pCommands, "%u", &pData->nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_BIT_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + /* Get the number of actually used tones*/ + for (i = 0; i < pData->data.bitAllocationNsc.nNumData; i++) + { + if (pData->data.bitAllocationNsc.nNSCData[i]) + { + nUsedNumData++; + } + } + + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + nUsedNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nBit(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.bitAllocationNsc.nNumData)*10 + + (pData->data.bitAllocationNsc.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.bitAllocationNsc.nNumData; i++) + { + /* skip the printout when 0 */ + if (pData->data.bitAllocationNsc.nNSCData[i] == 0) + { + /* do a separator only when starting to skip */ + if (!nSkipped) + { + nSkipped = 1; + *pParse++ = '\r'; + *pParse++ = '\n'; + } + continue; + } + + nSkipped = 0; + + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\r'; + *pParse++ = '\n'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.bitAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.bitAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF, pResult ); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997bansg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint8_t nBit (hex)"DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_BitAllocationNscShortGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, i = 0; + DSL_G997_BitAllocationNsc_t *pData; + unsigned char *pResult, *pParse, Num; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_BitAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF , DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_BitAllocationNsc_t)); + + sscanf (pCommands, "%u", &pData->nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_BIT_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, pData->accessCtl.nReturn); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->data.bitAllocationNsc.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=nBit(hex) nData=\"" DSL_CPE_CRLF); + + /* use own encoding for performance reasons */ + pResult = malloc((pData->data.bitAllocationNsc.nNumData)*3+10); + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.bitAllocationNsc.nNumData; i++) + { + Num = ((pData->data.bitAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.bitAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF,pResult ); + free(pResult); + } + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_G997_PER_TONE*/ + +#ifdef INCLUDE_DSL_G997_PER_TONE +static const DSL_char_t g_sG997gang[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nGain (hex, linear, represented as multiple of 1/512: 20*log[gain/512])"DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_GainAllocationNscGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0, nSkipped = 0, nUsedNumData=0; + DSL_G997_GainAllocationNsc_t *pData; + unsigned char *pResult, *pParse, Num; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_GainAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_GainAllocationNsc_t)); + + sscanf (pCommands, "%u", &pData->nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_GAIN_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + /* Get the number of actually used tones*/ + for (i = 0; i < pData->data.gainAllocationNsc.nNumData; i++) + { + if (pData->data.gainAllocationNsc.nNSCData[i]) + { + nUsedNumData++; + } + } + + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn),pData->nDirection, + nUsedNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nGain(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.gainAllocationNsc.nNumData)*12 + + (pData->data.gainAllocationNsc.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.gainAllocationNsc.nNumData; i++) + { + /* skip the printout when 0 */ + if (pData->data.gainAllocationNsc.nNSCData[i] == 0) + { + /* do a separator only when starting to skip */ + if (!nSkipped) + { + nSkipped = 1; + *pParse++ = '\r'; + *pParse++ = '\n'; + } + continue; + } + + nSkipped = 0; + + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\r'; + *pParse++ = '\n'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.gainAllocationNsc.nNSCData[i] & 0xf000)>>12); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.gainAllocationNsc.nNSCData[i] & 0x0f00)>>8); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.gainAllocationNsc.nNSCData[i] & 0x00f0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.gainAllocationNsc.nNSCData[i] & 0x000f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF, pResult); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997gansg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint16_t nGain (hex, linear, represented as multiple of 1/512: 20*log[gain/512])"DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_GainAllocationNscShortGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_GainAllocationNsc_t *pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_GainAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_GainAllocationNsc_t)); + + sscanf (pCommands, "%u", &pData->nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_GAIN_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->data.gainAllocationNsc.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=nGain(hex) nData=\"" DSL_CPE_CRLF); + + for (i = 0; i < pData->data.gainAllocationNsc.nNumData; i++) + { + DSL_CPE_FPrintf(out, "%04X ", (DSL_int_t)pData->data.gainAllocationNsc.nNSCData[i]); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_G997_PER_TONE*/ + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY +static const DSL_char_t g_sG997lig[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_uint8_t G994VendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_uint8_t SystemVendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_uint8_t VersionNumber[" _MKSTR(DSL_G997_LI_MAXLEN_VERSION) "]" DSL_CPE_CRLF + "- DSL_uint8_t SerialNumber[" _MKSTR(DSL_G997_LI_MAXLEN_SERIAL) "]" DSL_CPE_CRLF + "- DSL_uint32_t SelfTestResult" DSL_CPE_CRLF + "- DSL_uint8_t XTSECapabilities[" _MKSTR(DSL_G997_NUM_XTSE_OCTETS) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineInventoryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInventory_t pData; + DSL_char_t buf[256]; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + sscanf (pCommands, "%u", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INVENTORY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u ", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + + DSL_CPE_ArraySPrintF(buf, pData.data.G994VendorID, + sizeof(pData.data.G994VendorID), sizeof(pData.data.G994VendorID[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "G994VendorID=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.data.SystemVendorID, + sizeof(pData.data.SystemVendorID), sizeof(pData.data.SystemVendorID[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "SystemVendorID=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.data.VersionNumber, + sizeof(pData.data.VersionNumber), sizeof(pData.data.VersionNumber[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "VersionNumber=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.data.SerialNumber, + sizeof(pData.data.SerialNumber), sizeof(pData.data.SerialNumber[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "SerialNumber=%s ", buf); + + DSL_CPE_FPrintf(out, "SelfTestResult=%u ", (DSL_uint32_t)pData.data.SelfTestResult); + + DSL_CPE_ArraySPrintF(buf, pData.data.XTSECapabilities, + sizeof(pData.data.XTSECapabilities), sizeof(pData.data.XTSECapabilities[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "XTSECapabilities=%s" DSL_CPE_CRLF, buf); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY +static const DSL_char_t g_sG997listrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + "- DSL_char_t G994VendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_char_t SystemVendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_char_t VersionNumber[" _MKSTR(DSL_G997_LI_MAXLEN_VERSION) "]" DSL_CPE_CRLF + "- DSL_char_t SerialNumber[" _MKSTR(DSL_G997_LI_MAXLEN_SERIAL) "]" DSL_CPE_CRLF + "- DSL_uint32_t SelfTestResult" DSL_CPE_CRLF + "- DSL_char_t XTSECapabilities[" _MKSTR(DSL_G997_NUM_XTSE_OCTETS) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineInventoryStringGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInventory_t pData; + DSL_char_t buf[256]; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + sscanf (pCommands, "%u", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INVENTORY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u ", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + + DSL_CPE_ArraySPrintF(buf, pData.data.G994VendorID, + sizeof(pData.data.G994VendorID), sizeof(pData.data.G994VendorID[0]), + DSL_ARRAY_FORMAT_STRING); + DSL_CPE_FPrintf(out, "G994VendorID=%s ", buf); + buf[0] = '\0'; + + DSL_CPE_ArraySPrintF(buf, pData.data.SystemVendorID, + sizeof(pData.data.SystemVendorID), sizeof(pData.data.SystemVendorID[0]), + DSL_ARRAY_FORMAT_STRING); + DSL_CPE_FPrintf(out, "SystemVendorID=%s ", buf); + buf[0] = '\0'; + + DSL_CPE_ArraySPrintF(buf, pData.data.VersionNumber, + sizeof(pData.data.VersionNumber), sizeof(pData.data.VersionNumber[0]), + DSL_ARRAY_FORMAT_STRING); + DSL_CPE_FPrintf(out, "VersionNumber=%s ", buf); + buf[0] = '\0'; + + DSL_CPE_ArraySPrintF(buf, pData.data.SerialNumber, + sizeof(pData.data.SerialNumber), sizeof(pData.data.SerialNumber[0]), + DSL_ARRAY_FORMAT_STRING); + DSL_CPE_FPrintf(out, "SerialNumber=%s ", buf); + buf[0] = '\0'; + + DSL_CPE_FPrintf(out, "SelfTestResult=%u ", (DSL_uint32_t)pData.data.SelfTestResult); + + DSL_CPE_ArraySPrintF(buf, pData.data.XTSECapabilities, + sizeof(pData.data.XTSECapabilities), sizeof(pData.data.XTSECapabilities[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf(out, "XTSECapabilities=%s" DSL_CPE_CRLF, buf); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + #define DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS 4 +#else + #define DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS 3 +#endif + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY +static const DSL_char_t g_sG997lis[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t SystemVendorID[" _MKSTR(DSL_G997_LI_MAXLEN_VENDOR_ID) "]" DSL_CPE_CRLF + "- DSL_uint8_t VersionNumber[" _MKSTR(DSL_G997_LI_MAXLEN_VERSION) "]" DSL_CPE_CRLF + "- DSL_uint8_t SerialNumber[" _MKSTR(DSL_G997_LI_MAXLEN_SERIAL) "]" DSL_CPE_CRLF +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + "- DSL_uint8_t Auxiliary[0-" _MKSTR(DSL_G993_LI_MAXLEN_AUX) "]" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineInventorySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInventoryNe_t pData; + DSL_char_t string[256] = { 0 }; + DSL_char_t seps[] = " "; + DSL_char_t *token; + DSL_uint16_t i = 0, nIdx = 0; + DSL_int_t nParams = 0; + DSL_int_t nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS] = { 0 }; + + for (i = 0; i < DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS; i++) + { + switch (i) + { + case 0: + nParamList[i] = DSL_G997_LI_MAXLEN_VENDOR_ID; + break; + case 1: + nParamList[i] = nParamList[i - 1] + DSL_G997_LI_MAXLEN_VERSION; + break; + case 2: + nParamList[i] = nParamList[i - 1] + DSL_G997_LI_MAXLEN_SERIAL; + break; +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + case 3: + nParamList[i] = nParamList[i - 1] + DSL_G993_LI_MAXLEN_AUX; + break; +#endif + default: + DSL_CPE_FPrintf(out, "nReturn=-1 (interanl error)" DSL_CPE_CRLF); + return 0; + } + } + + nParams = nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS - 1]; + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + if (DSL_CPE_CLI_CheckParamNumber( + pCommands, + nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS - 2], DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + if (DSL_CPE_CLI_CheckParamNumber(pCommands, nParams, DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } +#else + if (DSL_CPE_CLI_CheckParamNumber(pCommands, nParams, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } +#endif + + memset (&pData, 0, sizeof(DSL_G997_LineInventoryNe_t)); + + cpe_control_strncpy_s(string, sizeof(string)-1, pCommands, strlen(pCommands)); + string[sizeof(string)-1]=0; + + /* Get first token */ + token = strtok (string, seps); + if (token != DSL_NULL) + { + for (i = 0; i < nParams; i++) + { + if (i < nParamList[0]) + { + nIdx = i; + sscanf (token, "%bx", (unsigned char *)&(pData.data.SystemVendorID[nIdx])); + } + else if (i < nParamList[1]) + { + nIdx = (DSL_uint16_t)(i - nParamList[0]); + sscanf (token, "%bx", (unsigned char *)&(pData.data.VersionNumber[nIdx])); + } + else if (i < nParamList[2]) + { + nIdx = (DSL_uint16_t)(i - nParamList[1]); + sscanf (token, "%bx", (unsigned char *)&(pData.data.SerialNumber[nIdx])); + } +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + else if (i < nParamList[3]) + { + nIdx = (DSL_uint16_t)(i - nParamList[2]); + sscanf (token, "%bx", (unsigned char *)&(pData.data.Auxiliary.pData[nIdx])); + } +#endif + else + { + DSL_CPE_FPrintf(out, "nReturn=-1 (interanl error)" DSL_CPE_CRLF); + return 0; + } + + /* Get next token */ + token = strtok(DSL_NULL, seps); + + /* Exit scanning if no further information is included */ + if (token == DSL_NULL) + { + break; + } + } + } + +#if (INCLUDE_DSL_CPE_API_VDSL_SUPPORT == 1) + pData.data.Auxiliary.nLength = + (DSL_uint32_t)(i + 1 - nParamList[DSL_CPE_MAX_NE_INVENTORY_PARAM_LISTS - 2]); +#endif + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INVENTORY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +#ifdef INCLUDE_DSL_CEOC +static const DSL_char_t g_sG997sms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nMessageData[1-" _MKSTR(DSL_G997_SNMP_MESSAGE_LENGTH) "]" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnmpMessageSend( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint32_t nVal = 0; + DSL_int_t i = 0; + DSL_char_t *pChar = DSL_NULL, *pTmp = DSL_NULL; + DSL_G997_Snmp_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, DSL_G997_SNMP_MESSAGE_LENGTH, + DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0, sizeof(DSL_G997_Snmp_t)); + + pTmp = pCommands; + pChar = pCommands; + + for (i = 0; i < DSL_G997_SNMP_MESSAGE_LENGTH; i++) + { + if ( pChar == DSL_NULL ) + { + /* no more entries, leave the loop */ + break; + } + + ret = sscanf(pChar, "%x", &nVal); + + if ( ret != 1 ) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "invalid SNMP data!" DSL_CPE_CRLF); + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERROR)); + return 0; + } + + pData.data.nMessageData[i] = (DSL_uint8_t)nVal; + + ret = DSL_CPE_MoveCharPtr(pTmp, 1, " ", &pChar); + if ( (pTmp == pChar) || (ret != DSL_SUCCESS) ) + { + i++; + break; + } + else + { + pTmp = pChar; + } + } + + /* Set current length of SNMP message */ + pData.data.nMessageLength = (DSL_uint16_t)i; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNMP_MESSAGE_SEND, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CEOC */ + +#ifdef INCLUDE_DSL_CEOC +static const DSL_char_t g_sG997smr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint16_t nMessageLength" DSL_CPE_CRLF + "- DSL_uint8_t nMessageData[" _MKSTR(DSL_G997_SNMP_MESSAGE_LENGTH) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnmpMessageReceive( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_Snmp_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0, sizeof(DSL_G997_Snmp_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNMP_MESSAGE_RECEIVE, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nMessageLength=%hu nData(hex)=\"" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nMessageLength); + + /* Print only the number of values that are returned */ + for (i = 0; i < pData.data.nMessageLength; i++) + { + DSL_CPE_FPrintf(out, "0x%02X ", (DSL_int_t)(pData.data.nMessageData[i])); + } + + DSL_CPE_FPrintf (out, "\"" DSL_CPE_CRLF); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CEOC */ + +#ifdef INCLUDE_DSL_G997_PER_TONE +static const DSL_char_t g_sG997sang[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint8_t nSnr ( represented as -32 + SNR(nToneIndex)/2, nSnr(nToneIndex)=255 indicates that " + "no measurement could be done for the subcarrier)" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnrAllocationNscGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0, nSkipped = 0, nUsedNumData = 0; + unsigned char *pResult, *pParse, Num; + DSL_G997_SnrAllocationNsc_t *pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_SnrAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_SnrAllocationNsc_t)); + + + sscanf (pCommands, "%u", &pData->nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNR_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + /* Get the number of actually used tones*/ + for (i = 0; i < pData->data.snrAllocationNsc.nNumData; i++) + { + if (pData->data.snrAllocationNsc.nNSCData[i] != 0xFF) + { + nUsedNumData++; + } + } + + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + nUsedNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nSnr(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.snrAllocationNsc.nNumData)*10 + + (pData->data.snrAllocationNsc.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.snrAllocationNsc.nNumData; i++) + { + /* skip the printout when 0xff */ + if (pData->data.snrAllocationNsc.nNSCData[i] == 0xFF) + { + /* do a separator only when starting to skip */ + if (!nSkipped) + { + nSkipped = 1; + *pParse++ = '\r'; + *pParse++ = '\n'; + } + continue; + } + + nSkipped = 0; + + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\n'; + *pParse++ = '\r'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.snrAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.snrAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF,pResult ); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997sansg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint8_t nSnr (hex, represented as -32 + SNR(nToneIndex)/2, nSnr(nToneIndex)=255 indicates that " + "no measurement could be done for the subcarrier)" DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_SnrAllocationNscShortGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + unsigned char *pResult, *pParse, Num; + DSL_G997_SnrAllocationNsc_t *pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_SnrAllocationNsc_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_SnrAllocationNsc_t)); + + + sscanf (pCommands, "%u", &pData->nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_SNR_ALLOCATION_NSC_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nNumData=%hu ", + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->data.snrAllocationNsc.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=nSnr(hex) nData=\"" DSL_CPE_CRLF); + + /* use own encoding for performance reasons */ + pResult = malloc(pData->data.snrAllocationNsc.nNumData*3+10); + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.snrAllocationNsc.nNumData; i++) + { + Num = ((pData->data.snrAllocationNsc.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.snrAllocationNsc.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s" DSL_CPE_CRLF, pResult); + free(pResult); + } + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_G997_PER_TONE*/ + +#ifdef INCLUDE_DSL_DELT +static const DSL_char_t g_sG997dhling[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nHlin_real (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nHlin_imag (hex)" DSL_CPE_CRLF + "- ... nParamNr[3] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltHLINGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_DeltHlin_t *pData; + unsigned char *pResult, *pParse, Num; + + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltHlin_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltHlin_t)); + + sscanf (pCommands, "%u %u", &pData->nDirection, &pData->nDeltDataType); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_HLIN_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u" + " nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, + pData->nDeltDataType, pData->data.nMeasurementTime, + pData->data.nGroupSize, pData->data.deltHlin.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nHlin_real(hex),nHlin_imag(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.deltHlin.nNumData)*24 + + (pData->data.deltHlin.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.deltHlin.nNumData; i++) + { + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\r'; + *pParse++ = '\n'; + } + *pParse++ = '('; + *pParse++ = (unsigned char)('0' + i/1000); + *pParse++ = (unsigned char)('0' + (i%1000)/100); + *pParse++ = (unsigned char)('0' + (i%100)/10); + *pParse++ = (unsigned char)('0' + (i%10)); + *pParse++ = ','; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nReal & 0xf000)>>12); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nReal & 0x0f00)>>8); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nReal & 0x00f0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.deltHlin.nNSCComplexData[i].nReal & 0x000f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ','; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nImag & 0xf000)>>12); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nImag & 0x0f00)>>8); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = ((pData->data.deltHlin.nNSCComplexData[i].nImag & 0x00f0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.deltHlin.nNSCComplexData[i].nImag & 0x000f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF, pResult); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997dhlogg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nHlog" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltHLOGGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; +#if 0 + DSL_char_t *pResult, *pParse, Num; +#endif + DSL_G997_DeltHlog_t *pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltHlog_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltHlog_t)); + + sscanf (pCommands, "%u %u", &pData->nDirection, &pData->nDeltDataType); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_HLOG_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), + pData->nDirection, pData->nDeltDataType, + pData->data.nMeasurementTime, pData->data.nGroupSize, + pData->data.deltHlog.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nHlog(dec)) nData=\""); + + for (i = 0; i < pData->data.deltHlog.nNumData; i++) + { + if (i%10 == 0) DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + DSL_CPE_FPrintf(out, "(%04d,%04d) ", i, pData->data.deltHlog.nNSCData[i] ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + +#if 0 + DSL_CPE_FPrintf(out, "nFormat=(tone(dec),hlog(hex)) nData=\""); + + /* alloc size of value-pairs, number of line-breaks and security */ + pResult = malloc( + (pData->data.deltHlog.nNumData)*10 + + (pData->data.deltHlog.nNumData)*2/10 + 10); + + if (pResult != DSL_NULL) + { + pParse = pResult; + for (i = 0; i < pData->data.deltHlog.nNumData; i++) + { + /* do own encoding for performance reasons */ + if (i%10==0) + { + *pParse++ = '\n'; + *pParse++ = '\r'; + } + *pParse++ = '('; + *pParse++ = '0' + i/1000; + *pParse++ = '0' + (i%1000)/100; + *pParse++ = '0' + (i%100)/10; + *pParse++ = '0' + (i%10); + *pParse++ = ','; + Num = ((pData->data.deltHlog.nNSCData[i] & 0xf0)>>4); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + Num = (pData->data.deltHlog.nNSCData[i] & 0x0f); + *pParse++ = (Num > 9) ? (('A'-10)+Num) : ('0'+Num) ; + *pParse++ = ')'; + *pParse++ = ' '; + } + *pParse = '\0'; + DSL_CPE_FPrintf(out, "%s\"" DSL_CPE_CRLF,pResult ); + free(pResult); + } + else + { + /* not enough memory */ + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } +#endif + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997dqlng[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nQln" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltQLNGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_DeltQln_t *pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltQln_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltQln_t)); + + sscanf (pCommands, "%u %u", &pData->nDirection, &pData->nDeltDataType); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_QLN_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), pData->nDirection, pData->nDeltDataType, + pData->data.nMeasurementTime, pData->data.nGroupSize, + pData->data.deltQln.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nQln(dec)) nData=\""); + for (i = 0; i < pData->data.deltQln.nNumData; i++) + { + if (i%10 == 0) DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + DSL_CPE_FPrintf(out, "(%04d,%03d) ", i, pData->data.deltQln.nNSCData[i] ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + + } + free(pData); + return 0; +} + +static const DSL_char_t g_sG997dsnrg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " diagnostic = 0" DSL_CPE_CRLF + " showtime = 1" DSL_CPE_CRLF + "- DSL_uint16_t nMeasurementTime" DSL_CPE_CRLF + "- DSL_uint8_t nGroupSize (currently unused!)" DSL_CPE_CRLF + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_int_t nToneIndex" DSL_CPE_CRLF + "- DSL_uint16_t nSnr" DSL_CPE_CRLF + "- ... nParamNr[2] nCount[" _MKSTR(DSL_MAX_NSC) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_DeltSNRGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint16_t i = 0; + DSL_G997_DeltSnr_t *pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = malloc(sizeof(DSL_G997_DeltSnr_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + memset(pData, 0, sizeof(DSL_G997_DeltSnr_t)); + + sscanf (pCommands, "%u %u", &pData->nDirection, &pData->nDeltDataType); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_SNR_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u nDeltDataType=%u " + "nMeasurementTime=%hu nGroupSize=%hu nNumData=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData->accessCtl.nReturn), + pData->nDirection, pData->nDeltDataType, + pData->data.nMeasurementTime, pData->data.nGroupSize, + pData->data.deltSnr.nNumData ); + + DSL_CPE_FPrintf(out, "nFormat=(nToneIndex(dec),nSnr(dec)) nData=\""); + for (i = 0; i < pData->data.deltSnr.nNumData; i++) + { + if (i%10 == 0) DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + DSL_CPE_FPrintf(out, "(%04d,%03d) ", i, pData->data.deltSnr.nNSCData[i] ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + + } + free(pData); + return 0; +} +#endif /* INCLUDE_DSL_DELT*/ + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sG997xtusecg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t XTSE1 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE2 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE3 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE4 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE5 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE6 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE7 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE8 (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_XTUSystemEnablingConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t i = 0; + DSL_int_t ret = 0; + DSL_G997_XTUSystemEnabling_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_XTU_SYSTEM_ENABLING_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + + for (i = 0; i < DSL_G997_NUM_XTSE_OCTETS; i++) + { + DSL_CPE_FPrintf(out, "XTSE%d=0x%x ", i + 1, (DSL_int_t)(pData.data.XTSE[i]) ); + } + DSL_CPE_FPrintf(out, DSL_CPE_CRLF ); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +static const DSL_char_t g_sG997xtusecs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint8_t XTSE1 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE2 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE3 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE4 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE5 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE6 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE7 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE8 (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_XTUSystemEnablingConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_int_t i = 0; + DSL_G997_XTUSystemEnabling_t pData; + DSL_uint32_t nParam[DSL_G997_NUM_XTSE_OCTETS] = { 0 }; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 8, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf ( pCommands, "%x %x %x %x %x %x %x %x", + &(nParam[0]), &(nParam[1]), &(nParam[2]), &(nParam[3]), &(nParam[4]), + &(nParam[5]), &(nParam[6]), &(nParam[7])); + + for (i = 0; i < DSL_G997_NUM_XTSE_OCTETS; i++) + { + pData.data.XTSE[i] = (DSL_uint8_t) nParam[i]; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_XTU_SYSTEM_ENABLING_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sG997xtusesg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t XTSE1 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE2 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE3 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE4 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE5 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE6 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE7 (hex)" DSL_CPE_CRLF + "- DSL_uint8_t XTSE8 (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_XTUSystemEnablingStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_XTUSystemEnabling_t pData; + DSL_int_t i = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_XTU_SYSTEM_ENABLING_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, pData.accessCtl.nReturn); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + + for (i = 0; i < DSL_G997_NUM_XTSE_OCTETS; i++) + { + DSL_CPE_FPrintf(out, "XTSE%d=0x%x ", i + 1, (DSL_int_t)(pData.data.XTSE[i]) ); + } + DSL_CPE_FPrintf(out, DSL_CPE_CRLF ); + } + + return 0; +} + +static const DSL_char_t g_sLocs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_LineOptionsSelector_t nConfigSelector (dec)" DSL_CPE_CRLF + " DSL_OPT_NOISE_MARGIN_DELTA_DS = 0" DSL_CPE_CRLF + " DSL_ERASURE_DECODING_TYPE_DS = 1" DSL_CPE_CRLF + " DSL_TRUST_ME_BIT = 2" DSL_CPE_CRLF + " DSL_INBAND_SPECTRAL_SHAPING_US = 3" DSL_CPE_CRLF + "- DSL_int32_t nConfigValue (dec)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +#ifdef INCLUDE_DSL_PM +static const DSL_char_t g_sPMr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_PM_ResetTypes_t nResetType" DSL_CPE_CRLF + " current = 0" DSL_CPE_CRLF + " history = 1" DSL_CPE_CRLF + " total = 2" DSL_CPE_CRLF + " all = 3" DSL_CPE_CRLF + " current showtime = 4" DSL_CPE_CRLF + " history showtime = 5" DSL_CPE_CRLF + "- DSL_boolean_t bUseDetailedReset (optional, used only in conjunction with the next parameter)" DSL_CPE_CRLF + " do not use detailed reset = 0" DSL_CPE_CRLF + " use detailed reset = 1" DSL_CPE_CRLF + "- DSL_PM_BF_ResetMask_t nResetMask (hex, optional, used only if detailed reset was specified)" DSL_CPE_CRLF + " cleaned = 0x00000000" DSL_CPE_CRLF + " line init counters = 0x00000001" DSL_CPE_CRLF + " line sec counters = 0x00000002" DSL_CPE_CRLF + " line failure counters = 0x00000004" DSL_CPE_CRLF + " line event showtime counters = 0x00000008" DSL_CPE_CRLF + " channel counters = 0x00000100" DSL_CPE_CRLF + " data path counters = 0x00001000" DSL_CPE_CRLF + " data path failure counters = 0x00002000" DSL_CPE_CRLF + " retx counters = 0x00010000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_Reset( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_Reset_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x00, sizeof(DSL_PM_Reset_t)); + + sscanf (pCommands, "%u %u %x", + &pData.data.nResetType, &pData.data.bUseDetailedReset, &pData.data.nResetMask); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RESET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_PM */ + + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#endif /* INCLUDE_DSL_CPE_PM_DATA_LINE_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +#endif /* INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +#endif /* INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_PM */ + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +static const DSL_char_t g_sDtiStart[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint16_t numOfPhyDevices" DSL_CPE_CRLF + "- DSL_uint16_t numOfLinesPerPhyDevice" DSL_CPE_CRLF + "- DSL_char_t sDtiServerIp" DSL_CPE_CRLF + "- DSL_uint16_t DTI Server Port" DSL_CPE_CRLF + "- DSL_boolean_t bEnableCliAutoMsg" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + "- DSL_boolean_t bEnableDevAutoMsg" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + "- DSL_boolean_t bEnableSingleThreadMode" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DebugTraceInterfaceSTART( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_boolean_t bEnableCliAutoMsg = DSL_FALSE, bEnableDevAutoMsg = DSL_FALSE, bEnableSingleThrMode = DSL_FALSE; + DSL_uint16_t numOfDevs, portsPerDev, dtiIpPort; + DSL_char_t dtiIpAddr[32]; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 7, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf ( pCommands, "%hu %hu %s %hu %hu %hu %hu", + &numOfDevs, &portsPerDev, dtiIpAddr, &dtiIpPort, + &bEnableCliAutoMsg, &bEnableDevAutoMsg, &bEnableSingleThrMode); + + /* start DTI agent */ + ret = DSL_CPE_Dti_Start( + DSL_CPE_GetGlobalContext(), numOfDevs, portsPerDev, dtiIpPort, dtiIpAddr, + (bEnableCliAutoMsg) ? DSL_TRUE : DSL_FALSE, + (bEnableDevAutoMsg) ? DSL_TRUE : DSL_FALSE, + (bEnableSingleThrMode) ? DSL_TRUE : DSL_FALSE); + + DSL_CPE_FPrintf (out, "nReturn=%d", ret); + + return 0; +} + +static const DSL_char_t g_sDtiStop[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DebugTraceInterfaceSTOP( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + /* stop DTI agent */ + ret = DSL_CPE_Dti_Stop(DSL_CPE_GetGlobalContext()); + + DSL_CPE_FPrintf (out, "nReturn=%d", ret); + + return 0; +} +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +#ifdef INCLUDE_PILOT_TONES_STATUS +static const DSL_char_t g_sPtsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint16_t nNumData" DSL_CPE_CRLF + "- DSL_uint16_t nPilotTone" DSL_CPE_CRLF + "- ... nParamNr[1] nCount[" _MKSTR(MAX_NUMBER_OF_PILOT_TONES) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PilotTonesStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint8_t nPilot; + DSL_PilotTonesStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PILOT_TONES_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nNumData=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nNumData); + DSL_CPE_FPrintf (out, + "nFormat=(nPilotNum(dec),nPilotIndex(dec)) nData=\"" DSL_CPE_CRLF); + + for (nPilot = 0; nPilot < pData.data.nNumData; nPilot++) + { + DSL_CPE_FPrintf (out, "(%02d,%05d)"DSL_CPE_CRLF, nPilot, pData.data.nPilotTone[nPilot]); + } + + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + + return 0; +} +#endif /* #ifdef INCLUDE_PILOT_TONES_STATUS*/ + +/** + Register the CLI commands. + + \param pContext Pointer to dsl library context structure, [I] + \param command optional parameters [I] +*/ +DSL_void_t DSL_CPE_CLI_AccessCommandsRegister(DSL_void_t) +{ + /* Debug functionalities */ +#ifndef DSL_CPE_DEBUG_DISABLE + DSL_CPE_CLI_CMD_ADD_COMM ("ccadbgmlg", "CCA_DBG_ModuleLevelGet", DSL_CPE_CLI_CCA_DBG_ModuleLevelGet, g_sCcaDbgmlg); + DSL_CPE_CLI_CMD_ADD_COMM ("ccadbgmls", "CCA_DBG_ModuleLevelSet", DSL_CPE_CLI_CCA_DBG_ModuleLevelSet, g_sCcaDbgmls); +#endif + + /* Common functionalities */ +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +#ifdef INCLUDE_DSL_CONFIG_GET +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + DSL_CPE_CLI_CMD_ADD_COMM ("asecg", "AutobootScriptExecuteConfigGet", DSL_CPE_CLI_AutobootScriptExecuteConfigGet, g_sAsecg); +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + DSL_CPE_CLI_CMD_ADD_COMM ("acog", "AutobootConfigOptionGet", DSL_CPE_CLI_AutobootConfigOptionGet, g_sAcfgg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + DSL_CPE_CLI_CMD_ADD_COMM ("se", "ScriptExecute", DSL_CPE_CLI_ScriptExecute, g_sSe); + DSL_CPE_CLI_CMD_ADD_COMM ("asecs", "AutobootScriptExecuteConfigSet", DSL_CPE_CLI_AutobootScriptExecuteConfigSet, g_sAsecs); +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + DSL_CPE_CLI_CMD_ADD_COMM ("acos", "AutobootConfigOptionSet", DSL_CPE_CLI_AutobootConfigOptionSet, g_sAcfgs); +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_COMM ("nsecg", "NotificationScriptExecuteConfigGet", DSL_CPE_CLI_NotificationScriptExecuteConfigGet, g_sNsecg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_COMM ("nsecs", "NotificationScriptExecuteConfigSet", DSL_CPE_CLI_NotificationScriptExecuteConfigSet, g_sNsecs); +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + + DSL_CPE_CLI_CMD_ADD_COMM ("alf", "AutobootLoadFirmware", DSL_CPE_CLI_AutobootLoadFirmware, g_sAlf); +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS + DSL_CPE_CLI_CMD_ADD_COMM ("rusg", "ResourceUsageStatisticsGet", DSL_CPE_CLI_ResourceUsageStatisticsGet, g_sRusg); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + + DSL_CPE_CLI_CMD_ADD_COMM ("ics", "InstanceControlSet", DSL_CPE_CLI_InstanceControlSet, g_sIcs); +#ifdef INCLUDE_DSL_CPE_MISC_LINE_STATUS + DSL_CPE_CLI_CMD_ADD_COMM ("bbsg", "BandBorderStatusGet", DSL_CPE_CLI_BandBorderStatusGet, g_sBbsg); +#endif /* INCLUDE_DSL_CPE_MISC_LINE_STATUS*/ + /* G.997.1 related functionlities */ + +#ifdef INCLUDE_DSL_G997_PER_TONE + DSL_CPE_CLI_CMD_ADD_COMM ("g997bang", "G997_BitAllocationNscGet", DSL_CPE_CLI_G997_BitAllocationNscGet, g_sG997bang); + DSL_CPE_CLI_CMD_ADD_COMM ("g997bansg", "G997_BitAllocationNscShortGet", DSL_CPE_CLI_G997_BitAllocationNscShortGet, g_sG997bansg); + DSL_CPE_CLI_CMD_ADD_COMM ("g997gang", "G997_GainAllocationNscGet", DSL_CPE_CLI_G997_GainAllocationNscGet, g_sG997gang); + DSL_CPE_CLI_CMD_ADD_COMM ("g997gansg", "G997_GainAllocationNscShortGet", DSL_CPE_CLI_G997_GainAllocationNscShortGet, g_sG997gansg); + DSL_CPE_CLI_CMD_ADD_COMM ("g997sang", "G997_SnrAllocationNscGet", DSL_CPE_CLI_G997_SnrAllocationNscGet, g_sG997sang); + DSL_CPE_CLI_CMD_ADD_COMM ("g997sansg", "G997_SnrAllocationNscShortGet", DSL_CPE_CLI_G997_SnrAllocationNscShortGet, g_sG997sansg); +#endif /* INCLUDE_DSL_G997_PER_TONE*/ + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY + DSL_CPE_CLI_CMD_ADD_COMM ("g997lig", "G997_LineInventoryGet", DSL_CPE_CLI_G997_LineInventoryGet, g_sG997lig); + DSL_CPE_CLI_CMD_ADD_COMM ("g997lis", "G997_LineInventorySet", DSL_CPE_CLI_G997_LineInventorySet, g_sG997lis); + DSL_CPE_CLI_CMD_ADD_COMM ("g997listrg", "G997_LineInventorySTRingGet", DSL_CPE_CLI_G997_LineInventoryStringGet, g_sG997listrg); +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +#ifdef INCLUDE_DSL_CEOC + DSL_CPE_CLI_CMD_ADD_COMM ("g997sms", "G997_SnmpMessageSend", DSL_CPE_CLI_G997_SnmpMessageSend, g_sG997sms); + DSL_CPE_CLI_CMD_ADD_COMM ("g997smr", "G997_SnmpMessageReceive", DSL_CPE_CLI_G997_SnmpMessageReceive, g_sG997smr); +#endif /* INCLUDE_DSL_CEOC */ +#ifdef INCLUDE_DSL_DELT + DSL_CPE_CLI_CMD_ADD_COMM ("g997dhling", "G997_DeltHLINGet", DSL_CPE_CLI_G997_DeltHLINGet, g_sG997dhling); + DSL_CPE_CLI_CMD_ADD_COMM ("g997dhlogg", "G997_DeltHLOGGet", DSL_CPE_CLI_G997_DeltHLOGGet,g_sG997dhlogg); + DSL_CPE_CLI_CMD_ADD_COMM ("g997dqlng", "G997_DeltQLNGet", DSL_CPE_CLI_G997_DeltQLNGet,g_sG997dqlng); + DSL_CPE_CLI_CMD_ADD_COMM ("g997dsnrg", "G997_DeltSNRGet", DSL_CPE_CLI_G997_DeltSNRGet,g_sG997dsnrg); +#endif /* INCLUDE_DSL_DELT*/ +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_COMM ("g997xtusecg", "G997_XTUSystemEnablingConfigGet", DSL_CPE_CLI_G997_XTUSystemEnablingConfigGet, g_sG997xtusecg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_COMM ("g997xtusecs", "G997_XTUSystemEnablingConfigSet", DSL_CPE_CLI_G997_XTUSystemEnablingConfigSet, g_sG997xtusecs); + DSL_CPE_CLI_CMD_ADD_COMM ("g997xtusesg", "G997_XTUSystemEnablingStatusGet", DSL_CPE_CLI_G997_XTUSystemEnablingStatusGet, g_sG997xtusesg); + + +#ifdef INCLUDE_DSL_PM + /* PM related functionalities */ + DSL_CPE_CLI_CMD_ADD_COMM ("pmr", "PM_Reset", DSL_CPE_CLI_PM_Reset, g_sPMr); + +#ifdef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS + /* Data path related counters */ +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + +#ifdef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS +#endif /* INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS*/ +#endif /* INCLUDE_DSL_CPE_PM_HISTORY */ +#ifdef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS +#endif /* INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS */ +#ifdef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS +#endif /* INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS */ +#endif /* INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS */ + +#endif /* #ifdef INCLUDE_DSL_PM */ + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) + DSL_CPE_CLI_CMD_ADD_COMM ("dtistart", "DebugTraceInterfaceSTART", DSL_CPE_CLI_DebugTraceInterfaceSTART, g_sDtiStart); + DSL_CPE_CLI_CMD_ADD_COMM ("dtistop", "DebugTraceInterfaceSTOP", DSL_CPE_CLI_DebugTraceInterfaceSTOP, g_sDtiStop); +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + +#ifdef INCLUDE_PILOT_TONES_STATUS + DSL_CPE_CLI_CMD_ADD_COMM ("ptsg", "PilotTonesStatusGet", DSL_CPE_CLI_PilotTonesStatusGet, g_sPtsg); +#endif /* #ifdef INCLUDE_PILOT_TONES_STATUS*/ + + DSL_CPE_CLI_AutogenCommandsRegister(); + + DSL_CPE_CLI_DeviceCommandsRegister(); + +#ifdef INCLUDE_DSL_ADSL_MIB + DSL_CPE_CLI_MibCommandsRegister(); +#endif /* INCLUDE_DSL_ADSL_MIB*/ +} + +#endif /* #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) && defined(INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT) */ diff --git a/src/dsl_cpe_cli_autogen.c b/src/dsl_cpe_cli_autogen.c new file mode 100644 index 0000000..7b1fac6 --- /dev/null +++ b/src/dsl_cpe_cli_autogen.c @@ -0,0 +1,11451 @@ +/* attention, this file was automatically generated by swig and Perl scripts*/ +/** \file + DSL CPE CLI, autogen access CLI functions implementation +*/ + +#include "dsl_cpe_control.h" +#include "drv_dsl_cpe_api_ioctl.h" +#include "drv_dsl_cpe_api.h" + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + +/** \addtogroup DSL_CPE_CLI + @{ */ + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CLI + +extern const char *sFailureReturn; + +#ifdef DSL_CLI_LOCAL +#undef DSL_CLI_LOCAL +#endif +#define DSL_CLI_LOCAL static + + +static const DSL_char_t g_sAcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AutobootCtrlSet_t nCommand" DSL_CPE_CRLF + " DSL_AUTOBOOT_CTRL_STOP = 0" DSL_CPE_CRLF + " DSL_AUTOBOOT_CTRL_START = 1" DSL_CPE_CRLF + " DSL_AUTOBOOT_CTRL_RESTART = 2" DSL_CPE_CRLF + " DSL_AUTOBOOT_CTRL_CONTINUE = 3" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_AUTOBOOT_CONTROL_SET + + Long Form: AutobootControlSet + + Short Form: acs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AutobootCtrlSet_t nCommand + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootControlSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_AutobootControl_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.nCommand); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONTROL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sAsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AutobootStatGet_t nStatus" DSL_CPE_CRLF + " DSL_AUTOBOOT_STATUS_STOPPED = 0" DSL_CPE_CRLF + " DSL_AUTOBOOT_STATUS_STARTING = 1" DSL_CPE_CRLF + " DSL_AUTOBOOT_STATUS_RUNNING = 2" DSL_CPE_CRLF + " DSL_AUTOBOOT_STATUS_FW_WAIT = 3" DSL_CPE_CRLF + " DSL_AUTOBOOT_STATUS_CONFIG_WRITE_WAIT = 4" DSL_CPE_CRLF + " DSL_AUTOBOOT_STATUS_LINK_ACTIVATE_WAIT = 5" DSL_CPE_CRLF + " DSL_AUTOBOOT_STATUS_RESTART_WAIT = 6" DSL_CPE_CRLF + "- DSL_FirmwareRequestType_t nFirmwareRequestType" DSL_CPE_CRLF + " DSL_FW_REQUEST_NA = 0" DSL_CPE_CRLF + " DSL_FW_REQUEST_ADSL = 1" DSL_CPE_CRLF + " DSL_FW_REQUEST_VDSL = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_AUTOBOOT_STATUS_GET + + Long Form: AutobootStatusGet + + Short Form: asg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AutobootStatGet_t nStatus + + \ref DSL_FirmwareRequestType_t nFirmwareRequestType + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_AutobootStatus_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nStatus=%d nFirmwareRequestType=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nStatus, pData.data.nFirmwareRequestType); + } + + return 0; +} + + +static const DSL_char_t g_sLsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_LineStateValue_t nLineState (hex)" DSL_CPE_CRLF + " DSL_LINESTATE_NOT_INITIALIZED = 0x00000000" DSL_CPE_CRLF + " DSL_LINESTATE_EXCEPTION = 0x00000001" DSL_CPE_CRLF + " DSL_LINESTATE_NOT_UPDATED = 0x00000010" DSL_CPE_CRLF + " DSL_LINESTATE_IDLE_REQUEST = 0x000000FF" DSL_CPE_CRLF + " DSL_LINESTATE_IDLE = 0x00000100" DSL_CPE_CRLF + " DSL_LINESTATE_SILENT_REQUEST = 0x000001FF" DSL_CPE_CRLF + " DSL_LINESTATE_SILENT = 0x00000200" DSL_CPE_CRLF + " DSL_LINESTATE_HANDSHAKE = 0x00000300" DSL_CPE_CRLF + " DSL_LINESTATE_BONDING_CLR = 0x00000310" DSL_CPE_CRLF + " DSL_LINESTATE_FULL_INIT = 0x00000380" DSL_CPE_CRLF + " DSL_LINESTATE_SHORT_INIT_ENTRY = 0x000003C0" DSL_CPE_CRLF + " DSL_LINESTATE_DISCOVERY = 0x00000400" DSL_CPE_CRLF + " DSL_LINESTATE_TRAINING = 0x00000500" DSL_CPE_CRLF + " DSL_LINESTATE_ANALYSIS = 0x00000600" DSL_CPE_CRLF + " DSL_LINESTATE_EXCHANGE = 0x00000700" DSL_CPE_CRLF + " DSL_LINESTATE_SHOWTIME_NO_SYNC = 0x00000800" DSL_CPE_CRLF + " DSL_LINESTATE_SHOWTIME_TC_SYNC = 0x00000801" DSL_CPE_CRLF + " DSL_LINESTATE_ORDERLY_SHUTDOWN_REQUEST = 0x0000085F" DSL_CPE_CRLF + " DSL_LINESTATE_ORDERLY_SHUTDOWN = 0x00000860" DSL_CPE_CRLF + " DSL_LINESTATE_FASTRETRAIN = 0x00000900" DSL_CPE_CRLF + " DSL_LINESTATE_LOWPOWER_L2 = 0x00000A00" DSL_CPE_CRLF + " DSL_LINESTATE_LOOPDIAGNOSTIC_ACTIVE = 0x00000B00" DSL_CPE_CRLF + " DSL_LINESTATE_LOOPDIAGNOSTIC_DATA_EXCHANGE = 0x00000B10" DSL_CPE_CRLF + " DSL_LINESTATE_LOOPDIAGNOSTIC_DATA_REQUEST = 0x00000B20" DSL_CPE_CRLF + " DSL_LINESTATE_LOOPDIAGNOSTIC_COMPLETE = 0x00000C00" DSL_CPE_CRLF + " DSL_LINESTATE_RESYNC = 0x00000D00" DSL_CPE_CRLF + " DSL_LINESTATE_TEST = 0x01000000" DSL_CPE_CRLF + " DSL_LINESTATE_TEST_LOOP = 0x01000001" DSL_CPE_CRLF + " DSL_LINESTATE_TEST_REVERB = 0x01000010" DSL_CPE_CRLF + " DSL_LINESTATE_TEST_MEDLEY = 0x01000020" DSL_CPE_CRLF + " DSL_LINESTATE_TEST_SHOWTIME_LOCK = 0x01000030" DSL_CPE_CRLF + " DSL_LINESTATE_TEST_QUIET = 0x01000040" DSL_CPE_CRLF + " DSL_LINESTATE_LOWPOWER_L3 = 0x02000000" DSL_CPE_CRLF + " DSL_LINESTATE_UNKNOWN = 0x03000000" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_LINE_STATE_GET + + Long Form: LineStateGet + + Short Form: lsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_LineStateValue_t nLineState (hex) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineStateGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineState_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_STATE_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nLineState=0x%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nLineState); + } + + return 0; +} + + +static const DSL_char_t g_sLfcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_boolean_t bTrellisEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bBitswapEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bReTxEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bVirtualNoiseSupport" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_LINE_FEATURE_CONFIG_SET + + Long Form: LineFeatureConfigSet + + Short Form: lfcs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_boolean_t bTrellisEnable + + \ref DSL_boolean_t bBitswapEnable + + \ref DSL_boolean_t bReTxEnable + + \ref DSL_boolean_t bVirtualNoiseSupport + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineFeatureConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineFeature_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 5, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d %d %d %d", &pData.nDirection, &pData.data.bTrellisEnable, &pData.data.bBitswapEnable, &pData.data.bReTxEnable, &pData.data.bVirtualNoiseSupport); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_FEATURE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} + +#if defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sLfcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_boolean_t bTrellisEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bBitswapEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bReTxEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bVirtualNoiseSupport" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_LINE_FEATURE_CONFIG_GET + + Long Form: LineFeatureConfigGet + + Short Form: lfcg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_boolean_t bTrellisEnable + + \ref DSL_boolean_t bBitswapEnable + + \ref DSL_boolean_t bReTxEnable + + \ref DSL_boolean_t bVirtualNoiseSupport + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineFeatureConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineFeature_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_FEATURE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d bTrellisEnable=%d bBitswapEnable=%d bReTxEnable=%d bVirtualNoiseSupport=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.bTrellisEnable, pData.data.bBitswapEnable, pData.data.bReTxEnable, pData.data.bVirtualNoiseSupport); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + +static const DSL_char_t g_sLfsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_boolean_t bTrellisEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bBitswapEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bReTxEnable" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bVirtualNoiseSupport" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_LINE_FEATURE_STATUS_GET + + Long Form: LineFeatureStatusGet + + Short Form: lfsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_boolean_t bTrellisEnable + + \ref DSL_boolean_t bBitswapEnable + + \ref DSL_boolean_t bReTxEnable + + \ref DSL_boolean_t bVirtualNoiseSupport + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineFeatureStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineFeature_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_FEATURE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d bTrellisEnable=%d bBitswapEnable=%d bReTxEnable=%d bVirtualNoiseSupport=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.bTrellisEnable, pData.data.bBitswapEnable, pData.data.bReTxEnable, pData.data.bVirtualNoiseSupport); + } + + return 0; +} + +#if defined(INCLUDE_DSL_FRAMING_PARAMETERS) + +static const DSL_char_t g_sFpsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint16_t nTp" DSL_CPE_CRLF + "- DSL_uint16_t nMp" DSL_CPE_CRLF + "- DSL_uint16_t nSEQ" DSL_CPE_CRLF + "- DSL_uint16_t nBP" DSL_CPE_CRLF + "- DSL_uint16_t nMSGC" DSL_CPE_CRLF + "- DSL_uint16_t nMSGLP" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_FRAMING_PARAMETER_STATUS_GET + + Long Form: FramingParameterStatusGet + + Short Form: fpsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + \ref DSL_uint16_t nTp + + \ref DSL_uint16_t nMp + + \ref DSL_uint16_t nSEQ + + \ref DSL_uint16_t nBP + + \ref DSL_uint16_t nMSGC + + \ref DSL_uint16_t nMSGLP + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_FramingParameterStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_FramingParameterStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_FRAMING_PARAMETER_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nTp=%hu nMp=%hu nSEQ=%hu nBP=%hu nMSGC=%hu nMSGLP=%hu" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nTp, pData.data.nMp, pData.data.nSEQ, pData.data.nBP, pData.data.nMSGC, pData.data.nMSGLP); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_FRAMING_PARAMETERS) */ + +#if !defined(DSL_CPE_DEBUG_DISABLE) + +static const DSL_char_t g_sDmls[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_debugModules_t nDbgModule" DSL_CPE_CRLF + " DSL_DBG_NO_BLOCK = 0" DSL_CPE_CRLF + " DSL_DBG_CPE_API = 1" DSL_CPE_CRLF + " DSL_DBG_G997 = 2" DSL_CPE_CRLF + " DSL_DBG_PM = 3" DSL_CPE_CRLF + " DSL_DBG_MIB = 4" DSL_CPE_CRLF + " DSL_DBG_CEOC = 5" DSL_CPE_CRLF + " DSL_DBG_LED = 6 (not used anymore!)" DSL_CPE_CRLF + " DSL_DBG_SAR = 7 (not used anymore!)" DSL_CPE_CRLF + " DSL_DBG_DEVICE = 8" DSL_CPE_CRLF + " DSL_DBG_AUTOBOOT_THREAD = 9" DSL_CPE_CRLF + " DSL_DBG_OS = 10" DSL_CPE_CRLF + " DSL_DBG_CALLBACK = 11" DSL_CPE_CRLF + " DSL_DBG_MESSAGE_DUMP = 12" DSL_CPE_CRLF + " DSL_DBG_LOW_LEVEL_DRIVER = 13" DSL_CPE_CRLF + "- DSL_debugLevels_t nDbgLevel" DSL_CPE_CRLF + " DSL_DBG_NONE = 0x00" DSL_CPE_CRLF + " DSL_DBG_PRN = 0x01" DSL_CPE_CRLF + " DSL_DBG_ERR = 0x02" DSL_CPE_CRLF + " DSL_DBG_WRN = 0x40" DSL_CPE_CRLF + " DSL_DBG_MSG = 0x80" DSL_CPE_CRLF + " DSL_DBG_LOCAL = 0xFF" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_DBG_MODULE_LEVEL_SET + + Long Form: DbgModuleLevelSet + + Short Form: dmls + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_debugModules_t nDbgModule + + \ref DSL_debugLevels_t nDbgLevel + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_ModuleLevelSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_DBG_ModuleLevel_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d", &pData.data.nDbgModule, &pData.data.nDbgLevel); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_LEVEL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sDmlg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_debugModules_t nDbgModule" DSL_CPE_CRLF + " DSL_DBG_NO_BLOCK = 0" DSL_CPE_CRLF + " DSL_DBG_CPE_API = 1" DSL_CPE_CRLF + " DSL_DBG_G997 = 2" DSL_CPE_CRLF + " DSL_DBG_PM = 3" DSL_CPE_CRLF + " DSL_DBG_MIB = 4" DSL_CPE_CRLF + " DSL_DBG_CEOC = 5" DSL_CPE_CRLF + " DSL_DBG_LED = 6" DSL_CPE_CRLF + " DSL_DBG_SAR = 7" DSL_CPE_CRLF + " DSL_DBG_DEVICE = 8" DSL_CPE_CRLF + " DSL_DBG_AUTOBOOT_THREAD = 9" DSL_CPE_CRLF + " DSL_DBG_OS = 10" DSL_CPE_CRLF + " DSL_DBG_CALLBACK = 11" DSL_CPE_CRLF + " DSL_DBG_MESSAGE_DUMP = 12" DSL_CPE_CRLF + " DSL_DBG_LOW_LEVEL_DRIVER = 13" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_debugLevels_t nDbgLevel" DSL_CPE_CRLF + " DSL_DBG_NONE = 0x00" DSL_CPE_CRLF + " DSL_DBG_PRN = 0x01" DSL_CPE_CRLF + " DSL_DBG_ERR = 0x02" DSL_CPE_CRLF + " DSL_DBG_WRN = 0x40" DSL_CPE_CRLF + " DSL_DBG_MSG = 0x80" DSL_CPE_CRLF + " DSL_DBG_LOCAL = 0xFF" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_DBG_MODULE_LEVEL_GET + + Long Form: DbgModuleLevelGet + + Short Form: dmlg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_debugModules_t nDbgModule + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_debugLevels_t nDbgLevel + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_ModuleLevelGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_DBG_ModuleLevel_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.nDbgModule); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_LEVEL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDbgLevel=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nDbgLevel); + } + + return 0; +} + +#endif /* !defined(DSL_CPE_DEBUG_DISABLE) */ + +static const DSL_char_t g_sTmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_TestModeControlSet_t nTestMode" DSL_CPE_CRLF + " DSL_TESTMODE_DISABLE = 0" DSL_CPE_CRLF + " DSL_TESTMODE_SHOWTIME_LOCK = 1" DSL_CPE_CRLF + " DSL_TESTMODE_QUIET = 2" DSL_CPE_CRLF + " DSL_TESTMODE_TRAINING_LOCK = 3" DSL_CPE_CRLF + " DSL_TESTMODE_LOCK = 4" DSL_CPE_CRLF + " DSL_TESTMODE_UNLOCK = 5" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_TEST_MODE_CONTROL_SET + + Long Form: TestModeControlSet + + Short Form: tmcs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_TestModeControlSet_t nTestMode + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_TestModeControlSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_TestModeControl_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.nTestMode); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_TEST_MODE_CONTROL_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#if defined(INCLUDE_DSL_SYSTEM_INTERFACE) + +static const DSL_char_t g_sSics[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_TcLayerSelection_t nTcLayer" DSL_CPE_CRLF + " DSL_TC_UNKNOWN = 0" DSL_CPE_CRLF + " DSL_TC_ATM = 1" DSL_CPE_CRLF + " DSL_TC_EFM = 2" DSL_CPE_CRLF + " DSL_TC_HDLC = 3" DSL_CPE_CRLF + " DSL_TC_AUTO = 4" DSL_CPE_CRLF + " DSL_TC_EFM_FORCED = 5" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex)" DSL_CPE_CRLF + " DSL_EMF_TC_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_EMF_TC_NORMAL = 0x00000001" DSL_CPE_CRLF + " DSL_EMF_TC_PRE_EMPTION = 0x00000002" DSL_CPE_CRLF + " DSL_EMF_TC_SHORT_PACKETS = 0x00000004" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex)" DSL_CPE_CRLF + " DSL_EMF_TC_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_EMF_TC_NORMAL = 0x00000001" DSL_CPE_CRLF + " DSL_EMF_TC_PRE_EMPTION = 0x00000002" DSL_CPE_CRLF + " DSL_EMF_TC_SHORT_PACKETS = 0x00000004" DSL_CPE_CRLF + "- DSL_SystemInterfaceSelection_t nSystemIf" DSL_CPE_CRLF + " DSL_SYSTEMIF_UNKNOWN = 0" DSL_CPE_CRLF + " DSL_SYSTEMIF_UTOPIA = 1" DSL_CPE_CRLF + " DSL_SYSTEMIF_POSPHY = 2" DSL_CPE_CRLF + " DSL_SYSTEMIF_MII = 3" DSL_CPE_CRLF + " DSL_SYSTEMIF_UNDEFINED = 4" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_SYSTEM_INTERFACE_CONFIG_SET + + Long Form: SystemInterfaceConfigSet + + Short Form: sics + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_TcLayerSelection_t nTcLayer + + \ref DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex) + + \ref DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex) + + \ref DSL_SystemInterfaceSelection_t nSystemIf + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_SystemInterfaceConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_SystemInterfaceConfig_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %x %x %d", &pData.data.nTcLayer, &pData.data.nEfmTcConfigUs, &pData.data.nEfmTcConfigDs, &pData.data.nSystemIf); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_SYSTEM_INTERFACE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_SYSTEM_INTERFACE) */ + +#if defined(INCLUDE_DSL_SYSTEM_INTERFACE) && defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sSicg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_TcLayerSelection_t nTcLayer" DSL_CPE_CRLF + " DSL_TC_UNKNOWN = 0" DSL_CPE_CRLF + " DSL_TC_ATM = 1" DSL_CPE_CRLF + " DSL_TC_EFM = 2" DSL_CPE_CRLF + " DSL_TC_HDLC = 3" DSL_CPE_CRLF + " DSL_TC_AUTO = 4" DSL_CPE_CRLF + " DSL_TC_EFM_FORCED = 5" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex)" DSL_CPE_CRLF + " DSL_EMF_TC_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_EMF_TC_NORMAL = 0x00000001" DSL_CPE_CRLF + " DSL_EMF_TC_PRE_EMPTION = 0x00000002" DSL_CPE_CRLF + " DSL_EMF_TC_SHORT_PACKETS = 0x00000004" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex)" DSL_CPE_CRLF + " DSL_EMF_TC_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_EMF_TC_NORMAL = 0x00000001" DSL_CPE_CRLF + " DSL_EMF_TC_PRE_EMPTION = 0x00000002" DSL_CPE_CRLF + " DSL_EMF_TC_SHORT_PACKETS = 0x00000004" DSL_CPE_CRLF + "- DSL_SystemInterfaceSelection_t nSystemIf" DSL_CPE_CRLF + " DSL_SYSTEMIF_UNKNOWN = 0" DSL_CPE_CRLF + " DSL_SYSTEMIF_UTOPIA = 1" DSL_CPE_CRLF + " DSL_SYSTEMIF_POSPHY = 2" DSL_CPE_CRLF + " DSL_SYSTEMIF_MII = 3" DSL_CPE_CRLF + " DSL_SYSTEMIF_UNDEFINED = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_SYSTEM_INTERFACE_CONFIG_GET + + Long Form: SystemInterfaceConfigGet + + Short Form: sicg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_TcLayerSelection_t nTcLayer + + \ref DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex) + + \ref DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex) + + \ref DSL_SystemInterfaceSelection_t nSystemIf + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_SystemInterfaceConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_SystemInterfaceConfig_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_SYSTEM_INTERFACE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nTcLayer=%d nEfmTcConfigUs=0x%x nEfmTcConfigDs=0x%x nSystemIf=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nTcLayer, pData.data.nEfmTcConfigUs, pData.data.nEfmTcConfigDs, pData.data.nSystemIf); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_SYSTEM_INTERFACE) && defined(INCLUDE_DSL_CONFIG_GET) */ + +static const DSL_char_t g_sEsmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_EventType_t nEventType" DSL_CPE_CRLF + " DSL_EVENT_I_LINE_FAILURES = 0" DSL_CPE_CRLF + " DSL_EVENT_I_DATA_PATH_FAILURES = 1" DSL_CPE_CRLF + " DSL_EVENT_I_LINE_THRESHOLD_CROSSING = 2" DSL_CPE_CRLF + " DSL_EVENT_I_CHANNEL_THRESHOLD_CROSSING = 3" DSL_CPE_CRLF + " DSL_EVENT_I_DATA_PATH_THRESHOLD_CROSSING = 4" DSL_CPE_CRLF + " DSL_EVENT_I_RETX_THRESHOLD_CROSSING = 5" DSL_CPE_CRLF + " DSL_EVENT_I_CHANNEL_DATARATE_SHIFT_THRESHOLD_CROSSING = 6" DSL_CPE_CRLF + " DSL_EVENT_S_LINIT_FAILURE = 7" DSL_CPE_CRLF + " DSL_EVENT_S_LINE_STATE = 8" DSL_CPE_CRLF + " DSL_EVENT_S_LINE_POWERMANAGEMENT_STATE = 9" DSL_CPE_CRLF + " DSL_EVENT_S_CHANNEL_DATARATE = 10" DSL_CPE_CRLF + " DSL_EVENT_S_FIRMWARE_ERROR = 11" DSL_CPE_CRLF + " DSL_EVENT_S_INIT_READY = 12" DSL_CPE_CRLF + " DSL_EVENT_S_FE_INVENTORY_AVAILABLE = 13" DSL_CPE_CRLF + " DSL_EVENT_S_SYSTEM_STATUS = 14" DSL_CPE_CRLF + " DSL_EVENT_S_PM_SYNC = 15" DSL_CPE_CRLF + " DSL_EVENT_S_LINE_TRANSMISSION_STATUS = 16" DSL_CPE_CRLF + " DSL_EVENT_S_SHOWTIME_LOGGING = 17" DSL_CPE_CRLF + " DSL_EVENT_S_FIRMWARE_REQUEST = 18" DSL_CPE_CRLF + " DSL_EVENT_S_SNMP_MESSAGE_AVAILABLE = 19" DSL_CPE_CRLF + " DSL_EVENT_S_SYSTEM_INTERFACE_STATUS = 20" DSL_CPE_CRLF + " DSL_EVENT_S_FIRMWARE_DOWNLOAD_STATUS = 21" DSL_CPE_CRLF + " DSL_EVENT_S_AUTOBOOT_STATUS = 22" DSL_CPE_CRLF + "- DSL_boolean_t bMask" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_EVENT_STATUS_MASK_CONFIG_SET + + Long Form: EventStatusMaskConfigSet + + Short Form: esmcs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_EventType_t nEventType + + \ref DSL_boolean_t bMask + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_EventStatusMaskConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_EventStatusMask_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d", &pData.data.nEventType, &pData.data.bMask); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_EVENT_STATUS_MASK_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#if defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sEsmcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_EventType_t nEventType" DSL_CPE_CRLF + " DSL_EVENT_I_LINE_FAILURES = 0" DSL_CPE_CRLF + " DSL_EVENT_I_DATA_PATH_FAILURES = 1" DSL_CPE_CRLF + " DSL_EVENT_I_LINE_THRESHOLD_CROSSING = 2" DSL_CPE_CRLF + " DSL_EVENT_I_CHANNEL_THRESHOLD_CROSSING = 3" DSL_CPE_CRLF + " DSL_EVENT_I_DATA_PATH_THRESHOLD_CROSSING = 4" DSL_CPE_CRLF + " DSL_EVENT_I_RETX_THRESHOLD_CROSSING = 5" DSL_CPE_CRLF + " DSL_EVENT_I_CHANNEL_DATARATE_SHIFT_THRESHOLD_CROSSING = 6" DSL_CPE_CRLF + " DSL_EVENT_S_LINIT_FAILURE = 7" DSL_CPE_CRLF + " DSL_EVENT_S_LINE_STATE = 8" DSL_CPE_CRLF + " DSL_EVENT_S_LINE_POWERMANAGEMENT_STATE = 9" DSL_CPE_CRLF + " DSL_EVENT_S_CHANNEL_DATARATE = 10" DSL_CPE_CRLF + " DSL_EVENT_S_FIRMWARE_ERROR = 11" DSL_CPE_CRLF + " DSL_EVENT_S_INIT_READY = 12" DSL_CPE_CRLF + " DSL_EVENT_S_FE_INVENTORY_AVAILABLE = 13" DSL_CPE_CRLF + " DSL_EVENT_S_SYSTEM_STATUS = 14" DSL_CPE_CRLF + " DSL_EVENT_S_PM_SYNC = 15" DSL_CPE_CRLF + " DSL_EVENT_S_LINE_TRANSMISSION_STATUS = 16" DSL_CPE_CRLF + " DSL_EVENT_S_SHOWTIME_LOGGING = 17" DSL_CPE_CRLF + " DSL_EVENT_S_FIRMWARE_REQUEST = 18" DSL_CPE_CRLF + " DSL_EVENT_S_SNMP_MESSAGE_AVAILABLE = 19" DSL_CPE_CRLF + " DSL_EVENT_S_SYSTEM_INTERFACE_STATUS = 20" DSL_CPE_CRLF + " DSL_EVENT_S_FIRMWARE_DOWNLOAD_STATUS = 21" DSL_CPE_CRLF + " DSL_EVENT_S_AUTOBOOT_STATUS = 22" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bMask" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_EVENT_STATUS_MASK_CONFIG_GET + + Long Form: EventStatusMaskConfigGet + + Short Form: esmcg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_EventType_t nEventType + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_boolean_t bMask + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_EventStatusMaskConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_EventStatusMask_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.nEventType); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_EVENT_STATUS_MASK_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"bMask=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.bMask); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + +static const DSL_char_t g_sTmsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_TestModeControlSet_t nTestMode" DSL_CPE_CRLF + " DSL_TESTMODE_DISABLE = 0" DSL_CPE_CRLF + " DSL_TESTMODE_SHOWTIME_LOCK = 1" DSL_CPE_CRLF + " DSL_TESTMODE_QUIET = 2" DSL_CPE_CRLF + " DSL_TESTMODE_TRAINING_LOCK = 3" DSL_CPE_CRLF + " DSL_TESTMODE_LOCK = 4" DSL_CPE_CRLF + " DSL_TESTMODE_UNLOCK = 5" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_TEST_MODE_STATUS_GET + + Long Form: TestModeStatusGet + + Short Form: tmsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_TestModeControlSet_t nTestMode + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_TestModeStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_TestModeStatus_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_TEST_MODE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nTestMode=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nTestMode); + } + + return 0; +} + +#if defined(INCLUDE_DSL_SYSTEM_INTERFACE) + +static const DSL_char_t g_sSisg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_TcLayerSelection_t nTcLayer" DSL_CPE_CRLF + " DSL_TC_UNKNOWN = 0" DSL_CPE_CRLF + " DSL_TC_ATM = 1" DSL_CPE_CRLF + " DSL_TC_EFM = 2" DSL_CPE_CRLF + " DSL_TC_HDLC = 3" DSL_CPE_CRLF + " DSL_TC_AUTO = 4" DSL_CPE_CRLF + " DSL_TC_EFM_FORCED = 5" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex)" DSL_CPE_CRLF + " DSL_EMF_TC_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_EMF_TC_NORMAL = 0x00000001" DSL_CPE_CRLF + " DSL_EMF_TC_PRE_EMPTION = 0x00000002" DSL_CPE_CRLF + " DSL_EMF_TC_SHORT_PACKETS = 0x00000004" DSL_CPE_CRLF + "- DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex)" DSL_CPE_CRLF + " DSL_EMF_TC_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_EMF_TC_NORMAL = 0x00000001" DSL_CPE_CRLF + " DSL_EMF_TC_PRE_EMPTION = 0x00000002" DSL_CPE_CRLF + " DSL_EMF_TC_SHORT_PACKETS = 0x00000004" DSL_CPE_CRLF + "- DSL_SystemInterfaceSelection_t nSystemIf" DSL_CPE_CRLF + " DSL_SYSTEMIF_UNKNOWN = 0" DSL_CPE_CRLF + " DSL_SYSTEMIF_UTOPIA = 1" DSL_CPE_CRLF + " DSL_SYSTEMIF_POSPHY = 2" DSL_CPE_CRLF + " DSL_SYSTEMIF_MII = 3" DSL_CPE_CRLF + " DSL_SYSTEMIF_UNDEFINED = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_SYSTEM_INTERFACE_STATUS_GET + + Long Form: SystemInterfaceStatusGet + + Short Form: sisg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_TcLayerSelection_t nTcLayer + + \ref DSL_BF_EfmTcConfig_t nEfmTcConfigUs (hex) + + \ref DSL_BF_EfmTcConfig_t nEfmTcConfigDs (hex) + + \ref DSL_SystemInterfaceSelection_t nSystemIf + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_SystemInterfaceStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_SystemInterfaceStatus_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_SYSTEM_INTERFACE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nTcLayer=%d nEfmTcConfigUs=0x%x nEfmTcConfigDs=0x%x nSystemIf=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nTcLayer, pData.data.nEfmTcConfigUs, pData.data.nEfmTcConfigDs, pData.data.nSystemIf); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_SYSTEM_INTERFACE) */ + +static const DSL_char_t g_sIsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bEventActivation" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_BF_ResourceActivationType_t nResourceActivationMask" DSL_CPE_CRLF + " DSL_RESOURCE_ACTIVATION_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_RESOURCE_ACTIVATION_SNMP = 0x00000001" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_INSTANCE_STATUS_GET + + Long Form: InstanceStatusGet + + Short Form: isg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_boolean_t bEventActivation + + \ref DSL_BF_ResourceActivationType_t nResourceActivationMask + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_InstanceStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_InstanceStatus_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_INSTANCE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"bEventActivation=%d nResourceActivationMask=0x%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.bEventActivation, pData.data.nResourceActivationMask); + } + + return 0; +} + +#if defined(INCLUDE_DSL_CPE_MISC_LINE_STATUS) + +static const DSL_char_t g_sMlsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_MiscLineStatusSelector_t nStatusSelector" DSL_CPE_CRLF + " DSL_MLS_ATTNDR_CODING_GAIN_DS = 0" DSL_CPE_CRLF + " DSL_MLS_ATTNDR_MAX_BITS_PER_SYMBOL_DS = 1" DSL_CPE_CRLF + " DSL_MLS_DUAL_LATENCY_ON_US = 2" DSL_CPE_CRLF + " DSL_MLS_DUAL_LATENCY_ON_DS = 3" DSL_CPE_CRLF + " DSL_MLS_INIT_SNR_DS = 4" DSL_CPE_CRLF + " DSL_MLS_NOMPSD_US = 5" DSL_CPE_CRLF + " DSL_MLS_NOMPSD_DS = 6" DSL_CPE_CRLF + " DSL_MLS_LINE_RATE_US = 7" DSL_CPE_CRLF + " DSL_MLS_LINE_RATE_DS = 8" DSL_CPE_CRLF + " DSL_MLS_NET_RATE_US = 9" DSL_CPE_CRLF + " DSL_MLS_NET_RATE_DS = 10" DSL_CPE_CRLF + " DSL_MLS_TOTAL_DATA_RATE_US = 11" DSL_CPE_CRLF + " DSL_MLS_TOTAL_DATA_RATE_DS = 12" DSL_CPE_CRLF + " DSL_MLS_AGGREGATE_DATA_RATE_US = 13" DSL_CPE_CRLF + " DSL_MLS_AGGREGATE_DATA_RATE_DS = 14" DSL_CPE_CRLF + " DSL_MLS_MIN_INP_IP_LP0_DS = 15" DSL_CPE_CRLF + " DSL_MLS_MIN_INP_FP_LP1_DS = 16" DSL_CPE_CRLF + " DSL_MLS_ATT_AGGREGATE_DATA_RATE_US = 17" DSL_CPE_CRLF + " DSL_MLS_ATT_AGGREGATE_DATA_RATE_DS = 18" DSL_CPE_CRLF + " DSL_MLS_ATT_LINE_DATA_RATE_US = 19" DSL_CPE_CRLF + " DSL_MLS_ATT_LINE_DATA_RATE_DS = 20" DSL_CPE_CRLF + " DSL_MLS_ATT_TOTAL_DATA_RATE_US = 21" DSL_CPE_CRLF + " DSL_MLS_ATT_TOTAL_DATA_RATE_DS = 22" DSL_CPE_CRLF + " DSL_MLS_MASK_ANNEX_M_J_US = 23" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_int32_t nStatusValue" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_MISC_LINE_STATUS_GET + + Long Form: MiscLineStatusGet + + Short Form: mlsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_MiscLineStatusSelector_t nStatusSelector + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_int32_t nStatusValue + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MiscLineStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_MiscLineStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.nStatusSelector); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MISC_LINE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nStatusValue=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nStatusValue); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_CPE_MISC_LINE_STATUS) */ + +static const DSL_char_t g_sLocs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_LineOptionsSelector_t nConfigSelector" DSL_CPE_CRLF + " DSL_OPT_NOISE_MARGIN_DELTA_DS = 0" DSL_CPE_CRLF + " DSL_ERASURE_DECODING_TYPE_DS = 1" DSL_CPE_CRLF + " DSL_TRUST_ME_BIT = 2" DSL_CPE_CRLF + " DSL_INBAND_SPECTRAL_SHAPING_US = 3" DSL_CPE_CRLF + "- DSL_int32_t nConfigValue" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_LINE_OPTIONS_CONFIG_SET + + Long Form: LineOptionsConfigSet + + Short Form: locs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_LineOptionsSelector_t nConfigSelector + + \ref DSL_int32_t nConfigValue + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineOptionsConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineOptionsConfig_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d", &pData.data.nConfigSelector, &pData.data.nConfigValue); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_OPTIONS_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#if defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sLocg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_LineOptionsSelector_t nConfigSelector" DSL_CPE_CRLF + " DSL_OPT_NOISE_MARGIN_DELTA_DS = 0" DSL_CPE_CRLF + " DSL_ERASURE_DECODING_TYPE_DS = 1" DSL_CPE_CRLF + " DSL_TRUST_ME_BIT = 2" DSL_CPE_CRLF + " DSL_INBAND_SPECTRAL_SHAPING_US = 3" DSL_CPE_CRLF + "- DSL_int32_t nConfigValue" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_LINE_OPTIONS_CONFIG_GET + + Long Form: LineOptionsConfigGet + + Short Form: locg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_LineOptionsSelector_t nConfigSelector + + \ref DSL_int32_t nConfigValue + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LineOptionsConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LineOptionsConfig_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LINE_OPTIONS_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nConfigSelector=%d nConfigValue=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nConfigSelector, pData.data.nConfigValue); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + +static const DSL_char_t g_sG997lacs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_G997_LDSF_t nLDSF" DSL_CPE_CRLF + " DSL_G997_INHIBIT_LDSF = 0" DSL_CPE_CRLF + " DSL_G997_FORCE_LDSF = 1" DSL_CPE_CRLF + " DSL_G997_AUTO_LDSF = 2" DSL_CPE_CRLF + "- DSL_G997_ACSF_t nACSF" DSL_CPE_CRLF + " DSL_G997_INHIBIT_ACSF = 0" DSL_CPE_CRLF + " DSL_G997_FORCE_ACSF = 1" DSL_CPE_CRLF + "- DSL_G997_StartupMode_t nStartupMode" DSL_CPE_CRLF + " DSL_G997_NORMAL_STARTUP = 0" DSL_CPE_CRLF + " DSL_G997_FORCE_SHORT_STARTUP = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_LINE_ACTIVATE_CONFIG_SET + + Long Form: G997_LineActivateConfigSet + + Short Form: g997lacs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_G997_LDSF_t nLDSF + + \ref DSL_G997_ACSF_t nACSF + + \ref DSL_G997_StartupMode_t nStartupMode + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997LineActivateConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineActivate_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d %d", &pData.data.nLDSF, &pData.data.nACSF, &pData.data.nStartupMode); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_ACTIVATE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#if defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sG997lacg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_G997_LDSF_t nLDSF" DSL_CPE_CRLF + " DSL_G997_INHIBIT_LDSF = 0" DSL_CPE_CRLF + " DSL_G997_FORCE_LDSF = 1" DSL_CPE_CRLF + " DSL_G997_AUTO_LDSF = 2" DSL_CPE_CRLF + "- DSL_G997_ACSF_t nACSF" DSL_CPE_CRLF + " DSL_G997_INHIBIT_ACSF = 0" DSL_CPE_CRLF + " DSL_G997_FORCE_ACSF = 1" DSL_CPE_CRLF + "- DSL_G997_StartupMode_t nStartupMode" DSL_CPE_CRLF + " DSL_G997_NORMAL_STARTUP = 0" DSL_CPE_CRLF + " DSL_G997_FORCE_SHORT_STARTUP = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_LINE_ACTIVATE_CONFIG_GET + + Long Form: G997_LineActivateConfigGet + + Short Form: g997lacg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_G997_LDSF_t nLDSF + + \ref DSL_G997_ACSF_t nACSF + + \ref DSL_G997_StartupMode_t nStartupMode + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997LineActivateConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineActivate_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_ACTIVATE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nLDSF=%d nACSF=%d nStartupMode=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nLDSF, pData.data.nACSF, pData.data.nStartupMode); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + +#if defined(INCLUDE_DSL_G997_ALARM) + +static const DSL_char_t g_sG997cdrtcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdUpshift" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdDownshift" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_CHANNEL_DATA_RATE_THRESHOLD_CONFIG_SET + + Long Form: G997_ChannelDataRateThresholdConfigSet + + Short Form: g997cdrtcs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + \ref DSL_uint32_t nDataRateThresholdUpshift + + \ref DSL_uint32_t nDataRateThresholdDownshift + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997ChannelDataRateThresholdConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_ChannelDataRateThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u %u", &pData.nChannel, &pData.nDirection, &pData.data.nDataRateThresholdUpshift, &pData.data.nDataRateThresholdDownshift); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_CHANNEL_DATA_RATE_THRESHOLD_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_ALARM) */ + +#if defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sG997cdrtcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdUpshift" DSL_CPE_CRLF + "- DSL_uint32_t nDataRateThresholdDownshift" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_CHANNEL_DATA_RATE_THRESHOLD_CONFIG_GET + + Long Form: G997_ChannelDataRateThresholdConfigGet + + Short Form: g997cdrtcg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + \ref DSL_uint32_t nDataRateThresholdUpshift + + \ref DSL_uint32_t nDataRateThresholdDownshift + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997ChannelDataRateThresholdConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_ChannelDataRateThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_CHANNEL_DATA_RATE_THRESHOLD_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nDataRateThresholdUpshift=%u nDataRateThresholdDownshift=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nDataRateThresholdUpshift, pData.data.nDataRateThresholdDownshift); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) */ + +static const DSL_char_t g_sG997ltsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_G997_LineTransmission_t nLineTransmissionStatus" DSL_CPE_CRLF + " DSL_G997_LINE_TRANSMISSION_AVAILABLE = 0" DSL_CPE_CRLF + " DSL_G997_LINE_TRANSMISSION_NOT_AVAILABLE = 1" DSL_CPE_CRLF + " DSL_G997_LINE_TRANSMISSION_NOT_SUPPORTED = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_LINE_TRANSMISSION_STATUS_GET + + Long Form: G997_LineTransmissionStatusGet + + Short Form: g997ltsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_G997_LineTransmission_t nLineTransmissionStatus + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997LineTransmissionStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineTransmissionStatus_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_TRANSMISSION_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nLineTransmissionStatus=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nLineTransmissionStatus); + } + + return 0; +} + +#if defined(INCLUDE_DSL_G997_STATUS) + +static const DSL_char_t g_sG997lisg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_G997_LineInit_t nLineInitStatus" DSL_CPE_CRLF + " LINIT_SUCCESSFUL = 0" DSL_CPE_CRLF + " LINIT_CONFIG_ERROR = 1" DSL_CPE_CRLF + " LINIT_CONFIG_NOT_FEASIBLE = 2" DSL_CPE_CRLF + " LINIT_COMMUNICATION_PROBLEM = 3" DSL_CPE_CRLF + " LINIT_NO_PEER_XTU = 4" DSL_CPE_CRLF + " LINIT_UNKNOWN = 5" DSL_CPE_CRLF + "- DSL_G997_LineInitSubStatus_t nLineInitSubStatus" DSL_CPE_CRLF + " LINIT_SUB_NONE = 0" DSL_CPE_CRLF + " LINIT_SUB_UNKNOWN = 1" DSL_CPE_CRLF + " LINIT_SUB_NO_COMMON_MODE = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_LINE_INIT_STATUS_GET + + Long Form: G997_LineInitStatusGet + + Short Form: g997lisg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_G997_LineInit_t nLineInitStatus + + \ref DSL_G997_LineInitSubStatus_t nLineInitSubStatus + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997LineInitStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineInitStatus_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_INIT_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nLineInitStatus=%d nLineInitSubStatus=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nLineInitStatus, pData.data.nLineInitSubStatus); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_STATUS) */ + +static const DSL_char_t g_sG997lsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " DSL_DELT_DATA_DIAGNOSTICS = 0" DSL_CPE_CRLF + " DSL_DELT_DATA_SHOWTIME = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_int16_t LATN" DSL_CPE_CRLF + "- DSL_int16_t SATN" DSL_CPE_CRLF + "- DSL_int16_t SNR" DSL_CPE_CRLF + "- DSL_uint32_t ATTNDR" DSL_CPE_CRLF + "- DSL_int16_t ACTPS" DSL_CPE_CRLF + "- DSL_int16_t ACTATP" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_LINE_STATUS_GET + + Long Form: G997_LineStatusGet + + Short Form: g997lsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_DeltDataType_t nDeltDataType + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_int16_t LATN + + \ref DSL_int16_t SATN + + \ref DSL_int16_t SNR + + \ref DSL_uint32_t ATTNDR + + \ref DSL_int16_t ACTPS + + \ref DSL_int16_t ACTATP + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997LineStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d", &pData.nDirection, &pData.nDeltDataType); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d LATN=%hd SATN=%hd SNR=%hd ATTNDR=%u ACTPS=%hd ACTATP=%hd" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.LATN, pData.data.SATN, pData.data.SNR, pData.data.ATTNDR, pData.data.ACTPS, pData.data.ACTATP); + } + + return 0; +} + + +static const DSL_char_t g_sG997csg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint32_t ActualDataRate" DSL_CPE_CRLF + "- DSL_uint32_t PreviousDataRate" DSL_CPE_CRLF + "- DSL_uint32_t ActualInterleaveDelay" DSL_CPE_CRLF + "- DSL_uint8_t ActualImpulseNoiseProtection" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_CHANNEL_STATUS_GET + + Long Form: G997_ChannelStatusGet + + Short Form: g997csg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + \ref DSL_uint32_t ActualDataRate + + \ref DSL_uint32_t PreviousDataRate + + \ref DSL_uint32_t ActualInterleaveDelay + + \ref DSL_uint8_t ActualImpulseNoiseProtection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997ChannelStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_ChannelStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_CHANNEL_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d ActualDataRate=%u PreviousDataRate=%u ActualInterleaveDelay=%u ActualImpulseNoiseProtection=%hu" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.ActualDataRate, pData.data.PreviousDataRate, pData.data.ActualInterleaveDelay, pData.data.ActualImpulseNoiseProtection); + } + + return 0; +} + + +static const DSL_char_t g_sG997pmsft[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_G997_PowerManagementStateForce_t nPowerManagementState" DSL_CPE_CRLF + " DSL_G997_PMSF_L3_TO_L0 = 0" DSL_CPE_CRLF + " DSL_G997_PMSF_L0_TO_L2 = 2" DSL_CPE_CRLF + " DSL_G997_PMSF_LX_TO_L3 = 3" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_POWER_MANAGEMENT_STATE_FORCED_TRIGGER + + Long Form: G997_PowerManagementStateForcedTrigger + + Short Form: g997pmsft + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_G997_PowerManagementStateForce_t nPowerManagementState + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997PowerManagementStateForcedTrigger( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_PowerManagementStateForcedTrigger_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.nPowerManagementState); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_POWER_MANAGEMENT_STATE_FORCED_TRIGGER, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sG997pmsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_G997_PowerManagement_t nPowerManagementStatus" DSL_CPE_CRLF + " DSL_G997_PMS_NA = -1" DSL_CPE_CRLF + " DSL_G997_PMS_L0 = 0" DSL_CPE_CRLF + " DSL_G997_PMS_L1 = 1" DSL_CPE_CRLF + " DSL_G997_PMS_L2 = 2" DSL_CPE_CRLF + " DSL_G997_PMS_L3 = 3" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_POWER_MANAGEMENT_STATUS_GET + + Long Form: G997_PowerManagementStatusGet + + Short Form: g997pmsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_G997_PowerManagement_t nPowerManagementStatus + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997PowerManagementStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_PowerManagementStatus_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_POWER_MANAGEMENT_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nPowerManagementStatus=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nPowerManagementStatus); + } + + return 0; +} + +#if defined(INCLUDE_DSL_G997_STATUS) + +static const DSL_char_t g_sG997lstg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint16_t nLastStateTransmitted" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_LAST_STATE_TRANSMITTED_GET + + Long Form: G997_LastStateTransmittedGet + + Short Form: g997lstg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_uint16_t nLastStateTransmitted + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997LastStateTransmittedGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LastStateTransmitted_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LAST_STATE_TRANSMITTED_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nLastStateTransmitted=%hu" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nLastStateTransmitted); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_STATUS) */ + +#if defined(INCLUDE_DSL_G997_ALARM) + +static const DSL_char_t g_sG997amlfcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_G997_BF_LineFailures_t nLineFailures" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LPR = 0x00000001" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOF = 0x00000002" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOS = 0x00000004" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOM = 0x00000008" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOL = 0x00000010" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_ESE = 0x00000020" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_ALARM_MASK_LINE_FAILURES_CONFIG_SET + + Long Form: G997_AlarmMaskLineFailuresConfigSet + + Short Form: g997amlfcs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_G997_BF_LineFailures_t nLineFailures + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997AlarmMaskLineFailuresConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineFailures_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d", &pData.nDirection, &pData.data.nLineFailures); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_LINE_FAILURES_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_ALARM) */ + +#if defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sG997amlfcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_G997_BF_LineFailures_t nLineFailures" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LPR = 0x00000001" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOF = 0x00000002" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOS = 0x00000004" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOM = 0x00000008" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOL = 0x00000010" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_ESE = 0x00000020" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_ALARM_MASK_LINE_FAILURES_CONFIG_GET + + Long Form: G997_AlarmMaskLineFailuresConfigGet + + Short Form: g997amlfcg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_G997_BF_LineFailures_t nLineFailures + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997AlarmMaskLineFailuresConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineFailures_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_LINE_FAILURES_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nLineFailures=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nLineFailures); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) */ + +static const DSL_char_t g_sG997lfsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_G997_BF_LineFailures_t nLineFailures" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LPR = 0x00000001" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOF = 0x00000002" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOS = 0x00000004" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOM = 0x00000008" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_LOL = 0x00000010" DSL_CPE_CRLF + " DSL_G997_LINEFAILURE_ESE = 0x00000020" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_LINE_FAILURES_STATUS_GET + + Long Form: G997_LineFailuresStatusGet + + Short Form: g997lfsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_G997_BF_LineFailures_t nLineFailures + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997LineFailuresStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineFailures_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_FAILURES_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nLineFailures=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nLineFailures); + } + + return 0; +} + +#if defined(INCLUDE_DSL_G997_ALARM) + +static const DSL_char_t g_sG997amdpfcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex)" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_NCD = 0x00000001" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_LCD = 0x00000002" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_OOS = 0x00000004" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_ALARM_MASK_DATA_PATH_FAILURES_CONFIG_SET + + Long Form: G997_AlarmMaskDataPathFailuresConfigSet + + Short Form: g997amdpfcs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997AlarmMaskDataPathFailuresConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DataPathFailures_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %x", &pData.nChannel, &pData.nDirection, &pData.data.nDataPathFailures); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_DATA_PATH_FAILURES_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_ALARM) */ + +#if defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sG997amdpfcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex)" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_NCD = 0x00000001" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_LCD = 0x00000002" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_OOS = 0x00000004" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_ALARM_MASK_DATA_PATH_FAILURES_CONFIG_GET + + Long Form: G997_AlarmMaskDataPathFailuresConfigGet + + Short Form: g997amdpfcg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997AlarmMaskDataPathFailuresConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DataPathFailures_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ALARM_MASK_DATA_PATH_FAILURES_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nDataPathFailures=0x%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nDataPathFailures); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) */ + +static const DSL_char_t g_sG997dpfsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex)" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_CLEANED = 0x00000000" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_NCD = 0x00000001" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_LCD = 0x00000002" DSL_CPE_CRLF + " DSL_G997_DATAPATHFAILURE_OOS = 0x00000004" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_DATA_PATH_FAILURES_STATUS_GET + + Long Form: G997_DataPathFailuresStatusGet + + Short Form: g997dpfsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_G997_BF_DataPathFailures_t nDataPathFailures (hex) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997DataPathFailuresStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DataPathFailures_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DATA_PATH_FAILURES_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nDataPathFailures=0x%x" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nDataPathFailures); + } + + return 0; +} + +#if defined(INCLUDE_DSL_G997_FRAMING_PARAMETERS) + +static const DSL_char_t g_sG997fpsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint16_t nNFEC" DSL_CPE_CRLF + "- DSL_uint16_t nRFEC" DSL_CPE_CRLF + "- DSL_uint16_t nLSYMB" DSL_CPE_CRLF + "- DSL_uint16_t nINTLVDEPTH" DSL_CPE_CRLF + "- DSL_uint16_t nINTLVBLOCK" DSL_CPE_CRLF + "- DSL_uint8_t nLPATH" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_FRAMING_PARAMETER_STATUS_GET + + Long Form: G997_FramingParameterStatusGet + + Short Form: g997fpsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_AccessDir_t nDirection + + \ref DSL_uint16_t nNFEC + + \ref DSL_uint16_t nRFEC + + \ref DSL_uint16_t nLSYMB + + \ref DSL_uint16_t nINTLVDEPTH + + \ref DSL_uint16_t nINTLVBLOCK + + \ref DSL_uint8_t nLPATH + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997FramingParameterStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_FramingParameterStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_FRAMING_PARAMETER_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nNFEC=%hu nRFEC=%hu nLSYMB=%hu nINTLVDEPTH=%hu nINTLVBLOCK=%hu nLPATH=%hu" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nNFEC, pData.data.nRFEC, pData.data.nLSYMB, pData.data.nINTLVDEPTH, pData.data.nINTLVBLOCK, pData.data.nLPATH); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_G997_FRAMING_PARAMETERS) */ + +#if defined(INCLUDE_DSL_DELT) + +static const DSL_char_t g_sG997dhsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_DeltDataType_t nDeltDataType" DSL_CPE_CRLF + " DSL_DELT_DATA_DIAGNOSTICS = 0" DSL_CPE_CRLF + " DSL_DELT_DATA_SHOWTIME = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_uint16_t nDeltHlinScale" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_DELT_HLIN_SCALE_GET + + Long Form: G997_DeltHlinScaleGet + + Short Form: g997dhsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_DeltDataType_t nDeltDataType + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_uint16_t nDeltHlinScale + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997DeltHlinScaleGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DeltHlinScale_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d", &pData.nDirection, &pData.nDeltDataType); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_HLIN_SCALE_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nDeltHlinScale=%hu" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nDeltHlinScale); + } + + return 0; +} + + +static const DSL_char_t g_sG997dfr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_DELT_FREE_RESOURCES + + Long Form: G997_DeltFreeResources + + Short Form: g997dfr + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997DeltFreeResources( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_DeltFreeResources_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_DELT_FREE_RESOURCES, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_DELT) */ + +static const DSL_char_t g_sG997racs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_G997_RA_MODE_t RA_MODE" DSL_CPE_CRLF + " DSL_G997_RA_MODE_AT_INIT = 2" DSL_CPE_CRLF + " DSL_G997_RA_MODE_DYNAMIC = 3" DSL_CPE_CRLF + " DSL_G997_RA_MODE_DYNAMIC_SOS = 4" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_RATE_ADAPTATION_CONFIG_SET + + Long Form: G997_RateAdaptationConfigSet + + Short Form: g997racs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_G997_RA_MODE_t RA_MODE + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997RateAdaptationConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_RateAdaptationConfig_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d", &pData.nDirection, &pData.data.RA_MODE); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_RATE_ADAPTATION_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} + +#if defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sG997racg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " DSL_UPSTREAM = 0" DSL_CPE_CRLF + " DSL_DOWNSTREAM = 1" DSL_CPE_CRLF + "- DSL_G997_RA_MODE_t RA_MODE" DSL_CPE_CRLF + " DSL_G997_RA_MODE_AT_INIT = 2" DSL_CPE_CRLF + " DSL_G997_RA_MODE_DYNAMIC = 3" DSL_CPE_CRLF + " DSL_G997_RA_MODE_DYNAMIC_SOS = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_G997_RATE_ADAPTATION_CONFIG_GET + + Long Form: G997_RateAdaptationConfigGet + + Short Form: g997racg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_AccessDir_t nDirection + + \ref DSL_G997_RA_MODE_t RA_MODE + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997RateAdaptationConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_RateAdaptationConfig_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_RATE_ADAPTATION_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d RA_MODE=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.RA_MODE); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmlshs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_HISTORY_STATS_15MIN_GET + + Long Form: PM_LineSecHistoryStats15MinGet + + Short Form: pmlshs15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +static const DSL_char_t g_sPmlshs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_HISTORY_STATS_1DAY_GET + + Long Form: PM_LineSecHistoryStats1DayGet + + Short Form: pmlshs1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + +static const DSL_char_t g_sPmlsc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_COUNTERS_15MIN_GET + + Long Form: PM_LineSecCounters15MinGet + + Short Form: pmlsc15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nES, pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, pData.data.nLOFS); + } + + return 0; +} + + +static const DSL_char_t g_sPmlsc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_COUNTERS_1DAY_GET + + Long Form: PM_LineSecCounters1DayGet + + Short Form: pmlsc1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nES, pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, pData.data.nLOFS); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + +static const DSL_char_t g_sPmlsctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_COUNTERS_TOTAL_GET + + Long Form: PM_LineSecCountersTotalGet + + Short Form: pmlsctg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCountersTotal_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nElapsedTime=%u bValid=%d nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.total.nElapsedTime, pData.total.bValid, pData.data.nES, pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, pData.data.nLOFS); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmlst15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_THRESHOLDS_15MIN_SET + + Long Form: PM_LineSecThresholds15MinSet + + Short Form: pmlst15ms + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 6, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u %u %u %u %u", &pData.nDirection, &pData.data.nES, &pData.data.nSES, &pData.data.nLOSS, &pData.data.nUAS, &pData.data.nLOFS); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} + + +static const DSL_char_t g_sPmlst1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_THRESHOLDS_1DAY_SET + + Long Form: PM_LineSecThresholds1DaySet + + Short Form: pmlst1ds + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 6, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u %u %u %u %u", &pData.nDirection, &pData.data.nES, &pData.data.nSES, &pData.data.nLOSS, &pData.data.nUAS, &pData.data.nLOFS); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} + + +static const DSL_char_t g_sPmlst15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_THRESHOLDS_15MIN_GET + + Long Form: PM_LineSecThresholds15MinGet + + Short Form: pmlst15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nES, pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, pData.data.nLOFS); + } + + return 0; +} + + +static const DSL_char_t g_sPmlst1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_THRESHOLDS_1DAY_GET + + Long Form: PM_LineSecThresholds1DayGet + + Short Form: pmlst1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nES, pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, pData.data.nLOFS); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmlihs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_HISTORY_STATS_15MIN_GET + + Long Form: PM_LineInitHistoryStats15MinGet + + Short Form: pmlihs15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStats_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +static const DSL_char_t g_sPmlihs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_HISTORY_STATS_1DAY_GET + + Long Form: PM_LineInitHistoryStats1DayGet + + Short Form: pmlihs1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStats_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + +static const DSL_char_t g_sPmlic15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_COUNTERS_15MIN_GET + + Long Form: PM_LineInitCounters15MinGet + + Short Form: pmlic15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u", &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nFullInits=%u nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nFullInits, pData.data.nFailedFullInits, pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} + + +static const DSL_char_t g_sPmlic1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_COUNTERS_1DAY_GET + + Long Form: PM_LineInitCounters1DayGet + + Short Form: pmlic1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u", &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nFullInits=%u nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nFullInits, pData.data.nFailedFullInits, pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + +static const DSL_char_t g_sPmlictg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_COUNTERS_TOTAL_GET + + Long Form: PM_LineInitCountersTotalGet + + Short Form: pmlictg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCountersTotal_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nElapsedTime=%u bValid=%d nFullInits=%u nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.total.nElapsedTime, pData.total.bValid, pData.data.nFullInits, pData.data.nFailedFullInits, pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmlit15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_THRESHOLDS_15MIN_SET + + Long Form: PM_LineInitThresholds15MinSet + + Short Form: pmlit15ms + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u %u %u %u", &pData.data.nFullInits, &pData.data.nFailedFullInits, &pData.data.nShortInits, &pData.data.nFailedShortInits); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sPmlit1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_THRESHOLDS_1DAY_SET + + Long Form: PM_LineInitThresholds1DaySet + + Short Form: pmlit1ds + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u %u %u %u", &pData.data.nFullInits, &pData.data.nFailedFullInits, &pData.data.nShortInits, &pData.data.nFailedShortInits); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sPmlit15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_THRESHOLDS_15MIN_GET + + Long Form: PM_LineInitThresholds15MinGet + + Short Form: pmlit15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nFullInits=%u nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nFullInits, pData.data.nFailedFullInits, pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} + + +static const DSL_char_t g_sPmlit1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_THRESHOLDS_1DAY_GET + + Long Form: PM_LineInitThresholds1DayGet + + Short Form: pmlit1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitThreshold_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nFullInits=%u nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nFullInits, pData.data.nFailedFullInits, pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmchs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_HISTORY_STATS_15MIN_GET + + Long Form: PM_ChannelHistoryStats15MinGet + + Short Form: pmchs15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +static const DSL_char_t g_sPmchs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_HISTORY_STATS_1DAY_GET + + Long Form: PM_ChannelHistoryStats1DayGet + + Short Form: pmchs1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + +static const DSL_char_t g_sPmcc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_COUNTERS_15MIN_GET + + Long Form: PM_ChannelCounters15MinGet + + Short Form: pmcc15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} + + +static const DSL_char_t g_sPmcc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_COUNTERS_1DAY_GET + + Long Form: PM_ChannelCounters1DayGet + + Short Form: pmcc1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + +static const DSL_char_t g_sPmcctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_COUNTERS_TOTAL_GET + + Long Form: PM_ChannelCountersTotalGet + + Short Form: pmcctg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCountersTotal_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nElapsedTime=%u bValid=%d nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.total.nElapsedTime, pData.total.bValid, pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmct15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_THRESHOLDS_15MIN_SET + + Long Form: PM_ChannelThresholds15MinSet + + Short Form: pmct15ms + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u %u", &pData.nChannel, &pData.nDirection, &pData.data.nCodeViolations, &pData.data.nFEC); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} + + +static const DSL_char_t g_sPmct1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_THRESHOLDS_1DAY_SET + + Long Form: PM_ChannelThresholds1DaySet + + Short Form: pmct1ds + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u %u", &pData.nChannel, &pData.nDirection, &pData.data.nCodeViolations, &pData.data.nFEC); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} + + +static const DSL_char_t g_sPmct15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_THRESHOLDS_15MIN_GET + + Long Form: PM_ChannelThresholds15MinGet + + Short Form: pmct15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} + + +static const DSL_char_t g_sPmct1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_THRESHOLDS_1DAY_GET + + Long Form: PM_ChannelThresholds1DayGet + + Short Form: pmct1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmdphs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_HISTORY_STATS_15MIN_GET + + Long Form: PM_DataPathHistoryStats15MinGet + + Short Form: pmdphs15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +static const DSL_char_t g_sPmdphs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_HISTORY_STATS_1DAY_GET + + Long Form: PM_DataPathHistoryStats1DayGet + + Short Form: pmdphs1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + +static const DSL_char_t g_sPmdpc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_COUNTERS_15MIN_GET + + Long Form: PM_DataPathCounters15MinGet + + Short Form: pmdpc15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nHEC=%u nTotalCells=%u nUserTotalCells=%u nIBE=%u nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u nTxUserTotalCells=%u nTxIBE=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, pData.data.nIBE, pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, pData.data.nCVP_P, pData.data.nTxUserTotalCells, pData.data.nTxIBE); + } + + return 0; +} + + +static const DSL_char_t g_sPmdpc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_COUNTERS_1DAY_GET + + Long Form: PM_DataPathCounters1DayGet + + Short Form: pmdpc1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nHEC=%u nTotalCells=%u nUserTotalCells=%u nIBE=%u nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u nTxUserTotalCells=%u nTxIBE=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, pData.data.nIBE, pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, pData.data.nCVP_P, pData.data.nTxUserTotalCells, pData.data.nTxIBE); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + +static const DSL_char_t g_sPmdpctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_COUNTERS_TOTAL_GET + + Long Form: PM_DataPathCountersTotalGet + + Short Form: pmdpctg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCountersTotal_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nElapsedTime=%u bValid=%d nHEC=%u nTotalCells=%u nUserTotalCells=%u nIBE=%u nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u nTxUserTotalCells=%u nTxIBE=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.total.nElapsedTime, pData.total.bValid, pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, pData.data.nIBE, pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, pData.data.nCVP_P, pData.data.nTxUserTotalCells, pData.data.nTxIBE); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmdpt15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_THRESHOLDS_15MIN_SET + + Long Form: PM_DataPathThresholds15MinSet + + Short Form: pmdpt15ms + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 12, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u %u %u %u %u %u %u %u %u %u", &pData.nChannel, &pData.nDirection, &pData.data.nHEC, &pData.data.nTotalCells, &pData.data.nUserTotalCells, &pData.data.nIBE, &pData.data.nCRC_P, &pData.data.nCRCP_P, &pData.data.nCV_P, &pData.data.nCVP_P, &pData.data.nTxUserTotalCells, &pData.data.nTxIBE); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} + + +static const DSL_char_t g_sPmdpt1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_THRESHOLDS_1DAY_SET + + Long Form: PM_DataPathThresholds1DaySet + + Short Form: pmdpt1ds + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 12, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u %u %u %u %u %u %u %u %u %u", &pData.nChannel, &pData.nDirection, &pData.data.nHEC, &pData.data.nTotalCells, &pData.data.nUserTotalCells, &pData.data.nIBE, &pData.data.nCRC_P, &pData.data.nCRCP_P, &pData.data.nCV_P, &pData.data.nCVP_P, &pData.data.nTxUserTotalCells, &pData.data.nTxIBE); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection); + } + + return 0; +} + + +static const DSL_char_t g_sPmdpt15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_THRESHOLDS_15MIN_GET + + Long Form: PM_DataPathThresholds15MinGet + + Short Form: pmdpt15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHEC=%u nTotalCells=%u nUserTotalCells=%u nIBE=%u nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u nTxUserTotalCells=%u nTxIBE=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, pData.data.nIBE, pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, pData.data.nCVP_P, pData.data.nTxUserTotalCells, pData.data.nTxIBE); + } + + return 0; +} + + +static const DSL_char_t g_sPmdpt1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_THRESHOLDS_1DAY_GET + + Long Form: PM_DataPathThresholds1DayGet + + Short Form: pmdpt1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHEC=%u nTotalCells=%u nUserTotalCells=%u nIBE=%u nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u nTxUserTotalCells=%u nTxIBE=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, pData.data.nIBE, pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, pData.data.nCVP_P, pData.data.nTxUserTotalCells, pData.data.nTxIBE); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPm15meet[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bOneDayElapsed" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_15MIN_ELAPSED_EXT_TRIGGER + + Long Form: PM_15MinElapsedExtTrigger + + Short Form: pm15meet + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_boolean_t bOneDayElapsed + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_15MinElapsedExtTrigger( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ElapsedExtTrigger_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.bOneDayElapsed); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_15MIN_ELAPSED_EXT_TRIGGER, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sPmetr[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_ELAPSED_TIME_RESET + + Long Form: PM_ElapsedTimeReset + + Short Form: pmetr + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ElapsedTimeReset( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ElapsedTimeReset_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_ELAPSED_TIME_RESET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sPmsms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_PM_SyncModeType_t nMode" DSL_CPE_CRLF + " DSL_PM_SYNC_MODE_FREE = 0" DSL_CPE_CRLF + " DSL_PM_SYNC_MODE_SYS_TIME = 1" DSL_CPE_CRLF + " DSL_PM_SYNC_MODE_EXTERNAL = 2" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_SYNC_MODE_SET + + Long Form: PM_SyncModeSet + + Short Form: pmsms + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_PM_SyncModeType_t nMode + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_SyncModeSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_SyncMode_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.data.nMode); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_SYNC_MODE_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sPmbms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bActivate" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPmTick" DSL_CPE_CRLF + "- DSL_uint32_t nPm15Min" DSL_CPE_CRLF + "- DSL_uint32_t nPm15MinPerDay" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_BURNIN_MODE_SET + + Long Form: PM_BurninModeSet + + Short Form: pmbms + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_boolean_t bActivate + + \ref DSL_uint32_t nPmTick + + \ref DSL_uint32_t nPm15Min + + \ref DSL_uint32_t nPm15MinPerDay + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_BurninModeSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_BurninMode_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 4, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u %u %u", &pData.data.bActivate, &pData.data.nMode.nPmTick, &pData.data.nMode.nPm15Min, &pData.data.nMode.nPm15MinPerDay); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_BURNIN_MODE_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + +static const DSL_char_t g_sPmlscsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nES" DSL_CPE_CRLF + "- DSL_uint32_t nSES" DSL_CPE_CRLF + "- DSL_uint32_t nLOSS" DSL_CPE_CRLF + "- DSL_uint32_t nUAS" DSL_CPE_CRLF + "- DSL_uint32_t nLOFS" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_SEC_COUNTERS_SHOWTIME_GET + + Long Form: PM_LineSecCountersShowtimeGet + + Short Form: pmlscsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nES + + \ref DSL_uint32_t nSES + + \ref DSL_uint32_t nLOSS + + \ref DSL_uint32_t nUAS + + \ref DSL_uint32_t nLOFS + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineSecCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineSecCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_SEC_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nES=%u nSES=%u nLOSS=%u nUAS=%u nLOFS=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nES, pData.data.nSES, pData.data.nLOSS, pData.data.nUAS, pData.data.nLOFS); + } + + return 0; +} + + +static const DSL_char_t g_sPmlicsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedFullInits" DSL_CPE_CRLF + "- DSL_uint32_t nShortInits" DSL_CPE_CRLF + "- DSL_uint32_t nFailedShortInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_INIT_COUNTERS_SHOWTIME_GET + + Long Form: PM_LineInitCountersShowtimeGet + + Short Form: pmlicsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nFullInits + + \ref DSL_uint32_t nFailedFullInits + + \ref DSL_uint32_t nShortInits + + \ref DSL_uint32_t nFailedShortInits + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineInitCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineInitCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u", &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_INIT_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nFullInits=%u nFailedFullInits=%u nShortInits=%u nFailedShortInits=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nFullInits, pData.data.nFailedFullInits, pData.data.nShortInits, pData.data.nFailedShortInits); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + +static const DSL_char_t g_sPmccsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nCodeViolations" DSL_CPE_CRLF + "- DSL_uint32_t nFEC" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CHANNEL_COUNTERS_SHOWTIME_GET + + Long Form: PM_ChannelCountersShowtimeGet + + Short Form: pmccsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nCodeViolations + + \ref DSL_uint32_t nFEC + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ChannelCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ChannelCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CHANNEL_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nCodeViolations=%u nFEC=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nCodeViolations, pData.data.nFEC); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + +static const DSL_char_t g_sPmdpcsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHEC" DSL_CPE_CRLF + "- DSL_uint32_t nTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nIBE" DSL_CPE_CRLF + "- DSL_uint32_t nCRC_P" DSL_CPE_CRLF + "- DSL_uint32_t nCRCP_P" DSL_CPE_CRLF + "- DSL_uint32_t nCV_P" DSL_CPE_CRLF + "- DSL_uint32_t nCVP_P" DSL_CPE_CRLF + "- DSL_uint32_t nTxUserTotalCells" DSL_CPE_CRLF + "- DSL_uint32_t nTxIBE" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_COUNTERS_SHOWTIME_GET + + Long Form: PM_DataPathCountersShowtimeGet + + Short Form: pmdpcsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nHEC + + \ref DSL_uint32_t nTotalCells + + \ref DSL_uint32_t nUserTotalCells + + \ref DSL_uint32_t nIBE + + \ref DSL_uint32_t nCRC_P + + \ref DSL_uint32_t nCRCP_P + + \ref DSL_uint32_t nCV_P + + \ref DSL_uint32_t nCVP_P + + \ref DSL_uint32_t nTxUserTotalCells + + \ref DSL_uint32_t nTxIBE + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nHEC=%u nTotalCells=%u nUserTotalCells=%u nIBE=%u nCRC_P=%u nCRCP_P=%u nCV_P=%u nCVP_P=%u nTxUserTotalCells=%u nTxIBE=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nHEC, pData.data.nTotalCells, pData.data.nUserTotalCells, pData.data.nIBE, pData.data.nCRC_P, pData.data.nCRCP_P, pData.data.nCV_P, pData.data.nCVP_P, pData.data.nTxUserTotalCells, pData.data.nTxIBE); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) && defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sPmcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bNePollingOff" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bFePollingOff" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint8_t nBasicUpdateCycle" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactor" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactorL2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CONFIG_GET + + Long Form: PM_ConfigGet + + Short Form: pmcg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_boolean_t bNePollingOff + + \ref DSL_boolean_t bFePollingOff + + \ref DSL_uint8_t nBasicUpdateCycle + + \ref DSL_uint8_t nFeUpdateCycleFactor + + \ref DSL_uint8_t nFeUpdateCycleFactorL2 + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_Config_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"bNePollingOff=%d bFePollingOff=%d nBasicUpdateCycle=%hu nFeUpdateCycleFactor=%hu nFeUpdateCycleFactorL2=%hu" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.bNePollingOff, pData.data.bFePollingOff, pData.data.nBasicUpdateCycle, pData.data.nFeUpdateCycleFactor, pData.data.nFeUpdateCycleFactorL2); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) && defined(INCLUDE_DSL_CONFIG_GET) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) + +static const DSL_char_t g_sPmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_boolean_t bNePollingOff" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_boolean_t bFePollingOff" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint8_t nBasicUpdateCycle" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactor" DSL_CPE_CRLF + "- DSL_uint8_t nFeUpdateCycleFactorL2" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_CONFIG_SET + + Long Form: PM_ConfigSet + + Short Form: pmcs + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_boolean_t bNePollingOff + + \ref DSL_boolean_t bFePollingOff + + \ref DSL_uint8_t nBasicUpdateCycle + + \ref DSL_uint8_t nFeUpdateCycleFactor + + \ref DSL_uint8_t nFeUpdateCycleFactorL2 + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_ConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_Config_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 5, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %d %hhu %hhu %hhu", &pData.data.bNePollingOff, &pData.data.bFePollingOff, &pData.data.nBasicUpdateCycle, &pData.data.nFeUpdateCycleFactor, &pData.data.nFeUpdateCycleFactorL2); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + +static const DSL_char_t g_sPmlesc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_15MIN_GET + + Long Form: PM_LineEventShowtimeCounters15MinGet + + Short Form: pmlesc15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nLOS + + \ref DSL_uint32_t nLOF + + \ref DSL_uint32_t nLPR + + \ref DSL_uint32_t nLOM + + \ref DSL_uint32_t nSosSuccess + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nLOS=%u nLOF=%u nLPR=%u nLOM=%u nSosSuccess=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nLOS, pData.data.nLOF, pData.data.nLPR, pData.data.nLOM, pData.data.nSosSuccess); + } + + return 0; +} + + +static const DSL_char_t g_sPmlesc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_1DAY_GET + + Long Form: PM_LineEventShowtimeCounters1DayGet + + Short Form: pmlesc1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nLOS + + \ref DSL_uint32_t nLOF + + \ref DSL_uint32_t nLPR + + \ref DSL_uint32_t nLOM + + \ref DSL_uint32_t nSosSuccess + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nLOS=%u nLOF=%u nLPR=%u nLOM=%u nSosSuccess=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nLOS, pData.data.nLOF, pData.data.nLPR, pData.data.nLOM, pData.data.nSosSuccess); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + +static const DSL_char_t g_sPmlescsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_SHOWTIME_GET + + Long Form: PM_LineEventShowtimeCountersShowtimeGet + + Short Form: pmlescsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nLOS + + \ref DSL_uint32_t nLOF + + \ref DSL_uint32_t nLPR + + \ref DSL_uint32_t nLOM + + \ref DSL_uint32_t nSosSuccess + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nLOS=%u nLOF=%u nLPR=%u nLOM=%u nSosSuccess=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nLOS, pData.data.nLOF, pData.data.nLPR, pData.data.nLOM, pData.data.nSosSuccess); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + +static const DSL_char_t g_sPmlesctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nLOS" DSL_CPE_CRLF + "- DSL_uint32_t nLOF" DSL_CPE_CRLF + "- DSL_uint32_t nLPR" DSL_CPE_CRLF + "- DSL_uint32_t nLOM" DSL_CPE_CRLF + "- DSL_uint32_t nSosSuccess" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_TOTAL_GET + + Long Form: PM_LineEventShowtimeCountersTotalGet + + Short Form: pmlesctg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nLOS + + \ref DSL_uint32_t nLOF + + \ref DSL_uint32_t nLPR + + \ref DSL_uint32_t nLOM + + \ref DSL_uint32_t nSosSuccess + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_LineEventShowtimeCountersTotal_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nElapsedTime=%u bValid=%d nLOS=%u nLOF=%u nLPR=%u nLOM=%u nSosSuccess=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.total.nElapsedTime, pData.total.bValid, pData.data.nLOS, pData.data.nLOF, pData.data.nLPR, pData.data.nLOM, pData.data.nSosSuccess); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmleshs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_EVENT_SHOWTIME_HISTORY_STATS_15MIN_GET + + Long Form: PM_LineEventShowtimeHistoryStats15MinGet + + Short Form: pmleshs15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +static const DSL_char_t g_sPmleshs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_LINE_EVENT_SHOWTIME_HISTORY_STATS_1DAY_GET + + Long Form: PM_LineEventShowtimeHistoryStats1DayGet + + Short Form: pmleshs1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_LINE_EVENT_SHOWTIME_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + +static const DSL_char_t g_sPmdpfc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_15MIN_GET + + Long Form: PM_DataPathFailureCounters15MinGet + + Short Form: pmdpfc15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nNCD + + \ref DSL_uint32_t nLCD + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nNCD=%u nLCD=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nNCD, pData.data.nLCD); + } + + return 0; +} + + +static const DSL_char_t g_sPmdpfc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_1DAY_GET + + Long Form: PM_DataPathFailureCounters1DayGet + + Short Form: pmdpfc1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nNCD + + \ref DSL_uint32_t nLCD + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nNCD=%u nLCD=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nNCD, pData.data.nLCD); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + +static const DSL_char_t g_sPmdpfcsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_SHOWTIME_GET + + Long Form: PM_DataPathFailureCountersShowtimeGet + + Short Form: pmdpfcsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nNCD + + \ref DSL_uint32_t nLCD + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d %u", &pData.nChannel, &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nNCD=%u nLCD=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nNCD, pData.data.nLCD); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + +static const DSL_char_t g_sPmdpfctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nNCD" DSL_CPE_CRLF + "- DSL_uint32_t nLCD" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_TOTAL_GET + + Long Form: PM_DataPathFailureCountersTotalGet + + Short Form: pmdpfctg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nNCD + + \ref DSL_uint32_t nLCD + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_DataPathFailureCountersTotal_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nElapsedTime=%u bValid=%d nNCD=%u nLCD=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.total.nElapsedTime, pData.total.bValid, pData.data.nNCD, pData.data.nLCD); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmdpfhs15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_FAILURE_HISTORY_STATS_15MIN_GET + + Long Form: PM_DataPathFailureHistoryStats15MinGet + + Short Form: pmdpfhs15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +static const DSL_char_t g_sPmdpfhs1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nChannel" DSL_CPE_CRLF + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_DATA_PATH_FAILURE_HISTORY_STATS_1DAY_GET + + Long Form: PM_DataPathFailureHistoryStats1DayGet + + Short Form: pmdpfhs1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_uint8_t nChannel + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_DataPathFailureHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsChDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%hhu %d", &pData.nChannel, &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_DATA_PATH_FAILURE_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nChannel=%hu nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nChannel, pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + +static const DSL_char_t g_sPmrtc15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_COUNTERS_15MIN_GET + + Long Form: PM_ReTxCounters15MinGet + + Short Form: pmrtc15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxCounters15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nRxCorruptedTotal=%u nRxUncorrectedProtected=%u nRxRetransmitted=%u nRxCorrected=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nRxCorruptedTotal, pData.data.nRxUncorrectedProtected, pData.data.nRxRetransmitted, pData.data.nRxCorrected); + } + + return 0; +} + + +static const DSL_char_t g_sPmrtc1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_COUNTERS_1DAY_GET + + Long Form: PM_ReTxCounters1DayGet + + Short Form: pmrtc1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxCounters1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nRxCorruptedTotal=%u nRxUncorrectedProtected=%u nRxRetransmitted=%u nRxCorrected=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nRxCorruptedTotal, pData.data.nRxUncorrectedProtected, pData.data.nRxRetransmitted, pData.data.nRxCorrected); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + +static const DSL_char_t g_sPmrtcsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nHistoryInterval" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_uint8_t nNumber" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_COUNTERS_SHOWTIME_GET + + Long Form: PM_ReTxCountersShowtimeGet + + Short Form: pmrtcsg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nHistoryInterval + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_uint8_t nNumber + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxCountersShowtimeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u", &pData.nDirection, &pData.nHistoryInterval); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_SHOWTIME_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nHistoryInterval=%u nElapsedTime=%u nNumber=%hu bValid=%d nRxCorruptedTotal=%u nRxUncorrectedProtected=%u nRxRetransmitted=%u nRxCorrected=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.nHistoryInterval, pData.interval.nElapsedTime, pData.interval.nNumber, pData.interval.bValid, pData.data.nRxCorruptedTotal, pData.data.nRxUncorrectedProtected, pData.data.nRxRetransmitted, pData.data.nRxCorrected); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + +static const DSL_char_t g_sPmrtctg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nElapsedTime" DSL_CPE_CRLF + "- DSL_boolean_t bValid" DSL_CPE_CRLF + " DSL_FALSE = 0" DSL_CPE_CRLF + " DSL_TRUE = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_COUNTERS_TOTAL_GET + + Long Form: PM_ReTxCountersTotalGet + + Short Form: pmrtctg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nElapsedTime + + \ref DSL_boolean_t bValid + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxCountersTotalGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxCountersTotal_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_COUNTERS_TOTAL_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nElapsedTime=%u bValid=%d nRxCorruptedTotal=%u nRxUncorrectedProtected=%u nRxRetransmitted=%u nRxCorrected=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.total.nElapsedTime, pData.total.bValid, pData.data.nRxCorruptedTotal, pData.data.nRxUncorrectedProtected, pData.data.nRxRetransmitted, pData.data.nRxCorrected); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmrths15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_HISTORY_STATS_15MIN_GET + + Long Form: PM_ReTxHistoryStats15MinGet + + Short Form: pmrths15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxHistoryStats15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_HISTORY_STATS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + + +static const DSL_char_t g_sPmrths1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nPrevIvs" DSL_CPE_CRLF + "- DSL_uint32_t nPrevInvalidIvs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_HISTORY_STATS_1DAY_GET + + Long Form: PM_ReTxHistoryStats1DayGet + + Short Form: pmrths1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nPrevIvs + + \ref DSL_uint32_t nPrevInvalidIvs + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxHistoryStats1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_HistoryStatsDir_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_HISTORY_STATS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nPrevIvs=%u nPrevInvalidIvs=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nPrevIvs, pData.data.nPrevInvalidIvs); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + +static const DSL_char_t g_sPmrtt15mg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_THRESHOLDS_15MIN_GET + + Long Form: PM_ReTxThresholds15MinGet + + Short Form: pmrtt15mg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxThresholds15MinGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_15MIN_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nRxCorruptedTotal=%u nRxUncorrectedProtected=%u nRxRetransmitted=%u nRxCorrected=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nRxCorruptedTotal, pData.data.nRxUncorrectedProtected, pData.data.nRxRetransmitted, pData.data.nRxCorrected); + } + + return 0; +} + + +static const DSL_char_t g_sPmrtt15ms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_THRESHOLDS_15MIN_SET + + Long Form: PM_ReTxThresholds15MinSet + + Short Form: pmrtt15ms + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxThresholds15MinSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 5, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u %u %u %u", &pData.nDirection, &pData.data.nRxCorruptedTotal, &pData.data.nRxUncorrectedProtected, &pData.data.nRxRetransmitted, &pData.data.nRxCorrected); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_15MIN_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} + + +static const DSL_char_t g_sPmrtt1dg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_THRESHOLDS_1DAY_GET + + Long Form: PM_ReTxThresholds1DayGet + + Short Form: pmrtt1dg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxThresholds1DayGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &pData.nDirection); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_1DAY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d nRxCorruptedTotal=%u nRxUncorrectedProtected=%u nRxRetransmitted=%u nRxCorrected=%u" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection, pData.data.nRxCorruptedTotal, pData.data.nRxUncorrectedProtected, pData.data.nRxRetransmitted, pData.data.nRxCorrected); + } + + return 0; +} + + +static const DSL_char_t g_sPmrtt1ds[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorruptedTotal" DSL_CPE_CRLF + "- DSL_uint32_t nRxUncorrectedProtected" DSL_CPE_CRLF + "- DSL_uint32_t nRxRetransmitted" DSL_CPE_CRLF + "- DSL_uint32_t nRxCorrected" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " DSL_NEAR_END = 0" DSL_CPE_CRLF + " DSL_FAR_END = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_RETX_THRESHOLDS_1DAY_SET + + Long Form: PM_ReTxThresholds1DaySet + + Short Form: pmrtt1ds + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + \ref DSL_uint32_t nRxCorruptedTotal + + \ref DSL_uint32_t nRxUncorrectedProtected + + \ref DSL_uint32_t nRxRetransmitted + + \ref DSL_uint32_t nRxCorrected + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_XTUDir_t nDirection + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_RetxThresholds1DaySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_ReTxThreshold_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 5, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d %u %u %u %u", &pData.nDirection, &pData.data.nRxCorruptedTotal, &pData.data.nRxUncorrectedProtected, &pData.data.nRxRetransmitted, &pData.data.nRxCorrected); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_RETX_THRESHOLDS_1DAY_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) && defined(INCLUDE_DSL_CONFIG_GET) + +static const DSL_char_t g_sPmsmg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DSL_ENTITIES > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_PM_SyncModeType_t nMode" DSL_CPE_CRLF + " DSL_PM_SYNC_MODE_FREE = 0" DSL_CPE_CRLF + " DSL_PM_SYNC_MODE_SYS_TIME = 1" DSL_CPE_CRLF + " DSL_PM_SYNC_MODE_EXTERNAL = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +/** + CLI command for IOCTL: \ref DSL_FIO_PM_SYNC_MODE_GET + + Long Form: PM_SyncModeGet + + Short Form: pmsmg + + Input Parameter + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + + Output Parameter + + \ref DSL_Error_t nReturn + + \ref DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode) + + \ref DSL_PM_SyncModeType_t nMode + + + \param fd - device file descriptor + \param pCommands - input CLI command parameter(s) + \param out - output CLI command parameter(s) + + \ingroup DSL_CPE_CLI +*/ +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_PM_SyncModeGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_PM_SyncMode_t pData; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_PM_SYNC_MODE_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nMode=%d" DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nMode); + } + + return 0; +} + +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) && defined(INCLUDE_DSL_CONFIG_GET) */ + +/** Register autogenerated commands */ + +DSL_void_t DSL_CPE_CLI_AutogenCommandsRegister (DSL_void_t) +{ + /* Common functionalities */ + DSL_CPE_CLI_CMD_ADD_COMM ("acs", "AutobootControlSet", DSL_CPE_CLI_AutobootControlSet, g_sAcs); + DSL_CPE_CLI_CMD_ADD_COMM ("asg", "AutobootStatusGet", DSL_CPE_CLI_AutobootStatusGet, g_sAsg); + DSL_CPE_CLI_CMD_ADD_COMM ("lsg", "LineStateGet", DSL_CPE_CLI_LineStateGet, g_sLsg); + DSL_CPE_CLI_CMD_ADD_COMM ("lfcs", "LineFeatureConfigSet", DSL_CPE_CLI_LineFeatureConfigSet, g_sLfcs); +#if defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("lfcg", "LineFeatureConfigGet", DSL_CPE_CLI_LineFeatureConfigGet, g_sLfcg); +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + DSL_CPE_CLI_CMD_ADD_COMM ("lfsg", "LineFeatureStatusGet", DSL_CPE_CLI_LineFeatureStatusGet, g_sLfsg); +#if defined(INCLUDE_DSL_FRAMING_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("fpsg", "FramingParameterStatusGet", DSL_CPE_CLI_FramingParameterStatusGet, g_sFpsg); +#endif /* defined(INCLUDE_DSL_FRAMING_PARAMETERS) */ + +#if !defined(DSL_CPE_DEBUG_DISABLE) + DSL_CPE_CLI_CMD_ADD_COMM ("dmls", "DbgModuleLevelSet", DSL_CPE_CLI_DBG_ModuleLevelSet, g_sDmls); + DSL_CPE_CLI_CMD_ADD_COMM ("dmlg", "DbgModuleLevelGet", DSL_CPE_CLI_DBG_ModuleLevelGet, g_sDmlg); +#endif /* !defined(DSL_CPE_DEBUG_DISABLE) */ + DSL_CPE_CLI_CMD_ADD_COMM ("tmcs", "TestModeControlSet", DSL_CPE_CLI_TestModeControlSet, g_sTmcs); +#if defined(INCLUDE_DSL_SYSTEM_INTERFACE) + DSL_CPE_CLI_CMD_ADD_COMM ("sics", "SystemInterfaceConfigSet", DSL_CPE_CLI_SystemInterfaceConfigSet, g_sSics); +#endif /* defined(INCLUDE_DSL_SYSTEM_INTERFACE) */ + +#if defined(INCLUDE_DSL_SYSTEM_INTERFACE) && defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("sicg", "SystemInterfaceConfigGet", DSL_CPE_CLI_SystemInterfaceConfigGet, g_sSicg); +#endif /* defined(INCLUDE_DSL_SYSTEM_INTERFACE) && defined(INCLUDE_DSL_CONFIG_GET) */ + DSL_CPE_CLI_CMD_ADD_COMM ("esmcs", "EventStatusMaskConfigSet", DSL_CPE_CLI_EventStatusMaskConfigSet, g_sEsmcs); +#if defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("esmcg", "EventStatusMaskConfigGet", DSL_CPE_CLI_EventStatusMaskConfigGet, g_sEsmcg); +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + DSL_CPE_CLI_CMD_ADD_COMM ("tmsg", "TestModeStatusGet", DSL_CPE_CLI_TestModeStatusGet, g_sTmsg); +#if defined(INCLUDE_DSL_SYSTEM_INTERFACE) + DSL_CPE_CLI_CMD_ADD_COMM ("sisg", "SystemInterfaceStatusGet", DSL_CPE_CLI_SystemInterfaceStatusGet, g_sSisg); +#endif /* defined(INCLUDE_DSL_SYSTEM_INTERFACE) */ + DSL_CPE_CLI_CMD_ADD_COMM ("isg", "InstanceStatusGet", DSL_CPE_CLI_InstanceStatusGet, g_sIsg); +#if defined(INCLUDE_DSL_CPE_MISC_LINE_STATUS) + DSL_CPE_CLI_CMD_ADD_COMM ("mlsg", "MiscLineStatusGet", DSL_CPE_CLI_MiscLineStatusGet, g_sMlsg); +#endif /* defined(INCLUDE_DSL_CPE_MISC_LINE_STATUS) */ + DSL_CPE_CLI_CMD_ADD_COMM ("locs", "LineOptionsConfigSet", DSL_CPE_CLI_LineOptionsConfigSet, g_sLocs); +#if defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("locg", "LineOptionsConfigGet", DSL_CPE_CLI_LineOptionsConfigGet, g_sLocg); +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + DSL_CPE_CLI_CMD_ADD_COMM ("g997lacs", "G997_LineActivateConfigSet", DSL_CPE_CLI_G997LineActivateConfigSet, g_sG997lacs); +#if defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("g997lacg", "G997_LineActivateConfigGet", DSL_CPE_CLI_G997LineActivateConfigGet, g_sG997lacg); +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + +#if defined(INCLUDE_DSL_G997_ALARM) + DSL_CPE_CLI_CMD_ADD_COMM ("g997cdrtcs", "G997_ChannelDataRateThresholdConfigSet", DSL_CPE_CLI_G997ChannelDataRateThresholdConfigSet, g_sG997cdrtcs); +#endif /* defined(INCLUDE_DSL_G997_ALARM) */ + +#if defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("g997cdrtcg", "G997_ChannelDataRateThresholdConfigGet", DSL_CPE_CLI_G997ChannelDataRateThresholdConfigGet, g_sG997cdrtcg); +#endif /* defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) */ + DSL_CPE_CLI_CMD_ADD_COMM ("g997ltsg", "G997_LineTransmissionStatusGet", DSL_CPE_CLI_G997LineTransmissionStatusGet, g_sG997ltsg); +#if defined(INCLUDE_DSL_G997_STATUS) + DSL_CPE_CLI_CMD_ADD_COMM ("g997lisg", "G997_LineInitStatusGet", DSL_CPE_CLI_G997LineInitStatusGet, g_sG997lisg); +#endif /* defined(INCLUDE_DSL_G997_STATUS) */ + DSL_CPE_CLI_CMD_ADD_COMM ("g997lsg", "G997_LineStatusGet", DSL_CPE_CLI_G997LineStatusGet, g_sG997lsg); + DSL_CPE_CLI_CMD_ADD_COMM ("g997csg", "G997_ChannelStatusGet", DSL_CPE_CLI_G997ChannelStatusGet, g_sG997csg); + DSL_CPE_CLI_CMD_ADD_COMM ("g997pmsft", "G997_PowerManagementStateForcedTrigger", DSL_CPE_CLI_G997PowerManagementStateForcedTrigger, g_sG997pmsft); + DSL_CPE_CLI_CMD_ADD_COMM ("g997pmsg", "G997_PowerManagementStatusGet", DSL_CPE_CLI_G997PowerManagementStatusGet, g_sG997pmsg); +#if defined(INCLUDE_DSL_G997_STATUS) + DSL_CPE_CLI_CMD_ADD_COMM ("g997lstg", "G997_LastStateTransmittedGet", DSL_CPE_CLI_G997LastStateTransmittedGet, g_sG997lstg); +#endif /* defined(INCLUDE_DSL_G997_STATUS) */ + +#if defined(INCLUDE_DSL_G997_ALARM) + DSL_CPE_CLI_CMD_ADD_COMM ("g997amlfcs", "G997_AlarmMaskLineFailuresConfigSet", DSL_CPE_CLI_G997AlarmMaskLineFailuresConfigSet, g_sG997amlfcs); +#endif /* defined(INCLUDE_DSL_G997_ALARM) */ + +#if defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("g997amlfcg", "G997_AlarmMaskLineFailuresConfigGet", DSL_CPE_CLI_G997AlarmMaskLineFailuresConfigGet, g_sG997amlfcg); +#endif /* defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) */ + DSL_CPE_CLI_CMD_ADD_COMM ("g997lfsg", "G997_LineFailuresStatusGet", DSL_CPE_CLI_G997LineFailuresStatusGet, g_sG997lfsg); +#if defined(INCLUDE_DSL_G997_ALARM) + DSL_CPE_CLI_CMD_ADD_COMM ("g997amdpfcs", "G997_AlarmMaskDataPathFailuresConfigSet", DSL_CPE_CLI_G997AlarmMaskDataPathFailuresConfigSet, g_sG997amdpfcs); +#endif /* defined(INCLUDE_DSL_G997_ALARM) */ + +#if defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("g997amdpfcg", "G997_AlarmMaskDataPathFailuresConfigGet", DSL_CPE_CLI_G997AlarmMaskDataPathFailuresConfigGet, g_sG997amdpfcg); +#endif /* defined(INCLUDE_DSL_G997_ALARM) && defined(INCLUDE_DSL_CONFIG_GET) */ + DSL_CPE_CLI_CMD_ADD_COMM ("g997dpfsg", "G997_DataPathFailuresStatusGet", DSL_CPE_CLI_G997DataPathFailuresStatusGet, g_sG997dpfsg); +#if defined(INCLUDE_DSL_G997_FRAMING_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("g997fpsg", "G997_FramingParameterStatusGet", DSL_CPE_CLI_G997FramingParameterStatusGet, g_sG997fpsg); +#endif /* defined(INCLUDE_DSL_G997_FRAMING_PARAMETERS) */ + +#if defined(INCLUDE_DSL_DELT) + DSL_CPE_CLI_CMD_ADD_COMM ("g997dhsg", "G997_DeltHlinScaleGet", DSL_CPE_CLI_G997DeltHlinScaleGet, g_sG997dhsg); + DSL_CPE_CLI_CMD_ADD_COMM ("g997dfr", "G997_DeltFreeResources", DSL_CPE_CLI_G997DeltFreeResources, g_sG997dfr); +#endif /* defined(INCLUDE_DSL_DELT) */ + DSL_CPE_CLI_CMD_ADD_COMM ("g997racs", "G997_RateAdaptationConfigSet", DSL_CPE_CLI_G997RateAdaptationConfigSet, g_sG997racs); +#if defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("g997racg", "G997_RateAdaptationConfigGet", DSL_CPE_CLI_G997RateAdaptationConfigGet, g_sG997racg); +#endif /* defined(INCLUDE_DSL_CONFIG_GET) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlshs15mg", "PM_LineSecHistoryStats15MinGet", DSL_CPE_CLI_PM_LineSecHistoryStats15MinGet, g_sPmlshs15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlshs1dg", "PM_LineSecHistoryStats1DayGet", DSL_CPE_CLI_PM_LineSecHistoryStats1DayGet, g_sPmlshs1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlsc15mg", "PM_LineSecCounters15MinGet", DSL_CPE_CLI_PM_LineSecCounters15MinGet, g_sPmlsc15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlsc1dg", "PM_LineSecCounters1DayGet", DSL_CPE_CLI_PM_LineSecCounters1DayGet, g_sPmlsc1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlsctg", "PM_LineSecCountersTotalGet", DSL_CPE_CLI_PM_LineSecCountersTotalGet, g_sPmlsctg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlst15ms", "PM_LineSecThresholds15MinSet", DSL_CPE_CLI_PM_LineSecThresholds15MinSet, g_sPmlst15ms); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlst1ds", "PM_LineSecThresholds1DaySet", DSL_CPE_CLI_PM_LineSecThresholds1DaySet, g_sPmlst1ds); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlst15mg", "PM_LineSecThresholds15MinGet", DSL_CPE_CLI_PM_LineSecThresholds15MinGet, g_sPmlst15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlst1dg", "PM_LineSecThresholds1DayGet", DSL_CPE_CLI_PM_LineSecThresholds1DayGet, g_sPmlst1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlihs15mg", "PM_LineInitHistoryStats15MinGet", DSL_CPE_CLI_PM_LineInitHistoryStats15MinGet, g_sPmlihs15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlihs1dg", "PM_LineInitHistoryStats1DayGet", DSL_CPE_CLI_PM_LineInitHistoryStats1DayGet, g_sPmlihs1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlic15mg", "PM_LineInitCounters15MinGet", DSL_CPE_CLI_PM_LineInitCounters15MinGet, g_sPmlic15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlic1dg", "PM_LineInitCounters1DayGet", DSL_CPE_CLI_PM_LineInitCounters1DayGet, g_sPmlic1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlictg", "PM_LineInitCountersTotalGet", DSL_CPE_CLI_PM_LineInitCountersTotalGet, g_sPmlictg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlit15ms", "PM_LineInitThresholds15MinSet", DSL_CPE_CLI_PM_LineInitThresholds15MinSet, g_sPmlit15ms); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlit1ds", "PM_LineInitThresholds1DaySet", DSL_CPE_CLI_PM_LineInitThresholds1DaySet, g_sPmlit1ds); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlit15mg", "PM_LineInitThresholds15MinGet", DSL_CPE_CLI_PM_LineInitThresholds15MinGet, g_sPmlit15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlit1dg", "PM_LineInitThresholds1DayGet", DSL_CPE_CLI_PM_LineInitThresholds1DayGet, g_sPmlit1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmchs15mg", "PM_ChannelHistoryStats15MinGet", DSL_CPE_CLI_PM_ChannelHistoryStats15MinGet, g_sPmchs15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmchs1dg", "PM_ChannelHistoryStats1DayGet", DSL_CPE_CLI_PM_ChannelHistoryStats1DayGet, g_sPmchs1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + DSL_CPE_CLI_CMD_ADD_COMM ("pmcc15mg", "PM_ChannelCounters15MinGet", DSL_CPE_CLI_PM_ChannelCounters15MinGet, g_sPmcc15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmcc1dg", "PM_ChannelCounters1DayGet", DSL_CPE_CLI_PM_ChannelCounters1DayGet, g_sPmcc1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmcctg", "PM_ChannelCountersTotalGet", DSL_CPE_CLI_PM_ChannelCountersTotalGet, g_sPmcctg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmct15ms", "PM_ChannelThresholds15MinSet", DSL_CPE_CLI_PM_ChannelThresholds15MinSet, g_sPmct15ms); + DSL_CPE_CLI_CMD_ADD_COMM ("pmct1ds", "PM_ChannelThresholds1DaySet", DSL_CPE_CLI_PM_ChannelThresholds1DaySet, g_sPmct1ds); + DSL_CPE_CLI_CMD_ADD_COMM ("pmct15mg", "PM_ChannelThresholds15MinGet", DSL_CPE_CLI_PM_ChannelThresholds15MinGet, g_sPmct15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmct1dg", "PM_ChannelThresholds1DayGet", DSL_CPE_CLI_PM_ChannelThresholds1DayGet, g_sPmct1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdphs15mg", "PM_DataPathHistoryStats15MinGet", DSL_CPE_CLI_PM_DataPathHistoryStats15MinGet, g_sPmdphs15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmdphs1dg", "PM_DataPathHistoryStats1DayGet", DSL_CPE_CLI_PM_DataPathHistoryStats1DayGet, g_sPmdphs1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpc15mg", "PM_DataPathCounters15MinGet", DSL_CPE_CLI_PM_DataPathCounters15MinGet, g_sPmdpc15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpc1dg", "PM_DataPathCounters1DayGet", DSL_CPE_CLI_PM_DataPathCounters1DayGet, g_sPmdpc1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpctg", "PM_DataPathCountersTotalGet", DSL_CPE_CLI_PM_DataPathCountersTotalGet, g_sPmdpctg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpt15ms", "PM_DataPathThresholds15MinSet", DSL_CPE_CLI_PM_DataPathThresholds15MinSet, g_sPmdpt15ms); + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpt1ds", "PM_DataPathThresholds1DaySet", DSL_CPE_CLI_PM_DataPathThresholds1DaySet, g_sPmdpt1ds); + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpt15mg", "PM_DataPathThresholds15MinGet", DSL_CPE_CLI_PM_DataPathThresholds15MinGet, g_sPmdpt15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpt1dg", "PM_DataPathThresholds1DayGet", DSL_CPE_CLI_PM_DataPathThresholds1DayGet, g_sPmdpt1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pm15meet", "PM_15MinElapsedExtTrigger", DSL_CPE_CLI_PM_15MinElapsedExtTrigger, g_sPm15meet); + DSL_CPE_CLI_CMD_ADD_COMM ("pmetr", "PM_ElapsedTimeReset", DSL_CPE_CLI_PM_ElapsedTimeReset, g_sPmetr); + DSL_CPE_CLI_CMD_ADD_COMM ("pmsms", "PM_SyncModeSet", DSL_CPE_CLI_PM_SyncModeSet, g_sPmsms); + DSL_CPE_CLI_CMD_ADD_COMM ("pmbms", "PM_BurninModeSet", DSL_CPE_CLI_PM_BurninModeSet, g_sPmbms); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlscsg", "PM_LineSecCountersShowtimeGet", DSL_CPE_CLI_PM_LineSecCountersShowtimeGet, g_sPmlscsg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlicsg", "PM_LineInitCountersShowtimeGet", DSL_CPE_CLI_PM_LineInitCountersShowtimeGet, g_sPmlicsg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmccsg", "PM_ChannelCountersShowtimeGet", DSL_CPE_CLI_PM_ChannelCountersShowtimeGet, g_sPmccsg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpcsg", "PM_DataPathCountersShowtimeGet", DSL_CPE_CLI_PM_DataPathCountersShowtimeGet, g_sPmdpcsg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) && defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("pmcg", "PM_ConfigGet", DSL_CPE_CLI_PM_ConfigGet, g_sPmcg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) && defined(INCLUDE_DSL_CONFIG_GET) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) + DSL_CPE_CLI_CMD_ADD_COMM ("pmcs", "PM_ConfigSet", DSL_CPE_CLI_PM_ConfigSet, g_sPmcs); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_CONFIG) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlesc15mg", "PM_LineEventShowtimeCounters15MinGet", DSL_CPE_CLI_PM_LineEventShowtimeCounters15MinGet, g_sPmlesc15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmlesc1dg", "PM_LineEventShowtimeCounters1DayGet", DSL_CPE_CLI_PM_LineEventShowtimeCounters1DayGet, g_sPmlesc1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlescsg", "PM_LineEventShowtimeCountersShowtimeGet", DSL_CPE_CLI_PM_LineEventShowtimeCountersShowtimeGet, g_sPmlescsg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmlesctg", "PM_LineEventShowtimeCountersTotalGet", DSL_CPE_CLI_PM_LineEventShowtimeCountersTotalGet, g_sPmlesctg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmleshs15mg", "PM_LineEventShowtimeHistoryStats15MinGet", DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats15MinGet, g_sPmleshs15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmleshs1dg", "PM_LineEventShowtimeHistoryStats1DayGet", DSL_CPE_CLI_PM_LineEventShowtimeHistoryStats1DayGet, g_sPmleshs1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpfc15mg", "PM_DataPathFailureCounters15MinGet", DSL_CPE_CLI_PM_DataPathFailureCounters15MinGet, g_sPmdpfc15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpfc1dg", "PM_DataPathFailureCounters1DayGet", DSL_CPE_CLI_PM_DataPathFailureCounters1DayGet, g_sPmdpfc1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpfcsg", "PM_DataPathFailureCountersShowtimeGet", DSL_CPE_CLI_PM_DataPathFailureCountersShowtimeGet, g_sPmdpfcsg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpfctg", "PM_DataPathFailureCountersTotalGet", DSL_CPE_CLI_PM_DataPathFailureCountersTotalGet, g_sPmdpfctg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpfhs15mg", "PM_DataPathFailureHistoryStats15MinGet", DSL_CPE_CLI_PM_DataPathFailureHistoryStats15MinGet, g_sPmdpfhs15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmdpfhs1dg", "PM_DataPathFailureHistoryStats1DayGet", DSL_CPE_CLI_PM_DataPathFailureHistoryStats1DayGet, g_sPmdpfhs1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtc15mg", "PM_ReTxCounters15MinGet", DSL_CPE_CLI_PM_RetxCounters15MinGet, g_sPmrtc15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtc1dg", "PM_ReTxCounters1DayGet", DSL_CPE_CLI_PM_RetxCounters1DayGet, g_sPmrtc1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtcsg", "PM_ReTxCountersShowtimeGet", DSL_CPE_CLI_PM_RetxCountersShowtimeGet, g_sPmrtcsg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtctg", "PM_ReTxCountersTotalGet", DSL_CPE_CLI_PM_RetxCountersTotalGet, g_sPmrtctg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmrths15mg", "PM_ReTxHistoryStats15MinGet", DSL_CPE_CLI_PM_RetxHistoryStats15MinGet, g_sPmrths15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmrths1dg", "PM_ReTxHistoryStats1DayGet", DSL_CPE_CLI_PM_RetxHistoryStats1DayGet, g_sPmrths1dg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_HISTORY) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtt15mg", "PM_ReTxThresholds15MinGet", DSL_CPE_CLI_PM_RetxThresholds15MinGet, g_sPmrtt15mg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtt15ms", "PM_ReTxThresholds15MinSet", DSL_CPE_CLI_PM_RetxThresholds15MinSet, g_sPmrtt15ms); + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtt1dg", "PM_ReTxThresholds1DayGet", DSL_CPE_CLI_PM_RetxThresholds1DayGet, g_sPmrtt1dg); + DSL_CPE_CLI_CMD_ADD_COMM ("pmrtt1ds", "PM_ReTxThresholds1DaySet", DSL_CPE_CLI_PM_RetxThresholds1DaySet, g_sPmrtt1ds); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_RETX_COUNTERS) && defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) */ + +#if defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) && defined(INCLUDE_DSL_CONFIG_GET) + DSL_CPE_CLI_CMD_ADD_COMM ("pmsmg", "PM_SyncModeGet", DSL_CPE_CLI_PM_SyncModeGet, g_sPmsmg); +#endif /* defined(INCLUDE_DSL_PM) && defined(INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS) && defined(INCLUDE_DSL_CONFIG_GET) */ + +} + +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ diff --git a/src/dsl_cpe_cli_console.c b/src/dsl_cpe_cli_console.c new file mode 100644 index 0000000..b19c7aa --- /dev/null +++ b/src/dsl_cpe_cli_console.c @@ -0,0 +1,664 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL daemon command line interface for console (single key input) +*/ + +/*#define DEBUG_CONSOLE*/ + +/*#define DSL_INTERN*/ + +#include "dsl_cpe_control.h" +#include "dsl_cpe_os.h" +#include "dsl_cpe_cli.h" +#include "dsl_cpe_cli_console.h" +#include "drv_dsl_cpe_api_error.h" + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CONSOLE + +#define KEY_INPUT_NONE 0 +#define KEY_INPUT_ENTER 1 +#define KEY_INPUT_BS 2 +#define KEY_INPUT_UP 3 +#define KEY_INPUT_DOWN 4 +#define KEY_INPUT_CHAR 5 + +#define DSL_CPE_MAX_CLI_LEN 1024 + +#ifndef WIN32 + #define BOLD "\033[1;30m" + #define NORMAL "\033[0m" + #define CLREOL "\033[K" +#else + #define BOLD "" + #define NORMAL "" + #define CLREOL "" +#endif + +static DSL_Error_t DSL_CPE_Console_Exit +( + DSL_void_t *pContext +); + +static DSL_Error_t DSL_CPE_Console_EventCallback +( + DSL_void_t *pContext, + DSL_char_t *pMsg +); + +static DSL_int_t DSL_CPE_CommandLineRead +( + DSL_char_t *str, + DSL_uint32_t len, + DSL_CPE_File_t *in, + DSL_CPE_File_t * out +); + +/******************************************************************************/ + +#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA +DSL_Error_t run_dsl_cpe_console(int fd) +{ + DSL_CPE_Console_Context_t *pConsoleContext = DSL_NULL; + DSL_Error_t ret = DSL_SUCCESS; + DSL_CPE_Control_Context_t *pContext = DSL_CPE_GetGlobalContext ( ); +#ifdef VXWORKS + DSL_int_t i; + DSL_int_t stdfds[3]; +#endif + + if (pContext == DSL_NULL) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "'dsl_cpe_control' not running! Exit..." DSL_CPE_CRLF ); + return DSL_ERROR; + } + +#ifdef VXWORKS + /* FIXME: make sure that this console runs on the serial port (fd 3) */ + for (i = 0; i < 3; ++i) + { + stdfds[i] = ioTaskStdGet(0,i); + if (stdfds[i] != ERROR) + ioTaskStdSet(0,i,3); + } +#endif + + if (DSL_CPE_CLI_Init () == DSL_ERROR) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "'DSL_CPE_CLI_Init' failed" DSL_CPE_CRLF)); + goto console_exit; + } + + if (DSL_CPE_Console_Init (&pConsoleContext, pContext, DSL_CPE_STDIN, DSL_CPE_STDOUT) == + DSL_ERROR) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "'DSL_CPE_Console_Init' failed! Exit..." DSL_CPE_CRLF)); + ret = DSL_ERROR; + goto console_exit; + } + + do + { + ret = DSL_CPE_Handle_Console (pConsoleContext); + } + while (ret != DSL_ERROR); + + if (DSL_CPE_Console_Shutdown (pConsoleContext) == DSL_ERROR) + { + ret = DSL_ERROR; + goto console_exit; + } + +console_exit: + +#ifdef VXWORKS + /* restore stdio */ + for (i = 0; i < 3; ++i) + { + if (stdfds[i] != ERROR) + ioTaskStdSet(0,i,stdfds[i]); + } +#endif + + return ret; +} +#endif + +DSL_Error_t DSL_CPE_Console_Init (DSL_CPE_Console_Context_t ** pConsoleRefContext, + DSL_CPE_Control_Context_t *pContext, DSL_CPE_File_t * in, + DSL_CPE_File_t * out) +{ + DSL_CPE_Console_Context_t *pConsoleContext; + + if (*pConsoleRefContext != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "expecting zero context pointer '*pConsoleRefContext'" DSL_CPE_CRLF)); + return DSL_ERROR; + } + + *pConsoleRefContext = malloc (sizeof (DSL_CPE_Console_Context_t)); + if (*pConsoleRefContext == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "no memory for '*pConsoleRefContext'" DSL_CPE_CRLF)); + return DSL_ERROR; + } + pConsoleContext = *pConsoleRefContext; + + memset (pConsoleContext, 0x00, sizeof (*pConsoleContext)); + pConsoleContext->pContext = pContext; + pConsoleContext->file_in = in; + pConsoleContext->file_out = out; + pConsoleContext->bRun = DSL_TRUE; + + if (out == DSL_CPE_STDOUT) + DSL_CPE_EchoOff (); + if (in == DSL_CPE_STDIN) + DSL_CPE_KeypressSet (); + + DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + "Welcome to the CLI interface of DSL CPE API" DSL_CPE_CRLF)); +#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA + DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + "Enter 'bye' to close console only." DSL_CPE_CRLF)); +#endif + DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + "Enter 'help all' for a list of built-in commands." DSL_CPE_CRLF)); + + DSL_CPE_CLI_Register(&pConsoleContext->pCLIContext, pConsoleContext, + DSL_CPE_Console_Exit, DSL_CPE_Console_EventCallback); + +#ifdef RTEMS + gv_pConsoleContext = pConsoleContext; +#endif /* RTEMS*/ + + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_Console_Shutdown (DSL_CPE_Console_Context_t * pConsoleContext) +{ +#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA + if (DSL_CPE_CLI_Unregister(pConsoleContext->pCLIContext) == DSL_SUCCESS) + { + free(pConsoleContext->pCLIContext); + pConsoleContext->pCLIContext = DSL_NULL; + } +#endif + if (pConsoleContext->file_in == DSL_CPE_STDIN) + DSL_CPE_KeypressReset (); + if (pConsoleContext->file_out == DSL_CPE_STDOUT) + DSL_CPE_EchoOn (); + + free(pConsoleContext); + pConsoleContext = DSL_NULL; + + return DSL_SUCCESS; +} + +static DSL_Error_t DSL_CPE_Console_Exit (DSL_void_t * pContext) +{ + DSL_CPE_Console_Context_t *pConsoleContext = pContext; +#ifdef DEBUG_CONSOLE + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "DSL_CPE_Console_Exit() called" DSL_CPE_CRLF)); +#endif + pConsoleContext->pCLIContext = DSL_NULL; + pConsoleContext->bRun = DSL_FALSE; + return DSL_SUCCESS; +} + +static DSL_Error_t DSL_CPE_Console_EventCallback( + DSL_void_t *pContext, + DSL_char_t *pMsg) +{ + DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, ("%s" DSL_CPE_CRLF, pMsg)); + + return DSL_SUCCESS; +} + +/** + Read command line. + + \param str Destination pointer for command line + \param len Maximum length of command line + \param in File for key input (e.g. DSL_CPE_STDIN) + \param out File for output (e.g. DSL_CPE_STDOUT) + + \return + Length of command string +*/ +static DSL_int_t DSL_CPE_CommandLineRead( + DSL_char_t *str, + DSL_uint32_t len, + DSL_CPE_File_t *in, + DSL_CPE_File_t *out) +{ + char c, echo; + int read_len; + int blank_cnt = 0; + int first = 1; + int ret = KEY_INPUT_CHAR; + + if (strlen (str)) + first = 0; + + len -= strlen (str); + str += strlen (str); + + while (len--) + { + echo = 0; + read_len = DSL_CPE_FRead (&c, 1, 1, in); + + if (read_len == 0) + { + if (DSL_CPE_Feof (in)) + ret = KEY_INPUT_NONE; + goto KEY_FINISH; + } +#ifdef DEBUG_CONSOLE + else + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF " no EOF from getc()" DSL_CPE_CRLF ); +#endif + + if (first && (c == ' ')) + { + len++; + continue; + } + + first = 0; + + if (c != ' ') + { + blank_cnt = 0; + } + + switch (c) + { + default: + echo = c; + break; + + case ' ': + if (blank_cnt) + { + len++; + str--; + } + else + { + echo = ' '; + } + blank_cnt++; + break; + + /* backspace */ + case 127: /* BS in Linux Terminal */ + case 8: /* BS in TTY */ +#ifdef DEBUG_CONSOLE + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF" DEL" DSL_CPE_CRLF ); +#endif + len++; + str--; + ret = KEY_INPUT_BS; + goto KEY_FINISH; + + /* tab */ + case 9: +#ifdef DEBUG_CONSOLE + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF " TAB" DSL_CPE_CRLF ); +#endif + break; + + case '\n': + DSL_CPE_PutChar ('\n', out); + DSL_CPE_FFlush (out); + ret = KEY_INPUT_ENTER; + goto KEY_FINISH; + + case 033: + read_len = DSL_CPE_FRead (&c, 1, 1, in); + if (read_len == 0) + break; + switch (c) + { + case 27: +#ifdef DEBUG_CONSOLE + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF " ESC" DSL_CPE_CRLF ); +#endif + /* escape */ + break; + + case '[': + read_len = DSL_CPE_FRead (&c, 1, 1, in); + if (read_len == 0) + break; + switch (c) + { + case 'D': + /* left */ + break; + case 'C': + /* right */ + break; + case 'A': + /* up */ + ret = KEY_INPUT_UP; + break; + case 'B': + /* down */ + ret = KEY_INPUT_DOWN; + break; + default: + break; + } + break; + + default: + break; + } + goto KEY_FINISH; + } + + *str++ = c; + + if (echo) + DSL_CPE_PutChar (echo, out); + + DSL_CPE_FFlush (out); + } + + KEY_FINISH: + + *str++ = 0; + + return ret; +} + + +/** + This function collects single key input and handles execution of commands. + + \param pConsoleContext Pointer to console context structure, [I] + + \return + Return values are defined within the DSL_Error_t definition + - DSL_SUCCESS if a command was completely entered and sucessful executed + - DSL_ERROR if an error occured or the command "quit" was entered +*/ +DSL_Error_t DSL_CPE_Handle_Console (DSL_CPE_Console_Context_t * pConsoleContext) +{ + DSL_int_t result = 0, len = 0, i = 0; + DSL_CPE_File_t *in = pConsoleContext->file_in, *out = pConsoleContext->file_out; + + pConsoleContext->cmd[0] = 0; + pConsoleContext->arg[0] = 0; + memset (pConsoleContext->arg, 0x00, sizeof (pConsoleContext->arg)); + + DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF ); + + ARROW_KEY: + + DSL_CPE_FPrintf(out, "\r" CLREOL BOLD "DSL_CPE#>" NORMAL "%s", pConsoleContext->arg); + DSL_CPE_FFlush (out); + + i = pConsoleContext->old_idx; + + NEW_LOOP: + +#ifndef RTEMS + /* read command line */ + switch (DSL_CPE_CommandLineRead + (pConsoleContext->arg, DSL_MAX_COMMAND_LINE_LENGTH, in, out)) + { + case KEY_INPUT_UP: + if (pConsoleContext->old_idx) + pConsoleContext->old_idx--; + else + pConsoleContext->old_idx = MAX_OLD_COMMAND - 1; + + if (strlen (pConsoleContext->old_command[pConsoleContext->old_idx])) + { + cpe_control_strncpy_s(pConsoleContext->arg, + DSL_MAX_COMMAND_LINE_LENGTH, + pConsoleContext->old_command[pConsoleContext->old_idx], + strlen(pConsoleContext->old_command[pConsoleContext->old_idx])); + + goto ARROW_KEY; + } + else + { + pConsoleContext->old_idx = i; + goto NEW_LOOP; + } + + case KEY_INPUT_DOWN: + + if (++pConsoleContext->old_idx >= MAX_OLD_COMMAND) + pConsoleContext->old_idx = 0; + + if (strlen (pConsoleContext->old_command[pConsoleContext->old_idx])) + { + + if (pConsoleContext->old_idx >= MAX_OLD_COMMAND) + pConsoleContext->old_idx = 0; + + cpe_control_strncpy_s(pConsoleContext->arg, + DSL_MAX_COMMAND_LINE_LENGTH, + pConsoleContext->old_command[pConsoleContext->old_idx], + strlen(pConsoleContext->old_command[pConsoleContext->old_idx])); + + + goto ARROW_KEY; + } + else + { + pConsoleContext->old_idx = i; + goto NEW_LOOP; + } + + case KEY_INPUT_BS: + /* backspace */ + goto ARROW_KEY; + + case KEY_INPUT_NONE: + if (pConsoleContext->bRun == DSL_FALSE) + { + /* indicate command "quit" */ + return DSL_ERROR; + /* DSL_CPE_FPrintf(DSL_CPE_STDOUT, "KEY_INPUT_NONE" DSL_CPE_CRLF ); */ + /* DSL_CPE_Sleep(1); */ + } + goto NEW_LOOP; + + default: + break; + } + + if (pConsoleContext->bRun == DSL_FALSE) + /* indicate command "quit" */ + return DSL_ERROR; +#else + while(gv_dsl_cli_wait==0) + { + DSL_CPE_Sleep(1); + } + gv_dsl_cli_wait = 0; +#endif /* RTEMS*/ + + /* get command name */ + sscanf (pConsoleContext->arg, "%"_MKSTR(_DSL_MAX_COMMAND_LINE_LENGTH)"s", pConsoleContext->cmd); + + len = (DSL_int_t) strlen (pConsoleContext->cmd); + + if (len) + { +#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA + if (strcmp(pConsoleContext->cmd, "bye") == 0) + { + /* indicate command "bye" */ + return DSL_ERROR; + } +#endif /* INCLUDE_DSL_API_CONSOLE_EXTRA */ + + if (strcmp + (pConsoleContext->old_command[pConsoleContext->prev_idx], + pConsoleContext->arg) != 0) + { + cpe_control_strncpy_s(pConsoleContext->old_command[pConsoleContext->idx], + sizeof(pConsoleContext->old_command[pConsoleContext->idx]), + pConsoleContext->arg, sizeof(pConsoleContext->arg)); + pConsoleContext->prev_idx = pConsoleContext->idx; + if (++pConsoleContext->idx >= MAX_OLD_COMMAND) + pConsoleContext->idx = 0; + } + + pConsoleContext->old_idx = pConsoleContext->idx; + + /* find function by name and execute it */ + + result = + DSL_CPE_CliDeviceCommandExecute (pConsoleContext->pContext, -1, + pConsoleContext->cmd, pConsoleContext->arg + len + 1, out); + } + + if (result == 1) + { + /* indicate command "quit" */ + return DSL_ERROR; + } + + return DSL_SUCCESS; +} + +#if defined(RTEMS) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT) +DSL_CPE_Console_Context_t *gv_pConsoleContext = DSL_NULL; +DSL_uint32_t gv_dsl_cli_wait=0; + +/******************************************************************************/ +// call from cpe_test.c + +/* + KAv: Should be renamed to DSL_CPE_CommandHandle +*/ +DSL_Error_t DSL_CPE_Handle_Command (char *cmd) +{ + DSL_CPE_Console_Context_t * pConsoleContext = gv_pConsoleContext; + DSL_int_t result, len; + DSL_int32_t fd = DSL_NULL; + DSL_CPE_File_t *out = pConsoleContext->file_out; + + if (gv_pConsoleContext == DSL_NULL) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "'DSL_CPE_Handle_Command' Console not initilized..." DSL_CPE_CRLF ); + return DSL_ERROR; + } + fd = pConsoleContext->fd; + + cpe_control_strncpy_s(gv_pConsoleContext->arg, sizeof(gv_pConsoleContext->arg), cmd, sizeof(gv_pConsoleContext->arg)); + + /* get command name */ + sscanf (pConsoleContext->arg, "%s", pConsoleContext->cmd); + + len = (DSL_int_t) strlen (pConsoleContext->cmd); + + if (len) + { + cpe_control_strncpy_s(pConsoleContext->arg, sizeof(pConsoleContext->arg), cmd, sizeof(pConsoleContext->arg)); + } + + /* find function by name and execute it */ + result = DSL_CPE_CliDeviceCommandExecute( + pConsoleContext->pContext, -1, + pConsoleContext->cmd, + pConsoleContext->arg + len + 1, out); + + if (result == 1) + { + /* indicate command "quit" */ + return DSL_ERROR; + } + + return DSL_SUCCESS; +} + +// call from adsl_dbg.c: adsl_dbg_cmd() +void rtems_DSL_CPE_Handle_Console(char *cmd) +{ + + while(gv_dsl_cli_wait==1) + { + DSL_CPE_Sleep (1); + } + + if (gv_pConsoleContext == DSL_NULL) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "'rtems_DSL_CPE_Handle_Console' Console not initilized..." DSL_CPE_CRLF ); + return DSL_ERROR; + } + + cpe_control_strncpy_s(gv_pConsoleContext->arg, sizeof(gv_pConsoleContext->arg), cmd, sizeof(gv_pConsoleContext->arg)); + // DSL_CPE_Handle_Console (gv_pConsoleContext); + gv_dsl_cli_wait=1; +} + +/* + Implementation below moved from the adsl_dbg.c module +*/ + +#undef DBG_TARGET +#define DBG_TARGET DIO_NONE + +/* adsl_dbg_help -- ATM debug help module callback. */ +static void adsl_dbg_help (void) +{ + tty_print ("Following ADSL commands are available:\r\n"); + tty_print ("dpt : Run DSL production test (with 100 Ohm resistor)\r\n"); + tty_print ("other commands : Controlled by DSL CPE Control API:\r\n"); + + /* call DSL-API CLI handler */ + rtems_DSL_CPE_Handle_Console("help"); +} + +/* adsl_dbg_cmd -- ADSL debug command module callback. */ +unsigned long adsl_dbg_cmd (char *str, int *idx, char *cmd) +{ +#ifdef INCLUDE_DSL_CPE_PRODUCTION_TEST_SUPPORT + if (!astrncmp (str, "dpt", 3)) + { + /* DSL Production test */ + dsl_cpe_test(); + } + else +#endif /* INCLUDE_DSL_CPE_PRODUCTION_TEST_SUPPORT*/ + { + /* call DSL-API CLI handler */ + rtems_DSL_CPE_Handle_Console(str); + } + return (1); // 0= command not defined +} + +void adsl_dbg_init (void) +{ + dbg_link ("ADSL", adsl_dbg_help, adsl_dbg_cmd); +} +#endif /* defined(RTEMS) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/ + +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ diff --git a/src/dsl_cpe_cli_console.h b/src/dsl_cpe_cli_console.h new file mode 100644 index 0000000..e8e035c --- /dev/null +++ b/src/dsl_cpe_cli_console.h @@ -0,0 +1,58 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef DSL_CPE_CLI_CONSOLE_H +#define DSL_CPE_CLI_CONSOLE_H + +/** \file + DSL daemon command line interface for console (single key input) +*/ + +/** \defgroup LIB_DSL_CLI_CON_CONF Configuration of DSL CPE API console + @{ */ + +/** maximum length of command line */ +#define _DSL_MAX_COMMAND_LINE_LENGTH 255 + +/** maximum length of command line */ +#define DSL_MAX_COMMAND_LINE_LENGTH 256 +/** maximum length of command names */ +#define DSL_MAX_FUNCTION_NAME_LENGTH 64 +/** maximum of history elements */ +#define MAX_OLD_COMMAND 16 + +/** @} */ + +struct DSL_CPE_Console_Context +{ + DSL_char_t old_command[MAX_OLD_COMMAND][DSL_MAX_COMMAND_LINE_LENGTH]; + DSL_char_t arg[DSL_MAX_COMMAND_LINE_LENGTH]; + DSL_char_t cmd[DSL_MAX_FUNCTION_NAME_LENGTH]; + DSL_CPE_Control_Context_t *pContext; + DSL_int_t idx; + DSL_int_t old_idx; + DSL_int_t prev_idx; + DSL_CPE_File_t *file_in; + DSL_CPE_File_t *file_out; + volatile DSL_boolean_t bRun; + DSL_CLI_Context_t *pCLIContext; +}; + +/** Context for console (including simple "editor") */ +typedef struct DSL_CPE_Console_Context DSL_CPE_Console_Context_t; + +DSL_Error_t DSL_CPE_Console_Init (DSL_CPE_Console_Context_t ** pConsoleRefContext, + DSL_CPE_Control_Context_t *pContext, DSL_CPE_File_t * in, + DSL_CPE_File_t * out); +DSL_Error_t DSL_CPE_Console_Shutdown(DSL_CPE_Console_Context_t *pConsoleContext); +DSL_Error_t DSL_CPE_Handle_Console(DSL_CPE_Console_Context_t *pConsoleContext); + +#endif /* DSL_CPE_CLI_CONSOLE_H */ + diff --git a/src/dsl_cpe_cli_mib.c b/src/dsl_cpe_cli_mib.c new file mode 100644 index 0000000..82de742 --- /dev/null +++ b/src/dsl_cpe_cli_mib.c @@ -0,0 +1,1986 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL CLI, access function implementation +*/ + +#include "dsl_cpe_control.h" +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) && defined(INCLUDE_DSL_ADSL_MIB) + +#include "dsl_cpe_cli.h" +#include "dsl_cpe_cli_console.h" +#include "dsl_cpe_debug.h" +#include "drv_dsl_cpe_api.h" +#include "drv_dsl_cpe_api_ioctl.h" +#include "drv_dsl_cpe_api_adslmib.h" +#include "drv_dsl_cpe_api_adslmib_ioctl.h" + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CLI + + +/* for debugging: */ +#ifdef DSL_CLI_LOCAL +#undef DSL_CLI_LOCAL +#endif +#if 1 +#define DSL_CLI_LOCAL +#else +#define DSL_CLI_LOCAL static +#endif + +extern const char *sFailureReturn; + +static const DSL_char_t g_sMibLeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags" DSL_CPE_CRLF + " line code = 0x1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags" DSL_CPE_CRLF + "- DSL_int_t adslLineCode" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_LineEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslLineTableEntry_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslLineTableEntry_t)); + + sscanf (pCommands, "%x", &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_LINE_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"flags=0x%x adslLineCode=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), pData.flags, pData.adslLineCode); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibLeeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags" DSL_CPE_CRLF + " atuc trans. capabilities = 0x1" DSL_CPE_CRLF + " atuc trans. config = 0x2" DSL_CPE_CRLF + " atuc trans. actual = 0x4" DSL_CPE_CRLF + " power state = 0x8" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags" DSL_CPE_CRLF + "- DSL_uint16_t adslLineTransAtucCap (hex)" DSL_CPE_CRLF + "- DSL_uint16_t adslLineTransAtucConfig (hex)" DSL_CPE_CRLF + "- DSL_uint16_t adslLineTransAtucActual (hex)" DSL_CPE_CRLF + "- DSL_int_t adslLineGlitePowerState" DSL_CPE_CRLF + " none = 1" DSL_CPE_CRLF + " L0 = 2" DSL_CPE_CRLF + " L1 = 3" DSL_CPE_CRLF + " L3 = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_LineExtEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslLineExtTableEntry_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslLineExtTableEntry_t)); + + sscanf (pCommands, "%x", &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_LINE_EXT_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x adslLineTransAtucCap=0x%x " + "adslLineTransAtucConfig=0x%x adslLineTransAtucActual=0x%x " + "adslLineGlitePowerState=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), pData.flags, + pData.adslLineTransAtucCap, + pData.adslLineTransAtucConfig, + pData.adslLineTransAtucActual, + pData.adslLineGlitePowerState); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAtucpeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + " serial number = 0x1" DSL_CPE_CRLF + " vendor id = 0x2" DSL_CPE_CRLF + " version number = 0x4" DSL_CPE_CRLF + " line status = 0x8" DSL_CPE_CRLF + " output power = 0x10" DSL_CPE_CRLF + " att. rate = 0x20" DSL_CPE_CRLF + " attenuation = 0x40" DSL_CPE_CRLF + " snr margin = 0x80" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + "- DSL_char_t serial_no[32]" DSL_CPE_CRLF + "- DSL_char_t vendor_id[16]" DSL_CPE_CRLF + "- DSL_uint16_t country_code (hex)" DSL_CPE_CRLF + "- DSL_char_t provider_id[4]" DSL_CPE_CRLF + "- DSL_char_t revision_info[2]" DSL_CPE_CRLF + "- DSL_char_t version_no[16]" DSL_CPE_CRLF + "- DSL_uint32_t Attn" DSL_CPE_CRLF + "- DSL_uint32_t SnrMgn" DSL_CPE_CRLF + "- DSL_uint32_t status" DSL_CPE_CRLF + " noDefect = 0x0" DSL_CPE_CRLF + " lossOfFraming = 0x1" DSL_CPE_CRLF + " lossOfSignal = 0x2" DSL_CPE_CRLF + " lossOfPower = 0x4" DSL_CPE_CRLF + " lossOfSignalQuality = 0x8" DSL_CPE_CRLF + " lossOfLink = 0x10" DSL_CPE_CRLF + " dataInitFailure = 0x20" DSL_CPE_CRLF + " configInitFailure = 0x40" DSL_CPE_CRLF + " protocolInitFailure = 0x80" DSL_CPE_CRLF + " noPeerAtuPresent = 0x100" DSL_CPE_CRLF + "- DSL_int_t outputPwr" DSL_CPE_CRLF + "- DSL_uint32_t attainableRate" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_PhysEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAtucPhysEntry_t pData; + DSL_char_t buf[256]; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAtucPhysEntry_t)); + + sscanf (pCommands, "%x", &flags); + pData.flags = flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_PHYS_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_ArraySPrintF(buf, pData.serial_no, + sizeof(pData.serial_no), sizeof(pData.serial_no[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, DSL_CPE_RET"flags=0x%x serial_no=%s ", DSL_CPE_RET_VAL(ret), + pData.flags, buf); + + DSL_CPE_ArraySPrintF(buf, pData.vendor_id.vendor_id, + sizeof(pData.vendor_id.vendor_id), sizeof(pData.vendor_id.vendor_id[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "vendor_id=%s ", buf); + + DSL_CPE_FPrintf (out, "country_code=0x%x ", pData.vendor_id.vendor_info.country_code); + + DSL_CPE_ArraySPrintF(buf, pData.vendor_id.vendor_info.provider_id, + sizeof(pData.vendor_id.vendor_info.provider_id), sizeof(pData.vendor_id.vendor_info.provider_id[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "provider_id=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.vendor_id.vendor_info.revision_info, + sizeof(pData.vendor_id.vendor_info.revision_info), sizeof(pData.vendor_id.vendor_info.revision_info[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "revision_info=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.version_no, + sizeof(pData.version_no), sizeof(pData.version_no[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "version_no=%s ", buf); + + DSL_CPE_FPrintf (out, "Attn=%d SnrMgn=%d ", pData.Attn, pData.SnrMgn); + + DSL_CPE_FPrintf (out, "status=%d ", pData.status); + DSL_CPE_FPrintf (out, "outputPwr=%d ", pData.outputPwr); + DSL_CPE_FPrintf (out, "attainableRate=%d"DSL_CPE_CRLF, pData.attainableRate); + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAturpeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + " serial number = 0x1" DSL_CPE_CRLF + " vendor id = 0x2" DSL_CPE_CRLF + " version number = 0x4" DSL_CPE_CRLF + " line status = 0x20" DSL_CPE_CRLF + " output power = 0x40" DSL_CPE_CRLF + " att. rate = 0x80" DSL_CPE_CRLF + " attenuation = 0x100" DSL_CPE_CRLF + " snr margin = 0x200" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + "- DSL_char_t serial_no[32]" DSL_CPE_CRLF + "- DSL_char_t vendor_id[16]" DSL_CPE_CRLF + "- DSL_uint16_t country_code (hex)" DSL_CPE_CRLF + "- DSL_char_t provider_id[4]" DSL_CPE_CRLF + "- DSL_char_t revision_info[2]" DSL_CPE_CRLF + "- DSL_char_t version_no[16]" DSL_CPE_CRLF + "- DSL_uint32_t Attn" DSL_CPE_CRLF + "- DSL_uint32_t SnrMgn" DSL_CPE_CRLF + "- DSL_uint32_t status" DSL_CPE_CRLF + " noDefect = 0x0" DSL_CPE_CRLF + " lossOfFraming = 0x1" DSL_CPE_CRLF + " lossOfSignal = 0x2" DSL_CPE_CRLF + " lossOfPower = 0x4" DSL_CPE_CRLF + " lossOfSignalQuality = 0x8" DSL_CPE_CRLF + "- DSL_int_t outputPwr" DSL_CPE_CRLF + "- DSL_uint32_t attainableRate" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_PhysEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAturPhysEntry_t pData; + DSL_char_t buf[256]; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAturPhysEntry_t)); + + sscanf (pCommands, "%x", &flags); + pData.flags = flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_PHYS_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_ArraySPrintF(buf, pData.serial_no, + sizeof(pData.serial_no), sizeof(pData.serial_no[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, DSL_CPE_RET"flags=0x%x serial_no=%s ", + DSL_CPE_RET_VAL(ret), pData.flags, buf); + + DSL_CPE_ArraySPrintF(buf, pData.vendor_id.vendor_id, + sizeof(pData.vendor_id.vendor_id), sizeof(pData.vendor_id.vendor_id[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "vendor_id=%s ", buf); + + DSL_CPE_FPrintf (out, "country_code=0x%x ", pData.vendor_id.vendor_info.country_code); + + DSL_CPE_ArraySPrintF(buf, pData.vendor_id.vendor_info.provider_id, + sizeof(pData.vendor_id.vendor_info.provider_id), sizeof(pData.vendor_id.vendor_info.provider_id[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "provider_id=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.vendor_id.vendor_info.revision_info, + sizeof(pData.vendor_id.vendor_info.revision_info), sizeof(pData.vendor_id.vendor_info.revision_info[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "revision_info=%s ", buf); + + DSL_CPE_ArraySPrintF(buf, pData.version_no, + sizeof(pData.version_no), sizeof(pData.version_no[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_FPrintf (out, "version_no=%s ", buf); + + DSL_CPE_FPrintf (out, "Attn=%d SnrMgn=%d ", pData.Attn, pData.SnrMgn); + + DSL_CPE_FPrintf (out, "status=%d ", pData.status); + DSL_CPE_FPrintf (out, "outputPwr=%d ", pData.outputPwr); + DSL_CPE_FPrintf (out, "attainableRate=%d"DSL_CPE_CRLF, pData.attainableRate); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAtucceg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + " interleaver delay = 0x1" DSL_CPE_CRLF + " curr tx rate = 0x2" DSL_CPE_CRLF + " prev tx rate = 0x4" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t interleaveDelay" DSL_CPE_CRLF + "- DSL_uint32_t currTxRate" DSL_CPE_CRLF + "- DSL_uint32_t prevTxRate" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_ChanEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAtucChanInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAtucChanInfo_t)); + + sscanf (pCommands, "%x", &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_CHAN_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"flags=0x%x interleaveDelay=%d currTxRate=%d prevTxRate=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, pData.interleaveDelay, pData.currTxRate, pData.prevTxRate); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAturceg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + " interleaver delay = 0x1" DSL_CPE_CRLF + " curr tx rate = 0x2" DSL_CPE_CRLF + " prev tx rate = 0x4" DSL_CPE_CRLF + " crc blk length = 0x8" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t interleaveDelay" DSL_CPE_CRLF + "- DSL_uint32_t currTxRate" DSL_CPE_CRLF + "- DSL_uint32_t prevTxRate" DSL_CPE_CRLF + "- DSL_uint32_t crcBlkLen" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_ChanEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAturChanInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAturChanInfo_t)); + + sscanf (pCommands, "%x", &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_CHAN_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"flags=0x%x interleaveDelay=%d currTxRate=%d prevTxRate=%d " + "crcBlkLen=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, pData.interleaveDelay, pData.currTxRate, pData.prevTxRate, pData.crcBlkLen); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +static const DSL_char_t g_sMibAturpdeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " LOFS = 0x1" DSL_CPE_CRLF + " LOSS = 0x2" DSL_CPE_CRLF + " LPR = 0x4" DSL_CPE_CRLF + " ESS = 0x8" DSL_CPE_CRLF + " valid intervals = 0x10" DSL_CPE_CRLF + " invalid intervals = 0x20" DSL_CPE_CRLF + " 15min elapsed = 0x40" DSL_CPE_CRLF + " 15min LOFS = 0x80" DSL_CPE_CRLF + " 15min LOSS = 0x100" DSL_CPE_CRLF + " 15min LPR = 0x200" DSL_CPE_CRLF + " 15min ESS = 0x400" DSL_CPE_CRLF + " 1day elapsed = 0x800" DSL_CPE_CRLF + " 1day LOFS = 0x1000" DSL_CPE_CRLF + " 1day LOSS = 0x2000" DSL_CPE_CRLF + " 1day LPR = 0x4000" DSL_CPE_CRLF + " 1day ESS = 0x8000" DSL_CPE_CRLF + " 1day elapsed prev = 0x10000" DSL_CPE_CRLF + " 1day LOFS prev = 0x20000" DSL_CPE_CRLF + " 1day LOSS prev = 0x40000" DSL_CPE_CRLF + " 1day LPR prev = 0x80000" DSL_CPE_CRLF + " 1day ESS prev = 0x100000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfLprs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfESs" DSL_CPE_CRLF + "- DSL_int_t adslAturPerfValidIntervals" DSL_CPE_CRLF + "- DSL_int_t adslAturPerfInvalidIntervals" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr15MinTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr15MinLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr15MinLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr15MinLprs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr15MinESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr1DayTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr1DayLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr1DayLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr1DayLprs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr1DayESs" DSL_CPE_CRLF + "- DSL_int_t adslAturPerfPrev1DayMoniSecs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfPrev1DayLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfPrev1DayLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfPrev1DayLprs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfPrev1DayESs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_PerfDataEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + aturPerfDataEntry_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(aturPerfDataEntry_t)); + + sscanf (pCommands, "%x", &pData.flags); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_PERF_DATA_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAturPerfLofs=%d adslAturPerfLoss=%d adslAturPerfLprs=%d " + "adslAturPerfESs=%d adslAturPerfValidIntervals=%d adslAturPerfInvalidIntervals=%d " + "adslAturPerfCurr15MinTimeElapsed=%d adslAturPerfCurr15MinLofs=%d " + "adslAturPerfCurr15MinLoss=%d adslAturPerfCurr15MinLprs=%d " + "adslAturPerfCurr15MinESs=%d adslAturPerfCurr1DayTimeElapsed=%d " + "adslAturPerfCurr1DayLofs=%d adslAturPerfCurr1DayLoss=%d " + "adslAturPerfCurr1DayLprs=%d adslAturPerfCurr1DayESs=%d " + "adslAturPerfPrev1DayMoniSecs=%d adslAturPerfPrev1DayLofs=%d " + "adslAturPerfPrev1DayLoss=%d adslAturPerfPrev1DayLprs=%d " + "adslAturPerfPrev1DayESs=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAturPerfLofs, + pData.adslAturPerfLoss, + pData.adslAturPerfLprs, + pData.adslAturPerfESs, + pData.adslAturPerfValidIntervals, + pData.adslAturPerfInvalidIntervals, + pData.adslAturPerfCurr15MinTimeElapsed, + pData.adslAturPerfCurr15MinLofs, + pData.adslAturPerfCurr15MinLoss, + pData.adslAturPerfCurr15MinLprs, + pData.adslAturPerfCurr15MinESs, + pData.adslAturPerfCurr1DayTimeElapsed, + pData.adslAturPerfCurr1DayLofs, + pData.adslAturPerfCurr1DayLoss, + pData.adslAturPerfCurr1DayLprs, + pData.adslAturPerfCurr1DayESs, + pData.adslAturPerfPrev1DayMoniSecs, + pData.adslAturPerfPrev1DayLofs, + pData.adslAturPerfPrev1DayLoss, + pData.adslAturPerfPrev1DayLprs, + pData.adslAturPerfPrev1DayESs); + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAtucpdeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " LOFS = 0x1" DSL_CPE_CRLF + " LOSS = 0x2" DSL_CPE_CRLF + " ESS = 0x4" DSL_CPE_CRLF + " INITS = 0x8" DSL_CPE_CRLF + " valid intervals = 0x10" DSL_CPE_CRLF + " invalid intervals = 0x20" DSL_CPE_CRLF + " 15min elapsed = 0x40" DSL_CPE_CRLF + " 15min LOFS = 0x80" DSL_CPE_CRLF + " 15min LOSS = 0x100" DSL_CPE_CRLF + " 15min ESS = 0x200" DSL_CPE_CRLF + " 15min INIT = 0x400" DSL_CPE_CRLF + " 1day elapsed = 0x800" DSL_CPE_CRLF + " 1day LOFS = 0x1000" DSL_CPE_CRLF + " 1day LOSS = 0x2000" DSL_CPE_CRLF + " 1day ESS = 0x4000" DSL_CPE_CRLF + " 1day INIT = 0x8000" DSL_CPE_CRLF + " 1day elapsed prev = 0x10000" DSL_CPE_CRLF + " 1day LOFS prev = 0x20000" DSL_CPE_CRLF + " 1day LOSS prev = 0x40000" DSL_CPE_CRLF + " 1day ESS prev = 0x80000" DSL_CPE_CRLF + " 1day INIT prev = 0x100000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfInits" DSL_CPE_CRLF + "- DSL_int_t adslAtucPerfValidIntervals" DSL_CPE_CRLF + "- DSL_int_t adslAtucPerfInvalidIntervals" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinInits" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayInits" DSL_CPE_CRLF + "- DSL_int_t adslAtucPerfPrev1DayMoniSecs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DayLofs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DayLoss" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DayESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DayInits" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_PerfDataEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + atucPerfDataEntry_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(atucPerfDataEntry_t)); + + sscanf (pCommands, "%x", &pData.flags); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_PERF_DATA_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x adslAtucPerfLofs=%d adslAtucPerfLoss=%d adslAtucPerfESs=%d " + "adslAtucPerfInits=%d adslAtucPerfValidIntervals=%d adslAtucPerfInvalidIntervals=%d " + "adslAtucPerfCurr15MinTimeElapsed=%d adslAtucPerfCurr15MinLofs=%d " + "adslAtucPerfCurr15MinLoss=%d adslAtucPerfCurr15MinESs=%d " + "adslAtucPerfCurr15MinInits=%d adslAtucPerfCurr1DayTimeElapsed=%d " + "adslAtucPerfCurr1DayLofs=%d adslAtucPerfCurr1DayLoss=%d " + "adslAtucPerfCurr1DayESs=%d adslAtucPerfCurr1DayInits=%d " + "adslAtucPerfPrev1DayMoniSecs=%d adslAtucPerfPrev1DayLofs=%d " + "adslAtucPerfPrev1DayLoss=%d adslAtucPerfPrev1DayESs=%d " + "adslAtucPerfPrev1DayInits=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAtucPerfLofs, + pData.adslAtucPerfLoss, + pData.adslAtucPerfESs, + pData.adslAtucPerfInits, + pData.adslAtucPerfValidIntervals, + pData.adslAtucPerfInvalidIntervals, + pData.adslAtucPerfCurr15MinTimeElapsed, + pData.adslAtucPerfCurr15MinLofs, + pData.adslAtucPerfCurr15MinLoss, + pData.adslAtucPerfCurr15MinESs, + pData.adslAtucPerfCurr15MinInits, + pData.adslAtucPerfCurr1DayTimeElapsed, + pData.adslAtucPerfCurr1DayLofs, + pData.adslAtucPerfCurr1DayLoss, + pData.adslAtucPerfCurr1DayESs, + pData.adslAtucPerfCurr1DayInits, + pData.adslAtucPerfPrev1DayMoniSecs, + pData.adslAtucPerfPrev1DayLofs, + pData.adslAtucPerfPrev1DayLoss, + pData.adslAtucPerfPrev1DayESs, + pData.adslAtucPerfPrev1DayInits); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sMibAtucieg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_int_t IntervalNumber" DSL_CPE_CRLF + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " LOF = 0x1" DSL_CPE_CRLF + " LOS = 0x2" DSL_CPE_CRLF + " ESS = 0x4" DSL_CPE_CRLF + " INIT = 0x8" DSL_CPE_CRLF + " VALID DATA = 0x10" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t intervalLOF" DSL_CPE_CRLF + "- DSL_uint32_t intervalLOS" DSL_CPE_CRLF + "- DSL_uint32_t intervalES" DSL_CPE_CRLF + "- DSL_uint32_t intervalInits" DSL_CPE_CRLF + "- DSL_int_t intervalValidData" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_IntervalEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAtucIntvlInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAtucIntvlInfo_t)); + + sscanf (pCommands, "%d %x", &pData.IntervalNumber, &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_INTERVAL_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "intervalLOF=%d intervalLOS=%d intervalES=%d " + "intervalInits=%d intervalValidData=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.intervalLOF, + pData.intervalLOS, + pData.intervalES, + pData.intervalInits, + pData.intervalValidData); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAturieg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_int_t IntervalNumber" DSL_CPE_CRLF + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " LOF = 0x1" DSL_CPE_CRLF + " LOS = 0x2" DSL_CPE_CRLF + " LPR = 0x4" DSL_CPE_CRLF + " ESS = 0x8" DSL_CPE_CRLF + " VALID DATA = 0x10" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t intervalLOF" DSL_CPE_CRLF + "- DSL_uint32_t intervalLOS" DSL_CPE_CRLF + "- DSL_uint32_t intervalLPR" DSL_CPE_CRLF + "- DSL_uint32_t intervalES" DSL_CPE_CRLF + "- DSL_int_t intervalValidData" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_IntervalEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAturIntvlInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAturIntvlInfo_t)); + + sscanf (pCommands, "%d %x", &pData.IntervalNumber, &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_INTERVAL_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "intervalLOF=%d intervalLOS=%d intervalLPR=%d " + "intervalES=%d intervalValidData=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.intervalLOF, + pData.intervalLOS, + pData.intervalLPR, + pData.intervalES, + pData.intervalValidData); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_HISTORY*/ +#endif /* INCLUDE_DSL_CPE_PM_LINE_COUNTERS*/ + +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS +static const DSL_char_t g_sMibAtuccpdeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " recv_blk = 0x1" DSL_CPE_CRLF + " tx_blk = 0x2" DSL_CPE_CRLF + " corr_blk = 0x4" DSL_CPE_CRLF + " uncorr_blk = 0x8" DSL_CPE_CRLF + " valid intervals = 0x10" DSL_CPE_CRLF + " invalid intervals = 0x20" DSL_CPE_CRLF + " 15min time elapsed = 0x40" DSL_CPE_CRLF + " 15min recv_blk = 0x80" DSL_CPE_CRLF + " 15min tx_blk = 0x100" DSL_CPE_CRLF + " 15min corr_blk = 0x200" DSL_CPE_CRLF + " 15min uncorr_blk = 0x400" DSL_CPE_CRLF + " 1day time elapsed = 0x800" DSL_CPE_CRLF + " 1day recv_blk = 0x1000" DSL_CPE_CRLF + " 1day tx_blk = 0x2000" DSL_CPE_CRLF + " 1day corr_blk = 0x4000" DSL_CPE_CRLF + " 1day uncorr_blk = 0x8000" DSL_CPE_CRLF + " prev 1day time elapsed = 0x10000" DSL_CPE_CRLF + " prev 1day recv_blk = 0x20000" DSL_CPE_CRLF + " prev 1day tx_blk = 0x40000" DSL_CPE_CRLF + " prev 1day corr_blk = 0x80000" DSL_CPE_CRLF + " prev 1day uncorr_blk = 0x100000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanUncorrectBlks" DSL_CPE_CRLF + "- DSL_int_t adslAtucChanPerfValidIntervals" DSL_CPE_CRLF + "- DSL_int_t adslAtucChanPerfInvalidIntervals" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr15MinTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr15MinReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr15MinTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr15MinCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr15MinUncorrectBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr1DayTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr1DayReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr1DayTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr1DayCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfCurr1DayUncorrectBlks" DSL_CPE_CRLF + "- DSL_int_t adslAtucChanPerfPrev1DayMoniSecs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfPrev1DayReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfPrev1DayTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfPrev1DayCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucChanPerfPrev1DayUncorrectBlks" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_ChanPerfDataEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + atucChannelPerfDataEntry_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(atucChannelPerfDataEntry_t)); + + sscanf (pCommands, "%x", &pData.flags); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_CHAN_PERF_DATA_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAtucChanReceivedBlks=%d adslAtucChanTransmittedBlks=%d " + "adslAtucChanCorrectedBlks=%d adslAtucChanUncorrectBlks=%d " + "adslAtucChanPerfValidIntervals=%d adslAtucChanPerfInvalidIntervals=%d " + "adslAtucChanPerfCurr15MinTimeElapsed=%d adslAtucChanPerfCurr15MinReceivedBlks=%d " + "adslAtucChanPerfCurr15MinTransmittedBlks=%d adslAtucChanPerfCurr15MinCorrectedBlks=%d " + "adslAtucChanPerfCurr15MinUncorrectBlks=%d adslAtucChanPerfCurr1DayTimeElapsed=%d " + "adslAtucChanPerfCurr1DayReceivedBlks=%d adslAtucChanPerfCurr1DayTransmittedBlks=%d " + "adslAtucChanPerfCurr1DayCorrectedBlks=%d adslAtucChanPerfCurr1DayUncorrectBlks=%d " + "adslAtucChanPerfPrev1DayMoniSecs=%d adslAtucChanPerfPrev1DayReceivedBlks=%d " + "adslAtucChanPerfPrev1DayTransmittedBlks=%d adslAtucChanPerfPrev1DayCorrectedBlks=%d " + "adslAtucChanPerfPrev1DayUncorrectBlks=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAtucChanReceivedBlks, + pData.adslAtucChanTransmittedBlks, + pData.adslAtucChanCorrectedBlks, + pData.adslAtucChanUncorrectBlks, + pData.adslAtucChanPerfValidIntervals, + pData.adslAtucChanPerfInvalidIntervals, + pData.adslAtucChanPerfCurr15MinTimeElapsed, + pData.adslAtucChanPerfCurr15MinReceivedBlks, + pData.adslAtucChanPerfCurr15MinTransmittedBlks, + pData.adslAtucChanPerfCurr15MinCorrectedBlks, + pData.adslAtucChanPerfCurr15MinUncorrectBlks, + pData.adslAtucChanPerfCurr1DayTimeElapsed, + pData.adslAtucChanPerfCurr1DayReceivedBlks, + pData.adslAtucChanPerfCurr1DayTransmittedBlks, + pData.adslAtucChanPerfCurr1DayCorrectedBlks, + pData.adslAtucChanPerfCurr1DayUncorrectBlks, + pData.adslAtucChanPerfPrev1DayMoniSecs, + pData.adslAtucChanPerfPrev1DayReceivedBlks, + pData.adslAtucChanPerfPrev1DayTransmittedBlks, + pData.adslAtucChanPerfPrev1DayCorrectedBlks, + pData.adslAtucChanPerfPrev1DayUncorrectBlks); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAturcpdeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " recv_blk = 0x1" DSL_CPE_CRLF + " tx_blk = 0x2" DSL_CPE_CRLF + " corr_blk = 0x4" DSL_CPE_CRLF + " uncorr_blk = 0x8" DSL_CPE_CRLF + " valid intervals = 0x10" DSL_CPE_CRLF + " invalid intervals = 0x20" DSL_CPE_CRLF + " 15min time elapsed = 0x40" DSL_CPE_CRLF + " 15min recv_blk = 0x80" DSL_CPE_CRLF + " 15min tx_blk = 0x100" DSL_CPE_CRLF + " 15min corr_blk = 0x200" DSL_CPE_CRLF + " 15min uncorr_blk = 0x400" DSL_CPE_CRLF + " 1day time elapsed = 0x800" DSL_CPE_CRLF + " 1day recv_blk = 0x1000" DSL_CPE_CRLF + " 1day tx_blk = 0x2000" DSL_CPE_CRLF + " 1day corr_blk = 0x4000" DSL_CPE_CRLF + " 1day uncorr_blk = 0x8000" DSL_CPE_CRLF + " prev 1day time elapsed = 0x10000" DSL_CPE_CRLF + " prev 1day recv_blk = 0x20000" DSL_CPE_CRLF + " prev 1day tx_blk = 0x40000" DSL_CPE_CRLF + " prev 1day corr_blk = 0x80000" DSL_CPE_CRLF + " prev 1day uncorr_blk = 0x100000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanUncorrectBlks" DSL_CPE_CRLF + "- DSL_int_t adslAturChanPerfValidIntervals" DSL_CPE_CRLF + "- DSL_int_t adslAturChanPerfInvalidIntervals" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr15MinTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr15MinReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr15MinTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr15MinCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr15MinUncorrectBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr1DayTimeElapsed" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr1DayReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr1DayTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr1DayCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfCurr1DayUncorrectBlks" DSL_CPE_CRLF + "- DSL_int_t adslAturChanPerfPrev1DayMoniSecs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfPrev1DayReceivedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfPrev1DayTransmittedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfPrev1DayCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t adslAturChanPerfPrev1DayUncorrectBlks" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_ChanPerfDataEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + aturChannelPerfDataEntry_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(aturChannelPerfDataEntry_t)); + + sscanf (pCommands, "%x", &pData.flags); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_CHAN_PERF_DATA_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAturChanReceivedBlks=%d adslAturChanTransmittedBlks=%d " + "adslAturChanCorrectedBlks=%d adslAturChanUncorrectBlks=%d " + "adslAturChanPerfValidIntervals=%d adslAturChanPerfInvalidIntervals=%d " + "adslAturChanPerfCurr15MinTimeElapsed=%d adslAturChanPerfCurr15MinReceivedBlks=%d " + "adslAturChanPerfCurr15MinTransmittedBlks=%d adslAturChanPerfCurr15MinCorrectedBlks=%d " + "adslAturChanPerfCurr15MinUncorrectBlks=%d adslAturChanPerfCurr1DayTimeElapsed=%d " + "adslAturChanPerfCurr1DayReceivedBlks=%d adslAturChanPerfCurr1DayTransmittedBlks=%d " + "adslAturChanPerfCurr1DayCorrectedBlks=%d adslAturChanPerfCurr1DayUncorrectBlks=%d " + "adslAturChanPerfPrev1DayMoniSecs=%d adslAturChanPerfPrev1DayReceivedBlks=%d " + "adslAturChanPerfPrev1DayTransmittedBlks=%d adslAturChanPerfPrev1DayCorrectedBlks=%d " + "adslAturChanPerfPrev1DayUncorrectBlks=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAturChanReceivedBlks, + pData.adslAturChanTransmittedBlks, + pData.adslAturChanCorrectedBlks, + pData.adslAturChanUncorrectBlks, + pData.adslAturChanPerfValidIntervals, + pData.adslAturChanPerfInvalidIntervals, + pData.adslAturChanPerfCurr15MinTimeElapsed, + pData.adslAturChanPerfCurr15MinReceivedBlks, + pData.adslAturChanPerfCurr15MinTransmittedBlks, + pData.adslAturChanPerfCurr15MinCorrectedBlks, + pData.adslAturChanPerfCurr15MinUncorrectBlks, + pData.adslAturChanPerfCurr1DayTimeElapsed, + pData.adslAturChanPerfCurr1DayReceivedBlks, + pData.adslAturChanPerfCurr1DayTransmittedBlks, + pData.adslAturChanPerfCurr1DayCorrectedBlks, + pData.adslAturChanPerfCurr1DayUncorrectBlks, + pData.adslAturChanPerfPrev1DayMoniSecs, + pData.adslAturChanPerfPrev1DayReceivedBlks, + pData.adslAturChanPerfPrev1DayTransmittedBlks, + pData.adslAturChanPerfPrev1DayCorrectedBlks, + pData.adslAturChanPerfPrev1DayUncorrectBlks); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sMibAtuccieg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_int_t IntervalNumber" DSL_CPE_CRLF + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " interval num = 0x1" DSL_CPE_CRLF + " recv_blk = 0x2" DSL_CPE_CRLF + " tx_blk = 0x4" DSL_CPE_CRLF + " corr_blk = 0x8" DSL_CPE_CRLF + " uncorr_blk = 0x10" DSL_CPE_CRLF + " interval valid = 0x20" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalRecvdBlks" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalXmitBlks" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalUncorrectBlks" DSL_CPE_CRLF + "- DSL_int_t intervalValidData" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_ChanIntervalEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAtucChanIntvlInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAtucChanIntvlInfo_t)); + + sscanf (pCommands, "%d %x", &pData.IntervalNumber, &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_CHAN_INTERVAL_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "chanIntervalRecvdBlks=%d chanIntervalXmitBlks=%d chanIntervalCorrectedBlks=%d " + "chanIntervalUncorrectBlks=%d intervalValidData=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.chanIntervalRecvdBlks, + pData.chanIntervalXmitBlks, + pData.chanIntervalCorrectedBlks, + pData.chanIntervalUncorrectBlks, + pData.intervalValidData); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAturcieg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_int_t IntervalNumber" DSL_CPE_CRLF + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " interval num = 0x1" DSL_CPE_CRLF + " recv_blk = 0x2" DSL_CPE_CRLF + " tx_blk = 0x4" DSL_CPE_CRLF + " corr_blk = 0x8" DSL_CPE_CRLF + " uncorr_blk = 0x10" DSL_CPE_CRLF + " interval valid = 0x20" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalRecvdBlks" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalXmitBlks" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalCorrectedBlks" DSL_CPE_CRLF + "- DSL_uint32_t chanIntervalUncorrectBlks" DSL_CPE_CRLF + "- DSL_int_t intervalValidData" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_ChanIntervalEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAturChanIntvlInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAturChanIntvlInfo_t)); + + sscanf (pCommands, "%d %x", &pData.IntervalNumber, &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_CHAN_INTERVAL_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "chanIntervalRecvdBlks=%d chanIntervalXmitBlks=%d chanIntervalCorrectedBlks=%d " + "chanIntervalUncorrectBlks=%d intervalValidData=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.chanIntervalRecvdBlks, + pData.chanIntervalXmitBlks, + pData.chanIntervalCorrectedBlks, + pData.chanIntervalUncorrectBlks, + pData.intervalValidData); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} +#endif /* INCLUDE_DSL_CPE_PM_HISTORY*/ +#endif /* INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS*/ + +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +static const DSL_char_t g_sMibAtucpdeeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " FASTR = 0x1" DSL_CPE_CRLF + " FAILED_FASTR = 0x2" DSL_CPE_CRLF + " SESL = 0x4" DSL_CPE_CRLF + " UASL = 0x8" DSL_CPE_CRLF + " 15min FASTR = 0x10" DSL_CPE_CRLF + " 15min FAILED_FASTR = 0x20" DSL_CPE_CRLF + " 15min SESL = 0x40" DSL_CPE_CRLF + " 15min UASL = 0x80" DSL_CPE_CRLF + " 1day FASTR = 0x100" DSL_CPE_CRLF + " 1day FAILED_FASTR = 0x200" DSL_CPE_CRLF + " 1day SESL = 0x400" DSL_CPE_CRLF + " 1day UASL = 0x800" DSL_CPE_CRLF + " 1day FASTR prev = 0x1000" DSL_CPE_CRLF + " 1day FAILED_FASTR prev = 0x2000" DSL_CPE_CRLF + " 1day SESL prev = 0x4000" DSL_CPE_CRLF + " 1day UASL prev = 0x8000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfStatFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfStatFailedFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfStatSesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfStatUasL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinFailedFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinSesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr15MinUasL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayFailedFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DaySesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfCurr1DayUasL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DayFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DayFailedFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DaySesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucPerfPrev1DayUasL" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_PerfDataExtEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + atucPerfDataExtEntry_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(atucPerfDataExtEntry_t)); + + sscanf (pCommands, "%x", &pData.flags); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_PERF_DATA_EXT_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAtucPerfStatFastR=%d adslAtucPerfStatFailedFastR=%d " + "adslAtucPerfStatSesL=%d adslAtucPerfStatUasL=%d " + "adslAtucPerfCurr15MinFastR=%d adslAtucPerfCurr15MinFailedFastR=%d " + "adslAtucPerfCurr15MinSesL=%d adslAtucPerfCurr15MinUasL=%d " + "adslAtucPerfCurr1DayFastR=%d adslAtucPerfCurr1DayFailedFastR=%d " + "adslAtucPerfCurr1DaySesL=%d adslAtucPerfCurr1DayUasL=%d " + "adslAtucPerfPrev1DayFastR=%d adslAtucPerfPrev1DayFailedFastR=%d " + "adslAtucPerfPrev1DaySesL=%d adslAtucPerfPrev1DayUasL=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAtucPerfStatFastR, + pData.adslAtucPerfStatFailedFastR, + pData.adslAtucPerfStatSesL, + pData.adslAtucPerfStatUasL, + pData.adslAtucPerfCurr15MinFastR, + pData.adslAtucPerfCurr15MinFailedFastR, + pData.adslAtucPerfCurr15MinSesL, + pData.adslAtucPerfCurr15MinUasL, + pData.adslAtucPerfCurr1DayFastR, + pData.adslAtucPerfCurr1DayFailedFastR, + pData.adslAtucPerfCurr1DaySesL, + pData.adslAtucPerfCurr1DayUasL, + pData.adslAtucPerfPrev1DayFastR, + pData.adslAtucPerfPrev1DayFailedFastR, + pData.adslAtucPerfPrev1DaySesL, + pData.adslAtucPerfPrev1DayUasL); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAturpdeeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " SESL = 0x1" DSL_CPE_CRLF + " UASL = 0x2" DSL_CPE_CRLF + " 15min SESL = 0x4" DSL_CPE_CRLF + " 15min UASL = 0x8" DSL_CPE_CRLF + " 1day SESL = 0x10" DSL_CPE_CRLF + " 1day UASL = 0x20" DSL_CPE_CRLF + " 1day SESL prev = 0x40" DSL_CPE_CRLF + " 1day UASL prev = 0x80" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfStatSesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfStatUasL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr15MinSesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr15MinUasL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr1DaySesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfCurr1DayUasL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfPrev1DaySesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturPerfPrev1DayUasL" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_PerfDataExtEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + aturPerfDataExtEntry_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(aturPerfDataExtEntry_t)); + + sscanf (pCommands, "%x", &pData.flags); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_PERF_DATA_EXT_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAturPerfStatSesL=%d adslAturPerfStatUasL=%d " + "adslAturPerfCurr15MinFastR=%d adslAturPerfCurr15MinFailedFastR=%d " + "adslAturPerfCurr15MinSesL=%d adslAturPerfCurr15MinUasL=%d " + "adslAturPerfCurr1DaySesL=%d adslAturPerfCurr1DayUasL=%d " + "adslAturPerfPrev1DaySesL=%d adslAturPerfPrev1DayUasL=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAturPerfStatSesL, + pData.adslAturPerfStatUasL, + pData.adslAturPerfCurr15MinSesL, + pData.adslAturPerfCurr15MinUasL, + pData.adslAturPerfCurr1DaySesL, + pData.adslAturPerfCurr1DayUasL, + pData.adslAturPerfPrev1DaySesL, + pData.adslAturPerfPrev1DayUasL); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +static const DSL_char_t g_sMibAtucieeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_int_t IntervalNumber" DSL_CPE_CRLF + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " FASTR = 0x1" DSL_CPE_CRLF + " FAILED_FASTR = 0x2" DSL_CPE_CRLF + " SESL = 0x4" DSL_CPE_CRLF + " UASL = 0x8" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucIntervalFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucIntervalFailedFastR" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucIntervalSesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucIntervalUasL" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUC_IntervalExtEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAtucInvtlExtInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAtucInvtlExtInfo_t)); + + sscanf (pCommands, "%d %x", &pData.IntervalNumber, &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUC_INTERVAL_EXT_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAtucIntervalFastR=%d adslAtucIntervalFailedFastR=%d " + "adslAtucIntervalSesL=%d adslAtucIntervalUasL=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAtucIntervalFastR, + pData.adslAtucIntervalFailedFastR, + pData.adslAtucIntervalSesL, + pData.adslAtucIntervalUasL); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibAturieeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_int_t IntervalNumber" DSL_CPE_CRLF + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " SESL = 0x1" DSL_CPE_CRLF + " UASL = 0x2" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_uint32_t adslAturIntervalSesL" DSL_CPE_CRLF + "- DSL_uint32_t adslAturIntervalUasL" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ATUR_IntervalExtEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAturInvtlExtInfo_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAturInvtlExtInfo_t)); + + sscanf (pCommands, "%d %x", &pData.IntervalNumber, &flags); + pData.flags = (DSL_uint8_t)flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_ATUR_INTERVAL_EXT_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAturIntervalSesL=%d adslAturIntervalUasL=%d"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAturIntervalSesL, + pData.adslAturIntervalUasL); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} +#endif /*INCLUDE_DSL_CPE_PM_HISTORY*/ +#endif /* INCLUDE_DSL_CPE_PM_LINE_COUNTERS*/ +#endif /* INCLUDE_DSL_PM*/ + +static const DSL_char_t g_sMibLacpeg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " ATUC 15min LOFS = 0x1" DSL_CPE_CRLF + " ATUC 15min LOSS = 0x2" DSL_CPE_CRLF + " ATUC 15min ESS = 0x4" DSL_CPE_CRLF + " ATUC fast rate UP = 0x8" DSL_CPE_CRLF + " ATUC interleave rate UP = 0x10" DSL_CPE_CRLF + " ATUC fast rate DOWN = 0x20" DSL_CPE_CRLF + " ATUC interleave rate DOWN = 0x40" DSL_CPE_CRLF + " ATUC failure trap = 0x80" DSL_CPE_CRLF + " ATUR 15min LOFS = 0x100" DSL_CPE_CRLF + " ATUR 15min LOSS = 0x200" DSL_CPE_CRLF + " ATUR 15min LPRS = 0x400" DSL_CPE_CRLF + " ATUR 15min ESS = 0x800" DSL_CPE_CRLF + " ATUR fast rate UP = 0x1000" DSL_CPE_CRLF + " ATUR interleave rate UP = 0x2000" DSL_CPE_CRLF + " ATUR fast rate DOWN = 0x4000" DSL_CPE_CRLF + " ATUR interleave rate DOWN = 0x8000" DSL_CPE_CRLF + " row status = 0x10000" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + "- DSL_int_t adslAtucThresh15MinLofs" DSL_CPE_CRLF + "- DSL_int_t adslAtucThresh15MinLoss" DSL_CPE_CRLF + "- DSL_int_t adslAtucThresh15MinESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshFastRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshInterleaveRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshFastRateDown" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshInterleaveRateDown" DSL_CPE_CRLF + "- DSL_int_t adslAtucInitFailureTrapEnable" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinLofs" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinLoss" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinLprs" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshFastRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshInterleaveRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshFastRateDown" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshInterleaveRateDown" DSL_CPE_CRLF + "- DSL_int_t adslLineAlarmConfProfileRowStatus" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_LineAlarmConfProfileEntryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslLineAlarmConfProfileEntry_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslLineAlarmConfProfileEntry_t)); + + sscanf (pCommands, "%x", &flags); + pData.flags = flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_LINE_ALARM_CONF_PROFILE_ENTRY_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x " + "adslAtucThresh15MinLofs=%u adslAtucThresh15MinLoss=%u " + "adslAtucThresh15MinESs=%u adslAtucThreshFastRateUp=%u " + "adslAtucThreshInterleaveRateUp=%u adslAtucThreshFastRateDown=%u " + "adslAtucThreshInterleaveRateDown=%u adslAtucInitFailureTrapEnable=%u " + "adslAturThresh15MinLofs=%u adslAturThresh15MinLoss=%u " + "adslAturThresh15MinLprs=%u adslAturThresh15MinESs=%u " + "adslAturThreshFastRateUp=%u adslAturThreshInterleaveRateUp=%u " + "adslAturThreshFastRateDown=%u adslAturThreshInterleaveRateDown=%u " + "adslLineAlarmConfProfileRowStatus=%u"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + pData.flags, + pData.adslAtucThresh15MinLofs, + pData.adslAtucThresh15MinLoss, + pData.adslAtucThresh15MinESs, + pData.adslAtucThreshFastRateUp, + pData.adslAtucThreshInterleaveRateUp, + pData.adslAtucThreshFastRateDown, + pData.adslAtucThreshInterleaveRateDown, + pData.adslAtucInitFailureTrapEnable, + pData.adslAturThresh15MinLofs, + pData.adslAturThresh15MinLoss, + pData.adslAturThresh15MinLprs, + pData.adslAturThresh15MinESs, + pData.adslAturThreshFastRateUp, + pData.adslAturThreshInterleaveRateUp, + pData.adslAturThreshFastRateDown, + pData.adslAturThreshInterleaveRateDown, + pData.adslLineAlarmConfProfileRowStatus); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibLacpes[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + " ATUC 15min LOFS = 0x1" DSL_CPE_CRLF + " ATUC 15min LOSS = 0x2" DSL_CPE_CRLF + " ATUC 15min ESS = 0x4" DSL_CPE_CRLF + " ATUC fast rate UP = 0x8" DSL_CPE_CRLF + " ATUC interleave rate UP = 0x10" DSL_CPE_CRLF + " ATUC fast rate DOWN = 0x20" DSL_CPE_CRLF + " ATUC interleave rate DOWN = 0x40" DSL_CPE_CRLF + " ATUC failure trap = 0x80" DSL_CPE_CRLF + " ATUR 15min LOFS = 0x100" DSL_CPE_CRLF + " ATUR 15min LOSS = 0x200" DSL_CPE_CRLF + " ATUR 15min LPRS = 0x400" DSL_CPE_CRLF + " ATUR 15min ESS = 0x800" DSL_CPE_CRLF + " ATUR fast rate UP = 0x1000" DSL_CPE_CRLF + " ATUR interleave rate UP = 0x2000" DSL_CPE_CRLF + " ATUR fast rate DOWN = 0x4000" DSL_CPE_CRLF + " ATUR interleave rate DOWN = 0x8000" DSL_CPE_CRLF + " row status = 0x10000" DSL_CPE_CRLF + "- DSL_int_t adslAtucThresh15MinLofs" DSL_CPE_CRLF + "- DSL_int_t adslAtucThresh15MinLoss" DSL_CPE_CRLF + "- DSL_int_t adslAtucThresh15MinESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshFastRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshInterleaveRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshFastRateDown" DSL_CPE_CRLF + "- DSL_uint32_t adslAtucThreshInterleaveRateDown" DSL_CPE_CRLF + "- DSL_int_t adslAtucInitFailureTrapEnable" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinLofs" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinLoss" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinLprs" DSL_CPE_CRLF + "- DSL_int_t adslAturThresh15MinESs" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshFastRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshInterleaveRateUp" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshFastRateDown" DSL_CPE_CRLF + "- DSL_uint32_t adslAturThreshInterleaveRateDown" DSL_CPE_CRLF + "- DSL_int_t adslLineAlarmConfProfileRowStatus" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t flags (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_LineAlarmConfProfileEntrySet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslLineAlarmConfProfileEntry_t pData; + DSL_uint32_t flags = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 18, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslLineAlarmConfProfileEntry_t)); + + sscanf (pCommands, "%x %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + &flags, + &pData.adslAtucThresh15MinLofs, &pData.adslAtucThresh15MinLoss, + &pData.adslAtucThresh15MinESs, &pData.adslAtucThreshFastRateUp, + &pData.adslAtucThreshInterleaveRateUp, &pData.adslAtucThreshFastRateDown, + &pData.adslAtucThreshInterleaveRateDown, &pData.adslAtucInitFailureTrapEnable, + &pData.adslAturThresh15MinLofs, &pData.adslAturThresh15MinLoss, + &pData.adslAturThresh15MinLprs, &pData.adslAturThresh15MinESs, + &pData.adslAturThreshFastRateUp, &pData.adslAturThreshInterleaveRateUp, + &pData.adslAturThreshFastRateDown, &pData.adslAturThreshInterleaveRateDown, + &pData.adslLineAlarmConfProfileRowStatus); + + pData.flags = flags; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_LINE_ALARM_CONF_PROFILE_ENTRY_SET, (int) &pData); + + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + + return 0; +} + +static const DSL_char_t g_sMibTg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- adslAturTrapsFlags_t flags (hex)" DSL_CPE_CRLF + " ATUC LOFS = 0x1" DSL_CPE_CRLF + " ATUC LOSS = 0x2" DSL_CPE_CRLF + " ATUC ESS = 0x4" DSL_CPE_CRLF + " ATUC rate change = 0x8" DSL_CPE_CRLF + " ATUR LOFS = 0x10" DSL_CPE_CRLF + " ATUR LOSS = 0x20" DSL_CPE_CRLF + " ATUR LPRS = 0x40" DSL_CPE_CRLF + " ATUR ESS = 0x80" DSL_CPE_CRLF + " ATUR rate change = 0x100" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_TrapsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAturTrapsFlags_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAturTrapsFlags_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_TRAPS_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), pData); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +static const DSL_char_t g_sMibEtg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- adslAturExtTrapsFlags_t flags (hex)" DSL_CPE_CRLF + " ATUC 15min FAILED FASTR = 0x1" DSL_CPE_CRLF + " ATUC 15min SESL = 0x2" DSL_CPE_CRLF + " ATUC 15min UASL = 0x4" DSL_CPE_CRLF + " ATUR 15min SESL = 0x8" DSL_CPE_CRLF + " ATUR 15min UASL = 0x10" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MIB_ExtTrapsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + adslAturExtTrapsFlags_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(adslAturExtTrapsFlags_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_MIB_ADSL_EXT_TRAPS_GET, (int) &pData); + + if (ret < 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"flags=0x%x"DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), pData); + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF); + } + return 0; +} + +/** + Register the CLI commands. + + \param pContext Pointer to dsl library context structure, [I] + \param command optional parameters [I] +*/ +DSL_void_t DSL_CPE_CLI_MibCommandsRegister(DSL_void_t) +{ + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibleg", "MIB_LineEntryGet", DSL_CPE_CLI_MIB_LineEntryGet, g_sMibLeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibleeg", "MIB_LineExtEntryGet", DSL_CPE_CLI_MIB_LineExtEntryGet, g_sMibLeeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatucpeg", "MIB_ATUC_PhysEntryGet", DSL_CPE_CLI_MIB_ATUC_PhysEntryGet, g_sMibAtucpeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturpeg", "MIB_ATUR_PhysEntryGet", DSL_CPE_CLI_MIB_ATUR_PhysEntryGet, g_sMibAturpeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatucceg", "MIB_ATUC_ChanEntryGet", DSL_CPE_CLI_MIB_ATUC_ChanEntryGet, g_sMibAtucceg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturceg", "MIB_ATUR_ChanEntryGet", DSL_CPE_CLI_MIB_ATUR_ChanEntryGet, g_sMibAturceg); + + DSL_CPE_CLI_CMD_ADD_DEVICE ("miblacpeg", "MIB_LineAlarmConfProfileEntryGet", DSL_CPE_CLI_MIB_LineAlarmConfProfileEntryGet, g_sMibLacpeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("miblacpes", "MIB_LineAlarmConfProfileEntrySet", DSL_CPE_CLI_MIB_LineAlarmConfProfileEntrySet, g_sMibLacpes); + + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("mibtg", "MIB_TrapsGet", DSL_CPE_CLI_MIB_TrapsGet, g_sMibTg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("mibetg", "MIB_ExtTrapsGet", DSL_CPE_CLI_MIB_ExtTrapsGet, g_sMibEtg); + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_LINE_COUNTERS +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatucieg", "MIB_ATUC_IntervalEntryGet", DSL_CPE_CLI_MIB_ATUC_IntervalEntryGet, g_sMibAtucieg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturieg", "MIB_ATUR_IntervalEntryGet", DSL_CPE_CLI_MIB_ATUR_IntervalEntryGet, g_sMibAturieg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatucieeg", "MIB_ATUC_IntervalExtEntryGet", DSL_CPE_CLI_MIB_ATUC_IntervalExtEntryGet, g_sMibAtucieeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturieeg", "MIB_ATUR_IntervalExtEntryGet", DSL_CPE_CLI_MIB_ATUR_IntervalExtEntryGet, g_sMibAturieeg); +#endif /* INCLUDE_DSL_CPE_PM_HISTORY*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatucpdeg", "MIB_ATUC_PerfDataEntryGet", DSL_CPE_CLI_MIB_ATUC_PerfDataEntryGet, g_sMibAtucpdeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturpdeg", "MIB_ATUR_PerfDataEntryGet", DSL_CPE_CLI_MIB_ATUR_PerfDataEntryGet, g_sMibAturpdeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatucpdeeg", "MIB_ATUC_PerfDataExtEntryGet", DSL_CPE_CLI_MIB_ATUC_PerfDataExtEntryGet, g_sMibAtucpdeeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturpdeeg", "MIB_ATUR_PerfDataExtEntryGet", DSL_CPE_CLI_MIB_ATUR_PerfDataExtEntryGet, g_sMibAturpdeeg); +#endif /* INCLUDE_DSL_CPE_PM_LINE_COUNTERS*/ + +#ifdef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatuccpdeg", "MIB_ATUC_ChanPerfDataEntryGet", DSL_CPE_CLI_MIB_ATUC_ChanPerfDataEntryGet, g_sMibAtuccpdeg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturcpdeg", "MIB_ATUR_ChanPerfDataEntryGet", DSL_CPE_CLI_MIB_ATUR_ChanPerfDataEntryGet, g_sMibAturcpdeg); +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibatuccieg", "MIB_ATUC_ChanIntervalEntryGet", DSL_CPE_CLI_MIB_ATUC_ChanIntervalEntryGet, g_sMibAtuccieg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("mibaturcieg", "MIB_ATUR_ChanIntervalEntryGet", DSL_CPE_CLI_MIB_ATUR_ChanIntervalEntryGet, g_sMibAturcieg); +#endif /* INCLUDE_DSL_CPE_PM_HISTORY*/ +#endif /* INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS*/ +#endif /* INCLUDE_DSL_PM*/ +} + +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT && INCLUDE_DSL_ADSL_MIB*/ diff --git a/src/dsl_cpe_cli_pipe.c b/src/dsl_cpe_cli_pipe.c new file mode 100644 index 0000000..0951212 --- /dev/null +++ b/src/dsl_cpe_cli_pipe.c @@ -0,0 +1,402 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL CPE Control Application command line interface for pipe +*/ + +#include "dsl_cpe_control.h" + +#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT + +#include "dsl_cpe_cli.h" + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_PIPE + + +#ifndef MAX_CLI_PIPES +#define MAX_CLI_PIPES 1 +#endif +#ifndef MAX_CLI_PIPE_CMD_LEN +#define MAX_CLI_PIPE_CMD_LEN 1024 +#endif + +#define PIPE_NAME_FORMAT "dsl_cpe%d_%s" +#define DTI_PIPE_NAME_FORMAT "dsl_cpe_dti%d_%s" + +#define PIPE_DEBUG 1 + +typedef struct Pipe_env_s Pipe_env_t; +struct Pipe_env_s +{ + /** reference to registered CLI */ + DSL_CLI_Context_t *pCLIContext; + /** running status of pipe task */ + volatile DSL_boolean_t bRun; + /** thread id of the pipe task */ + DSL_CPE_ThreadCtrl_t control; + /** number of this pipe interface */ + DSL_int_t number; + /** name of event pipe */ + DSL_char_t namePipeEvent[32]; + /** command buffer */ + DSL_char_t cmd_buffer[MAX_CLI_PIPE_CMD_LEN]; + DSL_CPE_File_t *pipe_in; + DSL_CPE_File_t *pipe_out; +}; + +#ifdef INCLUDE_DTI_AGENT_STANDALONE_SUPPORT +static Pipe_env_t PipeEnv[MAX_CLI_PIPES + 1]; +#else +static Pipe_env_t PipeEnv[MAX_CLI_PIPES]; +#endif /* INCLUDE_DTI_AGENT_STANDALONE_SUPPORT */ + +static DSL_Error_t DSL_CPE_Pipe_Exit(DSL_void_t *pContext); +static DSL_int_t DSL_CPE_Pipe_Task(DSL_CPE_Thread_Params_t *params); +static DSL_Error_t DSL_CPE_Pipe_Event(DSL_void_t *pContext, DSL_char_t *pMessage); +static DSL_Error_t DSL_CPE_Pipe_CreateCliEntry(DSL_CPE_Control_Context_t *pContext, + Pipe_env_t *pPipeEnv, + DSL_char_t *pipeNameFormat, + DSL_int_t nPipeNum); + +/******************************************************************************/ + +DSL_Error_t DSL_CPE_Pipe_Init(DSL_CPE_Control_Context_t *pContext) +{ + DSL_int_t i = 0; + DSL_Error_t ret = DSL_SUCCESS; + + for (i = 0; i < MAX_CLI_PIPES; i++) + { + ret = DSL_CPE_Pipe_CreateCliEntry(pContext, &PipeEnv[i], PIPE_NAME_FORMAT, i); + if (ret < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "DSL_CPE_Pipe_Init: could not create " + PIPE_NAME_FORMAT DSL_CPE_CRLF, i, " pipe")); + } + } + +#ifdef INCLUDE_DTI_AGENT_STANDALONE_SUPPORT + ret = DSL_CPE_Pipe_CreateCliEntry(pContext, + &PipeEnv[i], + DTI_PIPE_NAME_FORMAT, + i); + if (ret < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "DSL_CPE_Pipe_Init: could not create " + DTI_PIPE_NAME_FORMAT DSL_CPE_CRLF, MAX_CLI_PIPES, " pipe")); + } +#endif /* INCLUDE_DTI_AGENT_STANDALONE_SUPPORT */ + + return ret; +} + +DSL_Error_t DSL_CPE_Pipe_CreateCliEntry(DSL_CPE_Control_Context_t *pContext, + Pipe_env_t *pPipeEnv, + DSL_char_t *pipeNameFormat, + DSL_int_t nPipeNum) +{ + DSL_Error_t ret = DSL_SUCCESS; + DSL_char_t Name[32]; + + memset(pPipeEnv, 0, sizeof(Pipe_env_t)); + + /* remember own number */ + pPipeEnv->number = nPipeNum; + + DSL_CPE_snprintf(Name, sizeof(Name), pipeNameFormat, nPipeNum, "cmd"); + ret = DSL_CPE_PipeCreate(Name); + + if (ret < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_CPE_PipeCreate: could not create %s pipe" + DSL_CPE_CRLF, Name)); + } + + DSL_CPE_snprintf(Name, sizeof(Name), pipeNameFormat, nPipeNum, "ack"); + ret = DSL_CPE_PipeCreate(Name); + + if (ret < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_CPE_PipeCreate: could not create %s pipe" + DSL_CPE_CRLF, Name)); + } + + DSL_CPE_snprintf(pPipeEnv->namePipeEvent, sizeof(pPipeEnv->namePipeEvent), + pipeNameFormat, nPipeNum, "event"); + + ret = DSL_CPE_PipeCreate(pPipeEnv->namePipeEvent); + + if (ret < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_CPE_PipeCreate: could not create %s pipe" + DSL_CPE_CRLF, pPipeEnv->namePipeEvent)); + } + + DSL_CPE_snprintf(Name, sizeof(Name), "tPipe_%d", nPipeNum); + + pPipeEnv->bRun = DSL_TRUE; + + /* start task to handle pipe */ + DSL_CPE_ThreadInit(&pPipeEnv->control, Name, DSL_CPE_Pipe_Task, + DSL_CPE_PIPE_STACK_SIZE, DSL_CPE_PIPE_PRIORITY, (DSL_uint32_t)pContext, + (DSL_uint32_t)pPipeEnv); + + return DSL_CPE_CLI_Register(&pPipeEnv->pCLIContext, + pPipeEnv, + DSL_CPE_Pipe_Exit, + DSL_CPE_Pipe_Event); +} + +static DSL_Error_t DSL_CPE_Pipe_Exit(DSL_void_t *pContext) +{ + Pipe_env_t *env = pContext; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "DSL_CPE_Pipe_Exit(%d)" DSL_CPE_CRLF, env->number)); + + /*env->bRun = DSL_FALSE;*/ + DSL_CPE_ThreadShutdown(&env->control, 1000); + if (env->pipe_in != DSL_NULL) + { + DSL_CPE_PipeClose(env->pipe_in); + env->pipe_in = DSL_NULL; + } + + /* wait for task to exit */ + /*DSL_CPE_MSecSleep(200);*/ + return DSL_SUCCESS; +} + +/** + Split the command buffer in single lines and execute them +*/ +static DSL_int_t DSL_CPE_Pipe_Exec(DSL_Context_t * pContext, DSL_char_t *pCommand, + DSL_int_t len, DSL_CPE_File_t *out) +{ + DSL_int_t ret=0; + DSL_char_t *arg = DSL_NULL; + + DSL_char_t *line, *tokbuf; + DSL_char_t *cmd, *cmd_tok; + + line = strtok_r(pCommand, "" DSL_CPE_CRLF , &tokbuf); + if (line == DSL_NULL) + { + DSL_CPE_CLI_CommandExecute (0, DSL_NULL, DSL_NULL, out); + } + else + { + while (line != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("line = *%s*" DSL_CPE_CRLF, line)); + + if (strlen(line)>0) + { + /* get command name */ + cmd = strtok_r(line, " \t" DSL_CPE_CRLF , &cmd_tok); + if (cmd == DSL_NULL) + { + goto skip; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("cmd = *%s*" DSL_CPE_CRLF, cmd)); + + arg = strtok_r(NULL, "" DSL_CPE_CRLF , &cmd_tok); + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("arg =")); + if (arg != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("*%s*" DSL_CPE_CRLF , arg)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("*NULL*" DSL_CPE_CRLF)); + } + + if (DSL_CPE_CliDeviceCommandExecute(DSL_CPE_GetGlobalContext(), -1, cmd, arg, out) == 1) + { + /* "quit" was found, ignore following commands */ + return 1; + } + } + +skip: + line = strtok_r(NULL, "" DSL_CPE_CRLF , &tokbuf); + }; + } + + return ret; +} + +/** + Task for handling the commands received in the ..._cmd pipe +*/ +static DSL_int_t DSL_CPE_Pipe_Task(DSL_CPE_Thread_Params_t *params) +{ + DSL_Context_t * pContext = (DSL_Context_t *)params->nArg1; + Pipe_env_t *pPipeEnv = (Pipe_env_t *)params->nArg2; + DSL_char_t pipe_name_cmd[50]; + DSL_char_t pipe_name_ack[50]; + DSL_char_t *pPipeFormat = DSL_NULL; + DSL_int_t len = 0; + DSL_int_t ret = 0; + + if (pPipeEnv == DSL_NULL) { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, ( + "DSL_CPE_Pipe_Task() started failed, pipe env is NULL" DSL_CPE_CRLF)); + return -1; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ( + " DSL_CPE_Pipe_Task(%d) started" DSL_CPE_CRLF , pPipeEnv->number)); + + if (pPipeEnv->number == MAX_CLI_PIPES) + { + pPipeFormat = DTI_PIPE_NAME_FORMAT; + } + else + { + pPipeFormat = PIPE_NAME_FORMAT; + } + + DSL_CPE_snprintf(pipe_name_ack, sizeof(pipe_name_ack), pPipeFormat, + pPipeEnv->number, "ack"); + DSL_CPE_snprintf(pipe_name_cmd, sizeof(pipe_name_cmd), pPipeFormat, + pPipeEnv->number, "cmd"); + + do + { + pPipeEnv->pipe_in = DSL_CPE_PipeOpen(pipe_name_cmd, DSL_TRUE, DSL_TRUE); + if (pPipeEnv->pipe_in == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, ( + "DSL_CPE_Pipe_Task() cannot open %s, errno=%d" DSL_CPE_CRLF , pipe_name_cmd, errno)); + ret = -1; + goto error; + } + if (!pPipeEnv->bRun) + { + break; + } + + memset(&pPipeEnv->cmd_buffer[0], 0, + sizeof(pPipeEnv->cmd_buffer)); + + len = sizeof(pPipeEnv->cmd_buffer); +#ifndef _lint + if (len>0) +#endif /* _lint*/ + { + ret = DSL_CPE_FRead(&pPipeEnv->cmd_buffer[0], 1, (DSL_uint32_t)len, pPipeEnv->pipe_in); + + if (!pPipeEnv->bRun) + { + break; + } + if (ret>0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ( + "Pipe%d: cmd len %d, feof=%d ferror=%d " DSL_CPE_CRLF "%s" DSL_CPE_CRLF, + pPipeEnv->number, len, + feof(pPipeEnv->pipe_in), + ferror(pPipeEnv->pipe_in), + pPipeEnv->cmd_buffer)); + + DSL_CPE_PipeClose(pPipeEnv->pipe_in); + pPipeEnv->pipe_in = DSL_NULL; + + pPipeEnv->pipe_out = DSL_CPE_PipeOpen(pipe_name_ack, DSL_FALSE, DSL_TRUE); + if (pPipeEnv->pipe_out == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, ( + "DSL_CPE_Pipe_Task() cannot open %s" DSL_CPE_CRLF, pipe_name_ack)); + ret = -1; + goto error; + } + + DSL_CPE_Pipe_Exec(pContext, pPipeEnv->cmd_buffer, + len, pPipeEnv->pipe_out); + DSL_CPE_FFlush(pPipeEnv->pipe_out); + DSL_CPE_PipeClose(pPipeEnv->pipe_out); + pPipeEnv->pipe_out = DSL_NULL; + } + else + { + DSL_CPE_PipeClose(pPipeEnv->pipe_in); + pPipeEnv->pipe_in = DSL_NULL; + DSL_CPE_MSecSleep(50); + } + } + } while (pPipeEnv->bRun); + +error: + + if (pPipeEnv->pipe_out != DSL_NULL) + { + DSL_CPE_PipeClose(pPipeEnv->pipe_out); + pPipeEnv->pipe_out = DSL_NULL; + } + if (pPipeEnv->pipe_in != DSL_NULL) + { + DSL_CPE_PipeClose(pPipeEnv->pipe_in); + pPipeEnv->pipe_in = DSL_NULL; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ( + " DSL_CPE_Pipe_Task(%d) exit" DSL_CPE_CRLF , pPipeEnv->number)); + + return ret; +} + + +static DSL_Error_t DSL_CPE_Pipe_Event(DSL_void_t *pContext, DSL_char_t *pMessage) +{ + DSL_CPE_File_t *file; + Pipe_env_t *env = pContext; + + file = DSL_CPE_PipeOpen(env->namePipeEvent, DSL_FALSE, DSL_FALSE); + if (file != DSL_NULL) + { + if (fprintf(file, "%s" DSL_CPE_CRLF, pMessage) <= 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, ( + "Pipe[%d]Event: Error %d during print!" DSL_CPE_CRLF, env->number, errno)); + } + + DSL_CPE_PipeClose(file); + } + + return DSL_SUCCESS; +} + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_Pipe_StaticResourceUsageGet(DSL_uint32_t *pStatResUsage) +{ + if (pStatResUsage == DSL_NULL) + { + return DSL_ERROR; + } + else + { + *pStatResUsage = sizeof(PipeEnv); + return DSL_SUCCESS; + } +} +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +#endif /* DSL_CPE_REMOVE_PIPE_SUPPORT */ + diff --git a/src/dsl_cpe_cli_vrx.c b/src/dsl_cpe_cli_vrx.c new file mode 100644 index 0000000..6f2c003 --- /dev/null +++ b/src/dsl_cpe_cli_vrx.c @@ -0,0 +1,2972 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + VRX specific DSL CLI, access function implementation +*/ + +#include "dsl_cpe_control.h" + +#if defined(INCLUDE_DSL_CPE_API_VRX) + +#include "dsl_cpe_cli.h" +#include "drv_dsl_cpe_api.h" +#include "drv_dsl_cpe_api_ioctl.h" + +/* MEI CPE driver specific headers*/ +#include "drv_mei_cpe_interface.h" + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + +#include "dsl_cpe_bnd_vrx.h" + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CLI + +extern const char *sFailureReturn; + +/* for debugging: */ +#ifdef DSL_CLI_LOCAL +#undef DSL_CLI_LOCAL +#endif +#if 0 +#define DSL_CLI_LOCAL +#else +#define DSL_CLI_LOCAL static +#endif + + +static const DSL_char_t g_sDms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nMsgID (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nIndex (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nLength (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nPayload[0-256] (hex, for 32-bit messages payload contains maximum 128 32-bit values, leading 0's can be skipped)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nMsgID (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nIndex (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nLength (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nPayload[256] (hex, for 32-bit messages payload contains maximum 128 32-bit values)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_DeviceMessageSend( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + /* maximum message size includinf ID, Index and Length field */ + #define VRX_MSG_LEN 262 + /** + This bit of the Message ID identifies 32 bit aligned TC messages */ + #define VDSL2_MBX_MSG_ID_IFX_MASK 0x0010 + + DSL_int_t ret = 0; + DSL_DeviceMessage_t DevMsg; + DSL_uint8_t msg[VRX_MSG_LEN]; + DSL_uint16_t *pMsg16 = (DSL_uint16_t*)&msg[0]; + DSL_uint16_t const *pMsgId = (DSL_uint16_t*)&msg[0]; + DSL_uint32_t *pMsg32 = (DSL_uint32_t*)&msg[6]; + DSL_char_t *pChar; + DSL_uint32_t nParam = 0; + DSL_uint32_t i = 0; + DSL_boolean_t bXtcMsg = DSL_FALSE; + + + if (pCommands == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF , + DSL_CPE_RET_VAL(DSL_ERROR)); + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + pChar = pCommands; + + /* get MsgId, Index and Length parameter */ + while (pChar != DSL_NULL) + { + /* Extract next parameter */ + if (sscanf(pChar, "%x", &nParam) > 0) + { + i += 2; + *pMsg16 = (DSL_uint16_t)nParam; + /* Find next parameter */ + pChar = strpbrk( pChar, " "); + if (pChar != DSL_NULL) + { + pChar++; + pMsg16++; + } + else + { + break; + } + } + else + { + break; + } + + if (i >= 6) break; + } + + /* decide on the MsgId wether to treat 16 or 32bit params */ + if (*pMsgId & VDSL2_MBX_MSG_ID_IFX_MASK) + bXtcMsg = DSL_TRUE; + + + while (pChar != DSL_NULL) + { + /* Extract next parameter */ + if (sscanf(pChar, "%x", &nParam) > 0) + { + if (bXtcMsg == DSL_TRUE) + { + i += 4; + *pMsg32 = (DSL_uint32_t)nParam; + } + else + { + i += 2; + *pMsg16 = (DSL_uint16_t)nParam; + } + /* Find next parameter */ + pChar = strpbrk( pChar, " "); + if (pChar != DSL_NULL) + { + pChar++; + if (bXtcMsg == DSL_TRUE) + pMsg32++; + else + pMsg16++; + } + else + { + break; + } + } + else + { + break; + } + + if (i >= VRX_MSG_LEN) break; + } + if ( (i > 0) && (i < VRX_MSG_LEN) ) + { + /* Firmware message must consist of MsgID and two parameters minimum (6 bytes)*/ + if (i < 6) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"(firmware message has to be at least 3 " + "hex parameters long - '0x' does not have to be written)" DSL_CPE_CRLF , + DSL_CPE_RET_VAL(DSL_ERROR)); + return -1; + } + else + { + memset(&DevMsg, 0x0, sizeof(DSL_DeviceMessage_t)); + + DevMsg.data.pMsg = (DSL_uint8_t*)&msg; + DevMsg.data.nSizeTx = (DSL_uint16_t)i; + DevMsg.data.nSizeRx = (DSL_uint16_t)VRX_MSG_LEN; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_DEVICE_MESSAGE_SEND, (int) &DevMsg); + + if ((ret < 0) && (DevMsg.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + return ret; + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nData=\"", DSL_CPE_RET_VAL(ret)); + pMsg16 = (DSL_uint16_t*)&msg[0]; + pMsg32 = (DSL_uint32_t*)&msg[6]; + /* print Msg ID, Index and Length*/ + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + i = 6; + if (bXtcMsg == DSL_TRUE) + { + while (i < DevMsg.data.nSizeRx) + { + DSL_CPE_FPrintf(out, "%08X ", *pMsg32 ); + pMsg32++; + i += 4; + } + } + else + { + while (i < DevMsg.data.nSizeRx) + { + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + i += 2; + } + } + + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + return 0; + } + } + + } + else + { + DSL_CPE_FPrintf(out, "DSL: error during processing of message data." DSL_CPE_CRLF ); + ret = -1; + } + + return ret; +} + +static const DSL_char_t g_sDmms[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nMsgID (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nIndex (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nLength (hex, N)" DSL_CPE_CRLF + "- DSL_uint16_t nPayload[0-256] (hex, ... )" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nMsgID (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nIndex (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nLength (hex)" DSL_CPE_CRLF + "- DSL_uint16_t nPayload[256] (hex, for 32-bit messages payload contains maximum 128 32-bit values)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DBG_DeviceMessageModifySend( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + /* maximum mask size */ + #define VRX_MASK_LEN (VRX_MSG_LEN - 6 /*message header size = 6*/) + + DSL_int_t ret = 0; + DSL_DeviceMessageModify_t DevMsg; + DSL_uint8_t msg[VRX_MSG_LEN]; + DSL_uint16_t *pMsg16 = (DSL_uint16_t*)&msg[0]; + DSL_uint16_t const *pMsgId = (DSL_uint16_t*)&msg[0]; + DSL_uint32_t *pMsg32 = (DSL_uint32_t*)&msg[6]; + + DSL_uint8_t msk[VRX_MASK_LEN]; + DSL_uint16_t *pMask16 = (DSL_uint16_t*)&msk[0]; + DSL_uint32_t *pMask32 = (DSL_uint32_t*)&msk[0]; + + DSL_char_t *pChar; + DSL_uint32_t nParam = 0; + DSL_uint32_t i = 0; + DSL_boolean_t bXtcMsg = DSL_FALSE; + DSL_boolean_t bProcMask = DSL_FALSE; + + if (pCommands == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF , + DSL_CPE_RET_VAL(DSL_ERROR)); + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 3, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + pChar = pCommands; + + memset(msg,0,VRX_MSG_LEN); + memset(msk,0,VRX_MASK_LEN); + + /* get MsgId, Index and Length parameter */ + while (pChar != DSL_NULL) + { + /* Extract next parameter */ + if (sscanf(pChar, "%x", &nParam) > 0) + { + i += 2; + *pMsg16 = (DSL_uint16_t)nParam; + /* Find next parameter */ + pChar = strpbrk( pChar, " "); + if (pChar != DSL_NULL) + { + pChar++; + pMsg16++; + } + else + { + break; + } + } + else + { + break; + } + + if (i >= 6) break; + } + + /* decide on the MsgId wether to treat 16 or 32bit params */ + if (*pMsgId & VDSL2_MBX_MSG_ID_IFX_MASK) + bXtcMsg = DSL_TRUE; + + + while (pChar != DSL_NULL) + { + /* Extract next parameter */ + if (sscanf(pChar, "%x", &nParam) > 0) + { + if (bProcMask == DSL_TRUE) + { + if (bXtcMsg == DSL_TRUE) + { + *pMask32 = (DSL_uint32_t)nParam; + pMask32++; + } + else + { + *pMask16 = (DSL_uint16_t)nParam; + pMask16++; + } + + bProcMask = DSL_FALSE; + } else + { + if (bXtcMsg == DSL_TRUE) + { + i += 4; + *pMsg32 = (DSL_uint32_t)nParam; + pMsg32++; + } + else + { + i += 2; + *pMsg16 = (DSL_uint16_t)nParam; + pMsg16++; + } + + bProcMask = DSL_TRUE; + } + + /* Find next parameter */ + pChar = strpbrk( pChar, " "); + if (pChar != DSL_NULL) + { + pChar++; + } + else + { + break; + } + } else + { + break; + } + + if (i >= VRX_MSG_LEN) break; + } + if ( (i > 0) && (i < VRX_MSG_LEN) ) + { + /* Firmware message must consist of MsgID and two parameters minimum (6 bytes)*/ + if (i < 6) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"(firmware message has to be at least 3 " + "hex parameters long - '0x' does not have to be written)" DSL_CPE_CRLF , + DSL_CPE_RET_VAL(DSL_ERROR)); + return -1; + } + else + { + memset(&DevMsg, 0x0, sizeof(DSL_DeviceMessageModify_t)); + + DevMsg.data.pMsg = (DSL_uint8_t*)&msg; + DevMsg.data.pMsgMask= (DSL_uint8_t*)&msk; + DevMsg.data.nSizeTx = (DSL_uint16_t)i; + DevMsg.data.nSizeRx = (DSL_uint16_t)VRX_MSG_LEN; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_DEVICE_MESSAGE_MODIFY_SEND, (int) &DevMsg); + + if ((ret < 0) && (DevMsg.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + return ret; + } + else + { + /*Check that all data values passed with mask*/ + if (bProcMask == DSL_TRUE) + { + DSL_CPE_FPrintf(out,"Last data value passed without mask."DSL_CPE_CRLF); + ret = DSL_WRN_CONFIG_PARAM_IGNORED; + } else + { + ret = 0; + } + + DSL_CPE_FPrintf(out, DSL_CPE_RET"nData=\"", DSL_CPE_RET_VAL(ret)); + pMsg16 = (DSL_uint16_t*)&msg[0]; + pMsg32 = (DSL_uint32_t*)&msg[6]; + /* print Msg ID, Index and Length*/ + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + i = 6; + if (bXtcMsg == DSL_TRUE) + { + while (i < DevMsg.data.nSizeRx) + { + DSL_CPE_FPrintf(out, "%08X ", *pMsg32 ); + pMsg32++; + i += 4; + } + } + else + { + while (i < DevMsg.data.nSizeRx) + { + DSL_CPE_FPrintf(out, "%04X ", *pMsg16 ); + pMsg16++; + i += 2; + } + } + + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF); + return 0; + } + } + + } + else + { + DSL_CPE_FPrintf(out, "DSL: error during processing of message data." DSL_CPE_CRLF ); + ret = -1; + } + + return ret; +} + +static const DSL_char_t g_sAufg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_char_t xdsl_firmware[1-256]" DSL_CPE_CRLF + /*TODO: Handle OnChipBonding */ +#if defined(INCLUDE_DSL_BONDING) + "- DSL_char_t xdsl_firmware2[1-256]"DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootUsedFirmwareGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_NULL; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pCtrlCtx = DSL_CPE_GetGlobalContext(); + if(pCtrlCtx == DSL_NULL) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + + return -1; + } + + if (DSL_CPE_LINES_PER_DEVICE == 2) + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"xdsl_firmware=%s xdsl_firmware2=%s" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + g_sFirmwareName1 != DSL_NULL ? g_sFirmwareName1 : "n/a", + g_sFirmwareName2 != DSL_NULL ? g_sFirmwareName2 : "n/a"); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"xdsl_firmware=%s" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(ret), + g_sFirmwareName1 != DSL_NULL ? g_sFirmwareName1 : "n/a"); + } + return 0; +} + +static const DSL_char_t g_sAlf[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_char_t xdsl_firmware[1-256] (Attention: Use absolute firmware path only"DSL_CPE_CRLF + /*TODO: Handle On chip bonding */ +#if defined(INCLUDE_DSL_BONDING) + "- DSL_char_t xdsl_firmware2[1-256] (Attention: Use absolute firmware path only"DSL_CPE_CRLF +#endif + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AutobootLoadFirmware( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_char_t sFirmwareName1[256] = { 0 }; + DSL_char_t *pcFw = DSL_NULL; + DSL_char_t *pcFw2 = DSL_NULL; + DSL_char_t sFirmwareName2[256] = { 0 }; +#ifdef INCLUDE_FW_REQUEST_SUPPORT + DSL_AutobootControl_t autobootCtrl; + DSL_AutobootStatus_t AutobootStatus; +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + DSL_uint32_t nDevice = 0; + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_NULL; + + memset(&autobootCtrl, 0x00, sizeof(DSL_AutobootControl_t)); + memset(&AutobootStatus, 0x00, sizeof(DSL_AutobootStatus_t)); + + if (DSL_CPE_LINES_PER_DEVICE == 2) + { + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + } + else + { + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + } + + if (DSL_CPE_LINES_PER_DEVICE == 2) + { + sscanf (pCommands, "%256s %256s", sFirmwareName1, sFirmwareName2); + } + else + { + sscanf (pCommands, "%256s", sFirmwareName1); + } + + /* Get first (default) firmware binary. */ + if (strlen(sFirmwareName1) > 0) + { + if ( strcmp(sFirmwareName1, ".") != 0 ) + { + pcFw = &sFirmwareName1[0]; + + /* Update link to the first (default) FW binary. */ + if (pcFw) + { + if (g_sFirmwareName1 != DSL_NULL) + { + DSL_CPE_Free(g_sFirmwareName1); + } + + g_sFirmwareName1 = DSL_CPE_Malloc (strlen (pcFw) + 1); + if (g_sFirmwareName1) + { + cpe_control_strncpy_s(g_sFirmwareName1, strlen (pcFw) + 1, pcFw, strlen (pcFw)); + } + DSL_CPE_FwFeaturesGet(g_sFirmwareName1, &g_nFwFeatures1); + } + } + } + + /* Get second (on-chip bonding) firmware binary. */ + if (DSL_CPE_LINES_PER_DEVICE == 2 && strlen(sFirmwareName2) > 0) + { + pcFw2 = &sFirmwareName2[0]; + + /* Update link to the second (on-chip bonding) FW binary. */ + if (pcFw2) + { + if (g_sFirmwareName2 != DSL_NULL) + { + DSL_CPE_Free(g_sFirmwareName2); + } + + g_sFirmwareName2 = DSL_CPE_Malloc (strlen (pcFw2) + 1); + if (g_sFirmwareName2) + { + cpe_control_strncpy_s(g_sFirmwareName2, strlen (pcFw2) + 1, pcFw2, strlen (pcFw2)); + } + DSL_CPE_FwFeaturesGet(g_sFirmwareName2, &g_nFwFeatures2); + } + } + + pCtrlCtx = DSL_CPE_GetGlobalContext(); + if(pCtrlCtx == DSL_NULL) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + + return -1; + } + + DSL_CPE_Fd2DevNum(fd, &nDevice); + pCtrlCtx->bForceFirmwareDownload[nDevice] = DSL_TRUE; + +#ifdef INCLUDE_FW_REQUEST_SUPPORT + if (DSL_CPE_LINES_PER_DEVICE < 2) + { + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_STATUS_GET, (int) &AutobootStatus); + + if ((ret < 0) && (AutobootStatus.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(autobootCtrl.accessCtl.nReturn)); + return 0; + } + } + + if (DSL_CPE_LINES_PER_DEVICE < 2 && ((AutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_FW_WAIT && + AutobootStatus.data.nFirmwareRequestType != DSL_FW_REQUEST_NA) || + (AutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_STOPPED))) + { + ret = DSL_CPE_DownloadFirmware(fd, nDevice, AutobootStatus.data.nFirmwareRequestType, + DSL_PORT_MODE_NA, pcFw, pcFw2); + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + if (ret < DSL_SUCCESS) + { + DSL_CPE_FPrintf(out, " (Have you used absolute firmware path?)" DSL_CPE_CRLF); + } + } + else + { + /* Trigger Autoboot restart sequence. FW binary will be requested + from the DSL CPE API driver later*/ + autobootCtrl.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONTROL_SET, (int) &autobootCtrl); + + if ((ret < 0) && (autobootCtrl.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(autobootCtrl.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + } +#else + ret = DSL_CPE_DownloadFirmware(fd, nDevice, DSL_FW_REQUEST_NA, pcFw, pcFw2); + + DSL_CPE_FPrintf (out, DSL_CPE_RET, DSL_CPE_RET_VAL(ret)); + if (ret < DSL_SUCCESS) + { + DSL_CPE_FPrintf(out, " (Have you used absolute firmware path?)" DSL_CPE_CRLF); + } +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + + return 0; +} + +static const DSL_char_t g_sAlig[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_XTUDir_t nDirection" DSL_CPE_CRLF + " near end = 0" DSL_CPE_CRLF + " far end = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AuxLineInventory_t nData[" _MKSTR(DSL_G993_LI_MAXLEN_AUX)"]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_AuxLineInventoryGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_uint32_t i = 0; + DSL_AuxLineInventory_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + memset(&pData, 0x0, sizeof(DSL_AuxLineInventory_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUX_LINE_INVENTORY_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nLength=%u nData=\"" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + (unsigned int)pData.data.nLength); + + for (i = 0; i < pData.data.nLength; i++) + { + if (i%10 == 0) DSL_CPE_FPrintf ( out, DSL_CPE_CRLF); + DSL_CPE_FPrintf ( out, "%02x ", pData.data.pData[i]); + } + DSL_CPE_FPrintf ( out, "\""DSL_CPE_CRLF); + } + + return 0; +} + +#define DSL_CPE_CLI_MAX_PROFILES_PER_BANDS 2030 + +static const DSL_char_t g_sBpsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nBandPlan" DSL_CPE_CRLF + "- DSL_uint32_t nProfile" DSL_CPE_CRLF + "- DSL_boolean_t bSupported" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + "- ... nParamNr[3] nCount[" _MKSTR(DSL_CPE_CLI_MAX_PROFILES_PER_BANDS) "]" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BandPlanSupportGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_BandPlanSupport_t *pData = DSL_NULL; + DSL_int_t nBandPlan = 0, nProfile = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + pData = (DSL_BandPlanSupport_t*)DSL_CPE_Malloc(sizeof(DSL_BandPlanSupport_t)); + if (pData == DSL_NULL) + { + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERR_MEMORY)); + return 0; + } + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BAND_PLAN_SUPPORT_GET, (int) pData); + + if ((ret < 0) && (pData->accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData->accessCtl.nReturn)); + DSL_CPE_FPrintf (out, "nFormat=(nBandPlan(dec),nProfile(dec),bSupported(dec)) nData=\"" DSL_CPE_CRLF); + + for (nBandPlan = 0; nBandPlan < DSL_BANDPLAN_LAST; nBandPlan++) + { + for (nProfile = 0; nProfile < DSL_PROFILE_LAST; nProfile++) + { + DSL_CPE_FPrintf (out, "(%02d,%02d,%d) ", nBandPlan, nProfile, + pData->data.bSupported[nBandPlan][nProfile]); + } + DSL_CPE_FPrintf (out, DSL_CPE_CRLF ); + } + DSL_CPE_FPrintf(out, "\"" DSL_CPE_CRLF ); + } + + DSL_CPE_Free(pData); + + return 0; +} + +static const DSL_char_t g_sBpstg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nBandPlan (deprecated)" DSL_CPE_CRLF + " DSL_BANDPLAN_NA = -1" DSL_CPE_CRLF + "- DSL_uint32_t nProfile" DSL_CPE_CRLF + " DSL_PROFILE_8A = 0" DSL_CPE_CRLF + " DSL_PROFILE_8B = 1" DSL_CPE_CRLF + " DSL_PROFILE_8C = 2" DSL_CPE_CRLF + " DSL_PROFILE_8D = 3" DSL_CPE_CRLF + " DSL_PROFILE_12A = 4" DSL_CPE_CRLF + " DSL_PROFILE_12B = 5" DSL_CPE_CRLF + " DSL_PROFILE_17A = 6" DSL_CPE_CRLF + " DSL_PROFILE_30A = 7" DSL_CPE_CRLF + " DSL_PROFILE_35B = 8" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BandPlanStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_BandPlanStatus_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BandPlanStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BAND_PLAN_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nBandPlan=%d nProfile=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nBandPlan, pData.data.nProfile); + } + + return 0; +} + +static const DSL_char_t g_sVig[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_char_t DSL_DriverVersionApi[" _MKSTR(MAX_INFO_STRING_LEN)"]"DSL_CPE_CRLF + "- DSL_char_t DSL_ChipSetFWVersion[" _MKSTR(MAX_INFO_STRING_LEN)"]"DSL_CPE_CRLF + "- DSL_char_t DSL_ChipSetHWVersion[" _MKSTR(MAX_INFO_STRING_LEN)"]"DSL_CPE_CRLF + "- DSL_char_t DSL_ChipSetType[" _MKSTR(MAX_INFO_STRING_LEN)"]"DSL_CPE_CRLF + "- DSL_char_t DSL_DriverVersionMeiBsp[" _MKSTR(MAX_INFO_STRING_LEN)"]"DSL_CPE_CRLF + "- DSL_HybridType_t nHybridType"DSL_CPE_CRLF + " unknown = -1"DSL_CPE_CRLF + " na = 0"DSL_CPE_CRLF + " pots = 1"DSL_CPE_CRLF + " isdn_b = 2"DSL_CPE_CRLF + " isdn_bj = 3"DSL_CPE_CRLF + " universal_vrx500 = 4"DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_VersionInformationGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_VersionInformation_t pData; + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_NULL; + DSL_char_t pAppPatch[8]; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_VersionInformation_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_VERSION_INFORMATION_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(ret)); + } + else + { + pCtrlCtx = DSL_CPE_GetGlobalContext(); + if(pCtrlCtx == DSL_NULL) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + return -1; + } + + if ((pCtrlCtx->driverVer.nMajor != pCtrlCtx->applicationVer.nMajor) || + (pCtrlCtx->driverVer.nMinor != pCtrlCtx->applicationVer.nMinor)) + { + pData.accessCtl.nReturn = DSL_WRN_VERSION_INCOMPATIBLE; + } + + pAppPatch[0] = 0; + +#ifndef DISABLE_DSL_PATCH_VERSION + if (pCtrlCtx->applicationVer.nPatch != 0) + { + snprintf (pAppPatch, sizeof(pAppPatch), "%spa%d", (pCtrlCtx->driverVer.nPatch == 0) ? "-" : "", + pCtrlCtx->applicationVer.nPatch); + } +#endif /*#ifndef DISABLE_DSL_PATCH_VERSION*/ + + DSL_CPE_FPrintf (out, + DSL_CPE_RET"DSL_DriverVersionApi=%s%s DSL_ChipSetFWVersion=%s " + "DSL_ChipSetHWVersion=%s DSL_ChipSetType=%s DSL_DriverVersionMeiBsp=%s " + "nHybrid=%d" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.DSL_DriverVersionApi, pAppPatch, + pData.data.DSL_ChipSetFWVersion, pData.data.DSL_ChipSetHWVersion, + pData.data.DSL_ChipSetType, pData.data.DSL_DriverVersionMeiBsp, + pData.data.nHybridType); + } + + return 0; +} + +static const DSL_char_t g_sDscs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "- DSL_uint32_t nDevice" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DeviceSelectionConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_uint32_t nDevice = 0; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + sscanf (pCommands, "%u", &nDevice); + + if (nDevice >= DSL_CPE_DSL_ENTITIES) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + } + else + { + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + pCtx->nDevNum = nDevice; + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(0)); + } + else + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + } + } + + + return 0; +} + +static const DSL_char_t g_sDscg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "- DSL_uint32_t nDevice" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DeviceSelectionConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + DSL_CPE_FPrintf (out, "nReturn=%d nDevice=%d" DSL_CPE_CRLF,0, pCtx->nDevNum); + } + else + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(-1)); + } + + return 0; +} + +static const DSL_char_t g_sLlcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DEV_Filter_t nFilter" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " off = 0" DSL_CPE_CRLF + " isdn = 1" DSL_CPE_CRLF + " pots = 2" DSL_CPE_CRLF + " pots_2 = 3" DSL_CPE_CRLF + " pots_3 = 4" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroupMode_t nHsToneGroupMode" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " auto = 0" DSL_CPE_CRLF + " manual = 1" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroup_t nHsToneGroup_A (hex)" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " VDSL2 B43 = 0001" DSL_CPE_CRLF + " VDSL2 A43 = 0002" DSL_CPE_CRLF + " VDSL2 V43 = 0004" DSL_CPE_CRLF + " VDSL1 V43POTS = 0008" DSL_CPE_CRLF + " VDSL1 V43ISDN = 0010" DSL_CPE_CRLF + " ADSL1 C43 = 0020" DSL_CPE_CRLF + " ADSL2 J43 = 0040" DSL_CPE_CRLF + " ADSL2 B43C = 0080" DSL_CPE_CRLF + " ADSL2 A43C = 0100" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroup_t nHsToneGroup_V (hex)" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " VDSL2 B43 = 0001" DSL_CPE_CRLF + " VDSL2 A43 = 0002" DSL_CPE_CRLF + " VDSL2 V43 = 0004" DSL_CPE_CRLF + " VDSL1 V43POTS = 0008" DSL_CPE_CRLF + " VDSL1 V43ISDN = 0010" DSL_CPE_CRLF + " ADSL1 C43 = 0020" DSL_CPE_CRLF + " ADSL2 J43 = 0040" DSL_CPE_CRLF + " ADSL2 B43C = 0080" DSL_CPE_CRLF + " ADSL2 A43C = 0100" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroup_t nHsToneGroup_AV (hex)" DSL_CPE_CRLF + " not used anymore (set it to zero)" DSL_CPE_CRLF + "- DSL_uint32_t nBaseAddr (hex)" DSL_CPE_CRLF + "- DSL_uint8_t nIrqNum" DSL_CPE_CRLF + "- DSL_boolean_t bNtrEnable" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LowLevelConfigurationSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_Error_t nReturn = DSL_SUCCESS; + DSL_LowLevelConfiguration_t pData; + unsigned int nToneGroup_A = 0; + unsigned int nToneGroup_V = 0; + unsigned int nToneGroup_AV = 0; + unsigned int bNtrEnable = 0; + int nFilter = 0; + int nHsToneGroupMode = 0; + char nIrqNum = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_MIN) == DSL_FALSE) + { + return -1; + } + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 8, DSL_CLI_MAX) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_LowLevelConfiguration_t)); + memset(&(pData.data), 0xFF, sizeof(DSL_DeviceLowLevelConfig_t)); + + sscanf (pCommands, "%d %d %x %x %x %x %hhd %u", + &nFilter, + &nHsToneGroupMode, + &nToneGroup_A, + &nToneGroup_V, + &nToneGroup_AV, + &pData.data.nBaseAddr, + &nIrqNum, + &bNtrEnable); + + pData.data.nHsToneGroup_A = nToneGroup_A; + pData.data.nHsToneGroup_V = nToneGroup_V; + pData.data.nHsToneGroup_AV = nToneGroup_AV; + pData.data.nFilter = nFilter; + pData.data.nHsToneGroupMode = nHsToneGroupMode; + pData.data.nIrqNum = nIrqNum; + pData.data.bNtrEnable = bNtrEnable; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LOW_LEVEL_CONFIGURATION_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + /* Check Low Level configuration*/ + nReturn = DSL_CPE_LowLevelConfigurationCheck(fd); + if (nReturn != DSL_SUCCESS) + { + pData.accessCtl.nReturn = nReturn; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +static const DSL_char_t g_sLlcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DEV_Filter_t nFilter" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " off = 0" DSL_CPE_CRLF + " isdn = 1" DSL_CPE_CRLF + " pots = 2" DSL_CPE_CRLF + " pots_2 = 3" DSL_CPE_CRLF + " pots_3 = 4" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroupMode_t nHsToneGroupMode" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " auto = 0" DSL_CPE_CRLF + " manual = 1" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroup_t nHsToneGroup_A (hex)" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " VDSL2 B43 = 0001" DSL_CPE_CRLF + " VDSL2 A43 = 0002" DSL_CPE_CRLF + " VDSL2 V43 = 0004" DSL_CPE_CRLF + " VDSL1 V43POTS = 0008" DSL_CPE_CRLF + " VDSL1 V43ISDN = 0010" DSL_CPE_CRLF + " ADSL1 C43 = 0020" DSL_CPE_CRLF + " ADSL2 J43 = 0040" DSL_CPE_CRLF + " ADSL2 B43C = 0080" DSL_CPE_CRLF + " ADSL2 A43C = 0100" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroup_t nHsToneGroup_V (hex)" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " VDSL2 B43 = 0001" DSL_CPE_CRLF + " VDSL2 A43 = 0002" DSL_CPE_CRLF + " VDSL2 V43 = 0004" DSL_CPE_CRLF + " VDSL1 V43POTS = 0008" DSL_CPE_CRLF + " VDSL1 V43ISDN = 0010" DSL_CPE_CRLF + " ADSL1 C43 = 0020" DSL_CPE_CRLF + " ADSL2 J43 = 0040" DSL_CPE_CRLF + " ADSL2 B43C = 0080" DSL_CPE_CRLF + " ADSL2 A43C = 0100" DSL_CPE_CRLF + "- DSL_DEV_HsToneGroup_t nHsToneGroup_AV (hex)" DSL_CPE_CRLF + " not used anymore" DSL_CPE_CRLF + "- DSL_uint32_t nBaseAddr (hex)" DSL_CPE_CRLF + "- DSL_uint8_t nIrqNum" DSL_CPE_CRLF + "- DSL_boolean_t bNtrEnable" DSL_CPE_CRLF + " na = -1" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_LowLevelConfigurationGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_LowLevelConfiguration_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0, sizeof(DSL_LowLevelConfiguration_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LOW_LEVEL_CONFIGURATION_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET + "nFilter=%d " + "nHsToneGroupMode=%d " + "nHsToneGroup_A=%x " + "nHsToneGroup_V=%x " + "nHsToneGroup_AV=%x " + "nBaseAddr=%x " + "nIrqNum=%u " + "bNtrEnable=%d", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nFilter, + pData.data.nHsToneGroupMode, + pData.data.nHsToneGroup_A, + pData.data.nHsToneGroup_V, + pData.data.nHsToneGroup_AV, + pData.data.nBaseAddr, + pData.data.nIrqNum, + pData.data.bNtrEnable); + } + + return 0; +} + +static const DSL_char_t g_sG997lspbg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_int16_t[" _MKSTR(DSL_G997_MAX_NUMBER_OF_BANDS) "] LATN" DSL_CPE_CRLF + "- DSL_int16_t[" _MKSTR(DSL_G997_MAX_NUMBER_OF_BANDS) "] SATN" DSL_CPE_CRLF + "- DSL_int16_t[" _MKSTR(DSL_G997_MAX_NUMBER_OF_BANDS) "] SNR" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LineStatusPerBandGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LineStatusPerBand_t pData; + DSL_int_t i = 0; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LineStatusPerBand_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LINE_STATUS_PER_BAND_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nDirection=%u ", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDirection ); + + for (i = 0; i < DSL_G997_MAX_NUMBER_OF_BANDS; i++) + { + DSL_CPE_FPrintf(out, "LATN[%d]=%hd ", i, pData.data.LATN[i]); + } + for (i = 0; i < DSL_G997_MAX_NUMBER_OF_BANDS; i++) + { + DSL_CPE_FPrintf(out, "SATN[%d]=%hd ", i, pData.data.SATN[i]); + } + for (i = 0; i < DSL_G997_MAX_NUMBER_OF_BANDS; i++) + { + DSL_CPE_FPrintf(out, "SNR[%d]=%hd ", i, pData.data.SNR[i]); + } + DSL_CPE_FPrintf(out, DSL_CPE_CRLF ); + } + + return 0; +} + +static const DSL_char_t g_sG997upbosg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_G997_AeleMode_t nAeleMode" DSL_CPE_CRLF + " AELE_MODE_0 = 0" DSL_CPE_CRLF + " AELE_MODE_1 = 1" DSL_CPE_CRLF + " AELE_MODE_2 = 2" DSL_CPE_CRLF + " AELE_MODE_3 = 3" DSL_CPE_CRLF + "- DSL_uint16_t UpboElmt" DSL_CPE_CRLF + "- DSL_int16_t RxThreshDs" DSL_CPE_CRLF + "- DSL_int16_t[" _MKSTR(DSL_G997_MAX_NUMBER_OF_BANDS) "] nKleOPb" DSL_CPE_CRLF + "- DSL_int16_t[" _MKSTR(DSL_G997_MAX_NUMBER_OF_BANDS) "] nKleRPb" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_UsPowerBackOffStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_UsPowerBackOffStatus_t pData; + DSL_int_t i = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0, sizeof(DSL_G997_UsPowerBackOffStatus_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_US_POWER_BACK_OFF_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf(out, DSL_CPE_RET"nAeleMode=%u UpboElmt=%u RxThreshDs=%d ", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nAeleMode, + pData.data.UpboElmt, pData.data.RxThreshDs); + + for (i = 0; i < DSL_G997_MAX_NUMBER_OF_BANDS; i++) + { + DSL_CPE_FPrintf(out, "nKleOPb[%d]=%hu ", i, pData.data.nKl0EstimOPb[i]); + } + for (i = 0; i < DSL_G997_MAX_NUMBER_OF_BANDS; i++) + { + DSL_CPE_FPrintf(out, "nKleRPb[%d]=%hu ", i, pData.data.nKl0EstimRPb[i]); + } + + DSL_CPE_FPrintf(out, DSL_CPE_CRLF ); + } + + return 0; +} + +static const DSL_char_t g_sLpmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_G997_PMMode_t PMMode" DSL_CPE_CRLF + " DSL_G997_PMMODE_BIT_L3_STATE = 1" DSL_CPE_CRLF + " DSL_G997_PMMODE_BIT_L2_STATE = 2" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LowPowerModeConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LowPowerModeConfig_t pData; + unsigned int PMMode = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LowPowerModeConfig_t)); + + sscanf (pCommands, "%u", &PMMode); + + pData.data.PMMode = PMMode; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LOW_POWER_MODE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sLpmcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_G997_PMMode_t PMMode" DSL_CPE_CRLF + " DSL_G997_PMMODE_BIT_L3_STATE = 1" DSL_CPE_CRLF + " DSL_G997_PMMODE_BIT_L2_STATE = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_LowPowerModeConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_LowPowerModeConfig_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_LowPowerModeConfig_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_LOW_POWER_MODE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"PMMode=%d" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.PMMode); + } + + return 0; +} +#endif /*INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_G997_STATUS +static const DSL_char_t g_sG997ansg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + "- DSL_uint16_t nAttndrActMethod" DSL_CPE_CRLF + "- DSL_uint16_t nAttndrActInpDs" DSL_CPE_CRLF + "- DSL_uint16_t nAttndrActInpReinDs" DSL_CPE_CRLF + "- DSL_uint16_t nAttndrActDelayDs" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_AttainableNdrStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_AttainableNdrStatus_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_AttainableNdrStatus_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_ATTAINABLE_NDR_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%u nAttndrActMethod=%d " + "nAttndrActInpDs=%d nAttndrActInpReinDs=%d nAttndrActDelayDs=%d" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.nAttndrActMethod, pData.data.nAttndrActInpDs, + pData.data.nAttndrActInpReinDs, pData.data.nAttndrActDelayDs); + } + + return 0; +} +#endif /* INCLUDE_DSL_G997_STATUS*/ + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sDsmcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- IOCTL_MEI_VectorControl_t eVectorControl" DSL_CPE_CRLF + " e_MEI_VECTOR_CTRL_OFF = 0" DSL_CPE_CRLF + " e_MEI_VECTOR_CTRL_ON = 1" DSL_CPE_CRLF + " e_MEI_VECTOR_FRIENDLY_CTRL_ON = 2" DSL_CPE_CRLF + " e_MEI_VECTOR_FRIENDLY_CTRL_AUTO = 3" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DsmConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_dsmConfig_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_dsmConfig_t)); + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_DSM_CONFIG_GET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"eVectorControl=%u " + DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), pData.eVectorControl); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET */ + +static const DSL_char_t g_sDsmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- IOCTL_MEI_VectorControl_t eVectorControl" DSL_CPE_CRLF + " e_MEI_VECTOR_CTRL_OFF = 0" DSL_CPE_CRLF + " e_MEI_VECTOR_CTRL_ON = 1" DSL_CPE_CRLF + " e_MEI_VECTOR_FRIENDLY_CTRL_ON = 2" DSL_CPE_CRLF + " e_MEI_VECTOR_FRIENDLY_CTRL_AUTO = 3" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DsmConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_dsmConfig_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + unsigned int eVectorControl = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_dsmConfig_t)); + + sscanf (pCommands, "%u", &eVectorControl); + + pData.eVectorControl = eVectorControl; + + if ((pData.eVectorControl < 0) || (pData.eVectorControl > 3)) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "invalid parameters!" DSL_CPE_CRLF); + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERROR)); + + return 0; + } + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_DSM_CONFIG_SET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} + +static const DSL_char_t g_sDsmsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- IOCTL_MEI_VectorStatus_t eVectorStatus" DSL_CPE_CRLF + " e_MEI_VECTOR_STAT_OFF = 0" DSL_CPE_CRLF + " e_MEI_VECTOR_STAT_ON_DS = 1" DSL_CPE_CRLF + " e_MEI_VECTOR_STAT_ON_DS_US = 2" DSL_CPE_CRLF + "- IOCTL_MEI_VectorFriendlyStatus_t eVectorFriendlyStatus" DSL_CPE_CRLF + " e_MEI_VECTOR_FRIENDLY_STAT_OFF = 0" DSL_CPE_CRLF + " e_MEI_VECTOR_FRIENDLY_STAT_ON_DS = 1" DSL_CPE_CRLF + " e_MEI_VECTOR_FRIENDLY_STAT_ON_DS_US = 2" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DsmStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_dsmStatus_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_dsmStatus_t)); + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_DSM_STATUS_GET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"eVectorStatus=%u eVectorFriendlyStatus=%u " + DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), + pData.eVectorStatus, pData.eVectorFriendlyStatus); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} + +static const DSL_char_t g_sDsmstatg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t n_processed" DSL_CPE_CRLF + "- DSL_uint32_t n_fw_dropped_size" DSL_CPE_CRLF + "- DSL_uint32_t n_mei_dropped_size" DSL_CPE_CRLF + "- DSL_uint32_t n_mei_dropped_no_pp_cb" DSL_CPE_CRLF + "- DSL_uint32_t n_pp_dropped" DSL_CPE_CRLF + "- DSL_uint32_t n_fw_total" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DsmStatisticsGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_dsmStatistics_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_dsmStatistics_t)); + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_DSM_STATISTICS_GET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"n_processed=%u n_fw_dropped_size=%u " + "n_mei_dropped_size=%u n_mei_dropped_no_pp_cb=%u n_pp_dropped=%u n_fw_total=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), pData.n_processed, pData.n_fw_dropped_size, + pData.n_mei_dropped_size, pData.n_mei_dropped_no_pp_cb, pData.n_pp_dropped, + pData.n_fw_total); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sDsmmcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF +#if (DSL_CPE_MAX_DEVICE_NUMBER > 1) + "Input Parameter" DSL_CPE_CRLF + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF + DSL_CPE_CRLF +#endif + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DEVICE_NUMBER > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t[6] nMacAddress (used hex format XX:XX:XX:XX:XX:XX)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DsmMacConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_MacConfig_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_MacConfig_t)); + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_MAC_CONFIG_GET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nMacAddress=%02X:%02X:%02X:%02X:%02X:%02X " + DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), + pData.nMacAddress[0], pData.nMacAddress[1], + pData.nMacAddress[2], pData.nMacAddress[3], + pData.nMacAddress[4], pData.nMacAddress[5]); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET */ + +static const DSL_char_t g_sDsmmcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DEVICE_NUMBER > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t[6] nMacAddress (used hex format XX:XX:XX:XX:XX:XX)" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DEVICE_NUMBER > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DsmMacConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_MacConfig_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + DSL_char_t sMacAdr[18]; + DSL_CPE_MacAddress_t macAdr; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_MacConfig_t)); + + ret = sscanf (pCommands, "%18s", sMacAdr); + + ret = DSL_CPE_GetMacAdrFromString(sMacAdr, &macAdr); + if (ret < DSL_SUCCESS) + { + DSL_CPE_FPrintf(out, DSL_CPE_PREFIX "inconsistent MAC address!" DSL_CPE_CRLF); + DSL_CPE_FPrintf(out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(DSL_ERROR)); + return 0; + } + else + { + cpe_control_memcpy_s(pData.nMacAddress, DSL_MAC_ADDRESS_OCTETS, &macAdr, sizeof(macAdr)); + } + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_MAC_CONFIG_SET, (DSL_int_t)&pData); + + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} + + +#ifndef DSL_CPE_DEBUG_DISABLE +static const DSL_char_t g_sBNDDBGst[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint32_t nAggregateReg" DSL_CPE_CRLF + "- DSL_uint8_t nRemoteDiscoveryCode[6] (hex)" DSL_CPE_CRLF + "- DSL_CPE_BND_MsStatus_t nMsStatus" DSL_CPE_CRLF + " DSL_BND_MASTER = 0" DSL_CPE_CRLF + " DSL_BND_SLAVE = 1" DSL_CPE_CRLF + "- DSL_uint16_t nPafAvailable" DSL_CPE_CRLF + "- DSL_uint16_t nRemotePafAvailable" DSL_CPE_CRLF + "- DSL_uint16_t nPafAggregate" DSL_CPE_CRLF + "- DSL_uint16_t nPafEnable" DSL_CPE_CRLF + "- DSL_uint32_t nTxDataRate" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BND_DBG_StatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t i = 0; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + DSL_CPE_BND_Context_t *pBnd = DSL_NULL; + DSL_uint32_t nDevice = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if ((pBnd = (DSL_CPE_BND_Context_t*)pCtx->pBnd) == DSL_NULL) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + if ((DSL_CPE_Fd2DevNum(fd, &nDevice)) < DSL_SUCCESS) + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(-1)); + return 0; + } + + DSL_CPE_FPrintf (out, DSL_CPE_RET"nAggregateReg=%u ", + DSL_CPE_RET_VAL(DSL_SUCCESS), pBnd->aggregateReg); + + DSL_CPE_FPrintf (out, "nRemoteDiscoveryCode=\""); + for (i = 0; i < 6; i++) + { + DSL_CPE_FPrintf (out, "0x%02x ", pBnd->remoteDiscoveryCode[i]); + } + DSL_CPE_FPrintf (out, "\""); + + DSL_CPE_FPrintf (out, "nMsStatus=%u nPafAvailable=%u nRemotePafAvailable=%u " + "nPafAggregate=%u nPafEnable=%u nTxDataRate=%u"DSL_CPE_CRLF, + pBnd->lineMonitorStateMachine[nDevice].MsStatus, + pBnd->lineMonitorStateMachine[nDevice].PafAvailable, + pBnd->lineMonitorStateMachine[nDevice].RemotePafAvailable, + pBnd->lineMonitorStateMachine[nDevice].PafAggregate, + pBnd->lineMonitorStateMachine[nDevice].PafEnable, + pBnd->lineMonitorStateMachine[nDevice].TxDataRate); + + return 0; +} +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE */ + +static const DSL_char_t g_sBNDcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_boolean_t bPafEnable" DSL_CPE_CRLF + " disable = 0" DSL_CPE_CRLF + " enable = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BND_ConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_BND_ConfigSet_t pData; + DSL_uint_t nDslMode = 0; + DSL_uint_t pafEnable = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 2, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BND_ConfigSet_t)); + + sscanf (pCommands, "%u %u", &nDslMode, &pafEnable); + + pData.nDslMode = nDslMode; + pData.data.bPafEnable = pafEnable; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sBNDcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_DslModeSelection_t nDslMode" DSL_CPE_CRLF + " mode adsl = 0" DSL_CPE_CRLF +#if defined(INCLUDE_DSL_CPE_API_VRX) + " mode vdsl = 1" DSL_CPE_CRLF +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + "- DSL_boolean_t bPafEnable" DSL_CPE_CRLF + " false = 0" DSL_CPE_CRLF + " true = 1" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BND_ConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_BND_ConfigGet_t pData; + DSL_uint_t nDslMode = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BND_ConfigGet_t)); + + sscanf (pCommands, "%u", &nDslMode); + + pData.nDslMode = nDslMode; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDslMode=%u bPafEnable=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.nDslMode, pData.data.bPafEnable); + } + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +static const DSL_char_t g_sBNDhsg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_BND_ActivationMode_t nActivationMode (hex)" DSL_CPE_CRLF + " DSL_BND_NO_COMMAND = 0x00000000" DSL_CPE_CRLF + " DSL_BND_DISCOVERY_SET_IF_CLEAR = 0x00000001" DSL_CPE_CRLF + " DSL_BND_DISCOVERY_CLEAR_IF_SAME = 0x00000002" DSL_CPE_CRLF + " DSL_BND_AGGREGATE_SET = 0x00000004" DSL_CPE_CRLF + " DSL_BND_AGGREGATE_CLR = 0x00000008" DSL_CPE_CRLF + "- DSL_uint32_t nAggregateData" DSL_CPE_CRLF + "- DSL_BND_RemotePafSupported_t nRemotePafSupported" DSL_CPE_CRLF + " DSL_BND_ENABLE_NOT_INITIALIZED = -1" DSL_CPE_CRLF + " DSL_BND_ENABLE_OFF = 0" DSL_CPE_CRLF + " DSL_BND_ENABLE_ON = 1" DSL_CPE_CRLF + "- DSL_uint8_t nDiscoveryCode[6] (hex)" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BND_HsStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, i; + DSL_BND_HsStatusGet_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BND_HsStatusGet_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_HS_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nActivationMode=0x%08x nAggregateData=%d " + "nRemotePafSupported=%d ", + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nActivationMode, pData.data.nAggregateData, pData.data.nRemotePafSupported); + + DSL_CPE_FPrintf (out, "nDiscoveryCode=\""); + + for (i = 0; i < 6; i++) + { + DSL_CPE_FPrintf (out, "0x%02x ", pData.data.nDiscoveryCode[i]); + } + DSL_CPE_FPrintf (out, "\"" DSL_CPE_CRLF); + } + + return 0; +} + +static const DSL_char_t g_sBNDETHDBGcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nControlRegister" DSL_CPE_CRLF + "- DSL_uint16_t nRxFragmentsDrop" DSL_CPE_CRLF + "- DSL_uint16_t nRxFragmentsLink0" DSL_CPE_CRLF + "- DSL_uint16_t nRxFragmentsLink1" DSL_CPE_CRLF + "- DSL_uint32_t nRxGoodFragments" DSL_CPE_CRLF + "- DSL_uint16_t nRxPackets" DSL_CPE_CRLF + "- DSL_uint16_t nTxFragmentsLink0" DSL_CPE_CRLF + "- DSL_uint16_t nTxFragmentsLink1" DSL_CPE_CRLF + "- DSL_uint16_t nTxPackets" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BND_ETH_DBG_CountersGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_BND_EthDbgCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BND_EthDbgCounters_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_ETH_DBG_COUNTERS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nControlRegister=%hu nRxFragmentsDrop=%hu " + "nRxFragmentsLink0=%hu nRxFragmentsLink1=%hu nRxGoodFragments=%u " + "nRxPackets=%hu nTxFragmentsLink0=%hu nTxFragmentsLink1=%hu nTxPackets=%hu" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nControlRegister, pData.data.nRxFragmentsDrop, + pData.data.nRxFragmentsLink0, pData.data.nRxFragmentsLink1, + pData.data.nRxGoodFragments, pData.data.nRxPackets, + pData.data.nTxFragmentsLink0, pData.data.nTxFragmentsLink1, pData.data.nTxPackets); + } + + return 0; +} + +static const DSL_char_t g_sBNDETHcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nRxBadFragments" DSL_CPE_CRLF + "- DSL_uint32_t nRxErroredFragments" DSL_CPE_CRLF + "- DSL_uint32_t nRxLargeFragments" DSL_CPE_CRLF + "- DSL_uint16_t nRxLostEnds" DSL_CPE_CRLF + "- DSL_uint16_t nRxLostFragments" DSL_CPE_CRLF + "- DSL_uint16_t nRxLostStarts" DSL_CPE_CRLF + "- DSL_uint32_t nRxOverlfows" DSL_CPE_CRLF + "- DSL_uint32_t nRxSmallFragments" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BND_ETH_CountersGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_BND_EthCounters_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BND_EthCounters_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_ETH_COUNTERS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nRxBadFragments=%hu nRxErroredFragments=%u " + "nRxLargeFragments=%u nRxLostEnds=%hu nRxLostFragments=%hu nRxLostStarts=%hu " + "nRxOverlfows=%u nRxSmallFragments=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.data.nRxBadFragments, pData.data.nRxErroredFragments, + pData.data.nRxLargeFragments, pData.data.nRxLostEnds, pData.data.nRxLostFragments, + pData.data.nRxLostStarts, pData.data.nRxOverlfows, pData.data.nRxSmallFragments); + } + + return 0; +} + +static const DSL_char_t g_sBNDpmss[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_PortMode_t nPortMode" DSL_CPE_CRLF + " DSL_PORT_MODE_NA = 0" DSL_CPE_CRLF + " DSL_PORT_MODE_SINGLE = 1" DSL_CPE_CRLF + " DSL_PORT_MODE_DUAL = 2" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_BND_PortModeSyncSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_BND_PortModeSync_t pData; + DSL_uint_t portMode = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_BND_PortModeSync_t)); + + sscanf (pCommands, "%u", &portMode); + pData.data.nPortMode = portMode; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_PORT_MODE_SYNC_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + + +static const DSL_char_t g_sVpcs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_BF_VdslProfileConfigData_t nVdslProfile (hex)" DSL_CPE_CRLF + " DSL_BF_PROFILE_8A = 0x00000001" DSL_CPE_CRLF + " DSL_BF_PROFILE_8B = 0x00000002" DSL_CPE_CRLF + " DSL_BF_PROFILE_8C = 0x00000004" DSL_CPE_CRLF + " DSL_BF_PROFILE_8D = 0x00000008" DSL_CPE_CRLF + " DSL_BF_PROFILE_12A = 0x00000010" DSL_CPE_CRLF + " DSL_BF_PROFILE_12B = 0x00000020" DSL_CPE_CRLF + " DSL_BF_PROFILE_17A = 0x00000040" DSL_CPE_CRLF + " DSL_BF_PROFILE_30A = 0x00000080" DSL_CPE_CRLF + " DSL_BF_PROFILE_35B = 0x00000100" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_VdslProfileConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_VdslProfileConfig_t pData; + unsigned int nVdslProfile = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_VdslProfileConfig_t)); + + sscanf (pCommands, "%x", &nVdslProfile); + + pData.data.nVdslProfile = nVdslProfile; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_VDSL_PROFILE_CONFIG_SET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sVpcg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_BF_VdslProfileConfigData_t nVdslProfile (hex)" DSL_CPE_CRLF + " DSL_BF_PROFILE_8A = 0x00000001" DSL_CPE_CRLF + " DSL_BF_PROFILE_8B = 0x00000002" DSL_CPE_CRLF + " DSL_BF_PROFILE_8C = 0x00000004" DSL_CPE_CRLF + " DSL_BF_PROFILE_8D = 0x00000008" DSL_CPE_CRLF + " DSL_BF_PROFILE_12A = 0x00000010" DSL_CPE_CRLF + " DSL_BF_PROFILE_12B = 0x00000020" DSL_CPE_CRLF + " DSL_BF_PROFILE_17A = 0x00000040" DSL_CPE_CRLF + " DSL_BF_PROFILE_30A = 0x00000080" DSL_CPE_CRLF + " DSL_BF_PROFILE_35B = 0x00000100" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_VdslProfileConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_VdslProfileConfig_t pData; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_VdslProfileConfig_t)); + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_VDSL_PROFILE_CONFIG_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, + DSL_CPE_RET"nVdslProfile=0x%08X" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), pData.data.nVdslProfile); + } + + return 0; +} +#endif /* #ifdef INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sMEIPocg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nPllOffset" DSL_CPE_CRLF + " PLL_OFFSET_MIN = -32768" DSL_CPE_CRLF + " PLL_OFFSET_MAX = 32767" DSL_CPE_CRLF + " PLL_DISABLED = 32768" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MEI_PllOffsetConfigGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_pllOffsetConfig_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_pllOffsetConfig_t)); + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_PLL_OFFSET_CONFIG_GET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nPllOffset=%d" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), pData.nPllOffset); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET */ + +static const DSL_char_t g_sMEIPocs[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "- DSL_uint16_t nPllOffset" DSL_CPE_CRLF + " PLL_OFFSET_MIN = -32768" DSL_CPE_CRLF + " PLL_OFFSET_MAX = 32767" DSL_CPE_CRLF + " PLL_DISABLED = 32768" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_MEI_PllOffsetConfigSet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_pllOffsetConfig_t pData; + DSL_uint32_t nDevice = 0; + DSL_char_t dev_name[32] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_pllOffsetConfig_t)); + + sscanf (pCommands, "%d", &pData.nPllOffset); + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_PLL_OFFSET_CONFIG_SET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret)); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} + +static const DSL_char_t g_sRaSg[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DEVICE_NUMBER > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_AccessDir_t nDirection" DSL_CPE_CRLF + " upstream = 0" DSL_CPE_CRLF + " downstream = 1" DSL_CPE_CRLF + DSL_CPE_CRLF + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF +#if (DSL_CPE_MAX_DEVICE_NUMBER > 1) + "- DSL_uint32_t nDevice (optional, not used in the 'backward compatible' mode)" DSL_CPE_CRLF +#endif + "- DSL_uint8_t nDirection" DSL_CPE_CRLF + "- DSL_G997_RA_MODE_t RA_MODE" DSL_CPE_CRLF + " manual = 1" DSL_CPE_CRLF + " at init = 2" DSL_CPE_CRLF + " dynamic = 3" DSL_CPE_CRLF + " dynamic SOS = 4" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_G997_RateAdaptationStatusGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_G997_RateAdaptationStatus_t pData; + int nDirection = 0; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 1, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(DSL_G997_RateAdaptationStatus_t)); + + sscanf (pCommands, "%d", &nDirection); + + pData.nDirection = nDirection; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_G997_RATE_ADAPTATION_STATUS_GET, (int) &pData); + + if ((ret < 0) && (pData.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.accessCtl.nReturn)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nDirection=%hu RA_MODE=%u" DSL_CPE_CRLF, + DSL_CPE_RET_VAL(pData.accessCtl.nReturn), + pData.nDirection, pData.data.RA_MODE); + } + + return 0; +} + +#ifdef INCLUDE_DSL_CONFIG_GET +static const DSL_char_t g_sDig[] = +#ifndef DSL_CPE_DEBUG_DISABLE + "Long Form: %s" DSL_CPE_CRLF + "Short Form: %s" DSL_CPE_CRLF + DSL_CPE_CRLF + "Input Parameter" DSL_CPE_CRLF + "%s" + "Output Parameter" DSL_CPE_CRLF + "- DSL_Error_t nReturn" DSL_CPE_CRLF + "%s" + "- DSL_uint8_t nMaxDeviceNumber" DSL_CPE_CRLF + "- DSL_uint8_t nLinesPerDevice" DSL_CPE_CRLF + "- DSL_uint8_t nChannelsPerLine" DSL_CPE_CRLF + "- DSL_uint8_t nEntitiesEnabled" DSL_CPE_CRLF + DSL_CPE_CRLF ""; +#else + ""; +#endif + +DSL_CLI_LOCAL DSL_int_t DSL_CPE_CLI_DeviceInfoGet( + DSL_int_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0, mei_fd; + IOCTL_MEI_devinfo_t pData; + DSL_uint32_t nDevice; + DSL_char_t dev_name[32] = {0}; + + if (DSL_CPE_CLI_CheckParamNumber(pCommands, 0, DSL_CLI_EQUALS) == DSL_FALSE) + { + return -1; + } + + memset(&pData, 0x0, sizeof(IOCTL_MEI_devinfo_t)); + + DSL_CPE_Fd2DevNum(fd, &nDevice); + + snprintf(dev_name, sizeof(dev_name), "/dev/mei_cpe/%u", nDevice); + + mei_fd = DSL_CPE_Open(dev_name); + if (mei_fd <= 0) { + DSL_CPE_Close(mei_fd); + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(mei_fd)); + return 0; + } + + ret = ioctl(mei_fd, FIO_MEI_DRV_DEVINFO_GET, (DSL_int_t)&pData); + if (ret != 0) + { + DSL_CPE_FPrintf (out, sFailureReturn, DSL_CPE_RET_VAL(pData.ictl.retCode)); + } + else + { + DSL_CPE_FPrintf (out, DSL_CPE_RET"nMaxDeviceNumber=%u nLinesPerDevice=%u " + "nChannelsPerLine=%u nEntitiesEnabled=%u" + DSL_CPE_CRLF, DSL_CPE_RET_VAL(ret), + pData.maxDeviceNumber, pData.linesPerDevice, + pData.channelsPerLine, pData.entitiesEnabled); + } + + DSL_CPE_Close(mei_fd); + + return 0; +} +#endif /* INCLUDE_DSL_CONFIG_GET */ + +DSL_void_t DSL_CPE_CLI_DeviceCommandsRegister (DSL_void_t) +{ + /* Debug functionalities */ + DSL_CPE_CLI_CMD_ADD_DEVICE ("dms", "DeviceMessageSend", DSL_CPE_CLI_DBG_DeviceMessageSend, g_sDms); + DSL_CPE_CLI_CMD_ADD_DEVICE ("dmms", "DeviceMessageModifySend", DSL_CPE_CLI_DBG_DeviceMessageModifySend, g_sDmms); + + /* Common functionalities */ + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("aufg", "AutobootUsedFirmwareGet", DSL_CPE_CLI_AutobootUsedFirmwareGet, g_sAufg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("alf", "AutobootLoadFirmware", DSL_CPE_CLI_AutobootLoadFirmware, g_sAlf); + DSL_CPE_CLI_CMD_ADD_DEVICE ("alig", "AuxLineInventoryGet", DSL_CPE_CLI_AuxLineInventoryGet, g_sAlig); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("bpsg", "BandPlanSupportGet", DSL_CPE_CLI_BandPlanSupportGet, g_sBpsg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("bpstg", "BandPlanSTatusGet", DSL_CPE_CLI_BandPlanStatusGet, g_sBpstg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("vig", "VersionInformationGet", DSL_CPE_CLI_VersionInformationGet, g_sVig); + if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_CLI_CMD_ADD_DEVICE ("dscs", "DeviceSelectionConfigSet", DSL_CPE_CLI_DeviceSelectionConfigSet, g_sDscs); + DSL_CPE_CLI_CMD_ADD_DEVICE ("dscg", "DeviceSelectionConfigGet", DSL_CPE_CLI_DeviceSelectionConfigGet, g_sDscg); + } + + DSL_CPE_CLI_CMD_ADD_DEVICE ("llcs", "LowLevelConfigurationSet", DSL_CPE_CLI_LowLevelConfigurationSet, g_sLlcs); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("llcg", "LowLevelConfigurationGet", DSL_CPE_CLI_LowLevelConfigurationGet, g_sLlcg); + + /* G.997.1 related functionlities */ + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lspbg", "G997_LineStatusPerBandGet", DSL_CPE_CLI_G997_LineStatusPerBandGet, g_sG997lspbg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997upbosg", "G997_UsPowerBackOffStatusGet", DSL_CPE_CLI_G997_UsPowerBackOffStatusGet, g_sG997upbosg); + + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997lpmcs", "G997_LowPowerModeConfigSet", DSL_CPE_CLI_G997_LowPowerModeConfigSet, g_sLpmcs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("g997lpmcg", "G997_LowPowerModeConfigGet", DSL_CPE_CLI_G997_LowPowerModeConfigGet, g_sLpmcg); +#endif /* #ifdef INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_G997_STATUS + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997ansg", "G997_AttainableNdrStatusGet", DSL_CPE_CLI_G997_AttainableNdrStatusGet, g_sG997ansg); +#endif /* #ifdef INCLUDE_DSL_G997_STATUS*/ + +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("dsmcg", "DSM_ConfigGet", DSL_CPE_CLI_DsmConfigGet, g_sDsmcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("dsmcs", "DSM_ConfigSet", DSL_CPE_CLI_DsmConfigSet, g_sDsmcs); + DSL_CPE_CLI_CMD_ADD_DEVICE ("dsmsg", "DSM_StatusGet", DSL_CPE_CLI_DsmStatusGet, g_sDsmsg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("dsmstatg", "DSM_STATisticsGet", DSL_CPE_CLI_DsmStatisticsGet, g_sDsmstatg); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("dsmmcg", "DSM_MacConfigGet", DSL_CPE_CLI_DsmMacConfigGet, g_sDsmmcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("dsmmcs", "DSM_MacConfigSet", DSL_CPE_CLI_DsmMacConfigSet, g_sDsmmcs); + + if (INCLUDE_DSL_BONDING) + { + /* Debug functionalities */ +#ifndef DSL_CPE_DEBUG_DISABLE + DSL_CPE_CLI_CMD_ADD_DEVICE ("bnddbgsg", "BND_DBG_StatusGet", DSL_CPE_CLI_BND_DBG_StatusGet, g_sBNDDBGst); +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE */ + DSL_CPE_CLI_CMD_ADD_DEVICE ("bndcs", "BND_ConfigSet", DSL_CPE_CLI_BND_ConfigSet, g_sBNDcs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("bndcg", "BND_ConfigGet", DSL_CPE_CLI_BND_ConfigGet, g_sBNDcg); +#endif /* #ifdef INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("bndhsg", "BND_HsStatusGet", DSL_CPE_CLI_BND_HsStatusGet, g_sBNDhsg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("bndethdbgcg", "BND_ETH_DBG_CountersGet", DSL_CPE_CLI_BND_ETH_DBG_CountersGet, g_sBNDETHDBGcg); + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("bndethcg", "BND_ETH_CountersGet", DSL_CPE_CLI_BND_ETH_CountersGet, g_sBNDETHcg); + DSL_CPE_CLI_CMD_ADD_DEVICE ("bndpmss", "BND_PortModeSyncSet", DSL_CPE_CLI_BND_PortModeSyncSet, g_sBNDpmss); + } + + DSL_CPE_CLI_CMD_ADD_DEVICE ("vpcs", "VdslProfileConfigSet", DSL_CPE_CLI_VdslProfileConfigSet, g_sVpcs); +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG ("vpcg", "VdslProfileConfigGet", DSL_CPE_CLI_VdslProfileConfigGet, g_sVpcg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("meipocg", "MEI_PllOffsetConfigGet", DSL_CPE_CLI_MEI_PllOffsetConfigGet, g_sMEIPocg); +#endif /* INCLUDE_DSL_CONFIG_GET*/ + DSL_CPE_CLI_CMD_ADD_DEVICE ("meipocs", "MEI_PllOffsetConfigSet", DSL_CPE_CLI_MEI_PllOffsetConfigSet, g_sMEIPocs); + + DSL_CPE_CLI_CMD_ADD_DEVICE ("g997rasg", "G997_RateAdaptationStatusGet", DSL_CPE_CLI_G997_RateAdaptationStatusGet, g_sRaSg); + +#ifdef INCLUDE_DSL_CONFIG_GET + DSL_CPE_CLI_CMD_ADD_DEVICE ("dig", "DeviceInfoGet", DSL_CPE_CLI_DeviceInfoGet, g_sDig); +#endif /* INCLUDE_DSL_CONFIG_GET*/ +} + +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#endif /* INCLUDE_DSL_CPE_API_VRX */ diff --git a/src/dsl_cpe_config.h.in b/src/dsl_cpe_config.h.in new file mode 100644 index 0000000..918affc --- /dev/null +++ b/src/dsl_cpe_config.h.in @@ -0,0 +1,294 @@ +/* src/dsl_cpe_config.h.in. Generated from configure.in by autoheader. */ + + +#ifndef _DSL_CPE_CONFIG_H +#define _DSL_CPE_CONFIG_H + +/* Debug level = local */ +#undef DSL_CCA_DBG_MAX_LEVEL_PRE + +/* Preselection of max. debug level = no (using default) */ +#undef DSL_CCA_DBG_MAX_LEVEL_SET + +/* Disabled debug prints */ +#undef DSL_CPE_DEBUG_DISABLE + +/* Debug netlink ID number. */ +#undef DSL_DBG_MSG_NETLINK_ID + +/* Include DSL TCP debug support */ +#undef DSL_DEBUG_TOOL_INTERFACE + +/* Add VR10 support */ +#undef DSL_VRX_DEVICE_VR10 + +/* Add VR10_320 support */ +#undef DSL_VRX_DEVICE_VR10_320 + +/* Add VR11 support */ +#undef DSL_VRX_DEVICE_VR11 + +/* Add VR9 support */ +#undef DSL_VRX_DEVICE_VR9 + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SAFE_LIB_H + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Include deprecated functions */ +#undef INCLUDE_DEPRECATED + +/* Include Device Exception Codes */ +#undef INCLUDE_DEVICE_EXCEPTION_CODES + +/* Include ADSL MIB support */ +#undef INCLUDE_DSL_ADSL_MIB + +/* Include DSL CEOC support */ +#undef INCLUDE_DSL_CEOC + +/* Include configuration get support */ +#undef INCLUDE_DSL_CONFIG_GET + +/* Add DANUBE support */ +#undef INCLUDE_DSL_CPE_API_DANUBE + +/* Add VRX support */ +#undef INCLUDE_DSL_CPE_API_VRX + +/* Enable Autogen CLI support */ +#undef INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT + +/* Enable CLI support */ +#undef INCLUDE_DSL_CPE_CLI_SUPPORT + +/* Enable CMV scripts math support */ +#undef INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH + +/* Enable CMV scripts parser support */ +#undef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + +/* Enable debug logger support */ +#undef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT + +/* Include DTI support */ +#undef INCLUDE_DSL_CPE_DTI_SUPPORT + +/* Include filesystem support */ +#undef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + +/* Include IFXOS support */ +#undef INCLUDE_DSL_CPE_IFXOS_SUPPORT + +/* Include Misc Line Status support */ +#undef INCLUDE_DSL_CPE_MISC_LINE_STATUS + +/* Include DSL PM channel counters support */ +#undef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS + +/* Include DSL PM channel extended counters support */ +#undef INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS + +/* Include DSL PM channel thresholds support */ +#undef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS + +/* Include PM config support */ +#undef INCLUDE_DSL_CPE_PM_CONFIG + +/* Include DSL PM datapath counters support */ +#undef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS + +/* Include DSL PM datapath failure counters support */ +#undef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS + +/* Include DSL PM datapath thresholds support */ +#undef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS + +/* Include DSL PM history support */ +#undef INCLUDE_DSL_CPE_PM_HISTORY + +/* Include DSL PM line counters support */ +#undef INCLUDE_DSL_CPE_PM_LINE_COUNTERS + +/* Include DSL PM line event showtime counters support */ +#undef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS + +/* Include DSL PM line thresholds support */ +#undef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS + +/* Include DSL PM optional parameters support */ +#undef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS + +/* Include DSL PM retransmission counters support */ +#undef INCLUDE_DSL_CPE_PM_RETX_COUNTERS + +/* Include DSL PM retransmission thresholds support */ +#undef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS + +/* Include DSL PM showtime counters support */ +#undef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS + +/* Include DSL PM total counters support */ +#undef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS + +/* Include ADSL showtime event logging support */ +#undef INCLUDE_DSL_CPE_TRACE_BUFFER + +/* Include DELT support */ +#undef INCLUDE_DSL_DELT + +/* Include FW request support */ +#undef INCLUDE_DSL_EVENT_POLLING + +/* Include Filter Detection support */ +#undef INCLUDE_DSL_FILTER_DETECTION + +/* Include Framing Parameters support */ +#undef INCLUDE_DSL_FRAMING_PARAMETERS + +/* Include G997 alarm support */ +#undef INCLUDE_DSL_G997_ALARM + +/* Include G997 Framing Parameters support */ +#undef INCLUDE_DSL_G997_FRAMING_PARAMETERS + +/* Include G997 Line Inventory support */ +#undef INCLUDE_DSL_G997_LINE_INVENTORY + +/* Include G997 per tone values support */ +#undef INCLUDE_DSL_G997_PER_TONE + +/* Include G997 status support */ +#undef INCLUDE_DSL_G997_STATUS + +/* Include DSL PM support */ +#undef INCLUDE_DSL_PM + +/* Include Resource Statistics support */ +#undef INCLUDE_DSL_RESOURCE_STATISTICS + +/* Include System Interface configuration support */ +#undef INCLUDE_DSL_SYSTEM_INTERFACE + +/* Enable DTI stand-alone agent support */ +#undef INCLUDE_DTI_AGENT_STANDALONE_SUPPORT + +/* Include FW request support */ +#undef INCLUDE_FW_REQUEST_SUPPORT + +/* Pilot Tones Status support */ +#undef INCLUDE_PILOT_TONES_STATUS + +/* Include DSL RTT support */ +#undef INCLUDE_REAL_TIME_TRACE + +/* Enable script notification support */ +#undef INCLUDE_SCRIPT_NOTIFICATION + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Safe-C supported */ +#undef SAFEC_SUPPORT + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to empty if the keyword `volatile' does not work. Warning: valid + code using `volatile' can become incorrect without. Disable with care. */ +#undef volatile + + +#endif /* _DSL_CPE_CONFIG_H */ diff --git a/src/dsl_cpe_control.c b/src/dsl_cpe_control.c new file mode 100644 index 0000000..c3e53bc --- /dev/null +++ b/src/dsl_cpe_control.c @@ -0,0 +1,7553 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/* +Includes +*/ +#include "dsl_cpe_control.h" +#include "dsl_cpe_cli.h" +#include "dsl_cpe_cli_console.h" +#include "dsl_cpe_debug.h" +#include "drv_dsl_cpe_api_ioctl.h" +#include "dsl_cpe_simulator.h" +#include + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) +#include "drv_dsl_cpe_cmv_danube.h" +#endif + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +#include "dsl_cpe_dti.h" +#endif + +#if defined (INCLUDE_DSL_CPE_API_VRX) +#include "dsl_cpe_bnd_vrx.h" +#endif + +#define DSL_CPE_STATIC static + +#include "dsl_cpe_init_cfg.h" + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP + +#ifdef LINUX +struct termios stored_stdout_settings; +struct termios stored_stdin_settings; +#endif /* LINUX */ + +#ifdef RTEMS +#ifdef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE +#include "AmazonSE_310801.h" +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ +DSL_CPE_ThreadCtrl DslMainControl; +static DSL_int_t errno = 0; +#endif /*RTEMS*/ + +DSL_boolean_t bScriptError = DSL_FALSE; + +/* the console only works in forground mode, so no daemonize ! */ +#ifndef INCLUDE_DSL_API_CONSOLE + +#if defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32) +DSL_char_t *g_sRemoteTcpServerIp = DSL_NULL; +#endif /* defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/ + +/* 'daemon()' function is not working correctly therefore this feature has been + disabled here. + You might use the '&' operator to start the dsl_cpe_control application + within background */ +#undef USE_DAEMONIZE +#if 0 +#ifdef __UCLIBC__ +#define UCLIBC_VER ((__UCLIBC_MAJOR__*10000) + (__UCLIBC_MINOR__*100) + __UCLIBC_SUBLEVEL__) +#if (UCLIBC_VER >= 926) + /* Older versions of uClibc than our tested version (0.9.26) seams to have + problems with the daemon function */ +#define USE_DAEMONIZE 1 +#endif +#else + /* assume that other libraries will work! */ +/*#define USE_DAEMONIZE 1*/ +#endif /* __UCLIBC__ */ +#endif + +#endif /* INCLUDE_DSL_API_CONSOLE */ + +#if defined(INCLUDE_DSL_CPE_API_VRX) +DSL_CPE_STATIC DSL_char_t *sLowLevCfgName = DSL_NULL; + +DSL_CPE_STATIC DSL_MultimodeFsmConfigData_t g_MultimodeFsmConfig = + {DSL_FW_TYPE_NA}; + +DSL_CPE_STATIC DSL_ActivationFsmConfigData_t g_ActivationFsmConfig = + {DSL_ACT_SEQ_STD, DSL_ACT_MODE_NA}; + +DSL_CPE_STATIC DSL_boolean_t g_RememberFsmConfig = + {DSL_TRUE}; +#endif + +DSL_CPE_STATIC DSL_SystemInterfaceConfigData_t g_sSysIfCfg[DSL_MODE_LAST]; +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +DSL_CPE_STATIC const DSL_CPE_EVT_CodeString_t eventString[] = +{ + {DSL_EVENT_I_LINE_FAILURES, "DSL_EVENT_I_LINE_FAILURES"}, + {DSL_EVENT_I_DATA_PATH_FAILURES, "DSL_EVENT_I_DATA_PATH_FAILURES"}, + {DSL_EVENT_I_LINE_THRESHOLD_CROSSING, "DSL_EVENT_I_LINE_THRESHOLD_CROSSING"}, + {DSL_EVENT_I_CHANNEL_THRESHOLD_CROSSING, "DSL_EVENT_I_CHANNEL_THRESHOLD_CROSSING"}, + {DSL_EVENT_I_DATA_PATH_THRESHOLD_CROSSING, "DSL_EVENT_I_DATA_PATH_THRESHOLD_CROSSING"}, + {DSL_EVENT_I_RETX_THRESHOLD_CROSSING, "DSL_EVENT_I_RETX_THRESHOLD_CROSSING"}, + {DSL_EVENT_I_CHANNEL_DATARATE_SHIFT_THRESHOLD_CROSSING, "DSL_EVENT_I_CHANNEL_DATARATE_SHIFT_THRESHOLD_CROSSING"}, + {DSL_EVENT_S_LINIT_FAILURE, "DSL_EVENT_S_LINIT_FAILURE"}, + {DSL_EVENT_S_LINE_STATE, "DSL_EVENT_S_LINE_STATE"}, + {DSL_EVENT_S_LINE_POWERMANAGEMENT_STATE, "DSL_EVENT_S_LINE_POWERMANAGEMENT_STATE"}, + {DSL_EVENT_S_CHANNEL_DATARATE, "DSL_EVENT_S_CHANNEL_DATARATE"}, + {DSL_EVENT_S_FIRMWARE_ERROR, "DSL_EVENT_S_FIRMWARE_ERROR"}, + {DSL_EVENT_S_INIT_READY, "DSL_EVENT_S_INIT_READY"}, + {DSL_EVENT_S_FE_INVENTORY_AVAILABLE, "DSL_EVENT_S_FE_INVENTORY_AVAILABLE"}, + {DSL_EVENT_S_FE_TESTPARAMS_AVAILABLE, "DSL_EVENT_S_FE_TESTPARAMS_AVAILABLE"}, + {DSL_EVENT_S_SYSTEM_STATUS, "DSL_EVENT_S_SYSTEM_STATUS"}, + {DSL_EVENT_S_PM_SYNC, "DSL_EVENT_S_PM_SYNC"}, + {DSL_EVENT_S_LINE_TRANSMISSION_STATUS, "DSL_EVENT_S_LINE_TRANSMISSION_STATUS"}, + {DSL_EVENT_S_SHOWTIME_LOGGING, "DSL_EVENT_S_SHOWTIME_LOGGING"}, + {DSL_EVENT_S_FIRMWARE_REQUEST, "DSL_EVENT_S_FIRMWARE_REQUEST"}, + {DSL_EVENT_S_FIRMWARE_DOWNLOAD_STATUS, "DSL_EVENT_S_FIRMWARE_DOWNLOAD_STATUS"}, + {DSL_EVENT_S_AUTOBOOT_STATUS, "DSL_EVENT_S_AUTOBOOT_STATUS"}, + {DSL_EVENT_S_SNMP_MESSAGE_AVAILABLE, "DSL_EVENT_S_SNMP_MESSAGE_AVAILABLE"}, + {DSL_EVENT_S_SYSTEM_INTERFACE_STATUS, "DSL_EVENT_S_SYSTEM_INTERFACE_STATUS"}, + {DSL_EVENT_LAST, DSL_NULL} +}; +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + +/* +local prototypes +*/ +DSL_CPE_STATIC DSL_void_t DSL_CPE_ArgParse ( + DSL_int32_t argc, + DSL_char_t * argv[] +); + +DSL_CPE_STATIC DSL_Error_t DSL_CPE_SysIfCfgCheck( + DSL_int_t nArgs, + DSL_CPE_ArgElement_t *pArgList +); + +DSL_CPE_STATIC DSL_void_t DSL_CPE_ArgParseSysIfCfg ( + DSL_char_t * optarg +); + +#ifndef DSL_CPE_DEBUG_DISABLE +DSL_CPE_STATIC DSL_void_t DSL_CPE_ArgParseCommonDebugLevel ( + DSL_char_t * optarg +); +#endif + +DSL_CPE_STATIC DSL_void_t DSL_CPE_Help ( + DSL_char_t * sApplicationName +); + +DSL_CPE_STATIC DSL_void_t DSL_CPE_Termination(void); + +DSL_CPE_STATIC DSL_Error_t DSL_CPE_FwInfoFromWhatstringGet( + DSL_char_t *pWhatString, + DSL_int_t *pFwApplication, + DSL_uint8_t *nPlatformId +); + + +DSL_CPE_STATIC DSL_CPE_Control_Context_t *gDSLContext = DSL_NULL; + +#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT +extern DSL_Error_t DSL_CPE_Pipe_Init (DSL_CPE_Control_Context_t * pContext); +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +extern DSL_Error_t DSL_CPE_Pipe_StaticResourceUsageGet(DSL_uint32_t *pStatResUsage); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ +#endif + +DSL_char_t *g_sFirmwareName1 = DSL_NULL; +DSL_FirmwareFeatures_t g_nFwFeatures1 = {DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED, + DSL_FW_XDSLFEATURE_CLEANED}; + +DSL_char_t *g_sFirmwareName2 = DSL_NULL; +DSL_FirmwareFeatures_t g_nFwFeatures2 = {DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED, + DSL_FW_XDSLFEATURE_CLEANED}; + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +DSL_char_t *g_sRcScript = DSL_NULL; +DSL_CPE_STATIC DSL_boolean_t bScriptWarn = DSL_FALSE; +#endif + +DSL_boolean_t g_bWaitBeforeLinkActivation[DSL_CPE_MAX_DSL_ENTITIES]; +DSL_boolean_t g_bWaitBeforeConfigWrite[DSL_CPE_MAX_DSL_ENTITIES]; +DSL_boolean_t g_bWaitBeforeRestart[DSL_CPE_MAX_DSL_ENTITIES]; + +static DSL_LineStateValue_t g_nPrevLineState[DSL_CPE_MAX_DSL_ENTITIES]; + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +# ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +DSL_char_t *g_sAdslScript = DSL_NULL; +DSL_char_t *g_sVdslScript = DSL_NULL; +# else +#include "dsl_cpe_autoboot_script_adsl.h" +DSL_char_t *g_sAdslScript = g_sAdslScript_static; +#if defined(INCLUDE_DSL_CPE_API_VRX) +#include "dsl_cpe_autoboot_script_vdsl.h" +DSL_char_t *g_sVdslScript = g_sVdslScript_static; +#else +DSL_char_t *g_sVdslScript = DSL_NULL; +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ +# endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ +DSL_boolean_t g_bAutoContinueWaitBeforeLinkActivation[DSL_CPE_MAX_DSL_ENTITIES]; +DSL_boolean_t g_bAutoContinueWaitBeforeConfigWrite[DSL_CPE_MAX_DSL_ENTITIES]; +DSL_boolean_t g_bAutoContinueWaitBeforeRestart[DSL_CPE_MAX_DSL_ENTITIES]; +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/ + +/* +local variables +*/ +DSL_CPE_STATIC DSL_int32_t bHelp = -1; +DSL_CPE_STATIC DSL_int32_t bGetVersion = -1; +DSL_CPE_STATIC DSL_int32_t bInit = -1; +DSL_CPE_STATIC DSL_int32_t bXtuOctets = -1; + +/* Events and resource handling is enabled for all available types by default! */ +DSL_CPE_STATIC DSL_boolean_t bEventActivation = DSL_TRUE; +DSL_CPE_STATIC DSL_uint32_t nResourceActivationMask = 0x00000000; + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) && !defined(RTEMS) + DSL_int32_t bOptimize = 1; +#else + DSL_int32_t bOptimize = -1; +#endif /* defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + +#if defined(RTEMS) +DSL_CPE_STATIC DSL_int32_t bMsgDump = 1; +#else +DSL_CPE_STATIC DSL_int32_t bMsgDump = -1; +#endif /* defined(RTEMS)*/ + +#ifndef DSL_CPE_DEBUG_DISABLE +DSL_CPE_STATIC DSL_int32_t g_bDebugLevelApp = -1; +DSL_CPE_STATIC DSL_uint32_t g_nDebugLevelApp = 0; +DSL_CPE_STATIC DSL_int32_t g_bDebugLevelDrv = -1; +DSL_CPE_STATIC DSL_uint32_t g_nDebugLevelDrv = 0; +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ + +#ifdef DSL_DEBUG_TOOL_INTERFACE +DSL_CPE_STATIC DSL_int32_t bTcpMessageIntf = -1; +#endif + +#ifdef INCLUDE_DSL_CPE_DTI_SUPPORT +DSL_CPE_STATIC DSL_int32_t bDTI = -1; +#endif + +#ifdef USE_DAEMONIZE +DSL_CPE_STATIC DSL_int_t bNotSilent = 1; +#endif /* USE_DAEMONIZE */ + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +DSL_CPE_STATIC DSL_int32_t bConsole = -1; +DSL_CPE_Console_Context_t *pConsoleContext = DSL_NULL; +#endif + +DSL_CPE_STATIC DSL_int_t g_bFirmware1 = -1; +DSL_CPE_STATIC DSL_int_t g_bFirmware2 = -1; + +DSL_CPE_STATIC DSL_G997_XTUSystemEnablingData_t g_nXtseInit; +DSL_CPE_STATIC DSL_uint8_t g_nMsgDumpDbgLvl; + +#ifndef DSL_CPE_DEBUG_DISABLE + +#define MAX_DBG_MOD_PAIRS 10 +DSL_CPE_STATIC DSL_DBG_ModuleLevelData_t g_nDbgDrvLevel[MAX_DBG_MOD_PAIRS] = {{0,0}}; +DSL_CPE_STATIC DSL_DBG_ModuleLevelData_t g_nDbgAppLevel[MAX_DBG_MOD_PAIRS] = {{0,0}}; + +#endif /*DSL_CPE_DEBUG_DISABLE*/ + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +typedef struct +{ + /** reference to registered CLI */ + DSL_CLI_Context_t *pCLIContext; + /** running status of pipe task */ + volatile DSL_boolean_t bRun; +} dummy_console_t; + +DSL_CPE_STATIC dummy_console_t dummy_console; + +DSL_CPE_STATIC DSL_Error_t DSL_CPE_Control_Exit (DSL_void_t * pContext); +#endif + +#ifdef LINUX +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + #define DSL_CPE_DEFAULT_FIRMWARE_1 "/opt/lantiq/firmware/ModemHWE.bin" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "" +#elif defined(INCLUDE_DSL_CPE_API_VRX) + #define DSL_CPE_DEFAULT_FIRMWARE_1 "/opt/lantiq/firmware/xcpe_hw.bin" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "/opt/lantiq/firmware/xcpe_hw_2p.bin" +#endif +#elif defined(VXWORKS) +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + #define DSL_CPE_DEFAULT_FIRMWARE_1 "modemhwe.bin" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "" +#elif defined(INCLUDE_DSL_CPE_API_VRX) + #define DSL_CPE_DEFAULT_FIRMWARE_1 "xcpe_hw.bin" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "xcpe_hw_2p.bin" +#endif +#elif defined(RTEMS) + #define DSL_CPE_DEFAULT_FIRMWARE_1 "cgi_pFileData_modemfw_bin" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "" +#elif defined(WIN32) +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + #define DSL_CPE_DEFAULT_FIRMWARE_1 "..\\firmware\\modemhwe.bin" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "" +#elif defined(INCLUDE_DSL_CPE_API_VRX) + #define DSL_CPE_DEFAULT_FIRMWARE_1 "..\\firmware\\xcpe_hw.bin" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "..\\firmware\\xcpe_hw_2.bin" +#endif +#else + #define DSL_CPE_DEFAULT_FIRMWARE_1 "" + #define DSL_CPE_DEFAULT_FIRMWARE_2 "" +#endif + +const DSL_char_t *sDefaultFirmwareName1 = (DSL_char_t *)DSL_CPE_DEFAULT_FIRMWARE_1; +const DSL_char_t *sDefaultFirmwareName2 = (DSL_char_t *)DSL_CPE_DEFAULT_FIRMWARE_2; + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + #if defined (INCLUDE_DSL_CPE_API_DANUBE) + #define DSL_CPE_DEFAULT_RC_SCRIPT "./adslrc.sh" + #else + #define DSL_CPE_DEFAULT_RC_SCRIPT "./xdslrc.sh" + #endif + const DSL_char_t *sDefaultRcScript = DSL_CPE_DEFAULT_RC_SCRIPT; +#endif + +#ifdef DSL_DEBUG_TOOL_INTERFACE +DSL_char_t *g_sTcpMessagesSocketAddr = DSL_NULL; +DSL_uint16_t g_nTcpMessagesSocketPort = 0; +DSL_boolean_t g_bEnableTcpCli = DSL_FALSE; +#endif + +#ifdef INCLUDE_DSL_CPE_DTI_SUPPORT +DSL_char_t *sDtiSocketAddr = DSL_NULL; +#endif + + +DSL_uint8_t g_nDevices = 1; +DSL_uint8_t g_nLines = 1; +DSL_uint8_t g_nChannels = 1; + + +/*DSL_InitData_t gInitCfgData;*/ + + +DSL_CPE_STATIC struct option long_options[] = { + {"help ", 0, 0, 'h'}, + {"version ", 0, 0, 'v'}, + {"init ", 1, 0, 'i'}, +#if defined(INCLUDE_DSL_CPE_API_VRX) + #if (DSL_CPE_MAX_DSL_ENTITIES > 1) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + {"backward ", 0, 0, 'b'}, + #endif /* (DSL_CPE_MAX_DSL_ENTITIES > 1) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/ + {"low_cfg ", 1, 0, 'l'}, +#endif +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + {"console ", 0, 0, 'c'}, +#endif + {"event_cnf ", 1, 0, 'e'}, + {"msg_dump ", 1, 0, 'm'}, +#ifndef DSL_CPE_DEBUG_DISABLE + {"dbg_level ", 1, 0, 'D'}, +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + {"auto_scr_1", 1, 0, 'a'}, +#if defined(INCLUDE_DSL_CPE_API_VRX) + {"auto_scr_2", 1, 0, 'A'}, +#endif +#endif +#endif +#ifdef USE_DAEMONIZE + {"silent ", 0, 0, 'q'}, +#endif /* USE_DAEMONIZE */ + {"firmware1 ", 1, 0, 'f'}, + {"firmware2 ", 1, 0, 'F'}, /*TODO: fail if not ocb */ +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + {"opt_off ", 1, 0, 'o'}, +#endif +#ifdef INCLUDE_SCRIPT_NOTIFICATION + {"notif ", 1, 0, 'n'}, +#endif +#if defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32) + {"remoteTcp ", 1, 0, 'r'}, +#endif /* defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/ +#ifdef DSL_DEBUG_TOOL_INTERFACE + {"tcpmsg ", 1, 0, 't'}, +#endif +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) + {"dti ", 1, 0, 'd'}, +#endif /* defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ +#ifdef INCLUDE_DSL_CPE_API_VRX + {"multimode ", 1, 0, 'M'}, +#endif + {"tc-layer ", 1, 0, 'T'}, +#ifdef INCLUDE_DSL_CPE_API_VRX + {"sequence ", 1, 0, 'S'}, + {"remember ", 1, 0, 'R'}, +#endif +#ifndef DSL_CPE_DEBUG_DISABLE + {"debug_drv ", 1, 0, 'g'}, + {"debug_app ", 1, 0, 'G'}, +#endif + {"devices ", 1, 0, 'V'}, + {"lines ", 1, 0, 'L'}, + {"channels ", 1, 0, 'C'}, + {0, 0, 0, 0} +}; + +/* 1 colon means there is a required parameter */ +/* 2 colons means there is an optional parameter */ +DSL_CPE_STATIC const DSL_char_t GETOPT_LONG_OPTSTRING[] = "hvi::" +#if defined(INCLUDE_DSL_CPE_API_VRX) + #if (DSL_CPE_MAX_DSL_ENTITIES > 1) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + "b" + #endif /* (DSL_CPE_MAX_DSL_ENTITIES > 1) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/ + "l:" +#endif +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + "c" +#endif + "e:m::" +#ifndef DSL_CPE_DEBUG_DISABLE + "D:" +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + "a:" +#if defined(INCLUDE_DSL_CPE_API_VRX) + "A:" +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ +#endif +#endif +#ifdef USE_DAEMONIZE + "q" +#endif + "f:" + "F:" +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + "o" +#endif +#ifdef INCLUDE_SCRIPT_NOTIFICATION + "n:" +#endif +#if defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32) + "r:" +#endif /* defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/ +#ifdef DSL_DEBUG_TOOL_INTERFACE + "t::" +#endif +#ifdef INCLUDE_DSL_CPE_DTI_SUPPORT + "d::" +#endif +#ifdef INCLUDE_DSL_CPE_API_VRX + "M:" +#endif + "T:" +#ifdef INCLUDE_DSL_CPE_API_VRX + "S:R:" +#endif +#ifndef DSL_CPE_DEBUG_DISABLE + "g::G::" +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ + "V:" + "L:" + "C:" + ; + +/*lint -save -e786 */ \ +DSL_CPE_STATIC DSL_char_t description[][105] = { + {"help screen"}, + {"display version"}, + {"init device w/ Bits seperated by underscore (e.g. -i05_01_04_00_04_01_00_00)"}, +#if defined(INCLUDE_DSL_CPE_API_VRX) + #if (DSL_CPE_MAX_DSL_ENTITIES > 1) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + {"CLI backward compatible mode"}, + #endif /*(DSL_CPE_MAX_DSL_ENTITIES > 1)*/ + {"low level configuration file"}, +#endif +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + {"start console"}, +#endif + {"configure instance activation handling [_mask] (e.g. -e1_1)"}, + {"enable message dump"}, +#ifndef DSL_CPE_DEBUG_DISABLE + {"config debug level -D{_} (0=NO, 1=LOW, 2=NORMAL, 3=HIGH, 4=OFF), e.g. -D3"}, +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + {"autoboot start script for ADSL (empty by default)"}, +#if defined(INCLUDE_DSL_CPE_API_VRX) + {"autoboot start script for VDSL (empty by default)"}, +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ +#endif +#endif +#ifdef USE_DAEMONIZE + "silent mode, no output from background", +#endif + {"firmware file, default " DSL_CPE_DEFAULT_FIRMWARE_1}, + {"2nd firmware file, default " DSL_CPE_DEFAULT_FIRMWARE_2}, +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + {"deactivate footprint optimizations"}, +#endif +#ifdef INCLUDE_SCRIPT_NOTIFICATION + {"notification script name, default " DSL_CPE_DEFAULT_RC_SCRIPT}, +#endif +#if defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32) + {"remote TCP debug server IP address"}, +#endif /* defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/ +#ifdef DSL_DEBUG_TOOL_INTERFACE + {"enable dbgtool, listen only on (optional, e.g. -t0.0.0.0)"}, +#endif +#ifdef INCLUDE_DSL_CPE_DTI_SUPPORT + {"enable DTI support on default tcp port 9000, listen only on (optional)"}, +#endif +#ifdef INCLUDE_DSL_CPE_API_VRX + {"set multimode config -M (e.g. -M1)"}, + {"config TC-Layer -T::_:: (e.g. -T1:0x0:0x0_2:0x0:0x0)"}, +#else + {"config TC-Layer -T:: (e.g. -T1:0x0:0x0)"}, +#endif +#ifdef INCLUDE_DSL_CPE_API_VRX + {"set activation sequence -S_ (e.g. -S0_0)"}, + {"set remember config -R (e.g. -R1)"}, +#endif +#ifndef DSL_CPE_DEBUG_DISABLE + {"Driver modules debug level -g_{__} e.g. -g1:2_14:FF"}, + {"Application modules debug level -G_{__} e.g. -G1:40"}, +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ + {"Number of devices"}, + {"Number of lines per device"}, + {"Number of channels per line"}, + {0} +}; + +/*lint -restore */ + +DSL_CPE_STATIC const DSL_char_t *dsl_cpe_ctl_version = "@(#)" PACKAGE_VERSION; + +DSL_CPE_STATIC DSL_boolean_t DSL_CPE_UpdateLayoutConfiguration() +{ + DSL_boolean_t ret = DSL_TRUE; + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_CPE_GetGlobalContext(); + + if (g_nDevices <= 0 || g_nDevices >2 || + g_nLines <= 0 || g_nLines >2 || + g_nChannels <= 0 || g_nChannels >2 || + g_nDevices * g_nLines > 2) + { + printf(DSL_CPE_PREFIX " Invalid device configuration, devices:%d, lines:%d, channels:%d"DSL_CPE_CRLF, + g_nDevices, g_nLines, g_nChannels); + g_nDevices = 1; + g_nLines = 1; + g_nChannels = 1; + return DSL_FALSE; + } + if (g_nLines > 1) + g_RememberFsmConfig = DSL_FALSE; + if (DSL_CPE_DSL_ENTITIES > 1) + pCtrlCtx->bBackwardCompMode = DSL_FALSE; +#ifdef RTEMS + if (g_nDevices > 1) + { + printf(DSL_CPE_PREFIX "No support for DSL_CPE_MAX_DEVICE_NUMBER > 1 under RTEMS!!!" DSL_CPE_CRLF); + ret = DSL_FALSE; + } +#endif + if (g_nLines * g_nDevices > 1) + { +# ifndef INCLUDE_FW_REQUEST_SUPPORT + printf(DSL_CPE_PREFIX "Bonding is only supported with the FW request feature!!!"DSL_CPE_CRLF); + ret = DSL_FALSE; +# endif +# ifndef INCLUDE_SCRIPT_NOTIFICATION + printf(DSL_CPE_PREFIX "Bonding is only supported with the Script Notification feature!!!"DSL_CPE_CRLF); + ret = DSL_FALSE; +# endif + } + return ret; +} +DSL_CPE_Control_Context_t *DSL_CPE_GetGlobalContext ( + DSL_void_t +) +{ + if (gDSLContext == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR, requesting for global context, which is zero" DSL_CPE_CRLF)); + } + + return gDSLContext; +} + +#ifndef DSL_CPE_DEBUG_DISABLE +DSL_CPE_STATIC DSL_void_t DSL_CPE_DebugInitCommon(DSL_uint32_t dbg_level) +{ + DSL_CCA_debugLevels_t nCcaDbgLvl = DSL_CCA_DBG_NONE; + DSL_int_t i = 0; + DSL_boolean_t bSetLvl = DSL_TRUE; + + /* Set common debug level for all application related modules if defined by + '-D' startup option */ + switch (dbg_level) + { + case 0: + /* Nothing to do */ + bSetLvl = DSL_FALSE; + break; + case 1: + nCcaDbgLvl = DSL_CCA_DBG_MSG; + break; + case 2: + nCcaDbgLvl = DSL_CCA_DBG_WRN; + break; + case 3: + nCcaDbgLvl = DSL_CCA_DBG_ERR; + break; + case 4: + nCcaDbgLvl = DSL_CCA_DBG_NONE; + break; + default: + /* Invalid */ + bSetLvl = DSL_FALSE; + printf(DSL_CPE_PREFIX + "Invalid argument (%d) for '-D' option - will be ignored!" + DSL_CPE_CRLF, dbg_level); + break; + } + + if (bSetLvl == DSL_TRUE) + { + for (i = (DSL_CCA_DBG_NO_BLOCK + 1); i < DSL_CCA_DBG_LAST_BLOCK; ++i) + { + DSL_CCA_g_dbgLvl[i].nDbgLvl = nCcaDbgLvl; + } + } + + return; +} + +DSL_CPE_STATIC DSL_void_t DSL_CPE_DebugInitModule() +{ + DSL_int_t i = 0; + + /* Set debug module specific application debug levels as defined by '-g' + startup option */ + for (i = 0; (i < MAX_DBG_MOD_PAIRS) && (g_nDbgAppLevel[i].nDbgModule != 0); ++i) + { + if (g_nDbgAppLevel[i].nDbgModule >= DSL_CCA_DBG_MAX_ENTRIES) + { + continue; + } + + DSL_CCA_g_dbgLvl[g_nDbgAppLevel[i].nDbgModule].nDbgLvl = + g_nDbgAppLevel[i].nDbgLevel; + } + + return; +} +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ + +void DSL_CPE_Echo ( + DSL_char_t *buf) +{ + DSL_char_t *str; + DSL_char_t cmd[64]; + + if (buf == DSL_NULL) + { + return; + } + + /* remove leading whitespaces */ + for (str = buf; str && *str && isspace((int)(*str)); ++str) + { + ; + } + + sscanf (str, "%64s", cmd); + + if (strcmp (cmd, "echo") == 0) + { + str += 4; + } + if (str[0] == ' ') str++; + + DSL_CPE_FPrintf (DSL_CPE_STDOUT, "%s \n", str); + + return; +} + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +/* Use this to format arrays of unspecified contents as hex values */ +DSL_void_t DSL_CPE_ArraySPrintF( + DSL_char_t *pDst, + DSL_void_t *pSrc, + DSL_uint16_t nSrcSize, + DSL_uint16_t nSrcElementSize, + DSL_CPE_ArrayPrintFormat_t nFormat) +{ + DSL_uint16_t i = 0, j = 0, elements = 0; + DSL_uint32_t nVal = 0; + DSL_char_t c; + DSL_int_t ret = 0, counter = 256; + + elements = nSrcSize/nSrcElementSize; + + if (nFormat == DSL_ARRAY_FORMAT_HEX) + { + ret = snprintf(pDst, counter, "("); + counter -= ret; + pDst++; + } + + for (i = 0; i < elements; i++) + { + if ((i != 0) && (nFormat == DSL_ARRAY_FORMAT_HEX)) + { + ret = snprintf(pDst, counter, ","); + counter -= ret; + pDst ++; + } + + if (nFormat == DSL_ARRAY_FORMAT_HEX) + { + switch (nSrcElementSize) + { + case 1: + ret = snprintf(pDst, counter, "%02X", ((DSL_uint8_t*)pSrc)[i]); + break; + case 2: + ret = snprintf(pDst, counter, "%04X", ((DSL_uint16_t*)pSrc)[i]); + break; + case 4: + ret = snprintf(pDst, counter, "%08X", ((DSL_uint32_t*)pSrc)[i]); + break; + default: + ret = snprintf(pDst, counter, "xx"); + break; + } + + if(ret > 0) + { + counter -= ret; + pDst += ret; + } + } + else + { + switch (nSrcElementSize) + { + case 1: + nVal = (DSL_uint32_t)(((DSL_uint8_t*)pSrc)[i]); + break; + case 2: + nVal = (DSL_uint32_t)(((DSL_uint16_t*)pSrc)[i]); + break; + case 4: + nVal = (DSL_uint32_t)(((DSL_uint32_t*)pSrc)[i]); + break; + default: + nVal = 0; + break; + } + + for (j = 0; j < nSrcElementSize; j++) + { + c = (DSL_char_t)(nVal >> j); + if (isprint((int)c) != 0) + { + ret = snprintf(pDst, counter, "%c", c); + counter -= ret; + pDst += ret; + } + else + { + if (nFormat == DSL_ARRAY_FORMAT_PRINT_STRING) + { + ret = snprintf(pDst, counter, "%c", '.'); + counter -= ret; + pDst += ret; + } + } + } + } + } + + if (nFormat == DSL_ARRAY_FORMAT_HEX) + { + ret = snprintf(pDst, counter, ")"); + } +} + +/** + Parses the given character string for given token and sets the resulting + pointer to the given offset of tokens within the given string. + + \param DSL_char_t *pCommands + Specifies a string that shall be parsed + \param DSL_int_t nParamNr + Specifies the number of tokens that shall be found and of which the + pointer has to be incresed. + \param DSL_char_t *pSeps + Specifies the separators to be srearched for + \param DSL_char_t *pCmdOffset + Returns a pointer to the command string including token offset if found +*/ +DSL_Error_t DSL_CPE_MoveCharPtr( + DSL_char_t *pCommands, + DSL_int_t nParamNr, + DSL_char_t *pSeps, + DSL_char_t **pCmdOffset) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_int_t i = 0; + DSL_char_t *pTmp = DSL_NULL; + + pTmp = pCommands; + + for (i = 0; i < nParamNr; i++) + { + if (pTmp == DSL_NULL) break; + + pTmp = strpbrk(pTmp, pSeps); + if (pTmp != DSL_NULL) + { + pTmp++; + } + else + { + break; + } + } + + if (i < nParamNr) + { + nRet = DSL_ERROR; + *pCmdOffset = pCommands; + } + else + { + nRet = DSL_SUCCESS; + *pCmdOffset = pTmp; + } + + return nRet; +} + + +#if defined(INCLUDE_DSL_CPE_API_VRX) +DSL_Error_t DSL_CPE_GetMacAdrFromString( + DSL_char_t *pString, + DSL_CPE_MacAddress_t *pMacAdr) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_char_t string[20] = { 0 }; + DSL_char_t sMacAddr[3] = {0}; + DSL_char_t seps[] = ":"; + DSL_char_t *token; + DSL_int_t i = 0; + + cpe_control_strncpy_s(string, sizeof(string)-1, pString, strlen(pString)); + string[sizeof(string)-1] = 0; + + /* Get first token */ + token = strtok (string, seps); + if (token != DSL_NULL) + { + for (i = 0; i < DSL_MAC_ADDRESS_OCTETS; i++) + { + sscanf (token, "%3s", (unsigned char *)sMacAddr); + + sscanf (token, "%hhx", (unsigned char *)&(pMacAdr->nAdr[i])); + + if ( ((strcmp (&sMacAddr[1], "0") != 0) && ( (pMacAdr->nAdr[i] & 0xF) == 0)) ) + { + i=0; + break; + } + + sMacAddr[1] = '\0'; + if ( ((strcmp (&sMacAddr[0], "0") != 0) && ( ((pMacAdr->nAdr[i] >> 4) & 0xF) == 0)) ) + { + i=0; + break; + } + + /* Get next token */ + token = strtok(DSL_NULL, seps); + + /* Exit scanning if no further information is included */ + if (token == DSL_NULL) + { + break; + } + } + } + + if (i < (DSL_MAC_ADDRESS_OCTETS - 1)) + { + nRet = DSL_ERROR; + } + else + { + nRet = DSL_SUCCESS; + } + + return nRet; +} +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifndef DSL_CPE_DEBUG_DISABLE +DSL_CPE_STATIC +DSL_Error_t DSL_CPE_DebugPairExtract(DSL_char_t** argv, DSL_uint_t *module, DSL_uint_t *level) +{ + DSL_int_t items, symbols; + + if ( (argv == NULL) || (*argv == NULL) ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "NULL debug pair string." DSL_CPE_CRLF)); + return DSL_ERROR; + } + + items = sscanf(*argv, "%u:%x%n", module, level, &symbols); + + if ( items != 2 ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Wrong debug module syntax. %d" DSL_CPE_CRLF, items)); + return DSL_ERROR; + } + + *argv += symbols; + + return DSL_SUCCESS; +} +#endif /*#ifndef DSL_CPE_DEBUG_DISABLE*/ + +DSL_CPE_STATIC DSL_int_t DSL_CPE_ArgsExtract( + DSL_char_t **pArg, + DSL_char_t *pcSeparators, + DSL_int_t nArgListNum, + DSL_CPE_ArgElement_t *pArgList) +{ + DSL_char_t cString[30] = { 0 }; + DSL_char_t *pcToken; + DSL_int_t i = 0, nRet = 0; + + /* Set pointer to beginning of next parameter group */ + if ((**pArg == '_') && (*(*pArg+1) != '\0')) *pArg = *pArg + 1; + + cpe_control_strncpy_s(cString, sizeof(cString)-1, *pArg, strlen(*pArg)); + cString[sizeof(cString)-1]=0; + pcToken = strtok (cString, pcSeparators); + + if (pcToken != DSL_NULL) + { + nRet++; + *pArg = *pArg + (strlen(pcToken) + 1); + pArgList[i].nValue = + (DSL_int_t)(strtol(pcToken, DSL_NULL, pArgList[i].nBase)); + + for ( i = nRet ; nRet < nArgListNum; i++) + { + /* Get next token */ + pcToken = strtok(DSL_NULL, pcSeparators); + if (pcToken == DSL_NULL) + { + break; + } + nRet++; + *pArg = *pArg + (strlen(pcToken) + 1); + pArgList[i].nValue = + (DSL_int_t)(strtol(pcToken, DSL_NULL, pArgList[i].nBase)); + } + /* Take care that pointer is not pointing to string termination '\0' + (preparation for extracting the next parameter group). */ + *pArg = *pArg - 1; + } + + return nRet; +} + +/** + Parse layout specific arguments. + + \param argc - number of parameters + \param argv - array of parameter strings +*/ +DSL_CPE_STATIC DSL_void_t DSL_CPE_ArgParseLayout ( + DSL_int32_t argc, + DSL_char_t * argv[] +) +{ + DSL_int_t option_index = 1; + + /* extract number of devices, lines and channels */ + while (1) + { + DSL_int_t c; + c = getopt_long (argc, argv, GETOPT_LONG_OPTSTRING, long_options, + &option_index); + if (c == -1) + { + break; + } + switch (c) + { + case 'V': + sscanf(optarg, "%hhu", &g_nDevices); + break; + case 'L': + sscanf(optarg, "%hhu", &g_nLines); + break; + case 'C': + sscanf(optarg, "%hhu", &g_nChannels); + break; + default: + break; + } + + } + + + optind = 1; +} + +/** + Parse all arguments and enable requested features. + + \param argc - number of parameters + \param argv - array of parameter strings +*/ +DSL_CPE_STATIC DSL_void_t DSL_CPE_ArgParse ( + DSL_int32_t argc, + DSL_char_t * argv[] +) +{ + DSL_char_t *pEndPtr = "\0"; + + DSL_char_t string[30] = { 0 }; + DSL_int_t i = 0; + DSL_uint32_t nVal = 0; + DSL_char_t seps[] = "_"; + DSL_char_t *token, *errMask; + DSL_int_t option_index = 1; + + + + while (1) + { + DSL_int_t c; + + /* 1 colon means there is a required parameter */ + /* 2 colons means there is an optional parameter */ + c = getopt_long (argc, argv, GETOPT_LONG_OPTSTRING, long_options, + &option_index); + + if (c == -1) + { + break; + } + + switch (c) + { + case 'V': + case 'L': + case 'C': + break; + case 0: + /* optarg found */ + break; + + case 'h': + bHelp = 1; + break; + + case 'v': + bGetVersion = 1; + break; + +#if defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32) + case 'r': + g_sRemoteTcpServerIp = DSL_CPE_Malloc(strlen (optarg) + 1); + if (g_sRemoteTcpServerIp) + { + cpe_control_strncpy_s(g_sRemoteTcpServerIp, strlen (optarg) + 1, optarg, strlen (optarg)); + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "using %s as the remote TCP debug server IP address" DSL_CPE_CRLF, + optarg)); + } + break; +#endif /* defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/ + +#ifdef DSL_DEBUG_TOOL_INTERFACE + case 't': + bTcpMessageIntf = 1; + if (optarg != NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-t) using %s as IP address for tcp messages debug server" + DSL_CPE_CRLF, optarg)); + + if (g_sTcpMessagesSocketAddr) + { + DSL_CPE_Free(g_sTcpMessagesSocketAddr); + } + + g_sTcpMessagesSocketAddr = DSL_CPE_Malloc(strlen (optarg) + 1); + if (g_sTcpMessagesSocketAddr) + { + cpe_control_strncpy_s(g_sTcpMessagesSocketAddr, strlen (optarg) + 1, optarg, strlen (optarg)); + } + } + else + { + if (g_sTcpMessagesSocketAddr) + { + DSL_CPE_Free(g_sTcpMessagesSocketAddr); + } + + g_sTcpMessagesSocketAddr = DSL_CPE_OwnAddrStringGet(); + if (g_sTcpMessagesSocketAddr == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Own IP address get failed!" DSL_CPE_CRLF)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-t) using %s (default) as IP address for tcp messages " + "debug server"DSL_CPE_CRLF, g_sTcpMessagesSocketAddr)); + } + } + + g_nTcpMessagesSocketPort = DSL_CPE_TCP_MESSAGES_PORT; + g_bEnableTcpCli = DSL_CPE_ENABLE_TCP_CLI_DEFAULT; + break; +#endif + +#ifdef INCLUDE_DSL_CPE_DTI_SUPPORT + case 'd': + bDTI = 1; + if (optarg != NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-d) using %s as IP address for DTI Agent" DSL_CPE_CRLF, + optarg)); + + if (sDtiSocketAddr) + { + DSL_CPE_Free(sDtiSocketAddr); + } + + sDtiSocketAddr = DSL_CPE_Malloc(strlen (optarg) + 1); + if (sDtiSocketAddr) + { + cpe_control_strncpy_s(sDtiSocketAddr, strlen (optarg) + 1, optarg, strlen (optarg)); + } + } + else + { + if (sDtiSocketAddr) + { + DSL_CPE_Free(sDtiSocketAddr); + } + + sDtiSocketAddr = DSL_CPE_OwnAddrStringGet(); + if (sDtiSocketAddr == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Own IP address get failed!" DSL_CPE_CRLF)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-d) using %s (default) as IP address for DTI Agent" + DSL_CPE_CRLF, sDtiSocketAddr)); + } + } + break; +#endif /* INCLUDE_DSL_CPE_DTI_SUPPORT*/ + +#ifdef USE_DAEMONIZE + case 'q': + bNotSilent = 0; + break; +#endif /* USE_DAEMONIZE */ + + case 'i': + bInit = 1; + memset (&g_nXtseInit.XTSE, 0, sizeof(g_nXtseInit.XTSE)); + + if (optarg != DSL_NULL) + { + cpe_control_strncpy_s(string,sizeof(string)-1, optarg, strlen(optarg)); + string[sizeof(string)-1]=0; + + token = strtok (string, seps); + if (token != DSL_NULL) + { + for (i = 0; i < DSL_G997_NUM_XTSE_OCTETS; i++) + { + sscanf (token, "%x", &nVal); + g_nXtseInit.XTSE[i] = (DSL_uint8_t) nVal; + + /* Get next token */ + token = strtok(DSL_NULL, seps); + + /* Exit scanning if no further information is included */ + if (token == DSL_NULL) + { + break; + } + } + } + if (i > 0) bXtuOctets = 1; + } + break; + +#if defined(INCLUDE_DSL_CPE_API_VRX) + case 'b': + { + if (DSL_CPE_DSL_ENTITIES <= 1 ) + { + printf( DSL_CPE_PREFIX " backward compatibility setting ignored "); + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_NULL; + pCtrlCtx = DSL_CPE_GetGlobalContext(); + if (pCtrlCtx != DSL_NULL) + { + pCtrlCtx->bBackwardCompMode = DSL_TRUE; + } + } + } + break; + + case 'l': + if (sLowLevCfgName) + { + DSL_CPE_Free(sLowLevCfgName); + sLowLevCfgName = DSL_NULL; + } + if (optarg) + { + sLowLevCfgName = DSL_CPE_Malloc (strlen (optarg) + 1); + + if (sLowLevCfgName) + { + cpe_control_strncpy_s(sLowLevCfgName, strlen (optarg) + 1, optarg, strlen (optarg)); + } + } + break; +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + case 'c': + bConsole = 1; + break; +#endif + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + case 'n': + if (g_sRcScript) + { + DSL_CPE_Free(g_sRcScript); + } + + if (optarg != NULL) + { + g_sRcScript = DSL_CPE_Malloc (strlen (optarg) + 1); + if (g_sRcScript) + { + cpe_control_strncpy_s(g_sRcScript, strlen (optarg) + 1, optarg, strlen (optarg)); + } + } + else + { + g_sRcScript = DSL_CPE_Malloc (strlen (sDefaultRcScript) + 1); + if (g_sRcScript) + { + cpe_control_strncpy_s(g_sRcScript, strlen (sDefaultRcScript) + 1, sDefaultRcScript, strlen (sDefaultRcScript)); + } + } + break; +#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION */ + + case 'f': + g_bFirmware1 = 1; + if (g_sFirmwareName1) + { + DSL_CPE_Free(g_sFirmwareName1); + g_sFirmwareName1 = NULL; + } + if (optarg) + { + g_sFirmwareName1 = DSL_CPE_Malloc (strlen (optarg) + 1); + if (g_sFirmwareName1) + { + cpe_control_strncpy_s(g_sFirmwareName1, strlen (optarg) + 1, optarg, strlen(optarg)); + } + } + break; + case 'F': + if (g_nLines < 2) + { + printf(DSL_CPE_PREFIX " Firmware 2 ignored when On Chip Bonding is off "); + } + g_bFirmware2 = 1; + if (g_sFirmwareName2) + { + DSL_CPE_Free(g_sFirmwareName2); + g_sFirmwareName2 = NULL; + } + if (optarg) + { + g_sFirmwareName2 = DSL_CPE_Malloc (strlen (optarg) + 1); + if (g_sFirmwareName2) + { + cpe_control_strncpy_s(g_sFirmwareName2, strlen (optarg) + 1, optarg, strlen (optarg)); + } + } + break; + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + case 'o': + bOptimize = -1; + break; +#endif + + case 'e': + if (optarg != NULL) + { + cpe_control_strncpy_s(string, sizeof(string)-1, optarg, strlen(optarg)); + string[sizeof(string)-1]=0; + token = strtok (string, seps); + + if (token != DSL_NULL) + { + /* Get events enable/disable flag*/ + sscanf (token, "%u", &nVal); + bEventActivation = nVal ? DSL_TRUE : DSL_FALSE; + + /* Get next token, event mask */ + token = strtok(DSL_NULL, seps); + if (token != DSL_NULL) + { + nResourceActivationMask = (DSL_uint32_t)strtoul (token, &errMask, 16); + + if (nResourceActivationMask == ULONG_MAX && errno != 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "invalid resource mask %s specified, all resources will " + "be disabled" DSL_CPE_CRLF, optarg)); + nResourceActivationMask = 0xFFFFFFFF; + } + } + } + + if (bEventActivation == DSL_FALSE) + { + /* Mask (disable) all resources */ + nResourceActivationMask = 0xFFFFFFFF; + } + } + break; + + case 'm': + bMsgDump = 1; + if (optarg != DSL_NULL) + { + g_nMsgDumpDbgLvl = (DSL_uint8_t)(strtoul (optarg, &pEndPtr, 0)); + } + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-m) Using message dump (debug level: 0x%02X)" DSL_CPE_CRLF, + g_nMsgDumpDbgLvl)); + break; + +#ifndef DSL_CPE_DEBUG_DISABLE + case 'D': + DSL_CPE_ArgParseCommonDebugLevel(optarg); + + if ((g_bDebugLevelApp == 1) && (g_nDebugLevelApp != 0)) + { + DSL_CPE_DebugInitCommon(g_nDebugLevelApp); + } + + printf(DSL_CPE_PREFIX + "(-D) User defined debug levels: app="); + g_bDebugLevelApp ? printf("%d", g_nDebugLevelApp):printf("n/a"); + printf(", drv="); + g_bDebugLevelDrv ? printf("%d", g_nDebugLevelDrv):printf("n/a"); + printf(DSL_CPE_CRLF); + break; +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE*/ + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + case 'a': + if (g_sAdslScript) + { + DSL_CPE_Free(g_sAdslScript); + g_sAdslScript = DSL_NULL; + } + if (optarg) + { + g_sAdslScript = DSL_CPE_Malloc (strlen (optarg) + 1); + if (g_sAdslScript) + { + cpe_control_strncpy_s(g_sAdslScript, strlen (optarg) + 1, optarg, strlen (optarg)); + } + } + break; + + case 'A': + + if (g_sVdslScript) + { + DSL_CPE_Free(g_sVdslScript); + g_sVdslScript = DSL_NULL; + } + if (optarg) + { + g_sVdslScript = DSL_CPE_Malloc (strlen (optarg) + 1); + if (g_sVdslScript) + { + cpe_control_strncpy_s(g_sVdslScript, strlen (optarg) + 1, optarg, strlen (optarg)); + } + } + break; +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_API_VRX + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_MULTIMODE + case 'M': + if( optarg != NULL ) + { + cpe_control_strncpy_s(string, sizeof(string)-1, optarg, strlen(optarg)); + string[sizeof(string)-1]=0; + + token = strtok (string, seps); + + if (token != DSL_NULL) + { + /* Get next mode */ + g_MultimodeFsmConfig.nNextMode = strtoul(token, DSL_NULL, 16); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Invalid multimode options string: %s" DSL_CPE_CRLF, optarg)); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "No multimode options specified." DSL_CPE_CRLF)); + } + break; + + case 'R': + if( optarg != NULL ) + { + cpe_control_strncpy_s(string, sizeof(string)-1, optarg, strlen(optarg)); + string[sizeof(string)-1]=0; + + token = strtok (string, seps); + + if (token != DSL_NULL) + { + /* Get remember option */ + g_RememberFsmConfig = (strtoul(token, DSL_NULL, 10)) ? DSL_TRUE : DSL_FALSE; + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Invalid remember options string: %s" DSL_CPE_CRLF, optarg)); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "No remember options specified." DSL_CPE_CRLF)); + } + break; + + case 'S': + if( optarg != NULL ) + { + cpe_control_strncpy_s(string, sizeof(string)-1, optarg, strlen(optarg)); + string[sizeof(string)-1]=0; + + token = strtok (string, seps); + + if (token != DSL_NULL) + { + /* Get Activation sequence value */ + g_ActivationFsmConfig.nActivationSequence = strtoul(token, DSL_NULL, 10); + + /* Automatic detection from XTSE configuration is NOT required and + supported anymore. For backward compatibility reason this value + is mapped to the new default value DSL_ACT_SEQ_STD */ + if (g_ActivationFsmConfig.nActivationSequence == DSL_ACT_SEQ_AUTO) + { + g_ActivationFsmConfig.nActivationSequence = DSL_ACT_SEQ_STD; + } + + /* Get next token */ + token = strtok(DSL_NULL, seps); + if (token != DSL_NULL) + { + /* Get Activation mode value */ + g_ActivationFsmConfig.nActivationMode = strtoul(token, DSL_NULL, 10); + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "activation option: nActivationSequence=%d nActivationMode=%d" DSL_CPE_CRLF, + g_ActivationFsmConfig.nActivationSequence, + g_ActivationFsmConfig.nActivationMode)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Invalid activation options string: %s" DSL_CPE_CRLF, optarg)); + } + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "No activation options specified." DSL_CPE_CRLF)); + } + break; +#endif /* #ifdef INCLUDE_DSL_CPE_API_VRX */ + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP + + case 'T': + if( optarg != NULL ) + { + DSL_CPE_ArgParseSysIfCfg(optarg); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "(-T) No SystemInterfaceConfig options specified!" DSL_CPE_CRLF)); + } + break; + +#ifndef DSL_CPE_DEBUG_DISABLE + case 'g': + if ( optarg != NULL ) + { + DSL_uint_t nDbgModProc; + DSL_char_t* pArg = optarg; + + for (nDbgModProc = 0; ;++nDbgModProc, ++pArg) + { + if ( DSL_CPE_DebugPairExtract(&pArg, + (DSL_uint_t*) &g_nDbgDrvLevel[nDbgModProc % MAX_DBG_MOD_PAIRS].nDbgModule, + (DSL_uint_t*) &g_nDbgDrvLevel[nDbgModProc % MAX_DBG_MOD_PAIRS].nDbgLevel) != DSL_SUCCESS ) + { + printf(DSL_CPE_PREFIX + "Error in driver debug module level option, " + "%d debug level pair%s parsed successfully." DSL_CPE_CRLF, + nDbgModProc, nDbgModProc == 1 ? "" : "s"); + break; + } + + if ( *pArg != '_' ) + { + break; + } + } + + if (nDbgModProc++ > MAX_DBG_MOD_PAIRS) + { + printf(DSL_CPE_PREFIX + "Too many driver debug modules specified. Only last %d pairs " + "are used!" DSL_CPE_CRLF, MAX_DBG_MOD_PAIRS); + } + } + else + { + printf(DSL_CPE_PREFIX + "No driver modules debug level specified." DSL_CPE_CRLF); + } + break; + + case 'G': + if ( optarg != NULL ) + { + DSL_uint_t nDbgModProc, nDbgModule, nDbgLvl; + DSL_uint_t i = 0; + DSL_char_t* pArg = optarg; + + for (i = 0; ; ++pArg) + { + nDbgModProc = i % MAX_DBG_MOD_PAIRS; + if ( DSL_CPE_DebugPairExtract(&pArg, &nDbgModule, &nDbgLvl) != DSL_SUCCESS ) + { + printf(DSL_CPE_PREFIX + "Error in application debug module level option, " + "%d debug level pair%s parsed successfully." DSL_CPE_CRLF, i, + i == 1 ? "" : "s"); + break; + } + + if ((nDbgModule > DSL_CCA_DBG_NO_BLOCK) && + (nDbgModule < DSL_CCA_DBG_LAST_BLOCK)) + { + if ((nDbgLvl == DSL_CCA_DBG_PRN) || (nDbgLvl == DSL_CCA_DBG_ERR) || + (nDbgLvl == DSL_CCA_DBG_WRN) || (nDbgLvl == DSL_CCA_DBG_MSG) || + (nDbgLvl == DSL_CCA_DBG_LOCAL)) + { + g_nDbgAppLevel[nDbgModProc].nDbgModule = nDbgModule; + g_nDbgAppLevel[nDbgModProc].nDbgLevel = nDbgLvl; + i++; + } + else + { + printf(DSL_CPE_PREFIX + "Wrong application debug level number: %d." DSL_CPE_CRLF, nDbgLvl); + } + } + else + { + printf(DSL_CPE_PREFIX + "Wrong application debug module number: %d." DSL_CPE_CRLF, nDbgModule); + } + + if ( *pArg != '_' ) + { + break; + } + } + + if (i++ > MAX_DBG_MOD_PAIRS) + { + printf(DSL_CPE_PREFIX + "Too many application debug modules specified. Only last " + "%d will be accepted." DSL_CPE_CRLF, MAX_DBG_MOD_PAIRS); + } + } + else + { + printf(DSL_CPE_PREFIX + "No application modules debug level specified." DSL_CPE_CRLF); + } + DSL_CPE_DebugInitModule(); + break; +#endif /*#ifndef DSL_CPE_DEBUG_DISABLE*/ + default: + printf(DSL_CPE_PREFIX + "Sorry, there is an unrecognized option: %c" DSL_CPE_CRLF, c); + break; + } + } + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + if( (g_sAdslScript != DSL_NULL) +#if defined(INCLUDE_DSL_CPE_API_VRX) + || (g_sVdslScript != DSL_NULL) +#endif + ) + { + DSL_uint32_t nDevice = 0; + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + g_bWaitBeforeLinkActivation[nDevice] = DSL_TRUE; + g_bWaitBeforeConfigWrite[nDevice] = DSL_TRUE; + g_bWaitBeforeRestart[nDevice] = DSL_TRUE; + } + } + else + { + DSL_uint32_t nDevice = 0; + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + g_bWaitBeforeLinkActivation[nDevice] = DSL_FALSE; + g_bWaitBeforeConfigWrite[nDevice] = DSL_FALSE; + g_bWaitBeforeRestart[nDevice] = DSL_FALSE; + } + } +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ +} + +#define NUM_SYSIF_ARGS 3 + +DSL_CPE_STATIC DSL_Error_t DSL_CPE_SysIfCfgCheck ( + DSL_int_t nArgs, + DSL_CPE_ArgElement_t *pArgList ) +{ + /* Only accept parameters if consistent number of values (three) are given */ + if (nArgs < NUM_SYSIF_ARGS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Invalid number of arguments for -T option - NO config applied." + DSL_CPE_CRLF)); + return DSL_ERROR; + } + + /* Check for consistent configuration value (TC-Layer) */ + if ((pArgList[0].nValue != DSL_TC_ATM) && (pArgList[0].nValue != DSL_TC_EFM) + && (pArgList[0].nValue != DSL_TC_AUTO) +#if defined(INCLUDE_DSL_CPE_API_DANUBE) + && (pArgList[0].nValue != DSL_TC_EFM_FORCED) +#endif + ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Invalid TC-Layer configuration (%d) for -T option - NO config applied." + DSL_CPE_CRLF, pArgList[0].nValue)); + return DSL_ERROR; + } + + return DSL_SUCCESS; +} + +DSL_CPE_STATIC DSL_void_t DSL_CPE_ArgParseSysIfCfg ( + DSL_char_t * optarg ) +{ + DSL_CPE_ArgElement_t sArgList[NUM_SYSIF_ARGS]; + DSL_int_t nArgs = 0; + DSL_char_t *pArg = optarg; + DSL_char_t seps_old[] = "_:"; +#if defined(INCLUDE_DSL_CPE_API_VRX) + DSL_char_t seps_new[] = ":"; +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + DSL_int_t i = 0; + + memset (&sArgList, 0, (sizeof(DSL_CPE_ArgElement_t)) * NUM_SYSIF_ARGS); + + /* First value: TC-Layer is enum (int) */ + sArgList[0].nBase = 10; + /* Second and third value: Bitfield for EMF TC Config (hex) */ + sArgList[1].nBase = sArgList[2].nBase = 16; + + nArgs = DSL_CPE_ArgsExtract(&pArg, seps_old, NUM_SYSIF_ARGS, &sArgList[0]); + + if (DSL_CPE_SysIfCfgCheck(nArgs, &sArgList[0]) != DSL_SUCCESS) + { + return; + } + + g_sSysIfCfg[DSL_MODE_ADSL].nTcLayer = sArgList[0].nValue; + g_sSysIfCfg[DSL_MODE_ADSL].nEfmTcConfigUs = sArgList[1].nValue; + g_sSysIfCfg[DSL_MODE_ADSL].nEfmTcConfigDs = sArgList[2].nValue; + /* Fixed value for SystemInterface configuration by now! */ + g_sSysIfCfg[DSL_MODE_ADSL].nSystemIf = DSL_SYSTEMIF_MII; + +#if defined(INCLUDE_DSL_CPE_API_VRX) + /* VRX could have separate settings for ADSL and VDSL */ + memset (&sArgList, 0, (sizeof(DSL_CPE_ArgElement_t)) * NUM_SYSIF_ARGS); + + /* First value: TC-Layer is enum (int) */ + sArgList[0].nBase = 10; + /* Second and third value: Bitfield for EMF TC Config (hex) */ + sArgList[1].nBase = sArgList[2].nBase = 16; + + nArgs = DSL_CPE_ArgsExtract(&pArg, seps_new, NUM_SYSIF_ARGS, &sArgList[0]); + + if (DSL_CPE_SysIfCfgCheck(nArgs, &sArgList[0]) == DSL_SUCCESS) + { + g_sSysIfCfg[DSL_MODE_VDSL].nTcLayer = sArgList[0].nValue; + g_sSysIfCfg[DSL_MODE_VDSL].nEfmTcConfigUs = sArgList[1].nValue; + g_sSysIfCfg[DSL_MODE_VDSL].nEfmTcConfigDs = sArgList[2].nValue; + /* Fixed value for SystemInterface configuration by now! */ + g_sSysIfCfg[DSL_MODE_VDSL].nSystemIf = DSL_SYSTEMIF_MII; + } + else + { + /* If no valid values are given for VDSL use the valid ADSL ones */ + cpe_control_memcpy_s(&g_sSysIfCfg[DSL_MODE_VDSL], + sizeof(DSL_SystemInterfaceConfigData_t), + &g_sSysIfCfg[DSL_MODE_ADSL], + sizeof(g_sSysIfCfg[DSL_MODE_ADSL])); + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Using valid -T options from ADSL also for VDSL." + DSL_CPE_CRLF)); + } +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-T) User defined SystemInterfaceConfig:"DSL_CPE_CRLF)); + for (i = 0; i < DSL_MODE_LAST; i++) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + " %s: TC-Layer=%d, nEfmTcConfigUs=%d, nEfmTcConfigDs=%d" + DSL_CPE_CRLF, i==0 ? "ADSL":"VDSL", g_sSysIfCfg[i].nTcLayer, + g_sSysIfCfg[i].nEfmTcConfigUs, g_sSysIfCfg[i].nEfmTcConfigDs)); + } + + return; +} + +#ifndef DSL_CPE_DEBUG_DISABLE +#define NUM_COMMON_DBGLVL_ARGS 2 + +DSL_CPE_STATIC DSL_void_t DSL_CPE_ArgParseCommonDebugLevel ( + DSL_char_t * optarg ) +{ + DSL_CPE_ArgElement_t sArgList[NUM_COMMON_DBGLVL_ARGS]; + DSL_int_t nArgs = 0; + DSL_char_t *pArg = optarg; + DSL_char_t seps[] = "_"; + DSL_int_t i = 0; + + memset (&sArgList[0], 0, (sizeof(DSL_CPE_ArgElement_t)) * NUM_COMMON_DBGLVL_ARGS); + + /* First and second value: Common debug level (int) */ + sArgList[0].nBase = sArgList[1].nBase = 10; + + nArgs = DSL_CPE_ArgsExtract(&pArg, seps, NUM_COMMON_DBGLVL_ARGS, &sArgList[0]); + + for (i = 0; i < nArgs; i++) + { + /* Check valid range of debug level */ + if (sArgList[i].nValue < 0 || sArgList[i].nValue > 4) + { + printf(DSL_CPE_PREFIX + "Invalid debug level (%d) within '-D' option - will be ignored!" + DSL_CPE_CRLF, sArgList[i].nValue); + continue; + } + + switch (i) + { + case 0: + g_bDebugLevelApp = 1; + g_nDebugLevelApp = sArgList[i].nValue; + break; + case 1: + g_bDebugLevelDrv = 1; + g_nDebugLevelDrv = sArgList[i].nValue; + break; + default: + printf(DSL_CPE_PREFIX + "Error within parsing of '-D' options!"DSL_CPE_CRLF); + break; + } + } + + return; +} +#endif /* DSL_CPE_DEBUG_DISABLE */ + +/** +Print usage help. + +\param sApplicationName name of the application + +*/ +DSL_CPE_STATIC DSL_void_t DSL_CPE_Help ( + DSL_char_t *sApplicationName +) +{ + struct option *ptr; + DSL_char_t *desc = description[0]; + + ptr = long_options; + + + DSL_CPE_FPrintf (DSL_CPE_STDOUT, + DSL_CPE_PREFIX"Welcome to DSL CPI API control application" DSL_CPE_CRLF); + + if (strlen(sApplicationName) == 0) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, + DSL_CPE_PREFIX"usage: %s [options]"DSL_CPE_CRLF, sApplicationName); + } + else + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, + DSL_CPE_PREFIX"usage: [options]"DSL_CPE_CRLF); + } + DSL_CPE_FPrintf (DSL_CPE_STDOUT, + DSL_CPE_PREFIX"following options are available:"DSL_CPE_CRLF); +#ifdef DEBUG + sleep (1); +#endif + + while (ptr->name) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, + DSL_CPE_PREFIX" --%s\t(-%c)\t- %s"DSL_CPE_CRLF, ptr->name, ptr->val, desc); +#ifdef DEBUG + sleep (1); +#endif + ptr++; + desc += sizeof (description[0]); + } + return; +} + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + +DSL_Error_t DSL_CPE_Fd2DevNum( + DSL_int_t fd, + DSL_uint32_t *nDevice) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + DSL_uint32_t i = 0; + + if ((pCtx = DSL_CPE_GetGlobalContext()) != DSL_NULL) + { + if (pCtx->bBackwardCompMode) + { + if (pCtx->nDevNum < 0) + { + nRet = DSL_ERROR; + } + else + { + *nDevice = (DSL_uint32_t) pCtx->nDevNum; + } + } + else + { + for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++) + { + if(pCtx->fd[i] == fd) + { + *nDevice = i; + break; + } + } + + if (i == DSL_CPE_DSL_ENTITIES) + { + nRet = DSL_ERROR; + } + } + } + else + { + nRet = DSL_ERROR; + } + + return nRet; +} + +DSL_char_t g_nDevNumStr[20]; + +DSL_char_t *DSL_CPE_Fd2DevStr(DSL_int_t fd) +{ + DSL_int_t i; + DSL_char_t *pDevSrt = g_nDevNumStr; + DSL_CPE_Control_Context_t *pCtx = DSL_NULL; + + snprintf(pDevSrt, sizeof(g_nDevNumStr), "%s", ""); + + /* Get Global Context pointer*/ + pCtx = DSL_CPE_GetGlobalContext(); + + if (pCtx == DSL_NULL) + { + return pDevSrt; + } + + if (!(pCtx->bBackwardCompMode)) + { + for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++) + { + if (fd == pCtx->fd[i]) + { + snprintf(pDevSrt, sizeof(g_nDevNumStr), " nDevice=%d", i); + return pDevSrt; + } + } + } + + return pDevSrt; +} + +DSL_boolean_t DSL_CPE_IsFileExists(DSL_char_t *path) +{ + DSL_CPE_File_t *fd = DSL_NULL; + + fd = DSL_CPE_FOpen (path, "r"); + + if (fd == DSL_NULL) + { + return DSL_FALSE; + } + else + { + DSL_CPE_FClose(fd); + return DSL_TRUE; + } +} + +DSL_int_t DSL_CPE_CliDeviceCommandExecute( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_char_t *cmd, + DSL_char_t *arg, + DSL_CPE_File_t *out) +{ + DSL_int_t ret = 0; + DSL_int_t fd[DSL_CPE_MAX_DSL_ENTITIES], i, nDeviceNumber = -1; + DSL_char_t help[] = "-h"; + DSL_boolean_t bHelp = DSL_FALSE; + DSL_int_t nDevNum = 0; + DSL_char_t dummy_arg[10] = ""; + + /* Check Context pointer*/ + if (pContext == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Expecting non-zero context pointer!" DSL_CPE_CRLF)); + return -1; + } + + if (nDevice >= DSL_CPE_DSL_ENTITIES) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Invalid device number (%d) specified!" DSL_CPE_CRLF, + nDevice)); + + return -1; + } + + /* Reset fd*/ + for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++) + { + fd[i] = -1; + } + + /* Check if the Backward compatible mode was specified*/ + if (pContext->bBackwardCompMode) + { + nDeviceNumber = (nDevice == -1) ? pContext->nDevNum : nDevice; + + if (nDeviceNumber >= DSL_CPE_DSL_ENTITIES) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Invalid device number (%d) specified!" DSL_CPE_CRLF, + nDeviceNumber)); + + DSL_CPE_FPrintf (out, "nReturn=%d" DSL_CPE_CRLF, -1); + + return -1; + } + + /* Get fd for the specified nDeviceNumber*/ + fd[0] = pContext->fd[nDeviceNumber]; + } + else + { + if (DSL_CPE_DSL_ENTITIES > 1 ) + { + if(arg != DSL_NULL) + { + arg = DSL_CPE_CLI_WhitespaceRemove(arg); + + if (DSL_CPE_CLI_CheckParamNumber(arg, 1, DSL_CLI_MIN) == DSL_FALSE + || DSL_CPE_CLI_CheckHelp(arg)) + { + bHelp = DSL_TRUE; + } + else + { + if(strstr(cmd, "help") != 0) + { + DSL_CPE_CLI_HelpPrint (fd[0], arg, out); + return 0; + } + + /* Get device number*/ + sscanf (arg, "%d", &nDevNum); + + /* Check device number*/ + if (nDevNum >= DSL_CPE_DSL_ENTITIES) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Invalid device number (%d) specified, valid range 0...%d!" DSL_CPE_CRLF, + nDevNum, (DSL_CPE_DSL_ENTITIES-1))); + + DSL_CPE_FPrintf (out, "nReturn=%d" DSL_CPE_CRLF, -1); + + return -1; + } + + /* Move to the next parameter*/ + while (1) + { + if (isspace((int)(*arg))) + { + break; + } + + if (*arg == '\0') + { + arg = dummy_arg; + break; + } + + arg++; + } + } + } + else + { + bHelp = DSL_TRUE; + } + + if (nDevice == -1) + { + /* Normal CLI command*/ + if (nDevNum == -1) + { + /* CLI command for all available devices*/ + for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++) + { + fd[i] = pContext->fd[i]; + } + } + else + { + fd[0] = pContext->fd[nDevNum]; + } + } + else + { + if (nDevice == nDevNum) + { + fd[0] = pContext->fd[nDevNum]; + } + else if (nDevNum == -1) + { + fd[0] = pContext->fd[nDevice]; + } + else + { + /* Skip CLI handling*/ + return 0; + } + } + } + else + { + /* Get fd for the default Device*/ + fd[0] = pContext->fd[0]; + } + } + + for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++) + { + if (fd[i] == -1) + continue; + + if ((ret = DSL_CPE_CLI_CommandExecute(fd[i], cmd, bHelp ? help : arg, out)) < 0) + return ret; + } + + return ret; +} +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + +DSL_Error_t DSL_CPE_LoadFirmwareFromFile( + DSL_char_t *psFirmwareName, + DSL_uint8_t **pFirmware, + DSL_uint32_t *pnFirmwareSize) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_CPE_File_t *fd_image = DSL_NULL; + DSL_CPE_stat_t file_stat; + + *pnFirmwareSize = 0; + if (*pFirmware != DSL_NULL) + { + DSL_CPE_Free(*pFirmware); + *pFirmware = DSL_NULL; + } + +#ifdef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + *pFirmware = cgi_pFileData_modemfw_bin; + *pnFirmwareSize = FIRMWARE_SIZE; +#else + for (;;) + { + fd_image = DSL_CPE_FOpen (psFirmwareName, "rb"); + if (fd_image == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "open %s fail" DSL_CPE_CRLF, psFirmwareName)); + nRet = DSL_ERROR; + break; + } + + DSL_CPE_FStat (psFirmwareName, &file_stat); + *pnFirmwareSize = file_stat.st_size; + *pFirmware = DSL_CPE_Malloc (*pnFirmwareSize); + + if (*pFirmware == DSL_NULL) + { + nRet = DSL_ERROR; + break; + } + + if (DSL_CPE_FRead (*pFirmware, sizeof (DSL_uint8_t), *pnFirmwareSize, fd_image) <= 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX DSL_CPE_CRLF + "\n firmware_image not present")); + nRet = DSL_ERROR; + break; + } + + break; + } + + if (fd_image != DSL_NULL) + { + DSL_CPE_FClose (fd_image); + fd_image = DSL_NULL; + } +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ + return nRet; +} + +DSL_Error_t DSL_CPE_DownloadFirmware( + DSL_int_t fd, + DSL_int_t nDevice, + DSL_FirmwareRequestType_t nFwReqType, + DSL_PortMode_t nPortMode, + DSL_char_t *pcFw, + DSL_char_t *pcFw2) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_CPE_Control_Context_t *pContext = DSL_NULL; + DSL_AutobootLoadFirmware_t ldFw; + DSL_AutobootControl_t pAcs; + DSL_AutobootStatus_t pAsg; + DSL_CPE_File_t *fd_image = DSL_NULL; + DSL_CPE_stat_t file_stat; + DSL_int_t nSize = 0, nReadSize = DSL_CPE_FW_CHUNK_SIZE; + DSL_int_t nWriteSize = 0; + DSL_uint8_t *pChunkData = DSL_NULL; + + memset(&ldFw, 0, sizeof(DSL_AutobootLoadFirmware_t)); + + pContext = DSL_CPE_GetGlobalContext(); + if (pContext == DSL_NULL) + { + return DSL_ERROR; + } + + /* + If firmware name is not defined by current call + choose last defined file (or default if startup + value was not changed). + */ + if (nPortMode == DSL_PORT_MODE_DUAL && DSL_CPE_LINES_PER_DEVICE == 2) + { + if ( pcFw2 == DSL_NULL ) + { + if ((g_bFirmware2 != -1) || (strlen(g_sFirmwareName2) > 0)) + { + pcFw2 = g_sFirmwareName2; + } + } + } + else + { + if ( pcFw == DSL_NULL ) + { + if ((g_bFirmware1 != -1) || (strlen(g_sFirmwareName1) > 0)) + { + pcFw = g_sFirmwareName1; + } + } + } + + do + { + if ( bOptimize == 1 ) + { + /* + Footprint optimized download uses chunks for firmware binary download. + This is to reduce the necessary runtime memory allocation for download + procedure + */ + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Using optimized fw " + "download..." DSL_CPE_CRLF)); + + if (pcFw == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + " firmware file not found!" DSL_CPE_CRLF)); + nRet = DSL_ERROR; + break; + } + + fd_image = DSL_CPE_FOpen (pcFw, "r"); + if (fd_image == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX " open %s failed." + DSL_CPE_CRLF, pcFw)); + nRet = DSL_ERROR; + break; + } + + DSL_CPE_FStat (pcFw, &file_stat); + nSize = file_stat.st_size; + + pChunkData = DSL_CPE_Malloc((DSL_uint32_t)nReadSize); + if (pChunkData == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "Memory allocation " + "failed (optimized FW download)" DSL_CPE_CRLF)); + nRet = DSL_ERROR; + break; + } + + ldFw.data.pFirmware = pChunkData; + + while (nSize > 0) + { + if (nSize > DSL_CPE_FW_CHUNK_SIZE) + { + nReadSize = DSL_CPE_FW_CHUNK_SIZE; + } + else + { + nReadSize = nSize; + } + + if (DSL_CPE_FRead (pChunkData, sizeof (DSL_uint8_t), (DSL_uint32_t)nReadSize, + fd_image) <= 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "firmware_image not present" DSL_CPE_CRLF)); + nRet = DSL_ERROR; + break; + } + + ldFw.data.nFirmwareSize = (DSL_uint32_t)nReadSize; + ldFw.data.nFirmwareOffset = (DSL_uint32_t)nWriteSize; + + if (nSize - nReadSize <= 0) + { + ldFw.data.bLastChunk = DSL_TRUE; + } + else + { + ldFw.data.bLastChunk = DSL_FALSE; + } + + ldFw.data.bChunkDonwloadEnabled = DSL_TRUE; + cpe_control_memcpy_s(&ldFw.data.firmwareFeatures, sizeof(DSL_FirmwareFeatures_t), &g_nFwFeatures1, sizeof(g_nFwFeatures1)); + + ldFw.data.bForceDownload = pContext->bForceFirmwareDownload[nDevice]; + pContext->bForceFirmwareDownload[nDevice] = DSL_FALSE; + nRet = (DSL_Error_t) DSL_CPE_Ioctl(fd, + DSL_FIO_AUTOBOOT_LOAD_FIRMWARE, (DSL_int_t) &ldFw); + + if (nRet < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Autoboot Load Firmware (using chunks) failed!, nRet = %d!" + DSL_CPE_CRLF, ldFw.accessCtl.nReturn)); + + break; + } + + nSize -= nReadSize; + nWriteSize += nReadSize; + } + + if (nRet < DSL_SUCCESS) + { + break; + } + else + { + /* $$TD: Temporary only because better solution would be to start + the link directly within driver after last chunk is downloaded */ + DSL_CPE_Sleep(1); + + memset(&pAsg, 0x0, sizeof(DSL_AutobootStatus_t)); + + nRet = (DSL_Error_t) DSL_CPE_Ioctl(fd, + DSL_FIO_AUTOBOOT_STATUS_GET, (DSL_int_t) &pAsg); + + if (pAsg.data.nStatus == DSL_AUTOBOOT_STATUS_STOPPED) + { + memset(&pAcs, 0x0, sizeof(DSL_AutobootControl_t)); + pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_START; + nRet = (DSL_Error_t) DSL_CPE_Ioctl(fd, + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs); + nRet = pAcs.accessCtl.nReturn; + } + } + + /* also store the new firmware binary name within global + configuration to be used for next download */ + if (pcFw != g_sFirmwareName1) + { + /* also store the new firmware binary name within global + configuration to be used for next download */ + if (ldFw.data.pFirmware != DSL_NULL) + { + DSL_CPE_Free(g_sFirmwareName1); + g_sFirmwareName1 = DSL_CPE_Malloc (strlen (pcFw) + 1); + if (g_sFirmwareName1) + { + cpe_control_strncpy_s(g_sFirmwareName1, strlen (pcFw) + 1, pcFw, strlen (pcFw)); + } + } + } + } + else + { + /* simple download without any memory optimizations just loads the + necessary firmware binaries completely into memory. */ + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "Using normal fw download..." DSL_CPE_CRLF)); + +#if defined(INCLUDE_DSL_CPE_API_DANUBE) + if ((nFwReqType == DSL_FW_REQUEST_ADSL) || (nFwReqType == DSL_FW_REQUEST_NA)) +#elif defined(INCLUDE_DSL_CPE_API_VRX) + if ((nFwReqType == DSL_FW_REQUEST_XDSL) || (nFwReqType == DSL_FW_REQUEST_NA)) +#endif + { + if (nPortMode == DSL_PORT_MODE_DUAL && DSL_CPE_LINES_PER_DEVICE == 2) + { + if (pcFw2 != DSL_NULL) + { + nRet = DSL_CPE_LoadFirmwareFromFile(pcFw2, &ldFw.data.pFirmware2, + &ldFw.data.nFirmwareSize2); + if (nRet < DSL_SUCCESS) + { + nRet = DSL_ERROR; + } + else + { + if (pcFw2 != g_sFirmwareName2) + { + /* also store the new firmware binary name within global + configuration to be used for next download */ + if (ldFw.data.pFirmware2 != DSL_NULL) + { + DSL_CPE_Free(g_sFirmwareName2); + g_sFirmwareName2 = DSL_CPE_Malloc (strlen (pcFw2) + 1); + if (g_sFirmwareName2) + { + cpe_control_strncpy_s(g_sFirmwareName2, strlen (pcFw2) + 1, pcFw2, strlen (pcFw2)); + } + } + } + } + } + } + else + { + if (pcFw != DSL_NULL) + { + nRet = DSL_CPE_LoadFirmwareFromFile(pcFw, &ldFw.data.pFirmware, + &ldFw.data.nFirmwareSize); + if (nRet < DSL_SUCCESS) + { + nRet = DSL_ERROR; + } + else + { + if (pcFw != g_sFirmwareName1) + { + /* also store the new firmware binary name within global + configuration to be used for next download */ + if (ldFw.data.pFirmware != DSL_NULL) + { + DSL_CPE_Free(g_sFirmwareName1); + g_sFirmwareName1 = DSL_CPE_Malloc (strlen (pcFw) + 1); + if (g_sFirmwareName1) + { + cpe_control_strncpy_s(g_sFirmwareName1, strlen (pcFw) + 1, pcFw, strlen (pcFw)); + } + } + } + } + } + } + } + + if ( ((ldFw.data.pFirmware != DSL_NULL) && (ldFw.data.nFirmwareSize)) || + ((ldFw.data.pFirmware2 != DSL_NULL) && (ldFw.data.nFirmwareSize2)) ) + { + ldFw.data.bLastChunk = DSL_TRUE; + ldFw.data.bChunkDonwloadEnabled = DSL_FALSE; + + if (nPortMode == DSL_PORT_MODE_DUAL && DSL_CPE_LINES_PER_DEVICE == 2) + { + if (pcFw2 != DSL_NULL) + { + cpe_control_memcpy_s(&ldFw.data.firmwareFeatures2, sizeof(DSL_FirmwareFeatures_t), + &g_nFwFeatures2, sizeof(g_nFwFeatures2)); + } + } + else + { + if (pcFw != DSL_NULL) + { + cpe_control_memcpy_s(&ldFw.data.firmwareFeatures, sizeof(DSL_FirmwareFeatures_t), + &g_nFwFeatures1, sizeof(g_nFwFeatures1)); + } + } + + ldFw.data.bForceDownload = pContext->bForceFirmwareDownload[nDevice]; + pContext->bForceFirmwareDownload[nDevice] = DSL_FALSE; + nRet = (DSL_Error_t) DSL_CPE_Ioctl(fd, + DSL_FIO_AUTOBOOT_LOAD_FIRMWARE, (DSL_int_t) &ldFw); + + if (nRet < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Autoboot Load Firmware failed!, nRet = %d!" DSL_CPE_CRLF, + ldFw.accessCtl.nReturn)); + break; + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Necessary FW binary " + "for requested port mode %d " + "are not specified!" DSL_CPE_CRLF, nPortMode)); + nRet = DSL_ERROR; + break; + } + } + } while (0); + + /* take care to clean up all memory that might be allocated during function + processing */ + if (fd_image != DSL_NULL) + { + DSL_CPE_FClose(fd_image); + } + +#ifndef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + if (pChunkData != DSL_NULL) + { + DSL_CPE_Free(pChunkData); + pChunkData = DSL_NULL; + ldFw.data.pFirmware = DSL_NULL; + if (DSL_CPE_LINES_PER_DEVICE == 2) + { + ldFw.data.pFirmware2 = DSL_NULL; + } + } + + if (nPortMode == DSL_PORT_MODE_DUAL && DSL_CPE_LINES_PER_DEVICE == 2) + { + if (ldFw.data.pFirmware2) + { + DSL_CPE_Free(ldFw.data.pFirmware2); + } + } + else + { + if (ldFw.data.pFirmware) + { + DSL_CPE_Free(ldFw.data.pFirmware); + } + } +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ + +#if defined(INCLUDE_DSL_CPE_API_VRX) + if (nRet >= DSL_SUCCESS) + { + /* Check Low Level configuration*/ + nRet = DSL_CPE_LowLevelConfigurationCheck(fd); + } +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + + return nRet; +} + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +DSL_CPE_STATIC DSL_char_t const * DSL_CPE_Event_Type2String(DSL_EventType_t *pEventType) +{ + DSL_int32_t i; + DSL_CPE_EVT_CodeString_t const *pCS; + + pCS = eventString; + for (i = 0; pCS[i].string; i++) + { + if (pCS[i].eventType == *pEventType) + { + return pCS[i].string; + } + } + + return "Unknown"; +} +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +DSL_CPE_STATIC DSL_boolean_t DSL_CPE_ScriptSectionTagFind( + DSL_char_t *pLine, + DSL_CPE_ScriptSection_t searchSection) +{ + DSL_boolean_t bTagOpenFound = DSL_FALSE, + bTagCloseFound = DSL_FALSE, + bTagNameFound = DSL_FALSE, + bRet = DSL_FALSE; + DSL_char_t *pTag = DSL_NULL; + DSL_uint8_t nTagSize = 0; + + if (pLine == DSL_NULL) + { + return DSL_FALSE; + } + + /* find tag open*/ + while (*pLine != '\0') + { + if (*pLine == '[') + { + /* tag open found*/ + bTagOpenFound = DSL_TRUE; + /* move to the next character*/ + pLine++; + break; + } + /* move to the next character*/ + pLine++; + } + + /* find tag name*/ + if (bTagOpenFound) + { + /* remove leading whitespaces*/ + while (isspace((DSL_int_t)*pLine) && *pLine != '\0') + { + pLine++; + } + + if (searchSection == DSL_SCRIPT_SECTION_WAIT_FOR_CONFIFURATION) + { + pTag = DSL_CPE_SCRIPT_WAIT_FOR_CONFIGURATION_TAG; + nTagSize = sizeof(DSL_CPE_SCRIPT_WAIT_FOR_CONFIGURATION_TAG)-1; + } + else if (searchSection == DSL_SCRIPT_SECTION_WAIT_FOR_LINK_ACTIVATE) + { + pTag = DSL_CPE_SCRIPT_WAIT_FOR_LINK_ACTIVATE_TAG; + nTagSize = sizeof(DSL_CPE_SCRIPT_WAIT_FOR_LINK_ACTIVATE_TAG)-1; + } + else if (searchSection == DSL_SCRIPT_SECTION_COMMON) + { + pTag = DSL_CPE_SCRIPT_COMMON_TAG; + nTagSize = sizeof(DSL_CPE_SCRIPT_COMMON_TAG)-1; + } + else if (searchSection == DSL_SCRIPT_SECTION_WAIT_BEFORE_RESTART) + { + pTag = DSL_CPE_SCRIPT_WAIT_BEFORE_RESTART_TAG; + nTagSize = sizeof(DSL_CPE_SCRIPT_WAIT_BEFORE_RESTART_TAG)-1; + } + + if (pTag) + { + /* compare case insensitive*/ + if (DSL_CPE_STRNCASECMP(pTag, pLine, nTagSize) == 0) + { + bTagNameFound = DSL_TRUE; + } + } + } + + /* find tag close*/ + if (bTagNameFound) + { + /* remove ending whitespaces*/ + while (isspace((DSL_int_t)*pLine) && *pLine != '\0') + { + pLine++; + } + + while (*pLine != '\0') + { + if (*pLine == ']') + { + /* tag open found*/ + bTagCloseFound = DSL_TRUE; + break; + } + /* move to the next character*/ + pLine++; + } + } + + if (bTagOpenFound && bTagNameFound && bTagCloseFound && pTag) + { + bRet = DSL_TRUE; + } + + return bRet; +} + +DSL_CPE_STATIC DSL_boolean_t DSL_CPE_ScriptSectionOpenFind( + DSL_char_t *pLine) +{ + DSL_boolean_t bRet = DSL_FALSE; + + if (pLine == DSL_NULL) + { + return DSL_FALSE; + } + + /* find section open*/ + while (*pLine != '\0') + { + if (*pLine == '{') + { + /* section open found*/ + bRet = DSL_TRUE; + break; + } + /* move to the next character*/ + pLine++; + } + + return bRet; +} + +DSL_CPE_STATIC DSL_boolean_t DSL_CPE_ScriptSectionCloseFind( + DSL_char_t *pLine) +{ + DSL_boolean_t bRet = DSL_FALSE; + + if (pLine == DSL_NULL) + { + return DSL_FALSE; + } + + /* find section close*/ + while (*pLine != '\0') + { + if (*pLine == '}') + { + /* section close found*/ + bRet = DSL_TRUE; + break; + } + /* move to the next character*/ + pLine++; + } + + return bRet; +} + +/** + Parses a batch file and performs necessary actions +*/ +DSL_Error_t DSL_CPE_ScriptExecute ( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_CPE_File_t *pFile, + DSL_CPE_ScriptSection_t searchSection, + DSL_CPE_ScriptBuffer_t *script_buf) +{ + DSL_char_t *buf = DSL_NULL; + DSL_char_t *args = DSL_NULL; + DSL_char_t nLineIdentifiers[3][9] = { "nLine=0", "nLine=1", "nLine=-1" }; + DSL_uint16_t nLineOffset = 0; + DSL_char_t *pLine = DSL_NULL; + DSL_char_t *str_command = DSL_NULL; + DSL_boolean_t bTagFound = DSL_FALSE, + bSectionOpenFound = DSL_FALSE; + DSL_char_t echo_val[5] = {0}; + DSL_boolean_t bEchoOn = DSL_FALSE; +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + DSL_char_t str_group[20] = { 0 }; + DSL_char_t str_value[128] = { 0 }; +#if defined(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH) + DSL_char_t op1[40] = {0}, op2[40] = {0}; + DSL_uint32_t var32[8] = {0}; + DSL_uint16_t Message[DSL_MAX_CMV_MSG_LENGTH]; +#endif /* defined(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH)*/ + DSL_int_t address, index, retCode = 0; + DSL_int_t n = 0, m = 0; + DSL_uint16_t value = 0; + DSL_uint16_t var16[8] = {0}; + DSL_Error_t nErrCode = DSL_SUCCESS; + DSL_DeviceMessage_t msg; +#endif /* defined (INCLUDE_DSL_CPE_API_DANUBE)*/ +#ifndef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + DSL_char_t *pFile__; +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + + if (!pFile) + { + return DSL_ERROR; + } + + if (!script_buf) + { + return DSL_ERROR; + } + + if (!script_buf->buffer_cmd) + { + return DSL_ERROR; + } + + if (!script_buf->buffer_tmp) + { + return DSL_ERROR; + } + + buf = script_buf->buffer_tmp; + str_command = script_buf->buffer_cmd; + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + while (1) + { + memset (str_command, 0, script_buf->nSize); + memset (buf, 0, script_buf->nSize); + + char nSize[14]; + snprintf(nSize, sizeof(nSize), "%%%ds", script_buf->nSize); + + /* scan one line into buffer */ + if ((DSL_CPE_FGets (buf, script_buf->nSize, pFile)) == DSL_NULL) + break; + + pLine = buf; + + /* if the line is empty or a special "#" symbol detected, + then go on to the next */ + if ((sscanf (buf, nSize, str_command) == 0) || (buf[0] == '#')) + { + continue; + } +#else + pFile__ = (DSL_char_t*) pFile; + + while (1) + { + memset (str_command, 0, script_buf->nSize); + memset (buf, 0, script_buf->nSize); + + sscanf (pFile__, "%[^\n]s", &buf); + + while(*pFile__++ != '\n'); + + if ((sscanf (buf, "%"_MKSTR(MAX_SCRIPT_CMD_LEN)"s", str_command) == 0) || (buf[0] == '#')) + { + continue; + } + + if (strcmp(str_command, "EOF") == 0) + { + break; + } + + pLine = buf; +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + + /* remove leading whitespaces*/ + while((DSL_int_t)isspace(*pLine)) + { + pLine++; + } + + if (!bTagFound) + { + /* find search section tag*/ + if (!DSL_CPE_ScriptSectionTagFind(pLine, searchSection)) + { + continue; + } + else + { + /* search section tag found*/ + bTagFound = DSL_TRUE; + } + } + + /* find search section open*/ + if (bTagFound && !bSectionOpenFound) + { + if (DSL_CPE_ScriptSectionOpenFind(pLine)) + { + /* search section open found*/ + bSectionOpenFound = DSL_TRUE; + } + continue; + } + + /* Check for search section close*/ + if (bSectionOpenFound) + { + if (DSL_CPE_ScriptSectionCloseFind(pLine)) + { + /* Complete section proceeded, reset flags*/ + bTagFound = DSL_FALSE; + bSectionOpenFound = DSL_FALSE; + continue; + } + } + + if (strcmp (str_command, "echo") == 0) /* echo command */ + { + if (sscanf (buf, "%"_MKSTR(MAX_SCRIPT_CMD_LEN)"s %3s", str_command, echo_val) != 0) + { + if (strcmp (echo_val, "on") == 0) + { + /* Activate local echo*/ + bEchoOn = DSL_TRUE; + continue; + } + + if (strcmp (echo_val, "off") == 0) + { + /* Deactivate local echo*/ + bEchoOn = DSL_FALSE; + continue; + } + } + + if (bEchoOn) + DSL_CPE_Echo (buf); + + continue; + } + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + memset(&msg, 0, sizeof(DSL_DeviceMessage_t)); + + /* if the line is empty, then go on to the next */ + if (strcmp (str_command, "cr") == 0) /* cr command */ + { + sscanf (buf, "%s %s %d %d %s", &str_command[0], &str_group[0], &address, + &index, &str_value[0]); + + if (strncmp (str_value, "$", 1) != 0) + { + return DSL_ERR_INVALID_PARAMETER; + } + + n = strtoul (str_value + 1, DSL_NULL, 10); + + if (n >= sizeof(var16)/sizeof(var16[0])) + { + return DSL_ERR_INVALID_PARAMETER; + } + + nErrCode = DSL_CMV_Read (pContext, str_group, address, index, 1, &var16[n]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"CMV RD %s %d %d, value=0x%04x, " + "retCode=%d"DSL_CPE_CRLF, + str_group, address, index, var16[n], nErrCode)); + } + else if (strcmp (str_command, "cw") == 0) /* cw command */ + { + sscanf (buf, "%s %s %d %d %s", &str_command[0], &str_group[0], &address, + &index, &str_value[0]); + + if (strncmp (str_value, "$", 1) == 0) + { + n = strtoul (str_value + 1, DSL_NULL, 10); + + if (n >= sizeof(var16)/sizeof(var16[0])) + { + return DSL_ERR_INVALID_PARAMETER; + } + + value = var16[n]; + } + else if (strncmp (str_value, "#", 1) == 0) + { + value = (DSL_uint16_t)strtoul (str_value + 1, DSL_NULL, 16); + } + else + { + value = (DSL_uint16_t)strtoul (str_value, DSL_NULL, 16); + } + + nErrCode = DSL_CMV_Write (pContext, str_group, address, index, 1, &value); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"CMV WR %s %d %d, value=0x%04x, " + "retCode=%d"DSL_CPE_CRLF, + str_group, address, index, value, nErrCode)); + + if (nErrCode != DSL_SUCCESS) + { + return DSL_ERR_MSG_EXCHANGE; + } + } +#if defined(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH) + else if (strcmp (str_command, "mw") == 0) /* debug memory write command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &str_value[0]); + + address = strtoul (op1, DSL_NULL, 0); + if (strncmp (str_value, "$", 1) == 0) + { + n = strtoul (str_value + 1, DSL_NULL, 10); + + if (n >= sizeof(var16)/sizeof(var16[0])) + { + return DSL_ERR_INVALID_PARAMETER; + } + + value = var16[n]; + } + else if (strncmp (str_value, "#", 1) == 0) + { + value = (DSL_uint16_t)strtoul (str_value + 1, DSL_NULL, 0); + } + else + { + value = (DSL_uint16_t)strtoul (str_value, DSL_NULL, 0); + } + + DSL_CMV_Prepare (DSL_CMV_OPCODE_H2D_DEBUG_WRITE_DM, 0x0, address >> 16, + (address) & (0xffff), 1, &value, Message); + + msg.data.pMsg = (DSL_uint8_t *)Message; + msg.data.nSizeTx = 8; + + retCode = DSL_CPE_Ioctl (pContext->fd[pContext->nDevNum], DSL_FIO_DBG_DEVICE_MESSAGE_SEND, (int)&Message); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"Dbg Memory write address=%08x, value=%04x, " + "retCode=%d"DSL_CPE_CRLF, + address, value, retCode)); + + if (retCode < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "mw %08x fail" DSL_CPE_CRLF, address)); + return DSL_ERR_MSG_EXCHANGE; + } + } + else if (strcmp (str_command, "mr") == 0) /* debug memory read command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &str_value[0]); + address = strtoul (op1, DSL_NULL, 0); + n = strtoul (str_value + 1, DSL_NULL, 10); + + if (n >= sizeof(var16)/sizeof(var16[0])) + { + return DSL_ERR_INVALID_PARAMETER; + } + + if (strncmp (str_value, "$", 1) != 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "error:mr parameter type mismatch!" DSL_CPE_CRLF)); + return DSL_ERR_INVALID_PARAMETER; + } + DSL_CMV_Prepare (DSL_CMV_OPCODE_H2D_DEBUG_READ_DM, 0x0, address >> 16, + (address) & (0xffff), 1, DSL_NULL, Message); + + msg.data.pMsg = (DSL_uint8_t *)Message; + msg.data.nSizeTx = 8; + msg.data.nSizeRx = 10; + + + retCode = DSL_CPE_Ioctl (pContext->fd[pContext->nDevNum], DSL_FIO_DBG_DEVICE_MESSAGE_SEND, (int)&Message); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"Dbg Memory read address=%08x, value=%04x, " + "retCode=%d"DSL_CPE_CRLF, + address, value, retCode)); + + if (retCode < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "mw %08x fail" DSL_CPE_CRLF, address)); + + return DSL_ERR_MSG_EXCHANGE; + } + value = Message[4]; + var16[n] = value; + } + + + /* meiw command */ +/*$$ + else if (strcmp (str_command, "meiw") == 0) + { + meireg regrdwr; + + sscanf (buf, "%s %s %s", &str_command, &op1, &op2); + regrdwr.iAddress = strtoul (op1, DSL_NULL, 0) + MEI_SPACE_ACCESS; + + + if (strncmp (op2, "#", 1) == 0) + regrdwr.iData = strtoul (op1 + 1, DSL_NULL, 0); + else if (strncmp (op2, "$", 1) == 0) + regrdwr.iData = var16[strtoul (op2 + 1, DSL_NULL, 0)]; + else if (strncmp (op2, "@", 1) == 0) + regrdwr.iData = var32[strtoul (op2 + 1, DSL_NULL, 0)]; + else + regrdwr.iData = strtoul (op1, DSL_NULL, 0); + // printf("address=%08x\n", regrdwr.iAddress); + + msg.data.pMsg = (DSL_uint8_t *)Message; + msg.data.nSizeTx = 8; + msg.data.nSizeRx = 10; + + if (ioctl (pContext->fd, DANUBE_MEI_CMV_WRITE, ®rdwr) < 0) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "meiw fail\n"); + break;; + } + + } +*/ + + /* meir command */ +/*$$ + else if (strcmp (str_command, "meir") == 0) + { + meireg regrdwr; + + sscanf (buf, "%s %s %s", &str_command, &op1, &op2); + regrdwr.iAddress = strtoul (op1, DSL_NULL, 0) + MEI_SPACE_ACCESS; + if (ioctl (pContext->fd, DANUBE_MEI_CMV_READ, ®rdwr) < 0) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "meir fail\n"); + break; + } + if (strncmp (op2, "$", 1) == 0) + var16[strtoul (op2 + 1, DSL_NULL, 0)] = regrdwr.iData; + else if (strncmp (op2, "@", 1) == 0) + var32[strtoul (op2 + 1, DSL_NULL, 0)] = regrdwr.iData; + else + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "meir grammar error!" DSL_CPE_CRLF); + break; + } + + } +*/ + + else if (strcmp (str_command, "lst") == 0) /* list command */ + { + sscanf (buf, "%s %s", &str_command[0], &str_value[0]); + + n = strtoul (str_value + 1, DSL_NULL, 0); + + if (strncmp (str_value, "$", 1) == 0) + { + if (n >= sizeof(var16)/sizeof(var16[0])) + { + return DSL_ERR_INVALID_PARAMETER; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "$%d=0x%04x" DSL_CPE_CRLF, n, var16[n])); + } + else if (strncmp (str_value, "@", 1) == 0) + { + if (n >= sizeof(var32)/sizeof(var32[0])) + { + return DSL_ERR_INVALID_PARAMETER; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "$%d=0x%08x" DSL_CPE_CRLF, n, var32[n])); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "lst grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + else if (strcmp (str_command, "mov") == 0) /* move command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &op2[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"MOVE %s -> %s"DSL_CPE_CRLF, op2, op1)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] = var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] = var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var16[n] = (DSL_uint16_t)strtoul (op2 + 1, DSL_NULL, 0); + } + else + { + var16[n] = (DSL_uint16_t)strtoul (op2, DSL_NULL, 0); + } + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] = var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] = var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var32[n] = strtoul (op2 + 1, DSL_NULL, 0); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + else if (strcmp (str_command, "or") == 0) /* or command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &op2[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"%s = %s OR %s"DSL_CPE_CRLF, + op1, op1, op2)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] |= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] |= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var16[n] |= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] |= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] |= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var32[n] |= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + else if (strcmp (str_command, "and") == 0) /* and command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &op2[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"%s = %s AND %s"DSL_CPE_CRLF, + op1, op1, op2)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] &= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] &= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var16[n] &= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] &= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] &= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var32[n] &= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + else if (strcmp (str_command, "not") == 0) /* not command */ + { + sscanf (buf, "%s %s", &str_command[0], &op1[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"%s = NOT %s"DSL_CPE_CRLF, + op1, op1)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] = ~var16[n]; + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] = ~var32[n]; + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + else if (strcmp (str_command, "shl") == 0) /* shift left command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &op2[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"%s = %s << %s"DSL_CPE_CRLF, + op1, op1, op2)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] <<= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] <<= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var16[n] <<= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] <<= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] <<= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var32[n] <<= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + else if (strcmp (str_command, "shr") == 0) /* shift right command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &op2[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"%s = %s >> %s"DSL_CPE_CRLF, + op1, op1, op2)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] >>= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] >>= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var16[n] >>= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] >>= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] >>= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var32[n] >>= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + + else if (strcmp (str_command, "add") == 0) /* addition command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &op2[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"%s = %s + %s"DSL_CPE_CRLF, + op1, op1, op2)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] += var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] += var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var16[n] += (DSL_uint16_t)strtoul (op2 + 1, DSL_NULL, 0); + } + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] += var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] += var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var32[n] += strtoul (op2 + 1, DSL_NULL, 0); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } + else if (strcmp (str_command, "sub") == 0) /* subtraction command */ + { + sscanf (buf, "%s %s %s", &str_command[0], &op1[0], &op2[0]); + + DSL_SCRIPT_DEBUG(bEchoOn, + (DSL_CPE_STDOUT, DSL_CPE_SCRIPT_PREFIX"%s = %s - %s"DSL_CPE_CRLF, + op1, op1, op2)); + + if (strncmp (op1, "$", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] -= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var16[n] -= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var16[n] -= (DSL_uint16_t)strtoul (op2 + 1, DSL_NULL, 0); + } + } + else if (strncmp (op1, "@", 1) == 0) + { + n = strtoul (op1 + 1, DSL_NULL, 0); + + if (n >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + if (strncmp (op2, "$", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var16)/sizeof(var16[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] -= var16[m]; + } + else if (strncmp (op2, "@", 1) == 0) + { + m = strtoul (op2 + 1, DSL_NULL, 0); + + if (m >= sizeof(var32)/sizeof(var32[0])) + return DSL_ERR_INVALID_PARAMETER; + + var32[n] -= var32[m]; + } + else if (strncmp (op2, "#", 1) == 0) + { + var32[n] -= strtoul (op2 + 1, DSL_NULL, 0); + } + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "grammar error!" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + } +#endif /* defined(INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH)*/ + else +#endif /* defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + { +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + str_command[script_buf->nSize - 1] = '\0'; + + args = buf + DSL_MIN(strlen(str_command) + 1, script_buf->nSize - 1); + nLineOffset = 0; + + /* for single link remove parameter and it's value */ + if(pContext->bBackwardCompMode) + { + if(strncmp(args, nLineIdentifiers[0], strlen(nLineIdentifiers[0])) == 0) + { + nLineOffset = strlen(nLineIdentifiers[0]); + } + else if(strncmp(args, nLineIdentifiers[1], strlen(nLineIdentifiers[1])) == 0) + { + /* do not process this case + * just indicate that required parameter was found */ + nLineOffset = 1; + } + else if(strncmp(args, nLineIdentifiers[2], strlen(nLineIdentifiers[2])) == 0) + { + nLineOffset = strlen(nLineIdentifiers[2]); + } + } + /* for bonding keep just parameter's value */ + else + { + if(strncmp(args, nLineIdentifiers[0], strlen(nLineIdentifiers[0])) == 0 || + strncmp(args, nLineIdentifiers[1], strlen(nLineIdentifiers[1])) == 0) + { + nLineOffset = strlen(nLineIdentifiers[0]) - 1; + } + else if(strncmp(args, nLineIdentifiers[2], strlen(nLineIdentifiers[2])) == 0) + { + nLineOffset = strlen(nLineIdentifiers[2]) - 2; + } + } + + if(nLineOffset > 1) + { + /* Check if a CLI command is given */ + DSL_CPE_CliDeviceCommandExecute (pContext, nDevice, + str_command, args + nLineOffset, DSL_CPE_STDOUT); + } + else if (nLineOffset == 0) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX + "Missing command's required first argument \"nLine=[0|1|-1]\"!" + DSL_CPE_CRLF); + } + +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + } + } + return DSL_SUCCESS; +} +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +/** + Performs an execution of debug batch file +*/ +DSL_Error_t DSL_CPE_ScriptFileParse( + DSL_CPE_Control_Context_t * pContext, + DSL_int_t nDevice, + DSL_char_t *sFileName, + DSL_CPE_ScriptSection_t searchSection) +{ + DSL_Error_t nErrCode = DSL_SUCCESS; + DSL_CPE_File_t *pFile; + DSL_CPE_ScriptBuffer_t script_buf = {0}; + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Parsing script file (%s)..." + DSL_CPE_CRLF, sFileName)); +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + + do + { + if (sFileName == DSL_NULL) + { + nErrCode = DSL_ERR_POINTER; + break; + } + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + pFile = DSL_CPE_FOpen(sFileName, "r"); + if (pFile == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - %s script file open failed! Have you used absolute script file path?" DSL_CPE_CRLF, + sFileName)); + + nErrCode = DSL_ERROR; + break; + } +#else + pFile = (DSL_CPE_File_t*)sFileName; +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + + script_buf.nSize = MAX_SCRIPT_CMD_LEN + 1; + script_buf.buffer_cmd = DSL_CPE_Malloc(script_buf.nSize); + script_buf.buffer_tmp = DSL_CPE_Malloc(script_buf.nSize); + + if ((script_buf.buffer_cmd == DSL_NULL) || (script_buf.buffer_tmp == DSL_NULL)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Could not allocate memory %d bytes" DSL_CPE_CRLF, script_buf.nSize)); + nErrCode = DSL_ERROR; + } + else + { + nErrCode = DSL_CPE_ScriptExecute(pContext, nDevice, pFile, searchSection, &script_buf); + } + + DSL_CPE_Free(script_buf.buffer_cmd); + DSL_CPE_Free(script_buf.buffer_tmp); + script_buf.nSize = 0; + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + DSL_CPE_FClose(pFile); +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT*/ + } while (0); + + + if (nErrCode != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Script file execution failed (nErrCode=%d)!" DSL_CPE_CRLF, nErrCode)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Script file execution performed successfully." DSL_CPE_CRLF)); + } + + return nErrCode; +} +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_NOTIFICATIONS + +DSL_void_t DSL_CPE_ScriptRun(DSL_void_t) +{ + if (g_sRcScript != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Run script file (%s)" + DSL_CPE_CRLF, g_sRcScript)); + + if (DSL_CPE_System(g_sRcScript) != DSL_SUCCESS + && bScriptWarn == DSL_FALSE) + { + bScriptWarn = DSL_TRUE; + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "notification script file (%s) execution failed!" DSL_CPE_CRLF, + g_sRcScript)); + } + } + + return; +} + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP + +#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION */ + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_ResourceUsageStatisticsGet( + DSL_CPE_Control_Context_t *pContext, + DSL_CPE_ResourceUsageStatisticsData_t *pData) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_uint32_t staticMemUsageTotal = 0, dynamicMemUsageTotal = 0, currMemUsage = 0; +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_CLI_ResourceUsageStatisticsData_t cliResourceUsageStatisticsData; +#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT + DSL_uint32_t pipeStatResourceUsage = 0; +#endif /* DSL_CPE_REMOVE_PIPE_SUPPORT*/ +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ +#ifdef DSL_DEBUG_TOOL_INTERFACE + DSL_CPE_TcpDebugResourceUsageStatisticsData_t TcpDebugResUsage; +#endif /*DSL_DEBUG_TOOL_INTERFACE*/ + + if (pContext == DSL_NULL || pData == DSL_NULL) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + nRet = DSL_CPE_CLI_ResourceUsageGet(&cliResourceUsageStatisticsData); + if (nRet != DSL_SUCCESS) + { + return nRet; + } +#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT + nRet = DSL_CPE_Pipe_StaticResourceUsageGet(&pipeStatResourceUsage); + if (nRet != DSL_SUCCESS) + { + return nRet; + } +#endif /* DSL_CPE_REMOVE_PIPE_SUPPORT*/ +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + +#ifdef DSL_DEBUG_TOOL_INTERFACE + nRet = DSL_CPE_TcpDebugMessageResourceUsageGet(pContext, &TcpDebugResUsage); + if (nRet != DSL_SUCCESS) + { + return nRet; + } +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + + /* *********************************************************************** */ + /* *** Print statistic on memory usage of DSL CPE Control Application *** */ + /* *********************************************************************** */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX DSL_CPE_CRLF )); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + "*****************************************************" DSL_CPE_CRLF )); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " DSL CPE Control Application version: %s" DSL_CPE_CRLF, PACKAGE_VERSION)); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + "*****************************************************" DSL_CPE_CRLF )); + /* + Global Context static memory usage + */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " Global Context static memory usage" DSL_CPE_CRLF )); + currMemUsage = sizeof(DSL_CPE_Control_Context_t); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " context structure : %10d bytes" DSL_CPE_CRLF, (int)currMemUsage)); + staticMemUsageTotal += currMemUsage; + /* + Auxiliary data static memory usage + */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " Auxiliary data static memory usage" DSL_CPE_CRLF )); +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + currMemUsage = sizeof(eventString); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " events : %10d bytes" DSL_CPE_CRLF, (int)currMemUsage)); + staticMemUsageTotal += currMemUsage; +#endif /* #ifdef INCLUDE_DSL_CPE_CLI_SUPPORT*/ + currMemUsage = sizeof(DSL_InitData_t); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " initial configuration data : %10d bytes" DSL_CPE_CRLF, (int)currMemUsage)); + staticMemUsageTotal += currMemUsage; + currMemUsage = sizeof(long_options) + sizeof(GETOPT_LONG_OPTSTRING) + sizeof(description); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " help screen/startup options : %10d bytes" DSL_CPE_CRLF, (int)currMemUsage)); + staticMemUsageTotal += currMemUsage; +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + /* + CLI static memory usage + */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " CLI static memory usage : %10d bytes" DSL_CPE_CRLF, cliResourceUsageStatisticsData.staticMemUsage)); + staticMemUsageTotal += cliResourceUsageStatisticsData.staticMemUsage; +#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT + /* + Pipe static memory usage + */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " Pipe static memory usage : %10d bytes" DSL_CPE_CRLF, pipeStatResourceUsage)); + staticMemUsageTotal += pipeStatResourceUsage; +#endif /* DSL_CPE_REMOVE_PIPE_SUPPORT*/ +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " --------------" DSL_CPE_CRLF )); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " Total static memory usage : %10d bytes" DSL_CPE_CRLF, staticMemUsageTotal)); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX DSL_CPE_CRLF )); +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + /* + CLI dynamic memory usage + */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " CLI dynamic memory usage : %10d bytes" DSL_CPE_CRLF, cliResourceUsageStatisticsData.dynamicMemUsage)); + dynamicMemUsageTotal += cliResourceUsageStatisticsData.dynamicMemUsage; + if (pConsoleContext != DSL_NULL) + { + currMemUsage = sizeof(DSL_CPE_Console_Context_t); + dynamicMemUsageTotal += currMemUsage; + } + /* + Console dynamic memory usage + */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " Console dynamic memory usage : %10d bytes" DSL_CPE_CRLF, currMemUsage)); +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + +#ifdef DSL_DEBUG_TOOL_INTERFACE + /* + Console dynamic memory usage + */ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " Debug tool dynamic memory usage: %10d bytes" DSL_CPE_CRLF, TcpDebugResUsage.dynamicMemUsage)); + dynamicMemUsageTotal += TcpDebugResUsage.dynamicMemUsage; +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " --------------" DSL_CPE_CRLF )); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX + " Total dynamic memory usage : %10d bytes" DSL_CPE_CRLF, dynamicMemUsageTotal)); + DSL_CCA_DEBUG( DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX DSL_CPE_CRLF )); + + pData->staticMemUsage = staticMemUsageTotal; + pData->dynamicMemUsage = dynamicMemUsageTotal; + + return nRet; +} +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +#if defined(INCLUDE_DSL_CPE_API_VRX) +DSL_Error_t DSL_CPE_LowLevelConfigurationCheck( + DSL_int_t fd) +{ + DSL_Error_t nErrCode = DSL_SUCCESS; + DSL_int_t ret = 0, i = 0; + DSL_VersionInformation_t verInf; + DSL_LowLevelConfiguration_t llCfg; + DSL_VRX_FwVersion_t FwVersion = {0}; + DSL_char_t seps[] = "."; + DSL_char_t *token; + DSL_uint8_t *pVer = (DSL_uint8_t*)&FwVersion; + DSL_boolean_t bCfgChanged = DSL_FALSE; + + memset(&verInf, 0x0, sizeof(DSL_VersionInformation_t)); + + /* Get version info*/ + ret = DSL_CPE_Ioctl (fd, DSL_FIO_VERSION_INFORMATION_GET, (int) &verInf); + + if ((ret < 0) && (verInf.accessCtl.nReturn < DSL_SUCCESS)) + { + return DSL_ERROR; + } + + if (strcmp (verInf.data.DSL_ChipSetFWVersion, "n/a") == 0) + { + /* No FW version available*/ + return DSL_SUCCESS; + } + else + { + /* Get first token */ + token = strtok (verInf.data.DSL_ChipSetFWVersion, seps); + if (token != DSL_NULL) + { + for(i = 0; i < 6; i++) + { + sscanf (token, "%hhu", pVer); + + /* Get next token */ + token = strtok(DSL_NULL, seps); + + /* Exit scanning if no further information is included */ + if (token == DSL_NULL) + { + break; + } + pVer++; + } + + if (i < 5) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "ERROR - Inconsistent FW version received!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + } + } + + /* Clean LL cfg structure*/ + memset(&llCfg, 0, sizeof(DSL_LowLevelConfiguration_t)); + + /* Get LL configuration from the driver*/ + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LOW_LEVEL_CONFIGURATION_GET, (int) &llCfg); + + if ((ret < 0) && (llCfg.accessCtl.nReturn < DSL_SUCCESS)) + { + return DSL_ERROR; + } + /* Check for the changed LL configuration*/ + if (bCfgChanged) + { + /* Set updated LL configuration*/ + ret = DSL_CPE_Ioctl (fd, DSL_FIO_LOW_LEVEL_CONFIGURATION_SET, (int) &llCfg); + + if ((ret < 0) && (llCfg.accessCtl.nReturn < DSL_SUCCESS)) + { + return DSL_ERROR; + } + } + + return nErrCode; +} +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_InitReadyHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s" DSL_CPE_CRLF , + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType))); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d" DSL_CPE_CRLF , + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), nDevice); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_AutobootStatusHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t fd, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + DSL_CPE_ScriptSection_t searchSection; + DSL_AutobootStatus_t status; + DSL_AutobootStatusData_t StatusData; + DSL_AutobootControl_t control; + DSL_int_t ret = 0; +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ + + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nStatus=%d nFirmwareRequestType=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.pData->autobootStatus.nStatus, pEvent->data.pData->autobootStatus.nFirmwareRequestType); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice%d nStatus=%d nFirmwareRequestType=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.pData->autobootStatus.nStatus, pEvent->data.pData->autobootStatus.nFirmwareRequestType); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + cpe_control_memcpy_s(&StatusData, sizeof(DSL_AutobootStatusData_t), + &(pEvent->data.pData->autobootStatus), sizeof(pEvent->data.pData->autobootStatus)); + + switch (StatusData.nStatus) + { + case DSL_AUTOBOOT_STATUS_CONFIG_WRITE_WAIT: + searchSection = DSL_SCRIPT_SECTION_WAIT_FOR_CONFIFURATION; + break; + case DSL_AUTOBOOT_STATUS_LINK_ACTIVATE_WAIT: + searchSection = DSL_SCRIPT_SECTION_WAIT_FOR_LINK_ACTIVATE; + break; + case DSL_AUTOBOOT_STATUS_RESTART_WAIT: + searchSection = DSL_SCRIPT_SECTION_WAIT_BEFORE_RESTART; + if (INCLUDE_DSL_BONDING) + { + /* Bonding specific handling*/ + if (DSL_CPE_BND_AutobootStatusRestartWait( + (DSL_CPE_BND_Context_t*)pContext->pBnd, nDevice) < DSL_SUCCESS) + { + return -1; + } + } + break; + default: + return 0; + } + + if (pContext->nFwModeStatus == DSL_FW_STATUS_ADSL) + { + if (g_sAdslScript != DSL_NULL) + { + DSL_CPE_ScriptFileParse(pContext, nDevice, g_sAdslScript, searchSection); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "ADSL script not specified" DSL_CPE_CRLF)); + } + } + +#if defined(INCLUDE_DSL_CPE_API_VRX) + if (pContext->nFwModeStatus == DSL_FW_STATUS_VDSL) + { + if (g_sVdslScript != DSL_NULL) + { + DSL_CPE_ScriptFileParse(pContext, nDevice, g_sVdslScript, searchSection); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "VDSL script not specified" DSL_CPE_CRLF)); + } + } +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + + /* Get autoboot status directly after script execution*/ + memset (&status, 0, sizeof(DSL_AutobootStatus_t)); + + ret = DSL_CPE_Ioctl(fd, DSL_FIO_AUTOBOOT_STATUS_GET,(DSL_int_t) &status); + + if (ret >= 0) + { + if (((status.data.nStatus == DSL_AUTOBOOT_STATUS_CONFIG_WRITE_WAIT) && g_bAutoContinueWaitBeforeConfigWrite[nDevice]) || + ((status.data.nStatus == DSL_AUTOBOOT_STATUS_LINK_ACTIVATE_WAIT) && g_bAutoContinueWaitBeforeLinkActivation[nDevice]) || + ((status.data.nStatus == DSL_AUTOBOOT_STATUS_RESTART_WAIT) && g_bAutoContinueWaitBeforeRestart[nDevice])) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "Continue autoboot handling..." DSL_CPE_CRLF)); + + memset (&control, 0, sizeof(DSL_AutobootControl_t)); + + control.data.nCommand = DSL_AUTOBOOT_CTRL_CONTINUE; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_AUTOBOOT_CONTROL_SET,(DSL_int_t) &control); + } + } +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ + + return 0; +} + +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_HISTORY +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_PmSyncHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s b15MinElapsed=%u b1DayElapsed=%u" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.pData->sync.b15MinElapsed, + pEvent->data.pData->sync.b1DayElapsed); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d b15MinElapsed=%u b1DayElapsed=%u" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.pData->sync.b15MinElapsed, + pEvent->data.pData->sync.b1DayElapsed); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /*INCLUDE_DSL_CPE_PM_HISTORY*/ +#endif /*INCLUDE_DSL_PM*/ + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_LineStateHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + DSL_LineStateValue_t nLineState = DSL_LINESTATE_NOT_INITIALIZED; +#ifdef INCLUDE_SCRIPT_NOTIFICATION + DSL_boolean_t bExec = DSL_FALSE; + DSL_char_t buff[5]; +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + + nLineState = pEvent->data.pData->lineStateData.nLineState; + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " "nLineState=%08X" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.pData->lineStateData.nLineState); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nLineState=%08X" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.pData->lineStateData.nLineState); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + if (g_sRcScript != DSL_NULL) + { + if ( (nLineState == DSL_LINESTATE_SILENT) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_SILENT) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "READY") == DSL_SUCCESS) + { + bExec = DSL_TRUE; + } + } + else if ( (nLineState == DSL_LINESTATE_HANDSHAKE) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_HANDSHAKE) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "HANDSHAKE") == DSL_SUCCESS) + { + bExec = DSL_TRUE; + } + } + else if ( (nLineState == DSL_LINESTATE_FULL_INIT) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_FULL_INIT) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "TRAINING") == DSL_SUCCESS) + { + bExec = DSL_TRUE; + } + } + else if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_SHOWTIME_TC_SYNC) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "UP") == DSL_SUCCESS) + { + bExec = DSL_TRUE; + } + } + else if ( ((nLineState == DSL_LINESTATE_EXCEPTION) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_EXCEPTION)) || + ((nLineState != DSL_LINESTATE_SHOWTIME_TC_SYNC) && + (nLineState != DSL_LINESTATE_SHOWTIME_NO_SYNC) && + ((g_nPrevLineState[nDevice] == DSL_LINESTATE_SHOWTIME_TC_SYNC) || + (g_nPrevLineState[nDevice] == DSL_LINESTATE_SHOWTIME_NO_SYNC))) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "DOWN") == DSL_SUCCESS) + { + bExec = DSL_TRUE; + } + } + else if ( (nLineState == DSL_LINESTATE_LOOPDIAGNOSTIC_ACTIVE) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_LOOPDIAGNOSTIC_ACTIVE) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "LDM_ACTIVE") == DSL_SUCCESS) + { + bExec = DSL_TRUE; + } + } + else if ( (nLineState == DSL_LINESTATE_LOOPDIAGNOSTIC_COMPLETE) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_LOOPDIAGNOSTIC_COMPLETE) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "LDM_COMPLETE") == DSL_SUCCESS) + { + bExec = DSL_TRUE; + } + } + if (DSL_CPE_DSL_ENTITIES > 1) + { + snprintf(buff, sizeof(buff), "%u", nDevice); + if (bExec == DSL_TRUE) + { + if (DSL_CPE_SetEnv("DSL_LINE_NUMBER", buff) != DSL_SUCCESS) + { + bExec = DSL_FALSE; + } + } + } + if (bExec != DSL_FALSE) + { + if (DSL_CPE_SetEnv("DSL_NOTIFICATION_TYPE", "DSL_INTERFACE_STATUS") == DSL_SUCCESS) + { + DSL_CPE_ScriptRun(); + } + } + } +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + + if (INCLUDE_DSL_BONDING) + { + if ( DSL_CPE_BND_LineStateHandle( + (DSL_CPE_BND_Context_t *)pContext->pBnd, + pContext->fd[nDevice], nDevice, nLineState, g_nPrevLineState[nDevice]) < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "BND - Line State handling failed!" DSL_CPE_CRLF)); + } + } + + g_nPrevLineState[nDevice] = nLineState; + + return 0; +} + +#ifdef INCLUDE_DSL_SYSTEM_INTERFACE +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_SystemInterfaceStatusHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t fd, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + DSL_Error_t nErrCode = DSL_SUCCESS; +#ifdef INCLUDE_SCRIPT_NOTIFICATION +#if defined(INCLUDE_DSL_CPE_API_VRX) + DSL_VersionInformation_t ioctlVig; + DSL_uint8_t nPlatformId = 0; + DSL_int_t FwApplication = -1; +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + DSL_char_t *pXDSLstatus = "ADSL"; + DSL_char_t buff[5]; +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#if defined(INCLUDE_DSL_CPE_API_VRX) + if (INCLUDE_DSL_BONDING) + { + nErrCode = DSL_CPE_BND_SystemInterfaceStatusHandle( + (DSL_CPE_BND_Context_t*)pContext->pBnd, fd, nDevice); + if (nErrCode != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Bonding System Interface status handle failed" DSL_CPE_CRLF)); + return nErrCode; + } + } +#endif + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + if (g_sRcScript != DSL_NULL) + { + if (DSL_CPE_SetEnv("DSL_NOTIFICATION_TYPE", "DSL_STATUS") == DSL_SUCCESS) + { +#if defined(INCLUDE_DSL_CPE_API_VRX) + memset(&ioctlVig, 0x00, sizeof(DSL_VersionInformation_t)); + if (DSL_CPE_Ioctl(fd, DSL_FIO_VERSION_INFORMATION_GET, (DSL_int_t)&ioctlVig) >= 0) + { + DSL_CPE_FwInfoFromWhatstringGet(ioctlVig.data.DSL_ChipSetFWVersion, + &FwApplication, &nPlatformId); + /* Application type (application) + The following application types are defined. + - 0x01: ADSL Annex A + - 0x02: ADSL Annex B + - 0x06: VDSL + - 0x07: VDSL with G.Vector support */ + if ((FwApplication != 0x1) && (FwApplication != 0x2)) + { + pXDSLstatus = "VDSL"; + } + } +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ + nErrCode = DSL_CPE_SetEnv("DSL_XTU_STATUS", pXDSLstatus); + + if (nErrCode == DSL_SUCCESS) + { + switch (pEvent->data.pData->systemInterfaceStatusData.nTcLayer) + { + case DSL_TC_ATM: + nErrCode = DSL_CPE_SetEnv("DSL_TC_LAYER_STATUS", "ATM"); + break; + case DSL_TC_EFM: + case DSL_TC_EFM_FORCED: + nErrCode = DSL_CPE_SetEnv("DSL_TC_LAYER_STATUS", "EFM"); + break; + default: + nErrCode = DSL_CPE_SetEnv("DSL_TC_LAYER_STATUS", "UNKNOWN"); + break; + } + } + + if (nErrCode == DSL_SUCCESS) + { + switch (pEvent->data.pData->systemInterfaceStatusData.nEfmTcConfigUs) + { + case DSL_EMF_TC_NORMAL: + nErrCode = DSL_CPE_SetEnv("DSL_EFM_TC_CONFIG_US", "NORMAL"); + break; + case DSL_EMF_TC_PRE_EMPTION: + nErrCode = DSL_CPE_SetEnv("DSL_EFM_TC_CONFIG_US", "PRE_EMPTION"); + break; + default: + nErrCode = DSL_CPE_SetEnv("DSL_EFM_TC_CONFIG_US", "UNKNOWN"); + break; + } + } + + if (nErrCode == DSL_SUCCESS) + { + switch (pEvent->data.pData->systemInterfaceStatusData.nEfmTcConfigDs) + { + case DSL_EMF_TC_NORMAL: + nErrCode = DSL_CPE_SetEnv("DSL_EFM_TC_CONFIG_DS", "NORMAL"); + break; + default: + nErrCode = DSL_CPE_SetEnv("DSL_EFM_TC_CONFIG_DS", "UNKNOWN"); + break; + } + } + if (DSL_CPE_DSL_ENTITIES > 1) + { + if (nErrCode == DSL_SUCCESS) + { + snprintf(buff, sizeof(buff), "%u", nDevice); + nErrCode = DSL_CPE_SetEnv("DSL_LINE_NUMBER", buff); + } + } + if (nErrCode == DSL_SUCCESS) + { + DSL_CPE_ScriptRun(); + } + } + } +#endif + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nTcLayer=%d nEfmTcConfigUs=0x%08X nEfmTcConfigDs=0x%08X " + "nSystemIf=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.pData->systemInterfaceStatusData.nTcLayer, + pEvent->data.pData->systemInterfaceStatusData.nEfmTcConfigUs, + pEvent->data.pData->systemInterfaceStatusData.nEfmTcConfigDs, + pEvent->data.pData->systemInterfaceStatusData.nSystemIf); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nTcLayer=%d nEfmTcConfigUs=0x%08X nEfmTcConfigDs=0x%08X " + "nSystemIf=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.pData->systemInterfaceStatusData.nTcLayer, + pEvent->data.pData->systemInterfaceStatusData.nEfmTcConfigUs, + pEvent->data.pData->systemInterfaceStatusData.nEfmTcConfigDs, + pEvent->data.pData->systemInterfaceStatusData.nSystemIf); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return nErrCode; +} +#endif /* INCLUDE_DSL_SYSTEM_INTERFACE*/ + +#ifdef INCLUDE_DSL_G997_ALARM +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_I_DataPathFailuresHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nChannel=%d nAccessDir=%s nDataPathFailures=%08X" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->dataPathFailuresData.nDataPathFailures); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nChannel=%d nAccessDir=%s nDataPathFailures=%08X" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->dataPathFailuresData.nDataPathFailures); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ + +#ifdef INCLUDE_DSL_G997_ALARM +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_I_LineFailuresHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nChannel=%d nAccessDir=%s nLineFailures=%08X" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->lineFailuresData.nLineFailures); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nChannel=%d nAccessDir=%s nLineFailures=%08X" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->lineFailuresData.nLineFailures); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_ChannelDataRateHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ +#ifdef INCLUDE_SCRIPT_NOTIFICATION + DSL_char_t sVarName[20]; + DSL_char_t sVarVal[11]; + DSL_char_t buff[5]; +#endif + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + if (g_sRcScript != DSL_NULL) + { + if (DSL_CPE_SetEnv("DSL_NOTIFICATION_TYPE", + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? + "DSL_DATARATE_STATUS_DS" : "DSL_DATARATE_STATUS_US") == DSL_SUCCESS) + { + if (DSL_CPE_DSL_ENTITIES > 1) + { + snprintf(buff, sizeof(buff), "%u", nDevice); + DSL_CPE_SetEnv("DSL_LINE_NUMBER", buff); + } + snprintf(sVarName, sizeof(sVarName), "DSL_DATARATE_%s_BC%d", + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DS" : "US", + pEvent->data.nChannel == 0 ? 0 : pEvent->data.nChannel == 1 ? 1 : 0); + snprintf(sVarVal, sizeof(sVarVal), "%lu", (unsigned long)pEvent->data.pData->channelStatusData.ActualDataRate); + + if (DSL_CPE_SetEnv(sVarName, sVarVal) == DSL_SUCCESS) + { + DSL_CPE_ScriptRun(); + } + } + } +#endif + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nChannel=%d nAccessDir=%s ActualDataRate=%d PreviousDataRate=%d " + "ActualInterleaveDelay=%d ActualImpulseNoiseProtection=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->channelStatusData.ActualDataRate, + pEvent->data.pData->channelStatusData.PreviousDataRate, + pEvent->data.pData->channelStatusData.ActualInterleaveDelay, + pEvent->data.pData->channelStatusData.ActualImpulseNoiseProtection); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nChannel=%d nAccessDir=%s ActualDataRate=%d PreviousDataRate=%d " + "ActualInterleaveDelay=%d ActualImpulseNoiseProtection=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->channelStatusData.ActualDataRate, + pEvent->data.pData->channelStatusData.PreviousDataRate, + pEvent->data.pData->channelStatusData.ActualInterleaveDelay, + pEvent->data.pData->channelStatusData.ActualImpulseNoiseProtection); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} + +#ifdef INCLUDE_DSL_G997_ALARM +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_ChannelDataRateShiftThresholdCrossingHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL || pContext == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nChannel=%d nAccessDir=%s" + " nDataRateThresholdType=DSL_G997_DATARATE_THRESHOLD_%sSHIFT" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->dataRateThresholdCrossing.nDataRateThresholdType == + DSL_G997_DATARATE_THRESHOLD_DOWNSHIFT ? "DOWN": "UP"); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nChannel=%d nAccessDir=%s" + " nDataRateThresholdType=DSL_G997_DATARATE_THRESHOLD_%sSHIFT" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nAccessDir == DSL_DOWNSTREAM ? "DSL_DOWNSTREAM" : "DSL_UPSTREAM", + pEvent->data.pData->dataRateThresholdCrossing.nDataRateThresholdType == + DSL_G997_DATARATE_THRESHOLD_DOWNSHIFT ? "DOWN": "UP"); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ + +#ifdef INCLUDE_DSL_G997_ALARM +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_LinitFailureHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_char_t *pStatus = DSL_NULL; + DSL_char_t *pSubStatus = DSL_NULL; +#endif + + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + switch( pEvent->data.pData->lineInitStatusData.nLineInitStatus ) + { + case LINIT_SUCCESSFUL: + pStatus = "LINIT_SUCCESSFUL"; + break; + case LINIT_CONFIG_ERROR: + pStatus = "LINIT_CONFIG_ERROR"; + break; + case LINIT_CONFIG_NOT_FEASIBLE: + pStatus = "LINIT_CONFIG_NOT_FEASIBLE"; + break; + case LINIT_COMMUNICATION_PROBLEM: + pStatus = "LINIT_COMMUNICATION_PROBLEM"; + break; + case LINIT_NO_PEER_XTU: + pStatus = "LINIT_NO_PEER_XTU"; + break; + case LINIT_UNKNOWN: + pStatus = "LINIT_UNKNOWN"; + break; + + default: + pStatus = "LINIT_UNKNOWN"; + break; + } + + switch( pEvent->data.pData->lineInitStatusData.nLineInitSubStatus ) + { + case LINIT_SUB_NONE: + pSubStatus = "LINIT_SUB_NONE"; + break; + case LINIT_SUB_NO_COMMON_MODE: + pSubStatus = "LINIT_SUB_NO_COMMON_MODE"; + break; + case LINIT_SUB_OPP_MODE: + pSubStatus = "LINIT_SUB_OPP_MODE"; + break; + case LINIT_SUB_FW_RETRY: + pSubStatus = "LINIT_SUB_FW_RETRY"; + break; + case LINIT_SUB_FW_HYBRID: + pSubStatus = "LINIT_SUB_FW_HYBRID"; + printf(DSL_CPE_PREFIX "Wrong combination of DSL PHY Firmware and hybrid " + "type used! Please change one of it." DSL_CPE_CRLF); +#if defined(DSL_VRX_DEVICE_VR10) || defined(DSL_VRX_DEVICE_VR10_320) + printf(DSL_CPE_PREFIX "Workaround for DSLCPE_SW-995: performing full Firmware " + "download for device %d." DSL_CPE_CRLF, nDevice); + pContext->bForceFirmwareDownload[nDevice] = DSL_TRUE; + DSL_CPE_DownloadFirmware(pContext->fd[nDevice], nDevice, + DSL_FW_REQUEST_XDSL, DSL_PORT_MODE_NA, DSL_NULL, DSL_NULL); +#endif + break; + case LINIT_SUB_PORT_MODE: + pSubStatus = "LINIT_SUB_PORT_MODE"; + break; + case LINIT_SUB_S_PP_DRIVER: + pSubStatus = "LINIT_SUB_S_PP_DRIVER"; + break; + case LINIT_SUB_S_INTENDED_LOCAL_SHUTDOWN: + pSubStatus = "LINIT_SUB_S_INTENDED_LOCAL_SHUTDOWN"; + break; + case LINIT_SUB_TIMEOUT: + pSubStatus = "LINIT_SUB_TIMEOUT"; + break; + case LINIT_SUB_FAST_LOS: + pSubStatus = "LINIT_SUB_FAST_LOS"; + break; +#if defined(DSL_VRX_DEVICE_VR11) + case LINIT_SUB_S_PP_CLOCK_NEW: + pSubStatus = "LINIT_SUB_S_PP_CLOCK_NEW"; + break; + case LINIT_SUB_S_PP_ERB_INIT: + pSubStatus = "LINIT_SUB_S_PP_ERB_INIT"; + break; +#endif /* defined(DSL_VRX_DEVICE_VR11) */ + default: + pSubStatus = "LINIT_SUB_UNKNOWN"; + break; + } + + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nLineInitStatus=%s nLineInitSubStatus=%s" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), pStatus, pSubStatus); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nLineInitStatus=%s nLineInitSubStatus=%s" + DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), nDevice, pStatus, + pSubStatus); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /* INCLUDE_DSL_G997_ALARM*/ + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_FirmwareRequestHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t fd, + DSL_int_t nDevice, + DSL_EventType_t nEvent, + DSL_FirmwareRequestType_t nFwReqType, + DSL_PortMode_t nPortMode) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_uint32_t nFwLoadRetryCnt = 0; + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_char_t *pFwReqType = "DSL_FW_REQUEST_NA"; + DSL_char_t *pPortMode = "DSL_PORT_MODE_NA"; + + switch (nFwReqType) + { + case DSL_FW_REQUEST_ADSL: + pFwReqType = "DSL_FW_REQUEST_ADSL"; + break; + case DSL_FW_REQUEST_VDSL: + pFwReqType = "DSL_FW_REQUEST_VDSL"; + break; + case DSL_FW_REQUEST_XDSL: + pFwReqType = "DSL_FW_REQUEST_XDSL"; + break; + case DSL_FW_REQUEST_NA: + default: + pFwReqType = "DSL_FW_REQUEST_NA"; + break; + } + switch (nPortMode) + { + case DSL_PORT_MODE_SINGLE: + pPortMode = "DSL_PORT_MODE_SINGLE"; + break; + case DSL_PORT_MODE_DUAL: + pPortMode = "DSL_PORT_MODE_DUAL"; + break; + default: + break; + } + + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "sEventType=%s nFirmwareRequestType=%s nPortMode=%s"DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&nEvent), pFwReqType, pPortMode); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "sEventType=%s nDevice=%d nFirmwareRequestType=%s nPortMode=%s" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&nEvent), nDevice, pFwReqType, pPortMode); + } + +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + if (DSL_CPE_LINES_PER_DEVICE == 2) + { + nRet = DSL_CPE_BND_SyncDownloadFirmware(pContext->pBnd, nDevice, nFwReqType, nPortMode); + } + else + { + /* Try to reload FW several times in case of any fail*/ + for (nFwLoadRetryCnt = 0; nFwLoadRetryCnt < DSL_CPE_MAX_FW_RELOAD_RETRY_COUNT; nFwLoadRetryCnt++) + { + nRet = DSL_CPE_DownloadFirmware(fd, nDevice, nFwReqType, nPortMode, DSL_NULL, DSL_NULL); + + if (nRet >= DSL_SUCCESS) + { + break; + } + } + } + if (nRet != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - FW download failed on the %d retry!"DSL_CPE_CRLF, + DSL_CPE_MAX_FW_RELOAD_RETRY_COUNT)); + } + + return 0; +} + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_FirmwareDownloadStatusHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventType_t nEvent, + DSL_FwDownloadStatusData_t nFwDwnlStatus) +{ +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "sEventType=%s nError=%d nFwType=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&nEvent), + nFwDwnlStatus.nError, + nFwDwnlStatus.nFwModeStatus); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "sEventType=%s nDevice=%d nError=%d nFwType=%d" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&nEvent), + nDevice, + nFwDwnlStatus.nError, + nFwDwnlStatus.nFwModeStatus); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + if (nFwDwnlStatus.nError == DSL_FW_LOAD_SUCCESS) + { + pContext->nFwModeStatus = nFwDwnlStatus.nFwModeStatus; + } + else + { + pContext->nFwModeStatus = DSL_FW_REQUEST_NA; + } +#endif + + return 0; +} + +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_FeInventoryAvailableHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t fd, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + DSL_G997_LineInventory_t lineInventory; +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_char_t buf[256]; +#endif + DSL_int_t ret = 0; + + if( pEvent == DSL_NULL ) + { + return DSL_ERROR; + } + + memset(&lineInventory, 0x00, sizeof(DSL_G997_LineInventory_t)); + /* Specify direction */ + lineInventory.nDirection = DSL_FAR_END; + ret = DSL_CPE_Ioctl(fd, DSL_FIO_G997_LINE_INVENTORY_GET, + (DSL_int_t) &lineInventory); + + if( ret < 0 ) + { + if (lineInventory.accessCtl.nReturn < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "FE line inventory get failed!, ret = %d!"DSL_CPE_CRLF, + lineInventory.accessCtl.nReturn)); + return -1; + } + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "sEventType=%s ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType))); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "sEventType=%s nDevice=%d ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), nDevice); + } + + DSL_CPE_ArraySPrintF(buf, lineInventory.data.G994VendorID, + sizeof(lineInventory.data.G994VendorID), + sizeof(lineInventory.data.G994VendorID[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%sG994VendorID=%s ", + CLI_EventText, buf); + + DSL_CPE_ArraySPrintF(buf, lineInventory.data.SystemVendorID, + sizeof(lineInventory.data.SystemVendorID), + sizeof(lineInventory.data.SystemVendorID[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%sSystemVendorID=%s ", + CLI_EventText, buf); + + DSL_CPE_ArraySPrintF(buf, lineInventory.data.VersionNumber, + sizeof(lineInventory.data.VersionNumber), + sizeof(lineInventory.data.VersionNumber[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%sVersionNumber=%s ", + CLI_EventText, buf); + + DSL_CPE_ArraySPrintF(buf, lineInventory.data.SerialNumber, + sizeof(lineInventory.data.SerialNumber), + sizeof(lineInventory.data.SerialNumber[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%sSerialNumber=%s ", + CLI_EventText, buf); + + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%sSelfTestResult=%u ", + CLI_EventText, lineInventory.data.SelfTestResult); + + DSL_CPE_ArraySPrintF(buf, lineInventory.data.XTSECapabilities, + sizeof(lineInventory.data.XTSECapabilities), + sizeof(lineInventory.data.XTSECapabilities[0]), + DSL_ARRAY_FORMAT_HEX); + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%sXTSECapabilities=%s ", + CLI_EventText, buf); + + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%s" DSL_CPE_CRLF, CLI_EventText); +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_FeTestParamsAvailableHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t fd, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + DSL_int_t ret = 0; + + if( pEvent == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s "DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType))); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d "DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), nDevice); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return ret; +} + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_LinePowerMgmtStateHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_char_t *pStatus = DSL_NULL; +#endif + + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL || pContext == DSL_NULL) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + switch(pEvent->data.pData->powerMgmtStatusData.nPowerManagementStatus) + { + case DSL_G997_PMS_L0: + pStatus = "DSL_G997_PMS_L0"; + break; + case DSL_G997_PMS_L1: + pStatus = "DSL_G997_PMS_L1"; + break; + case DSL_G997_PMS_L2: + pStatus = "DSL_G997_PMS_L2"; + break; + case DSL_G997_PMS_L3: + pStatus = "DSL_G997_PMS_L3"; + break; + + default: + pStatus = "DSL_G997_PMS_NA"; + break; + } + + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nPowerManagementStatus=%s" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), pStatus); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d nPowerManagementStatus=%s" DSL_CPE_CRLF, + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), nDevice, pStatus); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} + +#if defined(INCLUDE_DSL_CEOC) +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S_SnmpMessageAvailableHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pContext == DSL_NULL) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType))); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), nDevice); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif + +#if defined(INCLUDE_DSL_PM) +#if defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS) +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_I_ChannelThresholdCrossingHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL || pContext == DSL_NULL) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->channelThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->channelThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->channelThresholdCrossing.n15Min, + pEvent->data.pData->channelThresholdCrossing.n1Day); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nDevice=%d " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->channelThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->channelThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->channelThresholdCrossing.n15Min, + pEvent->data.pData->channelThresholdCrossing.n1Day); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /** #if defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS)*/ + +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_I_LineThresholdCrossingHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->lineThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->lineThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->lineThresholdCrossing.n15Min, + pEvent->data.pData->lineThresholdCrossing.n1Day); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nDevice=%d " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->lineThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->lineThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->lineThresholdCrossing.n15Min, + pEvent->data.pData->lineThresholdCrossing.n1Day); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} + +#if defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS) +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_I_DataPathThresholdCrossingHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->dataPathThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->dataPathThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->dataPathThresholdCrossing.n15Min, + pEvent->data.pData->dataPathThresholdCrossing.n1Day); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nDevice=%d " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->dataPathThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->dataPathThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->dataPathThresholdCrossing.n15Min, + pEvent->data.pData->dataPathThresholdCrossing.n1Day); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /** #if defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS)*/ + +#if defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS) +DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_I_ReTxThresholdCrossingHandle( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_EventStatus_t *pEvent) +{ + if( pEvent == DSL_NULL || pEvent->data.pData == DSL_NULL ) + { + return DSL_ERROR; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->reTxThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->reTxThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->reTxThresholdCrossing.n15Min, + pEvent->data.pData->reTxThresholdCrossing.n1Day); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s " + "nDevice=%d " + "nChannel=%d " + "nATUDir=%s " + "nCurr15MinTime=%d " + "nCurr1DayTime=%d " + "n15Min=0x%08X " + "n1day=0x%08X ", + DSL_CPE_Event_Type2String(&(pEvent->data.nEventType)), + nDevice, + pEvent->data.nChannel, + pEvent->data.nXtuDir == DSL_NEAR_END ? "DSL_NEAR_END" : "DSL_FAR_END", + pEvent->data.pData->reTxThresholdCrossing.nCurr15MinTime, + pEvent->data.pData->reTxThresholdCrossing.nCurr1DayTime, + pEvent->data.pData->reTxThresholdCrossing.n15Min, + pEvent->data.pData->reTxThresholdCrossing.n1Day); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + return 0; +} +#endif /** #if defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS)*/ + +#endif /** #if defined(INCLUDE_DSL_PM)*/ + +DSL_int_t DSL_CPE_EventHandler (DSL_CPE_Thread_Params_t *param) +{ + DSL_CPE_Control_Context_t *pContext; +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_TRACE_BUFFER + DSL_CPE_File_t *file = DSL_NULL; +#endif /* INCLUDE_DSL_CPE_TRACE_BUFFER*/ +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT */ + +#ifndef INCLUDE_DSL_EVENT_POLLING +#if !defined(RTEMS) && !defined(WIN32) + DSL_int_t sretval; +#endif + DSL_CPE_fd_set_t rd_fds; /* File descr. sets for use with select() */ +#endif /* #ifndef INCLUDE_DSL_EVENT_POLLING*/ + + DSL_int_t ret, nDevice = 0; + DSL_int_t fd; + DSL_EventStatus_t event; +#ifdef INCLUDE_DSL_CPE_TRACE_BUFFER + DSL_ShowtimeLogging_t showtimeLogging; + DSL_uint16_t showtimeData[120]; +#endif /* INCLUDE_DSL_CPE_TRACE_BUFFER*/ +#if (defined (INCLUDE_DSL_CPE_CLI_SUPPORT) || defined (INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT)) && \ + defined(INCLUDE_DSL_CPE_TRACE_BUFFER) + DSL_int_t i; +#endif + +/* DSL_EventData_Union_t eventData;*/ + + pContext = (DSL_CPE_Control_Context_t *) param->nArg1; + if (pContext == DSL_NULL) + { + return DSL_ERROR; + } + + /* + The main fd read cycle starts here. + */ + pContext->bEvtRun = DSL_TRUE; + for (;;) + { + if (pContext->bRun == DSL_FALSE || pContext->bEvtRun == DSL_FALSE) + { + break; + } + +#ifdef INCLUDE_DSL_EVENT_POLLING + DSL_CPE_MSecSleep(1000); +#else +#if !defined(RTEMS) && !defined(WIN32) + FD_ZERO (&rd_fds); + + if (pContext->bBackwardCompMode) + { + DSL_CPE_FD_SET (pContext->fd[pContext->nDevNum], &rd_fds); + } + else + { + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + DSL_CPE_FD_SET (pContext->fd[nDevice], &rd_fds); + } + } + + sretval = DSL_CPE_Select (DSL_FD_SETSIZE, &rd_fds, NULL, DSL_DEV_TIMEOUT_SELECT); + + /* error or timeout on select */ + if (sretval <= 0) + { + continue; + } +#else + #if defined(RTEMS) + sretval = DSL_CPE_Select (gv_drv_dsl_pOpenCtx->eventWaitQueue, DSL_DEV_TIMEOUT_SELECT); + + if (sretval != 0) + { + /* Timeout (or Error) */ + continue; + } + #endif /* defined(RTEMS)*/ + DSL_CPE_MSecSleep(100); + #if defined(WIN32) + #endif /* defined(WIN32)*/ +#endif /* !defined(RTEMS) && !defined(WIN32)*/ +#endif /* INCLUDE_DSL_EVENT_POLLING*/ + + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + +#if !defined(INCLUDE_DSL_EVENT_POLLING) + /* handles a normal wakeup of the select because data is avialble from + within the device driver */ + if (DSL_CPE_FD_ISSET (pContext->fd[nDevice], &rd_fds) == 0) + { + continue; + } +#endif /* !defined(RTEMS) && !defined(WIN32)*/ + fd = pContext->fd[nDevice]; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "EVENT from Device=%d..." DSL_CPE_CRLF, + nDevice)); + + /* get an event status */ + memset (&event, 0, sizeof (DSL_EventStatus_t)); + event.data.pData = (DSL_EventData_Union_t*)malloc(sizeof(DSL_EventData_Union_t)); + + if( event.data.pData == DSL_NULL ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX DSL_CPE_CRLF + "Can't allocate memory for event data!!!"DSL_CPE_CRLF)); + continue; + } + + /* Get Event Status*/ + ret = DSL_CPE_Ioctl (fd, DSL_FIO_EVENT_STATUS_GET, (DSL_int_t) & event); + + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX DSL_CPE_CRLF + "Could not get device driver event status, ret = %d!" DSL_CPE_CRLF, ret)); + if (event.data.pData != DSL_NULL) + { + free(event.data.pData); + } + continue; + } + + if (event.accessCtl.nReturn != DSL_SUCCESS) + { + if (event.accessCtl.nReturn < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX DSL_CPE_CRLF + "Error code was returned by driver IOCTL errCode= %d!" DSL_CPE_CRLF, + event.accessCtl.nReturn)); + } + + /* Check for the FIFO overflow condition*/ + if (event.accessCtl.nReturn == DSL_WRN_EVENT_FIFO_OVERFLOW) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX DSL_CPE_CRLF + "Event FIFO overflow occured!" DSL_CPE_CRLF)); + } + else + { + if (event.data.pData != DSL_NULL) + { + free(event.data.pData); + } + continue; + } + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + CLI_EventText[0] = '\0'; +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + switch (event.data.nEventType) + { + case DSL_EVENT_S_INIT_READY: + DSL_CPE_Event_S_InitReadyHandle(pContext, nDevice, &event); + break; +#ifdef INCLUDE_DSL_CPE_TRACE_BUFFER + case DSL_EVENT_S_SHOWTIME_LOGGING: +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->bBackwardCompMode) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s", + DSL_CPE_Event_Type2String(&(event.data.nEventType))); + } + else if (DSL_CPE_DSL_ENTITIES > 1) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), + "sEventType=%s nDevice=%d", + DSL_CPE_Event_Type2String(&(event.data.nEventType)), nDevice); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + memset (&showtimeLogging, 0, sizeof (DSL_ShowtimeLogging_t)); + memset (&showtimeData, 0, sizeof (showtimeData)); + showtimeLogging.data.nDataSize = sizeof (showtimeData); + showtimeLogging.data.pData = (DSL_uint8_t *) showtimeData; + + ret = + DSL_CPE_Ioctl (fd, DSL_FIO_SHOWTIME_LOGGING_DATA_GET, + (DSL_int_t) & showtimeLogging); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX DSL_CPE_CRLF + "Could not get showtime info, ret = %d!" DSL_CPE_CRLF, ret)); + break; /*continue;*/ /*KAv: 2009-10-27, This might cause a memory leakage*/ + } + + if (showtimeLogging.accessCtl.nReturn != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX DSL_CPE_CRLF + "Error code was returned by driver IOCTL while trying to get " + "showtimeLogging data, errCode = %d!" DSL_CPE_CRLF, + showtimeLogging.accessCtl.nReturn)); + break; /*continue;*/ /*KAv: 2009-10-27, This might cause a memory leakage*/ + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%s nData=\"", + CLI_EventText); + + for (i = 0; i < (DSL_int_t)(sizeof (showtimeData) / 2); i++) + { + if (i % 10 == 0) + { + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%s" DSL_CPE_CRLF, + CLI_EventText); + } + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%s0x%04X ", + CLI_EventText, showtimeData[i]); + } + DSL_CPE_snprintf(CLI_EventText, sizeof(CLI_EventText), "%s" DSL_CPE_CRLF "\"", + CLI_EventText); +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + file = DSL_CPE_FOpen(DSL_CPE_SHOWTIME_EVENT_LOGGING_FILENAME,"w"); + if (file == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX DSL_CPE_CRLF + "Could not open file (%s) for showtime event logging data!!!" + DSL_CPE_CRLF, DSL_CPE_SHOWTIME_EVENT_LOGGING_FILENAME)); + } + else + { + DSL_CPE_FPrintf(file, "showtime event logging data:"); + for (i = 0; i < (DSL_int_t)(sizeof (showtimeData) / 2); i++) + { + if (i % 10 == 0) DSL_CPE_FPrintf (file, DSL_CPE_CRLF); + DSL_CPE_FPrintf (file, "0x%04X ", showtimeData[i]); + } + DSL_CPE_FPrintf (file, DSL_CPE_CRLF DSL_CPE_CRLF); + + DSL_CPE_FClose(file); + } +#endif + break; +#endif /* INCLUDE_DSL_CPE_TRACE_BUFFER*/ + case DSL_EVENT_S_FIRMWARE_REQUEST: + DSL_CPE_Event_S_FirmwareRequestHandle( + pContext, fd, nDevice, + event.data.nEventType, + event.data.pData->fwRequestData.nFirmwareRequestType, + event.data.pData->fwRequestData.nPortMode); + break; + case DSL_EVENT_S_FIRMWARE_DOWNLOAD_STATUS: + DSL_CPE_Event_S_FirmwareDownloadStatusHandle( + pContext, nDevice, + event.data.nEventType, + event.data.pData->fwDownloadStatus); + break; +#ifdef INCLUDE_DSL_G997_ALARM + case DSL_EVENT_I_DATA_PATH_FAILURES: + DSL_CPE_Event_I_DataPathFailuresHandle(pContext, nDevice, &event); + break; + case DSL_EVENT_I_LINE_FAILURES: + DSL_CPE_Event_I_LineFailuresHandle(pContext, nDevice, &event); + break; +#endif /* INCLUDE_DSL_G997_ALARM*/ + case DSL_EVENT_S_LINE_STATE: + DSL_CPE_Event_S_LineStateHandle(pContext, nDevice, &event); + break; +#ifdef INCLUDE_DSL_PM +#ifdef INCLUDE_DSL_CPE_PM_HISTORY + case DSL_EVENT_S_PM_SYNC: + DSL_CPE_Event_S_PmSyncHandle(pContext, nDevice, &event); + break; +#endif /* INCLUDE_DSL_CPE_PM_HISTORY*/ +#endif /* INCLUDE_DSL_PM*/ + case DSL_EVENT_S_AUTOBOOT_STATUS: + DSL_CPE_Event_S_AutobootStatusHandle(pContext, fd, nDevice, &event); + break; +#ifdef INCLUDE_DSL_SYSTEM_INTERFACE + case DSL_EVENT_S_SYSTEM_INTERFACE_STATUS: + DSL_CPE_Event_S_SystemInterfaceStatusHandle(pContext, fd, nDevice, &event); + break; +#endif /* INCLUDE_DSL_SYSTEM_INTERFACE*/ + case DSL_EVENT_S_CHANNEL_DATARATE: + DSL_CPE_Event_S_ChannelDataRateHandle(pContext, nDevice, &event); + break; +#ifdef INCLUDE_DSL_G997_ALARM + case DSL_EVENT_I_CHANNEL_DATARATE_SHIFT_THRESHOLD_CROSSING: + DSL_CPE_Event_S_ChannelDataRateShiftThresholdCrossingHandle(pContext, nDevice, &event); + break; +#endif /* INCLUDE_DSL_G997_ALARM*/ +#ifdef INCLUDE_DSL_G997_ALARM + case DSL_EVENT_S_LINIT_FAILURE: + DSL_CPE_Event_S_LinitFailureHandle(pContext, nDevice, &event); + break; +#endif /* INCLUDE_DSL_G997_ALARM*/ +#ifdef INCLUDE_DSL_G997_LINE_INVENTORY + case DSL_EVENT_S_FE_INVENTORY_AVAILABLE: + DSL_CPE_Event_S_FeInventoryAvailableHandle(pContext, fd, nDevice, &event); + break; +#endif /* INCLUDE_DSL_G997_LINE_INVENTORY*/ + case DSL_EVENT_S_FE_TESTPARAMS_AVAILABLE: + DSL_CPE_Event_S_FeTestParamsAvailableHandle(pContext, fd, nDevice, &event); + break; + case DSL_EVENT_S_LINE_POWERMANAGEMENT_STATE: + DSL_CPE_Event_S_LinePowerMgmtStateHandle(pContext, nDevice, &event); + break; +#if defined(INCLUDE_DSL_CEOC) + case DSL_EVENT_S_SNMP_MESSAGE_AVAILABLE: + DSL_CPE_Event_S_SnmpMessageAvailableHandle(pContext, nDevice, &event); + break; +#endif +#if defined(INCLUDE_DSL_PM) + #if defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS) + case DSL_EVENT_I_CHANNEL_THRESHOLD_CROSSING: + DSL_CPE_Event_I_ChannelThresholdCrossingHandle(pContext, nDevice, &event); + break; + #endif /** #if defined(INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS)*/ + case DSL_EVENT_I_LINE_THRESHOLD_CROSSING: + DSL_CPE_Event_I_LineThresholdCrossingHandle(pContext, nDevice, &event); + break; + #if defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS) + case DSL_EVENT_I_DATA_PATH_THRESHOLD_CROSSING: + DSL_CPE_Event_I_DataPathThresholdCrossingHandle(pContext, nDevice, &event); + break; + #endif /** #if defined(INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS)*/ + #if defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS) + case DSL_EVENT_I_RETX_THRESHOLD_CROSSING: + DSL_CPE_Event_I_ReTxThresholdCrossingHandle(pContext, nDevice, &event); + break; + #endif /** #if defined(INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS)*/ +#endif /** #if defined(INCLUDE_DSL_PM)*/ +#ifdef INCLUDE_REAL_TIME_TRACE + case DSL_EVENT_S_RTT_STATUS: + /*TBD:*/ + break; +#endif /*#ifdef INCLUDE_REAL_TIME_TRACE*/ + default: + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX DSL_CPE_CRLF + "unhandled event with type: %d" DSL_CPE_CRLF, event.data.nEventType)); + break; + } + + if (event.data.pData != DSL_NULL) + { + free(event.data.pData); + } +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + /* Do not handle if not string id given */ + if (CLI_EventText[0] != '\0') + { + DSL_CPE_CLI_HandleEvent(CLI_EventText); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + } + } /* for */ + + printf ("EventHandler: exit(0)\n"); + return 0; +} + +/** + Start Event handler thread +*/ +DSL_Error_t DSL_CPE_EventHandlerStart ( + DSL_CPE_Control_Context_t * pContext +) +{ + if (DSL_CPE_ThreadInit (&pContext->EventControl, "evnthnd", + DSL_CPE_EventHandler, DSL_CPE_EVENT_STACKSIZE, DSL_CPE_PRIORITY, + (DSL_uint32_t) pContext, 0) == 0) + { + return DSL_SUCCESS; + } + + printf ("Event thread start error\n"); + + return DSL_ERROR; +} + +static DSL_Error_t DSL_CPE_WhatStringGet( + DSL_CPE_Control_Context_t *pContext, + DSL_char_t *psFirmwareName, + const DSL_uint32_t nMaxStringLength, + DSL_char_t *pString, + DSL_uint8_t nStringKey, + DSL_uint8_t nStringNumber) +{ + DSL_Error_t errorCode = DSL_SUCCESS; + DSL_uint32_t i = 0; + DSL_uint32_t str_len = nMaxStringLength - 1; + DSL_uint8_t *ptr = DSL_NULL, *pChunk = DSL_NULL; + DSL_uint32_t rd_sz, bin_len; + DSL_boolean_t bFound = DSL_FALSE, bEnd = DSL_FALSE; + DSL_uint8_t nStrCnt; +#ifndef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + DSL_CPE_File_t *fd_image = DSL_NULL; + DSL_CPE_stat_t file_stat; + DSL_uint32_t chunkSz = 0, seek = 0; +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ + + if((psFirmwareName == DSL_NULL) || (pString == DSL_NULL) || (nMaxStringLength < 2)) + { + return DSL_ERROR; + } + + if (nStringNumber == 0) + { + return DSL_ERROR; + } + + nStrCnt = nStringNumber - 1; + +#ifdef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + bin_len = FIRMWARE_SIZE; + rd_sz = bin_len - 4; + + if (bin_len < 4) + { + return DSL_ERROR; + } + + ptr = cgi_pFileData_modemfw_bin; +#else + fd_image = DSL_CPE_FOpen (psFirmwareName, "rb"); + if (fd_image == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "open %s fail" DSL_CPE_CRLF, psFirmwareName)); + return DSL_ERROR; + } + + DSL_CPE_FStat (psFirmwareName, &file_stat); + + bin_len = file_stat.st_size; + chunkSz = bin_len > WHAT_STRING_CHUNK_LEN ? WHAT_STRING_CHUNK_LEN : bin_len; + rd_sz = chunkSz - 4; + + if (bin_len < 4) + { + DSL_CPE_FClose (fd_image); + return DSL_ERROR; + } + + pChunk = DSL_CPE_Malloc((DSL_uint32_t)chunkSz); + if (pChunk == DSL_NULL) + { + DSL_CPE_FClose (fd_image); + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Memory allocation failed for WHAT string chunk!" + DSL_CPE_CRLF)); + return DSL_ERROR; + } +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE */ + + while (bin_len > 4) + { +#ifndef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + if (DSL_CPE_FRead (pChunk, sizeof (DSL_uint8_t), chunkSz, fd_image) <= 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "read %s failed!"DSL_CPE_CRLF, psFirmwareName)); + errorCode = DSL_ERROR; + break; + } + ptr = pChunk; +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ + + while(rd_sz) + { + if(*ptr == '@' && !bFound) + { + if (ptr[1] == '(' && ptr[2] == nStringKey && ptr[3] == ')') + { + if (nStrCnt == 0) + { + bFound = DSL_TRUE; + #ifndef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + break; + #endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ + } + else + { + nStrCnt = nStrCnt ? nStrCnt - 1 : 0; + } + } + } + + if (bFound) + { + ptr += 4; + rd_sz -= 4; + + /* found what string */ + while(str_len && *ptr && (rd_sz)) + { + if(*ptr != ' ') + { + pString[i++] = *ptr; + str_len--; + } + + ptr++; + rd_sz--; + } + + bEnd = DSL_TRUE; + break; + } + + ptr++; + rd_sz--; + bin_len--; + } + + if (bEnd) + { + break; + } + +#ifndef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + seek += (chunkSz - rd_sz - 4); + if (fseek(fd_image, seek, SEEK_SET)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "fseek %s fail" DSL_CPE_CRLF, psFirmwareName)); + errorCode = DSL_ERROR; + break; + } + + chunkSz = bin_len > DSL_CPE_FW_CHUNK_SIZE ? DSL_CPE_FW_CHUNK_SIZE : bin_len; + + if (chunkSz <= 4) + { + break; + } + + rd_sz = chunkSz - 4; +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ + } + + pString[i] = 0; + + if(i) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX"Firmware WHAT String%d (%c): %s"DSL_CPE_CRLF, + nStringNumber, nStringKey, pString)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX"Firmware WHAT String%d (%c): not detected"DSL_CPE_CRLF, + nStringNumber, nStringKey)); + } + +#ifndef INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + /* Close FW binary*/ + if (fd_image != DSL_NULL) + { + DSL_CPE_FClose (fd_image); + } + + /* Free Chunk data*/ + if (pChunk != DSL_NULL) + { + DSL_CPE_Free(pChunk); + } +#endif /* INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE*/ + + return errorCode; +} + +DSL_CPE_STATIC DSL_Error_t DSL_CPE_FwInfoFromWhatstringGet( + DSL_char_t *pWhatString, + DSL_int_t *pFwApplication, + DSL_uint8_t *nPlatformId) +{ + DSL_Error_t errorCode = DSL_SUCCESS; + DSL_char_t *pWhat = DSL_NULL; + DSL_uint32_t i, nValue = 0; + + if (!pWhatString || !pFwApplication) + { + return DSL_ERROR; + } + + /* Set undefined FW application type*/ + *pFwApplication = -1; + + pWhat = pWhatString; + + for (i=0; i<6; i++) + { + if (*pWhat == '\0') + { + break; + } + + /* expect a hex value */ + nValue = strtoul(pWhat, &pWhat, 16); + + if (i == 0) + { + *nPlatformId = (DSL_uint8_t) nValue; + } + + /* step to the next position after a '.' */ + pWhat = strpbrk(pWhat, "."); + pWhat++; + } + + if (i == 6) + { + *pFwApplication = nValue; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX"Firmware AppType: %d"DSL_CPE_CRLF, *pFwApplication)); + + return(errorCode); +} + +static DSL_Error_t DSL_CPE_FwFeatureSetFromWhatstringGet( + DSL_char_t *pWhatString, + DSL_uint32_t *pFwFeatures) +{ + DSL_Error_t errorCode = DSL_SUCCESS; + DSL_char_t *pWhat = DSL_NULL; + DSL_uint32_t nValue = 0; + + if (!pWhatString || !pFwFeatures) + { + return DSL_ERROR; + } + + /* Set empty FW feature set */ + *pFwFeatures = 0; + + /* Skip first char */ + pWhat = pWhatString + 1; + + /* expect a hex value */ + nValue = strtoul(pWhat, &pWhat, 16); + + *pFwFeatures = nValue; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX"Firmware FwFeatures: 0x%x"DSL_CPE_CRLF, *pFwFeatures)); + + return(errorCode); +} + +DSL_Error_t DSL_CPE_FwFeaturesGet( + DSL_char_t *pcFw, + DSL_FirmwareFeatures_t *pFwFeatures) +{ + DSL_char_t sWhatString[MAX_WHAT_STRING_LEN] = {0}; + /* Only one ID is needed because the platform is expected to be the same in + case there are multiple firmware what strings included within one firmware + binary. */ + DSL_uint8_t nPlatformId = 0; + DSL_int_t FwApplication1 = -1; +#if defined (INCLUDE_DSL_CPE_API_VRX) + DSL_int_t FwApplication2 = -1; +#endif + DSL_CPE_Control_Context_t *pCtrlCtx = DSL_NULL; + DSL_Error_t errorCode = DSL_SUCCESS; + DSL_uint32_t nFeatureSet = 0; + + pCtrlCtx = DSL_CPE_GetGlobalContext(); + + if (pCtrlCtx == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Invalid context pointer!" DSL_CPE_CRLF)); + return DSL_ERROR; + } + + if(pcFw == DSL_NULL) + { + return DSL_ERROR; + } + + /* + Initialize return value with empty feature definition. If this value will + be returned it indicates that NO what string was found within firmware + binaries */ + memset(pFwFeatures, 0, sizeof(DSL_FirmwareFeatures_t)); + + /* Get 1st What String*/ + DSL_CPE_WhatStringGet(pCtrlCtx, pcFw, MAX_WHAT_STRING_LEN, sWhatString, '#', 1); + + /* Get FW application type*/ + DSL_CPE_FwInfoFromWhatstringGet(sWhatString, &FwApplication1, + &nPlatformId); + +#if defined (INCLUDE_DSL_CPE_API_VRX) + memset(sWhatString, 0x0, MAX_WHAT_STRING_LEN); + + /* Get 2nd What String*/ + DSL_CPE_WhatStringGet(pCtrlCtx, pcFw, MAX_WHAT_STRING_LEN, sWhatString, '#', 2); + + /* Get FW application type*/ + DSL_CPE_FwInfoFromWhatstringGet(sWhatString, &FwApplication2, + &nPlatformId); +#endif /* #if defined (INCLUDE_DSL_CPE_API_VRX)*/ + + pFwFeatures->nPlatformId = nPlatformId; + + /* Check for Annex A (default) mode*/ +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + if ((FwApplication1 == -1) || (FwApplication1 == 1)) +#elif defined (INCLUDE_DSL_CPE_API_VRX) + if ((FwApplication1 == 1) || (FwApplication2 == 1)) +#endif /* defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_ADSL_A; + } +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + else if ((FwApplication1 == 2) || (FwApplication1 == 0)) +#elif defined (INCLUDE_DSL_CPE_API_VRX) + else if ((FwApplication1 == 0) || (FwApplication2 == 0) || + (FwApplication1 == 2) || (FwApplication2 == 2)) +#endif /* defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_ADSL_B; + } + +#if defined (INCLUDE_DSL_CPE_API_VRX) + if ((g_bFirmware1 != -1) || (strlen(g_sFirmwareName1) > 0)) + { + /* Check for the VDSL FW capability */ + if ((FwApplication1 == 5) || (FwApplication2 == 5) || + (FwApplication1 == 6) || (FwApplication2 == 6)) + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_VDSL2; + } + + /* Check for the Vectoring FW capability */ + if ((FwApplication1 == 7) || (FwApplication2 == 7)) + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_VDSL2_VECTOR; + } + } +#endif /* defined (INCLUDE_DSL_CPE_API_VRX)*/ + + /* Get first feature set what string */ + memset(sWhatString, 0x0, MAX_WHAT_STRING_LEN); + DSL_CPE_WhatStringGet(pCtrlCtx, pcFw, MAX_WHAT_STRING_LEN, sWhatString, '~', 1); + + /* Get FW feature set */ + DSL_CPE_FwFeatureSetFromWhatstringGet(sWhatString, &nFeatureSet); + if (sWhatString[0] == 'A') + { + pFwFeatures->nFirmwareAdslFeatures = nFeatureSet; + } + else if (sWhatString[0] == 'V') + { + pFwFeatures->nFirmwareVdslFeatures = nFeatureSet; + } + +#if defined (INCLUDE_DSL_CPE_API_VRX) + memset(sWhatString, 0x0, MAX_WHAT_STRING_LEN); + + /* Get 2nd feature set what string */ + DSL_CPE_WhatStringGet(pCtrlCtx, pcFw, MAX_WHAT_STRING_LEN, sWhatString, '~', 2); + + /* Get FW feature set */ + DSL_CPE_FwFeatureSetFromWhatstringGet(sWhatString, &nFeatureSet); + if (sWhatString[0] == 'A') + { + pFwFeatures->nFirmwareAdslFeatures = nFeatureSet; + } + else if (sWhatString[0] == 'V') + { + pFwFeatures->nFirmwareVdslFeatures = nFeatureSet; + } +#endif /* #if defined (INCLUDE_DSL_CPE_API_VRX)*/ + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX"Firmware features (%s): 0x%x, set=[0x%x, 0x%x]"DSL_CPE_CRLF, pcFw, + pFwFeatures->nFirmwareXdslModes, pFwFeatures->nFirmwareAdslFeatures, + pFwFeatures->nFirmwareVdslFeatures)); + + return(errorCode); +} + +static DSL_Error_t DSL_CPE_SwVersionFromStringGet(DSL_char_t* pVerString, DSL_SwVersion_t* pVer) +{ + DSL_int_t nFields; + DSL_char_t *pPatchString, dummy; + + if (pVerString == DSL_NULL || pVer == DSL_NULL) + { + return DSL_ERROR; + } + + memset((void*)pVer,0,sizeof(DSL_SwVersion_t)); + + nFields = sscanf(pVerString,"%d.%d.%d.%d", &pVer->nMajor, &pVer->nMinor, &pVer->nDevelopment, + &pVer->nMaintenance); + + if (nFields < 3) + { + memset((void*)pVer,0xff,sizeof(DSL_SwVersion_t)); + return DSL_ERROR; + } + +#ifndef DISABLE_DSL_PATCH_VERSION + /* checking patch number*/ + pPatchString = strstr(pVerString,"-p"); + if (pPatchString != DSL_NULL) + { + sscanf(pPatchString,"-p%c%d",&dummy,&pVer->nPatch); + } +#endif /*#ifndef DISABLE_DSL_PATCH_VERSION*/ + + return DSL_SUCCESS; +} + +DSL_int32_t DSL_CPE_DeviceInit ( + DSL_CPE_Control_Context_t * pContext) +{ +#ifndef INCLUDE_FW_REQUEST_SUPPORT + DSL_Error_t nRet = DSL_SUCCESS; + DSL_uint8_t *pFirmware1 = DSL_NULL; + DSL_uint32_t nFirmwareSize1 = 0; + DSL_uint8_t *pFirmware2 = DSL_NULL; + DSL_uint32_t nFirmwareSize2 = 0; +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + DSL_int32_t ret = 0; + DSL_Init_t init; + DSL_G997_LineInventoryNeData_t inv; + DSL_FirmwareFeatures_t fwFeatures1 = {DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED, + DSL_FW_XDSLFEATURE_CLEANED}; + DSL_FirmwareFeatures_t fwFeatures2 = {DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED, + DSL_FW_XDSLFEATURE_CLEANED}; + DSL_int_t nDevice = 0; + const DSL_uint8_t G994VendorID[DSL_G997_LI_MAXLEN_VENDOR_ID] = {DSL_G994_VENDOR_ID}; + + memset (&init, 0x00, sizeof (DSL_Init_t)); + +#if defined(INCLUDE_DSL_CPE_API_VRX) + /** Just for debug purposes. Further all initialization should be done + in the gInitCfgData table*/ + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_DOWNSTREAM].MinDataRate = + 64000; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_UPSTREAM].MinDataRate = 64000; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_DOWNSTREAM].MaxDataRate = + 380000000; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_UPSTREAM].MaxDataRate = + 380000000; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_DOWNSTREAM].MaxIntDelay = 0; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_UPSTREAM].MaxIntDelay = 0; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_DOWNSTREAM].MinINP = 0; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_UPSTREAM].MinINP = 0; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_DOWNSTREAM].MaxBER = + DSL_G997_MAX_BER_7; + gInitCfgData.nDeviceCfg.ChannelConfigData[DSL_UPSTREAM].MaxBER = + DSL_G997_MAX_BER_7; + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_MULTIMODE + + gInitCfgData.nDeviceCfg.nMultimodeCfg.nNextMode = g_MultimodeFsmConfig.nNextMode; + gInitCfgData.nDeviceCfg.nActivationCfg.nActivationSequence = + g_ActivationFsmConfig.nActivationSequence; + gInitCfgData.nDeviceCfg.nActivationCfg.nActivationMode = + g_ActivationFsmConfig.nActivationMode; + gInitCfgData.nDeviceCfg.bRememberCfg = g_RememberFsmConfig; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Initial multimode settings: nNextMode=%d" DSL_CPE_CRLF, + gInitCfgData.nDeviceCfg.nMultimodeCfg.nNextMode)); + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP + +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + + /* Overwrite SystemInterfaceConfig if a valid configuration is given by the + user via -T option */ + if (g_sSysIfCfg[DSL_MODE_ADSL].nTcLayer != DSL_TC_UNKNOWN) + { + cpe_control_memcpy_s(&gInitCfgData.nDeviceCfg.sysCIF[DSL_MODE_ADSL], + sizeof(DSL_SystemInterfaceConfigData_t), + &g_sSysIfCfg[DSL_MODE_ADSL], + sizeof(g_sSysIfCfg[DSL_MODE_ADSL])); + } +#if defined(INCLUDE_DSL_CPE_API_VRX) + if (g_sSysIfCfg[DSL_MODE_VDSL].nTcLayer != DSL_TC_UNKNOWN) + { + cpe_control_memcpy_s(&gInitCfgData.nDeviceCfg.sysCIF[DSL_MODE_VDSL], + sizeof(DSL_SystemInterfaceConfigData_t), + &g_sSysIfCfg[DSL_MODE_VDSL], + sizeof(g_sSysIfCfg[DSL_MODE_VDSL])); + } +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + + /* Initialize device configuration as defined via gInitCfgData table */ + cpe_control_memcpy_s(&init.data, sizeof (DSL_InitData_t), + &gInitCfgData, sizeof(gInitCfgData)); + +#ifndef INCLUDE_FW_REQUEST_SUPPORT + if (bOptimize != 1) + { + /* Get Firmware binary 1 */ + if ((g_bFirmware1 != -1) || (strlen(g_sFirmwareName1) > 0)) + { + nRet = DSL_CPE_LoadFirmwareFromFile(g_sFirmwareName1, &pFirmware1, + &nFirmwareSize1); + if (nRet == DSL_SUCCESS) + { + if (pFirmware1 != DSL_NULL) + { + /* Assign FW binary*/ + init.data.pFirmware = pFirmware1; + init.data.nFirmwareSize = nFirmwareSize1; + DSL_CPE_FwFeaturesGet(g_sFirmwareName1, &fwFeatures1); + cpe_control_memcpy_s(&init.data.nFirmwareFeatures, sizeof(DSL_FirmwareFeatures_t), + &fwFeatures1, sizeof(fwFeatures1)); + } + } + } + + if (DSL_CPE_LINES_PER_DEVICE == 2) + { + /* Get Firmware binary 2 */ + if ((g_bFirmware2 != -1) || (strlen(g_sFirmwareName2))) + { + nRet = DSL_CPE_LoadFirmwareFromFile(g_sFirmwareName2, &pFirmware2, + &nFirmwareSize2); + if (nRet == DSL_SUCCESS) + { + if (pFirmware2 != DSL_NULL) + { + /* Assign FW binary*/ + init.data.pFirmware2 = pFirmware2; + init.data.nFirmwareSize2 = nFirmwareSize2; + DSL_CPE_FwFeaturesGet(g_sFirmwareName2, &fwFeatures2); + cpe_control_memcpy_s(&init.data.nFirmwareFeatures2, sizeof(DSL_FirmwareFeatures_t), + &fwFeatures2, sizeof(fwFeatures2)); + } + } + } + } + } +#endif /* INCLUDE_FW_REQUEST_SUPPORT */ + + /* Get 1st FW binary Information */ + if ((g_bFirmware1 != -1) || (strlen(g_sFirmwareName1) > 0)) + { + DSL_CPE_FwFeaturesGet(g_sFirmwareName1, &fwFeatures1); + } + cpe_control_memcpy_s(&init.data.nFirmwareFeatures, + sizeof(DSL_FirmwareFeatures_t), &fwFeatures1, sizeof(fwFeatures1)); + cpe_control_memcpy_s(&g_nFwFeatures1, sizeof(DSL_FirmwareFeatures_t), + &fwFeatures1, sizeof(fwFeatures1)); + + if (DSL_CPE_LINES_PER_DEVICE == 2) + { + /* Get 2nd FW binary Information */ + if ((g_bFirmware2 != -1) || (strlen(g_sFirmwareName2) > 0)) + { + DSL_CPE_FwFeaturesGet(g_sFirmwareName2, &fwFeatures2); + } + cpe_control_memcpy_s(&init.data.nFirmwareFeatures2, + sizeof(DSL_FirmwareFeatures_t), &fwFeatures2, sizeof(&fwFeatures2)); + cpe_control_memcpy_s(&g_nFwFeatures2, sizeof(DSL_FirmwareFeatures_t), + &fwFeatures2, sizeof(&fwFeatures2)); + } + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + if (gInitCfgData.nDeviceCfg.cfg.nHybrid == DSL_DEV_HYBRID_NA) + { + init.data.nDeviceCfg.cfg.nHybrid = + fwFeatures1.nFirmwareXdslModes == DSL_FW_XDSLMODE_ADSL_B ? + DSL_DEV_HYBRID_ANNEX_B_J : DSL_DEV_HYBRID_ANNEX_A; + } +#endif /* #if defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + + if (bXtuOctets == 1) + { + /* Use given XTU octets provided on init (-i) */ + cpe_control_memcpy_s(&init.data.nXtseCfg, sizeof(DSL_G997_XTUSystemEnablingData_t), + &g_nXtseInit, sizeof(g_nXtseInit)); + } + else + { + /* If no XTU octets are given on init (-i) use device specific default + configuration */ + memset (&init.data.nXtseCfg.XTSE, 0, sizeof(init.data.nXtseCfg.XTSE)); + + if (fwFeatures1.nFirmwareXdslModes == DSL_FW_XDSLMODE_CLEANED) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX "No valid WHAT strings detected, setting default " + "XTSE configuration" DSL_CPE_CRLF)); + /* Set all default modes*/ + init.data.nXtseCfg.XTSE[0] = 0x15; + init.data.nXtseCfg.XTSE[2] = 0x14; + init.data.nXtseCfg.XTSE[4] = 0xc; + init.data.nXtseCfg.XTSE[5] = 0x5; + init.data.nXtseCfg.XTSE[7] = 0x7; + } + else + { + /* Check for Annex A (default) mode */ + if (fwFeatures1.nFirmwareXdslModes & DSL_FW_XDSLMODE_ADSL_A) + { + init.data.nXtseCfg.XTSE[0] = 0x4; + init.data.nXtseCfg.XTSE[2] = 0x4; + init.data.nXtseCfg.XTSE[4] = 0xc; + init.data.nXtseCfg.XTSE[5] = 0x1; + } + else if (fwFeatures1.nFirmwareXdslModes & DSL_FW_XDSLMODE_ADSL_B) + { + init.data.nXtseCfg.XTSE[0] = 0x10; + init.data.nXtseCfg.XTSE[5] = 0x4; + init.data.nXtseCfg.XTSE[6] = 0x1; + } + + /* Check if the VDSL2 FW was specified */ + if ((fwFeatures1.nFirmwareXdslModes & DSL_FW_XDSLMODE_VDSL2) || + (fwFeatures1.nFirmwareXdslModes & DSL_FW_XDSLMODE_VDSL2_VECTOR)) + { + init.data.nXtseCfg.XTSE[7] = 0x7; + } + } + } + + memset(&inv,0x0, sizeof(DSL_G997_LineInventoryNeData_t )); +#if defined(INCLUDE_DSL_CPE_API_VRX) + cpe_control_memcpy_s(&inv.Auxiliary.pData, 8, "12344321", sizeof("12344321")); + inv.Auxiliary.nLength = 8; +#endif + /* $$ ND: this is for testing only --> */ + cpe_control_memcpy_s(&inv.SerialNumber, 32, + "01234567890123456789012345678901", sizeof("01234567890123456789012345678901")); + cpe_control_memcpy_s(&inv.SystemVendorID, 8, + G994VendorID, sizeof(G994VendorID)); + cpe_control_memcpy_s(&inv.VersionNumber, 16, + "0123456789012345", sizeof("0123456789012345")); + init.data.pInventory = &inv; + /* $$ <-- */ + + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + init.data.nAutobootConfig.nStateMachineOptions.bWaitBeforeLinkActivation = + g_bWaitBeforeLinkActivation[nDevice]; + + init.data.nAutobootConfig.nStateMachineOptions.bWaitBeforeConfigWrite = + g_bWaitBeforeConfigWrite[nDevice]; + + init.data.nAutobootConfig.nStateMachineOptions.bWaitBeforeRestart = + g_bWaitBeforeRestart[nDevice]; + + if (DSL_CPE_DEVICE_NUMBER == 2) + { + if (nDevice) + { + /*Slave*/ + init.data.nDeviceCfg.cfg.nBaseAddr = 0x18116000; + /* Set active polling mode for the MEI driver*/ + init.data.nDeviceCfg.cfg.nIrqNum = 0x63; + } + } + + /* Initialize device driver*/ + ret = DSL_CPE_Ioctl (pContext->fd[nDevice], DSL_FIO_INIT, (DSL_int_t) & init); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Device %d init failed!"DSL_CPE_CRLF, nDevice)); + break; + } + else if (init.accessCtl.nReturn == DSL_WRN_ALREADY_INITIALIZED) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX "Already initialized - " + "ignoring '-i' option!" DSL_CPE_CRLF)); + bInit = -1; + } +#ifndef INCLUDE_FW_REQUEST_SUPPORT + else + { + if (bOptimize == 1) + { + if ((g_bFirmware1 != -1) || (strlen(g_sFirmwareName1) > 0)) + { + ret = DSL_CPE_DownloadFirmware( + pContext->fd[nDevice], nDevice, DSL_FW_REQUEST_ADSL, + DSL_PORT_MODE_NA, g_sFirmwareName1, DSL_NULL); + } + } + } +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + } + +#ifndef INCLUDE_FW_REQUEST_SUPPORT + if (pFirmware1 != DSL_NULL) + { + DSL_CPE_Free (pFirmware1); + pFirmware1 = DSL_NULL; + nFirmwareSize1 = 0; + } + + if (pFirmware2 != DSL_NULL) + { + DSL_CPE_Free (pFirmware2); + pFirmware2 = DSL_NULL; + nFirmwareSize2 = 0; + } +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + + return ret; +} + + +/** + Termination handler. Will clean up in case of ctrl-c. + + \param sig signal number +*/ +DSL_CPE_STATIC void DSL_CPE_TerminationHandler ( + DSL_int_t sig) +{ +#ifndef RTEMS + /* ignore the signal, we'll handle by ourself */ + signal (sig, SIG_IGN); + + if (sig == SIGINT) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "terminated" DSL_CPE_CRLF)); + DSL_CPE_Termination (); + } +#endif /* RTEMS*/ +} + +DSL_CPE_STATIC DSL_void_t DSL_CPE_Termination (void) +{ +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_int_t nDevice = 0; + DSL_char_t buf[32] = "quit"; +#endif + + DSL_CPE_Control_Context_t *pCtrlCtx; + + pCtrlCtx = DSL_CPE_GetGlobalContext(); + if (pCtrlCtx != DSL_NULL) + { + pCtrlCtx->bRun = DSL_FALSE; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + /* quit via the CLI */ + DSL_CPE_CLI_CommandExecute (DSL_CPE_GetGlobalContext()->fd[nDevice], buf, DSL_NULL, + DSL_CPE_STDERR); + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "CLI interface of DSL CPE API terminated." DSL_CPE_CRLF)); +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ +} + +/** + Control application for the DSL CPE driver. + + \param argc - number of parameters + \param argv - array of parameter strings + + \return + DSL_SUCCESS - success +*/ +DSL_int_t dsl_cpe_daemon ( + int argc, + DSL_char_t * argv[]) +{ + DSL_int_t ret = 0; + DSL_char_t device[128] = ""; + DSL_int_t fd = 0, i = 0, nDevice = 0; + DSL_int_t nSysIfCfgSize = 0; +#ifndef DSL_CPE_DEBUG_DISABLE + DSL_DBG_ModuleLevel_t nDbgModLvl; +#endif /* DSL_CPE_DEBUG_DISABLE */ + DSL_VersionInformation_t verInf; +#ifdef VXWORKS + DSL_int_t stdfds[3]; +#endif /* VXWORKS*/ + DSL_CPE_Control_Context_t nCtrlCtx; + DSL_CPE_Control_Context_t *pCtrlCtx = &nCtrlCtx; + DSL_InstanceControl_t instanceConfig; + DSL_EventStatusMask_t statusEventMaskCfgSet; +#ifndef INCLUDE_DSL_CPE_CLI_SUPPORT +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS + DSL_CPE_ResourceUsageStatisticsData_t pAppResStatData; + DSL_ResourceUsageStatistics_t pDrvResStatData; +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + DSL_CPE_ArgParseLayout(argc, argv); + +#if defined(RTEMS) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + void adsl_dbg_init(void); + /* Register RTEMS Debug Module CLI. + located in adsl_dbg.c: adsl_dbg_init()*/ + adsl_dbg_init(); +#endif /* defined(RTEMS) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/ + + memset (pCtrlCtx, 0x00, sizeof (DSL_CPE_Control_Context_t)); + memset(&instanceConfig, 0x0, sizeof(DSL_InstanceControl_t)); +#ifndef DSL_CPE_DEBUG_DISABLE + memset(&nDbgModLvl, 0x0, sizeof(DSL_DBG_ModuleLevel_t)); +#endif /* DSL_CPE_DEBUG_DISABLE */ + + gDSLContext = pCtrlCtx; + g_nMsgDumpDbgLvl = DSL_DBG_MSG; + + /* Set default Device Number*/ + pCtrlCtx->nDevNum = 0; + + pCtrlCtx->bBackwardCompMode = DSL_TRUE; + + /* Initialize Wait points and Auto continue options*/ + for (nDevice = 0; nDevice < DSL_CPE_MAX_DSL_ENTITIES; nDevice++) + { + g_nPrevLineState[nDevice] = DSL_LINESTATE_NOT_INITIALIZED; +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + g_bAutoContinueWaitBeforeLinkActivation[nDevice] = DSL_TRUE; + g_bAutoContinueWaitBeforeConfigWrite[nDevice] = DSL_TRUE; + g_bAutoContinueWaitBeforeRestart[nDevice] = DSL_TRUE; + g_bWaitBeforeLinkActivation[nDevice] = DSL_TRUE; + g_bWaitBeforeConfigWrite[nDevice] = DSL_TRUE; + g_bWaitBeforeRestart[nDevice] = DSL_TRUE; +#else + g_bWaitBeforeLinkActivation[nDevice] = DSL_FALSE; + g_bWaitBeforeConfigWrite[nDevice] = DSL_FALSE; + g_bWaitBeforeRestart[nDevice] = DSL_FALSE; +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/ + } + + /* init first fw download */ + for (nDevice = 0; nDevice < DSL_CPE_MAX_DSL_ENTITIES; nDevice++) + { + pCtrlCtx->bForceFirmwareDownload[nDevice] = DSL_TRUE; + } + + /* Reset user defined SystemInterfaceConfig settings */ + nSysIfCfgSize = (sizeof(DSL_SystemInterfaceConfigData_t) * DSL_MODE_LAST); + memset(&g_sSysIfCfg[DSL_MODE_ADSL], 0, nSysIfCfgSize); + + /* Initialize firmware files with its default values (might be overwritten + by user arguments in folowing DSL_CPE_ArgParse() function) */ + g_sFirmwareName1 = DSL_CPE_Malloc(strlen(sDefaultFirmwareName1) + 1); + g_sFirmwareName2 = DSL_CPE_Malloc(strlen(sDefaultFirmwareName2) + 1); + if(g_sFirmwareName1) + { + cpe_control_strncpy_s(g_sFirmwareName1, strlen(sDefaultFirmwareName1) + 1, + sDefaultFirmwareName1, strlen(sDefaultFirmwareName1)); + } + if(g_sFirmwareName2) + { + cpe_control_strncpy_s(g_sFirmwareName2, strlen(sDefaultFirmwareName2) + 1, + sDefaultFirmwareName2, strlen(sDefaultFirmwareName2)); + } + + if (DSL_CPE_UpdateLayoutConfiguration() == DSL_FALSE) + { + ret = DSL_ERROR; + goto DSL_CPE_CONTROL_EXIT; + } + DSL_CPE_ArgParse (argc, argv); + + + + /* display version */ + if (bGetVersion != -1) + { + DSL_CPE_FPrintf (DSL_CPE_STDOUT, + DSL_CPE_PREFIX"DSL CPE Control Application V%s" DSL_CPE_CRLF, &dsl_cpe_ctl_version[4]); + + bEventActivation = DSL_FALSE; + ret = DSL_SUCCESS; + goto DSL_CPE_CONTROL_EXIT; + } + +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + if (pCtrlCtx->bBackwardCompMode) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-b) Using CLI backward compatible mode" DSL_CPE_CRLF)); + } +#endif /* defined(INCLUDE_DSL_CPE_CLI_SUPPORT) */ + + /* display Control Application help screen*/ + if (bHelp == 1) + { + DSL_CPE_Help (argv[0]); + bEventActivation = DSL_FALSE; + ret = DSL_SUCCESS; + goto DSL_CPE_CONTROL_EXIT; + } +#if defined(DSL_CPE_SIMULATOR_CONTROL) + if (DSL_SimulatorInitialize() != DSL_SUCCESS) + { + ret = DSL_ERROR; + goto DSL_CPE_CONTROL_EXIT; + } +#endif /* defined(DSL_CPE_SIMULATOR_CONTROL)*/ + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + if (g_sAdslScript != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-a) Using ADSL autostart script file - %s" DSL_CPE_CRLF, g_sAdslScript)); + } +#if defined(INCLUDE_DSL_CPE_API_VRX) + if (g_sVdslScript != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-A) Using VDSL autostart script file - %s" DSL_CPE_CRLF, g_sVdslScript)); + } +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT */ +#ifdef INCLUDE_SCRIPT_NOTIFICATION + if (g_sRcScript != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-n) using script notification file - %s" DSL_CPE_CRLF , g_sRcScript)); + } +#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION */ + + if (bInit == 1) + { + /* Print currently used firmware file(s) */ + if (g_sFirmwareName1 && (strlen(g_sFirmwareName1) > 0)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-f) using 1st firmware file - %s" DSL_CPE_CRLF , g_sFirmwareName1)); + } + if (g_sFirmwareName2 && (strlen(g_sFirmwareName2) > 0)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-F) using 2nd firmware file - %s" DSL_CPE_CRLF , g_sFirmwareName2)); + } + } + +#if defined(INCLUDE_DSL_CPE_API_VRX) + if (sLowLevCfgName != DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-l) using low level configuration file - %s" DSL_CPE_CRLF, + sLowLevCfgName)); + + ret = DSL_CPE_GetInitialLowLevelConfig( sLowLevCfgName, + &(gInitCfgData.nDeviceCfg.cfg) ); + if (ret != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "(-l) using default low level configuration" DSL_CPE_CRLF)); + } + } +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + +#ifdef LINUX +#ifdef USE_DAEMONIZE + if (bConsole != 1) + { + if (daemon (1, bNotSilent) != 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "(-c) DSL CPE Control Application cannot daemonize (err=%d)" + DSL_CPE_CRLF, errno)); + ret = DSL_ERROR; + goto DSL_CPE_CONTROL_EXIT; + } + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "(-c) DSL CPE Control Application running in background now!" + DSL_CPE_CRLF)); + } +#endif /* USE_DAEMONIZE */ + DSL_CPE_HandlerInstall (); +#endif /* LINUX */ + +#ifndef RTEMS + signal (SIGINT, DSL_CPE_TerminationHandler); +#endif /* RTEMS*/ + + /* Open DSL_CPE_MAX_DSL_ENTITIES devices*/ + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { +#if defined(INCLUDE_DSL_CPE_API_VRX) + snprintf(device, sizeof(device), "%s/%d", DSL_CPE_DEVICE_NAME, nDevice); +#else + snprintf(device, sizeof(device), "%s", DSL_CPE_DEVICE_NAME); +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + + fd = DSL_CPE_Open (device); + if (fd < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Device %s open failed!" DSL_CPE_CRLF, device)); + ret = DSL_ERROR; + bEventActivation = DSL_FALSE; + goto DSL_CPE_CONTROL_EXIT; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX"Device %s opened successfully" DSL_CPE_CRLF, device)); + + pCtrlCtx->fd[nDevice] = fd; + +#ifndef DSL_CPE_DEBUG_DISABLE + /* Set common debug level for all driver related modules first if defined + by '-D' startup option */ + if ((g_bDebugLevelDrv == 1) && (g_nDebugLevelDrv != 0)) + { + DSL_boolean_t bSetLvl = DSL_TRUE; + + /* Set debug level to all available modules. */ + nDbgModLvl.data.nDbgModule = DSL_DBG_NO_BLOCK; + + switch (g_nDebugLevelDrv) + { + case 1: + nDbgModLvl.data.nDbgLevel = DSL_DBGLVL_MSG; + break; + case 2: + nDbgModLvl.data.nDbgLevel = DSL_DBGLVL_WRN; + break; + case 3: + nDbgModLvl.data.nDbgLevel = DSL_DBGLVL_ERR; + break; + case 4: + nDbgModLvl.data.nDbgLevel = DSL_DBGLVL_NONE; + break; + default: + bSetLvl = DSL_FALSE; + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Invalid value (%d) given with '-D' startup otion, skipping " + "configuration!" DSL_CPE_CRLF, g_nDebugLevelDrv)); + break; + } + + if (bSetLvl == DSL_TRUE) + { + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_LEVEL_SET, (int) &nDbgModLvl); + + if ( (ret < 0) || (nDbgModLvl.accessCtl.nReturn < DSL_SUCCESS) ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "Unable to set global driver debug level to 0x%X. nReturn = %d" + DSL_CPE_CRLF, g_nDebugLevelDrv, nDbgModLvl.accessCtl.nReturn)); + } + } + } + /* Now set (overwrite) debug module specific driver debug levels as + defined by '-g' startup option */ + for (i = 0; (i < MAX_DBG_MOD_PAIRS) && (g_nDbgDrvLevel[i].nDbgModule != 0); ++i) + { + nDbgModLvl.data.nDbgModule = g_nDbgDrvLevel[i].nDbgModule; + nDbgModLvl.data.nDbgLevel = g_nDbgDrvLevel[i].nDbgLevel; + + ret = DSL_CPE_Ioctl (fd, DSL_FIO_DBG_MODULE_LEVEL_SET, (int) &nDbgModLvl); + + if ( (ret < 0) || (nDbgModLvl.accessCtl.nReturn < DSL_SUCCESS) ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "Unable to set driver debug module %u to level %x. nReturn = %d" + DSL_CPE_CRLF, g_nDbgDrvLevel[i].nDbgModule, + g_nDbgDrvLevel[i].nDbgLevel, nDbgModLvl.accessCtl.nReturn)); + } + } +#endif /* #ifndef DSL_CPE_DEBUG_DISABLE */ + } + + memset(&(pCtrlCtx->applicationVer), 0xFF, sizeof(DSL_SwVersion_t)); + memset(&(pCtrlCtx->driverVer), 0xFF, sizeof(DSL_SwVersion_t)); + + /* Get Control Application Version*/ + if (DSL_CPE_SwVersionFromStringGet(PACKAGE_VERSION, &(pCtrlCtx->applicationVer)) != DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - DSL CPE Control Application version get failed!" DSL_CPE_CRLF)); + } + + /* Get Driver version info*/ + memset(&verInf, 0x0, sizeof(DSL_VersionInformation_t)); + ret = DSL_CPE_Ioctl (pCtrlCtx->fd[0], DSL_FIO_VERSION_INFORMATION_GET, (int) &verInf); + + if ((ret < 0) && (verInf.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - DSL_FIO_VERSION_INFORMATION_GET ioctl failed!" DSL_CPE_CRLF)); + } + else + { + ret = DSL_CPE_SwVersionFromStringGet(verInf.data.DSL_DriverVersionApi, &(pCtrlCtx->driverVer)); + if ((ret < 0) && (verInf.accessCtl.nReturn < DSL_SUCCESS)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - DSL CPE Driver version get failed!" DSL_CPE_CRLF)); + } + } + + if ((pCtrlCtx->driverVer.nMajor != pCtrlCtx->applicationVer.nMajor) || + (pCtrlCtx->driverVer.nMinor != pCtrlCtx->applicationVer.nMinor)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - DSL CPE Driver vs Application version mismatch!" DSL_CPE_CRLF)); + } + + if (INCLUDE_DSL_BONDING) + { + if (DSL_CPE_BND_Start( + pCtrlCtx, pCtrlCtx->fd[0] ) < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Bonding Start failed!" DSL_CPE_CRLF)); + bEventActivation = DSL_FALSE; + ret = DSL_ERROR; + goto DSL_CPE_CONTROL_EXIT; + } + } + + pCtrlCtx->bRun = DSL_TRUE; + +#ifdef VXWORKS + /* FIXME: make sure that this console runs on the serial port (fd 3) */ + for (i = 0; i < 3; ++i) + { + stdfds[i] = ioTaskStdGet(0,i); + if (stdfds[i] != ERROR) + ioTaskStdSet(0,i,3); + } +#endif + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (DSL_CPE_CLI_Init() == DSL_ERROR) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "'DSL_CPE_CLI_Init' failed! Exit dsl_cpe_control..." DSL_CPE_CRLF)); + goto DSL_CPE_CONTROL_EXIT; + } +#endif + +#ifdef DSL_DEBUG_TOOL_INTERFACE + if (bTcpMessageIntf == 1) + { + if (DSL_CPE_TcpDebugMessageIntfStart(pCtrlCtx, + g_nTcpMessagesSocketPort, g_sTcpMessagesSocketAddr) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug messages interface start failed!" DSL_CPE_CRLF)); + } +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (DSL_CPE_TcpDebugCliIntfStart(pCtrlCtx, g_bEnableTcpCli) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug CLI interface start failed!" DSL_CPE_CRLF)); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + + bTcpMessageIntf = 2; + } +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + + /* Configure event and resource handling*/ + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + instanceConfig.data.bEventActivation = bEventActivation; + instanceConfig.data.nResourceActivationMask = + (DSL_BF_ResourceActivationType_t)nResourceActivationMask; + + ret = DSL_CPE_Ioctl (pCtrlCtx->fd[nDevice], DSL_FIO_INSTANCE_CONTROL_SET, + (DSL_int_t) &instanceConfig); + + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "Could not configure " + "event handling for device %d (%d)." DSL_CPE_CRLF, + i, instanceConfig.accessCtl.nReturn)); + } + } + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) + if (bDTI == 1) + { + /* start DTI agent with default values */ + if ( DSL_CPE_Dti_Start( + pCtrlCtx, + DSL_CPE_DSL_ENTITIES, + 1, + DSL_CPE_DTI_DEFAULT_TCP_PORT, + sDtiSocketAddr, + #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + DSL_TRUE, + #else + DSL_FALSE, + #endif + DSL_FALSE, + DSL_FALSE) < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - DTI Agent start failed!" DSL_CPE_CRLF)); + + goto DSL_CPE_CONTROL_EXIT; + } + + bDTI = 2; + } +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) */ + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (bConsole == 1) + { + if (DSL_CPE_Console_Init (&pConsoleContext, pCtrlCtx, DSL_CPE_STDIN, + DSL_CPE_STDOUT) == DSL_ERROR) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "'DSL_CLI_Console_Init' failed! Exit dsl_cpe_control..." DSL_CPE_CRLF)); + goto DSL_CPE_CONTROL_EXIT; + } + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + + if (bEventActivation) + { + /* Unmask (enable) all possible events that are masked (disabled) by + default after instance event activation. */ + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + for (i = DSL_EVENT_S_FIRST; i < DSL_EVENT_S_LAST; i++) + { + memset(&statusEventMaskCfgSet, 0x00, sizeof(DSL_EventStatusMask_t)); + statusEventMaskCfgSet.data.nEventType = (DSL_EventType_t)i; + statusEventMaskCfgSet.data.bMask = DSL_FALSE; + ret = DSL_CPE_Ioctl(pCtrlCtx->fd[nDevice], DSL_FIO_EVENT_STATUS_MASK_CONFIG_SET, + (DSL_int_t) &statusEventMaskCfgSet); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "Could not unmask " + "event(%d) for device %d (%d)!" DSL_CPE_CRLF, i, nDevice, instanceConfig.accessCtl.nReturn)); + } + } + } + } + + if (bEventActivation == DSL_TRUE) + { + DSL_CPE_EventHandlerStart (pCtrlCtx); + } + +#ifndef DSL_CPE_DEBUG_DISABLE + if (bMsgDump == 1) + { + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + nDbgModLvl.data.nDbgModule = DSL_DBG_MESSAGE_DUMP; + nDbgModLvl.data.nDbgLevel = (DSL_debugLevels_t)g_nMsgDumpDbgLvl; + ret = DSL_CPE_Ioctl (pCtrlCtx->fd[nDevice], DSL_FIO_DBG_MODULE_LEVEL_SET, (int) &nDbgModLvl); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "failed to set message dump debug level for device %d!" DSL_CPE_CRLF, nDevice)); + } + } + } +#endif /* DSL_CPE_DEBUG_DISABLE */ + + if (bInit == 1) + { + ret = DSL_CPE_DeviceInit (pCtrlCtx); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Device initialization failed (ret=%d)!" DSL_CPE_CRLF, ret)); + goto DSL_CPE_CONTROL_EXIT; + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Device initialized succeeded (ret=%d)." DSL_CPE_CRLF, ret)); + } + } + + if (bInit != 1) + { +#ifdef INCLUDE_FW_REQUEST_SUPPORT +#if defined(INCLUDE_DSL_CPE_API_DANUBE) + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + /* Download ADSL Firmware*/ + ret = DSL_CPE_DownloadFirmware(pCtrlCtx->fd[nDevice], nDevice, + DSL_FW_REQUEST_ADSL, DSL_PORT_MODE_NA, DSL_NULL, DSL_NULL); + if (ret == DSL_ERR_NOT_INITIALIZED) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Device[%d] not initialized yet, please use [-i] option" DSL_CPE_CRLF, + nDevice)); + } + + } +#else + DSL_AutobootControl_t pAcs; + + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + memset(&pAcs,0x0, sizeof(DSL_AutobootControl_t)); + /* Restat Autoboot handling*/ + pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART; + + ret = DSL_CPE_Ioctl(pCtrlCtx->fd[nDevice], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs); + if (ret < 0) + { + if (pAcs.accessCtl.nReturn == DSL_ERR_NOT_INITIALIZED) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Device[%d] not initialized yet, please use [-i] option" DSL_CPE_CRLF, + nDevice)); + } + } + } +#endif /* defined(INCLUDE_DSL_CPE_API_DANUBE)*/ +#else + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + /* Download ADSL/VDSL Firmware if available*/ + ret = DSL_CPE_DownloadFirmware(pCtrlCtx->fd[nDevice], nDevice, + DSL_FW_REQUEST_NA, DSL_PORT_MODE_NA, DSL_NULL, DSL_NULL); + if (ret == DSL_ERR_NOT_INITIALIZED) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Device[%d] not initialized yet, please use [-i] option" DSL_CPE_CRLF, + nDevice)); + } + } +#endif /* INCLUDE_FW_REQUEST_SUPPORT*/ + } + +#ifndef INCLUDE_DSL_CPE_CLI_SUPPORT +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS + /* In case of disabled CLI there is no possibility to get resource usage + statistics manually. Therefore print resource statistics here by default */ + + /* Wait for all driver modules to be initialized*/ + DSL_CPE_Sleep(3); + + memset(&pDrvResStatData, 0, sizeof(DSL_ResourceUsageStatistics_t)); + + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + ret = DSL_CPE_Ioctl (pCtrlCtx->fd[nDevice], DSL_FIO_RESOURCE_USAGE_STATISTICS_GET, (int) &pDrvResStatData); + if ((ret < 0) && (pDrvResStatData.accessCtl.nReturn < DSL_SUCCESS)) + { + printf(DSL_CPE_PREFIX "Failed to get device=%d resource usage statistic from driver!" + DSL_CPE_CRLF, nDevice); + } + else + { + if (DSL_CPE_DSL_ENTITIES > 1) + { + printf(DSL_CPE_PREFIX "nDevice=%d drvStaticMemUsage=%d drvDynamicMemUsage=%d" + DSL_CPE_CRLF, + nDevice, pDrvResStatData.data.staticMemUsage, pDrvResStatData.data.dynamicMemUsage); + } + else + { + printf(DSL_CPE_PREFIX "drvStaticMemUsage=%d drvDynamicMemUsage=%d " + DSL_CPE_CRLF, + pDrvResStatData.data.staticMemUsage, pDrvResStatData.data.dynamicMemUsage); + } + } + } + + memset(&pAppResStatData, 0, sizeof(DSL_CPE_ResourceUsageStatisticsData_t)); + if (DSL_CPE_ResourceUsageStatisticsGet(pCtrlCtx, + &pAppResStatData) == DSL_ERROR) + { + printf(DSL_CPE_PREFIX "Failed to get resource usage statistic from application!" + DSL_CPE_CRLF); + } + + printf(DSL_CPE_PREFIX"appStaticMemUsage=%d appDynamicMemUsage=%d" DSL_CPE_CRLF, + pAppResStatData.staticMemUsage, pAppResStatData.dynamicMemUsage); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT + if (DSL_CPE_Pipe_Init (pCtrlCtx) == DSL_ERROR) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "'DSL_CPE_Pipe_Init' failed! Exit dsl_cpe_control..." DSL_CPE_CRLF)); + goto DSL_CPE_CONTROL_EXIT; + } +#endif /* DSL_CPE_REMOVE_PIPE_SUPPORT */ + + if (bConsole == 1) + { + do + { + ret = DSL_CPE_Handle_Console (pConsoleContext); + if (ret < 0) + { + if (pCtrlCtx->bRun) + { + DSL_CPE_Termination (); + } + break; + } + } + while (ret != DSL_ERROR); + + ret = DSL_SUCCESS; + + if (DSL_CPE_Console_Shutdown(pConsoleContext) == DSL_ERROR) + { + goto DSL_CPE_CONTROL_EXIT; + } + pConsoleContext = DSL_NULL; + + } + else + { + dummy_console.bRun = DSL_TRUE; + + DSL_CPE_CLI_Register (&dummy_console.pCLIContext, &dummy_console, + DSL_CPE_Control_Exit, DSL_NULL); + + while (dummy_console.bRun) + { + DSL_CPE_Sleep (1); + } + } + + DSL_CPE_CLI_Shutdown(); +#else + while(pCtrlCtx->bRun) + { + DSL_CPE_Sleep (1); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +DSL_CPE_CONTROL_EXIT: + + if (INCLUDE_DSL_BONDING) + { + DSL_CPE_BND_Stop((DSL_CPE_BND_Context_t*)pCtrlCtx->pBnd); + } + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) + if (bDTI == 2) + { + /* Stop DTI Agent*/ + if (DSL_CPE_Dti_Stop(pCtrlCtx) < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX"ERROR - DTI Agent stop failed!" DSL_CPE_CRLF)); + } + } + + if(sDtiSocketAddr != DSL_NULL) + { + DSL_CPE_Free (sDtiSocketAddr); + sDtiSocketAddr = DSL_NULL; + } +#endif /* defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/ + + if (bEventActivation) + { + /* Mask (disable) all possible events which were enabled at the startup. + Workaround to solve the SMS00833504 issue.*/ + for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++) + { + for (i = DSL_EVENT_S_FIRST; i < DSL_EVENT_S_LAST; i++) + { + if (pCtrlCtx->fd[nDevice] < 0) + { + continue; + } + + memset(&statusEventMaskCfgSet, 0x00, sizeof(DSL_EventStatusMask_t)); + statusEventMaskCfgSet.data.nEventType = (DSL_EventType_t)i; + statusEventMaskCfgSet.data.bMask = DSL_TRUE; + ret = DSL_CPE_Ioctl(pCtrlCtx->fd[nDevice], DSL_FIO_EVENT_STATUS_MASK_CONFIG_SET, + (DSL_int_t) &statusEventMaskCfgSet); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "Could not nmask " + "event(%d) for device %d (%d)!" DSL_CPE_CRLF, i, nDevice, instanceConfig.accessCtl.nReturn)); + } + } + } + } + +#ifdef VXWORKS + /* restore stdio */ + for (i = 0; i < 3; ++i) + { + if (stdfds[i] != ERROR) + ioTaskStdSet(0,i,stdfds[i]); + } +#endif + + if (pCtrlCtx->bRun) + { + pCtrlCtx->bRun = DSL_FALSE; + + /* wait while CPE Event handler thread ends */ + DSL_CPE_ThreadShutdown (&pCtrlCtx->EventControl, 1000); + } + + for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++) + { + if(pCtrlCtx->fd[i] >= 0) + { + /* close device */ + ret = (DSL_int32_t) (DSL_CPE_Close (pCtrlCtx->fd[i])); + if (ret < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX"error on closing device %d!" DSL_CPE_CRLF, i)); + } + } + } +#ifdef DSL_CPE_SIMULATOR_DRIVER + /* Delete Complex Simulator device*/ + DSL_DRV_SIM_DeviceDelete(); +#endif /* DSL_CPE_SIMULATOR_DRIVER*/ + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + if(g_sRcScript != DSL_NULL) + { + DSL_CPE_Free (g_sRcScript); + g_sRcScript = DSL_NULL; + } + + /* Delete all created user environment variables*/ + DSL_CPE_EnvVarFree(); +#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION*/ + + if(g_sFirmwareName1 != DSL_NULL) + { + DSL_CPE_Free (g_sFirmwareName1); + g_sFirmwareName1 = DSL_NULL; + } + + if(g_sFirmwareName2 != DSL_NULL) + { + DSL_CPE_Free (g_sFirmwareName2); + g_sFirmwareName2 = DSL_NULL; + } + +#ifdef DSL_DEBUG_TOOL_INTERFACE + if (bTcpMessageIntf == 2) + { +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (DSL_CPE_TcpDebugCliIntfStop(DSL_CPE_GetGlobalContext()) < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug CLI interface stop failed!" DSL_CPE_CRLF)); + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + if (DSL_CPE_TcpDebugMessageIntfStop(DSL_CPE_GetGlobalContext()) < DSL_SUCCESS) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP debug messages interface stop failed!" DSL_CPE_CRLF)); + } + } + + if(g_sTcpMessagesSocketAddr != DSL_NULL) + { + DSL_CPE_Free (g_sTcpMessagesSocketAddr); + g_sTcpMessagesSocketAddr = DSL_NULL; + } + + g_nTcpMessagesSocketPort = 0; + g_bEnableTcpCli = DSL_FALSE; +#endif + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + if(g_sAdslScript != DSL_NULL) + { + DSL_CPE_Free (g_sAdslScript); + g_sAdslScript = DSL_NULL; + } + + if(g_sVdslScript != DSL_NULL) + { + DSL_CPE_Free (g_sVdslScript); + g_sVdslScript = DSL_NULL; + } +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ +#endif /* INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT */ + +#if defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32) + if (g_sRemoteTcpServerIp) + { + DSL_CPE_Free (g_sRemoteTcpServerIp); + } +#endif /* defined(INCLUDE_TCP_SIMULATOR) && defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/ + + /* clear global variable*/ + gDSLContext = DSL_NULL; + + return ret; +} + +#if defined(LINUX) || defined(WIN32) +int main (int argc, char *argv[]) +{ + + return dsl_cpe_daemon (argc, argv); +} +#elif defined(RTEMS) +void dsl_cpe_daemon_start(void) +{ + DSL_char_t * argv[]={"dsl_cpe_control","-i","-c"}; + /* Start Daemon*/ + dsl_cpe_daemon (3,&argv); + xt_delete(0); +} + +/* RTEMS main */ +void DSL_CPE_main(void) +{ + int DSL_DRV_DeviceCreate(void); + int DSL_DRV_Open(void); + + /* level driver (MEI BSP Driver) is already initialized */ + + /* load the driver module ("insmod ./drv_dsl_cpe_api" in Linux) */ + DSL_DRV_DeviceCreate(); + DSL_DRV_Open(); + + memset(&DslMainControl, 0x00, sizeof(DslMainControl)); + + /* Now the target system is ready to run the DSL CPE Control Application. */ + DSL_CPE_ThreadInit(&DslMainControl, "DslMain", dsl_cpe_daemon_start, + DSL_CPE_DEFAULT_STACK_SIZE, DSL_CPE_PRIORITY, + (DSL_uint32_t)0, (DSL_uint32_t)0); +} +#endif /* defined(LINUX) || defined(WIN32)*/ + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +DSL_CPE_STATIC DSL_Error_t DSL_CPE_Control_Exit (DSL_void_t * pContext) +{ + dummy_console_t *pConsole = pContext; + pConsole->bRun = DSL_FALSE; + return DSL_SUCCESS; +} +#endif diff --git a/src/dsl_cpe_control.h b/src/dsl_cpe_control.h new file mode 100644 index 0000000..72a984f --- /dev/null +++ b/src/dsl_cpe_control.h @@ -0,0 +1,557 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef _DSL_CPE_CONTROL_H +#define _DSL_CPE_CONTROL_H + +/** \defgroup DSL_CPE_CONTROL Lantiq DSL CPE API Control Application + Lists the entire modules to the DSL CPE_API Control Application. + @{ */ + +/** + \defgroup DSL_CPE_CLI Implementation of Command Line Interface access commands + This module implements the Command Line Interface. +*/ + +/** @} */ + +#ifdef HAVE_CONFIG_H +#include "dsl_cpe_config.h" +#endif + +/* To disable patch version handling set up definition below.*/ +/* #define DISABLE_DSL_PATCH_VERSION*/ + +#ifndef DSL_DOC_GENERATION_EXCLUDE_UNWANTED + +#include "dsl_cpe_os.h" + +#ifdef WIN32 +#include "dsl_cpe_win32.h" +#endif /* WIN32*/ + +/* Maximum number of FW reload retries in case of a failed FW download*/ +#define DSL_CPE_MAX_FW_RELOAD_RETRY_COUNT (5) + +#if defined(INCLUDE_DSL_ADSL_MIB) && defined (INCLUDE_DSL_CPE_API_VRX) + #error "MIB not supported for the VRX devices yet!!!" +#endif + +extern DSL_char_t *g_sFirmwareName1; +extern DSL_FirmwareFeatures_t g_nFwFeatures1; + +extern DSL_char_t *g_sFirmwareName2; +extern DSL_FirmwareFeatures_t g_nFwFeatures2; + +extern DSL_uint8_t g_nDevices; +extern DSL_uint8_t g_nLines; +extern DSL_uint8_t g_nChannels; +/* Maximum lines per DSL device to support */ + +#define DSL_CPE_LINES_PER_DEVICE ((const DSL_uint8_t) g_nLines) +#define DSL_CPE_DEVICE_NUMBER ((const DSL_uint8_t) g_nDevices) +#define INCLUDE_DSL_BONDING (g_nLines * g_nDevices > 1) +#define DSL_CPE_DSL_ENTITIES (g_nLines * g_nDevices) + +#define DSL_CPE_MAX_DEVICE_NUMBER 2 +/* +#if defined(DSL_DEBUG_TOOL_INTERFACE) && (!defined(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT)) +#error "DSL Debug Interface can be used with Linux and file \ +system support enabled only" +#endif +*/ + +#if defined(DSL_DEBUG_TOOL_INTERFACE) && !defined(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT) + #error "Debug Tool Interface needs --enable-cmv-scripts option enabled!" +#endif + +/* \todo [RTT] Temporary exclude RTT because of important bugfix is needed first! */ +#if defined(INCLUDE_REAL_TIME_TRACE) +#error Real Time Trace functionality is currently not supported. +#endif + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +#ifdef LINUX + #define DSL_DEBUG_TOOL_INTERFACE_DEFAULT_IFACE "eth0" +#elif defined(VXWORKS) + #define DSL_DEBUG_TOOL_INTERFACE_DEFAULT_IFACE "ei0" +#else + #error "OS type undefined!" +#endif +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + #define DSL_CPE_DSL_LOW_DEV "/dev/ifx_mei" +#elif defined (INCLUDE_DSL_CPE_API_VRX) + #define DSL_CPE_DSL_LOW_DEV "/dev/mei_cpe" +#else + #error "Device undefined!" +#endif + +/** + This define specifies the maximum number of device instances +*/ + + +#define DSL_CPE_MAX_DSL_ENTITIES 2 + + +#include "drv_dsl_cpe_api.h" +#include "drv_dsl_cpe_api_types.h" +#include "drv_dsl_cpe_api_error.h" +#include "dsl_cpe_safec_wrapper.h" + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + #include "dsl_cpe_cli.h" +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#define DSL_DEV_TIMEOUT_SELECT 1000 + +#define DSL_CPE_FW_CHUNK_SIZE (64 * 1024) + +/*#define INCLUDE_DSL_API_CLI_LEGACY*/ + +/* + Security checks for configure options +*/ +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) && defined(INCLUDE_DSL_CPE_API_DANUBE) + #ifndef INCLUDE_DSL_CPE_CLI_SUPPORT + #error "DTI support for Danube requires CLI please define 'INCLUDE_DSL_CPE_CLI_SUPPORT'" + #endif +#endif /* INCLUDE_DSL_CPE_DTI_SUPPORT */ + +#if !defined(INCLUDE_DSL_CPE_CLI_SUPPORT) +#define DSL_CPE_REMOVE_PIPE_SUPPORT +#endif + +extern DSL_boolean_t g_bWaitBeforeLinkActivation[DSL_CPE_MAX_DSL_ENTITIES]; +extern DSL_boolean_t g_bWaitBeforeConfigWrite[DSL_CPE_MAX_DSL_ENTITIES]; +extern DSL_boolean_t g_bWaitBeforeRestart[DSL_CPE_MAX_DSL_ENTITIES]; + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +extern DSL_char_t *g_sAdslScript; +extern DSL_char_t *g_sVdslScript; +extern DSL_boolean_t g_bAutoContinueWaitBeforeLinkActivation[DSL_CPE_MAX_DSL_ENTITIES]; +extern DSL_boolean_t g_bAutoContinueWaitBeforeConfigWrite[DSL_CPE_MAX_DSL_ENTITIES]; +extern DSL_boolean_t g_bAutoContinueWaitBeforeRestart[DSL_CPE_MAX_DSL_ENTITIES]; +#endif + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +extern DSL_char_t *g_sRcScript; +DSL_void_t DSL_CPE_ScriptRun(DSL_void_t); +#endif /* INCLUDE_SCRIPT_NOTIFICATION*/ + +#define MAX_WHAT_STRING_LEN 64 +#define WHAT_STRING_CHUNK_LEN (64*1024) + +#define DSL_CPE_DEVICE_NAME "/dev/dsl_cpe_api" +#define DSL_CPE_PREFIX "DSL_CPE: " +#define DSL_CPE_SCRIPT_PREFIX "DSL_CPE_SCRIPT: " + +#define DSL_SCRIPT_PRINTF (void) DSL_CPE_FPrintf + +#define DSL_SCRIPT_DEBUG(echo, body) \ +{ \ + if (echo) \ + { \ + DSL_SCRIPT_PRINTF body; \ + } \ +} + +#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT + #define DSL_CPE_SHOWTIME_EVENT_LOGGING_FILENAME "/tmp/post_mortem_data.txt" +#endif + + +#ifndef _MKSTR_1 +#define _MKSTR_1(x) #x +#define _MKSTR(x) _MKSTR_1(x) +#endif + + +typedef unsigned int DSL_size_t; + +typedef void (DSL_CliFunction_t) (DSL_int32_t fd, + DSL_char_t *pCommands, + DSL_CPE_File_t *out); + +typedef struct +{ + char *sShortCommand; + char *sLongCommand; + DSL_CliFunction_t *pFunction; +} DSL_CliCommand_t; + + +DSL_int32_t DSL_CPE_sscanf (DSL_char_t * buf, DSL_char_t const *fmt, ...) +#if __GNUC__ >= 3 +__attribute__ ((__format__ (__scanf__, 2, 3))) +#endif +; + +#ifdef INCLUDE_DSL_API_CLI_LEGACY + +#define GET_ADSL_LINE_STATUS 0 +#define DANUBE_MEI_CMV_WINHOST 0 +#define LINE_RATE_DATA_RATEDS_FLAG 1 +#define LINE_RATE_DATA_RATEUS_FLAG 2 + +typedef struct +{ + DSL_uint32_t dummy; +} adslLineStatusInfo; + +typedef struct +{ + DSL_uint32_t flags; + DSL_uint32_t adslDataRateus; + DSL_uint32_t adslDataRateds; +} adslLineRateInfo; + +#endif /* INCLUDE_DSL_API_CLI_LEGACY */ + +#if defined(INCLUDE_DSL_CPE_API_VRX) +/* Structure to keep the decoded Firmware Verion information + contained in the 32bit Version number */ +typedef struct +{ + /* Revision 1, 2, ... */ + DSL_uint8_t nPlatform; + /* */ + DSL_uint8_t nFeatureSet; + /* */ + DSL_uint8_t nMajor; + /* */ + DSL_uint8_t nMinor; + /* Pre, Verification, Development */ + DSL_uint8_t nReleaseStatus; + /* VDSL1/2, ADSL, ... */ + DSL_uint8_t nApplication; +} DSL_VRX_FwVersion_t; +#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/ + +#ifdef INCLUDE_DSL_CPE_API_DANUBE +/* Structure to keep the decoded Firmware Verion information + contained in the 32bit Version number */ +typedef struct +{ + /* Major version*/ + DSL_uint8_t nMajor; + /* Minor version*/ + DSL_uint8_t nMinor; + /* Release State */ + DSL_uint8_t nRelState; + /* Annex A, Annex B*/ + DSL_uint8_t nApplication; + /* External Version*/ + DSL_uint8_t nExtVersion; + /* Internal Version */ + DSL_uint8_t nIntVersion; +} DSL_DANUBE_FwVersion_t; +#endif /* INCLUDE_DSL_CPE_API_DANUBE*/ + +/* + Structure for the SW (driver, application) version*/ +typedef struct +{ + /* Major version*/ + DSL_int_t nMajor; + /* Minor version*/ + DSL_int_t nMinor; + /* Development version*/ + DSL_int_t nDevelopment; + /* Maintenance version*/ + DSL_int_t nMaintenance; +#ifndef DISABLE_DSL_PATCH_VERSION + /* Patch number*/ + DSL_int_t nPatch; +#endif /*#ifndef DISABLE_DSL_PATCH_VERSION*/ +} DSL_SwVersion_t; + +/* + This structure is used to get resource usage statistics + data +*/ +typedef struct +{ + /* + Total memory allocated statically (bytes) */ + DSL_uint32_t staticMemUsage; + /* + Total memory allocated dynamically (bytes) */ + DSL_uint32_t dynamicMemUsage; +} DSL_CPE_ResourceUsageStatisticsData_t; + +typedef struct +{ + /* + File name is only used in case of using firmware binary that is located + within file system. If firmware that is used which is already stored + within context of DSL CPE Control Applicationthis pointer shall be DSL_NULL.*/ + DSL_char_t *pFileName; + /* + Pointer to firmware binary in case of using data stored within context of + DSL CPE Control Application. In case of using reference to file instead + (pFileName does not equal DSL_NULL) this pointer shall be DSL_NULL. */ + DSL_uint8_t *pData; + /* + Size of firmware binary in case of using data stored within context of + DSL CPE Control Application. In case of using reference to file instead + (pFileName does not equal DSL_NULL) this parameter shall be zero. */ + DSL_uint32_t nSize; + /* + Includes information about xDSL mode related firmware features */ + DSL_FirmwareFeatures_t fwFeatures; +} DSL_CPE_Firmware_t; + +typedef struct +{ + DSL_int_t fd[DSL_CPE_MAX_DSL_ENTITIES]; + DSL_boolean_t bRun; + DSL_CPE_ThreadCtrl_t EventControl; + DSL_boolean_t bEvtRun; + DSL_boolean_t bBackwardCompMode; + DSL_int_t nDevNum; +#ifdef DSL_DEBUG_TOOL_INTERFACE + DSL_CPE_ThreadCtrl_t nTcpMsgHandler; + DSL_void_t *pDebugClientInfo; +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_CPE_ThreadCtrl_t nTcpCliHandler; + DSL_void_t *pDebugCliClientInfo; +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_CLI_Context_t *pCLI_List_head; +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + DSL_FirmwareStatusType_t nFwModeStatus; +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/ + /* DSL CPE API driver version*/ + DSL_SwVersion_t driverVer; + /* DSL CPE API control application version*/ + DSL_SwVersion_t applicationVer; + DSL_void_t *pBnd; + DSL_boolean_t bForceFirmwareDownload[DSL_CPE_MAX_DSL_ENTITIES]; +} DSL_CPE_Control_Context_t; + +#include "dsl_cpe_debug.h" + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT + +#define DSL_CPE_SCRIPT_WAIT_FOR_CONFIGURATION_TAG "WaitForConfiguration" +#define DSL_CPE_SCRIPT_WAIT_FOR_LINK_ACTIVATE_TAG "WaitForLinkActivate" +#define DSL_CPE_SCRIPT_WAIT_BEFORE_RESTART_TAG "WaitForRestart" +#define DSL_CPE_SCRIPT_COMMON_TAG "Common" + +typedef enum +{ + /* Specifies common section.*/ + DSL_SCRIPT_SECTION_COMMON = 1, + /* Specifies "WaitForConfiguration" section within + Autoboot script*/ + DSL_SCRIPT_SECTION_WAIT_FOR_CONFIFURATION = 2, + /* Specifies "WaitForLinkActivate" section within + Autoboot script*/ + DSL_SCRIPT_SECTION_WAIT_FOR_LINK_ACTIVATE = 3, + /* Specifies "WaitBeforeRestart" section within + Autoboot script*/ + DSL_SCRIPT_SECTION_WAIT_BEFORE_RESTART = 4 +} DSL_CPE_ScriptSection_t; +#endif /* #ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/ + +#define MAX_SCRIPT_CMD_LEN 1023 + +/** + Structure for dynamic script buffers. +*/ +typedef struct +{ + /** dynamic buffer */ + DSL_char_t *buffer_cmd; + /** dynamic buffer */ + DSL_char_t *buffer_tmp; + /** buffer size */ + DSL_int_t nSize; +} DSL_CPE_ScriptBuffer_t; + +/** + Structure for parsing startup arguments. +*/ +typedef struct +{ + /** element value (to be returned) */ + DSL_int_t nValue; + /** element base (for strtoul function, + e.g. 10 for decimal or 16 for hex values) */ + DSL_int_t nBase; +} DSL_CPE_ArgElement_t; + +/* + A structure for event type<->string conversion tables. +*/ +typedef struct +{ + /** event type */ + DSL_EventType_t eventType; + /** event string */ + DSL_char_t const *string; +} DSL_CPE_EVT_CodeString_t; + +DSL_CPE_Control_Context_t *DSL_CPE_GetGlobalContext(DSL_void_t); + +#if defined(INCLUDE_DSL_CPE_API_VRX) +DSL_Error_t DSL_CPE_LowLevelConfigurationCheck( + DSL_int_t fd); +#endif + +DSL_Error_t DSL_CPE_LoadFirmwareFromFile +( + DSL_char_t *psFirmwareName, + DSL_uint8_t **pFirmware, + DSL_uint32_t *pnFirmwareSize +); + +DSL_Error_t DSL_CPE_DownloadFirmware +( + DSL_int_t fd, + DSL_int_t nDevice, + DSL_FirmwareRequestType_t nFwReqType, + DSL_PortMode_t nPortMode, + DSL_char_t *pcFw, + DSL_char_t *pcFw2 +); + +DSL_Error_t DSL_CPE_FwFeaturesGet +( + DSL_char_t *pcFw, + DSL_FirmwareFeatures_t *pFwFeatures +); + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +typedef enum +{ + /* Format as hey values */ + DSL_ARRAY_FORMAT_HEX, + /* Format as string */ + DSL_ARRAY_FORMAT_STRING, + /* Format as string (print dots instead of non print symbols) */ + DSL_ARRAY_FORMAT_PRINT_STRING +} DSL_CPE_ArrayPrintFormat_t; + +DSL_void_t DSL_CPE_ArraySPrintF +( + DSL_char_t *pDst, + DSL_void_t *pSrc, + DSL_uint16_t nSrcSize, + DSL_uint16_t nSrcElementSize, + DSL_CPE_ArrayPrintFormat_t nFormat +); + +DSL_Error_t DSL_CPE_MoveCharPtr +( + DSL_char_t *pCommands, + DSL_int_t nParamNr, + DSL_char_t *pSeps, + DSL_char_t **pCmdOffset +); + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +DSL_char_t *DSL_CPE_Fd2DevStr(DSL_int_t fd); +DSL_Error_t DSL_CPE_Fd2DevNum(DSL_int_t fd, DSL_uint32_t *nDevice); + +DSL_boolean_t DSL_CPE_IsFileExists(DSL_char_t *path); +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + +DSL_int_t DSL_CPE_CliDeviceCommandExecute( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t nDevice, + DSL_char_t *cmd, + DSL_char_t *arg, + DSL_CPE_File_t *out); + +#if defined(INCLUDE_DSL_CPE_API_VRX) +typedef struct +{ + DSL_uint8_t nAdr[DSL_MAC_ADDRESS_OCTETS]; +} DSL_CPE_MacAddress_t; + +DSL_Error_t DSL_CPE_GetMacAdrFromString +( + DSL_char_t *pString, + DSL_CPE_MacAddress_t *pMacAdr +); +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */ + +/* + Start Event handler thread +*/ +DSL_Error_t DSL_CPE_EventHandlerStart ( + DSL_CPE_Control_Context_t * pContext +); + +#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT +DSL_void_t DSL_CPE_Echo +( + DSL_char_t *buf +); + +DSL_Error_t DSL_CPE_ScriptExecute +( + DSL_CPE_Control_Context_t * pContext, + DSL_int_t nDevice, + DSL_CPE_File_t *pFile, + DSL_CPE_ScriptSection_t searchSection, + DSL_CPE_ScriptBuffer_t *script_buf +); + +DSL_Error_t DSL_CPE_ScriptFileParse +( + DSL_CPE_Control_Context_t * pContext, + DSL_int_t nDevice, + DSL_char_t *sFileName, + DSL_CPE_ScriptSection_t searchSection +); +#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */ + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_ResourceUsageStatisticsGet +( + DSL_CPE_Control_Context_t *pContext, + DSL_CPE_ResourceUsageStatisticsData_t *pData +); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +#endif /* #ifndef DSL_DOC_GENERATION_EXCLUDE_UNWANTED*/ + +/** + Returns the smaller of the two parameters. + Take care to use compatible types! + + \param a first element to compare, [I] + \param b second element to compare, [I] +*/ +#define DSL_MIN(a,b) ((a)<(b)?(a):(b)) + +/** + Returns the biggest of the two parameters. + Take care to use compatible types! + + \param a first element to compare, [I] + \param b second element to compare, [I] +*/ +#define DSL_MAX(a,b) ((a)>(b)?(a):(b)) + +#endif /* _DSL_CPE_CONTROL_H */ + diff --git a/src/dsl_cpe_debug.c b/src/dsl_cpe_debug.c new file mode 100644 index 0000000..d5da6c7 --- /dev/null +++ b/src/dsl_cpe_debug.c @@ -0,0 +1,1099 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/* +Includes +*/ +#include "dsl_cpe_control.h" +#include "dsl_cpe_debug.h" +#include "drv_dsl_cpe_api_ioctl.h" +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + #include "drv_dsl_cpe_cmv_danube.h" +#endif + +#ifndef DSL_CPE_DEBUG_DISABLE + +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +DSL_CCA_debugDestinations_t DSL_CCA_g_dbgDestination = DSL_CCA_DBG_DST_CONSOLE; +#endif /* INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT */ + +/* Default initialization for all debug blocks */ +DSL_CCA_debugLevelEntry_t DSL_CCA_g_dbgLvl[DSL_CCA_DBG_MAX_ENTRIES] = { + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_NO_BLOCK" }, /* 00 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_APP" }, /* 01 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_OS" }, /* 02 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_CLI" }, /* 03 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_PIPE" }, /* 04 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_CONSOLE" }, /* 06 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_TCPMSG" }, /* 07 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_MULTIMODE" }, /* 08 */ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_NOTIFICATIONS" }, /* 09 */ + { DSL_CCA_DBG_NONE, "not used" }, /* 10 */ +}; + +#ifndef _lint +/* Initialization for all debug levels */ +DSL_CCA_debugLevelEntry_t DSL_CCA_g_dbgLvlNames[] = +{ + { DSL_CCA_DBG_NONE, "DSL_CCA_DBG_NONE" }, + { DSL_CCA_DBG_PRN, "DSL_CCA_DBG_PRN" }, + { DSL_CCA_DBG_ERR, "DSL_CCA_DBG_ERR" }, + { DSL_CCA_DBG_WRN, "DSL_CCA_DBG_WRN" }, + { DSL_CCA_DBG_MSG, "DSL_CCA_DBG_MSG" }, + { DSL_CCA_DBG_LOCAL, "DSL_CCA_DBG_LOCAL" }, +}; + +const DSL_uint8_t DSL_CCA_g_dbgLvlNumber = sizeof(DSL_CCA_g_dbgLvlNames) / sizeof(DSL_CCA_debugLevelEntry_t); +#endif /* _lint*/ + +DSL_CCA_debugLevels_t DSL_CCA_g_globalDbgLvl = DSL_CCA_DBG_LOCAL; + +#endif /* DSL_CPE_DEBUG_DISABLE */ + + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + +#define MEI_SPACE_ACCESS 0xBE116000 + +static DSL_CmvGroupEntry_t DSL_CmvGroups[] = +{ + { "optn", DSL_CMV_GROUP_OPTN }, + { "cnfg", DSL_CMV_GROUP_CNFG }, + { "cntl", DSL_CMV_GROUP_CNTL }, + { "stat", DSL_CMV_GROUP_STAT }, + { "rate", DSL_CMV_GROUP_RATE }, + { "plam", DSL_CMV_GROUP_PLAM }, + { "info", DSL_CMV_GROUP_INFO }, + { "test", DSL_CMV_GROUP_TEST }, + { "dsl", DSL_CMV_GROUP_DSL }, + { "", 0 } +}; +#endif /* #if defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + +DSL_Error_t DSL_strlwr(DSL_char_t *psStr) +{ + DSL_char_t *pChar = DSL_NULL; + + for(pChar = psStr; *pChar != '\0'; pChar++) + { + if ((*pChar >= 0x41) && (*pChar <= 0x5A)) + { + *pChar += 0x20; + } + } + return DSL_SUCCESS; +} + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) +void DSL_CMV_Prepare ( + DSL_uint8_t opcode, + DSL_uint8_t group, + DSL_uint16_t address, + DSL_uint16_t index, + DSL_int_t size, + DSL_uint16_t *data, + DSL_uint16_t *Message) +{ + memset (Message, 0, DSL_MAX_CMV_MSG_LENGTH * 2); + Message[0] = (opcode << 4) + (size & 0xf); + if (opcode == DSL_CMV_OPCODE_H2D_DEBUG_WRITE_DM) + { + Message[1] = (group & 0x7f); + } + else + { + Message[1] = (((index == 0) ? 0 : 1) << 7) + (group & 0x7f); + } + Message[2] = address; + Message[3] = index; + + if ((opcode == DSL_CMV_OPCODE_H2D_CMV_WRITE) || + (opcode == DSL_CMV_OPCODE_H2D_DEBUG_WRITE_DM)) + { + cpe_control_memcpy_s(&(Message[4]), (DSL_uint32_t)(size * 2), + data, (DSL_uint32_t)(size * 2)); + } + + return; +} +#endif /* #if defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + +DSL_Error_t DSL_CMV_Read ( + DSL_CPE_Control_Context_t * pContext, + DSL_char_t *str_group, + DSL_uint16_t address, + DSL_uint16_t index, + DSL_int_t size, + DSL_uint16_t *pData) +{ +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + DSL_uint8_t group = 0; + DSL_boolean_t bFound = DSL_FALSE; + DSL_CmvGroupEntry_t *pGroups = &DSL_CmvGroups[0]; + DSL_uint16_t Message[DSL_MAX_CMV_MSG_LENGTH]; + DSL_DeviceMessage_t msg; + + memset(&msg, 0, sizeof(DSL_DeviceMessage_t)); + + DSL_strlwr(str_group); + + for (;(pGroups->nGroupId != 0) && (strlen(pGroups->psGroupName) > 0); pGroups++) + { + if (strcmp (str_group, pGroups->psGroupName) == 0) + { + group = (DSL_uint8_t)(pGroups->nGroupId); + bFound = DSL_TRUE; + break; + } + } + + if (bFound == DSL_FALSE) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - CMV read, wrong group type" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + + DSL_CMV_Prepare (DSL_CMV_OPCODE_H2D_CMV_READ, group, address, index, size, DSL_NULL, Message); + msg.data.pMsg = (DSL_uint8_t *)Message; + msg.data.nSizeTx = 8; + msg.data.nSizeRx = (DSL_uint16_t)((size + DSL_CMV_HEADER_LENGTH) * 2); + if (DSL_CPE_Ioctl(pContext->fd[pContext->nDevNum], DSL_FIO_DBG_DEVICE_MESSAGE_SEND, (int)&msg) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - cr read %d %d %d fail" DSL_CPE_CRLF, group, address, index)); + + return DSL_ERROR; + } + + cpe_control_memcpy_s(pData, (DSL_uint32_t)(size * 2), &(Message[4]), (DSL_uint32_t)(size * 2)); + + return msg.accessCtl.nReturn; +#else + return DSL_ERR_NOT_IMPLEMENTED; +#endif /* #if defined (INCLUDE_DSL_CPE_API_DANUBE)*/ +} + + +DSL_Error_t DSL_CMV_Write ( + DSL_CPE_Control_Context_t *pContext, + DSL_char_t *str_group, + DSL_uint16_t address, + DSL_uint16_t index, + DSL_int_t size, + DSL_uint16_t *pData) +{ +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + DSL_uint8_t group = 0; + DSL_boolean_t bFound = DSL_FALSE; + DSL_CmvGroupEntry_t *pGroups = &DSL_CmvGroups[0]; + DSL_uint16_t Message[DSL_MAX_CMV_MSG_LENGTH]; + DSL_DeviceMessage_t msg; + + memset(&msg, 0, sizeof(DSL_DeviceMessage_t)); + + DSL_strlwr(str_group); + + for (;(pGroups->nGroupId != 0) && (strlen(pGroups->psGroupName) > 0); pGroups++) + { + if (strcmp (str_group, pGroups->psGroupName) == 0) + { + group = (DSL_uint8_t)pGroups->nGroupId; + bFound = DSL_TRUE; + break; + } + } + + if (bFound == DSL_FALSE) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - CMV write, wrong group type" DSL_CPE_CRLF)); + + return DSL_ERR_INVALID_PARAMETER; + } + + DSL_CMV_Prepare (DSL_CMV_OPCODE_H2D_CMV_WRITE, group, address, index, size, + pData, Message); + + msg.data.pMsg = (DSL_uint8_t *)Message; + msg.data.nSizeTx = (DSL_uint16_t)((size + DSL_CMV_HEADER_LENGTH) * 2); + msg.data.nSizeRx = 0; + if (DSL_CPE_Ioctl(pContext->fd[pContext->nDevNum], DSL_FIO_DBG_DEVICE_MESSAGE_SEND, (int)&msg) < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - cw %d %d %d failed" DSL_CPE_CRLF, group, address, index)); + + return DSL_ERR_MSG_EXCHANGE; + } + + return msg.accessCtl.nReturn; +#else + return DSL_ERR_NOT_IMPLEMENTED; +#endif /* #if defined (INCLUDE_DSL_CPE_API_DANUBE)*/ +} + +#ifdef DSL_DEBUG_TOOL_INTERFACE + +#ifndef DSL_CPE_IFX_LOW_DEV +#error "Please define low level device name!" +#endif + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_TCPMSG + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_TcpDebugMessageResourceUsageGet ( + DSL_CPE_Control_Context_t * pContext, + DSL_CPE_TcpDebugResourceUsageStatisticsData_t *pResUsage) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_CPE_TcpDebugClientInfo_t *clientInfo = DSL_NULL; +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + DSL_CPE_TcpDebugCliClientInfo_t *CliClientInfo = DSL_NULL; + DSL_int_t c = 0; +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + DSL_uint32_t devStaticMemUsage = 0, devDynamicMemUsage = 0; + + if (pContext == DSL_NULL || + pResUsage == DSL_NULL) + { + return DSL_ERROR; + } + + pResUsage->staticMemUsage = 0; + pResUsage->dynamicMemUsage = 0; + + if (pContext->pDebugClientInfo != DSL_NULL) + { + pResUsage->dynamicMemUsage += DSL_FD_SETSIZE * sizeof(DSL_CPE_TcpDebugClientInfo_t); + + clientInfo = (DSL_CPE_TcpDebugClientInfo_t*)pContext->pDebugClientInfo; + + nRet = DSL_CPE_DEV_TcpDebugMessageResourceUsageGet( + clientInfo, &devStaticMemUsage, &devDynamicMemUsage); + if (nRet != DSL_SUCCESS) + { + return nRet; + } + + pResUsage->staticMemUsage += devStaticMemUsage; + pResUsage->dynamicMemUsage += devDynamicMemUsage; + } + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT + if (pContext->pDebugCliClientInfo != DSL_NULL) + { + CliClientInfo = (DSL_CPE_TcpDebugCliClientInfo_t*)pContext->pDebugCliClientInfo; + + pResUsage->dynamicMemUsage += DSL_FD_SETSIZE * sizeof(DSL_CPE_TcpDebugCliClientInfo_t); + + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + if (CliClientInfo[c].buf != DSL_NULL) + { + pResUsage->dynamicMemUsage += DSL_CPE_TCP_CLI_COMMAND_LENGTH_MAX; + } + } + } +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + + return DSL_SUCCESS; +} +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +/* Tcp messages debug handler */ +DSL_int_t DSL_CPE_TcpDebugMessageHandle (DSL_CPE_Thread_Params_t *params ) +{ + DSL_int_t sockfd, nRet; + DSL_int_t width; + DSL_CPE_fd_set_t readFds,tempFds; + DSL_Socket_t socketaccept; + DSL_sockaddr_in_t my_addr; + /* client address*/ + DSL_sockaddr_in_t remoteaddr; +#ifdef LINUX + DSL_int_t so_reuseaddr=1; + DSL_int_t so_keepalive =1 ; + DSL_int_t so_debug =1; + DSL_TimeVal_t tv_sendtimeout; + DSL_SockOptLinger_t struct_lg; +#endif /* LINUX*/ + DSL_int_t c; + /*number of requests*/ + DSL_int_t n=0; + /* stores the client information */ + DSL_CPE_TcpDebugClientInfo_t *clientInfo; + DSL_int_t nClients=0; + DSL_CPE_Control_Context_t *pCtrlContext = (DSL_CPE_Control_Context_t*)params->nArg1; + + /**$$ND FIXME: all linux and BSD sockets calls should be renamed to DSL_xxx() */ + + /* init variables */ + memset((char *) &readFds, 0x0, sizeof(DSL_CPE_fd_set_t)); + memset((char *) &tempFds, 0x0, sizeof(DSL_CPE_fd_set_t)); + + /* Socket Address */ + memset((char *) &my_addr, '\0', sizeof(DSL_sockaddr_in_t)); + my_addr.sin_family = AF_INET; + /* Listens at port g_nTcpMessagesSocketPort */ + my_addr.sin_port = DSL_CPE_Htons(g_nTcpMessagesSocketPort); + + if (g_sTcpMessagesSocketAddr) + { + if (DSL_CPE_StringToAddress(g_sTcpMessagesSocketAddr, &my_addr.sin_addr) == 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - invalid IP address specified" DSL_CPE_CRLF)); + + return -1; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "TCP messages debug server: Address: %s" DSL_CPE_CRLF, + DSL_CPE_AddressToString(my_addr.sin_addr))); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Using multihomed host for TCP messages..." DSL_CPE_CRLF)); + my_addr.sin_addr.s_addr = DSL_CPE_Htonl(DSL_CPE_INADDR_ANY); + } + + /* Initialise file descriptor to zero */ + DSL_CPE_FD_ZERO(&readFds); + DSL_CPE_FD_ZERO(&tempFds); + + /* Set up socket parameters */ + if ((DSL_CPE_Socket(SOCK_STREAM, (DSL_Socket_t*)&sockfd)) == -1) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Socket was not created" DSL_CPE_CRLF)); + return 0; + } + +#ifdef LINUX + /*$$ ND: I'm not sure whether all of options below are supported + by another OS than Linux */ + + /* set the socket to be reuseable */ + DSL_CPE_SockOptSet(sockfd, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddr, + sizeof(so_reuseaddr)); + + /* set up the struct timeval for the timeout If connected socket fails + to respond to these messages, the connection is broken and processes + writing to that socket are notified with an ENETRSET errno. This option + takes an int value in the optval argument. This is a BOOL option */ + DSL_CPE_SockOptSet(sockfd, SOL_SOCKET, SO_KEEPALIVE, &so_keepalive, + sizeof(so_keepalive) ); + + /* SO_DEBUG */ + /* Enables recording of debugging information */ + DSL_CPE_SockOptSet(sockfd, SOL_SOCKET, SO_DEBUG, &so_debug, sizeof(so_debug) ); + + /* SO_LINGER linger on close if data present SO_LINGER controls the action + taken when unsent messages are queued on socket and a close(2) + is performed */ + struct_lg.l_onoff=0; + struct_lg.l_linger=0; + DSL_CPE_SockOptSet(sockfd, SOL_SOCKET, SO_LINGER, &struct_lg, + sizeof(DSL_SockOptLinger_t) ); + + /* SO_RCVTIME0 and SO_SNDTIME0 Specify the sending or receiving timeouts + until reporting an error. They are fixed to a protocol specific setting + in Linux adn cannot be read or written They can be easily emulated + using alarm */ + tv_sendtimeout.tv_sec=60; + tv_sendtimeout.tv_usec=0; + DSL_CPE_SockOptSet(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv_sendtimeout, sizeof(DSL_TimeVal_t) ); +#endif /* LINUX*/ +#if 0 + if (jtag_debug_enable) + { + if(ioctl(nLowFd, IFX_ADSL_BSP_IOC_JTAG_ENABLE)!=MEI_SUCCESS) + { + printf("\n IFX_ADSL_BSP_IOC_JTAG_ENABLE failed"); + close(nLowFd); + return -1; + } + } +#endif + + clientInfo = DSL_CPE_Malloc(DSL_FD_SETSIZE * sizeof(DSL_CPE_TcpDebugClientInfo_t)); + if (clientInfo == DSL_NULL) + { + DSL_CPE_SocketClose(sockfd); + return -1; + } + + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + clientInfo[c].fd = -1; + clientInfo[c].pDevData = DSL_NULL; + } + + /* Set info in the Control Context*/ + pCtrlContext->pDebugClientInfo = clientInfo; + + if (DSL_CPE_SocketBind(sockfd, &my_addr) == -1) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "TCP Debug ERROR - Could not bind to socket!" DSL_CPE_CRLF)); + } + else + { + if (listen(sockfd, 1) == -1) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "TCP Debug ERROR - Listening Error" DSL_CPE_CRLF)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "TCP Debug socket is listening connection %s:%d" DSL_CPE_CRLF, + g_sTcpMessagesSocketAddr, g_nTcpMessagesSocketPort)); + + c = 0; + +#if 0 + if (firmare_flag) + { + nRet = Download_Firmware(filename,nLowFd); + nRet=ioctl(nLowFd, IFX_ADSL_BSP_IOC_DSLSTART, NULL); + } + + if (ioctl(nLowFd, AUTOBOOT_CONTROL_SET , 0)<0) + { + printf("\n\n mei ioctl AUTOBOOT_CONTROL_SET fail.\n"); + } +#endif + + DSL_CPE_FD_SET(sockfd, &readFds); + + width = sockfd + 1; + /* Listen to the selected port */ + while(1) + { + /* Update the local file descriptor by the copy in the task parameter */ + cpe_control_memcpy_s(&tempFds, sizeof(DSL_CPE_fd_set_t), &readFds, sizeof(readFds)); + + /* Wait for incoming events */ + n = DSL_CPE_Select(width, &tempFds, + &tempFds, DSL_CPE_TCP_LISTEN_SELECT_TIMEOUT); + + if ((n == 0) && (params->bShutDown == 1)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "%s thread prepare to shutdown, close conection %s:%d" DSL_CPE_CRLF, + "tcpmsg", g_sTcpMessagesSocketAddr, g_nTcpMessagesSocketPort)); + break; + } + + /* Look if messages were received */ + /* New connection */ + if (DSL_CPE_FD_ISSET(sockfd,&tempFds)) + { + /* Received socket stream Accept connection from socket*/ + socketaccept = DSL_CPE_Accept(sockfd, &remoteaddr); + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Connected from %s, sock = %d." DSL_CPE_CRLF, + DSL_CPE_AddressToString(remoteaddr.sin_addr), socketaccept)); + + /* store information to clientInfo table */ + for (c = 0; c < FD_SETSIZE; c++) + { + if (nClients >= FD_SETSIZE) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Too many clients" DSL_CPE_CRLF)); + + DSL_CPE_SocketClose(socketaccept); + continue; + } + + if (clientInfo[c].fd < 0) + { + /* try to create FILE structure for socket */ + clientInfo[c].fd = (DSL_int_t)socketaccept; + clientInfo[c].client_addr = remoteaddr; + nClients++; + + /* update fd to readFds */ + if ((DSL_int_t)socketaccept >= width) + width = (DSL_int_t)socketaccept + 1; + DSL_CPE_FD_SET((DSL_int_t)socketaccept,&readFds); + n--; + + break; + } + } + } + + /* check fd for all clients */ + for (c = 0; c < FD_SETSIZE; c++) + { + if (n==0) + { + break; + } + + if ((socketaccept = (DSL_Socket_t)clientInfo[c].fd) < 0) + { + continue; + } + + + /* Check for receive time-out */ + if (FD_ISSET((DSL_int_t)socketaccept ,&tempFds)) + { + n--; + nRet = DSL_CPE_DEV_TcpMessageHandle(&clientInfo[c]); + if (nRet == -ENODATA) /* read 0 bytes, client closed the connection */ + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "Connection closed from %s." DSL_CPE_CRLF, + DSL_CPE_AddressToString(clientInfo[c].client_addr.sin_addr))); + + DSL_CPE_SocketClose(socketaccept); + DSL_CPE_FD_CLR((DSL_int_t)socketaccept,&readFds); + clientInfo[c].fd = -1; + + if (clientInfo[c].pDevData) + { + DSL_CPE_DEV_DeviceDataFree(clientInfo[c].pDevData); + clientInfo[c].pDevData = DSL_NULL; + } + + nClients--; + } + } + } + } + } + } + + /* Free device data*/ + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + if ((socketaccept = (DSL_Socket_t)clientInfo[c].fd) != -1) + { + DSL_CPE_SocketClose(socketaccept); + } + if (clientInfo[c].pDevData) + { + + DSL_CPE_DEV_DeviceDataFree(clientInfo[c].pDevData); + } + } + + DSL_CPE_Free(clientInfo); + + DSL_CPE_SocketClose(sockfd); + + return 0; +} + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +/* + Start TCP message debug interface thread +*/ +DSL_Error_t DSL_CPE_TcpDebugMessageIntfStart ( + DSL_CPE_Control_Context_t *pContext, + DSL_uint16_t nTcpListenPort, + DSL_char_t *sTcpServerIp) +{ + g_nTcpMessagesSocketPort = nTcpListenPort; + + /* sTcpServerIp == g_sTcpMessagesSocketAddr for startup 't' option case*/ + /* sTcpServerIp != g_sTcpMessagesSocketAddr for cli tcpmistart case*/ + if (g_sTcpMessagesSocketAddr != sTcpServerIp) + { + if (g_sTcpMessagesSocketAddr) + { + DSL_CPE_Free(g_sTcpMessagesSocketAddr); + } + g_sTcpMessagesSocketAddr = DSL_CPE_Malloc(strlen (sTcpServerIp) + 1); + if (g_sTcpMessagesSocketAddr) + { + cpe_control_strncpy_s(g_sTcpMessagesSocketAddr, strlen (sTcpServerIp) + 1, + sTcpServerIp, strlen (sTcpServerIp)); + } + } + + if (DSL_CPE_ThreadInit (&pContext->nTcpMsgHandler, "tcpmsg", DSL_CPE_TcpDebugMessageHandle, + DSL_CPE_TCP_MSG_STACKSIZE, DSL_CPE_TCP_MSG_PRIORITY, (DSL_uint32_t) pContext, 0) == 0) + { + /* return the task/process id */ + return DSL_SUCCESS; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP message debug interface thread start error" DSL_CPE_CRLF)); + + return DSL_ERROR; +} + +DSL_Error_t DSL_CPE_TcpDebugMessageIntfStop( + DSL_CPE_Control_Context_t *pContext) +{ + if (DSL_CPE_ThreadDelete (&pContext->nTcpMsgHandler, + DSL_CPE_TCP_THREAD_SHUTDOWN_TIMEOUT) == DSL_SUCCESS) + { + if(g_sTcpMessagesSocketAddr != DSL_NULL) + { + DSL_CPE_Free (g_sTcpMessagesSocketAddr); + g_sTcpMessagesSocketAddr = DSL_NULL; + } + + g_nTcpMessagesSocketPort = 0; + + return DSL_SUCCESS; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP message debug interface thread shutdown error" DSL_CPE_CRLF)); + + return DSL_ERROR; +} + +DSL_int_t DSL_CPE_TcpCliHandle( + DSL_CPE_Control_Context_t *pCtx, + DSL_CPE_TcpDebugCliClientInfo_t *pClient, + DSL_int_t socketaccept) +{ + DSL_int_t nBytesReceived; + DSL_char_t nCurrChar = 0; + DSL_char_t *pArg; + + /* receive command line */ + nBytesReceived = DSL_CPE_SocketRecv(socketaccept, (DSL_char_t *)&nCurrChar, + sizeof(nCurrChar)); + + /* Error or termination from host */ + if(nBytesReceived == 0) + { + return -ENODATA; + } + + /* TODO: Get system last error for analysis*/ + if(nBytesReceived < 0) + { + return 0; + } + + if (nCurrChar == '\r') + { + return 0; + } + + if (pClient->pPos == DSL_NULL) + { + pClient->pPos = pClient->buf; + } + + if ((nCurrChar == '\n') || (pClient->pPos >= pClient->buf + + DSL_CPE_TCP_CLI_COMMAND_LENGTH_MAX - 1)) + { + if (pClient->pPos == pClient->buf) + { + return 0; + } + + if (pClient->pPos > pClient->buf + DSL_CPE_TCP_CLI_COMMAND_LENGTH_MAX - 1) + { + pClient->pPos = 0; + return -EFAULT; + } + else + { + *(pClient->pPos) = '\0'; + pArg = strstr(pClient->buf, " "); + if (pArg == DSL_NULL) + { + pArg = pClient->pPos; + } + else + { + *pArg = '\0'; + pArg++; + } + + DSL_CPE_CliDeviceCommandExecute(pCtx, -1, pClient->buf, pArg, pClient->out); + pClient->pPos = 0; + } + } + else + { + *(pClient->pPos) = nCurrChar; + (pClient->pPos)++; + } + + return 0; +} + +/* TCP CLI debug handler */ +DSL_int_t DSL_CPE_TcpDebugCliHandle ( DSL_CPE_Thread_Params_t *params ) +{ + DSL_int_t nSockFd, nRet; + DSL_int_t nWidth; + DSL_CPE_fd_set_t readFds, tempFds; + DSL_Socket_t nSocketAccept; + DSL_sockaddr_in_t myAddr; + /* client address*/ + DSL_sockaddr_in_t remoteAddr; +#ifdef LINUX + DSL_int_t nSockOpt = 1; + DSL_TimeVal_t sendTimeout; + DSL_SockOptLinger_t structLg; +#endif + DSL_int_t c; + /*number of requests*/ + DSL_int_t n = 0; + /* stores the client information */ + DSL_CPE_TcpDebugCliClientInfo_t *clientInfo; + DSL_int_t nClients = 0; + DSL_CPE_Control_Context_t *pCtrlContext = (DSL_CPE_Control_Context_t*)params->nArg1; + + clientInfo = DSL_CPE_Malloc(DSL_FD_SETSIZE * sizeof(DSL_CPE_TcpDebugCliClientInfo_t)); + if (clientInfo == DSL_NULL) + { + return -1; + } + + /* init variables */ + memset((char *) &readFds, 0x0, sizeof(DSL_CPE_fd_set_t)); + memset((char *) &tempFds, 0x0, sizeof(DSL_CPE_fd_set_t)); + + /* Socket Address */ + memset((char *) &myAddr, '\0', sizeof(DSL_sockaddr_in_t)); + myAddr.sin_family = AF_INET; + myAddr.sin_port = DSL_CPE_Htons(DSL_CPE_TCP_CLI_PORT); /* Listens at port 2001 */ + + if (g_sTcpMessagesSocketAddr) + { + if (DSL_CPE_StringToAddress(g_sTcpMessagesSocketAddr, &myAddr.sin_addr) == 0) + { + DSL_CPE_Free(clientInfo); + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - invalid IP address specified" DSL_CPE_CRLF)); + + return -1; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "TCP CLI debug server: Address: %s" DSL_CPE_CRLF, + DSL_CPE_AddressToString(myAddr.sin_addr))); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Using multihomed host for TCP messages..." DSL_CPE_CRLF)); + + myAddr.sin_addr.s_addr = DSL_CPE_Htonl(DSL_CPE_INADDR_ANY); + } + + /* Initialise file descriptors to zero */ + DSL_CPE_FD_ZERO(&readFds); + DSL_CPE_FD_ZERO(&tempFds); + + /* Set up socket parameters */ + if ((DSL_CPE_Socket(SOCK_STREAM, (DSL_Socket_t*)&nSockFd)) == -1) + { + DSL_CPE_Free(clientInfo); + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Socket was not created" DSL_CPE_CRLF)); + return 0; + } + +#ifdef LINUX + /*$$ ND: I'm not sure whether all of options below are supported + by another OS than Linux */ + + /* set the socket to be reuseable */ + DSL_CPE_SockOptSet(nSockFd, SOL_SOCKET, SO_REUSEADDR, &nSockOpt, + sizeof(nSockOpt)); + + /* set up the struct timeval for the timeout If connected socket fails + to respond to these messages, the connection is broken and processes + writing to that socket are notified with an ENETRSET errno. This option + takes an int value in the optval argument. This is a BOOL option */ + nSockOpt = 1; + DSL_CPE_SockOptSet(nSockFd, SOL_SOCKET, SO_KEEPALIVE, &nSockOpt, + sizeof(nSockOpt) ); + + /* SO_DEBUG */ + /* Enables recording of debugging information */ + nSockOpt = 1; + DSL_CPE_SockOptSet(nSockFd, SOL_SOCKET, SO_DEBUG, &nSockOpt, sizeof(nSockOpt) ); + + /* SO_LINGER linger on close if data present SO_LINGER controls the action + taken when unsent messages are queued on socket and a close(2) + is performed */ + structLg.l_onoff=0; + structLg.l_linger=0; + DSL_CPE_SockOptSet(nSockFd, SOL_SOCKET, SO_LINGER, &structLg, + sizeof(DSL_SockOptLinger_t) ); + + /* SO_RCVTIME0 and SO_SNDTIME0 Specify the sending or receiving timeouts + until reporting an error. They are fixed to a protocol specific setting + in Linux adn cannot be read or written They can be easily emulated + using alarm */ + sendTimeout.tv_sec=60; + sendTimeout.tv_usec=0; + DSL_CPE_SockOptSet(nSockFd, SOL_SOCKET, SO_SNDTIMEO, &sendTimeout, + sizeof(DSL_TimeVal_t) ); +#endif + + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + clientInfo[c].fd = -1; + clientInfo[c].buf = 0; + } + + /* Set info in the Control Context*/ + pCtrlContext->pDebugCliClientInfo = clientInfo; + + if (DSL_CPE_SocketBind(nSockFd, &myAddr) == -1) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "TCP CLI ERROR - Could not bind to socket" DSL_CPE_CRLF)); + } + else + { + if (listen(nSockFd, 1) == -1) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "TCP CLI ERROR - Listening Error" DSL_CPE_CRLF)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "TCP CLI socket is listening connection %s:%d" DSL_CPE_CRLF, + g_sTcpMessagesSocketAddr, DSL_CPE_TCP_CLI_PORT)); + + c = 0; + + DSL_CPE_FD_SET(nSockFd, &readFds); + + nWidth = nSockFd + 1; + /* Listen to the selected port */ + while(1) + { + /* Update the local file descriptor by the copy in the task parameter */ + cpe_control_memcpy_s(&tempFds, sizeof(DSL_CPE_fd_set_t), + &readFds, sizeof(readFds)); + + /* Wait for incoming events */ + n = DSL_CPE_Select(nWidth, &tempFds, + &tempFds, DSL_CPE_TCP_LISTEN_SELECT_TIMEOUT); + + if ((n == 0) && (params->bShutDown == 1)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "%s thread prepare to shutdown, close connection %s:%d" DSL_CPE_CRLF, + "tcpcli", g_sTcpMessagesSocketAddr, DSL_CPE_TCP_CLI_PORT)); + break; + } + + /* Look if messages were received */ + /* New connection */ + if (DSL_CPE_FD_ISSET(nSockFd,&tempFds)) + { + /* Received socket stream Accept connection from socket*/ + nSocketAccept = DSL_CPE_Accept(nSockFd, &remoteAddr); + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Connected from %s" DSL_CPE_CRLF, DSL_CPE_AddressToString(remoteAddr.sin_addr))); + + /* store information to clientInfo table */ + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + if (nClients >= DSL_FD_SETSIZE) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Too many clients" DSL_CPE_CRLF)); + + DSL_CPE_SocketClose(nSocketAccept); + continue; + } + + if (clientInfo[c].fd < 0) + { + clientInfo[c].out = DSL_CPE_FdOpen((DSL_int_t)nSocketAccept, "w"); + if (clientInfo[c].out != DSL_NULL) + { + if (clientInfo[c].buf != DSL_NULL) + { + DSL_CPE_Free(clientInfo[c].buf); + } + + clientInfo[c].buf = + DSL_CPE_Malloc(DSL_CPE_TCP_CLI_COMMAND_LENGTH_MAX); + + if (clientInfo[c].buf == DSL_NULL) + { + DSL_CPE_SocketClose(nSocketAccept); + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Could not allocate buffer for CLI command" DSL_CPE_CRLF)); + } + else + { + clientInfo[c].fd = (DSL_int_t)nSocketAccept; + clientInfo[c].client_addr = remoteAddr; + nClients++; + /* update fd to readFds */ + if ((DSL_int_t)nSocketAccept >= nWidth) + { + nWidth = (DSL_int_t)nSocketAccept + 1; + } + + DSL_CPE_FD_SET((DSL_int_t)nSocketAccept,&readFds); + n--; + } + } + else + { + DSL_CPE_SocketClose(nSocketAccept); + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Could not create file structure for socket"DSL_CPE_CRLF)); + } + break; + } + } + } + + /* check fd for all clients */ + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + if (n == 0) + { + break; + } + + if ((nSocketAccept = (DSL_Socket_t)clientInfo[c].fd) < 0) + { + continue; + } + + /* Check for receive time-out */ + if (DSL_CPE_FD_ISSET((DSL_int_t)nSocketAccept, &tempFds)) + { + n--; + nRet = DSL_CPE_TcpCliHandle((DSL_CPE_Control_Context_t*) params->nArg1, + &clientInfo[c], (DSL_int_t)nSocketAccept); + + if (nRet == -ENODATA) /* read 0 bytes, client closed the connection */ + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "Connection closed from %s." DSL_CPE_CRLF, + DSL_CPE_AddressToString(clientInfo[c].client_addr.sin_addr))); + + if (clientInfo[c].out != DSL_NULL) + { + DSL_CPE_FClose(clientInfo[c].out); + clientInfo[c].out = DSL_NULL; + if (clientInfo[c].buf != DSL_NULL) + { + DSL_CPE_Free(clientInfo[c].buf); + clientInfo[c].buf = DSL_NULL; + } + } + else + { + DSL_CPE_SocketClose(nSocketAccept); + } + + DSL_CPE_FD_CLR((DSL_int_t)nSocketAccept, &readFds); + clientInfo[c].fd = -1; + nClients--; + } + } + } + } + } + } + + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + if ((nSocketAccept = (DSL_Socket_t)clientInfo[c].fd) != -1) + { + DSL_CPE_SocketClose(nSocketAccept); + } + if (clientInfo[c].buf != DSL_NULL) + { + DSL_CPE_Free(clientInfo[c].buf); + } + } + + DSL_CPE_SocketClose(nSockFd); + + return 0; +} + +/* + Start TCP CLI debug interface thread +*/ +DSL_Error_t DSL_CPE_TcpDebugCliIntfStart ( + DSL_CPE_Control_Context_t * pContext, + DSL_boolean_t bEnableTcpCli) +{ + g_bEnableTcpCli = bEnableTcpCli; + if (!g_bEnableTcpCli) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "WARNING - TCP CLI debug interface disabled" DSL_CPE_CRLF)); + + return DSL_SUCCESS; + } + + if (DSL_CPE_ThreadInit (&pContext->nTcpCliHandler, "tcpcli", DSL_CPE_TcpDebugCliHandle, + 2*DSL_CPE_TCP_MSG_STACKSIZE, DSL_CPE_TCP_MSG_PRIORITY, (DSL_uint32_t) pContext, 0) == 0) + { + return DSL_SUCCESS; + } + + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP CLI debug interface thread start error" DSL_CPE_CRLF)); + + return DSL_ERROR; +} + +DSL_Error_t DSL_CPE_TcpDebugCliIntfStop ( + DSL_CPE_Control_Context_t * pContext) +{ + if (!g_bEnableTcpCli) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "WARNING - TCP CLI debug interface disabled" DSL_CPE_CRLF)); + + return DSL_SUCCESS; + } + + if (DSL_CPE_ThreadDelete (&pContext->nTcpCliHandler, + DSL_CPE_TCP_THREAD_SHUTDOWN_TIMEOUT) == DSL_SUCCESS) + { + g_bEnableTcpCli = DSL_FALSE; + return DSL_SUCCESS; + } + + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - TCP CLI debug interface thread stop error" DSL_CPE_CRLF)); + + return DSL_ERROR; +} +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + +#endif diff --git a/src/dsl_cpe_debug.h b/src/dsl_cpe_debug.h new file mode 100644 index 0000000..60d8dd9 --- /dev/null +++ b/src/dsl_cpe_debug.h @@ -0,0 +1,388 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef _DSL_CPE_DEBUG_H +#define _DSL_CPE_DEBUG_H + +/** Defines the max. string length for group names (including termination '0') */ +#define DSL_MAX_CMV_NAME_LENGTH 5 + +/** Defines the max. string length for group names (excluding termination '0') */ +#define DSL_MAX_CMV_NAME_LENGTH_NO_TERM 4 + +/** + Max level of debug printouts. Compiler will automatically omit all debug + code during optimizations +*/ +#ifndef DSL_CCA_DBG_MAX_LEVEL +#define DSL_CCA_DBG_MAX_LEVEL DSL_CCA_DBG_ERR +#endif + +#define DSL_CCA_DBG_MAX_ENTRIES 11 + +#ifdef DSL_CCA_DBG_BLOCK +#undef DSL_CCA_DBG_BLOCK +#endif + +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_NO_BLOCK + +/** Definitions for defining the debug level. + The smaller the value the less debug output will be printed +*/ +typedef enum +{ + /** no output */ + DSL_CCA_DBG_NONE = 0x00, + /** */ + DSL_CCA_DBG_PRN = 0x01, + /** errors will be printed */ + DSL_CCA_DBG_ERR = 0x02, + /** warnings and errors are printed */ + DSL_CCA_DBG_WRN = 0x40, + /** verbose output */ + DSL_CCA_DBG_MSG = 0x80, + /** */ + DSL_CCA_DBG_LOCAL = 0xFF +} DSL_CCA_debugLevels_t; + +/** + Defines all available debug modules +*/ +typedef enum +{ + /** no block selected */ + DSL_CCA_DBG_NO_BLOCK = 0, + /** Application function block */ + DSL_CCA_DBG_APP = 1, + /** Operating system block */ + DSL_CCA_DBG_OS = 2, + /** CLI specific block */ + DSL_CCA_DBG_CLI = 3, + /** Pipe specific block */ + DSL_CCA_DBG_PIPE = 4, + /** Console specific block */ + DSL_CCA_DBG_CONSOLE = 6, + /** TCP Message specific block */ + DSL_CCA_DBG_TCPMSG = 7, + /** Multimode debug messages */ + DSL_CCA_DBG_MULTIMODE = 8, + /** Debug output for notification related information's. + The related output can be used to checked that DSL Subsystem 'deliveres' + the required information towards the higher layer. For example the script + notification handling that includes important information for TC-Layer + configuration requirement. */ + DSL_CCA_DBG_NOTIFICATIONS = 9, + /** Last entry for debug blocks - only used as delimiter! */ + DSL_CCA_DBG_LAST_BLOCK +} DSL_CCA_debugModules_t; + +/** + Structure that is used to build up a list of debug modules and its names. + Structure that is used for printing out the names of available debug levels only. +*/ +typedef struct +{ + /** Debug level according to debug level definition */ + DSL_CCA_debugLevels_t nDbgLvl; + /** Name of debug level */ + DSL_char_t *pcName; +} DSL_CCA_debugLevelEntry_t; + +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +/** + Definitions for defining the debug destination. +*/ +typedef enum +{ + /** output will be passed to the console */ + DSL_CCA_DBG_DST_CONSOLE = 0x00, + /** output will be passed to the logger application */ + DSL_CCA_DBG_DST_LOGGER = 0x01 +} DSL_CCA_debugDestinations_t; +#endif /* INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT */ + +#define DSL_CCA_DBG_MAX_PRINT_CHAR 256 + +#undef DSL_CCA_DBG_PRINTF +/** debug outputs mapped to standard special DSL printf() function */ +#define DSL_CCA_DBG_PRINTF (void) DSL_CPE_debug_printf + + +/* Macro __FUNCTION__ defined in C99, use it if available, define empty macro if not. */ + +#if defined( __FUNCTION__) +/** debug print function */ +#define DSL_CCA_DBG_PRINTF_FUNCTION DSL_CCA_DBG_PRINTF(DSL_NULL, __FUNCTION__) +#else +/** debug print function */ +#define DSL_CCA_DBG_PRINTF_FUNCTION do {} while(0) +#endif + +#ifdef DSL_CPE_DEBUG_DISABLE + + /* + * Kill debug defines for maximum speed and minimum code size. + */ + + /** Macro to print debug info contained in "body" with a prepended header that + contains current file name, current function name (if available) and + current source line no. */ + #define DSL_CCA_DEBUG_HDR(level, body) ((void)0) + /** Macro to just print debug body without header. */ + #define DSL_CCA_DEBUG(level, body) ((void)0) + /** Terminate execution if assertion fails */ + #define DSL_CCA_ASSERT(exp) ((void)0) + +#else + +/** + Macro to print debug info contained in "body" with a prepended header that + contains current file name, current function name (if available) and + current source line no. + This macro does not exist for dumping information to a external + application using a registered callback. Thus it should be only used for + critical errors that will be printed to the standard output (console) + in any case. */ +#define DSL_CCA_DEBUG_HDR(level, body) \ +{ \ + /*lint -save -e568 -e685 -e774 -e506 */ \ + /* Warning 568 non-negative quantity is never less than zero */ \ + /* Warning 685 Relational operator '<=' always evaluates to 'true' */ \ + if ( (DSL_CCA_DBG_MAX_LEVEL >= level) && \ + ((((level) <= DSL_CCA_g_dbgLvl[DSL_CCA_DBG_BLOCK].nDbgLvl) && (DSL_CCA_g_globalDbgLvl == DSL_CCA_DBG_LOCAL)) \ + || (((level) <= DSL_CCA_g_globalDbgLvl) && (DSL_CCA_g_globalDbgLvl != DSL_CCA_DBG_LOCAL)))) \ + { \ + DSL_CCA_DBG_PRINTF(DSL_NULL, __FILE__":"); \ + DSL_CCA_DBG_PRINTF_FUNCTION; \ + DSL_CCA_DBG_PRINTF(DSL_NULL, ":Line %i:" DSL_CPE_CRLF,__LINE__); \ + DSL_CCA_DBG_PRINTF body; \ + } \ + /*lint -restore */ \ +} + +/** + Macro to dump debug body if line is in specified range for debug output + and if the debug level is set to an appropriate value. + The handling of the debug output is related to the former registration of + a callback function as follows: + + Callback function is registered + The debug string will be passed to the upper layer software using the + callback itself in case of appropriate debug level. + + NO callback function is registered + The debug string will be printed to the standard output (console) in + case of appropriate debug level. + + \attention The implementation of this macro needs a valid context pointer + from the DSL API. Thus you shall use this macro AFTER complete + initialization of the DSL API only! +*/ +#define DSL_CCA_DEBUG(level, body) \ +{ \ + /*lint -save -e568 -e685 -e774 -e506 */ \ + /* Warning 568 non-negative quantity is never less than zero */ \ + /* Warning 685 Relational operator '<=' always evaluates to 'true' */ \ + if ( (DSL_CCA_DBG_MAX_LEVEL >= level) ) \ + { \ + if ( ((((level) <= DSL_CCA_g_dbgLvl[DSL_CCA_DBG_BLOCK].nDbgLvl) && (DSL_CCA_g_globalDbgLvl == DSL_CCA_DBG_LOCAL))) \ + || (((level) <= DSL_CCA_g_globalDbgLvl) && (DSL_CCA_g_globalDbgLvl != DSL_CCA_DBG_LOCAL)) ) \ + { \ + DSL_CCA_DBG_PRINTF body; \ + } \ + } \ + /*lint -restore */ \ +} + + +/** Macro to get debug level for actual debug block */ +#define DSL_CCA_DEBUG_LEVEL_GET (DSL_CCA_g_dbgLvl[DSL_CCA_DBG_BLOCK].nDbgLvl) + + +/** Terminate execution if assertion fails */ +#define DSL_CCA_ASSERT(exp) \ +{ \ + if (!(exp)) \ + { \ + DSL_CCA_DBG_PRINTF(DSL_NULL, __FILE__":"); \ + DSL_CCA_DBG_PRINTF_FUNCTION; \ + DSL_CCA_DBG_PRINTF(DSL_NULL, ":Line %i:" DSL_CPE_CRLF,__LINE__); \ + DSL_CCA_DBG_PRINTF(DSL_NULL, "Assertion failed." DSL_CPE_CRLF ); \ + while(1) ; \ + } \ +} + +/* Import global variables from lib_dsl_debug.c */ + +extern DSL_CCA_debugLevelEntry_t DSL_CCA_g_dbgLvl[DSL_CCA_DBG_MAX_ENTRIES]; +extern DSL_CCA_debugLevels_t DSL_CCA_g_globalDbgLvl; +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +extern DSL_CCA_debugDestinations_t DSL_CCA_g_dbgDestination; +#endif /* INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT */ +#ifndef _lint +extern DSL_CCA_debugLevelEntry_t DSL_CCA_g_dbgLvlNames[]; +extern const DSL_uint8_t DSL_CCA_g_dbgLvlNumber; +#endif /* _lint*/ +#endif /* ifdef DSL_CPE_DEBUG_DISABLE */ + + +/** + A structure for event type<->string conversion tables. +*/ +typedef struct +{ + /** group name string */ + DSL_char_t *psGroupName; + /** group ID */ + DSL_int_t nGroupId; +} DSL_CmvGroupEntry_t; + + +DSL_Error_t DSL_CMV_Read +( + DSL_CPE_Control_Context_t *pContext, + DSL_char_t *str_group, + DSL_uint16_t address, + DSL_uint16_t index, + DSL_int_t size, + DSL_uint16_t *pData +); + +DSL_Error_t DSL_CMV_Write +( + DSL_CPE_Control_Context_t *pContext, + DSL_char_t *str_group, + DSL_uint16_t address, + DSL_uint16_t index, + DSL_int_t size, + DSL_uint16_t *pData +); + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) +void DSL_CMV_Prepare +( + DSL_uint8_t opcode, + DSL_uint8_t group, + DSL_uint16_t address, + DSL_uint16_t index, + DSL_int_t size, + DSL_uint16_t *data, + DSL_uint16_t *Message +); +#endif /* defined (INCLUDE_DSL_CPE_API_DANUBE)*/ + +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + #include "dsl_cpe_debug_danube.h" +#elif defined (INCLUDE_DSL_CPE_API_VRX) + #include "dsl_cpe_debug_vrx.h" +#else + #error "xDSL chip not specified!" +#endif + +/** TCP messages debug stuff, for Danube for the time present */ + +#ifdef DSL_DEBUG_TOOL_INTERFACE + +/* Tcp debug messages stuff */ + +typedef struct { + DSL_int_t fd; + DSL_sockaddr_in_t client_addr; + DSL_void_t *pDevData; +} DSL_CPE_TcpDebugClientInfo_t; + +#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT +typedef struct { + DSL_int_t fd; + DSL_sockaddr_in_t client_addr; + DSL_char_t *buf; + DSL_char_t *pPos; + DSL_CPE_File_t *out; +} DSL_CPE_TcpDebugCliClientInfo_t; +#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/ + +/** + This structure is used to get resource usage statistics + data +*/ +typedef struct +{ + /** + Total memory allocated statically (bytes) */ + DSL_uint32_t staticMemUsage; + /** + Total memory allocated dynamically (bytes) */ + DSL_uint32_t dynamicMemUsage; +} DSL_CPE_TcpDebugResourceUsageStatisticsData_t; + +DSL_void_t DSL_CPE_DEV_DeviceDataFree(DSL_void_t *pDevData); + +DSL_int_t DSL_CPE_DEV_TcpMessageHandle +( + DSL_CPE_TcpDebugClientInfo_t *pDevData +); + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_DEV_TcpDebugMessageResourceUsageGet( + DSL_CPE_TcpDebugClientInfo_t *clientInfo, + DSL_uint32_t *pStaticMemUsage, + DSL_uint32_t *pDynamicMemUsage); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_TcpDebugMessageResourceUsageGet ( + DSL_CPE_Control_Context_t * pContext, + DSL_CPE_TcpDebugResourceUsageStatisticsData_t *pResUsage); +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +DSL_Error_t DSL_CPE_TcpDebugMessageIntfStart ( + DSL_CPE_Control_Context_t * pContext, + DSL_uint16_t nTcpListenPort, DSL_char_t *sTcpServerIp); + +DSL_Error_t DSL_CPE_TcpDebugMessageIntfStop ( + DSL_CPE_Control_Context_t * pContext); + +DSL_Error_t DSL_CPE_TcpDebugCliIntfStart ( + DSL_CPE_Control_Context_t * pContext, + DSL_boolean_t bEnableTcpCli); + +DSL_Error_t DSL_CPE_TcpDebugCliIntfStop ( + DSL_CPE_Control_Context_t * pContext); + +#ifdef DSL_DEBUG_TOOL_INTERFACE +/** TCP messages server ip address */ +extern DSL_char_t *g_sTcpMessagesSocketAddr; +/** TCP messages server port */ +extern DSL_uint16_t g_nTcpMessagesSocketPort; +extern DSL_boolean_t g_bEnableTcpCli; +#endif + +/** TCP messages server port */ +#define DSL_CPE_TCP_MESSAGES_PORT 2000 + +/** default value for enabling TCP CLI */ +#define DSL_CPE_ENABLE_TCP_CLI_DEFAULT DSL_TRUE + +/** TCP CLI server port */ +#define DSL_CPE_TCP_CLI_PORT 2001 + +/** TCP CLI command maximum length */ +#define DSL_CPE_TCP_CLI_COMMAND_LENGTH_MAX 2048 + +/** TCP messages select timeout */ +#define DSL_CPE_TCP_LISTEN_SELECT_TIMEOUT 100 + +/** TCP messages thread shutdown timeout */ +#define DSL_CPE_TCP_THREAD_SHUTDOWN_TIMEOUT 1000 + +#endif /* #ifdef DSL_DEBUG_TOOL_INTERFACE*/ + +#endif /* _DSL_CPE_DEBUG_H */ + diff --git a/src/dsl_cpe_debug_vrx.c b/src/dsl_cpe_debug_vrx.c new file mode 100644 index 0000000..e37f7b5 --- /dev/null +++ b/src/dsl_cpe_debug_vrx.c @@ -0,0 +1,1649 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/* +Includes +*/ +#include "dsl_cpe_control.h" + +#if defined(INCLUDE_DSL_CPE_API_VRX) + +#include "dsl_cpe_debug.h" +#include "drv_dsl_cpe_api_ioctl.h" + +#ifdef DSL_DEBUG_TOOL_INTERFACE + +/** TCP messages debug stuff */ +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_TCPMSG + +extern DSL_char_t *g_sFirmwareName2; + +/* =============================================== */ +/* Functions to swap between H&N byteorder */ +/* =============================================== */ + +/* swap an CMV 32 bit payload from net to host order */ +#define N2H_SWAP_CMV_PAYL_32v16(val_32bit) \ + ( (ntohs(((DSL_uint16_t)(((val_32bit) & 0xFFFF0000) >> 16)))) \ + | ((ntohs((DSL_uint16_t)((val_32bit) & 0x0000FFFF))) << 16) ) + +/* swap an CMV 32 bit payload from host to net order */ +#define H2N_SWAP_CMV_PAYL_32v16(val_32bit) \ + ( (htons(((DSL_uint16_t)(((val_32bit) & 0xFFFF0000) >> 16)))) \ + | ((htons((DSL_uint16_t)((val_32bit) & 0x0000FFFF))) << 16) ) + + +/* swap an CMV 32 bit payload vs 2 16 bit CMV fields */ +#define SWAP_CMV_PAYL_32_VS_16BIT(x) ( (((x)&0xFFFF0000)>>16) \ + | (((x)&0x0000FFFF)<<16) ) + + +#if ((__BYTE_ORDER == __BIG_ENDIAN ) && (WINHOST_REMOTE_SW_BYTE_ORDER == __LITTLE_ENDIAN)) || \ + ((__BYTE_ORDER == __LITTLE_ENDIAN ) && (WINHOST_REMOTE_SW_BYTE_ORDER == __BIG_ENDIAN)) + +/** + Swap WORD fields (payload + header) within a CMV message from net to host order. + This function will be used to swap CMV message fields incoming form the net. +*/ +DSL_void_t N2H_SwapCmvBlockWord(CMV_MESSAGE_ALL_T *pCmvMsg, DSL_int_t startIdx, DSL_int_t count_16bit) +{ + DSL_int_t i; + + for (i=startIdx; i < (startIdx + count_16bit); i++) + { + pCmvMsg->rawMsg[i] = ntohs ( pCmvMsg->rawMsg[i] ); + } + return; +} + +/** + Swap WORD fields (payload + header) within a CMV message from host to net order. + This function will be used to swap CMV message fields outgoing to the net. +*/ +DSL_void_t H2N_SwapCmvBlockWord(CMV_MESSAGE_ALL_T *pCmvMsg, DSL_int_t startIdx, DSL_int_t count_16bit) +{ + DSL_int_t i; + + for (i=startIdx; i < (startIdx + count_16bit); i++) + { + pCmvMsg->rawMsg[i] = htons( pCmvMsg->rawMsg[i] ); + } + return; +} + +/** + Swap DWORD fields (payload) within a CMV message from net to host order. + This function will be used to swap CMV message fields incoming form the net. + +\remark + The incoming 32 bit payload is a 16 bit aligned CMV message. + --> Swap HI / LO 16 bit word from net to host order + --> Swap HI / LO word + +*/ +DSL_void_t N2H_SwapCmvPaylDWord(CMV_MESSAGE_ALL_T *pCmvMsg, DSL_int_t startIdx, DSL_int_t count_32bit) +{ + DSL_int_t i; + + for (i=startIdx; i < (startIdx + count_32bit); i++) + { + ((unsigned int *)pCmvMsg->rawMsg)[i] = + N2H_SWAP_CMV_PAYL_32v16(((unsigned int *)pCmvMsg->rawMsg)[i]); + } + return; +} + +/** + Swap DWORD fields (payload) within a CMV message from host to net order. + This function will be used to swap CMV message fields outgoing to the net. +*/ +DSL_void_t H2N_SwapCmvPaylDWord(CMV_MESSAGE_ALL_T *pCmvMsg, DSL_int_t startIdx, DSL_int_t count_32bit) +{ + DSL_int_t i; + for (i=startIdx; i < (startIdx + count_32bit); i++) + { + ((unsigned int *)pCmvMsg->rawMsg)[i] = + H2N_SWAP_CMV_PAYL_32v16(((unsigned int *)pCmvMsg->rawMsg)[i]); + } + return; +} +#endif + +/** + Swap DWORD fields (payload) within a CMV message from host to target order. + This function will be used to swap 32 bit CMV message fields outgoing to the + MEI interface. + +\remark + The CMV 32 bit payload into 2 a 16 bit aligned CMV message fields. + --> Swap HI / LO word + +*/ +DSL_void_t SwapCmvPayl_32vs16(CMV_MESSAGE_ALL_T *pCmvMsg, DSL_int_t startIdx, DSL_int_t count_32bit) +{ + DSL_int_t i; + for (i=startIdx; i < (startIdx + count_32bit); i++) + { + pCmvMsg->cmv.payload.params_32Bit[i] = + SWAP_CMV_PAYL_32_VS_16BIT(pCmvMsg->cmv.payload.params_32Bit[i]); + } + return; +} + +/* =============================================== */ +/* VRX device specific functions */ +/* =============================================== */ + +DSL_int_t DSL_CPE_VRX_LoadFirmwareFromFile( + DSL_char_t *psFirmwareName, + DSL_uint8_t **pFirmware, + DSL_uint32_t *pnFirmwareSize) +{ + DSL_int_t nRet = 0; + DSL_CPE_File_t *fd_image = DSL_NULL; + DSL_CPE_stat_t file_stat; + + *pnFirmwareSize = 0; + if (*pFirmware != DSL_NULL) + { + DSL_CPE_Free(*pFirmware); + *pFirmware = DSL_NULL; + } + + for (;;) + { + fd_image = DSL_CPE_FOpen (psFirmwareName, "rb"); + if (fd_image == DSL_NULL) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "open %s fail!"DSL_CPE_CRLF, psFirmwareName)); + + nRet = -1; + break; + } + + DSL_CPE_FStat (psFirmwareName, &file_stat); + *pnFirmwareSize = file_stat.st_size; + *pFirmware = DSL_CPE_Malloc (*pnFirmwareSize); + + if (*pFirmware == DSL_NULL) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + DSL_CPE_CRLF" firmware cannot be allocated: out of memory"DSL_CPE_CRLF)); + + nRet = -1; + break; + } + + if (DSL_CPE_FRead (*pFirmware, sizeof (DSL_uint8_t), *pnFirmwareSize, fd_image) <= 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + DSL_CPE_CRLF" firmware_image not present"DSL_CPE_CRLF)); + + nRet = -1; + break; + } + + break; + } + + if (fd_image != DSL_NULL) + { + DSL_CPE_FClose (fd_image); + fd_image = DSL_NULL; + } + + return nRet; +} + +static DSL_int_t DSL_CPE_VRX_DeviceStateCheck( + DSL_int_t fd) +{ + IOCTL_VRX_reqCfg_t Vdsl2_requCfg; + + memset(&Vdsl2_requCfg, 0x0, sizeof(IOCTL_VRX_reqCfg_t)); + + if (ioctl(fd, FIO_VRX_REQ_CONFIG, (DSL_int_t)&Vdsl2_requCfg) != 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ioct(FIO_VRX_REQ_CONFIG): ERROR - cannot request config, retCode = %d!"DSL_CPE_CRLF, + Vdsl2_requCfg.ictl.retCode)); + return -1; + } + + if (Vdsl2_requCfg.currDrvState != 6) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ioct(FIO_VRX_REQ_CONFIG): ERROR - device not available, state = %d!"DSL_CPE_CRLF, + Vdsl2_requCfg.currDrvState)); + return -1; + } + + return 0; +} + +/** + Builds the response message +*/ +static DSL_int_t DSL_CPE_VRX_ResponseMessage( + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + memset(pCmvMsg, 0x0, CMV_MESSAGE_SIZE); + CMV_MSGHDR_CODE_RESERVED_SET((pCmvMsg->cmv), 3); + CMV_MSGHDR_CODE_MBOX_CODE_SET((pCmvMsg->cmv), CMV_MBOX_CODE_ME_MSG); + CMV_MSGHDR_BIT_SIZE_SET((pCmvMsg->cmv), 1); + return 0; +} + + +/** + Send a message to the mailbox. + +\remark: + Because for Winhost the "raw" interface is used it is in responsibility of + the caller that the payload is already correct aligned. + +*/ +static DSL_int_t DSL_CPE_VRX_MailboxSend( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t msgSize_16bit, ret; + IOCTL_VRX_mboxSend_t DSL_Ioctl_DeviceArg; + CMV_MESSAGE_ALL_T CmvMsg_Ack; + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Start - send to mailbox"DSL_CPE_CRLF)); + + msgSize_16bit = CMV_MSGHDR_PAYLOAD_SIZE_GET(pCmvMsg->cmv) + CMV_HEADER_16BIT_SIZE; + + /* swap cmv payload (16 bit fields) from host order to target */ + switch (CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + case CMV_MSG_BIT_SIZE_16BIT: + /* nothing to do */ + break; + case CMV_MSG_BIT_SIZE_32BIT: + SWAP_CMV_PAYL_32_VS_16(pCmvMsg, 0, ((CMV_MSGHDR_PAYLOAD_SIZE_GET(pCmvMsg->cmv)) >> 1)); + break; + default: + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Swap Payload CMD Raw - invalid bit size 0x%X (32 bit)"DSL_CPE_CRLF, + CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv))); + break; + } + + DSL_Ioctl_DeviceArg.write_msg.pData_16 = (unsigned short *)pCmvMsg; + DSL_Ioctl_DeviceArg.write_msg.count_16bit = (unsigned int)msgSize_16bit; + + DSL_Ioctl_DeviceArg.ack_msg.pData_16 = (unsigned short *)(&CmvMsg_Ack); + DSL_Ioctl_DeviceArg.ack_msg.count_16bit = CMV_MESSAGE_SIZE / 2; + + ret = ioctl(fd, FIO_VRX_MBOX_MSG_RAW_SEND, (DSL_int_t)&DSL_Ioctl_DeviceArg); + if (ret < 0) + { + + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - send to mailbox failed !! - retCode = %d!"DSL_CPE_CRLF, + DSL_Ioctl_DeviceArg.ictl.retCode)); + + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE_TIMEOUT); + } + else + { + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Send to mailbox successful"DSL_CPE_CRLF)); + + cpe_control_memcpy_s(pCmvMsg, CMV_MESSAGE_SIZE, + &CmvMsg_Ack, sizeof(&CmvMsg_Ack)); + } + + + /* swap cmv payload (16 bit fields) from target to host order */ + switch (CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + case CMV_MSG_BIT_SIZE_16BIT: + /* nothing to do */ + break; + case CMV_MSG_BIT_SIZE_32BIT: + SWAP_CMV_PAYL_32_VS_16(pCmvMsg, 0, ((CMV_MSGHDR_PAYLOAD_SIZE_GET(pCmvMsg->cmv)) >> 1)); + break; + default: + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Swap Payload ACK Raw - invalid bit size 0x%X (32 bit)"DSL_CPE_CRLF, + CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv))); + break; + } + + return 0; +} + +DSL_int_t DSL_CPE_VRX_Reboot( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t nRet = 0; + DSL_char_t *pcFw = DSL_NULL, *pcFw2 = DSL_NULL; + DSL_AutobootLoadFirmware_t ldFw; + DSL_AutobootControl_t autobootCtrl; + DSL_AutobootStatus_t autobootStatus; +#ifdef INCLUDE_SMS00976338 + DSL_AutobootConfig_t pAcfg; +#endif /* #ifdef INCLUDE_SMS00976338*/ + DSL_CPE_Control_Context_t *pContext = DSL_NULL; + DSL_int_t nDevice = 0; + + nDevice = CMV_MSGHDR_CODE_PORT_NUMBER_GET(pCmvMsg->cmv); + + if (nDevice >= DSL_CPE_DSL_ENTITIES) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_CPE_VRX_MsgHandle : unsupported device number (%d)"DSL_CPE_CRLF, + nDevice)); + return -1; + } + + memset(&ldFw, 0, sizeof(DSL_AutobootLoadFirmware_t)); + + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + + if (strlen(g_sFirmwareName1) > 0) + { + pcFw = g_sFirmwareName1; + } + + if (strlen(g_sFirmwareName2) > 0) + { + pcFw2 = g_sFirmwareName2; + } + + if (pcFw != DSL_NULL) + { + nRet = DSL_CPE_VRX_LoadFirmwareFromFile( + pcFw, &ldFw.data.pFirmware, &ldFw.data.nFirmwareSize); + } + + if (pcFw2 != DSL_NULL) + { + nRet = DSL_CPE_VRX_LoadFirmwareFromFile( + pcFw2, &ldFw.data.pFirmware2, &ldFw.data.nFirmwareSize2); + } + + while(1) + { + pContext = DSL_CPE_GetGlobalContext(); + if (pContext == DSL_NULL) + { + nRet = -1; + break; + } +#ifdef INCLUDE_SMS00976338 + /* Set Special Autoboot Configuration Options*/ + g_bWaitBeforeConfigWrite[pContext->nDevNum] = DSL_TRUE; + g_bWaitBeforeLinkActivation[pContext->nDevNum] = DSL_FALSE; + g_bWaitBeforeRestart[pContext->nDevNum] = DSL_FALSE; + + g_bAutoContinueWaitBeforeConfigWrite[pContext->nDevNum] = DSL_FALSE; + g_bAutoContinueWaitBeforeLinkActivation[pContext->nDevNum] = DSL_TRUE; + g_bAutoContinueWaitBeforeRestart[pContext->nDevNum] = DSL_TRUE; + + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "Autoboot Configuration options changed: " + "bWaitBeforeConfigWrite=%u bWaitBeforeLinkActivation=%u bWaitBeforeRestart=%u " + "bAutoContinueWaitBeforeConfigWrite=%u bAutoContinueWaitBeforeLinkActivation=%u " + "bAutoContinueWaitBeforeRestart=%u" DSL_CPE_CRLF, + g_bWaitBeforeConfigWrite[pContext->nDevNum], g_bWaitBeforeLinkActivation[pContext->nDevNum], + g_bWaitBeforeRestart[pContext->nDevNum], g_bAutoContinueWaitBeforeConfigWrite[pContext->nDevNum], + g_bAutoContinueWaitBeforeLinkActivation[pContext->nDevNum], + g_bAutoContinueWaitBeforeRestart[pContext->nDevNum])); + + pAcfg.data.nStateMachineOptions.bWaitBeforeConfigWrite = + g_bWaitBeforeConfigWrite[pContext->nDevNum]; + + pAcfg.data.nStateMachineOptions.bWaitBeforeLinkActivation = + g_bWaitBeforeLinkActivation[pContext->nDevNum]; + + pAcfg.data.nStateMachineOptions.bWaitBeforeRestart = + g_bWaitBeforeRestart[pContext->nDevNum]; + + nRet = DSL_CPE_Ioctl (pContext->fd[nDevice], DSL_FIO_AUTOBOOT_CONFIG_SET, (int) &pAcfg); + + if (nRet < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "IOCTL (DSL_FIO_AUTOBOOT_CONFIG_SET) failed, nRet = %d!" + DSL_CPE_CRLF, pAcfg.accessCtl.nReturn)); + + nRet = -1; + break; + } +#endif /* #ifdef INCLUDE_SMS00976338*/ + if ( ((ldFw.data.pFirmware != DSL_NULL) && (ldFw.data.nFirmwareSize)) || + ((ldFw.data.pFirmware2 != DSL_NULL) && (ldFw.data.nFirmwareSize2)) ) + { + if (DSL_CPE_LINES_PER_DEVICE < 2) + { + memset(&autobootStatus, 0x00, sizeof(DSL_AutobootStatus_t)); + + nRet = (DSL_Error_t) DSL_CPE_Ioctl (pContext->fd[nDevice], + DSL_FIO_AUTOBOOT_STATUS_GET, (int) &autobootStatus); + + if (nRet < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "Reboot failed!"DSL_CPE_CRLF)); + break; + } + } + if (DSL_CPE_LINES_PER_DEVICE < 2 && ( (autobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_FW_WAIT) || + (autobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_STOPPED && + autobootStatus.data.nFirmwareRequestType != DSL_FW_REQUEST_NA)) ) + { + ldFw.data.bLastChunk = DSL_TRUE; + + nRet = (DSL_Error_t) DSL_CPE_Ioctl(pContext->fd[nDevice], + DSL_FIO_AUTOBOOT_LOAD_FIRMWARE, (DSL_int_t) &ldFw); + } + else + { + /* Trigger Autoboot restart sequence. FW binary will be requested + from the DSL CPE API driver later*/ + autobootCtrl.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL; + + nRet = (DSL_Error_t) DSL_CPE_Ioctl (pContext->fd[nDevice], + DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &autobootCtrl); + } + + if (nRet < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "Reboot failed!"DSL_CPE_CRLF)); + break; + } + else + { + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE_SUCCESS); + break; + } + } + else + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Both FW binaries are not specified!"DSL_CPE_CRLF)); + nRet = -1; + break; + } + } + + if (ldFw.data.pFirmware) + { + DSL_CPE_Free(ldFw.data.pFirmware); + } + + if (ldFw.data.pFirmware2) + { + DSL_CPE_Free(ldFw.data.pFirmware2); + } + + return nRet; +} + +DSL_int_t DSL_CPE_VRX_Halt( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE_SUCCESS); + + return 0; +} + +DSL_int_t DSL_CPE_VRX_Run( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE_SUCCESS); + + return 0; +} + +/** + Request information on the Mailbox size +*/ +DSL_int_t DSL_CPE_VRX_MailboxSize( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t ret; + DSL_uint32_t tmp; + IOCTL_VRX_reqCfg_t reqCfg; + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Mailbox size query"DSL_CPE_CRLF)); + + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + + memset(&reqCfg, 0x00, sizeof(IOCTL_VRX_reqCfg_t)); + + ret = ioctl(fd, FIO_VRX_REQ_CONFIG, (DSL_int_t)&reqCfg); + + if (ret != 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - Get cfg (payload size) failed - retCode = %d!"DSL_CPE_CRLF, + reqCfg.ictl.retCode)); + + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE_TIMEOUT); + } + else + { + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_MBOX_PAYLOAD_SIZE_REPLY); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 2); + + /* get the mimimal size between the driver's and the chip's mailbox size */ + /* the size is sent in 16bits */ + tmp = (reqCfg.drvArc2MeMbSize > reqCfg.Arc2MeOnlineMbSize) ? \ + reqCfg.Arc2MeOnlineMbSize : reqCfg.drvArc2MeMbSize; + (pCmvMsg->cmv).payload.params_16Bit[0] = (unsigned short)(tmp / 2); + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "ARC-to-ME Mailbox Payload Size = %d (16bit)"DSL_CPE_CRLF, tmp)); + + tmp = (reqCfg.drvMe2ArcMbSize > reqCfg.Me2ArcOnlineMbSize) ? \ + reqCfg.Me2ArcOnlineMbSize : reqCfg.drvMe2ArcMbSize; + (pCmvMsg->cmv).payload.params_16Bit[1] = (unsigned short)(tmp / 2); + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "ME-to-ARC Mailbox Payload Size = %d (16bit)"DSL_CPE_CRLF, tmp)); + } + + return 0; +} + +/** + Get directly a 32bits value from the MEI register. + --> VOS_Ioctl_Device(..., FIO_VRX_REG_GET, ...) +*/ +DSL_int_t DSL_CPE_VRX_GetReg( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t ret; + IOCTL_VRX_regInOut_t Vdsl2_RegIo; + + Vdsl2_RegIo.addr = (DSL_uint32_t)P_CMV_MSGHDR_MEI_ADDR_GET(pCmvMsg); + Vdsl2_RegIo.value = (DSL_uint32_t)0; + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ioct(FIO_VRX_REG_GET): MEI[0x%X]"DSL_CPE_CRLF, Vdsl2_RegIo.addr)); + + ret = ioctl(fd, FIO_VRX_REG_GET, (DSL_int_t)(&Vdsl2_RegIo)); + if (ret != 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - ioct(.., FIO_VRX_REG_GET, ..) - retCode = %d!"DSL_CPE_CRLF, Vdsl2_RegIo.ictl.retCode)); + + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE_MEI_REG_RD_ERROR); + } + else + { + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Get Reg --> MEI[0x%X] = 0x%X"DSL_CPE_CRLF, + Vdsl2_RegIo.addr, Vdsl2_RegIo.value)); + + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_DEBUG_READ_MEI_REPLY); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 1); + P_CMV_MSGHDR_MEI_ADDR_SET(pCmvMsg, ((unsigned short)Vdsl2_RegIo.addr) ); + CMV_MSGHDR_LENGTH_SET((pCmvMsg->cmv), 1); + (pCmvMsg->cmv).payload.params_16Bit[0] = (unsigned short)Vdsl2_RegIo.value; + } + + return 0; +} + +/** + Set directly a 32bit value to the MEI register. + --> VOS_Ioctl_Device(..., FIO_VRX_REG_SET, ...) +*/ +static DSL_int_t DSL_CPE_VRX_SetReg( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t ret; + IOCTL_VRX_regInOut_t Vdsl2_RegIo; + + Vdsl2_RegIo.addr = (DSL_uint32_t)P_CMV_MSGHDR_MEI_ADDR_GET(pCmvMsg); + Vdsl2_RegIo.value = (DSL_uint32_t)(pCmvMsg->cmv).payload.params_16Bit[0]; + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "ioct(FIO_VRX_REG_SET): MEI[0x%X] = 0x%X"DSL_CPE_CRLF, + Vdsl2_RegIo.addr, Vdsl2_RegIo.value)); + + ret = ioctl(fd, FIO_VRX_REG_SET, (DSL_int_t)&Vdsl2_RegIo); + if (ret != 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - ioct(.., FIO_VRX_REG_SET, ..) - retCode = %d!"DSL_CPE_CRLF, Vdsl2_RegIo.ictl.retCode)); + + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE_MEI_REG_WR_ERROR); + } + + else + { + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Set Reg --> MEI[0x%X] = 0x%08X"DSL_CPE_CRLF, + Vdsl2_RegIo.addr, Vdsl2_RegIo.value)); + + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_DEBUG_WRITE_MEI_REPLY); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + P_CMV_MSGHDR_MEI_ADDR_SET(pCmvMsg, ((unsigned short)Vdsl2_RegIo.addr) ); + CMV_MSGHDR_LENGTH_SET((pCmvMsg->cmv), 1); + } + + return 0; +} + +/** + check the bitsize to the corresponding address. +*/ +static DSL_int_t DSL_CPE_VRX_BitSizeCheck( + DSL_char_t *pStr, + CMV_MESSAGE_ALL_T *pCmvMsg, + DSL_uint32_t destAddr) +{ + /* prepare the CMV payload for return */ + switch (CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + break; + case CMV_MSG_BIT_SIZE_16BIT: + if(destAddr & 0x00000001) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR %s - addr 0x%08X missaligned (16 bit)"DSL_CPE_CRLF, pStr, destAddr)); + + return -1; + } + break; + case CMV_MSG_BIT_SIZE_32BIT: + if(destAddr & 0x00000003) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR %s - addr 0x%08X missaligned (32 bit)"DSL_CPE_CRLF, pStr, destAddr)); + + return -1; + } + break; + default: + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR %s - invalid bit size 0x%X (32 bit)"DSL_CPE_CRLF, pStr, CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv))); + + return -1; + } + + return 0; +} + +/** + Read the designed address using the Debug IF +*/ +static DSL_int_t DSL_CPE_VRX_ReadDebug( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t remainCnt_byte, tmpCnt; + DSL_uint32_t i, blkSize_byte; + DSL_int_t ret = DSL_SUCCESS; + DSL_uint32_t destAddr; + /* fix unsigned int tmpData; */ + DSL_uint32_t tmpData = 0; + DSL_char_t *pDest, *pTmp; + /* unsigned short *pDest16; */ + + IOCTL_VRX_dbgAccess_t vdsl2_dbg_access; + CMV_DEBUG_ACCESS_BUFFER_T buffer; + + /* swap ? */ + destAddr = P_CMV_MSGHDR_ADDR_LSW_GET(pCmvMsg) | + ( (P_CMV_MSGHDR_ADDR_MSW_GET(pCmvMsg) << 16) & 0xFFFF0000); + + if ( (DSL_CPE_VRX_BitSizeCheck("Debug Read", pCmvMsg, destAddr) ) != 0) + goto RESPONSE_ERROR; + + blkSize_byte = CMV_MSGHDR_LENGTH_GET(pCmvMsg->cmv) << CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv); + if (blkSize_byte > CMV_USED_PAYLOAD_8BIT_SIZE) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "ERROR Debug Read - size %d / max %d"DSL_CPE_CRLF, + blkSize_byte, CMV_USED_PAYLOAD_8BIT_SIZE)); + + goto RESPONSE_ERROR; + } + + remainCnt_byte = blkSize_byte; + pDest = (DSL_char_t*)(pCmvMsg->cmv.payload.params_8Bit); + + /* + the requested data block is not 32 bit aligned + */ + if(destAddr & 0x00000003) + { + tmpCnt = sizeof(DSL_uint32_t) - (destAddr & 0x00000003); + tmpCnt = (tmpCnt > remainCnt_byte) ? remainCnt_byte : tmpCnt; + + vdsl2_dbg_access.count = 1; + vdsl2_dbg_access.pData_32 = (unsigned int*)&tmpData; + vdsl2_dbg_access.dbgAddr = destAddr & ~0x00000003; + ret = ioctl(fd, FIO_VRX_DBG_LS_READ, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "ERROR Debug Read (unasigned cat) - retCode = %d"DSL_CPE_CRLF, + vdsl2_dbg_access.ictl.retCode)); + + goto RESPONSE_ERROR; + } + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug Read - cat (addr 0x%X, tmpCnt %d, remain %d) = 0x%08lX"DSL_CPE_CRLF, + destAddr, tmpCnt, remainCnt_byte, (unsigned long)tmpData)); + + pTmp = ((DSL_char_t *)&tmpData); + + /* receive data as 32 bit value --> swap to the corresponding target */ + switch(CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + /* tmpData = WH_SWAP_HOST32_TARGET8(tmpData); */ + + cpe_control_memcpy_s(pDest, (DSL_uint32_t)tmpCnt, + &pTmp[destAddr & 0x00000003], (DSL_uint32_t)tmpCnt); + break; + case CMV_MSG_BIT_SIZE_16BIT: + /* + tmpData = WH_SWAP_HOST32_TARGET16(tmpData); + */ + /* address has to be 16 bit aligned --> only 0x00 or 0x02 */ + cpe_control_memcpy_s(pDest, (DSL_uint32_t)tmpCnt, + &pTmp[destAddr & 0x00000003], (DSL_uint32_t)tmpCnt); + break; + case CMV_MSG_BIT_SIZE_32BIT: + /* no swap necessary */ + break; + default: + goto RESPONSE_ERROR; + } + + pDest += tmpCnt; + remainCnt_byte -= tmpCnt; + destAddr &= ~0x00000003; + destAddr += sizeof(DSL_uint32_t); + } + + /* + get the next block 32 bit aligend + */ + if (remainCnt_byte > 3) + { + /* fix tmpCnt = (remainCnt_byte & 0x00000003); */ + tmpCnt = (remainCnt_byte & ~0x00000003); + + vdsl2_dbg_access.count = ((DSL_uint32_t)tmpCnt) >> 2; + vdsl2_dbg_access.pData_32 = (unsigned int *) &buffer; + vdsl2_dbg_access.dbgAddr = destAddr; + ret = ioctl(fd, FIO_VRX_DBG_LS_READ, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Read - retCode = %d!"DSL_CPE_CRLF, + vdsl2_dbg_access.ictl.retCode)); + + goto RESPONSE_ERROR; + } + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug Read - 32 bit aligned (addr 0x%X, tmpCnt %d, remain %d) = 0x%08X"DSL_CPE_CRLF, + destAddr, tmpCnt, remainCnt_byte, buffer.params_32Bit[0])); + + /* receive data as 32 bit value --> swap to the corresponding target */ + switch(CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + #if 0 + for (i=0; i < (tmpCnt>>2); i++) + { + buffer.params_32Bit[i] = TCP_DEBUG_SWAP_HOST32_TARGET8(buffer.params_32Bit[i]); + } + #endif + break; + case CMV_MSG_BIT_SIZE_16BIT: + #if 0 + for (i=0; i < (tmpCnt>>2); i++) + { + buffer.params_32Bit[i] = TCP_DEBUG_SWAP_HOST32_TARGET16(buffer.params_32Bit[i]); + } + #endif + break; + case CMV_MSG_BIT_SIZE_32BIT: + for (i=0; i < (((DSL_uint32_t)tmpCnt)>>2); i++) + { + buffer.params_32Bit[i] = TCP_DEBUG_SWAP_HOST32_TARGET32(buffer.params_32Bit[i]); + } + break; + default: + goto RESPONSE_ERROR; + } + + /* copy received data */ + cpe_control_memcpy_s(pDest, (DSL_uint32_t)(tmpCnt), buffer.params_8Bit, sizeof(buffer.params_8Bit)); + pDest += tmpCnt; + destAddr += ((DSL_uint32_t)tmpCnt); + remainCnt_byte -= tmpCnt; + } + + /* + get tail - the requested data block is not 32 bit aligned + */ + if ((remainCnt_byte > 0) && (remainCnt_byte < 4) ) + { + vdsl2_dbg_access.count = 1; + vdsl2_dbg_access.pData_32 = (unsigned int *) &tmpData; + vdsl2_dbg_access.dbgAddr = destAddr; + ret = ioctl(fd, FIO_VRX_DBG_LS_READ, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Read (unasigned tail) - retCode = %d"DSL_CPE_CRLF, + vdsl2_dbg_access.ictl.retCode)); + + goto RESPONSE_ERROR; + } + + /* copy received data */ + pTmp = ((DSL_char_t *)&tmpData); + + /* receive data as 32 bit value --> swap to the corresponding target */ + switch(CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + { + cpe_control_memcpy_s(pDest, (DSL_uint32_t)remainCnt_byte, + &pTmp[0], (DSL_uint32_t)remainCnt_byte); + } + break; + case CMV_MSG_BIT_SIZE_16BIT: + /* the high word will be cached by the "CAT" section */ + cpe_control_memcpy_s(pDest, (DSL_uint32_t)remainCnt_byte, + &pTmp[0], (DSL_uint32_t)remainCnt_byte); + break; + case CMV_MSG_BIT_SIZE_32BIT: + /* no swap necessary */ + tmpData = TCP_DEBUG_SWAP_HOST32_TARGET32(tmpData); + cpe_control_memcpy_s(pDest, (DSL_uint32_t)remainCnt_byte, + &pTmp[0], (DSL_uint32_t)remainCnt_byte); + break; + default: + goto RESPONSE_ERROR; + } + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug Read - tail (addr 0x%X, remain %d) = 0x%08lX"DSL_CPE_CRLF, + destAddr, remainCnt_byte, (unsigned long)tmpData)); + + pDest += remainCnt_byte; + remainCnt_byte = 0; + } + + if (remainCnt_byte != 0) + { + /* ERROR */ + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Read (remain %d)"DSL_CPE_CRLF, + remainCnt_byte)); + + goto RESPONSE_ERROR; + } + + if (CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv) == CMV_MSG_BIT_SIZE_8BIT) + { + for (i = 0; i < ((blkSize_byte>1) ? blkSize_byte/sizeof(unsigned short) : 1); i++) + { + pCmvMsg->cmv.payload.params_16Bit[i] = + TCP_DEBUG_SWAP_HOST16_TARGET16(pCmvMsg->cmv.payload.params_16Bit[i]); + } + } + + /* number of 16bit CMV units + one extra field for single bytes */ + tmpCnt = blkSize_byte/sizeof(unsigned short) + (blkSize_byte & 0x1); + + /* build a success response message */ + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_DEBUG_READDEBUG_ACK); + CMV_MSGHDR_PAYLOAD_SIZE_SET( pCmvMsg->cmv, (DSL_uint32_t)tmpCnt); + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug read successful"DSL_CPE_CRLF)); + + return 0; + +RESPONSE_ERROR: + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), + (errno != ETIMEDOUT) ? DCE2H_RESPONSE_HOST_DBG_PORT_RD_ERROR : DCE2H_RESPONSE_TIMEOUT); + return -1; +} + +static DSL_int_t DSL_CPE_VRX_WriteDebug( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t ret = DSL_SUCCESS; + DSL_uint32_t destAddr, tmpCnt, remainCnt_byte, blkSize_byte, msgPaylSize_byte; + DSL_uint32_t tmpData = 0, tmpSrc = 0; + DSL_char_t *pSrc, *pTmp, *pTmpSrc; + + IOCTL_VRX_dbgAccess_t vdsl2_dbg_access; + CMV_DEBUG_ACCESS_BUFFER_T buffer; + + destAddr = (P_CMV_MSGHDR_ADDR_LSW_GET(pCmvMsg)) | + (( (P_CMV_MSGHDR_ADDR_MSW_GET(pCmvMsg)) << 16) & 0xFFFF0000); + + if ( (DSL_CPE_VRX_BitSizeCheck("Debug Write", pCmvMsg, destAddr) ) != 0 ) + goto RESPONSE_WR_ERROR; + + msgPaylSize_byte = CMV_MSGHDR_PAYLOAD_SIZE_GET(pCmvMsg->cmv) << 1; /* always 16 bit */ + + blkSize_byte = CMV_MSGHDR_LENGTH_GET(pCmvMsg->cmv) << CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv); + + if (blkSize_byte > msgPaylSize_byte) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Write - msg size %d / length size %d"DSL_CPE_CRLF, + msgPaylSize_byte, blkSize_byte)); + + goto RESPONSE_WR_ERROR; + } + + remainCnt_byte = blkSize_byte; + pSrc = (DSL_char_t*)(pCmvMsg->cmv.payload.params_8Bit); + + /* + the destination address is not 32 bit aligned + */ + if(destAddr & 0x00000003) + { + tmpCnt = sizeof(DSL_uint32_t) - (destAddr & 0x00000003); + tmpCnt = (tmpCnt > remainCnt_byte) ? remainCnt_byte : tmpCnt; + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug Write - cat (addr 0x%X, tmpCnt %d, remain %d)"DSL_CPE_CRLF, + destAddr, tmpCnt, remainCnt_byte)); + + /* read/modify/write - get current 32 bit value */ + vdsl2_dbg_access.count = 1; + vdsl2_dbg_access.pData_32 = (unsigned int *)&tmpData; + vdsl2_dbg_access.dbgAddr = destAddr & ~0x00000003; + ret = ioctl(fd, FIO_VRX_DBG_LS_READ, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Write (rd/mod/wr) - ret = %d"DSL_CPE_CRLF, + ret)); + + goto RESPONSE_WR_ERROR; + } + + + /* get cat source data --> modify write data */ + pTmp = ((DSL_char_t *)&tmpData); + pTmpSrc = ((DSL_char_t *)&tmpSrc); + cpe_control_memcpy_s(pTmpSrc, (DSL_uint32_t)tmpCnt, + pSrc, (DSL_uint32_t)tmpCnt); + + /* receive msg is 16 bit target aligened --> data as 32 bit host value */ + switch(CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + tmpSrc = TCP_DEBUG_SWAP_TARGET8_HOST32(tmpSrc); + cpe_control_memcpy_s(&pTmp[destAddr & 0x00000003], (DSL_uint32_t)tmpCnt, + pTmpSrc, (DSL_uint32_t)tmpCnt); + + break; + case CMV_MSG_BIT_SIZE_16BIT: + /* + tmpSrc = WH_SWAP_TARGET16_HOST32(tmpSrc); + */ + cpe_control_memcpy_s(&pTmp[destAddr & 0x00000003], (DSL_uint32_t)tmpCnt, + pTmpSrc, (DSL_uint32_t)tmpCnt); + break; + case CMV_MSG_BIT_SIZE_32BIT: + /* no swap necessary */ + break; + default: + goto RESPONSE_WR_ERROR; + } + + /* write back */ + ret = ioctl(fd, FIO_VRX_DBG_LS_WRITE, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Write (rd/mod/wr) - retCode = %d!"DSL_CPE_CRLF, + vdsl2_dbg_access.ictl.retCode)); + + goto RESPONSE_WR_ERROR; + } + + pSrc += tmpCnt; + remainCnt_byte -= tmpCnt; + destAddr &= ~0x00000003; + destAddr += sizeof(DSL_uint32_t); + } + + /* + write the next block (dest Addr is now 32 bit aligend) + */ + memset(&buffer, 0x0, sizeof(CMV_DEBUG_ACCESS_BUFFER_T)); + + if (remainCnt_byte > 3) + { + tmpCnt = remainCnt_byte & ~0x00000003; + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug Write - 32 bit aligned (addr 0x%X, tmpCnt %d, remain %d)"DSL_CPE_CRLF, + destAddr, tmpCnt, remainCnt_byte)); + + cpe_control_memcpy_s(&buffer, sizeof(CMV_DEBUG_ACCESS_BUFFER_T), + pSrc, (DSL_uint32_t)tmpCnt); + + /* receive data as 32 bit value --> swap to the corresponding target */ + switch(CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + DSL_uint32_t i; + case CMV_MSG_BIT_SIZE_8BIT: + for (i=0; i < (tmpCnt>>2); i++) + { + buffer.params_32Bit[i] = TCP_DEBUG_SWAP_TARGET8_HOST32(buffer.params_32Bit[i]); + } + break; + case CMV_MSG_BIT_SIZE_16BIT: + for (i=0; i < (tmpCnt>>2); i++) + { + buffer.params_32Bit[i] = TCP_DEBUG_SWAP_TARGET16_HOST32(buffer.params_32Bit[i]); + } + break; + case CMV_MSG_BIT_SIZE_32BIT: + for (i=0; i < (tmpCnt>>2); i++) + { + buffer.params_32Bit[i] = TCP_DEBUG_SWAP_TARGET32_HOST32(buffer.params_32Bit[i]); + } + break; + default: + goto RESPONSE_WR_ERROR; + } + + vdsl2_dbg_access.count = tmpCnt >> 2; /* 32 bit */ + vdsl2_dbg_access.pData_32 = (unsigned int *) &buffer; + vdsl2_dbg_access.dbgAddr = destAddr; + ret = ioctl(fd, FIO_VRX_DBG_LS_WRITE, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Write - retCode = %d!"DSL_CPE_CRLF, + vdsl2_dbg_access.ictl.retCode)); + + goto RESPONSE_WR_ERROR; + } + + pSrc += tmpCnt; + destAddr += tmpCnt; + remainCnt_byte -= tmpCnt; + } + + /* + write tail - the requested data block is not 32 bit aligned + */ + if ((remainCnt_byte > 0) && (remainCnt_byte < 4) ) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug Write - tail (addr 0x%X, remain %d)"DSL_CPE_CRLF, + destAddr, remainCnt_byte)); + + /* read/modify/write - get current 32 bit value */ + vdsl2_dbg_access.count = 1; + vdsl2_dbg_access.pData_32 = (unsigned int *) &tmpData; + vdsl2_dbg_access.dbgAddr = destAddr; + ret = ioctl(fd, FIO_VRX_DBG_LS_READ, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Write (rd/mod/wr) rd tail - retCode =%d!"DSL_CPE_CRLF, + vdsl2_dbg_access.ictl.retCode)); + + goto RESPONSE_WR_ERROR; + } + + + /* get cat source data --> modify write data */ + pTmp = ((DSL_char_t *)&tmpData); + pTmpSrc = ((DSL_char_t *)&tmpSrc); + cpe_control_memcpy_s(pTmpSrc, remainCnt_byte, + pSrc, sizeof(pSrc)); + + /* receive msg is 16 bit target aligened --> data as 32 bit host value */ + switch(CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + break; + case CMV_MSG_BIT_SIZE_16BIT: + break; + case CMV_MSG_BIT_SIZE_32BIT: + tmpSrc = TCP_DEBUG_SWAP_TARGET32_HOST32(tmpSrc); + break; + default: + goto RESPONSE_WR_ERROR; + } + + cpe_control_memcpy_s(pTmp, remainCnt_byte, + pTmpSrc, sizeof(pTmpSrc)); + + vdsl2_dbg_access.count = 1; + vdsl2_dbg_access.pData_32 = (unsigned int *) &tmpData; + vdsl2_dbg_access.dbgAddr = destAddr; + ret = ioctl(fd, FIO_VRX_DBG_LS_WRITE, (DSL_int_t)&vdsl2_dbg_access); + if (ret < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + DSL_CPE_PREFIX "ERROR Debug Write wr tail - retCode=%d!"DSL_CPE_CRLF, + vdsl2_dbg_access.ictl.retCode)); + + goto RESPONSE_WR_ERROR; + } + remainCnt_byte = 0; + } + + if (remainCnt_byte != 0) + { + /* ERROR */ + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Debug Write (remain %d)!"DSL_CPE_CRLF, + remainCnt_byte)); + + + goto RESPONSE_WR_ERROR; + } + + /* build a success response message */ + CMV_MSGHDR_CODE_RESERVED_SET((pCmvMsg->cmv), 3); + CMV_MSGHDR_CODE_MBOX_CODE_SET((pCmvMsg->cmv), CMV_MBOX_CODE_ME_MSG); + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_DEBUG_WRITEDEBUG_ACK); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "Debug write successful"DSL_CPE_CRLF)); + + return 0; + +RESPONSE_WR_ERROR: + DSL_CPE_VRX_ResponseMessage(pCmvMsg); + CMV_MSGHDR_FCT_OPCODE_SET((pCmvMsg->cmv), DCE2H_RESPONSE); + CMV_MSGHDR_PAYLOAD_SIZE_SET((pCmvMsg->cmv), 0); + CMV_MSGHDR_RESULT_CODE_SET((pCmvMsg->cmv), + ( (errno != ETIMEDOUT) ? DCE2H_RESPONSE_HOST_DBG_PORT_RD_ERROR : + DCE2H_RESPONSE_TIMEOUT )); + + return -1; + +} + +static DSL_int_t DSL_CPE_VRX_TcpMsgSend( + DSL_int_t fd, + CMV_MESSAGE_ALL_T *pCmvMsg) +{ + DSL_int_t tmp; + DSL_uint32_t CMVSizeByte; + + CMVSizeByte = ( CMV_MSGHDR_PAYLOAD_SIZE_GET(pCmvMsg->cmv) + CMV_HEADER_16BIT_SIZE ) * 2; + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "DSL_CPE_VRX_MsgSend - %d bytes"DSL_CPE_CRLF, CMVSizeByte)); + + /* prepare the CMV payload for return + swap payload at first (still need header information in host order) */ + switch (CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + case CMV_MSG_BIT_SIZE_16BIT: + H2N_SWAP_CMV_BLOCK_WORD(pCmvMsg, CMV_HEADER_16BIT_SIZE, (CMVSizeByte >> 1)-CMV_HEADER_16BIT_SIZE); + break; + case CMV_MSG_BIT_SIZE_32BIT: + H2N_SWAP_CMV_PAYL_DWORD(pCmvMsg, CMV_HEADER_32BIT_SIZE, (CMVSizeByte >> 2)-CMV_HEADER_32BIT_SIZE); + break; + default: + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Swap Payload Replay - invalid bit size 0x%X (32 bit)"DSL_CPE_CRLF, + CMV_MSGHDR_BIT_SIZE_GET(pCmvMsg->cmv))); + + break; + } + + /* swap header */ + H2N_SWAP_CMV_BLOCK_WORD(pCmvMsg, 0, CMV_HEADER_16BIT_SIZE); + + /* send the CMV message */ + /* Bytes of message sent has to be 32 bytes */ + tmp = DSL_CPE_SocketSend(fd, (DSL_char_t *)pCmvMsg, CMVSizeByte); + + if ( tmp != ((DSL_int_t)CMVSizeByte)) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - DSL_CPE_VRX_MsgSend failed !!! (sent = %d, exp = %d)"DSL_CPE_CRLF, + tmp, CMVSizeByte)); + + return -1; + } + + return 0; +} + +static DSL_int_t DSL_CPE_VRX_MsgHandle( + DSL_VRX_TcpDebugInfo_t *pTcpDebugInfo, + CMV_MESSAGE_ALL_T *pCmvMsgRecv, + DSL_int_t CMVSizeByte) +{ + DSL_int_t ret, mei_fd; + DSL_uint32_t tmpChannel; + DSL_uint32_t opcode; + DSL_uint32_t mbxCode; + CMV_MESSAGE_ALL_T *pCmvMsg = &(pTcpDebugInfo->CmvMsg); + + cpe_control_memcpy_s(pCmvMsg, (DSL_uint32_t)CMVSizeByte, + pCmvMsgRecv, (DSL_uint32_t)CMVSizeByte); + + tmpChannel = CMV_MSGHDR_CODE_PORT_NUMBER_GET(pCmvMsg->cmv); + /*tmpChannel = 0;*/ + + if (tmpChannel >= WINHOST_VDSL2_DFE_CHANNELS_AVAILABLE) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL_CPE_VRX_MsgHandle : unsupported channel number (%d)"DSL_CPE_CRLF, + tmpChannel)); + + return -1; + } + + if (pTcpDebugInfo->arrDeviceFd[tmpChannel] < 0) + { + pTcpDebugInfo->arrDeviceFd[tmpChannel] = DSL_CPE_DEV_DeviceOpen(DSL_CPE_IFX_LOW_DEV, tmpChannel); + + if (pTcpDebugInfo->arrDeviceFd[tmpChannel] <= 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Error: MEI BSP device file open failed!"DSL_CPE_CRLF)); + + return -1; + } + } + + mei_fd = pTcpDebugInfo->arrDeviceFd[tmpChannel]; + + opcode = CMV_MSGHDR_FCT_OPCODE_GET((pCmvMsg->cmv)); + mbxCode = CMV_MSGHDR_CODE_MBOX_CODE_GET((pCmvMsg->cmv)); + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "DSL_CPE_VRX_MsgHandle : mbxCode = 0x%x, opcode = 0x%x"DSL_CPE_CRLF, + mbxCode, opcode)); + + /* clear the channel number and the two MSBs in the mailbox code */ + (pCmvMsg->cmv).header.mbxCode = (unsigned short)mbxCode; + + /* handle the CMV message */ + if (mbxCode != CMV_MBOX_CODE_ME_MSG) + { + /* + just forward the CMV through the mailbox + these messages do not require ME intervention + */ + ret = DSL_CPE_VRX_MailboxSend(mei_fd, pCmvMsg); + + /* set back channel number */ + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + } + else + { + /* interprete the other WinHost Commands */ + switch(opcode) + { + case H2DCE_DEBUG_HALT: + ret = DSL_CPE_VRX_Halt(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + case H2DCE_DEBUG_RUN: + ret = DSL_CPE_VRX_Run(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + case H2DCE_DEBUG_REBOOT: + case H2DCE_DEBUG_DOWNLOAD: + /* Reboot device*/ + ret = DSL_CPE_VRX_Reboot(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + case H2DCE_MBOX_PAYLOAD_SIZE_QUERY: + /* Request information on the Mailbox size*/ + ret = DSL_CPE_VRX_MailboxSize(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + case H2DCE_DEBUG_READ_MEI: + /* Read directly from and return 32-bit MEI register */ + + /* !!!! + The driver interface is 32 bit while the mei interface is 16 bit + --> The driver uses only the lower word (16 mei register) + --> swap ???? + */ + ret = DSL_CPE_VRX_GetReg(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + case H2DCE_DEBUG_WRITE_MEI: + /* Write directly to 32-bit MEI register */ + + /* !!!! */ + ret = DSL_CPE_VRX_SetReg(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + case H2DCE_DEBUG_READDEBUG: + /* Read the designed address using Debug IF */ + + /* !!!! + Here the driver interface and the value is 32 bit + SWAP + */ + ret = DSL_CPE_VRX_ReadDebug(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + case H2DCE_DEBUG_WRITEDEBUG: + /* Write the designed address using Debug IF */ + + /* !!!! */ + ret = DSL_CPE_VRX_WriteDebug(mei_fd, pCmvMsg); + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || ret; + + default: + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - DSL_CPE_VRX_MsgHandle: Unknown WH opcode 0x%x"DSL_CPE_CRLF, + opcode)); + + return DSL_CPE_VRX_TcpMsgSend(pTcpDebugInfo->socket_fd, pCmvMsg) || (-1); + } + } +} + +#ifdef INCLUDE_DSL_RESOURCE_STATISTICS +DSL_Error_t DSL_CPE_DEV_TcpDebugMessageResourceUsageGet( + DSL_CPE_TcpDebugClientInfo_t *clientInfo, + DSL_uint32_t *pStaticMemUsage, + DSL_uint32_t *pDynamicMemUsage) +{ + DSL_int_t c = 0; + + if (clientInfo == DSL_NULL || + pStaticMemUsage == DSL_NULL || + pDynamicMemUsage == DSL_NULL) + { + return DSL_ERROR; + } + + *pStaticMemUsage = 0; + *pDynamicMemUsage = 0; + + for (c = 0; c < DSL_FD_SETSIZE; c++) + { + if (clientInfo[c].pDevData != DSL_NULL) + { + *pDynamicMemUsage += sizeof(DSL_VRX_TcpDebugInfo_t); + } + } + + return DSL_SUCCESS; +} +#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/ + +DSL_void_t DSL_CPE_DEV_DeviceDataFree(DSL_void_t *pDevData) +{ + DSL_int_t i = 0; + + if (pDevData) + { + for (i = 0; i < WINHOST_VDSL2_DFE_CHANNELS_AVAILABLE; i++) + { + if ( ((DSL_VRX_TcpDebugInfo_t*)pDevData)->arrDeviceFd[i] > 0) + { + /* Close low-level driver*/ + close(((DSL_VRX_TcpDebugInfo_t*)pDevData)->arrDeviceFd[i]); + } + } + + DSL_CPE_Free(pDevData); + } + + return; +} + +DSL_int_t DSL_CPE_DEV_DeviceOpen(DSL_char_t *pDevName, DSL_uint32_t dev_num) +{ + DSL_char_t text[30]; + DSL_int_t mei_fd = -1; + + if (pDevName == DSL_NULL) + { + return -1; + } + + snprintf(text, sizeof(text), "%s/%d", pDevName, dev_num); + + mei_fd = DSL_CPE_Open(text); + /*mei_fd = open(text, O_RDWR);*/ + + if (mei_fd < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "xDSL device driver cannot be opened!"DSL_CPE_CRLF)); + return -1; + } + + /* Check VRX device driver state*/ + if (DSL_CPE_VRX_DeviceStateCheck(mei_fd) < 0) + { + DSL_CPE_Close(mei_fd); + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "xDSL device driver not ready!"DSL_CPE_CRLF)); + return -1; + } + + return mei_fd; +} + +DSL_int_t DSL_CPE_DEV_TcpMessageHandle( + DSL_CPE_TcpDebugClientInfo_t *pDevData) +{ + DSL_int_t i = 0, tmp, nReceived; + DSL_uint32_t PayloadSize, CMVSizeByte; + DSL_char_t *pPackage; + CMV_MESSAGE_ALL_T *pRecvCmvMsg; + DSL_VRX_TcpDebugInfo_t *pTcpDebugInfo; + + if (pDevData == DSL_NULL) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "Pointer to the client info is NULL!"DSL_CPE_CRLF)); + return -1; + } + + pTcpDebugInfo = (DSL_VRX_TcpDebugInfo_t*)(pDevData->pDevData); + + if (pTcpDebugInfo == DSL_NULL) + { + /* Create device specific data*/ + pTcpDebugInfo = DSL_CPE_Malloc(sizeof(DSL_VRX_TcpDebugInfo_t)); + if (pTcpDebugInfo == DSL_NULL) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Can't allocate memory for the xDSL device specific data!"DSL_CPE_CRLF)); + + return -1; + } + pDevData->pDevData = pTcpDebugInfo; + + /* Get VRX device specific info*/ + pTcpDebugInfo->pEndReceive = pTcpDebugInfo->Buffer; + pTcpDebugInfo->socket_fd = pDevData->fd; + + for (i = 0 ; i< WINHOST_VDSL2_DFE_CHANNELS_AVAILABLE; i++) + { + pTcpDebugInfo->arrDeviceFd[i] = -1; + } + } + + pPackage = pTcpDebugInfo->Buffer; + + /* remaining free space in Buffer */ + tmp = ((DSL_int_t)sizeof(pTcpDebugInfo->Buffer)) - + ((DSL_int_t)pTcpDebugInfo->pEndReceive - (DSL_int_t)pTcpDebugInfo->Buffer); + + /* Receive data from the socket*/ + nReceived = DSL_CPE_SocketRecv(pTcpDebugInfo->socket_fd, pTcpDebugInfo->pEndReceive, tmp); + + if (nReceived < 1) + { + /* the connection is reset, because the TcpDebug client has been closed */ + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "connection terminated from host!"DSL_CPE_CRLF)); + + return -ENODATA; + } + + /* + A WinHost CMV will be always in 16 bit units + --> check the 16 bit assignment + --> check length + --> swap the whole msg here at once + */ + if (nReceived & 0x00000001) + { + /* **it happens - skip or terminate ? */ + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - unasigned message (size %d) terminate!"DSL_CPE_CRLF, + nReceived)); + + return -1; + } + + /* check length - at least one CMV header */ + if (((DSL_uint32_t)nReceived) < CMV_HEADER_8BIT_SIZE) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - invalid message (size %d) terminate!"DSL_CPE_CRLF, + nReceived)); + + return -1; + } + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Received %d bytes"DSL_CPE_CRLF, nReceived)); + + /* update the index */ + pTcpDebugInfo->pEndReceive += nReceived; + + while (pTcpDebugInfo->pEndReceive >= pPackage + CMV_HEADER_8BIT_SIZE) + { + /* the received package is big enough to be analyzed */ + pRecvCmvMsg = (CMV_MESSAGE_ALL_T*)pPackage; + + /* swap cmv header (16 bit) from network to host order */ + N2H_SWAP_CMV_BLOCK_WORD(pRecvCmvMsg, 0, CMV_HEADER_16BIT_SIZE); + + /* get the payload size (16 bit count) and check length */ + PayloadSize = CMV_MSGHDR_PAYLOAD_SIZE_GET(pRecvCmvMsg->cmv); + + if ( ((DSL_uint32_t)nReceived) < (CMV_HEADER_8BIT_SIZE + (PayloadSize << 1)) ) + { + /* error not all data received */ + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR - msg incomplete (size %d, payl[16bit] %d) terminate!"DSL_CPE_CRLF, + nReceived, PayloadSize)); + + return -1; + } + + /* swap cmv payload (16 bit fields) from network to host order */ + switch (CMV_MSGHDR_BIT_SIZE_GET(pRecvCmvMsg->cmv)) + { + case CMV_MSG_BIT_SIZE_8BIT: + case CMV_MSG_BIT_SIZE_16BIT: + N2H_SWAP_CMV_BLOCK_WORD(pRecvCmvMsg, CMV_HEADER_16BIT_SIZE, PayloadSize); + break; + case CMV_MSG_BIT_SIZE_32BIT: + N2H_SWAP_CMV_PAYL_DWORD(pRecvCmvMsg, CMV_HEADER_32BIT_SIZE, (PayloadSize >> 1)); + break; + default: + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ERROR Swap Payload Recv - invalid bit size 0x%X (32 bit)!"DSL_CPE_CRLF, + CMV_MSGHDR_BIT_SIZE_GET(pRecvCmvMsg->cmv))); + + break; + } + + /* calculate the size in bytes of the payload */ + CMVSizeByte = (PayloadSize << 1) + CMV_HEADER_8BIT_SIZE; + + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "CMV msg[0x%04X]: Payload: %d [byte], msg %d [byte]"DSL_CPE_CRLF, + pRecvCmvMsg->cmv.header.MessageID, PayloadSize << 1, CMVSizeByte)); + + if (pTcpDebugInfo->pEndReceive >= pPackage + CMVSizeByte) + { + /* handle the received message */ + DSL_CPE_VRX_MsgHandle(pTcpDebugInfo, pRecvCmvMsg, CMVSizeByte); + /* go to the next message in the buffer */ + pPackage += CMVSizeByte; + } + } + + /* copy the parts of the new message to the beginning of the buffer */ + tmp = (pTcpDebugInfo->pEndReceive - pPackage); + if (tmp > 0) + { + cpe_control_memcpy_s(pTcpDebugInfo->Buffer, (DSL_uint32_t)tmp, pPackage, (DSL_uint32_t)tmp); + } + + pTcpDebugInfo->pEndReceive = pTcpDebugInfo->Buffer + tmp; + + return 0; +} + +#endif + +#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */ diff --git a/src/dsl_cpe_debug_vrx.h b/src/dsl_cpe_debug_vrx.h new file mode 100644 index 0000000..8da3858 --- /dev/null +++ b/src/dsl_cpe_debug_vrx.h @@ -0,0 +1,319 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef _DSL_CPE_DEBUG_VRX_H +#define _DSL_CPE_DEBUG_VRX_H + +#ifdef DSL_DEBUG_TOOL_INTERFACE + + +#include "cmv_message_format.h" + +#if defined(INCLUDE_DSL_CPE_API_VRX) +/* MEI CPE driver specific headers*/ +#include "drv_mei_cpe_interface.h" +#else +#error "Device undefined!" +#endif + +#if defined(INCLUDE_DSL_CPE_API_VRX) + #define DSL_CPE_IFX_LOW_DEV "/dev/mei_cpe" +#endif + + +#if defined(INCLUDE_DSL_CPE_API_VRX) +/* MEI CPE driver interface IOCTLs wrappers*/ +#define FIO_VRX_REQ_CONFIG FIO_MEI_REQ_CONFIG +#define FIO_VRX_MBOX_MSG_RAW_SEND FIO_MEI_MBOX_MSG_RAW_SEND +#define FIO_VRX_REG_GET FIO_MEI_REG_GET +#define FIO_VRX_REG_SET FIO_MEI_REG_SET +#define FIO_VRX_DBG_LS_WRITE FIO_MEI_DBG_LS_WRITE +#define FIO_VRX_DBG_LS_READ FIO_MEI_DBG_LS_READ +/* MEI CPE driver interface data types wrappers*/ +typedef IOCTL_MEI_reqCfg_t IOCTL_VRX_reqCfg_t; +typedef IOCTL_MEI_mboxSend_t IOCTL_VRX_mboxSend_t; +typedef IOCTL_MEI_regInOut_t IOCTL_VRX_regInOut_t; +typedef IOCTL_MEI_dbgAccess_t IOCTL_VRX_dbgAccess_t; +#endif + +#define WINHOST_VDSL2_DFE_CHANNELS_AVAILABLE 2 + +typedef struct +{ + DSL_int_t socket_fd; + /* device file descriptor */ + DSL_int_t arrDeviceFd[WINHOST_VDSL2_DFE_CHANNELS_AVAILABLE]; + /* response message*/ + CMV_MESSAGE_ALL_T CmvMsg; + /* index of free space in Buffer */ + DSL_char_t *pEndReceive; + /* Buffer for the received data*/ + DSL_char_t Buffer[3*CMV_MESSAGE_SIZE]; +} DSL_VRX_TcpDebugInfo_t; + + +#ifndef __BYTE_ORDER + #error __BYTE_ORDER has to be defined through including of drv_dsl_cpe_os.h +#endif + +#define WINHOST_REMOTE_SW_BYTE_ORDER __BIG_ENDIAN +/*#define WINHOST_REMOTE_SW_BYTE_ORDER __LITTLE_ENDIAN*/ + +/* ============================================================================ + Macros & Definitions + ========================================================================= */ + +#if ((__BYTE_ORDER == __BIG_ENDIAN ) && (WINHOST_REMOTE_SW_BYTE_ORDER == __LITTLE_ENDIAN)) || \ + ((__BYTE_ORDER == __LITTLE_ENDIAN ) && (WINHOST_REMOTE_SW_BYTE_ORDER == __BIG_ENDIAN)) + + #define N2H_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16)\ + N2H_SwapCmvBlockWord(cmvMsg, startIdx, count_16) + + #define H2N_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16)\ + H2N_SwapCmvBlockWord(cmvMsg, startIdx, count_16) + + #define N2H_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32)\ + N2H_SwapCmvPaylDWord(cmvMsg, startIdx, count_32) + + #define H2N_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32)\ + H2N_SwapCmvPaylDWord(cmvMsg, startIdx, count_32) + +#else + #define N2H_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16) + #define H2N_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16) + #define N2H_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32) + #define H2N_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32) + + /*#define SWAP_CMV_PAYL_32_VS_16(cmvMsg, startIdx, count_32) */ +#endif + +#define SWAP_CMV_PAYL_32_VS_16(cmvMsg, startIdx, count_32)\ + SwapCmvPayl_32vs16(cmvMsg, startIdx, count_32) + +#if 1 +#define TCP_DEBUG_SWAP_HOST32_TARGET8(x) ( (((x)&0xFFFF0000)>>16) \ + |(((x)&0x0000FFFF)<<16) ) +#define TCP_DEBUG_SWAP_HOST32_TARGET16(x) ( (((x)&0xFFFF0000)>>16) \ + |(((x)&0x0000FFFF)<<16) ) + +#define TCP_DEBUG_SWAP_HOST32_TARGET32(x) ( (((x)&0xFFFF0000)>>16) \ + |(((x)&0x0000FFFF)<<16) ) + +#define TCP_DEBUG_SWAP_HOST16_TARGET16(x) ( (((x)&0xFF00)>>8) \ + |(((x)&0x00FF)<<8) ) + +#else + +#define TCP_DEBUG_SWAP_HOST32_TARGET8(x) (x) +#define TCP_DEBUG_SWAP_HOST32_TARGET16(x) (x) +#define TCP_DEBUG_SWAP_HOST32_TARGET32(x) (x) +#define TCP_DEBUG_SWAP_HOST16_TARGET16(x) (x) + +#endif + + +#if 1 + +#define TCP_DEBUG_SWAP_TARGET8_HOST32(x) ( (((x)&0xFFFF0000)>>16) \ + |(((x)&0x0000FFFF)<<16) ) +#define TCP_DEBUG_SWAP_TARGET16_HOST32(x) ( (((x)&0xFFFF0000)>>16) \ + |(((x)&0x0000FFFF)<<16) ) +#define TCP_DEBUG_SWAP_TARGET32_HOST32(x) ( (((x)&0xFFFF0000)>>16) \ + |(((x)&0x0000FFFF)<<16) ) +#else + +#define TCP_DEBUG_SWAP_TARGET8_HOST32(x) (x) +#define TCP_DEBUG_SWAP_TARGET16_HOST32(x) (x) +#define TCP_DEBUG_SWAP_TARGET32_HOST32(x) (x) + +#endif + + +/* ============================================================================ + Debug Read/Write Buffer + ========================================================================= */ +/* two 32bit elements margin, if request address is not 32bit aligned */ +typedef union cmv_debug_access_buffer_s +{ + unsigned char params_8Bit[CMV_USED_PAYLOAD_8BIT_SIZE + 8]; + unsigned short params_16Bit[CMV_USED_PAYLOAD_16BIT_SIZE + 4]; + unsigned int params_32Bit[CMV_USED_PAYLOAD_32BIT_SIZE + 2]; +} CMV_DEBUG_ACCESS_BUFFER_T; + + +/* ============================================================================ + CMV Message format: offset code [16 bit] + ========================================================================= */ +#define CMV_MSGHDR_CODE_MBOX_CODE_POS (0) +#define CMV_MSGHDR_CODE_MBOX_CODE_MASK (0x00FF << CMV_MSGHDR_CODE_MBOX_CODE_POS) + +#define CMV_MSGHDR_CODE_PORT_NUMBER_POS (8) +#define CMV_MSGHDR_CODE_PORT_NUMBER_MASK (0x003F << CMV_MSGHDR_CODE_PORT_NUMBER_POS) + +#define CMV_MSGHDR_CODE_RESERVED_POS (14) +#define CMV_MSGHDR_CODE_RESERVED_MASK (0x0003 << CMV_MSGHDR_CODE_RESERVED_POS) + + +/* + Access Macros Offset code +*/ +#define P_CMV_MSGHDR_CODE_MBOX_CODE_GET(pmsg) \ + ((pmsg->header.mbxCode & CMV_MSGHDR_CODE_MBOX_CODE_MASK) >> CMV_MSGHDR_CODE_MBOX_CODE_POS) + +#define CMV_MSGHDR_CODE_MBOX_CODE_GET(msg) \ + ((msg.header.mbxCode & CMV_MSGHDR_CODE_MBOX_CODE_MASK) >> CMV_MSGHDR_CODE_MBOX_CODE_POS) + +#define P_CMV_MSGHDR_CODE_MBOX_CODE_SET(pmsg, val) ( pmsg->header.mbxCode = \ + ( (pmsg->header.mbxCode & ~(CMV_MSGHDR_CODE_MBOX_CODE_MASK)) | \ + ((val << CMV_MSGHDR_CODE_MBOX_CODE_POS) & (CMV_MSGHDR_CODE_MBOX_CODE_MASK)) ) ) + +#define CMV_MSGHDR_CODE_MBOX_CODE_SET(msg, val) ( msg.header.mbxCode = \ + ( (msg.header.mbxCode & ~(CMV_MSGHDR_CODE_MBOX_CODE_MASK)) | \ + ((val << CMV_MSGHDR_CODE_MBOX_CODE_POS) & (CMV_MSGHDR_CODE_MBOX_CODE_MASK)) ) ) + +#define P_CMV_MSGHDR_CODE_PORT_NUMBER_GET(pmsg) \ + ((pmsg->header.mbxCode & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) >> CMV_MSGHDR_CODE_PORT_NUMBER_POS) + +#define CMV_MSGHDR_CODE_PORT_NUMBER_GET(msg) \ + ((msg.header.mbxCode & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) >> CMV_MSGHDR_CODE_PORT_NUMBER_POS) + +#define P_CMV_MSGHDR_CODE_PORT_NUMBER_SET(pmsg, val) ( pmsg->header.mbxCode = \ + ( (pmsg->header.mbxCode & ~(CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) | \ + ((val << CMV_MSGHDR_CODE_PORT_NUMBER_POS) & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) ) ) + +#define CMV_MSGHDR_CODE_PORT_NUMBER_SET(msg, val) ( msg.header.mbxCode = \ + ( (msg.header.mbxCode & ~(CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) | \ + ((val << CMV_MSGHDR_CODE_PORT_NUMBER_POS) & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) ) ) + + +#define P_CMV_MSGHDR_CODE_RESERVED_GET(pmsg) \ + ((pmsg->header.mbxCode & CMV_MSGHDR_CODE_RESERVED_MASK) >> CMV_MSGHDR_CODE_RESERVED_POS) + +#define CMV_MSGHDR_CODE_RESERVED_GET(msg) \ + ((msg.header.mbxCode & CMV_MSGHDR_CODE_RESERVED_MASK) >> CMV_MSGHDR_CODE_RESERVED_POS) + +#define P_CMV_MSGHDR_CODE_RESERVED_SET(pmsg, val) ( pmsg->header.mbxCode = \ + ( (pmsg->header.mbxCode & ~(CMV_MSGHDR_CODE_RESERVED_MASK)) | \ + ((val << CMV_MSGHDR_CODE_RESERVED_POS) & (CMV_MSGHDR_CODE_RESERVED_MASK)) ) ) + +#define CMV_MSGHDR_CODE_RESERVED_SET(msg, val) ( msg.header.mbxCode = \ + ( (msg.header.mbxCode & ~(CMV_MSGHDR_CODE_RESERVED_MASK)) | \ + ((val << CMV_MSGHDR_CODE_RESERVED_POS) & (CMV_MSGHDR_CODE_RESERVED_MASK)) ) ) + + +/* ============================================================================ + CMV Message format: offset 1 [16 bit] + ========================================================================= */ +#define CMV_RESPONSE_RESULT_CODE_POS (0) +#define CMV_RESPONSE_RESULT_CODE_MASK (0xFFFF << CMV_RESPONSE_RESULT_CODE_POS) + +/* + Access Macros Offset 1 +*/ +#define P_CMV_MSGHDR_RESULT_CODE_GET(pmsg) \ + ((pmsg->header.MessageID & CMV_RESPONSE_RESULT_CODE_MASK) >> CMV_RESPONSE_RESULT_CODE_POS) +#define CMV_MSGHDR_RESULT_CODE_GET(msg) \ + ((msg.header.MessageID & CMV_RESPONSE_RESULT_CODE_MASK) >> CMV_RESPONSE_RESULT_CODE_POS) +#define P_CMV_MSGHDR_RESULT_CODE_SET(pmsg, val) ( pmsg->header.MessageID = \ + (unsigned short)( (pmsg->header.MessageID & ~(CMV_RESPONSE_RESULT_CODE_MASK)) | \ + ((val << CMV_RESPONSE_RESULT_CODE_POS) & ~(CMV_RESPONSE_RESULT_CODE_MASK)) ) ) +#define CMV_MSGHDR_RESULT_CODE_SET(msg, val) ( msg.header.MessageID = \ + (unsigned short)( (msg.header.MessageID & ~(CMV_RESPONSE_RESULT_CODE_MASK)) | \ + (((val) << CMV_RESPONSE_RESULT_CODE_POS) & ~(CMV_RESPONSE_RESULT_CODE_MASK)) ) ) + + +/* ============================================================================ + CMV Message format: offset 2 [16 bit] + ========================================================================= */ +/* CMV header MSW debug address field */ +#define P_CMV_MSGHDR_ADDR_MSW_GET(pmsg) (pmsg->rawMsg[3]) +#define CMV_MSGHDR_ADDR_MSW_GET(msg) (msg.rawMsg[3]) +#define P_CMV_MSGHDR_ADDR_MSW_SET(pmsg, val) (pmsg->rawMsg[3] = val) +#define CMV_MSGHDR_ADDR_MSW_SET(msg, val) (msg.rawMsg[3] = val) + + +/* ============================================================================ + CMV Message format: offset 3 [16 bit] + ========================================================================= */ +/* CMV header LSW debug address field */ +#define P_CMV_MSGHDR_MEI_ADDR_GET(pmsg) (pmsg->rawMsg[3]) +#define CMV_MSGHDR_MEI_ADDR_GET(msg) (msg.rawMsg[3]) +#define P_CMV_MSGHDR_MEI_ADDR_SET(pmsg, val) (pmsg->rawMsg[3] = val) +#define CMV_MSGHDR_MEI_ADDR_SET(msg, val) (msg.rawMsg[3] = val) + + +/* ============================================================================ + CMV Message format: offset 3 [16 bit] + ========================================================================= */ +/* CMV header LSW debug address field */ +#define P_CMV_MSGHDR_ADDR_LSW_GET(pmsg) (pmsg->rawMsg[4]) +#define CMV_MSGHDR_ADDR_LSW_GET(msg) (msg.rawMsg[4]) +#define P_CMV_MSGHDR_ADDR_LSW_SET(pmsg, val) (pmsg->rawMsg[4] = val) +#define CMV_MSGHDR_ADDR_LSW_SET(msg, val) (msg.rawMsg[4] = val) + + + +/* ======================================================================== + Definition of the MESSAGE MAILBOX CODES. + ===================================================================== */ +/* Must be interpreted by the WinHost task */ +#define CMV_MBOX_CODE_ME_MSG 0x80 + + +/* ======================================================================== + Definition of the MESSAGE OPCODES. + ===================================================================== */ +/* + NOTE: + The MESSAGE OPCODE is a combination of thection fields: + OPCODE, MSG MODE and DIRECTION +*/ + +/* Message Codes: WinHost-to-MEI */ +#define H2DCE_DEBUG_REBOOT 0x04 +#define H2DCE_DEBUG_DOWNLOAD 0x0A +#define H2DCE_DEBUG_RUN 0x0C +#define H2DCE_DEBUG_HALT 0x0E +#define H2DCE_DEBUG_READ_MEI 0x06 +#define H2DCE_DEBUG_WRITE_MEI 0x08 +#define H2DCE_DEBUG_READDEBUG 0x14 +#define H2DCE_DEBUG_WRITEDEBUG 0x12 +#define H2DCE_MBOX_PAYLOAD_SIZE_QUERY 0x16 + +/* Message Codes: MEI-to-Winhost */ +#if 0 +#define DCE2H_DEBUG_RESET_ACK 0x03 +#define DCE2H_DEBUG_REBOOT_ACK 0x05 +#define DCE2H_ERROR_OPCODE_UNKNOWN 0x0B +#define DCE2H_ERROR_ADDR_UNKNOWN 0x0D +#endif + +#define DCE2H_RESPONSE 0x0F +#define DCE2H_DEBUG_READ_MEI_REPLY 0x07 +#define DCE2H_DEBUG_WRITE_MEI_REPLY 0x09 +#define DCE2H_DEBUG_WRITEDEBUG_ACK 0x13 +#define DCE2H_DEBUG_READDEBUG_ACK 0x15 +#define DCE2H_MBOX_PAYLOAD_SIZE_REPLY 0x17 + +/* Message Result Codes: MEI-to-Winhost Response */ +#define DCE2H_RESPONSE_SUCCESS 0x00 +#define DCE2H_RESPONSE_TIMEOUT 0x10 +#define DCE2H_RESPONSE_MEI_REG_RD_ERROR 0x20 +#define DCE2H_RESPONSE_MEI_REG_WR_ERROR 0x30 +#define DCE2H_RESPONSE_HOST_DBG_PORT_RD_ERROR 0x40 +#define DCE2H_RESPONSE_HOST_DBG_PORT_WR_ERROR DCE2H_RESPONSE_TIMEOUT +#define DCE2H_RESPONSE_MODEM_READY_TIMEOUT 0x50 +#define DCE2H_RESPONSE_MODEM_READY_AC_CLK 0x51 + +DSL_int_t DSL_CPE_DEV_DeviceOpen(DSL_char_t *pDevName, DSL_uint32_t dev_num); + +#endif /* #ifdef DSL_DEBUG_TOOL_INTERFACE*/ + +#endif /* _DSL_CPE_DEBUG_VRX_H */ diff --git a/src/dsl_cpe_dti.c b/src/dsl_cpe_dti.c new file mode 100644 index 0000000..5bf4304 --- /dev/null +++ b/src/dsl_cpe_dti.c @@ -0,0 +1,527 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL daemon command line interface for the Debug & Trace Interface +*/ + +/*#define DEBUG_CONSOLE*/ + +/* ============================================================================ + inlcudes + ========================================================================= */ +#include "dsl_cpe_control.h" + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) + +#include "dsl_cpe_os.h" +#include "dsl_cpe_cli.h" +#include "dsl_cpe_dti.h" + +/* get the DTI interface defines */ +#include "dti_agent_interface.h" +#include "dti_cli_interface.h" + +#ifdef DTI_STATIC +#undef DTI_STATIC +#endif + +#if (defined(DTI_DEBUG) || 1) +#define DTI_STATIC +#else +#define DTI_STATIC static +#endif + +#if (DTI_AGENT_VER_MAJOR >= 1) +/* + Note: With the DTI Version >= 1.0.0 the following changes have been made: + - Build process: + use dynamic libraries + - Device handling: + allow several devices in parallel + separate device handling (device part will be in a own library) + - Interface: + New interface to start and register several devices. +*/ +# define DTI_INTERFACE_VERSION 1 +#else +# define DTI_INTERFACE_VERSION 0 +#endif + +#if defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0) +extern DTI_DeviceAccessFct_t DTI_DeviceAccessFct_VRX; +#endif + +/* ============================================================================ + Local defines + ========================================================================= */ + +struct DSL_CPE_Dti_Context_s +{ + /* points to the DTI Agent context pointer */ + DTI_AgentCtx_t *pDtiAgent; + + /* enable / disbale DTI interface */ + volatile DSL_boolean_t bEnabled; + /* if number */ + volatile DSL_int_t ifNum; + /** dsl cpe api context pointer */ + DSL_CPE_Control_Context_t *pDSLContext; + /** console pointer (event handling) */ + DSL_CLI_Context_t *pCLIContext; +}; + +typedef struct DSL_CPE_Dti_Context_s DSL_CPE_Dti_Context_t; + + +/* ============================================================================ + Local Function declarations + ========================================================================= */ +DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Command_Exec( + DSL_CPE_Dti_Context_t *pDtiContext, + const DSL_char_t *pCliDtiCommand, + DSL_CPE_File_t *pOutStream); + +DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Event( + DSL_void_t *pContext, + DSL_char_t *pMessage); + +DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Exit( + DSL_void_t *pContext); + +DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Exec( + DSL_void_t *pCliDtiDescriptor, + const DSL_char_t *pCmdIn, + DSL_char_t *pResultOut, + DSL_int_t *pResultBufSize_byte, + DSL_int_t *pResultCode); + +/* ============================================================================ + Local Variables + ========================================================================= */ + +/* DTI interface - context */ +DTI_STATIC DSL_CPE_Dti_Context_t DSL_CPE_GlobalDtiContext = {DSL_NULL, DSL_FALSE, -1, DSL_NULL, DSL_NULL}; + + +/* ============================================================================ + Local Function definitons + ========================================================================= */ + +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) +/** + Handle a DTI command form the Debug & Trace interface +*/ +DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Command_Exec( + DSL_CPE_Dti_Context_t *pDtiContext, + const DSL_char_t *pCliDtiCommand, + DSL_CPE_File_t *pOutStream) +{ + DSL_int_t retVal = 0; + DSL_char_t cmdBuf[256]; + DSL_char_t *pArgBuf = DSL_NULL; + + /* get command name */ + sscanf(pCliDtiCommand, "%255s", cmdBuf); + cmdBuf[255] = '\0'; + + if(strlen(cmdBuf) < strlen(pCliDtiCommand)) + { + pArgBuf = (DSL_char_t *)pCliDtiCommand + strlen(cmdBuf) + 1; + } + + retVal = DSL_CPE_CliDeviceCommandExecute(pDtiContext->pDSLContext, -1, cmdBuf, pArgBuf, pOutStream); + + return retVal; +} + +/** + Exit the CLI DTI +*/ +DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Exit( + DSL_void_t *pContext) +{ + DSL_Error_t ret = DSL_SUCCESS; + DSL_CPE_Dti_Context_t *pDtiContext = (DSL_CPE_Dti_Context_t*)pContext; + + if (pDtiContext == DSL_NULL) + { + return DSL_ERROR; + } + + /* unregister the exec within the DTI module */ +#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA + if (pDtiContext->bEnabled == DSL_TRUE) + { +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + if (DSL_CPE_CLI_Unregister(pDtiContext->pCLIContext) == DSL_SUCCESS) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, CLI DTI Exit - unregister failed" DSL_CPECRLF); + DSL_CPE_Free(pDtiContext->pCLIContext); + pDtiContext->pCLIContext = DSL_NULL; + } +#endif /* #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) */ + } +#endif + + return ret; +} + +/** + CLI DTI Event +*/ +DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Event( + DSL_void_t *pContext, + DSL_char_t *pMessage) +{ + DSL_uint_t eventOutSize_byte = 0; + DSL_CPE_Dti_Context_t *pDtiContext = (DSL_CPE_Dti_Context_t *)pContext; + + eventOutSize_byte = strlen(pMessage) + 1; + + if (DTI_CLI_InterfaceEventSend( + pDtiContext->pDtiAgent, pDtiContext->ifNum, + pMessage, eventOutSize_byte) != IFX_SUCCESS) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"CLI DTI Event - event send failed" DSL_CPE_CRLF + "Evt: <%s>" DSL_CPE_CRLF, pMessage); + + return DSL_ERROR; + } + + return DSL_SUCCESS; +} + +/** + Handle a incoming command form the Debug & Trace interface +*/ +DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Exec( + DSL_void_t *pCliDtiDescriptor, + const DSL_char_t *pCmdIn, + DSL_char_t *pResultOut, + DSL_int_t *pResultBufSize_byte, + DSL_int_t *pResultCode) +{ + DSL_int_t retVal = 0, writtenBytes = 0; + DSL_CPE_Dti_Context_t *pCliDtiContext = (DSL_CPE_Dti_Context_t *)pCliDtiDescriptor; + DSL_CPE_File_t *pOutStream = DSL_CPE_STDOUT; + + if (pResultOut && pResultBufSize_byte) + { + memset(pResultOut, 0, *pResultBufSize_byte); + } + else + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, missing DTI result buffer" DSL_CPE_CRLF); + return DSL_ERROR; + } + + if (!pCliDtiDescriptor) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, missing CLI DTI handle" DSL_CPE_CRLF); + writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte, + "nReturn=-1 nError=\"oops, missing CLI DTI handle\n\r\""); + + *pResultBufSize_byte = writtenBytes; + return DSL_ERROR; + } + + if (!pCmdIn) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, missing DTI command" DSL_CPE_CRLF); + writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte, + "nReturn=-1 nError=\"oops, missing DTI command\n\r\""); + + *pResultBufSize_byte = writtenBytes; + return DSL_ERROR; + } + +#if defined(IFXOS_HAVE_MEMORY_FILE) && (IFXOS_HAVE_MEMORY_FILE == 1) + pOutStream = DSL_CPE_FMemOpen(pResultOut, *pResultBufSize_byte - 1, "w"); + if(pOutStream == NULL) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, cannot open DTI stream" DSL_CPE_CRLF); + writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte, + "nReturn=-1 nError=\"oops, cannot open DTI stream\n\r\""); + + *pResultBufSize_byte = writtenBytes; + return DSL_ERROR; + } +#endif + + /* + execute the given DTI command. + */ + retVal = DSL_CPE_CLI_Dti_Command_Exec(pCliDtiContext, pCmdIn, pOutStream); + + + if (retVal) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"nReturn=%d" DSL_CPE_CRLF, retVal); + } + +#if defined(IFXOS_HAVE_MEMORY_FILE) && (IFXOS_HAVE_MEMORY_FILE == 1) + DSL_CPE_FClose(pOutStream); + + writtenBytes = strlen(pResultOut); + pResultOut[writtenBytes] = '\0'; +#else + writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte, + "nReturn=%d nWarning=\"result written to stdout\n\r\"", retVal); +#endif + + *pResultBufSize_byte = writtenBytes; + + return DSL_SUCCESS; +} +#endif /* #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/ + +/* ============================================================================ + Global Function definitons + ========================================================================= */ +/** + Initialize the DTI +*/ +DSL_Error_t DSL_CPE_Dti_Start( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t numOfPhyDevices, + DSL_int_t numOfLinesPerPhyDevice, + DSL_uint16_t dtiListenPort, + DSL_char_t *pDtiServerIp, + DSL_boolean_t bEnableCliAutoMsg, + DSL_boolean_t bEnableDevAutoMsg, + DSL_boolean_t bEnableSingleThreadMode) +{ + DSL_int_t ret = DSL_SUCCESS; + DTI_AgentCtx_t *pDtiAgent = DSL_NULL; + DTI_AgentStartupSettings_t dtiStartup; + + memset(&dtiStartup, 0x00, sizeof(DTI_AgentStartupSettings_t)); + +#if defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0) + DTI_AgentStartupSettingsXDevs_t AgentStartupSettingsXDevs; + DTI_DeviceAccessFct_t *pDeviceAccessFct = IFX_NULL; + + if (DSL_CPE_GlobalDtiContext.bEnabled == DSL_TRUE) + { + /* already running */ + return DSL_SUCCESS; + } + + /* init the DTI control struct */ + memset(&DSL_CPE_GlobalDtiContext, 0, sizeof(DSL_CPE_Dti_Context_t)); + DSL_CPE_GlobalDtiContext.ifNum = -1; + + if (DSL_CPE_GlobalDtiContext.pDtiAgent == DSL_NULL) + { + memset(&AgentStartupSettingsXDevs, 0x00, sizeof(DTI_AgentStartupSettingsXDevs_t)); + + /* DTI Agent configuration */ + AgentStartupSettingsXDevs.debugLevel = 3; + AgentStartupSettingsXDevs.bStartupAutoCliMsgSupport = (bEnableCliAutoMsg == DSL_TRUE) ? 1 : 0; + +#if defined(DTI_SUPPORT_SINGLE_THREADED_MODE) && (DTI_SUPPORT_SINGLE_THREADED_MODE == 1) + /* + Out from the DTI Agent interface: + This version ot the DTI Agent supports "single threaded mode" + */ + if (bEnableSingleThreadMode == DSL_TRUE) + { + AgentStartupSettingsXDevs.bSingleThreadedMode = 1; + AgentStartupSettingsXDevs.numOfUsedWorker = 1; + } + else + { + AgentStartupSettingsXDevs.bSingleThreadedMode = 0; + AgentStartupSettingsXDevs.numOfUsedWorker = 4; + } +#endif + + /* DTI IP Setup setup */ + cpe_control_strncpy_s(AgentStartupSettingsXDevs.serverIpAddr, 16, pDtiServerIp, strlen(pDtiServerIp)); + AgentStartupSettingsXDevs.serverIpAddr[15]='\0'; + AgentStartupSettingsXDevs.listenPort = (dtiListenPort == 0) ? 9000 : (IFX_uint16_t)dtiListenPort; + + pDeviceAccessFct = &DTI_DeviceAccessFct_VRX; + + if ( (pDeviceAccessFct != IFX_NULL) && + (numOfPhyDevices > 0) && (numOfLinesPerPhyDevice > 0) ) + { + AgentStartupSettingsXDevs.devIfSettings[0].bStartupAutoDevMsgSupport = + (bEnableDevAutoMsg == DSL_TRUE) ? 1 : 0; + AgentStartupSettingsXDevs.devIfSettings[0].numOfDevices = (IFX_int_t)numOfPhyDevices; + AgentStartupSettingsXDevs.devIfSettings[0].linesPerDevice = (IFX_int_t)numOfLinesPerPhyDevice; + AgentStartupSettingsXDevs.devIfSettings[0].pDeviceAccessFct = pDeviceAccessFct; + } + + /* + start the DTI Agent + */ + if ( DTI_AgentStartXDevs(&pDtiAgent, &AgentStartupSettingsXDevs) != DTI_SUCCESS) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX "DSL: ERROR - start DTI agent (several devices)" DSL_CPE_CRLF); + + return DSL_ERROR; + } + DSL_CPE_GlobalDtiContext.pDtiAgent = pDtiAgent; + } + else + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX "DSL: WARNING - DTI agent already running" DSL_CPE_CRLF); + } +#else /* defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0) */ + if (DSL_CPE_GlobalDtiContext.pDtiAgent == DSL_NULL) + { + /* init the DTI control struct */ + memset(&DSL_CPE_GlobalDtiContext, 0, sizeof(DSL_CPE_Dti_Context_t)); + DSL_CPE_GlobalDtiContext.ifNum = -1; + + /* physical device setup */ + dtiStartup.numOfDevices = (IFX_int_t)numOfPhyDevices; + dtiStartup.linesPerDevice = (IFX_int_t)numOfLinesPerPhyDevice; + + + /* DTI IP Setup setup */ + cpe_control_strncpy_s(dtiStartup.serverIpAddr, 16, pDtiServerIp, strlen(pDtiServerIp)); + dtiStartup.listenPort = (dtiListenPort == 0) ? 9000 : (IFX_uint16_t)dtiListenPort; + + /* DTI Agent configuration */ + dtiStartup.bStartupAutoCliMsgSupport = (bEnableCliAutoMsg == DSL_TRUE) ? 1 : 0; + dtiStartup.bStartupAutoDevMsgSupport = (bEnableDevAutoMsg == DSL_TRUE) ? 1 : 0; + + dtiStartup.debugLevel = 3; + +#if defined(DTI_SUPPORT_SINGLE_THREADED_MODE) && (DTI_SUPPORT_SINGLE_THREADED_MODE == 1) + /* + Out from the DTI Agent interface: + This version ot the DTI Agent supports "single threaded mode" + */ + if (bEnableSingleThreadMode == DSL_TRUE) + { + dtiStartup.bSingleThreadedMode = 1; + dtiStartup.numOfUsedWorker = 1; + } + else + { + dtiStartup.bSingleThreadedMode = 0; + dtiStartup.numOfUsedWorker = 4; + } +#endif + + /* + start the DTI Agent + */ + if ( DTI_AgentStart(&pDtiAgent, &dtiStartup) != DTI_SUCCESS) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - start DTI agent" DSL_CPE_CRLF); + + return DSL_ERROR; + } + DSL_CPE_GlobalDtiContext.pDtiAgent = pDtiAgent; + } + else + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"WARNING - DTI agent already running" DSL_CPE_CRLF); + } +#endif/* defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0) */ + +#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) + if (DSL_CPE_GlobalDtiContext.bEnabled != DSL_TRUE) + { + DSL_CPE_GlobalDtiContext.pDSLContext = pContext; + + if (dtiStartup.bStartupAutoCliMsgSupport == 1) + { + ret = DSL_CPE_CLI_Register( + &DSL_CPE_GlobalDtiContext.pCLIContext, + &DSL_CPE_GlobalDtiContext, + DSL_CPE_CLI_Dti_Exit, + DSL_CPE_CLI_Dti_Event); + } + else + { + ret = DSL_CPE_CLI_Register( + &DSL_CPE_GlobalDtiContext.pCLIContext, + &DSL_CPE_GlobalDtiContext, + DSL_CPE_CLI_Dti_Exit, + IFX_NULL); + } + + + /* register the exec within the DTI module */ + DSL_CPE_GlobalDtiContext.ifNum = DTI_CLI_SendFunctionRegister( + (IFX_void_t *)DSL_CPE_GlobalDtiContext.pDtiAgent, + (IFX_void_t *)&DSL_CPE_GlobalDtiContext, + "DSL_API", + DSL_CPE_CLI_Dti_Exec, + 0x10000 /* size of response buffer */); + if (DSL_CPE_GlobalDtiContext.ifNum < 0) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - start DTI agent, send fct register" DSL_CPE_CRLF); + + if (DSL_CPE_CLI_Unregister(DSL_CPE_GlobalDtiContext.pCLIContext) == DSL_SUCCESS) + { + DSL_CPE_Free(DSL_CPE_GlobalDtiContext.pCLIContext); + DSL_CPE_GlobalDtiContext.pCLIContext = DSL_NULL; + } + + return DSL_ERROR; + } + } + else + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"WARNING - DTI agent already registered" DSL_CPE_CRLF); + } +#endif /* #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/ + + DSL_CPE_GlobalDtiContext.bEnabled = DSL_TRUE; + + return ret; +} + +/** + Initialise the CLI DTI +*/ +DSL_Error_t DSL_CPE_Dti_Stop( + DSL_CPE_Control_Context_t *pContext) +{ + DTI_AgentCtx_t *pDtiAgent = DSL_NULL; + + if (DSL_CPE_GlobalDtiContext.bEnabled == DSL_TRUE) + { + pDtiAgent = DSL_CPE_GlobalDtiContext.pDtiAgent; + DSL_CPE_GlobalDtiContext.pDtiAgent = DSL_NULL; + + if ( DTI_AgentStop(&pDtiAgent) != DTI_SUCCESS) + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - Stop DTI agent" DSL_CPE_CRLF); + + return DSL_ERROR; + } + + if (DSL_CPE_CLI_Unregister(DSL_CPE_GlobalDtiContext.pCLIContext) == DSL_SUCCESS) + { + DSL_CPE_Free(DSL_CPE_GlobalDtiContext.pCLIContext); + DSL_CPE_GlobalDtiContext.pCLIContext = DSL_NULL; + } + } + else + { + DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - Stop DTI agent, not running" DSL_CPE_CRLF); + + return DSL_ERROR; + } + + return DSL_SUCCESS; +} + +#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) */ diff --git a/src/dsl_cpe_dti.h b/src/dsl_cpe_dti.h new file mode 100644 index 0000000..adc0859 --- /dev/null +++ b/src/dsl_cpe_dti.h @@ -0,0 +1,67 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +*******************************************************************************/ + +#ifndef _DSL_CPE_DTI_H_ +#define _DSL_CPE_DTI_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dsl_cpe_control.h" + +#define DSL_CPE_DTI_DEFAULT_TCP_PORT (9000) + +/** \file + DSL daemon command line interface for DTI control +*/ + +/** + Start the Debug and Trace Agent + + \param pContext DSL CPE API context pointer (used for callback handling) + \param numOfPhyDevices number of used physical devices. + \param numOfLinesPerPhyDevice lines per physical device + \param dtiListenPort DTI Agent listen port number. + \param pDtiServerIp DTI Agent IP address. + + \return + - DSL_ERROR On error + - DSL_SUCCESS On success +*/ +DSL_Error_t DSL_CPE_Dti_Start( + DSL_CPE_Control_Context_t *pContext, + DSL_int_t numOfPhyDevices, + DSL_int_t numOfLinesPerPhyDevice, + DSL_uint16_t dtiListenPort, + DSL_char_t *pDtiServerIp, + DSL_boolean_t bEnableCliAutoMsg, + DSL_boolean_t bEnableDevAutoMsg, + DSL_boolean_t bEnableSingleThreadMode); + + +/** + Stop the Debug and Trace Agent + + \param pContext DSL CPE API context pointer (used for callback handling) + + \return + - DSL_ERROR On error + - DSL_SUCCESS On success +*/ +DSL_Error_t DSL_CPE_Dti_Stop( + DSL_CPE_Control_Context_t *pContext); + +#ifdef __cplusplus +} +#endif + +#endif /* _DSL_CPE_DTI_H_ */ + diff --git a/src/dsl_cpe_dti_vrx.c b/src/dsl_cpe_dti_vrx.c new file mode 100644 index 0000000..0582e76 --- /dev/null +++ b/src/dsl_cpe_dti_vrx.c @@ -0,0 +1,3154 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Debug and Trace Interface - Basic Protocol Packet Handling. +*/ + +/* ============================================================================ + Includes + ========================================================================= */ +#include "dti_osmap.h" +#include "dsl_cpe_control.h" + +#if defined(INCLUDE_DSL_CPE_API_VRX) + +#include "cmv_message_format.h" + +#include "drv_mei_cpe_interface.h" +#include "drv_dsl_cpe_api_ioctl.h" + +#include "ifx_dti_protocol.h" +#include "ifx_dti_protocol_device.h" + +#ifdef DTI_DONT_USE_PROTEXT +/* + Dummy defines, not requried for the DTI Serial Proxy. +*/ +typedef struct DTI_ProtocolServerCtx_s +{ + IFX_int_t dummy; +} DTI_ProtocolServerCtx_t; + +typedef struct DTI_Connection_s +{ + IFX_int_t dummy; +} DTI_Connection_t; + + +/* sorry for this style - we want to avoid that the dti_protocol_ext.h is included */ +#ifndef _DTI_PROTOCOL_EXT_H +#define _DTI_PROTOCOL_EXT_H +#endif +#endif /* DTI_DONT_USE_PROTEXT */ + +#include "dti_device.h" +#include "dsl_cpe_dti_vrx_ctx.h" + +/* ============================================================================ + Defines + ========================================================================= */ +#ifdef DTI_STATIC +# undef DTI_STATIC +#endif + +#ifdef DTI_DEBUG +# define DTI_STATIC +#else +# define DTI_STATIC static +#endif + +#define VRX_IOCTL_ARG unsigned long + +/** DTI Device Interface Name */ +#define DTI_DEV_VRX_IF_NAME "DSL-CPE" +#define DTI_DEV_VRX_BOARD_NAME "DSL CPE Board" + +/** Max number of register accesses per packet */ +#define DTI_DEV_VRX_MAX_REGISTER_ACCESS_NUM 0x44 +/** Max number of debug accesses per packet */ +#define DTI_DEV_VRX_MAX_DEBUG_ACCESS_NUM 0x44 +/** max DTI buffer size for debug stream handling */ +#define DTI_DEV_MEI_DBG_STREAM_MAX_BUFFER_SIZE 0x10000 + +/** default VRX device mailbox size */ +#define DTI_DEV_VRX_DEFAULT_MBOX_SIZE CMV_USED_PAYLOAD_8BIT_SIZE + +#define DTI_VRX_ARRAY_LENGTH(array) ((sizeof(array)/sizeof((array)[0]))) + +/* message header structure */ +#define VRX_DTI_MSG_IDX_MSDID 0 +#define VRX_DTI_MSG_IDX_INDEX 1 +#define VRX_DTI_MSG_IDX_LENGTH 2 + +/* ============================================================================ + Local Function Declaration + ========================================================================= */ + +DTI_STATIC IFX_int_t DTI_DevOpenByName( + IFX_int_t dev_num, + IFX_char_t *pDevName); + +DTI_STATIC IFX_int_t DTI_DevCloseByFd( + IFX_int_t devFd); + +DTI_STATIC IFX_int_t DTI_DevOpen( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + DTI_PacketError_t *pPacketError, + IFX_int_t lineNum); + +DTI_STATIC IFX_int_t DTI_DevClose( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + DTI_PacketError_t *pPacketError, + IFX_int_t lineNum); + +DTI_STATIC IFX_int_t DTI_configSet_AutoMsg( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + DTI_H2D_DeviceConfigSet_t *pInCfgSet, + DTI_D2H_DeviceConfigSet_t *pOutCfgSet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_configGet_AutoMsg( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +#ifndef DTI_DONT_USE_PROTEXT +DTI_STATIC IFX_int_t DTI_autoMsgRecv( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + const DTI_Connection_t *pDtiCon, + IFX_int_t devIfNum, + IFX_int_t lineNum, + IFX_char_t *pOutBuffer, + IFX_int_t outBufferSize_byte); +#endif /* !DTI_DONT_USE_PROTEXT */ + +#ifndef DTI_DONT_USE_PROTEXT +DTI_STATIC IFX_void_t DTI_devFdClear( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + IFX_int_t lineNum); +#endif /* !DTI_DONT_USE_PROTEXT */ + +DTI_STATIC IFX_int_t DTI_configGet_MbSize( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +/* ============================================================================ + Device Access Functions + ========================================================================= */ + +DTI_STATIC IFX_int_t DTI_VRX_PrintoutLevelSet( + IFX_int_t newDbgLevel); + +DTI_STATIC IFX_int_t DTI_VRX_ModuleSetup( + DTI_DeviceSysInfo_t *pDeviceSystemInfo, + DTI_DeviceCtx_t **ppDtiDevCtx); + +DTI_STATIC IFX_int_t DTI_VRX_ModuleDelete( + DTI_DeviceSysInfo_t *pDeviceSystemInfo, + DTI_DeviceCtx_t **ppDtiDevCtx); + +DTI_STATIC IFX_int_t DTI_VRX_SystemInfoWrite( + DTI_DeviceSysInfo_t *pDeviceSystemInfo, + IFX_char_t *pSysInfoBuffer, + IFX_int_t bufferSize); + +DTI_STATIC IFX_int_t DTI_VRX_Reset( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceReset_t *pInDevReset, + DTI_D2H_DeviceReset_t *pOutDevReset, + IFX_int_t rstMaskSize_32, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_Download( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_ProtocolServerCtx_t *pDtiProtServerCtx, + DTI_H2D_DeviceDownload_t *pInDevDownload, + DTI_D2H_DeviceDownload_t *pOutDevDownload, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_DeviceOpen( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_DeviceClose( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_RegisterLock( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceLock_t *pInLock, + DTI_D2H_DeviceLock_t *pOutLock, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_RegisterGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_RegisterGet_t *pInRegGet, + DTI_D2H_RegisterGet_t *pOutRegGet, + IFX_int_t lineNum, + IFX_uint32_t *pOutPaylSize_byte, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_RegisterSet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_RegisterSet_t *pInRegSet, + IFX_int_t inRegSetSize_Byte, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_ConfigSet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceConfigSet_t *pInCfgSet, + DTI_D2H_DeviceConfigSet_t *pOutCfgSet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_ConfigGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceConfigGet_t *pInCfgGet, + DTI_D2H_DeviceConfigGet_t *pOutCfgGet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +#if (DTI_DEVICE_INTERFACE_VERSION) > (0x00000100) +DTI_STATIC IFX_int_t DTI_VRX_Message8Send( + DTI_DeviceCtx_t * pDtiDevCtx, + DTI_H2D_Message8_u *pInMsg8Send, + DTI_D2H_Message8_u *pOutMsg8Send, + IFX_int_t devNum, + IFX_int_t inPaylSize_byte, + IFX_int_t * pOutPaylSize_byte, + DTI_PacketError_t *pPacketError); +#endif + +DTI_STATIC IFX_int_t DTI_VRX_Message16Send( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_Message16_u *pInMsg16Send, + DTI_D2H_Message16_u *pOutMsg16Send, + IFX_int_t lineNum, + IFX_int_t inPaylSize_byte, + IFX_int_t *pOutPaylSize_byte, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_Message32Send( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_Message32_u *pInMsg32Send, + DTI_D2H_Message32_u *pOutMsg32Send, + IFX_int_t lineNum, + IFX_int_t inPaylSize_byte, + IFX_int_t *pOutPaylSize_byte, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferConfigSet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_TraceConfigSet_t *pInTraceConfigSet, + DTI_D2H_TraceConfigSet_t *pOutTraceConfigSet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferReset( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferStatusGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_D2H_TraceStatusGet_t *pOutTraceStatusGet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_TraceBufferGet_t *pInTraceBufferGet, + DTI_Packet_t **ppUsedDtiPacketOut, + IFX_int_t *pUsedBufferOutSize, + IFX_int_t lineNum, + IFX_int_t *pTrBufReadSize_byte, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_DebugRead( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DebugRead_t *pInDbgGet, + DTI_D2H_DebugRead_t *pOutDbgGet, + IFX_int_t lineNum, + IFX_int_t *pDbgReadCount, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_DebugWrite( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DebugWrite_t *pInDbgSet, + IFX_uint32_t *pOutDbgGet_nU, + IFX_int_t lineNum, + IFX_int_t *pDbgWriteCount, + DTI_PacketError_t *pPacketError); + +DTI_STATIC IFX_int_t DTI_VRX_AutoMsgProcess( + DTI_DeviceCtx_t *pDtiDevCtx, + const DTI_Connection_t *pDtiCon, + IFX_uint32_t devSelectWait_ms, + IFX_char_t *pOutBuffer, + IFX_int_t outBufferSize_byte); + +DTI_STATIC IFX_int_t DTI_VRX_WinEasyCiAccess( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + const IFX_uint8_t *pDataIn, + const IFX_uint32_t sizeIn, + IFX_uint8_t *pDataOut, + const IFX_uint32_t sizeOut, + DTI_PacketError_t *pPacketError); + +/* ============================================================================ + Variables + ========================================================================= */ + +/* Create device debug module - user part */ +IFXOS_PRN_USR_MODULE_CREATE(DTI_VRX, DTI_PRN_LEVEL_HIGH); + +/** + Collection of all available device access functions. +*/ +DTI_DeviceAccessFct_t DTI_DeviceAccessFct_VRX = +{ + sizeof(DTI_DeviceAccessFct_t), /* structure check */ + DTI_DEVICE_INTERFACE_VERSION, /* device interface version */ + DTI_DEV_VRX_IF_NAME, /* device name */ + + DTI_VRX_PrintoutLevelSet, + DTI_VRX_ModuleSetup, + DTI_VRX_ModuleDelete, + DTI_VRX_SystemInfoWrite, + + DTI_VRX_Reset, + DTI_VRX_Download, + DTI_VRX_DeviceOpen, + DTI_VRX_DeviceClose, + DTI_VRX_RegisterLock, + DTI_VRX_RegisterGet, + DTI_VRX_RegisterSet, + DTI_VRX_ConfigSet, + DTI_VRX_ConfigGet, + DTI_VRX_Message16Send, + DTI_VRX_Message32Send, + DTI_VRX_TraceBufferConfigSet, + DTI_VRX_TraceBufferReset, + DTI_VRX_TraceBufferStatusGet, + DTI_VRX_TraceBufferGet, + DTI_VRX_DebugRead, + DTI_VRX_DebugWrite, + DTI_VRX_AutoMsgProcess, + DTI_VRX_WinEasyCiAccess, +#if (DTI_DEVICE_INTERFACE_VERSION) > (0x00000100) + DTI_VRX_Message8Send, +#endif +}; + + +/* ============================================================================ + Local Function + ========================================================================= */ + +static DSL_int_t DTI_VrxDeviceStateCheck( + DSL_int_t fd) +{ + IOCTL_MEI_reqCfg_t Vdsl2_requCfg; + + memset(&Vdsl2_requCfg, 0x0, sizeof(IOCTL_MEI_reqCfg_t)); + + if (DSL_CPE_Ioctl(fd, FIO_MEI_REQ_CONFIG, (DSL_int_t)&Vdsl2_requCfg) != 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ioct(FIO_MEI_REQ_CONFIG): ERROR - cannot request config, retCode = %d!"DSL_CPE_CRLF, + Vdsl2_requCfg.ictl.retCode)); + return -1; + } + + if (Vdsl2_requCfg.currDrvState != 6) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "ioct(FIO_MEI_REQ_CONFIG): ERROR - device not available, state = %d!"DSL_CPE_CRLF, + Vdsl2_requCfg.currDrvState)); + return -1; + } + + return 0; +} + +/** + Open a line or control device of the VRX driver + +\param + num - control or line device number +\param + bCntrlDev - if set open a control device +\param + pDevName - device base name + +\return + if success, a valid device fd + else IFX_ERROR. +*/ +DTI_STATIC IFX_int_t DTI_DevOpenByName( + IFX_int_t dev_num, + IFX_char_t *pDevName) +{ + DSL_char_t text[30]; + DSL_int_t mei_fd = -1; + + if (pDevName == DSL_NULL) + { + return -1; + } + + snprintf(text, sizeof(text),"%s/%d", pDevName, dev_num); + text[sizeof(text) - 1]='\0'; + + mei_fd = DSL_CPE_Open(text); + /*mei_fd = open(text, O_RDWR);*/ + + if (mei_fd < 0) + { + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "xDSL device driver cannot be opened!"DSL_CPE_CRLF)); + return -1; + } + + /* Check VRX device driver state*/ + if (DTI_VrxDeviceStateCheck(mei_fd) < 0) + { + DSL_CPE_Close(mei_fd); + DSL_CCA_DEBUG (DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "xDSL device driver not ready!"DSL_CPE_CRLF)); + return -1; + } + + return mei_fd; +} + +/** + Close a line or control device of the VRX driver + +\param + devFd - a valid device fd + +\return + If success IFX_SUCCESS else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t DTI_DevCloseByFd( + IFX_int_t devFd) +{ + IFX_int_t retVal = IFX_ERROR; + + if (devFd > 0) + { + retVal = DSL_CPE_Close(devFd); + } + + return retVal; +} + +DTI_STATIC IFX_int_t DTI_DevOpen( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + DTI_PacketError_t *pPacketError, + IFX_int_t lineNum) +{ + *pPacketError = DTI_eNoError; + + if (pVrxDevCtx->pDevFds[lineNum] < 0) + { + pVrxDevCtx->pDevFds[lineNum] = + DTI_DevOpenByName(lineNum, DSL_CPE_DSL_LOW_DEV); + if (pVrxDevCtx->pDevFds[lineNum] < 0) + { + *pPacketError = DTI_eErrPortOpen; + return IFX_ERROR; + } + } + + return IFX_SUCCESS; +} + +DTI_STATIC IFX_int_t DTI_DevClose( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + DTI_PacketError_t *pPacketError, + IFX_int_t lineNum) +{ + *pPacketError = DTI_eNoError; + + if (pVrxDevCtx->pDevFds[lineNum] >= 0) + { + (void)DTI_DevCloseByFd(pVrxDevCtx->pDevFds[lineNum]); + pVrxDevCtx->pDevFds[lineNum] = -1; + } + + return IFX_SUCCESS; +} + +/* + Config Set - enable / disable autonomous messages. + +\param + pVrxDevCtx - points to the VRX Device context. +\param + pInCfgSet - points to the config data which will be set. +\param + pOutCfgSet - points to the data structure to return the actual config. +\param + lineNum - line number +\param + pPacketError - returns the DTI operation result + +\return + -1 if something went wrong, else + size of the mailbox +*/ +DTI_STATIC IFX_int_t DTI_configSet_AutoMsg( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + DTI_H2D_DeviceConfigSet_t *pInCfgSet, + DTI_D2H_DeviceConfigSet_t *pOutCfgSet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ +#ifndef DTI_DONT_USE_PROTEXT + IFX_int_t nfcChange = 1; + IOCTL_MEI_ioctl_t drvIoCtl; + + pOutCfgSet->key = pInCfgSet->key; + pOutCfgSet->value = 0; + + if ((pInCfgSet->value != 1) && (pInCfgSet->value != 0)) + { + *pPacketError = DTI_eErrInvalidParameters; + + return IFX_SUCCESS; + } + + if (pVrxDevCtx->bAutoDevMsgSupport) + { + if ( (pVrxDevCtx->pDevFds[lineNum] == -1) && (pInCfgSet->value == 0) ) + { + nfcChange = 0; + } + else + { + DTI_devFdClear(pVrxDevCtx, lineNum); + } + + if (nfcChange == 1) + { + DTI_MemSet(&drvIoCtl, 0x00, sizeof(drvIoCtl)); + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Config Set AutoMsg - device open error." DTI_CRLF)); + + *pPacketError = DTI_eErrPortOpen; + return IFX_ERROR; + } + + if ( (DSL_CPE_Ioctl( + pVrxDevCtx->pDevFds[lineNum], + (pInCfgSet->value == 0) ? FIO_MEI_MBOX_NFC_DISABLE : FIO_MEI_MBOX_NFC_ENABLE, + (DSL_int_t)&drvIoCtl)) < 0 ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Config Set AutoMsg - ioctl, NFC %s."DTI_CRLF, + (pInCfgSet->value == 0) ? "disable" : "enable")); + + *pPacketError = DTI_eErrPortOperation; + } + else + { + if (pInCfgSet->value == 1) + { + IFXOS_DevFdSet( (IFX_uint32_t)pVrxDevCtx->pDevFds[lineNum], + &pVrxDevCtx->nfcDevFds); + + if ((pVrxDevCtx->pDevFds[lineNum] + 1) > pVrxDevCtx->nfcMaxDevFd) + { + pVrxDevCtx->nfcMaxDevFd = pVrxDevCtx->pDevFds[lineNum] + 1; + } + pOutCfgSet->value = 1; + } + } + } + } + else +#endif /* !DTI_DONT_USE_PROTEXT */ + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Cfg Set - Auto msg not supported."DTI_CRLF)); + + *pPacketError = DTI_eErrConfiguration; + } + + return IFX_SUCCESS; +} + +/* + Config Get - enable / disable status of autonous messages. + +\param + pVrxDevCtx - points to the VRX Device context. +\param + lineNum - line number +\param + pPacketError - returns the DTI operation result + +\return + 1 if auto msg is enabled + 0 if auto msg is disabled +*/ +DTI_STATIC IFX_int_t DTI_configGet_AutoMsg( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + IFX_int_t keyValue = 0; + +#ifndef DTI_DONT_USE_PROTEXT + if (pVrxDevCtx->bAutoDevMsgSupport) + { + if ( (pVrxDevCtx->pDevFds[lineNum] >= 0) && (pVrxDevCtx->nfcMaxDevFd > 0)) + { + keyValue = (IFXOS_DevFdIsSet( (IFX_uint32_t)pVrxDevCtx->pDevFds[lineNum], + &pVrxDevCtx->nfcDevFds)) ? 1 : 0; + } + else + { + keyValue = 0; + } + + *pPacketError = DTI_eNoError; + } + else +#endif /* !DTI_DONT_USE_PROTEXT */ + { + *pPacketError = DTI_eErrConfiguration; + } + + return keyValue; +} + +#ifndef DTI_DONT_USE_PROTEXT +/** + Clear a device FD from the FD_SET and recalc new max FD. + +\param + pVrxDevCtx - points to the VRX Device context. +\param + lineNum - line number + +*/ +DTI_STATIC IFX_void_t DTI_devFdClear( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + IFX_int_t lineNum) +{ +#if defined(IFXOS_HAVE_DEV_FD_CLEAR) + IFX_int_t i, maxDevFd = 0; + + DTI_DevFdClear(pVrxDevCtx->pDevFd[lineNum], &pVrxDevCtx->nfcDevFds); + + for (i = 0; i < pVrxDevCtx->numOfPorts; i++) + { + if (pVrxDevCtx->pDevFd[i] >= 0) + { + if ( (DTI_DevFdIsSet(pVrxDevCtx->pDevFds[i], &pVrxDevCtx->nfcDevFds)) && + (pVrxDevCtx->pDevFds[i] > maxDevFd) } + { + maxDevFd = pVrxDevCtx->pDevFds[i]; + } + } + } + + pVrxDevCtx->nfcMaxDevFd = maxDevFd + 1; + +#else + IFX_int_t i, maxDevFd = 0; + + DTI_DevFdZero(&pVrxDevCtx->tmpDevFds); + pVrxDevCtx->nfcMaxDevFd = 0; + + for (i = 0; i < pVrxDevCtx->numOfPorts; i++) + { + if ( (pVrxDevCtx->pDevFds[i] >= 0) && (i != lineNum)) + { + if ( DTI_DevFdIsSet((IFX_uint32_t)pVrxDevCtx->pDevFds[i], &pVrxDevCtx->nfcDevFds) ) + { + DTI_DevFdSet((IFX_uint32_t)pVrxDevCtx->pDevFds[i], &pVrxDevCtx->tmpDevFds); + + if (pVrxDevCtx->pDevFds[i] > maxDevFd) + { + maxDevFd = pVrxDevCtx->pDevFds[i]; + } + } + } + } + + DTI_MemCpy(&pVrxDevCtx->nfcDevFds, &pVrxDevCtx->tmpDevFds, sizeof(IFXOS_devFd_set_t)); + pVrxDevCtx->nfcMaxDevFd = (maxDevFd) ? (maxDevFd + 1) : 0; + + DTI_DevFdZero(&pVrxDevCtx->tmpDevFds); + +#endif + return; +} +#endif /* !DTI_DONT_USE_PROTEXT */ + +#ifndef DTI_DONT_USE_PROTEXT +/** + Check and process for xDSL Rev3 Device Autonomous Messages. + The Auto Msg is read form the device (driver) and a corresponding + DTI packet is created and sent to the upper DTI Client + +\param + pVrxDevCtx - points to the VRX Device context. +\param + pDtiCon - points to the established DTI Connection data. +\param + lineNum - line number. +\param + pOutBuffer - points to the DTI packet out buffer to create a DTI packet. +\param + outBufferSize_byte - DTI out buffer size [byte] + +\return + IFX_SUCCESS if the DTI packet has been sent. + IFX_ERROR DTI packet has not been sent. + +\remarks + At first the device msg will be read out to free the internal driver buffer. + This is done independant on the established connection. +*/ +DTI_STATIC IFX_int_t DTI_autoMsgRecv( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + const DTI_Connection_t *pDtiCon, + IFX_int_t devIfNum, + IFX_int_t lineNum, + IFX_char_t *pOutBuffer, + IFX_int_t outBufferSize_byte) +{ + IFX_int_t paylBufferSize_byte = 0; + DTI_PacketError_t packetError = DTI_eNoError; + DTI_Packet_t *pAutoMsgPacket = IFX_NULL; + IFX_uint16_t *pModemPayload = IFX_NULL; + DTI_D2H_Message16_u *pMsg16; + IOCTL_MEI_message_t msgRead; + DTI_PTR_U uPayload; + + /* + First: read out the msg to free the driver. + */ + DTI_MemSet(&msgRead, 0x00, sizeof(msgRead)); + + msgRead.pPayload = (unsigned char*)pVrxDevCtx->pAutoMsgBuf; + msgRead.paylSize_byte = (unsigned int)pVrxDevCtx->autoMsgBuf_byte; + + if ( DSL_CPE_Ioctl( + pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_MBOX_NFC_RD, + (DSL_int_t)&msgRead) < 0 ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Auto Msg[0x04X%] - ioctl error)."DTI_CRLF, + msgRead.msgId)); + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("\tNFC[0x04X%]."DTI_CRLF,msgRead.msgId)); + + packetError = DTI_eErrPortAutoOperation; + } + + /* + Second: prepare and send the packet. + */ + if (outBufferSize_byte < (sizeof(DTI_PacketHeader_t) + sizeof(IOCTL_MEI_message_t))) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Auto Msg - not enough out buffer."DTI_CRLF)); + + return IFX_ERROR; + } + + /* setup out packet */ + uPayload.pUInt8 = (IFX_uint8_t *)pOutBuffer; + pAutoMsgPacket = (DTI_Packet_t *)DTI_PTR_CAST_GET_ULONG(uPayload); + if (pAutoMsgPacket == IFX_NULL) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Auto Msg - DTI Packet out buffer missaligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* setup out packet - payload */ + uPayload.pUInt8 = (IFX_uint8_t *)pAutoMsgPacket->payload; + pMsg16 = (DTI_D2H_Message16_u *)DTI_PTR_CAST_GET_UINT16(uPayload); + if (pMsg16 == IFX_NULL) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Auto Msg - DTI Payload out buffer missaligned."DTI_CRLF)); + + packetError = (packetError == DTI_eNoError) ? DTI_eErrMalformedPacket : packetError; + } + + if (packetError == DTI_eNoError) + { + /* modem msg payload = index[16Bit] + length[16Bit] + Payload Data[16/32 Bit] */ + uPayload.pUInt8 = (IFX_uint8_t *)msgRead.pPayload; + pModemPayload = (IFX_uint16_t *)DTI_PTR_CAST_GET_UINT16(uPayload); + if (pModemPayload == IFX_NULL) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Auto Msg - DTI Payload modem buffer missaligned."DTI_CRLF)); + + packetError = (packetError == DTI_eNoError) ? DTI_eErrMalformedPacket : packetError; + } + } + + if ( (packetError == DTI_eNoError) && (pModemPayload != IFX_NULL) ) + { + /* DTI Packet Message [16/32 Bit]: + DTI Packet Header + Payload Hdr [msg ID, index, length] + Payload Data [16/32 Bit] */ + paylBufferSize_byte = outBufferSize_byte - sizeof(DTI_PacketHeader_t); + paylBufferSize_byte -= sizeof(pMsg16->raw.data[0])*4 + sizeof(pMsg16->raw.sendResult); + + if ( paylBufferSize_byte < ((IFX_int_t)msgRead.paylSize_byte) ) + { + /* not enough buffer - cut payload and setup error packet */ + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Auto Msg - cut Payload."DTI_CRLF)); + packetError = DTI_eErrInvalidPayloadSize; + } + else + { + paylBufferSize_byte = (IFX_int_t)msgRead.paylSize_byte; + if (msgRead.paylSize_byte & 0x1) + { + /* add 1 byte in case of odd msg length */ + paylBufferSize_byte +=1; + } + /* Modem 16 Bit message */ + (void)DTI_headerPacketTypeSet( + pAutoMsgPacket, + (IFX_uint32_t)DTI_PacketType_eMessageSend, + (IFX_uint32_t)DTI_e16Bit, + (IFX_uint32_t)((sizeof(pMsg16->raw.data[VRX_DTI_MSG_IDX_MSDID]) + sizeof(pMsg16->raw.sendResult)) + + paylBufferSize_byte) ); + + pMsg16->raw.sendResult = IFX_SUCCESS; + pMsg16->raw.data[VRX_DTI_MSG_IDX_MSDID] = msgRead.msgId; + if (paylBufferSize_byte > 0) + { + DTI_MemCpy(&pMsg16->raw.data[VRX_DTI_MSG_IDX_INDEX], msgRead.pPayload, paylBufferSize_byte); + } + } + } + + if (packetError != DTI_eNoError) + { + (void)DTI_headerPacketTypeSet( + pAutoMsgPacket, + (IFX_uint32_t)DTI_PacketType_eMessageError, (IFX_uint32_t)DTI_e8Bit, 0); + } + + /* complete header setup */ + pAutoMsgPacket->header.port = DTI_HDR_PORT_PORT_NUM_SET(pAutoMsgPacket->header.port, lineNum); + pAutoMsgPacket->header.port = DTI_HDR_PORT_DEV_TYPE_NUM_SET(pAutoMsgPacket->header.port, devIfNum); + pAutoMsgPacket->header.tan = (IFX_uint32_t)0; + pAutoMsgPacket->header.error = (IFX_uint32_t)packetError; + + DTI_packetShow ( + pAutoMsgPacket, IFX_TRUE, IFX_FALSE, "Vrx AutoMsg", + (pAutoMsgPacket->header.error == DTI_eNoError) ? IFXOS_PRN_LEVEL_LOW : DTI_PRN_LEVEL_HIGH); + + if (DTI_packetSend(pDtiCon, pAutoMsgPacket) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Auto Msg - send packet."DTI_CRLF)); + + return IFX_ERROR; + } + + return IFX_SUCCESS; +} +#endif /* !DTI_DONT_USE_PROTEXT */ + +/* + Get the Line Cfg from the driver and return the mailbox size. + +\param + pVrxDevCtx - points to the VRX Device context. +\param + lineNum - line number +\param + pPacketError - returns the DTI operation result + +\return + -1 if something went wrong, else + size of the mailbox +*/ +DTI_STATIC IFX_int_t DTI_configGet_MbSize( + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + IOCTL_MEI_reqCfg_t reqCfg; + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Config Get MB Size - device open error."DTI_CRLF)); + + return -1; + } + + DTI_MemSet(&reqCfg, 0x00, sizeof(IOCTL_MEI_reqCfg_t)); + + if ( (DSL_CPE_Ioctl( + pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_REQ_CONFIG, + (DSL_int_t)&reqCfg)) < 0 ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Config Get MB Size - request config error."DTI_CRLF)); + + *pPacketError = DTI_eErrPortOperation; + return -1; + } + else + { + DTI_PRN_USR_DBG_NL(DTI_VRX, DTI_PRN_LEVEL_NORMAL, + ("Vrx Config MB Size: ME2ARC = 0x%X, ARC2ME = 0x%X."DTI_CRLF, + reqCfg.Me2ArcOnlineMbSize, reqCfg.Arc2MeOnlineMbSize)); + + *pPacketError = DTI_eNoError; + return (IFX_int_t)reqCfg.Me2ArcOnlineMbSize; + } +} + +/** + xDSL Debug Stream setup + - request current config + - if still not init do init if data are given. + +\param + priv_ctx - points to the VRX Device context. +\param + line_num - line number +\param + cfg_get - incoming configuration +\param + cfg_set - outgoing configuration + +\return + -1 if something went wrong, else + size of the mailbox +*/ +DTI_STATIC IFX_int_t +DTI_traceBufferDbgStrmCfg(DTI_DEV_VrxDriverCtx_t *pVrxDevCtx, + IFX_int_t lineNum, + IOCTL_MEI_DEBUG_STREAM_configGet_t *pCfgGet, + IOCTL_MEI_DEBUG_STREAM_configSet_t *pCfgSet) +{ + /* get current config */ + DTI_MemSet(pCfgGet, 0x00, sizeof(IOCTL_MEI_DEBUG_STREAM_configGet_t)); + + if (IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_CONFIG_GET, + (IFX_int_t)pCfgGet) < 0) + { + if (pCfgSet != IFX_NULL) + { + if (IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_CONFIG_SET, + (IFX_int_t)pCfgSet) < 0) + { + DTI_PRN_USR_ERR_NL( + DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Mei dbgStreamCfgGet - "\ + "line %d, init set error."DTI_CRLF, + lineNum)); + + return IFX_ERROR; + } + else + { + DTI_MemSet(pCfgGet, 0x00, sizeof(IOCTL_MEI_DEBUG_STREAM_configGet_t)); + if (IFXOS_DeviceControl( + pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_CONFIG_GET, + (IFX_int_t)pCfgGet) < 0) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, + DTI_PRN_LEVEL_ERR, + ("ERROR: Mei dbgStreamCfgGet "\ + "- line %d, re-init get error"\ + DTI_CRLF, lineNum)); + + return IFX_ERROR; + } + else + { + return IFX_SUCCESS; + } + } + } + } + + return IFX_SUCCESS; +} + +DTI_STATIC IFX_int_t DTI_FwFeaturesGet( + IFX_char_t *pFirmware, + const IFX_uint32_t nFwLength, + DSL_FirmwareFeatures_t *pFwFeatures) +{ + DSL_uint32_t i = 0, nValue = 0; + IFX_uint32_t str_len = MAX_WHAT_STRING_LEN - 1; + IFX_uint8_t *ptr = IFX_NULL; + IFX_uint32_t rd_sz, bin_len; + IFX_boolean_t bFound = IFX_FALSE, bEnd = IFX_FALSE; + DSL_char_t pString[MAX_WHAT_STRING_LEN] = {0}; + IFX_int_t nFwApplication = -1; + IFX_uint8_t nPlatformId = 0; + DSL_char_t *pWhat = DSL_NULL; + + if((pFirmware == IFX_NULL) || (nFwLength < 4)) + { + return IFX_ERROR; + } + + bin_len = nFwLength; + rd_sz = bin_len - 4; + + if (bin_len < 4) + { + return DSL_ERROR; + } + + ptr = (IFX_uint8_t*)pFirmware; + + while (bin_len > 4) + { + while(rd_sz) + { + if(*ptr == '@' && !bFound) + { + if (ptr[1] == '(' && ptr[2] == '#' && ptr[3] == ')') + { + bFound = IFX_TRUE; + } + } + + if (bFound) + { + ptr += 4; + rd_sz -= 4; + + /* found what string */ + while(str_len && *ptr && (rd_sz)) + { + if(*ptr != ' ') + { + pString[i++] = *ptr; + str_len--; + } + + ptr++; + rd_sz--; + } + + bEnd = IFX_TRUE; + break; + } + + ptr++; + rd_sz--; + bin_len--; + } + + if (bEnd) + { + break; + } + } + + pString[i] = 0; + + if(i) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("Firmware WHAT String: %s"DTI_CRLF, pString)); + } + else + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("Firmware WHAT String not detected"DTI_CRLF)); + } + + pWhat = pString; + + for (i=0; i<6; i++) + { + if (*pWhat == '\0') + { + break; + } + + /* expect a hex value */ + nValue = strtoul(pWhat, &pWhat, 16); + + if (i == 0) + { + nPlatformId = (IFX_uint8_t) nValue; + } + + /* step to the next position after a '.' */ + pWhat = strpbrk(pWhat, "."); + pWhat++; + } + + pFwFeatures->nPlatformId = nPlatformId; + + if (i == 6) + { + nFwApplication = nValue; + } + + /* Check for Annex A (default) mode*/ + if (nFwApplication == 1) + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_ADSL_A; + } + else if ((nFwApplication == 0) || (nFwApplication == 2)) + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_ADSL_B; + } + + /* Check for the VDSL FW capability */ + if ((nFwApplication == 5) || (nFwApplication == 6)) + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_VDSL2; + } + + /* Check for the Vectoring FW capability */ + if (nFwApplication == 7) + { + pFwFeatures->nFirmwareXdslModes |= DSL_FW_XDSLMODE_VDSL2_VECTOR; + } + + return IFX_SUCCESS; +} + +/* ============================================================================ + Device Access Functions + ========================================================================= */ + +/** + Set a new debug level. +*/ +DTI_STATIC IFX_int_t DTI_VRX_PrintoutLevelSet( + IFX_int_t newDbgLevel) +{ + IFXOS_PRN_USR_LEVEL_SET(DTI_VRX, newDbgLevel); + + return IFX_SUCCESS; +} + +/** + Setup Vrx Module + +\param + pDeviceSystemInfo - points to the system infos +\param + ppDtiDevCtx - pointer to return the allocated Vrx Modul struct. + +\return + If success IFX_SUCCESS, the context is returned via the ppDtiDevCtx param + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t DTI_VRX_ModuleSetup( + DTI_DeviceSysInfo_t *pDeviceSystemInfo, + DTI_DeviceCtx_t **ppDtiDevCtx) +{ + IFX_int_t i, ctxSize = 0; + DTI_DeviceCtx_t *pDtiDevCtx = IFX_NULL; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = IFX_NULL; + DTI_PTR_U uDtiDevCtx; + IFX_int_t nDevNum; + + if ( (ppDtiDevCtx == IFX_NULL) || (pDeviceSystemInfo == IFX_NULL)) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Setup - NULL ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*ppDtiDevCtx != IFX_NULL) + { + pDtiDevCtx = *ppDtiDevCtx; + pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + } + + if (pDtiDevCtx != IFX_NULL) + { + pDtiDevCtx = *ppDtiDevCtx; + + DTI_PRN_USR_ERR_NL(DTI_VRX, IFXOS_PRN_LEVEL_WRN, + ("WARNING: Vrx Dev Module Setup - already done (devs = %d, ports = %d)."DTI_CRLF, + (pVrxDevCtx != IFX_NULL) ? pVrxDevCtx->numOfDevs : -1, + (pVrxDevCtx != IFX_NULL) ? pVrxDevCtx->numOfPorts : -1)); + + return IFX_ERROR; + } + + pDeviceSystemInfo->numOfDevs = (IFX_int_t)1; + pDeviceSystemInfo->portsPerDev = (IFX_int_t)1; + pDeviceSystemInfo->ifPerDev = (IFX_int_t)1; + pDeviceSystemInfo->numOfPorts = pDeviceSystemInfo->numOfDevs * pDeviceSystemInfo->portsPerDev; + pDeviceSystemInfo->bValid = IFX_FALSE; +#ifndef DTI_DONT_USE_PROTEXT + pDeviceSystemInfo->bControlAutoDevMsgSupport = IFX_TRUE; +#else + pDeviceSystemInfo->bControlAutoDevMsgSupport = IFX_FALSE; +#endif /* !DTI_DONT_USE_PROTEXT */ + + /* Calculate the number of devices */ + for (nDevNum = 0; nDevNum <= DTI_DEV_MAX_LINE_NUMBER; nDevNum++) + { + IFX_int_t fd = -1; + fd = DTI_DevOpenByName(nDevNum, DSL_CPE_IFX_LOW_DEV); + if (fd < 0) + { + break; + } + DTI_DevCloseByFd(fd); + } + + if (nDevNum > 0) + { + pDeviceSystemInfo->numOfDevs = (IFX_int_t)nDevNum; + pDeviceSystemInfo->numOfPorts = pDeviceSystemInfo->numOfDevs * + pDeviceSystemInfo->ifPerDev; + pDeviceSystemInfo->bValid = IFX_TRUE; + } + + DTI_PRN_USR_DBG_NL(DTI_VRX, DTI_PRN_LEVEL_HIGH, + ("Vrx Dev Module Setup - update driver config (devs = %d, ports per dev = %d, total lines = %d, auto msg support = %d)." + DTI_CRLF, pDeviceSystemInfo->numOfDevs, pDeviceSystemInfo->portsPerDev, pDeviceSystemInfo->numOfPorts, + pDeviceSystemInfo->bControlAutoDevMsgSupport)); + + ctxSize = sizeof(DTI_DeviceCtx_t) + sizeof(DTI_DEV_VrxDriverCtx_t) + + (sizeof(IFX_int_t) * pDeviceSystemInfo->numOfPorts); + ctxSize += ((pDeviceSystemInfo->bControlAutoDevMsgSupport == IFX_TRUE) ? (DTI_DEV_VRX_DEFAULT_MBOX_SIZE) : 0); + + uDtiDevCtx.pUInt8 = DTI_Malloc((IFX_uint_t)ctxSize); + if (uDtiDevCtx.pUInt8 == IFX_NULL) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Setup - Dev Struct alloc."DTI_CRLF)); + + return IFX_ERROR; + } + memset(uDtiDevCtx.pUInt8, 0x0, ctxSize); + /* set context pointer */ + pDtiDevCtx = (DTI_DeviceCtx_t *)DTI_PTR_CAST_GET_ULONG(uDtiDevCtx); + if (pDtiDevCtx == IFX_NULL) + { + DTI_Free(uDtiDevCtx.pUInt8); + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Setup - Dev Struct miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set pDevice pointer*/ + uDtiDevCtx.pUInt8 += sizeof(DTI_DeviceCtx_t); + pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t*)DTI_PTR_CAST_GET_UINT32(uDtiDevCtx); + + if (pVrxDevCtx == IFX_NULL) + { + DTI_Free(pDtiDevCtx); + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Setup - pDevice miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set devFd pointer */ + uDtiDevCtx.pUInt8 += sizeof(DTI_DEV_VrxDriverCtx_t); + pVrxDevCtx->pDevFds = (IFX_int_t *)DTI_PTR_CAST_GET_UINT32(uDtiDevCtx); + + if (pVrxDevCtx->pDevFds == IFX_NULL) + { + DTI_Free(pDtiDevCtx); + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Setup - Vnx devFds miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set auto msg buffer pointer */ + if (pDeviceSystemInfo->bControlAutoDevMsgSupport == IFX_TRUE) + { + uDtiDevCtx.pUInt8 += (sizeof(IFX_int_t) * pDeviceSystemInfo->numOfPorts); + pVrxDevCtx->pAutoMsgBuf = (IFX_ulong_t *)DTI_PTR_CAST_GET_ULONG(uDtiDevCtx); + + if (pVrxDevCtx->pAutoMsgBuf == IFX_NULL) + { + DTI_Free(pDtiDevCtx); + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Setup - Vnx Auto MSg Buffer miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + pVrxDevCtx->autoMsgBuf_byte = DTI_DEV_VRX_DEFAULT_MBOX_SIZE; + } + else + { + pVrxDevCtx->pAutoMsgBuf = IFX_NULL; + pVrxDevCtx->autoMsgBuf_byte = 0; + } + + for (i = 0; i < pDeviceSystemInfo->numOfPorts; i++) + { + pVrxDevCtx->pDevFds[i] = -1; + } + + pVrxDevCtx->numOfRegAccess = DTI_DEV_VRX_MAX_REGISTER_ACCESS_NUM; + pVrxDevCtx->numOfDebugAccess = DTI_DEV_VRX_MAX_DEBUG_ACCESS_NUM; + + pDtiDevCtx->bAutoDevMsgActive = IFX_FALSE; + + pVrxDevCtx->numOfDevs = pDeviceSystemInfo->numOfDevs; + pVrxDevCtx->portsPerDev = pDeviceSystemInfo->portsPerDev; + pVrxDevCtx->numOfPorts = pDeviceSystemInfo->numOfPorts; +#ifndef DTI_DONT_USE_PROTEXT + pVrxDevCtx->bAutoDevMsgSupport = pDeviceSystemInfo->bControlAutoDevMsgSupport; +#else + pVrxDevCtx->bAutoDevMsgSupport = IFX_FALSE; +#endif /* !DTI_DONT_USE_PROTEXT */ + pDtiDevCtx->pDevice = (IFX_void_t *)pVrxDevCtx; + *ppDtiDevCtx = pDtiDevCtx; + + return IFX_SUCCESS; +} + + +/** + Delete a Vrx Module. + - close all open devices + - free memory + +\param + ppDtiDevCtx - contains the modul context. + +\return + If success IFX_SUCCESS, the context is freed and the ptr is set to IFX_NULL. + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t DTI_VRX_ModuleDelete( + DTI_DeviceSysInfo_t *pDeviceSystemInfo, + DTI_DeviceCtx_t **ppDtiDevCtx) +{ + IFX_int_t i; + DTI_DeviceCtx_t *pDtiDevCtx = IFX_NULL; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = IFX_NULL; + + if (ppDtiDevCtx == IFX_NULL) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Delete - NULL ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*ppDtiDevCtx == IFX_NULL) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Dev Module Delete - NULL ptr modul ctx."DTI_CRLF)); + + return IFX_ERROR; + } + + pDtiDevCtx = *ppDtiDevCtx; + *ppDtiDevCtx = IFX_NULL; + + pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + for (i = 0; i < pVrxDevCtx->numOfPorts; i++) + { + if (pVrxDevCtx->pDevFds[i] >= 0) + { + (void)DTI_DevCloseByFd(pVrxDevCtx->pDevFds[i]); + pVrxDevCtx->pDevFds[i] = -1; + } + } + + DTI_Free(pDtiDevCtx); + + return IFX_SUCCESS; +} + +/** + Write the Sytem Info of the current DTI Agent instance to the given buffer. + +\param + pDeviceSystemInfo - points to Sytem Info struct of the current agent instance. +\param + pSysInfoBuffer - points to the Sytem Info char buffer. +\param + bufferSize - buffer size. + +\return + Number of written bytes. +*/ +DTI_STATIC IFX_int_t DTI_VRX_SystemInfoWrite( + DTI_DeviceSysInfo_t *pDeviceSystemInfo, + IFX_char_t *pSysInfoBuffer, + IFX_int_t bufferSize) +{ + IFX_int_t writtenLen = 0; + const IFX_char_t *pBoardName = DTI_DEV_VRX_BOARD_NAME; + + (void)DTI_snprintf(&pSysInfoBuffer[writtenLen], bufferSize - writtenLen, + "VendorName=%s", DTI_VENDOR_NAME_STR); + writtenLen = (IFX_int_t)DTI_StrLen(&pSysInfoBuffer[writtenLen]) + 1; + + (void)DTI_snprintf(&pSysInfoBuffer[writtenLen], bufferSize - writtenLen, + "BoardName=%s", pBoardName); + writtenLen += (IFX_int_t)DTI_StrLen(&pSysInfoBuffer[writtenLen]) + 1; + + (void)DTI_snprintf(&pSysInfoBuffer[writtenLen], bufferSize - writtenLen, + "BoardRevision=0.0"); + writtenLen += (IFX_int_t)DTI_StrLen(&pSysInfoBuffer[writtenLen]) + 1; + + if (pDeviceSystemInfo->bValid == IFX_TRUE) + { + (void)DTI_snprintf(&pSysInfoBuffer[writtenLen], bufferSize - writtenLen, + "NumOfDevices=%d", pDeviceSystemInfo->numOfDevs); + writtenLen += (IFX_int_t)DTI_StrLen(&pSysInfoBuffer[writtenLen]) + 1; + + (void)DTI_snprintf(&pSysInfoBuffer[writtenLen], bufferSize - writtenLen, + "MaxChannel=%d", pDeviceSystemInfo->numOfPorts); + writtenLen += (IFX_int_t)DTI_StrLen(&pSysInfoBuffer[writtenLen]) + 1; + } + else + { + (void)DTI_snprintf(&pSysInfoBuffer[writtenLen], bufferSize - writtenLen, + "NumOfDevices="); + writtenLen += (IFX_int_t)DTI_StrLen(&pSysInfoBuffer[writtenLen]) + 1; + + (void)DTI_snprintf(&pSysInfoBuffer[writtenLen], bufferSize - writtenLen, + "MaxChannel="); + writtenLen += (IFX_int_t)DTI_StrLen(&pSysInfoBuffer[writtenLen]) + 1; + } + + return writtenLen; +} + +/** + Do an device reset on the selected device. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInDevReset - points to the DTI Host2Dev Reset struct. +\param + pOutDevReset - points to the DTI Dev2Host Reset struct. +\param + rstMaskSize_32 - number of mask elements (32 Bit). +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_Reset( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceReset_t *pInDevReset, + DTI_D2H_DeviceReset_t *pOutDevReset, + IFX_int_t rstMaskSize_32, + DTI_PacketError_t *pPacketError) +{ + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Device Reset - not supported."DTI_CRLF)); + + *pPacketError = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +/** + Do a FW download on the selected devices + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pDtiProtServerCtx - points to the DTI protocol server context. +\param + pInDevDownload - points to the DTI Host2Dev Download struct. +\param + pOutDevDownload - points to the DTI Dev2Host Download struct. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_Download( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_ProtocolServerCtx_t *pDtiProtServerCtx, + DTI_H2D_DeviceDownload_t *pInDevDownload, + DTI_D2H_DeviceDownload_t *pOutDevDownload, + DTI_PacketError_t *pPacketError) +{ +#ifndef DTI_DONT_USE_PROTEXT + IFX_int_t fd = -1; + IFX_int_t nDevNum, nDevMax = -1, nDevMin = -1, nDevCount = 0; + DTI_PacketError_t lockPacketError = DTI_eNoError; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + DTI_ImageControl_t *imgCtrl = IFX_NULL; + IOCTL_MEI_reset_t MEI_ResetArgs; + IOCTL_MEI_fwDownLoad_t MEI_FwDl; + IOCTL_MEI_FwModeCtrlSet_t MEI_FwMode; + DSL_FirmwareFeatures_t FwFeatures = {0}; + + pOutDevDownload->errorMask = pInDevDownload->loadMask; + + /* + Check args + */ + for (nDevNum = 0; nDevNum < 32; nDevNum++) + { + if (pInDevDownload->loadMask & (0x1 << nDevNum)) + { + if (nDevMin == -1) + { + nDevMin = nDevNum; + } + nDevMax = nDevNum; + nDevCount++; + } + } + + if ((nDevMin > pVrxDevCtx->numOfDevs) || + (nDevMax > pVrxDevCtx->numOfDevs) || (nDevCount == 0)) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: MEI Device Download - mask 0x%08X, max devs %d (nDevMin=%d, " + "nDevMax=%d, nDevCount=%d), truncate."DTI_CRLF, + pInDevDownload->loadMask, pVrxDevCtx->numOfDevs, nDevMin, + nDevMax, nDevCount)); + } + + /* + Get Image from the DTI Agent Context. + */ + if (pDtiProtServerCtx->pCbFctImageCntrlLock( + pDtiProtServerCtx->pCbCtxAgent, + (IFX_int_t)pInDevDownload->imageNum, + 1, &imgCtrl, pPacketError) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: MEI Device Download - image %d get."DTI_CRLF, + pInDevDownload->imageNum)); + + *pPacketError = DTI_eErrPortOperation; + return IFX_ERROR; + } + + if (imgCtrl) + { + if ((imgCtrl->pData == IFX_NULL) || (imgCtrl->imageSize == 0)) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: MEI Device Download - image %d empty."DTI_CRLF, + pInDevDownload->imageNum)); + + *pPacketError = DTI_eErrPortOperation; + goto DTI_AGENT_DOWNLOAD_EXIT; + } + } + else + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: MEI Device Download - failed to get image."DTI_CRLF)); + goto DTI_AGENT_DOWNLOAD_EXIT; + } + nDevCount=0; + for (nDevNum=0; nDevNum < 32; nDevNum++) + { + if (nDevCount >= pVrxDevCtx->numOfDevs) + { + DTI_PRN_USR_DBG_NL(DTI_VRX, DTI_PRN_LEVEL_LOW, + ("MEI Device Download - break, nDevCount(%d) >= numOfDevs(%d). " + DTI_CRLF, nDevCount, pVrxDevCtx->numOfDevs)); + break; + } + + if (!(pInDevDownload->loadMask & (0x1 << nDevNum))) + { + DTI_PRN_USR_DBG_NL(DTI_VRX, DTI_PRN_LEVEL_LOW, + ("MEI Device Download - skip FW download on device %d."DTI_CRLF, + nDevNum)); + continue; + } + nDevCount++; + + /* + open device + */ + fd = DTI_DevOpenByName(nDevNum, DSL_CPE_IFX_LOW_DEV); + if (fd < 0) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Mei Device Download - open control device %d."DTI_CRLF, + nDevNum)); + + *pPacketError = DTI_eErrPortOperation; + goto DTI_AGENT_DOWNLOAD_EXIT; + } + + /* + reset MEI driver + */ + DTI_MemSet(&MEI_ResetArgs, 0x00, sizeof(IOCTL_MEI_reset_t)); + + MEI_ResetArgs.rstMode = (IOCTL_MEI_resetMode_e)0; + MEI_ResetArgs.rstSelMask = (unsigned int)0x1F; + + if (IFXOS_DeviceControl(fd, FIO_MEI_RESET, (IFX_int_t)&MEI_ResetArgs) < 0) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: MEI Device Download - ioctl MEI_RESET " + "retCode = %d."DTI_CRLF, MEI_ResetArgs.ictl.retCode)); + + *pPacketError = DTI_eErrPortOperation; + goto DTI_AGENT_DOWNLOAD_EXIT; + } + + /* + configure FW mode + */ + DTI_MemSet(&MEI_FwMode, 0x00, sizeof(IOCTL_MEI_FwModeCtrlSet_t)); + + DTI_FwFeaturesGet((DSL_char_t*)imgCtrl->pData, + (IFX_uint32_t)imgCtrl->imageSize, + &FwFeatures); + + MEI_FwMode.bMultiLineModeLock = IFX_TRUE; + MEI_FwMode.bXdslModeLock = IFX_TRUE; + MEI_FwMode.eXdslModeCurrent = 0;/* VDSL only */ + MEI_FwMode.firmwareFeatures.nPlatformId = FwFeatures.nPlatformId; + MEI_FwMode.firmwareFeatures.eFirmwareXdslModes = + FwFeatures.nFirmwareXdslModes; + + if (IFXOS_DeviceControl(fd, FIO_MEI_FW_MODE_CTRL_SET, + (IFX_int_t)&MEI_FwMode) < 0) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: MEI Device Download - ioctl FIO_MEI_FW_MODE_CTRL_SET " + " %d, retCode = %d."DTI_CRLF, MEI_FwMode.ictl.retCode)); + + *pPacketError = DTI_eErrPortOperation; + goto DTI_AGENT_DOWNLOAD_EXIT; + } + + /* + do FW download + */ + DTI_PRN_USR_DBG_NL(DTI_VRX, DTI_PRN_LEVEL_LOW, + ("MEI Device Download - start FW download on device %d."DTI_CRLF, + nDevNum)); + + DTI_MemSet(&MEI_FwDl, 0x00, sizeof(MEI_FwDl)); + MEI_FwDl.pFwImage = (unsigned char *)imgCtrl->pData; + MEI_FwDl.size_byte = (IFX_uint32_t)imgCtrl->imageSize; + + if (IFXOS_DeviceControl(fd, FIO_MEI_FW_DL, (IFX_int_t)&MEI_FwDl) < 0) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: MEI Device Download - ioctl FW download."DTI_CRLF)); + + *pPacketError = DTI_eErrPortOperation; + goto DTI_AGENT_DOWNLOAD_EXIT; + } + else + { + DTI_PRN_USR_DBG_NL(DTI_VRX, DTI_PRN_LEVEL_LOW, + ("MEI Device Download - FW download on device %d successful ." + DTI_CRLF, nDevNum)); + } + + if (fd != -1) + { + (void)IFXOS_DeviceClose(fd); + fd = -1; + } + } + +DTI_AGENT_DOWNLOAD_EXIT: + + if (fd != -1) + { + (void)DTI_DevCloseByFd(fd); + } + + if (imgCtrl != IFX_NULL) + { + (void)pDtiProtServerCtx->pCbFctImageCntrlLock( + pDtiProtServerCtx->pCbCtxAgent, + (IFX_int_t)pInDevDownload->imageNum, + 0, IFX_NULL, &lockPacketError); + + if (*pPacketError == DTI_eNoError) + { + /* return lock error only if no previous error occured */ + *pPacketError = lockPacketError; + } + } + + if (*pPacketError == DTI_eNoError) + { + pOutDevDownload->errorMask = 0; + } + + return (*pPacketError == DTI_eNoError) ? IFX_SUCCESS : IFX_ERROR; +#else + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Device Download - not supported."DTI_CRLF)); + + *pPacketError = DTI_eErrUnknown; + return IFX_SUCCESS; +#endif /* !DTI_DONT_USE_PROTEXT */ +} + + +/** + Open a given line device. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_DeviceOpen( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + *pPacketError = DTI_eNoError; + + if (lineNum > DTI_DEV_MAX_LINE_NUMBER) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Device Open - line number %d is different from 0."DTI_CRLF, + lineNum)); + + *pPacketError = DTI_eErrPortOutOfRange; + + return IFX_ERROR; + } + + return DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum); +} + + +/** + Close a given line device. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_DeviceClose( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + *pPacketError = DTI_eNoError; + + if (lineNum > DTI_DEV_MAX_LINE_NUMBER) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Device Close - line number %d is different from 0."DTI_CRLF, + lineNum)); + + *pPacketError = DTI_eErrPortOutOfRange; + + return IFX_ERROR; + } + + return DTI_DevClose(pVrxDevCtx, pPacketError, lineNum); +} + +/** + Get / release the device lock. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInLock - points to the DTI Host2Dev Lock struct. +\param + pOutLock - points to the DTI Dev2Host Lock struct. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_RegisterLock( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceLock_t *pInLock, + DTI_D2H_DeviceLock_t *pOutLock, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Lock - not supported."DTI_CRLF)); + + pOutLock->lock = 0; + *pPacketError = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Get a device register (MEI interface). + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInRegGet - points to the DTI Host2Dev RegisterGet struct. +\param + pOutRegGet - points to the DTI Dev2Host RegisterGet struct. +\param + lineNum - line number. +\param + pOutPaylSize_byte - return ptr, return the size of the read registers. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_RegisterGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_RegisterGet_t *pInRegGet, + DTI_D2H_RegisterGet_t *pOutRegGet, + IFX_int_t lineNum, + IFX_uint32_t *pOutPaylSize_byte, + DTI_PacketError_t *pPacketError) +{ + IFX_int_t count, regCount; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + IOCTL_MEI_regInOut_t regIO; + + regCount = (IFX_int_t)pInRegGet->count; + + *pOutPaylSize_byte = 0; + + if (regCount > pVrxDevCtx->numOfRegAccess) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx RegisterGet - line %d, count %d > max %d."DTI_CRLF, + lineNum, regCount, pVrxDevCtx->numOfRegAccess)); + + *pPacketError = DTI_eErrConfiguration; + + return IFX_SUCCESS; + } + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx RegisterGet - device open error." DTI_CRLF)); + + return IFX_SUCCESS; + } + + for (count = 0; count < regCount; count++) + { + DTI_MemSet(®IO, 0x00, sizeof(regIO)); + regIO.addr = (unsigned int)pInRegGet->address; + + if ( (DSL_CPE_Ioctl( + pVrxDevCtx->pDevFds[lineNum], FIO_MEI_REG_GET, (DSL_int_t)®IO)) < 0 ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx RegisterGet - ioctl error."DTI_CRLF)); + + break; + } + else + { + pOutRegGet->data[count] = (IFX_uint32_t)regIO.value; + } + } + + if (count < regCount) + { + *pOutPaylSize_byte = 0; + *pPacketError = DTI_eErrPortOperation; + } + else + { + *pOutPaylSize_byte = (IFX_uint32_t)(regCount * sizeof(IFX_uint32_t)); + *pPacketError = DTI_eNoError; + } + + return IFX_SUCCESS; +} + + +/** + Get a device register (MEI interface). + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInRegSet - points to the DTI Host2Dev RegisterSet struct. +\param + inRegSetSize_Byte - size of the given IN data [byte]. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS DTI Packet Error code is "no error". + IFX_ERROR if the register read operation fails. +*/ +DTI_STATIC IFX_int_t DTI_VRX_RegisterSet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_RegisterSet_t *pInRegSet, + IFX_int_t inRegSetSize_Byte, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + IFX_int_t count, regCount; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + IOCTL_MEI_regInOut_t regIO; + + regCount = (inRegSetSize_Byte - sizeof(pInRegSet->address)) / sizeof(IFX_uint32_t); + + if ( (regCount > pVrxDevCtx->numOfRegAccess) || (regCount <= 0) ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx RegisterSet - line %d, count %d (max %d)."DTI_CRLF, + lineNum, regCount, pVrxDevCtx->numOfRegAccess)); + + *pPacketError = DTI_eErrInvalidPayloadSize; + + return IFX_SUCCESS; + } + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx RegisterSet - device open error." DTI_CRLF)); + + return IFX_SUCCESS; + } + + *pPacketError = DTI_eNoError; + + for (count = 0; count < regCount; count++) + { + DTI_MemSet(®IO, 0x00, sizeof(regIO)); + regIO.addr = (unsigned int)pInRegSet->address; + regIO.value = (unsigned int)pInRegSet->data[count]; + + if ( (DSL_CPE_Ioctl( + pVrxDevCtx->pDevFds[lineNum], FIO_MEI_REG_SET, (DSL_int_t)®IO)) < 0 ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx RegisterSet - ioctl error."DTI_CRLF)); + + *pPacketError = DTI_eErrPortOperation; + + break; + } + } + + return IFX_SUCCESS; +} + + +/** + Set a device configuration. + +\param + pDtiConCtx - points to the DTI connection setup. +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInCfgSet - points to the DTI Host2Dev ConfigSet struct. +\param + pOutCfgSet - points to the DTI Dev2Host ConfigSet struct. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). + +\remark + Changes of the autonomous message handling may have influence to the + connection settings (select wait time) +*/ +DTI_STATIC IFX_int_t DTI_VRX_ConfigSet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceConfigSet_t *pInCfgSet, + DTI_D2H_DeviceConfigSet_t *pOutCfgSet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + memset(pOutCfgSet, 0x00, sizeof(DTI_D2H_DeviceConfigSet_t)); + pOutCfgSet->key = pInCfgSet->key; + + switch (pInCfgSet->key) + { + case DTI_eTimeout: + pOutCfgSet->value = 0; + *pPacketError = DTI_eErrUnknown; + break; + + case DTI_eAutonousMessages: + (void)DTI_configSet_AutoMsg( + pVrxDevCtx, pInCfgSet, pOutCfgSet, + lineNum, pPacketError); + + /* NFC is enabled - change conncetion settings */ + if (pVrxDevCtx->nfcMaxDevFd) + { + pDtiDevCtx->bAutoDevMsgActive = IFX_TRUE; + } + else + { + pDtiDevCtx->bAutoDevMsgActive = IFX_FALSE; + } + break; + + case DTI_eMaxRegAccess: + if (pInCfgSet->value > DTI_DEV_VRX_MAX_REGISTER_ACCESS_NUM) + { + pVrxDevCtx->numOfRegAccess = DTI_DEV_VRX_MAX_REGISTER_ACCESS_NUM; + *pPacketError = DTI_eErrConfiguration; + } + else + { + pVrxDevCtx->numOfRegAccess = (IFX_int_t)pInCfgSet->value; + *pPacketError = DTI_eNoError; + } + pOutCfgSet->value = (IFX_uint32_t)pVrxDevCtx->numOfRegAccess; + break; + + case DTI_eMaxDebugAccess: + if (pInCfgSet->value > DTI_DEV_VRX_MAX_DEBUG_ACCESS_NUM) + { + pVrxDevCtx->numOfDebugAccess = DTI_DEV_VRX_MAX_DEBUG_ACCESS_NUM; + *pPacketError = DTI_eErrConfiguration; + } + else + { + pVrxDevCtx->numOfDebugAccess = (IFX_int_t)pInCfgSet->value; + *pPacketError = DTI_eNoError; + } + pOutCfgSet->value = (IFX_uint32_t)pVrxDevCtx->numOfDebugAccess; + break; + + /* R/O */ + case DTI_eMailboxSize: + default: + pOutCfgSet->value = 0; + *pPacketError = DTI_eErrUnknown; + break; + } + + return IFX_SUCCESS; +} + + +/** + Get the device configuration of the given line. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInCfgSet - points to the DTI Host2Dev ConfigSet struct. +\param + pOutCfgSet - points to the DTI Dev2Host ConfigSet struct. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_ConfigGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DeviceConfigGet_t *pInCfgGet, + DTI_D2H_DeviceConfigGet_t *pOutCfgGet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + memset(pOutCfgGet, 0x00, sizeof(DTI_D2H_DeviceConfigGet_t)); + pOutCfgGet->key = pInCfgGet->key; + + switch (pInCfgGet->key) + { + case DTI_eTimeout: + *pPacketError = DTI_eErrUnknown; + break; + + case DTI_eAutonousMessages: + pOutCfgGet->value = (IFX_uint32_t)DTI_configGet_AutoMsg( + pVrxDevCtx, lineNum, pPacketError); + break; + + case DTI_eMailboxSize: + pOutCfgGet->value = (IFX_uint32_t)DTI_configGet_MbSize( + pVrxDevCtx, lineNum, pPacketError); + break; + + case DTI_eMaxRegAccess: + pOutCfgGet->value = (IFX_uint32_t)pVrxDevCtx->numOfRegAccess; + *pPacketError = DTI_eNoError; + break; + + case DTI_eMaxDebugAccess: + pOutCfgGet->value = (IFX_uint32_t)pVrxDevCtx->numOfDebugAccess; + *pPacketError = DTI_eNoError; + break; + + default: + *pPacketError = DTI_eErrUnknown; + break; + } + + return IFX_SUCCESS; +} + + +/** + Send a 16 Bit message to the device and wait for the responce. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInMsg16Send - points to the DTI 16 bit message send struct. +\param + pOutMsg16Send - points to the DTI 16 bit message responce struct. +\param + lineNum - line number. +\param + inPaylSize_byte - payload size of the DTI packet [byte]. +\param + pOutPaylSize_byte - return ptr, return the OUT payload size [byte]. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_Message16Send( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_Message16_u *pInMsg16Send, + DTI_D2H_Message16_u *pOutMsg16Send, + IFX_int_t lineNum, + IFX_int_t inPaylSize_byte, + IFX_int_t *pOutPaylSize_byte, + DTI_PacketError_t *pPacketError) +{ + IOCTL_MEI_messageSend_t messageSend; + + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx msg16 Send - device open error" DTI_CRLF)); + + *pOutPaylSize_byte = 0; + + return IFX_SUCCESS; + } + + memset(&messageSend, 0x00, sizeof(IOCTL_MEI_messageSend_t)); + + /* setup message send */ + messageSend.write_msg.msgId = (unsigned short)pInMsg16Send->raw.data[VRX_DTI_MSG_IDX_MSDID]; + messageSend.write_msg.paylSize_byte = (unsigned short)inPaylSize_byte - sizeof(pInMsg16Send->raw.data[VRX_DTI_MSG_IDX_MSDID]); + messageSend.write_msg.pPayload = (unsigned char*)&pInMsg16Send->raw.data[VRX_DTI_MSG_IDX_INDEX]; + + messageSend.ack_msg.paylSize_byte = CMV_USED_PAYLOAD_8BIT_SIZE; + messageSend.ack_msg.pPayload = (unsigned char *)&pOutMsg16Send->raw.data[VRX_DTI_MSG_IDX_INDEX]; + + if ( (DSL_CPE_Ioctl(pVrxDevCtx->pDevFds[lineNum], FIO_MEI_MBOX_MSG_SEND, (DSL_int_t)&messageSend)) < 0 ) + { + /* in case of error loop back input message */ + pOutMsg16Send->raw.data[VRX_DTI_MSG_IDX_MSDID] = pInMsg16Send->raw.data[VRX_DTI_MSG_IDX_MSDID]; + pOutMsg16Send->raw.data[VRX_DTI_MSG_IDX_INDEX] = pInMsg16Send->raw.data[VRX_DTI_MSG_IDX_INDEX]; + pOutMsg16Send->raw.data[VRX_DTI_MSG_IDX_LENGTH] = pInMsg16Send->raw.data[VRX_DTI_MSG_IDX_LENGTH]; + *pOutPaylSize_byte = (sizeof(pOutMsg16Send->raw.data[VRX_DTI_MSG_IDX_MSDID]) * 3) + sizeof(pOutMsg16Send->raw.sendResult); + pOutMsg16Send->raw.sendResult = IFX_ERROR; + *pPacketError = DTI_eErrPortOperation; + } + else + { + pOutMsg16Send->raw.data[VRX_DTI_MSG_IDX_MSDID] = messageSend.ack_msg.msgId; + if (messageSend.ack_msg.paylSize_byte & 0x1) + { + /*in case of odd message add 1 byte */ + messageSend.ack_msg.paylSize_byte += 1; + } + *pOutPaylSize_byte = (IFX_int_t)(messageSend.ack_msg.paylSize_byte + sizeof(pOutMsg16Send->raw.data[VRX_DTI_MSG_IDX_MSDID]) + + sizeof(pOutMsg16Send->raw.sendResult)); + pOutMsg16Send->raw.sendResult = IFX_SUCCESS; + *pPacketError = DTI_eNoError; + } + + return IFX_SUCCESS; +} + + +/** + Send a 32 Bit message to the device and wait for the responce. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInMsg32Send - points to the DTI 32 bit message send struct. +\param + pOutMsg32Send - points to the DTI 32 bit message responce struct. +\param + lineNum - line number. +\param + inPaylSize_byte - payload size of the DTI packet [byte]. +\param + pOutPaylSize_byte - return ptr, return the OUT payload size. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_Message32Send( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_Message32_u *pInMsg32Send, + DTI_D2H_Message32_u *pOutMsg32Send, + IFX_int_t lineNum, + IFX_int_t inPaylSize_byte, + IFX_int_t *pOutPaylSize_byte, + DTI_PacketError_t *pPacketError) +{ + IOCTL_MEI_messageSend_t messageSend; + + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx msg32 Send - line %d %s."DTI_CRLF, + lineNum, (*pPacketError == DTI_eErrPortOutOfRange) ? "range error" : "open error")); + + *pOutPaylSize_byte = 0; + + return IFX_SUCCESS; + } + + memset(&messageSend, 0x00, sizeof(IOCTL_MEI_messageSend_t)); + + /* setup message send */ + messageSend.write_msg.msgId = (unsigned short)pInMsg32Send->raw.data[VRX_DTI_MSG_IDX_MSDID]; + messageSend.write_msg.paylSize_byte = (unsigned short)inPaylSize_byte - (sizeof(IFX_uint32_t) << 1); + pInMsg32Send->raw.data[VRX_DTI_MSG_IDX_LENGTH] |= (pInMsg32Send->raw.data[VRX_DTI_MSG_IDX_INDEX] << 16); + messageSend.write_msg.pPayload = (unsigned char*)&pInMsg32Send->raw.data[VRX_DTI_MSG_IDX_LENGTH]; + + messageSend.ack_msg.paylSize_byte = CMV_USED_PAYLOAD_8BIT_SIZE; + messageSend.ack_msg.pPayload = (unsigned char *)&pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_LENGTH]; + + if ( (DSL_CPE_Ioctl(pVrxDevCtx->pDevFds[lineNum], FIO_MEI_MBOX_MSG_SEND, (DSL_int_t)&messageSend)) < 0 ) + { + /* in case of error loop back input message */ + pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_MSDID] = pInMsg32Send->raw.data[VRX_DTI_MSG_IDX_MSDID]; + pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_INDEX] = pInMsg32Send->raw.data[VRX_DTI_MSG_IDX_INDEX]; + pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_LENGTH] = pInMsg32Send->raw.data[VRX_DTI_MSG_IDX_LENGTH]; + *pOutPaylSize_byte = sizeof(pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_MSDID]) * 3 + sizeof(pOutMsg32Send->raw.sendResult); + pOutMsg32Send->raw.sendResult = IFX_ERROR; + *pPacketError = DTI_eErrPortOperation; + } + else + { + pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_MSDID] = (IFX_uint32_t)messageSend.ack_msg.msgId; + pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_INDEX] |= (pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_LENGTH] >> 16); + *pOutPaylSize_byte = (IFX_int_t)(messageSend.ack_msg.paylSize_byte + sizeof(pOutMsg32Send->raw.data[VRX_DTI_MSG_IDX_MSDID]) + + sizeof(pOutMsg32Send->raw.sendResult)); + pOutMsg32Send->raw.sendResult = IFX_SUCCESS; + *pPacketError = DTI_eNoError; + } + + return IFX_SUCCESS; +} + +#if (DTI_DEVICE_INTERFACE_VERSION) > (0x00000100) +/** + Send a 8 Bit message to the device and wait for the responce. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInMsg32Send - points to the DTI 32 bit message send struct. +\param + pOutMsg32Send - points to the DTI 32 bit message responce struct. +\param + lineNum - line number. +\param + inPaylSize_byte - payload size of the DTI packet [byte]. +\param + pOutPaylSize_byte - return ptr, return the OUT payload size. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_Message8Send( + DTI_DeviceCtx_t * pDtiDevCtx, + DTI_H2D_Message8_u *pInMsg8Send, + DTI_D2H_Message8_u *pOutMsg8Send, + IFX_int_t devNum, + IFX_int_t inPaylSize_byte, + IFX_int_t * pOutPaylSize_byte, + DTI_PacketError_t *pPacketError) +{ + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Msg8 Send - not necessary (supported)."DTI_CRLF)); + + *pPacketError = DTI_eErrUnknown; + + return IFX_SUCCESS; +} +#endif /*(DTI_DEVICE_INTERFACE_VERSION) > (0x00000100)*/ + +/** + Setup the trace buffer configuration (xDSL Rev3 debug streams). + +\remark + This function releases current configuration if the Debug Streams are + already configured before the new config is set. + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInTraceConfigSet - points to the DTI Host2Dev TraceConfigSet struct. +\param + pOutTraceConfigSet - points to the DTI Dev2Host TraceConfigSet struct. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferConfigSet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_TraceConfigSet_t *pInTraceConfigSet, + DTI_D2H_TraceConfigSet_t *pOutTraceConfigSet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + IFX_int_t nRet = IFX_SUCCESS; + IFX_uint_t nOpMode = 0; + IOCTL_MEI_DEBUG_STREAM_configGet_t pCfgGet; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = pDtiDevCtx->pDevice; + IOCTL_MEI_DEBUG_STREAM_release_t release; + union { + IOCTL_MEI_DEBUG_STREAM_configSet_t cfg; + IOCTL_MEI_DEBUG_STREAM_control_t ctrl; + } ioCmd; + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Mei TraceBufferConfigSet - line %d %s"DTI_CRLF, + lineNum, (*pPacketError == DTI_eErrPortOutOfRange) ? + "range error" : "open error")); + pOutTraceConfigSet->size = 0; + return IFX_SUCCESS; + } + + *pPacketError = DTI_eNoError; + + nRet = DTI_traceBufferDbgStrmCfg(pVrxDevCtx, lineNum, &pCfgGet, IFX_NULL); + if (nRet != IFX_SUCCESS) + { + /* return, still not initialized, nothing to do for switch off*/ + pOutTraceConfigSet->size = 0; + return IFX_SUCCESS; + } + + switch ((DTI_TraceBufferMode_t)pInTraceConfigSet->mode) + { + case DTI_eDisabled: + /* switch off - and return */ + pOutTraceConfigSet->size = 0; + nOpMode = e_MEI_DBG_STREAM_DEFAULT_RING; + break; + + case DTI_eLinear: + nOpMode = e_MEI_DBG_STREAM_FILL; + break; + + case DTI_eCircular: + nOpMode = e_MEI_DBG_STREAM_USER_RING; + break; + + case DTI_eFifo: + nOpMode = e_MEI_DBG_STREAM_FIFO; + break; + + default: + /* invalid config request */ + *pPacketError = DTI_eErrInvalidParameters; + pOutTraceConfigSet->size = 0; + return IFX_SUCCESS; + } + + /* debug streams already initialized */ + if (((DTI_TraceBufferMode_t)pInTraceConfigSet->mode == DTI_eDisabled) + || ((unsigned int)nOpMode != pCfgGet.operationMode)) + { + /* release current config */ + memset(&release, 0, sizeof(release)); + release.releaseMode = e_MEI_DBG_STREAM_RELEASE_COMPLETELY; + (void)IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_RELEASE, + (IFX_int_t)&release); + + if ((DTI_TraceBufferMode_t)pInTraceConfigSet->mode == + DTI_eDisabled) + { + /* return - disabled */ + pOutTraceConfigSet->size = 0; + return IFX_SUCCESS; + } + } + + DTI_MemSet(&ioCmd.cfg, 0, sizeof(IOCTL_MEI_DEBUG_STREAM_configSet_t)); + ioCmd.cfg.operationMode = (MEI_DBG_STREAM_BUF_OPMODE_E)nOpMode; + ioCmd.cfg.bufferSize = (unsigned int) pInTraceConfigSet->size; + + /* new init */ + nRet = DTI_traceBufferDbgStrmCfg(pVrxDevCtx, lineNum, + &pCfgGet, &ioCmd.cfg); + if (nRet != IFX_SUCCESS) + { + pOutTraceConfigSet->size = 0; + *pPacketError = DTI_eErrPortOperation; + } + + DTI_MemSet(&ioCmd.ctrl, 0, sizeof(IOCTL_MEI_DEBUG_STREAM_control_t)); + ioCmd.ctrl.operationMode = (MEI_DBG_STREAM_BUF_OPMODE_E)nOpMode; + ioCmd.ctrl.onOff = 1; + + if (IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_CONTROL, + (IFX_int_t)&ioCmd.ctrl) < 0) + { + /* error - by enabling debug streams, release it completely */ + memset(&release, 0, sizeof(release)); + release.releaseMode = e_MEI_DBG_STREAM_RELEASE_COMPLETELY; + (void)IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_RELEASE, + (IFX_int_t)&release); + + *pPacketError = DTI_eErrPortOperation; + pOutTraceConfigSet->size = 0; + + return IFX_SUCCESS; + } + + pOutTraceConfigSet->size = (IFX_uint32_t)pCfgGet.bufferSize; + + return IFX_SUCCESS; +} + + +/** + Reset the current trace buffer (xDSL Rev3 debug streams). + +\param + pDtiDevCtx - points to the VRX Device context. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferReset( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + IOCTL_MEI_DEBUG_STREAM_release_t release; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = pDtiDevCtx->pDevice; + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Mei trace buffer reset - line %d %s."DTI_CRLF, + lineNum, (*pPacketError == DTI_eErrPortOutOfRange) ? + "range error" : "open error")); + + return IFX_SUCCESS; + } + + memset(&release, 0, sizeof(release)); + release.releaseMode = e_MEI_DBG_STREAM_DELETE_DATA_AND_STATISTIC; + + if (IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_RELEASE, + (IFX_int_t)&release) < 0 ) + { + *pPacketError = DTI_eErrPortOperation; + return IFX_SUCCESS; + } + *pPacketError = DTI_eNoError; + return IFX_SUCCESS; +} + +/** + Setup the trace buffer configuration (xDSL Rev3 debug streams). + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pOutTraceStatusGet - points to the DTI Dev2Host TraceStatusGet struct. +\param + lineNum - line number. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream config request failed. +*/ +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferStatusGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_D2H_TraceStatusGet_t *pOutTraceStatusGet, + IFX_int_t lineNum, + DTI_PacketError_t *pPacketError) +{ + IFX_int_t nRet = IFX_SUCCESS; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = pDtiDevCtx->pDevice; + union { + IOCTL_MEI_DEBUG_STREAM_configGet_t pCfgGet; + IOCTL_MEI_DEBUG_STREAM_statistic_t statistics; + } ioCmd; + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Mei TraceBufferStatusGet - line %d %s."DTI_CRLF, + lineNum, + (*pPacketError == DTI_eErrPortOutOfRange) ? + "range error" : "open error")); + + goto DTI_DEV_TRACE_BUFFER_STATUS_GET_ERR; + } + + *pPacketError = DTI_eNoError; + + nRet = DTI_traceBufferDbgStrmCfg(pVrxDevCtx, lineNum, + &ioCmd.pCfgGet, IFX_NULL); + if (nRet != IFX_SUCCESS) + { + *pPacketError = DTI_eErrConfiguration; + + goto DTI_DEV_TRACE_BUFFER_STATUS_GET_ERR; + } + + if (ioCmd.pCfgGet.onOff == 0) + { + pOutTraceStatusGet->mode = DTI_eDisabled; + pOutTraceStatusGet->size = 0; + pOutTraceStatusGet->fill = 0; + } + else + { + switch (ioCmd.pCfgGet.operationMode) + { + case e_MEI_DBG_STREAM_FILL: + pOutTraceStatusGet->mode = DTI_eLinear; + break; + case e_MEI_DBG_STREAM_USER_RING: + pOutTraceStatusGet->mode = DTI_eCircular; + break; + case e_MEI_DBG_STREAM_FIFO: + pOutTraceStatusGet->mode = DTI_eFifo; + break; + default: + pOutTraceStatusGet->mode = + (IFX_uint32_t)ioCmd.pCfgGet.operationMode; + } + + pOutTraceStatusGet->size = (IFX_uint32_t)ioCmd.pCfgGet.bufferSize; + + DTI_MemSet(&ioCmd.statistics, 0x00, + sizeof(IOCTL_MEI_DEBUG_STREAM_statistic_t)); + + if (IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_STATISTIC_GET, + (IFX_int_t)&ioCmd.statistics) < 0) + { + /* error - get statistics */ + *pPacketError = DTI_eErrPortOperation; + pOutTraceStatusGet->fill = 0; + return IFX_SUCCESS; + } + + pOutTraceStatusGet->fill = + (IFX_uint32_t)(ioCmd.statistics.dataH2BufSize_byte - + ioCmd.statistics.dataBuf2UsrSize_byte); + } + + return IFX_SUCCESS; + +DTI_DEV_TRACE_BUFFER_STATUS_GET_ERR: + + pOutTraceStatusGet->mode = 0; + pOutTraceStatusGet->size = 0; + pOutTraceStatusGet->fill = 0; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInTraceBufferGet - points to the DTI Host2Dev RegisterGet struct. +\param + ppUsedDtiPacketOut - return ptr, points to the DTI Out packet. +\param + pUsedBufferOutSize - return value, points to the DTI Out packet size. +\param + lineNum - line number. +\param + pTrBufReadSize_byte - return ptr, return the number of read registers. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\remark + The function is called with the standard out packet. If the requested size + does not fit into this buffer, a corresponding buffer is allocated and used + for the DSL_CPE_Ioctl call. The pointer to this out packet will be returned. + +\return + IFX_SUCCESS debug stream data read successful. + - returns the DTI Packet Error code. + - pointer to the used out package. + - size of the used out package. + IFX_ERROR data read failed. +*/ +DTI_STATIC IFX_int_t DTI_VRX_TraceBufferGet( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_TraceBufferGet_t *pInTraceBufferGet, + DTI_Packet_t **ppUsedDtiPacketOut, + IFX_int_t *pUsedBufferOutSize, + IFX_int_t lineNum, + IFX_int_t *pTrBufReadSize_byte, + DTI_PacketError_t *pPacketError) +{ + IFX_int_t nRet = (IFX_int_t)IFX_SUCCESS, nBufferOutSize; + DTI_PTR_U uPtr; + IOCTL_MEI_DEBUG_STREAM_data_t stream; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = pDtiDevCtx->pDevice; + DTI_Packet_t *pDtiPacketOut; + DTI_D2H_TraceBufferGet_t *pOutTraceBufferGet; + + /* check if we use the local or default buffer for responce */ + if (pInTraceBufferGet->size > (IFX_uint32_t)(*pUsedBufferOutSize - + sizeof(DTI_PacketHeader_t))) + { + /* use local user buffer */ + if (pVrxDevCtx->pDbgStreamUserBuf != IFX_NULL) + { + if (pInTraceBufferGet->size > + (IFX_uint32_t) (pVrxDevCtx->dbgStreamUserBuf_byte - + sizeof(DTI_PacketHeader_t)) ) + { + DTI_Free(pVrxDevCtx->pDbgStreamUserBuf); + pVrxDevCtx->pDbgStreamUserBuf = IFX_NULL; + pVrxDevCtx->dbgStreamUserBuf_byte = 0; + } + } + + if (pVrxDevCtx->pDbgStreamUserBuf == IFX_NULL) + { + nBufferOutSize = (IFX_int_t)(((sizeof(DTI_PacketHeader_t) + + pInTraceBufferGet->size) & ~0xFFF) + 0x1000); + + if (nBufferOutSize > DTI_DEV_MEI_DBG_STREAM_MAX_BUFFER_SIZE) + { + nBufferOutSize = DTI_DEV_MEI_DBG_STREAM_MAX_BUFFER_SIZE; + } + + pVrxDevCtx->dbgStreamUserBuf_byte = nBufferOutSize; + pVrxDevCtx->pDbgStreamUserBuf = DTI_Malloc((IFX_size_t)nBufferOutSize); + + if (pVrxDevCtx->pDbgStreamUserBuf == IFX_NULL) + { + pVrxDevCtx->dbgStreamUserBuf_byte = 0; + + *pPacketError = DTI_eErrMalformedPacket; + *pTrBufReadSize_byte = 0; + + return IFX_SUCCESS; + } + } + + uPtr.pUInt8 = pVrxDevCtx->pDbgStreamUserBuf; + pDtiPacketOut = (DTI_Packet_t *)DTI_PTR_CAST_GET_ULONG(uPtr); + + if (pDtiPacketOut == IFX_NULL) + { + if (pVrxDevCtx->pDbgStreamUserBuf != IFX_NULL) + { + DTI_Free(pVrxDevCtx->pDbgStreamUserBuf); + pVrxDevCtx->pDbgStreamUserBuf = IFX_NULL; + pVrxDevCtx->dbgStreamUserBuf_byte = 0; + } + + *pPacketError = DTI_eErrMalformedPacket; + *pTrBufReadSize_byte = 0; + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("Error: Mei Packet Trace Buffer Get - "\ + "missaligned user stream buffer."DTI_CRLF)); + + return IFX_SUCCESS; + } + nBufferOutSize = pVrxDevCtx->dbgStreamUserBuf_byte; + } + else + { + /* use default buffer */ + nBufferOutSize = *pUsedBufferOutSize; + pDtiPacketOut = *ppUsedDtiPacketOut; + } + + /* asign packet payload */ + uPtr.pUInt8 = pDtiPacketOut->payload; + pOutTraceBufferGet =(DTI_D2H_TraceBufferGet_t *)DTI_PTR_CAST_GET_ULONG(uPtr); + + if (pOutTraceBufferGet == IFX_NULL) + { + if (pVrxDevCtx->pDbgStreamUserBuf != IFX_NULL) + { + DTI_Free(pVrxDevCtx->pDbgStreamUserBuf); + pVrxDevCtx->pDbgStreamUserBuf = IFX_NULL; + pVrxDevCtx->dbgStreamUserBuf_byte = 0; + } + + *pPacketError = DTI_eErrMalformedPacket; + *pTrBufReadSize_byte = 0; + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("Error: Mei Packet Trace Buffer Get - "\ + "missaligned payload."DTI_CRLF)); + + return IFX_SUCCESS; + } + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + *pTrBufReadSize_byte = 0; + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Mei Packet Trace Buffer Get - "\ + "line %d %s." DTI_CRLF, + lineNum, + (*pPacketError == DTI_eErrPortOutOfRange) ? + "range error" : "open error")); + + return IFX_SUCCESS; + } + + /* read until buffer full or no more data available */ + DTI_MemSet(&stream, 0x00, sizeof(IOCTL_MEI_DEBUG_STREAM_data_t)); + stream.dataBufferSize_byte = (unsigned int)pInTraceBufferGet->size; + stream.pData = (unsigned char *)pOutTraceBufferGet->data; + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_LOW, + ("ERROR: Mei Packet Trace Buffer Get - line %d, "\ + "InTraceBufferGet->size=%d, nBufferOutSize=%d."\ + DTI_CRLF, + lineNum, pInTraceBufferGet->size, nBufferOutSize)); + + if ((stream.dataBufferSize_byte == 0) || (stream.pData == IFX_NULL)) + { + *pPacketError = DTI_eErrPortOperation; + *pTrBufReadSize_byte = 0; + return IFX_ERROR; + } + nRet = IFXOS_DeviceControl(pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DEBUG_STREAM_DATA_GET, + (IFX_int_t)&stream); + if (nRet < 0) + { + *pPacketError = DTI_eErrPortOperation; + *pTrBufReadSize_byte = 0; + return IFX_SUCCESS; + } + + if (((nBufferOutSize - sizeof(DTI_PacketHeader_t)) < + (IFX_int_t)stream.dataBufferSize_byte) || + (pInTraceBufferGet->size < (IFX_uint32_t)stream.dataBufferSize_byte) ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Mei Packet Trace Buffer Get - "\ + "line %d, ioctl error recv = %d > "\ + "ioctlreq = %d / dtireq = %d."DTI_CRLF, + lineNum, stream.dataBufferSize_byte, + (nBufferOutSize - + sizeof(DTI_PacketHeader_t)), + pInTraceBufferGet->size )); + + *pTrBufReadSize_byte = (IFX_int_t)pInTraceBufferGet->size; + } + else + { + *pTrBufReadSize_byte = (IFX_int_t)stream.dataBufferSize_byte; + } + + *pPacketError = DTI_eNoError; + *pTrBufReadSize_byte = (IFX_int_t)stream.dataBufferSize_byte; + *pUsedBufferOutSize = nBufferOutSize; + *ppUsedDtiPacketOut = pDtiPacketOut; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInDbgGet - points to the DTI Host2Dev RegisterGet struct. +\param + pOutDbgGet - points to the DTI Dev2Host RegisterGet struct. +\param + lineNum - line number. +\param + pDbgReadCount - return ptr, return the number of read registers. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_DebugRead( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DebugRead_t *pInDbgGet, + DTI_D2H_DebugRead_t *pOutDbgGet, + IFX_int_t lineNum, + IFX_int_t *pDbgReadCount, + DTI_PacketError_t *pPacketError) +{ + IOCTL_MEI_dbgAccess_t dbgAcc; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + *pDbgReadCount = 0; + *pPacketError = DTI_eNoError; + + if (pInDbgGet->count > (IFX_uint32_t)pVrxDevCtx->numOfRegAccess) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx DebugRead - line %d, count %d > max %d."DTI_CRLF, + lineNum, pInDbgGet->count, pVrxDevCtx->numOfDebugAccess)); + + *pPacketError = DTI_eErrConfiguration; + + return IFX_SUCCESS; + } + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx DebugRead - device open error." DTI_CRLF)); + + return IFX_SUCCESS; + } + + DTI_MemSet(&dbgAcc, 0x00, sizeof(IOCTL_MEI_dbgAccess_t)); + dbgAcc.count = (unsigned int)((pInDbgGet->count) ? pInDbgGet->count : 1); + dbgAcc.dbgAddr = (unsigned int)pInDbgGet->offset; + dbgAcc.dbgDest = (unsigned int) pInDbgGet->type; + dbgAcc.pData_32 = (unsigned int *) pOutDbgGet->data; + + if ( (DSL_CPE_Ioctl( + pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DBG_READ, + (DSL_int_t)&dbgAcc)) < 0 ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx DebugRead - ioctl error)."DTI_CRLF)); + + *pPacketError = DTI_eErrPortOperation; + } + else + { + *pDbgReadCount = (IFX_int_t)dbgAcc.count; + } + + return IFX_SUCCESS; +} + + +/** + Write data to the device via Debug Access (MEI Debug). + +\param + pDtiDevCtx - points to the VRX Device context. +\param + pInDbgSet - points to the DTI Host2Dev RegisterGet struct. +\param + pOutDbgGet_nU - not used. +\param + lineNum - line number. +\param + pDbgWriteCount - return ptr, return the number of read registers. +\param + pPacketError - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t DTI_VRX_DebugWrite( + DTI_DeviceCtx_t *pDtiDevCtx, + DTI_H2D_DebugWrite_t *pInDbgSet, + IFX_uint32_t *pOutDbgGet_nU, + IFX_int_t lineNum, + IFX_int_t *pDbgWriteCount, + DTI_PacketError_t *pPacketError) +{ + IOCTL_MEI_dbgAccess_t dbgAcc; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + *pPacketError = DTI_eNoError; + + if (*pDbgWriteCount > pVrxDevCtx->numOfRegAccess) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx DebugWrite - line %d, count %d > max %d."DTI_CRLF, + lineNum, *pDbgWriteCount, pVrxDevCtx->numOfDebugAccess)); + + *pDbgWriteCount = 0; + *pPacketError = DTI_eErrConfiguration; + + return IFX_SUCCESS; + } + + if (DTI_DevOpen(pVrxDevCtx, pPacketError, lineNum) != IFX_SUCCESS) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx DebugRead - device open error." DTI_CRLF)); + + *pDbgWriteCount = 0; + return IFX_SUCCESS; + } + + DTI_MemSet(&dbgAcc, 0x00, sizeof(IOCTL_MEI_dbgAccess_t)); + dbgAcc.count = (*pDbgWriteCount > 0) ? ((unsigned int)*pDbgWriteCount) : 0; + dbgAcc.dbgAddr = (unsigned int) pInDbgSet->offset; + dbgAcc.dbgDest = (unsigned int) pInDbgSet->type; + dbgAcc.pData_32 = (unsigned int *) pInDbgSet->data; + + if ( (DSL_CPE_Ioctl( + pVrxDevCtx->pDevFds[lineNum], + FIO_MEI_DBG_WRITE, + (DSL_int_t)&dbgAcc)) < 0 ) + { + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx DebugWrite - ioctl error."DTI_CRLF)); + + *pDbgWriteCount = 0; + *pPacketError = DTI_eErrPortOperation; + } + else + { + *pDbgWriteCount = (IFX_int_t)dbgAcc.count; + } + + return IFX_SUCCESS; +} + +DTI_STATIC IFX_int_t DTI_VRX_WinEasyCiAccess( + DTI_DeviceCtx_t *pDtiDevCtx, + IFX_int_t lineNum, + const IFX_uint8_t *pDataIn, + const IFX_uint32_t sizeIn, + IFX_uint8_t *pDataOut, + const IFX_uint32_t sizeOut, + DTI_PacketError_t *pPacketError) +{ + + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx WinEasy Access - not supported."DTI_CRLF)); + + *pPacketError = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +/** + Check and process for Device Autonomous Messages. + The Auto Msg is read form the device (driver) and a corresponding + DTI packet is created and sent to the upper DTI Client + +\param + pDtiDevCtx - points to the Device context. +\param + pDtiCon - points to the established DTI Connection data. +\param + devSelectWait_ms - wait time [ms] for the device select operation. +\param + pOutBuffer - points to the DTI packet out buffer to create a DTI packet. +\param + outBufferSize_byte - DTI out buffer size [byte] + +\return + IFX_SUCCESS if the DTI packet has been sent. + IFX_ERROR DTI packet has not been sent. + +\remarks + At first the device msg will be read out to free the internal driver buffer. + This is done independant on the established connection. +*/ +DTI_STATIC IFX_int_t DTI_VRX_AutoMsgProcess( + DTI_DeviceCtx_t *pDtiDevCtx, + const DTI_Connection_t *pDtiCon, + IFX_uint32_t devSelectWait_ms, + IFX_char_t *pOutBuffer, + IFX_int_t outBufferSize_byte) +{ +#ifndef DTI_DONT_USE_PROTEXT + IFX_int_t lineNum = 0, retVal = IFX_SUCCESS; + DTI_DEV_VrxDriverCtx_t *pVrxDevCtx = (DTI_DEV_VrxDriverCtx_t *)pDtiDevCtx->pDevice; + + if (pVrxDevCtx->nfcMaxDevFd == 0) + { + /* min DevFd = 0 --> maxFD = 0 +1, no device enabled */ + return IFX_SUCCESS; + } + + DTI_DevFdZero(&pVrxDevCtx->tmpDevFds); + retVal = DTI_DeviceSelect( + (IFX_uint32_t)pVrxDevCtx->nfcMaxDevFd, + &pVrxDevCtx->nfcDevFds, &pVrxDevCtx->tmpDevFds, devSelectWait_ms); + + if ( retVal < 0 ) + { + return IFX_ERROR; + } + + if (retVal == 0) + { + return IFX_SUCCESS; + } + + for (lineNum = 0; lineNum < pVrxDevCtx->numOfPorts; lineNum++) + { + if (pVrxDevCtx->pDevFds[lineNum] != -1) + { + if ( DTI_DevFdIsSet((IFX_uint32_t)pVrxDevCtx->pDevFds[lineNum], &pVrxDevCtx->tmpDevFds) ) + { + retVal--; + (void)DTI_autoMsgRecv( + pVrxDevCtx, pDtiCon, + pDtiDevCtx->devIfNum, lineNum, + pOutBuffer, outBufferSize_byte); + } + } + + if (retVal == 0) + break; + } +#else + DTI_PRN_USR_ERR_NL(DTI_VRX, DTI_PRN_LEVEL_ERR, + ("ERROR: Vrx Auto msg - not supported."DTI_CRLF)); +#endif /* !DTI_DONT_USE_PROTEXT */ + + return IFX_SUCCESS; +} + +#endif /* INCLUDE_DSL_CPE_API_VRX*/ + + diff --git a/src/dsl_cpe_dti_vrx_ctx.h b/src/dsl_cpe_dti_vrx_ctx.h new file mode 100644 index 0000000..824e065 --- /dev/null +++ b/src/dsl_cpe_dti_vrx_ctx.h @@ -0,0 +1,92 @@ +#ifndef _DTI_VRX_CTX_H +#define _DTI_VRX_CTX_H +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ +#ifdef __cplusplus + extern "C" { +#endif + +/** \file + VRX device context, control struct for xDSL Rev3 access and handling. +*/ + +/* ========================================================================== + includes + ========================================================================== */ +#include "ifx_types.h" +#include "ifxos_debug.h" +#include "ifxos_device_access.h" + +/* ========================================================================== + defines + ========================================================================== */ +#ifndef DTI_DEV_MAX_LINE_NUMBER +# define DTI_DEV_MAX_LINE_NUMBER 1 +#endif + +/* ========================================================================== + macro + ========================================================================== */ + +/* ========================================================================== + types + ========================================================================== */ + +/** + VRX Driver Control Struct +*/ +typedef struct DTI_DEV_VrxDriverCtx_s +{ + /** number of devices */ + IFX_int_t numOfDevs; + /** ports per device */ + IFX_int_t portsPerDev; + /** number of ports */ + IFX_int_t numOfPorts; + /** points to the array of devices fds */ + IFX_int_t *pDevFds; + /* + DTI Config + */ + /** max number of register requests / sets */ + IFX_int_t numOfRegAccess; + /** max number of debug requests / sets */ + IFX_int_t numOfDebugAccess; + + /** auto msg handling - supported */ + IFX_boolean_t bAutoDevMsgSupport; + /** auto msg handling - max device fd for select */ + IFX_int_t nfcMaxDevFd; + /** auto msg handling - device FDSET */ + IFXOS_devFd_set_t nfcDevFds; + /** auto msg handling - for temporary use, device FDSET */ + IFXOS_devFd_set_t tmpDevFds; + /** auto msg handling - recv buffer for auto msg's */ + IFX_ulong_t *pAutoMsgBuf; + /** auto msg handling - size of the modem message buffer for NFC handling */ + IFX_int_t autoMsgBuf_byte; + /** debug stream local user buffer */ + IFX_uint8_t *pDbgStreamUserBuf; + /** size of the local user buffer for debug stream handling */ + IFX_int_t dbgStreamUserBuf_byte; +} DTI_DEV_VrxDriverCtx_t; + + +/* ========================================================================== + exports + ========================================================================== */ + + + +#ifdef __cplusplus +} +#endif + +#endif /* _DTI_VRX_CTX_H */ diff --git a/src/dsl_cpe_init_cfg.c b/src/dsl_cpe_init_cfg.c new file mode 100644 index 0000000..a85548d --- /dev/null +++ b/src/dsl_cpe_init_cfg.c @@ -0,0 +1,230 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/* +Includes +*/ +#include "dsl_cpe_control.h" +#include "drv_dsl_cpe_api.h" +#include "dsl_cpe_init_cfg.h" + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP + +#ifndef _lint +DSL_InitData_t gInitCfgData = +{ + DSL_CPE_FW1_SET(DSL_NULL, 0x0), + DSL_CPE_FW_FEATURE_SET(0, DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED, \ + DSL_FW_XDSLFEATURE_CLEANED), + DSL_CPE_FW2_SET(DSL_NULL, 0x0), + DSL_CPE_XTU_SET(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7), + DSL_CPE_LINE_INV_NE_SET(DSL_NULL), + DSL_CPE_AUTOBOOT_CTRL_SET(DSL_AUTOBOOT_CTRL_STOP), + DSL_CPE_AUTOBOOT_CFG_SET(DSL_FALSE, DSL_FALSE, DSL_FALSE), + DSL_CPE_TEST_MODE_CTRL_SET(DSL_TESTMODE_DISABLE), + DSL_CPE_LINE_ACTIVATE_CTRL_SET(DSL_G997_INHIBIT_LDSF, DSL_G997_INHIBIT_ACSF, DSL_G997_NORMAL_STARTUP), + /** Device specific configuration parameters*/ +#if defined(INCLUDE_DSL_CPE_API_VRX) + { + DSL_CPE_LL_CFG_SET(DSL_DEV_FILTER_NA, DSL_DEV_HS_TONE_GROUP_MODE_AUTO, \ + DSL_DEV_HS_TONE_GROUP_CLEANED, \ + DSL_DEV_HS_TONE_GROUP_CLEANED, \ + DSL_DEV_HS_TONE_GROUP_CLEANED, \ + 0x1E116000, 0x37, -1), + DSL_CPE_SIC_SET(DSL_TC_ATM, DSL_EMF_TC_CLEANED, DSL_EMF_TC_CLEANED, DSL_SYSTEMIF_MII, \ + DSL_TC_EFM, DSL_EMF_TC_CLEANED, DSL_EMF_TC_CLEANED, DSL_SYSTEMIF_MII), + DSL_CPE_MAC_CFG_SET(DSL_EFM_SPEED_100, DSL_EFM_DUPLEX_FULL, DSL_EFM_FLOWCTRL_ON, DSL_EFM_AUTONEG_OFF, \ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 1536, DSL_FALSE) + } +#endif +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + { + DSL_CPE_LL_CFG_SET(DSL_DEV_HYBRID_NA), + DSL_CPE_SIC_SET(DSL_TC_ATM, DSL_EMF_TC_NORMAL, DSL_EMF_TC_NORMAL, DSL_SYSTEMIF_MII) + } +#endif +}; +#endif /* _lint*/ + +#if defined(INCLUDE_DSL_CPE_API_VRX) +static DSL_Error_t DSL_VRX_ProcessDevConfigLine( + DSL_char_t *pLine, + DSL_uint32_t cfgLine, + DSL_DeviceLowLevelConfig_t *pRetLLCfg ) +{ + DSL_Error_t nRet = DSL_SUCCESS; + DSL_int_t nFilter = -1, nHsToneGroupMode = -1, + nIrqNum = 0, + bNtrEnable = -1; + DSL_uint32_t nHsToneGroup_A = -1, nHsToneGroup_V = -1, + nHsToneGroup_AV = -1, nBaseAddr = 0; + + switch(cfgLine) + { + case 0: + sscanf(pLine, + "%d", + &nFilter); + + pRetLLCfg->nFilter = (DSL_uint32_t)nFilter; + break; + case 1: + sscanf(pLine, + "%d %x %x %x", + &nHsToneGroupMode, + &nHsToneGroup_A, + &nHsToneGroup_V, + &nHsToneGroup_AV); + + pRetLLCfg->nHsToneGroupMode = (DSL_uint32_t)nHsToneGroupMode; + pRetLLCfg->nHsToneGroup_A = (DSL_uint32_t)nHsToneGroup_A; + pRetLLCfg->nHsToneGroup_V = (DSL_uint32_t)nHsToneGroup_V; + pRetLLCfg->nHsToneGroup_AV = (DSL_uint32_t)nHsToneGroup_AV; + case 2: + sscanf(pLine, + "%x %d", + &nBaseAddr, + &nIrqNum); + + pRetLLCfg->nBaseAddr = (DSL_uint32_t)nBaseAddr; + pRetLLCfg->nIrqNum = (DSL_int8_t)nIrqNum; + break; + case 3: + sscanf(pLine, + "%d", + &bNtrEnable); + + pRetLLCfg->bNtrEnable = (DSL_boolean_t)bNtrEnable; + break; + default: + break; + } + + return(nRet); +} + +/** + This function returns the Initial Low Level Configuration from the give file + or the fixed default settings. + + \param pName file name of the given LowLevelConfig + \param ppRetLLCfg Pointer to return the settings. + + \return + Return values are defined within the DSL_Error_t definition + - DSL_SUCCESS in case of success + - DSL_ERROR if operation failed + - The return pointer is set to the given configuration or ULL + +*/ +DSL_Error_t DSL_CPE_GetInitialLowLevelConfig( DSL_char_t const *pName, + DSL_DeviceLowLevelConfig_t *pRetLLCfg ) +{ + DSL_CPE_File_t *fdCfg = DSL_NULL; + DSL_Error_t nRet = DSL_SUCCESS; + DSL_uint32_t nCfgFileLine; + DSL_char_t line[256]; + +/* +# VRX Low Level Configuration File +# +# Parameters must be separated by tabs or spaces. +# Empty lines and comments will be ignored. +# + +# nFilter +# +# NA = -1 +# OFF = 0 +# ISDN = 1 +# POTS = 2 +# POTS_2 = 3 +# POTS_3 = 4 +# +# (dec) + -1 + +# nHsToneGroupMode nHsToneGroup_A nHsToneGroup_V nHsToneGroup_AV +# +# NA = -1 NA = -1 see see +# AUTO = 0 VDSL2_B43 = 0x0001 nHsToneGroup_A nHsToneGroup_A +# MANUAL = 1 VDSL2_A43 = 0x0002 +# VDSL2_V43 = 0x0004 +# VDSL1_V43P = 0x0008 +# VDSL1_V43I = 0x0010 +# ADSL1_C43 = 0x0020 +# ADSL2_J43 = 0x0040 +# ADSL2_B43C = 0x0080 +# ADSL2_A43C = 0x0100 +# +# (dec) (hex) (hex) (hex) + 0 0x1 0x1 0x1 + +# nBaseAddr nIrqNum +# +# (hex) (dec) + 0x1e116000 55 + +# nUtopiaPhyAdr nUtopiaBusWidth nPosPhyParity +# default(16b) = 0 NA = -1 +# 8-bit = 1 ODD = 0 +# 16-bit = 2 +# +# +# (hex) (dec) (dec) + 0xFF 0 0 + +# bNtrEnable +# +# (dec) + 0 +*/ + + if (pName != DSL_NULL) + { + fdCfg = DSL_CPE_FOpen(pName, "r"); + if (fdCfg == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL: Error opening low level configuration file %s " DSL_CPE_CRLF , pName)); + return DSL_ERROR; + } + + nCfgFileLine = 0; + while( (DSL_CPE_FGets(line, sizeof(line), fdCfg)) != DSL_NULL ) + { + if( (line[0] == '\n') || (line[0] == '#') ) + { + continue; + } + + nRet = DSL_VRX_ProcessDevConfigLine(line, nCfgFileLine, pRetLLCfg); + + nCfgFileLine++; + + if( nRet != DSL_SUCCESS ) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "DSL: Error processing configuration file %s, line %d "DSL_CPE_CRLF, pName, nCfgFileLine)); + break; + } + } + DSL_CPE_FClose (fdCfg); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX + "DSL: Low Level Configuration file not specified, using default configuration"DSL_CPE_CRLF)); + } + + return nRet; +} +#endif /* #if defined(INCLUDE_DSL_CPE_API_VRX)*/ diff --git a/src/dsl_cpe_init_cfg.h b/src/dsl_cpe_init_cfg.h new file mode 100644 index 0000000..a89f3ab --- /dev/null +++ b/src/dsl_cpe_init_cfg.h @@ -0,0 +1,96 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef _DSL_CPE_INIT_CFG_H +#define _DSL_CPE_INIT_CFG_H + +#ifdef __cplusplus + extern "C" { +#endif + +#define DSL_CPE_FW1_SET(pFw1, szFw1) pFirmware: pFw1, nFirmwareSize: szFw1 + +#define DSL_CPE_FW_FEATURE_SET(nFwPId, nFwFsMode, nFwFsAdsl, nFwFsVdsl) \ + {nPlatformId: nFwPId, nFirmwareXdslModes: nFwFsMode, \ + nFirmwareAdslFeatures: nFwFsAdsl, nFirmwareVdslFeatures: nFwFsVdsl} + +#define DSL_CPE_FW2_SET(pFw2, szFw2) pFirmware2: pFw2, nFirmwareSize2: szFw2 + +#define DSL_CPE_XTU_SET(oct0, oct1, oct2, oct3, oct4, oct5, oct6, oct7) \ + nXtseCfg: {{oct0, oct1, oct2, oct3, oct4, oct5, oct6, oct7}} + +#define DSL_CPE_LINE_INV_NE_SET(pLi) pInventory: pLi + +#define DSL_CPE_AUTOBOOT_CTRL_SET(opt) nAutobootStartupMode: opt + +#define DSL_CPE_AUTOBOOT_CFG_SET(opt1, opt2, opt3) \ + {{bWaitBeforeConfigWrite: opt1, bWaitBeforeLinkActivation: opt2, bWaitBeforeRestart: opt3}} + +#define DSL_CPE_TEST_MODE_CTRL_SET(opt) nTestModeControl: opt + +#define DSL_CPE_LINE_ACTIVATE_CTRL_SET(LDSF, ACSF, STARTUP_MODE) \ + {nLDSF: LDSF, nACSF: ACSF, nStartupMode: STARTUP_MODE} + +#if defined(INCLUDE_DSL_CPE_API_DANUBE) +#define DSL_CPE_LL_CFG_SET(HYBRID) {nHybrid: HYBRID} + +#define DSL_CPE_SIC_SET(TCLAYER, EFM_TC_CFG_US, EFM_TC_CFG_DS, SICS) \ + {{nTcLayer: TCLAYER, nEfmTcConfigUs: EFM_TC_CFG_US, \ + nEfmTcConfigDs: EFM_TC_CFG_DS, nSystemIf: SICS}} +#endif /* #if defined(INCLUDE_DSL_CPE_API_DANUBE)*/ + +#if defined(INCLUDE_DSL_CPE_API_VRX) +#define DSL_CPE_LL_CFG_SET(FILTER, HS_TONE_GROUP_MODE, HS_TONE_GROUP_A, \ + HS_TONE_GROUP_V, HS_TONE_GROUP_AV, BASEADDR, IRQNUM, NTR_ENABLE) \ + {nFilter: FILTER, nHsToneGroupMode: HS_TONE_GROUP_MODE, \ + nHsToneGroup_A: HS_TONE_GROUP_A, nHsToneGroup_V: HS_TONE_GROUP_V, \ + nHsToneGroup_AV: HS_TONE_GROUP_AV, nBaseAddr: BASEADDR, nIrqNum: IRQNUM, \ + bNtrEnable: NTR_ENABLE} + +#define DSL_CPE_SIC_SET(TCLAYER_A, EFM_TC_CFG_US_A, EFM_TC_CFG_DS_A, SICS_A, \ + TCLAYER_V, EFM_TC_CFG_US_V, EFM_TC_CFG_DS_V, SICS_V) \ + {{nTcLayer: TCLAYER_A, nEfmTcConfigUs: EFM_TC_CFG_US_A, \ + nEfmTcConfigDs:EFM_TC_CFG_DS_A, nSystemIf: SICS_A}, \ + {nTcLayer: TCLAYER_V, nEfmTcConfigUs: EFM_TC_CFG_US_V, \ + nEfmTcConfigDs: EFM_TC_CFG_DS_V, nSystemIf: SICS_V}} +#endif /* #ifdef INCLUDE_DSL_CPE_API_VRX*/ + +#define DSL_CPE_MAC_CFG_SET(SPEED, DUPLEX, FLOW, ANEGOT, MAC_OCT_0, MAC_OCT_1, MAC_OCT_2, \ + MAC_OCT_3, MAC_OCT_4, MAC_OCT_5, MAX_FRAME_SIZE, EXT_ETH_OAM) \ + {SPEED, DUPLEX, FLOW, ANEGOT, {MAC_OCT_0, MAC_OCT_1, MAC_OCT_2, MAC_OCT_3, MAC_OCT_4, MAC_OCT_5}, \ + MAX_FRAME_SIZE, EXT_ETH_OAM} + +extern DSL_InitData_t gInitCfgData; + +#if defined(INCLUDE_DSL_CPE_API_VRX) +/** + This function returns the Initial Low Level Configuration from the give file + or the fixed default settings. + + \param pName file name of the given LowLevelConfig + \param ppRetLLCfg Pointer to return the settings. + + \return + Return values are defined within the DSL_Error_t definition + - DSL_SUCCESS in case of success + - DSL_ERROR if operation failed + - The return pointer is set to the given configuration or ULL + +*/ +DSL_Error_t DSL_CPE_GetInitialLowLevelConfig( DSL_char_t const *pName, + DSL_DeviceLowLevelConfig_t *pRetLLCfg ); +#endif /* #ifdef INCLUDE_DSL_CPE_API_VRX*/ + + +#ifdef __cplusplus +} +#endif + +#endif /* _DSL_CPE_INIT_CFG_H */ diff --git a/src/dsl_cpe_linux.c b/src/dsl_cpe_linux.c new file mode 100644 index 0000000..0dbf7a2 --- /dev/null +++ b/src/dsl_cpe_linux.c @@ -0,0 +1,1639 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef LINUX + +#ifndef _lint + +/** \file + Operating System access implementation +*/ + +#include "dsl_cpe_control.h" +#include "dsl_cpe_os.h" + +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +#include "drv_dsl_cpe_debug.h" +#include +#include +#include +#endif + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT + +#ifndef PRJ_NAME_PREFIX +#define PRJ_NAME_PREFIX +#endif + +#define SYS_NAME_PREFIX PRJ_NAME_PREFIX"/tmp" +#define SYS_PIPE_PREFIX SYS_NAME_PREFIX"/pipe" + +#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_OS + +static struct termios stored_stdin_settings; +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT +static struct termios stored_stdout_settings; +#endif /* INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +#ifndef DSL_DBG_MSG_NETLINK_ID + #define DSL_DBG_MSG_NETLINK_ID 28 +#endif +#define NL_DBG_MSG_GROUP 1 +#define MAX_MSG_SIZE_BYTES 256 + +static void DSL_CPE_NlSendMsg(DSL_char_t* pMsg); +#endif + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_Open(const DSL_char_t *pName) +{ + return open(pName, O_RDWR, 0644); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_Close(const DSL_int_t fd) +{ + return close(fd); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_Write(const DSL_int_t fd, const DSL_void_t *pData, const DSL_uint32_t nSize) +{ + return write(fd, pData, nSize); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_Read(const DSL_int_t fd, DSL_void_t *pData, const DSL_uint32_t nSize) +{ + return read(fd, (char *)pData, nSize); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_Ioctl(const DSL_int_t fd, const DSL_uint32_t cmd, DSL_int_t param) +{ + return ioctl(fd, cmd, param); +} + +/** + Wait for a device wake up +*/ +DSL_int_t DSL_CPE_Select( + const DSL_int_t max_fd, + const DSL_CPE_fd_set_t *read_fd_in, + DSL_CPE_fd_set_t *read_fd_out, + const DSL_uint32_t timeout_msec) +{ + DSL_CPE_fd_set_t tmp; + struct timeval tv; + + tv.tv_sec = timeout_msec / 1000; + tv.tv_usec = (timeout_msec % 1000) * 1000; + + if(read_fd_in) + { + if(read_fd_out) + { + if (timeout_msec == (DSL_uint32_t)-1) + { + if (read_fd_out != read_fd_in) + { + cpe_control_memcpy_s(read_fd_out, sizeof(DSL_CPE_fd_set_t), + read_fd_in, sizeof(DSL_CPE_fd_set_t)); + } + return select(max_fd, read_fd_out, NULL, NULL, NULL); + } + else + { + if (read_fd_out != read_fd_in) + { + cpe_control_memcpy_s(read_fd_out, sizeof(DSL_CPE_fd_set_t), + read_fd_in, sizeof(DSL_CPE_fd_set_t)); + } + return select(max_fd, read_fd_out, NULL, NULL, &tv); + } + } + else + { + if (timeout_msec == (DSL_uint32_t)-1) + { + cpe_control_memcpy_s(&tmp, sizeof(DSL_CPE_fd_set_t), + read_fd_in, sizeof(DSL_CPE_fd_set_t)); + return select(max_fd, &tmp, NULL, NULL, NULL); + } + else + { + cpe_control_memcpy_s(&tmp, sizeof(DSL_CPE_fd_set_t), + read_fd_in, sizeof(DSL_CPE_fd_set_t)); + return select(max_fd, &tmp, NULL, NULL, &tv); + } + } + } + else + { + DSL_CPE_MSecSleep(timeout_msec); + } + + return 0; +} + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_GetChar(DSL_void_t) +{ + return getchar(); +} +#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_PutChar(DSL_char_t c, DSL_CPE_File_t *stream) +{ + return putc(c, stream); +} +#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t DSL_CPE_FD_SET(DSL_int_t fd, DSL_CPE_fd_set_t *set) +{ + FD_SET(fd, set); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t DSL_CPE_FD_CLR(DSL_int_t fd, DSL_CPE_fd_set_t *set) +{ + FD_CLR(fd, set); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t DSL_CPE_FD_ZERO(DSL_CPE_fd_set_t *set) +{ + FD_ZERO(set); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FD_ISSET(DSL_int_t fd, const DSL_CPE_fd_set_t *set) +{ +#ifdef DSL_CPE_SIMULATOR + DSL_uint32_t i; + + for (i = 0; i < (__FD_SETSIZE / __NFDBITS); i++) + { + if (FD_ISSET(fd, set)) + { + return DSL_SIM_FD_ISSET(fd); + } + } + return 0; +#else + return FD_ISSET(fd, set); +#endif +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_Error_t DSL_CPE_PipeCreate(DSL_char_t *pName) +{ + /* Used to generate the pipe path */ + DSL_char_t *pipepath = NULL; + DSL_Error_t ret = DSL_SUCCESS; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "create pipe %s" DSL_CPE_CRLF, pName)); + + pipepath = DSL_CPE_Malloc(strlen(SYS_PIPE_PREFIX"/") + strlen(pName) + 1); + if ( !pipepath ) + { + return DSL_ERR_MEMORY; + } + + cpe_control_strncpy_s(pipepath, + strlen(SYS_PIPE_PREFIX"/") + strlen(pName) + 1, + SYS_PIPE_PREFIX"/", + strlen(SYS_PIPE_PREFIX"/")); + /* try to create directory, ignore error designedly */ + mkdir(pipepath, S_IFDIR | 0777); + strcat(pipepath, pName); + + /*create a named pipe and check errors*/ + if ((mkfifo(pipepath, 0777) == -1) && (errno != EEXIST)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "mkfifo %s failed (errno=%d)" + DSL_CPE_CRLF, pipepath, errno)); + /* delete named pipe */ + /*unlink(pipepath);*/ + ret = DSL_ERROR; + } + + DSL_CPE_Free (pipepath); + return ret; +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_CPE_File_t *DSL_CPE_PipeOpen(DSL_char_t *pName, DSL_boolean_t reading, DSL_boolean_t blocking) +{ + int fd; + int flags; + DSL_CPE_File_t * pipefile = DSL_NULL; + DSL_char_t pipepath[256]; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "open pipe %s" DSL_CPE_CRLF, pName)); + + DSL_CPE_snprintf(pipepath, sizeof(pipepath), SYS_PIPE_PREFIX"/%s", pName); + /* only open allows the flag "O_NONBLOCK", + so first open a fd and change it to a DSL_CPE_File_t* with fdopen() */ + if (reading == DSL_TRUE) + { + flags = O_RDONLY; + } + else + { + flags = O_WRONLY; + } + + if (!blocking) + { + flags |= O_NONBLOCK; + } + + fd = open(pipepath, flags); + if (fd <= 0) + { + /* Attention: The following printout is assigned to WARNING only because + the evvent handling of standard pipe mechanism will always lead to + this state if there is no instance that collects event data from an + existing pipe. This is the normal behavior and should be NOT displayed + as an error! */ + DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, ("open %s failed (errno=%d)" DSL_CPE_CRLF, + pipepath, errno)); + } + if (fd > 0) + { + if (reading == DSL_TRUE) + { + pipefile = fdopen(fd, "r"); + } + else + { + pipefile = fdopen(fd, "w"); + } + if (pipefile == DSL_NULL) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, ("fdopen %s failed (errno=%d)" DSL_CPE_CRLF, + pipepath, errno)); + } + } + + return pipefile; +} + + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_Error_t DSL_CPE_PipeClose(DSL_CPE_File_t *pipefile) +{ + return (fclose(pipefile)==0) ? DSL_SUCCESS : DSL_ERROR; +} + + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int32_t DSL_CPE_LockCreate( + DSL_CPE_Lock_t *lockId) +{ + if(lockId) + { + if (DSL_LOCK_INIT_VALID(lockId) == DSL_FALSE) + { + if(sem_init(&lockId->object, 0, 1) == 0) + { + lockId->bValid = DSL_TRUE; + + return DSL_SUCCESS; + } + } + } + + return DSL_ERROR; +} + + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int32_t DSL_CPE_LockDelete( + DSL_CPE_Lock_t *lockId) +{ + /* delete semaphore */ + if(lockId) + { + if (DSL_LOCK_INIT_VALID(lockId) == DSL_TRUE) + { + if (sem_destroy(&lockId->object) == 0) + { + lockId->bValid = DSL_FALSE; + + return DSL_SUCCESS; + } + } + } + + return DSL_ERROR; +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int32_t DSL_CPE_LockGet( + DSL_CPE_Lock_t *lockId) +{ + if(lockId) + { + if (DSL_LOCK_INIT_VALID(lockId) == DSL_TRUE) + { + if (sem_wait(&lockId->object) == 0) + { + return DSL_SUCCESS; + } + } + } + + return DSL_ERROR; +} + +/** + LINUX Application - Get the Lock with timeout. + +\par Implementation + +\param + lockId Provides the pointer to the Lock Object. + +\param + timeout_ms Timeout value [ms] + - 0: no wait + - -1: wait forever + - any other value: waiting for specified amount of milliseconds +\param + pRetCode Points to the return code variable. [O] + - If the pointer is NULL the return code will be ignored, else + the corresponding return code will be set + - For timeout the return code is set to 1. + +\return + DSL_SUCCESS on success. + DSL_ERROR on error or timeout. + +\note + To detect timeouts provide the return code varibale, in case of timeout + the return code is set to 1. +*/ +DSL_int32_t DSL_CPE_LockTimedGet( + DSL_CPE_Lock_t *lockId, + DSL_uint32_t timeout_ms, + DSL_int32_t *pRetCode) +{ + struct timespec t; + int ret; + + if(lockId) + { + if (DSL_LOCK_INIT_VALID(lockId) == DSL_TRUE) + { + if(timeout_ms == 0xFFFFFFFF) + { + return DSL_CPE_LockGet(lockId); + } + + if(timeout_ms == 0) + { + /* just try to get the semaphore without waiting, if not available return to calling thread */ + ret = sem_trywait(&lockId->object); + if(ret != 0) + { + if (pRetCode) *pRetCode = 0; + return DSL_ERROR; + } + } + else + { + clock_gettime(CLOCK_REALTIME, &t); + + t.tv_sec += (timeout_ms / 1000); + t.tv_nsec += (timeout_ms % 1000) * 1000 * 1000; + + ret = sem_timedwait(&lockId->object, &t); + } + + if(ret == 0) + { + if (pRetCode) *pRetCode = 0; + return DSL_SUCCESS; + } + + switch(errno) + { + case EINTR: + if (pRetCode) *pRetCode = 0; + break; + + case EDEADLK: + if (pRetCode) *pRetCode = 0; + break; + + case EINVAL: + if (pRetCode) *pRetCode = 0; + break; + + case ETIMEDOUT: + if (pRetCode) *pRetCode = 1; + break; + + default: + if (pRetCode) *pRetCode = 0; + break; + } + } + } + + return DSL_ERROR; +} + + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int32_t DSL_CPE_LockSet( + DSL_CPE_Lock_t *lockId) +{ + if(lockId) + { + if (DSL_LOCK_INIT_VALID(lockId) == DSL_TRUE) + { + if (sem_post(&lockId->object) == 0) + { + return DSL_SUCCESS; + } + } + } + + return DSL_ERROR; +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t DSL_CPE_Sleep(DSL_uint32_t nSeconds) +{ + sleep(nSeconds); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t DSL_CPE_MSecSleep(DSL_uint32_t nMs) +{ + usleep(nMs * 1000); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t *DSL_CPE_Malloc(DSL_uint32_t size) +{ + DSL_void_t *memblock; + + memblock = (DSL_void_t*) malloc((size_t)size); + + return (memblock); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +void DSL_CPE_Free(DSL_void_t *memblock) +{ + free(memblock); +} + +/** + Open a file. +*/ +DSL_CPE_File_t *DSL_CPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode) +{ + return fopen(name, mode); +} + +#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_CPE_File_t *DSL_CPE_FMemOpen (DSL_char_t *buf, const DSL_uint32_t size, const DSL_char_t *mode) +{ + return fmemopen(buf, size, mode); +} +#endif /* INCLUDE_DSL_CPE_DTI_SUPPORT */ + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FClose(DSL_CPE_File_t *fd) +{ + if(fd != 0) + return fclose(fd); + + return -1; +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream) +{ + return fread(buf, size, count, stream); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FWrite(const DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream) +{ + return fwrite(buf, size, count, stream); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FFlush(DSL_CPE_File_t *fd) +{ + return fflush(fd); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_Feof(DSL_CPE_File_t *stream) +{ + return feof(stream); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_char_t *DSL_CPE_FGets(DSL_char_t *str, DSL_int_t n, DSL_CPE_File_t *stream) +{ + return fgets(str, n, stream); +} + +/** + get file status +*/ +DSL_int_t DSL_CPE_FStat(DSL_char_t *str, DSL_CPE_stat_t *st) +{ + return stat(str, st); +} + +static DSL_int32_t DSL_CPE_UserThreadStartup( + DSL_CPE_ThreadCtrl_t *pThrCntrl); + + +/* ============================================================================ + IFX Linux adaptation - Application Thread handling + ========================================================================= */ + +/** + LINUX Application - Thread stub function. The stub function will be called + before calling the user defined thread routine. This gives + us the possibility to add checks etc. + +\par Implementation + Before the stub function enters the user thread routin the following setup will + be done: + - make the kernel thread to a daemon + - asign the parent to the init process (avoid termination if the parent thread dies). + - setup thread name, and signal handling (if required). + After this the user thread routine will be entered. + +\param + pThrCntrl Thread information data + +\return + - DSL_SUCCESS on success + - DSL_ERROR on error +*/ +static DSL_int32_t DSL_CPE_UserThreadStartup( + DSL_CPE_ThreadCtrl_t *pThrCntrl) +{ + DSL_int32_t retVal = DSL_ERROR; + + if(pThrCntrl) + { + if (!pThrCntrl->pThrFct) + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "User Thread startup <%s>, missing THR function" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName)); + + return DSL_ERROR; + } + + DSL_CCA_DEBUG( DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "User Thread Startup <%s>, TID %d (PID %d) - ENTER" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName, pthread_self(), getpid())); + + pThrCntrl->thrParams.bRunning = 1; + retVal = pThrCntrl->pThrFct(&pThrCntrl->thrParams); + pThrCntrl->thrParams.bRunning = 0; + + DSL_CCA_DEBUG( DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "User Thread Startup <%s>, TID %d (PID %d) - EXIT" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName, pthread_self(), getpid())); + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "User Thread startup <%s>, missing control object" DSL_CPE_CRLF)); + } + + return retVal; +} + +/** + LINUX Application - Creates a new thread / task. + +\par Implementation + - Allocate and setup the internal thread control structure. + - setup the LINUX specific thread parameter (see "init_completion"). + - start the LINUX Kernel thread with the internal stub function (see "kernel_thread") + +\param + pThrCntrl Pointer to thread control structure. This structure has to + be allocated outside and will be initialized. +\param + pName specifies the 8-char thread / task name. +\param + pThreadFunction specifies the user entry function of the thread / task. +\param + nStackSize specifies the size of the thread stack - not used. +\param + nPriority specifies the thread priority, 0 will be ignored +\param + nArg1 first argument passed to thread / task entry function. +\param + nArg2 second argument passed to thread / task entry function. + +\return + - DSL_SUCCESS thread was successful started. + - DSL_ERROR thread was not started +*/ +DSL_int32_t DSL_CPE_ThreadInit( + DSL_CPE_ThreadCtrl_t *pThrCntrl, + DSL_char_t *pName, + DSL_CPE_ThreadFunction_t pThreadFunction, + DSL_uint32_t nStackSize, + DSL_uint32_t nPriority, + DSL_uint32_t nArg1, + DSL_uint32_t nArg2) +{ + DSL_int32_t retVal=0; + pthread_t tid; + pthread_attr_t attr; + + if(pThrCntrl) + { + if (DSL_THREAD_INIT_VALID(pThrCntrl) == DSL_FALSE) + { + pthread_attr_init(&attr); + /*pthread_attr_setstacksize (&attr, nStackSize);*/ + + memset(pThrCntrl, 0x00, sizeof(DSL_CPE_ThreadCtrl_t)); + + /* set thread function arguments */ + cpe_control_strncpy_s(pThrCntrl->thrParams.pName, + DSL_CPE_THREAD_NAME_LEN, pName, strlen(pName)); + pThrCntrl->thrParams.pName[DSL_CPE_THREAD_NAME_LEN-1] = 0; + pThrCntrl->nPriority = nPriority; + pThrCntrl->thrParams.nArg1 = nArg1; + pThrCntrl->thrParams.nArg2 = nArg2; + + /* set thread control settings */ + pThrCntrl->pThrFct = pThreadFunction; + + /* + create thread with configured attributes + we call first our own routine for further checks and setup etc. + */ + retVal = pthread_create ( + &tid, &attr, + (DSL_USER_THREAD_StartRoutine)DSL_CPE_UserThreadStartup, + (DSL_void_t*)pThrCntrl); + if (retVal) + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "User Thread create <%s> - pthread_create = %d" DSL_CPE_CRLF, + (pName ? (pName) : "noname"), errno )); + + return DSL_ERROR;; + } + + pThrCntrl->tid = tid; + + pThrCntrl->bValid = DSL_TRUE; + + return DSL_SUCCESS; + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "ThreadInit, object already valid" DSL_CPE_CRLF)); + } + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "ThreadInit, missing object" DSL_CPE_CRLF)); + } + + return DSL_ERROR;; +} + + +/** + LINUX Application - Shutdown and terminate a given thread. + Therefore the thread delete functions triggers the user thread function + to shutdown. In case of not responce (timeout) the thread will be canceled. + +\par Implementation + - force a shutdown via the shutdown flag. + - wait for completion (see "wait_for_completion"). + - free previous allocated internal data. + +\param + pThrCntrl Thread control struct. +\param + waitTime_ms Time [ms] to wait for "self-shutdown" of the user thread. + +\return + - DSL_SUCCESS thread was successful deleted - thread control struct is freed. + - DSL_ERROR thread was not deleted +*/ +DSL_int32_t DSL_CPE_ThreadDelete( + DSL_CPE_ThreadCtrl_t *pThrCntrl, + DSL_uint32_t waitTime_ms) +{ + DSL_uint32_t waitCnt = 1; + + if(pThrCntrl) + { + if (DSL_THREAD_INIT_VALID(pThrCntrl) == DSL_TRUE) + { + if (pThrCntrl->thrParams.bRunning == 1) + { + /* trigger user thread routine to shutdown */ + pThrCntrl->thrParams.bShutDown = 1; + + if (waitTime_ms != DSL_THREAD_DELETE_WAIT_FOREVER) + { + waitCnt = waitTime_ms / DSL_THREAD_DOWN_WAIT_POLL_MS; + } + + while (waitCnt && (pThrCntrl->thrParams.bRunning == 1) ) + { + DSL_CPE_MSecSleep(DSL_THREAD_DOWN_WAIT_POLL_MS); + + if (waitTime_ms != DSL_THREAD_DELETE_WAIT_FOREVER) + waitCnt--; + } + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + ("IFXOS WRN - User Thread Delete <%s> - not running" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName)); + } + + if (pThrCntrl->thrParams.bRunning == 1) + { + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + ("IFXOS WRN - User Thread Delete <%s> TID %d - kill, no shutdown responce" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName, pThrCntrl->tid)); + + /** still running --> kill */ + switch(pthread_cancel(pThrCntrl->tid)) + { + case 0: + pThrCntrl->thrParams.bRunning = 0; + break; + + case ESRCH: + /* just information that task already exited by itself */ + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + ("IFXOS WRN - User Thread Delete <%s> TID %d - not found (already exited)" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName, pThrCntrl->tid)); + pThrCntrl->thrParams.bRunning = 0; + break; + + default: + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "User Thread Delete <%s> TID %d - unknown (mem loss)" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName, pThrCntrl->tid)); + + pThrCntrl->bValid = DSL_FALSE; + + return DSL_ERROR; + } + } + + pThrCntrl->bValid = DSL_FALSE; + + return DSL_SUCCESS; + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "ThreadDelete, invalid object" DSL_CPE_CRLF)); + } + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "ThreadDelete, missing object" DSL_CPE_CRLF)); + } + + return DSL_ERROR; + +} + + +/** + LINUX Application - Shutdown a given thread. + Therefore the thread delete functions triggers the user thread function + to shutdown. + +\par Implementation + - force a shutdown via the shutdown flag. + - wait for completion (see "wait_for_completion"). + - free previous allocated internal data. + +\param + pThrCntrl Thread control struct. +\param + waitTime_ms Time [ms] to wait for "self-shutdown" of the user thread. + +\return + - DSL_SUCCESS successful shutdown - thread control struct is freed. + - DSL_ERROR no success, thread struct still exists. +*/ +DSL_int32_t DSL_CPE_ThreadShutdown( + DSL_CPE_ThreadCtrl_t *pThrCntrl, + DSL_uint32_t waitTime_ms) +{ + DSL_uint32_t waitCnt = 1; + + if(pThrCntrl) + { + if (DSL_THREAD_INIT_VALID(pThrCntrl) == DSL_TRUE) + { + if (pThrCntrl->thrParams.bRunning == 1) + { + /* trigger user thread routine to shutdown */ + pThrCntrl->thrParams.bShutDown = 1; + + if (waitTime_ms != DSL_THREAD_DELETE_WAIT_FOREVER) + { + waitCnt = waitTime_ms / DSL_THREAD_DOWN_WAIT_POLL_MS; + } + + while (waitCnt && (pThrCntrl->thrParams.bRunning == 1) ) + { + DSL_CPE_MSecSleep(DSL_THREAD_DOWN_WAIT_POLL_MS); + + if (waitTime_ms != DSL_THREAD_DELETE_WAIT_FOREVER) + waitCnt--; + } + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + ("IFXOS WRN - User Thread Shutdown <%s> - not running" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName)); + } + + if (pThrCntrl->thrParams.bRunning != 0) + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "User Thread Shutdown <%s> - no responce" DSL_CPE_CRLF, + pThrCntrl->thrParams.pName)); + + pThrCntrl->bValid = DSL_FALSE; + + return DSL_ERROR; + } + + pThrCntrl->bValid = DSL_FALSE; + + return DSL_SUCCESS; + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Thread Shutdown, invalid object" DSL_CPE_CRLF)); + } + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Thread Shutdown, missing object" DSL_CPE_CRLF)); + } + + return DSL_ERROR; +} + +/** + LINUX Application - Modify own thread priority. + +\todo + Under discussion how to handle the priority! + +\param + newPriority - new thread priority. + Possible Values are: + - DSL_THREAD_PRIO_IDLE + - DSL_THREAD_PRIO_LOWEST + - DSL_THREAD_PRIO_LOW + - DSL_THREAD_PRIO_NORMAL + - DSL_THREAD_PRIO_HIGH + - DSL_THREAD_PRIO_HIGHEST + - DSL_THREAD_PRIO_TIME_CRITICAL +\attention + The intention for the priority "TIME_CRITICAL" is for use within + driver space. + +\return + - DSL_SUCCESS priority changed. + - DSL_ERROR priority not changed. +*/ +DSL_int32_t DSL_CPE_ThreadPriorityModify( + DSL_uint32_t newPriority) +{ + struct sched_param param; + int ret=0, policy=0; + + memset(¶m, 0x00, sizeof(param)); + + ret = pthread_getschedparam (pthread_self(), &policy, ¶m); + if(ret == 0) + { + param.sched_priority = +newPriority; + + /* fix the scheduler to FIFO to be able to increase the priority */ + policy = SCHED_FIFO; + + switch(policy) + { + case SCHED_OTHER: + DSL_CCA_DEBUG( DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "Thread, using SCHED_OTHER (regular, non-realtime scheduling)" DSL_CPE_CRLF)); + break; + + case SCHED_RR: + DSL_CCA_DEBUG( DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "Thread, using SCHED_RR (realtime, round-robin)" DSL_CPE_CRLF)); + break; + + case SCHED_FIFO: + DSL_CCA_DEBUG( DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "Thread, using SCHED_FIFO (realtime, first-in first-out)" DSL_CPE_CRLF)); + break; + + default: + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX "Thread, priority not defined %d" DSL_CPE_CRLF, policy)); + break; + } + + /* setting the new priority */ + ret = pthread_setschedparam (pthread_self(), policy, ¶m); + if(ret == 0) + { + DSL_CCA_DEBUG( DSL_CCA_DBG_MSG, + (DSL_CPE_PREFIX "Thread, Set new priority %d, policy %d" DSL_CPE_CRLF, + param.sched_priority, policy)); + + return DSL_SUCCESS; + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Thread, Set of new priority %d failed (pid %d)" DSL_CPE_CRLF, + param.sched_priority, (int)pthread_self())); + } + } + else + { + DSL_CCA_DEBUG( DSL_CCA_DBG_ERR, + (DSL_CPE_PREFIX "Thread, Get of priority failed (pid %d)" DSL_CPE_CRLF, + (int)pthread_self())); + } + + switch(ret) + { + case ENOSYS: + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX "Thread, The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the " + "implementation does not support the function." DSL_CPE_CRLF)); + break; + + case ESRCH: + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX "Thread, The value specified by thread does not refer to a existing thread." DSL_CPE_CRLF)); + break; + + case EINVAL: + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX "Thread, The value specified by policy or one of the scheduling parameters " + "associated with the scheduling policy policy is invalid." DSL_CPE_CRLF)); + break; + + case ENOTSUP: + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX "Thread, An attempt was made to set the policy or scheduling parameters " + "to an unsupported value." DSL_CPE_CRLF)); + break; + + case EPERM: + DSL_CCA_DEBUG( DSL_CCA_DBG_WRN, + (DSL_CPE_PREFIX "Thread, The caller does not have the appropriate permission to set either " + "the scheduling parameters or the scheduling policy of the specified thread." DSL_CPE_CRLF)); + break; + } + + return DSL_ERROR; +} + + +/** + Return the own thread / task ID + +\return + Thread ID of the current thread. +*/ +DSL_CPE_Thread_t DSL_CPE_ThreadIdGet(void) +{ + return pthread_self(); +} + +void DSL_CPE_EchoOff(void) +{ + struct termios new_settings; + tcgetattr(fileno(stdout),&stored_stdout_settings); + new_settings = stored_stdout_settings; + new_settings.c_lflag &= (~ECHO); + tcsetattr(fileno(stdout),TCSANOW,&new_settings); + return; +} + +void DSL_CPE_EchoOn(void) +{ + tcsetattr(fileno(stdout),TCSANOW,&stored_stdout_settings); + return; +} + +DSL_Socket_t DSL_CPE_Accept( + DSL_Socket_t socFd, + DSL_sockaddr_in_t *pSocAddr) +{ + DSL_int_t addrlen = sizeof (struct sockaddr); + + return (DSL_Socket_t)accept((int)socFd, (struct sockaddr *)pSocAddr, (socklen_t*)&addrlen); +} + +DSL_int_t DSL_CPE_Socket( + DSL_int_t socType, + DSL_Socket_t *pSocketFd) +{ + if (pSocketFd == DSL_NULL) + { + return -1; + } + + /* arg3 = 0: do not specifiy the protocol */ + if((*pSocketFd = socket(AF_INET, socType, 0)) == -1) + { + return -1; + } + + return 0; +} + +DSL_int_t DSL_CPE_SocketBind( + DSL_Socket_t socFd, + DSL_sockaddr_in_t *pSocAddr) +{ + DSL_int_t ret; + + if (pSocAddr == DSL_NULL) + { + return -1; + } + + ret = bind( + (int)socFd, + (struct sockaddr*)pSocAddr, + sizeof(struct sockaddr_in)); + + if (ret != 0) + { + return -1; + } + + return 0; +} +#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nRet = 0; + + va_start(ap, format); /* set ap pointer to 1st unnamed arg */ + + nRet = vfprintf(stream, format, ap); + fflush(stream); + + va_end(ap); + + return nRet; +} + +/* + [KAv]: IFXOS mapping for this function causes CLI console hung +*/ +void DSL_CPE_KeypressSet(void) +{ + struct termios new_settings; + + tcgetattr(fileno(stdin),&stored_stdin_settings); + new_settings = stored_stdin_settings; + + /* Disable canonical mode */ + new_settings.c_lflag &= ~(ICANON); + /* set buffer size to 0 byte / timeout 100 ms */ + new_settings.c_cc[VTIME] = 10; + new_settings.c_cc[VMIN] = 1; + + tcsetattr(fileno(stdin),TCSANOW,&new_settings); + return; +} + +void DSL_CPE_KeypressReset(void) +{ + tcsetattr(fileno(stdin),TCSANOW,&stored_stdin_settings); + return; +} + +#ifdef INCLUDE_SCRIPT_NOTIFICATION + +DSL_CPE_EnvList_t g_EnvList = {0}; + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_NOTIFICATIONS +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue) +{ +#if 0 + DSL_Error_t nRet = DSL_ERROR; + + nRet = ((setenv(sName, sValue, 1) == 0) ? DSL_SUCCESS : DSL_ERROR); + + if (nRet == DSL_ERROR) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Failed to set envvar (%s=%s)!" DSL_CPE_CRLF, sName, sValue)); + } + else + { + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX "Set envvar (%s=%s)" + DSL_CPE_CRLF, sName, sValue)); + } +#else + DSL_Error_t nRet = DSL_SUCCESS; + DSL_CPE_EnvList_t *pEnvList = &g_EnvList, *pEnvListPrev = &g_EnvList; + const DSL_uint16_t namelen = strlen (sName); + const DSL_uint16_t vallen = sValue != DSL_NULL ? strlen (sValue) : 0; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "SNH - Set %s to %s" DSL_CPE_CRLF, sName, sValue)); + + if (namelen == 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Can't set zero-length env variable!" DSL_CPE_CRLF)); + + return DSL_ERROR; + } + + if (vallen > DSL_CPE_MAX_ENV_VAR_LENGTH) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Unsupported environment variable value length=%d, variable value: %s!" DSL_CPE_CRLF, + vallen, sValue)); + + return DSL_ERROR; + } + + while(1) + { + if (pEnvList == DSL_NULL) + { + pEnvList = (DSL_CPE_EnvList_t*)malloc(sizeof(DSL_CPE_EnvList_t)); + + if (!pEnvList) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Failed to allocate Env list entry!" DSL_CPE_CRLF)); + return DSL_ERROR; + } + + memset(pEnvList, 0x0, sizeof(DSL_CPE_EnvList_t)); + + pEnvListPrev->pNext = pEnvList; + } + + if (pEnvList->pEnvEntry == DSL_NULL) + { + pEnvList->pEnvEntry = (DSL_char_t*)malloc(namelen + DSL_CPE_MAX_ENV_VAR_LENGTH + 2); + + if (!(pEnvList->pEnvEntry)) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Failed to allocate Env entry!" DSL_CPE_CRLF)); + return DSL_ERROR; + } + + memset(pEnvList->pEnvEntry, 0x0, namelen + DSL_CPE_MAX_ENV_VAR_LENGTH + 2); + + break; + } + else if (!strncmp (pEnvList->pEnvEntry, sName, namelen)) + { + /* variable already exists*/ + break; + } + else + { + pEnvListPrev = pEnvList; + pEnvList = pEnvList->pNext; + continue; + } + } + + snprintf(pEnvList->pEnvEntry, namelen + DSL_CPE_MAX_ENV_VAR_LENGTH + 2, "%s=%s", sName, sValue != DSL_NULL ? sValue : ""); + putenv(pEnvList->pEnvEntry); +#endif + + return (nRet); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t DSL_CPE_EnvVarFree(DSL_void_t) +{ + DSL_CPE_EnvList_t *pEnvListHead = &g_EnvList, *pEnvListNext = DSL_NULL; + + if (pEnvListHead->pEnvEntry) + free(pEnvListHead->pEnvEntry); + + pEnvListHead = pEnvListHead->pNext; + + while(pEnvListHead) + { + if (pEnvListHead->pEnvEntry) + free(pEnvListHead->pEnvEntry); + + pEnvListNext = pEnvListHead->pNext; + + free(pEnvListHead); + + pEnvListHead = pEnvListNext; + } +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +#define DSL_CPE_LINUX_CMD_ADD " 2> /dev/null" +DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand) +{ + DSL_int_t nRet = 0; + pid_t pid; + DSL_int_t pstatus, i, max_fds; + + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "system command: %s" DSL_CPE_CRLF, sCommand)); + + /** reap child silently */ + signal(SIGCHLD, SIG_IGN); + + pid = fork(); + + if (pid == 0) { + /* child */ + + max_fds = getdtablesize(); + for (i = 0; i < max_fds; i++) + { + /* skip closing stout (fds 1) for echo correct working + within notification scripts */ + if (i == 1) + { + continue; + } + close(i); + } + + if (execl(sCommand, sCommand, NULL) == -1) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "execl(); errno %u" DSL_CPE_CRLF, errno)); + + nRet = DSL_ERROR; + } + } + else if (pid < 0) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "fork(); errno %u" DSL_CPE_CRLF, errno)); + + nRet = DSL_ERROR; + } + else + { + /* parent */ + + /** don't wait till environment variable is set */ + if (waitpid(pid, &pstatus, WNOHANG) == -1) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "waitpid(); errno %u" DSL_CPE_CRLF, errno)); + + nRet = DSL_ERROR; + } + } + + return nRet == 0 ? DSL_SUCCESS : DSL_ERROR; +} +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_OS + +#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION*/ + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +int DSL_CPE_debug_printf(DSL_char_t *fmt, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nRet = 0; +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +#ifndef DSL_CPE_DEBUG_DISABLE + IFX_char_t debugString[MAX_MSG_SIZE_BYTES + 1] = {0}; + + /* add the debug string itself */ + va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */ + nRet = vsnprintf(&debugString[0], DSL_DBG_MAX_DEBUG_PRINT_CHAR, fmt, ap); + va_end(ap); + + if (DSL_CCA_g_dbgDestination == DSL_CCA_DBG_DST_CONSOLE) + { + printf("%s", debugString); + } + else + { + /* send the formed string to the logger */ + DSL_CPE_NlSendMsg(debugString); + } +#endif /* DSL_CPE_DEBUG_DISABLE */ +#else + va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */ + nRet = vprintf(fmt, ap); + va_end(ap); +#endif + + return nRet; +} + +#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT +static void DSL_CPE_NlSendMsg(DSL_char_t* pMsg) +{ + DSL_int_t nSockFd = -1; + struct sockaddr_nl srcAddr, dstAddr; + struct nlmsghdr *pNlMsgHdr; + struct msghdr msg; + struct iovec iov; + + nSockFd = socket(AF_NETLINK, SOCK_RAW, DSL_DBG_MSG_NETLINK_ID); + if(nSockFd == -1) + { + printf("could not open netlink socket"); + DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX + "could not open netlink socket" DSL_CPE_CRLF)); + + return; + } + + /* source address */ + memset(&srcAddr, 0, sizeof(srcAddr)); + srcAddr.nl_family = AF_NETLINK; + srcAddr.nl_pid = getpid(); + srcAddr.nl_groups = NL_DBG_MSG_GROUP; + if (bind(nSockFd, (struct sockaddr*)&srcAddr, sizeof(srcAddr))) { + return; + } + + memset(&dstAddr, 0, sizeof(dstAddr)); + dstAddr.nl_family = AF_NETLINK; + dstAddr.nl_groups = NL_DBG_MSG_GROUP; + + /* Fill the netlink message header and data */ + pNlMsgHdr = (struct nlmsghdr*) malloc(NLMSG_SPACE(MAX_MSG_SIZE_BYTES)); + if (pNlMsgHdr == NULL) { + close(nSockFd); + return; + } + + memset(pNlMsgHdr, 0, NLMSG_SPACE(MAX_MSG_SIZE_BYTES)); + pNlMsgHdr->nlmsg_len = MAX_MSG_SIZE_BYTES; + pNlMsgHdr->nlmsg_pid = getpid(); + pNlMsgHdr->nlmsg_flags = 1; + pNlMsgHdr->nlmsg_type = 0; + + cpe_control_strncpy_s(NLMSG_DATA(pNlMsgHdr), NLMSG_SPACE(MAX_MSG_SIZE_BYTES), pMsg, strlen(pMsg)); + + iov.iov_base = (void*) pNlMsgHdr; + iov.iov_len = pNlMsgHdr->nlmsg_len; + msg.msg_name = (void*) &dstAddr; + msg.msg_namelen = sizeof(dstAddr); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + + sendmsg(nSockFd, &msg, 0); + + close(nSockFd); +} +#endif + +/** + Segmentation fault handler. Will print the current thread id. + + \param val not used +*/ +static void DSL_CPE_SegmentationFault(int val) +{ + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "Segmentation fault, thread ID is %d, PID %d" DSL_CPE_CRLF, + (int)DSL_CPE_ThreadIdGet(), getpid())); + + sleep(10000); +} + +/** + Installing of system handler routines. +*/ +DSL_void_t DSL_CPE_HandlerInstall(DSL_void_t) +{ + signal(SIGSEGV, DSL_CPE_SegmentationFault); + /* ignore broken pipes */ + signal(SIGPIPE, SIG_IGN); +} + +DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal) +{ + return htons(hVal); +} + +DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal) +{ + return htonl(hVal); +} + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t) +{ + DSL_int_t nFd,nErrCode; + struct ifreq ifr; + DSL_char_t *pString = DSL_NULL; + + /* obtain ip-address automatically */ + nFd = socket(AF_INET, SOCK_DGRAM, 0); + if (nFd != -1) + { + ifr.ifr_addr.sa_family = AF_INET; + cpe_control_strncpy_s(ifr.ifr_name, IFNAMSIZ-1, + DSL_DEBUG_TOOL_INTERFACE_DEFAULT_IFACE, strlen(DSL_DEBUG_TOOL_INTERFACE_DEFAULT_IFACE)); + nErrCode = DSL_CPE_Ioctl(nFd, SIOCGIFADDR, (DSL_int_t) &ifr); + close(nFd); + if (nErrCode == 0) + { + pString = + DSL_CPE_Malloc( strlen(inet_ntoa( + ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)) + 1); + } + } + + + if (pString != DSL_NULL) + { + cpe_control_strncpy_s(pString, + strlen(inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)) + 1, + inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr), + strlen(inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr))); + } + + return pString; +} + +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#endif /* #ifndef _lint*/ + +#endif /* LINUX */ diff --git a/src/dsl_cpe_linux.h b/src/dsl_cpe_linux.h new file mode 100644 index 0000000..72d701f --- /dev/null +++ b/src/dsl_cpe_linux.h @@ -0,0 +1,572 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef LINUX + +#include "drv_dsl_cpe_api_types.h" + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT + +#define _GNU_SOURCE 1 +#include + +#include +#include +#include /* fdopen */ +#include /* open */ +#include /* ioctl */ +#include /* memset, strstr, strlen */ +#include /* strtoul */ +#include /* fd_set */ +#include /* select */ +#include /* ftok */ +#include +#include /* daemon */ +#include +#include +#include +#include +#include /* va_start... */ +#include +#include /* stat */ +#include /* log10, fabs, ceil */ +#include +#include /* tcgetattr, tcsetattr */ +#include +#include +#include +#include /* socket */ +#include /* semget */ +#include /* sem_t */ + +#ifdef DSL_DEBUG_TOOL_INTERFACE +#include +#include +#include +#include +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#else + +#include +#include +#include /* fdopen */ +#include /* memset, strstr, strlen */ +#include /* strtoul */ +#include /* fd_set */ +#include +#include /* daemon */ +#include +#include +#include /* va_start... */ +#include +#include +#include +#include +#include +#include +#ifdef DSL_DEBUG_TOOL_INTERFACE +#include +#include +#include +#include +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +/** IFXOS includes*/ +#include "ifxos_common.h" +#include "ifxos_print_io.h" +#include "ifxos_memory_alloc.h" +#include "ifxos_device_access.h" +#include "ifxos_file_access.h" +#include "ifxos_time.h" +#include "ifxos_lock.h" +#include "ifxos_thread.h" +#include "ifxos_termios.h" +#include "ifxos_pipe.h" +#include "ifxos_misc.h" +#include "ifxos_socket.h" +#endif /* INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +/** \file + OS interface, Linux adaptation +*/ + + +/* + ***************** Common definitions ******************************** +*/ + +#define DSL_CPE_STRNCASECMP strncasecmp + +#ifndef FD_SETSIZE +#define DSL_FD_SETSIZE 1024 +#else +#define DSL_FD_SETSIZE FD_SETSIZE +#endif + +/* arpa/inet.h mapping */ +#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr)) +#define DSL_CPE_AddressToString inet_ntoa + +/* sys/socket.h mapping */ +#define DSL_CPE_SockOptSet setsockopt + + +/** map FILE to own type */ +typedef FILE DSL_CPE_File_t; + +/** map timeval structure */ +typedef struct timeval DSL_TimeVal_t; + +/** map the sockaddr_in to own type */ +typedef struct linger DSL_SockOptLinger_t; + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +typedef struct DSL_CPE_EnvList +{ + struct DSL_CPE_EnvList *pNext; + DSL_char_t *pEnvEntry; +} DSL_CPE_EnvList_t; + +#define DSL_CPE_MAX_ENV_VAR_LENGTH (40) + +#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION*/ + +/** + Installs system dependant handlers (e.g. signal handler on linux) +*/ +DSL_void_t DSL_CPE_HandlerInstall(DSL_void_t); + +void DSL_CPE_KeypressSet (void); +void DSL_CPE_KeypressReset (void); + +#ifdef INCLUDE_SCRIPT_NOTIFICATION +/** + Set environment variable +*/ +DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue); + +/** + Clear all environment variables +*/ +DSL_void_t DSL_CPE_EnvVarFree(DSL_void_t); + +/** + Execute a shell command +*/ +DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand); +#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION*/ + +DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal); + +DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal); + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t); +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +/** + Print to a file, pipe, stdout, stderr or memory file. +*/ +DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))) +#endif + ; + +/* + ***************** IFXOS dependent definitions ************************** +*/ + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT + +#ifndef __BIG_ENDIAN + #define __BIG_ENDIAN 1 + #define __LITTLE_ENDIAN 2 +#endif + +#ifndef __BYTE_ORDER + #define __BYTE_ORDER __BIG_ENDIAN +#endif + +/** LINUX User - LOCK, user space semaphore for synchronisation. */ +typedef struct +{ + /** lock id */ + sem_t object; + /** valid flag */ + DSL_boolean_t bValid; +} DSL_CPE_Lock_t; + +#define DSL_LOCK_INIT_VALID(P_LOCK_ID)\ + (((P_LOCK_ID)) ? (((P_LOCK_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE) + + +/** map the fd_set to own type */ +typedef fd_set DSL_CPE_fd_set_t; + +typedef int DSL_Socket_t; +/** map the sockaddr_in to own type */ +typedef struct sockaddr_in DSL_sockaddr_in_t; + +/** map the sockaddr to own type */ +typedef struct sockaddr DSL_sockaddr_t; + +/** map the socklen_t to own type */ +typedef socklen_t DSL_socklen_t; + +/** map stat structure */ +typedef struct stat DSL_CPE_stat_t; + +/** map to stderr */ +#define DSL_CPE_STDERR stderr + +/** map to stdout */ +#define DSL_CPE_STDOUT stdout + +/** map to stdin */ +#define DSL_CPE_STDIN stdin + +#define DSL_CPE_snprintf snprintf + +/* stdio.h mapping */ +#define DSL_CPE_FdOpen fdopen + +#define DSL_CPE_INADDR_ANY INADDR_ANY + +#define DSL_CPE_SocketClose close +#define DSL_CPE_SocketRecv(s,buf,sz) recv(s,buf,sz,0) +#define DSL_CPE_SocketSend(s,buf,sz) send(s,buf,sz,MSG_DONTWAIT) + +/** + LINUX User Thread - map the Thread ID. +*/ +typedef int DSL_CPE_Thread_t; + +/** + LINUX User Thread - function type LINUX User Thread Start Routine. +*/ +typedef void *(*DSL_USER_THREAD_StartRoutine)(void*); + +#define DSL_CPE_THREAD_NAME_LEN 16 +#define DSL_THREAD_DOWN_WAIT_POLL_MS 10 +#define DSL_THREAD_DELETE_WAIT_FOREVER 0xFFFFFFFF + +typedef struct +{ + /** user argument 1 */ + DSL_uint32_t nArg1; + /** user argument 2 */ + DSL_uint32_t nArg2; + /** name of the thread/task */ + DSL_char_t pName[DSL_CPE_THREAD_NAME_LEN]; + + /** control - signal the run state */ + volatile DSL_boolean_t bRunning; + /** control - set to shutdown the thread */ + volatile DSL_boolean_t bShutDown; +} DSL_CPE_Thread_Params_t; + +typedef DSL_int_t (*DSL_CPE_ThreadFunction_t)(DSL_CPE_Thread_Params_t *); + +/** + LINUX User Thread - Control struct for thread handling. +*/ +typedef struct +{ + /* Contains the user and thread control parameters */ + DSL_CPE_Thread_Params_t thrParams; + + /* Points to the thread start routine */ + DSL_CPE_ThreadFunction_t pThrFct; + + /** LINUX User specific for internal - keep the task thread ID */ + DSL_CPE_Thread_t tid; + + /** requested kernel thread priority */ + DSL_int32_t nPriority; + + /** flag indicates that the structure is initialized */ + DSL_boolean_t bValid; + +} DSL_CPE_ThreadCtrl_t; + +DSL_int32_t DSL_CPE_ThreadInit( DSL_CPE_ThreadCtrl_t *pThrCntrl, + DSL_char_t *pName, + DSL_CPE_ThreadFunction_t pThreadFunction, + DSL_uint32_t nStackSize, + DSL_uint32_t nPriority, + DSL_uint32_t nArg1, + DSL_uint32_t nArg2); + +DSL_int32_t DSL_CPE_ThreadShutdown( DSL_CPE_ThreadCtrl_t *pThrCntrl, + DSL_uint32_t waitTime_ms); + +DSL_CPE_Thread_t DSL_CPE_ThreadIdGet(void); + +#define DSL_THREAD_INIT_VALID(P_THREAD_ID) (((P_THREAD_ID)) ? (((P_THREAD_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE) + +/** + Open a device +*/ +DSL_int_t DSL_CPE_Open(const DSL_char_t *pName); + +/** + Close a device +*/ +DSL_int_t DSL_CPE_Close(const DSL_int_t fd); + +/** + Write to a device +*/ +DSL_int_t DSL_CPE_Write(const DSL_int_t fd, const DSL_void_t *pData, const DSL_uint32_t nSize); + +/** + Read from a device +*/ +DSL_int_t DSL_CPE_Read(const DSL_int_t fd, DSL_void_t *pData, const DSL_uint32_t nSize); + +/** + Control a device +*/ +DSL_int_t DSL_CPE_Ioctl(const DSL_int_t fd, const DSL_uint32_t cmd, DSL_int_t param); + +/** + Wait for a device wake up +*/ +DSL_int_t DSL_CPE_Select(const DSL_int_t max_fd, + const DSL_CPE_fd_set_t *read_fd_in, + DSL_CPE_fd_set_t *read_fd_out, + const DSL_uint32_t timeout_msec); + +/** + Fill a descriptor set with zeros. +*/ +DSL_void_t DSL_CPE_FD_ZERO(DSL_CPE_fd_set_t *set); + +/** + Mark a descriptor in use. +*/ +DSL_void_t DSL_CPE_FD_SET(DSL_int_t fd, DSL_CPE_fd_set_t *set); + +/** + Clear a descriptor in use flag. +*/ +DSL_void_t DSL_CPE_FD_CLR(DSL_int_t fd, DSL_CPE_fd_set_t *set); + +/** + Check if a descriptor is set. +*/ +DSL_int_t DSL_CPE_FD_ISSET(DSL_int_t fd, const DSL_CPE_fd_set_t *set); + +/** + Get a byte from stdin . +*/ +DSL_int_t DSL_CPE_GetChar(DSL_void_t); + +/** + Write a byte stdout . +*/ +DSL_int_t DSL_CPE_PutChar(DSL_char_t c, DSL_CPE_File_t *stream); + +/** + Create a pipe. + + \param + pName - pipe name + \return + - DSL_SUCCESS on success + - DSL_ERROR on failure + */ +DSL_Error_t DSL_CPE_PipeCreate(DSL_char_t *pName); + +/** + Open a pipe. + + \param + pName - pipe name + \return + - pointer to FILE structure + - in case of error the return value is NULL + */ +DSL_CPE_File_t *DSL_CPE_PipeOpen(DSL_char_t *pName, DSL_boolean_t reading, DSL_boolean_t blocking); + +/** + Close a pipe. + + \param + pipe - pipe stream + \return + - (0) on success + - (-1) on failure +*/ +DSL_Error_t DSL_CPE_PipeClose(DSL_CPE_File_t *file); + +/** + Initialize a semaphore. + + \param lock semaphore identifier + + \return + 0 on success. +*/ +DSL_int32_t DSL_CPE_LockCreate(DSL_CPE_Lock_t *lock); + +/** + Delete a semaphore. + + \param lock semaphore identifier + + \return + - DSL_SUCCESS on success + - DSL_ERROR on failure + */ +DSL_int32_t DSL_CPE_LockDelete(DSL_CPE_Lock_t *lock); + +/** + Gets a semaphore. + + \param lock semaphore identifier + + \return + - (0) on success + - (-1) on failure +*/ +DSL_int32_t DSL_CPE_LockGet(DSL_CPE_Lock_t *lock); + +/** + Get the Lock with timeout. + +\param + lockId Provides the pointer to the Lock Object. + +\param + timeout_ms Timeout value [ms] + - 0: no wait + - -1: wait forever + - any other value: waiting for specified amount of milliseconds +\param + pRetCode Points to the return code variable. [O] + - If the pointer is NULL the return code will be ignored, else + the corresponding return code will be set + - For timeout the return code is set to 1. + +\return + DSL_SUCCESS on success. + DSL_ERROR on error or timeout. + +\note + To detect timeouts provide the return code varibale, in case of timeout + the return code is set to 1. +*/ +DSL_int32_t DSL_CPE_LockTimedGet( + DSL_CPE_Lock_t *lockId, + DSL_uint32_t timeout_ms, + DSL_int32_t *pRetCode); + + +/** + Return the semaphore + + \param lock semaphore identifier + + \return + - (0) on success + - (-1) on failure + */ +DSL_int32_t DSL_CPE_LockSet(DSL_CPE_Lock_t *lock); + +/** + Sleep specified number of seconds. + + \param nSeconds Number of seconds to sleep +*/ +DSL_void_t DSL_CPE_Sleep(DSL_uint32_t nSeconds); + +/** + Sleep specified number of milliseconds. + + \param nMs Number of milliseconds to sleep +*/ +DSL_void_t DSL_CPE_MSecSleep(DSL_uint32_t nMs); + +/** + Allocates a memory block + + \param size Bytes to allocate + + \return + returns a DSL_void_t pointer to the allocated space, NULL if there's not + sufficient memory space available. +*/ +DSL_void_t *DSL_CPE_Malloc(DSL_uint32_t size); + +/** + Deallocates a memory block + + \param memblock Previously allocated memory block that should be freed + +*/ +void DSL_CPE_Free(DSL_void_t *memblock); + + +/** + Open a file. +*/ +DSL_CPE_File_t *DSL_CPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode); + +/** + Close the file or memory file. +*/ +DSL_int_t DSL_CPE_FClose(DSL_CPE_File_t *fd); + +/** + Flush a file or pipe. +*/ +DSL_int_t DSL_CPE_FFlush(DSL_CPE_File_t *fd); + +/** + Read from file, stdin . +*/ +DSL_int_t DSL_CPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream); + +/** + Write to a file, pipe, stdout. +*/ +DSL_int_t DSL_CPE_FWrite(const DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream); + +/** + End of file test of a file. +*/ +DSL_int_t DSL_CPE_Feof(DSL_CPE_File_t *stream); + +/** + Read a string from the file. +*/ +DSL_char_t *DSL_CPE_FGets(DSL_char_t *str, DSL_int_t n, DSL_CPE_File_t *stream); + +/** + get file status +*/ +DSL_int_t DSL_CPE_FStat(DSL_char_t *str, DSL_CPE_stat_t *st); + +DSL_Socket_t DSL_CPE_Accept(DSL_Socket_t socFd, DSL_sockaddr_in_t *pSocAddr); + +DSL_int_t DSL_CPE_Socket(DSL_int_t socType, DSL_Socket_t *pSocketFd); + +DSL_int_t DSL_CPE_SocketBind( + DSL_Socket_t socFd, + DSL_sockaddr_in_t *pSocAddr); + +void DSL_CPE_EchoOff (void); +void DSL_CPE_EchoOn (void); +#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +#endif /* LINUX */ diff --git a/src/dsl_cpe_os.h b/src/dsl_cpe_os.h new file mode 100644 index 0000000..da5c31c --- /dev/null +++ b/src/dsl_cpe_os.h @@ -0,0 +1,277 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef DSL_CPE_API_OS_H +#define DSL_CPE_API_OS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/** \file + Operating System depending files, definitions and functions +*/ +#include "drv_dsl_cpe_api_types.h" +#include "drv_dsl_cpe_api.h" + +#if defined(INCLUDE_DSL_CPE_IFXOS_SUPPORT) || defined(VXWORKS) + /* support other OS only through lib_ifxos */ + #ifndef USE_LIB_IFXOS + #define USE_LIB_IFXOS 1 + #endif +#endif /** INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +#ifndef _lint +#ifdef LINUX +#include "dsl_cpe_linux.h" +#elif defined(WIN32) +#include "dsl_cpe_win32.h" +#elif defined(VXWORKS) +#include "dsl_cpe_vxworks.h" +#elif defined(ECOS) +#include "dsl_cpe_ecos.h" +#elif defined(RTEMS) +#include "dsl_cpe_rtems.h" +#elif defined(GENERIC_OS) +#include "dsl_cpe_generic_os.h" +#else +#error please define your OS for the CPE Control adaptation +#endif +#else +#include "dsl_cpe_os_lint_map.h" +#endif /* _lint*/ + +#ifndef __BIG_ENDIAN + #error please define the __BIG_ENDIAN macro +#endif + +#ifndef __BYTE_ORDER + #error please specify the endianess of your target system +#endif + +/** + System definitions +*/ + +#ifndef DSL_CPE_PRIORITY +#define DSL_CPE_PRIORITY (0) +#endif + +#ifndef DSL_CPE_STACKSIZE +#define DSL_CPE_STACKSIZE (2048) +#endif + +#ifndef DSL_CPE_EVENT_STACKSIZE +#define DSL_CPE_EVENT_STACKSIZE (8192) +#endif + +/** Default stack size */ +#ifndef DSL_CPE_DEFAULT_STACK_SIZE +#define DSL_CPE_DEFAULT_STACK_SIZE (4096) +#endif + +/** Control task stack size */ +#ifndef DSL_CPE_CONTROL_STACK_SIZE +#define DSL_CPE_CONTROL_STACK_SIZE (4096) +#endif + +/** Pipe task stack size */ +#ifndef DSL_CPE_PIPE_STACK_SIZE +#define DSL_CPE_PIPE_STACK_SIZE (8192) +#endif + +/** Pipe task priority */ +#ifndef DSL_CPE_PIPE_PRIORITY +#define DSL_CPE_PIPE_PRIORITY (0) +#endif + +#ifndef DSL_CPE_TCP_MSG_STACKSIZE +#define DSL_CPE_TCP_MSG_STACKSIZE (8192) +#endif + +#ifndef DSL_CPE_TCP_MSG_PRIORITY +#define DSL_CPE_TCP_MSG_PRIORITY (0) +#endif + +/** + Carriage Return + Line Feed, maybe overwritten by compile switches + or OS-specific adaptation */ +#ifndef DSL_CPE_CRLF +#define DSL_CPE_CRLF "\n\r" +#endif + +int DSL_CPE_debug_printf(DSL_char_t *fmt, ...) +#if __GNUC__ >= 3 +__attribute__ ((__format__ (__printf__, 1, 2))) +#endif +; + +#if defined(USE_LIB_IFXOS) && (USE_LIB_IFXOS == 1) + +/* + common defines - ifxos_common.h" +*/ + +#define DSL_BYTE_ORDER IFXOS_BYTE_ORDER +#define DSL_LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN +#define DSL_BIG_ENDIAN IFXOS_BIG_ENDIAN + +#ifndef __BIG_ENDIAN + #define __BIG_ENDIAN IFXOS_BIG_ENDIAN + #define __LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN + #define __BYTE_ORDER IFXOS_BYTE_ORDER +#endif + +#ifndef __BYTE_ORDER + #define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +/* + Function map - stdio, string +*/ +#define DSL_CPE_GetChar IFXOS_GetChar +#define DSL_CPE_PutChar IFXOS_PutChar + +#define DSL_CPE_FGets IFXOS_FGets +/*#define DSL_CPE_FPrintf IFXOS_FPrintf*/ +#define DSL_CPE_snprintf IFXOS_SNPrintf +#define DSL_vsnprintf IFXOS_VSNPrintf + +/* + Function map - Memory Functions. +*/ + +#if ( defined(IFXOS_HAVE_MEM_ALLOC) && (IFXOS_HAVE_MEM_ALLOC == 1) ) +#define DSL_CPE_Malloc IFXOS_MemAlloc +#define DSL_CPE_Free IFXOS_MemFree +#endif + +/* + Function map - Device handling (open, close ...). +*/ + +#define DSL_CPE_fd_set_t IFXOS_devFd_set_t +#define DSL_CPE_FD_SET IFXOS_DevFdSet +#define DSL_CPE_FD_ISSET IFXOS_DevFdIsSet +#define DSL_CPE_FD_ZERO IFXOS_DevFdZero +#define DSL_CPE_FD_CLR FD_CLR /*KAv: no IFX OS support!*/ + + +#if ( defined(IFXOS_HAVE_DEVICE_ACCESS) && (IFXOS_HAVE_DEVICE_ACCESS == 1) ) +#define DSL_CPE_Open IFXOS_DeviceOpen +#define DSL_CPE_Close IFXOS_DeviceClose +#define DSL_CPE_Read IFXOS_DeviceRead +#define DSL_CPE_Write IFXOS_DeviceWrite +#define DSL_CPE_Ioctl IFXOS_DeviceControl +#define DSL_CPE_Select IFXOS_DeviceSelect +#endif + +/* + function types - "ifxos_file_access.h" +*/ + +#if ( defined(IFXOS_HAVE_FILE_ACCESS) && (IFXOS_HAVE_FILE_ACCESS == 1) ) +#define DSL_CPE_STDERR IFXOS_STDERR +#define DSL_CPE_STDOUT IFXOS_STDOUT +#define DSL_CPE_STDIN IFXOS_STDIN +#define DSL_CPE_stat_t IFXOS_stat_t + +#define DSL_CPE_FdOpen fdopen +#define DSL_CPE_FOpen IFXOS_FOpen +#define DSL_CPE_FClose IFXOS_FClose +#define DSL_CPE_FRead IFXOS_FRead +#define DSL_CPE_FWrite IFXOS_FWrite +#define DSL_CPE_FFlush IFXOS_FFlush +#define DSL_CPE_Feof IFXOS_FEof +#define DSL_CPE_FStat IFXOS_Stat +#define DSL_CPE_FMemOpen IFXOS_FMemOpen + +#endif + +/* + Function map - Time and Wait Functions and Defines. +*/ +#define DSL_CPE_Sleep IFXOS_SecSleep +#define DSL_CPE_MSecSleep IFXOS_MSecSleep + +/* + Function map - Lock functions and defines. +*/ + +#define DSL_CPE_Lock_t IFXOS_lock_t + +#define DSL_LOCK_INIT_VALID IFXOS_LOCK_INIT_VALID +#define DSL_CPE_LockCreate IFXOS_LockInit +#define DSL_CPE_LockDelete IFXOS_LockDelete +#define DSL_CPE_LockSet IFXOS_LockRelease +#define DSL_CPE_LockTimedGet IFXOS_LockTimedGet +#define DSL_CPE_LockGet IFXOS_LockGet + +/* + Function map - Lock functions and defines. +*/ + +#define DSL_CPE_Thread_t IFXOS_thread_t +#define DSL_CPE_ThreadFunction_t IFXOS_ThreadFunction_t +#define DSL_CPE_ThreadCtrl_t IFXOS_ThreadCtrl_t +#define DSL_CPE_Thread_Params_t IFXOS_ThreadParams_t + +#define DSL_CPE_ThreadInit IFXOS_ThreadInit +#define DSL_CPE_ThreadDelete IFXOS_ThreadDelete +#define DSL_CPE_ThreadShutdown IFXOS_ThreadShutdown +#define DSL_CPE_ThreadIdGet IFXOS_ThreadIdGet + +/* + Function map - Pipe functions and defines. +*/ + +#define DSL_CPE_Pipe_t IFXOS_Pipe_t + +#define DSL_CPE_PipeCreate IFXOS_PipeCreate +#define DSL_CPE_PipeOpen IFXOS_PipeOpen +#define DSL_CPE_PipeClose IFXOS_PipeClose + +/* + Function map - Terminal functions and defines. +*/ + +#define DSL_CPE_EchoOff IFXOS_EchoOff +#define DSL_CPE_EchoOn IFXOS_EchoOn + +/* + function types - "ifxos_socket.h" +*/ +#define DSL_CPE_INADDR_ANY IFXOS_SOC_INADDR_ANY +#define DSL_CPE_ADDR_LEN IFXOS_SOC_ADDR_LEN_BYTE + +#define DSL_sockaddr_in_t IFXOS_sockAddr_t +#define DSL_sockaddr_t IFXOS_sockAddr_t +#define DSL_Socket_t IFXOS_socket_t + +#define DSL_CPE_Socket IFXOS_SocketCreate +#define DSL_CPE_Accept IFXOS_SocketAccept +#define DSL_CPE_SocketBind IFXOS_SocketBind +#define DSL_CPE_SocketClose IFXOS_SocketClose +#define DSL_CPE_SocketRecv IFXOS_SocketRecv +#define DSL_CPE_SocketSend IFXOS_SocketSend +#define DSL_CPE_AddressToString inet_ntoa /*KAv: no IFX OS support!*/ + +#else /* (USE_LIB_IFXOS == 1) */ + +/* use the built in OS abstraction layer */ +/* this is obsolete, in mid term it will be removed from source tree */ + +#endif /* (USE_LIB_IFXOS == 1) */ + +#ifdef __cplusplus +} +#endif + +#endif /* DSL_CPE_API_OS_H */ diff --git a/src/dsl_cpe_os_lint_map.h b/src/dsl_cpe_os_lint_map.h new file mode 100644 index 0000000..d29dac2 --- /dev/null +++ b/src/dsl_cpe_os_lint_map.h @@ -0,0 +1,628 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef DSL_CPE_API_OS_LINT_MAP_H +#define DSL_CPE_API_OS_LINT_MAP_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "drv_dsl_cpe_api_types.h" + +#define DSL_LOCK_INIT_VALID(P_LOCK_ID)\ + (((P_LOCK_ID)) ? (((P_LOCK_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE) + +#define NULL ((void *)0) + +#define ULONG_MAX (0xFFFFFFFF) + +#define _IOW(a,b,c) (b) +#define _IOR(a,b,c) (b) +#define _IOWR(a, b, c) (b) +#define _IO(a,b) (b) +#define _IOC_TYPE(x) (((x)>>8) & 0xFF) + +#define SIGINT (0x0) +#define SIG_IGN NULL + +#define FD_SETSIZE (1024) +#define DSL_FD_SETSIZE FD_SETSIZE +#define AF_INET (0) +#define DSL_CPE_INADDR_ANY (0) +#define SOCK_STREAM (0) +#define SOL_SOCKET (0) +#define SO_REUSEADDR (0) +#define SO_KEEPALIVE (0) +#define SO_DEBUG (0) +#define SO_LINGER (0) +#define SO_SNDTIMEO (0) +#define SO_RCVTIMEO (0) +#define MSG_DONTWAIT (1) + +#define O_RDONLY (0) +#define O_RDWR (1) +#define SEEK_SET (0) + +#define ENODATA (1) +#define EFAULT (2) +#define ETIMEDOUT (3) +#define ENOENT (4) + +extern unsigned short errno; + +extern char *optarg; + +typedef int sem_t; +typedef int time_t; +typedef int off_t; +typedef unsigned long size_t; + +/** LINUX User - LOCK, user space semaphore for synchronisation. */ +typedef struct +{ + /** lock id */ + sem_t object; + /** valid flag */ + DSL_boolean_t bValid; +} DSL_CPE_Lock_t; + +typedef struct +{ + int l_onoff; + int l_linger; +} DSL_SockOptLinger_t; + +struct timeval +{ + unsigned int tv_sec; /* seconds */ + unsigned int tv_usec; /* microseconds */ +}; + +struct in_addr { + unsigned long s_addr; +}; + +struct sockaddr_in{ + short sin_family; + unsigned short sin_port; + struct in_addr sin_addr; + char sin_zero[8]; +}; + +struct sockaddr { + unsigned short sa_family; + char sa_data[14]; +}; + +struct stat { + unsigned st_dev; + long st_pad1[3]; /* Reserved for network id */ + unsigned st_rdev; + unsigned st_size; + long st_pad2[2]; + long st_pad3; + /* + * Actually this should be timestruc_t st_atime, st_mtime and st_ctime + * but we don't have it under Linux. + */ + time_t st_atime; + long st_atime_nsec; + time_t st_mtime; + long st_mtime_nsec; + time_t st_ctime; + long st_ctime_nsec; + long st_blksize; + long st_blocks; + long st_pad4[14]; +}; + +#define NCC 8 +struct termios { + unsigned short c_iflag; /* input mode flags */ + unsigned short c_oflag; /* output mode flags */ + unsigned short c_cflag; /* control mode flags */ + unsigned short c_lflag; /* local mode flags */ + char c_line; /* line discipline */ + unsigned char c_cc[NCC]; /* control characters */ +}; + +struct option +{ + const char *name; + int has_arg; + int *flag; + int val; +}; + +/** map the fd_set to own type */ +typedef int DSL_CPE_fd_set_t; + +typedef int DSL_Socket_t; + +/** map the sockaddr_in to own type */ +typedef struct sockaddr_in DSL_sockaddr_in_t; + +/** map the sockaddr to own type */ +typedef struct sockaddr DSL_sockaddr_t; + +/** map the socklen_t to own type */ +typedef int DSL_socklen_t; + +/** map FILE to own type */ +typedef int DSL_CPE_File_t; + +/** map stat structure */ +typedef struct stat DSL_CPE_stat_t; + +typedef struct timeval DSL_TimeVal_t; + +/** + LINUX User Thread - map the Thread ID. +*/ +typedef int DSL_CPE_Thread_t; + +/** + LINUX User Thread - function type LINUX User Thread Start Routine. +*/ +typedef void *(*DSL_USER_THREAD_StartRoutine)(void*); + +#define DSL_CPE_THREAD_NAME_LEN 16 +#define DSL_THREAD_DOWN_WAIT_POLL_MS 10 +#define DSL_THREAD_DELETE_WAIT_FOREVER 0xFFFFFFFF + +typedef struct +{ + /** user argument 1 */ + DSL_uint32_t nArg1; + /** user argument 2 */ + DSL_uint32_t nArg2; + /** name of the thread/task */ + DSL_char_t pName[DSL_CPE_THREAD_NAME_LEN]; + + /** control - signal the run state */ + volatile DSL_boolean_t bRunning; + /** control - set to shutdown the thread */ + volatile DSL_boolean_t bShutDown; +} DSL_CPE_Thread_Params_t; + +typedef DSL_int_t (*DSL_CPE_ThreadFunction_t)(DSL_CPE_Thread_Params_t *); + +/** + LINUX User Thread - Control struct for thread handling. +*/ +typedef struct +{ + /* Contains the user and thread control parameters */ + DSL_CPE_Thread_Params_t thrParams; + + /* Points to the thread start routine */ + DSL_CPE_ThreadFunction_t pThrFct; + + /** LINUX User specific for internal - keep the task thread ID */ + DSL_CPE_Thread_t tid; + + /** requested kernel thread priority */ + DSL_int32_t nPriority; + + /** flag indicates that the structure is initialized */ + DSL_boolean_t bValid; + +} DSL_CPE_ThreadCtrl_t; + + +/** map to stderr */ +#define DSL_CPE_STDERR ((DSL_CPE_File_t*)0) + +/** map to stdout */ +#define DSL_CPE_STDOUT ((DSL_CPE_File_t*)1) + +/** map to stdin */ +#define DSL_CPE_STDIN ((DSL_CPE_File_t*)2) + +DSL_int32_t DSL_CPE_ThreadInit( DSL_CPE_ThreadCtrl_t *pThrCntrl, + DSL_char_t *pName, + DSL_CPE_ThreadFunction_t pThreadFunction, + DSL_uint32_t nStackSize, + DSL_uint32_t nPriority, + DSL_uint32_t nArg1, + DSL_uint32_t nArg2); + +DSL_int32_t DSL_CPE_ThreadShutdown( DSL_CPE_ThreadCtrl_t *pThrCntrl, + DSL_uint32_t waitTime_ms); + +DSL_CPE_Thread_t DSL_CPE_ThreadIdGet(void); + +#define DSL_THREAD_INIT_VALID(P_THREAD_ID) (((P_THREAD_ID)) ? (((P_THREAD_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE) + +int FD_ISSET(int fd, const int *set); + +int lstat(char*, struct stat* ); + +int open(char* , int ); + +unsigned short ntohs(unsigned short); + +unsigned short htons(unsigned short); + +int ioctl(const int , const unsigned, int ); + +int close(int); + +int recv(int, char*, int, int); + +int send(int , const char *, int , int ); + +int listen(int, int); + +int setsockopt(int, int, int, const void*, unsigned int); + +int inet_aton(const char*, struct in_addr *); + +char *inet_ntoa(struct in_addr); + +int getopt_long(int, char* const*, const char*, const struct option*, int*); + +int feof(DSL_CPE_File_t* stream ); + +int ferror(DSL_CPE_File_t* stream ); + +int fprintf(DSL_CPE_File_t* stream, const char* format, ...); + +char *strpbrk( const char *string, const char *strCharSet ); + +void lseek(int , int , int ); + +int strtol( const char *nptr, char **endptr, int base ); +int strtoul( const char *nptr, char **endptr, int base ); + +void *malloc(unsigned int size); + +void *memset(void* dest, int c, size_t count); + +void *memcpy(void* dest, const void* src, unsigned int count ); + +int isspace(int c); + +int isprint(int c); + +int read(int , void*, unsigned int); +int write(int , const void* , unsigned int ); + +void FD_ZERO(DSL_CPE_fd_set_t*); + +void free(void* memblock); + +int sscanf( const char *buffer, const char *format , ... ); + +int printf(const char* format, ...); + +int signal (int , void*); + +char *strstr( const char *string, const char *strCharSet ); + +int sprintf( char *buffer, const char *format ,... ); + +char *strncpy( char *strDest, const char *strSource, size_t count ); + +char *strtok( char *strToken, const char *strDelimit ); + +char *strtok_r(char*, const char*, char**); + +size_t strlen( const char *string ); + +int strcmp( const char *string1, const char *string2 ); + +char *strcpy( char *strDestination, const char *strSource ); + +int DSL_CPE_snprintf(char *buffer, size_t count, const char *format , ... ); + +/** + Open a device +*/ +DSL_int_t DSL_CPE_Open(const DSL_char_t *pName); + +/** + Close a device +*/ +DSL_int_t DSL_CPE_Close(const DSL_int_t fd); + +/** + Write to a device +*/ +DSL_int_t DSL_CPE_Write(const DSL_int_t fd, const DSL_void_t *pData, const DSL_uint32_t nSize); + +/** + Read from a device +*/ +DSL_int_t DSL_CPE_Read(const DSL_int_t fd, DSL_void_t *pData, const DSL_uint32_t nSize); + +/** + Control a device +*/ +DSL_int_t DSL_CPE_Ioctl(const DSL_int_t fd, const DSL_uint32_t cmd, DSL_int_t param); + +/** + Wait for a device wake up +*/ +DSL_int_t DSL_CPE_Select(const DSL_int_t max_fd, + const DSL_CPE_fd_set_t *read_fd_in, + DSL_CPE_fd_set_t *read_fd_out, + const DSL_uint32_t timeout_msec); + +/** + Fill a descriptor set with zeros. +*/ +DSL_void_t DSL_CPE_FD_ZERO(DSL_CPE_fd_set_t *set); + +/** + Mark a descriptor in use. +*/ +DSL_void_t DSL_CPE_FD_SET(DSL_int_t fd, DSL_CPE_fd_set_t *set); + +/** + Clear a descriptor in use flag. +*/ +DSL_void_t DSL_CPE_FD_CLR(DSL_int_t fd, DSL_CPE_fd_set_t *set); + +/** + Check if a descriptor is set. +*/ +DSL_int_t DSL_CPE_FD_ISSET(DSL_int_t fd, const DSL_CPE_fd_set_t *set); + +/** + Get a byte from stdin . +*/ +DSL_int_t DSL_CPE_GetChar(DSL_void_t); + +/** + Write a byte stdout . +*/ +DSL_int_t DSL_CPE_PutChar(DSL_char_t c, DSL_CPE_File_t *stream); + +/** + Create a pipe. + + \param + pName - pipe name + \return + - DSL_SUCCESS on success + - DSL_ERROR on failure + */ +DSL_Error_t DSL_CPE_PipeCreate(DSL_char_t *pName); + +/** + Open a pipe. + + \param + pName - pipe name + \return + - pointer to FILE structure + - in case of error the return value is NULL + */ +DSL_CPE_File_t *DSL_CPE_PipeOpen(DSL_char_t *pName, DSL_boolean_t reading, DSL_boolean_t blocking); + +/** + Close a pipe. + + \param + pipe - pipe stream + \return + - (0) on success + - (-1) on failure +*/ +DSL_Error_t DSL_CPE_PipeClose(DSL_CPE_File_t *file); + +/** + Initialize a semaphore. + + \param lock semaphore identifier + + \return + 0 on success. +*/ +DSL_int32_t DSL_CPE_LockCreate(DSL_CPE_Lock_t *lock); + +/** + Delete a semaphore. + + \param lock semaphore identifier + + \return + - DSL_SUCCESS on success + - DSL_ERROR on failure + */ +DSL_int32_t DSL_CPE_LockDelete(DSL_CPE_Lock_t *lock); + +/** + Gets a semaphore. + + \param lock semaphore identifier + + \return + - (0) on success + - (-1) on failure +*/ +DSL_int32_t DSL_CPE_LockGet(DSL_CPE_Lock_t *lock); + +/** + Get the Lock with timeout. + +\param + lockId Provides the pointer to the Lock Object. + +\param + timeout_ms Timeout value [ms] + - 0: no wait + - -1: wait forever + - any other value: waiting for specified amount of milliseconds +\param + pRetCode Points to the return code variable. [O] + - If the pointer is NULL the return code will be ignored, else + the corresponding return code will be set + - For timeout the return code is set to 1. + +\return + DSL_SUCCESS on success. + DSL_ERROR on error or timeout. + +\note + To detect timeouts provide the return code varibale, in case of timeout + the return code is set to 1. +*/ +DSL_int32_t DSL_CPE_LockTimedGet( + DSL_CPE_Lock_t *lockId, + DSL_uint32_t timeout_ms, + DSL_int32_t *pRetCode); + + +/** + Return the semaphore + + \param lock semaphore identifier + + \return + - (0) on success + - (-1) on failure + */ +DSL_int32_t DSL_CPE_LockSet(DSL_CPE_Lock_t *lock); + +/** + Sleep specified number of seconds. + + \param nSeconds Number of seconds to sleep +*/ +DSL_void_t DSL_CPE_Sleep(DSL_uint32_t nSeconds); + +/** + Sleep specified number of milliseconds. + + \param nMs Number of milliseconds to sleep +*/ +DSL_void_t DSL_CPE_MSecSleep(DSL_uint32_t nMs); + +/** + Allocates a memory block + + \param size Bytes to allocate + + \return + returns a DSL_void_t pointer to the allocated space, NULL if there's not + sufficient memory space available. +*/ +DSL_void_t *DSL_CPE_Malloc(DSL_uint32_t size); + +/** + Deallocates a memory block + + \param memblock Previously allocated memory block that should be freed + +*/ +void DSL_CPE_Free(DSL_void_t *memblock); + +/** + Print to a file, pipe, stdout, stderr or memory file. +*/ +DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...); + +/** + Open a file. +*/ +DSL_CPE_File_t *DSL_CPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode); + +/** + Close the file or memory file. +*/ +DSL_int_t DSL_CPE_FClose(DSL_CPE_File_t *fd); + +/** + Flush a file or pipe. +*/ +DSL_int_t DSL_CPE_FFlush(DSL_CPE_File_t *fd); + +/** + Read from file, stdin . +*/ +DSL_int_t DSL_CPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream); + +/** + Write to a file, pipe, stdout. +*/ +DSL_int_t DSL_CPE_FWrite(const DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream); + +/** + End of file test of a file. +*/ +DSL_int_t DSL_CPE_Feof(DSL_CPE_File_t *stream); + +/** + Read a string from the file. +*/ +DSL_char_t *DSL_CPE_FGets(DSL_char_t *str, DSL_int_t n, DSL_CPE_File_t *stream); + +/** + get file status +*/ +DSL_int_t DSL_CPE_FStat(DSL_char_t *str, DSL_CPE_stat_t *st); + +DSL_Socket_t DSL_CPE_Accept(DSL_Socket_t socFd, DSL_sockaddr_in_t *pSocAddr); + +DSL_int_t DSL_CPE_Socket(DSL_int_t socType, DSL_Socket_t *pSocketFd); + +DSL_int_t DSL_CPE_SocketBind( + DSL_Socket_t socFd, + DSL_sockaddr_in_t *pSocAddr); + +void DSL_CPE_EchoOff (void); +void DSL_CPE_EchoOn (void); + +/** + Installs system dependant handlers (e.g. signal handler on linux) +*/ +DSL_void_t DSL_CPE_HandlerInstall(DSL_void_t); + +void DSL_CPE_KeypressSet (void); +void DSL_CPE_KeypressReset (void); + +/** + Set environment variable +*/ +DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue); + +/** + Execute a shell command +*/ +DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand); + +DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal); + +DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal); + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t); +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr)) +#define DSL_CPE_AddressToString inet_ntoa + +#define DSL_CPE_SocketClose close +#define DSL_CPE_SocketRecv(s,buf,sz) recv(s,buf,sz,0) +#define DSL_CPE_SocketSend(s,buf,sz) send(s,buf,sz,MSG_DONTWAIT) + +DSL_CPE_File_t *DSL_CPE_FdOpen(int , char*); + +/* sys/socket.h mapping */ +#define DSL_CPE_SockOptSet setsockopt + +#ifdef __cplusplus +} +#endif + +#endif /* DSL_CPE_API_OS_LINT_MAP_H */ diff --git a/src/dsl_cpe_rtems.c b/src/dsl_cpe_rtems.c new file mode 100644 index 0000000..0df037b --- /dev/null +++ b/src/dsl_cpe_rtems.c @@ -0,0 +1,68 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef RTEMS + +#include "dsl_cpe_rtems.h" +#include "dsl_cpe_control.h" +#include "dsl_cpe_os.h" +#include "dsl_cpe_simulator.h" + +/** \file + Operating System access implementation +*/ + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +int DSL_CPE_debug_printf(DSL_char_t *fmt, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nLength = 0, nRet = 0; + DSL_boolean_t bPrint = DSL_FALSE; + DSL_char_t msg[DSL_DBG_MAX_DEBUG_PRINT_CHAR + 1] = "\0"; + + va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */ + + if (bPrint == DSL_FALSE) + { + nRet = vsprintf(msg, fmt, ap); + + if (nRet < 0) + { + nLength = DSL_DBG_MAX_DEBUG_PRINT_CHAR; + printf("DSL CPE API: WARNING - printout truncated in 'DSL_CPE_debug_printf'!" DSL_DRV_CRLF ); + } + else + { + nLength = nRet; + } + + nRet = printf(msg); + } + + va_end(ap); + + return nRet; +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_Ioctl(const DSL_int_t fd, const DSL_uint32_t cmd, DSL_int_t param) +{ + return DSL_DRV_Ioctls(0,cmd, param); +} + +#endif /* RTEMS */ + + diff --git a/src/dsl_cpe_rtems.h b/src/dsl_cpe_rtems.h new file mode 100644 index 0000000..05a3d6a --- /dev/null +++ b/src/dsl_cpe_rtems.h @@ -0,0 +1,66 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef RTEMS + +/** \file + OS interface, RTEMS adaptation +*/ + +#include "drv_dsl_cpe_api_types.h" + +#include + +#include +#include +#include +#include "dispatch.h" +#include "print.h" +#include "dbgio.h" +#include "xapi.h" + +#include "ifxos_common.h" +#include "ifxos_debug.h" +#include "ifxos_thread.h" +#include "ifxos_memory_alloc.h" +#include "ifxos_lock.h" +#include "ifxos_select.h" +#include "ifxos_common.h" +#include "ifxos_print_io.h" +#include "ifxos_device_access.h" +#include "ifxos_file_access.h" +#include "ifxos_time.h" +#include "ifxos_thread.h" +#include "ifxos_termios.h" +#include "ifxos_pipe.h" +#include "ifxos_misc.h" +#include "ifxos_socket.h" +#include "ifx_getopt.h" + +#define INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE + +#define PACKAGE_VERSION "" + +#define DSL_CPE_STACKSIZE 2048 + +#define DSL_CPE_PRIORITY 64 +#define DSL_CPE_PIPE_PRIORITY 64 +#define DSL_CPE_TCP_MSG_PRIORITY 64 + +#define DSL_CPE_STRNCASECMP(a,b,c) stricmp(a,b) + +#define DSL_CPE_FD_ZERO IFXOS_DevFdZero + +/** context from DSL_DRV_Open()*/ +extern DSL_OpenContext_t *gv_drv_dsl_pOpenCtx; + +#endif /* RTEMS */ + + diff --git a/src/dsl_cpe_safec_wrapper.h b/src/dsl_cpe_safec_wrapper.h new file mode 100644 index 0000000..f4f1aae --- /dev/null +++ b/src/dsl_cpe_safec_wrapper.h @@ -0,0 +1,30 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef _SAFEC_WRAPPER_H +#define _SAFEC_WRAPPER_H + +#if defined (SAFEC_SUPPORT) && (SAFEC_SUPPORT == 1) +#include "safe_lib.h" +#define cpe_control_memcpy_s(dest, destsz, src, srcsz) memcpy_s(dest, destsz, src, srcsz) +#define cpe_control_strncpy_s(dest, destsz, src, srcsz) strncpy_s(dest, destsz, src, srcsz) +#else +#warning "Safe C library is not available!" + +#include /* size_t */ +static __inline__ size_t safec_wrapper_min(size_t a, size_t b) +{ + return a > b ? b : a; +} + +#define cpe_control_memcpy_s(dest, destsz, src, srcsz) memcpy(dest, src, safec_wrapper_min(destsz,srcsz)) +#define cpe_control_strncpy_s(dest, destsz, src, srcsz) strncpy(dest, src, safec_wrapper_min(destsz,srcsz)) +#endif /* defined (SAFEC_SUPPORT) && (SAFEC_SUPPORT == 1) */ + +#endif /* _SAFEC_WRAPPER_H */ diff --git a/src/dsl_cpe_simulator.c b/src/dsl_cpe_simulator.c new file mode 100644 index 0000000..0033218 --- /dev/null +++ b/src/dsl_cpe_simulator.c @@ -0,0 +1,200 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Simulator +*/ + +#include "dsl_cpe_control.h" + +#include "dsl_cpe_os.h" +#include "dsl_cpe_simulator.h" +#include "drv_dsl_cpe_api.h" +#include "drv_dsl_cpe_api_ioctl.h" +#include "drv_dsl_cpe_debug.h" + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_OS + +#ifdef DSL_CPE_SIMULATOR_CONTROL + +#define DSL_SIM_RX_BUFFER_SIZE 1024 + +/*static DSL_uint32_t device_fd=0;*/ +static DSL_boolean_t g_bFirst = DSL_TRUE; +static DSL_boolean_t g_bVerbose = DSL_TRUE; +static DSL_CPE_Lock_t semData; +static DSL_DBG_ModuleLevelData_t g_nDbgLevelData[DSL_DBG_MAX_ENTRIES]; + +typedef struct +{ + DSL_uint8_t msg_buffer[DSL_SIM_RX_BUFFER_SIZE]; + DSL_uint8_t msg_count; + DSL_uint8_t device_count; +} dsl_line_t; + +dsl_line_t dsl_line; + + +DSL_int_t DSL_CPE_SIM_Open( void *device, const char *appendix ) +{ + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "open simulated" DSL_CPE_CRLF)); + + return (int)device; +} + +DSL_int_t DSL_SIM_Close( void *pprivate ) +{ + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "close simulated" DSL_CPE_CRLF)); + + return 0; +} + +DSL_int_t DSL_SIM_Write(void *pprivate, const char *buf, const int len ) +{ + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "write simulated" DSL_CPE_CRLF )); + + return 0; +} + +DSL_int_t DSL_SIM_Read( void *pprivate, char *buf, const int len ) +{ + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "read simulated %d" DSL_CPE_CRLF)); + + return 0; +} + +DSL_int_t DSL_SIM_Ioctl( void *pprivate, unsigned int cmd, unsigned int arg ) +{ + DSL_int_t nRet = 0; + + dsl_line_t *ctx = (dsl_line_t *)pprivate; + + DSL_CPE_LockTimedGet(&semData, 0xFFFF, DSL_NULL); + + switch(cmd) + { + case DSL_FIO_VERSION_INFORMATION_GET: + if(g_bVerbose) + { + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "ioctl simulated - VersionInformationGet (cmd=0x%08X)" DSL_CPE_CRLF, cmd)); + } + { + DSL_VersionInformation_t *pData = (DSL_VersionInformation_t *)arg; + DSL_char_t verApi[10] = "2.9.9"; + DSL_char_t ver[10] = "0.0.0"; +#if defined (INCLUDE_DSL_CPE_API_DANUBE) + DSL_char_t chip[15] = "Lantiq-Danube"; +#else + DSL_char_t chip[15] = "Lantiq-Unknown"; +#endif + + memset(&(pData->data), 0, sizeof(pData->data)); + memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl)); + cpe_control_memcpy_s(pData->data.DSL_DriverVersionApi, sizeof(pData->data.DSL_DriverVersionApi), + verApi, sizeof(verApi)); + cpe_control_memcpy_s(pData->data.DSL_ChipSetFWVersion,sizeof(pData->data.DSL_ChipSetFWVersion), + ver, sizeof(ver)); + cpe_control_memcpy_s(pData->data.DSL_ChipSetHWVersion, sizeof(pData->data.DSL_ChipSetHWVersion), + ver, sizeof(ver)); + cpe_control_memcpy_s(pData->data.DSL_ChipSetType, sizeof(pData->data.DSL_ChipSetType), + chip, sizeof(chip)); + cpe_control_memcpy_s(pData->data.DSL_DriverVersionMeiBsp, sizeof(pData->data.DSL_DriverVersionMeiBsp), + ver, sizeof(ver)); + } + break; + + case DSL_FIO_DBG_MODULE_LEVEL_GET: + { + DSL_DBG_ModuleLevel_t *pData = (DSL_DBG_ModuleLevel_t *)arg; + + memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl)); + pData->data.nDbgLevel = g_nDbgLevelData[pData->data.nDbgModule].nDbgLevel; + } + break; + + case DSL_FIO_DBG_MODULE_LEVEL_SET: + { + DSL_DBG_ModuleLevel_t *pData = (DSL_DBG_ModuleLevel_t *)arg; + + memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl)); + g_nDbgLevelData[pData->data.nDbgModule].nDbgLevel = pData->data.nDbgLevel; + g_nDbgLevelData[pData->data.nDbgModule].nDbgModule = pData->data.nDbgModule; + } + break; + + case DSL_FIO_AUTOBOOT_CONTROL_SET: + break; + + case DSL_FIO_AUTOBOOT_LOAD_FIRMWARE: + break; + + case DSL_FIO_AUTOBOOT_STATUS_GET: + { + DSL_AutobootStatus_t *pData = (DSL_AutobootStatus_t *)arg; + memset(&(pData->data), 0, sizeof(pData->data)); + memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl)); + pData->data.nStatus = DSL_AUTOBOOT_STATUS_STOPPED; + } + break; + + default: + DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX + "unhandled simulated ioctl (cmd=0x%08X)" DSL_CPE_CRLF, cmd)); + nRet = -1; + break; + } + + DSL_CPE_LockSet(&semData); + + return nRet; +} + +DSL_int_t DSL_SIM_Poll( void *pprivate ) +{ + dsl_line_t *ctx = (dsl_line_t *)pprivate; + return ctx->msg_count; +} +#endif /* DSL_CPE_SIMULATOR_CONTROL */ + +#ifdef DSL_CPE_SIMULATOR_CONTROL +DSL_Error_t DSL_SimulatorInitialize(DSL_void_t) +{ +#ifndef DSL_CPE_SIMULATOR_DRIVER + int drv_num; + + if(g_bFirst) + { + g_bFirst = DSL_FALSE; + + DSL_CPE_LockCreate(&semData); + + drv_num = (int)DEVIO_driver_install( + DSL_CPE_SIM_Open, + DSL_SIM_Close, + DSL_SIM_Read, + DSL_SIM_Write, + DSL_SIM_Ioctl, + DSL_SIM_Poll ); + + DEVIO_device_add(&dsl_line, "/dev/dsl_cpe_api", drv_num); + } +#else + /* Create DSL CPE API driver Simulator device*/ + if (DSL_DRV_SIM_DeviceCreate() < 0) + { + return DSL_ERROR; + } +#endif /* DSL_CPE_SIMULATOR_DRIVER*/ + return DSL_SUCCESS; +} +#endif /* DSL_CPE_SIMULATOR_CONTROL*/ diff --git a/src/dsl_cpe_simulator.h b/src/dsl_cpe_simulator.h new file mode 100644 index 0000000..3dcb253 --- /dev/null +++ b/src/dsl_cpe_simulator.h @@ -0,0 +1,33 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + DSL Device Simulator +*/ + +#include "dsl_cpe_control.h" +#include "dsl_cpe_os.h" +#ifdef DSL_CPE_SIMULATOR_DRIVER +#include "drv_dsl_cpe_os_win32.h" +#endif /* DSL_CPE_SIMULATOR_DRIVER*/ + + +#if defined(DSL_CPE_SIMULATOR_CONTROL) && !defined(DSL_CPE_SIMULATOR_DRIVER) +DSL_int_t DSL_CPE_SIM_Open(void *device, const char *appendix); +DSL_int_t DSL_SIM_Close( void *pprivate ); +DSL_int_t DSL_SIM_Write( void *pprivate, const char *buf, const int len ); +DSL_int_t DSL_SIM_Read( void *pprivate, char *buf, const int len ); +DSL_int_t DSL_SIM_Ioctl( void *pprivate, unsigned int cmd, unsigned long arg ); +DSL_int_t DSL_SIM_Poll( void *pprivate ); +#endif /* defined(DSL_CPE_SIMULATOR_CONTROL) && !defined(DSL_CPE_SIMULATOR_DRIVER)*/ + +#if defined(DSL_CPE_SIMULATOR_CONTROL) +DSL_Error_t DSL_SimulatorInitialize(DSL_void_t); +#endif /* defined(DSL_CPE_SIMULATOR_CONTROL)*/ diff --git a/src/dsl_cpe_vxworks.c b/src/dsl_cpe_vxworks.c new file mode 100644 index 0000000..0ca0cde --- /dev/null +++ b/src/dsl_cpe_vxworks.c @@ -0,0 +1,116 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef VXWORKS + +#include "dsl_cpe_vxworks.h" +#include "dsl_cpe_control.h" +/** \file + Operating System access implementation +*/ + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +int DSL_CPE_debug_printf(DSL_char_t *fmt, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nRet = 0; + + va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */ + + /* For VxWorks printout will be only done to console only at the moment */ + nRet = vprintf(fmt, ap); + + va_end(ap); + + return nRet; +} + +/** + Enable the console line mode. + In this mode the input from the device is available only after receiving NEWLINE . + This allows to modify the command line until the Enter key is pressed. +*/ +void DSL_CPE_KeypressSet (void) +{ +#ifndef _lint + int options; + int iofd = fileno(stdin); + + options = ioctl(iofd, FIOGETOPTIONS, 0); + ioctl(iofd, FIOSETOPTIONS, (int)(options & ~OPT_LINE)); +#endif +} + +/** + Disable the console line mode. + Plesae refer to \ref IFXOS_KeypressSet . +*/ +void DSL_CPE_KeypressReset (void) +{ +#ifndef _lint + int options; + int iofd = fileno(stdin); + + options = ioctl(iofd, FIOGETOPTIONS, 0); + ioctl(iofd, FIOSETOPTIONS, (int)(options | OPT_LINE)); +#endif +} + + +DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal) +{ +#if __BYTE_ORDER == __LITTLE_ENDIAN + return (((hVal >> 8) & 0xFF) | (hVal << 8)); +#else + return hVal; +#endif +} + +DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal) +{ +#if __BYTE_ORDER == __LITTLE_ENDIAN + + return (((hVal >> 24) & 0x000000ff) | ((hVal >> 8) & 0x0000ff00) | ((hVal << 8) & 0x00ff0000) | ((hVal << 24) & 0xff000000)); +#else + return hVal; +#endif +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nRet = 0; + + va_start(ap, format); /* set ap pointer to 1st unnamed arg */ + + nRet = vfprintf(stream, format, ap); + fflush(stream); + + va_end(ap); + + return nRet; +} + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_char_t * DSL_CPE_OwnAddrStringGet(DSL_void_t) +{ + return DSL_NULL; +} +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +#endif /* VXWORKS */ + diff --git a/src/dsl_cpe_vxworks.h b/src/dsl_cpe_vxworks.h new file mode 100644 index 0000000..22d85d9 --- /dev/null +++ b/src/dsl_cpe_vxworks.h @@ -0,0 +1,90 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef VXWORKS + +/** \file + OS interface, WIN32 adaptation +*/ + +#include "drv_dsl_cpe_api_types.h" + +#include + +#include +#ifdef DSL_DEBUG_TOOL_INTERFACE +#include +#include +#include +#include +#endif + +#include "ifxos_common.h" +#include "ifxos_debug.h" +#include "ifxos_thread.h" +#include "ifxos_memory_alloc.h" +#include "ifxos_lock.h" +#include "ifxos_select.h" +#include "ifxos_common.h" +#include "ifxos_print_io.h" +#include "ifxos_device_access.h" +#include "ifxos_file_access.h" +#include "ifxos_time.h" +#include "ifxos_thread.h" +#include "ifxos_termios.h" +#include "ifxos_pipe.h" +#include "ifxos_misc.h" +#include "ifxos_socket.h" +#include "ifx_getopt.h" + +#define PACKAGE_VERSION "" + +#define DSL_CPE_STACKSIZE 2048 + +#define DSL_CPE_PRIORITY 64 +#define DSL_CPE_PIPE_PRIORITY 64 +#define DSL_CPE_TCP_MSG_PRIORITY 64 + +#define DSL_CPE_STRNCASECMP(a,b,c) stricmp(a,b) + +#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr)) +#define DSL_CPE_AddressToString inet_ntoa + +#ifndef FD_SETSIZE +#define DSL_FD_SETSIZE 1024 +#else +#define DSL_FD_SETSIZE FD_SETSIZE +#endif + +#define DSL_CPE_File_t IFXOS_File_t + +void DSL_CPE_KeypressSet (void); +void DSL_CPE_KeypressReset (void); + +DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal); + +DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal); + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t); +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +/** + Print to a file, pipe, stdout, stderr or memory file. +*/ +DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))) +#endif + ; + +#endif /* VXWORKS */ + + diff --git a/src/dsl_cpe_win32.c b/src/dsl_cpe_win32.c new file mode 100644 index 0000000..0f807cc --- /dev/null +++ b/src/dsl_cpe_win32.c @@ -0,0 +1,112 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Operating System access implementation +*/ + +/*#define DSL_INTERN*/ + +#include "dsl_cpe_os.h" + +#if defined(WIN32) + +#include +#include + +#undef DSL_CCA_DBG_BLOCK +#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_OS + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_Error_t DSL_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue) +{ + return ((SetEnvironmentVariable(sName, sValue) == 0) ? DSL_ERROR : DSL_SUCCESS); +} + +/** + Installing of system handler routines. + + \remarks not used +*/ +DSL_void_t DSL_HandlerInstall(DSL_void_t) +{ +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +int DSL_CPE_debug_printf(DSL_char_t *fmt, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nRet = 0; + + va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */ + + /* For VxWorks printout will be only done to console only at the moment */ + nRet = vprintf(fmt, ap); + + va_end(ap); + + return nRet; +} + +DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal) +{ + return htons(hVal); +} + +DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal) +{ + return htonl(hVal); +} + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_char_t * DSL_CPE_OwnAddrStringGet(DSL_void_t) +{ + return DSL_NULL; +} +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nRet = 0; + + va_start(ap, format); /* set ap pointer to 1st unnamed arg */ + + nRet = vfprintf(stream, format, ap); + fflush(stream); + + va_end(ap); + + return nRet; +} +DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand) +{ + return DSL_SUCCESS; +} + +DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue) +{ + return DSL_SUCCESS; +} + +DSL_void_t DSL_CPE_EnvVarFree(DSL_void_t) +{ +} +#endif /* WIN32 */ diff --git a/src/dsl_cpe_win32.h b/src/dsl_cpe_win32.h new file mode 100644 index 0000000..c66af6a --- /dev/null +++ b/src/dsl_cpe_win32.h @@ -0,0 +1,129 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef WIN32 + +/** \file + OS interface, WIN32 adaptation +*/ + +#pragma pack(1) + +#include +#include + +#include +#include +#include + +#include "drv_dsl_cpe_api_types.h" + +#include "ifxos_common.h" +#include "ifxos_debug.h" +#include "ifxos_thread.h" +#include "ifxos_memory_alloc.h" +#include "ifxos_lock.h" +#include "ifxos_select.h" +#include "ifxos_common.h" +#include "ifxos_print_io.h" +#include "ifxos_device_access.h" +#include "ifxos_file_access.h" +#include "ifxos_time.h" +#include "ifxos_thread.h" +#include "ifxos_termios.h" +#include "ifxos_pipe.h" +#include "ifxos_misc.h" +#include "ifxos_socket.h" +#include "ifx_getopt.h" + +#ifndef snprintf +#define snprintf sprintf_s +#endif + +#ifndef strtok_r +#define strtok_r strtok_s +#endif + +#define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */ + +#define __BIG_ENDIAN IFXOS_BIG_ENDIAN +#define __BYTE_ORDER IFXOS_BYTE_ORDER + +#define DSL_CPE_PRIORITY (0) +#define DSL_CPE_STACKSIZE (2048) + +#define DSL_CPE_STRNCASECMP(a,b,c) stricmp((a),(b)) + +/** carriage return for windows */ +#define DSL_CPE_CRLF "\n" + +#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ +#define IOC_VOID 0x20000000 /* no parameters */ +#define IOC_OUT 0x40000000 /* copy out parameters */ +#define IOC_IN 0x80000000 /* copy in parameters */ +#define IOC_INOUT (IOC_IN|IOC_OUT) + +#ifndef _IO +#define _IO(x,y) (IOC_VOID|((x)<<8)|y) +#endif /* _IO*/ +#ifndef _IOR +#define _IOR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y) +#endif /* _IOR*/ +#ifndef _IOW +#define _IOW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y) +#endif /* _IOW*/ +#ifndef _IOWR +#define _IOWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y) +#endif /* _IOWR*/ + +#define _IOC_TYPE(x) (((x)>>8) & 0xFF) + +#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr)) +#define DSL_CPE_AddressToString inet_ntoa + +#define DSL_CPE_KeypressSet IFXOS_KeypressSet +#define DSL_CPE_KeypressReset IFXOS_KeypressReset + + +/** map FILE to own type */ +typedef FILE DSL_CPE_File_t; + +DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal); + +DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal); + +#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) +DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t); +#endif /* DSL_DEBUG_TOOL_INTERFACE*/ + +/** + Print to a file, pipe, stdout, stderr or memory file. +*/ +DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))) +#endif + ; + + +#pragma pack() + +extern DSL_Error_t DSL_CPE_PipeCreate(DSL_char_t *pName); +extern DSL_Error_t DSL_CPE_PipeClose(DSL_CPE_File_t *file); +extern DSL_CPE_File_t *DSL_CPE_PipeOpen(DSL_char_t *pName, + DSL_boolean_t reading, DSL_boolean_t blocking); + +DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand); +DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue); +DSL_void_t DSL_CPE_EnvVarFree(DSL_void_t); + +#endif /* WIN32 */ + + diff --git a/tools/pipe/Makefile.am b/tools/pipe/Makefile.am new file mode 100644 index 0000000..353ba54 --- /dev/null +++ b/tools/pipe/Makefile.am @@ -0,0 +1,32 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = dsl_cpe_pipe + +if ADD_APPL_CFLAGS_SET +dsl_cpe_pipe_cflags = $(ADD_APPL_CFLAGS) +else +dsl_cpe_pipe_cflags = +endif + +dsl_cpe_pipe_compile_cflags = $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) + +if SAFEC_SUPPORT +dsl_cpe_pipe_compile_cflags += @SAFEC_INCL_PATH@ +endif + +dsl_cpe_pipe_common_cflags = -Wall -Wimplicit -Wreturn-type -Wunused -Wundef \ + -Wswitch -Wcomment -Wuninitialized -DLINUX -g -s + +dsl_cpe_pipe_SOURCES = dsl_pipe_client.c dsl_pipe_lib.c + +dsl_cpe_pipe_CFLAGS = $(dsl_cpe_pipe_common_cflags) \ + $(dsl_cpe_pipe_cflags) \ + $(dsl_cpe_pipe_compile_cflags) + +dsl_cpe_pipe_LDADD = -lifxos -lpthread -lm -lrt + +EXTRA_DIST = dsl_cpe_safec_wrapper.h + +if SAFEC_SUPPORT +dsl_cpe_pipe_LDADD += -l@SAFEC_LIB_NAME@ +endif \ No newline at end of file diff --git a/tools/pipe/Makefile.in b/tools/pipe/Makefile.in new file mode 100644 index 0000000..3f3a6d2 --- /dev/null +++ b/tools/pipe/Makefile.in @@ -0,0 +1,685 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = dsl_cpe_pipe$(EXEEXT) +@SAFEC_SUPPORT_TRUE@am__append_1 = @SAFEC_INCL_PATH@ +@SAFEC_SUPPORT_TRUE@am__append_2 = -l@SAFEC_LIB_NAME@ +subdir = tools/pipe +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/dsl_cpe_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_dsl_cpe_pipe_OBJECTS = dsl_cpe_pipe-dsl_pipe_client.$(OBJEXT) \ + dsl_cpe_pipe-dsl_pipe_lib.$(OBJEXT) +dsl_cpe_pipe_OBJECTS = $(am_dsl_cpe_pipe_OBJECTS) +am__DEPENDENCIES_1 = +dsl_cpe_pipe_DEPENDENCIES = $(am__DEPENDENCIES_1) +dsl_cpe_pipe_LINK = $(CCLD) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(dsl_cpe_pipe_SOURCES) +DIST_SOURCES = $(dsl_cpe_pipe_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADD_APPL_CFLAGS = @ADD_APPL_CFLAGS@ +ADD_APPL_LDFLAGS = @ADD_APPL_LDFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTCHECK_CONFIGURE_PARAMS = @DISTCHECK_CONFIGURE_PARAMS@ +DSL_ADD_EXT_APPL_CFLAGS = @DSL_ADD_EXT_APPL_CFLAGS@ +DSL_CCA_DBG_MAX_LEVEL_PRE = @DSL_CCA_DBG_MAX_LEVEL_PRE@ +DSL_CCA_DBG_MAX_LEVEL_SET = @DSL_CCA_DBG_MAX_LEVEL_SET@ +DSL_CONFIG_MODEL_TYPE = @DSL_CONFIG_MODEL_TYPE@ +DSL_CPE_DEBUG_DISABLE = @DSL_CPE_DEBUG_DISABLE@ +DSL_DBG_MSG_NETLINK_ID = @DSL_DBG_MSG_NETLINK_ID@ +DSL_DEBUG_TOOL_INTERFACE = @DSL_DEBUG_TOOL_INTERFACE@ +DSL_DEVICE_DRIVER_INCL_PATH = @DSL_DEVICE_DRIVER_INCL_PATH@ +DSL_DEVICE_NAME = @DSL_DEVICE_NAME@ +DSL_DRIVER_INCL_PATH = @DSL_DRIVER_INCL_PATH@ +DSL_VRX_DEVICE_NAME = @DSL_VRX_DEVICE_NAME@ +DTI_INCL_PATH = @DTI_INCL_PATH@ +DTI_LIBRARY_PATH = @DTI_LIBRARY_PATH@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTRA_APP_CFLAGS = @EXTRA_APP_CFLAGS@ +GREP = @GREP@ +IFXOS_INCLUDE_PATH = @IFXOS_INCLUDE_PATH@ +IFXOS_LIBRARY_PATH = @IFXOS_LIBRARY_PATH@ +INCLUDE_DEPRECATED = @INCLUDE_DEPRECATED@ +INCLUDE_DEVICE_EXCEPTION_CODES = @INCLUDE_DEVICE_EXCEPTION_CODES@ +INCLUDE_DSL_ADSL_MIB = @INCLUDE_DSL_ADSL_MIB@ +INCLUDE_DSL_CEOC = @INCLUDE_DSL_CEOC@ +INCLUDE_DSL_CONFIG_GET = @INCLUDE_DSL_CONFIG_GET@ +INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT = @INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT@ +INCLUDE_DSL_CPE_CLI_SUPPORT = @INCLUDE_DSL_CPE_CLI_SUPPORT@ +INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH = @INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH@ +INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT = @INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT@ +INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT = @INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT@ +INCLUDE_DSL_CPE_DTI_SUPPORT = @INCLUDE_DSL_CPE_DTI_SUPPORT@ +INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT = @INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT@ +INCLUDE_DSL_CPE_IFXOS_SUPPORT = @INCLUDE_DSL_CPE_IFXOS_SUPPORT@ +INCLUDE_DSL_CPE_MISC_LINE_STATUS = @INCLUDE_DSL_CPE_MISC_LINE_STATUS@ +INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS@ +INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS@ +INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS = @INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_CONFIG = @INCLUDE_DSL_CPE_PM_CONFIG@ +INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS@ +INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS@ +INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS = @INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_HISTORY = @INCLUDE_DSL_CPE_PM_HISTORY@ +INCLUDE_DSL_CPE_PM_LINE_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_COUNTERS@ +INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS@ +INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS = @INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS = @INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS@ +INCLUDE_DSL_CPE_PM_RETX_COUNTERS = @INCLUDE_DSL_CPE_PM_RETX_COUNTERS@ +INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS = @INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS@ +INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS@ +INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS = @INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS@ +INCLUDE_DSL_CPE_TRACE_BUFFER = @INCLUDE_DSL_CPE_TRACE_BUFFER@ +INCLUDE_DSL_DELT = @INCLUDE_DSL_DELT@ +INCLUDE_DSL_EVENT_POLLING = @INCLUDE_DSL_EVENT_POLLING@ +INCLUDE_DSL_FILTER_DETECTION = @INCLUDE_DSL_FILTER_DETECTION@ +INCLUDE_DSL_FRAMING_PARAMETERS = @INCLUDE_DSL_FRAMING_PARAMETERS@ +INCLUDE_DSL_G997_ALARM = @INCLUDE_DSL_G997_ALARM@ +INCLUDE_DSL_G997_FRAMING_PARAMETERS = @INCLUDE_DSL_G997_FRAMING_PARAMETERS@ +INCLUDE_DSL_G997_LINE_INVENTORY = @INCLUDE_DSL_G997_LINE_INVENTORY@ +INCLUDE_DSL_G997_PER_TONE = @INCLUDE_DSL_G997_PER_TONE@ +INCLUDE_DSL_G997_STATUS = @INCLUDE_DSL_G997_STATUS@ +INCLUDE_DSL_PM = @INCLUDE_DSL_PM@ +INCLUDE_DSL_RESOURCE_STATISTICS = @INCLUDE_DSL_RESOURCE_STATISTICS@ +INCLUDE_DSL_SYSTEM_INTERFACE = @INCLUDE_DSL_SYSTEM_INTERFACE@ +INCLUDE_DTI_AGENT_STANDALONE_SUPPORT = @INCLUDE_DTI_AGENT_STANDALONE_SUPPORT@ +INCLUDE_FW_REQUEST_SUPPORT = @INCLUDE_FW_REQUEST_SUPPORT@ +INCLUDE_PILOT_TONES_STATUS = @INCLUDE_PILOT_TONES_STATUS@ +INCLUDE_REAL_TIME_TRACE = @INCLUDE_REAL_TIME_TRACE@ +INCLUDE_SCRIPT_NOTIFICATION = @INCLUDE_SCRIPT_NOTIFICATION@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SAFEC_INCL_PATH = @SAFEC_INCL_PATH@ +SAFEC_LIB_FUNC = @SAFEC_LIB_FUNC@ +SAFEC_LIB_NAME = @SAFEC_LIB_NAME@ +SAFEC_LIB_PATH = @SAFEC_LIB_PATH@ +SAFEC_SUPPORT = @SAFEC_SUPPORT@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@ADD_APPL_CFLAGS_SET_FALSE@dsl_cpe_pipe_cflags = +@ADD_APPL_CFLAGS_SET_TRUE@dsl_cpe_pipe_cflags = $(ADD_APPL_CFLAGS) +dsl_cpe_pipe_compile_cflags = $(DSL_DRIVER_INCL_PATH) \ + $(IFXOS_INCLUDE_PATH) $(am__append_1) +dsl_cpe_pipe_common_cflags = -Wall -Wimplicit -Wreturn-type -Wunused -Wundef \ + -Wswitch -Wcomment -Wuninitialized -DLINUX -g -s + +dsl_cpe_pipe_SOURCES = dsl_pipe_client.c dsl_pipe_lib.c +dsl_cpe_pipe_CFLAGS = $(dsl_cpe_pipe_common_cflags) \ + $(dsl_cpe_pipe_cflags) \ + $(dsl_cpe_pipe_compile_cflags) + +dsl_cpe_pipe_LDADD = -lifxos -lpthread -lm -lrt $(am__append_2) +EXTRA_DIST = dsl_cpe_safec_wrapper.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/pipe/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tools/pipe/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +dsl_cpe_pipe$(EXEEXT): $(dsl_cpe_pipe_OBJECTS) $(dsl_cpe_pipe_DEPENDENCIES) $(EXTRA_dsl_cpe_pipe_DEPENDENCIES) + @rm -f dsl_cpe_pipe$(EXEEXT) + $(AM_V_CCLD)$(dsl_cpe_pipe_LINK) $(dsl_cpe_pipe_OBJECTS) $(dsl_cpe_pipe_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +dsl_cpe_pipe-dsl_pipe_client.o: dsl_pipe_client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_client.o -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo -c -o dsl_cpe_pipe-dsl_pipe_client.o `test -f 'dsl_pipe_client.c' || echo '$(srcdir)/'`dsl_pipe_client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_client.c' object='dsl_cpe_pipe-dsl_pipe_client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_client.o `test -f 'dsl_pipe_client.c' || echo '$(srcdir)/'`dsl_pipe_client.c + +dsl_cpe_pipe-dsl_pipe_client.obj: dsl_pipe_client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_client.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo -c -o dsl_cpe_pipe-dsl_pipe_client.obj `if test -f 'dsl_pipe_client.c'; then $(CYGPATH_W) 'dsl_pipe_client.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_client.c' object='dsl_cpe_pipe-dsl_pipe_client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_client.obj `if test -f 'dsl_pipe_client.c'; then $(CYGPATH_W) 'dsl_pipe_client.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_client.c'; fi` + +dsl_cpe_pipe-dsl_pipe_lib.o: dsl_pipe_lib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_lib.o -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo -c -o dsl_cpe_pipe-dsl_pipe_lib.o `test -f 'dsl_pipe_lib.c' || echo '$(srcdir)/'`dsl_pipe_lib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_lib.c' object='dsl_cpe_pipe-dsl_pipe_lib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_lib.o `test -f 'dsl_pipe_lib.c' || echo '$(srcdir)/'`dsl_pipe_lib.c + +dsl_cpe_pipe-dsl_pipe_lib.obj: dsl_pipe_lib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_lib.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo -c -o dsl_cpe_pipe-dsl_pipe_lib.obj `if test -f 'dsl_pipe_lib.c'; then $(CYGPATH_W) 'dsl_pipe_lib.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_lib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_lib.c' object='dsl_cpe_pipe-dsl_pipe_lib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_lib.obj `if test -f 'dsl_pipe_lib.c'; then $(CYGPATH_W) 'dsl_pipe_lib.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_lib.c'; fi` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tools/pipe/dsl_cpe_safec_wrapper.h b/tools/pipe/dsl_cpe_safec_wrapper.h new file mode 100644 index 0000000..d9fa62e --- /dev/null +++ b/tools/pipe/dsl_cpe_safec_wrapper.h @@ -0,0 +1,33 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef _SAFEC_WRAPPER_H +#define _SAFEC_WRAPPER_H + +#if defined (SAFEC_SUPPORT) && (SAFEC_SUPPORT == 1) +#include "safe_lib.h" +#define cpe_control_pipe_memcpy_s(dest, destsz, src, srcsz) memcpy_s(dest, destsz, src, srcsz) +#define cpe_control_pipe_strncpy_s(dest, destsz, src, srcsz) strncpy_s(dest, destsz, src, srcsz) +#else +#warning "Safe C library is not available!" + +#include /* size_t */ +static __inline__ size_t safec_wrapper_min(size_t a, size_t b) +{ + return a > b ? b : a; +} + +#define cpe_control_pipe_memcpy_s(dest, destsz, src, srcsz) memcpy(dest, src, safec_wrapper_min(destsz,srcsz)) +#define cpe_control_pipe_strncpy_s(dest, destsz, src, srcsz) strncpy(dest, src, safec_wrapper_min(destsz,srcsz)) +#endif /* defined (SAFEC_SUPPORT) && (SAFEC_SUPPORT == 1) */ + +#endif /* _SAFEC_WRAPPER_H */ diff --git a/tools/pipe/dsl_pipe_client.c b/tools/pipe/dsl_pipe_client.c new file mode 100644 index 0000000..5141ac1 --- /dev/null +++ b/tools/pipe/dsl_pipe_client.c @@ -0,0 +1,489 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef LINUX + +#include "dsl_pipe_client.h" + +#define PIPE_PREFIX "/tmp/pipe/dsl_cpe" +#define SYS_NAME_PREFIX "/tmp" + +#undef DSL_DBG_BLOCK +#define DSL_DBG_BLOCK DSL_DBG_OS + +static char Result[20000]; +static int sema; + +#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) + /* union semun is defined by including */ +#else + /* according to X/OPEN we have to define it ourselves */ + union semun { + int val; /* value for SETVAL */ + struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* array for GETALL, SETALL */ + /* Linux specific part: */ + struct seminfo *__buf; /* buffer for IPC_INFO */ + }; +#endif + +#ifndef DSL_DEBUG_DISABLE +static void print_sem_error(int err) +{ + switch(err) + { + case E2BIG: + printf( "DSL[Pipe]: The value of nsops is greater than the system-" + "imposed maximum." DSL_PIPE_CRLF); + break; + + case EACCES: + printf( "DSL[Pipe]: Operation permission is denied to the calling " + "process, see IPC." DSL_PIPE_CRLF); + break; + + case EAGAIN: + printf( "DSL[Pipe]: The operation would result in suspension of the " + "calling process but (sem_flg&IPC_NOWAIT) is non-zero." DSL_PIPE_CRLF); + break; + + case EFBIG: + printf( "DSL[Pipe]: The value of sem_num is less than 0 or greater " + "than or equal to the number of semaphores in the set associated " + "with semid. " DSL_PIPE_CRLF); + break; + + case EIDRM: + printf( "DSL[Pipe]: The semaphore identifier semid is removed from " + "the system. " DSL_PIPE_CRLF); + break; + + case EINTR: + printf( "DSL[Pipe]: The semop() function was interrupted by a signal." DSL_PIPE_CRLF); + break; + + case EINVAL: + printf( "DSL[Pipe]: The value of semid is not a valid semaphore " + "identifier, or the number of individual semaphores for which the " + "calling process requests a SEM_UNDO would exceed the system-" + "imposed limit. " DSL_PIPE_CRLF); + break; + + case ENOSPC: + printf( "DSL[Pipe]: The limit on the number of individual processes " + "requesting a SEM_UNDO would be exceeded. " DSL_PIPE_CRLF); + break; + + case ERANGE: + printf( "DSL[Pipe]: An operation would cause a semval to overflow " + "the system-imposed limit, or an operation would cause a semadj " + "value to overflow the system-imposed limit." DSL_PIPE_CRLF); + break; + + default: + break; + } +} +#endif /* DSL_DEBUG_DISABLE */ + +/** signal handler, will abort blocking semop() call */ +static void DSL_PIPE_SemAlarm(int val) +{ +} + +static int DSL_PIPE_SemaphoreGlobalCreate(DSL_char_t *pName) +{ + /* Semaphore ID used in further semaphore operations */ + int semid = -1; + int fd; + /* Used to generate the semaphore key in case pName is not a number */ + DSL_char_t *sempath = DSL_NULL; + /* the name should be an integer if not the key for semaphore is generated at + runtime*/ + DSL_int_t nsemkey; + union semun arg; + + arg.val = 0; + + if (pName == DSL_NULL) + pName = ""; + + nsemkey = atoi(pName); + + /*incase atoi fails generate a tmp string and try to generate a key + at runtime */ + if (nsemkey == 0) + { + sempath = DSL_PIPE_Malloc(strlen(SYS_NAME_PREFIX"/") + strlen(pName) + 1); + if (sempath == DSL_NULL) + { + printf( "DSL: No Mem." DSL_PIPE_CRLF); + return -1; + } + mkdir(SYS_NAME_PREFIX, 0777); + fd = open(SYS_NAME_PREFIX, O_RDONLY); + fchmod(fd, 0777); + close(fd); + cpe_control_pipe_strncpy_s(sempath, strlen(SYS_NAME_PREFIX"/") + strlen(pName) + 1, + SYS_NAME_PREFIX"/\0", strlen(SYS_NAME_PREFIX"/")); + strcat(sempath, pName); + strcat(sempath, "\0"); + + /* creat(sempath, 0666); */ + creat(sempath, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); + /* Access to all */ + /*chmod(sempath, 0777);*/ + + /* generate key */ + if ( (nsemkey = ftok(sempath, 5)) < 0) + { + switch(errno) + { + case EBADF: + printf( "DSL: filedes is bad." DSL_PIPE_CRLF); + break; + + case ENOENT: + printf( "DSL: A component of the path file_name does not exist, " + "or the path is an empty string." DSL_PIPE_CRLF); + break; + + case ENOTDIR: + printf( "DSL: A component of the path is not a directory." DSL_PIPE_CRLF); + break; + + case ELOOP: + printf( "DSL: Too many symbolic links encountered while " + "traversing the path." DSL_PIPE_CRLF); + break; + + case EFAULT: + printf( "DSL: Bad address." DSL_PIPE_CRLF); + break; + + case EACCES: + printf( "DSL: Permission denied." DSL_PIPE_CRLF); + break; + + case ENOMEM: + printf( "DSL: Out of memory (i.e. kernel memory)." DSL_PIPE_CRLF); + break; + + case ENAMETOOLONG: + printf( "DSL: File name too long." DSL_PIPE_CRLF); + break; + + default: + break; + } + + DSL_PIPE_Free(sempath); + return -1; + } + DSL_PIPE_Free(sempath); + } + + if ( ((semid = semget(nsemkey, 1, 0666|IPC_CREAT|IPC_EXCL)) < 0) ) + { + /* ERROR: check errno */ + if (errno == EEXIST) + { + /* get without create */ + if ( ((semid = semget(nsemkey, 1, 0666|IPC_EXCL)) < 0) ) + { + printf( "DSL: create semaphore - semget(0x%X,0), errno=%d\n\r", + nsemkey, errno ); + #ifndef DSL_DEBUG_DISABLE + print_sem_error(errno); + #endif + return -1; + } + } + else + { + #ifndef DSL_DEBUG_DISABLE + print_sem_error(errno); + #endif + return -1; + } + } + else + arg.val = 1; + + if (arg.val == 1) + { + /* set the value of semaphore to 1 ie released or free to use */ + if (semctl(semid, 0, SETVAL, arg) < 0 ) + { + printf( "DSL: create semaphore - semctl(0x%X,0), errno=%d\n\r", + semid, errno ); + #ifndef DSL_DEBUG_DISABLE + print_sem_error(errno); + #endif + return -1; + } + } + + return semid; +} + +DSL_Error_t DSL_PIPE_SemaphoreGet(int sem, DSL_uint32_t nTimeout) +{ + struct sigaction sa; + struct sembuf sb; + struct timespec timeout; + + sb.sem_num = 0; + /* specifies the operation ie to get the semaphore */ + sb.sem_op = -1; + sb.sem_flg = SEM_UNDO; + + switch(nTimeout) + { + case 0xFFFFFFFF: + /* Blocking call */ + break; + + case 0: + /* Non Blocking */ + sb.sem_flg |= IPC_NOWAIT; + break; + + default: + /* Blocking call */ + /* Initialize timer expiration value */ + timeout.tv_sec = (nTimeout/1000); + timeout.tv_nsec = (nTimeout%1000) * 1000 * 1000; + + sa.sa_flags = 0; + sa.sa_handler = DSL_PIPE_SemAlarm; + sigaction(SIGALRM, &sa, DSL_NULL); + alarm(timeout.tv_sec + 1); + + break; + } + + /* Acquire semaphore */ + if (semop(sem, &sb, 1) == 0) + { + alarm(0); + return DSL_SUCCESS; + } + else + { + alarm(0); + if(errno == EINTR) + { + printf( "DSL: semaphore timeout." DSL_PIPE_CRLF); + return DSL_ERR_TIMEOUT; + } + else + { + #ifndef DSL_DEBUG_DISABLE + print_sem_error(errno); + #endif + printf( "DSL: get semaphore %x failed (errno=%d)" DSL_PIPE_CRLF, sem, errno); + return DSL_ERROR; + } + } +} + +DSL_Error_t DSL_PIPE_SemaphoreSet(int sem) +{ + struct sembuf sb; + + sb.sem_num = 0; + /* specifies the operation ie to set the semaphore */ + sb.sem_op = 1; + sb.sem_flg = SEM_UNDO; + + if (semop(sem, &sb, 1) == 0) + { + return DSL_SUCCESS; + } + else + { + #ifndef DSL_DEBUG_DISABLE + print_sem_error(errno); + #endif + printf( "DSL: set semaphore %x failed (errno=%d)" DSL_PIPE_CRLF, sem, errno); + return DSL_ERROR; + } +} + +/* 1 colon means there is a required parameter */ +/* 2 colons means there is an optional parameter */ +static const char GETOPT_LONG_OPTSTRING[] = "hve:"; + +int main(int argc, char **argv) +{ + char *pCommand = DSL_NULL; + int i, k=0, len=0, ret; + FILE *pipe_cmd, *pipe_ack; + DSL_int8_t instance = 0; + DSL_char_t nameBuf[64], *pChar; + + i = 1; + pChar = argv[1]; + if (pChar) + { + if (pChar[0] == '-') + { + switch(pChar[1]) + { + case 'h': + printf(DSL_PIPE_CRLF); + printf("Client for the pipe interface of the \"DSL CPE API\"" DSL_PIPE_CRLF); + printf("\t%s [-hv] [pipe_no] cmd [params]" DSL_PIPE_CRLF, argv[0]); + printf(DSL_PIPE_CRLF); + printf("\t-h\tthis help" DSL_PIPE_CRLF); + printf("\tpipe_no\tpipe number (default 0)" DSL_PIPE_CRLF); + printf("\tcmd\tcommand to execute" DSL_PIPE_CRLF); + printf("\tparams\tparameters of the command" DSL_PIPE_CRLF); + printf(DSL_PIPE_CRLF); + return 0; + case 'v': + printf("\tdsl_pipe_client v0.0.2" DSL_PIPE_CRLF); + return 0; + } + } + else if (isdigit(pChar[0])) + { + if (argc >= 3) + { + instance = atoi(argv[1]); + if ((instance >= MAX_CLI_PIPES) || (instance < 0)) + { + printf("\tpipe_no\toption requires parameter in range [0;%d]" + DSL_PIPE_CRLF, (MAX_CLI_PIPES - 1)); + return -1; + } + i = 2; + } + } + + k = i; + for(;i0) + { + Result[ret] = '\0'; + printf( "%s", Result); + } + } + while ((ret > 0)); + + DSL_PIPE_FClose(pipe_ack); + + DSL_PIPE_SemaphoreSet(sema); + + printf( DSL_PIPE_CRLF ); + + DSL_PIPE_Free(pCommand); + + return 0; + +error: + DSL_PIPE_SemaphoreSet(sema); + + printf( "There were errors!" DSL_PIPE_CRLF); + + DSL_PIPE_Free(pCommand); + + return -1; +} + +#endif /* LINUX */ + diff --git a/tools/pipe/dsl_pipe_client.h b/tools/pipe/dsl_pipe_client.h new file mode 100644 index 0000000..248ee97 --- /dev/null +++ b/tools/pipe/dsl_pipe_client.h @@ -0,0 +1,173 @@ +/****************************************************************************** + + Copyright 2018, Intel Corporation + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifndef DSL_PIPE_CLIENT_H +#define DSL_PIPE_CLIENT_H + +#ifdef HAVE_CONFIG_H +#include "dsl_cpe_config.h" +#endif + +#include "drv_dsl_cpe_api_types.h" +#include "drv_dsl_cpe_api_error.h" +#include "dsl_cpe_safec_wrapper.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT + +#include +#include + +#else + +/** IFXOS includes*/ +#include "ifxos_common.h" +#include "ifxos_print_io.h" +#include "ifxos_memory_alloc.h" +#include "ifxos_device_access.h" +#include "ifxos_file_access.h" +#include "ifxos_time.h" +#include "ifxos_lock.h" +#include "ifxos_thread.h" +#include "ifxos_termios.h" +#include "ifxos_pipe.h" +#include "ifxos_misc.h" +#include "ifxos_socket.h" + +#endif /* INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +#if defined(INCLUDE_DSL_CPE_IFXOS_SUPPORT) + /* support other OS only through lib_ifxos */ + #ifndef USE_LIB_IFXOS + #define USE_LIB_IFXOS 1 + #endif +#endif /** INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + + +#ifndef __BIG_ENDIAN + #error please define the __BIG_ENDIAN macro +#endif + +#ifndef __BYTE_ORDER + #error please specify the endianess of your target system +#endif + +/** + Carriage Return + Line Feed, maybe overwritten by compile switches + or OS-specific adaptation */ +#ifndef DSL_PIPE_CRLF +#define DSL_PIPE_CRLF "\n\r" +#endif + +#if defined(USE_LIB_IFXOS) && (USE_LIB_IFXOS == 1) + +/* + common defines - ifxos_common.h" +*/ + +#define DSL_BYTE_ORDER IFXOS_BYTE_ORDER +#define DSL_LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN +#define DSL_BIG_ENDIAN IFXOS_BIG_ENDIAN + +#ifndef __BIG_ENDIAN + #define __BIG_ENDIAN IFXOS_BIG_ENDIAN + #define __LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN + #define __BYTE_ORDER IFXOS_BYTE_ORDER +#endif + +#ifndef __BYTE_ORDER + #define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +/* + Function map - stdio, string +*/ +#define DSL_PIPE_FPrintf IFXOS_FPrintf + +/* + Function map - Memory Functions. +*/ +#define DSL_PIPE_Malloc IFXOS_MemAlloc +#define DSL_PIPE_Free IFXOS_MemFree + +/* + Function map - Device handling (open, close ...). +*/ +#define DSL_PIPE_FOpen IFXOS_FOpen +#define DSL_PIPE_FClose IFXOS_FClose +#define DSL_PIPE_FRead IFXOS_FRead + +#else /* (USE_LIB_IFXOS == 1) */ + +#ifndef __BIG_ENDIAN + #define __BIG_ENDIAN 1 + #define __LITTLE_ENDIAN 2 +#endif + +#ifndef __BYTE_ORDER + #define __BYTE_ORDER __BIG_ENDIAN +#endif + +/** + Allocates a memory block + + \param size Bytes to allocate + + \return + returns a DSL_void_t pointer to the allocated space, NULL if there's not + sufficient memory space available. +*/ +DSL_void_t *DSL_PIPE_Malloc(DSL_uint32_t size); + +/** + Deallocates a memory block + + \param memblock Previously allocated memory block that should be freed + +*/ +void DSL_PIPE_Free(DSL_void_t *memblock); + +/** + Open a file. +*/ +FILE *DSL_PIPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode); + +/** + Close the file or memory file. +*/ +DSL_int_t DSL_PIPE_FClose(FILE *fd); + +/** + Read from file, stdin . +*/ +DSL_int_t DSL_PIPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, FILE *stream); + +/** + Print out . +*/ +DSL_int_t DSL_PIPE_FPrintf(FILE *stream, const DSL_char_t *format, ...); + +#endif /* (USE_LIB_IFXOS == 1) */ + +#endif /* DSL_PIPE_CLIENT_H */ diff --git a/tools/pipe/dsl_pipe_lib.c b/tools/pipe/dsl_pipe_lib.c new file mode 100644 index 0000000..2fa9f00 --- /dev/null +++ b/tools/pipe/dsl_pipe_lib.c @@ -0,0 +1,88 @@ +/****************************************************************************** + + Copyright (c) 2007-2015 + Lantiq Beteiligungs-GmbH & Co. KG + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#ifdef LINUX + +#include "dsl_pipe_client.h" + +#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_void_t *DSL_PIPE_Malloc(DSL_uint32_t size) +{ + DSL_void_t *memblock; + + memblock = (DSL_void_t*) malloc((size_t)size); + + return (memblock); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +void DSL_PIPE_Free(DSL_void_t *memblock) +{ + free(memblock); +} + +/** + Open a file. +*/ +FILE *DSL_PIPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode) +{ + return fopen(name, mode); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_PIPE_FClose(FILE *fd) +{ + if(fd != 0) + return fclose(fd); + + return -1; +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_PIPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, FILE *stream) +{ + return fread(buf, size, count, stream); +} + +/** + For a detailed description of the function, its arguments and return value + please refer to the description in the header file 'dsl_cpe_os.h' +*/ +DSL_int_t DSL_PIPE_FPrintf(FILE *stream, const DSL_char_t *format, ...) +{ + va_list ap; /* points to each unnamed arg in turn */ + DSL_int_t nRet = 0; + + va_start(ap, format); /* set ap pointer to 1st unnamed arg */ + + nRet = vfprintf(stream, format, ap); + fflush(stream); + + va_end(ap); + + return nRet; +} +#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/ + +#endif /* LINUX */