Skip to content

Commit d2a7d29

Browse files
jhirsinashif
authored andcommitted
drivers: net: ppp: configurable autostart
New Kconfig CONFIG_PPP_NET_IF_NO_AUTO_START to have an option to disable of starting of the PPP networking interface right after the init. Signed-off-by: Jani Hirsimäki <[email protected]>
1 parent 8a51a79 commit d2a7d29

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

drivers/net/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ config PPP_CLIENT_CLIENTSERVER
8383
This is only necessary if a ppp connection should be
8484
established with a Microsoft Windows PC.
8585

86+
config PPP_NET_IF_NO_AUTO_START
87+
bool "Disable PPP interface auto-start"
88+
help
89+
This option allows user to disable autostarting of the PPP interface
90+
immediately after initialization.
91+
8692
module = NET_PPP
8793
module-dep = LOG
8894
module-str = Log level for ppp driver

drivers/net/ppp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,12 @@ static void ppp_iface_init(struct net_if *iface)
781781

782782
memset(ppp->buf, 0, sizeof(ppp->buf));
783783

784-
/* If we have a GSM modem with PPP support, then do not start the
785-
* interface automatically but only after the modem is ready.
784+
/* If we have a GSM modem with PPP support or interface autostart is disabled
785+
* from Kconfig, then do not start the interface automatically but only
786+
* after the modem is ready or when manually started.
786787
*/
787-
if (IS_ENABLED(CONFIG_MODEM_GSM_PPP)) {
788+
if (IS_ENABLED(CONFIG_MODEM_GSM_PPP) ||
789+
IS_ENABLED(CONFIG_PPP_NET_IF_NO_AUTO_START)) {
788790
net_if_flag_set(iface, NET_IF_NO_AUTO_START);
789791
}
790792
}

0 commit comments

Comments
 (0)