Skip to content

Commit

Permalink
drivers: net: ppp: configurable autostart
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jhirsi authored and nashif committed Nov 17, 2021
1 parent 8a51a79 commit d2a7d29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions drivers/net/ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,12 @@ static void ppp_iface_init(struct net_if *iface)

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);
}
}
Expand Down

0 comments on commit d2a7d29

Please sign in to comment.