[PATCH] libqmi-glib: use ((guint64) 1) << 31 for QMI_*_BAND_CAPABILITY_BC_15

Reinhard Speyerer rspmn at arcor.de
Fri Mar 25 15:40:09 UTC 2016


The current definition of QMI_*_BAND_CAPABILITY_BC_15 gets converted to a
negative value (0xffffffff80000000) which causes false positives for BC15
to be returned from dms_add_qmi_bands() and nas_add_qmi_bands() in
ModemManager/src/mm-modem-helpers-qmi.c when a matching QMI band (e.g.
WCDMA900) is present in qmi_bands like in this example
https://lists.freedesktop.org/archives/libqmi-devel/2016-March/001572.html .

Replace 1 << 31  with ((guint64) 1) << 31 for QMI_*_BAND_CAPABILITY_BC_15
to avoid incorrect mmcli "Bands | supported: 'cdma-bc15-aws, ...'" output.

Signed-off-by: Reinhard Speyerer <rspmn at arcor.de>
---
diff --git a/src/libqmi-glib/qmi-flags64-dms.h b/src/libqmi-glib/qmi-flags64-dms.h
index 678b829..b416569 100644
--- a/src/libqmi-glib/qmi-flags64-dms.h
+++ b/src/libqmi-glib/qmi-flags64-dms.h
@@ -111,7 +111,7 @@ typedef enum {
     QMI_DMS_BAND_CAPABILITY_BC_12            = 1 << 28,
     QMI_DMS_BAND_CAPABILITY_BC_14            = 1 << 29,
     /* Bit 30 reserved */
-    QMI_DMS_BAND_CAPABILITY_BC_15            = 1 << 31,
+    QMI_DMS_BAND_CAPABILITY_BC_15            = ((guint64) 1) << 31,
     /* Bits 32-47 reserved */
     QMI_DMS_BAND_CAPABILITY_WCDMA_2600       = ((guint64) 1) << 48,
     QMI_DMS_BAND_CAPABILITY_WCDMA_900        = ((guint64) 1) << 49,
diff --git a/src/libqmi-glib/qmi-flags64-nas.h b/src/libqmi-glib/qmi-flags64-nas.h
index b76f8f2..ef0c621 100644
--- a/src/libqmi-glib/qmi-flags64-nas.h
+++ b/src/libqmi-glib/qmi-flags64-nas.h
@@ -108,7 +108,7 @@ typedef enum {
     QMI_NAS_BAND_PREFERENCE_BC_12            = 1 << 28,
     QMI_NAS_BAND_PREFERENCE_BC_14            = 1 << 29,
     /* Bit 30 reserved */
-    QMI_NAS_BAND_PREFERENCE_BC_15            = 1 << 31,
+    QMI_NAS_BAND_PREFERENCE_BC_15            = ((guint64) 1) << 31,
     /* Bits 32-47 reserved */
     QMI_NAS_BAND_PREFERENCE_WCDMA_2600       = ((guint64) 1) << 48,
     QMI_NAS_BAND_PREFERENCE_WCDMA_900        = ((guint64) 1) << 49,


More information about the libqmi-devel mailing list