summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* tty: serial: Add UART driver for Cortina-Access platformJason Li2021-06-183-0/+818
| | | | | | | | | This driver supports Cortina Access UART IP integrated in most all CAXXXX line of SoCs. Earlycom is also supported Signed-off-by: Jason Li <jason.li@cortina-access.com> Link: https://lore.kernel.org/r/20210615165750.31261-1-alex.nemirovsky@cortina-access.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: introduce mxser_16550A_or_MUST helperJiri Slaby2021-06-181-13/+13
| | | | | | | | | | | | This check is used in the code on many places. Either in positive or negative form. So introduce a helper called mxser_16550A_or_MUST for this purpose. And replace all the occurrences. This simplifies many ifs in there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-67-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: rename flags to old_speed in mxser_set_serial_infoJiri Slaby2021-06-181-3/+3
| | | | | | | | | | Local 'flags' are used to store speed in mxser_set_serial_info, not actual flags (by doing & ASYNC_SPD_MASK). So rename 'flags' to 'old_speed' (after what it is). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-66-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: use port variable in mxser_set_serial_infoJiri Slaby2021-06-181-5/+5
| | | | | | | | | | | mxser_set_serial_info already defined a local 'port' of type struct tty_port. So use it in the code everywhere. This eliminates some text from the code there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-65-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: access info->MCR under info->slockJiri Slaby2021-06-181-2/+2
| | | | | | | | | | | info->MCR is protected by info->slock all over the code. Extend the lock in mxser_tiocmget around the info->MCR fetch too. It likely doesn't change anything, but it's always good to be consistent. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-64-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: fix typos around enhanced modeJiri Slaby2021-06-181-9/+9
| | | | | | | | | | | Fix spelling of "enhanced" in macros and comments around them. While "enchance" comes from the original Moxa's driver, I don't think it was meant to be that. From the context, they obviously mean "enhanced". Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-63-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: decrypt FCR valuesJiri Slaby2021-06-181-2/+6
| | | | | | | | | | | | Currently, some of the values written to FCR are magic constants. But they are composed of well-defined bits. Use these named macros in place of the constants. No changes in objdump -d. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-62-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove xmit_cnt < 0 testsJiri Slaby2021-06-181-4/+4
| | | | | | | | | mxser_port::xmit_cnt is unsigned, it cannot be negative. Therefore remove all the xmit_cnt < 0 tests. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-61-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: introduce and use start/stop_tx helpersJiri Slaby2021-06-181-43/+37
| | | | | | | | | | | | | Starting and stopping TX is performed on many places in the driver. It is repeated outb and info->IER modification. Create few helpers (__mxser_start_tx, mxser_start_tx, __mxser_stop_tx) and use them in the code instead of open coding. This should be a base for an uart driver for this device in the future. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-60-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: extract and dedup CTS handlingJiri Slaby2021-06-181-54/+33
| | | | | | | | | | CTS is handled on two locations in mxser. Extract the code into separation function mxser_handle_cts. And call it from the two locations. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-59-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: don't start TX from tty_operations::put_charJiri Slaby2021-06-181-11/+1
| | | | | | | | | | | | TX is not supposed to be started from tty_operations::put_char. Line disciplines ought to call tty_operations::put_char several times and then do a single tty_operations::flush_chars to start TX. Fix this in mxser by removing TX startup from mxser_put_char. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-58-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: cleanup mxser_dtr_rtsJiri Slaby2021-06-181-4/+5
| | | | | | | | | | mxser_dtr_rts now does all inb, outb, & or | in a single statement. The code is hard to follow, so make it more readable by doing one-line = one-statement. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-57-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: cleanup mxser_rs_breakJiri Slaby2021-06-181-4/+6
| | | | | | | | | | mxser_rs_break now does all inb, outb, & or | in a single statement. The code is hard to follow, so make it more readable by doing one-line = one-statement. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-56-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove pointless ioaddr checksJiri Slaby2021-06-181-10/+1
| | | | | | | | | struct mxser_port::ioaddr can never be NULL once set in ->probe. Hence the checks for it are pointless. Remove them. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-55-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: alloc only needed # of portsJiri Slaby2021-06-181-2/+3
| | | | | | | | | | | | Many boards have only 2 ports. But we always allocate 8 ports (struct mxser_port) in each struct mxser_board. Switch this to an empty/variable sized array ([]) and allocate the needed number of ports using struct_size helper in ->probe. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-54-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: alloc struct mxser_board dynamicallyJiri Slaby2021-06-181-10/+11
| | | | | | | | | | | | | There is no need to preallocate an array of four struct mxser_board's. In most cases a single board or two will be present in a machine. So allocate struct mxser_board as needed in ->probe. This makes mxser_boards a bit array. There we store which indexes are free (unallocated). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-53-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: make mxser_board::idx really an indexJiri Slaby2021-06-181-6/+7
| | | | | | | | | | | mxser_board::idx is named as index, but actually contain a base. So assign index there. And for base, introduce a local variable. This is needed for the next patch (use index as a bit index). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-52-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: rework and simplify mxser_openJiri Slaby2021-06-181-7/+4
| | | | | | | | | | | In mxser_open, tty->port is already set thanks to tty_port_register_device in ->probe. So we can simply use container_of to deduce the struct mxser_port's pointer. Thus avoiding divisions and complex computations. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-51-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: cleanup mxser_process_txrx_fifoJiri Slaby2021-06-181-13/+15
| | | | | | | | | | | | | Rename process_txrx_fifo to mxser_process_txrx_fifo and: * remove useless parentheses * return from the 'if's true branch and process the rest in normal code flow (shift the code one level left) All this to make the code more readable. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-50-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove mxser_cardinfoJiri Slaby2021-06-181-72/+41
| | | | | | | | | | Now that mxser_cards array (of struct mxser_cardinfo) contains only port count and a quirk, we can encode these two directly into pci_device_id::driver_data. And we can remove this struct completely. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-49-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove info message from probeJiri Slaby2021-06-181-30/+26
| | | | | | | | | | | | There is a dev_info in ->probe which prints device's name, bus and slot numbers. All these can be fetched from the lspci output. So remove this useless print. This eliminates the whole mxser_cardinfo::name field. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-48-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: move request irq to probe and switch to managedJiri Slaby2021-06-181-21/+9
| | | | | | | | | Move request_irq from mxser_initbrd to mxser_probe so that we can switch it to managed request. It simplifies the cleanup code. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-47-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: pci, switch to managed resourcesJiri Slaby2021-06-181-11/+3
| | | | | | | | | | | Switch to managed resources for PCI using pcim_enable_device. Regions and device disabling is now taken care of by the core and we need not unwind. Neither in ->probe, nor in ->remove. That simplifies the code. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-46-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: inline mxser_board_remove into mxser_removeJiri Slaby2021-06-181-12/+7
| | | | | | | | | The only user of mxser_board_remove is mxser_remove. Move there those few lines. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-45-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: move board init into mxser_initbrdJiri Slaby2021-06-181-25/+28
| | | | | | | | | What's done in ->probe for board is actually its initialization. So move it to mxser_initbrd where it belongs. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-44-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: clean up the rest of MUST helpersJiri Slaby2021-06-181-85/+12
| | | | | | | | | | Clean up the rest of MUST helpers. They all can use the newly added mxser_must_set_EFR. And passing a bool instead of having two functions (_enable+_disable) simplifies the code a lot too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-43-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: introduce mxser_must_select_bank and use itJiri Slaby2021-06-181-58/+16
| | | | | | | | | | | | | Again, selecting a bank in the EFR register is duplicated many times. Extract it to a separate function (mxser_must_select_bank) and use it on all the places. This cleans up most of the helpers. And mxser_get_must_hardware_id now returns the HW ID directly, not via a by-reference parameter. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-42-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: dedup mxser_must_set_enhance_modeJiri Slaby2021-06-181-20/+22
| | | | | | | | | | | There are multiple copies of setting the EFR register. Separate it to a new universal function called __mxser_must_set_EFR. And use it in the code by introducing mxser_must_set_enhance_mode instead of mxser_disable_must_enchance_mode and mxser_enable_must_enchance_mode. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-41-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: simplify mxser_ioctl_op_modeJiri Slaby2021-06-181-17/+10
| | | | | | | | | | | * ModeMask local array is just inverted OP_MODE_MASK shifted by shiftbit. Drop this array and use the value directly. * return from the if's true branch and drop 'else' branch by moving the code completely outside the if. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-40-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: extract mxser_ioctl_op_modeJiri Slaby2021-06-181-38/+45
| | | | | | | | | | | This ioctl code sets RS232, RS422 or RS485 mode. Move the code to a separate function (mxser_ioctl_op_mode) with a note that these mxser-special ioctls should be likely replaced eventually by TIOCGRS485 and TIOCSRS485. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-39-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: cleanup mxser_change_speedJiri Slaby2021-06-181-8/+7
| | | | | | | | | * use UART macros instead of magic constants * let the default case reuse already existing code (CS5 case) Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-38-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: drop mxser_port::custom_divisorJiri Slaby2021-06-181-5/+3
| | | | | | | | | It's an once-set constant, so define a macro for the constant (MXSER_CUSTOM_DIVISOR) and use it in the code instead. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-37-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: drop mxser_port::baud_baseJiri Slaby2021-06-181-14/+11
| | | | | | | | | It's an once-set constant, so define a macro for the constant (MXSER_BAUD_BASE) and use it in the code instead. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-36-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove unused mxser_port::stop_rxJiri Slaby2021-06-181-2/+0
| | | | | | | | It's been a long time since mxser_port::stop_rx was abandoned. Remove it. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-35-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: drop unused mxser_port::normal_termiosJiri Slaby2021-06-181-3/+0
| | | | | | | | | After the previous patches, mxser_port::normal_termios is unused, so time to wave bye-bye. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-34-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: don't allocate MXSER_PORTS + 1Jiri Slaby2021-06-181-20/+3
| | | | | | | | | | | | | | | | | The MXSER_PORTS's tty_device is never registered and neither its tty_port instance exists. Hence, it's quite pointless to allocate it. It used to be used for global information fetches via ioctls. We have just removed these as non-existent tty_device+tty_port was exactly the reason to remove the ioctls. It would be peculiar to add this "virtual" port as we require a backing tty_port since commit ecbbfd44a08f (TTY: move tty buffers to tty_port) in 2012. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-33-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove cnt from mxser_receive_charsJiri Slaby2021-06-181-9/+7
| | | | | | | | | | After the previous ioctls removal, cnt is needed only in mxser_receive_chars_old now. So remove it from mxser_receive_chars and mxser_receive_chars_new and account only in mxser_receive_chars_old. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-32-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_HighSpeedOn ioctlJiri Slaby2021-06-181-3/+0
| | | | | | | | | | | | | 1) The semantics are defined exactly nowhere. 2) The ioctl definition was never exposed to userspace, so noone should actually be reliably using this. 3) It's not even mentioned in any of the mxser utilities. Provided the above, remove this mxser-special ioctl. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-31-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_ASPP_OQUEUE ioctlJiri Slaby2021-06-181-13/+0
| | | | | | | | | | | | | 1) The semantics are defined exactly nowhere. 2) The ioctl definition was never exposed to userspace, so noone should actually be reliably using this. 3) It's not even mentioned in any of the mxser utilities. Provided the above, remove this mxser-special ioctl. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-30-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_GETMSTATUS ioctlJiri Slaby2021-06-181-61/+1
| | | | | | | | | | | | | | | | | | 1) MOXA_GETMSTATUS is broken at least since commit ecbbfd44a08f (TTY: move tty buffers to tty_port) in 2012. Even though it's mentioned in the mon_pa moxa utility, obviously noone ever tried that in that timeframe. 2) The ioctl definition was never exposed to userspace, so noone should actually be reliably using this. Provided the above, remove this mxser-special ioctl. And remove the whole concept of mxser_ioctl_special as this was the last ioctl in there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-29-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_GETDATACOUNT ioctlJiri Slaby2021-06-181-19/+0
| | | | | | | | | | | | | | | 1) MOXA_GETDATACOUNT is broken at least since commit ecbbfd44a08f (TTY: move tty buffers to tty_port) in 2012. Even though it's mentioned in the mon_p moxa utility, obviously noone ever tried that in that timeframe. 2) The ioctl definition was never exposed to userspace, so noone should actually be reliably using this. Provided the above, remove this mxser-special ioctl. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-28-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_CHKPORTENABLE ioctlJiri Slaby2021-06-181-9/+1
| | | | | | | | | | | | | | 1) MOXA_CHKPORTENABLE is broken at least since commit ecbbfd44a08f (TTY: move tty buffers to tty_port) in 2012. 2) The ioctl definition was never exposed to userspace, so noone should actually be reliably using this. 3) It's not even mentioned in any of the mxser utilities. Provided the above, remove this mxser-special ioctl. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-27-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_ASPP_LSTATUS ioctlJiri Slaby2021-06-181-25/+0
| | | | | | | | | | | | | 1) The semantics are defined exactly nowhere. 2) The ioctl definition was never exposed to userspace, so noone should actually be reliably using this. 3) It's not even mentioned in any of the mxser utilities. Provided the above, remove this mxser-special ioctl. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-26-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_ASPP_MON and friendsJiri Slaby2021-06-181-184/+0
| | | | | | | | | | | | | | | 1) MOXA_ASPP_MON_EXT is broken at least since commit ecbbfd44a08f (TTY: move tty buffers to tty_port) in 2012. 2) The ioctl definitions were never exposed to userspace, so noone should actually be reliably using them. 3) They're not even mentioned in any of the mxser utilities. So remove all these mxser-special ioctls: MOXA_ASPP_MON, MOXA_ASPP_MON_EXT, and MOXA_SDS_RSTICOUNTER. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-25-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_SET_BAUD_METHOD ioctlJiri Slaby2021-06-181-12/+1
| | | | | | | | | | | | | 1) The semantics are defined exactly nowhere. 2) The ioctl definition was never exposed to userspace, so noone should actually be reliably using this. 3) It's not even mentioned in any of the mxser utilities. Provided the above, remove this mxser-special ioctl. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-24-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: remove MOXA_GET_MAJOR deprecated ioctlJiri Slaby2021-06-181-7/+0
| | | | | | | | | MOXA_GET_MAJOR was deprecated in commit 41aee9a121fd (Char: mxser, ioctl cleanup) in 2008. Remove this ioctl finally. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-23-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: drop unused MOXA_DIAGNOSE macroJiri Slaby2021-06-181-1/+0
| | | | | | | | It's unused. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-22-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: drop UART_MCR_AFE and UART_LSR_SPECIAL definesJiri Slaby2021-06-181-5/+2
| | | | | | | | | | | | | * UART_MCR_AFE is a redefinition of serial_reg.h's one. * UART_LSR_SPECIAL is a redefinition of serial_reg.h's UART_LSR_BRK_ERROR_BITS. So remove both and replace the latter uses by already defined UART_LSR_BRK_ERROR_BITS. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-21-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: make xmit ring buffer variables unsignedJiri Slaby2021-06-181-3/+3
| | | | | | | | | | Make the xmit ring buffer pointers and counter (xmit_head, xmit_tail, xmit_cnt) unsigned. Now, the assumptions for the compiler are clear -- they cannot be negative. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-20-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mxser: correct types for uart variablesJiri Slaby2021-06-181-5/+5
| | | | | | | | | | | | | | In struct mxser_port, all the UART registers and masks, and the xon/xoff character are stored into int. Let's re-type all these as UART registers are 8bit (u8) and xon/xoff character is an unsigned char (cc_t in ktermios). This save some bytes in memory, but more importantly the change makes it what it really is. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-19-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>