
{"id":12859,"date":"2026-03-31T06:21:48","date_gmt":"2026-03-31T06:21:48","guid":{"rendered":"https:\/\/developer.rdkcentral.com\/documentation\/?page_id=12859"},"modified":"2026-03-31T07:38:45","modified_gmt":"2026-03-31T07:38:45","slug":"onewifi","status":"publish","type":"page","link":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/","title":{"rendered":"OneWifi"},"content":{"rendered":"\n<p>OneWifi is the RDK-B component responsible for WiFi management, providing control of WiFi parameters, statistics, telemetry, client steering, and optimization across both Gateway and Extender devices. This component is the central WiFi management system for RDK platforms, handling operations across multiple radios, Virtual Access Points (VAPs), and specialized applications. OneWifi bridges high-level configuration interfaces (TR-181 and JSON-based WebConfig) with underlying hardware via the Hardware Abstraction Layer (HAL).<\/p>\n\n\n\n<p>OneWifi manages radio configuration, VAP management, client association handling, DFS channel management, security configuration, and WiFi 6E\/7 support. It implements TR-181 data model parameters for WiFi management and integrates with WebPA for cloud-based configuration and monitoring. OneWifi orchestrates all WiFi-related functionality, coordinating between configuration sources, internal database, control engine, and hardware abstraction layer. VAPs are categorized by service type prefixes including private_ssid, iot_ssid, hotspot, and mesh_backhaul to distinguish different service purposes.<\/p>\n\n\n\n<p>The component supports mesh WiFi (EasyMesh Multi-AP protocol), WiFi optimization (client steering), performance measurement (Blaster), motion detection (CSI analytics), channel availability checking (CAC), and statistics collection through a modular application framework. For mesh networking, the system supports both Gateway and Extender device roles with automatic backhaul selection using ranking algorithms based on SNR and Channel Utilization.<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">graph LR\n    subgraph \"External Systems\"\n        RemoteMgmt[\"Remote Management\"]\n        LocalUI[\"Local Web UI\"]\n        CloudSvc[\"Cloud Services\"]\n    end\n\n    subgraph \"RDK-B Platform\"\n        subgraph \"Remote Management Agents\"\n            ProtocolAgents[\"Protocol Agents&lt;br>(TR-069, WebPA)\"]\n        end\n\n        PandM[\"PandM\"]\n        PSM[\"CCSP PSM\"]\n        OneWifi[\"OneWifi Component\"]\n        OtherComponents[\"Other RDK-B Components\"]\n\n        subgraph \"Platform Layer\"\n            HAL[\"WiFi HAL\"]\n            Hostapd[\"hostapd\/wpa_supplicant\"]\n            Linux[\"Linux System\"]\n        end\n    end\n\n    RemoteMgmt -->|TR-069\/WebPA| ProtocolAgents\n    LocalUI -->|HTTP\/HTTPS| ProtocolAgents\n    CloudSvc -->|WebConfig JSON| OneWifi\n\n    ProtocolAgents -->|R-BUS| OneWifi\n\n    OneWifi -->|R-BUS| PandM\n    OneWifi -->|R-BUS| PSM\n    OneWifi -->|R-BUS| OtherComponents\n\n    OneWifi &lt;-->|HAL APIs| HAL\n\n    HAL &lt;-->|nl80211| Hostapd\n    Hostapd &lt;-->|Driver Interface| Linux\n    OneWifi &lt;-->|System Events| Linux\n\n    classDef external fill:#fff3e0,stroke:#ef6c00,stroke-width:2px;\n    classDef onewifi fill:#e3f2fd,stroke:#1976d2,stroke-width:3px;\n    classDef rdkbComponent fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px;\n    classDef system fill:#fce4ec,stroke:#c2185b,stroke-width:2px;\n\n    class RemoteMgmt,LocalUI,CloudSvc external;\n    class OneWifi onewifi;\n    class ProtocolAgents,PandM,PSM,OtherComponents rdkbComponent;\n    class HAL,Hostapd,Linux system;<\/pre><\/div>\n\n\n\n<p><strong>Key Features &amp; Responsibilities<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Unified WiFi Management<\/strong>: Centralized control of all WiFi operations including radio configuration, VAP management, client associations, and security settings across multiple radios and service types<\/li>\n\n\n\n<li><strong>Multi-Interface Configuration<\/strong>: Supports TR-181 data model access and JSON-based WebConfig for flexible configuration from local management interfaces and cloud services<\/li>\n\n\n\n<li><strong>Event-Driven Control Engine<\/strong>: Real-time processing of hardware events, configuration changes, and application requests through an event queue architecture with database synchronization<\/li>\n\n\n\n<li><strong>Application Framework<\/strong>: Hosts specialized applications including EasyMesh (Multi-AP), Statistics Monitor, Blaster (performance testing), CSI (motion detection), CAC (channel availability), and client steering<\/li>\n\n\n\n<li><strong>Hardware Abstraction<\/strong>: Interfaces with WiFi HAL providing platform-independent WiFi management supporting WiFi 5\/6\/6E\/7 standards and vendor-specific features<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Design<\/strong><\/h2>\n\n\n\n<p>OneWifi follows a layered, event-driven architecture designed to provide centralized WiFi management while maintaining separation between configuration interfaces, control logic, persistent storage, and hardware abstraction. The design emphasizes modularity, scalability, and real-time responsiveness to both configuration changes and hardware events. The architecture separates concerns between external configuration sources (TR-181 DML and WebConfig), the central WiFi manager, control engine, database layer, and hardware abstraction layer through well-defined interfaces.<\/p>\n\n\n\n<p>The component operates as a central orchestrator coordinating between multiple subsystems. The WiFi Manager (wifi_mgr_t) maintains global state including radio configurations, VAP mappings, hardware capabilities, and handles for database and control engine instances. The Control Engine (wifi_ctrl_t) processes events from an internal queue including database updates, HAL indications, timeout events, and application requests. The database layer uses OVSDB-based persistent storage with in-memory caching for performance. Configuration changes flow through validation, normalization, and apply pipelines to maintain consistency between external interfaces, internal state, and hardware configuration.<\/p>\n\n\n\n<p>The northbound interface uses TR-181 compliant access through R-BUS messaging for integration with other RDK-B components and external management systems. WebConfig integration handles cloud-based configuration through JSON subdocuments with schema validation. The southbound interface abstracts hardware interactions through WiFi HAL APIs supporting multiple vendor platforms. Data persistence is achieved through OVSDB database integration with PSM for non-volatile storage across reboots. The application framework allows specialized applications to register for events and extend WiFi functionality without modifying core logic. When CONFIG_IEEE80211BE is enabled, OneWifi supports WiFi 7 (802.11be) Multi-Link Operation (MLO) and Multi-Link Device (MLD) management. The MLO architecture tracks Multi-Link Device identifiers using UNDEFINED_MLD_ID and MLD_UNIT_COUNT constants, implements Wi-Fi Alliance data model extensions in wfa_dml_cb.c for APMLD (Access Point Multi-Link Device) and STAMLD (Station Multi-Link Device) identity tracking, and supports simultaneous operation across 2.4GHz, 5GHz, and 6GHz bands with coordinated channel selection and DFS handling. The OVSDB schema includes versioning flag ONEWIFI_DB_VERSION_UPDATE_MLD_FLAG for WiFi 7 MLD support, while hostapd applies over 30 patches for MLO configuration with independent security, QoS, and power management settings per physical link while maintaining unified MLD identity.<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">graph TD\n    subgraph ExternalSystems [\"External Systems\"]\n        RemoteMgmt[\"Remote Management Systems\"]\n        CloudServices[\"Cloud Services\"]\n    end\n\n    subgraph OneWifiComponent [\"OneWifi\"]\n        subgraph CoreManagement [\"WiFi Manager Core\"]\n            WifiMgr[\"WiFi Manager&lt;br\/>wifi_mgr_t\"]\n            CtrlEngine[\"Control Engine&lt;br\/>wifi_ctrl_t\"]\n        end\n        \n        subgraph ConfigHandlers [\"Configuration Handlers\"]\n            DMLHandler[\"TR-181 DML Handler\"]\n            WebCfgHandler[\"WebConfig Handler\"]\n        end\n        \n        subgraph DataLayer [\"Database &amp; Persistence\"]\n            DBLayer[\"Database Layer&lt;br\/>wifi_db_t\"]\n            OVSDB[\"OVSDB Tables\"]\n        end\n        \n        subgraph AppFramework [\"Application Framework\"]\n            Apps[\"Specialized Applications&lt;br\/>(EasyMesh, Stats, Blaster, CSI, CAC)\"]\n        end\n    end\n\n    subgraph RDKBComponents [\"RDK-B Components\"]\n        OtherRDKB[\"Other RDK-B Components\"]\n        PSM[\"CCSP PSM\"]\n    end\n\n    RemoteMgmt --> DMLHandler\n    CloudServices --> WebCfgHandler\n    \n    DMLHandler --> WifiMgr\n    WebCfgHandler --> WifiMgr\n    WifiMgr --> CtrlEngine\n    WifiMgr --> DBLayer\n    WifiMgr --> Apps\n    \n    DBLayer --> OVSDB\n    DBLayer &lt;--> PSM\n    DMLHandler &lt;--> OtherRDKB<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites and Dependencies<\/h3>\n\n\n\n<p><strong>Build-Time Flags and Configuration:<\/strong><\/p>\n\n\n\n<p>Build-time configuration options, DISTRO features, and compiler flags from Yocto recipe files (<a href=\"http:\/\/ccsp-one-wifi.bb\">ccsp-one-wifi.bb<\/a>, ccsp-one-wifi.bbappend, <a href=\"http:\/\/ccsp-one-wifi-libwebconfig.bb\">ccsp-one-wifi-libwebconfig.bb<\/a>, ccsp-one-wifi-libwebconfig.bbappend).<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Configure Option<\/th><th>DISTRO Feature<\/th><th>Build Flag<\/th><th>Purpose<\/th><th>Default<\/th><\/tr><\/thead><tbody><tr><td><code>ONEWIFI_CAC_APP_SUPPORT=true<\/code><\/td><td><code>cac<\/code><\/td><td><code>-DONEWIFI_CAC_APP_SUPPORT<\/code><\/td><td>Enable Connection Admission Control application for DFS channel availability checking<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_DML_SUPPORT_MAKEFILE=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_DML_SUPPORT<\/code><\/td><td>Enable TR-181 Data Model Layer support for RDK-B integration<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_CSI_APP_SUPPORT=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_CSI_APP_SUPPORT<\/code><\/td><td>Enable Channel State Information application for motion detection and analytics<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_MOTION_APP_SUPPORT=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_MOTION_APP_SUPPORT<\/code><\/td><td>Enable motion sensing application using CSI data<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_HARVESTER_APP_SUPPORT=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_HARVESTER_APP_SUPPORT<\/code><\/td><td>Enable data harvester application for telemetry collection<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_ANALYTICS_APP_SUPPORT=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_ANALYTICS_APP_SUPPORT<\/code><\/td><td>Enable WiFi analytics application for performance monitoring<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_LEVL_APP_SUPPORT=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_LEVL_APP_SUPPORT<\/code><\/td><td>Enable LEVL application support<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_WHIX_APP_SUPPORT=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_WHIX_APP_SUPPORT<\/code><\/td><td>Enable WHIX\/Ignite client steering and link quality management<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_BLASTER_APP_SUPPORT=true<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_BLASTER_APP_SUPPORT<\/code><\/td><td>Enable Blaster application for active WiFi performance measurement<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_MEMWRAPTOOL_APP_SUPPORT=true<\/code><\/td><td><code>Memwrap_Tool<\/code><\/td><td><code>-DONEWIFI_MEMWRAPTOOL_APP_SUPPORT<\/code><\/td><td>Enable memory wrapper tool for memory profiling and leak detection<\/td><td>Disabled<\/td><\/tr><tr><td><code>ONEWIFI_RDKB_APP_SUPPORT<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_RDKB_APP_SUPPORT<\/code><\/td><td>Enable RDK-B specific application layer integration<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_DB_SUPPORT<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_DB_SUPPORT<\/code><\/td><td>Enable OVSDB database layer support<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_RDKB_CCSP_SUPPORT<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_RDKB_CCSP_SUPPORT<\/code><\/td><td>Enable RDK-B platform integration<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_OVSDB_TABLE_SUPPORT<\/code><\/td><td>N\/A<\/td><td><code>-DONEWIFI_OVSDB_TABLE_SUPPORT<\/code><\/td><td>Enable OVSDB table management support<\/td><td>Enabled<\/td><\/tr><tr><td><code>ONEWIFI_STA_MGR_APP_SUPPORT=true<\/code><\/td><td><code>sta_manager<\/code><\/td><td><code>-DONEWIFI_STA_MGR_APP_SUPPORT<\/code><\/td><td>Enable Station Manager application for client mode operations<\/td><td>Disabled<\/td><\/tr><tr><td><code>FEATURE_OFF_CHANNEL_SCAN_5G=true<\/code><\/td><td><code>offchannel_scan_5g<\/code><\/td><td>N\/A<\/td><td>Enable off-channel scanning capability for 5GHz band<\/td><td>Disabled<\/td><\/tr><tr><td>N\/A<\/td><td><code>meshwifi<\/code><\/td><td><code>-DENABLE_FEATURE_MESHWIFI<\/code><\/td><td>Enable Mesh WiFi capabilities and EasyMesh protocol support<\/td><td>Disabled<\/td><\/tr><tr><td>N\/A<\/td><td><code>wps_support<\/code><\/td><td><code>-DFEATURE_SUPPORT_WPS<\/code><\/td><td>Enable WiFi Protected Setup (WPS) functionality<\/td><td>Disabled<\/td><\/tr><tr><td><code>--enable-easyconnect<\/code><\/td><td><code>EasyConnect<\/code><\/td><td>N\/A<\/td><td>Enable WiFi Easy Connect (DPP) protocol support<\/td><td>Disabled<\/td><\/tr><tr><td>N\/A<\/td><td><code>CONFIG_IEEE80211BE<\/code><\/td><td><code>-DCONFIG_IEEE80211BE<\/code><\/td><td>Enable WiFi 7 (802.11be) and MLO\/MLD support<\/td><td>Disabled<\/td><\/tr><tr><td><code>--enable-sm-app<\/code><\/td><td><code>sm_app<\/code><\/td><td>N\/A<\/td><td>Enable Statistics Manager application<\/td><td>Disabled<\/td><\/tr><tr><td>N\/A<\/td><td><code>halVersion3<\/code><\/td><td><code>-DWIFI_HAL_VERSION_3<\/code><\/td><td>Enable WiFi HAL Version 3 API support<\/td><td>Enabled<\/td><\/tr><tr><td>N\/A<\/td><td><code>always_enable_ax_2g<\/code><\/td><td><code>-DALWAYS_ENABLE_AX_2G<\/code><\/td><td>Force enable WiFi 6 (802.11ax) on 2.4GHz band<\/td><td>Disabled<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>RDK-B Platform and Integration Requirements:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>DISTRO Features<\/strong>: Core features include&nbsp;<code>halVersion3<\/code>&nbsp;for WiFi HAL v3 support,&nbsp;<code>systemd<\/code>&nbsp;for service management, optional features include&nbsp;<code>meshwifi<\/code>,&nbsp;<code>cac<\/code>,&nbsp;<code>sta_manager<\/code>,&nbsp;<code>Memwrap_Tool<\/code>,&nbsp;<code>wps_support<\/code>,&nbsp;<code>EasyConnect<\/code>,&nbsp;<code>CONFIG_IEEE80211BE<\/code><\/li>\n\n\n\n<li><strong>Build Dependencies<\/strong>:&nbsp;<code>webconfig-framework<\/code>,&nbsp;<code>telemetry<\/code>,&nbsp;<code>libsyswrapper<\/code>,&nbsp;<code>libev<\/code>,&nbsp;<code>rbus<\/code>,&nbsp;<code>libnl<\/code>,&nbsp;<code>ccsp-one-wifi-libwebconfig<\/code>,&nbsp;<code>trower-base64<\/code>,&nbsp;<code>ccsp-common-library<\/code>,&nbsp;<code>utopia<\/code>,&nbsp;<code>libunpriv<\/code>,&nbsp;<code>jansson<\/code>,&nbsp;<code>opensync-headers<\/code>,&nbsp;<code>avro-c<\/code>,&nbsp;<code>libparodus<\/code><\/li>\n\n\n\n<li><strong>RDK-B Components<\/strong>:&nbsp;<code>CcspPandM<\/code>,&nbsp;<code>CcspPsm<\/code>,&nbsp;<code>CcspCommonLibrary<\/code>,&nbsp;<code>CcspCrSsp<\/code>, optional&nbsp;<code>WiFiCnxCtrl<\/code>&nbsp;(if&nbsp;<code>cac<\/code>&nbsp;enabled),&nbsp;<code>WiFiStaManager<\/code>&nbsp;(if&nbsp;<code>sta_manager<\/code>&nbsp;enabled)<\/li>\n\n\n\n<li><strong>HAL Dependencies<\/strong>:&nbsp;<code>rdk-wifi-halif<\/code>&nbsp;(WiFi HAL interface definitions),&nbsp;<code>rdk-wifi-hal<\/code>&nbsp;(HAL implementation),&nbsp;<code>hal-cm<\/code>,&nbsp;<code>hal-dhcpv4c<\/code>,&nbsp;<code>hal-ethsw<\/code>,&nbsp;<code>hal-moca<\/code>,&nbsp;<code>hal-mso_mgmt<\/code>,&nbsp;<code>hal-mta<\/code>,&nbsp;<code>hal-platform<\/code>,&nbsp;<code>hal-vlan<\/code><\/li>\n\n\n\n<li><strong>Systemd Services<\/strong>:&nbsp;<code>CcspCrSsp.service<\/code>,&nbsp;<code>CcspPsmSsp.service<\/code>&nbsp;must be active before&nbsp;<code>OneWifi.service<\/code>&nbsp;starts; optional&nbsp;<code>wifi-telemetry.target<\/code>&nbsp;and&nbsp;<code>wifi-telemetry-cron.service<\/code>&nbsp;for telemetry collection<\/li>\n\n\n\n<li><strong>Hardware Requirements<\/strong>: WiFi radio hardware supporting nl80211 interface, minimum WiFi 5 (802.11ac) support, optional WiFi 6\/6E\/7 support based on build flags<\/li>\n\n\n\n<li><strong>Message Bus<\/strong>: R-BUS registration under\u00a0<code>Device.WiFi.*<\/code>\u00a0namespace for TR-181 parameter access and event notifications<\/li>\n\n\n\n<li><strong>TR-181 Data Model<\/strong>: Complete Device.WiFi.* object hierarchy including Device.WiFi.Radio.{i}, Device.WiFi.SSID.{i}, Device.WiFi.AccessPoint.{i}, Device.WiFi.EndPoint.{i} for WiFi management<\/li>\n\n\n\n<li><strong>Configuration Files<\/strong>:&nbsp;<code>CcspWifi.cfg<\/code>&nbsp;for component configuration,&nbsp;<code>CcspDmLib.cfg<\/code>&nbsp;for data model library settings,&nbsp;<code>rdkb-wifi.ovsschema<\/code>&nbsp;for OVSDB schema,&nbsp;<code>WifiSingleClient.avsc<\/code>&nbsp;and&nbsp;<code>WifiSingleClientActiveMeasurement.avsc<\/code>&nbsp;for Avro telemetry schemas<\/li>\n\n\n\n<li><strong>Startup Order<\/strong>: Network interfaces must be initialized, R-BUS services running, PSM services active, HAL components loaded before OneWifi initialization<\/li>\n\n\n\n<li><strong>Resource Constraints<\/strong>: Multi-threaded application requiring mutex synchronization, event queue processing, database caching, recommended minimum 256MB RAM allocation for WiFi subsystem<\/li>\n<\/ul>\n\n\n\n<p><strong>Threading Model:<\/strong><\/p>\n\n\n\n<p>OneWifi implements a multi-threaded architecture with a central event processing loop and specialized worker threads for different operational domains.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Threading Architecture<\/strong>: Multi-threaded with main event loop, control engine thread, database operations thread, and application-specific threads<\/li>\n\n\n\n<li><strong>Main Thread<\/strong>\u00a0(<code>wifi_mgr<\/code>): Handles component initialization, R-BUS message registration, serves as entry point for external parameter requests, and coordinates overall system lifecycle<\/li>\n\n\n\n<li><strong>Control Engine Thread<\/strong>&nbsp;(<code>wifi_ctrl<\/code>): Processes events from internal queue (wifi_ctrl_t) including configuration changes, HAL events, timeout events, and application requests using condition variable pattern for efficient event processing<\/li>\n\n\n\n<li><strong>Database Thread<\/strong>&nbsp;(<code>wifi_db<\/code>): Manages OVSDB operations, in-memory cache updates, and database synchronization to avoid blocking main control flow with disk\/socket I\/O<\/li>\n\n\n\n<li><strong>Statistics Monitor Thread<\/strong>&nbsp;(<code>wifi_monitor<\/code>): Collects periodic radio statistics, client statistics, and telemetry data for Avro serialization and reporting<\/li>\n\n\n\n<li><strong>R-BUS Listener Threads<\/strong>: Handle asynchronous R-BUS message reception for TR-181 parameter get\/set requests and event subscriptions<\/li>\n\n\n\n<li><strong>Application Threads<\/strong>:\n<ul class=\"wp-block-list\">\n<li><strong>EasyMesh Thread<\/strong>&nbsp;(<code>easymesh_agent<\/code>): Handles Multi-AP protocol operations, mesh topology management, and backhaul steering (if meshwifi enabled)<\/li>\n\n\n\n<li><strong>CSI Processing Thread<\/strong>&nbsp;(<code>csi_processor<\/code>): Processes Channel State Information for motion detection and presence sensing analytics (if CSI app enabled)<\/li>\n\n\n\n<li><strong>Blaster Thread<\/strong>&nbsp;(<code>blaster_worker<\/code>): Executes active WiFi performance measurement tests for throughput testing (if Blaster app enabled)<\/li>\n\n\n\n<li><strong>Harvester Thread<\/strong>&nbsp;(<code>data_harvester<\/code>): Collects and aggregates telemetry data for periodic reporting (if Harvester app enabled)<\/li>\n\n\n\n<li><strong>Analytics Thread<\/strong>&nbsp;(<code>wifi_analytics<\/code>): Processes performance metrics and generates analytics reports (if Analytics app enabled)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Scheduled Tasks<\/strong>: Includes sta_connectivity_selfheal that monitors health of backhaul connection on Extender devices and automatically re-establishes mesh backhaul connections if station interface loses connectivity<\/li>\n\n\n\n<li><strong>Synchronization Mechanisms<\/strong>:\n<ul class=\"wp-block-list\">\n<li><code>data_cache_lock<\/code>&nbsp;(pthread_mutex_t): Protects global WiFi data cache access across wifi_mgr, wifi_ctrl, and wifi_monitor threads<\/li>\n\n\n\n<li><code>queue_lock<\/code>&nbsp;(pthread_mutex_t): Protects event queue operations in wifi_ctrl_t<\/li>\n\n\n\n<li><code>cond<\/code>&nbsp;(pthread_cond_t): Condition variable for event queue signaling<\/li>\n\n\n\n<li><code>webconfig_data_lock<\/code>&nbsp;(pthread_mutex_t): Protects webconfig_ovsdb_data cache structure<\/li>\n\n\n\n<li><code>associated_devices_lock<\/code>&nbsp;(pthread_mutex_t): Per-VAP locks for client list protection<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Component State Flow<\/h3>\n\n\n\n<p><strong>Initialization to Active State<\/strong><\/p>\n\n\n\n<p>OneWifi follows a structured initialization sequence ensuring all subsystems are properly initialized before entering active operation mode. The component performs configuration loading, database initialization, HAL capability discovery, R-BUS registration, and application framework startup in a predetermined order to guarantee system stability.<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">%%{init: { \"sequence\": { \"useMaxWidth\": false } }}%%\nsequenceDiagram\n    autonumber\n    participant System as System Startup\n    participant SSP as Service Support&lt;br\/>Platform\n    participant WifiMgr as WiFi Manager&lt;br\/>wifi_mgr_t\n    participant DB as Database Layer&lt;br\/>wifi_db_t\n    participant HAL as WiFi HAL\n    participant R-BUS as R-BUS\n    participant Ctrl as Control Engine&lt;br\/>wifi_ctrl_t\n    participant Apps as Application&lt;br\/>Framework\n    \n    System->>SSP: systemd starts OneWifi.service\n    SSP->>SSP: Load CcspWifi.cfg configuration\n    SSP->>WifiMgr: wifi_mgr_init()\n    \n    WifiMgr->>DB: wifi_db_init()\n    DB->>DB: Initialize OVSDB connection\n    DB->>DB: Load schema rdkb-wifi.ovsschema\n    DB-->>WifiMgr: Database handle\n    \n    WifiMgr->>HAL: wifi_hal_init()\n    HAL->>HAL: Initialize radio hardware\n    HAL->>HAL: Load capabilities\n    HAL-->>WifiMgr: Hardware capabilities\n    \n    WifiMgr->>R-BUS: rbus_open()\n    R-BUS->>R-BUS: Register Device.WiFi.* namespace\n    R-BUS-->>WifiMgr: Bus handle\n    \n    WifiMgr->>Ctrl: wifi_ctrl_init()\n    Ctrl->>Ctrl: Create event queue\n    Ctrl->>Ctrl: Start control thread\n    Ctrl-->>WifiMgr: Control handle\n    \n    WifiMgr->>Apps: Initialize application framework\n    Apps->>Apps: Load enabled applications\n    Apps->>Apps: Register event callbacks\n    Apps-->>WifiMgr: Application handles\n    \n    WifiMgr->>DB: Sync initial configuration from PSM\n    DB->>DB: Load persistent WiFi configuration\n    DB-->>WifiMgr: Configuration loaded\n    \n    WifiMgr->>Ctrl: Apply initial configuration\n    Ctrl->>HAL: Configure radios and VAPs\n    HAL-->>Ctrl: Configuration applied\n    \n    WifiMgr-->>SSP: Initialization complete\n    SSP-->>System: Service ready notification\n    System->>System: Component Active State<\/pre><\/div>\n\n\n\n<p><strong>Runtime State Changes and Context Switching<\/strong><\/p>\n\n\n\n<p>During normal operation, OneWifi responds to various configuration changes, hardware events, and application requests that may affect its operational state and behavior.<\/p>\n\n\n\n<p><strong>State Change Triggers:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TR-181 parameter set operations causing radio or VAP configuration changes with validation and apply pipeline execution<\/li>\n\n\n\n<li>WebConfig subdocument reception triggering JSON decode, validation, and multi-object configuration updates<\/li>\n\n\n\n<li>HAL event indications including client association\/disassociation, DFS channel changes, radar detection, or hardware errors<\/li>\n\n\n\n<li>Application-initiated events such as EasyMesh topology changes, client steering decisions, or CSI analytics triggers<\/li>\n\n\n\n<li>Timeout events for periodic statistics collection, telemetry reporting, or DFS channel monitoring<\/li>\n\n\n\n<li>Channel change events notifying relevant VAP services including Mesh VAPs to adjust their operational state<\/li>\n<\/ul>\n\n\n\n<p><strong>Context Switching Scenarios:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DFS channel change events causing VAP down, channel switch, CAC period, and VAP restart sequence<\/li>\n\n\n\n<li>Mesh role changes between Gateway and Extender modes affecting VAP configurations and backhaul settings<\/li>\n\n\n\n<li>Mesh backhaul connectivity loss triggering sta_connectivity_selfheal task to re-establish connections<\/li>\n\n\n\n<li>Factory reset operations clearing OVSDB database, resetting to default configuration, and reinitializing all subsystems<\/li>\n\n\n\n<li>Firmware upgrade scenarios requiring graceful shutdown, configuration backup to PSM, and post-upgrade restoration<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Call Flow<\/h3>\n\n\n\n<p><strong>Initialization Call Flow:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">%%{init: { \"sequence\": { \"useMaxWidth\": false } }}%%\nsequenceDiagram\n    participant Init as Initialization Process\n    participant Comp as OneWifi Component\n    participant DB as Database Layer\n    participant HAL as Hardware Layer\n    participant Bus as Message Bus\n    \n    Init->>Comp: Component Start\n    Comp->>Comp: Load Configuration\n    Comp->>DB: Initialize Database\n    DB-->>Comp: Database Ready\n    Comp->>HAL: Initialize HAL\n    HAL-->>Comp: HAL Ready\n    Comp->>Bus: Register Parameters\n    Bus-->>Comp: Registration Complete\n    Comp->>Comp: Start Event Processing\n    Comp->>Init: Initialization Complete (Active State)<\/pre><\/div>\n\n\n\n<p><strong>Request Processing Call Flow:<\/strong><\/p>\n\n\n\n<p>TR-181 parameter set operation (e.g., changing WiFi radio channel):<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">%%{init: { \"sequence\": { \"useMaxWidth\": false } }}%%\nsequenceDiagram\n    participant Client as TR-181 Client&lt;br\/>(WebPA\/DM)\n    participant R-BUS as R-BUS\n    participant DML as DML Handler\n    participant WifiMgr as WiFi Manager&lt;br\/>wifi_mgr_t\n    participant DB as Database Layer&lt;br\/>wifi_db_t\n    participant Ctrl as Control Engine&lt;br\/>wifi_ctrl_t\n    participant HAL as WiFi HAL\n    \n    Client->>R-BUS: Set Device.WiFi.Radio.1.Channel=36\n    R-BUS->>DML: Parameter set callback\n    DML->>DML: Validate parameter value\n    DML->>WifiMgr: Update radio configuration\n    WifiMgr->>DB: Store configuration to OVSDB\n    DB->>DB: Update table_Wifi_Radio_Config\n    DB->>Ctrl: Queue configuration change event\n    Ctrl->>Ctrl: Process event from queue\n    Ctrl->>HAL: wifi_setRadioChannel(36)\n    HAL->>HAL: Apply channel change to hardware\n    HAL-->>Ctrl: Channel changed\n    Ctrl->>DB: Update operational state\n    DB-->>WifiMgr: State synchronized\n    WifiMgr-->>DML: Configuration applied\n    DML-->>R-BUS: Success response\n    R-BUS-->>Client: Parameter set complete<\/pre><\/div>\n\n\n\n<p><strong>WebConfig Subdocument Processing Call Flow:<\/strong><\/p>\n\n\n\n<p>WebConfig JSON subdocument reception from cloud:<\/p>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">%%{init: { \"sequence\": { \"useMaxWidth\": false } }}%%\nsequenceDiagram\n    participant Cloud as Cloud Service\n    participant WebCfg as WebConfig&lt;br\/>Framework\n    participant Decoder as WiFi Decoder\n    participant WifiMgr as WiFi Manager\n    participant DB as Database Layer\n    participant Ctrl as Control Engine\n    participant HAL as WiFi HAL\n    \n    Cloud->>WebCfg: POST WiFi subdocument (JSON)\n    WebCfg->>Decoder: wifi_webconfig_decode()\n    Decoder->>Decoder: Parse JSON schema\n    Decoder->>Decoder: Validate configuration\n    Decoder->>Decoder: Convert to native structures\n    Decoder->>WifiMgr: Apply configuration\n    WifiMgr->>DB: Update OVSDB tables\n    DB->>DB: Batch update multiple tables\n    DB->>Ctrl: Queue configuration events\n    Ctrl->>Ctrl: Process configuration pipeline\n    Ctrl->>HAL: Apply radio\/VAP changes\n    HAL-->>Ctrl: Configuration applied\n    Ctrl-->>WifiMgr: Apply complete\n    WifiMgr-->>Decoder: Success\n    Decoder-->>WebCfg: Configuration accepted\n    WebCfg-->>Cloud: 200 OK<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TR\u2011181 Data Models<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Supported TR-181 Parameters<\/h3>\n\n\n\n<p>OneWifi implements TR-181 data model support for WiFi management. The component implements the Device.WiFi object hierarchy including Radio, SSID, AccessPoint, EndPoint, and associated statistics objects. The implementation supports both standard parameters and RDK-specific extensions for Mesh WiFi, CSI analytics, and client steering.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Object Hierarchy<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Device.\n\u2514\u2500\u2500 WiFi.\n    \u251c\u2500\u2500 RadioNumberOfEntries (unsignedInt, R)\n    \u251c\u2500\u2500 SSIDNumberOfEntries (unsignedInt, R)\n    \u251c\u2500\u2500 AccessPointNumberOfEntries (unsignedInt, R)\n    \u251c\u2500\u2500 EndPointNumberOfEntries (unsignedInt, R)\n    \u251c\u2500\u2500 Radio.{i}.\n    \u2502   \u251c\u2500\u2500 Enable (boolean, R\/W)\n    \u2502   \u251c\u2500\u2500 Status (string, R)\n    \u2502   \u251c\u2500\u2500 Name (string, R)\n    \u2502   \u251c\u2500\u2500 OperatingFrequencyBand (string, R\/W)\n    \u2502   \u251c\u2500\u2500 Channel (unsignedInt, R\/W)\n    \u2502   \u251c\u2500\u2500 AutoChannelEnable (boolean, R\/W)\n    \u2502   \u251c\u2500\u2500 OperatingChannelBandwidth (string, R\/W)\n    \u2502   \u251c\u2500\u2500 TransmitPower (int, R\/W)\n    \u2502   \u251c\u2500\u2500 X_RDK_MLD_ID (unsignedInt, R)\n    \u2502   \u2514\u2500\u2500 Stats.\n    \u251c\u2500\u2500 SSID.{i}.\n    \u2502   \u251c\u2500\u2500 Enable (boolean, R\/W)\n    \u2502   \u251c\u2500\u2500 Status (string, R)\n    \u2502   \u251c\u2500\u2500 Name (string, R\/W)\n    \u2502   \u251c\u2500\u2500 SSID (string, R\/W)\n    \u2502   \u251c\u2500\u2500 BSSID (string, R)\n    \u2502   \u2514\u2500\u2500 Stats.\n    \u251c\u2500\u2500 AccessPoint.{i}.\n    \u2502   \u251c\u2500\u2500 Enable (boolean, R\/W)\n    \u2502   \u251c\u2500\u2500 Status (string, R)\n    \u2502   \u251c\u2500\u2500 SSIDReference (string, R\/W)\n    \u2502   \u251c\u2500\u2500 Security.\n    \u2502   \u2502   \u251c\u2500\u2500 ModesSupported (string, R)\n    \u2502   \u2502   \u251c\u2500\u2500 ModeEnabled (string, R\/W)\n    \u2502   \u2502   \u251c\u2500\u2500 KeyPassphrase (string, R\/W)\n    \u2502   \u2502   \u2514\u2500\u2500 RadiusServerIPAddr (string, R\/W)\n    \u2502   \u251c\u2500\u2500 WPS.\n    \u2502   \u251c\u2500\u2500 AssociatedDevice.{i}.\n    \u2502   \u2502   \u251c\u2500\u2500 MACAddress (string, R)\n    \u2502   \u2502   \u251c\u2500\u2500 X_RDK_MLD_ID (unsignedInt, R)\n    \u2502   \u2502   \u251c\u2500\u2500 X_RDK_MLD_Addr (string, R)\n    \u2502   \u2502   \u2514\u2500\u2500 LastDataDownlinkRate (unsignedInt, R)\n    \u2502   \u2514\u2500\u2500 Stats.\n    \u251c\u2500\u2500 EndPoint.{i}.\n    \u2502   \u251c\u2500\u2500 Enable (boolean, R\/W)\n    \u2502   \u251c\u2500\u2500 Status (string, R)\n    \u2502   \u251c\u2500\u2500 Profile.{i}.\n    \u2502   \u2514\u2500\u2500 Stats.\n    \u251c\u2500\u2500 MultiLinkDevice.{i}.\n    \u2502   \u251c\u2500\u2500 MLDAddress (string, R)\n    \u2502   \u251c\u2500\u2500 MLDNumberOfLinks (unsignedInt, R)\n    \u2502   \u251c\u2500\u2500 Link.{i}.\n    \u2502   \u2502   \u251c\u2500\u2500 RadioReference (string, R)\n    \u2502   \u2502   \u251c\u2500\u2500 LinkStatus (string, R)\n    \u2502   \u2502   \u251c\u2500\u2500 LinkID (unsignedInt, R)\n    \u2502   \u2502   \u2514\u2500\u2500 Stats.\n    \u2502   \u2514\u2500\u2500 Stats.\n    \u2514\u2500\u2500 X_RDK_Extensions.\n        \u251c\u2500\u2500 CSI.{i}.\n        \u251c\u2500\u2500 Harvester.\n        \u251c\u2500\u2500 Analytics.\n        \u2514\u2500\u2500 Steering.\n\nDevice.\n\u2514\u2500\u2500 X_RDKCENTRAL-COM_WiFi.\n    \u251c\u2500\u2500 MacFilterList (string, R\/W)\n    \u2514\u2500\u2500 Config (string, R\/W)\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Parameter Registration and Object Access<\/h3>\n\n\n\n<p>OneWifi implements TR-181 parameter support for the Device.WiFi.* object hierarchy with standard TR-181 objects and RDK-specific extensions.<\/p>\n\n\n\n<p><strong>Implementation Details:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Implemented Objects<\/strong>: Device.WiFi.* object hierarchy including Radio, SSID, AccessPoint, EndPoint objects with statistics subtrees. RDK extensions include X_RDK_CSI for CSI analytics, X_RDK_Harvester for data collection, X_RDK_Analytics for performance monitoring, and X_RDK_Steering for client steering parameters<\/li>\n\n\n\n<li><strong>Registration Mechanism<\/strong>: Parameters are registered with R-BUS during initialization through wifi_dml_registration(). DML handler functions map TR-181 paths to internal wifi_mgr_t structures and database tables<\/li>\n\n\n\n<li><strong>Access Pattern<\/strong>: External components access parameters via R-BUS method calls (rbus_get\/rbus_set) which invoke corresponding DML handler functions. Handlers validate parameters, update wifi_mgr_t state, write to OVSDB via wifi_db_t layer, and queue events to control engine for HAL application<\/li>\n\n\n\n<li><strong>Validation<\/strong>: Radio channel selection validates against supported channel lists and regulatory constraints. Security mode changes validate against hardware capabilities. Bandwidth selection validates channel width support for current band. String parameters enforce maximum length constraints<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Internal Modules<\/strong><\/h2>\n\n\n\n<p>OneWifi is organized into specialized modules responsible for different aspects of WiFi management including configuration handling, control logic, database management, hardware abstraction, and application services.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Module\/Class<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><strong>WiFi Manager Core<\/strong><\/td><td>Central management entity maintaining global state, coordinating between subsystems, managing wifi_mgr_t structure<\/td><\/tr><tr><td><strong>Control Engine<\/strong><\/td><td>Event-driven processing engine handling configuration changes, HAL events, timeout events through event queue architecture with scheduler for deferred tasks<\/td><\/tr><tr><td><strong>Database Layer<\/strong><\/td><td>OVSDB-based persistence layer with in-memory caching, schema management, and PSM synchronization<\/td><\/tr><tr><td><strong>DML\/TR-181 Handler<\/strong><\/td><td>Implementation of Device.WiFi.* TR-181 data model with R-BUS integration for external parameter access<\/td><\/tr><tr><td><strong>WebConfig System<\/strong><\/td><td>JSON-based configuration decoder\/encoder supporting cloud-based configuration and bulk updates with subdocument handlers for private, radio, mesh, dml, and blaster configurations<\/td><\/tr><tr><td><strong>Statistics Monitor<\/strong><\/td><td>Periodic collection of radio statistics, client statistics, and telemetry reporting with Avro serialization<\/td><\/tr><tr><td><strong>EasyMesh Application<\/strong><\/td><td>Multi-AP protocol implementation for WiFi mesh networking including topology management and backhaul steering (requires meshwifi DISTRO feature)<\/td><\/tr><tr><td><strong>Mesh VAP Service<\/strong><\/td><td>Mesh-specific VAP service operations managing mesh_backhaul VAP type with backhaul candidate selection using ranking algorithms based on SNR and Channel Utilization<\/td><\/tr><tr><td><strong>Blaster Application<\/strong><\/td><td>Active WiFi performance measurement tool for throughput testing and quality assessment<\/td><\/tr><tr><td><strong>CSI Analytics<\/strong><\/td><td>Channel State Information processing for motion detection and presence sensing applications<\/td><\/tr><tr><td><strong>CAC Application<\/strong><\/td><td>Connection Admission Control and DFS channel availability checking for radar detection compliance (requires cac DISTRO feature)<\/td><\/tr><tr><td><strong>Client Steering (WHIX)<\/strong><\/td><td>Link quality monitoring and intelligent client steering for optimal AP association<\/td><\/tr><tr><td><strong>Station Manager<\/strong><\/td><td>Client mode (STA) connection management for Extender and repeater devices with station interface health monitoring (requires sta_manager DISTRO feature)<\/td><\/tr><tr><td><strong>Service Support Platform<\/strong><\/td><td>Process lifecycle management, message bus initialization, configuration loading, component entry point<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Component Interactions<\/strong><\/h2>\n\n\n\n<p>OneWifi interacts with external RDK-B components, system services, and hardware layers to provide WiFi management functionality.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Interaction Matrix<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Target Component\/Layer<\/th><th>Interaction Purpose<\/th><th>Key APIs\/Endpoints<\/th><\/tr><\/thead><tbody><tr><td><strong>R-BUS<\/strong><\/td><td>TR-181 parameter access, event notifications, inter-component communication<\/td><td><code>rbus_open()<\/code>,&nbsp;<code>rbus_regDataElements()<\/code>,&nbsp;<code>rbus_get()<\/code>,&nbsp;<code>rbus_set()<\/code>,&nbsp;<code>rbus_publishEvent()<\/code><\/td><\/tr><tr><td><strong>CcspPsm<\/strong><\/td><td>Persistent configuration storage across reboots<\/td><td>PSM_Get(), PSM_Set(), PSM_Del() via wifi_db layer<\/td><\/tr><tr><td><strong>WiFi HAL<\/strong><\/td><td>Hardware control and configuration<\/td><td><code>wifi_init()<\/code>,&nbsp;<code>wifi_setRadioChannel()<\/code>,&nbsp;<code>wifi_createAp()<\/code>,&nbsp;<code>wifi_setApSecurity()<\/code>, event callbacks<\/td><\/tr><tr><td><strong>Telemetry<\/strong><\/td><td>Statistics and event reporting<\/td><td><code>t2_event_s()<\/code>,&nbsp;<code>t2_event_d()<\/code>&nbsp;for marker-based telemetry<\/td><\/tr><tr><td><strong>WebConfig Framework<\/strong><\/td><td>Cloud-based configuration reception<\/td><td><code>wifi_webconfig_decode()<\/code>,&nbsp;<code>wifi_webconfig_encode()<\/code>, blob management<\/td><\/tr><tr><td><strong>Parodus\/WebPA<\/strong><\/td><td>Cloud connectivity and management<\/td><td>Message passing through WebConfig subdocuments<\/td><\/tr><tr><td><strong>CcspPandM<\/strong><\/td><td>Device management coordination<\/td><td>Via R-BUS for system-level parameters<\/td><\/tr><tr><td><strong>hostapd\/wpa_supplicant<\/strong><\/td><td>Low-level WiFi protocol handling<\/td><td>Via libhostap and HAL layer<\/td><\/tr><tr><td><strong>OVSDB<\/strong><\/td><td>Local database for configuration caching<\/td><td>Table operations via wifi_db layer<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Key Interaction Flows:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Configuration from Cloud<\/strong>: WebPA \u2192 Parodus \u2192 WebConfig \u2192 JSON Decode \u2192 WiFi Manager \u2192 Database \u2192 Control Engine \u2192 HAL \u2192 Hardware<\/li>\n\n\n\n<li><strong>TR-181 Parameter Access<\/strong>: External Client \u2192 R-BUS \u2192 DML Handler \u2192 WiFi Manager \u2192 Database\/HAL \u2192 Response<\/li>\n\n\n\n<li><strong>Persistent Storage<\/strong>: WiFi Manager \u2192 Database Layer \u2192 PSM \u2192 Non-volatile Storage<\/li>\n\n\n\n<li><strong>Telemetry Reporting<\/strong>: Statistics Monitor \u2192 Avro Encoding \u2192 Telemetry Service \u2192 Cloud<\/li>\n\n\n\n<li><strong>Hardware Events<\/strong>: Radio Hardware \u2192 Driver \u2192 HAL Callback \u2192 Control Engine \u2192 Event Processing \u2192 State Update<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Performance Tuning and Optimization<\/h2>\n\n\n\n<p>OneWifi implements multiple performance optimization strategies to minimize latency, reduce resource consumption, and maximize WiFi throughput across different operational scenarios.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">In-Memory Data Caching<\/h3>\n\n\n\n<p><strong>OVSDB Cache Layer:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose<\/strong>: Avoid frequent disk\/socket I\/O operations by maintaining synchronized in-memory cache of database state<\/li>\n\n\n\n<li><strong>Implementation<\/strong>: webconfig_ovsdb_data structure protected by webconfig_data_lock mutex for thread-safe access<\/li>\n\n\n\n<li><strong>Cache Scope<\/strong>: Stores radio configurations, VAP settings, security parameters, and client association data<\/li>\n\n\n\n<li><strong>Synchronization<\/strong>: wifi_mgr, wifi_ctrl, and wifi_monitor threads access cached data with mutex protection<\/li>\n\n\n\n<li><strong>Update Strategy<\/strong>: Write-through cache updates OVSDB and in-memory structures atomically<\/li>\n<\/ul>\n\n\n\n<p><strong>DML Cache:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Function<\/strong>: get_dml_cache_vap_info retrieves cached VAP data for TR-181 parameter requests without HAL queries<\/li>\n\n\n\n<li><strong>Benefit<\/strong>: Reduces TR-181 get parameter latency from milliseconds to microseconds for cached parameters<\/li>\n\n\n\n<li><strong>Invalidation<\/strong>: Cache invalidated on configuration changes through control engine event processing<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Event Queue Optimization<\/h3>\n\n\n\n<p><strong>Condition Variable Pattern:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Control Loop<\/strong>: wifi_ctrl thread uses pthread_cond_timedwait for efficient event processing without busy-waiting<\/li>\n\n\n\n<li><strong>Wake Mechanism<\/strong>: Events trigger pthread_cond_signal to immediately wake control thread<\/li>\n\n\n\n<li><strong>Timeout Handling<\/strong>: Configurable timeout for periodic maintenance tasks without blocking event processing<\/li>\n\n\n\n<li><strong>Queue Management<\/strong>: Thread-safe queue_t implementation with queue_lock mutex protection<\/li>\n<\/ul>\n\n\n\n<p><strong>Event Batching:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Multiple Events<\/strong>: Control engine processes multiple queued events per wake cycle<\/li>\n\n\n\n<li><strong>Priority Handling<\/strong>: Critical events (HAL indications, client associations) processed before configuration updates<\/li>\n\n\n\n<li><strong>Deferred Processing<\/strong>: Low-priority events deferred using scheduler mechanism<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Database Performance<\/h3>\n\n\n\n<p><strong>Transaction Batching:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Bulk Updates<\/strong>: WebConfig subdocument processing batches multiple table updates into single OVSDB transaction<\/li>\n\n\n\n<li><strong>Atomic Operations<\/strong>: Multi-parameter changes committed atomically to maintain consistency<\/li>\n\n\n\n<li><strong>Reduced Overhead<\/strong>: Minimizes transaction overhead and database synchronization latency<\/li>\n<\/ul>\n\n\n\n<p><strong>Schema Versioning:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Migration Flags<\/strong>: ONEWIFI_DB_VERSION_UPDATE_MLD_FLAG for conditional schema updates<\/li>\n\n\n\n<li><strong>Backward Compatibility<\/strong>: Database API handles legacy schema formats for upgrade scenarios<\/li>\n\n\n\n<li><strong>Default Population<\/strong>: wifidb_init_default_value populates cache with hardcoded defaults on factory reset<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">HAL Interaction Optimization<\/h3>\n\n\n\n<p><strong>Capability Caching:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>hal_cap Structure<\/strong>: Hardware capabilities cached during initialization in wifi_hal_capability_t<\/li>\n\n\n\n<li><strong>Query Elimination<\/strong>: Eliminates repeated HAL capability queries during runtime<\/li>\n\n\n\n<li><strong>Validation<\/strong>: Configuration validation uses cached capabilities for immediate parameter checks<\/li>\n<\/ul>\n\n\n\n<p><strong>Asynchronous HAL Operations:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Non-Blocking Callbacks<\/strong>: HAL event callbacks queue events to control engine without blocking HAL thread<\/li>\n\n\n\n<li><strong>Deferred Application<\/strong>: Configuration changes queued for application during appropriate control engine cycles<\/li>\n\n\n\n<li><strong>Timeout Protection<\/strong>: HAL operations monitored with timeout mechanisms to prevent system hang<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Network Protocol Optimization<\/h3>\n\n\n\n<p><strong>Channel Selection:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ACS Optimization<\/strong>: Auto Channel Selection uses cached scan results to minimize channel switching overhead<\/li>\n\n\n\n<li><strong>DFS Handling<\/strong>: Non-Occupancy Period (NOP) tracking prevents unnecessary radar channel rescans<\/li>\n\n\n\n<li><strong>Background Scanning<\/strong>: Off-channel scan support (FEATURE_OFF_CHANNEL_SCAN_5G) for spectrum analysis without service interruption<\/li>\n<\/ul>\n\n\n\n<p><strong>Client Association:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Fast Roaming<\/strong>: Pre-authentication support for 802.11r reduces handoff latency<\/li>\n\n\n\n<li><strong>Association Caching<\/strong>: Client device information cached to speed reconnection processing<\/li>\n\n\n\n<li><strong>Steering Optimization<\/strong>: WHIX client steering uses link quality metrics for intelligent AP selection<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Memory Management<\/h3>\n\n\n\n<p><strong>Lock Granularity:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Per-VAP Locks<\/strong>: associated_devices_lock for fine-grained locking per VAP to reduce contention<\/li>\n\n\n\n<li><strong>Read-Write Patterns<\/strong>: Optimized lock duration minimizes critical section time<\/li>\n\n\n\n<li><strong>Lock-Free Reads<\/strong>: Atomic operations used where possible for lock-free read access<\/li>\n<\/ul>\n\n\n\n<p><strong>Resource Pooling:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Event Structures<\/strong>: Reusable event structure pools reduce malloc\/free overhead<\/li>\n\n\n\n<li><strong>String Buffers<\/strong>: Static buffer allocation for frequently accessed strings<\/li>\n\n\n\n<li><strong>Memory Profiling<\/strong>: ONEWIFI_MEMWRAPTOOL_APP_SUPPORT for runtime memory leak detection<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>OneWifi is the RDK-B component responsible for WiFi management, providing control of WiFi parameters, statistics, [&hellip;]<\/p>\n","protected":false},"author":659,"featured_media":0,"parent":9575,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-12859","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OneWifi - RDK Documentation Portal | Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OneWifi - RDK Documentation Portal | Documentation\" \/>\n<meta property=\"og:description\" content=\"OneWifi is the RDK-B component responsible for WiFi management, providing control of WiFi parameters, statistics, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/\" \/>\n<meta property=\"og:site_name\" content=\"RDK Documentation Portal | Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-31T07:38:45+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/\",\"name\":\"OneWifi - RDK Documentation Portal | Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\"},\"datePublished\":\"2026-03-31T06:21:48+00:00\",\"dateModified\":\"2026-03-31T07:38:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentation\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"RDK Broadband\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Components\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"OneWifi\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/\",\"name\":\"RDK Documentation Portal | Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OneWifi - RDK Documentation Portal | Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/","og_locale":"en_US","og_type":"article","og_title":"OneWifi - RDK Documentation Portal | Documentation","og_description":"OneWifi is the RDK-B component responsible for WiFi management, providing control of WiFi parameters, statistics, [&hellip;]","og_url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/","og_site_name":"RDK Documentation Portal | Documentation","article_modified_time":"2026-03-31T07:38:45+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/","url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/","name":"OneWifi - RDK Documentation Portal | Documentation","isPartOf":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website"},"datePublished":"2026-03-31T06:21:48+00:00","dateModified":"2026-03-31T07:38:45+00:00","breadcrumb":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/onewifi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":3,"name":"RDK Broadband","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/"},{"@type":"ListItem","position":4,"name":"Components","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_broadband_documentation\/components\/"},{"@type":"ListItem","position":5,"name":"OneWifi"}]},{"@type":"WebSite","@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website","url":"https:\/\/developer.rdkcentral.com\/documentation\/","name":"RDK Documentation Portal | Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/12859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/users\/659"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/comments?post=12859"}],"version-history":[{"count":2,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/12859\/revisions"}],"predecessor-version":[{"id":12862,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/12859\/revisions\/12862"}],"up":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9575"}],"wp:attachment":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/media?parent=12859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}