diff options
author | Chris Severance | 2021-06-29 19:21:03 -0400 |
---|---|---|
committer | Chris Severance | 2021-06-29 19:21:03 -0400 |
commit | 8a2175ba6cb926faf58009d7635c4a03fc4a9954 (patch) | |
tree | 5a79dc6f370e1a55c19525b7ac1535bf9a29bf8f | |
parent | b9227f65400f0d9afa7fe5005ed0f50cbe331292 (diff) | |
download | aur-8a2175ba6cb926faf58009d7635c4a03fc4a9954.tar.gz |
autu: Update to 1.9.40-3
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | 0000-Kernel-4-13-CLASS_ATTR_STRING.patch | 62 | ||||
-rw-r--r-- | 0000a-Kernel-4-13-CLASS_ATTR_STRING.patch | 59 | ||||
-rw-r--r-- | 0001-Kernel-4-15-timers.patch | 145 | ||||
-rw-r--r-- | 0001a-Kernel-4-15-timers.patch | 158 | ||||
-rw-r--r-- | 0002a-kernel-5.0.0-do_gettimeofday.patch | 36 | ||||
-rw-r--r-- | 0003a-kernel-5.0.0-dgrp_mon_ops-access_ok.patch | 194 | ||||
-rw-r--r-- | 0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch | 18 | ||||
-rw-r--r-- | PKGBUILD | 88 |
9 files changed, 759 insertions, 25 deletions
@@ -1,7 +1,7 @@ pkgbase = dgrp pkgdesc = tty driver for Digi RealPort ConnectPort EtherLite Flex One CM PortServer TS IBM RAN serial console terminal servers pkgver = 1.9.40 - pkgrel = 2 + pkgrel = 3 url = https://www.digi.com/ install = dgrp-install.sh arch = i686 @@ -54,9 +54,16 @@ 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 + 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 md5sums = 175349c08d19158c88ad582c76916397 md5sums = b4af5022ba96fcc2429263cfbbe85bae md5sums = 9feebec170552c9186e713e7f5852e14 @@ -87,9 +94,16 @@ pkgbase = dgrp 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 sha256sums = 2044715efa7a56fccad5ac76cdca9f71bca430e8c53ce31fa5c9563da3e7906a sha256sums = 42898b9d24262de27e9b1f3067d51d01373810b7c9e4991403a7f0a5dd7a26cf sha256sums = 66f8b106a052b4807513ace92978e5e6347cef08eee39e4b4ae31c60284cc0a3 @@ -120,9 +134,15 @@ 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 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/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/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/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 @@ -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,8 +57,6 @@ _opt_RealPort='RealPort' # Can also be Realport _opt_DKMS=1 # This can be toggled between installs -_opt_SSL10=0 - # Since the kernel module isn't loaded until you have a device # configured, these services are automatically enabled and started # for immediate hardware support. They will be reenabled each time the @@ -107,13 +105,18 @@ pkgname='dgrp' #_pkgver='1.9-39'; _dl='40002086_Z.tgz' _pkgver='1.9-40'; _dl='40002086_AA.tgz' pkgver="${_pkgver//-/.}" -pkgrel='2' +pkgrel='3' 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 @@ -183,11 +186,13 @@ source=( '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 - '0002-kernel-5.0.0-do_gettimeofday.patch' - '0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch' # https://lkml.org/lkml/2019/1/4/418 + # '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' ) unset _mibsrc #source_i686=('http://ftp1.digi.com/support/utilities/40002890_A.tgz') @@ -223,9 +228,16 @@ md5sums=('175349c08d19158c88ad582c76916397' '1f6fcaabe4058c225674f866b19f2ca8' '031e105a06300feecacfc2774e48ff2f' '699172bf54ec0e45b6aae348b1f570e8' + 'be3bd26c2b2a74b445854135b17766a8' + '60a5d51a562aa1d8fa5f2294a683ce47' + '9f9275a3fb9b7a81a2ba098db1738b7d' + 'c1cd2d98c466e252b6c8f3a85e92489f' '6a58beab1cb022cd368e874e24c7b9ef' + '91eb572a5ad032073326fd4dd2842504' 'a65ba371ae411de4607259fc78a55682' - 'c25c1fdfbdc1fa38d87e45cf1c8511c2') + '4f1c03f1cc5f440a770c080a121d998a' + 'c25c1fdfbdc1fa38d87e45cf1c8511c2' + '2596b5f38ef54d72af08dca05fcce369') sha256sums=('2044715efa7a56fccad5ac76cdca9f71bca430e8c53ce31fa5c9563da3e7906a' '42898b9d24262de27e9b1f3067d51d01373810b7c9e4991403a7f0a5dd7a26cf' '66f8b106a052b4807513ace92978e5e6347cef08eee39e4b4ae31c60284cc0a3' @@ -256,9 +268,16 @@ sha256sums=('2044715efa7a56fccad5ac76cdca9f71bca430e8c53ce31fa5c9563da3e7906a' 'c471cafa43503a40d43b42acd8bc6ef49db29e55a74e0494c85f729ea45fe243' '5cac7ce2e6f043127f314b93694af021ae7820ffb5bf3de343da7a240d05e9c8' '8654496d83c083e457e8bb9bae2b1e71804d156a38c284d89872d0125eba947d' + '61500188b388fd1eb52ec970150cf098d855b8ba09a8efb8192803eebefaba03' + 'cc54e4bc21255a419ba0a416b1c8d1e705e27676c5561dd4b83fe657f045b65e' + '46a87449cd316a621271def4147ba781424dd524ae2332cd55dd07f2ac9ab456' + '4cb63ad72244eea04879b07cbca809120bdb08a7d8ea2a37e8d9a6fcc1333f26' '353d15624675c78dfd83318195d75bdb0507fd0476f5e22be1329bf257d2de1e' + '9c6ce4ae64e206b442aeea6af98b9b86b8a67571ba00a92fc721619ba3061c26' 'acbcf462628daf4fa2dbee064969a158ccc0bb0ce9f286ceb3617e470eab1c1f' - 'b812176f6061d135ab45facecf5a05922d9ffd5ec0a6f17c3e3a5a74729034b1') + '882019276d59e6cc15fcda1bb1dea75b01591509a2644ddb0225ef1d5a17fd1c' + 'b812176f6061d135ab45facecf5a05922d9ffd5ec0a6f17c3e3a5a74729034b1' + '82f2c244f169c1f5a9b6186e4e4436c116bd020a1be973e8be261097d38bc937') if [ "${_opt_DKMS}" -ne 0 ]; then depends+=('linux' 'dkms' 'linux-headers') @@ -339,17 +358,40 @@ prepare() { false fi - #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 -Nbup0 -i "${srcdir}/0002-kernel-5.0.0-do_gettimeofday.patch" + 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 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 -Nbup0 -i "${srcdir}/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch" + #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 -Nbup0 -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 -Nbup0 -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 -Nbup0 -i "${srcdir}/0004-kernel-5.6-proc_dir_entry-proc_ops.patch" + fi #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 -Nbup0 -i "${srcdir}/0004-kernel-5.6-proc_dir_entry-proc_ops.patch" + #diff -pNaru5 driver/2.6.27{.orig,} > '0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch' + patch -Nbup0 -i "${srcdir}/0005-kernel-5.12-MODULE_SUPPORTED_DEVICE.patch" # Standardize name of RealPort sed -e "s/RealPort/${_opt_RealPort}/gI" -i $(grep -lrF $'RealPort\nRealport' .) |