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 <jani.hirsimaki@nordicsemi.no>
This commit is contained in:
Jani Hirsimäki 2021-11-16 09:00:06 +02:00 committed by Anas Nashif
parent 8a51a79d89
commit d2a7d29a08
2 changed files with 11 additions and 3 deletions

View file

@ -83,6 +83,12 @@ config PPP_CLIENT_CLIENTSERVER
This is only necessary if a ppp connection should be
established with a Microsoft Windows PC.
config PPP_NET_IF_NO_AUTO_START
bool "Disable PPP interface auto-start"
help
This option allows user to disable autostarting of the PPP interface
immediately after initialization.
module = NET_PPP
module-dep = LOG
module-str = Log level for ppp driver

View file

@ -781,10 +781,12 @@ use_random_mac:
memset(ppp->buf, 0, sizeof(ppp->buf));
/* If we have a GSM modem with PPP support, then do not start the
* interface automatically but only after the modem is ready.
/* If we have a GSM modem with PPP support or interface autostart is disabled
* from Kconfig, then do not start the interface automatically but only
* after the modem is ready or when manually started.
*/
if (IS_ENABLED(CONFIG_MODEM_GSM_PPP)) {
if (IS_ENABLED(CONFIG_MODEM_GSM_PPP) ||
IS_ENABLED(CONFIG_PPP_NET_IF_NO_AUTO_START)) {
net_if_flag_set(iface, NET_IF_NO_AUTO_START);
}
}