diff mbox series

[07/10] gobi: Support RAW_IP configuration

Message ID 20241121152949.56962-7-denkenz@gmail.com (mailing list archive)
State Under Review
Headers show
Series [01/10] qmi: wda: Add qmi_wda_set_data_format utility | expand

Commit Message

Denis Kenzior Nov. 21, 2024, 3:29 p.m. UTC
Most newer QMI modem firmware only support RAW_IP based configurations.
This is a more efficient data path since 802.3 headers do not need to be
emulated.  Support this data format by configuring the 'raw_ip' setting
on QMI_WWAN accordingly.
---
 plugins/gobi.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/plugins/gobi.c b/plugins/gobi.c
index cb53ec582385..111ddd3464fe 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -65,6 +65,7 @@ 
 
 enum wda_data_format {
 	WDA_DATA_FORMAT_UNKNOWN = 0,
+	WDA_DATA_FORMAT_RAW_IP,
 	WDA_DATA_FORMAT_802_3,	/* Last, most compatible legacy fallback */
 };
 
@@ -133,7 +134,10 @@  static bool wda_get_data_format(struct gobi_data *data,
 		return true;
 	}
 
-	return false;
+	/* For everything except 802.3, use RAW_IP */
+	out_format->ll_protocol = QMI_WDA_DATA_LINK_PROTOCOL_RAW_IP;
+
+	return true;
 }
 
 static int wda_data_format_to_mtu(enum wda_data_format format, uint32_t *out_mtu)
@@ -142,6 +146,7 @@  static int wda_data_format_to_mtu(enum wda_data_format format, uint32_t *out_mtu
 
 	switch (format) {
 	case WDA_DATA_FORMAT_802_3:
+	case WDA_DATA_FORMAT_RAW_IP:
 		mtu = DEFAULT_MTU;
 		break;
 	default:
@@ -500,6 +505,15 @@  static void enable_set_mtu_cb(int error, uint16_t type,
 	if (error)
 		goto error;
 
+	if (data->data_format == WDA_DATA_FORMAT_RAW_IP) {
+		DBG("Setting QMI WWAN to raw_ip");
+
+		if (qmi_wwan_set_raw_ip(data->main_net_name, 'Y') < 0) {
+			ofono_warn("Unable to set raw_ip");
+			goto error;
+		}
+	}
+
 	DBG("Requesting services");
 
 	if (qmi_qmux_device_create_client(data->device, QMI_SERVICE_DMS,