Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fbebafa
RDKBACCL-863
anatar818 Jul 22, 2025
83e04be
Merge pull request #10 from rdkcentral/anatar818-patch-3
cpokuru Jul 22, 2025
ac1aa76
RDKBACCL-1004 : Need to add logic of wifi constant mac for EM builds
kpandu987 Aug 8, 2025
d751027
Merge pull request #14 from kpandu987/RDKBACCL-1004
cpokuru Aug 8, 2025
6434d44
RDKBACCL-870: Integrating "gw-lan-refresh" utility for banana pi
pganna856 Aug 11, 2025
932dbb3
Merge pull request #16 from pganna856/gw_lan
cpokuru Aug 12, 2025
8dc573c
RDKBACCL-870: Integrating "gw-lan-refresh" utility for banana pi
pganna856 Aug 13, 2025
2671dd4
Merge pull request #17 from pganna856/870_preceding
cpokuru Aug 13, 2025
e9f1fe4
RDKBACCL-1050 : Increment Vap's number and validate the EasyMesh func…
kpandu987 Aug 29, 2025
e2060a7
Merge pull request #19 from kpandu987/rdkbaccl-1050
cpokuru Aug 29, 2025
d7b9fec
RDKBACCL-1144: LAN IP change via tr181 parameter is not getting refle…
pganna856 Oct 10, 2025
c46d71d
Merge pull request #21 from pganna856/1144_gw_lan
cpokuru Oct 10, 2025
de35d4d
RDKBACCL-771 : Wifi interfaces should have constant unique MAC for 6G
kpandu987 Oct 29, 2025
55d70f1
Merge pull request #22 from kpandu987/RDKBACCL-771
cpokuru Oct 29, 2025
af33e19
RDKBACCL-1343: Utilizing rfcmgr for BPI
pganna856 Feb 23, 2026
ccbe5d2
Merge pull request #23 from pganna856/rdkbaccl_1343
cpokuru Mar 12, 2026
e15591a
RDKBWIFI-388: Add support for onboarding extender using WPS mechanism…
bsomanath Jul 23, 2026
c1b78aa
Merge pull request #24 from bsomanath/develop
cpokuru Jul 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions gw-lan-refresh/Readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Description
This code implements an application to refresh the lan clients connected ports for updating the DHCP configuration.

# Core Functionality
The program is to refresh all the eth ports except the port which is associated with WAN for BPI R4 device. As part of the refresh it will restart wifi clients using "X_CISCO_COM_KickAssocDevices" DM.
Comment on lines +1 to +5

# Sample Output
root@Filogic-GW:/rdklogs/logs# gw_lan_refresh
[ 619.265690] brlan0: port 1(lan1) entered disabled state
[ 619.275415] mt7530 mdio-bus:1f lan2: Link is Down
[ 619.281093] brlan0: port 2(lan2) entered disabled state
[ 619.291225] brlan0: port 3(lan3) entered disabled state
gw_lan_refresh
refresh_external_switch(): setting admin status down for port 1
refresh_external_switch(): setting admin status down for port 2
refresh_external_switch(): setting admin status down for port 3
[ 623.300639] mt7530 mdio-bus:1f lan1: configuring for phy/gmii link mode
[ 623.307505] 8021q: adding VLAN 0 to HW filter on device lan1
[ 623.317077] mt7530 mdio-bus:1f lan2: configuring for phy/gmii link mode
[ 623.324052] 8021q: adding VLAN 0 to HW filter on device lan2
[ 623.333377] mt7530 mdio-bus:1f lan3: configuring for phy/gmii link mode
[ 623.340286] 8021q: adding VLAN 0 to HW filter on device lan3
root@Filogic-GW:/rdklogs/logs# [ 623.530492] wifi1: moving STA e0:1f:88:f9:ac:36 to state 3
[ 623.556269] wifi1: Rx BA session stop requested for e0:1f:88:f9:ac:36 tid 0 recipient reason: 36
[ 623.565837] wifi1: Rx BA session stop requested for e0:1f:88:f9:ac:36 tid 1 recipient reason: 36
[ 623.575016] wifi1: Rx BA session stop requested for e0:1f:88:f9:ac:36 tid 7 recipient reason: 36
[ 623.584323] wifi1: Tx BA session stop requested for e0:1f:88:f9:ac:36 tid 0
[ 623.620043] wifi1: Tx BA session stop requested for e0:1f:88:f9:ac:36 tid 1
[ 623.644235] wifi1: Tx BA session stop requested for e0:1f:88:f9:ac:36 tid 4
[ 623.672113] wifi1: Tx BA session stop requested for e0:1f:88:f9:ac:36 tid 7
[ 623.752069] mt7996e 0000:01:00.0: mt7996_set_key: keyidx=0, link_bitmap=0x1 (STA e0:1f:88:f9:ac:36)
[ 623.761882] wifi1: moving STA e0:1f:88:f9:ac:36 to state 2
[ 623.767478] wifi1: moving STA e0:1f:88:f9:ac:36 to state 1
[ 623.773033] mt7996e 0000:01:00.0: mt7996_mac_sta_remove_links: removed_links=0x1
[ 623.780450] mt7996e 0000:01:00.0: mt7996_mcu_add_sta: link=0, wcid=1, newly=0, conn_state=0
[ 623.790781] wifi1: Removed STA e0:1f:88:f9:ac:36
[ 623.795875] wifi1: Destroyed STA e0:1f:88:f9:ac:36
refresh_external_switch(): setting admin status up for port 1
refresh_external_switch(): setting admin status up for port 2
refresh_external_switch(): setting admin status up for port 3
Successfully set Device.WiFi.AccessPoint.1.X_CISCO_COM_KickAssocDevices
Successfully set Device.WiFi.AccessPoint.2.X_CISCO_COM_KickAssocDevices
124 changes: 124 additions & 0 deletions gw-lan-refresh/source/gw_lan_refresh.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2025 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file gw_lan_refresh.c
* @brief Main program entry for the Gateway Lan Refresh daemon
*/

#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <rbus.h>
#include <pthread.h>

#include "ccsp/ccsp_hal_ethsw.h"

#define CONSOLE_LOG_FILE "/rdklogs/logs/Consolelog.txt.0"

#define DBG_PRINT(fmt ...) {\
FILE *fp = NULL;\
fp = fopen ( CONSOLE_LOG_FILE, "a+");\
if (fp)\
{\
fprintf(fp,fmt);\
fclose(fp);\
}\
}\


#define SLEEP_TIME 4

pthread_mutex_t gw_lan_mutex = PTHREAD_MUTEX_INITIALIZER;

void refresh_external_switch()
{
CCSP_HAL_ETHSW_PORT port;
INT max_phy_eth_ports = 0;

/* Total 3 LAN ports*/
max_phy_eth_ports = CCSP_HAL_ETHSW_EthPort4;

for (port = CCSP_HAL_ETHSW_EthPort2; port <= max_phy_eth_ports; port++)
{
// Disable the port
DBG_PRINT("%s(): setting admin status down for port %d\n", __FUNCTION__, port);

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
CcspHalEthSwSetPortAdminStatus(port, CCSP_HAL_ETHSW_AdminDown);
}

sleep(SLEEP_TIME);

for (port = CCSP_HAL_ETHSW_EthPort2; port <= max_phy_eth_ports; port++)
{
// Enable the port
DBG_PRINT("%s(): setting admin status up for port %d\n", __FUNCTION__, port);

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
CcspHalEthSwSetPortAdminStatus(port, CCSP_HAL_ETHSW_AdminUp);
}
}

void set_wifi_refresh_dm(rbusHandle_t handle, const char* param) {
pthread_mutex_lock(&gw_lan_mutex);

rbusError_t err = rbus_setBoolean(handle, param, true);
if (err != RBUS_ERROR_SUCCESS) {
DBG_PRINT("Failed to set %s: %d\n", param, err);

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
} else {
DBG_PRINT("Successfully set %s\n", param);

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
}

pthread_mutex_unlock(&gw_lan_mutex);
}

void refresh_wifi()
{
rbusHandle_t handle;
rbusError_t err;
err = rbus_open(&handle, "gw_lan_refresh");
if (err != RBUS_ERROR_SUCCESS) {
DBG_PRINT("Failed to initialize RBus: %d\n", err);

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
}
Comment on lines +95 to +97
/* dis-associate connected wifi clients */
set_wifi_refresh_dm(handle,"Device.WiFi.AccessPoint.1.X_CISCO_COM_KickAssocDevices");
set_wifi_refresh_dm(handle,"Device.WiFi.AccessPoint.2.X_CISCO_COM_KickAssocDevices");

rbus_close(handle);
}

int main(int argc, char **argv)
{
if (argc == 2) {
if (strncmp (argv[1], "ethsw", strlen ("ethsw")) == 0) {
DBG_PRINT ("[%s] calling to update ethsw setting \n",argv[0]);

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
refresh_external_switch();
}else if (strncmp (argv[1], "wifi", strlen ("wifi")) == 0) {
DBG_PRINT ("[%s] calling to update wifi setting \n",argv[0]);

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
refresh_wifi();
}
else {

}
}else {
DBG_PRINT("gw_lan_refresh \n");

Check failure

Code scanning / CodeQL

File created without restricting permissions High

A file may be created here with mode 0666, which would make it world-writable.
refresh_external_switch();
refresh_wifi();
}
return 0;
}
20 changes: 13 additions & 7 deletions rdk-wps-monitor/source/button_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,19 @@ void default_button_callback(const char *device, int button_code, int value) {
printf("Failed to initialize RBus: %d\n", err);
}

// Set WPS Push Button for Access Point 1
log_message(LOG_INFO, "WPS button pressed on device %s - triggering WPS action for 2G", device);
set_wps_push_button(handle, "Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_ActivatePushButton");

// Set WPS Push Button for Access Point 2
log_message(LOG_INFO, "WPS button pressed on device %s - triggering WPS action for 5G", device);
set_wps_push_button(handle, "Device.WiFi.AccessPoint.2.WPS.X_CISCO_COM_ActivatePushButton");
#ifdef CONFIG_EXTENDER
// Set WPS Push Button for Station Interface
log_message(LOG_INFO, "WPS button pressed on device %s - triggering WPS action for station", device);
set_wps_push_button(handle, "Device.WiFi.AccessPoint.16.WPS.X_CISCO_COM_ActivatePushButton");
#else
Comment on lines +73 to +77
// Set WPS Push Button for Access Point 1
log_message(LOG_INFO, "WPS button pressed on device %s - triggering WPS action for 2G", device);
set_wps_push_button(handle, "Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_ActivatePushButton");

// Set WPS Push Button for Access Point 2
log_message(LOG_INFO, "WPS button pressed on device %s - triggering WPS action for 5G", device);
set_wps_push_button(handle, "Device.WiFi.AccessPoint.2.WPS.X_CISCO_COM_ActivatePushButton");
#endif
sleep(WPS_DELAY);

// Close RBus
Expand Down
17 changes: 14 additions & 3 deletions rdkb-bpi-mac/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@ int main() {
{"lan1", 0x01, 0x01},
{"lan2", 0x01, 0x02},
{"lan3", 0x01, 0x03},
{"wifi0", 0x02, 0x00},
{"wifi1", 0x02, 0x01},
{"wifi2", 0x02, 0x02}
{"wifi0", 0x02, 0x10},
{"wifi1", 0x02, 0x20},
{"wifi2", 0x02, 0x30},
#if defined(_EM_BUILD_)
{"wifi0.1", 0x02, 0x11},
{"wifi0.2", 0x02, 0x12},
{"wifi1.1", 0x02, 0x21},
{"wifi1.2", 0x02, 0x22},
{"wifi1.3", 0x02, 0x23},
{"wifi2.1", 0x02, 0x31},
{"wifi2.2", 0x02, 0x32},
{"wifi2.3", 0x02, 0x33},
#endif
{"brlan0", 0x03, 0x00}
};

// Read serial number
Expand Down
67 changes: 67 additions & 0 deletions rfc-utils/mtlsUtils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2026 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "mtlsUtils.h"
#include "rfc_common.h"

#include "ccsp/platform_hal.h"

#ifdef __cplusplus
extern "C" {
#endif

#define BUF_SIZE 64
Comment on lines +23 to +29

#if defined(RDKB_SUPPORT)
std::string getErouterMac()
{
char macBuf[BUF_SIZE] = {0};
std::string erouterMac;

if (platform_hal_GetBaseMacAddress(macBuf) == RETURN_OK) {
erouterMac = macBuf;
while (!erouterMac.empty() && (erouterMac.back() == '\n' || erouterMac.back() == ' ')) {
erouterMac.pop_back();
}
}

RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s] Recevied eRouterMac(eSTBMac): %s\n", __FUNCTION__,erouterMac.c_str());
return erouterMac;
}

std::string geteCMMac()
{
std::string macAddress;
char macBuf[BUF_SIZE] = {0};

if (platform_hal_GetBaseMacAddress(macBuf) == RETURN_OK) {
macAddress = macBuf;
while (!macAddress.empty() && (macAddress.back() == '\n' || macAddress.back() == ' ')) {
macAddress.pop_back();
}
}

RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s] Received eCM MAC: %s\n", __FUNCTION__, macAddress.c_str());
return macAddress;
}
#endif

#ifdef __cplusplus
}
#endif
46 changes: 46 additions & 0 deletions rfc-utils/mtlsUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2026 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef MTLSUTILS_H_
#define MTLSUTILS_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>

#ifdef __cplusplus
extern "C" {
#endif

#include <system_utils.h>
#include <urlHelper.h>

#if defined(RDKB_SUPPORT)
std::string getErouterMac();
std::string geteCMMac();
#endif

#ifdef __cplusplus
}
#endif
Comment on lines +28 to +42


#endif /* MTLSUTILS_H_ */