From b10139f96bc634a672f2850e870d860e5bbb7049 Mon Sep 17 00:00:00 2001 From: xuhongxing Date: Tue, 24 Mar 2026 17:08:51 +0800 Subject: [PATCH] Rolling: Add modifications related to the rw350-usb project 1.Modify rule files for the 33f8/0802 MI interface 2.Modify the rolling plugin code to share and reuse code from the mtk plugin T: Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=33f8 ProdID=0802 Rev=00.01 S: Manufacturer=Rolling Wireless S.a.r.l. S: Product=USB DATA CARD C: #Ifs=10 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=06(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=07(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=88(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=08(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=09(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=8a(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms Signed-off-by: xuhongxing --- meson.build | 2 +- src/plugins/meson.build | 2 +- .../rolling/77-mm-rolling-port-types.rules | 16 ++++++++++++++++ src/plugins/rolling/mm-plugin-rolling.c | 11 +++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 0198a6d1..3cf29e80 100644 --- a/meson.build +++ b/meson.build @@ -383,7 +383,7 @@ plugins_options_reqs = { 'pantech': {'available': true, 'shared': []}, 'qcom-soc': {'available': enable_qmi, 'shared': []}, 'quectel': {'available': true, 'shared': ['quectel']}, - 'rolling': {'available': true, 'shared': ['fibocom']}, + 'rolling': {'available': true, 'shared': ['fibocom', 'mtk']}, 'samsung': {'available': true, 'shared': ['icera']}, 'sierra-legacy': {'available': true, 'shared': ['icera', 'sierra']}, 'sierra': {'available': true, 'shared': ['xmm']}, diff --git a/src/plugins/meson.build b/src/plugins/meson.build index 47f12bd5..10d02933 100644 --- a/src/plugins/meson.build +++ b/src/plugins/meson.build @@ -905,7 +905,7 @@ if plugins_options['rolling'] test_udev_rules_dir_c_args = ['-DTESTUDEVRULESDIR_ROLLING="@0@"'.format(plugins_dir / 'rolling')] plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args - incs = plugins_incs + [fibocom_inc] + incs = plugins_incs + [fibocom_inc] + [mtk_inc] sources = files( 'rolling/mm-plugin-rolling.c', diff --git a/src/plugins/rolling/77-mm-rolling-port-types.rules b/src/plugins/rolling/77-mm-rolling-port-types.rules index 7dfccc91..01e1e684 100644 --- a/src/plugins/rolling/77-mm-rolling-port-types.rules +++ b/src/plugins/rolling/77-mm-rolling-port-types.rules @@ -81,4 +81,20 @@ ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="02", SUBS ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1" ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +# Rolling RW350-USB (MBIM in iface #0, ADB in iface #5) +# ttyUSB0 (if #2): AP AT port +# ttyUSB1 (if #3): AP LOG port +# ttyUSB2 (if #4): AP META port +# ttyUSB3 (if #6): MD AT port +# ttyUSB4 (if #7): MD META port +# ttyUSB5 (if #8): NPT port +# ttyUSB6 (if #9): DEBUG port +ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0802", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0802", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0802", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0802", ENV{.MM_USBIFNUM}=="06", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0802", ENV{.MM_USBIFNUM}=="07", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0802", ENV{.MM_USBIFNUM}=="08", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0802", ENV{.MM_USBIFNUM}=="09", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" + LABEL="mm_rolling_port_types_end" diff --git a/src/plugins/rolling/mm-plugin-rolling.c b/src/plugins/rolling/mm-plugin-rolling.c index c2955c11..21404fe8 100644 --- a/src/plugins/rolling/mm-plugin-rolling.c +++ b/src/plugins/rolling/mm-plugin-rolling.c @@ -28,6 +28,7 @@ #include "mm-broadband-modem-fibocom.h" #if defined WITH_MBIM #include "mm-broadband-modem-mbim-fibocom.h" +#include "mm-broadband-modem-mbim-mtk-fibocom.h" #endif #if defined WITH_QMI @@ -53,6 +54,16 @@ create_modem (MMPlugin *self, { #if defined WITH_MBIM if (mm_port_probe_list_has_mbim_port (probes)) { + /* rw350r-usb support with rolling-specific changes */ + if (product == 0x0802) { + mm_obj_dbg (self, "MBIM-powered MTK-based Rolling modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_mbim_mtk_fibocom_new (uid, + physdev, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } /* For the MBIM-based modem we fully rely on the Fibocom implementation */ mm_obj_dbg (self, "MBIM-powered Rolling modem found..."); return MM_BASE_MODEM (mm_broadband_modem_mbim_fibocom_new (uid,