ltq-adsl-app: add more script notifications
[openwrt/openwrt.git] / package / network / config / ltq-adsl-app / patches / 100-add-more-script-notifications.patch
1 From 9d4f86ba2cf10304303011f4f5628fa68dc77624 Mon Sep 17 00:00:00 2001
2 From: Mathias Kresin <dev@kresin.me>
3 Date: Mon, 16 Oct 2017 21:08:26 +0200
4 Subject: ltq-adsl-app: add more script notifications
5
6 Backport HANDSHAKE and TRAINING notification from ltq-vdsl-app. It
7 unifies the dsl led blinking pattern accross all subtargets and allows
8 to get the current line status from the dsl led.
9
10 Signed-off-by: Mathias Kresin <dev@kresin.me>
11 ---
12 .../100-add-more-script-notifications.patch | 27 ++++++++++++++++++++++
13 1 file changed, 27 insertions(+)
14 create mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch
15
16 --- a/src/dsl_cpe_control.c
17 +++ b/src/dsl_cpe_control.c
18 @@ -3273,7 +3273,23 @@ DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S
19 #ifdef INCLUDE_SCRIPT_NOTIFICATION
20 if (g_sRcScript != DSL_NULL)
21 {
22 - if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) &&
23 + if ( (nLineState == DSL_LINESTATE_HANDSHAKE) &&
24 + (g_nPrevLineState[nDevice] != DSL_LINESTATE_HANDSHAKE) )
25 + {
26 + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "HANDSHAKE") == DSL_SUCCESS)
27 + {
28 + bExec = DSL_TRUE;
29 + }
30 + }
31 + else if ( (nLineState == DSL_LINESTATE_FULL_INIT) &&
32 + (g_nPrevLineState[nDevice] != DSL_LINESTATE_FULL_INIT) )
33 + {
34 + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "TRAINING") == DSL_SUCCESS)
35 + {
36 + bExec = DSL_TRUE;
37 + }
38 + }
39 + else if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) &&
40 (g_nPrevLineState[nDevice] != DSL_LINESTATE_SHOWTIME_TC_SYNC) )
41 {
42 if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "UP") == DSL_SUCCESS)