Thales IoT Developer Community
Modify and Setup Linux Driver for MV31 USB Variant
Tutorial, April 19, 2021 - 9:31pm, 3891 views
The easiest way to customize, build and install the required drivers for MV31 is through this simple script: mv31-driver-setup.sh. You can find it in the attachment section of this article.
If you need to setup a Debian-based Linux PC or Raspberry Pi for testing MV31, download this script to a folder under the Linux home directory, use
$ chmod a+x mv31-driver-setup.sh
to make it as an executable, then run it:
$./mv31-driver-setup.sh
This small utility will handle downloading the kernel source code, patching, building and installing the required driver modules to the running kernel.
After that you can plug-in MV31 USB variant to this Linux box, and everything just works.
This script should work on any Debian-based Linux system, this means Ubuntu and all it's derivatives, Raspberry Pi OS, are all supported. Because the patch used requires newer macro found in option.c, the system kernel has to be newer then 4.16.7.
The adopted patch looks like this:
diff -uNr linux-4.19.158/drivers/net/usb/qmi_wwan.c linux-4.19.158.mv31/drivers/net/usb/qmi_wwan.c --- linux-4.19.158/drivers/net/usb/qmi_wwan.c 2020-11-18 10:18:53.000000000 -0800 +++ linux-4.19.158.mv31/drivers/net/usb/qmi_wwan.c 2020-11-21 13:30:15.456841804 -0800 @@ -1282,6 +1282,7 @@ {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */ {QMI_FIXED_INTF(0x0b3c, 0xc00a, 6)}, /* Olivetti Olicard 160 */ {QMI_FIXED_INTF(0x0b3c, 0xc00b, 4)}, /* Olivetti Olicard 500 */ + {QMI_FIXED_INTF(0x1e2d, 0x00b7, 0)}, /* Cinterion MV31 USB variant */ {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */ {QMI_FIXED_INTF(0x1e2d, 0x0053, 4)}, /* Cinterion PHxx,PXxx */ {QMI_FIXED_INTF(0x1e2d, 0x0063, 10)}, /* Cinterion ALASxx (1 RmNet) */ diff -uNr linux-4.19.158/drivers/usb/serial/option.c linux-4.19.158.mv31/drivers/usb/serial/option.c --- linux-4.19.158/drivers/usb/serial/option.c 2020-11-18 10:18:53.000000000 -0800 +++ linux-4.19.158.mv31/drivers/usb/serial/option.c 2020-11-21 13:31:27.622021953 -0800 @@ -410,6 +410,8 @@ /* Gemalto's Cinterion products (formerly Siemens) */ #define SIEMENS_VENDOR_ID 0x0681 #define CINTERION_VENDOR_ID 0x1e2d +#define CINTERION_PRODUCT_MV31_MBIM 0x00b3 +#define CINTERION_PRODUCT_MV31_RMNET 0x00b7 #define CINTERION_PRODUCT_HC25_MDMNET 0x0040 #define CINTERION_PRODUCT_HC25_MDM 0x0047 #define CINTERION_PRODUCT_HC28_MDMNET 0x004A /* same for HC28J */ @@ -1887,6 +1889,10 @@ { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012, 0xff) }, /* Cinterion */ + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_MBIM), + .driver_info = RSVD(0) | RSVD(1) | RSVD(3) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET), + .driver_info = RSVD(0) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8),