summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO46
-rw-r--r--0003-kernel-5.6--proc_dir_entry-proc_ops.patch72
-rw-r--r--0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch17
-rw-r--r--0005-kernel-5.13-dropped-tty_check_change.patch17
-rw-r--r--0006-kernel-5.14-task_struct.state-unsigned-tty.patch73
-rw-r--r--0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch55
-rw-r--r--0008-kernel-6.1-remove-TTY_MAGIC.patch359
-rw-r--r--0009-kernel-5.17-change-PDE_DATA.patch67
-rw-r--r--0010-kernel-6.1-INIT_C_CC-termios_internal.patch17
-rw-r--r--0011-kernel-6.0-set_termios-const-ktermios.patch35
-rw-r--r--0012-kernel-6.4-class_create-1arg.patch19
-rw-r--r--0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch19
-rw-r--r--0014-kernel-6.6-struct-tty_operations-write-size_t.patch37
-rw-r--r--PKGBUILD144
14 files changed, 958 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d64bb25973d1..295bea40302e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Mon Apr 1 01:08:46 UTC 2019
pkgbase = digi-dgnc
pkgdesc = tty driver for Digi Neo and legacy ClassicBoard PCI PCIe RS-232 serial port
pkgver = 1.3.29
- pkgrel = 2
+ pkgrel = 8
url = https://www.digi.com/
install = digi-dgnc-install.sh
arch = i686
@@ -13,14 +11,54 @@ pkgbase = digi-dgnc
depends = dkms
depends = linux-headers
options = !strip
+ options = !buildflags
source = dgnc-1.3.29-40002369_H.src.rpm::http://ftp1.digi.com/support/driver/40002369_H.src.rpm
source = 0000-Kernel-4-14-DRIVER-ATTR.patch
source = 0001-Kernel-4-15-timers.patch
source = 0002-kernel-5.0.0-do_gettimeofday.patch
+ source = 0003-kernel-5.6--proc_dir_entry-proc_ops.patch
+ source = 0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch
+ source = 0005-kernel-5.13-dropped-tty_check_change.patch
+ source = 0006-kernel-5.14-task_struct.state-unsigned-tty.patch
+ source = 0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch
+ source = 0008-kernel-6.1-remove-TTY_MAGIC.patch
+ source = 0009-kernel-5.17-change-PDE_DATA.patch
+ source = 0010-kernel-6.1-INIT_C_CC-termios_internal.patch
+ source = 0011-kernel-6.0-set_termios-const-ktermios.patch
+ source = 0012-kernel-6.4-class_create-1arg.patch
+ source = 0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch
+ source = 0014-kernel-6.6-struct-tty_operations-write-size_t.patch
+ md5sums = 6171349852f6d02228d6e30c79b7a434
+ md5sums = a171e9ea1a4ff8340c3c58b303632edf
+ md5sums = 6c16c3c24c79fb558bcf27f780829c75
+ md5sums = 8e46a778c648ab4f0ca63a337d36df60
+ md5sums = 394d24a150676d8123300d6715b81fb8
+ md5sums = 44b0a7b0ab4dbe661b822fcba9423121
+ md5sums = 98f1684623d45f66e42f78e5ab8fd8c2
+ md5sums = 89de6a694ecf827a3358bcd8aea03a6a
+ md5sums = 58d75d8f86830d09ba8754d4e03a6a9d
+ md5sums = 7ceda3eaa776322b2042de8d159535ea
+ md5sums = 9371ea6968666c58413a463fcf341d1f
+ md5sums = 53bcd11e5e4acbd0466b3ffdda3b263b
+ md5sums = 6475487a9415d3dc7ece9dd888cec92c
+ md5sums = 7824cfd37ca3c7dd27e911c679f8256c
+ md5sums = bbae50830fad8e9e2b674078c2770aee
+ md5sums = b1584c28e0e1d6741ff4e7cca25761d8
sha256sums = e121a31569e3e1f156caeed70742971ec32fef598429ef647bde98f56aa048f5
sha256sums = 625bb794d31690b45ad7469f811e7422dac938cf8e9b777aba4d97b60b3c6eae
sha256sums = 88d5a8589dca55ca98089dfa4570aa1fbde1095957d0788ad710a27b348c2f4f
sha256sums = 737df02a12fc76841325d1059d90451467637eab2df016efc20d84976eb5de7d
+ sha256sums = 3496e90914e1fa2f209dd85c336e7b1c0b784dbbf67cc45e0f0f55f0b1ef5a0e
+ sha256sums = f215451df4a01f0875a53425b6d8452c344f19b61b59b821f8c949b1b276c022
+ sha256sums = f5eebe58f625b493cf8cb4c7fb8630fd4d0f9fa278ce4400b011fd702bd2db90
+ sha256sums = dcedb22e0f3fb0c8197630b38217f86c5468d065ab2d67708c16c17351d6944e
+ sha256sums = 0693e13442749c40a338320cca72dd8aad23678ea7cae035e6bab01a40640c44
+ sha256sums = 718e5104ff4caf153757dd2f8c143402d2c175fd838cfc5db3f47618efd40230
+ sha256sums = b5000b9bb68ae8ddc173b666ead6d60fa329aa4d5d96636af4717a131827748c
+ sha256sums = c0786d12440da829f0a57ca9e7f2c3114edbd88213bb66687ac84730ee7c8ed1
+ sha256sums = ab4921079d2a4ee3316bbea3bcb3ff7844d8ced73b6b4327d3c580088bc511b1
+ sha256sums = 021745fab94745eaea1abc503a1f7ec94dfa6132f841d5ce2bb969dcb049eda6
+ sha256sums = 40ee1fb8e261008d810c7251de5612029fa9c8b83a58bdd3279dd64467cb1bed
+ sha256sums = 414f1115e195616945ac8d597bfd59a9ae3b8ec392c8f06f15213efa662e6433
pkgname = digi-dgnc
-
diff --git a/0003-kernel-5.6--proc_dir_entry-proc_ops.patch b/0003-kernel-5.6--proc_dir_entry-proc_ops.patch
new file mode 100644
index 000000000000..e9b11a4b5ad4
--- /dev/null
+++ b/0003-kernel-5.6--proc_dir_entry-proc_ops.patch
@@ -0,0 +1,72 @@
+diff -pNaru5 driver/2.6.27.orig/dgnc_proc.c driver/2.6.27/dgnc_proc.c
+--- driver/2.6.27.orig/dgnc_proc.c 2017-10-21 10:39:21.000000000 -0400
++++ driver/2.6.27/dgnc_proc.c 2020-05-22 05:56:03.148214713 -0400
+@@ -69,18 +69,28 @@ static int dgnc_proc_chk_perm(struct ino
+ #else
+ static int dgnc_proc_chk_perm(struct inode *, int);
+ #endif
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++static const struct proc_ops dgnc_proc_file_ops =
++{
++ .proc_read = dgnc_gen_proc_read, /* read */
++ .proc_write = dgnc_gen_proc_write, /* write */
++ .proc_open = dgnc_gen_proc_open, /* open */
++ .proc_release = dgnc_gen_proc_close, /* release */
++};
++#else
+ static const struct file_operations dgnc_proc_file_ops =
+ {
+ .owner = THIS_MODULE,
+ .read = dgnc_gen_proc_read, /* read */
+ .write = dgnc_gen_proc_write, /* write */
+ .open = dgnc_gen_proc_open, /* open */
+ .release = dgnc_gen_proc_close, /* release */
+ };
++#endif
+
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static struct inode_operations dgnc_proc_inode_ops =
+ {
+diff -pNaru5 driver/2.6.27.orig/dgnc_tty.c driver/2.6.27/dgnc_tty.c
+--- driver/2.6.27.orig/dgnc_tty.c 2020-05-22 05:54:38.907639099 -0400
++++ driver/2.6.27/dgnc_tty.c 2020-05-22 05:54:48.157702308 -0400
+@@ -519,13 +519,22 @@ void dgnc_tty_uninit(struct board_t *brd
+ }
+
+
+ #define TMPBUFLEN (1024)
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++struct DGNC_timeval {
++ __kernel_old_time_t tv_sec; /* seconds */
++ __kernel_suseconds_t tv_usec; /* microseconds */
++};
++#else
++#define DGNC_timeval timeval
++#endif
++
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
+ /* Temporary until reimplemented with 64 bit functions */
+-static inline void do_gettimeofday(struct timeval *tv)
++static inline void do_gettimeofday(struct DGNC_timeval *tv)
+ {
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ tv->tv_sec = now.tv_sec;
+@@ -537,11 +546,11 @@ static inline void do_gettimeofday(struc
+ * dgnc_sniff - Dump data out to the "sniff" buffer if the
+ * proc sniff file is opened...
+ */
+ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int len)
+ {
+- struct timeval tv;
++ struct DGNC_timeval tv;
+ int n;
+ int r;
+ int nbuf;
+ int i;
+ int tmpbuflen;
diff --git a/0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch b/0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch
new file mode 100644
index 000000000000..e38924f7c83f
--- /dev/null
+++ b/0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch
@@ -0,0 +1,17 @@
+diff -pNaru5 driver/2.6.27.orig/dgnc_driver.c driver/2.6.27/dgnc_driver.c
+--- driver/2.6.27.orig/dgnc_driver.c 2021-09-13 20:59:15.005962528 -0400
++++ driver/2.6.27/dgnc_driver.c 2021-09-13 21:01:14.600755648 -0400
+@@ -55,11 +55,13 @@
+ #include "dgnc_sysfs.h"
+
+ MODULE_LICENSE("GPL");
+ MODULE_AUTHOR("Digi International, http://www.digi.com");
+ MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line");
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0)
+ MODULE_SUPPORTED_DEVICE("dgnc");
++#endif
+
+ /*
+ * insmod command line overrideable parameters
+ *
+ * NOTE: we use a set of macros to create the variables, which allows
diff --git a/0005-kernel-5.13-dropped-tty_check_change.patch b/0005-kernel-5.13-dropped-tty_check_change.patch
new file mode 100644
index 000000000000..53bc3291a932
--- /dev/null
+++ b/0005-kernel-5.13-dropped-tty_check_change.patch
@@ -0,0 +1,17 @@
+diff -pNaru5 driver/2.6.27.orig/dgnc_tty.c driver/2.6.27/dgnc_tty.c
+--- driver/2.6.27.orig/dgnc_tty.c 2021-09-13 21:09:08.726233822 -0400
++++ driver/2.6.27/dgnc_tty.c 2021-09-13 21:09:55.913091170 -0400
+@@ -3249,10 +3249,13 @@ static void dgnc_tty_flush_buffer(struct
+ DGNC_UNLOCK(ch->ch_lock, lock_flags);
+
+ DPR_IOCTL(("dgnc_tty_flush_buffer finish\n"));
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,180)
++int tty_check_change(struct tty_struct *tty);
++#endif
+
+
+ /*****************************************************************************
+ *
+ * The IOCTL function and all of its helpers
diff --git a/0006-kernel-5.14-task_struct.state-unsigned-tty.patch b/0006-kernel-5.14-task_struct.state-unsigned-tty.patch
new file mode 100644
index 000000000000..761aeaa679b8
--- /dev/null
+++ b/0006-kernel-5.14-task_struct.state-unsigned-tty.patch
@@ -0,0 +1,73 @@
+diff -pNaru5 driver/2.6.27.orig/dgnc_driver.c driver/2.6.27/dgnc_driver.c
+--- driver/2.6.27.orig/dgnc_driver.c 2021-09-13 21:13:41.814470344 -0400
++++ driver/2.6.27/dgnc_driver.c 2021-09-13 21:13:52.344550262 -0400
+@@ -1031,11 +1031,11 @@ static void dgnc_mbuf(struct board_t *br
+ *
+ * Returns 0 if timed out, !0 (showing signal) if interrupted by a signal.
+ */
+ int dgnc_ms_sleep(ulong ms)
+ {
+- current->state = TASK_INTERRUPTIBLE;
++ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout((ms * HZ) / 1000);
+ return (signal_pending(current));
+ }
+
+
+diff -pNaru5 driver/2.6.27.orig/dgnc_tty.c driver/2.6.27/dgnc_tty.c
+--- driver/2.6.27.orig/dgnc_tty.c 2021-09-13 21:13:41.817803703 -0400
++++ driver/2.6.27/dgnc_tty.c 2021-09-13 21:17:10.562916701 -0400
+@@ -119,13 +119,21 @@ static int dgnc_tty_ioctl(struct tty_str
+ #else
+ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
+ #endif
+ static int dgnc_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retinfo);
+ static int dgnc_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_info);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgnc_tty_write_room(struct tty_struct* tty);
++#else
+ static int dgnc_tty_write_room(struct tty_struct* tty);
++#endif
+ static int dgnc_tty_put_char(struct tty_struct *tty, unsigned char c);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgnc_tty_chars_in_buffer(struct tty_struct* tty);
++#else
+ static int dgnc_tty_chars_in_buffer(struct tty_struct* tty);
++#endif
+ static void dgnc_tty_start(struct tty_struct *tty);
+ static void dgnc_tty_stop(struct tty_struct *tty);
+ static void dgnc_tty_throttle(struct tty_struct *tty);
+ static void dgnc_tty_unthrottle(struct tty_struct *tty);
+ static void dgnc_tty_flush_chars(struct tty_struct *tty);
+@@ -2034,11 +2042,15 @@ static void dgnc_tty_close(struct tty_st
+ * Return number of characters that have not been transmitted yet.
+ *
+ * This routine is used by the line discipline to determine if there
+ * is data waiting to be transmitted/drained/flushed or not.
+ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
++#else
+ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
++#endif
+ {
+ struct channel_t *ch = NULL;
+ struct un_t *un = NULL;
+ ushort thead;
+ ushort ttail;
+@@ -2142,11 +2154,15 @@ static int dgnc_maxcps_room(struct tty_s
+ /*
+ * dgnc_tty_write_room()
+ *
+ * Return space available in Tx buffer
+ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgnc_tty_write_room(struct tty_struct *tty)
++#else
+ static int dgnc_tty_write_room(struct tty_struct *tty)
++#endif
+ {
+ struct channel_t *ch = NULL;
+ struct un_t *un = NULL;
+ ushort head;
+ ushort tail;
diff --git a/0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch b/0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch
new file mode 100644
index 000000000000..ae2db28e3544
--- /dev/null
+++ b/0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch
@@ -0,0 +1,55 @@
+diff -pNaru5 driver/2.6.27.orig/dgnc_tty.c driver/2.6.27/dgnc_tty.c
+--- driver/2.6.27.orig/dgnc_tty.c 2021-11-21 00:49:57.469474751 -0500
++++ driver/2.6.27/dgnc_tty.c 2021-11-21 00:52:04.633840884 -0500
+@@ -246,11 +246,11 @@ int dgnc_tty_register(struct board_t *br
+ {
+ int rc = 0;
+
+ DPR_INIT(("tty_register start\n"));
+
+- brd->SerialDriver = alloc_tty_driver(brd->maxports);
++ brd->SerialDriver = tty_alloc_driver(brd->maxports,0);
+
+ brd->SerialDriver->owner = THIS_MODULE;
+ snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgnc_%d_", brd->boardnum);
+
+ brd->SerialDriver->name = brd->SerialName;
+@@ -291,11 +291,11 @@ int dgnc_tty_register(struct board_t *br
+ /*
+ * If we're doing transparent print, we have to do all of the above
+ * again, seperately so we don't get the LD confused about what major
+ * we are when we get into the dgnc_tty_open() routine.
+ */
+- brd->PrintDriver = alloc_tty_driver(brd->maxports);
++ brd->PrintDriver = tty_alloc_driver(brd->maxports,0);
+
+ brd->PrintDriver->owner = THIS_MODULE;
+ snprintf(brd->PrintName, MAXTTYNAMELEN, "pr_dgnc_%d_", brd->boardnum);
+
+ brd->PrintDriver->name = brd->PrintName;
+@@ -503,11 +503,11 @@ void dgnc_tty_uninit(struct board_t *brd
+ tty_unregister_driver(brd->SerialDriver);
+ if (brd->SerialDriver->ttys) {
+ kfree(brd->SerialDriver->ttys);
+ brd->SerialDriver->ttys = NULL;
+ }
+- put_tty_driver(brd->SerialDriver);
++ tty_driver_kref_put(brd->SerialDriver);
+ brd->dgnc_Major_Serial_Registered = FALSE;
+ }
+
+ if (brd->dgnc_Major_TransparentPrint_Registered) {
+ dgnc_BoardsByMajor[brd->PrintDriver->major] = NULL;
+@@ -519,11 +519,11 @@ void dgnc_tty_uninit(struct board_t *brd
+ tty_unregister_driver(brd->PrintDriver);
+ if (brd->PrintDriver->ttys) {
+ kfree(brd->PrintDriver->ttys);
+ brd->PrintDriver->ttys = NULL;
+ }
+- put_tty_driver(brd->PrintDriver);
++ tty_driver_kref_put(brd->PrintDriver);
+ brd->dgnc_Major_TransparentPrint_Registered = FALSE;
+ }
+ }
+
+
diff --git a/0008-kernel-6.1-remove-TTY_MAGIC.patch b/0008-kernel-6.1-remove-TTY_MAGIC.patch
new file mode 100644
index 000000000000..4d079b09d820
--- /dev/null
+++ b/0008-kernel-6.1-remove-TTY_MAGIC.patch
@@ -0,0 +1,359 @@
+diff -pNaru5 a/driver/2.6.27/dgnc_cls.c b/driver/2.6.27/dgnc_cls.c
+--- a/driver/2.6.27/dgnc_cls.c 2017-10-21 10:39:21.000000000 -0400
++++ b/driver/2.6.27/dgnc_cls.c 2023-01-28 14:36:56.298578571 -0500
+@@ -482,11 +482,11 @@ static void cls_param(struct tty_struct
+ int quot = 0;
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+
+- if (!tty || tty->magic != TTY_MAGIC) {
++ if (!tty || !tty->ldisc) {
+ return;
+ }
+
+ un = (struct un_t *) tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC) {
+@@ -979,11 +979,11 @@ static int cls_drain(struct tty_struct *
+ ulong lock_flags;
+ struct channel_t *ch;
+ struct un_t *un;
+ int rc = 0;
+
+- if (!tty || tty->magic != TTY_MAGIC) {
++ if (!tty || !tty->ldisc) {
+ return (-ENXIO);
+ }
+
+ un = (struct un_t *) tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC) {
+diff -pNaru5 a/driver/2.6.27/dgnc_neo.c b/driver/2.6.27/dgnc_neo.c
+--- a/driver/2.6.27/dgnc_neo.c 2017-10-21 10:39:21.000000000 -0400
++++ b/driver/2.6.27/dgnc_neo.c 2023-01-28 14:36:49.068942864 -0500
+@@ -656,11 +656,11 @@ static void neo_param(struct tty_struct
+ int quot = 0;
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+
+- if (!tty || tty->magic != TTY_MAGIC) {
++ if (!tty || !tty->ldisc) {
+ return;
+ }
+
+ un = (struct un_t *) tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC) {
+@@ -1432,11 +1432,11 @@ static int neo_drain(struct tty_struct *
+ ulong lock_flags;
+ struct channel_t *ch;
+ struct un_t *un;
+ int rc = 0;
+
+- if (!tty || tty->magic != TTY_MAGIC) {
++ if (!tty || !tty->ldisc) {
+ return (-ENXIO);
+ }
+
+ un = (struct un_t *) tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC) {
+diff -pNaru5 a/driver/2.6.27/dgnc_neo_II.c b/driver/2.6.27/dgnc_neo_II.c
+--- a/driver/2.6.27/dgnc_neo_II.c 2017-10-21 10:39:21.000000000 -0400
++++ b/driver/2.6.27/dgnc_neo_II.c 2023-01-28 14:37:01.024996046 -0500
+@@ -531,11 +531,11 @@ static void neo_II_param(struct tty_stru
+ int quot = 0;
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+
+- if (!tty || tty->magic != TTY_MAGIC) {
++ if (!tty || !tty->ldisc) {
+ return;
+ }
+
+ un = (struct un_t *) tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC) {
+@@ -1166,11 +1166,11 @@ static int neo_II_drain(struct tty_struc
+ ulong lock_flags;
+ struct channel_t *ch;
+ struct un_t *un;
+ int rc = 0;
+
+- if (!tty || tty->magic != TTY_MAGIC) {
++ if (!tty || !tty->ldisc) {
+ return (-ENXIO);
+ }
+
+ un = (struct un_t *) tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC) {
+diff -pNaru5 a/driver/2.6.27/dgnc_tty.c b/driver/2.6.27/dgnc_tty.c
+--- a/driver/2.6.27/dgnc_tty.c 2023-01-28 14:28:53.575256967 -0500
++++ b/driver/2.6.27/dgnc_tty.c 2023-01-28 14:36:29.533153640 -0500
+@@ -783,18 +783,18 @@ void dgnc_input(struct channel_t *ch)
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+ if (!tp || (tp->magic != TTY_MAGIC) || !(ch->ch_tun.un_flags & UN_ISOPEN) ||
+ !(tp->termios->c_cflag & CREAD) || (ch->ch_tun.un_flags & UN_CLOSING))
+ #else
+- if (!tp || (tp->magic != TTY_MAGIC) || !(ch->ch_tun.un_flags & UN_ISOPEN) ||
++ if (!tp || !tp->ldisc || !(ch->ch_tun.un_flags & UN_ISOPEN) ||
+ !(tp->termios.c_cflag & CREAD) || (ch->ch_tun.un_flags & UN_CLOSING))
+ #endif
+ {
+
+ DPR_READ(("input. dropping %d bytes on port %d...\n", data_len, ch->ch_portnum));
+- DPR_READ(("input. tp: %p tp->magic: %x MAGIC:%x ch flags: %x\n",
+- tp, tp ? tp->magic : 0, TTY_MAGIC, ch->ch_tun.un_flags));
++ DPR_READ(("input. tp: %p ch flags: %x\n",
++ tp, ch->ch_tun.un_flags));
+
+ ch->ch_r_head = tail;
+
+ /* Force queue flow control to be released, if needed */
+ dgnc_check_queue_flow_control(ch);
+@@ -1686,11 +1686,11 @@ static int dgnc_block_til_ready(struct t
+ struct un_t *un = NULL;
+ ulong lock_flags;
+ uint old_flags = 0;
+ int sleep_on_un_flags = 0;
+
+- if (!tty || tty->magic != TTY_MAGIC || !file || !ch || ch->magic != DGNC_CHANNEL_MAGIC) {
++ if (!tty || !tty->ldisc || !file || !ch || ch->magic != DGNC_CHANNEL_MAGIC) {
+ return (-ENXIO);
+ }
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC) {
+@@ -1848,11 +1848,11 @@ static int dgnc_block_til_ready(struct t
+ */
+ static void dgnc_tty_hangup(struct tty_struct *tty)
+ {
+ struct un_t *un;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -1879,11 +1879,11 @@ static void dgnc_tty_close(struct tty_st
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags;
+ int rc = 0;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -2466,11 +2466,11 @@ static int dgnc_tty_tiocmget(struct tty_
+ struct un_t *un;
+ int result = -EIO;
+ uchar mstat = 0;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return result;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return result;
+@@ -2525,11 +2525,11 @@ static int dgnc_tty_tiocmset(struct tty_
+ struct channel_t *ch;
+ struct un_t *un;
+ int ret = -EIO;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return ret;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return ret;
+@@ -2584,11 +2584,11 @@ static int dgnc_tty_send_break(struct tt
+ struct channel_t *ch;
+ struct un_t *un;
+ int ret = -EIO;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return ret;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return ret;
+@@ -2637,11 +2637,11 @@ static void dgnc_tty_wait_until_sent(str
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+ int rc;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -2673,11 +2673,11 @@ static void dgnc_tty_send_xchar(struct t
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -2782,11 +2782,11 @@ static int dgnc_set_modem_info(struct tt
+ struct un_t *un;
+ int ret = -ENXIO;
+ unsigned int arg = 0;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return ret;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return ret;
+@@ -2880,11 +2880,11 @@ static int dgnc_tty_digigeta(struct tty_
+ ulong lock_flags;
+
+ if (!retinfo)
+ return (-EFAULT);
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return (-EFAULT);
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return (-EFAULT);
+@@ -2922,11 +2922,11 @@ static int dgnc_tty_digiseta(struct tty_
+ struct digi_t new_digi;
+ ulong lock_flags;
+
+ DPR_IOCTL(("DIGI_SETA start\n"));
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return (-EFAULT);
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return (-EFAULT);
+@@ -3003,11 +3003,11 @@ static void dgnc_tty_set_termios(struct
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+ unsigned long lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -3049,11 +3049,11 @@ static void dgnc_tty_throttle(struct tty
+ {
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags = 0;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -3078,11 +3078,11 @@ static void dgnc_tty_unthrottle(struct t
+ {
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -3108,11 +3108,11 @@ static void dgnc_tty_start(struct tty_st
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -3142,11 +3142,11 @@ static void dgnc_tty_stop(struct tty_str
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -3189,11 +3189,11 @@ static void dgnc_tty_flush_chars(struct
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -3228,11 +3228,11 @@ static void dgnc_tty_flush_buffer(struct
+ {
+ struct channel_t *ch;
+ struct un_t *un;
+ ulong lock_flags;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return;
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return;
+@@ -3298,11 +3298,11 @@ dgnc_tty_ioctl(struct tty_struct *tty, u
+ struct un_t *un;
+ int rc;
+ ulong lock_flags;
+ void __user *uarg = (void __user *) arg;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return (-ENODEV);
+
+ un = tty->driver_data;
+ if (!un || un->magic != DGNC_UNIT_MAGIC)
+ return (-ENODEV);
diff --git a/0009-kernel-5.17-change-PDE_DATA.patch b/0009-kernel-5.17-change-PDE_DATA.patch
new file mode 100644
index 000000000000..d2c1002be18f
--- /dev/null
+++ b/0009-kernel-5.17-change-PDE_DATA.patch
@@ -0,0 +1,67 @@
+diff -pNaru5 a/driver/2.6.27/dgnc_proc.c b/driver/2.6.27/dgnc_proc.c
+--- a/driver/2.6.27/dgnc_proc.c 2023-01-28 14:46:11.117123311 -0500
++++ b/driver/2.6.27/dgnc_proc.c 2023-01-28 14:52:09.647326130 -0500
+@@ -400,11 +400,15 @@ static int dgnc_gen_proc_open(struct ino
+ goto done;
+ }
+
+ entry = (struct dgnc_proc_entry *) de->data;
+ #else /* >=3,10,0 */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
+ entry = (struct dgnc_proc_entry *) PDE_DATA(file_inode(file));
++#else
++ entry = pde_data(file_inode(file));
++#endif
+ #endif
+ if (!entry) {
+ ret = -ENXIO;
+ goto done;
+ }
+@@ -448,11 +452,15 @@ static int dgnc_gen_proc_close(struct in
+ if (!de || !de->data)
+ goto done;
+
+ entry = (struct dgnc_proc_entry *) de->data;
+ #else /* >=3,10,0 */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
+ entry = (struct dgnc_proc_entry *) PDE_DATA(file_inode(file));
++#else
++ entry = pde_data(file_inode(file));
++#endif
+ #endif
+
+ if (!entry)
+ goto done;
+
+@@ -490,11 +498,15 @@ static ssize_t dgnc_gen_proc_read(struct
+ if (!de || !de->data)
+ return -ENXIO;
+
+ entry = (struct dgnc_proc_entry *) de->data;
+ #else /* >=3,10,0 */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
+ entry = (struct dgnc_proc_entry *) PDE_DATA(file_inode(file));
++#else
++ entry = pde_data(file_inode(file));
++#endif
+ #endif
+
+ if (!entry)
+ return -ENXIO;
+
+@@ -534,11 +546,15 @@ static ssize_t dgnc_gen_proc_write(struc
+ if (!de || !de->data)
+ return -ENXIO;
+
+ entry = (struct dgnc_proc_entry *) de->data;
+ #else /* >=3,10,0 */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
+ entry = (struct dgnc_proc_entry *) PDE_DATA(file_inode(file));
++#else
++ entry = pde_data(file_inode(file));
++#endif
+ #endif
+
+ if (!entry)
+ return -ENXIO;
+
diff --git a/0010-kernel-6.1-INIT_C_CC-termios_internal.patch b/0010-kernel-6.1-INIT_C_CC-termios_internal.patch
new file mode 100644
index 000000000000..f6d9178ec163
--- /dev/null
+++ b/0010-kernel-6.1-INIT_C_CC-termios_internal.patch
@@ -0,0 +1,17 @@
+diff -pNaru5 a/driver/2.6.27/dgnc_tty.c b/driver/2.6.27/dgnc_tty.c
+--- a/driver/2.6.27/dgnc_tty.c 2023-01-28 15:38:17.005198782 -0500
++++ b/driver/2.6.27/dgnc_tty.c 2023-01-28 15:42:22.631445123 -0500
+@@ -54,10 +54,13 @@
+ #include <linux/serial_reg.h>
+ #include <linux/slab.h>
+ #include <linux/delay.h> /* For udelay */
+ #include <asm/uaccess.h> /* For copy_from_user/copy_to_user */
+ #include <linux/pci.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
++#include <linux/termios_internal.h>
++#endif
+
+ #include "dgnc_driver.h"
+ #include "dgnc_kcompat.h"
+ #include "dgnc_tty.h"
+ #include "dgnc_types.h"
diff --git a/0011-kernel-6.0-set_termios-const-ktermios.patch b/0011-kernel-6.0-set_termios-const-ktermios.patch
new file mode 100644
index 000000000000..8db4ce693efe
--- /dev/null
+++ b/0011-kernel-6.0-set_termios-const-ktermios.patch
@@ -0,0 +1,35 @@
+diff -pNaru5 a/driver/2.6.27/dgnc_tty.c b/driver/2.6.27/dgnc_tty.c
+--- a/driver/2.6.27/dgnc_tty.c 2023-01-28 15:45:44.006164787 -0500
++++ b/driver/2.6.27/dgnc_tty.c 2023-01-28 15:48:09.570243005 -0500
+@@ -152,11 +152,15 @@ static int dgnc_tty_tiocmget(struct tty_
+ static int dgnc_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear);
+ #endif
+ static int dgnc_tty_send_break(struct tty_struct *tty, int msec);
+ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout);
+ static int dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf, int count);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,0,0)
+ static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios);
++#else
++static void dgnc_tty_set_termios(struct tty_struct *tty, const struct ktermios *old_termios);
++#endif
+ static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch);
+
+
+ static const struct tty_operations dgnc_tty_ops = {
+ .open = dgnc_tty_open,
+@@ -2999,11 +3003,15 @@ static int dgnc_tty_digiseta(struct tty_
+
+
+ /*
+ * dgnc_set_termios()
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,0,0)
+ static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
++#else
++static void dgnc_tty_set_termios(struct tty_struct *tty, const struct ktermios *old_termios)
++#endif
+ {
+ struct board_t *bd;
+ struct channel_t *ch;
+ struct un_t *un;
+ unsigned long lock_flags;
diff --git a/0012-kernel-6.4-class_create-1arg.patch b/0012-kernel-6.4-class_create-1arg.patch
new file mode 100644
index 000000000000..ccd329aaf84e
--- /dev/null
+++ b/0012-kernel-6.4-class_create-1arg.patch
@@ -0,0 +1,19 @@
+diff -pNaru5 a/driver/2.6.27/dgnc_driver.c b/driver/2.6.27/dgnc_driver.c
+--- a/driver/2.6.27/dgnc_driver.c 2023-12-19 01:34:02.724532936 -0500
++++ b/driver/2.6.27/dgnc_driver.c 2023-12-19 01:35:48.258543884 -0500
+@@ -308,11 +308,15 @@ static int dgnc_start(void)
+ rc = -ENXIO;
+ return(rc);
+ }
+ dgnc_Major = rc;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
+ dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
++#else
++ dgnc_class = class_create("dgnc_mgmt");
++#endif
+ device_create(dgnc_class, NULL, MKDEV(dgnc_Major, 0),
+ NULL, "dgnc_mgmt");
+ device_create(dgnc_class, NULL, MKDEV(dgnc_Major, 1),
+ NULL, "dgnc_mgmt1");
+ device_create(dgnc_class, NULL, MKDEV(dgnc_Major, 2),
diff --git a/0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch b/0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch
new file mode 100644
index 000000000000..b13c197dd961
--- /dev/null
+++ b/0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch
@@ -0,0 +1,19 @@
+diff -pNaru5 a/driver/2.6.27/dgnc_tty.c b/driver/2.6.27/dgnc_tty.c
+--- a/driver/2.6.27/dgnc_tty.c 2023-12-19 01:37:32.514419708 -0500
++++ b/driver/2.6.27/dgnc_tty.c 2023-12-19 01:38:44.487209394 -0500
+@@ -75,11 +75,15 @@
+ /*
+ * internal variables
+ */
+ static struct board_t *dgnc_BoardsByMajor[256];
+ static uchar *dgnc_TmpWriteBuf = NULL;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
+ static DEFINE_SEMAPHORE(dgnc_TmpWriteSem);
++#else
++static DEFINE_SEMAPHORE(dgnc_TmpWriteSem,1);
++#endif
+
+ /*
+ * Default transparent print information.
+ */
+ static struct digi_t dgnc_digi_init = {
diff --git a/0014-kernel-6.6-struct-tty_operations-write-size_t.patch b/0014-kernel-6.6-struct-tty_operations-write-size_t.patch
new file mode 100644
index 000000000000..35f64657d785
--- /dev/null
+++ b/0014-kernel-6.6-struct-tty_operations-write-size_t.patch
@@ -0,0 +1,37 @@
+diff -pNaru5 a/driver/2.6.27/dgnc_tty.c b/driver/2.6.27/dgnc_tty.c
+--- a/driver/2.6.27/dgnc_tty.c 2023-12-19 01:40:37.816271903 -0500
++++ b/driver/2.6.27/dgnc_tty.c 2023-12-19 01:43:19.098247079 -0500
+@@ -155,11 +155,15 @@ static int dgnc_tty_tiocmset(struct tty_
+ static int dgnc_tty_tiocmget(struct tty_struct *tty);
+ static int dgnc_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear);
+ #endif
+ static int dgnc_tty_send_break(struct tty_struct *tty, int msec);
+ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,6,0)
+ static int dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf, int count);
++#else
++static ssize_t dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf, size_t count);
++#endif
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(6,0,0)
+ static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios);
+ #else
+ static void dgnc_tty_set_termios(struct tty_struct *tty, const struct ktermios *old_termios);
+ #endif
+@@ -2251,12 +2255,17 @@ static int dgnc_tty_put_char(struct tty_
+ * dgnc_tty_write()
+ *
+ * Take data from the user or kernel and send it out to the FEP.
+ * In here exists all the Transparent Print magic as well.
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,6,0)
+ static int dgnc_tty_write(struct tty_struct *tty,
+ const unsigned char *buf, int count)
++#else
++static ssize_t dgnc_tty_write(struct tty_struct *tty,
++ const unsigned char *buf, size_t count)
++#endif
+ {
+ struct channel_t *ch = NULL;
+ struct un_t *un = NULL;
+ int bufcount = 0, n = 0;
+ int orig_count = 0;
diff --git a/PKGBUILD b/PKGBUILD
index 5f1341bde822..04014a15d765 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,11 +5,19 @@
# Digi bug: change literal "dgnc" to DRVSTR or PROCSTR
# Digi bug: viewing /proc/dgnc/0/[0-9]/sniff hangs terminal
+# Digi bug: multiple PCI cards not fully supported. Some cards may be non functional. Boot over and over to get them all to work.
+# Digi bug: Non functional in 5.15 even with just one card
+
+# Stopped working after kernel version 5.14.0: /dev/ttyn1a: No such device or address
+# also works not well in 5.10. rmmod modprobe doesn't fix it. Must reboot over and over until it's fixed.
+# Pretty much dead
_opt_DKMS=1 # This can be toggled between installs
_opt_defaultmode="0660" # default: 0600
_opt_defaultgroup="uucp" # default: root
+#export KERNELRELEASE="$(basename $(dirname /usr/lib/modules/5.10.*/modules.alias))"
+
# ls -l /dev | grep ',' | sort -n -k 5.1 | less
set -u
@@ -17,12 +25,13 @@ pkgname='digi-dgnc'
#_pkgver='1.3-28'; _dl='40002369_G.tgz'
_pkgver='1.3-29'; _dl='40002369_H.src.rpm'
pkgver="${_pkgver//-/.}"
-pkgrel='2'
+pkgrel='8'
pkgdesc='tty driver for Digi Neo and legacy ClassicBoard PCI PCIe RS-232 serial port'
arch=('i686' 'x86_64')
url='https://www.digi.com/'
+# https://hub.digi.com/support/products/infrastructure-management/
license=('GPL')
-options=('!strip')
+options=('!strip' '!buildflags')
install="${pkgname}-install.sh"
_srcdir="${pkgname##*-}-${pkgver%.*}"
source=(
@@ -30,11 +39,51 @@ source=(
'0000-Kernel-4-14-DRIVER-ATTR.patch' # https://patchwork.kernel.org/patch/9851919/ Available since 3.11-rc2
'0001-Kernel-4-15-timers.patch'
'0002-kernel-5.0.0-do_gettimeofday.patch'
+ '0003-kernel-5.6--proc_dir_entry-proc_ops.patch'
+ '0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch'
+ '0005-kernel-5.13-dropped-tty_check_change.patch'
+ '0006-kernel-5.14-task_struct.state-unsigned-tty.patch'
+ '0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch'
+ '0008-kernel-6.1-remove-TTY_MAGIC.patch'
+ '0009-kernel-5.17-change-PDE_DATA.patch'
+ '0010-kernel-6.1-INIT_C_CC-termios_internal.patch'
+ '0011-kernel-6.0-set_termios-const-ktermios.patch'
+ '0012-kernel-6.4-class_create-1arg.patch'
+ '0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch'
+ '0014-kernel-6.6-struct-tty_operations-write-size_t.patch'
)
+md5sums=('6171349852f6d02228d6e30c79b7a434'
+ 'a171e9ea1a4ff8340c3c58b303632edf'
+ '6c16c3c24c79fb558bcf27f780829c75'
+ '8e46a778c648ab4f0ca63a337d36df60'
+ '394d24a150676d8123300d6715b81fb8'
+ '44b0a7b0ab4dbe661b822fcba9423121'
+ '98f1684623d45f66e42f78e5ab8fd8c2'
+ '89de6a694ecf827a3358bcd8aea03a6a'
+ '58d75d8f86830d09ba8754d4e03a6a9d'
+ '7ceda3eaa776322b2042de8d159535ea'
+ '9371ea6968666c58413a463fcf341d1f'
+ '53bcd11e5e4acbd0466b3ffdda3b263b'
+ '6475487a9415d3dc7ece9dd888cec92c'
+ '7824cfd37ca3c7dd27e911c679f8256c'
+ 'bbae50830fad8e9e2b674078c2770aee'
+ 'b1584c28e0e1d6741ff4e7cca25761d8')
sha256sums=('e121a31569e3e1f156caeed70742971ec32fef598429ef647bde98f56aa048f5'
'625bb794d31690b45ad7469f811e7422dac938cf8e9b777aba4d97b60b3c6eae'
'88d5a8589dca55ca98089dfa4570aa1fbde1095957d0788ad710a27b348c2f4f'
- '737df02a12fc76841325d1059d90451467637eab2df016efc20d84976eb5de7d')
+ '737df02a12fc76841325d1059d90451467637eab2df016efc20d84976eb5de7d'
+ '3496e90914e1fa2f209dd85c336e7b1c0b784dbbf67cc45e0f0f55f0b1ef5a0e'
+ 'f215451df4a01f0875a53425b6d8452c344f19b61b59b821f8c949b1b276c022'
+ 'f5eebe58f625b493cf8cb4c7fb8630fd4d0f9fa278ce4400b011fd702bd2db90'
+ 'dcedb22e0f3fb0c8197630b38217f86c5468d065ab2d67708c16c17351d6944e'
+ '0693e13442749c40a338320cca72dd8aad23678ea7cae035e6bab01a40640c44'
+ '718e5104ff4caf153757dd2f8c143402d2c175fd838cfc5db3f47618efd40230'
+ 'b5000b9bb68ae8ddc173b666ead6d60fa329aa4d5d96636af4717a131827748c'
+ 'c0786d12440da829f0a57ca9e7f2c3114edbd88213bb66687ac84730ee7c8ed1'
+ 'ab4921079d2a4ee3316bbea3bcb3ff7844d8ced73b6b4327d3c580088bc511b1'
+ '021745fab94745eaea1abc503a1f7ec94dfa6132f841d5ce2bb969dcb049eda6'
+ '40ee1fb8e261008d810c7251de5612029fa9c8b83a58bdd3279dd64467cb1bed'
+ '414f1115e195616945ac8d597bfd59a9ae3b8ec392c8f06f15213efa662e6433')
if [ "${_opt_DKMS}" -ne 0 ]; then
depends+=('linux' 'dkms' 'linux-headers')
@@ -72,19 +121,73 @@ prepare() {
fi
cd "${_srcdir}"
- #cp -pr "${srcdir}/${_srcdir}"{,.orig-0000}
+ #cp -pr "${srcdir}/${_srcdir}"{,.orig-0000}; false
#diff -pNaru5 dgnc-1.3{.orig-0000,} > '0000-Kernel-4-14-DRIVER-ATTR.patch'
patch -Nup1 -i "${srcdir}/0000-Kernel-4-14-DRIVER-ATTR.patch"
test ! -d "${srcdir}/${_srcdir}.orig-0000" || echo "${}"
- #cp -pr "${srcdir}/${_srcdir}"{,.orig-0001}
+ #cp -pr "${srcdir}/${_srcdir}"{,.orig-0001}; false
#diff -pNaru5 dgnc-1.3{.orig-0001,} > '0001-Kernel-4-15-timers.patch'
patch -Nup1 -i "${srcdir}/0001-Kernel-4-15-timers.patch"
test ! -d "${srcdir}/${_srcdir}.orig-0001" || echo "${}"
#cp -p driver/2.6.27/dgnc_tty.c{,.orig}; false
#diff -pNau5 driver/2.6.27/dgnc_tty.c{.orig,} > '0002-kernel-5.0.0-do_gettimeofday.patch'
- patch -Nbup0 -i "${srcdir}/0002-kernel-5.0.0-do_gettimeofday.patch"
+ patch -Nup0 -i "${srcdir}/0002-kernel-5.0.0-do_gettimeofday.patch"
+
+ #cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0003-kernel-5.6--proc_dir_entry-proc_ops.patch'
+ patch -Nup0 -i "${srcdir}/0003-kernel-5.6--proc_dir_entry-proc_ops.patch"
+
+ #rm -f driver/2.6.27/*.orig; cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch'
+ patch -Nup0 -i "${srcdir}/0004-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch"
+
+ #rm -f driver/2.6.27/*.orig; cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0005-kernel-5.13-dropped-tty_check_change.patch'
+ patch -Nup0 -i "${srcdir}/0005-kernel-5.13-dropped-tty_check_change.patch"
+
+ #rm -f driver/2.6.27/*.orig; cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0006-kernel-5.14-task_struct.state-unsigned-tty.patch'
+ patch -Nup0 -i "${srcdir}/0006-kernel-5.14-task_struct.state-unsigned-tty.patch"
+
+ # http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08799.html [PATCH 5/8] tty: drop alloc_tty_driver
+ # http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08801.html [PATCH 7/8] tty: drop put_tty_driver
+ #rm -f driver/2.6.27/*.orig; cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch'
+ patch -Nup0 -i "${srcdir}/0007-kernel-5.15-alloc_tty_driver-put_tty_driver.patch"
+
+ # https://lore.kernel.org/lkml/723478a270a3858f27843cbec621df4d5d44efcc.1663288066.git.nabijaczleweli@nabijaczleweli.xyz/T/
+ # cd ..; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0008-kernel-6.1-remove-TTY_MAGIC.patch'
+ patch -Nup1 -i "${srcdir}/0008-kernel-6.1-remove-TTY_MAGIC.patch"
+
+ # https://www.spinics.net/lists/linux-fsdevel/msg207433.html
+ # cd ..; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0009-kernel-5.17-change-PDE_DATA.patch'
+ patch -Nup1 -i "${srcdir}/0009-kernel-5.17-change-PDE_DATA.patch"
+
+ # https://www.uwsg.indiana.edu/hypermail/linux/kernel/1809.1/00449.html
+ #cd ..; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0010-kernel-6.1-INIT_C_CC-termios_internal.patch'
+ patch -Nup1 -i "${srcdir}/0010-kernel-6.1-INIT_C_CC-termios_internal.patch"
+
+ # https://lore.kernel.org/linux-arm-kernel/20220816115739.10928-9-ilpo.jarvinen@linux.intel.com/T/
+ # cd ..; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0011-kernel-6.0-set_termios-const-ktermios.patch'
+ patch -Nup1 -i "${srcdir}/0011-kernel-6.0-set_termios-const-ktermios.patch"
+
+ #cd ..; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0012-kernel-6.4-class_create-1arg.patch'
+ patch -Nup1 -i "${srcdir}/0012-kernel-6.4-class_create-1arg.patch"
+
+ #cd ..; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch'
+ patch -Nup1 -i "${srcdir}/0013-kernel-6.4-DEFINE_SEMAPHORE-2arg.patch"
+
+ #cd ..; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0014-kernel-6.6-struct-tty_operations-write-size_t.patch'
+ patch -Nup1 -i "${srcdir}/0014-kernel-6.6-struct-tty_operations-write-size_t.patch"
# Version check
local _ver
@@ -126,7 +229,22 @@ prepare() {
test ! -s 'scripts/postinstall.Arch' || echo "${}"
# new folder in gcc 8
- sed -e 's/^clean:$/&\n\trm -f .cache.mk/g' -i driver/*/Makefile*
+ #cp -p 'driver/2.6.27/Makefile26'{,.Arch}
+ sed -e 's/^clean:$/&\n\trm -f .cache.mk/g' \
+ -e '# Use built in clean' \
+ -e 's:clean:clean_local:g' \
+ -e 's~^clean_local:~clean:\n\tmake -C @KERNEL_HEADERS@ SUBDIRS=$$PWD clean\n\n&~g' \
+ -e '# Kernel 5.4 compatible' \
+ -e 's: SUBDIRS=\([^ ]\+\) : M=\1&:g ' \
+ -e 's:@MODDIR@:/usr/lib/modules/$(KERNELRELEASE):g' \
+ -e 's:@KERNEL_HEADERS@:/usr/lib/modules/$(KERNELRELEASE)/build:g' \
+ -e '# Not a good way to sub variables' \
+ -e '/^MODDIR =/ s:\$(shell echo \(.*\))$:\1:g' \
+ -e '# Anything using these must fail' \
+ -e '/MOD = \// s:^:#:g' \
+ -e '1i KERNELRELEASE?=$(shell uname -r)' \
+ -i 'driver/2.6.27/Makefile26'
+ test ! -s 'driver/2.6.27/Makefile26.Arch'
# Branding in dmesg
sed -e '/^static int dgnc_start/,/^}$/ s@^\(\s\+\)APR(("For@'"\1APR((DRVSTR\": Arch Linux https://aur.archlinux.org/packages/${pkgname}/\"));\n&@g" \
@@ -174,8 +292,10 @@ build() {
set -u
cd "${_srcdir}"
_configure
- CPPFLAGS="${CPPFLAGS//-D_FORTIFY_SOURCE=2/}" \
+ set +u; msg2 'Build config'; set -u
+ #CPPFLAGS="${CPPFLAGS//-D_FORTIFY_SOURCE=2/}" \
make -C 'config' -j1
+ set +u; msg2 'Build'; set -u
make -j1
set +u
}
@@ -267,13 +387,7 @@ EOF
rm "${_dkms}/driver/build/"/Makefile?*
install -Dpm644 'dpa/dpacompat.h' -t "${_dkms}/dpa"
install -pm644 'Makefile.inc' -t "${_dkms}/"
- sed -e 's:/usr/lib/modules/[^/]\+/:/usr/lib/modules/$(KERNELRELEASE)/:g' \
- -e '# Not a good way to sub variables' \
- -e '/^MODDIR =/ s:\$(shell echo \(.*\))$:\1:g' \
- -e '# Anything using these must fail' \
- -e '/MOD = \// s:^:#:g' \
- -i "${_dkms}/driver/build/Makefile"
- make -C "${_dkms}/driver/build/" clean
+ make -C "${_dkms}/driver/build/" clean KERNELRELEASE="$(uname -r)" MYPWD="${_dkms}/driver/build/"
fi
set +u
}