summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorExcalibur2023-11-09 18:37:32 +0800
committerExcalibur2023-11-09 18:37:32 +0800
commitf6695d453968c3ad2a6941725a2b858006903070 (patch)
treef216e7bae7f6197102daff00f74a7d7a31486d9c
parentd1227a3460d4c77d97568575badc4a81236e863e (diff)
downloadaur-ch9344-dkms.tar.gz
Update to 2.0 and fix Linux 6.6 build
-rw-r--r--.SRCINFO12
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD8
-rw-r--r--fix-incompatible-pointer-types.patch42
4 files changed, 25 insertions, 40 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0aa1151338d4..ddb1227bb0d0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ch9344-dkms
pkgdesc = Kernel module for CH9344/CH348 USB UART controller
- pkgver = 1.9
- pkgrel = 2
+ pkgver = 2.0
+ pkgrel = 1
url = https://www.wch.cn/downloads/CH9344SER_LINUX_ZIP.html
arch = any
license = unknown
@@ -10,12 +10,12 @@ pkgbase = ch9344-dkms
optdepends = linux-headers: Build the module for Arch kernel
optdepends = linux-lts-headers: Build the module for LTS Arch kernel
conflicts = ch9344
- noextract = CH9344SER_LINUX-1.9.ZIP
- source = CH9344SER_LINUX-1.9.ZIP::https://www.wch.cn/downloads/file/386.html
+ noextract = CH9344SER_LINUX-2.0.ZIP
+ source = CH9344SER_LINUX-2.0.ZIP::https://www.wch.cn/downloads/file/386.html
source = dkms.conf
source = fix-incompatible-pointer-types.patch
- sha256sums = 2eb9bfb6a4e61834dc89565ef7f7b05abba77299ee05c98103a0eb85f2fb50e2
+ sha256sums = b388b2af20bd6e3f842bb9c5bdc49ef681b7fc4e9b589e7f265eed61437e39f7
sha256sums = cac2091fcfc7276c1b6fa5f5e0fa811f5aa51b9529652b02766ec933904e308f
- sha256sums = d12452dcb757788bb4e8ee954419915e960bd8654323ab3f504360bcecdb5356
+ sha256sums = 06a125bc78786ec7e11712ba4520a83ab53d1af906cfdf3336b0f3fe07c85587
pkgname = ch9344-dkms
diff --git a/.gitignore b/.gitignore
index 9bdf47172b8a..da52c92ab206 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/pkg
/src
/*.pkg.*
-/*.ZIP \ No newline at end of file
+/*.ZIP
+.vscode-ctags
diff --git a/PKGBUILD b/PKGBUILD
index b85e185a1844..a99414f22ed2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,8 +2,8 @@
_pkgname=ch9344
pkgname=${_pkgname}-dkms
-pkgver=1.9
-pkgrel=2
+pkgver=2.0
+pkgrel=1
url="https://www.wch.cn/downloads/CH9344SER_LINUX_ZIP.html"
pkgdesc="Kernel module for CH9344/CH348 USB UART controller"
license=('unknown')
@@ -17,9 +17,9 @@ source=("CH9344SER_LINUX-$pkgver.ZIP::https://www.wch.cn/downloads/file/386.html
'dkms.conf'
'fix-incompatible-pointer-types.patch')
noextract=("CH9344SER_LINUX-$pkgver.ZIP")
-sha256sums=('2eb9bfb6a4e61834dc89565ef7f7b05abba77299ee05c98103a0eb85f2fb50e2'
+sha256sums=('b388b2af20bd6e3f842bb9c5bdc49ef681b7fc4e9b589e7f265eed61437e39f7'
'cac2091fcfc7276c1b6fa5f5e0fa811f5aa51b9529652b02766ec933904e308f'
- 'd12452dcb757788bb4e8ee954419915e960bd8654323ab3f504360bcecdb5356')
+ '06a125bc78786ec7e11712ba4520a83ab53d1af906cfdf3336b0f3fe07c85587')
prepare() {
cd "$srcdir"
diff --git a/fix-incompatible-pointer-types.patch b/fix-incompatible-pointer-types.patch
index 471fe8af5429..ba0afdf84067 100644
--- a/fix-incompatible-pointer-types.patch
+++ b/fix-incompatible-pointer-types.patch
@@ -1,32 +1,16 @@
-diff --git a/ch9344.c b/ch9344.c
-index 1e37293..a16af82 100644
---- a/ch9344.c
-+++ b/ch9344.c
-@@ -79,7 +79,7 @@ static DEFINE_IDR(ch9344_minors);
- static DEFINE_MUTEX(ch9344_minors_lock);
-
- static void ch9344_tty_set_termios(struct tty_struct *tty,
-- struct ktermios *termios_old);
-+ const struct ktermios *termios_old);
-
- static int ch9344_get_portnum(int index);
-
-@@ -1597,7 +1597,7 @@ u8 cal_recv_tmt(__le32 bd)
- }
-
- static void ch9344_tty_set_termios(struct tty_struct *tty,
-- struct ktermios *termios_old)
-+ const struct ktermios *termios_old)
- {
- struct ch9344 *ch9344 = tty->driver_data;
- struct ktermios *termios = &tty->termios;
-
-@@ -774,7 +774,7 @@ static inline void *tty_get_portdata(struct ch9344_ttyport *port)
- return (port->portdata);
+diff --git a/LINUX/driver/ch9344.c b/LINUX/driver/ch9344.c
+index bfa10bb..76a94a7 100644
+--- a/LINUX/driver/ch9344.c
++++ b/LINUX/driver/ch9344.c
+@@ -837,7 +837,11 @@ static void ch9344_tty_close(struct tty_struct *tty, struct file *filp)
+ }
}
--static void ch9344_port_dtr_rts(struct tty_port *port, int raise)
-+static void ch9344_port_dtr_rts(struct tty_port *port, bool raise)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0))
++static ssize_t ch9344_tty_write(struct tty_struct *tty, const u8 *buf, size_t count)
++#else
+ static int ch9344_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
++#endif
{
- struct ch9344_ttyport *ttyport = container_of(port, struct ch9344_ttyport, port);
- struct ch9344 *ch9344 = tty_get_portdata(ttyport);
+ struct ch9344 *ch9344 = tty->driver_data;
+ int stat;