aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers-qmi.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-23 21:09:58 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-03-10 10:59:22 +0100
commitcd2f8d9d6344dcd4b079fc17e0b8bc555b54a1a4 (patch)
tree3c3bf8429f8dab26f692e43882bc340296670471 /src/mm-modem-helpers-qmi.c
parentd1a893775ea1968a32377f0fc8cb049916aec5a7 (diff)
port-qmi: keep track of the endpoint info
The endpoint info of a given MMPortQmi is immutable (it's associated to the specific kernel driver in use and to the specific physical interface number of the device). We'll load it as soon as the kernel device object is set in the port, and we'll keep it in the private struct so that it can be used at any time, e.g. by the WDA Get/Set Data Format operations on newest devices, where the endpoint info TLV is mandatory.
Diffstat (limited to 'src/mm-modem-helpers-qmi.c')
-rw-r--r--src/mm-modem-helpers-qmi.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c
index e4bc7e29..ef951bac 100644
--- a/src/mm-modem-helpers-qmi.c
+++ b/src/mm-modem-helpers-qmi.c
@@ -1539,6 +1539,27 @@ mm_bearer_ip_family_to_qmi_pdp_type (MMBearerIpFamily ip_family,
}
/*****************************************************************************/
+/* QMI/WDA to MM translations */
+
+QmiDataEndpointType
+mm_port_subsys_to_qmi_endpoint_type (MMPortSubsys subsys)
+{
+ switch (subsys) {
+ case MM_PORT_SUBSYS_USBMISC:
+ return QMI_DATA_ENDPOINT_TYPE_HSUSB;
+ case MM_PORT_SUBSYS_RPMSG:
+ return QMI_DATA_ENDPOINT_TYPE_EMBEDDED;
+ case MM_PORT_SUBSYS_UNKNOWN:
+ case MM_PORT_SUBSYS_TTY:
+ case MM_PORT_SUBSYS_NET:
+ case MM_PORT_SUBSYS_UNIX:
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+}
+
+/*****************************************************************************/
/**
* The only case where we need to apply some logic to decide what the current