diff options
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | 0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch | 211 | ||||
-rw-r--r-- | PKGBUILD | 16 |
3 files changed, 228 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = trueport pkgdesc = tty driver for Perle IOLan+ DS TS SDS STS SCS JetStream LanStream LinkStream and 3rd party serial console terminal device servers pkgver = 6.10.0.1 - pkgrel = 1 + pkgrel = 2 url = https://www.perle.com/ install = trueport-install.sh arch = i686 @@ -28,13 +28,16 @@ pkgbase = trueport source = tty_default_permissions.patch source = 0000-tty_unregister_driver-void.patch source = 0001-kernel-5.13-dropped-tty_check_change.patch + source = 0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch md5sums = 5a529676de30706133255ba4e8dae5b0 md5sums = 56444e2f404aa2e6a2c9e8e2bd919fcf md5sums = fb798f306553cb253b30ff5af5ba2f40 md5sums = a103f2791c03733b1fd75493864fb464 + md5sums = 5206e863cf6340c05325d86935d4b40c sha256sums = c21340a7523593da3e229b79cfbcf9e656772b2039e972dbca3947d138d55ffa sha256sums = 28863731fd99e447dc456312ef33e40f93623b56da0d345e45f40e238ca49639 sha256sums = 5f806246751d3a91c59bd97273221d1066006bafc7ed598c3d93f9b7bdae65a1 sha256sums = 88181bc7a0a5fa5a1320cbed20e02e1329b03b4c9800fc691990754b9a9aac18 + sha256sums = ee64f971753fb4fd8a488e32e8fe3de9c468a00a1d1b995329bcfe87c93cedf7 pkgname = trueport diff --git a/0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch b/0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch new file mode 100644 index 000000000000..68a24ffb24ae --- /dev/null +++ b/0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch @@ -0,0 +1,211 @@ +diff -pNaru5 trueport-6.10.0.orig/ptyx/ptyc.c trueport-6.10.0/ptyx/ptyc.c +--- trueport-6.10.0.orig/ptyx/ptyc.c 2020-05-28 07:56:32.000000000 -0400 ++++ trueport-6.10.0/ptyx/ptyc.c 2021-09-12 22:50:04.105320366 -0400 +@@ -91,29 +91,41 @@ static void ptyx_ctrl_close(struct tty_s + + } + + + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++static unsigned int ptyx_ctrl_write_room(struct tty_struct *tty) ++#else + static int ptyx_ctrl_write_room(struct tty_struct *tty) ++#endif + { + struct ptyx_struct *ptyx_info; + + if (!tty || !tty->driver_data) // paranoia + return 0; + + ptyx_info = (struct ptyx_struct *) tty->driver_data; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++ if (!tty || tty->flow.stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#else + if (!tty || tty->stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#endif + return 0; + + return RECEIVE_ROOM(tty); + } + + // The Control tty will pass all statuses in raw mode to the dameon + // so in this case we can return the true count in the buffer. + // ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++static unsigned int ptyx_ctrl_chars_in_buffer(struct tty_struct *tty) ++#else + static int ptyx_ctrl_chars_in_buffer(struct tty_struct *tty) ++#endif + { + return 0; + } + + +diff -pNaru5 trueport-6.10.0.orig/ptyx/ptym.c trueport-6.10.0/ptyx/ptym.c +--- trueport-6.10.0.orig/ptyx/ptym.c 2020-05-28 07:56:32.000000000 -0400 ++++ trueport-6.10.0/ptyx/ptym.c 2021-09-12 22:50:24.095375131 -0400 +@@ -173,11 +173,15 @@ static int ptyx_master_write(struct tty_ + ptyx_print(PTYX_DEBUG_WRITE, ("ptyx_master_write(%d): buf=0x%p, count=%d\n", ptyx_info->line, buf, count)); + PTYX_LOCK(&ptyx_info->port_lock, flags); + s_tty = ptyx_info->s_tty; + PTYX_UNLOCK(&ptyx_info->port_lock, flags); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++ if (!s_tty || tty->flow.stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#else + if (!s_tty || tty->stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#endif + return 0; + + if (from_user) + { + down(&tty->flip.pty_sem); +@@ -243,11 +247,15 @@ static int ptyx_master_write(struct tty_ + ptyx_print(PTYX_DEBUG_WRITE, ("ptyx_master_write(%d): buf=0x%p, count=%d\n", ptyx_info->line, buf, count)); + PTYX_LOCK(&ptyx_info->port_lock, flags); + s_tty = ptyx_info->s_tty; + PTYX_UNLOCK(&ptyx_info->port_lock, flags); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++ if (!s_tty || tty->flow.stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#else + if (!s_tty || tty->stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#endif + return 0; + + if (count > 0) + { + /* Stuff the data into the input queue of the other end */ +@@ -264,11 +272,15 @@ static int ptyx_master_write(struct tty_ + + return c; + } + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++static unsigned int ptyx_master_write_room(struct tty_struct *tty) ++#else + static int ptyx_master_write_room(struct tty_struct *tty) ++#endif + { + struct ptyx_struct *ptyx_info; + struct tty_struct *s_tty; + unsigned long flags; + +@@ -279,11 +291,15 @@ static int ptyx_master_write_room(struct + + PTYX_LOCK(&ptyx_info->port_lock, flags); + s_tty = ptyx_info->s_tty; + PTYX_UNLOCK(&ptyx_info->port_lock, flags); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++ if (!s_tty || tty->flow.stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#else + if (!s_tty || tty->stopped || (ptyx_info->flags & SLAVE_CLOSING) ) ++#endif + return 0; + + return RECEIVE_ROOM(s_tty); + } + +@@ -299,11 +315,15 @@ static int ptyx_master_write_room(struct + * WAKEUP_CHARS is regarded by select() as "full".) To avoid deadlock + * the count returned must be 0 if no canonical data is available to be + * read. (The N_TTY ldisc.chars_in_buffer now knows this.) + * + */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++static unsigned int ptyx_master_chars_in_buffer(struct tty_struct *tty) ++#else + static int ptyx_master_chars_in_buffer(struct tty_struct *tty) ++#endif + { + return 0; + } + + +diff -pNaru5 trueport-6.10.0.orig/ptyx/ptys.c trueport-6.10.0/ptyx/ptys.c +--- trueport-6.10.0.orig/ptyx/ptys.c 2021-09-12 22:49:37.855248337 -0400 ++++ trueport-6.10.0/ptyx/ptys.c 2021-09-12 22:50:41.015421437 -0400 +@@ -223,11 +223,15 @@ static int ptyx_slave_write(struct tty_s + + PTYX_LOCK(&ptyx_info->port_lock, flags); + m_tty = ptyx_info->m_tty; + PTYX_UNLOCK(&ptyx_info->port_lock, flags); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++ if ( !m_tty || tty->flow.stopped ) ++#else + if ( !m_tty || tty->stopped ) ++#endif + return 0; + + if (from_user) + { + down(&tty->flip.pty_sem); +@@ -307,11 +311,15 @@ static int ptyx_slave_write(struct tty_s + + PTYX_LOCK(&ptyx_info->port_lock, flags); + m_tty = ptyx_info->m_tty; + PTYX_UNLOCK(&ptyx_info->port_lock, flags); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++ if ( !m_tty || tty->flow.stopped ) ++#else + if ( !m_tty || tty->stopped ) ++#endif + return 0; + + if (!slave_dump_data(ptyx_info)) + { + if (count > 0) +@@ -337,11 +345,15 @@ static int ptyx_slave_write(struct tty_s + } + #endif // end greater than or equal to 2.6.10 + + + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++static unsigned int ptyx_slave_write_room(struct tty_struct *tty) ++#else + static int ptyx_slave_write_room(struct tty_struct *tty) ++#endif + { + struct ptyx_struct *ptyx_info; + struct tty_struct *m_tty; + unsigned long flags; + +@@ -353,11 +365,15 @@ static int ptyx_slave_write_room(struct + + PTYX_LOCK(&ptyx_info->port_lock, flags); + m_tty = ptyx_info->m_tty; + PTYX_UNLOCK(&ptyx_info->port_lock, flags); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++ if (!m_tty || tty->flow.stopped) ++#else + if (!m_tty || tty->stopped) ++#endif + return 0; + + return RECEIVE_ROOM(m_tty); + } + +@@ -365,11 +381,15 @@ static int ptyx_slave_write_room(struct + * + * The Slave side passes all characters in raw mode to the Master side's + * buffer where they can be read immediately, so in this case we can + * return the true count in the buffer. + */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) ++static unsigned int ptyx_slave_chars_in_buffer(struct tty_struct *tty) ++#else + static int ptyx_slave_chars_in_buffer(struct tty_struct *tty) ++#endif + { + return 0; + } + + @@ -97,7 +97,7 @@ _dlver='6.10.0-1' pkgver="${_dlver//-/.}" #_dlver='6.8.0-2' # only use this with a version change patch set _srcdir="${pkgname}-${_dlver%%-*}" -pkgrel='1' +pkgrel='2' pkgdesc='tty driver for Perle IOLan+ DS TS SDS STS SCS JetStream LanStream LinkStream and 3rd party serial console terminal device servers' _pkgdescshort='Perle TruePort driver for Ethernet serial servers' arch=('i686' 'x86_64') @@ -123,15 +123,18 @@ source=( #'trueport-patch-signal_pending-kernel-4-11.patch' '0000-tty_unregister_driver-void.patch' '0001-kernel-5.13-dropped-tty_check_change.patch' + '0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch' ) md5sums=('5a529676de30706133255ba4e8dae5b0' '56444e2f404aa2e6a2c9e8e2bd919fcf' 'fb798f306553cb253b30ff5af5ba2f40' - 'a103f2791c03733b1fd75493864fb464') + 'a103f2791c03733b1fd75493864fb464' + '5206e863cf6340c05325d86935d4b40c') sha256sums=('c21340a7523593da3e229b79cfbcf9e656772b2039e972dbca3947d138d55ffa' '28863731fd99e447dc456312ef33e40f93623b56da0d345e45f40e238ca49639' '5f806246751d3a91c59bd97273221d1066006bafc7ed598c3d93f9b7bdae65a1' - '88181bc7a0a5fa5a1320cbed20e02e1329b03b4c9800fc691990754b9a9aac18') + '88181bc7a0a5fa5a1320cbed20e02e1329b03b4c9800fc691990754b9a9aac18' + 'ee64f971753fb4fd8a488e32e8fe3de9c468a00a1d1b995329bcfe87c93cedf7') if [ "${_opt_DKMS}" -ne 0 ]; then depends+=('linux' 'dkms' 'linux-headers') @@ -158,6 +161,13 @@ prepare() { # diff -pNaru5 trueport-6.10.0{.orig,} > '0001-kernel-5.13-dropped-tty_check_change.patch' patch -Nup1 -i "${srcdir}/0001-kernel-5.13-dropped-tty_check_change.patch" + # tty.stopped https://lore.kernel.org/lkml/20210505091928.22010-13-jslaby@suse.cz/ + # 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 + #cd ..; cp -pr trueport-6.10.0{,.orig}; false + # diff -pNaru5 trueport-6.10.0{.orig,} > '0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch' + patch -Nup1 -i "${srcdir}/0002-kernel-5.14-task_struct.state-unsigned-tty-flow-tty.patch" + # insert parameters and make install script non interactive. set +u; msg2 'Checking SSL with rpm_build'; set -u sed -e 's:^\(DONE\)=.*$:'"\1='done';SSL='${_opt_SSL}':g" \ |