[PATCH] broadband-modem-mbim: add missing guard for shared_qmi_init()

2018-08-21 Thread Ben Chan
Fixes: 9e42a19742de55cf5c0ba4d68069c1845e9392e6
---
 src/mm-broadband-modem-mbim.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index 1559ab5b..eb9e723b 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -4634,6 +4634,8 @@ iface_modem_signal_init (MMIfaceModemSignal *iface)
 iface->load_values_finish = modem_signal_load_values_finish;
 }
 
+#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
+
 static MMIfaceModemLocation *
 peek_parent_location_interface (MMSharedQmi *self)
 {
@@ -4647,6 +4649,8 @@ shared_qmi_init (MMSharedQmi *iface)
 iface->peek_parent_location_interface = peek_parent_location_interface;
 }
 
+#endif
+
 static void
 mm_broadband_modem_mbim_class_init (MMBroadbandModemMbimClass *klass)
 {
-- 
2.18.0.1017.ga543ac7ca45-goog

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


[PATCH] port-mbim: add missing guard for try_qmi_over_mbim in mm_port_mbim_open()

2018-08-21 Thread Ben Chan
Fixes: c0cc694c67d9e71f200fb23e20473cc9b31d9ec0
---
 src/mm-port-mbim.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mm-port-mbim.c b/src/mm-port-mbim.c
index f48ebd8f..cd6d9f22 100644
--- a/src/mm-port-mbim.c
+++ b/src/mm-port-mbim.c
@@ -335,9 +335,11 @@ mm_port_mbim_open (MMPortMbim  *self,
 fullpath = g_strdup_printf ("/dev/%s", mm_port_get_device (MM_PORT 
(self)));
 file = g_file_new_for_path (fullpath);
 
+#if WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
 /* If we want to try QMI over MBIM, store the GFile as task data */
 if (try_qmi_over_mbim)
 g_task_set_task_data (task, g_object_ref (file), g_object_unref);
+#endif
 
 self->priv->in_progress = TRUE;
 mbim_device_new (file,
-- 
2.18.0.1017.ga543ac7ca45-goog

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [PATCH] shared-qmi: include string.h for memset()

2018-08-21 Thread Aleksander Morgado
On 21/08/18 23:02, Ben Chan wrote:
> This patch fixes the following compiler warning:
> 
> mm-shared-qmi.c:447:9: error: implicitly declaring library function 'memset' 
> with type 'void *(void *, int, unsigned long)' 
> [-Werror,-Wimplicit-function-declaration]
> memset (buf, 0, sizeof (buf));
> ^

Pushed, thanks

> ---
>  src/mm-shared-qmi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c
> index 25fc29a1..dd08d7fd 100644
> --- a/src/mm-shared-qmi.c
> +++ b/src/mm-shared-qmi.c
> @@ -14,6 +14,7 @@
>   */
>  
>  #include 
> +#include 
>  #include 
>  
>  #include 
> 


-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [PATCH] xmm: include string.h for strlen()

2018-08-21 Thread Aleksander Morgado
On 21/08/18 23:03, Ben Chan wrote:
> This patch fixes the following compiler warning:
> 
> xmm/mm-modem-helpers-xmm.c:388:38: error: implicitly declaring library 
> function 'strlen' with type 'unsigned long (const char *)' 
> [-Werror,-Wimplicit-function-declaration]
> g_regex_match_full (r, response, strlen (response), 0, 0, _info, 
> _error);
>  ^
> ---

Pushed, thanks

>  plugins/xmm/mm-modem-helpers-xmm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/plugins/xmm/mm-modem-helpers-xmm.c 
> b/plugins/xmm/mm-modem-helpers-xmm.c
> index a8ede4cf..1c2280af 100644
> --- a/plugins/xmm/mm-modem-helpers-xmm.c
> +++ b/plugins/xmm/mm-modem-helpers-xmm.c
> @@ -13,6 +13,8 @@
>   * Copyright (C) 2018 Aleksander Morgado 
>   */
>  
> +#include 
> +
>  #include "mm-log.h"
>  #include "mm-modem-helpers.h"
>  #include "mm-modem-helpers-xmm.h"
> 


-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


[PATCH] xmm: include string.h for strlen()

2018-08-21 Thread Ben Chan
This patch fixes the following compiler warning:

xmm/mm-modem-helpers-xmm.c:388:38: error: implicitly declaring library function 
'strlen' with type 'unsigned long (const char *)' 
[-Werror,-Wimplicit-function-declaration]
g_regex_match_full (r, response, strlen (response), 0, 0, _info, 
_error);
 ^
---
 plugins/xmm/mm-modem-helpers-xmm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugins/xmm/mm-modem-helpers-xmm.c 
b/plugins/xmm/mm-modem-helpers-xmm.c
index a8ede4cf..1c2280af 100644
--- a/plugins/xmm/mm-modem-helpers-xmm.c
+++ b/plugins/xmm/mm-modem-helpers-xmm.c
@@ -13,6 +13,8 @@
  * Copyright (C) 2018 Aleksander Morgado 
  */
 
+#include 
+
 #include "mm-log.h"
 #include "mm-modem-helpers.h"
 #include "mm-modem-helpers-xmm.h"
-- 
2.18.0.1017.ga543ac7ca45-goog

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


[PATCH] shared-qmi: include string.h for memset()

2018-08-21 Thread Ben Chan
This patch fixes the following compiler warning:

mm-shared-qmi.c:447:9: error: implicitly declaring library function 'memset' 
with type 'void *(void *, int, unsigned long)' 
[-Werror,-Wimplicit-function-declaration]
memset (buf, 0, sizeof (buf));
^
---
 src/mm-shared-qmi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c
index 25fc29a1..dd08d7fd 100644
--- a/src/mm-shared-qmi.c
+++ b/src/mm-shared-qmi.c
@@ -14,6 +14,7 @@
  */
 
 #include 
+#include 
 #include 
 
 #include 
-- 
2.18.0.865.gffc8e1a3cd6-goog

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


[review] Reset, Capabilities/Modes and Bands management in shared QMI logic

2018-08-21 Thread Aleksander Morgado
Hey,

The following MR includes support for reset actions (reset, factory
reset), modes/capabilities management and bands management in the
shared QMI logic, so reused by both QMI and QMI-over-MBIM capable
devices.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/30

There is an important logic change in this MR related to how "lte" and
"gsm-umts" capabiliites are managed. Until know, the only way to have
e.g. 4G only setup using the MM APIs would be by selecting "lte"
capability only, and that would require a device reset, because
changing capabilities requires a reset (as it may change the list of
exposed interfaces if e.g. CDMA interface is lost or added when
lte-only is selected in a cdma-evdo+lte device). With this new MR, a
device that is "lte+gsm-umts" would not allow capabilities switching,
but would allow the same operation as a mode selection (e.g.
"4G-only"). The benefit is that we don't require a device reset in
this case, as we don't change capabiliities. The only devices for
which we allow selecting and updating capabilities would be those with
mixed cdma-evdo+gsm-umts(+lte), where we would allow e.g. making it
cdma-evdo(+lte) or gsm-umts(+lte).

-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: Sierra MC7354: Drowning in "bearer verbose call end reason (6,36): [3gpp] regular-deactivation"

2018-08-21 Thread Einar Jón
Thanks for that.

Info below

On Mon, 20 Aug 2018 at 23:31, Aleksander Morgado
 wrote:
>
> Hey,
>
> >
> > I am using the Sierra MC7354 modem, and we are getting unusual
> > disconnects on AT in the US. Vodafone is fine on the same modems,
> > and this only seems to happen on 4G. AT 3G  seems to work.
> >
> > We start out connected, but  after a bit of time we hit
> > "gsm-wcdma-regular-deactivation/[3gpp] regular-deactivation", and then
> > we're spamming the log file with those messages (up to 240 lines/sec).
> > Logs below.
> > Similar to this post, but seems mostly unrelated.
> > https://lists.freedesktop.org/archives/modemmanager-devel/2017-February/003988.html
> > We opening/closing PDP connections during this period, but there is no
> > connectivity.
> >
> > Questions:
> > 1) Any ideas what is happening?
>
> Nope
>
> > 2) should I be calling ifdown when I hit 'state changed (connected ->
> > registered)' ?
> >
>
> Are you using NetworkManager as well as ModemManager? Or how do you
> setup the network interface?

I'm using a Python script that listens to ModemManager events, and
reacts to them.
As it turns out, I think I really should be calling ifdown when I hit
'state changed (connected -> registered)'

> > We have been in touch with both Sierra and AT, but they say that
> > libQMI is unsupported. so there is not much help there.
> >
>
> Oh well. This is, I would say, NOT related to libqmi in any way. If
> they told you this, you should be able to recreate a small test using
> Sierra's SDK and see if/how it is reproduced. This is probably your
> best shot I'd say, given the type of problem.

True. I have more logs, and it turns out that we are just losing connection:
Aug  4 21:29:12 armxl ModemManager[944]:   bearer call end
reason (1): 'generic-unspecified'
Aug  4 21:29:12 armxl ModemManager[944]:   bearer verbose call
end reason (3,1028): [cm] (null)
Aug  4 21:29:12 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (connected ->
registered)
Aug  4 21:29:12 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (registered ->
connecting)
Aug  4 21:29:12 armxl ModemManager[944]:   error: couldn't start
network: QMI protocol error (14): 'CallFailed'
Aug  4 21:29:12 armxl ModemManager[944]:   call end reason (3):
'generic-no-service'
Aug  4 21:29:12 armxl ModemManager[944]:   verbose call end
reason (3,2001): [cm] no-service
Aug  4 21:29:12 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (connecting ->
registered)

If I don't call ifdown, we get into a weird state, where we get a new
IP address, but I don't bother to call ifup on that new IP address, so
the handshake isn't finalized.
So the modem requests another IP address every 40-50 seconds, while
looping through these states:


Aug  4 22:10:33 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (connected ->
registered)
Aug  4 22:10:33 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (registered ->
connecting)
Aug  4 22:10:33 armxl ModemManager[944]: Address: 10.192.XX.YY/30
Aug  4 22:10:34 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (connecting ->
connected)
Aug  4 22:10:48 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (connected ->
registered)
Aug  4 22:10:49 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (registered ->
connecting)
Aug  4 22:10:49 armxl ModemManager[944]:  Address: 10.192.YY.ZZ/29
Aug  4 22:10:49 armxl ModemManager[944]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (connecting ->
connected)

So note to self:
Always call ifdown when I hit 'state changed (connected -> "any other state")'

> > Setup
> > Sierra MC7354 modem
> > ModemManager 1.6.2
> > libQmi 1.16.0
> > Arm linux - kernel 3.14
> >
> > I'm using buildroot, so upgrading libQmi  (to 1.18.0 or 1.20.0) and
> > ModemManager (to 1.6.8 or 1.8.0) would be doable. Are there any
> > additional benefits in the newer versions regarding this issue?
>
> Well, those versions are extremely old. Please upgrade to the newest
> ones and retry, to avoid any possible issue that may already have been
> fixed. Those upgrades should be 100% compatible.

Upgrade done, but it's unrelated.
Behaves the same on the new libs, but should be fixed by calling
ifdown. In testing as we speak.

-- 
Regards
Einar Jón

> --
> Aleksander
> https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review v2] New 'fibocom' plugin (with a new Intel XMM modem class)

2018-08-21 Thread Dan Williams
On Wed, 2018-08-08 at 17:14 +0200, Aleksander Morgado wrote:
> > > 
> > > I've now pushed an updated MR to suggest the Fibocom plugin, this
> > > time
> > > including a new "Icera-like" Intel XMM chipset detection. If the
> > > modem
> > > is found to be based on Intel XMM, supporting the "AT+X.."
> > > commands,
> > > then we will use them for things like mode switching. This
> > > updated MR
> > > includes mode/band selection as well as additional power related
> > > operations like "off" or "reset".
> > > 
> > > The new XMM-specific operations are implemented in a
> > > "MMSharedXmm"
> > > interface, which is used by both the MMBroadbandXmm and
> > > MMBroadbandMbimXmm objects.
> > > 
> > > https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merg
> > > e_requests/12
> > > 
> > > Comments?
> > 
> > IIRC, Huawei ME936 is based on Intel XMM7160, but implements a
> > different set of AT commands that align mostly with other Huawei
> > modems. If you have such a modem, you may want to check if those
> > AT+X*
> > commands exist and behave as expected.  I may be able to find one
> > to
> > test and will let you know.
> > 
> 
> u-blox also does basically the same thing, they're based on Intel XMM
> modems but they provide custom AT commands on top (e.g. UACT and URAT
> instead of XACT, or UCALLSTAT instead of XCALLSTAT). This generic XMM
> implementation could be applied to all modems that don't provide
> customized AT commands instead of the original Intel AT+X commands.

Merged to git master, FWIW.

Dan
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] USSD support for MBIM

2018-08-21 Thread Dan Williams
On Wed, 2018-08-08 at 17:18 +0200, Aleksander Morgado wrote:
> Hey,
> 
> This MR adds USSD support for MBIM devices, and while at it, also
> ported the original MMBroadbandModem USSD support to GTask:
> 
> https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_re
> quests/23
> 
> The MBIM USSD logic basically matches what we had for the AT+CUSD
> based logic. The main difference being that the actual strings are
> always encoded (GSM7 or UCS2) in the MBIM USSD logic while the
> strings
> passed to AT+CUSD were all in the current modem charset, except for
> Huawei modems (which are also always in GSM7/hex).
> 
> Comments?

Merged to git master.

Dan
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] MBIM ATDS service based 3GPP location and extended Signal interface support

2018-08-21 Thread Dan Williams
On Thu, 2018-08-09 at 13:45 +0200, Aleksander Morgado wrote:
> Hey,
> 
> The following MR introduces support for using the MBIM ATDS service
> extensions to query for 3GPP location (LAC/TAC/CID) as well as
> extended signal information (RSRP, RSRQ, RSSI...).
> 
> The MR contains 3 commits but only the last 2 are relevant. The first
> one is a commit cherry-picked from the aleksander/mbim-ussd support
> to
> avoid many conflict resolutions later on.
> 
> https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_re
> quests/25
> 
> Comments?

Nope.  Merged to git master last week.

Dan
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] New 'MMSharedCinterion' interface

2018-08-21 Thread Dan Williams
On Mon, 2018-08-13 at 19:25 +0200, Aleksander Morgado wrote:
> Hey,
> 
> See this MR:
> https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_re
> quests/26
> 
> It implements a new shared interface containing the code shared
> between the Cinterion modem objects, similar to what's been suggested
> for Qmi and Xmm in other MRs.
> 
> It also fixes the logic behind the parent interface management: we
> cannot get a single static pointer pointing to the parent interface
> because this will be different depending on the object hierarchy
> (e.g.
> the location interface of the parent of MMBroadbandModemCinterion is
> the location interface of the MMBroadbandModem; while the location
> interface of the parent of the MMBroadbandModemQmiCinterion is the
> location interface of the MMBroadbandModemQmi). This issue would make
> ModemManager crash if a MMBroadbandModemQmiCinterion and a
> MMBroadbandModemCinterion modem were managed at the same time.

Merged to git master.

Dan
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] QMI LOC based GPS positioning for QMI and Qualcomm-based MBIM devices

2018-08-21 Thread Dan Williams
On Mon, 2018-08-13 at 15:06 +0200, Aleksander Morgado wrote:
> Hey all,
> 
> > 
> > See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/me
> > rge_requests/10
> > 
> > The MR implements QMI LOC based GPS positioning, including SUPL-
> > server
> > based A-GPS and some new support for injecting "assistance data"
> > (e.g.
> > Qualcomm gpsOneXtra files), useful when the device doesn't have a
> > mobile network coverage.
> > 
> > The implementation moves all the QMI LOC management to a separate
> > "MMSharedQmi" interface, that is used by both the QMI and MBIM
> > mobile
> > broadband objects, so the GNSS positioning support (both QMI PDS
> > and
> > QMI LOC) is now also available in Qualcomm-based MBIM devices.
> > 
> 
> I have re-created and re-pushed this branch after fixing up how the
> "parent interface" is obtained by the new MMSharedQmi implementation.

Merged to git master.

Dan
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] ICCID related improvements

2018-08-21 Thread Dan Williams
On Tue, 2018-08-21 at 16:41 +0200, Aleksander Morgado wrote:
> Hey all,
> 
> This MR includes some improvements for ICCID reporting:
> https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_re
> quests/29
> 
> Fixes several things found recently with China Mobile ICCIDs.

Do we need testcases on this one?

Dan
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


[review] ICCID related improvements

2018-08-21 Thread Aleksander Morgado
Hey all,

This MR includes some improvements for ICCID reporting:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/29

Fixes several things found recently with China Mobile ICCIDs.

Cheers

-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel