Re: [RFC] m95: Add driver for Quectel M95 modem

2018-08-27 Thread Martin Hundebøll
Hi Denis, Thanks for the review. I am working on doing a proper patch with your comments addressed. I do have some feedback below, though. // Martin On 24/08/2018 18.59, Denis Kenzior wrote: Hi Martin, On 08/24/2018 06:34 AM, Martin Hundebøll wrote: So far the driver is only tested

[PATCH 2/2] m95: Add driver for Quectel M95 modem

2018-08-28 Thread Martin Hundebøll
So far the driver is only tested with GPRS. The modem uses GSM 07.10 multiplexing, which breaks when changing functional modes (i.e. going from CFUN=4 to CFUN=1). Because of this the driver doesn't implement online/offline states. It does support disabling the device to save power though, but

[PATCH 1/2] atmodem: add Quectel M95 special case for PIN query

2018-08-28 Thread Martin Hundebøll
The AT command reference for Quectel M95 specifies that remaining SIM pin retires can be queried using AT+QTRPIN, which responds with one count for each pin-type: +QTRPIN: 3,3,10,10 --- drivers/atmodem/sim.c| 49 drivers/atmodem/vendor.h | 1 + 2

[RFC] m95: Add driver for Quectel M95 modem

2018-08-24 Thread Martin Hundebøll
So far the driver is only tested with GPRS. The modem uses GSM 07.10 multiplexing, which breaks when changing functional modes (i.e. going from CFUN=4 to CFUN=1), the driver doesn't implement online/offline states. It does support disabling the device to save power though, but users must go

[PATCH] udevng: fix removal of serial devices

2018-08-24 Thread Martin Hundebøll
Since the merge of udev.c into udevng.c all cleanup function must handle both usb devices and serial devices. Add this distinction to check_remove(), so that is doesn't try to iterate the .serial member as if it were a .devices list. --- plugins/udevng.c | 14 +++--- 1 file changed, 11

Re: GPIO power management

2018-12-11 Thread Martin Hundebøll
Hi Denis, On 10/12/2018 18.27, Denis Kenzior wrote: Hi Martin, On 12/10/2018 08:14 AM, Martin Hundebøll wrote: Hi, I previously submitted pacthes[1] for the Quectel M95 modem, and now finally have the time needed to address the review comments. In the meantime, my hardware has changed

GPIO power management

2018-12-10 Thread Martin Hundebøll
parameter somewhere in the stack. [1] https://lists.ofono.org/pipermail/ofono/2018-August/018293.html -- Kind regards, Martin Hundebøll ___ ofono mailing list ofono@ofono.org https://lists.ofono.org/mailman/listinfo/ofono

Re: [PATCH] provision: allow duplicate apn's from mbpi

2019-01-07 Thread Martin Hundebøll
Hi Denis, On 04/01/2019 22.03, Denis Kenzior wrote: On 01/04/2019 08:03 AM, Martin Hundebøll wrote: On 02/01/2019 19.36, Denis Kenzior wrote: On 01/02/2019 05:50 AM, Martin Hundebøll wrote: Let the user/connection-manager decide what to do with duplicate apn entries instead of bailing out

Re: PPP broken by 6fc119d9eaee5f9cc37a5a7198d1c55ef98fd645

2019-01-04 Thread Martin Hundebøll
Hi Giacinto, On 04/01/2019 15.48, Giacinto Cifelli wrote: On 04/01/2019, Giacinto Cifelli wrote: The comments for a88662d23c45f49d9af5a508d4d0a778950b2420 made me suspect it is this part of the patch that broke it: diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c index df9cd0ef..3fe38217

Re: PPP broken by 6fc119d9eaee5f9cc37a5a7198d1c55ef98fd645

2019-01-04 Thread Martin Hundebøll
ofono mailing list ofono@ofono.org https://lists.ofono.org/mailman/listinfo/ofono Regards, Giacinto ___ ofono mailing list ofono@ofono.org https://lists.ofono.org/mailman/listinfo/ofono -- Kind regards, Martin Hundebøll Embedded Linux Consu

Re: [PATCH] provision: allow duplicate apn's from mbpi

2019-01-04 Thread Martin Hundebøll
Hi Denis, On 02/01/2019 19.36, Denis Kenzior wrote: On 01/02/2019 05:50 AM, Martin Hundebøll wrote: Let the user/connection-manager decide what to do with duplicate apn entries instead of bailing out with an error. ---   plugins/provision.c | 2 +-   1 file changed, 1 insertion(+), 1 deletion

[PATCHv2] gprs: fix allocation of context id

2019-01-04 Thread Martin Hundebøll
After the convertion to l_uintset, the creation of new contexts fails due to a range error being returned from l_uintset_find_unused(). The error happens because the uinset is created with a min-value of 1, but the start-value passed to l_uintset_find_unused() is initialized as 0. Fix this by

[PATCH] gprs: fix allocation of context id

2019-01-02 Thread Martin Hundebøll
After the convertion to l_uintset, the creation of new contexts fails due to a range error being returned from l_uintset_find_unused(). The error happens because the uinset is created with a min-value of 1, but the start-value passed to l_uintset_find_unused() is initialized as 0. Fix this by

[PATCH] provision: allow duplicate apn's from mbpi

2019-01-02 Thread Martin Hundebøll
Let the user/connection-manager decide what to do with duplicate apn entries instead of bailing out with an error. --- plugins/provision.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/provision.c b/plugins/provision.c index 99c299eb..aa0b05e4 100644 ---

[PATCH] ubloxmodem: fix maybe-unitialized error

2019-06-21 Thread Martin Hundebøll
Fixes: ../git/drivers/ubloxmodem/gprs-context.c: In function ‘ublox_gprs_activate_primary’: ../git/drivers/ubloxmodem/gprs-context.c:339:2: error: ‘auth’ may be used uninitialized in this function [-Werror=maybe-uninitialized] snprintf(buf, sizeof(buf), "AT+UAUTHREQ=%u,%u,\"%s\",\"%s\"",

Re: Compiling: error: cast increases required alignment of target type [-Werror=cast-align]

2019-06-21 Thread Martin Hundebøll
Hi Denis, On 08/02/2019 21.15, Denis Kenzior wrote: Hi, On 02/04/2019 04:28 PM, Pičugins Arsenijs wrote:    CC       drivers/mbimmodem/mbim-message.o drivers/mbimmodem/mbim-message.c: In function ‘_iter_copy_string’: drivers/mbimmodem/mbim-message.c:199:18: error: cast increases required

Re: [PATCH] ubloxmodem: fix maybe-unitialized error

2019-06-21 Thread Martin Hundebøll
Hi Denis, On 21/06/2019 19.54, Denis Kenzior wrote: What compiler are you using?  gcc really needs to make up its mind whether it warns about enums or doesn't.  The behavior between versions is nuts. % arm-oe-linux-gnueabi-gcc --version arm-oe-linux-gnueabi-gcc (GCC) 8.2.0 So I need this

[PATCHv3 4/9] quectel: replace glib uses with ell

2019-07-10 Thread Martin Hundebøll
--- Changes since v1: * don't use l_free in plugin callback plugins/quectel.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index faad16cc..6e93f45a 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -26,7 +26,7 @@

[PATCHv3 2/9] quectel: always print modem pointer in debug messages

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 37969097..e1a5ffa4 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -127,7 +127,7 @@ static void cpin_notify(GAtResult *result, gpointer

[PATCHv3 9/9] quectel: initialize call, phonebook and sms when ready

2019-07-10 Thread Martin Hundebøll
The Quectel M95 modem issues a "Call ready" notification when call and phonebook are ready, so set up a listener for that. The only way to know when sms is ready is to issue QINITSTAT queries. Since sms is always ready after call and phonebook, the queries are initiated after creating

[PATCHv3 3/9] quectel: unwrap call to at_util_open_device()

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index e1a5ffa4..faad16cc 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -91,12 +91,6 @@ static void quectel_remove(struct ofono_modem *modem)

[PATCHv3 7/9] quectel: configure flow control when enabled

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 3f9c93f8..bfae31c0 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -495,7 +495,13 @@ static int open_serial(struct ofono_modem *modem) *

[PATCHv3 8/9] quectel: query device model to enable vendor quirks

2019-07-10 Thread Martin Hundebøll
--- plugins/quectel.c | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index bfae31c0..8bf9a963 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -51,6 +51,7 @@ static const char

[PATCHv3 6/9] quectel: support gpio to power on/off the modem

2019-07-10 Thread Martin Hundebøll
This adds support for configuring a gpio in udev to control the modem power. To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example: KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \

[PATCHv3 5/9] quectel: add basic support for serial connected modems

2019-07-10 Thread Martin Hundebøll
Setup GSM 07.10 multiplexing using the kernel n_gsm line discpline driver, and use the virtual tty devices as Aux and Modem channels. The driver supports rts/cts on the underlying serial device. This is enabled with OFONO_QUECTED_RTSCTS udev environment, e.g.: KERNEL=="ttymxc0",

[PATCHv3 1/9] atmodem: sms: add quectel m95 quirks

2019-07-10 Thread Martin Hundebøll
CNMA isn't mentioned in the m95 documentation, but trial'n'error has revealed some details: * the CSMS query returns the list (0,128) instead of a range * CNMA is enabled by setting 128 as CSMS service * once enabled, SMS deliveries are acked by sending AT+CNMA without a value setting Add

[PATCHv3 0/9] Quectel M95 support

2019-07-10 Thread Martin Hundebøll
Changes since v1/v2: * remove c types patch * add patch with m95 sms quirks * add patch to query device model * add patch to create voicecall, phonebook, and sms functionality * add patch to enable flow control on modem if configured Martin Hundebøll (9): atmodem: sms: add quectel m95

Re: [PATCHv3 0/9] Quectel M95 support

2019-07-10 Thread Martin Hundebøll
ofono_modem_set_powered(modem, false), but what about the warnings? Should I just add a hardware monitor dbus interface like the gemalto/cinterion drivers do, with a signal for the warnings? Thanks, Martin On 10/07/2019 23.51, Martin Hundebøll wrote: Changes since v1/v2: * remove c types patch

Re: [PATCH 09/10] quectel: add basic support for serial connected modems

2019-07-09 Thread Martin Hundebøll
Hi Denis, On 08/07/2019 18.12, Denis Kenzior wrote: However, there is still the fundamental issue of not being able to correlate the created ttys to the original one...  If we can fix that in the kernel, then a strong argument can be made to drop GAtMux entirely. Which is actually what I

[PATCH 09/10] quectel: add basic support for serial connected modems

2019-07-03 Thread Martin Hundebøll
Setup GSM 07.10 multiplexing using the kernel n_gsm line discpline driver, and use the virtual tty devices as Aux and Modem channels. The driver supports rts/cts on the underlying serial device. This is enabled with OFONO_QUECTED_RTSCTS udev environment, e.g.: KERNEL=="ttymxc0",

[PATCH 03/10] quectel: improve coding style

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 6ab97027..f99b1ff8 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -91,8 +91,8 @@ static void quectel_remove(struct

[PATCH 06/10] quectel: unwrap call to at_util_open_device()

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 3b57e06d..83197991 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -92,12 +92,6 @@ static void quectel_remove(struct ofono_modem *modem)

[PATCH 00/10] quectel serial support

2019-07-03 Thread Martin Hundebøll
support in ell. The cleanups are mostly done to obey my OCD wrt. coding style. Expect to see further patches adding tweaks as I get around to test pin unlocking, sms texting, calls, etc. [1] https://lists.01.org/pipermail/ofono/2018-August/018293.html Martin Hundebøll (10): gatresult: include

[PATCH 01/10] gatresult: include glib header

2019-07-03 Thread Martin Hundebøll
The gatresult data types embeds GSList members, and the function prototypes uses glib types. Add include of glib.h to allow use of gatresult.h without also including glib.h --- gatchat/gatresult.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gatchat/gatresult.h b/gatchat/gatresult.h

[PATCH 05/10] quectel: always print modem pointer in debug messages

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 50657265..3b57e06d 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -128,7 +128,7 @@ static void cpin_notify(GAtResult *result, void

[PATCH 04/10] quectel: use plain c-types over glib/ofono typedefs

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index f99b1ff8..50657265 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -25,6 +25,7 @@ #include #include

[PATCH 02/10] atutil: guard call to g_hash_table_destroy()

2019-07-03 Thread Martin Hundebøll
Glib emits a warning when g_hash_table_destroy() is called on a NULL pointer: GLib-CRITICAL **: 13:27:40.269: g_hash_table_destroy: assertion 'hash_table != NULL' failed Add a check to avoid this warning. --- drivers/atmodem/atutil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH 08/10] quectel: split up initial channel/device configuration

2019-07-03 Thread Martin Hundebøll
The three-commands-in-one-go results in error on some quectel devices (e.g. m95), so do the commands in three separate calls to g_at_chat_send() instead. --- plugins/quectel.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index

[PATCH 07/10] quectel: replace glib uses with ell

2019-07-03 Thread Martin Hundebøll
--- plugins/quectel.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 83197991..3c6b9d9f 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include

[PATCH 10/10] quectel: support gpio to power on/off the modem

2019-07-03 Thread Martin Hundebøll
This adds support for configuring a gpio in udev to control the modem power. To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example: KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \

[PATCHv2 10/10] quectel: support gpio to power on/off the modem

2019-07-04 Thread Martin Hundebøll
This adds support for configuring a gpio in udev to control the modem power. To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example: KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \

[PATCHv2 08/10] quectel: fix initial channel/device configuration

2019-07-04 Thread Martin Hundebøll
The three-commands-in-one-go results in error on some quectel devices (e.g. m95). Add semicolons between the commands to fix it. --- plugins/quectel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 3c6b9d9f..7e3c4e4a 100644

[PATCH 1/2] doc: convert quectel power event reasons to lower case

2019-08-13 Thread Martin Hundebøll
--- doc/quectel-hardware-api.txt | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/quectel-hardware-api.txt b/doc/quectel-hardware-api.txt index 139a0dc1..c2433282 100644 --- a/doc/quectel-hardware-api.txt +++ b/doc/quectel-hardware-api.txt @@ -16,9 +16,9 @@

[PATCH 1/2] gatchat: add g_at_chat_retry()

2019-08-12 Thread Martin Hundebøll
The current API doesn't support canceling an in-progress command; instead g_at_chat_cancel() simply removes the callback. In cases where the modem doesn't respond at all to a command, a chat is simply stalled without any way to write new commands to the modem. Support that case by adding a

[PATCH 2/2] quectel: replace g_at_chat_set_wakeup_command() with g_at_chat_retry()

2019-08-12 Thread Martin Hundebøll
If the modem isn't powered on, the use of g_at_chat_set_wakeup_command() makes ofono send out AT strings in an endless loop. Avoid this by using g_at_chat_retry() in a timer instead. --- plugins/quectel.c | 64 +++ 1 file changed, 53 insertions(+), 11

Handle broken AT command process

2019-08-19 Thread Martin Hundebøll
Hi, Does ofono have a way to handle lacking OK/error messages? I seems like my modem (Quectel M95) is buggy when it comes to unsolicited indications and (as far as I have seen) SIM commands: > AT+CRSM=178,28614,3,4,8 < +CRSM: 144,0,"" < OK > AT+CRSM=178,28614,4,4,8 <

Re: Handle broken AT command process

2019-08-19 Thread Martin Hundebøll
Hi Denis, On 19/08/2019 21.55, Denis Kenzior wrote: Hi Martin, On 8/19/19 2:29 PM, Martin Hundebøll wrote: Does ofono have a way to handle lacking OK/error messages? I seems like my modem (Quectel M95) is buggy when it comes to unsolicited indications and (as far as I have seen) SIM commands

[RFC] gatchat: implement timeout setting for commands

2019-09-02 Thread Martin Hundebøll
The adds a function to the set a chat-wide timeout for at commands. It allows plugins to handle cases where the modem fails to respond with either an OK or an error. Without these timeouts, the plugin is never notified about a hanging command, and it has no way to detect it; effectively leaving

[PATCHv2] quectel: handle sim states

2019-09-02 Thread Martin Hundebøll
The quectel M95 and MC60 modems are picky about when the sim is properly initialized, so the logic to detect this needs to be in the quectel plugin. After doing basic initialization, a CPIN query is issued to detect sim state. If the sim is unlocked and ready, a timer is created to wait for the

[PATCHv2] quectel: swap cmuxed ports

2019-09-02 Thread Martin Hundebøll
According to the manual, when using CMUX on the UC15, it outputs unsolicited indications on port 2 (i.e. /dev/gsmtty2), so the quectel plugin must use this when registering for such. --- plugins/quectel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/quectel.c

Re: [PATCHv2] quectel: swap cmuxed ports

2019-09-02 Thread Martin Hundebøll
On 02/09/2019 23.17, Martin Hundebøll wrote: According to the manual, when using CMUX on the UC15, it outputs unsolicited indications on port 2 (i.e. /dev/gsmtty2), so the quectel plugin must use this when registering for such. Sorry, this should have been a separate patch instead of a v2

Re: [RFC] gatchat: implement timeout setting for commands

2019-09-05 Thread Martin Hundebøll
Hi Denis, On 02/09/2019 23.25, Denis Kenzior wrote: Hi Martin, On 9/2/19 4:10 PM, Martin Hundebøll wrote: The adds a function to the set a chat-wide timeout for at commands. It allows plugins to handle cases where the modem fails to respond with either an OK or an error. Okay, this is sort

[PATCH] atmodem: sms: don't request URC buffering for Quectel UC15 modems

2019-09-05 Thread Martin Hundebøll
Add a vendor quirk to avoid an error being returned when setting up sms notification for Quectel UC15 modems. --- drivers/atmodem/sms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c index 442cfc58..d502da72 100644 --- a/drivers/atmodem/sms.c +++

[PATCHv3] quectel: handle sim states

2019-09-05 Thread Martin Hundebøll
The quectel M95 and MC60 modems are picky about when the sim is properly initialized, so the logic to detect this needs to be in the quectel plugin. After doing basic initialization, a CPIN query is issued to detect sim state. If the sim is unlocked and ready, a timer is created to wait for the

[PATCHv2] gatchat: implement timeout setting for commands

2019-09-05 Thread Martin Hundebøll
The adds a function to the set a chat-wide timeout for at commands. It allows plugins to handle cases where the modem fails to respond with either an OK or an error. Without these timeouts, the plugin is never notified about a hanging command, and it has no way to detect it; effectively leaving

[PATCH 3/4] test: process-context-settings: print commands instead of running them

2019-07-18 Thread Martin Hundebøll
Collect the setup commands and print them to stdout at the end of the script. This allows users to evaluate the standard output to apply settings. --- test/process-context-settings | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/process-context-settings

[PATCH 2/4] test: process-context-settings: print settings to stderr

2019-07-18 Thread Martin Hundebøll
Prepare the test to print commands to execute and let the caller evaluate those. In that way, more commands can be added to also set up name servers and default routes without secretly breaking the existing system network setup. --- test/process-context-settings | 20 +--- 1 file

[PATCH 1/4] test: process-context-settings: use ip instead of ifconfig/route

2019-07-18 Thread Martin Hundebøll
--- test/process-context-settings | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/process-context-settings b/test/process-context-settings index 1d30b30d..a536a771 100755 --- a/test/process-context-settings +++ b/test/process-context-settings @@ -41,14 +41,14 @@ for

[PATCH 4/4] test: process-context-settings: add argument for default connection

2019-07-18 Thread Martin Hundebøll
Add an optional argument to specify an interface to as default connection for the system. This changes the printet commands so that the gateway is configured as default route, and nameservers are written to resolv.conf. Output without a default interface: root@iwg26:/usr/lib/ofono/test#

Re: [PATCH 1/4] test: process-context-settings: use ip instead of ifconfig/route

2019-07-18 Thread Martin Hundebøll
On 18/07/2019 18.38, Pavel Machek wrote: On Thu 2019-07-18 13:49:34, Martin Hundebøll wrote: --- test/process-context-settings | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/process-context-settings b/test/process-context-settings index 1d30b30d..a536a771

[PATCHv2] test: process-context-settings: add argument for default connection

2019-07-19 Thread Martin Hundebøll
Add an optional argument to specify an interface to as default connection for the system. This changes the constructed commands so that the gateway is configured as default route, and nameservers are written to resolv.conf. --- I decided to drop the print-instead-execute approach, and simply add

[PATCHv2 1/4] quectel: add dbus hardware interface

2019-07-19 Thread Martin Hundebøll
For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. --- Changes since v1: * use and export int32_t for all three properties * place dbus functions below close_serial() * remove doc/ changes * update comments for charge status

[PATCHv2 4/4] doc: document power-event signals for quectel Hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v1: * new patch split out from PATCHv1 7/7 doc/quectel-hardware-api.txt | 19 +++ 1 file changed, 19 insertions(+) diff --git a/doc/quectel-hardware-api.txt b/doc/quectel-hardware-api.txt index 6aafbfd8..411afcd1 100644 --- a/doc/quectel-hardware-api.txt +++

[PATCHv2 3/4] quectel: implement dbus signals for modem power notifications

2019-07-19 Thread Martin Hundebøll
The Quectel modems issues unsolicited strings in case of power related events. The UC15 uses +QIND: for the events, while M95 and MC60 uses descriptive strings. (UC15 also uses a string for normal power down). Register listeners for these strings/codes. The handler emits an appropriate dbus

[PATCHv2 2/4] doc: add documentaion for Quectel hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v1: * new patch split out from PATCHv1 6/7 * added documentation of charge status and level doc/quectel-hardware-api.txt | 33 + 1 file changed, 33 insertions(+) create mode 100644 doc/quectel-hardware-api.txt diff --git

Re: [PATCHv2 1/4] quectel: add dbus hardware interface

2019-07-19 Thread Martin Hundebøll
On 19/07/2019 12.19, Martin Hundebøll wrote: For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. This is obviously not true, since the API also exposes charge status and level on the UC15 modem. Feel free to update the text

[PATCH 1/2] atmodem: gprs-context: parse list-less CGDATA response

2019-07-19 Thread Martin Hundebøll
The Quectel M95 and MC60 modems respond to AT+CGDATA=? with a single +CGDATA="PPP", but the callback in gprs-context expects a list of protocols. Avoid falling back to the old-style ATD*99 by not expecting a list of protocols for serial quectel modems. --- drivers/atmodem/gprs-context.c | 8

[PATCH 2/2] quectel: pass vendor id to gprs and gprs-context

2019-07-19 Thread Martin Hundebøll
The gprs-context does special casing on the quectel serial modem when probing the supported layer 2 protocols, so pass the vendor id when setting up the atoms. --- plugins/quectel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/quectel.c b/plugins/quectel.c

Re: [PATCHv2 4/4] doc: document power-event signals for quectel Hardware API

2019-07-19 Thread Martin Hundebøll
Hi Pavel, On 19/07/2019 13.04, Pavel Machek wrote: On Fri 2019-07-19 12:19:14, Martin Hundebøll wrote: --- Changes since v1: * new patch split out from PATCHv1 7/7 doc/quectel-hardware-api.txt | 19 +++ 1 file changed, 19 insertions(+) diff --git a/doc/quectel-hardware

[PATCHv3 1/4] quectel: add dbus hardware interface

2019-07-19 Thread Martin Hundebøll
For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. --- Changes since v2: * updated commit message Changes since v1: * use and export int32_t for all three properties * place dbus functions below close_serial() * remove doc/

[PATCHv3 4/4] doc: document power-event signals for quectel Hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v2: * Use Voltage{High,Low} instead of {High,Low}Power Changes since v1: * new patch split out from PATCHv1 7/7 doc/quectel-hardware-api.txt | 19 +++ 1 file changed, 19 insertions(+) diff --git a/doc/quectel-hardware-api.txt b/doc/quectel-hardware-api.txt

[PATCHv3 2/4] doc: add documentaion for Quectel hardware API

2019-07-19 Thread Martin Hundebøll
--- Changes since v2: * none Changes since v1: * new patch split out from PATCHv1 6/7 * added documentation of charge status and level doc/quectel-hardware-api.txt | 33 + 1 file changed, 33 insertions(+) create mode 100644 doc/quectel-hardware-api.txt diff

[PATCHv3 3/4] quectel: implement dbus signals for modem power notifications

2019-07-19 Thread Martin Hundebøll
The Quectel modems issues unsolicited strings in case of power related events. The UC15 uses +QIND: for the events, while M95 and MC60 uses descriptive strings. (UC15 also uses a string for normal power down). Register listeners for these strings/codes. The handler emits an appropriate dbus

[PATCH 4/7] quectel: store model id in private data

2019-07-16 Thread Martin Hundebøll
Some Quectel models supports different features such has GNSS or different URC strings. Add a field in the quectel data structure to be used when adding support for said features. --- plugins/quectel.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/plugins/quectel.c

[PATCH 6/7] quectel: add dbus hardware interface

2019-07-16 Thread Martin Hundebøll
For now the interface only exposes the modem supply voltage, but is added as a preparation for signaling power events. --- doc/quectel-hardware-api.txt | 15 plugins/quectel.c| 154 +++ 2 files changed, 169 insertions(+) create mode 100644

[PATCH 1/7] gatresult: strip trailing spaces from unquoted strings

2019-07-16 Thread Martin Hundebøll
Some vendors might print trailing spaces after unsolicited result codes. Avoid duplicating and stripping the string after calling g_at_result_iter_next_unquoted_string() by stripping the spaces in gatresult instead. --- gatchat/gatresult.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH 7/7] quectel: implement dbus signals for modem power notifications

2019-07-16 Thread Martin Hundebøll
The Quectel modems issues unsolicited strings in case of power related events. The UC15 uses +QIND: for the events, while M95 and MC60 uses descriptive strings. (UC15 also uses a string for normal power down). Register listeners for these strings/codes. The handler emits an appropriate dbus

[PATCH 5/7] quectel: add support for the Quectel MC60 modem

2019-07-16 Thread Martin Hundebøll
The modem is AT-compatible with the Quectel M95 modem, but also features a GNSS module. --- plugins/quectel.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index e84e3cf1..9cac92fa 100644 --- a/plugins/quectel.c +++

[PATCH 2/7] atmodem: rename OFONO_VENDOR_QUECTEL_M95 to OFONO_VENDOR_QUECTEL_SERIAL

2019-07-16 Thread Martin Hundebøll
Other serial connected modems (i.e the MC60 model) from is AT-compatible with the M95 model, so rename the M95 vendor id to be common for both. --- drivers/atmodem/sim.c| 4 ++-- drivers/atmodem/sms.c| 4 ++-- drivers/atmodem/vendor.h | 2 +- plugins/quectel.c| 2 +- 4 files

[PATCH 3/7] quectel: enable call volume settings

2019-07-16 Thread Martin Hundebøll
--- plugins/quectel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/quectel.c b/plugins/quectel.c index f2b765b6..61b82744 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@

[PATCH 3/4] quectel: rework sim detection

2019-09-26 Thread Martin Hundebøll
Simplify sim handling by querying cpin state directly from quectel_pre_sim(). The query is conducted by issuing a AT+CPIN?, where only CME errors are catched by the command response handler. The +CPIN: response is instead catched by a listener. The CME handler allows proper handling of the

[PATCH 1/4] atmodem: sim: remove quectel serial vendor quirk

2019-09-26 Thread Martin Hundebøll
The sim inserted/initialized state is handled properly in the quectel plugin now, so remove the "auto-initialized" quirk from the atmodem sim driver. --- drivers/atmodem/sim.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c index dd42cac4..e750a139

[PATCH 4/4] quectel: use own cmux implementation over kernel line discipline

2019-09-26 Thread Martin Hundebøll
The in-kernel implementation of gsm0710 causes deadlocks in the kernel[1], so switch back to the user-space implementation in ofono. [1] https://lore.kernel.org/lkml/4b2455c0-25ba-0187-6df6-c63b4ccc6...@geanix.com/ --- plugins/quectel.c | 250 -- 1

[PATCH 2/4] quectel: remove leftover reset of wakeup command

2019-09-26 Thread Martin Hundebøll
--- plugins/quectel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/quectel.c b/plugins/quectel.c index 1d21d6dd..a0e435b5 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -968,7 +968,6 @@ static void ate_cb(int ok, GAtResult *result, void *user_data) DBG("%p",

Re: [PATCHv3] quectel: handle sim states

2019-09-26 Thread Martin Hundebøll
Hi Denis, On 24/09/2019 22.40, Denis Kenzior wrote: I tried implementing what you suggest - see the attached patch. But I still get "SMS not supported by this modem.". The attached log shows quectel_post_sim() being called (line 584) way before QINISTAT returns 3 (line 686). Is this

[PATCH] gprs: free interface name in gprs_context_remove()

2019-09-26 Thread Martin Hundebøll
--- src/gprs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gprs.c b/src/gprs.c index 8df983a9..a8702958 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -2794,6 +2794,7 @@ static void gprs_context_remove(struct ofono_atom *atom) if (gc->driver && gc->driver->remove)

[RFC] gatmux: don't free cmux data until watchers are destroyed

2019-09-26 Thread Martin Hundebøll
When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). It is caused by glib sources not being entirely removed in g_at_mux_shutdown(), an so their callbacks can be called with a freed mux object. Avoid this by deferring the free of the mux object

Re: [PATCHv3] quectel: handle sim states

2019-09-23 Thread Martin Hundebøll
Hi Denis, On 10/09/2019 16.10, Denis Kenzior wrote: Hi Martin, On 9/5/19 5:33 AM, Martin Hundebøll wrote: The quectel M95 and MC60 modems are picky about when the sim is properly initialized, so the logic to detect this needs to be in the quectel plugin. After doing basic initialization

[PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-09-30 Thread Martin Hundebøll
When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). Avoid this by taking a reference to the mux object during the processing in received_data(). ofonod[3640549]: ../git/plugins/quectel.c:cfun_disable() 0x61000b40 ofonod[3640549]:

Re: [PATCH] gatmux: don't free cmux data until watchers are destroyed

2019-09-30 Thread Martin Hundebøll
Uh, Forgot to change the subject. Feel free to use: gatmux: take reference to mux object in received_data() // Martin On 30/09/2019 19.35, Martin Hundebøll wrote: When closing down a cmux object, the address sanitizer detects a use-after-free in gatmux.c (see below). Avoid

Re: [PATCH 4/4] quectel: use own cmux implementation over kernel line discipline

2019-09-30 Thread Martin Hundebøll
Hi Denis, On 27/09/2019 03.00, Denis Kenzior wrote: On 9/26/19 2:27 PM, Martin Hundebøll wrote: The in-kernel implementation of gsm0710 causes deadlocks in the kernel[1], so switch back to the user-space implementation in ofono. [1] https://lore.kernel.org/lkml/4b2455c0-25ba-0187-6df6

[PATCHv2 2/2] quectel: use own cmux implementation over kernel line discipline

2019-09-30 Thread Martin Hundebøll
The in-kernel implementation of gsm0710 causes deadlocks in the kernel[1], so switch back to the user-space implementation in ofono. [1] https://lore.kernel.org/lkml/4b2455c0-25ba-0187-6df6-c63b4ccc6...@geanix.com/ --- Changes since v1: * none plugins/quectel.c | 253

[PATCHv2 1/2] quectel: rework sim detection

2019-09-30 Thread Martin Hundebøll
Use at_util_sim_state_query_new() to query the sim inserted state. Once that returns, the locked state is queried by issuing a AT+CPIN? command. If not locked, a timer is started to query the quectel init status of the sim. Once the init status is ready, the sim atom is created, and the modem is

Re: [PATCH 4/4] quectel: use own cmux implementation over kernel line discipline

2019-09-30 Thread Martin Hundebøll
Hi Denis, On 30/09/2019 21.55, Denis Kenzior wrote: Hi Martin, So I wonder whether instead of fully reverting back to CMUX (only to put in n_gsm in later) you might want to just keep both around and use a /etc/quectel.conf or OFONO_QUECTEL_MUX=n_gsm|internal instead? I'd prefer a single

Re: [PATCH 3/4] quectel: rework sim detection

2019-09-30 Thread Martin Hundebøll
Hi Denis, On 27/09/2019 00.10, Denis Kenzior wrote: On 9/26/19 2:27 PM, Martin Hundebøll wrote: Simplify sim handling by querying cpin state directly from quectel_pre_sim(). Don't initiate commands from pre_sim/post_sim/post_online callbacks please.  There's almost never a reason to. Ok

Re: [PATCH v2 1/1] ublox: rework device initialization sequence

2019-09-24 Thread Martin Hundebøll
Hi, On 24/09/2019 20.09, Martin Hundebøll wrote: On 24/09/2019 19.23, Denis Kenzior wrote: Furthermore, there's not an AT command sent every 500 ms.  The command gets requeued after 500ms, but it doesn't actually go out until the modem responds to the first one... not quite sure why

Re: [PATCH v2 1/1] ublox: rework device initialization sequence

2019-09-24 Thread Martin Hundebøll
Hi, On 24/09/2019 19.23, Denis Kenzior wrote: Furthermore, there's not an AT command sent every 500 ms.  The command gets requeued after 500ms, but it doesn't actually go out until the modem responds to the first one... not quite sure why this works, to be honest. Funny.  But not real

Re: [PATCH] udevng: Add support for Quectel BG96 modem

2019-11-25 Thread Martin Hundebøll
Hi Sean, On 11/25/19 9:26 AM, Sean Nyekjaer wrote: Signed-off-by: Sean Nyekjaer No signoff when submitting to ofono. // Martin --- plugins/udevng.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/udevng.c b/plugins/udevng.c index 40ed2b02..cc294c94 100644 ---

Re: [PATCHv3] quectel: handle sim states

2019-09-24 Thread Martin Hundebøll
Hi Denis, On 24/09/2019 04.50, Denis Kenzior wrote: I've tried to work-around quectel_post_sim() being called after the PIN is entered, but before I call ofono_sim_initialized_notify(): ../git/drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 1

Re: [PATCHv3] quectel: handle sim states

2019-09-24 Thread Martin Hundebøll
Hi Denis, On 24/09/2019 22.44, Martin Hundebøll wrote: Hi Denis, On 24/09/2019 04.50, Denis Kenzior wrote: I've tried to work-around quectel_post_sim() being called after the PIN is entered, but before I call ofono_sim_initialized_notify(): ../git/drivers/atmodem/sim.c:at_crsm_read_cb

  1   2   >