[PATCH] libqmi-glib: use ((guint64) 1) << 31 for QMI_*_BAND_CAPABILITY_BC_15
Aleksander Morgado
aleksander at aleksander.es
Fri Mar 25 18:29:26 UTC 2016
On 25/03/16 16:40, Reinhard Speyerer wrote:
> 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>
Ha! nice one :)
Pushed to git master, qmi-1-14 and qmi-1-12.
> ---
> 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,
> _______________________________________________
> libqmi-devel mailing list
> libqmi-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libqmi-devel
>
--
Aleksander
https://aleksander.es
More information about the libqmi-devel
mailing list