dms: new 'Extended LTE Band Capability' TLV in "Get Band Capabilities"

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@cypress.bc.ca>
Updated according to suggestions from Carlo Lobrano <c.lobrano@gmail.com>
2 files changed