g_assert_cmpmem and glib 2.46

2018-11-06 Thread Ben Chan
Hi Aleksander and Dan,

The PCO patches I submitted earlier on used g_assert_cmpmem(), which I
just realized that it is available in glib 2.46 or later.
ModemManager requires glib 2.36 or later.   Given that glib 2.45 was
released about 3 years ago, I wonder if it's time to bump the minimum
glib version. Otherwise, I can update the code not to use
g_assert_cmpmem(). WDYT?

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


Re: Band 28 not appearing in mmcli output

2018-11-06 Thread Nick B
Hey!

Tested and working for me, here is the patch.  Next I need to get it into 
mmcli’s output.


diff --git a/src/libqmi-glib/qmi-flags64-dms.h 
b/src/libqmi-glib/qmi-flags64-dms.h
index 240d26c..f9dbe88 100644
--- a/src/libqmi-glib/qmi-flags64-dms.h
+++ b/src/libqmi-glib/qmi-flags64-dms.h
@@ -193,13 +193,7 @@ typedef enum {
 /* Bit 21-22 reserved */
 QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_24 = 1 << 23,
 QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_25 = 1 << 24,
-QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_26 = 1 << 25,
-QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_27 = 1 << 26,
-QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_28 = 1 << 27,
-QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_29 = 1 << 28,
-QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_30 = 1 << 29,
-QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_31 = 1 << 30,
-QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_32 = 1 << 31,   
+/* Bit 25-31 reserved */
 QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_33 = ((guint64) 1) << 32,
 QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_34 = ((guint64) 1) << 33,
 QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_35 = ((guint64) 1) << 34,



And here is some sample output 
Before patch:
root@openwrt:(unknown)# qmicli -d /dev/cdc-wdm0 -p --dms-get-band-capabilities
[/dev/cdc-wdm0] Device band capabilities retrieved:
Bands: 'wcdma-2100, wcdma-850-us, wcdma-800, wcdma-900, 
wcdma-1700-japan, wcdma-850-japan'
LTE bands: '1, 3, 5, 7, 8, 18, 19, 21, 38, 39, 40, 41'

With patch:
root@openwrt:~# qmicli -d /dev/cdc-wdm0 -p --dms-get-band-capabilities
[/dev/cdc-wdm0] Device band capabilities retrieved:
Bands: 'wcdma-2100, wcdma-850-us, wcdma-800, wcdma-900, 
wcdma-1700-japan, wcdma-850-japan'
LTE bands: '1, 3, 5, 7, 8, 18, 19, 21, 28, 38, 39, 40, 41'


Best,
Nicholas

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


[PATCH] broadband-modem-mbim: update ms-basic-connect-extensions naming

2018-11-06 Thread Ben Chan
libmbim 1.17.4 (commit 3eeaa4248b98 "ms-basic-connect-extensions: rename
service") added a MS prefix to the Basic Connectivity Extensions
service. This patch updates the MMBroadbandModemMbim code accordingly.
---
 configure.ac  |  2 +-
 src/mm-broadband-modem-mbim.c | 22 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index f6623eab..964cb523 100644
--- a/configure.ac
+++ b/configure.ac
@@ -317,7 +317,7 @@ 
dnl-
 dnl MBIM support (enabled by default)
 dnl
 
-LIBMBIM_VERSION=1.17.3
+LIBMBIM_VERSION=1.17.4
 
 AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM 
support]), [], [with_mbim=yes])
 AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index 8f95e60e..4f92a7c0 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -2009,9 +2009,9 @@ query_device_services_ready (MbimDevice   *device,
 service = mbim_uuid_to_service 
(_services[i]->device_service_id);
 
 switch (service) {
-case MBIM_SERVICE_BASIC_CONNECT_EXTENSIONS:
+case MBIM_SERVICE_MS_BASIC_CONNECT_EXTENSIONS:
 for (j = 0; j < device_services[i]->cids_count; j++) {
-if (device_services[i]->cids[j] == 
MBIM_CID_BASIC_CONNECT_EXTENSIONS_PCO) {
+if (device_services[i]->cids[j] == 
MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_PCO) {
 mm_dbg ("PCO is supported");
 self->priv->is_pco_supported = TRUE;
 break;
@@ -2754,7 +2754,7 @@ sms_notification (MMBroadbandModemMbim *self,
 }
 
 static void
-basic_connect_extensions_notification_pco (MMBroadbandModemMbim *self,
+ms_basic_connect_extensions_notification_pco (MMBroadbandModemMbim *self,
MbimMessage *notification)
 {
 MbimPcoValue *pco_value;
@@ -2762,7 +2762,7 @@ basic_connect_extensions_notification_pco 
(MMBroadbandModemMbim *self,
 gchar *pco_data_hex;
 MMPco *pco;
 
-if (!mbim_message_basic_connect_extensions_pco_notification_parse (
+if (!mbim_message_ms_basic_connect_extensions_pco_notification_parse (
 notification,
 _value,
 )) {
@@ -2796,13 +2796,13 @@ basic_connect_extensions_notification_pco 
(MMBroadbandModemMbim *self,
 }
 
 static void
-basic_connect_extensions_notification (MMBroadbandModemMbim *self,
+ms_basic_connect_extensions_notification (MMBroadbandModemMbim *self,
MbimMessage *notification)
 {
 switch (mbim_message_indicate_status_get_cid (notification)) {
-case MBIM_CID_BASIC_CONNECT_EXTENSIONS_PCO:
+case MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_PCO:
 if (self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_PCO)
-basic_connect_extensions_notification_pco (self, notification);
+ms_basic_connect_extensions_notification_pco (self, notification);
 break;
 default:
 /* Ignore */
@@ -2846,8 +2846,8 @@ device_notification_cb (MbimDevice *device,
 case MBIM_SERVICE_BASIC_CONNECT:
 basic_connect_notification (self, notification);
 break;
-case MBIM_SERVICE_BASIC_CONNECT_EXTENSIONS:
-basic_connect_extensions_notification (self, notification);
+case MBIM_SERVICE_MS_BASIC_CONNECT_EXTENSIONS:
+ms_basic_connect_extensions_notification (self, notification);
 break;
 case MBIM_SERVICE_SMS:
 sms_notification (self, notification);
@@ -3083,10 +3083,10 @@ common_enable_disable_unsolicited_events 
(MMBroadbandModemMbim *self,
 /* Basic connect extensions service */
 if (self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_PCO) {
 entries[n_entries] = g_new (MbimEventEntry, 1);
-memcpy (&(entries[n_entries]->device_service_id), 
MBIM_UUID_BASIC_CONNECT_EXTENSIONS, sizeof (MbimUuid));
+memcpy (&(entries[n_entries]->device_service_id), 
MBIM_UUID_MS_BASIC_CONNECT_EXTENSIONS, sizeof (MbimUuid));
 entries[n_entries]->cids_count = 1;
 entries[n_entries]->cids = g_new0 (guint32, 1);
-entries[n_entries]->cids[0] = MBIM_CID_BASIC_CONNECT_EXTENSIONS_PCO;
+entries[n_entries]->cids[0] = MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_PCO;
 n_entries++;
 }
 
-- 
2.19.1.930.g4563a0d9d0-goog

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


Re: Band 28 not appearing in mmcli output

2018-11-06 Thread Aleksander Morgado
Hey!

> > > I got it installed, but it is still missing band 28 in the mmcli and 
> > > qmicli output.  It is a MC7430 in QMI mode.  Any special requirements?
> > >
> > >
> > >   Bands|  supported: 'utran-1, utran-6, utran-5, utran-8, 
> > > utran-9, eutran-1, eutran-3, eutran-5, eutran-7, eutran-8, eutran-18, 
> > > eutran-19, eutran-21, eutran-38, eutran-39, eutran-40, eutran-41, 
> > > utran-19'
> > >|current: 'unknown'
> > >   -
> > >
> > >
> > > # qmicli -d /dev/cdc-wdm0 -p --dms-get-band-capabilities
> > > [/dev/cdc-wdm0] Device band capabilities retrieved:
> > > Bands: 'wcdma-2100, wcdma-850-us, wcdma-800, wcdma-900, wcdma-1700-japan, 
> > > wcdma-850-japan'
> > > LTE bands: '1, 3, 5, 7, 8, 18, 19, 21, 38, 39, 40, 41'
> > >
> >
> > Well, looks like the modem doesn't report the "Extended LTE Band
> > Capability" TLV in the Get Band Capabilities response; probably a
> > limitation of the firmware. Is this using the latest firmware version?
> >
>
> Hi Aleksander,
>
> the "Extended LTE Band Capability" TLV only seems to be used by devices
> which use LTE bands > 64. For other devices flags which are marked as
> "reserved" in the latest/last(?) GobiAPI_2013-07-31-1347.tar.gz are used
> which explains why some LTE bands are missing in mmcli/qmicli output for
> devices like the MC7430:
>
>   Sierra Wireless EM7565:
>   DMSGetBandCapabilities 3000
>   +OK DMSGetBandCapabilities 
> 020400010800c00f0610100800df190eba00a71108001232001800010002000300040005000700080009000c000d001200130014001a001c001d001e00200029002a002b002e0030004200
>   Sierra Wireless MC7455:
>   DMSGetBandCapabilities 3000
>   +OK DMSGetBandCapabilities 
> 020400110800100800df1808330001010800c0070200
>   Sierra Wireless MC7430:
>   DMSGetBandCapabilities 3000
>   +OK DMSGetBandCapabilities 
> 020400110800100800d5001608e001010800400c0610
>   Quectel BG96:
>   DMSGetBandCapabilities 3000
>   +OK DMSGetBandCapabilities 
> 020400010800800328001008009f180f0a4000
>
> This also applies to NASGetSystemSelectionPref/NASSetSystemSelectionPref.
>

Ohhh, so we just need to add the proper enum entries instead of
flagging them as "reserved" e.g. here:

QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_24 = 1 << 23,
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_25 = 1 << 24,
/* Bit 25-31 reserved */
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_33 = ((guint64) 1) << 32,
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_34 = ((guint64) 1) << 33,

That's an easy fix, anyone up to doing this easy one? :)

And so we should also probably update the QmiNasActiveBand entry
accordingly as well.

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


Re: Band 28 not appearing in mmcli output

2018-11-06 Thread Reinhard Speyerer
On Tue, Nov 06, 2018 at 09:11:00AM +0100, Aleksander Morgado wrote:
> Hey,
> 
> > I got it installed, but it is still missing band 28 in the mmcli and qmicli 
> > output.  It is a MC7430 in QMI mode.  Any special requirements?
> >
> >
> >   Bands|  supported: 'utran-1, utran-6, utran-5, utran-8, utran-9, 
> > eutran-1, eutran-3, eutran-5, eutran-7, eutran-8, eutran-18, eutran-19, 
> > eutran-21, eutran-38, eutran-39, eutran-40, eutran-41, utran-19'
> >|current: 'unknown'
> >   -
> >
> >
> > # qmicli -d /dev/cdc-wdm0 -p --dms-get-band-capabilities
> > [/dev/cdc-wdm0] Device band capabilities retrieved:
> > Bands: 'wcdma-2100, wcdma-850-us, wcdma-800, wcdma-900, wcdma-1700-japan, 
> > wcdma-850-japan'
> > LTE bands: '1, 3, 5, 7, 8, 18, 19, 21, 38, 39, 40, 41'
> >
> 
> Well, looks like the modem doesn't report the "Extended LTE Band
> Capability" TLV in the Get Band Capabilities response; probably a
> limitation of the firmware. Is this using the latest firmware version?
> 

Hi Aleksander,

the "Extended LTE Band Capability" TLV only seems to be used by devices
which use LTE bands > 64. For other devices flags which are marked as
"reserved" in the latest/last(?) GobiAPI_2013-07-31-1347.tar.gz are used
which explains why some LTE bands are missing in mmcli/qmicli output for
devices like the MC7430:

  Sierra Wireless EM7565:
  DMSGetBandCapabilities 3000
  +OK DMSGetBandCapabilities 
020400010800c00f0610100800df190eba00a71108001232001800010002000300040005000700080009000c000d001200130014001a001c001d001e00200029002a002b002e0030004200
  Sierra Wireless MC7455:
  DMSGetBandCapabilities 3000
  +OK DMSGetBandCapabilities 
020400110800100800df1808330001010800c0070200
  Sierra Wireless MC7430:
  DMSGetBandCapabilities 3000
  +OK DMSGetBandCapabilities 
020400110800100800d5001608e001010800400c0610
  Quectel BG96:
  DMSGetBandCapabilities 3000
  +OK DMSGetBandCapabilities 
020400010800800328001008009f180f0a4000

This also applies to NASGetSystemSelectionPref/NASSetSystemSelectionPref.

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


Re: Band 28 not appearing in mmcli output

2018-11-06 Thread Aleksander Morgado
Hey,

> I got it installed, but it is still missing band 28 in the mmcli and qmicli 
> output.  It is a MC7430 in QMI mode.  Any special requirements?
>
>
>   Bands|  supported: 'utran-1, utran-6, utran-5, utran-8, utran-9, 
> eutran-1, eutran-3, eutran-5, eutran-7, eutran-8, eutran-18, eutran-19, 
> eutran-21, eutran-38, eutran-39, eutran-40, eutran-41, utran-19'
>|current: 'unknown'
>   -
>
>
> # qmicli -d /dev/cdc-wdm0 -p --dms-get-band-capabilities
> [/dev/cdc-wdm0] Device band capabilities retrieved:
> Bands: 'wcdma-2100, wcdma-850-us, wcdma-800, wcdma-900, wcdma-1700-japan, 
> wcdma-850-japan'
> LTE bands: '1, 3, 5, 7, 8, 18, 19, 21, 38, 39, 40, 41'
>

Well, looks like the modem doesn't report the "Extended LTE Band
Capability" TLV in the Get Band Capabilities response; probably a
limitation of the firmware. Is this using the latest firmware version?

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