drivers: modem: gsm_ppp: Kconfig for autostarting ppp

Autostarting PPP is far from controversial. There are many, many reasons
someone could have for wanting to control exactly when PPP starts. Power
management, NET_EVENT race condition avoidance and any application not
requiring constant and instant use of networking just to name a few.

This commit introduces a Kconfig setting, GSM_PPP_AUTOSTART, which
controls whether gsm_ppp should connect and initialize PPP at boot. It
is set to "y" as default to minimize surprises for legacy code.

Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
This commit is contained in:
Benjamin Lindqvist 2021-03-11 17:25:13 +01:00 committed by Jukka Rissanen
commit 4626a577c4
2 changed files with 12 additions and 1 deletions

View file

@ -53,6 +53,15 @@ config MODEM_GSM_APN
Specify Access Point Name, i.e. the name to identify Internet IP Specify Access Point Name, i.e. the name to identify Internet IP
GPRS cellular data context. GPRS cellular data context.
config GSM_PPP_AUTOSTART
bool "Auto-start PPP at boot"
default y
help
This setting lets driver connect to network and initialize PPP at
boot. Unselect this if you want to run application code before
modem connects to network. See contents of "drivers/gsm_ppp.h"
to get an idea of the API.
config MODEM_GSM_MANUAL_MCCMNO config MODEM_GSM_MANUAL_MCCMNO
string "MCC/MNO for establishing network connection" string "MCC/MNO for establishing network connection"
help help

View file

@ -794,7 +794,9 @@ static int gsm_init(const struct device *device)
return -ENODEV; return -ENODEV;
} }
gsm_ppp_start(device); if (IS_ENABLED(CONFIG_GSM_PPP_AUTOSTART)) {
gsm_ppp_start(device);
}
return 0; return 0;
} }