You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

CcspCMAgent (CCSP Cable Modem Agent) is the RDK-B middleware component that provides cable modem management and TR-181 data model implementation for DOCSIS-based gateway devices. This component serves as the primary interface between the RDK-B middleware stack and the underlying cable modem hardware, enabling remote management, monitoring, and configuration of cable modem functionality through standardized TR-181 parameters.

CcspCMAgent provides real-time status monitoring, configuration management, and event notification capabilities. It integrates with the WAN Manager for connectivity coordination and supports both traditional message bus communication and modern RBus event-driven architecture for optimal performance and scalability.

graph LR
    subgraph "External Systems"
        RemoteMgmt["Remote Management"]
        LocalUI["Local Web UI"]
        CMTS[DOCSIS CMTS]
    end

    subgraph "RDK-B Platform"
        subgraph "Remote Management Agents"
            ProtocolAgents["Protocol Agents<br>( TR-069, WebPA, USP etc.)"]
        end

        cmAgent["CCSP CMAgent"]

        subgraph "WAN Specific Managers"
            rdkbComponent["Other RDK-B Components ( PSM, PNM, WAN Manager etc.)"]
        end

        subgraph "Platform Layer"
            HAL["CM HAL"]
            Linux["Linux"]
            HW[(Cable Modem<br>Hardware)]
        end
    end

    %% External connections
    RemoteMgmt -->|TR-069/WebPA/TR-369| ProtocolAgents
    LocalUI -->|HTTP/HTTPS| ProtocolAgents
    CMTS -->|RF Signal|HW

    %% Upper layer to CM Agent
    ProtocolAgents -->|IPC| cmAgent

    %% Upper layer to CM Agent
    ProtocolAgents -->|IPC| rdkbComponent
    rdkbComponent <-->|IPC| cmAgent

    %% System integration
    cmAgent <-->|HAL APIs| HAL
    HAL <-->|Drivers| Linux
    Linux -->|Driver Interfaces| HW

    classDef external fill:#fff3e0,stroke:#ef6c00,stroke-width:2px;
    classDef cmAgent fill:#e3f2fd,stroke:#1976d2,stroke-width:3px;
    classDef rdkbComponent fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px;
    classDef system fill:#fce4ec,stroke:#c2185b,stroke-width:2px;

    class RemoteMgmt,LocalUI,CMTS external;
    class cmAgent cmAgent;
    class ProtocolAgents,InterfaceMgr,DHCPMgr,VLANMgr,FirewallMgr,rdkbComponent rdkbComponent;
    class HAL,Linux,HW system;

Key Features & Responsibilities:

  • DOCSIS Cable Modem Management: Provides complete lifecycle management of cable modem operations including registration, authentication, and network access control through BPI (Baseline Privacy Interface) state management
  • TR-181 Data Model Implementation: Implements comprehensive TR-181 parameter support for Device.DeviceInfo, X_CISCO_COM_CableModem, and X_RDKCENTRAL-COM_CableModem objects with full BBF compliance
  • Real-time Status Monitoring: Continuously monitors cable modem RF signal status, DOCSIS link state, and network connectivity with event-driven notifications via RBus
  • WAN Integration Services: Coordinates with WAN Manager for interface provisioning, providing cable modem interface abstraction and boot-time WAN configuration
  • Hardware Abstraction: Interfaces with multiple HAL layers including CM, DHCP, Ethernet switch, MoCA, and platform-specific HALs for comprehensive hardware control
  • Remote Management Support: Enables remote configuration management, firmware download orchestration, and telemetry data collection for service provider operations
  • Event-Driven Architecture: Publishes real-time cable modem events including RF signal changes, link status updates, and registration state transitions via RBus messaging

Design

The CcspCMAgent follows a layered architecture design that separates responsibilities between TR-181 data model management, cable modem hardware abstraction, and inter-component communication. The component is built around a service-oriented architecture where the main SSP (Service Support Platform) layer handles component lifecycle and message bus registration, while specialized middle-layer modules manage TR-181 parameter operations and hardware interaction.

The component's modular design supports extensive customization through compile-time configuration options and runtime parameter tuning, enabling adaptation to various cable modem hardware platforms and service provider requirements. Integration with the WAN Manager is achieved through well-defined IPC mechanisms that coordinate cable modem interface provisioning during boot sequences and handle dynamic configuration changes during runtime operations.

Data persistence is managed through the PSM (Persistent Storage Manager) integration for configuration parameters and syscfg for operational settings, ensuring configuration state survives across system reboots. The component also implements comprehensive error handling and recovery mechanisms, including automatic retry logic for hardware communication failures and graceful degradation when dependent services are unavailable.

flowchart LR
    subgraph CcspCMAgent["CcspCMAgent Component"]
        SSP([SSP Main])
        MSGBUS([Message Bus Interface])
        HELPER([Helper Functions /<br>Utilities])        

        subgraph "TR-181 DML Modules"
            DEVINFO([Device Info DML<br>Device.DeviceInfo.*])
            CMCISCO([Cisco CM DML<br>X_CISCO_COM_CableModem.*])
            CMRDK([CM DML<br>X_RDKCENTRAL-COM_CableModem.*])
        end
        
        subgraph "Event & Communication"
            RBUS([RBus Handler])
            WEBCONFIG([WebConfig API])
        end
        
        subgraph "Hardware Integration"
            INTEGAPI([Integration APIs<br>HAL Abstraction])
            GWPROV([Gateway Provisioning<br>Boot State Machine])
        end   
    end

    SSP --> MSGBUS
    MSGBUS --> DEVINFO
    MSGBUS --> CMCISCO
    MSGBUS --> CMRDK
    
    DEVINFO --> INTEGAPI
    CMCISCO --> INTEGAPI
    CMRDK --> INTEGAPI
    
    RBUS --> INTEGAPI
    WEBCONFIG --> INTEGAPI
    GWPROV --> INTEGAPI
    
    INTEGAPI -.-> HELPER
    DEVINFO -.-> HELPER
    CMCISCO -.-> HELPER
    CMRDK -.-> HELPER
    RBUS -.-> HELPER

Prerequisites and Dependencies

Build-Time Flags and Configuration:

Configure OptionDISTRO FeatureBuild FlagPurposeDefault
--enable-core_net_lib_feature_supportN/ACORE_NET_LIB_FEATURE_SUPPORTEnable advanced networking library supportDisabled

RDK-B Platform and Integration Requirements:

  • RDK-B Components: PSM, CR, WAN Manager for interface coordination, CCSP Message Bus for inter-component communication
  • HAL Dependencies: Cable Modem HAL, DHCP Client HAL, Ethernet Switch HAL, Platform HAL
  • Systemd Services: ccsp-cm-agent.service must start after network-online.target and before wanmanager.service
  • Message Bus: CCSP Message Bus registration with component name "eRT.com.cisco.spvtg.ccsp.cm"
  • TR-181 Data Model: Device.DeviceInfo.* parameter support from Platform Agent, X_CISCO_COM_CableModem.* namespace reservation
  • Configuration Files: CcspCM.cfg, CcspCMDM.cfg, TR181-CM.XML for parameter definitions, /nvram/syscfg.db for persistent configuration
  • Startup Order: Must initialize after PSM and Message Bus but before WAN Manager and dependent networking components

Threading Model:

CcspCMAgent implements a hybrid threading model that combines single-threaded CCSP message bus operations with multi-threaded RBus event handling for optimal performance and resource utilization.

  • Threading Architecture: Multi-threaded with dedicated worker threads for specific operations
  • Main Thread: Handles CCSP message bus operations, TR-181 parameter get/set operations, component lifecycle management, and synchronous HAL interactions
  • Main worker Threads:
    • HAL Monitor Thread: Continuously monitors cable modem RF signal status and DOCSIS link state with configurable polling intervals
  • Synchronization: Uses pthread mutexes for shared data structures, RBus internal synchronization for event publishing, and CCSP-provided synchronization primitives for message bus operations

Component State Flow

Initialization to Active State

The CcspCMAgent component follows a structured initialization sequence that ensures proper dependency resolution and hardware readiness before transitioning to active operational state. The component implements comprehensive error handling during initialization with retry mechanisms for hardware communication failures.

sequenceDiagram
    participant Sys as System
    participant CM as CcspCMAgent

    Note over Sys,CM: Exact Same Flow as State Diagram Above

    Sys->>CM: Start (Initializing)
    CM->>CM: Load TR-181 XML Configuration (LoadingConfig)
    CM->>CM: Parse Parameter Definitions (RegisteringTR181)
    CM->>CM: Register with CCSP Message Bus (ConnectingMessageBus)
    CM->>CM: Connect to Cable Modem HAL (InitializingHAL)
    CM->>CM: Verify WAN Manager Health (CheckingDependencies)
    CM->>CM: Setup RBus Event Publishing (InitializingRBus)
    CM->>CM: Component Ready (Active)
    
    loop Runtime Operations (Active State)
        CM->>CM: Monitor Cable Modem Status (MonitoringCM → Active)
        CM->>CM: Handle TR-181 Requests (ProcessingRequests → Active)
    end
    
    Sys->>CM: Stop Request (Shutdown)
    CM->>CM: Cleanup and Exit

Runtime State Changes and Context Switching

During runtime operations, CcspCMAgent manages multiple operational contexts including DOCSIS registration states, RF signal monitoring, and WAN interface coordination. The component implements state-aware processing to ensure consistent behavior across different cable modem operational states.

State Change Triggers:

  • DOCSIS link status changes trigger immediate event publication and WAN Manager notification
  • RF signal level variations beyond threshold values initiate diagnostic data collection and telemetry reporting
  • Remote configuration updates trigger parameter validation and atomic configuration commits
  • Cable modem registration state changes coordinate with WAN Manager for interface provisioning

Context Switching Scenarios:

  • Boot-time provisioning mode switches to operational monitoring after successful DOCSIS registration
  • Firmware download mode temporarily suspends normal operations and enables download progress monitoring
  • Factory reset mode clears all persistent configuration and reinitializes with default values

Call Flow

Initialization Call Flow:

sequenceDiagram
    participant SystemD as SystemD Service Manager
    participant CMAgent as CcspCMAgent (ssp_main)
    participant CCSP as CCSP Message Bus
    participant HAL as Cable Modem HAL
    participant WanMgr as WAN Manager

    SystemD->>CMAgent: Start ccsp-cm-agent.service
    CMAgent->>CMAgent: Load Configuration Files
    CMAgent->>CCSP: Register Component (eRT.com.cisco.spvtg.ccsp.cm)
    CCSP-->>CMAgent: Registration Complete
    CMAgent->>HAL: Initialize Cable Modem HAL
    HAL-->>CMAgent: HAL Ready
    CMAgent->>WanMgr: Check WAN Manager Health
    WanMgr-->>CMAgent: Health Status OK
    CMAgent->>CMAgent: Initialize RBus Event Publishing
    CMAgent->>SystemD: Signal Service Ready (sd_notify)

Cable Modem Status Monitoring Call Flow:

sequenceDiagram
    participant RBusSub as RBus Subscribers
    participant CMAgent as CcspCMAgent (RBus Handler)
    participant HAL as Cable Modem HAL
    participant DOCSIS as DOCSIS Firmware

    loop Every 5 seconds
        CMAgent->>HAL: docsis_IsEnergyDetected()
        HAL->>DOCSIS: Check RF Signal Status
        DOCSIS-->>HAL: RF Signal Level
        HAL-->>CMAgent: Signal Status (true/false)
        
        alt RF Status Changed
            CMAgent->>CMAgent: Update Internal State
            CMAgent->>RBusSub: Publish CableModemRfSignalStatus Event
            RBusSub-->>CMAgent: Event Acknowledgment
        end
    end

TR‑181 Data Models

Supported TR-181 Parameters

CcspCMAgent implements comprehensive TR-181 data model support following BBF specification guidelines with both standard Device.DeviceInfo parameters and vendor-specific extensions for cable modem functionality. The component provides full compliance with TR-181 Issue 2 Amendment 15 specifications while supporting custom extensions for advanced cable modem operations.

Object Hierarchy

Device.
├── DeviceInfo.
│   ├── SerialNumber (string, R)
│   ├── ModelName (string, R)  
│   ├── Description (string, R)
│   ├── ProductClass (string, R)
│   ├── ManufacturerOUI (string, R)
│   └── HardwareVersion (string, R)
└── X_CISCO_COM_CableModem.
    ├── TelephonyDHCPStatus (string, R)
    ├── TelephonyTftpStatus (string, R)
    ├── TelephonyRegistrationStatus (string, R)
    ├── DOCSISDHCPAttempts (unsignedInt, R)
    ├── DOCSISTftpAttempts (unsignedInt, R)
    ├── MaxCpeAllowed (unsignedInt, R)
    ├── DOCSISConfigFileName (string, R)
    ├── ToDStatus (string, R)
    ├── UpstreamServiceFlowParams (string, R)
    ├── DownstreamServiceFlowParams (string, R)
    ├── DOCSISDownstreamDataRate (string, R)
    ├── DOCSISUpstreamDataRate (string, R)
    ├── MACAddress (string, R)
    ├── BPIState (boolean, R)
    ├── NetworkAccess (boolean, R)
    ├── UpgradeServerIP (string, R)
    ├── Market (string, R)
    ├── MDDIPOverride (string, R)
    ├── IPAddress (string, R)
    ├── BootFileName (string, R)
    ├── SubnetMask (string, R)
    ├── Gateway (string, R)
    └── X_RDKCENTRAL-COM_CableModem.
        ├── X_RDKCENTRAL-COM_FirmwareDownloadStatus (string, R/W)
        ├── X_RDKCENTRAL-COM_FirmwareDownloadProtocol (string, R/W)
        ├── X_RDKCENTRAL-COM_FirmwareDownloadURL (string, R/W)
        ├── X_RDKCENTRAL-COM_FirmwareToDownload (string, R/W)
        ├── X_RDKCENTRAL-COM_FirmwareDownloadNow (boolean, R/W)
        ├── X_RDKCENTRAL-COM_CableRfSignalStatus (boolean, R)
        └── DsOfdmChan.{i}.
            ├── ChannelId (unsignedInt, R)
            ├── CenterFrequency (unsignedInt, R)
            ├── SubcarrierSpacing (unsignedInt, R)
            ├── CyclicPrefix (string, R)
            ├── RollOffPeriod (string, R)
            ├── PlcTotalCodewords (unsignedLong, R)
            ├── PlcUnreliableCodewords (unsignedLong, R)
            └── NcpTotalFields (unsignedLong, R)

Parameter Definitions

Core Device Information Parameters:

Parameter PathData TypeAccessDefault ValueDescriptionBBF Compliance
Device.DeviceInfo.SerialNumberstringR""Unique serial number assigned by the manufacturer for device identification and service provisioningTR-181 Issue 2
Device.DeviceInfo.ModelNamestringR""Model name of the device as assigned by the manufacturer, used for device capability identificationTR-181 Issue 2
Device.DeviceInfo.DescriptionstringR""Textual description of the device including manufacturer, model, and basic capability informationTR-181 Issue 2
Device.DeviceInfo.ProductClassstringR""Product class identifier that categorizes the device type and expected feature set for management purposesTR-181 Issue 2
Device.DeviceInfo.ManufacturerOUIstringR""Organizationally Unique Identifier (OUI) of the device manufacturer as assigned by IEEE registration authorityTR-181 Issue 2
Device.DeviceInfo.HardwareVersionstringR""Hardware version string assigned by manufacturer, typically indicating PCB revision and component specificationsTR-181 Issue 2

Cable Modem Core Parameters:

Parameter PathData TypeAccessDefault ValueDescriptionBBF Compliance
Device.X_CISCO_COM_CableModem.TelephonyDHCPStatusstringR""Current DHCP status for telephony services including states: NotStarted, InProgress, Complete, Failed, RenewingCustom Extension
Device.X_CISCO_COM_CableModem.TelephonyTftpStatusstringR""TFTP provisioning status for telephony configuration with enumerated values: NotStarted, InProgress, Complete, FailedCustom Extension
Device.X_CISCO_COM_CableModem.DOCSISDHCPAttemptsunsignedIntR0Total number of DHCP attempts made by cable modem during current boot cycle for IP address acquisitionCustom Extension
Device.X_CISCO_COM_CableModem.DOCSISTftpAttemptsunsignedIntR0Number of TFTP configuration file download attempts during cable modem registration processCustom Extension
Device.X_CISCO_COM_CableModem.BPIStatebooleanRfalseBaseline Privacy Interface (BPI) encryption state indicating whether data encryption is active on cable modem interfaceCustom Extension
Device.X_CISCO_COM_CableModem.NetworkAccessbooleanRfalseNetwork access permission status controlled by CMTS authorization policies and service flow configurationsCustom Extension
Device.X_CISCO_COM_CableModem.MACAddressstringR""Hardware MAC address of cable modem interface used for DOCSIS registration and network identificationCustom Extension

RDK Central Extensions:

Parameter PathData TypeAccessDefault ValueDescriptionBBF Compliance
Device.X_CISCO_COM_CableModem.X_RDKCENTRAL-COM_FirmwareDownloadStatusstringR/W"Not Started"Current firmware download status with values: Not Started, In Progress, Complete, Failed, CancelledCustom Extension
Device.X_CISCO_COM_CableModem.X_RDKCENTRAL-COM_FirmwareDownloadURLstringR/W""URL for firmware image download supporting HTTP, HTTPS, and TFTP protocols with authentication supportCustom Extension
Device.X_CISCO_COM_CableModem.X_RDKCENTRAL-COM_FirmwareDownloadNowbooleanR/WfalseTrigger parameter to initiate immediate firmware download when set to true, automatically resets to falseCustom Extension
Device.X_CISCO_COM_CableModem.X_RDKCENTRAL-COM_CableRfSignalStatusbooleanRfalseReal-time RF signal detection status indicating presence of cable modem RF carrier signal for diagnosticsCustom Extension

Parameter Registration and Access

  • Implemented Parameters: CcspCMAgent implements 45+ TR‑181 parameters across Device.DeviceInfo, X_CISCO_COM_CableModem, and X_RDKCENTRAL-COM_CableModem namespaces with complete validation and constraint enforcement
  • Parameter Registration: Parameters are registered through CCSP Message Bus using component name "eRT.com.cisco.spvtg.ccsp.cm" with automatic namespace collision detection and resolution
  • Access Mechanism: External components access parameters via CCSP Message Bus GetParameterValues/SetParameterValues operations with full transaction support and atomic commit capabilities
  • Validation Rules: String parameters enforce maximum length constraints, numeric parameters validate range boundaries, and boolean parameters ensure proper true/false value conversion

Internal Modules

CcspCMAgent is organized into specialized modules that handle distinct aspects of cable modem management and TR-181 data model implementation. Each module encapsulates specific functionality while maintaining clean interfaces for inter-module communication and external component integration.

Module/ClassDescriptionKey Files
SSP MainPrimary service support platform module handling component lifecycle, CCSP message bus registration, systemd service management, and dependency health monitoringssp_main.c, ssp_global.h, ssp_internal.h
Message Bus InterfaceCCSP message bus communication handler managing parameter get/set operations, component registration, and inter-component messaging protocolsssp_messagebus_interface.c, ssp_messagebus_interface.h
Device Info DMLDevice.DeviceInfo TR-181 parameter implementation providing read-only device identification parameters including serial number, model, and manufacturer informationcosa_device_info_dml.c, cosa_device_info_dml.h, cosa_device_info_internal.c
Cisco CableModem DMLX_CISCO_COM_CableModem TR-181 object implementation handling DOCSIS-specific parameters, telephony status, and service flow managementcosa_x_cisco_com_cablemodem_dml.c, cosa_x_cisco_com_cablemodem_dml.h, cosa_x_cisco_com_cablemodem_internal.c
RDK Central CableModem DMLX_RDKCENTRAL-COM_CableModem TR-181 extensions for firmware management, RF signal monitoring, and advanced diagnostic capabilitiescosa_x_rdkcentral_com_cablemodem_dml.c, cosa_x_rdkcentral_com_cablemodem_dml.h, cosa_x_rdkcentral_com_cablemodem_internal.c
RBus HandlerModern event-driven messaging system for real-time cable modem status publishing, subscriber management, and high-performance event distributioncosa_rbus_handler_apis.c, cosa_rbus_handler_apis.h
Integration APIsHardware abstraction layer interface providing unified access to cable modem HAL, DHCP client HAL, and other hardware-specific operationscosa_x_cisco_com_cablemodem_apis.c, cosa_x_rdkcentral_com_cablemodem_apis.c
Helper FunctionsUtility module providing common operations including string manipulation, parameter validation, memory management, and logging facilitiescmagent_helpers.c, cmagent_helpers.h
Gateway ProvisioningCable modem provisioning state machine managing boot-time registration, WAN interface coordination, and service provider configuration workflowsgw_prov_sm.c, gw_prov_sm.h, gw_prov_abstraction.h

Component Interactions

CcspCMAgent maintains interactions with RDK-B middleware components, HAL layers, and external systems to provide comprehensive cable modem management functionality. The component serves as a critical integration point between higher-level management services and underlying hardware capabilities.

Interaction Matrix

Target Component/LayerInteraction PurposeIPC MechanismMessage FormatCommunication PatternKey APIs/Endpoints
RDK-B Middleware Components
WAN ManagerInterface status reporting, boot-time WAN configuration coordinationCCSP Message BusCCSP Parameter XMLSynchronous Request-ResponseGetParameterValues, SetParameterValues, GetHealth
Persistent Storage ManagerConfiguration parameter persistence, factory reset coordinationCCSP Message BusCCSP Parameter XMLSynchronous Request-ResponsePSM_Get_Record_Value, PSM_Set_Record_Value
Log AgentCable modem telemetry data, RF signal diagnostics, DOCSIS event loggingRBusJSON Event ObjectsAsynchronous Publish-SubscribeDevice.LogAgent.X_RDKCENTRAL-COM_CM_LogLevel
TR-069 Protocol AgentDevice identification parameters, cable modem status informationCCSP Message BusCCSP Parameter XMLSynchronous Request-ResponseDevice.DeviceInfo.*, Device.X_CISCO_COM_CableModem.*
System & HAL Layers
Cable Modem HALDOCSIS registration control, RF signal monitoring, MAC address retrievalDirect Function CallsC StructuresSynchronous Function Callsdocsis_IsEnergyDetected(), docsis_GetCMStatus(), docsis_GetMACAddress()
DHCP Client HALIP address configuration, DHCP lease management, gateway configurationDirect Function CallsC StructuresSynchronous Function Callsdhcpv4c_get_ert_lease(), dhcpv4c_get_ert_config_attempts()
Ethernet Switch HALLAN port configuration, bridge interface managementDirect Function CallsC StructuresSynchronous Function CallsGWP_GetEthWanLinkStatus(), GWP_SetEthWanLinkStatus()
Platform HALSystem information, hardware identification, factory reset operationsDirect Function CallsC StructuresSynchronous Function Callsplatform_hal_GetSerialNumber(), platform_hal_GetModelName()
External Systems
DOCSIS Network (CMTS)Cable modem registration, service flow provisioning, network access authorizationDOCSIS ProtocolDOCSIS MAC MessagesBi-directional ProtocolDOCSIS MAC Management Messages

Main events Published by CcspCMAgent:

Event NameEvent Topic/PathTrigger ConditionSubscriber Components
DocsisLinkStatusDevice.X_CISCO_COM_CableModem.DocsisLinkStatusDOCSIS link up/down state changeWAN Manager, Log Agent
CableModemRfSignalStatusDevice.X_CISCO_COM_CableModem.X_RDKCENTRAL-COM_CableRfSignalStatusRF signal detection changeWAN Manager, Diagnostic Agents
FirmwareDownloadStatusDevice.X_CISCO_COM_CableModem.X_RDKCENTRAL-COM_FirmwareDownloadStatusFirmware download progress/completionSystem Manager, Log Agent

IPC Flow Patterns

Primary IPC Flow - TR-181 Parameter Access:

sequenceDiagram
    participant Client as External Client (TR-069 PA)
    participant CCSP as CCSP Message Bus
    participant CMAgent as CcspCMAgent
    participant HAL as Cable Modem HAL
    participant HW as DOCSIS Hardware

    Client->>CCSP: GetParameterValues("Device.X_CISCO_COM_CableModem.MACAddress")
    CCSP->>CMAgent: RBUS GetParameterValues Request
    CMAgent->>HAL: docsis_GetMACAddress()
    HAL->>HW: Hardware Register Read
    HW-->>HAL: MAC Address Data
    HAL-->>CMAgent: MAC Address String
    CMAgent-->>CCSP: Parameter Value Response
    CCSP-->>Client: GetParameterValues Response (success/error)

Event Notification Flow:

%%{init: { "config": { "useMaxWidth": false } }}%%
sequenceDiagram
    participant HW as DOCSIS Hardware
    participant HAL as Cable Modem HAL
    participant CMAgent as CcspCMAgent (RBus Thread)
    participant RBus as RBus Message Bus
    participant Sub1 as WAN Manager
    participant Sub2 as Log Agent

    loop Every 5 seconds
        CMAgent->>HAL: docsis_IsEnergyDetected()
        HAL->>HW: Check RF Signal Status
        HW-->>HAL: Signal Present/Absent
        HAL-->>CMAgent: Boolean Status
        
        alt Status Changed
            CMAgent->>RBus: Publish CableModemRfSignalStatus Event
            RBus->>Sub1: Event Notification
            RBus->>Sub2: Event Notification
            Sub1-->>RBus: Ack (if required)
            Sub2-->>RBus: Ack (if required)
        end
    end

Implementation Details

Major HAL APIs Integration

CcspCMAgent integrates with multiple HAL interfaces to provide comprehensive cable modem hardware abstraction and control. The component implements robust error handling and retry mechanisms for all HAL interactions to ensure reliable operation under various hardware conditions.

Core HAL APIs:

HAL APIPurposeImplementation File
docsis_IsEnergyDetectedMonitor cable modem RF signal presence for connectivity diagnosticscosa_x_cisco_com_cablemodem_apis.c
docsis_GetCMStatusRetrieve comprehensive cable modem operational statuscosa_x_cisco_com_cablemodem_apis.c
docsis_GetMACAddressGet cable modem hardware MAC address for identificationcosa_x_cisco_com_cablemodem_apis.c
dhcpv4c_get_ert_leaseRetrieve current DHCP lease information for erouter interfacecosa_x_cisco_com_cablemodem_apis.c
platform_hal_GetSerialNumberGet device serial number from platform hardwarecosa_device_info_apis.c
platform_hal_GetModelNameRetrieve device model name from platform configurationcosa_device_info_apis.c
GWP_GetEthWanLinkStatusCheck Ethernet WAN link status for connectivity validationcosa_x_cisco_com_cablemodem_apis.c

Key Implementation Logic

  • Cable Modem State Machine: Core state management logic in gw_prov_sm.c handles DOCSIS registration phases including initial scanning, ranging, DHCP discovery, TFTP configuration download, and operational state transitions with comprehensive error recovery mechanisms

  • RF Signal Monitoring Engine: Real-time RF signal detection logic in cosa_rbus_handler_apis.c implements continuous monitoring with configurable polling intervals, threshold-based event triggering, and automatic subscriber notification for signal presence changes. Configurable polling interval (default 5 seconds) with adaptive frequency based on signal stability. Event debouncing to prevent spurious notifications during signal fluctuations. Integration with diagnostic data collection for signal quality analysis.

  • Event Processing Architecture: Asynchronous event handling system supporting both CCSP message bus and RBus protocols for maximum compatibility and performance. Multi-threaded event processing with dedicated RBus worker thread. Event queue management with priority-based processing and overflow protection. Subscriber lifecycle management with automatic cleanup and reconnection handling.

  • Error Handling Strategy: Comprehensive error detection and recovery mechanisms throughout all hardware interaction layers. HAL operation retry logic with exponential backoff for transient failures. Component health monitoring with automatic restart coordination via systemd. Graceful degradation modes when dependent services are unavailable.

  • Logging & Debugging: Multi-level logging system with component-specific categories and runtime verbosity control. CCSP trace integration for standardized RDK-B logging infrastructure. RBus event logging for real-time debugging of cable modem state changes. Performance metrics collection for HAL operation timing and success rates.

Key Configuration Files

Configuration FilePurposeOverride Mechanisms
/etc/ccsp/cm.cfgMain component configurationEnvironment variables, compile-time defines
/etc/ccsp/TR181-CM.XMLTR‑181 parameter definitionsNot user-configurable


  • No labels