[PATCH 09/10] qmimodem: wds: Add qmi_wds_ip_support_from_ofono

Denis Kenzior <[email protected]>
Newsgroups dev.linux.lists.ofono
Message-ID <[email protected]>
This is used to convert from ofono context type enumeration to
QMI IP support enumeration reported by Get LTE Attach Parameters.
---
 drivers/qmimodem/wds.c | 14 ++++++++++++++
 drivers/qmimodem/wds.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/drivers/qmimodem/wds.c b/drivers/qmimodem/wds.c
index ced0c5e5308d..07c96d4fdc58 100644
--- a/drivers/qmimodem/wds.c
+++ b/drivers/qmimodem/wds.c
@@ -43,6 +43,20 @@ int qmi_wds_pdp_type_from_ofono(enum ofono_gprs_proto proto)
 	return -ENOENT;
 }
 
+int qmi_wds_ip_support_from_ofono(enum ofono_gprs_proto proto)
+{
+	switch (proto) {
+	case OFONO_GPRS_PROTO_IP:
+		return QMI_WDS_IP_SUPPORT_IPV4;
+	case OFONO_GPRS_PROTO_IPV6:
+		return QMI_WDS_IP_SUPPORT_IPV6;
+	case OFONO_GPRS_PROTO_IPV4V6:
+		return QMI_WDS_IP_SUPPORT_IPV4V6;
+	}
+
+	return -ENOENT;
+}
+
 int qmi_wds_parse_data_system_status(const void *dss, uint16_t len)
 {
 	const size_t network_info_size = sizeof(uint8_t) + 2 * sizeof(uint32_t);
diff --git a/drivers/qmimodem/wds.h b/drivers/qmimodem/wds.h
index 64a18aa6d86e..9343d1f83665 100644
--- a/drivers/qmimodem/wds.h
+++ b/drivers/qmimodem/wds.h
@@ -155,6 +155,7 @@ enum qmi_wds_command {
 
 int qmi_wds_auth_from_ofono(enum ofono_gprs_auth_method method);
 int qmi_wds_pdp_type_from_ofono(enum ofono_gprs_proto proto);
+int qmi_wds_ip_support_from_ofono(enum ofono_gprs_proto proto);
 
 int qmi_wds_parse_data_system_status(const void *dss, uint16_t len);
 int qmi_wds_parse_extended_data_bearer_technology(const void *edbt,
-- 
2.47.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.