Commit graph

17 commits

Author SHA1 Message Date
Jukka Rissanen d81be8fd9c drivers: modem: gsm: Do not reference possible null pointer
The ppp_dev was used even if its value could be NULL.

Fixes #25781
Coverity-CID: 210031

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-08 16:50:35 +03:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Tomasz Bursztyka 97326c0445 device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix
accessing config_info, name, ... attributes everywhere via:

grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g'

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-08 23:07:44 +02:00
Peter Bigot df106a1708 modem: gsm: correct timeout parameter to k_delayed_work_submit
The parameter is a k_timeout_t, not an integer in milliseconds.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-20 18:09:18 +03:00
Jukka Rissanen 775dcb222e modem: gsm: Initialize the modem UART separately
This is needed if muxing is enabled in which case we must
change the UART to muxing UART after the AT+CMUX command
has succeed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-17 10:15:54 +03:00
Jukka Rissanen 492088b3fa net: ppp: Convert PPP driver to use normal UART APIs
This is needed so that we can support GSM 07.10 muxing protocol.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-17 10:15:54 +03:00
Jukka Rissanen eb1ad99cff drivers: modem: gsm: Add support for GSM 07.10 muxing protocol
Instead of using physical UART to connection to the modem, use
the GSM 07.10 muxing protocol and UART mux driver to create
virtual channels to the modem. This will allow simultaneous
PPP, AT and other type connections to the modem.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-17 10:15:54 +03:00
Peter Bigot ecf3bdb5b3 coccinelle: re-run timeout conversion semantic patch
Run the int_literal_to_timeout Coccinelle script to fix places where
it is clear that an integer duration is being passed where a timeout
value is required.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-02 19:47:51 +03:00
Jukka Rissanen 45eccbc5d7 drivers: modem: gsm: Command handlers should return value
GSM modem command handlers were missing a return value.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-10 19:52:33 +02:00
Jukka Rissanen b05e72f3bb drivers: modem: gsm: Add setting of MCC number
Add Kconfig option that allows user to set MCC (Mobile Country
Code). If user does not set it, then automatic operator
registration is used.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-10 12:32:24 +02:00
Jukka Rissanen 49724e25a0 drivers: modem: gsm: Add misc fixes like line ending char set
Misc fixes / enhancements to the GSM driver:
* set the \r as a line ending character
* make gsm_init() static as there is no need to expose it
* print the gsm context pointer at init
* set buffer allocation timeout to modem context so that it is
  not infinite

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-10 12:32:24 +02:00
Jukka Rissanen 4c1b0ab2a9 drivers: modem: gsm: Add context to DEVICE_INIT()
Instead of using global static variable "gsm" everywhere,
store the context when calling DEVICE_INIT(). Then in the device
init function get the context from the device struct. This way
it is possible to use the same functions for implementing two
gsm modem instances. Currently this is not fully possible because
the context is not passed via uart_pipe API and modem_cmd
callbacks. So some future work would still be needed.

In practice this commit does not change anything, it just makes
it a little bit easier to have two instance of this modem which
might be quite unlikely case. Anyway, the driver now follows the
same style how some other drivers are done like Ethernet etc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-10 12:32:24 +02:00
Jukka Rissanen cb4bf32f2c drivers: modem: gsm: Add support for getting modem info
Add callbacks to get the modem information which can then be
shown by modem shell.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 10:19:25 +02:00
Jukka Rissanen 1474b4ea14 drivers: modem: gsm: Use modem log level instead of ppp
Use the same log level as the other modems.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Jukka Rissanen 66cc8e9c3a drivers: modem: gsm: Fix uart_pipe.h location
The uart_pipe.h was moved to drivers/console/uart_pipe.h and that
was missed by sanity.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-28 19:11:13 +02:00
Patrik Flykt 3fe8707bc0 drivers: modem: Implement uart_pipe interface for GSM modem
Implement uart_pipe functionality for the modem so that it
integrates with the PPP implementation.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-01-28 12:44:17 +02:00
Patrik Flykt 2308293d89 drivers: modem: Support GSM modems and PPP
Create a driver for GSM modems that use a standard AT command set
and enable Zephyr's own PPP stack for IP traffic.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-01-28 12:44:17 +02:00