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'
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2012-2018 Google, Inc.
|
* Copyright (C) 2012-2018 Google, Inc.
|
||||||
* Copyright (C) 2018 Aleksander Morgado <aleksander@aleksander.es>
|
* Copyright (C) 2018 Aleksander Morgado <aleksander@aleksander.es>
|
||||||
|
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#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 *
|
GArray *
|
||||||
mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands,
|
mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands,
|
||||||
QmiDmsLteBandCapability qmi_lte_bands,
|
QmiDmsLteBandCapability qmi_lte_bands,
|
||||||
GArray *extended_qmi_lte_bands,
|
GArray *extended_qmi_lte_bands,
|
||||||
|
GArray *qmi_nr5g_bands,
|
||||||
gpointer log_object)
|
gpointer log_object)
|
||||||
{
|
{
|
||||||
GArray *mm_bands;
|
GArray *mm_bands;
|
||||||
@@ -367,6 +401,9 @@ mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands,
|
|||||||
else
|
else
|
||||||
dms_add_qmi_lte_bands (mm_bands, qmi_lte_bands);
|
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;
|
return mm_bands;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
* GNU General Public License for more details:
|
* GNU General Public License for more details:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Google, Inc.
|
* Copyright (C) 2012 Google, Inc.
|
||||||
|
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MM_MODEM_HELPERS_QMI_H
|
#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,
|
GArray *mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands,
|
||||||
QmiDmsLteBandCapability qmi_lte_bands,
|
QmiDmsLteBandCapability qmi_lte_bands,
|
||||||
GArray *extended_qmi_lte_bands,
|
GArray *extended_qmi_lte_bands,
|
||||||
|
GArray *qmi_nr5g_bands,
|
||||||
gpointer log_object);
|
gpointer log_object);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@@ -1845,6 +1845,7 @@ dms_get_band_capabilities_ready (QmiClientDms *client,
|
|||||||
QmiDmsBandCapability qmi_bands = 0;
|
QmiDmsBandCapability qmi_bands = 0;
|
||||||
QmiDmsLteBandCapability qmi_lte_bands = 0;
|
QmiDmsLteBandCapability qmi_lte_bands = 0;
|
||||||
GArray *extended_qmi_lte_bands = NULL;
|
GArray *extended_qmi_lte_bands = NULL;
|
||||||
|
GArray *qmi_nr5g_bands = NULL;
|
||||||
|
|
||||||
self = g_task_get_source_object (task);
|
self = g_task_get_source_object (task);
|
||||||
priv = get_private (self);
|
priv = get_private (self);
|
||||||
@@ -1867,8 +1868,12 @@ dms_get_band_capabilities_ready (QmiClientDms *client,
|
|||||||
output,
|
output,
|
||||||
&extended_qmi_lte_bands,
|
&extended_qmi_lte_bands,
|
||||||
NULL);
|
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) {
|
if (mm_bands->len == 0) {
|
||||||
g_clear_pointer (&mm_bands, g_array_unref);
|
g_clear_pointer (&mm_bands, g_array_unref);
|
||||||
error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||||
|
Reference in New Issue
Block a user