[PATCH 2/3] dms: new 'Extended LTE Band Capability' TLV in "Get Band Capabilities"

Aleksander Morgado aleksander at aleksander.es
Sat Nov 11 09:55:25 UTC 2017


On Thu, Nov 9, 2017 at 8:32 AM, Aleksander Morgado
<aleksander at aleksander.es> wrote:
> The 'LTE Band Capability' TLV (0x10) is a 64-bit mask, and therefore
> isn't capable of reporting more than 64 bands (1 to 64).
>
> In order to support LTE bands greater than 64, this new 'extended' TLV
> is defined, as an array of uint16 values, one per band.
>
> E.g. this "Get Band Capabilities" response where the modem reports
> band 66:
>
>      [/dev/cdc-wdm0] received message...
>      <<<<<< RAW:
>      <<<<<<   length = 98
>      <<<<<<   data   = 01:61:00:80:02:01:02:01:00:45:00:55:00:02:04:00:00:00:00:00:01:08:00:00:00:C0:07:00:00:02:00:10:08:00:DF:18:09:3B:A0:01:00:00:11:08:00:00:00:00:00:00:00:00:00:12:2A:00:14:00:01:00:02:00:03:00:04:00:05:00:07:00:08:00:0C:00:0D:00:11:00:14:00:19:00:1A:00:1C:00:1D:00:1E:00:26:00:28:00:29:00:42:00
>      [/dev/cdc-wdm0] received generic response (translated)...
>      <<<<<< QMUX:
>      <<<<<<   length  = 97
>      <<<<<<   flags   = 0x80
>      <<<<<<   service = "dms"
>      <<<<<<   client  = 1
>      <<<<<< QMI:
>      <<<<<<   flags       = "response"
>      <<<<<<   transaction = 1
>      <<<<<<   tlv_length  = 85
>      <<<<<<   message     = "Get Band Capabilities" (0x0045)
>      <<<<<< TLV:
>      <<<<<<   type       = "Result" (0x02)
>      <<<<<<   length     = 4
>      <<<<<<   value      = 00:00:00:00
>      <<<<<<   translated = SUCCESS
>      <<<<<< TLV:
>      <<<<<<   type       = "Band Capability" (0x01)
>      <<<<<<   length     = 8
>      <<<<<<   value      = 00:00:C0:07:00:00:02:00
>      <<<<<<   translated = wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800, wcdma-1700-us, wcdma-850-us, wcdma-900
>      <<<<<< TLV:
>      <<<<<<   type       = "LTE Band Capability" (0x10)
>      <<<<<<   length     = 8
>      <<<<<<   value      = DF:18:09:3B:A0:01:00:00
>      <<<<<<   translated = 1, 2, 3, 4, 5, 7, 8, 12, 13, 17, 20, 25, 38, 40, 41
>      <<<<<< TLV:
>      <<<<<<   type   = 0x11
>      <<<<<<   length = 8
>      <<<<<<   value  = 00:00:00:00:00:00:00:00
>      <<<<<< TLV:
>      <<<<<<   type       = "Extended LTE Band Capability" (0x12)
>      <<<<<<   length     = 42
>      <<<<<<   value      = 14:00:01:00:02:00:03:00:04:00:05:00:07:00:08:00:0C:00:0D:00:11:00:14:00:19:00:1A:00:1C:00:1D:00:1E:00:26:00:28:00:29:00:42:00
>      <<<<<<   translated = { [0] = '1 ' [1] = '2 ' [2] = '3 ' [3] = '4 ' [4] = '5 ' [5] = '7 ' [6] = '8 ' [7] = '12 ' [8] = '13 ' [9] = '17 ' [10] = '20 ' [11] = '25 ' [12] = '26 ' [13] = '28 ' [14] = '29 ' [15] = '30 ' [16] = '38 ' [17] = '40 ' [18] = '41 ' [19] = '66 '}
>
> Based on a patch from Wolfgang Tolkien <wtolkien at cypress.bc.ca>


Updated after the suggestion from Carlo, and merged to git master.

> ---
>  data/qmi-service-dms.json | 11 ++++++++++-
>  src/qmicli/qmicli-dms.c   | 13 +++++++++++++
>  2 files changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/data/qmi-service-dms.json b/data/qmi-service-dms.json
> index 72ebb6e..32ae890 100644
> --- a/data/qmi-service-dms.json
> +++ b/data/qmi-service-dms.json
> @@ -1016,7 +1016,16 @@
>                        "since"         : "1.0",
>                        "format"        : "guint64",
>                        "public-format" : "QmiDmsLteBandCapability",
> -                      "prerequisites": [ { "common-ref" : "Success" } ] } ] },
> +                      "prerequisites": [ { "common-ref" : "Success" } ] },
> +                    { "name"                   : "Extended LTE Band Capability",
> +                      "id"                     : "0x12",
> +                      "mandatory"              : "no",
> +                      "type"                   : "TLV",
> +                      "since"                  : "1.20",
> +                      "format"                 : "array",
> +                      "size-prefix-format"     : "guint16",
> +                      "array-element"          : { "format" : "guint16" },
> +                      "prerequisites"          : [ { "common-ref" : "Success" } ] } ] },
>
>    // *********************************************************************************
>    {  "name"    : "Get Factory SKU",
> diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c
> index 46b684b..173dc13 100644
> --- a/src/qmicli/qmicli-dms.c
> +++ b/src/qmicli/qmicli-dms.c
> @@ -2362,6 +2362,7 @@ get_band_capabilities_ready (QmiClientDms *client,
>      QmiMessageDmsGetBandCapabilitiesOutput *output;
>      QmiDmsBandCapability band_capability;
>      QmiDmsLteBandCapability lte_band_capability;
> +    GArray *extended_lte_band_capability;
>      GError *error = NULL;
>      gchar *str;
>
> @@ -2402,6 +2403,18 @@ get_band_capabilities_ready (QmiClientDms *client,
>          g_free (str);
>      }
>
> +    if (qmi_message_dms_get_band_capabilities_output_get_extended_lte_band_capability (
> +            output,
> +            &extended_lte_band_capability,
> +            NULL)) {
> +        guint i;
> +
> +        g_print ("\tLTE bands (extended): '");
> +        for (i = 0; i < extended_lte_band_capability->len; i++)
> +            g_print ("%" G_GUINT16_FORMAT, g_array_index (extended_lte_band_capability, guint16, i));
> +        g_print ("'\n");
> +    }
> +
>      qmi_message_dms_get_band_capabilities_output_unref (output);
>      operation_shutdown (TRUE);
>  }
> --
> 2.15.0
>



-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list