Skip to content

Instantly share code, notes, and snippets.

@mleinart
Last active March 13, 2020 21:48
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mleinart/373971d3560fa5814a684de2d9068eba to your computer and use it in GitHub Desktop.
Save mleinart/373971d3560fa5814a684de2d9068eba to your computer and use it in GitHub Desktop.
Fixes to Sierra Wireless QMI drivers to allow compiles on new versions of Linux
This is a patch to the Linux QMI drivers provided by Sierra Wireless
(http://source.sierrawireless.com/resources/airprime/software/usb-drivers-linux-qmi-software-s2,-d-,25n2,-d-,38/).
These drivers incorrectly assign `usb_serial_generic_resume` to a `struct usb_driver.resume` when it can only be assigned
to a `struct usb_serial_driver` (and the driver already provides one). Instead, the `struct usb_driver.resume` should get
`usb_serial_resume` from the generic usb-serial driver which does the delegation to the function passed into the
`struct usb_serial_driver.resume`. The `struct usb_driver.reset_resume` is removed as that's added automatically by the
kernel's USB init code.
Use this patch if you get the following errors compiling:
/usr/src/S2.26N2.38/GobiSerial/GobiSerial.c:325:14: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.resume = usb_serial_generic_resume,
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/S2.26N2.38/GobiSerial/GobiSerial.c:325:14: note: (near initialization for ‘GobiDriver.resume’)
/usr/src/S2.26N2.38/GobiSerial/GobiSerial.c:326:20: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.reset_resume = usb_serial_generic_resume,
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/S2.26N2.38/GobiSerial/GobiSerial.c:326:20: note: (near initialization for ‘GobiDriver.reset_resume’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:296: /usr/src/S2.26N2.38/GobiSerial/GobiSerial.o] Error 1
make[1]: *** [Makefile:1471: _module_/usr/src/S2.26N2.38/GobiSerial] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.8.6-1-ARCH/build'
make: *** [Makefile:16: all] Error 2
--- GobiSerial/GobiSerial.c.orig 2016-09-28 09:42:27.000000000 +0000
+++ GobiSerial/GobiSerial.c 2016-11-03 21:00:47.760637058 +0000
@@ -322,8 +322,7 @@
.id_table = GobiVIDPIDTable,
#ifdef CONFIG_PM
.suspend = usb_serial_suspend,
- .resume = usb_serial_generic_resume,
- .reset_resume = usb_serial_generic_resume,
+ .resume = usb_serial_resume,
.supports_autosuspend = true,
#else
.suspend = NULL,
This patch is due to a change discussed here: https://groups.google.com/forum/#!topic/linux.kernel/xmWuS0ALBtM
This is to fix the following compile error:
/usr/src/S2.26N2.38/GobiNet/GobiUSBNet.c: In function ‘GobiUSBNetStartXmit’:
/usr/src/S2.26N2.38/GobiNet/GobiUSBNet.c:1329:8: error: ‘struct net_device’ has no member named ‘trans_start’; did you mean mem_start’?
pNet->trans_start = jiffies;
^~
make[2]: *** [scripts/Makefile.build:290: /usr/src/S2.26N2.38/GobiNet/GobiUSBNet.o] Error 1
make[1]: *** [Makefile:1471: _module_/usr/src/S2.26N2.38/GobiNet] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.8.6-1-ARCH/build'
make: *** [Makefile:37: all] Error 2
--- GobiNet/GobiUSBNet.c.orig 2016-09-28 09:42:27.000000000 +0000
+++ GobiNet/GobiUSBNet.c 2016-11-03 22:07:36.374593081 +0000
@@ -1326,7 +1326,11 @@
complete( &pAutoPM->mThreadDoWork );
// Start transfer timer
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ netif_trans_update(pNet);
+#else
pNet->trans_start = jiffies;
+#endif
// Free SKB
if (pSKB)
dev_kfree_skb_any ( pSKB );
@szyper-sakrona
Copy link

Hello, Is this patch is also valid for S2.30N2.48 available from https://source.sierrawireless.com/resources/airprime/software/usb-drivers-linux-qmi-software-s2,-d-,30n2,-d-,48/
Thanks for any comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment