ch9344: 2.0 -> 0-unstable-2024-11-15 (#354536)

authored by

Wolfgang Walther and committed by
GitHub
cfd4bedd 8669f21c

+26 -26
+10 -10
pkgs/os-specific/linux/ch9344/default.nix
··· 1 - { stdenv, lib, fetchzip, kernel }: 1 + { stdenv, lib, fetchFromGitHub, kernel }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "ch9344"; 5 - version = "2.0"; 5 + version = "0-unstable-2024-11-15"; 6 6 7 - src = fetchzip { 8 - name = "CH9344SER_LINUX.zip"; 9 - url = "https://www.wch.cn/downloads/file/386.html#CH9344SER_LINUX.zip"; 10 - hash = "sha256-YKNMYpap7CjhgTIpd/M9+nB11NtpwGYT/P14J6q3XZg="; 7 + src = fetchFromGitHub { 8 + owner = "WCHSoftGroup"; 9 + repo = "ch9344ser_linux"; 10 + rev = "4ea8973886989d67acdd01dba213e355eacc9088"; 11 + hash = "sha256-ZZ/8s26o7wRwHy6c0m1vZ/DtRW5od+NgiU6aXZBVfc4="; 11 12 }; 12 13 13 14 patches = [ 14 - ./fix-incompatible-pointer-types.patch 15 + ./fix-linux-6-12-build.patch 15 16 ]; 16 17 17 18 sourceRoot = "${src.name}/driver"; ··· 34 35 35 36 meta = with lib; { 36 37 homepage = "https://www.wch-ic.com/"; 37 - downloadPage = "https://www.wch.cn/downloads/CH9344SER_LINUX_ZIP.html"; 38 + downloadPage = "https://github.com/WCHSoftGroup/ch9344ser_linux"; 38 39 description = "WCH CH9344/CH348 UART driver"; 39 40 longDescription = '' 40 41 A kernel module for WinChipHead CH9344/CH348 USB To Multi Serial Ports controller. 41 42 ''; 42 - # Archive contains no license. 43 - license = licenses.unfree; 43 + license = licenses.gpl2Only; 44 44 platforms = platforms.linux; 45 45 maintainers = with maintainers; [ MakiseKurisu ]; 46 46 };
-16
pkgs/os-specific/linux/ch9344/fix-incompatible-pointer-types.patch
··· 1 - diff --git a/ch9344.c b/ch9344.c 2 - index bfa10bb..76a94a7 100644 3 - --- a/ch9344.c 4 - +++ b/ch9344.c 5 - @@ -837,7 +837,11 @@ static void ch9344_tty_close(struct tty_struct *tty, struct file *filp) 6 - } 7 - } 8 - 9 - +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)) 10 - +static ssize_t ch9344_tty_write(struct tty_struct *tty, const u8 *buf, size_t count) 11 - +#else 12 - static int ch9344_tty_write(struct tty_struct *tty, const unsigned char *buf, int count) 13 - +#endif 14 - { 15 - struct ch9344 *ch9344 = tty->driver_data; 16 - int stat;
+16
pkgs/os-specific/linux/ch9344/fix-linux-6-12-build.patch
··· 1 + diff --git a/ch9344.c b/ch9344.c 2 + index 8130334..b017faa 100644 3 + --- a/ch9344.c 4 + +++ b/ch9344.c 5 + @@ -62,7 +62,11 @@ 6 + #include <linux/timer.h> 7 + #include <linux/kfifo.h> 8 + #include <asm/byteorder.h> 9 + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) 10 + +#include <linux/unaligned.h> 11 + +#else 12 + #include <asm/unaligned.h> 13 + +#endif 14 + 15 + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)) 16 + #include <linux/sched/signal.h>