summaryrefslogtreecommitdiff
path: root/drivers/s390/char
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 's390-6.4-1' of ↵Linus Torvalds2023-04-303-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Vasily Gorbik: - Add support for stackleak feature. Also allow specifying architecture-specific stackleak poison function to enable faster implementation. On s390, the mvc-based implementation helps decrease typical overhead from a factor of 3 to just 25% - Convert all assembler files to use SYM* style macros, deprecating the ENTRY() macro and other annotations. Select ARCH_USE_SYM_ANNOTATIONS - Improve KASLR to also randomize module and special amode31 code base load addresses - Rework decompressor memory tracking to support memory holes and improve error handling - Add support for protected virtualization AP binding - Add support for set_direct_map() calls - Implement set_memory_rox() and noexec module_alloc() - Remove obsolete overriding of mem*() functions for KASAN - Rework kexec/kdump to avoid using nodat_stack to call purgatory - Convert the rest of the s390 code to use flexible-array member instead of a zero-length array - Clean up uaccess inline asm - Enable ARCH_HAS_MEMBARRIER_SYNC_CORE - Convert to using CONFIG_FUNCTION_ALIGNMENT and enable DEBUG_FORCE_FUNCTION_ALIGN_64B - Resolve last_break in userspace fault reports - Simplify one-level sysctl registration - Clean up branch prediction handling - Rework CPU counter facility to retrieve available counter sets just once - Other various small fixes and improvements all over the code * tag 's390-6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (118 commits) s390/stackleak: provide fast __stackleak_poison() implementation stackleak: allow to specify arch specific stackleak poison function s390: select ARCH_USE_SYM_ANNOTATIONS s390/mm: use VM_FLUSH_RESET_PERMS in module_alloc() s390: wire up memfd_secret system call s390/mm: enable ARCH_HAS_SET_DIRECT_MAP s390/mm: use BIT macro to generate SET_MEMORY bit masks s390/relocate_kernel: adjust indentation s390/relocate_kernel: use SYM* macros instead of ENTRY(), etc. s390/entry: use SYM* macros instead of ENTRY(), etc. s390/purgatory: use SYM* macros instead of ENTRY(), etc. s390/kprobes: use SYM* macros instead of ENTRY(), etc. s390/reipl: use SYM* macros instead of ENTRY(), etc. s390/head64: use SYM* macros instead of ENTRY(), etc. s390/earlypgm: use SYM* macros instead of ENTRY(), etc. s390/mcount: use SYM* macros instead of ENTRY(), etc. s390/crc32le: use SYM* macros instead of ENTRY(), etc. s390/crc32be: use SYM* macros instead of ENTRY(), etc. s390/crypto,chacha: use SYM* macros instead of ENTRY(), etc. s390/amode31: use SYM* macros instead of ENTRY(), etc. ...
| * s390/sclp: replace zero-length array with flexible-array memberHeiko Carstens2023-04-132-2/+2
| | | | | | | | | | | | | | | | | | | | | | There are numerous patches which convert zero-length arrays with a flexible-array member. Convert the remaining s390 occurrences. Suggested-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://github.com/KSPP/linux/issues/78 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| * s390/boot: rename mem_detect to physmem_infoVasily Gorbik2023-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | In preparation to extending mem_detect with additional information like reserved ranges rename it to more generic physmem_info. This new naming also help to avoid confusion by using more exact terms like "physmem online ranges", etc. Acked-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | driver core: class: remove module * from class_create()Greg Kroah-Hartman2023-03-175-5/+5
|/ | | | | | | | | | | | The module pointer in class_create() never actually did anything, and it shouldn't have been requred to be set as a parameter even if it did something. So just remove it and fix up all callers of the function in the kernel tree at the same time. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20230313181843.1207845-4-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'tty-6.3-rc1' of ↵Linus Torvalds2023-02-241-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty / serial driver updates from Greg KH: "Here is the big set of serial and tty driver updates for 6.3-rc1. Once again, Jiri and Ilpo have done a number of core vt and tty/serial layer cleanups that were much needed and appreciated. Other than that, it's just a bunch of little tty/serial driver updates: - qcom-geni-serial driver updates - liteuart driver updates - hvcs driver cleanups - n_gsm updates and additions for new features - more 8250 device support added - fpga/dfl update and additions - imx serial driver updates - fsl_lpuart updates - other tiny fixes and updates for serial drivers All of these have been in linux-next for a while with no reported problems" * tag 'tty-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (143 commits) tty: n_gsm: add keep alive support serial: imx: remove a redundant check dt-bindings: serial: snps-dw-apb-uart: add dma & dma-names properties soc: qcom: geni-se: Move qcom-geni-se.h to linux/soc/qcom/geni-se.h tty: n_gsm: add TIOCMIWAIT support tty: n_gsm: add RING/CD control support tty: n_gsm: mark unusable ioctl structure fields accordingly serial: imx: get rid of registers shadowing serial: imx: refine local variables in rxint() serial: imx: stop using USR2 in FIFO reading loop serial: imx: remove redundant USR2 read from FIFO reading loop serial: imx: do not break from FIFO reading loop prematurely serial: imx: do not sysrq broken chars serial: imx: work-around for hardware RX flood serial: imx: factor-out common code to imx_uart_soft_reset() serial: 8250_pci1xxxx: Add power management functions to quad-uart driver serial: 8250_pci1xxxx: Add RS485 support to quad-uart driver serial: 8250_pci1xxxx: Add driver for quad-uart support serial: 8250_pci: Add serial8250_pci_setup_port definition in 8250_pcilib.c tty: pcn_uart: fix memory leak with using debugfs_lookup() ...
| * tty: Cleanup tty_port_set_initialized() bool parameterIlpo Järvinen2023-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | Make callers pass true/false consistently for bool val. Reviewed-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230117090358.4796-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | s390/hmcdrv: use strscpy() instead of strlcpy()Heiko Carstens2023-02-062-5/+5
| | | | | | | | | | | | Given that strlcpy() is deprecated use strscpy() instead. Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/early: fix sclp_early_sccb variable lifetimeAlexander Gordeev2023-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ada1da31ce34 ("s390/sclp: sort out physical vs virtual pointers usage") fixed the notion of virtual address for sclp_early_sccb pointer. However, it did not take into account that kasan_early_init() can also output messages and sclp_early_sccb should be adjusted by the time kasan_early_init() is called. Currently it is not a problem, since virtual and physical addresses on s390 are the same. Nevertheless, should they ever differ, this would cause an invalid pointer access. Fixes: ada1da31ce34 ("s390/sclp: sort out physical vs virtual pointers usage") Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: move condev definitionHeiko Carstens2023-01-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fix this for allmodconfig: drivers/s390/char/con3270.c:43:24: error: 'condev' defined but not used [-Werror=unused-variable] static struct tty3270 *condev; ^~~~~~ Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: c17fe081ac1f ("s390/3270: unify con3270 + tty3270") Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: add special output handling when oops_in_progress is setSven Schnelle2023-01-091-15/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | Normally a user can scroll back with PF7/PF8 if printed messages are outside of the visible screen area. This doesn't work when the kernel crashes, because the scrollback handling is done by the kernel, which is no longer alive after the kernel crash. Add code to always print all dirty lines in the screen buffer, so the user can scroll back with the terminal scrollback keys (Page Up/Down). Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: set SBA and RA addresses when converting linesSven Schnelle2023-01-091-23/+8
| | | | | | | | | | | | | | | | | | | | Now that lines are converted during output, the RA and SBA no longer need to get updated as an additional step. Instead set them when converting the line. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: simplify update flagsSven Schnelle2023-01-091-20/+10
| | | | | | | | | | | | | | | | | | Make TTY3270_UPDATE_ALL the sum of all TTY3270_* flags, so we don't need any special handling for it. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: return from notifier when activate view failsSven Schnelle2023-01-091-2/+6
| | | | | | | | | | | | | | | | | | | | When activating the view fails (in this case because the 3270 is disconnected) return from the notifer callback. Otherwise the system will deadlock. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/fs3270: split header filesSven Schnelle2023-01-092-88/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to use the fs3270 one would need at least the ioctl definitions in uapi. Add two new include files in uapi, which contain: fs3270: ioctl number declarations + returned struct for TUBGETMOD. raw3270: all the orders, attributes and similar stuff used with 3270 terminals. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/fs3270: fix screen reset on activateSven Schnelle2023-01-091-6/+7
| | | | | | | | | | | | | | | | | | | | | | fs3270 uses EWRITEA to clear the screen when a user opens /dev/3270/tub. However it misses the attribute byte after the EWRITEA, so (at least) x3270 complains about 'Record too short, missing write flags'. Add the missing flag byte to fix this. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/fs3270: fix function prototypesSven Schnelle2023-01-091-38/+22
| | | | | | | | | | | | | | | | | | | | | | fix function prototypes split over two lines like: static void foobar(void) Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/fs3270: use *ptr instead of struct in kzallocSven Schnelle2023-01-091-1/+1
| | | | | | | | | | | | Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/fs3270: remove duplicate assignmentSven Schnelle2023-01-091-1/+2
| | | | | | | | | | | | | | | | remove a duplicate assignment reported by checkpatch. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/fs3270: add missing braces to if/elseSven Schnelle2023-01-091-6/+9
| | | | | | | | | | | | | | | | | | Fix a few missing braces and wrong placement of braces reported by checkpatch. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/fs3270: fix whitespace errorsSven Schnelle2023-01-091-16/+16
| | | | | | | | | | | | | | | | | | Fix a few whitespace errors reported by checkpatch, namely superfluous whitespace, missing spaces and empty lines. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: fix nullpointer checkSven Schnelle2023-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fix the following checkpatch warning: CHECK: Comparison to NULL could be written "!rp" + if (rp == NULL) Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: split up raw3270_activate_view()Sven Schnelle2023-01-091-28/+46
| | | | | | | | | | | | | | | | | | move the core processing to __raw3270_activate_view() to reduce the required if/else blocks and indentiion levels. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: remove BUG_ON in raw3270_request_reset()Sven Schnelle2023-01-092-4/+8
| | | | | | | | | | | | | | | | | | WARN_ON_ONCE if list is not empty, and return an error code instead. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: use DEVICE_ATTR_RO() for sysfs attributesSven Schnelle2023-01-091-9/+9
| | | | | | | | | | | | Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: add comment to spinlock memberSven Schnelle2023-01-091-1/+1
| | | | | | | | | | | | | | | | | | Add a small comment to the lock member of struct raw3270_view to make checkpatch happy. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: fix raw3270 declarationsSven Schnelle2023-01-091-29/+30
| | | | | | | | | | | | | | | | | | checkpatch complains about missing argument names in function declarations. Fix it. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: fix indentation/whitespace errorsSven Schnelle2023-01-092-20/+23
| | | | | | | | | | | | Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: move EXPORT_SYMBOL() next to functionsSven Schnelle2023-01-091-24/+23
| | | | | | | | | | | | | | | | | | | | Fixes a few checkpatch warning about EXPORT_SYMBOL being at the end of the file instead of being next to the functions. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: fix minor checkpatch issuesSven Schnelle2023-01-091-11/+17
| | | | | | | | | | | | | | | | | | Fix remaining checkpatch issues, like misplaced brackets, whitespace and similar things. No functional change. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: use msecs_to_jiffies()Sven Schnelle2023-01-091-1/+1
| | | | | | | | | | | | | | | | Use msecs_to_jiffies() instead of HZ/10. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: fix multiple assignments in one lineSven Schnelle2023-01-091-5/+10
| | | | | | | | | | | | | | | | | | | | | | fix the following and similar checkpatch warnings: CHECK: multiple assignments should be avoided + tp->cx = tp->saved_cx = 0; Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: fix camelcase in enum membersSven Schnelle2023-01-091-13/+13
| | | | | | | | | | | | | | | | | | | | | | fix the following and similar checkpatch warnings: CHECK: Avoid CamelCase: <ESnormal> + enum { ESnormal, ESesc, ESsquare, ESparen, ESgetpars }; Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: add key help to status areaSven Schnelle2023-01-091-7/+33
| | | | | | | | | | | | | | | | | | | | | | To let the user know about function key bindings, print them next to the Running/History field at the lower right of the screen. Also print the scrollback position. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: reduce highlight width to 3 bitsSven Schnelle2023-01-091-14/+21
| | | | | | | | | | | | | | | | | | | | | | With the previous change this reduces the size of struct tty3270_attribute from four to two bytes. As we have this struct allocated for each character cell, this saves quite some memory. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: reduce f_color and b_color attribute size to 4 bitSven Schnelle2023-01-091-10/+18
| | | | | | | | | | | | | | | | | | | | As we're only supportign 8 colors, we don't need 8 bits. Reduce the size to 4 bits to save memory. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: rewrite command line recallingSven Schnelle2023-01-092-170/+74
| | | | | | | | | | | | | | | | | | | | | | Command line recalling is the last user of the 3270 custom malloc() like allocator. Remove this dependency by using a statically allocated buffer for the saved command lines, and also remove the allocator. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: use normal char buffer for prompt/inputSven Schnelle2023-01-091-55/+81
| | | | | | | | | | | | | | | | | | Preparation patch to allow removing the custom 3270 memory allocator. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: convert lines during outputSven Schnelle2023-01-092-238/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The length of the screen line is variable with the 3270 protocol. For each attribute (foreground, background color, highlighting etc) we need 3 bytes: the set attribute order, the attribute number, and the value of the attribute. This means that depending on screen content, we might end up 3*3 bytes addtional data for a single character. Allocating the maximum possible amount of memory is quite a lot, and we cannot easily extend the lines by allocating memory because we might get called from atomic context. Failing to extend the memory would also be bad as that would mean that we could miss kernel messages in oom conditions. Therefore move the conversion to a 3270 datastream to tty3270_update(), and use only single line buffer. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: generate status line during outputSven Schnelle2023-01-091-39/+45
| | | | | | | | | | | | | | | | | | | | | | Updating the status line is almost the same as generating it when redrawing the screen. However, the code is much easier to read when doing so. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: add 3270 datastream helpersSven Schnelle2023-01-091-44/+53
| | | | | | | | | | | | | | | | | | | | There are lots of places adding attributes or orders to the datastream. Add a few helpers to make that code shorter and easier to read. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: move ASCII->EBCDIC conversion to convert_line()Sven Schnelle2023-01-091-42/+42
| | | | | | | | | | | | | | | | | | | | Instead of always converting the character set, only convert them when the line is really displayed. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: move tty3270_convert_line()Sven Schnelle2023-01-091-162/+162
| | | | | | | | | | | | | | | | | | | | To make the upcoming patches easier to read, move tty3270_convert_line() before changing code. No functional change. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: make raw3270_buffer_address() accept x/y coordinatesSven Schnelle2023-01-093-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | All callers of raw3270_buffer_address() are calculating the offset from some x/y coordinates. Move that calculation inside of the function, so user can pass the x/y values directly. Note that negative values are relative to the end-of-line or end-of-screen. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: allocate screen with scrollbackSven Schnelle2023-01-091-14/+21
| | | | | | | | | | | | | | | | | | | | No functional change (except more memory consumption), in preparation for the line buffer rework. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/con3270: add helper to get number of tty rowsSven Schnelle2023-01-091-23/+29
| | | | | | | | | | | | | | | | | | | | | | There a quite a few places using 'tp->view.rows - 2'. Add a helper function for this. This will also be used when a function key help line will be added. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: split up tty3270_convert_line()Sven Schnelle2023-01-091-68/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make the code easier to read, split up tty3270_convertline() into several subfunctions: - tty3270_resize_line() to realloc the line if it doesn't have enough space left - tty3270_required_length() to calculate how much space we need - tty3270_add_attributes() to add the color and highlight attributes - tty3270_add_reset_attributes() to reset the attributes at the end of the line Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: resize terminal when the clear key is pressedSven Schnelle2023-01-093-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | There's no easy way to figure out whether the user has re-connected to the z/VM session. When the user re-connected with a different geometry to z/VM, the screen layout is broken. Allow the user to force a resizing by pressing the Clear Key. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: move resize work to raw3270Sven Schnelle2023-01-093-34/+42
| | | | | | | | | | | | | | | | | | | | | | | | This change was initially made to reduce code duplication when the con3270 and tty3270 shared the same resize code. It still makes sense to move the resize workqueue to raw3270 in case we add some other view later. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/raw3270: add raw3270_start_request() helperSven Schnelle2023-01-093-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few places (and there would be more with the following commits) like this: raw3270_request_reset(cp->kreset); raw3270_request_set_cmd(cp->kreset, TC_WRITE); raw3270_request_add_data(cp->kreset, &kreset_data, 1); raw3270_start(&cp->view, cp->kreset); i.e reset a request, setting the command, adding payload, and starting the request. Add a helper raw3270_start_request() which takes a command and the payload as argument and calls the approppriate functions. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
* | s390/tty3270: add AID definesSven Schnelle2023-01-092-2/+13
| | | | | | | | | | | | | | | | | | | | | | Use AID_* instead of hex numbers to make the code a bit easier to read. also convert the if/else blocks to a switch statement in tty3270_read_tasklet(). Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>