From bf5458acdde51a26b31f747fb7365a5c065deaa1 Mon Sep 17 00:00:00 2001 From: Slark Xiao Date: Tue, 3 Jun 2025 14:25:35 +0800 Subject: [PATCH 1/2] foxconn: add subsystem ID support for T99W696 T99W696 is the first Foxconn PCIE modem whick uses Qualcomm's VID/ PID. Driver ref: https://lore.kernel.org/mhi/20250528092232.16111-1-slark_xiao@163.com This changes include 2 parts: i: Add device for foxconn plugin ii: Show SSVID/SSPID for parameter "--firmware-status". This helps the fwupd get the right firmware upgrade method. Signed-off-by: Slark Xiao --- .../foxconn/mm-broadband-modem-mbim-foxconn.c | 10 ++++++-- .../foxconn/mm-broadband-modem-mbim-foxconn.h | 4 +++- src/plugins/foxconn/mm-plugin-foxconn.c | 24 ++++++++++++------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.c b/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.c index c7965133..9e32df3b 100644 --- a/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.c +++ b/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.c @@ -88,6 +88,7 @@ needs_qdu_and_mcfg_apps_version (MMIfaceModemFirmware *self) { guint vendor_id; guint product_id; + guint subsystem_vid; /* 0x105b is the T99W175 module, T99W175 supports QDU and requires MCFG+APPS version. * T99W265(0x0489:0xe0da ; 0x0489:0xe0db): supports QDU and requires MCFG+APPS version. @@ -95,7 +96,8 @@ needs_qdu_and_mcfg_apps_version (MMIfaceModemFirmware *self) */ vendor_id = mm_base_modem_get_vendor_id (MM_BASE_MODEM (self)); product_id = mm_base_modem_get_product_id (MM_BASE_MODEM (self)); - return (vendor_id == 0x105b || (vendor_id == 0x0489 && (product_id == 0xe0da || product_id == 0xe0db))); + subsystem_vid = mm_base_modem_get_subsystem_vendor_id (MM_BASE_MODEM (self)); + return (vendor_id == 0x105b || (vendor_id == 0x0489 && (product_id == 0xe0da || product_id == 0xe0db)) || subsystem_vid == 0x105b); } /*****************************************************************************/ @@ -582,7 +584,9 @@ mm_broadband_modem_mbim_foxconn_new (const gchar *device, const gchar **drivers, const gchar *plugin, guint16 vendor_id, - guint16 product_id) + guint16 product_id, + guint16 subsystem_vendor_id, + guint16 subsystem_device_id) { const gchar *carrier_config_mapping = NULL; @@ -598,6 +602,8 @@ mm_broadband_modem_mbim_foxconn_new (const gchar *device, MM_BASE_MODEM_PLUGIN, plugin, MM_BASE_MODEM_VENDOR_ID, vendor_id, MM_BASE_MODEM_PRODUCT_ID, product_id, + MM_BASE_MODEM_SUBSYSTEM_VENDOR_ID, subsystem_vendor_id, + MM_BASE_MODEM_SUBSYSTEM_DEVICE_ID, subsystem_device_id, /* MBIM bearer supports NET only */ MM_BASE_MODEM_DATA_NET_SUPPORTED, TRUE, MM_BASE_MODEM_DATA_TTY_SUPPORTED, FALSE, diff --git a/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.h b/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.h index e9535846..f384e3da 100644 --- a/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.h +++ b/src/plugins/foxconn/mm-broadband-modem-mbim-foxconn.h @@ -45,6 +45,8 @@ MMBroadbandModemMbimFoxconn *mm_broadband_modem_mbim_foxconn_new (const gchar * const gchar **driver, const gchar *plugin, guint16 vendor_id, - guint16 product_id); + guint16 product_id, + guint16 subsystem_vendor_id, + guint16 subsystem_device_id); #endif /* MM_BROADBAND_MODEM_MBIM_FOXCONN_H */ diff --git a/src/plugins/foxconn/mm-plugin-foxconn.c b/src/plugins/foxconn/mm-plugin-foxconn.c index c8a48c07..5188fcb8 100644 --- a/src/plugins/foxconn/mm-plugin-foxconn.c +++ b/src/plugins/foxconn/mm-plugin-foxconn.c @@ -74,7 +74,9 @@ create_modem (MMPlugin *self, drivers, mm_plugin_get_name (self), vendor, - product)); + product, + subsystem_vendor, + subsystem_device)); } #endif @@ -97,16 +99,22 @@ mm_plugin_create_foxconn (void) 0x0489, /* usb vid */ 0x105b, /* pci vid */ 0 }; + static const mm_uint16_pair subsystem_vendor_ids[] = { + {0x17cb, 0x105b }, /* QC VID, Foxconn Sub-VID*/ + {0x105b, 0x105b }, /* Foxconn VID, Foxconn Sub-VID*/ + {0, 0 } + }; return MM_PLUGIN ( g_object_new (MM_TYPE_PLUGIN_FOXCONN, - MM_PLUGIN_NAME, MM_MODULE_NAME, - MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, - MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, - MM_PLUGIN_ALLOWED_AT, TRUE, - MM_PLUGIN_ALLOWED_QCDM, TRUE, - MM_PLUGIN_ALLOWED_QMI, TRUE, - MM_PLUGIN_ALLOWED_MBIM, TRUE, + MM_PLUGIN_NAME, MM_MODULE_NAME, + MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, + MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, + MM_PLUGIN_ALLOWED_SUBSYSTEM_VENDOR_IDS, subsystem_vendor_ids, + MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_ALLOWED_QCDM, TRUE, + MM_PLUGIN_ALLOWED_QMI, TRUE, + MM_PLUGIN_ALLOWED_MBIM, TRUE, NULL)); } From 41f82a4d33be54daff193680ac94e07c33d76fcb Mon Sep 17 00:00:00 2001 From: Slark Xiao Date: Thu, 5 Jun 2025 15:33:10 +0800 Subject: [PATCH 2/2] dell: update the foxconn mbim interface Keep the mm_broadband_modem_mbim_foxconn_new() align with the new changes in src/plugins/foxconn. Signed-off-by: Slark Xiao --- src/plugins/dell/mm-plugin-dell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/dell/mm-plugin-dell.c b/src/plugins/dell/mm-plugin-dell.c index 4a9e7817..3079363f 100644 --- a/src/plugins/dell/mm-plugin-dell.c +++ b/src/plugins/dell/mm-plugin-dell.c @@ -405,7 +405,9 @@ create_modem (MMPlugin *self, drivers, mm_plugin_get_name (self), vendor, - product)); + product, + subsystem_vendor, + subsystem_device)); } if (mm_port_probe_list_is_xmm (probes)) {