summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Santos2020-06-21 18:51:16 +0100
committerBruno Santos2020-06-21 18:51:16 +0100
commitdbd81f9d42664cb660cb00803dacb09bdca88f47 (patch)
tree74d667eaaa97439703aadb56733c83bfda26d928
parent65133a891cb454d2df5997a0619e22b3caf2b362 (diff)
downloadaur-dbd81f9d42664cb660cb00803dacb09bdca88f47.tar.gz
Update for newer kernel and upstream location
Upstream has moved the download page and repackaged the source files, but the version remains the same. Other than handling these renames, the driver needs an additional patch for recent kernels.
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD21
-rw-r--r--kernel_do_gettimeofday_fix.patch (renamed from kernel_api_fix.patch)37
-rw-r--r--kernel_ioremap_nocache_fix.patch88
4 files changed, 128 insertions, 30 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9e988235b83d..a5ce7f3ccae8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ixxat-socketcan
pkgdesc = SocketCAN driver for IXXAT USB-to-CAN v2
pkgver = 1.1.148.0
- pkgrel = 5
+ pkgrel = 6
url = https://www.ixxat.com/products/products-industrial/pc-interfaces/pc-can-interfaces/socketcan
install = ixxat-socketcan.install
arch = i686
@@ -9,10 +9,12 @@ pkgbase = ixxat-socketcan
license = GPL2
makedepends = linux-headers
optdepends = can-utils: Linux-CAN / SocketCAN user space applications
- source = https://www.ixxat.com/docs/librariesprovider8/default-document-library/downloads/other-drivers/socketcan.zip?sfvrsn=c486dcd6_22
- source = kernel_api_fix.patch
- md5sums = c42d19b75802691b057a8163606903af
- md5sums = 94db6b37a2b8f07ef116352e73dbd88a
+ source = https://cdn.hms-networks.com/docs/librariesprovider8/ixxat-english-new/pc-can-interfaces/linux-drivers/socketcan-linux.zip?sfvrsn=3eb48d7_8
+ source = kernel_do_gettimeofday_fix.patch
+ source = kernel_ioremap_nocache_fix.patch
+ md5sums = 4875b7dcfddfb76279ec61477765dd04
+ md5sums = 918f3a220153599c2a4c3fad7de86cc1
+ md5sums = 25ef511b0f11a7d84ce9ffc6020293c3
pkgname = ixxat-socketcan
diff --git a/PKGBUILD b/PKGBUILD
index ffc0385508a2..e7c758a14a17 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=ixxat-socketcan
pkgver=1.1.148.0
-pkgrel=5
+pkgrel=6
pkgdesc="SocketCAN driver for IXXAT USB-to-CAN v2"
arch=('i686' 'x86_64')
url="https://www.ixxat.com/products/products-industrial/pc-interfaces/pc-can-interfaces/socketcan"
@@ -10,22 +10,29 @@ license=('GPL2')
makedepends=(linux-headers)
optdepends=('can-utils: Linux-CAN / SocketCAN user space applications')
install=$pkgname.install
-source=('https://www.ixxat.com/docs/librariesprovider8/default-document-library/downloads/other-drivers/socketcan.zip?sfvrsn=c486dcd6_22'
- kernel_api_fix.patch)
-md5sums=('c42d19b75802691b057a8163606903af'
- '94db6b37a2b8f07ef116352e73dbd88a')
+source=('https://cdn.hms-networks.com/docs/librariesprovider8/ixxat-english-new/pc-can-interfaces/linux-drivers/socketcan-linux.zip?sfvrsn=3eb48d7_8'
+ kernel_do_gettimeofday_fix.patch
+ kernel_ioremap_nocache_fix.patch)
+md5sums=('4875b7dcfddfb76279ec61477765dd04'
+ '918f3a220153599c2a4c3fad7de86cc1'
+ '25ef511b0f11a7d84ce9ffc6020293c3')
_extramodules=$(uname -r)/extramodules
prepare() {
- patch -p1 -i kernel_api_fix.patch
+ patch -p1 -i kernel_do_gettimeofday_fix.patch
+ patch -p1 -i kernel_ioremap_nocache_fix.patch
}
build() {
+ # Make will fail with the original folder name.
+ rm -rf "$srcdir/ixxat-socketcan"
+ mv "$srcdir/SocketCAN - Linux (V1.1.148.0)" "$srcdir/ixxat-socketcan"
+ cd "$srcdir/ixxat-socketcan"
make
}
package() {
mkdir -p $pkgdir/usr/lib/modules/$_extramodules
- install usb-to-can_socketcan/ixx_usb.ko $pkgdir/usr/lib/modules/$_extramodules
+ install ixxat-socketcan/usb-to-can_socketcan/ixx_usb.ko $pkgdir/usr/lib/modules/$_extramodules
}
diff --git a/kernel_api_fix.patch b/kernel_do_gettimeofday_fix.patch
index 3384cb0cbbfe..bbfa646bd802 100644
--- a/kernel_api_fix.patch
+++ b/kernel_do_gettimeofday_fix.patch
@@ -1,18 +1,19 @@
+commit 06cf40760506f7aeda1daee7fe8e5e330915daaa
Author: Bruno Santos <brunomanuelsantos@tecnico.ulisboa.pt>
Date: Tue Jun 18 18:37:17 2019 +0200
- Fix compilation against newer kernel driver's API
-
+ Fix use of deprecated do_gettimeofday()
+
do_gettimeofday() is deprecated because of the year 2038 overflow. Since
this driver uses it extensively and it's no longer available in recent
kernels, we need to convert it to something else.
-
+
The code could be improved, this is a least effort, half scripted fix.
-diff --git a/can-ibxxx_socketcan/ixx_pci_core.c b/can-ibxxx_socketcan/ixx_pci_core.c
+diff --git a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.c b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.c
index d6d4228..7f019fb 100644
---- a/can-ibxxx_socketcan/ixx_pci_core.c
-+++ b/can-ibxxx_socketcan/ixx_pci_core.c
+--- a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.c
++++ b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.c
@@ -235,24 +235,14 @@ void ixxat_dump_mem(char *prompt, void *p, int l)
DUMP_WIDTH, 1, p, l, false);
}
@@ -95,10 +96,10 @@ index d6d4228..7f019fb 100644
free_candev(netdev);
}
}
-diff --git a/can-ibxxx_socketcan/ixx_pci_core.h b/can-ibxxx_socketcan/ixx_pci_core.h
+diff --git a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.h b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.h
index 8e94b34..0f0f3e2 100644
---- a/can-ibxxx_socketcan/ixx_pci_core.h
-+++ b/can-ibxxx_socketcan/ixx_pci_core.h
+--- a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.h
++++ b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_core.h
@@ -241,7 +241,7 @@ struct ixx_canfd_msg {
} __packed;
@@ -108,10 +109,10 @@ index 8e94b34..0f0f3e2 100644
u32 ts_dev_0;
u32 ts_dev_last;
};
-diff --git a/can-ibxxx_socketcan/ixx_pci_ib_active.c b/can-ibxxx_socketcan/ixx_pci_ib_active.c
+diff --git a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c
index 6cc4985..cd0c50a 100644
---- a/can-ibxxx_socketcan/ixx_pci_ib_active.c
-+++ b/can-ibxxx_socketcan/ixx_pci_ib_active.c
+--- a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c
++++ b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c
@@ -369,7 +369,7 @@ static int ixx_act_ib_xxx_rcv_cmd(struct ixx_pci_interface *intf, u32 *rx_fifo,
u32* res_size;
struct ixx_dal_req *res_dal_req;
@@ -146,10 +147,10 @@ index 6cc4985..cd0c50a 100644
return err;
}
-diff --git a/usb-to-can_socketcan/ixx_usb_core.c b/usb-to-can_socketcan/ixx_usb_core.c
+diff --git a/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.c b/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.c
index 5d542a3..696e5d4 100644
---- a/usb-to-can_socketcan/ixx_usb_core.c
-+++ b/usb-to-can_socketcan/ixx_usb_core.c
+--- a/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.c
++++ b/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.c
@@ -94,24 +94,14 @@ void ixxat_dump_mem(char *prompt, void *p, int l)
DUMP_WIDTH, 1, p, l, false);
}
@@ -277,10 +278,10 @@ index 5d542a3..696e5d4 100644
*intf = (struct usb_interface*)to_usb_interface(d);
struct ixx_usb_device *dev;
-diff --git a/usb-to-can_socketcan/ixx_usb_core.h b/usb-to-can_socketcan/ixx_usb_core.h
+diff --git a/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.h b/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.h
index 60dc02d..577f276 100644
---- a/usb-to-can_socketcan/ixx_usb_core.h
-+++ b/usb-to-can_socketcan/ixx_usb_core.h
+--- a/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.h
++++ b/SocketCAN - Linux (V1.1.148.0)/usb-to-can_socketcan/ixx_usb_core.h
@@ -193,7 +193,7 @@ struct ixx_usb_adapter {
};
diff --git a/kernel_ioremap_nocache_fix.patch b/kernel_ioremap_nocache_fix.patch
new file mode 100644
index 000000000000..78e7125416dd
--- /dev/null
+++ b/kernel_ioremap_nocache_fix.patch
@@ -0,0 +1,88 @@
+commit 581f3d57fd2debe52b7647145334bfdd79212e7c
+Author: Bruno Santos <brunomanuelsantos@tecnico.ulisboa.pt>
+Date: Sun Jun 21 18:36:51 2020 +0100
+
+ Fix use of deprecated ioremap_nocache()
+
+ The kernel has provided non-cached semantics by default since v2.6. And
+ the additional interface has been removed since early 2020 from the
+ kernel.
+
+diff --git a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c
+index cd0c50a..1e698c8 100644
+--- a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c
++++ b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_active.c
+@@ -1854,17 +1854,17 @@ static int ixx_act_ib_xxx_probe(struct pci_dev *pdev,
+ intf->memlen = pci_resource_len(pdev, 2);
+
+ request_mem_region(intf->reg1add, intf->reg1len, "IXXAT PCI Registers");
+- intf->reg1vadd = ioremap_nocache(intf->reg1add, intf->reg1len);
++ intf->reg1vadd = ioremap(intf->reg1add, intf->reg1len);
+ if (!intf->reg1vadd) {
+- printk("reg1vadd ioremap_nocache failed\n");
++ printk("reg1vadd ioremap failed\n");
+ err = -ENOBUFS;
+ goto release_reg1;
+ }
+
+ request_mem_region(intf->memadd, intf->memlen, "IXXAT PCI Memory");
+- intf->memvadd = ioremap_nocache(intf->memadd, intf->memlen);
++ intf->memvadd = ioremap(intf->memadd, intf->memlen);
+ if (!intf->memvadd) {
+- printk("memvadd ioremap_nocache failed\n");
++ printk("memvadd ioremap failed\n");
+ err = -ENOBUFS;
+ goto release_memreg;
+ }
+diff --git a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_fd_passive.c b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_fd_passive.c
+index d3a4da1..7a3514f 100644
+--- a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_fd_passive.c
++++ b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_fd_passive.c
+@@ -1193,17 +1193,17 @@ static int ixx_pas_ib_fd_xxx_probe(struct pci_dev *pdev,
+ intf->memlen = pci_resource_len(pdev, 2);
+
+ request_mem_region(intf->memadd, intf->memlen, "IXXAT PCI Memory");
+- intf->memvadd = ioremap_nocache(intf->memadd, intf->memlen);
++ intf->memvadd = ioremap(intf->memadd, intf->memlen);
+ if (!intf->memvadd) {
+- printk("memvadd ioremap_nocache failed\n");
++ printk("memvadd ioremap failed\n");
+ err = -ENOBUFS;
+ goto release_memreg;
+ }
+
+ request_mem_region(intf->reg1add, intf->reg1len, "IXXAT PCI Registers");
+- intf->reg1vadd = ioremap_nocache(intf->reg1add, intf->reg1len);
++ intf->reg1vadd = ioremap(intf->reg1add, intf->reg1len);
+ if (!intf->reg1vadd) {
+- printk("reg1vadd ioremap_nocache failed\n");
++ printk("reg1vadd ioremap failed\n");
+ err = -ENOBUFS;
+ goto release_reg1;
+ }
+diff --git a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_passive.c b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_passive.c
+index 27b2b7d..fb08c03 100644
+--- a/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_passive.c
++++ b/SocketCAN - Linux (V1.1.148.0)/can-ibxxx_socketcan/ixx_pci_ib_passive.c
+@@ -1221,17 +1221,17 @@ static int ixx_pas_ib_xxx_probe(struct pci_dev *pdev,
+ intf->memlen = pci_resource_len(pdev, 2);
+
+ request_mem_region(intf->memadd, intf->memlen, "IXXAT PCI Memory");
+- intf->memvadd = ioremap_nocache(intf->memadd, intf->memlen);
++ intf->memvadd = ioremap(intf->memadd, intf->memlen);
+ if (!intf->memvadd) {
+- printk("memvadd ioremap_nocache failed\n");
++ printk("memvadd ioremap failed\n");
+ err = -ENOBUFS;
+ goto release_memreg;
+ }
+
+ request_mem_region(intf->reg1add, intf->reg1len, "IXXAT PCI Registers");
+- intf->reg1vadd = ioremap_nocache(intf->reg1add, intf->reg1len);
++ intf->reg1vadd = ioremap(intf->reg1add, intf->reg1len);
+ if (!intf->reg1vadd) {
+- printk("reg1vadd ioremap_nocache failed\n");
++ printk("reg1vadd ioremap failed\n");
+ err = -ENOBUFS;
+ goto release_reg1;
+ }