aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPrakash Pabba <quic_ppabba@quicinc.com>2021-08-31 17:59:55 +0530
committerPrakash Pabba <quic_ppabba@quicinc.com>2021-11-14 20:19:37 +0530
commit6e1cb371ca26efda0454328e6e2af864ddd2b992 (patch)
treeaa6f868cf47b44ff89a8e056f95181241ed85c9a /src
parent35d5287ddaeeae08370369b94f472d71301ea1e0 (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')
-rw-r--r--src/mm-modem-helpers-qmi.c37
-rw-r--r--src/mm-modem-helpers-qmi.h2
-rw-r--r--src/mm-shared-qmi.c7
3 files changed, 45 insertions, 1 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;
}
diff --git a/src/mm-modem-helpers-qmi.h b/src/mm-modem-helpers-qmi.h
index 4891fae1..152da3ed 100644
--- a/src/mm-modem-helpers-qmi.h
+++ b/src/mm-modem-helpers-qmi.h
@@ -11,6 +11,7 @@
* GNU General Public License for more details:
*
* Copyright (C) 2012 Google, Inc.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef MM_MODEM_HELPERS_QMI_H
@@ -41,6 +42,7 @@ QmiDmsUimFacility mm_3gpp_facility_to_qmi_uim_facility (MMModem3gppFacility mm);
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);
/*****************************************************************************/
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c
index 80230029..604d00eb 100644
--- a/src/mm-shared-qmi.c
+++ b/src/mm-shared-qmi.c
@@ -1845,6 +1845,7 @@ dms_get_band_capabilities_ready (QmiClientDms *client,
QmiDmsBandCapability qmi_bands = 0;
QmiDmsLteBandCapability qmi_lte_bands = 0;
GArray *extended_qmi_lte_bands = NULL;
+ GArray *qmi_nr5g_bands = NULL;
self = g_task_get_source_object (task);
priv = get_private (self);
@@ -1867,8 +1868,12 @@ dms_get_band_capabilities_ready (QmiClientDms *client,
output,
&extended_qmi_lte_bands,
NULL);
+ qmi_message_dms_get_band_capabilities_output_get_nr5g_band_capability (
+ output,
+ &qmi_nr5g_bands,
+ NULL);
- mm_bands = mm_modem_bands_from_qmi_band_capabilities (qmi_bands, qmi_lte_bands, extended_qmi_lte_bands, self);
+ mm_bands = mm_modem_bands_from_qmi_band_capabilities (qmi_bands, qmi_lte_bands, extended_qmi_lte_bands, qmi_nr5g_bands, self);
if (mm_bands->len == 0) {
g_clear_pointer (&mm_bands, g_array_unref);
error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED,