diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-02-18 15:13:11 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-10 10:59:22 +0100 |
commit | b45948a20dcceccf0fa506f3a84b25136b8abf07 (patch) | |
tree | ead2d9071016c2eac7f15bb43c796996a567e244 /src/mm-port-qmi.h | |
parent | cd2f8d9d6344dcd4b079fc17e0b8bc555b54a1a4 (diff) |
port-qmi: rework WDA-based logic and avoid setup during port open
The new logic is implemented as a separate async method with its own
state machine, which allows selecting different data format setups
with an strict preference.
Until now, we would not attempt to re-configure the link layer
protocol in the modem interface if we could instead change the
expected data format in the kernel. E.g. a MC7304 exposing one
interface in 802.3 format and another one in raw-ip format would be
used in either 802.3 or raw-ip, depending on the network interface
being connected.
This logic changes now, and we now by default always prefer raw-ip
over 802.3. E.g. the same MC7304 would now always be used in raw-ip
mode, regardless of whether the interface was by default in raw-ip or
not. Obviously, raw-ip will only be used if the kernel data format can
be changed. If the qmi_wwan driver in use is older than 4.5, the
default link layer protocol attempted would be 802.3, if the modem
supports it.
In addition to this change in logic, we also now avoid setting up the
WDA data format as soon as the port is opened; instead we defer that
logic until a connection request arrives, because once QMAP support is
integrated, we'll need to know whether the user requested the
multiplexing support or not. Therefore, during port open we just
query current state and during the connection attempt we reconfigure
either modem or kernel or both.
If WDA is unsupported, the logic falls back to CTL-based link layer
protocol configuration, as it use to.
The logic now also supports WDA Set/Get Data Format operations with
the newest modems that require the explicit endpoint info TLV. As soon
as the first failure is reported asking for the endpoint TLV, we'll
flag the port as requiring the endpoint info always.
Diffstat (limited to 'src/mm-port-qmi.h')
-rw-r--r-- | src/mm-port-qmi.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mm-port-qmi.h b/src/mm-port-qmi.h index 2a353e90..f776951d 100644 --- a/src/mm-port-qmi.h +++ b/src/mm-port-qmi.h @@ -97,6 +97,19 @@ QmiDevice *mm_port_qmi_peek_device (MMPortQmi *self); QmiDataEndpointType mm_port_qmi_get_endpoint_type (MMPortQmi *self); guint mm_port_qmi_get_endpoint_interface_number (MMPortQmi *self); -gboolean mm_port_qmi_llp_is_raw_ip (MMPortQmi *self); +QmiWdaLinkLayerProtocol mm_port_qmi_get_link_layer_protocol (MMPortQmi *self); + +typedef enum { + MM_PORT_QMI_SETUP_DATA_FORMAT_ACTION_QUERY, + MM_PORT_QMI_SETUP_DATA_FORMAT_ACTION_SET_DEFAULT, +} MMPortQmiSetupDataFormatAction; + +void mm_port_qmi_setup_data_format (MMPortQmi *self, + MMPortQmiSetupDataFormatAction action, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_port_qmi_setup_data_format_finish (MMPortQmi *self, + GAsyncResult *res, + GError **error); #endif /* MM_PORT_QMI_H */ |