From cd2f8d9d6344dcd4b079fc17e0b8bc555b54a1a4 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 23 Feb 2021 21:09:58 +0100 Subject: 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. --- src/mm-modem-helpers-qmi.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/mm-modem-helpers-qmi.c') 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 @@ -1538,6 +1538,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; + } +} + /*****************************************************************************/ /** -- cgit v1.2.3-70-g09d2