diff options
author | Prakash Pabba <quic_ppabba@quicinc.com> | 2021-08-31 17:59:55 +0530 |
---|---|---|
committer | Prakash Pabba <quic_ppabba@quicinc.com> | 2021-11-14 20:19:37 +0530 |
commit | 6e1cb371ca26efda0454328e6e2af864ddd2b992 (patch) | |
tree | aa6f868cf47b44ff89a8e056f95181241ed85c9a /src/mm-modem-helpers-qmi.c | |
parent | 35d5287ddaeeae08370369b94f472d71301ea1e0 (diff) |
shared-qmi,modem-helpers-qmi: Add support for NR5G band capability
Implement support for the NR5G band list to get supported NR5G
band capabilities.
localhost ~ # qmicli -d qrtr://0 --dms-get-band-capabilities
[qrtr://0] Device band capabilities retrieved:
Bands: 'bc-0-a-system, bc-0-b-system, bc-1-all-blocks, gsm-dcs-1800, gsm-900-extended, bc-10, gsm-850, gsm-pcs-1900, wcdma-2100, wcdma-pcs-1900, wcdma-1700-us, wcdma-850-us, wcdma-800, wcdma-900, wcdma-850-japan'
LTE bands: '1, 2, 3, 4, 5, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20, 21, 25, 26, 28, 29, 30, 32, 34, 38, 39, 40, 41, 42, 43'
LTE bands (extended): '1, 2, 3, 4, 5, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20, 21, 25, 26, 28, 29, 30, 32, 34, 38, 39, 40, 41, 42, 43, 46, 48, 66, 68, 71'
NR5G bands: '1, 2, 3, 5, 7, 8, 12, 13, 14, 18, 20, 25, 26, 28, 29, 30, 38, 40, 41, 48, 66, 70, 71, 77, 78, 79'
Diffstat (limited to 'src/mm-modem-helpers-qmi.c')
-rw-r--r-- | src/mm-modem-helpers-qmi.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c index 7b71a785..8228438d 100644 --- a/src/mm-modem-helpers-qmi.c +++ b/src/mm-modem-helpers-qmi.c @@ -12,6 +12,7 @@ * * Copyright (C) 2012-2018 Google, Inc. * Copyright (C) 2018 Aleksander Morgado <aleksander@aleksander.es> + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <string.h> @@ -351,10 +352,43 @@ dms_add_extended_qmi_lte_bands (GArray *mm_bands, } } +static void +dms_add_qmi_nr5g_bands (GArray *mm_bands, + GArray *qmi_bands, + gpointer log_object) +{ + guint i; + + g_assert (mm_bands != NULL); + + if (!qmi_bands) + return; + + for (i = 0; i < qmi_bands->len; i++) { + guint16 val; + + val = g_array_index (qmi_bands, guint16, i); + + /* MM_MODEM_BAND_NGRAN_1 = 301, + * ... + * MM_MODEM_BAND_NGRAN_261 = 561 + */ + if (val < 1 || val > 261) + mm_obj_dbg (log_object, "unexpected NR5G band supported by module: NGRAN %u", val); + else { + MMModemBand band; + + band = (MMModemBand)(val + MM_MODEM_BAND_NGRAN_1 - 1); + g_array_append_val (mm_bands, band); + } + } +} + GArray * mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands, QmiDmsLteBandCapability qmi_lte_bands, GArray *extended_qmi_lte_bands, + GArray *qmi_nr5g_bands, gpointer log_object) { GArray *mm_bands; @@ -367,6 +401,9 @@ mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands, else dms_add_qmi_lte_bands (mm_bands, qmi_lte_bands); + if (qmi_nr5g_bands) + dms_add_qmi_nr5g_bands (mm_bands, qmi_nr5g_bands, log_object); + return mm_bands; } |