Skip to content

Commit

Permalink
Merge branch 'openwrt:main' into BPI-R4-NIC-BE14
Browse files Browse the repository at this point in the history
  • Loading branch information
nextgen-networks authored Sep 1, 2024
2 parents eda9c7a + 85f0128 commit 042aea3
Show file tree
Hide file tree
Showing 48 changed files with 721 additions and 274 deletions.
4 changes: 2 additions & 2 deletions include/kernel-6.1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-6.1 = .106
LINUX_KERNEL_HASH-6.1.106 = 3773c9052c7ba7432e8337ca84bee115c1a94ccef9d62b72b99ae30c4cd5f80f
LINUX_VERSION-6.1 = .107
LINUX_KERNEL_HASH-6.1.107 = f43229d1d73011fa0a37400320a26972946f8ff295c404c31c0dd0407228b0e8
4 changes: 2 additions & 2 deletions include/kernel-6.6
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .47
LINUX_KERNEL_HASH-6.6.47 = d43376c9e9eaa92bb1b926054bd160d329c58a62d64bd65fe1222c11c6564f50
LINUX_VERSION-6.6 = .48
LINUX_KERNEL_HASH-6.6.48 = 6b16df7b2aba3116b78fdfd8aea0b6cd7abe8f0cb699b04a66d3169141772029
2 changes: 2 additions & 0 deletions include/netfilter.mk
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ $(eval $(call nf_add,NF_NATHELPER,CONFIG_NF_NAT_FTP, $(P_XT)nf_nat_ftp))
# nathelper-extra

$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_BROADCAST, $(P_XT)nf_conntrack_broadcast))
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_NETBIOS_NS, $(P_XT)nf_conntrack_netbios_ns))
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_SANE, $(P_XT)nf_conntrack_sane))
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_AMANDA, $(P_XT)nf_conntrack_amanda))
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_NAT_AMANDA, $(P_XT)nf_nat_amanda))
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_H323, $(P_XT)nf_conntrack_h323))
Expand Down
4 changes: 1 addition & 3 deletions package/kernel/linux/modules/usb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1846,9 +1846,7 @@ $(eval $(call KernelPackage,usb-roles))

define KernelPackage/usb-xhci-hcd
TITLE:=xHCI HCD (USB 3.0) support
KCONFIG:= \
CONFIG_USB_XHCI_HCD \
CONFIG_USB_XHCI_HCD_DEBUGGING=n
KCONFIG:= CONFIG_USB_XHCI_HCD
HIDDEN:=1
FILES:=$(LINUX_DIR)/drivers/usb/host/xhci-hcd.ko
AUTOLOAD:=$(call AutoLoad,54,xhci-hcd,1)
Expand Down
2 changes: 1 addition & 1 deletion package/network/config/ltq-vdsl-vr11-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=ltq-vdsl-vr11-app
PKG_VERSION:=4.23.1
PKG_RELEASE:=2
PKG_RELEASE:=5
PKG_BASE_NAME:=dsl_cpe_control

UGW_VERSION=8.5.2.10
Expand Down
1 change: 1 addition & 0 deletions package/network/config/ltq-vdsl-vr11-app/files/dsl_control
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ start_service() {
${mode} \
${tc_layer} \
$autoboot
procd_set_param term_timeout 10
procd_close_instance
}

Expand Down
126 changes: 95 additions & 31 deletions package/network/config/ltq-vdsl-vr11-app/patches/200-autoboot.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
This enables automatic connection after the control daemon is started,
and also changes the way the connection is stopped on termination.

Using the autoboot restart command is necessary because the stop command
would stop the autoboot thread, and the driver offers no working way to
start it again later, short of unloading and reloading the module.
Using the autoboot restart command (in combination with configuring the
state machine to wait) is necessary because the stop command would stop
the autoboot thread, and the driver offers no working way to start it
again later, short of unloading and reloading the module.

The disconnection code is also moved to a separate function, so it can
be called in other exit code paths than the one for SIGTERM.

--- a/src/dsl_cpe_init_cfg.c
+++ b/src/dsl_cpe_init_cfg.c
Expand All @@ -18,18 +22,19 @@ start it again later, short of unloading and reloading the module.
DSL_CPE_LINE_ACTIVATE_CTRL_SET(DSL_G997_INHIBIT_LDSF, DSL_G997_INHIBIT_ACSF, DSL_G997_NORMAL_STARTUP),
--- a/src/dsl_cpe_control.c
+++ b/src/dsl_cpe_control.c
@@ -7338,6 +7338,7 @@ DSL_CPE_STATIC DSL_void_t DSL_CPE_Termi
{
DSL_Error_t nRet = DSL_SUCCESS;
DSL_int_t nDevice = 0;
+ DSL_AutobootConfig_t sAutobootCfg;
DSL_AutobootControl_t sAutobootCtl;
DSL_CPE_Control_Context_t *pCtrlCtx = DSL_NULL;

@@ -7349,8 +7350,32 @@ DSL_CPE_STATIC DSL_void_t DSL_CPE_Termi
@@ -7252,6 +7252,58 @@ static DSL_boolean_t DSL_CPE_DebugAndTes
#endif /* defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) */
#endif /* defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1) */

for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; ++nDevice)
{
+DSL_CPE_STATIC DSL_void_t DSL_CPE_ShutdownConnection(void)
+{
+ DSL_Error_t nRet = DSL_SUCCESS;
+ DSL_int_t nDevice = 0;
+ DSL_AutobootConfig_t sAutobootCfg;
+ DSL_AutobootControl_t sAutobootCtl;
+
+ for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; ++nDevice)
+ {
+ g_bWaitBeforeConfigWrite[nDevice] = DSL_TRUE;
+ g_bWaitBeforeLinkActivation[nDevice] = DSL_TRUE;
+ g_bWaitBeforeRestart[nDevice] = DSL_TRUE;
Expand All @@ -51,32 +56,91 @@ start it again later, short of unloading and reloading the module.
+ {
+ DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
+ "Autoboot configuration for device (%d) failed!, nRet = %d!"
+ DSL_CPE_CRLF, nDevice, sAutobootCtl.accessCtl.nReturn));
+ DSL_CPE_CRLF, nDevice, sAutobootCfg.accessCtl.nReturn));
+ }
+
memset(&sAutobootCtl, 0, sizeof(DSL_AutobootControl_t));
- sAutobootCtl.data.nCommand = DSL_AUTOBOOT_CTRL_STOP;
+ memset(&sAutobootCtl, 0, sizeof(DSL_AutobootControl_t));
+ sAutobootCtl.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART;
nRet = (DSL_Error_t)DSL_CPE_Ioctl(
DSL_CPE_GetGlobalContext()->fd[nDevice],
@@ -7359,13 +7384,13 @@ DSL_CPE_STATIC DSL_void_t DSL_CPE_Termi
if (nRet < DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
- "Autoboot stop for device (%d) failed!, nRet = %d!"
+
+ nRet = (DSL_Error_t)DSL_CPE_Ioctl(
+ DSL_CPE_GetGlobalContext()->fd[nDevice],
+ DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t)&sAutobootCtl);
+
+ if (nRet < DSL_SUCCESS)
+ {
+ DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
+ "Autoboot restart for device (%d) failed!, nRet = %d!"
DSL_CPE_CRLF, nDevice, sAutobootCtl.accessCtl.nReturn));
}
+ DSL_CPE_CRLF, nDevice, sAutobootCtl.accessCtl.nReturn));
+ }
+ }
+
+ DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
+ "Connection shutdown finished." DSL_CPE_CRLF));
+}
+
#ifndef RTEMS
/**
Signal handler.
@@ -7327,6 +7379,8 @@ DSL_CPE_STATIC DSL_void_t DSL_CPE_CLI_Q

DSL_CPE_STATIC DSL_void_t DSL_CPE_Interruption(void)
{
+ DSL_CPE_ShutdownConnection();
+
DSL_CPE_DaemonExit();

#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
@@ -7336,37 +7390,16 @@ DSL_CPE_STATIC DSL_void_t DSL_CPE_Inter

DSL_CPE_STATIC DSL_void_t DSL_CPE_Termination(void)
{
- DSL_Error_t nRet = DSL_SUCCESS;
- DSL_int_t nDevice = 0;
- DSL_AutobootControl_t sAutobootCtl;
DSL_CPE_Control_Context_t *pCtrlCtx = DSL_NULL;

+ DSL_CPE_ShutdownConnection();
+
pCtrlCtx = DSL_CPE_GetGlobalContext();
if (pCtrlCtx != DSL_NULL)
{
pCtrlCtx->bEvtRun = DSL_FALSE;
}

DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
- for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; ++nDevice)
- {
- memset(&sAutobootCtl, 0, sizeof(DSL_AutobootControl_t));
- sAutobootCtl.data.nCommand = DSL_AUTOBOOT_CTRL_STOP;
-
- nRet = (DSL_Error_t)DSL_CPE_Ioctl(
- DSL_CPE_GetGlobalContext()->fd[nDevice],
- DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t)&sAutobootCtl);
-
- if (nRet < DSL_SUCCESS)
- {
- DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
- "Autoboot stop for device (%d) failed!, nRet = %d!"
- DSL_CPE_CRLF, nDevice, sAutobootCtl.accessCtl.nReturn));
- }
- }
-
- DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
- "Autoboot stop executed" DSL_CPE_CRLF));
+ "Autoboot restart executed" DSL_CPE_CRLF));

-
DSL_CPE_DaemonExit();

@@ -8798,4 +8823,4 @@ DSL_CPE_STATIC DSL_Error_t DSL_CPE_Firmw
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
@@ -8551,6 +8584,9 @@ void DSL_CPE_main(void)
DSL_CPE_STATIC DSL_Error_t DSL_CPE_Control_Exit (DSL_void_t * pContext)
{
dummy_console_t *pConsole = pContext;
+
+ DSL_CPE_ShutdownConnection();
+
pConsole->bRun = DSL_FALSE;
return DSL_SUCCESS;
}
@@ -8798,4 +8834,4 @@ DSL_CPE_STATIC DSL_Error_t DSL_CPE_Firmw
pDecimal));

return nErrCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Try to perform an orderly shutdown via L3 request before the connection
is stopped on exit.

--- a/src/dsl_cpe_control.c
+++ b/src/dsl_cpe_control.c
@@ -7252,15 +7252,58 @@ static DSL_boolean_t DSL_CPE_DebugAndTes
#endif /* defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT) */
#endif /* defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1) */

+DSL_CPE_STATIC DSL_void_t DSL_CPE_EnableConnection(void)
+{
+ DSL_Error_t nRet = DSL_SUCCESS;
+ DSL_int_t nDevice = 0;
+ DSL_G997_PowerManagementStateForcedTrigger_t sPowerManagementStateForcedTrigger;
+
+ for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; ++nDevice)
+ {
+ memset(&sPowerManagementStateForcedTrigger, 0x0,
+ sizeof(DSL_G997_PowerManagementStateForcedTrigger_t));
+ sPowerManagementStateForcedTrigger.data.nPowerManagementState = DSL_G997_PMSF_L3_TO_L0;
+
+ nRet = (DSL_Error_t)DSL_CPE_Ioctl(
+ DSL_CPE_GetGlobalContext()->fd[nDevice],
+ DSL_FIO_G997_POWER_MANAGEMENT_STATE_FORCED_TRIGGER,
+ (DSL_int_t)&sPowerManagementStateForcedTrigger);
+
+ if (nRet < DSL_SUCCESS)
+ {
+ DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
+ "Transition to L0 state (%d) failed!, nRet = %d!"
+ DSL_CPE_CRLF, nDevice, sPowerManagementStateForcedTrigger.accessCtl.nReturn));
+ }
+ }
+}
+
DSL_CPE_STATIC DSL_void_t DSL_CPE_ShutdownConnection(void)
{
DSL_Error_t nRet = DSL_SUCCESS;
DSL_int_t nDevice = 0;
+ DSL_G997_PowerManagementStateForcedTrigger_t sPowerManagementStateForcedTrigger;
DSL_AutobootConfig_t sAutobootCfg;
DSL_AutobootControl_t sAutobootCtl;

for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; ++nDevice)
{
+ memset(&sPowerManagementStateForcedTrigger, 0x0,
+ sizeof(DSL_G997_PowerManagementStateForcedTrigger_t));
+ sPowerManagementStateForcedTrigger.data.nPowerManagementState = DSL_G997_PMSF_LX_TO_L3;
+
+ nRet = (DSL_Error_t)DSL_CPE_Ioctl(
+ DSL_CPE_GetGlobalContext()->fd[nDevice],
+ DSL_FIO_G997_POWER_MANAGEMENT_STATE_FORCED_TRIGGER,
+ (DSL_int_t)&sPowerManagementStateForcedTrigger);
+
+ if (nRet < DSL_SUCCESS)
+ {
+ DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
+ "Transition to L3 state (%d) failed!, nRet = %d!"
+ DSL_CPE_CRLF, nDevice, sPowerManagementStateForcedTrigger.accessCtl.nReturn));
+ }
+
g_bWaitBeforeConfigWrite[nDevice] = DSL_TRUE;
g_bWaitBeforeLinkActivation[nDevice] = DSL_TRUE;
g_bWaitBeforeRestart[nDevice] = DSL_TRUE;
@@ -8318,6 +8361,8 @@ DSL_int_t dsl_cpe_daemon (
#endif /* defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1) */
}

+ DSL_CPE_EnableConnection();
+
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT
if (DSL_CPE_Pipe_Init (pCtrlCtx) == DSL_ERROR)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DSL_char_t *g_sFirmwareName1 = DSL_NULL;
DSL_FirmwareFeatures_t g_nFwFeatures1 = {DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED,
DSL_FW_XDSLFEATURE_CLEANED};
@@ -7831,6 +7834,8 @@ DSL_int_t dsl_cpe_daemon (
@@ -7882,6 +7885,8 @@ DSL_int_t dsl_cpe_daemon (
#endif /* defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1) */
#endif /* RTEMS*/

Expand All @@ -19,7 +19,7 @@
/* Open DSL_CPE_MAX_DSL_ENTITIES devices*/
for (nDevice = 0; nDevice < DSL_CPE_DSL_ENTITIES; nDevice++)
{
@@ -8367,6 +8372,7 @@ DSL_int_t dsl_cpe_daemon (
@@ -8420,6 +8425,7 @@ DSL_int_t dsl_cpe_daemon (
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */

DSL_CPE_CONTROL_EXIT:
Expand Down
2 changes: 1 addition & 1 deletion package/network/config/ltq-vdsl-vr9-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=ltq-vdsl-vr9-app
PKG_VERSION:=4.17.18.6
PKG_RELEASE:=5
PKG_RELEASE:=7
PKG_BASE_NAME:=dsl_cpe_control
PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@OPENWRT
Expand Down
54 changes: 33 additions & 21 deletions package/network/config/ltq-vdsl-vr9-app/patches/200-autoboot.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
This enables automatic connection after the control daemon is started,
and also stops the connection on termination.

Using the autoboot restart command is necessary because the stop command
doesn't actually stop the connection, and would also leave the driver in
a state where an explicit start command is necessary to connect again.
Using the autoboot restart command (in combination with configuring the
state machine to wait) is necessary because the stop command doesn't
actually stop the connection, and would also leave the driver in a state
where an explicit start command is necessary to connect again.

--- a/src/dsl_cpe_init_cfg.c
+++ b/src/dsl_cpe_init_cfg.c
Expand All @@ -18,25 +19,17 @@ a state where an explicit start command is necessary to connect again.
DSL_CPE_LINE_ACTIVATE_CTRL_SET(DSL_G997_INHIBIT_LDSF, DSL_G997_INHIBIT_ACSF, DSL_G997_NORMAL_STARTUP),
--- a/src/dsl_cpe_control.c
+++ b/src/dsl_cpe_control.c
@@ -6515,10 +6515,13 @@ DSL_CPE_STATIC void DSL_CPE_Termination
DSL_CPE_STATIC DSL_void_t DSL_CPE_Termination (void)
{
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
- DSL_int_t nDevice = 0;
DSL_char_t buf[32] = "quit";
#endif
@@ -6491,6 +6491,57 @@ DSL_int32_t DSL_CPE_DeviceInit (
return ret;
}

+DSL_CPE_STATIC DSL_void_t DSL_CPE_ShutdownConnection(void)
+{
+ DSL_Error_t nRet = DSL_SUCCESS;
+ DSL_int_t nDevice = 0;
+ DSL_AutobootConfig_t sAutobootCfg;
+ DSL_AutobootControl_t sAutobootCtl;
DSL_CPE_Control_Context_t *pCtrlCtx;

pCtrlCtx = DSL_CPE_GetGlobalContext();
@@ -6527,6 +6530,50 @@ DSL_CPE_STATIC DSL_void_t DSL_CPE_Termi
pCtrlCtx->bRun = DSL_FALSE;
}

+
+ for (nDevice = 0; nDevice < DSL_CPE_MAX_DSL_ENTITIES; ++nDevice)
+ {
+ g_bWaitBeforeConfigWrite[nDevice] = DSL_TRUE;
Expand All @@ -60,7 +53,7 @@ a state where an explicit start command is necessary to connect again.
+ {
+ DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
+ "Autoboot configuration for device (%d) failed!, nRet = %d!"
+ DSL_CPE_CRLF, nDevice, sAutobootCtl.accessCtl.nReturn));
+ DSL_CPE_CRLF, nDevice, sAutobootCfg.accessCtl.nReturn));
+ }
+
+ memset(&sAutobootCtl, 0, sizeof(DSL_AutobootControl_t));
Expand All @@ -79,8 +72,27 @@ a state where an explicit start command is necessary to connect again.
+ }
+
+ DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
+ "Autoboot restart executed" DSL_CPE_CRLF));
+ "Connection shutdown finished." DSL_CPE_CRLF));
+}

/**
Termination handler. Will clean up in case of ctrl-c.
@@ -6521,6 +6572,8 @@ DSL_CPE_STATIC DSL_void_t DSL_CPE_Termi

DSL_CPE_Control_Context_t *pCtrlCtx;

+ DSL_CPE_ShutdownConnection();
+
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
for (nDevice = 0; nDevice < DSL_CPE_MAX_DSL_ENTITIES; nDevice++)
pCtrlCtx = DSL_CPE_GetGlobalContext();
if (pCtrlCtx != DSL_NULL)
{
@@ -7416,6 +7469,9 @@ void DSL_CPE_main(void)
DSL_CPE_STATIC DSL_Error_t DSL_CPE_Control_Exit (DSL_void_t * pContext)
{
dummy_console_t *pConsole = pContext;
+
+ DSL_CPE_ShutdownConnection();
+
pConsole->bRun = DSL_FALSE;
return DSL_SUCCESS;
}
Loading

0 comments on commit 042aea3

Please sign in to comment.