summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO105
-rw-r--r--0000-Kernel-4-13-CLASS_ATTR_STRING.patch62
-rw-r--r--0000a-Kernel-4-13-CLASS_ATTR_STRING.patch59
-rw-r--r--0001-Kernel-4-15-timers.patch145
-rw-r--r--0001a-Kernel-4-15-timers.patch158
-rw-r--r--0002-kernel-5.0.0-do_gettimeofday.patch24
-rw-r--r--0002a-kernel-5.0.0-do_gettimeofday.patch36
-rw-r--r--0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch183
-rw-r--r--0003a-kernel-5.0.0-dgrp_mon_ops-access_ok.patch194
-rw-r--r--0004-kernel-5.6-proc_dir_entry-proc_ops.patch210
-rw-r--r--0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch18
-rw-r--r--0006-kernel-5.13-dropped-tty_check_change.patch17
-rw-r--r--0007-kernel-5.14-task_struct.state-unsigned-tty.patch142
-rw-r--r--0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch81
-rw-r--r--0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch21
-rw-r--r--0010-kernel-5.17-change-PDE_DATA.patch119
-rw-r--r--0011-kernel-6.1-remove-TTY_MAGIC.patch45
-rw-r--r--0012-kernel-6.1-INIT_C_CC-termios_internal.patch19
-rw-r--r--0013-kernel-6.0-set_termios-const-ktermios.patch35
-rw-r--r--0014-kernel-6.6-struct-tty_operations-size_t.patch35
-rw-r--r--0015-kernel-6.4-class_create-1arg.patch19
-rw-r--r--0016-0006-kernel-5.10-dropped-tty_check_change.patch16
-rw-r--r--PKGBUILD240
23 files changed, 1955 insertions, 28 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0751f18dd730..172e0a23d44e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Thu Nov 15 02:47:50 UTC 2018
pkgbase = dgrp
pkgdesc = tty driver for Digi RealPort ConnectPort EtherLite Flex One CM PortServer TS IBM RAN serial console terminal servers
- pkgver = 1.9.39
- pkgrel = 1
+ pkgver = 1.9.41
+ pkgrel = 2
url = https://www.digi.com/
install = dgrp-install.sh
arch = i686
@@ -16,7 +14,6 @@ pkgbase = dgrp
depends = procps-ng
depends = psmisc
depends = perl
- depends = openssl-1.0
depends = linux
depends = dkms
depends = linux-headers
@@ -27,7 +24,7 @@ pkgbase = dgrp
options = !docs
options = !emptydirs
backup = etc/dgrp.backing.store
- source = dgrp-1.9.39-40002086_Z.tgz::http://ftp1.digi.com/support/driver/40002086_Z.tgz
+ source = dgrp-1.9.41-40002086_AB.tgz::https://hub.digi.com/dp/path=/support/asset/realport-driver-for-linux-tgz/
source = drpadmin
source = drpadmin.1
source = addp_perl-1.0.tgz::https://github.com/severach/addp/archive/f92a6fd2050c9f32a5a11cac18cd9def78138530.tar.gz
@@ -57,7 +54,79 @@ pkgbase = dgrp
source = http://ftp1.digi.com/support/utilities/40002709_C.mib
source = http://ftp1.digi.com/support/utilities/rfc1316.mib
source = http://ftp1.digi.com/support/utilities/rfc1317.mib
- sha256sums = 0db5204cc7d7806fde39b5ea7b6a465b4310739c380d7330131956e63af0f137
+ source = 0000-Kernel-4-13-CLASS_ATTR_STRING.patch
+ source = 0000a-Kernel-4-13-CLASS_ATTR_STRING.patch
+ source = 0001-Kernel-4-15-timers.patch
+ source = 0001a-Kernel-4-15-timers.patch
+ source = 0002-kernel-5.0.0-do_gettimeofday.patch
+ source = 0002a-kernel-5.0.0-do_gettimeofday.patch
+ source = 0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
+ source = 0003a-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
+ source = 0004-kernel-5.6-proc_dir_entry-proc_ops.patch
+ source = 0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch
+ source = 0006-kernel-5.13-dropped-tty_check_change.patch
+ source = 0007-kernel-5.14-task_struct.state-unsigned-tty.patch
+ source = 0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch
+ source = 0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch
+ source = 0010-kernel-5.17-change-PDE_DATA.patch
+ source = 0011-kernel-6.1-remove-TTY_MAGIC.patch
+ source = 0012-kernel-6.1-INIT_C_CC-termios_internal.patch
+ source = 0013-kernel-6.0-set_termios-const-ktermios.patch
+ source = 0014-kernel-6.6-struct-tty_operations-size_t.patch
+ source = 0015-kernel-6.4-class_create-1arg.patch
+ source = 0016-0006-kernel-5.10-dropped-tty_check_change.patch
+ md5sums = df7d7093759350208fbe5abf5ceb27de
+ md5sums = b4af5022ba96fcc2429263cfbbe85bae
+ md5sums = 9feebec170552c9186e713e7f5852e14
+ md5sums = e9ae823e597f2b63d95e6d6a8e25cde3
+ md5sums = 1b6491756c123234035c053baab1607c
+ md5sums = 4dbc892ea6247057db2fe613391f9b02
+ md5sums = 2e516af8bbe96b6d2137a106941d4223
+ md5sums = f404ac48baee06c5fbd7efab157704e9
+ md5sums = da3b2a1c78d981940afea9bd2da4bf96
+ md5sums = d824adbace7a52ed4a08ec2b3101b10f
+ md5sums = 749a347ec350ac9ca5895ae4d0e2ca24
+ md5sums = feab0142fc161c7705e6a3a12a410f35
+ md5sums = ee66f700bdb828cfc916f1bd2fd9dc1a
+ md5sums = 2a321009c37ea6070607d1f1b97de84d
+ md5sums = 067d79acafc0eb32f809390fe1a9374e
+ md5sums = 276d710e355e24ea6635bb23a3dd46d0
+ md5sums = 0549b35492fb3e2dbee52b1ea7790a25
+ md5sums = f04c8e15255d115c05631845232e858a
+ md5sums = c1fa6b3f533da1bbf05c5be268ec9aba
+ md5sums = de6faa945f2816191f558df38a1ac917
+ md5sums = 9495d5154f4d03fdd994922220dd1f2f
+ md5sums = 5fc7f819bca1d5ebfc8e4d06a744cb77
+ md5sums = 09ad1cc83d31f7365992d3f974fde6d5
+ md5sums = 89545a33c5df6304b6c8e288a4019d54
+ md5sums = bc469a335d5b1a7986a93327a3b6f57b
+ md5sums = 83104a3387dc09ba95ccf4e2581fb20f
+ md5sums = 5da394f02ed6d62971f0d700f174bfd1
+ md5sums = 1f6fcaabe4058c225674f866b19f2ca8
+ md5sums = 031e105a06300feecacfc2774e48ff2f
+ md5sums = 699172bf54ec0e45b6aae348b1f570e8
+ md5sums = be3bd26c2b2a74b445854135b17766a8
+ md5sums = 60a5d51a562aa1d8fa5f2294a683ce47
+ md5sums = 9f9275a3fb9b7a81a2ba098db1738b7d
+ md5sums = c1cd2d98c466e252b6c8f3a85e92489f
+ md5sums = 6a58beab1cb022cd368e874e24c7b9ef
+ md5sums = 91eb572a5ad032073326fd4dd2842504
+ md5sums = a65ba371ae411de4607259fc78a55682
+ md5sums = 4f1c03f1cc5f440a770c080a121d998a
+ md5sums = c25c1fdfbdc1fa38d87e45cf1c8511c2
+ md5sums = 2596b5f38ef54d72af08dca05fcce369
+ md5sums = 60a06421a819bc65bd5ba0c3841e0500
+ md5sums = 5dfc03b8f6b8d190b63271b8ef32986c
+ md5sums = f60c03c266bec028b4df4b7996deaacb
+ md5sums = 3b51a73b29843bfc6db748351dea464b
+ md5sums = a841defc71b4b1da33ac9b24cdff52ca
+ md5sums = 18dad6ca1c3bc2dd5206fe8caf4bcdf1
+ md5sums = bca5ff7935af3fe539ec30f1e9f59190
+ md5sums = 26d60834e4804c1c8af826e4f2a45503
+ md5sums = dc163d401cf3db6e07ff66793d3ec7ca
+ md5sums = 762d49459368bb78da084e57ffc25d7c
+ md5sums = 8aeeb382e88b712c163e149bea6c5e1a
+ sha256sums = 9ab56e0c841a1eab13e9ced8f1ff6943be6643773dbbbb7b189462950b9f2113
sha256sums = 42898b9d24262de27e9b1f3067d51d01373810b7c9e4991403a7f0a5dd7a26cf
sha256sums = 66f8b106a052b4807513ace92978e5e6347cef08eee39e4b4ae31c60284cc0a3
sha256sums = 9d79df8617e2bb1042a4b7d34311e73dc4afcdfe4dfa66703455ff54512427f5
@@ -87,6 +156,26 @@ pkgbase = dgrp
sha256sums = c471cafa43503a40d43b42acd8bc6ef49db29e55a74e0494c85f729ea45fe243
sha256sums = 5cac7ce2e6f043127f314b93694af021ae7820ffb5bf3de343da7a240d05e9c8
sha256sums = 8654496d83c083e457e8bb9bae2b1e71804d156a38c284d89872d0125eba947d
+ sha256sums = 61500188b388fd1eb52ec970150cf098d855b8ba09a8efb8192803eebefaba03
+ sha256sums = cc54e4bc21255a419ba0a416b1c8d1e705e27676c5561dd4b83fe657f045b65e
+ sha256sums = 46a87449cd316a621271def4147ba781424dd524ae2332cd55dd07f2ac9ab456
+ sha256sums = 4cb63ad72244eea04879b07cbca809120bdb08a7d8ea2a37e8d9a6fcc1333f26
+ sha256sums = 353d15624675c78dfd83318195d75bdb0507fd0476f5e22be1329bf257d2de1e
+ sha256sums = 9c6ce4ae64e206b442aeea6af98b9b86b8a67571ba00a92fc721619ba3061c26
+ sha256sums = acbcf462628daf4fa2dbee064969a158ccc0bb0ce9f286ceb3617e470eab1c1f
+ sha256sums = 882019276d59e6cc15fcda1bb1dea75b01591509a2644ddb0225ef1d5a17fd1c
+ sha256sums = b812176f6061d135ab45facecf5a05922d9ffd5ec0a6f17c3e3a5a74729034b1
+ sha256sums = 82f2c244f169c1f5a9b6186e4e4436c116bd020a1be973e8be261097d38bc937
+ sha256sums = eaab5a80791644a24950fe0c6db2c09535655c63ed3a263eb70791ab30f86ab9
+ sha256sums = 50975ac2377ffd24874746df4b820de1734f53eb322bd25ccc9d51148129a2e0
+ sha256sums = 0ae424e8211836edbededafd308cf9ae73cdb791752c4fc43e1c194db7b77cab
+ sha256sums = 1d6ab72eec4977b7789d0f5af3dc907bebdd21e417abb5dcfdac80c460a77bae
+ sha256sums = d1c641d3f024e8e11c4a36bf58570afb4b63fcaa4a22f05c59b513a35a6a4af7
+ sha256sums = 2b9ccbe92e4e1cbeafd16208ef011209bce30b6d3f9b4f288d0b83418479b1bc
+ sha256sums = 2ac185b8a27855c22d64d2e3f56e28f6a4442b1141ad46e4a0a078e0e22adc53
+ sha256sums = 3afe6487f26f7393aa1a05b1cd307b3bd29d164a49596e199a681b4432f6e23e
+ sha256sums = 5787763cac47a3ba5df203f75d57c9d7d8d4364c7cd32db426b268f77f17247a
+ sha256sums = df2c6cf5943ca26f282b96f22cf7301cffa6521a273c8301199840b5dca57e8a
+ sha256sums = 26022e04543aa8ccebe1b9c698c452e2dccc98d5bf1fd8c4f0dba000067e899a
pkgname = dgrp
-
diff --git a/0000-Kernel-4-13-CLASS_ATTR_STRING.patch b/0000-Kernel-4-13-CLASS_ATTR_STRING.patch
new file mode 100644
index 000000000000..72db944aa13f
--- /dev/null
+++ b/0000-Kernel-4-13-CLASS_ATTR_STRING.patch
@@ -0,0 +1,62 @@
+diff -pNaru5 dgrp-1.9.orig/driver/2.6.27/dgrp_sysfs.c dgrp-1.9/driver/2.6.27/dgrp_sysfs.c
+--- dgrp-1.9.orig/driver/2.6.27/dgrp_sysfs.c 2017-07-11 13:01:13.000000000 -0400
++++ dgrp-1.9/driver/2.6.27/dgrp_sysfs.c 2018-04-13 21:02:27.542053022 -0400
+@@ -57,21 +57,24 @@
+
+ static struct class *dgrp_class;
+ struct device *dgrp_class_nodes_dev;
+ struct device *dgrp_class_global_settings_dev;
+
+-
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+ static ssize_t dgrp_class_version_show(struct class *class, struct class_attribute *attr, char *buf)
+ #else
+ static ssize_t dgrp_class_version_show(struct class *class, char *buf)
+ #endif
+ {
+ return snprintf(buf, PAGE_SIZE, "%s\n", DIGI_VERSION);
+ }
+ static CLASS_ATTR(driver_version, 0400, dgrp_class_version_show, NULL);
+-
++#else
++// CLASS_ATTR_STRING first appeared in 2.6.34
++static CLASS_ATTR_STRING(driver_version, 0400, __stringify(PAGE_SIZE) DIGI_VERSION);
++#endif
+
+ static ssize_t dgrp_class_register_with_sysfs_show(struct device *c, struct device_attribute *attr, char *buf)
+ {
+ return snprintf(buf, PAGE_SIZE, "1\n");
+ }
+@@ -186,11 +189,15 @@ void dgrp_create_class_sysfs_files(void)
+ {
+ int ret = 0;
+ int max_majors = 1U << (32 - MINORBITS);
+
+ dgrp_class = class_create(THIS_MODULE, "digi_realport");
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)
+ ret = class_create_file(dgrp_class, &class_attr_driver_version);
++#else
++ ret = class_create_file(dgrp_class, &class_attr_driver_version.attr);
++#endif
+
+ dgrp_class_global_settings_dev = device_create(dgrp_class, NULL,
+ MKDEV(0, max_majors + 1), NULL, "driver_settings");
+
+ ret = sysfs_create_group(&dgrp_class_global_settings_dev->kobj,
+@@ -218,11 +225,15 @@ void dgrp_remove_class_sysfs_files(void)
+ }
+
+ sysfs_remove_group(&dgrp_class_global_settings_dev->kobj,
+ &dgrp_global_settings_attribute_group);
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)
+ class_remove_file(dgrp_class, &class_attr_driver_version);
++#else
++ class_remove_file(dgrp_class, &class_attr_driver_version.attr);
++#endif
+
+ device_destroy(dgrp_class, MKDEV(0, max_majors + 1));
+ device_destroy(dgrp_class, MKDEV(0, max_majors + 2));
+ class_destroy(dgrp_class);
+ }
diff --git a/0000a-Kernel-4-13-CLASS_ATTR_STRING.patch b/0000a-Kernel-4-13-CLASS_ATTR_STRING.patch
new file mode 100644
index 000000000000..c982728a27f6
--- /dev/null
+++ b/0000a-Kernel-4-13-CLASS_ATTR_STRING.patch
@@ -0,0 +1,59 @@
+diff -r -u5 dgrp-1.9.orig/driver/2.6.27o/dgrp_sysfs.c dgrp-1.9.orig/driver/2.6.27/dgrp_sysfs.c
+--- dgrp-1.9.orig/driver/2.6.27o/dgrp_sysfs.c 2017-07-11 13:01:13.000000000 -0400
++++ dgrp-1.9.orig/driver/2.6.27/dgrp_sysfs.c 2020-07-02 22:27:27.678240692 -0400
+@@ -58,19 +58,23 @@
+ static struct class *dgrp_class;
+ struct device *dgrp_class_nodes_dev;
+ struct device *dgrp_class_global_settings_dev;
+
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)
++static CLASS_ATTR_STRING(driver_version, S_IRUGO, DIGI_VERSION);
++#else
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+ static ssize_t dgrp_class_version_show(struct class *class, struct class_attribute *attr, char *buf)
+ #else
+ static ssize_t dgrp_class_version_show(struct class *class, char *buf)
+ #endif
+ {
+ return snprintf(buf, PAGE_SIZE, "%s\n", DIGI_VERSION);
+ }
+ static CLASS_ATTR(driver_version, 0400, dgrp_class_version_show, NULL);
++#endif
+
+
+ static ssize_t dgrp_class_register_with_sysfs_show(struct device *c, struct device_attribute *attr, char *buf)
+ {
+ return snprintf(buf, PAGE_SIZE, "1\n");
+@@ -186,11 +190,15 @@
+ {
+ int ret = 0;
+ int max_majors = 1U << (32 - MINORBITS);
+
+ dgrp_class = class_create(THIS_MODULE, "digi_realport");
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)
++ ret = class_create_file(dgrp_class, &class_attr_driver_version.attr);
++#else
+ ret = class_create_file(dgrp_class, &class_attr_driver_version);
++#endif
+
+ dgrp_class_global_settings_dev = device_create(dgrp_class, NULL,
+ MKDEV(0, max_majors + 1), NULL, "driver_settings");
+
+ ret = sysfs_create_group(&dgrp_class_global_settings_dev->kobj,
+@@ -218,11 +226,15 @@
+ }
+
+ sysfs_remove_group(&dgrp_class_global_settings_dev->kobj,
+ &dgrp_global_settings_attribute_group);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)
++ class_remove_file(dgrp_class, &class_attr_driver_version.attr);
++#else
+ class_remove_file(dgrp_class, &class_attr_driver_version);
++#endif
+
+ device_destroy(dgrp_class, MKDEV(0, max_majors + 1));
+ device_destroy(dgrp_class, MKDEV(0, max_majors + 2));
+ class_destroy(dgrp_class);
+ }
diff --git a/0001-Kernel-4-15-timers.patch b/0001-Kernel-4-15-timers.patch
new file mode 100644
index 000000000000..c1227b2ecce7
--- /dev/null
+++ b/0001-Kernel-4-15-timers.patch
@@ -0,0 +1,145 @@
+diff -pNaru5 dgrp-1.9.orig/driver/2.6.27/dgrp_net_ops.c dgrp-1.9/driver/2.6.27/dgrp_net_ops.c
+--- dgrp-1.9.orig/driver/2.6.27/dgrp_net_ops.c 2018-06-03 20:45:01.337174862 -0400
++++ dgrp-1.9/driver/2.6.27/dgrp_net_ops.c 2018-06-03 20:45:01.417174550 -0400
+@@ -87,11 +87,15 @@ static long node_active_count; /* one
+ * the poller
+ */
+ static long poll_round; /* Timer rouding factor */
+ static ulong poll_time; /* Time of next poll */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static void poll_handler(ulong dummy);
++#else
++static void poll_handler(struct timer_list *dummy);
++#endif
+ static void poll_start_timer(ulong time);
+ static struct timer_list poll_timer = { function: poll_handler };
+
+
+ /*
+@@ -175,11 +179,15 @@ int register_net_device(struct nd_struct
+ struct proc_dir_entry *de;
+
+ if (!globals_initialized) {
+ globals_initialized = 1;
+ spin_lock_init(&GLBL(poll_lock));
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ init_timer(&poll_timer);
++#else
++ timer_setup(&poll_timer,poll_handler,0);
++#endif
+ }
+
+ ID_TO_CHAR(node->nd_ID, buf);
+
+ len = strlen(buf);
+@@ -4689,11 +4697,15 @@ static int test_perm(int mode, int op)
+ * waiter needs to be woken up, and (b) whether the poller needs to
+ * be rescheduled.
+ *
+ ******************************************************************************/
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static void poll_handler(ulong dummy)
++#else
++static void poll_handler(struct timer_list *dummy)
++#endif
+ {
+ struct nd_struct *nd;
+ link_t *lk;
+ ulong freq;
+ ulong lock_flags;
+@@ -4933,13 +4945,17 @@ static void poll_handler(ulong dummy)
+ return;
+ }
+
+ static void poll_start_timer(ulong time)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ init_timer(&poll_timer);
+ poll_timer.function = poll_handler;
+ poll_timer.data = 0;
++#else
++ timer_setup(&poll_timer,poll_handler,0);
++#endif
+ poll_timer.expires = time;
+ add_timer(&poll_timer);
+ }
+
+ /*
+diff -pNaru5 dgrp-1.9.orig/driver/2.6.27/dgrp_tty.c dgrp-1.9/driver/2.6.27/dgrp_tty.c
+--- dgrp-1.9.orig/driver/2.6.27/dgrp_tty.c 2018-06-03 20:45:01.340508182 -0400
++++ dgrp-1.9/driver/2.6.27/dgrp_tty.c 2018-06-03 20:46:37.953467319 -0400
+@@ -783,13 +783,25 @@ if (ttylock) tty_lock(ch->port.tty);
+
+ /*
+ * This function is just used as a callback for timeouts
+ * waiting on the ch_sleep flag.
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static void wake_up_drp_sleep_timer(unsigned long ptr)
+ {
+ struct ch_struct *ch = (struct ch_struct *) ptr;
++#else
++struct ch_timer_list {
++ struct timer_list tl;
++ struct ch_struct *ch;
++};
++
++static void wake_up_drp_sleep_timer(struct timer_list *ptr)
++{
++ struct ch_timer_list *chtl = (struct ch_timer_list *) ptr;
++ struct ch_struct *ch = chtl->ch;
++#endif
+ if (ch)
+ wake_up(&ch->ch_sleep);
+ }
+
+
+@@ -797,11 +809,15 @@ static void wake_up_drp_sleep_timer(unsi
+ * Set up our own sleep that can't be cancelled
+ * until our timeout occurs.
+ */
+ static void drp_my_sleep(struct ch_struct *ch)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ struct timer_list drp_wakeup_timer;
++#else
++ struct ch_timer_list drp_wakeup_timer_ch;
++#endif
+ DECLARE_WAITQUEUE(wait, current);
+
+ /*
+ * First make sure we're ready to receive the wakeup.
+ */
+@@ -812,23 +828,29 @@ static void drp_my_sleep(struct ch_struc
+ /*
+ * Since we are uninterruptible, set a timer to
+ * unset the uninterruptable state in 1 second.
+ */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ init_timer(&drp_wakeup_timer);
+ drp_wakeup_timer.function = wake_up_drp_sleep_timer;
+ drp_wakeup_timer.data = (unsigned long) ch;
++#else
++#define drp_wakeup_timer (drp_wakeup_timer_ch.tl)
++ timer_setup(&drp_wakeup_timer,wake_up_drp_sleep_timer,0);
++ drp_wakeup_timer_ch.ch=ch;
++#endif
+ drp_wakeup_timer.expires = jiffies + (1 * HZ);
+ add_timer(&drp_wakeup_timer);
+
+ schedule();
+
+ del_timer(&drp_wakeup_timer);
+
+ remove_wait_queue(&ch->ch_sleep, &wait);
+ }
+-
++#undef drp_wakeup_timer
+
+ /*****************************************************************************
+ *
+ * Function:
+ *
diff --git a/0001a-Kernel-4-15-timers.patch b/0001a-Kernel-4-15-timers.patch
new file mode 100644
index 000000000000..6833091b8df6
--- /dev/null
+++ b/0001a-Kernel-4-15-timers.patch
@@ -0,0 +1,158 @@
+diff -r -u5 dgrp-1.9.orig/driver/2.6.27o/dgrp_net_ops.c dgrp-1.9.orig/driver/2.6.27/dgrp_net_ops.c
+--- dgrp-1.9.orig/driver/2.6.27o/dgrp_net_ops.c 2017-07-11 13:01:13.000000000 -0400
++++ dgrp-1.9.orig/driver/2.6.27/dgrp_net_ops.c 2020-07-02 22:22:38.092377162 -0400
+@@ -87,11 +87,15 @@
+ * the poller
+ */
+ static long poll_round; /* Timer rouding factor */
+ static ulong poll_time; /* Time of next poll */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static void poll_handler(ulong dummy);
++#else
++static void poll_handler(struct timer_list *);
++#endif
+ static void poll_start_timer(ulong time);
+ static struct timer_list poll_timer = { function: poll_handler };
+
+
+ /*
+@@ -175,11 +179,15 @@
+ struct proc_dir_entry *de;
+
+ if (!globals_initialized) {
+ globals_initialized = 1;
+ spin_lock_init(&GLBL(poll_lock));
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ init_timer(&poll_timer);
++#else
++ timer_setup(&poll_timer, poll_handler, 0);
++#endif
+ }
+
+ ID_TO_CHAR(node->nd_ID, buf);
+
+ len = strlen(buf);
+@@ -4689,11 +4697,15 @@
+ * waiter needs to be woken up, and (b) whether the poller needs to
+ * be rescheduled.
+ *
+ ******************************************************************************/
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static void poll_handler(ulong dummy)
++#else
++static void poll_handler(struct timer_list *dummy)
++#endif
+ {
+ struct nd_struct *nd;
+ link_t *lk;
+ ulong freq;
+ ulong lock_flags;
+@@ -4933,13 +4945,17 @@
+ return;
+ }
+
+ static void poll_start_timer(ulong time)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ init_timer(&poll_timer);
+ poll_timer.function = poll_handler;
+ poll_timer.data = 0;
++#else
++ timer_setup(&poll_timer, poll_handler, 0);
++#endif
+ poll_timer.expires = time;
+ add_timer(&poll_timer);
+ }
+
+ /*
+diff -r -u5 dgrp-1.9.orig/driver/2.6.27o/dgrp_tty.c dgrp-1.9.orig/driver/2.6.27/dgrp_tty.c
+--- dgrp-1.9.orig/driver/2.6.27o/dgrp_tty.c 2017-07-11 13:01:13.000000000 -0400
++++ dgrp-1.9.orig/driver/2.6.27/dgrp_tty.c 2020-07-02 22:24:12.892107898 -0400
+@@ -783,13 +783,22 @@
+
+ /*
+ * This function is just used as a callback for timeouts
+ * waiting on the ch_sleep flag.
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static void wake_up_drp_sleep_timer(unsigned long ptr)
++#else
++static void wake_up_drp_sleep_timer(struct timer_list *t)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ struct ch_struct *ch = (struct ch_struct *) ptr;
++#else
++ struct ch_struct *ch = from_timer(ch, t, drp_wakeup_timer);
++#endif
++
+ if (ch)
+ wake_up(&ch->ch_sleep);
+ }
+
+
+@@ -797,11 +806,13 @@
+ * Set up our own sleep that can't be cancelled
+ * until our timeout occurs.
+ */
+ static void drp_my_sleep(struct ch_struct *ch)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ struct timer_list drp_wakeup_timer;
++#endif
+ DECLARE_WAITQUEUE(wait, current);
+
+ /*
+ * First make sure we're ready to receive the wakeup.
+ */
+@@ -812,19 +823,28 @@
+ /*
+ * Since we are uninterruptible, set a timer to
+ * unset the uninterruptable state in 1 second.
+ */
+
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ init_timer(&drp_wakeup_timer);
+ drp_wakeup_timer.function = wake_up_drp_sleep_timer;
+ drp_wakeup_timer.data = (unsigned long) ch;
+ drp_wakeup_timer.expires = jiffies + (1 * HZ);
+- add_timer(&drp_wakeup_timer);
+
++ add_timer(&drp_wakeup_timer);
+ schedule();
+-
+ del_timer(&drp_wakeup_timer);
++#else
++ timer_setup(&ch->drp_wakeup_timer, wake_up_drp_sleep_timer, 0);
++ ch->drp_wakeup_timer.expires = jiffies + (1 * HZ);
++
++ add_timer(&ch->drp_wakeup_timer);
++ schedule();
++ del_timer(&ch->drp_wakeup_timer);
++#endif
+
+ remove_wait_queue(&ch->ch_sleep, &wait);
+ }
+
+
+diff -r -u5 dgrp-1.9.orig/driver/2.6.27o/include/drp.h dgrp-1.9.orig/driver/2.6.27/include/drp.h
+--- dgrp-1.9.orig/driver/2.6.27o/include/drp.h 2017-07-11 13:01:13.000000000 -0400
++++ dgrp-1.9.orig/driver/2.6.27/include/drp.h 2018-06-01 12:10:27.000000000 -0400
+@@ -545,10 +545,14 @@
+ wait_queue_head_t ch_sleep; /* Wait queue for my_sleep() */
+
+ int ch_custom_speed; /* Realport custom speed */
+ int ch_txcount; /* Running TX count */
+ int ch_rxcount; /* Running RX count */
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++ struct timer_list drp_wakeup_timer;
++#endif
+ };
+
+
+ /************************************************************************
+ * Node State definitions.
diff --git a/0002-kernel-5.0.0-do_gettimeofday.patch b/0002-kernel-5.0.0-do_gettimeofday.patch
new file mode 100644
index 000000000000..4d1061186fae
--- /dev/null
+++ b/0002-kernel-5.0.0-do_gettimeofday.patch
@@ -0,0 +1,24 @@
+--- driver/2.6.27/dgrp_mon_ops.c.orig 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_mon_ops.c 2019-03-10 21:10:01.023556586 -0400
+@@ -218,10 +218,21 @@ int unregister_mon_device(struct nd_stru
+ node->nd_mon_de = NULL;
+
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
++/* Temporary until reimplemented with 64 bit functions */
++static inline void do_gettimeofday(struct timeval *tv)
++{
++ struct timespec64 now;
++
++ ktime_get_real_ts64(&now);
++ tv->tv_sec = now.tv_sec;
++ tv->tv_usec = now.tv_nsec/1000;
++}
++#endif
+
+ /*****************************************************************************
+ *
+ * Function:
+ *
diff --git a/0002a-kernel-5.0.0-do_gettimeofday.patch b/0002a-kernel-5.0.0-do_gettimeofday.patch
new file mode 100644
index 000000000000..caa56d77e803
--- /dev/null
+++ b/0002a-kernel-5.0.0-do_gettimeofday.patch
@@ -0,0 +1,36 @@
+--- driver/2.6.27/dgrp_mon_ops.c.orig 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_mon_ops.c 2020-07-02 21:48:51.158972983 -0400
+@@ -319,23 +319,33 @@
+ * Enter an RPDUMP file header into the buffer.
+ */
+
+ uchar *buf = nd->nd_mon_buf;
+ uint time;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
+ struct timeval tv;
++#else
++ struct timespec64 ts;
++#endif
+
+ strcpy(buf, RPDUMP_MAGIC);
+ buf += strlen(buf) + 1;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
+ do_gettimeofday(&tv);
+
+ /*
+ * tv.tv_sec might be a 64 bit quantity. Pare
+ * it down to 32 bits before attempting to encode
+ * it.
+ */
+ time = (uint) (tv.tv_sec & 0xffffffff);
++#else
++ ktime_get_real_ts64(&ts);
++ time = (uint) (ts.tv_sec & 0xffffffff);
++
++#endif
+
+ dgrp_encode_u4(buf + 0, time);
+ dgrp_encode_u2(buf + 4, 0);
+ buf += 6;
+
diff --git a/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch b/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
new file mode 100644
index 000000000000..5966ff3e8aa6
--- /dev/null
+++ b/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
@@ -0,0 +1,183 @@
+diff -pNaru5 driver/2.6.27.orig/dgrp_net_ops.c driver/2.6.27/dgrp_net_ops.c
+--- driver/2.6.27.orig/dgrp_net_ops.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_net_ops.c 2019-03-10 21:19:01.244643855 -0400
+@@ -4530,15 +4530,20 @@ static long dgrp_net_ioctl(struct file *
+
+ nd = file->private_data;
+
+ dbg_net_trace(IOCTL, ("net ioctl(%p) start\n", nd));
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
++#define compat_access_ok(u,v,w) access_ok(v,w)
++#else
++#define compat_access_ok(u,v,w) access_ok(u,v,w)
++#endif
+
+ if (_IOC_DIR(cmd) & _IOC_READ)
+- rtn = access_ok(VERIFY_WRITE, (void *) arg, size);
++ rtn = compat_access_ok(VERIFY_WRITE, (void *) arg, size);
+ else if (_IOC_DIR(cmd) & _IOC_WRITE)
+- rtn = access_ok(VERIFY_READ, (void *) arg, size);
++ rtn = compat_access_ok(VERIFY_READ, (void *) arg, size);
+
+ if (rtn == 0)
+ goto done;
+
+ rtn = 0;
+diff -pNaru5 driver/2.6.27.orig/dgrp_ports_ops.c driver/2.6.27/dgrp_ports_ops.c
+--- driver/2.6.27.orig/dgrp_ports_ops.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_ports_ops.c 2019-03-10 21:19:56.391097938 -0400
+@@ -516,11 +516,17 @@ static ssize_t dgrp_ports_read(struct fi
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buf, len) == 0) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
++#define compat_access_ok(u,v,w) access_ok(v,w)
++#else
++#define compat_access_ok(u,v,w) access_ok(u,v,w)
++#endif
++
++ if (compat_access_ok(VERIFY_WRITE, buf, len) == 0) {
+ res = -EFAULT;
+ goto done;
+ }
+
+ res = copy_to_user(buf, &linebuf[linepos], len);
+diff -pNaru5 driver/2.6.27.orig/dgrp_specproc.c driver/2.6.27/dgrp_specproc.c
+--- driver/2.6.27.orig/dgrp_specproc.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_specproc.c 2019-03-10 21:20:22.024333131 -0400
+@@ -642,11 +642,17 @@ static int write_config(struct dgrp_proc
+ len = *lenp;
+
+ if (len > INBUFLEN - 1)
+ len = INBUFLEN - 1;
+
+- if (access_ok(VERIFY_READ, buffer, len) == 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
++#define compat_access_ok(u,v,w) access_ok(v,w)
++#else
++#define compat_access_ok(u,v,w) access_ok(u,v,w)
++#endif
++
++ if (compat_access_ok(VERIFY_READ, buffer, len) == 0)
+ return -EFAULT;
+
+ if (copy_from_user(inbuf, buffer, len))
+ return -EFAULT;
+
+@@ -729,11 +735,11 @@ static int read_config(struct dgrp_proc_
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_WRITE, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+@@ -1116,11 +1122,11 @@ static int write_info(struct dgrp_proc_e
+ len = *lenp;
+
+ if (len > INBUFLEN - 1)
+ len = INBUFLEN - 1;
+
+- if (access_ok(VERIFY_READ, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_READ, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_from_user(inbuf, buffer, len))
+ return -EFAULT;
+
+ inbuf[len] = 0;
+@@ -1322,11 +1328,11 @@ static int read_info(struct dgrp_proc_en
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_WRITE, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+@@ -1431,11 +1437,11 @@ static int read_nodeinfo(struct dgrp_pro
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_WRITE, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+diff -pNaru5 driver/2.6.27.orig/dgrp_tty.c driver/2.6.27/dgrp_tty.c
+--- driver/2.6.27.orig/dgrp_tty.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_tty.c 2019-03-10 21:19:44.367810782 -0400
+@@ -2992,11 +2992,17 @@ static int set_modem_info(struct ch_stru
+ int error;
+ unsigned int arg;
+ int mval = 0;
+ ulong lock_flags;
+
+- error = access_ok(VERIFY_READ, value, sizeof(int));
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
++#define compat_access_ok(u,v,w) access_ok(v,w)
++#else
++#define compat_access_ok(u,v,w) access_ok(u,v,w)
++#endif
++
++ error = compat_access_ok(VERIFY_READ, value, sizeof(int));
+ if (error == 0)
+ return -EFAULT;
+
+ get_user(arg, (unsigned int *) value);
+ mval |= ((arg & TIOCM_RTS) ? DM_RTS : 0)
+@@ -3425,11 +3431,11 @@ dgrp_tty_ioctl(struct tty_struct *tty, u
+ * the break.
+ */
+ return 0;
+
+ case TIOCGSOFTCAR:
+- rc = access_ok(VERIFY_WRITE, (void *) arg, sizeof(long));
++ rc = compat_access_ok(VERIFY_WRITE, (void *) arg, sizeof(long));
+ if (rc == 0)
+ return -EFAULT;
+ put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+ return 0;
+
+@@ -3445,11 +3451,11 @@ dgrp_tty_ioctl(struct tty_struct *tty, u
+ (arg ? CLOCAL : 0));
+ #endif
+ return 0;
+
+ case TIOCMGET:
+- rc = access_ok(VERIFY_WRITE, (void *) arg,
++ rc = compat_access_ok(VERIFY_WRITE, (void *) arg,
+ sizeof(unsigned int));
+ if (rc == 0)
+ return -EFAULT;
+ return get_modem_info(ch, (unsigned int *) arg);
+
+@@ -3729,11 +3735,11 @@ dgrp_tty_ioctl(struct tty_struct *tty, u
+ ch->ch_xxoff = dflow.stopc;
+ }
+ break;
+
+ case DIGI_GETCUSTOMBAUD:
+- rc = access_ok(VERIFY_WRITE, (void *) arg, sizeof(int));
++ rc = compat_access_ok(VERIFY_WRITE, (void *) arg, sizeof(int));
+ if (rc == 0)
+ return -EFAULT;
+ put_user(ch->ch_custom_speed, (unsigned int *) arg);
+ break;
+
diff --git a/0003a-kernel-5.0.0-dgrp_mon_ops-access_ok.patch b/0003a-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
new file mode 100644
index 000000000000..a40362238935
--- /dev/null
+++ b/0003a-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
@@ -0,0 +1,194 @@
+diff -r -u5 driver/2.6.27o/dgrp_net_ops.c driver/2.6.27/dgrp_net_ops.c
+--- driver/2.6.27o/dgrp_net_ops.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_net_ops.c 2020-07-02 21:56:04.224066530 -0400
+@@ -4531,14 +4531,18 @@
+ nd = file->private_data;
+
+ dbg_net_trace(IOCTL, ("net ioctl(%p) start\n", nd));
+
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ if (_IOC_DIR(cmd) & _IOC_READ)
+ rtn = access_ok(VERIFY_WRITE, (void *) arg, size);
+ else if (_IOC_DIR(cmd) & _IOC_WRITE)
+ rtn = access_ok(VERIFY_READ, (void *) arg, size);
++#else
++ rtn = access_ok((void *) arg, size);
++#endif
+
+ if (rtn == 0)
+ goto done;
+
+ rtn = 0;
+diff -r -u5 driver/2.6.27o/dgrp_ports_ops.c driver/2.6.27/dgrp_ports_ops.c
+--- driver/2.6.27o/dgrp_ports_ops.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_ports_ops.c 2020-07-02 21:56:34.377310157 -0400
+@@ -516,11 +516,16 @@
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buf, len) == 0) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
++ if (access_ok(VERIFY_WRITE, buf, len) == 0)
++#else
++ if (access_ok(buf, len) == 0)
++#endif
++ {
+ res = -EFAULT;
+ goto done;
+ }
+
+ res = copy_to_user(buf, &linebuf[linepos], len);
+diff -r -u5 driver/2.6.27o/dgrp_specproc.c driver/2.6.27/dgrp_specproc.c
+--- driver/2.6.27o/dgrp_specproc.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_specproc.c 2020-07-02 21:56:49.193933873 -0400
+@@ -642,11 +642,15 @@
+ len = *lenp;
+
+ if (len > INBUFLEN - 1)
+ len = INBUFLEN - 1;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ if (access_ok(VERIFY_READ, buffer, len) == 0)
++#else
++ if (access_ok(buffer, len) == 0)
++#endif
+ return -EFAULT;
+
+ if (copy_from_user(inbuf, buffer, len))
+ return -EFAULT;
+
+@@ -729,11 +733,15 @@
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++#else
++ if (access_ok(buffer, len) == 0)
++#endif
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+@@ -1116,11 +1124,15 @@
+ len = *lenp;
+
+ if (len > INBUFLEN - 1)
+ len = INBUFLEN - 1;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ if (access_ok(VERIFY_READ, buffer, len) == 0)
++#else
++ if (access_ok(buffer, len) == 0)
++#endif
+ return -EFAULT;
+ if (copy_from_user(inbuf, buffer, len))
+ return -EFAULT;
+
+ inbuf[len] = 0;
+@@ -1322,11 +1334,15 @@
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++#else
++ if (access_ok(buffer, len) == 0)
++#endif
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+@@ -1431,11 +1447,15 @@
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++#else
++ if (access_ok(buffer, len) == 0)
++#endif
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+diff -r -u5 driver/2.6.27o/dgrp_tty.c driver/2.6.27/dgrp_tty.c
+--- driver/2.6.27o/dgrp_tty.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_tty.c 2020-07-02 21:56:18.577356760 -0400
+@@ -2992,11 +2992,15 @@
+ int error;
+ unsigned int arg;
+ int mval = 0;
+ ulong lock_flags;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ error = access_ok(VERIFY_READ, value, sizeof(int));
++#else
++ error = access_ok(value, sizeof(int));
++#endif
+ if (error == 0)
+ return -EFAULT;
+
+ get_user(arg, (unsigned int *) value);
+ mval |= ((arg & TIOCM_RTS) ? DM_RTS : 0)
+@@ -3425,11 +3429,15 @@
+ * the break.
+ */
+ return 0;
+
+ case TIOCGSOFTCAR:
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ rc = access_ok(VERIFY_WRITE, (void *) arg, sizeof(long));
++#else
++ rc = access_ok((void *) arg, sizeof(long));
++#endif
+ if (rc == 0)
+ return -EFAULT;
+ put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+ return 0;
+
+@@ -3445,12 +3453,16 @@
+ (arg ? CLOCAL : 0));
+ #endif
+ return 0;
+
+ case TIOCMGET:
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ rc = access_ok(VERIFY_WRITE, (void *) arg,
+ sizeof(unsigned int));
++#else
++ rc = access_ok((void *) arg, sizeof(unsigned int));
++#endif
+ if (rc == 0)
+ return -EFAULT;
+ return get_modem_info(ch, (unsigned int *) arg);
+
+ case TIOCMBIS:
+@@ -3729,11 +3741,15 @@
+ ch->ch_xxoff = dflow.stopc;
+ }
+ break;
+
+ case DIGI_GETCUSTOMBAUD:
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) && defined (VERIFY_WRITE)
+ rc = access_ok(VERIFY_WRITE, (void *) arg, sizeof(int));
++#else
++ rc = access_ok((void *) arg, sizeof(int));
++#endif
+ if (rc == 0)
+ return -EFAULT;
+ put_user(ch->ch_custom_speed, (unsigned int *) arg);
+ break;
+
diff --git a/0004-kernel-5.6-proc_dir_entry-proc_ops.patch b/0004-kernel-5.6-proc_dir_entry-proc_ops.patch
new file mode 100644
index 000000000000..3954964896be
--- /dev/null
+++ b/0004-kernel-5.6-proc_dir_entry-proc_ops.patch
@@ -0,0 +1,210 @@
+diff -pNaru5 driver/2.6.27.orig/dgrp_common.c driver/2.6.27/dgrp_common.c
+--- driver/2.6.27.orig/dgrp_common.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_common.c 2020-05-21 00:14:32.484255183 -0400
+@@ -610,21 +610,27 @@ void dgrp_tracef(const char *fmt, ...)
+ * Functions for creating and removing proc entries consistently
+ * across kernel versions.
+ *
+ *****************************************************************************/
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++#define DGRP_PROC_OPS proc_ops
++#else
++#define DGRP_PROC_OPS file_operations
++#endif
++
+ #include <linux/proc_fs.h>
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ struct proc_dir_entry *dgrp_create_proc_entry(const char *name, mode_t mode,
+ struct proc_dir_entry *parent)
+ {
+ return create_proc_entry(name, mode, parent);
+ }
+ #else
+ struct proc_dir_entry *dgrp_create_proc_entry(const char *name, mode_t mode,
+ struct proc_dir_entry *parent,
+- struct file_operations *fops,
++ struct DGRP_PROC_OPS *fops,
+ void *data)
+ {
+ return proc_create_data(name, mode, parent, fops, data);
+ }
+ #endif
+diff -pNaru5 driver/2.6.27.orig/dgrp_dpa_ops.c driver/2.6.27/dgrp_dpa_ops.c
+--- driver/2.6.27.orig/dgrp_dpa_ops.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_dpa_ops.c 2020-05-21 00:18:18.797589516 -0400
+@@ -86,18 +86,27 @@ static int dpa_chk_perm(struct inode *,
+ #else
+ static int dpa_chk_perm(struct inode *, int);
+ #endif
+ #endif
+
+-static struct file_operations dpa_ops = {
++static struct DGRP_PROC_OPS dpa_ops = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++ .proc_read = dgrp_dpa_read, /* read */
++ .proc_write = dgrp_dpa_write, /* write */
++ .proc_poll = dgrp_dpa_select, /* poll or select */
++ .proc_ioctl = dgrp_dpa_ioctl, /* ioctl */
++ .proc_open = dgrp_dpa_open, /* open */
++ .proc_release = dgrp_dpa_release, /* release */
++#else
+ .owner = THIS_MODULE, /* owner */
+ .read = dgrp_dpa_read, /* read */
+ .write = dgrp_dpa_write, /* write */
+ .poll = dgrp_dpa_select, /* poll or select */
+ .unlocked_ioctl = dgrp_dpa_ioctl, /* ioctl */
+ .open = dgrp_dpa_open, /* open */
+ .release = dgrp_dpa_release, /* release */
++#endif
+ };
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static struct inode_operations dpa_inode_ops = {
+ .permission = dpa_chk_perm
+diff -pNaru5 driver/2.6.27.orig/dgrp_mon_ops.c driver/2.6.27/dgrp_mon_ops.c
+--- driver/2.6.27.orig/dgrp_mon_ops.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_mon_ops.c 2020-05-21 00:19:47.094307603 -0400
+@@ -84,17 +84,25 @@ static int mon_chk_perm(struct inode *,
+ #else
+ static int mon_chk_perm(struct inode *, int);
+ #endif
+ #endif
+
+-static struct file_operations mon_ops = {
++static struct DGRP_PROC_OPS mon_ops = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++ .proc_read = dgrp_mon_read, /* read */
++ .proc_write = dgrp_mon_write, /* write */
++ .proc_ioctl = dgrp_mon_ioctl, /* ioctl */
++ .proc_open = dgrp_mon_open, /* open */
++ .proc_release = dgrp_mon_release, /* release */
++#else
+ .owner = THIS_MODULE, /* owner */
+ .read = dgrp_mon_read, /* read */
+ .write = dgrp_mon_write, /* write */
+ .unlocked_ioctl = dgrp_mon_ioctl, /* ioctl */
+ .open = dgrp_mon_open, /* open */
+ .release = dgrp_mon_release, /* release */
++#endif
+ };
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static struct inode_operations mon_inode_ops = {
+ .permission = mon_chk_perm
+diff -pNaru5 driver/2.6.27.orig/dgrp_net_ops.c driver/2.6.27/dgrp_net_ops.c
+--- driver/2.6.27.orig/dgrp_net_ops.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_net_ops.c 2020-05-21 00:21:01.311030489 -0400
+@@ -126,18 +126,27 @@ static int net_chk_perm(struct inode *,
+ #else
+ static int net_chk_perm(struct inode *, int);
+ #endif
+ #endif
+
+-static struct file_operations net_ops = {
++static struct DGRP_PROC_OPS net_ops = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++ .proc_read = dgrp_net_read, /* read */
++ .proc_write = dgrp_net_write, /* write */
++ .proc_poll = dgrp_net_select, /* poll or select */
++ .proc_ioctl = dgrp_net_ioctl, /* ioctl */
++ .proc_open = dgrp_net_open, /* open */
++ .proc_release = dgrp_net_release, /* release */
++#else
+ .owner = THIS_MODULE, /* owner */
+ .read = dgrp_net_read, /* read */
+ .write = dgrp_net_write, /* write */
+ .poll = dgrp_net_select, /* poll or select */
+ .unlocked_ioctl = dgrp_net_ioctl, /* ioctl */
+ .open = dgrp_net_open, /* open */
+ .release = dgrp_net_release, /* release */
++#endif
+ };
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static struct inode_operations net_inode_ops = {
+ .permission = net_chk_perm
+diff -pNaru5 driver/2.6.27.orig/dgrp_ports_ops.c driver/2.6.27/dgrp_ports_ops.c
+--- driver/2.6.27.orig/dgrp_ports_ops.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_ports_ops.c 2020-05-21 00:22:15.067761653 -0400
+@@ -81,16 +81,23 @@ static int ports_chk_perm(struct inode *
+ #else
+ static int ports_chk_perm(struct inode *, int);
+ #endif
+ #endif
+
+-static struct file_operations ports_ops = {
++static struct DGRP_PROC_OPS ports_ops = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++ .proc_read = dgrp_ports_read, /* read */
++ .proc_write = dgrp_ports_write, /* write */
++ .proc_open = dgrp_ports_open, /* open */
++ .proc_release = dgrp_ports_release /* release */
++#else
+ .owner = THIS_MODULE, /* owner */
+ .read = dgrp_ports_read, /* read */
+ .write = dgrp_ports_write, /* write */
+ .open = dgrp_ports_open, /* open */
+ .release = dgrp_ports_release /* release */
++#endif
+ };
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static struct inode_operations ports_inode_ops = {
+ .permission = ports_chk_perm
+diff -pNaru5 driver/2.6.27.orig/dgrp_specproc.c driver/2.6.27/dgrp_specproc.c
+--- driver/2.6.27.orig/dgrp_specproc.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_specproc.c 2020-05-21 00:23:53.674242899 -0400
+@@ -70,16 +70,23 @@ static int proc_chk_perm(struct inode *,
+ #else
+ static int proc_chk_perm(struct inode *, int);
+ #endif
+ #endif
+
+-struct file_operations dgrp_proc_file_ops = {
++struct DGRP_PROC_OPS dgrp_proc_file_ops = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++ .proc_read = dgrp_gen_proc_read, /* read */
++ .proc_write = dgrp_gen_proc_write, /* write */
++ .proc_open = dgrp_gen_proc_open, /* open */
++ .proc_release = dgrp_gen_proc_close, /* release */
++#else
+ .owner = THIS_MODULE, /* owner */
+ .read = dgrp_gen_proc_read, /* read */
+ .write = dgrp_gen_proc_write, /* write */
+ .open = dgrp_gen_proc_open, /* open */
+ .release = dgrp_gen_proc_close, /* release */
++#endif
+ };
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static struct inode_operations proc_inode_ops = {
+ .permission = proc_chk_perm
+diff -pNaru5 driver/2.6.27.orig/include/dgrp_common.h driver/2.6.27/include/dgrp_common.h
+--- driver/2.6.27.orig/include/dgrp_common.h 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/include/dgrp_common.h 2020-05-21 00:16:24.500892265 -0400
+@@ -295,18 +295,23 @@ int nd_struct_del(struct nd_struct *e
+
+ /*
+ * "proc" table manipulation functions
+ */
+ #include <linux/proc_fs.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++#define DGRP_PROC_OPS proc_ops
++#else
++#define DGRP_PROC_OPS file_operations
++#endif
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ struct proc_dir_entry *dgrp_create_proc_entry(const char *name, mode_t mode,
+ struct proc_dir_entry *parent);
+ void dgrp_remove_proc_entry(struct proc_dir_entry *pde);
+ #else
+ struct proc_dir_entry *dgrp_create_proc_entry(const char *name, mode_t mode,
+ struct proc_dir_entry *parent,
+- struct file_operations *fops,
++ struct DGRP_PROC_OPS *fops,
+ void *data);
+ void dgrp_remove_proc_entry(struct nd_struct *nd, struct proc_dir_entry *parent);
+ #endif
+
+ /*
diff --git a/0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch b/0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch
new file mode 100644
index 000000000000..22debe53cff8
--- /dev/null
+++ b/0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch
@@ -0,0 +1,18 @@
+diff -pNaru5 driver/2.6.27.orig/dgrp_driver.c driver/2.6.27/dgrp_driver.c
+--- driver/2.6.27.orig/dgrp_driver.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_driver.c 2021-06-29 19:07:04.558964855 -0400
+@@ -58,12 +58,13 @@ static char *version = DIGI_VERSION;
+ MODULE_LICENSE("GPL");
+ #endif
+
+ MODULE_AUTHOR("Digi International, http://www.digi.com");
+ MODULE_DESCRIPTION("RealPort driver for Digi's ethernet-based serial connectivity product line");
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0)
+ MODULE_SUPPORTED_DEVICE("dgrp");
+-
++#endif
+
+ /*
+ * insmod command line overrideable parameters
+ *
+ * NOTE: we use a set of macros to create the variables, which allows
diff --git a/0006-kernel-5.13-dropped-tty_check_change.patch b/0006-kernel-5.13-dropped-tty_check_change.patch
new file mode 100644
index 000000000000..00c672f9e2df
--- /dev/null
+++ b/0006-kernel-5.13-dropped-tty_check_change.patch
@@ -0,0 +1,17 @@
+diff -pNaru5 driver/2.6.27.orig/dgrp_tty.c driver/2.6.27/dgrp_tty.c
+--- driver/2.6.27.orig/dgrp_tty.c 2020-01-28 12:01:10.000000000 -0500
++++ driver/2.6.27/dgrp_tty.c 2021-08-10 14:00:21.627782755 -0400
+@@ -3246,10 +3246,13 @@ static int dgrp_tty_digisetedelay(struct
+ drp_param(ch);
+
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
++int tty_check_change(struct tty_struct *tty);
++#endif
+
+ /*
+ * The usual assortment of ioctl's
+ *
+ * note: use tty_check_change to make sure that we are not
diff --git a/0007-kernel-5.14-task_struct.state-unsigned-tty.patch b/0007-kernel-5.14-task_struct.state-unsigned-tty.patch
new file mode 100644
index 000000000000..7b596123f717
--- /dev/null
+++ b/0007-kernel-5.14-task_struct.state-unsigned-tty.patch
@@ -0,0 +1,142 @@
+diff -pNaru5 driver/2.6.27.orig/dgrp_common.c driver/2.6.27/dgrp_common.c
+--- driver/2.6.27.orig/dgrp_common.c 2021-09-12 14:45:27.901267870 -0400
++++ driver/2.6.27/dgrp_common.c 2021-09-12 14:49:02.969431475 -0400
+@@ -192,13 +192,13 @@ void *dgrp_kzmalloc(size_t size, int pri
+ *
+ * Returns 0 on success, !0 if interrupted
+ */
+ int dgrp_sleep(ulong ticks)
+ {
+- current->state = TASK_INTERRUPTIBLE;
++ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(ticks);
+- current->state = TASK_RUNNING;
++ set_current_state(TASK_RUNNING);
+ return signal_pending(current);
+ }
+
+
+
+diff -pNaru5 driver/2.6.27.orig/dgrp_tty.c driver/2.6.27/dgrp_tty.c
+--- driver/2.6.27.orig/dgrp_tty.c 2021-09-12 14:45:27.904601276 -0400
++++ driver/2.6.27/dgrp_tty.c 2021-09-12 14:48:48.089087547 -0400
+@@ -107,13 +107,21 @@ static void dgrp_tty_input_stop(struct t
+ static void drp_wmove(struct ch_struct *, int, void*, int);
+
+ static int dgrp_tty_open(struct tty_struct *, struct file *);
+ static void dgrp_tty_close(struct tty_struct *, struct file *);
+ static int dgrp_tty_write(struct tty_struct *, const unsigned char *, int);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgrp_tty_write_room(struct tty_struct *);
++#else
+ static int dgrp_tty_write_room(struct tty_struct *);
++#endif
+ static void dgrp_tty_flush_buffer(struct tty_struct *);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgrp_tty_chars_in_buffer(struct tty_struct *);
++#else
+ static int dgrp_tty_chars_in_buffer(struct tty_struct *);
++#endif
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+ static int dgrp_tty_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long);
+ #else
+ static int dgrp_tty_ioctl(struct tty_struct *, unsigned int, unsigned long);
+ #endif
+@@ -733,11 +741,12 @@ static int drp_wait_ack(struct ch_struct
+ * Prepare the task to accept the wakeup, then
+ * release our locks and release control.
+ */
+
+ add_wait_queue(&nd->nd_seq_wque[in], &wait);
+- current->state = TASK_INTERRUPTIBLE;
++ /* We'll retroactively apply this patch to support non Intel processors.*/
++ set_current_state(TASK_INTERRUPTIBLE);
+
+ DGRP_UNLOCK(nd->nd_lock, *lock_flags);
+
+ /*
+ * Give up control, we'll come back if we're
+@@ -765,11 +774,11 @@ if (ttylock) tty_lock(ch->port.tty);
+
+ remove_wait_queue(&nd->nd_seq_wque[in], &wait);
+
+ DGRP_LOCK(nd->nd_lock, *lock_flags);
+
+- current->state = TASK_RUNNING;
++ set_current_state(TASK_RUNNING);
+
+ if (signal_pending(current))
+ return -EINTR;
+
+ if (nd->nd_seq_wait[in] == 0)
+@@ -816,11 +825,11 @@ static void drp_my_sleep(struct ch_struc
+ /*
+ * First make sure we're ready to receive the wakeup.
+ */
+
+ add_wait_queue(&ch->ch_sleep, &wait);
+- current->state = TASK_UNINTERRUPTIBLE;
++ set_current_state(TASK_UNINTERRUPTIBLE);
+
+ /*
+ * Since we are uninterruptible, set a timer to
+ * unset the uninterruptable state in 1 second.
+ */
+@@ -1210,11 +1219,11 @@ static int dgrp_tty_open(struct tty_stru
+ * Prepare the task to accept the wakeup, then
+ * release our locks and release control.
+ */
+
+ add_wait_queue(&ch->ch_flag_wait, &wait);
+- current->state = TASK_INTERRUPTIBLE;
++ set_current_state(TASK_INTERRUPTIBLE);
+
+ DGRP_UNLOCK(nd->nd_lock, lock_flags);
+
+ /*
+ * Give up control, we'll come back if we're
+@@ -1247,11 +1256,11 @@ static int dgrp_tty_open(struct tty_stru
+ dbg_tty_trace(OPEN, ("tty open (%x) awake\n",
+ MINOR(tty_devnum(tty))));
+
+ DGRP_LOCK(nd->nd_lock, lock_flags);
+
+- current->state = TASK_RUNNING;
++ set_current_state(TASK_RUNNING);
+
+ ch->ch_wait_count[otype]--;
+
+ if (wait_carrier)
+ ch->ch_wait_carrier--;
+@@ -2484,11 +2493,15 @@ static void dgrp_tty_flush_buffer(struct
+
+ /*
+ * Return space available in Tx buffer
+ * count = ( ch->ch_tout - ch->ch_tin ) mod (TBUF_MAX - 1)
+ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgrp_tty_write_room(struct tty_struct *tty)
++#else
+ static int dgrp_tty_write_room(struct tty_struct *tty)
++#endif
+ {
+ struct un_struct *un;
+ struct ch_struct *ch;
+ int count;
+
+@@ -2534,11 +2547,15 @@ static int dgrp_tty_write_room(struct tt
+ *
+ * Remember that sequence number math is always with a sixteen bit
+ * mask, not the TBUF_MASK.
+ */
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++static unsigned int dgrp_tty_chars_in_buffer(struct tty_struct *tty)
++#else
+ static int dgrp_tty_chars_in_buffer(struct tty_struct *tty)
++#endif
+ {
+ struct un_struct *un;
+ struct ch_struct *ch;
+ int count;
+ int count1;
diff --git a/0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch b/0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch
new file mode 100644
index 000000000000..729e9db28d26
--- /dev/null
+++ b/0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch
@@ -0,0 +1,81 @@
+diff -pNaru5 driver/2.6.27.orig/dgrp_tty.c driver/2.6.27/dgrp_tty.c
+--- driver/2.6.27.orig/dgrp_tty.c 2021-11-20 14:56:04.993491404 -0500
++++ driver/2.6.27/dgrp_tty.c 2021-11-20 14:57:49.520506448 -0500
+@@ -4105,11 +4105,11 @@ dgrp_tty_uninit(struct nd_struct *nd)
+
+ if (nd->nd_serial_ttdriver->ttys) {
+ kfree(nd->nd_serial_ttdriver->ttys);
+ nd->nd_serial_ttdriver->ttys = NULL;
+ }
+- put_tty_driver(nd->nd_serial_ttdriver);
++ tty_driver_kref_put(nd->nd_serial_ttdriver);
+ nd->nd_ttdriver_flags &= ~SERIAL_TTDRV_REG;
+ }
+
+ if (nd->nd_ttdriver_flags & CALLOUT_TTDRV_REG) {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+@@ -4121,11 +4121,11 @@ dgrp_tty_uninit(struct nd_struct *nd)
+
+ if (nd->nd_callout_ttdriver->ttys) {
+ kfree(nd->nd_callout_ttdriver->ttys);
+ nd->nd_callout_ttdriver->ttys = NULL;
+ }
+- put_tty_driver(nd->nd_callout_ttdriver);
++ tty_driver_kref_put(nd->nd_callout_ttdriver);
+ nd->nd_ttdriver_flags &= ~CALLOUT_TTDRV_REG;
+ }
+
+ if (nd->nd_ttdriver_flags & XPRINT_TTDRV_REG) {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+@@ -4137,11 +4137,11 @@ dgrp_tty_uninit(struct nd_struct *nd)
+
+ if (nd->nd_xprint_ttdriver->ttys) {
+ kfree(nd->nd_xprint_ttdriver->ttys);
+ nd->nd_xprint_ttdriver->ttys = NULL;
+ }
+- put_tty_driver(nd->nd_xprint_ttdriver);
++ tty_driver_kref_put(nd->nd_xprint_ttdriver);
+ nd->nd_ttdriver_flags &= ~XPRINT_TTDRV_REG;
+ }
+
+ dbg_tty_trace(UNINIT, ("tty uninit: done\n"));
+ }
+@@ -4163,11 +4163,11 @@ dgrp_tty_init(struct nd_struct *nd)
+
+ /*
+ * Initialize the TTDRIVER structures.
+ */
+
+- nd->nd_serial_ttdriver = alloc_tty_driver(CHAN_MAX);
++ nd->nd_serial_ttdriver = tty_alloc_driver(CHAN_MAX,0);
+ sprintf(nd->nd_serial_name, "tty_dgrp_%s_", id);
+
+ nd->nd_serial_ttdriver->owner = THIS_MODULE;
+ nd->nd_serial_ttdriver->name = nd->nd_serial_name;
+ nd->nd_serial_ttdriver->name_base = 0;
+@@ -4227,11 +4227,11 @@ dgrp_tty_init(struct nd_struct *nd)
+ }
+ }
+ nd->nd_ttdriver_flags |= SERIAL_TTDRV_REG;
+ }
+
+- nd->nd_callout_ttdriver = alloc_tty_driver(CHAN_MAX);
++ nd->nd_callout_ttdriver = tty_alloc_driver(CHAN_MAX,0);
+ sprintf(nd->nd_callout_name, "cu_dgrp_%s_", id);
+
+ nd->nd_callout_ttdriver->owner = THIS_MODULE;
+ nd->nd_callout_ttdriver->name = nd->nd_callout_name;
+ nd->nd_callout_ttdriver->name_base = 0;
+@@ -4268,11 +4268,11 @@ dgrp_tty_init(struct nd_struct *nd)
+ nd->nd_ttdriver_flags |= CALLOUT_TTDRV_REG;
+ }
+ }
+
+
+- nd->nd_xprint_ttdriver = alloc_tty_driver(CHAN_MAX);
++ nd->nd_xprint_ttdriver = tty_alloc_driver(CHAN_MAX,0);
+ sprintf(nd->nd_xprint_name, "pr_dgrp_%s_", id);
+
+ nd->nd_xprint_ttdriver->owner = THIS_MODULE;
+ nd->nd_xprint_ttdriver->name = nd->nd_xprint_name;
+ nd->nd_xprint_ttdriver->name_base = 0;
diff --git a/0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch b/0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch
new file mode 100644
index 000000000000..c62f62fcdde1
--- /dev/null
+++ b/0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch
@@ -0,0 +1,21 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_tty.c b/driver/2.6.27/dgrp_tty.c
+--- a/driver/2.6.27/dgrp_tty.c 2022-01-16 22:20:11.863319323 -0500
++++ b/driver/2.6.27/dgrp_tty.c 2022-01-16 22:21:00.024125434 -0500
+@@ -325,15 +325,17 @@ static void drp_param(struct ch_struct *
+ * Determine if FAST writes can be performed.
+ */
+
+ if ((ch->ch_digi.digi_flags & DIGI_COOK) != 0 &&
+ (ch->ch_tun.un_open_count != 0) &&
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,16,0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+ !((un->un_tty)->ldisc->ops->flags & LDISC_FLAG_DEFINED) &&
+ #else
+ !((un->un_tty)->ldisc.ops->flags & LDISC_FLAG_DEFINED) &&
+ #endif
++#endif
+ !(L_XCASE(un->un_tty))) {
+ ch->ch_flag |= CH_FAST_WRITE;
+ } else {
+ ch->ch_flag &= ~CH_FAST_WRITE;
+ }
diff --git a/0010-kernel-5.17-change-PDE_DATA.patch b/0010-kernel-5.17-change-PDE_DATA.patch
new file mode 100644
index 000000000000..800ce09459d1
--- /dev/null
+++ b/0010-kernel-5.17-change-PDE_DATA.patch
@@ -0,0 +1,119 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_dpa_ops.c b/driver/2.6.27/dgrp_dpa_ops.c
+--- a/driver/2.6.27/dgrp_dpa_ops.c 2022-06-05 01:06:30.412698077 -0400
++++ b/driver/2.6.27/dgrp_dpa_ops.c 2022-06-05 01:06:56.105865450 -0400
+@@ -332,10 +332,12 @@ static int dgrp_dpa_open(struct inode *i
+ if (!de) {
+ rtn = -ENXIO;
+ goto done;
+ }
+ nd = (struct nd_struct *)de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ nd = pde_data(inode);
+ #else
+ nd = (struct nd_struct *)PDE_DATA(inode);
+ #endif
+ if (!nd) {
+ rtn = -ENXIO;
+diff -pNaru5 a/driver/2.6.27/dgrp_mon_ops.c b/driver/2.6.27/dgrp_mon_ops.c
+--- a/driver/2.6.27/dgrp_mon_ops.c 2022-06-05 01:06:30.412698077 -0400
++++ b/driver/2.6.27/dgrp_mon_ops.c 2022-06-05 01:07:32.049073042 -0400
+@@ -294,10 +294,12 @@ static int dgrp_mon_open(struct inode *i
+ if (!de) {
+ rtn = -ENXIO;
+ goto done;
+ }
+ nd = (struct nd_struct *)de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ nd = pde_data(inode);
+ #else
+ nd = (struct nd_struct *)PDE_DATA(inode);
+ #endif
+ if (!nd) {
+ rtn = -ENXIO;
+diff -pNaru5 a/driver/2.6.27/dgrp_net_ops.c b/driver/2.6.27/dgrp_net_ops.c
+--- a/driver/2.6.27/dgrp_net_ops.c 2022-06-05 01:06:30.412698077 -0400
++++ b/driver/2.6.27/dgrp_net_ops.c 2022-06-05 01:07:45.312388401 -0400
+@@ -1485,10 +1485,12 @@ static int dgrp_net_open(struct inode *i
+ rtn = -ENXIO;
+ goto done;
+ }
+
+ nd = (struct nd_struct *) de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ nd = pde_data(inode);
+ #else
+ nd = (struct nd_struct *) PDE_DATA(inode);
+
+ #endif
+ if (!nd) {
+diff -pNaru5 a/driver/2.6.27/dgrp_ports_ops.c b/driver/2.6.27/dgrp_ports_ops.c
+--- a/driver/2.6.27/dgrp_ports_ops.c 2022-06-05 01:06:30.416031385 -0400
++++ b/driver/2.6.27/dgrp_ports_ops.c 2022-06-05 01:07:57.855717730 -0400
+@@ -284,10 +284,12 @@ static int dgrp_ports_open(struct inode
+ if (!de) {
+ rtn = -ENXIO;
+ goto done;
+ }
+ nd = (struct nd_struct *)de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ nd = pde_data(inode);
+ #else
+ nd = (struct nd_struct *)PDE_DATA(inode);
+ #endif
+ if (!nd) {
+ rtn = -ENXIO;
+diff -pNaru5 a/driver/2.6.27/dgrp_specproc.c b/driver/2.6.27/dgrp_specproc.c
+--- a/driver/2.6.27/dgrp_specproc.c 2022-06-05 01:06:30.416031385 -0400
++++ b/driver/2.6.27/dgrp_specproc.c 2022-06-05 01:09:03.378681962 -0400
+@@ -467,10 +467,12 @@ static int dgrp_gen_proc_open(struct ino
+ ret = -ENXIO;
+ goto done;
+ }
+
+ entry = (struct dgrp_proc_entry *) de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ entry = pde_data(file_inode(file));
+ #else /* >=3,10,0 */
+ entry = (struct dgrp_proc_entry *) PDE_DATA(file_inode(file));
+ #endif
+ if (!entry) {
+ ret = -ENXIO;
+@@ -512,10 +514,12 @@ static int dgrp_gen_proc_close(struct in
+ if (!de || !de->data) {
+ goto done;
+ }
+
+ entry = (struct dgrp_proc_entry *) de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ entry = pde_data(file_inode(file));
+ #else /* >=3,10,0 */
+ entry = (struct dgrp_proc_entry *) PDE_DATA(file_inode(file));
+ #endif
+ if (!entry)
+ goto done;
+@@ -548,10 +552,12 @@ static ssize_t dgrp_gen_proc_read(struct
+ #endif
+ if (!de || !de->data)
+ return -ENXIO;
+
+ entry = (struct dgrp_proc_entry *) de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ entry = pde_data(file_inode(file));
+ #else /* >=3,10,0 */
+ entry = (struct dgrp_proc_entry *) PDE_DATA(file_inode(file));
+ #endif
+ if (!entry)
+ return -ENXIO;
+@@ -589,10 +595,12 @@ static ssize_t dgrp_gen_proc_write(struc
+ #endif
+ if (!de || !de->data)
+ return-ENXIO;
+
+ entry = (struct dgrp_proc_entry *) de->data;
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ entry = pde_data(file_inode(file));
+ #else /* >=3,10,0 */
+ entry = (struct dgrp_proc_entry *) PDE_DATA(file_inode(file));
+ #endif
+ if (!entry)
+ return -ENXIO;
diff --git a/0011-kernel-6.1-remove-TTY_MAGIC.patch b/0011-kernel-6.1-remove-TTY_MAGIC.patch
new file mode 100644
index 000000000000..cde614580ae2
--- /dev/null
+++ b/0011-kernel-6.1-remove-TTY_MAGIC.patch
@@ -0,0 +1,45 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_net_ops.c b/driver/2.6.27/dgrp_net_ops.c
+--- a/driver/2.6.27/dgrp_net_ops.c 2022-11-02 12:57:58.000000000 -0400
++++ b/driver/2.6.27/dgrp_net_ops.c 2023-01-03 01:32:48.395681042 -0500
+@@ -531,11 +531,11 @@ static void dgrp_input(struct ch_struct
+ }
+
+ tty = (ch->ch_tun).un_tty;
+
+
+- if (!tty || tty->magic != TTY_MAGIC) {
++ if (!tty || !tty->ldisc) {
+ ch->ch_rout = ch->ch_rin;
+ DGRP_UNLOCK(nd->nd_lock, lock_flags);
+ dbg_net_trace(INPUT, ("bad tty struct, discarding input data\n"));
+ return;
+ }
+diff -pNaru5 a/driver/2.6.27/dgrp_tty.c b/driver/2.6.27/dgrp_tty.c
+--- a/driver/2.6.27/dgrp_tty.c 2022-11-02 12:57:58.000000000 -0400
++++ b/driver/2.6.27/dgrp_tty.c 2023-01-03 01:32:20.776597151 -0500
+@@ -3236,11 +3236,11 @@ static int dgrp_tty_digigetedelay(struct
+ int tmp;
+
+ if (!retinfo)
+ return -EFAULT;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return -EFAULT;
+
+ un = tty->driver_data;
+
+ if (!un)
+@@ -3271,11 +3271,11 @@ static int dgrp_tty_digisetedelay(struct
+ {
+ struct un_struct *un;
+ struct ch_struct *ch;
+ int new_digi;
+
+- if (!tty || tty->magic != TTY_MAGIC)
++ if (!tty || !tty->ldisc)
+ return -EFAULT;
+
+ un = tty->driver_data;
+
+ if (!un)
diff --git a/0012-kernel-6.1-INIT_C_CC-termios_internal.patch b/0012-kernel-6.1-INIT_C_CC-termios_internal.patch
new file mode 100644
index 000000000000..9674febfde17
--- /dev/null
+++ b/0012-kernel-6.1-INIT_C_CC-termios_internal.patch
@@ -0,0 +1,19 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_tty.c b/driver/2.6.27/dgrp_tty.c
+--- a/driver/2.6.27/dgrp_tty.c 2023-01-03 01:50:17.756406551 -0500
++++ b/driver/2.6.27/dgrp_tty.c 2023-01-03 01:50:45.197687357 -0500
+@@ -60,11 +60,15 @@
+ #else
+ #include <linux/sched/signal.h> /* For in_egroup_p() and signal_pending() */
+ #endif
+
+ #include <linux/serial.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
+ #include <linux/termios.h>
++#else
++#include <linux/termios_internal.h>
++#endif
+ #include <linux/delay.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ #include <linux/slab.h>
+ #endif
+
diff --git a/0013-kernel-6.0-set_termios-const-ktermios.patch b/0013-kernel-6.0-set_termios-const-ktermios.patch
new file mode 100644
index 000000000000..c499262e9cac
--- /dev/null
+++ b/0013-kernel-6.0-set_termios-const-ktermios.patch
@@ -0,0 +1,35 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_tty.c b/driver/2.6.27/dgrp_tty.c
+--- a/driver/2.6.27/dgrp_tty.c 2023-01-03 01:55:00.701769691 -0500
++++ b/driver/2.6.27/dgrp_tty.c 2023-01-03 01:57:04.319274515 -0500
+@@ -124,11 +124,15 @@ static void dgrp_tty_flush_buffer(struct
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+ static int dgrp_tty_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long);
+ #else
+ static int dgrp_tty_ioctl(struct tty_struct *, unsigned int, unsigned long);
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
+ static void dgrp_tty_set_termios(struct tty_struct *, struct ktermios *);
++#else
++static void dgrp_tty_set_termios(struct tty_struct *, const struct ktermios *);
++#endif
+ static void dgrp_tty_stop(struct tty_struct *);
+ static void dgrp_tty_start(struct tty_struct *);
+ static void dgrp_tty_throttle(struct tty_struct *);
+ static void dgrp_tty_unthrottle(struct tty_struct *);
+ static void dgrp_tty_hangup(struct tty_struct *);
+@@ -3836,11 +3840,15 @@ __attribute__ ((__fallthrough__));
+ * and try to do something rational.
+ *
+ * So we need to make sure that our copies of ch_oflag,
+ * ch_clag, and ch_iflag reflect the tty->termios flags.
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
+ static void dgrp_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
++#else
++static void dgrp_tty_set_termios(struct tty_struct *tty, const struct ktermios *old)
++#endif
+ {
+ struct ktermios *ts;
+ struct ch_struct *ch;
+ struct un_struct *un;
+
diff --git a/0014-kernel-6.6-struct-tty_operations-size_t.patch b/0014-kernel-6.6-struct-tty_operations-size_t.patch
new file mode 100644
index 000000000000..bdb43c99f995
--- /dev/null
+++ b/0014-kernel-6.6-struct-tty_operations-size_t.patch
@@ -0,0 +1,35 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_tty.c b/driver/2.6.27/dgrp_tty.c
+--- a/driver/2.6.27/dgrp_tty.c 2023-12-18 20:56:27.737442928 -0500
++++ b/driver/2.6.27/dgrp_tty.c 2023-12-18 20:56:42.854022036 -0500
+@@ -110,11 +110,15 @@ static void dgrp_tty_input_stop(struct t
+
+ static void drp_wmove(struct ch_struct *, int, void*, int);
+
+ static int dgrp_tty_open(struct tty_struct *, struct file *);
+ static void dgrp_tty_close(struct tty_struct *, struct file *);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,6,0)
+ static int dgrp_tty_write(struct tty_struct *, const unsigned char *, int);
++#else
++static ssize_t dgrp_tty_write(struct tty_struct *, const unsigned char *, size_t);
++#endif
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)
+ static int dgrp_tty_write_room(struct tty_struct *);
+ static int dgrp_tty_chars_in_buffer(struct tty_struct *);
+ #else
+ static unsigned int dgrp_tty_write_room(struct tty_struct *);
+@@ -1963,11 +1967,15 @@ static int dgrp_calculate_txprint_bounds
+
+ return space;
+ }
+
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,6,0)
+ static int dgrp_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
++#else
++static ssize_t dgrp_tty_write(struct tty_struct *tty, const unsigned char *buf, size_t count)
++#endif
+ {
+ struct nd_struct *nd;
+ struct un_struct *un;
+ struct ch_struct *ch;
+ int space;
diff --git a/0015-kernel-6.4-class_create-1arg.patch b/0015-kernel-6.4-class_create-1arg.patch
new file mode 100644
index 000000000000..3af095139d60
--- /dev/null
+++ b/0015-kernel-6.4-class_create-1arg.patch
@@ -0,0 +1,19 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_sysfs.c b/driver/2.6.27/dgrp_sysfs.c
+--- a/driver/2.6.27/dgrp_sysfs.c 2022-11-02 12:57:58.000000000 -0400
++++ b/driver/2.6.27/dgrp_sysfs.c 2023-12-18 21:02:23.102079937 -0500
+@@ -189,11 +189,15 @@ static struct attribute_group dgrp_globa
+ void dgrp_create_class_sysfs_files(void)
+ {
+ int ret = 0;
+ int max_majors = 1U << (32 - MINORBITS);
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
+ dgrp_class = class_create(THIS_MODULE, "digi_realport");
++#else
++ dgrp_class = class_create("digi_realport");
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)
+ ret = class_create_file(dgrp_class, &class_attr_driver_version.attr);
+ #else
+ ret = class_create_file(dgrp_class, &class_attr_driver_version);
+ #endif
diff --git a/0016-0006-kernel-5.10-dropped-tty_check_change.patch b/0016-0006-kernel-5.10-dropped-tty_check_change.patch
new file mode 100644
index 000000000000..e9057f7139df
--- /dev/null
+++ b/0016-0006-kernel-5.10-dropped-tty_check_change.patch
@@ -0,0 +1,16 @@
+diff -pNaru5 a/driver/2.6.27/dgrp_tty.c b/driver/2.6.27/dgrp_tty.c
+--- a/driver/2.6.27/dgrp_tty.c 2023-12-18 21:37:04.585172106 -0500
++++ b/driver/2.6.27/dgrp_tty.c 2023-12-18 21:38:48.197717779 -0500
+@@ -149,11 +149,11 @@ static int dgrp_tty_tiocmget(struct tty_
+ static int dgrp_tty_tiocmset(struct tty_struct *, unsigned int, unsigned int);
+ #endif
+ static int dgrp_tty_send_break(struct tty_struct *, int);
+ static void dgrp_tty_send_xchar(struct tty_struct *, char);
+
+-#if LINUX_VERSION_CODE > KERNEL_VERSION(5,12,19)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,180)
+ /* they decided that tty_check_change was internal to tty subsystem and
+ * no longer export it; now its down in kernel/driver/tty/.. So far the symbol is still
+ * visible though, so can get away with a local decl.
+ */
+ int tty_check_change(struct tty_struct *t);
diff --git a/PKGBUILD b/PKGBUILD
index ca323ca83305..90a14144f4eb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,12 +4,12 @@
# Todo: add systemd getty support to drpadmin
# Todo: Default user, group, and mode are in the backing store. These do not work. They are set by udev and apply to all ports.
# Digi bug: terminal freezes when viewing /proc/dgrp/mon
-# Digi bug: drpd terminates after the first tty open when launched from dgrp_cfg_node. It stays working when launched by systemd restart
-# Digi bug: occasional Can't open serial /dev/ttyaf00: Resource temporarily unavailable for PortServer TS (not II)
-# Digi bug: occasional dropped characters for PortServer II, PortServer TS, Digi One
+# (fixed) Digi bug: drpd terminates after the first tty open when launched from dgrp_cfg_node. It stays working when launched by systemd restart
+# (hardware) Digi bug: occasional Can't open serial /dev/ttyaf00: Resource temporarily unavailable for PortServer TS (not II)
+# (hardware) Digi bug: occasional dropped characters for PortServer II, PortServer TS, Digi One
# Digi bug: Digi RealPort Manager (java) is unable to add new Realport because it uses the wrong options
# Digi bug: mbrowse reports a few parsing errors in MIB
-# Digi bug: make compatible with OpenSSL 1.1
+# (fixed) Digi bug: make compatible with OpenSSL 1.1
# Digi bug: transfer hangs if unit is repowered during live connection. Tested in 4.11, 4.9, and 4.4
# Digi bug: tty* takes up to an hour to reappear after unit is powered up after a long time being off
# Nov 29 06:16:50 springport drpd[715]: drpd(ag,128.0.0.92) Cannot connect to server - Connection timed out
@@ -22,8 +22,8 @@
# Nov 29 13:48:25 springport drpd[715]: drpd(ag,128.0.0.92) Cannot connect to server - Connection timed out
# Nov 29 14:52:56 springport drpd[715]: drpd(ag,128.0.0.92) Cannot connect to server - Connection timed out
# Nov 29 15:57:26 springport drpd[715]: drpd(ag,128.0.0.92) Cannot connect to server - Connection timed out
-# Arch Kernel 4.16: do_IRQ: 7.36 No irq handler for vector
-# does not occur in Manjaro Kernel 4.16
+# Digi bug: connect hangs for 15 minutes if no network connection to unit. Tested in 1.9-38..40
+# Digi bug: backing store is rewritten on every service start which can cause loss of config
# Digi Realport driver for Arch Linux. See Digi release notes for supported products.
@@ -57,7 +57,7 @@ _opt_RealPort='RealPort' # Can also be Realport
_opt_DKMS=1 # This can be toggled between installs
-_opt_SSL10=1
+#export KERNELRELEASE="$(basename $(dirname /usr/lib/modules/5.10.*/modules.alias))"
# Since the kernel module isn't loaded until you have a device
# configured, these services are automatically enabled and started
@@ -104,15 +104,22 @@ set -u
pkgname='dgrp'
#_pkgver='1.9-36'; _dl='81000137_X.tgz'
#_pkgver='1.9-38'; _dl='81000137_Y.tgz'
-_pkgver='1.9-39'; _dl='40002086_Z.tgz'
+#_pkgver='1.9-39'; _dl='40002086_Z.tgz'
+#_pkgver='1.9-40'; _dl='40002086_AA.tgz'
+_pkgver='1.9-41'; _dl='40002086_AB.tgz'
pkgver="${_pkgver//-/.}"
-pkgrel='1'
+pkgrel='2'
pkgdesc="tty driver for Digi ${_opt_RealPort} ConnectPort EtherLite Flex One CM PortServer TS IBM RAN serial console terminal servers"
#_pkgdescshort="Digi ${_opt_RealPort} driver for Ethernet serial servers" # For when we used to generate the autorebuild from here
arch=('i686' 'x86_64')
url='https://www.digi.com/'
license=('GPL' 'custom') # OpenSSL=Apache. Arch is always new enough to not need their version.
depends=('grep' 'awk' 'systemd' 'procps-ng' 'psmisc' 'perl')
+if [ "$(vercmp "${pkgver}" '1.9.39')" -le 0 ]; then
+ _opt_SSL10=1
+else
+ _opt_SSL10=0
+fi
if [ "${_opt_SSL10}" -ne 0 ]; then
depends+=('openssl-1.0')
fi
@@ -177,19 +184,87 @@ _srcdir="dgrp-${_filever%%-*}"
source=(
#"${pkgname}-${pkgver}-81000137_X.tgz::http://ftp1.digi.com/support/driver/81000137_X.tgz"
#"${pkgname}-${pkgver}-beta.tgz::ftp://ftp1.digi.com/support/driver/RealPort%20Linux%20Beta%20Driver/dgrp-${_filever}_y1p.tgz.rpm"
- "${pkgname##*-}-${pkgver}-${_dl}::http://ftp1.digi.com/support/driver/${_dl}"
+ #"${pkgname##*-}-${pkgver}-${_dl}::http://ftp1.digi.com/support/driver/${_dl}"
+ "${pkgname##*-}-${pkgver}-${_dl}::https://hub.digi.com/dp/path=/support/asset/realport-driver-for-linux-tgz/"
'drpadmin' 'drpadmin.1' # "autorebuild-${pkgname}.sh"
'addp_perl-1.0.tgz::https://github.com/severach/addp/archive/f92a6fd2050c9f32a5a11cac18cd9def78138530.tar.gz'
'ftp://ftp1.digi.com/support/utilities/AddpClient.zip'
"${_mibs[@]/#/${_mibsrc}}"
- #'0000-Kernel-4-13-CLASS_ATTR_STRING.patch' # https://www.digi.com/support/forum/67157/realport-compile-error-with-fedora-27-kernel-4-14-14 https://www.digi.com/support/forum/65817/class_attr_driver_version-error-compiling-in-kernel-4-13
- #'0001-Kernel-4-15-timers.patch' # https://forum.blackmagicdesign.com/viewtopic.php?uid=16&f=3&t=68382&start=0
+ # 'a' versions are by Digi from next version
+ '0000'{,a}'-Kernel-4-13-CLASS_ATTR_STRING.patch' # https://www.digi.com/support/forum/67157/realport-compile-error-with-fedor'{,a}'-27-kernel-4-14-14 https://www.digi.com/support/forum/65817/class_attr_driver_version-error-compiling-in-kernel-4-13
+ '0001'{,a}'-Kernel-4-15-timers.patch' # https://forum.blackmagicdesign.com/viewtopic.php?uid=16&f=3&t=68382&start=0
+ '0002'{,a}'-kernel-5.0.0-do_gettimeofday.patch'
+ '0003'{,a}'-kernel-5.0.0-dgrp_mon_ops-access_ok.patch' # https://lkml.org/lkml/2019/1/4/418
+ '0004-kernel-5.6-proc_dir_entry-proc_ops.patch'
+ '0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch'
+ '0006-kernel-5.13-dropped-tty_check_change.patch'
+ '0007-kernel-5.14-task_struct.state-unsigned-tty.patch'
+ '0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch'
+ '0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch'
+ '0010-kernel-5.17-change-PDE_DATA.patch'
+ '0011-kernel-6.1-remove-TTY_MAGIC.patch'
+ '0012-kernel-6.1-INIT_C_CC-termios_internal.patch'
+ '0013-kernel-6.0-set_termios-const-ktermios.patch'
+ '0014-kernel-6.6-struct-tty_operations-size_t.patch'
+ '0015-kernel-6.4-class_create-1arg.patch'
+ '0016-0006-kernel-5.10-dropped-tty_check_change.patch'
)
unset _mibsrc
#source_i686=('http://ftp1.digi.com/support/utilities/40002890_A.tgz')
#source_x86_64=('http://ftp1.digi.com/support/utilities/40002889_A.tgz') # compiled i686 therefore worthless
# addp and sddp are incomplete. I replaced them with addp.pl
-sha256sums=('0db5204cc7d7806fde39b5ea7b6a465b4310739c380d7330131956e63af0f137'
+md5sums=('df7d7093759350208fbe5abf5ceb27de'
+ 'b4af5022ba96fcc2429263cfbbe85bae'
+ '9feebec170552c9186e713e7f5852e14'
+ 'e9ae823e597f2b63d95e6d6a8e25cde3'
+ '1b6491756c123234035c053baab1607c'
+ '4dbc892ea6247057db2fe613391f9b02'
+ '2e516af8bbe96b6d2137a106941d4223'
+ 'f404ac48baee06c5fbd7efab157704e9'
+ 'da3b2a1c78d981940afea9bd2da4bf96'
+ 'd824adbace7a52ed4a08ec2b3101b10f'
+ '749a347ec350ac9ca5895ae4d0e2ca24'
+ 'feab0142fc161c7705e6a3a12a410f35'
+ 'ee66f700bdb828cfc916f1bd2fd9dc1a'
+ '2a321009c37ea6070607d1f1b97de84d'
+ '067d79acafc0eb32f809390fe1a9374e'
+ '276d710e355e24ea6635bb23a3dd46d0'
+ '0549b35492fb3e2dbee52b1ea7790a25'
+ 'f04c8e15255d115c05631845232e858a'
+ 'c1fa6b3f533da1bbf05c5be268ec9aba'
+ 'de6faa945f2816191f558df38a1ac917'
+ '9495d5154f4d03fdd994922220dd1f2f'
+ '5fc7f819bca1d5ebfc8e4d06a744cb77'
+ '09ad1cc83d31f7365992d3f974fde6d5'
+ '89545a33c5df6304b6c8e288a4019d54'
+ 'bc469a335d5b1a7986a93327a3b6f57b'
+ '83104a3387dc09ba95ccf4e2581fb20f'
+ '5da394f02ed6d62971f0d700f174bfd1'
+ '1f6fcaabe4058c225674f866b19f2ca8'
+ '031e105a06300feecacfc2774e48ff2f'
+ '699172bf54ec0e45b6aae348b1f570e8'
+ 'be3bd26c2b2a74b445854135b17766a8'
+ '60a5d51a562aa1d8fa5f2294a683ce47'
+ '9f9275a3fb9b7a81a2ba098db1738b7d'
+ 'c1cd2d98c466e252b6c8f3a85e92489f'
+ '6a58beab1cb022cd368e874e24c7b9ef'
+ '91eb572a5ad032073326fd4dd2842504'
+ 'a65ba371ae411de4607259fc78a55682'
+ '4f1c03f1cc5f440a770c080a121d998a'
+ 'c25c1fdfbdc1fa38d87e45cf1c8511c2'
+ '2596b5f38ef54d72af08dca05fcce369'
+ '60a06421a819bc65bd5ba0c3841e0500'
+ '5dfc03b8f6b8d190b63271b8ef32986c'
+ 'f60c03c266bec028b4df4b7996deaacb'
+ '3b51a73b29843bfc6db748351dea464b'
+ 'a841defc71b4b1da33ac9b24cdff52ca'
+ '18dad6ca1c3bc2dd5206fe8caf4bcdf1'
+ 'bca5ff7935af3fe539ec30f1e9f59190'
+ '26d60834e4804c1c8af826e4f2a45503'
+ 'dc163d401cf3db6e07ff66793d3ec7ca'
+ '762d49459368bb78da084e57ffc25d7c'
+ '8aeeb382e88b712c163e149bea6c5e1a')
+sha256sums=('9ab56e0c841a1eab13e9ced8f1ff6943be6643773dbbbb7b189462950b9f2113'
'42898b9d24262de27e9b1f3067d51d01373810b7c9e4991403a7f0a5dd7a26cf'
'66f8b106a052b4807513ace92978e5e6347cef08eee39e4b4ae31c60284cc0a3'
'9d79df8617e2bb1042a4b7d34311e73dc4afcdfe4dfa66703455ff54512427f5'
@@ -218,7 +293,28 @@ sha256sums=('0db5204cc7d7806fde39b5ea7b6a465b4310739c380d7330131956e63af0f137'
'731e05fc551367faa6ad5dc317eedf305388ab12db196c0a1361a3d01bd35279'
'c471cafa43503a40d43b42acd8bc6ef49db29e55a74e0494c85f729ea45fe243'
'5cac7ce2e6f043127f314b93694af021ae7820ffb5bf3de343da7a240d05e9c8'
- '8654496d83c083e457e8bb9bae2b1e71804d156a38c284d89872d0125eba947d')
+ '8654496d83c083e457e8bb9bae2b1e71804d156a38c284d89872d0125eba947d'
+ '61500188b388fd1eb52ec970150cf098d855b8ba09a8efb8192803eebefaba03'
+ 'cc54e4bc21255a419ba0a416b1c8d1e705e27676c5561dd4b83fe657f045b65e'
+ '46a87449cd316a621271def4147ba781424dd524ae2332cd55dd07f2ac9ab456'
+ '4cb63ad72244eea04879b07cbca809120bdb08a7d8ea2a37e8d9a6fcc1333f26'
+ '353d15624675c78dfd83318195d75bdb0507fd0476f5e22be1329bf257d2de1e'
+ '9c6ce4ae64e206b442aeea6af98b9b86b8a67571ba00a92fc721619ba3061c26'
+ 'acbcf462628daf4fa2dbee064969a158ccc0bb0ce9f286ceb3617e470eab1c1f'
+ '882019276d59e6cc15fcda1bb1dea75b01591509a2644ddb0225ef1d5a17fd1c'
+ 'b812176f6061d135ab45facecf5a05922d9ffd5ec0a6f17c3e3a5a74729034b1'
+ '82f2c244f169c1f5a9b6186e4e4436c116bd020a1be973e8be261097d38bc937'
+ 'eaab5a80791644a24950fe0c6db2c09535655c63ed3a263eb70791ab30f86ab9'
+ '50975ac2377ffd24874746df4b820de1734f53eb322bd25ccc9d51148129a2e0'
+ '0ae424e8211836edbededafd308cf9ae73cdb791752c4fc43e1c194db7b77cab'
+ '1d6ab72eec4977b7789d0f5af3dc907bebdd21e417abb5dcfdac80c460a77bae'
+ 'd1c641d3f024e8e11c4a36bf58570afb4b63fcaa4a22f05c59b513a35a6a4af7'
+ '2b9ccbe92e4e1cbeafd16208ef011209bce30b6d3f9b4f288d0b83418479b1bc'
+ '2ac185b8a27855c22d64d2e3f56e28f6a4442b1141ad46e4a0a078e0e22adc53'
+ '3afe6487f26f7393aa1a05b1cd307b3bd29d164a49596e199a681b4432f6e23e'
+ '5787763cac47a3ba5df203f75d57c9d7d8d4364c7cd32db426b268f77f17247a'
+ 'df2c6cf5943ca26f282b96f22cf7301cffa6521a273c8301199840b5dca57e8a'
+ '26022e04543aa8ccebe1b9c698c452e2dccc98d5bf1fd8c4f0dba000067e899a')
if [ "${_opt_DKMS}" -ne 0 ]; then
depends+=('linux' 'dkms' 'linux-headers')
@@ -290,12 +386,106 @@ prepare() {
cd "${_srcdir}"
# Version check
- if [ "${_pkgver}" != "$(grep -e 'TRUE_VERSION=' ./Makefile.inc | cut -d'"' -f2)" ]; then
+ local _tv
+ _tv="$(grep -e 'TRUE_VERSION=' ./Makefile.inc | cut -d'"' -f2)"
+ _tv="${_tv%_*}"
+ if [ "${_pkgver}" != "${_tv}" ]; then
set +u
echo 'Version mismatch'
false
fi
+ if [ "$(vercmp "${pkgver}" '1.9.38')" -le 0 ]; then
+ #cp -pr "${srcdir}/${_srcdir}"{,.orig-0000}
+ #diff -pNaru5 dgrp-1.9{.orig,} > '0000-Kernel-4-13-CLASS_ATTR_STRING.patch'
+ patch -Nup1 -i "${srcdir}/0000a-Kernel-4-13-CLASS_ATTR_STRING.patch"
+ test ! -d "${srcdir}/${_srcdir}.orig-0000" || echo "${}"
+
+ #cp -pr "${srcdir}/${_srcdir}"{,.orig-0001}
+ #diff -pNaru5 dgrp-1.9{.orig-0001,} > '0001-Kernel-4-15-timers.patch'
+ patch -Nup1 -i "${srcdir}/0001a-Kernel-4-15-timers.patch"
+ test ! -d "${srcdir}/${_srcdir}.orig-0001" || echo "${}"
+ fi
+
+ # 1.3-9 adds an 11th parameter on the end of each line in dgrp.backing.store
+ # Remove the last 'default' to go back
+
+ if [ "$(vercmp "${pkgver}" '1.9.39')" -le 0 ]; then
+ #cp -p driver/2.6.27/dgrp_mon_ops.c{,.orig}; false
+ #diff -pNau5 driver/2.6.27/dgrp_mon_ops.c{.orig,} > '0002-kernel-5.0.0-do_gettimeofday.patch'
+ patch -Nup0 -i "${srcdir}/0002a-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.0.0-dgrp_mon_ops-access_ok.patch'
+ patch -Nup0 -i "${srcdir}/0003a-kernel-5.0.0-dgrp_mon_ops-access_ok.patch"
+ fi
+
+ if [ "$(vercmp "${pkgver}" '1.9.40')" -le 0 ]; then
+ #cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0004-kernel-5.6-proc_dir_entry-proc_ops.patch'
+ patch -Nup0 -i "${srcdir}/0004-kernel-5.6-proc_dir_entry-proc_ops.patch"
+
+ #cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch'
+ patch -Nup0 -i "${srcdir}/0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch"
+
+ #cp -pr driver/2.6.27{,.orig}; false
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0006-kernel-5.13-dropped-tty_check_change.patch'
+ patch -Nup0 -i "${srcdir}/0006-kernel-5.13-dropped-tty_check_change.patch"
+
+ # unsigned write_room https://www.spinics.net/lists/linux-serial/msg42297.html
+ # unsigned chars_in_buffer https://www.spinics.net/lists/linux-serial/msg42299.html
+ # set_current_state https://linux-kernel.vger.kernel.narkive.com/xnPfKhYP/patch-2-5-52-use-set-current-state-instead-of-current-state-take-1
+ #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.14-task_struct.state-unsigned-tty.patch'
+ patch -Nup0 -i "${srcdir}/0007-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,} > '0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch'
+ patch -Nup0 -i "${srcdir}/0008-kernel-5.15-alloc_tty_driver-put_tty_driver.patch"
+
+ # https://lore.kernel.org/all/20210914091134.17426-2-jslaby@suse.cz/
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch'
+ patch -Nup1 -i "${startdir}/0009-kernel-5.16-remove-LDISC_FLAG_DEFINED.patch"
+
+ # https://www.spinics.net/lists/linux-fsdevel/msg207433.html
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0010-kernel-5.17-change-PDE_DATA.patch'
+ patch -Nup1 -i "${startdir}/0010-kernel-5.17-change-PDE_DATA.patch"
+ fi
+
+ if :; then
+ # 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' > '0011-kernel-6.1-remove-TTY_MAGIC.patch'
+ patch -Nup1 -i "${startdir}/0011-kernel-6.1-remove-TTY_MAGIC.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' > '0012-kernel-6.1-INIT_C_CC-termios_internal.patch'
+ patch -Nup1 -i "${startdir}/0012-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' > '0013-kernel-6.0-set_termios-const-ktermios.patch'
+ patch -Nup1 -i "${startdir}/0013-kernel-6.0-set_termios-const-ktermios.patch"
+
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0014-kernel-6.6-struct-tty_operations-size_t.patch'
+ patch -Nup1 -i "${startdir}/0014-kernel-6.6-struct-tty_operations-size_t.patch"
+
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0015-kernel-6.4-class_create-1arg.patch'
+ patch -Nup1 -i "${startdir}/0015-kernel-6.4-class_create-1arg.patch"
+
+ #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
+ # diff -pNaru5 'a' 'b' > '0016-0006-kernel-5.10-dropped-tty_check_change.patch'
+ patch -Nup1 -i "${srcdir}/0016-0006-kernel-5.10-dropped-tty_check_change.patch"
+ fi
+
# Standardize name of RealPort
sed -e "s/RealPort/${_opt_RealPort}/gI" -i $(grep -lrF $'RealPort\nRealport' .)
# grep -ri realport . | grep -vF $'RealPort\nRealport'
@@ -304,7 +494,7 @@ prepare() {
# Fix configure
sed -e '# Cosmetic fix for newer gcc compilers' \
- -e 's:\(3.9\*|4.\*\))$:\1|5.*|6.*|7.*|8.*):g' \
+ -e '#s:\(3.9\*|4.\*\))$:\1|5.*|6.*|7.*|8.*|9.*):g' \
-e "# I can't find any other way to fix the modules dir" \
-e 's:/lib/modules/:/usr&:g' \
-e '# Kill a harmless mkdir error. They mkdir the folder then dont use it.' \
@@ -367,7 +557,14 @@ prepare() {
fi
# new folder in gcc 8
- sed -e 's/^clean:$/&\n\trm -f .cache.mk/g' -i driver/*/Makefile*
+ sed -e 's/^clean:$/&\n\trm -f .cache.mk/g' \
+ -e '# Switch SUBDIRS= to M= for Kernel 5.4' \
+ -e 's:SUBDIRS=:M=:g' \
+ -e '# Build with any specified kernel, not just the current one' \
+ -e 's:@MODDIR@:/usr/lib/modules/$(KERNELRELEASE):g' \
+ -e 's:@KERNEL_HEADERS@:/usr/lib/modules/$(KERNELRELEASE)/build:g' \
+ -e '1i KERNELRELEASE?=$(shell uname -r)' \
+ -i driver/*/Makefile*
# Branding in dmesg
sed -e 's@ please visit [^"]\+"@ please visit https://aur.archlinux.org/packages/dgrp/"@g' \
@@ -398,7 +595,7 @@ build() {
_configure
#. 'config/file_locations.Arch'
- make -s all -j1 # This package doesn't support threaded make and it's too small to fix
+ make all -j1 # This package doesn't support threaded make and it's too small to fix
set +u
}
@@ -442,6 +639,9 @@ package() {
install -dm755 "${pkgdir}/etc/udev/rules.d/"
touch "${pkgdir}/${backup[0]}" # postinstall handles the pacsave file automatically
chmod 644 "${pkgdir}/${backup[0]}"
+ if [ ! -s "${pkgdir}/tmp/dgrp/10-dgrp.rules" ]; then
+ mv "${pkgdir}/etc/udev/rules.d/10-dgrp.rules" "${pkgdir}/tmp/dgrp/10-dgrp.rules" # 1.9-41
+ fi
sed -e 's:^KERNEL=="cu_dgrp:#&:g' -i "${pkgdir}/tmp/dgrp/10-dgrp.rules" # Recommended by Digi
cat > "${pkgdir}/etc/udev/rules.d/10-dgrp.rules" << EOF
# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
@@ -572,8 +772,8 @@ EOF
cp -pr 'driver/build/' "${_dkms}/driver/"
cp -pr 'commoninc/' "${_dkms}/"
install -pm644 'Makefile.inc' -t "${_dkms}/"
- sed -e 's:/usr/lib/modules/[^/]\+/:/usr/lib/modules/$(KERNELRELEASE)/:g' \
- -i "${_dkms}/driver/build/Makefile"
+ #sed -e 's:/usr/lib/modules/[^/]\+/:/usr/lib/modules/$(KERNELRELEASE)/:g' \
+ # -i "${_dkms}/driver/build/Makefile"
make -C "${_dkms}/driver/build/" clean
fi
set +u