mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
TTY / Serial patches for 5.14-rc1
Here is the big set of tty and serial driver patches for 5.14-rc1. A bit more than normal, but nothing major, lots of cleanups. Highlights are: - lots of tty api cleanups and mxser driver cleanups from Jiri - build warning fixes - various serial driver updates - coding style cleanups - various tty driver minor fixes and updates - removal of broken and disable r3964 line discipline (finally!) All of these have been in linux-next for a while with no reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYOM4qQ8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ylKvQCfbh+OmTkDlDlDhSWlxuV05M1XTXoAoLUcLZru s5JCnwSZztQQLMDHj7Pd =Zupm -----END PGP SIGNATURE----- Merge tag 'tty-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty / serial updates from Greg KH: "Here is the big set of tty and serial driver patches for 5.14-rc1. A bit more than normal, but nothing major, lots of cleanups. Highlights are: - lots of tty api cleanups and mxser driver cleanups from Jiri - build warning fixes - various serial driver updates - coding style cleanups - various tty driver minor fixes and updates - removal of broken and disable r3964 line discipline (finally!) All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (227 commits) serial: mvebu-uart: remove unused member nb from struct mvebu_uart arm64: dts: marvell: armada-37xx: Fix reg for standard variant of UART dt-bindings: mvebu-uart: fix documentation serial: mvebu-uart: correctly calculate minimal possible baudrate serial: mvebu-uart: do not allow changing baudrate when uartclk is not available serial: mvebu-uart: fix calculation of clock divisor tty: make linux/tty_flip.h self-contained serial: Prefer unsigned int to bare use of unsigned serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs serial: qcom_geni_serial: use DT aliases according to DT bindings Revert "tty: serial: Add UART driver for Cortina-Access platform" tty: serial: Add UART driver for Cortina-Access platform MAINTAINERS: add me back as mxser maintainer mxser: Documentation, fix typos mxser: Documentation, make the docs up-to-date mxser: Documentation, remove traces of callout device mxser: introduce mxser_16550A_or_MUST helper mxser: rename flags to old_speed in mxser_set_serial_info mxser: use port variable in mxser_set_serial_info mxser: access info->MCR under info->slock ...
This commit is contained in:
commit
c932ed0adb
@ -1122,6 +1122,11 @@
|
||||
the driver will use only 32-bit accessors to read/write
|
||||
the device registers.
|
||||
|
||||
liteuart,<addr>
|
||||
Start an early console on a litex serial port at the
|
||||
specified address. The serial port must already be
|
||||
setup and configured. Options are not yet supported.
|
||||
|
||||
meson,<addr>
|
||||
Start an early, polled-mode console on a meson serial
|
||||
port at the specified address. The serial port must
|
||||
|
@ -10,7 +10,7 @@ maintainers:
|
||||
- devicetree@vger.kernel.org
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
- if:
|
||||
anyOf:
|
||||
- required:
|
||||
|
118
Documentation/devicetree/bindings/serial/8250_omap.yaml
Normal file
118
Documentation/devicetree/bindings/serial/8250_omap.yaml
Normal file
@ -0,0 +1,118 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/serial/8250_omap.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Bindings for 8250 compliant UARTs on TI's OMAP2+ and K3 SoCs
|
||||
|
||||
maintainers:
|
||||
- Vignesh Raghavendra <vigneshr@ti.com>
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial/serial.yaml#
|
||||
- $ref: /schemas/serial/rs485.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
oneOf:
|
||||
- enum:
|
||||
- ti,am3352-uart
|
||||
- ti,am4372-uart
|
||||
- ti,am654-uart
|
||||
- ti,dra742-uart
|
||||
- ti,omap2-uart
|
||||
- ti,omap3-uart
|
||||
- ti,omap4-uart
|
||||
- items:
|
||||
- enum:
|
||||
- ti,am64-uart
|
||||
- ti,j721e-uart
|
||||
- const: ti,am654-uart
|
||||
|
||||
ti,hwmods:
|
||||
description:
|
||||
Must be "uart<n>", n being the instance number (1-based)
|
||||
This property is applicable only on legacy platforms mainly omap2/3
|
||||
and ti81xx and should not be used on other platforms.
|
||||
$ref: /schemas/types.yaml#/definitions/string
|
||||
deprecated: true
|
||||
|
||||
dmas:
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
|
||||
dma-names:
|
||||
items:
|
||||
- const: tx
|
||||
- const: rx
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
description:
|
||||
First entry is module IRQ required for normal IO operation.
|
||||
Second entry is optional and corresponds to system wakeup IRQ
|
||||
where supported.
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
clock-names:
|
||||
const: fclk
|
||||
|
||||
rts-gpios: true
|
||||
cts-gpios: true
|
||||
dtr-gpios: true
|
||||
dsr-gpios: true
|
||||
rng-gpios: true
|
||||
dcd-gpios: true
|
||||
rs485-rts-delay: true
|
||||
rs485-rts-active-low: true
|
||||
rs485-rx-during-tx: true
|
||||
rs485-rts-active-high: true
|
||||
linux,rs485-enabled-at-boot-time: true
|
||||
rts-gpio: true
|
||||
power-domains: true
|
||||
clock-frequency: true
|
||||
current-speed: true
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- interrupts
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
if:
|
||||
properties:
|
||||
compatible:
|
||||
oneOf:
|
||||
- const: ti,omap2-uart
|
||||
- const: ti,omap3-uart
|
||||
- const: ti,omap4-uart
|
||||
|
||||
then:
|
||||
properties:
|
||||
ti,hwmods:
|
||||
items:
|
||||
- pattern: "^uart([1-9])$"
|
||||
|
||||
else:
|
||||
properties:
|
||||
ti,hwmods: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
serial@49042000 {
|
||||
compatible = "ti,omap3-uart";
|
||||
reg = <0x49042000 0x400>;
|
||||
interrupts = <80>;
|
||||
dmas = <&sdma 81 &sdma 82>;
|
||||
dma-names = "tx", "rx";
|
||||
ti,hwmods = "uart4";
|
||||
clock-frequency = <48000000>;
|
||||
};
|
@ -55,6 +55,11 @@ properties:
|
||||
- const: pclk
|
||||
- const: baud
|
||||
|
||||
fifo-size:
|
||||
description: The fifo size supported by the UART channel.
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
enum: [64, 128]
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
@ -10,7 +10,7 @@ maintainers:
|
||||
- Al Cooper <alcooperx@gmail.com>
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
|
||||
description: |+
|
||||
The Broadcom UART is based on the basic 8250 UART but with
|
||||
|
@ -71,6 +71,18 @@ properties:
|
||||
received, and that the peripheral should invert its input using the
|
||||
INVR registers.
|
||||
|
||||
fsl,dma-info:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
minItems: 2
|
||||
maxItems: 2
|
||||
description: |
|
||||
First cell contains the size of DMA buffer chunks, second cell contains
|
||||
the amount of chunks used for the device. Multiplying both numbers is
|
||||
the total size of memory used for receiving data.
|
||||
When not being configured the system will use default settings, which
|
||||
are sensible for most use cases. If you need low latency processing on
|
||||
slow connections this needs to be configured appropriately.
|
||||
|
||||
uart-has-rtscts: true
|
||||
|
||||
rs485-rts-delay: true
|
||||
|
@ -10,7 +10,7 @@ maintainers:
|
||||
- Paul Cercueil <paul@crapouillou.net>
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
|
||||
properties:
|
||||
$nodename:
|
||||
|
@ -5,10 +5,10 @@ Required properties:
|
||||
- compatible:
|
||||
- "marvell,armada-3700-uart" for the standard variant of the UART
|
||||
(32 bytes FIFO, no DMA, level interrupts, 8-bit access to the
|
||||
FIFO, baudrate limited to 230400).
|
||||
FIFO), called also UART1.
|
||||
- "marvell,armada-3700-uart-ext" for the extended variant of the
|
||||
UART (128 bytes FIFO, DMA, front interrupts, 8-bit or 32-bit
|
||||
accesses to the FIFO, baudrate unlimited by the dividers).
|
||||
accesses to the FIFO), called also UART2.
|
||||
- reg: offset and length of the register set for the device.
|
||||
- clocks: UART reference clock used to derive the baudrate. If no clock
|
||||
is provided (possible only with the "marvell,armada-3700-uart"
|
||||
@ -33,7 +33,7 @@ Required properties:
|
||||
Example:
|
||||
uart0: serial@12000 {
|
||||
compatible = "marvell,armada-3700-uart";
|
||||
reg = <0x12000 0x200>;
|
||||
reg = <0x12000 0x18>;
|
||||
clocks = <&xtalclk>;
|
||||
interrupts =
|
||||
<GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
|
||||
|
@ -1,40 +0,0 @@
|
||||
OMAP UART controller
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "ti,am64-uart", "ti,am654-uart" for AM64 controllers
|
||||
- compatible : should be "ti,j721e-uart", "ti,am654-uart" for J721E controllers
|
||||
- compatible : should be "ti,am654-uart" for AM654 controllers
|
||||
- compatible : should be "ti,omap2-uart" for OMAP2 controllers
|
||||
- compatible : should be "ti,omap3-uart" for OMAP3 controllers
|
||||
- compatible : should be "ti,omap4-uart" for OMAP4 controllers
|
||||
- compatible : should be "ti,am4372-uart" for AM437x controllers
|
||||
- compatible : should be "ti,am3352-uart" for AM335x controllers
|
||||
- compatible : should be "ti,dra742-uart" for DRA7x controllers
|
||||
- reg : address and length of the register space
|
||||
- interrupts or interrupts-extended : Should contain the uart interrupt
|
||||
specifier or both the interrupt
|
||||
controller phandle and interrupt
|
||||
specifier.
|
||||
- ti,hwmods : Must be "uart<n>", n being the instance number (1-based)
|
||||
|
||||
Optional properties:
|
||||
- clock-frequency : frequency of the clock input to the UART
|
||||
- dmas : DMA specifier, consisting of a phandle to the DMA controller
|
||||
node and a DMA channel number.
|
||||
- dma-names : "rx" for receive channel, "tx" for transmit channel.
|
||||
- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
|
||||
- rs485-rts-active-high: drive RTS high when sending (default is low).
|
||||
- clocks: phandle to the functional clock as per
|
||||
Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
Example:
|
||||
|
||||
uart4: serial@49042000 {
|
||||
compatible = "ti,omap3-uart";
|
||||
reg = <0x49042000 0x400>;
|
||||
interrupts = <80>;
|
||||
dmas = <&sdma 81 &sdma 82>;
|
||||
dma-names = "tx", "rx";
|
||||
ti,hwmods = "uart4";
|
||||
clock-frequency = <48000000>;
|
||||
};
|
@ -10,7 +10,7 @@ maintainers:
|
||||
- Rob Herring <robh@kernel.org>
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
|
||||
# Need a custom select here or 'arm,primecell' will match on lots of nodes
|
||||
select:
|
||||
@ -24,12 +24,9 @@ select:
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
oneOf:
|
||||
- items:
|
||||
- const: arm,pl011
|
||||
- const: arm,primecell
|
||||
- items:
|
||||
- const: arm,primecell
|
||||
items:
|
||||
- const: arm,pl011
|
||||
- const: arm,primecell
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
@ -103,7 +100,7 @@ dependencies:
|
||||
poll-rate-ms: [ auto-poll ]
|
||||
poll-timeout-ms: [ auto-poll ]
|
||||
|
||||
additionalProperties: false
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
@ -10,7 +10,7 @@ maintainers:
|
||||
- Oleksij Rempel <o.rempel@pengutronix.de>
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
@ -35,7 +35,7 @@ required:
|
||||
- clocks
|
||||
- clock-names
|
||||
|
||||
additionalProperties: false
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
@ -35,7 +35,7 @@ required:
|
||||
- clocks
|
||||
- clock-names
|
||||
|
||||
additionalProperties: false
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
@ -64,6 +64,10 @@ properties:
|
||||
- const: renesas,rcar-gen3-scif # R-Car Gen3 and RZ/G2
|
||||
- const: renesas,scif # generic SCIF compatible UART
|
||||
|
||||
- items:
|
||||
- enum:
|
||||
- renesas,scif-r9a07g044 # RZ/G2{L,LC}
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
|
@ -81,7 +81,7 @@ required:
|
||||
unevaluatedProperties: false
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
|
||||
- if:
|
||||
properties:
|
||||
|
@ -23,6 +23,8 @@ properties:
|
||||
$nodename:
|
||||
pattern: "^serial(@.*)?$"
|
||||
|
||||
label: true
|
||||
|
||||
cts-gpios:
|
||||
maxItems: 1
|
||||
description:
|
||||
|
@ -12,7 +12,7 @@ maintainers:
|
||||
- Palmer Dabbelt <palmer@sifive.com>
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
@ -49,7 +49,7 @@ required:
|
||||
- interrupts
|
||||
- clocks
|
||||
|
||||
additionalProperties: false
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
@ -10,7 +10,7 @@ maintainers:
|
||||
- Rob Herring <robh@kernel.org>
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/serial.yaml#
|
||||
- $ref: serial.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
@ -23,6 +23,7 @@ properties:
|
||||
- items:
|
||||
- enum:
|
||||
- rockchip,px30-uart
|
||||
- rockchip,rk1808-uart
|
||||
- rockchip,rk3036-uart
|
||||
- rockchip,rk3066-uart
|
||||
- rockchip,rk3188-uart
|
||||
@ -31,6 +32,7 @@ properties:
|
||||
- rockchip,rk3328-uart
|
||||
- rockchip,rk3368-uart
|
||||
- rockchip,rk3399-uart
|
||||
- rockchip,rk3568-uart
|
||||
- rockchip,rv1108-uart
|
||||
- const: snps,dw-apb-uart
|
||||
- items:
|
||||
|
@ -112,8 +112,7 @@ required:
|
||||
- interrupts
|
||||
- clocks
|
||||
|
||||
additionalProperties:
|
||||
type: object
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
@ -2,14 +2,8 @@
|
||||
MOXA Smartio/Industio Family Device Driver Installation Guide
|
||||
=============================================================
|
||||
|
||||
.. note::
|
||||
|
||||
This file is outdated. It needs some care in order to make it
|
||||
updated to Kernel 5.0 and upper
|
||||
|
||||
Copyright (C) 2008, Moxa Inc.
|
||||
|
||||
Date: 01/21/2008
|
||||
Copyright (C) 2021, Jiri Slaby
|
||||
|
||||
.. Content
|
||||
|
||||
@ -17,12 +11,7 @@ Date: 01/21/2008
|
||||
2. System Requirement
|
||||
3. Installation
|
||||
3.1 Hardware installation
|
||||
3.2 Driver files
|
||||
3.3 Device naming convention
|
||||
3.4 Module driver configuration
|
||||
3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x.
|
||||
3.6 Custom configuration
|
||||
3.7 Verify driver installation
|
||||
3.2 Device naming convention
|
||||
4. Utilities
|
||||
5. Setserial
|
||||
6. Troubleshooting
|
||||
@ -31,14 +20,13 @@ Date: 01/21/2008
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The Smartio/Industio/UPCI family Linux driver supports following multiport
|
||||
boards.
|
||||
boards:
|
||||
|
||||
- 2 ports multiport board
|
||||
CP-102U, CP-102UL, CP-102UF
|
||||
CP-132U-I, CP-132UL,
|
||||
CP-132, CP-132I, CP132S, CP-132IS,
|
||||
CI-132, CI-132I, CI-132IS,
|
||||
(C102H, C102HI, C102HIS, C102P, CP-102, CP-102S)
|
||||
(CP-102, CP-102S)
|
||||
|
||||
- 4 ports multiport board
|
||||
CP-104EL,
|
||||
@ -46,10 +34,7 @@ Date: 01/21/2008
|
||||
CP-134U, CP-134U-I,
|
||||
C104H/PCI, C104HS/PCI,
|
||||
CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL,
|
||||
C104H, C104HS,
|
||||
CI-104J, CI-104JS,
|
||||
CI-134, CI-134I, CI-134IS,
|
||||
(C114HI, CT-114I, C104P),
|
||||
(C114HI, CT-114I),
|
||||
POS-104UL,
|
||||
CB-114,
|
||||
CB-134I
|
||||
@ -58,15 +43,10 @@ Date: 01/21/2008
|
||||
CP-118EL, CP-168EL,
|
||||
CP-118U, CP-168U,
|
||||
C168H/PCI,
|
||||
C168H, C168HS,
|
||||
(C168P),
|
||||
CB-108
|
||||
|
||||
This driver and installation procedure have been developed upon Linux Kernel
|
||||
2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order
|
||||
to maintain compatibility, this version has also been properly tested with
|
||||
RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem
|
||||
occurs, please contact Moxa at support@moxa.com.tw.
|
||||
If a compatibility problem occurs, please contact Moxa at
|
||||
support@moxa.com.tw.
|
||||
|
||||
In addition to device driver, useful utilities are also provided in this
|
||||
version. They are:
|
||||
@ -78,22 +58,19 @@ Date: 01/21/2008
|
||||
Monitor program to observe data count and line status signals.
|
||||
- msterm A simple terminal program which is useful in testing serial
|
||||
ports.
|
||||
- io-irq.exe
|
||||
Configuration program to setup ISA boards. Please note that
|
||||
this program can only be executed under DOS.
|
||||
|
||||
All the drivers and utilities are published in form of source code under
|
||||
GNU General Public License in this version. Please refer to GNU General
|
||||
Public License announcement in each source code file for more detail.
|
||||
|
||||
In Moxa's Web sites, you may always find latest driver at http://www.moxa.com/.
|
||||
In Moxa's Web sites, you may always find the latest driver at
|
||||
https://www.moxa.com/.
|
||||
|
||||
This version of driver can be installed as Loadable Module (Module driver)
|
||||
or built-in into kernel (Static driver). You may refer to following
|
||||
installation procedure for suitable one. Before you install the driver,
|
||||
This version of driver can be installed as a Loadable Module (Module driver)
|
||||
or built-in into kernel (Static driver). Before you install the driver,
|
||||
please refer to hardware installation procedure in the User's Manual.
|
||||
|
||||
We assume the user should be familiar with following documents.
|
||||
We assume the user should be familiar with following documents:
|
||||
|
||||
- Serial-HOWTO
|
||||
- Kernel-HOWTO
|
||||
@ -101,9 +78,6 @@ Date: 01/21/2008
|
||||
2. System Requirement
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Hardware platform: Intel x86 machine
|
||||
- Kernel version: 2.4.x or 2.6.x
|
||||
- gcc version 2.72 or later
|
||||
- Maximum 4 boards can be installed in combination
|
||||
|
||||
3. Installation
|
||||
@ -112,23 +86,12 @@ Date: 01/21/2008
|
||||
3.1 Hardware installation
|
||||
=========================
|
||||
|
||||
There are two types of buses, ISA and PCI, for Smartio/Industio
|
||||
family multiport board.
|
||||
|
||||
ISA board
|
||||
---------
|
||||
|
||||
You'll have to configure CAP address, I/O address, Interrupt Vector
|
||||
as well as IRQ before installing this driver. Please refer to hardware
|
||||
installation procedure in User's Manual before proceed any further.
|
||||
Please make sure the JP1 is open after the ISA board is set properly.
|
||||
|
||||
PCI/UPCI board
|
||||
--------------
|
||||
|
||||
You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict
|
||||
with other ISA devices. Please refer to hardware installation
|
||||
procedure in User's Manual in advance.
|
||||
You may need to adjust IRQ usage in BIOS to avoid IRQ conflict with other
|
||||
ISA devices. Please refer to hardware installation procedure in User's
|
||||
Manual in advance.
|
||||
|
||||
PCI IRQ Sharing
|
||||
---------------
|
||||
@ -138,42 +101,11 @@ PCI IRQ Sharing
|
||||
together on one system and they can share the same IRQ.
|
||||
|
||||
|
||||
3.2 Driver files
|
||||
================
|
||||
|
||||
The driver file may be obtained from ftp, CD-ROM or floppy disk. The
|
||||
first step, anyway, is to copy driver file "mxser.tgz" into specified
|
||||
directory. e.g. /moxa. The execute commands as below::
|
||||
|
||||
# cd /
|
||||
# mkdir moxa
|
||||
# cd /moxa
|
||||
# tar xvf /dev/fd0
|
||||
|
||||
or::
|
||||
|
||||
# cd /
|
||||
# mkdir moxa
|
||||
# cd /moxa
|
||||
# cp /mnt/cdrom/<driver directory>/mxser.tgz .
|
||||
# tar xvfz mxser.tgz
|
||||
|
||||
|
||||
3.3 Device naming convention
|
||||
3.2 Device naming convention
|
||||
============================
|
||||
|
||||
You may find all the driver and utilities files in /moxa/mxser.
|
||||
Following installation procedure depends on the model you'd like to
|
||||
run the driver. If you prefer module driver, please refer to 3.4.
|
||||
If static driver is required, please refer to 3.5.
|
||||
|
||||
Dialin and callout port
|
||||
-----------------------
|
||||
|
||||
This driver remains traditional serial device properties. There are
|
||||
two special file name for each serial port. One is dial-in port
|
||||
which is named "ttyMxx". For callout port, the naming convention
|
||||
is "cumxx".
|
||||
The device node is named "ttyMxx".
|
||||
|
||||
Device naming when more than 2 boards installed
|
||||
-----------------------------------------------
|
||||
@ -181,322 +113,13 @@ Device naming when more than 2 boards installed
|
||||
Naming convention for each Smartio/Industio multiport board is
|
||||
pre-defined as below.
|
||||
|
||||
============ =============== ==============
|
||||
Board Num. Dial-in Port Callout port
|
||||
1st board ttyM0 - ttyM7 cum0 - cum7
|
||||
2nd board ttyM8 - ttyM15 cum8 - cum15
|
||||
3rd board ttyM16 - ttyM23 cum16 - cum23
|
||||
4th board ttyM24 - ttym31 cum24 - cum31
|
||||
============ =============== ==============
|
||||
|
||||
.. note::
|
||||
|
||||
Under Kernel 2.6 and upper, the cum Device is Obsolete. So use ttyM*
|
||||
device instead.
|
||||
|
||||
Board sequence
|
||||
--------------
|
||||
|
||||
This driver will activate ISA boards according to the parameter set
|
||||
in the driver. After all specified ISA board activated, PCI board
|
||||
will be installed in the system automatically driven.
|
||||
Therefore the board number is sorted by the CAP address of ISA boards.
|
||||
For PCI boards, their sequence will be after ISA boards and C168H/PCI
|
||||
has higher priority than C104H/PCI boards.
|
||||
|
||||
3.4 Module driver configuration
|
||||
===============================
|
||||
|
||||
Module driver is easiest way to install. If you prefer static driver
|
||||
installation, please skip this paragraph.
|
||||
|
||||
|
||||
------------- Prepare to use the MOXA driver --------------------
|
||||
|
||||
3.4.1 Create tty device with correct major number
|
||||
-------------------------------------------------
|
||||
|
||||
Before using MOXA driver, your system must have the tty devices
|
||||
which are created with driver's major number. We offer one shell
|
||||
script "msmknod" to simplify the procedure.
|
||||
This step is only needed to be executed once. But you still
|
||||
need to do this procedure when:
|
||||
|
||||
a. You change the driver's major number. Please refer the "3.7"
|
||||
section.
|
||||
b. Your total installed MOXA boards number is changed. Maybe you
|
||||
add/delete one MOXA board.
|
||||
c. You want to change the tty name. This needs to modify the
|
||||
shell script "msmknod"
|
||||
|
||||
The procedure is::
|
||||
|
||||
# cd /moxa/mxser/driver
|
||||
# ./msmknod
|
||||
|
||||
This shell script will require the major number for dial-in
|
||||
device and callout device to create tty device. You also need
|
||||
to specify the total installed MOXA board number. Default major
|
||||
numbers for dial-in device and callout device are 30, 35. If
|
||||
you need to change to other number, please refer section "3.7"
|
||||
for more detailed procedure.
|
||||
Msmknod will delete any special files occupying the same device
|
||||
naming.
|
||||
|
||||
3.4.2 Build the MOXA driver and utilities
|
||||
-----------------------------------------
|
||||
|
||||
Before using the MOXA driver and utilities, you need compile the
|
||||
all the source code. This step is only need to be executed once.
|
||||
But you still re-compile the source code if you modify the source
|
||||
code. For example, if you change the driver's major number (see
|
||||
"3.7" section), then you need to do this step again.
|
||||
|
||||
Find "Makefile" in /moxa/mxser, then run
|
||||
|
||||
# make clean; make install
|
||||
|
||||
..note::
|
||||
|
||||
For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1:
|
||||
# make clean; make installsp1
|
||||
|
||||
For Red Hat Enterprise Linux AS4/ES4/WS4:
|
||||
# make clean; make installsp2
|
||||
|
||||
The driver files "mxser.o" and utilities will be properly compiled
|
||||
and copied to system directories respectively.
|
||||
|
||||
------------- Load MOXA driver--------------------
|
||||
|
||||
3.4.3 Load the MOXA driver
|
||||
--------------------------
|
||||
|
||||
::
|
||||
|
||||
# modprobe mxser <argument>
|
||||
|
||||
will activate the module driver. You may run "lsmod" to check
|
||||
if "mxser" is activated. If the MOXA board is ISA board, the
|
||||
<argument> is needed. Please refer to section "3.4.5" for more
|
||||
information.
|
||||
|
||||
------------- Load MOXA driver on boot --------------------
|
||||
|
||||
3.4.4 Load the mxser driver
|
||||
---------------------------
|
||||
|
||||
|
||||
For the above description, you may manually execute
|
||||
"modprobe mxser" to activate this driver and run
|
||||
"rmmod mxser" to remove it.
|
||||
|
||||
However, it's better to have a boot time configuration to
|
||||
eliminate manual operation. Boot time configuration can be
|
||||
achieved by rc file. We offer one "rc.mxser" file to simplify
|
||||
the procedure under "moxa/mxser/driver".
|
||||
|
||||
But if you use ISA board, please modify the "modprobe ..." command
|
||||
to add the argument (see "3.4.5" section). After modifying the
|
||||
rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser"
|
||||
manually to make sure the modification is ok. If any error
|
||||
encountered, please try to modify again. If the modification is
|
||||
completed, follow the below step.
|
||||
|
||||
Run following command for setting rc files::
|
||||
|
||||
# cd /moxa/mxser/driver
|
||||
# cp ./rc.mxser /etc/rc.d
|
||||
# cd /etc/rc.d
|
||||
|
||||
Check "rc.serial" is existed or not. If "rc.serial" doesn't exist,
|
||||
create it by vi, run "chmod 755 rc.serial" to change the permission.
|
||||
|
||||
Add "/etc/rc.d/rc.mxser" in last line.
|
||||
|
||||
Reboot and check if moxa.o activated by "lsmod" command.
|
||||
|
||||
3.4.5. specify CAP address
|
||||
--------------------------
|
||||
|
||||
If you'd like to drive Smartio/Industio ISA boards in the system,
|
||||
you'll have to add parameter to specify CAP address of given
|
||||
board while activating "mxser.o". The format for parameters are
|
||||
as follows.::
|
||||
|
||||
modprobe mxser ioaddr=0x???,0x???,0x???,0x???
|
||||
| | | |
|
||||
| | | +- 4th ISA board
|
||||
| | +------ 3rd ISA board
|
||||
| +------------ 2nd ISA board
|
||||
+-------------------1st ISA board
|
||||
|
||||
3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x
|
||||
================================================================
|
||||
|
||||
Note:
|
||||
To use static driver, you must install the linux kernel
|
||||
source package.
|
||||
|
||||
3.5.1 Backup the built-in driver in the kernel
|
||||
----------------------------------------------
|
||||
|
||||
::
|
||||
|
||||
# cd /usr/src/linux/drivers/char
|
||||
# mv mxser.c mxser.c.old
|
||||
|
||||
For Red Hat 7.x user, you need to create link:
|
||||
# cd /usr/src
|
||||
# ln -s linux-2.4 linux
|
||||
|
||||
3.5.2 Create link
|
||||
-----------------
|
||||
::
|
||||
|
||||
# cd /usr/src/linux/drivers/char
|
||||
# ln -s /moxa/mxser/driver/mxser.c mxser.c
|
||||
|
||||
3.5.3 Add CAP address list for ISA boards.
|
||||
------------------------------------------
|
||||
|
||||
For PCI boards user, please skip this step.
|
||||
|
||||
In module mode, the CAP address for ISA board is given by
|
||||
parameter. In static driver configuration, you'll have to
|
||||
assign it within driver's source code. If you will not
|
||||
install any ISA boards, you may skip to next portion.
|
||||
The instructions to modify driver source code are as
|
||||
below.
|
||||
|
||||
a. run::
|
||||
|
||||
# cd /moxa/mxser/driver
|
||||
# vi mxser.c
|
||||
|
||||
b. Find the array mxserBoardCAP[] as below::
|
||||
|
||||
static int mxserBoardCAP[] = {0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
c. Change the address within this array using vi. For
|
||||
example, to driver 2 ISA boards with CAP address
|
||||
0x280 and 0x180 as 1st and 2nd board. Just to change
|
||||
the source code as follows::
|
||||
|
||||
static int mxserBoardCAP[] = {0x280, 0x180, 0x00, 0x00};
|
||||
|
||||
3.5.4 Setup kernel configuration
|
||||
--------------------------------
|
||||
|
||||
Configure the kernel::
|
||||
|
||||
# cd /usr/src/linux
|
||||
# make menuconfig
|
||||
|
||||
You will go into a menu-driven system. Please select [Character
|
||||
devices][Non-standard serial port support], enable the [Moxa
|
||||
SmartIO support] driver with "[*]" for built-in (not "[M]"), then
|
||||
select [Exit] to exit this program.
|
||||
|
||||
3.5.5 Rebuild kernel
|
||||
--------------------
|
||||
|
||||
The following are for Linux kernel rebuilding, for your
|
||||
reference only.
|
||||
|
||||
For appropriate details, please refer to the Linux document:
|
||||
|
||||
a. Run the following commands::
|
||||
|
||||
cd /usr/src/linux
|
||||
make clean # take a few minutes
|
||||
make dep # take a few minutes
|
||||
make bzImage # take probably 10-20 minutes
|
||||
make install # copy boot image to correct position
|
||||
|
||||
f. Please make sure the boot kernel (vmlinuz) is in the
|
||||
correct position.
|
||||
g. If you use 'lilo' utility, you should check /etc/lilo.conf
|
||||
'image' item specified the path which is the 'vmlinuz' path,
|
||||
or you will load wrong (or old) boot kernel image (vmlinuz).
|
||||
After checking /etc/lilo.conf, please run "lilo".
|
||||
|
||||
Note that if the result of "make bzImage" is ERROR, then you have to
|
||||
go back to Linux configuration Setup. Type "make menuconfig" in
|
||||
directory /usr/src/linux.
|
||||
|
||||
|
||||
3.5.6 Make tty device and special file
|
||||
--------------------------------------
|
||||
|
||||
::
|
||||
# cd /moxa/mxser/driver
|
||||
# ./msmknod
|
||||
|
||||
3.5.7 Make utility
|
||||
------------------
|
||||
|
||||
::
|
||||
|
||||
# cd /moxa/mxser/utility
|
||||
# make clean; make install
|
||||
|
||||
3.5.8 Reboot
|
||||
------------
|
||||
|
||||
|
||||
|
||||
3.6 Custom configuration
|
||||
========================
|
||||
|
||||
Although this driver already provides you default configuration, you
|
||||
still can change the device name and major number. The instruction to
|
||||
change these parameters are shown as below.
|
||||
|
||||
a. Change Device name
|
||||
|
||||
If you'd like to use other device names instead of default naming
|
||||
convention, all you have to do is to modify the internal code
|
||||
within the shell script "msmknod". First, you have to open "msmknod"
|
||||
by vi. Locate each line contains "ttyM" and "cum" and change them
|
||||
to the device name you desired. "msmknod" creates the device names
|
||||
you need next time executed.
|
||||
|
||||
b. Change Major number
|
||||
|
||||
If major number 30 and 35 had been occupied, you may have to select
|
||||
2 free major numbers for this driver. There are 3 steps to change
|
||||
major numbers.
|
||||
|
||||
3.6.1 Find free major numbers
|
||||
-----------------------------
|
||||
|
||||
In /proc/devices, you may find all the major numbers occupied
|
||||
in the system. Please select 2 major numbers that are available.
|
||||
e.g. 40, 45.
|
||||
|
||||
3.6.2 Create special files
|
||||
--------------------------
|
||||
|
||||
Run /moxa/mxser/driver/msmknod to create special files with
|
||||
specified major numbers.
|
||||
|
||||
3.6.3 Modify driver with new major number
|
||||
-----------------------------------------
|
||||
|
||||
Run vi to open /moxa/mxser/driver/mxser.c. Locate the line
|
||||
contains "MXSERMAJOR". Change the content as below::
|
||||
|
||||
#define MXSERMAJOR 40
|
||||
#define MXSERCUMAJOR 45
|
||||
|
||||
3.6.4 Run "make clean; make install" in /moxa/mxser/driver.
|
||||
|
||||
3.7 Verify driver installation
|
||||
==============================
|
||||
|
||||
You may refer to /var/log/messages to check the latest status
|
||||
log reported by this driver whenever it's activated.
|
||||
============ ===============
|
||||
Board Num. Device node
|
||||
1st board ttyM0 - ttyM7
|
||||
2nd board ttyM8 - ttyM15
|
||||
3rd board ttyM16 - ttyM23
|
||||
4th board ttyM24 - ttyM31
|
||||
============ ===============
|
||||
|
||||
4. Utilities
|
||||
^^^^^^^^^^^^
|
||||
@ -505,14 +128,11 @@ b. Change Major number
|
||||
msterm. These 3 utilities are released in form of source code. They should
|
||||
be compiled into executable file and copied into /usr/bin.
|
||||
|
||||
Before using these utilities, please load driver (refer 3.4 & 3.5) and
|
||||
make sure you had run the "msmknod" utility.
|
||||
|
||||
msdiag - Diagnostic
|
||||
===================
|
||||
|
||||
This utility provides the function to display what Moxa Smartio/Industio
|
||||
board found by driver in the system.
|
||||
board was found by the driver in the system.
|
||||
|
||||
msmon - Port Monitoring
|
||||
=======================
|
||||
@ -542,23 +162,23 @@ msterm - Terminal Emulation
|
||||
|
||||
Supported Setserial parameters are listed as below.
|
||||
|
||||
============== =========================================================
|
||||
uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO)
|
||||
close_delay set the amount of time(in 1/100 of a second) that DTR
|
||||
============== =============================================================
|
||||
uart set UART type(16450 --> disable FIFO, 16550A --> enable FIFO)
|
||||
close_delay set the amount of time (in 1/100 of a second) that DTR
|
||||
should be kept low while being closed.
|
||||
closing_wait set the amount of time(in 1/100 of a second) that the
|
||||
closing_wait set the amount of time (in 1/100 of a second) that the
|
||||
serial port should wait for data to be drained while
|
||||
being closed, before the receiver is disable.
|
||||
spd_hi Use 57.6kb when the application requests 38.4kb.
|
||||
spd_vhi Use 115.2kb when the application requests 38.4kb.
|
||||
spd_shi Use 230.4kb when the application requests 38.4kb.
|
||||
spd_warp Use 460.8kb when the application requests 38.4kb.
|
||||
spd_normal Use 38.4kb when the application requests 38.4kb.
|
||||
spd_cust Use the custom divisor to set the speed when the
|
||||
being closed, before the receiver is disabled.
|
||||
spd_hi Use 57.6kb when the application requests 38.4kb.
|
||||
spd_vhi Use 115.2kb when the application requests 38.4kb.
|
||||
spd_shi Use 230.4kb when the application requests 38.4kb.
|
||||
spd_warp Use 460.8kb when the application requests 38.4kb.
|
||||
spd_normal Use 38.4kb when the application requests 38.4kb.
|
||||
spd_cust Use the custom divisor to set the speed when the
|
||||
application requests 38.4kb.
|
||||
divisor This option set the custom division.
|
||||
baud_base This option set the base baud rate.
|
||||
============== =========================================================
|
||||
divisor This option sets the custom division.
|
||||
baud_base This option sets the base baud rate.
|
||||
============== =============================================================
|
||||
|
||||
6. Troubleshooting
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
@ -575,41 +195,3 @@ msterm - Terminal Emulation
|
||||
Solution:
|
||||
To avoid this problem, please unplug fifth and after board, because Moxa
|
||||
driver supports up to 4 boards.
|
||||
|
||||
Error msg:
|
||||
Request_irq fail, IRQ(?) may be conflict with another device.
|
||||
|
||||
Solution:
|
||||
Other PCI or ISA devices occupy the assigned IRQ. If you are not sure
|
||||
which device causes the situation, please check /proc/interrupts to find
|
||||
free IRQ and simply change another free IRQ for Moxa board.
|
||||
|
||||
Error msg:
|
||||
Board #: C1xx Series(CAP=xxx) interrupt number invalid.
|
||||
|
||||
Solution:
|
||||
Each port within the same multiport board shares the same IRQ. Please set
|
||||
one IRQ (IRQ doesn't equal to zero) for one Moxa board.
|
||||
|
||||
Error msg:
|
||||
No interrupt vector be set for Moxa ISA board(CAP=xxx).
|
||||
|
||||
Solution:
|
||||
Moxa ISA board needs an interrupt vector.Please refer to user's manual
|
||||
"Hardware Installation" chapter to set interrupt vector.
|
||||
|
||||
Error msg:
|
||||
Couldn't install MOXA Smartio/Industio family driver!
|
||||
|
||||
Solution:
|
||||
Load Moxa driver fail, the major number may conflict with other devices.
|
||||
Please refer to previous section 3.7 to change a free major number for
|
||||
Moxa driver.
|
||||
|
||||
Error msg:
|
||||
Couldn't install MOXA Smartio/Industio family callout driver!
|
||||
|
||||
Solution:
|
||||
Load Moxa callout driver fail, the callout device major number may
|
||||
conflict with other devices. Please refer to previous section 3.7 to
|
||||
change a free callout device major number for Moxa driver.
|
||||
|
@ -69,9 +69,9 @@ There are debugfs parameters provided for serial communication.
|
||||
|
||||
- 0x01 - tty->warned is on.
|
||||
- 0x04 - tty->packed is on.
|
||||
- 0x08 - tty->flow_stopped is on.
|
||||
- 0x08 - tty->flow.tco_stopped is on.
|
||||
- 0x10 - tty->hw_stopped is on.
|
||||
- 0x20 - tty->stopped is on.
|
||||
- 0x20 - tty->flow.stopped is on.
|
||||
|
||||
* last_tx_msg: Binary blob Prints the last transmitted frame.
|
||||
|
||||
|
@ -12527,7 +12527,8 @@ S: Maintained
|
||||
F: drivers/net/phy/motorcomm.c
|
||||
|
||||
MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
|
||||
S: Orphan
|
||||
M: Jiri Slaby <jirislaby@kernel.org>
|
||||
S: Maintained
|
||||
F: Documentation/driver-api/serial/moxa-smartio.rst
|
||||
F: drivers/tty/mxser.*
|
||||
|
||||
@ -18771,9 +18772,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
|
||||
F: Documentation/driver-api/serial/
|
||||
F: drivers/tty/
|
||||
F: drivers/tty/serial/serial_core.c
|
||||
F: include/linux/selection.h
|
||||
F: include/linux/serial.h
|
||||
F: include/linux/serial_core.h
|
||||
F: include/linux/tty.h
|
||||
F: include/linux/sysrq.h
|
||||
F: include/linux/tty*.h
|
||||
F: include/linux/vt.h
|
||||
F: include/linux/vt_*.h
|
||||
F: include/uapi/linux/serial.h
|
||||
F: include/uapi/linux/serial_core.h
|
||||
F: include/uapi/linux/tty.h
|
||||
|
@ -142,18 +142,12 @@ srmcons_write(struct tty_struct *tty,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int
|
||||
static unsigned int
|
||||
srmcons_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 512;
|
||||
}
|
||||
|
||||
static int
|
||||
srmcons_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
srmcons_open(struct tty_struct *tty, struct file *filp)
|
||||
{
|
||||
@ -200,7 +194,6 @@ static const struct tty_operations srmcons_ops = {
|
||||
.close = srmcons_close,
|
||||
.write = srmcons_write,
|
||||
.write_room = srmcons_write_room,
|
||||
.chars_in_buffer= srmcons_chars_in_buffer,
|
||||
};
|
||||
|
||||
static int __init
|
||||
|
@ -651,6 +651,7 @@
|
||||
&uart2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_uart2>;
|
||||
fsl,dma-info = <24 20>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -670,6 +671,7 @@
|
||||
&uart5 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_uart5>;
|
||||
fsl,dma-info = <4096 4>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
@ -134,7 +134,7 @@
|
||||
|
||||
uart0: serial@12000 {
|
||||
compatible = "marvell,armada-3700-uart";
|
||||
reg = <0x12000 0x200>;
|
||||
reg = <0x12000 0x18>;
|
||||
clocks = <&xtalclk>;
|
||||
interrupts =
|
||||
<GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
|
||||
|
@ -85,7 +85,7 @@ static int nfcon_tty_put_char(struct tty_struct *tty, unsigned char ch)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int nfcon_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int nfcon_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
@ -33,7 +33,8 @@
|
||||
.irq = int, \
|
||||
.uartclk = 1843200, \
|
||||
.iotype = UPIO_PORT, \
|
||||
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
|
||||
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | \
|
||||
UPF_MAGIC_MULTIPLIER, \
|
||||
.regshift = 0, \
|
||||
}
|
||||
|
||||
|
@ -103,22 +103,16 @@ static int pdc_console_tty_write(struct tty_struct *tty, const unsigned char *bu
|
||||
return count;
|
||||
}
|
||||
|
||||
static int pdc_console_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int pdc_console_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 32768; /* no limit, no buffer used */
|
||||
}
|
||||
|
||||
static int pdc_console_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
return 0; /* no buffer */
|
||||
}
|
||||
|
||||
static const struct tty_operations pdc_console_tty_ops = {
|
||||
.open = pdc_console_tty_open,
|
||||
.close = pdc_console_tty_close,
|
||||
.write = pdc_console_tty_write,
|
||||
.write_room = pdc_console_tty_write_room,
|
||||
.chars_in_buffer = pdc_console_tty_chars_in_buffer,
|
||||
};
|
||||
|
||||
static void pdc_console_poll(struct timer_list *unused)
|
||||
|
@ -621,7 +621,6 @@ CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_VIRTIO=m
|
||||
CONFIG_NVRAM=y
|
||||
CONFIG_DTLK=m
|
||||
CONFIG_R3964=m
|
||||
CONFIG_CARDMAN_4000=m
|
||||
CONFIG_CARDMAN_4040=m
|
||||
CONFIG_IPWIRELESS=m
|
||||
|
@ -32,7 +32,7 @@ static irqreturn_t line_interrupt(int irq, void *data)
|
||||
*
|
||||
* Should be called while holding line->lock (this does not modify data).
|
||||
*/
|
||||
static int write_room(struct line *line)
|
||||
static unsigned int write_room(struct line *line)
|
||||
{
|
||||
int n;
|
||||
|
||||
@ -47,11 +47,11 @@ static int write_room(struct line *line)
|
||||
return n - 1;
|
||||
}
|
||||
|
||||
int line_write_room(struct tty_struct *tty)
|
||||
unsigned int line_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct line *line = tty->driver_data;
|
||||
unsigned long flags;
|
||||
int room;
|
||||
unsigned int room;
|
||||
|
||||
spin_lock_irqsave(&line->lock, flags);
|
||||
room = write_room(line);
|
||||
@ -60,11 +60,11 @@ int line_write_room(struct tty_struct *tty)
|
||||
return room;
|
||||
}
|
||||
|
||||
int line_chars_in_buffer(struct tty_struct *tty)
|
||||
unsigned int line_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct line *line = tty->driver_data;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
unsigned int ret;
|
||||
|
||||
spin_lock_irqsave(&line->lock, flags);
|
||||
/* write_room subtracts 1 for the needed NULL, so we readd it.*/
|
||||
@ -211,11 +211,6 @@ out_up:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void line_set_termios(struct tty_struct *tty, struct ktermios * old)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
void line_throttle(struct tty_struct *tty)
|
||||
{
|
||||
struct line *line = tty->driver_data;
|
||||
|
@ -66,11 +66,10 @@ extern int line_setup(char **conf, unsigned nlines, char **def,
|
||||
char *init, char *name);
|
||||
extern int line_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
int len);
|
||||
extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
|
||||
extern int line_chars_in_buffer(struct tty_struct *tty);
|
||||
extern unsigned int line_chars_in_buffer(struct tty_struct *tty);
|
||||
extern void line_flush_buffer(struct tty_struct *tty);
|
||||
extern void line_flush_chars(struct tty_struct *tty);
|
||||
extern int line_write_room(struct tty_struct *tty);
|
||||
extern unsigned int line_write_room(struct tty_struct *tty);
|
||||
extern void line_throttle(struct tty_struct *tty);
|
||||
extern void line_unthrottle(struct tty_struct *tty);
|
||||
|
||||
|
@ -99,7 +99,6 @@ static const struct tty_operations ssl_ops = {
|
||||
.chars_in_buffer = line_chars_in_buffer,
|
||||
.flush_buffer = line_flush_buffer,
|
||||
.flush_chars = line_flush_chars,
|
||||
.set_termios = line_set_termios,
|
||||
.throttle = line_throttle,
|
||||
.unthrottle = line_unthrottle,
|
||||
.install = ssl_install,
|
||||
|
@ -106,7 +106,6 @@ static const struct tty_operations console_ops = {
|
||||
.chars_in_buffer = line_chars_in_buffer,
|
||||
.flush_buffer = line_flush_buffer,
|
||||
.flush_chars = line_flush_chars,
|
||||
.set_termios = line_set_termios,
|
||||
.throttle = line_throttle,
|
||||
.unthrottle = line_unthrottle,
|
||||
.hangup = line_hangup,
|
||||
|
@ -100,18 +100,12 @@ static void rs_flush_chars(struct tty_struct *tty)
|
||||
{
|
||||
}
|
||||
|
||||
static int rs_write_room(struct tty_struct *tty)
|
||||
static unsigned int rs_write_room(struct tty_struct *tty)
|
||||
{
|
||||
/* Let's say iss can always accept 2K characters.. */
|
||||
return 2 * 1024;
|
||||
}
|
||||
|
||||
static int rs_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
/* the iss doesn't buffer characters */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rs_hangup(struct tty_struct *tty)
|
||||
{
|
||||
/* Stub, once again.. */
|
||||
@ -135,7 +129,6 @@ static const struct tty_operations serial_ops = {
|
||||
.put_char = rs_put_char,
|
||||
.flush_chars = rs_flush_chars,
|
||||
.write_room = rs_write_room,
|
||||
.chars_in_buffer = rs_chars_in_buffer,
|
||||
.hangup = rs_hangup,
|
||||
.wait_until_sent = rs_wait_until_sent,
|
||||
.proc_show = rs_proc_show,
|
||||
|
@ -72,7 +72,8 @@ static void spk_ttyio_ldisc_close(struct tty_struct *tty)
|
||||
}
|
||||
|
||||
static int spk_ttyio_receive_buf2(struct tty_struct *tty,
|
||||
const unsigned char *cp, char *fp, int count)
|
||||
const unsigned char *cp,
|
||||
const char *fp, int count)
|
||||
{
|
||||
struct spk_ldisc_data *ldisc_data = tty->disc_data;
|
||||
struct spk_synth *synth = ldisc_data->synth;
|
||||
@ -104,6 +105,7 @@ static int spk_ttyio_receive_buf2(struct tty_struct *tty,
|
||||
|
||||
static struct tty_ldisc_ops spk_ttyio_ldisc_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_SPEAKUP,
|
||||
.name = "speakup_ldisc",
|
||||
.open = spk_ttyio_ldisc_open,
|
||||
.close = spk_ttyio_ldisc_close,
|
||||
@ -211,14 +213,13 @@ static int spk_ttyio_initialise_ldisc(struct spk_synth *synth)
|
||||
|
||||
void spk_ttyio_register_ldisc(void)
|
||||
{
|
||||
if (tty_register_ldisc(N_SPEAKUP, &spk_ttyio_ldisc_ops))
|
||||
if (tty_register_ldisc(&spk_ttyio_ldisc_ops))
|
||||
pr_warn("speakup: Error registering line discipline. Most synths won't work.\n");
|
||||
}
|
||||
|
||||
void spk_ttyio_unregister_ldisc(void)
|
||||
{
|
||||
if (tty_unregister_ldisc(N_SPEAKUP))
|
||||
pr_warn("speakup: Couldn't unregister ldisc\n");
|
||||
tty_unregister_ldisc(&spk_ttyio_ldisc_ops);
|
||||
}
|
||||
|
||||
static int spk_ttyio_out(struct spk_synth *in_synth, const char ch)
|
||||
|
@ -593,7 +593,7 @@ static void hci_uart_tty_wakeup(struct tty_struct *tty)
|
||||
* Return Value: None
|
||||
*/
|
||||
static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
|
||||
char *flags, int count)
|
||||
const char *flags, int count)
|
||||
{
|
||||
struct hci_uart *hu = tty->disc_data;
|
||||
|
||||
@ -821,6 +821,7 @@ static __poll_t hci_uart_tty_poll(struct tty_struct *tty,
|
||||
|
||||
static struct tty_ldisc_ops hci_uart_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_HCI,
|
||||
.name = "n_hci",
|
||||
.open = hci_uart_tty_open,
|
||||
.close = hci_uart_tty_close,
|
||||
@ -840,7 +841,7 @@ static int __init hci_uart_init(void)
|
||||
BT_INFO("HCI UART driver ver %s", VERSION);
|
||||
|
||||
/* Register the tty discipline */
|
||||
err = tty_register_ldisc(N_HCI, &hci_uart_ldisc);
|
||||
err = tty_register_ldisc(&hci_uart_ldisc);
|
||||
if (err) {
|
||||
BT_ERR("HCI line discipline registration failed. (%d)", err);
|
||||
return err;
|
||||
@ -882,8 +883,6 @@ static int __init hci_uart_init(void)
|
||||
|
||||
static void __exit hci_uart_exit(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
#ifdef CONFIG_BT_HCIUART_H4
|
||||
h4_deinit();
|
||||
#endif
|
||||
@ -915,10 +914,7 @@ static void __exit hci_uart_exit(void)
|
||||
mrvl_deinit();
|
||||
#endif
|
||||
|
||||
/* Release tty registration of line discipline */
|
||||
err = tty_unregister_ldisc(N_HCI);
|
||||
if (err)
|
||||
BT_ERR("Can't unregister HCI line discipline (%d)", err);
|
||||
tty_unregister_ldisc(&hci_uart_ldisc);
|
||||
}
|
||||
|
||||
module_init(hci_uart_init);
|
||||
|
@ -218,19 +218,6 @@ config XILINX_HWICAP
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config R3964
|
||||
tristate "Siemens R3964 line discipline"
|
||||
depends on TTY && BROKEN
|
||||
help
|
||||
This driver allows synchronous communication with devices using the
|
||||
Siemens R3964 packet protocol. Unless you are dealing with special
|
||||
hardware like PLCs, you are unlikely to need this.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called n_r3964.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config APPLICOM
|
||||
tristate "Applicom intelligent fieldbus card support"
|
||||
depends on PCI
|
||||
|
@ -985,7 +985,7 @@ static void tx_done(MGSLPC_INFO *info, struct tty_struct *tty)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (tty && (tty->stopped || tty->hw_stopped)) {
|
||||
if (tty && (tty->flow.stopped || tty->hw_stopped)) {
|
||||
tx_stop(info);
|
||||
return;
|
||||
}
|
||||
@ -1005,7 +1005,7 @@ static void tx_ready(MGSLPC_INFO *info, struct tty_struct *tty)
|
||||
if (!info->tx_active)
|
||||
return;
|
||||
} else {
|
||||
if (tty && (tty->stopped || tty->hw_stopped)) {
|
||||
if (tty && (tty->flow.stopped || tty->hw_stopped)) {
|
||||
tx_stop(info);
|
||||
return;
|
||||
}
|
||||
@ -1419,13 +1419,7 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty)
|
||||
|
||||
/* byte size and parity */
|
||||
|
||||
switch (cflag & CSIZE) {
|
||||
case CS5: info->params.data_bits = 5; break;
|
||||
case CS6: info->params.data_bits = 6; break;
|
||||
case CS7: info->params.data_bits = 7; break;
|
||||
case CS8: info->params.data_bits = 8; break;
|
||||
default: info->params.data_bits = 7; break;
|
||||
}
|
||||
info->params.data_bits = tty_get_char_size(cflag);
|
||||
|
||||
if (cflag & CSTOPB)
|
||||
info->params.stop_bits = 2;
|
||||
@ -1525,7 +1519,7 @@ static void mgslpc_flush_chars(struct tty_struct *tty)
|
||||
if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_chars"))
|
||||
return;
|
||||
|
||||
if (info->tx_count <= 0 || tty->stopped ||
|
||||
if (info->tx_count <= 0 || tty->flow.stopped ||
|
||||
tty->hw_stopped || !info->tx_buf)
|
||||
return;
|
||||
|
||||
@ -1594,7 +1588,7 @@ static int mgslpc_write(struct tty_struct * tty,
|
||||
ret += c;
|
||||
}
|
||||
start:
|
||||
if (info->tx_count && !tty->stopped && !tty->hw_stopped) {
|
||||
if (info->tx_count && !tty->flow.stopped && !tty->hw_stopped) {
|
||||
spin_lock_irqsave(&info->lock, flags);
|
||||
if (!info->tx_active)
|
||||
tx_start(info, tty);
|
||||
@ -1609,7 +1603,7 @@ cleanup:
|
||||
|
||||
/* Return the count of free bytes in transmit buffer
|
||||
*/
|
||||
static int mgslpc_write_room(struct tty_struct *tty)
|
||||
static unsigned int mgslpc_write_room(struct tty_struct *tty)
|
||||
{
|
||||
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
|
||||
int ret;
|
||||
@ -1637,10 +1631,10 @@ static int mgslpc_write_room(struct tty_struct *tty)
|
||||
|
||||
/* Return the count of bytes in transmit buffer
|
||||
*/
|
||||
static int mgslpc_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int mgslpc_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
|
||||
int rc;
|
||||
unsigned int rc;
|
||||
|
||||
if (debug_level >= DEBUG_LEVEL_INFO)
|
||||
printk("%s(%d):mgslpc_chars_in_buffer(%s)\n",
|
||||
@ -1655,7 +1649,7 @@ static int mgslpc_chars_in_buffer(struct tty_struct *tty)
|
||||
rc = info->tx_count;
|
||||
|
||||
if (debug_level >= DEBUG_LEVEL_INFO)
|
||||
printk("%s(%d):mgslpc_chars_in_buffer(%s)=%d\n",
|
||||
printk("%s(%d):mgslpc_chars_in_buffer(%s)=%u\n",
|
||||
__FILE__, __LINE__, info->device_name, rc);
|
||||
|
||||
return rc;
|
||||
|
@ -52,12 +52,7 @@ static void tpk_flush(void)
|
||||
|
||||
static int tpk_printk(const unsigned char *buf, int count)
|
||||
{
|
||||
int i = tpk_curr;
|
||||
|
||||
if (buf == NULL) {
|
||||
tpk_flush();
|
||||
return i;
|
||||
}
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (tpk_curr >= TPK_STR_SIZE) {
|
||||
@ -100,12 +95,6 @@ static int tpk_open(struct tty_struct *tty, struct file *filp)
|
||||
static void tpk_close(struct tty_struct *tty, struct file *filp)
|
||||
{
|
||||
struct ttyprintk_port *tpkp = tty->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&tpkp->spinlock, flags);
|
||||
/* flush tpk_printk buffer */
|
||||
tpk_printk(NULL, 0);
|
||||
spin_unlock_irqrestore(&tpkp->spinlock, flags);
|
||||
|
||||
tty_port_close(&tpkp->port, tty, filp);
|
||||
}
|
||||
@ -120,7 +109,6 @@ static int tpk_write(struct tty_struct *tty,
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
|
||||
/* exclusive use of tpk_printk within this tty */
|
||||
spin_lock_irqsave(&tpkp->spinlock, flags);
|
||||
ret = tpk_printk(buf, count);
|
||||
@ -132,32 +120,11 @@ static int tpk_write(struct tty_struct *tty,
|
||||
/*
|
||||
* TTY operations write_room function.
|
||||
*/
|
||||
static int tpk_write_room(struct tty_struct *tty)
|
||||
static unsigned int tpk_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return TPK_MAX_ROOM;
|
||||
}
|
||||
|
||||
/*
|
||||
* TTY operations ioctl function.
|
||||
*/
|
||||
static int tpk_ioctl(struct tty_struct *tty,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct ttyprintk_port *tpkp = tty->driver_data;
|
||||
|
||||
if (!tpkp)
|
||||
return -EINVAL;
|
||||
|
||||
switch (cmd) {
|
||||
/* Stop TIOCCONS */
|
||||
case TIOCCONS:
|
||||
return -EOPNOTSUPP;
|
||||
default:
|
||||
return -ENOIOCTLCMD;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* TTY operations hangup function.
|
||||
*/
|
||||
@ -168,16 +135,31 @@ static void tpk_hangup(struct tty_struct *tty)
|
||||
tty_port_hangup(&tpkp->port);
|
||||
}
|
||||
|
||||
/*
|
||||
* TTY port operations shutdown function.
|
||||
*/
|
||||
static void tpk_port_shutdown(struct tty_port *tport)
|
||||
{
|
||||
struct ttyprintk_port *tpkp =
|
||||
container_of(tport, struct ttyprintk_port, port);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&tpkp->spinlock, flags);
|
||||
tpk_flush();
|
||||
spin_unlock_irqrestore(&tpkp->spinlock, flags);
|
||||
}
|
||||
|
||||
static const struct tty_operations ttyprintk_ops = {
|
||||
.open = tpk_open,
|
||||
.close = tpk_close,
|
||||
.write = tpk_write,
|
||||
.write_room = tpk_write_room,
|
||||
.ioctl = tpk_ioctl,
|
||||
.hangup = tpk_hangup,
|
||||
};
|
||||
|
||||
static const struct tty_port_operations null_ops = { };
|
||||
static const struct tty_port_operations tpk_port_ops = {
|
||||
.shutdown = tpk_port_shutdown,
|
||||
};
|
||||
|
||||
static struct tty_driver *ttyprintk_driver;
|
||||
|
||||
@ -195,7 +177,7 @@ static int __init ttyprintk_init(void)
|
||||
return PTR_ERR(ttyprintk_driver);
|
||||
|
||||
tty_port_init(&tpk_port.port);
|
||||
tpk_port.port.ops = &null_ops;
|
||||
tpk_port.port.ops = &tpk_port_ops;
|
||||
|
||||
ttyprintk_driver->driver_name = "ttyprintk";
|
||||
ttyprintk_driver->name = "ttyprintk";
|
||||
|
@ -114,7 +114,8 @@ static void serport_ldisc_close(struct tty_struct *tty)
|
||||
* 'interrupt' routine.
|
||||
*/
|
||||
|
||||
static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count)
|
||||
static void serport_ldisc_receive(struct tty_struct *tty,
|
||||
const unsigned char *cp, const char *fp, int count)
|
||||
{
|
||||
struct serport *serport = (struct serport*) tty->disc_data;
|
||||
unsigned long flags;
|
||||
@ -273,6 +274,7 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty)
|
||||
|
||||
static struct tty_ldisc_ops serport_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_MOUSE,
|
||||
.name = "input",
|
||||
.open = serport_ldisc_open,
|
||||
.close = serport_ldisc_close,
|
||||
@ -293,7 +295,7 @@ static struct tty_ldisc_ops serport_ldisc = {
|
||||
static int __init serport_init(void)
|
||||
{
|
||||
int retval;
|
||||
retval = tty_register_ldisc(N_MOUSE, &serport_ldisc);
|
||||
retval = tty_register_ldisc(&serport_ldisc);
|
||||
if (retval)
|
||||
printk(KERN_ERR "serport.c: Error registering line discipline.\n");
|
||||
|
||||
@ -302,7 +304,7 @@ static int __init serport_init(void)
|
||||
|
||||
static void __exit serport_exit(void)
|
||||
{
|
||||
tty_unregister_ldisc(N_MOUSE);
|
||||
tty_unregister_ldisc(&serport_ldisc);
|
||||
}
|
||||
|
||||
module_init(serport_init);
|
||||
|
@ -458,14 +458,14 @@ static int ipoctal_write_tty(struct tty_struct *tty,
|
||||
return char_copied;
|
||||
}
|
||||
|
||||
static int ipoctal_write_room(struct tty_struct *tty)
|
||||
static unsigned int ipoctal_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct ipoctal_channel *channel = tty->driver_data;
|
||||
|
||||
return PAGE_SIZE - channel->nb_bytes;
|
||||
}
|
||||
|
||||
static int ipoctal_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int ipoctal_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct ipoctal_channel *channel = tty->driver_data;
|
||||
|
||||
|
@ -1158,8 +1158,6 @@ static void capinc_tty_flush_chars(struct tty_struct *tty)
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
struct sk_buff *skb;
|
||||
|
||||
pr_debug("capinc_tty_flush_chars\n");
|
||||
|
||||
spin_lock_bh(&mp->outlock);
|
||||
skb = mp->outskb;
|
||||
if (skb) {
|
||||
@ -1175,18 +1173,18 @@ static void capinc_tty_flush_chars(struct tty_struct *tty)
|
||||
handle_minor_recv(mp);
|
||||
}
|
||||
|
||||
static int capinc_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int capinc_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
int room;
|
||||
unsigned int room;
|
||||
|
||||
room = CAPINC_MAX_SENDQUEUE-skb_queue_len(&mp->outqueue);
|
||||
room *= CAPI_MAX_BLKSIZE;
|
||||
pr_debug("capinc_tty_write_room = %d\n", room);
|
||||
pr_debug("capinc_tty_write_room = %u\n", room);
|
||||
return room;
|
||||
}
|
||||
|
||||
static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int capinc_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
|
||||
@ -1197,15 +1195,9 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
return mp->outbytes;
|
||||
}
|
||||
|
||||
static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
|
||||
{
|
||||
pr_debug("capinc_tty_set_termios\n");
|
||||
}
|
||||
|
||||
static void capinc_tty_throttle(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
pr_debug("capinc_tty_throttle\n");
|
||||
mp->ttyinstop = 1;
|
||||
}
|
||||
|
||||
@ -1213,7 +1205,6 @@ static void capinc_tty_unthrottle(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
|
||||
pr_debug("capinc_tty_unthrottle\n");
|
||||
mp->ttyinstop = 0;
|
||||
handle_minor_recv(mp);
|
||||
}
|
||||
@ -1222,7 +1213,6 @@ static void capinc_tty_stop(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
|
||||
pr_debug("capinc_tty_stop\n");
|
||||
mp->ttyoutstop = 1;
|
||||
}
|
||||
|
||||
@ -1230,7 +1220,6 @@ static void capinc_tty_start(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
|
||||
pr_debug("capinc_tty_start\n");
|
||||
mp->ttyoutstop = 0;
|
||||
handle_minor_send(mp);
|
||||
}
|
||||
@ -1239,26 +1228,9 @@ static void capinc_tty_hangup(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
|
||||
pr_debug("capinc_tty_hangup\n");
|
||||
tty_port_hangup(&mp->port);
|
||||
}
|
||||
|
||||
static int capinc_tty_break_ctl(struct tty_struct *tty, int state)
|
||||
{
|
||||
pr_debug("capinc_tty_break_ctl(%d)\n", state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void capinc_tty_flush_buffer(struct tty_struct *tty)
|
||||
{
|
||||
pr_debug("capinc_tty_flush_buffer\n");
|
||||
}
|
||||
|
||||
static void capinc_tty_set_ldisc(struct tty_struct *tty)
|
||||
{
|
||||
pr_debug("capinc_tty_set_ldisc\n");
|
||||
}
|
||||
|
||||
static void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
|
||||
{
|
||||
pr_debug("capinc_tty_send_xchar(%d)\n", ch);
|
||||
@ -1272,15 +1244,11 @@ static const struct tty_operations capinc_ops = {
|
||||
.flush_chars = capinc_tty_flush_chars,
|
||||
.write_room = capinc_tty_write_room,
|
||||
.chars_in_buffer = capinc_tty_chars_in_buffer,
|
||||
.set_termios = capinc_tty_set_termios,
|
||||
.throttle = capinc_tty_throttle,
|
||||
.unthrottle = capinc_tty_unthrottle,
|
||||
.stop = capinc_tty_stop,
|
||||
.start = capinc_tty_start,
|
||||
.hangup = capinc_tty_hangup,
|
||||
.break_ctl = capinc_tty_break_ctl,
|
||||
.flush_buffer = capinc_tty_flush_buffer,
|
||||
.set_ldisc = capinc_tty_set_ldisc,
|
||||
.send_xchar = capinc_tty_send_xchar,
|
||||
.install = capinc_tty_install,
|
||||
.cleanup = capinc_tty_cleanup,
|
||||
|
@ -214,7 +214,7 @@ static int bcm_vk_tty_write(struct tty_struct *tty,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int bcm_vk_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int bcm_vk_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct bcm_vk *vk = dev_get_drvdata(tty->dev);
|
||||
|
||||
|
@ -52,13 +52,12 @@ static void remove_channel_from_table(struct st_data_s *st_gdata,
|
||||
*/
|
||||
int st_get_uart_wr_room(struct st_data_s *st_gdata)
|
||||
{
|
||||
struct tty_struct *tty;
|
||||
if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) {
|
||||
pr_err("tty unavailable to perform write");
|
||||
return -1;
|
||||
}
|
||||
tty = st_gdata->tty;
|
||||
return tty->ops->write_room(tty);
|
||||
|
||||
return tty_write_room(st_gdata->tty);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -798,7 +797,7 @@ static void st_tty_close(struct tty_struct *tty)
|
||||
}
|
||||
|
||||
static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,
|
||||
char *tty_flags, int count)
|
||||
const char *tty_flags, int count)
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
print_hex_dump(KERN_DEBUG, ">in>", DUMP_PREFIX_NONE,
|
||||
@ -845,6 +844,7 @@ static void st_tty_flush_buffer(struct tty_struct *tty)
|
||||
}
|
||||
|
||||
static struct tty_ldisc_ops st_ldisc_ops = {
|
||||
.num = N_TI_WL,
|
||||
.name = "n_st",
|
||||
.open = st_tty_open,
|
||||
.close = st_tty_close,
|
||||
@ -860,7 +860,7 @@ int st_core_init(struct st_data_s **core_data)
|
||||
struct st_data_s *st_gdata;
|
||||
long err;
|
||||
|
||||
err = tty_register_ldisc(N_TI_WL, &st_ldisc_ops);
|
||||
err = tty_register_ldisc(&st_ldisc_ops);
|
||||
if (err) {
|
||||
pr_err("error registering %d line discipline %ld",
|
||||
N_TI_WL, err);
|
||||
@ -871,11 +871,8 @@ int st_core_init(struct st_data_s **core_data)
|
||||
st_gdata = kzalloc(sizeof(struct st_data_s), GFP_KERNEL);
|
||||
if (!st_gdata) {
|
||||
pr_err("memory allocation failed");
|
||||
err = tty_unregister_ldisc(N_TI_WL);
|
||||
if (err)
|
||||
pr_err("unable to un-register ldisc %ld", err);
|
||||
err = -ENOMEM;
|
||||
return err;
|
||||
goto err_unreg_ldisc;
|
||||
}
|
||||
|
||||
/* Initialize ST TxQ and Tx waitQ queue head. All BT/FM/GPS module skb's
|
||||
@ -890,17 +887,18 @@ int st_core_init(struct st_data_s **core_data)
|
||||
err = st_ll_init(st_gdata);
|
||||
if (err) {
|
||||
pr_err("error during st_ll initialization(%ld)", err);
|
||||
kfree(st_gdata);
|
||||
err = tty_unregister_ldisc(N_TI_WL);
|
||||
if (err)
|
||||
pr_err("unable to un-register ldisc");
|
||||
return err;
|
||||
goto err_free_gdata;
|
||||
}
|
||||
|
||||
INIT_WORK(&st_gdata->work_write_wakeup, work_fn_write_wakeup);
|
||||
|
||||
*core_data = st_gdata;
|
||||
return 0;
|
||||
err_free_gdata:
|
||||
kfree(st_gdata);
|
||||
err_unreg_ldisc:
|
||||
tty_unregister_ldisc(&st_ldisc_ops);
|
||||
return err;
|
||||
}
|
||||
|
||||
void st_core_exit(struct st_data_s *st_gdata)
|
||||
@ -918,9 +916,7 @@ void st_core_exit(struct st_data_s *st_gdata)
|
||||
kfree_skb(st_gdata->rx_skb);
|
||||
kfree_skb(st_gdata->tx_skb);
|
||||
/* TTY ldisc cleanup */
|
||||
err = tty_unregister_ldisc(N_TI_WL);
|
||||
if (err)
|
||||
pr_err("unable to un-register ldisc %ld", err);
|
||||
tty_unregister_ldisc(&st_ldisc_ops);
|
||||
/* free the global data pointer */
|
||||
kfree(st_gdata);
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ static void sdio_uart_transmit_chars(struct sdio_uart_port *port)
|
||||
tty = tty_port_tty_get(&port->port);
|
||||
|
||||
if (tty == NULL || !kfifo_len(xmit) ||
|
||||
tty->stopped || tty->hw_stopped) {
|
||||
tty->flow.stopped || tty->hw_stopped) {
|
||||
sdio_uart_stop_tx(port);
|
||||
tty_kref_put(tty);
|
||||
return;
|
||||
@ -797,13 +797,13 @@ static int sdio_uart_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sdio_uart_write_room(struct tty_struct *tty)
|
||||
static unsigned int sdio_uart_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct sdio_uart_port *port = tty->driver_data;
|
||||
return FIFO_SIZE - kfifo_len(&port->xmit_fifo);
|
||||
}
|
||||
|
||||
static int sdio_uart_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int sdio_uart_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct sdio_uart_port *port = tty->driver_data;
|
||||
return kfifo_len(&port->xmit_fifo);
|
||||
|
@ -87,9 +87,9 @@ static void ldisc_tx_wakeup(struct tty_struct *tty);
|
||||
static inline void update_tty_status(struct ser_device *ser)
|
||||
{
|
||||
ser->tty_status =
|
||||
ser->tty->stopped << 5 |
|
||||
ser->tty->flow_stopped << 3 |
|
||||
ser->tty->packet << 2;
|
||||
ser->tty->flow.stopped << 5 |
|
||||
ser->tty->flow.tco_stopped << 3 |
|
||||
ser->tty->ctrl.packet << 2;
|
||||
}
|
||||
static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty)
|
||||
{
|
||||
@ -159,7 +159,7 @@ static inline void debugfs_tx(struct ser_device *ser, const u8 *data, int size)
|
||||
#endif
|
||||
|
||||
static void ldisc_receive(struct tty_struct *tty, const u8 *data,
|
||||
char *flags, int count)
|
||||
const char *flags, int count)
|
||||
{
|
||||
struct sk_buff *skb = NULL;
|
||||
struct ser_device *ser;
|
||||
@ -380,6 +380,7 @@ static void ldisc_close(struct tty_struct *tty)
|
||||
/* The line discipline structure. */
|
||||
static struct tty_ldisc_ops caif_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_CAIF,
|
||||
.name = "n_caif",
|
||||
.open = ldisc_open,
|
||||
.close = ldisc_close,
|
||||
@ -429,7 +430,7 @@ static int __init caif_ser_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = tty_register_ldisc(N_CAIF, &caif_ldisc);
|
||||
ret = tty_register_ldisc(&caif_ldisc);
|
||||
if (ret < 0)
|
||||
pr_err("cannot register CAIF ldisc=%d err=%d\n", N_CAIF, ret);
|
||||
|
||||
@ -444,7 +445,7 @@ static void __exit caif_ser_exit(void)
|
||||
spin_unlock(&ser_lock);
|
||||
ser_release(NULL);
|
||||
cancel_work_sync(&ser_release_work);
|
||||
tty_unregister_ldisc(N_CAIF);
|
||||
tty_unregister_ldisc(&caif_ldisc);
|
||||
debugfs_remove_recursive(debugfsdir);
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,8 @@ static void slc_setup(struct net_device *dev)
|
||||
*/
|
||||
|
||||
static void slcan_receive_buf(struct tty_struct *tty,
|
||||
const unsigned char *cp, char *fp, int count)
|
||||
const unsigned char *cp, const char *fp,
|
||||
int count)
|
||||
{
|
||||
struct slcan *sl = (struct slcan *) tty->disc_data;
|
||||
|
||||
@ -697,6 +698,7 @@ static int slcan_ioctl(struct tty_struct *tty, struct file *file,
|
||||
|
||||
static struct tty_ldisc_ops slc_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_SLCAN,
|
||||
.name = "slcan",
|
||||
.open = slcan_open,
|
||||
.close = slcan_close,
|
||||
@ -721,7 +723,7 @@ static int __init slcan_init(void)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Fill in our line protocol discipline, and register it */
|
||||
status = tty_register_ldisc(N_SLCAN, &slc_ldisc);
|
||||
status = tty_register_ldisc(&slc_ldisc);
|
||||
if (status) {
|
||||
printk(KERN_ERR "slcan: can't register line discipline\n");
|
||||
kfree(slcan_devs);
|
||||
@ -782,9 +784,7 @@ static void __exit slcan_exit(void)
|
||||
kfree(slcan_devs);
|
||||
slcan_devs = NULL;
|
||||
|
||||
i = tty_unregister_ldisc(N_SLCAN);
|
||||
if (i)
|
||||
printk(KERN_ERR "slcan: can't unregister ldisc (err %d)\n", i);
|
||||
tty_unregister_ldisc(&slc_ldisc);
|
||||
}
|
||||
|
||||
module_init(slcan_init);
|
||||
|
@ -428,7 +428,7 @@ out:
|
||||
* and sent on to some IP layer for further processing.
|
||||
*/
|
||||
static void sixpack_receive_buf(struct tty_struct *tty,
|
||||
const unsigned char *cp, char *fp, int count)
|
||||
const unsigned char *cp, const char *fp, int count)
|
||||
{
|
||||
struct sixpack *sp;
|
||||
int count1;
|
||||
@ -742,6 +742,7 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
|
||||
|
||||
static struct tty_ldisc_ops sp_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_6PACK,
|
||||
.name = "6pack",
|
||||
.open = sixpack_open,
|
||||
.close = sixpack_close,
|
||||
@ -764,21 +765,16 @@ static int __init sixpack_init_driver(void)
|
||||
printk(msg_banner);
|
||||
|
||||
/* Register the provided line protocol discipline */
|
||||
if ((status = tty_register_ldisc(N_6PACK, &sp_ldisc)) != 0)
|
||||
status = tty_register_ldisc(&sp_ldisc);
|
||||
if (status)
|
||||
printk(msg_regfail, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static const char msg_unregfail[] = KERN_ERR \
|
||||
"6pack: can't unregister line discipline (err = %d)\n";
|
||||
|
||||
static void __exit sixpack_exit_driver(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = tty_unregister_ldisc(N_6PACK)))
|
||||
printk(msg_unregfail, ret);
|
||||
tty_unregister_ldisc(&sp_ldisc);
|
||||
}
|
||||
|
||||
/* encode an AX.25 packet into 6pack */
|
||||
|
@ -872,7 +872,7 @@ static int mkiss_ioctl(struct tty_struct *tty, struct file *file,
|
||||
* and sent on to the AX.25 layer for further processing.
|
||||
*/
|
||||
static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
struct mkiss *ax = mkiss_get(tty);
|
||||
|
||||
@ -934,6 +934,7 @@ out:
|
||||
|
||||
static struct tty_ldisc_ops ax_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_AX25,
|
||||
.name = "mkiss",
|
||||
.open = mkiss_open,
|
||||
.close = mkiss_close,
|
||||
@ -953,22 +954,16 @@ static int __init mkiss_init_driver(void)
|
||||
|
||||
printk(banner);
|
||||
|
||||
status = tty_register_ldisc(N_AX25, &ax_ldisc);
|
||||
status = tty_register_ldisc(&ax_ldisc);
|
||||
if (status != 0)
|
||||
printk(msg_regfail, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static const char msg_unregfail[] = KERN_ERR \
|
||||
"mkiss: can't unregister line discipline (err = %d)\n";
|
||||
|
||||
static void __exit mkiss_exit_driver(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = tty_unregister_ldisc(N_AX25)))
|
||||
printk(msg_unregfail, ret);
|
||||
tty_unregister_ldisc(&ax_ldisc);
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Ralf Baechle DL5RB <ralf@linux-mips.org>");
|
||||
|
@ -98,7 +98,7 @@ static int ppp_async_send(struct ppp_channel *chan, struct sk_buff *skb);
|
||||
static int ppp_async_push(struct asyncppp *ap);
|
||||
static void ppp_async_flush_output(struct asyncppp *ap);
|
||||
static void ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
|
||||
char *flags, int count);
|
||||
const char *flags, int count);
|
||||
static int ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd,
|
||||
unsigned long arg);
|
||||
static void ppp_async_process(struct tasklet_struct *t);
|
||||
@ -340,7 +340,7 @@ ppp_asynctty_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
|
||||
/* May sleep, don't call from interrupt level or with interrupts disabled */
|
||||
static void
|
||||
ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
|
||||
char *cflags, int count)
|
||||
const char *cflags, int count)
|
||||
{
|
||||
struct asyncppp *ap = ap_get(tty);
|
||||
unsigned long flags;
|
||||
@ -372,6 +372,7 @@ ppp_asynctty_wakeup(struct tty_struct *tty)
|
||||
|
||||
static struct tty_ldisc_ops ppp_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_PPP,
|
||||
.name = "ppp",
|
||||
.open = ppp_asynctty_open,
|
||||
.close = ppp_asynctty_close,
|
||||
@ -389,7 +390,7 @@ ppp_async_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = tty_register_ldisc(N_PPP, &ppp_ldisc);
|
||||
err = tty_register_ldisc(&ppp_ldisc);
|
||||
if (err != 0)
|
||||
printk(KERN_ERR "PPP_async: error %d registering line disc.\n",
|
||||
err);
|
||||
@ -829,7 +830,7 @@ process_input_packet(struct asyncppp *ap)
|
||||
|
||||
static void
|
||||
ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
|
||||
char *flags, int count)
|
||||
const char *flags, int count)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
int c, i, j, n, s, f;
|
||||
@ -1015,8 +1016,7 @@ static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
|
||||
|
||||
static void __exit ppp_async_cleanup(void)
|
||||
{
|
||||
if (tty_unregister_ldisc(N_PPP) != 0)
|
||||
printk(KERN_ERR "failed to unregister PPP line discipline\n");
|
||||
tty_unregister_ldisc(&ppp_ldisc);
|
||||
}
|
||||
|
||||
module_init(ppp_async_init);
|
||||
|
@ -94,7 +94,7 @@ static void ppp_sync_process(struct tasklet_struct *t);
|
||||
static int ppp_sync_push(struct syncppp *ap);
|
||||
static void ppp_sync_flush_output(struct syncppp *ap);
|
||||
static void ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
|
||||
char *flags, int count);
|
||||
const char *flags, int count);
|
||||
|
||||
static const struct ppp_channel_ops sync_ops = {
|
||||
.start_xmit = ppp_sync_send,
|
||||
@ -333,7 +333,7 @@ ppp_sync_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
|
||||
/* May sleep, don't call from interrupt level or with interrupts disabled */
|
||||
static void
|
||||
ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
|
||||
char *cflags, int count)
|
||||
const char *cflags, int count)
|
||||
{
|
||||
struct syncppp *ap = sp_get(tty);
|
||||
unsigned long flags;
|
||||
@ -365,6 +365,7 @@ ppp_sync_wakeup(struct tty_struct *tty)
|
||||
|
||||
static struct tty_ldisc_ops ppp_sync_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_SYNC_PPP,
|
||||
.name = "pppsync",
|
||||
.open = ppp_sync_open,
|
||||
.close = ppp_sync_close,
|
||||
@ -382,7 +383,7 @@ ppp_sync_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = tty_register_ldisc(N_SYNC_PPP, &ppp_sync_ldisc);
|
||||
err = tty_register_ldisc(&ppp_sync_ldisc);
|
||||
if (err != 0)
|
||||
printk(KERN_ERR "PPP_sync: error %d registering line disc.\n",
|
||||
err);
|
||||
@ -665,7 +666,7 @@ ppp_sync_flush_output(struct syncppp *ap)
|
||||
*/
|
||||
static void
|
||||
ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
|
||||
char *flags, int count)
|
||||
const char *flags, int count)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
unsigned char *p;
|
||||
@ -726,8 +727,7 @@ err:
|
||||
static void __exit
|
||||
ppp_sync_cleanup(void)
|
||||
{
|
||||
if (tty_unregister_ldisc(N_SYNC_PPP) != 0)
|
||||
printk(KERN_ERR "failed to unregister Sync PPP line discipline\n");
|
||||
tty_unregister_ldisc(&ppp_sync_ldisc);
|
||||
}
|
||||
|
||||
module_init(ppp_sync_init);
|
||||
|
@ -685,7 +685,7 @@ static void sl_setup(struct net_device *dev)
|
||||
*/
|
||||
|
||||
static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
struct slip *sl = tty->disc_data;
|
||||
|
||||
@ -1263,6 +1263,7 @@ static int sl_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
||||
|
||||
static struct tty_ldisc_ops sl_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_SLIP,
|
||||
.name = "slip",
|
||||
.open = slip_open,
|
||||
.close = slip_close,
|
||||
@ -1298,7 +1299,7 @@ static int __init slip_init(void)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Fill in our line protocol discipline, and register it */
|
||||
status = tty_register_ldisc(N_SLIP, &sl_ldisc);
|
||||
status = tty_register_ldisc(&sl_ldisc);
|
||||
if (status != 0) {
|
||||
printk(KERN_ERR "SLIP: can't register line discipline (err = %d)\n", status);
|
||||
kfree(slip_devs);
|
||||
@ -1359,9 +1360,7 @@ static void __exit slip_exit(void)
|
||||
kfree(slip_devs);
|
||||
slip_devs = NULL;
|
||||
|
||||
i = tty_unregister_ldisc(N_SLIP);
|
||||
if (i != 0)
|
||||
printk(KERN_ERR "SLIP: can't unregister line discipline (err = %d)\n", i);
|
||||
tty_unregister_ldisc(&sl_ldisc);
|
||||
}
|
||||
|
||||
module_init(slip_init);
|
||||
|
@ -1356,10 +1356,10 @@ out:
|
||||
}
|
||||
|
||||
/* how much room is there for writing */
|
||||
static int hso_serial_write_room(struct tty_struct *tty)
|
||||
static unsigned int hso_serial_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct hso_serial *serial = tty->driver_data;
|
||||
int room;
|
||||
unsigned int room;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&serial->serial_lock, flags);
|
||||
@ -1403,11 +1403,11 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
|
||||
}
|
||||
|
||||
/* how many characters in the buffer */
|
||||
static int hso_serial_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int hso_serial_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct hso_serial *serial = tty->driver_data;
|
||||
int chars;
|
||||
unsigned long flags;
|
||||
unsigned int chars;
|
||||
|
||||
/* sanity check */
|
||||
if (serial == NULL)
|
||||
|
@ -112,12 +112,13 @@ static int __init pps_tty_init(void)
|
||||
|
||||
/* Init PPS_TTY data */
|
||||
pps_ldisc_ops.owner = THIS_MODULE;
|
||||
pps_ldisc_ops.num = N_PPS;
|
||||
pps_ldisc_ops.name = "pps_tty";
|
||||
pps_ldisc_ops.dcd_change = pps_tty_dcd_change;
|
||||
pps_ldisc_ops.open = pps_tty_open;
|
||||
pps_ldisc_ops.close = pps_tty_close;
|
||||
|
||||
err = tty_register_ldisc(N_PPS, &pps_ldisc_ops);
|
||||
err = tty_register_ldisc(&pps_ldisc_ops);
|
||||
if (err)
|
||||
pr_err("can't register PPS line discipline\n");
|
||||
else
|
||||
@ -128,13 +129,7 @@ static int __init pps_tty_init(void)
|
||||
|
||||
static void __exit pps_tty_cleanup(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = tty_unregister_ldisc(N_PPS);
|
||||
if (err)
|
||||
pr_err("can't unregister PPS line discipline\n");
|
||||
else
|
||||
pr_info("PPS line discipline removed\n");
|
||||
tty_unregister_ldisc(&pps_ldisc_ops);
|
||||
}
|
||||
|
||||
module_init(pps_tty_init);
|
||||
|
@ -925,7 +925,7 @@ static void tty3215_close(struct tty_struct *tty, struct file * filp)
|
||||
/*
|
||||
* Returns the amount of free space in the output buffer.
|
||||
*/
|
||||
static int tty3215_write_room(struct tty_struct *tty)
|
||||
static unsigned int tty3215_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
@ -981,7 +981,7 @@ static void tty3215_flush_chars(struct tty_struct *tty)
|
||||
/*
|
||||
* Returns the number of characters in the output buffer
|
||||
*/
|
||||
static int tty3215_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int tty3215_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
|
@ -318,10 +318,10 @@ sclp_buffer_space(struct sclp_buffer *buffer)
|
||||
/*
|
||||
* Return number of characters in buffer
|
||||
*/
|
||||
int
|
||||
unsigned int
|
||||
sclp_chars_in_buffer(struct sclp_buffer *buffer)
|
||||
{
|
||||
int count;
|
||||
unsigned int count;
|
||||
|
||||
count = buffer->char_sum;
|
||||
if (buffer->current_line != NULL)
|
||||
|
@ -86,6 +86,6 @@ void *sclp_unmake_buffer(struct sclp_buffer *);
|
||||
int sclp_buffer_space(struct sclp_buffer *);
|
||||
int sclp_write(struct sclp_buffer *buffer, const unsigned char *, int);
|
||||
int sclp_emit_buffer(struct sclp_buffer *,void (*)(struct sclp_buffer *,int));
|
||||
int sclp_chars_in_buffer(struct sclp_buffer *);
|
||||
unsigned int sclp_chars_in_buffer(struct sclp_buffer *);
|
||||
|
||||
#endif /* __SCLP_RW_H__ */
|
||||
|
@ -86,12 +86,12 @@ sclp_tty_close(struct tty_struct *tty, struct file *filp)
|
||||
* a string of newlines. Every newline creates a new message which
|
||||
* needs 82 bytes.
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
sclp_tty_write_room (struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct list_head *l;
|
||||
int count;
|
||||
unsigned int count;
|
||||
|
||||
spin_lock_irqsave(&sclp_tty_lock, flags);
|
||||
count = 0;
|
||||
@ -280,15 +280,14 @@ sclp_tty_flush_chars(struct tty_struct *tty)
|
||||
* characters in the write buffer (will not be written as long as there is a
|
||||
* final line feed missing).
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
sclp_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct sclp_buffer *t;
|
||||
int count;
|
||||
unsigned int count = 0;
|
||||
|
||||
spin_lock_irqsave(&sclp_tty_lock, flags);
|
||||
count = 0;
|
||||
if (sclp_ttybuf != NULL)
|
||||
count = sclp_chars_in_buffer(sclp_ttybuf);
|
||||
list_for_each_entry(t, &sclp_tty_outqueue, list) {
|
||||
|
@ -604,12 +604,12 @@ sclp_vt220_flush_chars(struct tty_struct *tty)
|
||||
* to change as output buffers get emptied, or if the output flow
|
||||
* control is acted.
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
sclp_vt220_write_room(struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct list_head *l;
|
||||
int count;
|
||||
unsigned int count;
|
||||
|
||||
spin_lock_irqsave(&sclp_vt220_lock, flags);
|
||||
count = 0;
|
||||
@ -624,16 +624,15 @@ sclp_vt220_write_room(struct tty_struct *tty)
|
||||
/*
|
||||
* Return number of buffered chars.
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
sclp_vt220_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct list_head *l;
|
||||
struct sclp_vt220_request *r;
|
||||
int count;
|
||||
unsigned int count = 0;
|
||||
|
||||
spin_lock_irqsave(&sclp_vt220_lock, flags);
|
||||
count = 0;
|
||||
if (sclp_vt220_current_request != NULL)
|
||||
count = sclp_vt220_chars_stored(sclp_vt220_current_request);
|
||||
list_for_each(l, &sclp_vt220_outqueue) {
|
||||
|
@ -1071,7 +1071,7 @@ static void tty3270_cleanup(struct tty_struct *tty)
|
||||
/*
|
||||
* We always have room.
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
tty3270_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return INT_MAX;
|
||||
@ -1640,7 +1640,7 @@ tty3270_do_write(struct tty3270 *tp, struct tty_struct *tty,
|
||||
int i_msg, i;
|
||||
|
||||
spin_lock_bh(&tp->view.lock);
|
||||
for (i_msg = 0; !tty->stopped && i_msg < count; i_msg++) {
|
||||
for (i_msg = 0; !tty->flow.stopped && i_msg < count; i_msg++) {
|
||||
if (tp->esc_state != 0) {
|
||||
/* Continue escape sequence. */
|
||||
tty3270_escape_sequence(tp, buf[i_msg]);
|
||||
@ -1756,22 +1756,6 @@ tty3270_flush_chars(struct tty_struct *tty)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the number of characters in the output buffer. This is
|
||||
* used in tty_wait_until_sent to wait until all characters have
|
||||
* appeared on the screen.
|
||||
*/
|
||||
static int
|
||||
tty3270_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
tty3270_flush_buffer(struct tty_struct *tty)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for visible/invisible input switches
|
||||
*/
|
||||
@ -1892,8 +1876,6 @@ static const struct tty_operations tty3270_ops = {
|
||||
.put_char = tty3270_put_char,
|
||||
.flush_chars = tty3270_flush_chars,
|
||||
.write_room = tty3270_write_room,
|
||||
.chars_in_buffer = tty3270_chars_in_buffer,
|
||||
.flush_buffer = tty3270_flush_buffer,
|
||||
.throttle = tty3270_throttle,
|
||||
.unthrottle = tty3270_unthrottle,
|
||||
.hangup = tty3270_hangup,
|
||||
|
@ -721,7 +721,7 @@ static int fwtty_tx(struct fwtty_port *port, bool drain)
|
||||
|
||||
/* try to write as many dma transactions out as possible */
|
||||
n = -EAGAIN;
|
||||
while (!tty->stopped && !tty->hw_stopped &&
|
||||
while (!tty->flow.stopped && !tty->hw_stopped &&
|
||||
!test_bit(STOP_TX, &port->flags)) {
|
||||
txn = kmem_cache_alloc(fwtty_txn_cache, GFP_ATOMIC);
|
||||
if (!txn) {
|
||||
@ -1112,30 +1112,30 @@ static int fwtty_write(struct tty_struct *tty, const unsigned char *buf, int c)
|
||||
return (n < 0) ? 0 : n;
|
||||
}
|
||||
|
||||
static int fwtty_write_room(struct tty_struct *tty)
|
||||
static unsigned int fwtty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct fwtty_port *port = tty->driver_data;
|
||||
int n;
|
||||
unsigned int n;
|
||||
|
||||
spin_lock_bh(&port->lock);
|
||||
n = dma_fifo_avail(&port->tx_fifo);
|
||||
spin_unlock_bh(&port->lock);
|
||||
|
||||
fwtty_dbg(port, "%d\n", n);
|
||||
fwtty_dbg(port, "%u\n", n);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static int fwtty_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int fwtty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct fwtty_port *port = tty->driver_data;
|
||||
int n;
|
||||
unsigned int n;
|
||||
|
||||
spin_lock_bh(&port->lock);
|
||||
n = dma_fifo_level(&port->tx_fifo);
|
||||
spin_unlock_bh(&port->lock);
|
||||
|
||||
fwtty_dbg(port, "%d\n", n);
|
||||
fwtty_dbg(port, "%u\n", n);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return len;
|
||||
}
|
||||
|
||||
static int gdm_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int gdm_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct gdm *gdm = tty->driver_data;
|
||||
|
||||
|
@ -440,7 +440,7 @@ static int gb_tty_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int gb_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int gb_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct gb_tty *gb_tty = tty->driver_data;
|
||||
unsigned long flags;
|
||||
@ -457,11 +457,11 @@ static int gb_tty_write_room(struct tty_struct *tty)
|
||||
return room;
|
||||
}
|
||||
|
||||
static int gb_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int gb_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct gb_tty *gb_tty = tty->driver_data;
|
||||
unsigned long flags;
|
||||
int chars;
|
||||
unsigned int chars;
|
||||
|
||||
spin_lock_irqsave(&gb_tty->write_lock, flags);
|
||||
chars = kfifo_len(&gb_tty->write_fifo);
|
||||
@ -494,21 +494,7 @@ static void gb_tty_set_termios(struct tty_struct *tty,
|
||||
(termios->c_cflag & PARODD ? 1 : 2) +
|
||||
(termios->c_cflag & CMSPAR ? 2 : 0) : 0;
|
||||
|
||||
switch (termios->c_cflag & CSIZE) {
|
||||
case CS5:
|
||||
newline.data_bits = 5;
|
||||
break;
|
||||
case CS6:
|
||||
newline.data_bits = 6;
|
||||
break;
|
||||
case CS7:
|
||||
newline.data_bits = 7;
|
||||
break;
|
||||
case CS8:
|
||||
default:
|
||||
newline.data_bits = 8;
|
||||
break;
|
||||
}
|
||||
newline.data_bits = tty_get_char_size(termios->c_cflag);
|
||||
|
||||
/* FIXME: needs to clear unsupported bits in the termios */
|
||||
gb_tty->clocal = ((termios->c_cflag & CLOCAL) != 0);
|
||||
|
@ -204,7 +204,7 @@ config MOXA_INTELLIO
|
||||
|
||||
config MOXA_SMARTIO
|
||||
tristate "Moxa SmartIO support v. 2.0"
|
||||
depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA)
|
||||
depends on SERIAL_NONSTANDARD && PCI
|
||||
help
|
||||
Say Y here if you have a Moxa SmartIO multiport serial card and/or
|
||||
want to help develop a new version of this driver.
|
||||
|
@ -9,7 +9,6 @@ obj-$(CONFIG_AUDIT) += tty_audit.o
|
||||
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
|
||||
obj-$(CONFIG_N_HDLC) += n_hdlc.o
|
||||
obj-$(CONFIG_N_GSM) += n_gsm.o
|
||||
obj-$(CONFIG_R3964) += n_r3964.o
|
||||
|
||||
obj-y += vt/
|
||||
obj-$(CONFIG_HVC_DRIVER) += hvc/
|
||||
|
@ -148,7 +148,7 @@ static __inline__ void rtsdtr_ctrl(int bits)
|
||||
* ------------------------------------------------------------
|
||||
* rs_stop() and rs_start()
|
||||
*
|
||||
* This routines are called before setting or resetting tty->stopped.
|
||||
* This routines are called before setting or resetting tty->flow.stopped.
|
||||
* They enable or disable transmitter interrupts, as necessary.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
@ -309,7 +309,7 @@ static void transmit_chars(struct serial_state *info)
|
||||
return;
|
||||
}
|
||||
if (info->xmit.head == info->xmit.tail
|
||||
|| info->tport.tty->stopped
|
||||
|| info->tport.tty->flow.stopped
|
||||
|| info->tport.tty->hw_stopped) {
|
||||
info->IER &= ~UART_IER_THRI;
|
||||
custom.intena = IF_TBE;
|
||||
@ -768,7 +768,7 @@ static void rs_flush_chars(struct tty_struct *tty)
|
||||
unsigned long flags;
|
||||
|
||||
if (info->xmit.head == info->xmit.tail
|
||||
|| tty->stopped
|
||||
|| tty->flow.stopped
|
||||
|| tty->hw_stopped
|
||||
|| !info->xmit.buf)
|
||||
return;
|
||||
@ -812,7 +812,7 @@ static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count
|
||||
local_irq_restore(flags);
|
||||
|
||||
if (info->xmit.head != info->xmit.tail
|
||||
&& !tty->stopped
|
||||
&& !tty->flow.stopped
|
||||
&& !tty->hw_stopped
|
||||
&& !(info->IER & UART_IER_THRI)) {
|
||||
info->IER |= UART_IER_THRI;
|
||||
@ -827,14 +827,14 @@ static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rs_write_room(struct tty_struct *tty)
|
||||
static unsigned int rs_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
|
||||
}
|
||||
|
||||
static int rs_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int rs_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
|
@ -536,11 +536,11 @@ static void ehv_bc_tty_close(struct tty_struct *ttys, struct file *filp)
|
||||
* how much write room the driver can guarantee will be sent OR BUFFERED. This
|
||||
* driver MUST honor the return value.
|
||||
*/
|
||||
static int ehv_bc_tty_write_room(struct tty_struct *ttys)
|
||||
static unsigned int ehv_bc_tty_write_room(struct tty_struct *ttys)
|
||||
{
|
||||
struct ehv_bc_data *bc = ttys->driver_data;
|
||||
unsigned long flags;
|
||||
int count;
|
||||
unsigned int count;
|
||||
|
||||
spin_lock_irqsave(&bc->lock, flags);
|
||||
count = CIRC_SPACE(bc->head, bc->tail, BUF_SIZE);
|
||||
|
@ -193,12 +193,12 @@ static int goldfish_tty_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int goldfish_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int goldfish_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 0x10000;
|
||||
}
|
||||
|
||||
static int goldfish_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int goldfish_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct goldfish_tty *qtty = &goldfish_ttys[tty->index];
|
||||
void __iomem *base = qtty->base;
|
||||
|
@ -292,7 +292,7 @@ int hvc_instantiate(uint32_t vtermno, int index, const struct hv_ops *ops)
|
||||
if (vtermnos[index] != -1)
|
||||
return -1;
|
||||
|
||||
/* make sure no no tty has been registered in this index */
|
||||
/* make sure no tty has been registered in this index */
|
||||
hp = hvc_get_by_index(index);
|
||||
if (hp) {
|
||||
tty_port_put(&hp->port);
|
||||
@ -586,7 +586,7 @@ static void hvc_set_winsz(struct work_struct *work)
|
||||
* how much write room the driver can guarantee will be sent OR BUFFERED. This
|
||||
* driver MUST honor the return value.
|
||||
*/
|
||||
static int hvc_write_room(struct tty_struct *tty)
|
||||
static unsigned int hvc_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct hvc_struct *hp = tty->driver_data;
|
||||
|
||||
@ -596,7 +596,7 @@ static int hvc_write_room(struct tty_struct *tty)
|
||||
return hp->outbuf_size - hp->n_outbuf;
|
||||
}
|
||||
|
||||
static int hvc_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int hvc_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct hvc_struct *hp = tty->driver_data;
|
||||
|
||||
@ -620,7 +620,7 @@ static u32 timeout = MIN_TIMEOUT;
|
||||
/*
|
||||
* Maximum number of bytes to get from the console driver if hvc_poll is
|
||||
* called from driver (and can't sleep). Any more than this and we break
|
||||
* and start polling with khvcd. This value was derived from from an OpenBMC
|
||||
* and start polling with khvcd. This value was derived from an OpenBMC
|
||||
* console with the OPAL driver that results in about 0.25ms interrupts off
|
||||
* latency.
|
||||
*/
|
||||
|
@ -438,8 +438,6 @@ static void hvc_iucv_sndbuf_work(struct work_struct *work)
|
||||
struct hvc_iucv_private *priv;
|
||||
|
||||
priv = container_of(work, struct hvc_iucv_private, sndbuf_work.work);
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
spin_lock_bh(&priv->lock);
|
||||
hvc_iucv_send(priv);
|
||||
|
@ -1376,7 +1376,7 @@ static int hvcs_write(struct tty_struct *tty,
|
||||
* absolutely WILL BUFFER if we can't send it. This driver MUST honor the
|
||||
* return value, hence the reason for hvcs_struct buffering.
|
||||
*/
|
||||
static int hvcs_write_room(struct tty_struct *tty)
|
||||
static unsigned int hvcs_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct hvcs_struct *hvcsd = tty->driver_data;
|
||||
|
||||
@ -1386,7 +1386,7 @@ static int hvcs_write_room(struct tty_struct *tty)
|
||||
return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
|
||||
}
|
||||
|
||||
static int hvcs_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int hvcs_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct hvcs_struct *hvcsd = tty->driver_data;
|
||||
|
||||
|
@ -890,14 +890,14 @@ out:
|
||||
spin_unlock_irqrestore(&hp->lock, flags);
|
||||
}
|
||||
|
||||
static int hvsi_write_room(struct tty_struct *tty)
|
||||
static unsigned int hvsi_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct hvsi_struct *hp = tty->driver_data;
|
||||
|
||||
return N_OUTBUF - hp->n_outbuf;
|
||||
}
|
||||
|
||||
static int hvsi_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int hvsi_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct hvsi_struct *hp = tty->driver_data;
|
||||
|
||||
@ -929,7 +929,7 @@ static int hvsi_write(struct tty_struct *tty,
|
||||
* will see there is no room in outbuf and return.
|
||||
*/
|
||||
while ((count > 0) && (hvsi_write_room(tty) > 0)) {
|
||||
int chunksize = min(count, hvsi_write_room(tty));
|
||||
int chunksize = min_t(int, count, hvsi_write_room(tty));
|
||||
|
||||
BUG_ON(hp->n_outbuf < 0);
|
||||
memcpy(hp->outbuf + hp->n_outbuf, source, chunksize);
|
||||
|
@ -54,7 +54,6 @@ struct ipw_tty {
|
||||
unsigned int control_lines;
|
||||
struct mutex ipw_tty_mutex;
|
||||
int tx_bytes_queued;
|
||||
int closing;
|
||||
};
|
||||
|
||||
static struct ipw_tty *ttys[IPWIRELESS_PCMCIA_MINORS];
|
||||
@ -228,7 +227,7 @@ static int ipw_write(struct tty_struct *linux_tty,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int ipw_write_room(struct tty_struct *linux_tty)
|
||||
static unsigned int ipw_write_room(struct tty_struct *linux_tty)
|
||||
{
|
||||
struct ipw_tty *tty = linux_tty->driver_data;
|
||||
int room;
|
||||
@ -270,7 +269,7 @@ static int ipwireless_set_serial_info(struct tty_struct *linux_tty,
|
||||
return 0; /* Keeps the PCMCIA scripts happy. */
|
||||
}
|
||||
|
||||
static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
|
||||
static unsigned int ipw_chars_in_buffer(struct tty_struct *linux_tty)
|
||||
{
|
||||
struct ipw_tty *tty = linux_tty->driver_data;
|
||||
|
||||
@ -525,7 +524,6 @@ void ipwireless_tty_free(struct ipw_tty *tty)
|
||||
printk(KERN_INFO IPWIRELESS_PCCARD_NAME
|
||||
": deregistering %s device ttyIPWp%d\n",
|
||||
tty_type_name(ttyj->tty_type), j);
|
||||
ttyj->closing = 1;
|
||||
if (ttyj->port.tty != NULL) {
|
||||
mutex_unlock(&ttyj->ipw_tty_mutex);
|
||||
tty_vhangup(ttyj->port.tty);
|
||||
|
@ -840,11 +840,11 @@ static int mips_ejtag_fdc_tty_write(struct tty_struct *tty,
|
||||
return total;
|
||||
}
|
||||
|
||||
static int mips_ejtag_fdc_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int mips_ejtag_fdc_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct mips_ejtag_fdc_tty_port *dport = tty->driver_data;
|
||||
struct mips_ejtag_fdc_tty *priv = dport->driver;
|
||||
int room;
|
||||
unsigned int room;
|
||||
|
||||
/* Report the space in the xmit buffer */
|
||||
spin_lock(&dport->xmit_lock);
|
||||
@ -854,10 +854,10 @@ static int mips_ejtag_fdc_tty_write_room(struct tty_struct *tty)
|
||||
return room;
|
||||
}
|
||||
|
||||
static int mips_ejtag_fdc_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int mips_ejtag_fdc_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct mips_ejtag_fdc_tty_port *dport = tty->driver_data;
|
||||
int chars;
|
||||
unsigned int chars;
|
||||
|
||||
/* Report the number of bytes in the xmit buffer */
|
||||
spin_lock(&dport->xmit_lock);
|
||||
|
@ -188,9 +188,9 @@ module_param(ttymajor, int, 0);
|
||||
static int moxa_open(struct tty_struct *, struct file *);
|
||||
static void moxa_close(struct tty_struct *, struct file *);
|
||||
static int moxa_write(struct tty_struct *, const unsigned char *, int);
|
||||
static int moxa_write_room(struct tty_struct *);
|
||||
static unsigned int moxa_write_room(struct tty_struct *);
|
||||
static void moxa_flush_buffer(struct tty_struct *);
|
||||
static int moxa_chars_in_buffer(struct tty_struct *);
|
||||
static unsigned int moxa_chars_in_buffer(struct tty_struct *);
|
||||
static void moxa_set_termios(struct tty_struct *, struct ktermios *);
|
||||
static void moxa_stop(struct tty_struct *);
|
||||
static void moxa_start(struct tty_struct *);
|
||||
@ -216,9 +216,9 @@ static int MoxaPortLineStatus(struct moxa_port *);
|
||||
static void MoxaPortFlushData(struct moxa_port *, int);
|
||||
static int MoxaPortWriteData(struct tty_struct *, const unsigned char *, int);
|
||||
static int MoxaPortReadData(struct moxa_port *);
|
||||
static int MoxaPortTxQueue(struct moxa_port *);
|
||||
static unsigned int MoxaPortTxQueue(struct moxa_port *);
|
||||
static int MoxaPortRxQueue(struct moxa_port *);
|
||||
static int MoxaPortTxFree(struct moxa_port *);
|
||||
static unsigned int MoxaPortTxFree(struct moxa_port *);
|
||||
static void MoxaPortTxDisable(struct moxa_port *);
|
||||
static void MoxaPortTxEnable(struct moxa_port *);
|
||||
static int moxa_get_serial_info(struct tty_struct *, struct serial_struct *);
|
||||
@ -1217,11 +1217,11 @@ static int moxa_write(struct tty_struct *tty,
|
||||
return len;
|
||||
}
|
||||
|
||||
static int moxa_write_room(struct tty_struct *tty)
|
||||
static unsigned int moxa_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct moxa_port *ch;
|
||||
|
||||
if (tty->stopped)
|
||||
if (tty->flow.stopped)
|
||||
return 0;
|
||||
ch = tty->driver_data;
|
||||
if (ch == NULL)
|
||||
@ -1239,10 +1239,10 @@ static void moxa_flush_buffer(struct tty_struct *tty)
|
||||
tty_wakeup(tty);
|
||||
}
|
||||
|
||||
static int moxa_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int moxa_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct moxa_port *ch = tty->driver_data;
|
||||
int chars;
|
||||
unsigned int chars;
|
||||
|
||||
chars = MoxaPortTxQueue(ch);
|
||||
if (chars)
|
||||
@ -1374,7 +1374,7 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
|
||||
clear_bit(EMPTYWAIT, &p->statusflags);
|
||||
tty_wakeup(tty);
|
||||
}
|
||||
if (test_bit(LOWWAIT, &p->statusflags) && !tty->stopped &&
|
||||
if (test_bit(LOWWAIT, &p->statusflags) && !tty->flow.stopped &&
|
||||
MoxaPortTxQueue(p) <= WAKEUP_CHARS) {
|
||||
clear_bit(LOWWAIT, &p->statusflags);
|
||||
tty_wakeup(tty);
|
||||
@ -1981,7 +1981,7 @@ static int MoxaPortReadData(struct moxa_port *port)
|
||||
}
|
||||
|
||||
|
||||
static int MoxaPortTxQueue(struct moxa_port *port)
|
||||
static unsigned int MoxaPortTxQueue(struct moxa_port *port)
|
||||
{
|
||||
void __iomem *ofsAddr = port->tableAddr;
|
||||
u16 rptr, wptr, mask;
|
||||
@ -1992,7 +1992,7 @@ static int MoxaPortTxQueue(struct moxa_port *port)
|
||||
return (wptr - rptr) & mask;
|
||||
}
|
||||
|
||||
static int MoxaPortTxFree(struct moxa_port *port)
|
||||
static unsigned int MoxaPortTxFree(struct moxa_port *port)
|
||||
{
|
||||
void __iomem *ofsAddr = port->tableAddr;
|
||||
u16 rptr, wptr, mask;
|
||||
|
1962
drivers/tty/mxser.c
1962
drivers/tty/mxser.c
File diff suppressed because it is too large
Load Diff
@ -1,151 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _MXSER_H
|
||||
#define _MXSER_H
|
||||
|
||||
/*
|
||||
* Semi-public control interfaces
|
||||
*/
|
||||
|
||||
/*
|
||||
* MOXA ioctls
|
||||
*/
|
||||
|
||||
#define MOXA 0x400
|
||||
#define MOXA_GETDATACOUNT (MOXA + 23)
|
||||
#define MOXA_DIAGNOSE (MOXA + 50)
|
||||
#define MOXA_CHKPORTENABLE (MOXA + 60)
|
||||
#define MOXA_HighSpeedOn (MOXA + 61)
|
||||
#define MOXA_GET_MAJOR (MOXA + 63)
|
||||
#define MOXA_GETMSTATUS (MOXA + 65)
|
||||
#define MOXA_SET_OP_MODE (MOXA + 66)
|
||||
#define MOXA_GET_OP_MODE (MOXA + 67)
|
||||
|
||||
#define RS232_MODE 0
|
||||
#define RS485_2WIRE_MODE 1
|
||||
#define RS422_MODE 2
|
||||
#define RS485_4WIRE_MODE 3
|
||||
#define OP_MODE_MASK 3
|
||||
|
||||
#define MOXA_SDS_RSTICOUNTER (MOXA + 69)
|
||||
#define MOXA_ASPP_OQUEUE (MOXA + 70)
|
||||
#define MOXA_ASPP_MON (MOXA + 73)
|
||||
#define MOXA_ASPP_LSTATUS (MOXA + 74)
|
||||
#define MOXA_ASPP_MON_EXT (MOXA + 75)
|
||||
#define MOXA_SET_BAUD_METHOD (MOXA + 76)
|
||||
|
||||
/* --------------------------------------------------- */
|
||||
|
||||
#define NPPI_NOTIFY_PARITY 0x01
|
||||
#define NPPI_NOTIFY_FRAMING 0x02
|
||||
#define NPPI_NOTIFY_HW_OVERRUN 0x04
|
||||
#define NPPI_NOTIFY_SW_OVERRUN 0x08
|
||||
#define NPPI_NOTIFY_BREAK 0x10
|
||||
|
||||
#define NPPI_NOTIFY_CTSHOLD 0x01 /* Tx hold by CTS low */
|
||||
#define NPPI_NOTIFY_DSRHOLD 0x02 /* Tx hold by DSR low */
|
||||
#define NPPI_NOTIFY_XOFFHOLD 0x08 /* Tx hold by Xoff received */
|
||||
#define NPPI_NOTIFY_XOFFXENT 0x10 /* Xoff Sent */
|
||||
|
||||
/* follow just for Moxa Must chip define. */
|
||||
/* */
|
||||
/* when LCR register (offset 0x03) write following value, */
|
||||
/* the Must chip will enter enchance mode. And write value */
|
||||
/* on EFR (offset 0x02) bit 6,7 to change bank. */
|
||||
#define MOXA_MUST_ENTER_ENCHANCE 0xBF
|
||||
|
||||
/* when enhance mode enable, access on general bank register */
|
||||
#define MOXA_MUST_GDL_REGISTER 0x07
|
||||
#define MOXA_MUST_GDL_MASK 0x7F
|
||||
#define MOXA_MUST_GDL_HAS_BAD_DATA 0x80
|
||||
|
||||
#define MOXA_MUST_LSR_RERR 0x80 /* error in receive FIFO */
|
||||
/* enchance register bank select and enchance mode setting register */
|
||||
/* when LCR register equal to 0xBF */
|
||||
#define MOXA_MUST_EFR_REGISTER 0x02
|
||||
/* enchance mode enable */
|
||||
#define MOXA_MUST_EFR_EFRB_ENABLE 0x10
|
||||
/* enchance reister bank set 0, 1, 2 */
|
||||
#define MOXA_MUST_EFR_BANK0 0x00
|
||||
#define MOXA_MUST_EFR_BANK1 0x40
|
||||
#define MOXA_MUST_EFR_BANK2 0x80
|
||||
#define MOXA_MUST_EFR_BANK3 0xC0
|
||||
#define MOXA_MUST_EFR_BANK_MASK 0xC0
|
||||
|
||||
/* set XON1 value register, when LCR=0xBF and change to bank0 */
|
||||
#define MOXA_MUST_XON1_REGISTER 0x04
|
||||
|
||||
/* set XON2 value register, when LCR=0xBF and change to bank0 */
|
||||
#define MOXA_MUST_XON2_REGISTER 0x05
|
||||
|
||||
/* set XOFF1 value register, when LCR=0xBF and change to bank0 */
|
||||
#define MOXA_MUST_XOFF1_REGISTER 0x06
|
||||
|
||||
/* set XOFF2 value register, when LCR=0xBF and change to bank0 */
|
||||
#define MOXA_MUST_XOFF2_REGISTER 0x07
|
||||
|
||||
#define MOXA_MUST_RBRTL_REGISTER 0x04
|
||||
#define MOXA_MUST_RBRTH_REGISTER 0x05
|
||||
#define MOXA_MUST_RBRTI_REGISTER 0x06
|
||||
#define MOXA_MUST_THRTL_REGISTER 0x07
|
||||
#define MOXA_MUST_ENUM_REGISTER 0x04
|
||||
#define MOXA_MUST_HWID_REGISTER 0x05
|
||||
#define MOXA_MUST_ECR_REGISTER 0x06
|
||||
#define MOXA_MUST_CSR_REGISTER 0x07
|
||||
|
||||
/* good data mode enable */
|
||||
#define MOXA_MUST_FCR_GDA_MODE_ENABLE 0x20
|
||||
/* only good data put into RxFIFO */
|
||||
#define MOXA_MUST_FCR_GDA_ONLY_ENABLE 0x10
|
||||
|
||||
/* enable CTS interrupt */
|
||||
#define MOXA_MUST_IER_ECTSI 0x80
|
||||
/* enable RTS interrupt */
|
||||
#define MOXA_MUST_IER_ERTSI 0x40
|
||||
/* enable Xon/Xoff interrupt */
|
||||
#define MOXA_MUST_IER_XINT 0x20
|
||||
/* enable GDA interrupt */
|
||||
#define MOXA_MUST_IER_EGDAI 0x10
|
||||
|
||||
#define MOXA_MUST_RECV_ISR (UART_IER_RDI | MOXA_MUST_IER_EGDAI)
|
||||
|
||||
/* GDA interrupt pending */
|
||||
#define MOXA_MUST_IIR_GDA 0x1C
|
||||
#define MOXA_MUST_IIR_RDA 0x04
|
||||
#define MOXA_MUST_IIR_RTO 0x0C
|
||||
#define MOXA_MUST_IIR_LSR 0x06
|
||||
|
||||
/* received Xon/Xoff or specical interrupt pending */
|
||||
#define MOXA_MUST_IIR_XSC 0x10
|
||||
|
||||
/* RTS/CTS change state interrupt pending */
|
||||
#define MOXA_MUST_IIR_RTSCTS 0x20
|
||||
#define MOXA_MUST_IIR_MASK 0x3E
|
||||
|
||||
#define MOXA_MUST_MCR_XON_FLAG 0x40
|
||||
#define MOXA_MUST_MCR_XON_ANY 0x80
|
||||
#define MOXA_MUST_MCR_TX_XON 0x08
|
||||
|
||||
/* software flow control on chip mask value */
|
||||
#define MOXA_MUST_EFR_SF_MASK 0x0F
|
||||
/* send Xon1/Xoff1 */
|
||||
#define MOXA_MUST_EFR_SF_TX1 0x08
|
||||
/* send Xon2/Xoff2 */
|
||||
#define MOXA_MUST_EFR_SF_TX2 0x04
|
||||
/* send Xon1,Xon2/Xoff1,Xoff2 */
|
||||
#define MOXA_MUST_EFR_SF_TX12 0x0C
|
||||
/* don't send Xon/Xoff */
|
||||
#define MOXA_MUST_EFR_SF_TX_NO 0x00
|
||||
/* Tx software flow control mask */
|
||||
#define MOXA_MUST_EFR_SF_TX_MASK 0x0C
|
||||
/* don't receive Xon/Xoff */
|
||||
#define MOXA_MUST_EFR_SF_RX_NO 0x00
|
||||
/* receive Xon1/Xoff1 */
|
||||
#define MOXA_MUST_EFR_SF_RX1 0x02
|
||||
/* receive Xon2/Xoff2 */
|
||||
#define MOXA_MUST_EFR_SF_RX2 0x01
|
||||
/* receive Xon1,Xon2/Xoff1,Xoff2 */
|
||||
#define MOXA_MUST_EFR_SF_RX12 0x03
|
||||
/* Rx software flow control mask */
|
||||
#define MOXA_MUST_EFR_SF_RX_MASK 0x03
|
||||
|
||||
#endif
|
@ -512,7 +512,7 @@ static void gsm_print_packet(const char *hdr, int addr, int cr,
|
||||
*/
|
||||
|
||||
/**
|
||||
* gsm_stuff_packet - bytestuff a packet
|
||||
* gsm_stuff_frame - bytestuff a packet
|
||||
* @input: input buffer
|
||||
* @output: output buffer
|
||||
* @len: length of input
|
||||
@ -1594,7 +1594,7 @@ static void gsm_dlci_data(struct gsm_dlci *dlci, const u8 *data, int clen)
|
||||
}
|
||||
|
||||
/**
|
||||
* gsm_dlci_control - data arrived on control channel
|
||||
* gsm_dlci_command - data arrived on control channel
|
||||
* @dlci: channel
|
||||
* @data: block of bytes received
|
||||
* @len: length of received block
|
||||
@ -2424,7 +2424,7 @@ static void gsmld_detach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
|
||||
}
|
||||
|
||||
static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
struct gsm_mux *gsm = tty->disc_data;
|
||||
char flags = TTY_NORMAL;
|
||||
@ -2557,6 +2557,8 @@ static void gsmld_write_wakeup(struct tty_struct *tty)
|
||||
* @file: file object
|
||||
* @buf: userspace buffer pointer
|
||||
* @nr: size of I/O
|
||||
* @cookie: unused
|
||||
* @offset: unused
|
||||
*
|
||||
* Perform reads for the line discipline. We are guaranteed that the
|
||||
* line discipline will not be closed under us but we may get multiple
|
||||
@ -2857,6 +2859,7 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc)
|
||||
/* Line discipline for real tty */
|
||||
static struct tty_ldisc_ops tty_ldisc_packet = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_GSM0710,
|
||||
.name = "n_gsm",
|
||||
.open = gsmld_open,
|
||||
.close = gsmld_close,
|
||||
@ -3055,7 +3058,7 @@ static int gsmtty_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return sent;
|
||||
}
|
||||
|
||||
static int gsmtty_write_room(struct tty_struct *tty)
|
||||
static unsigned int gsmtty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct gsm_dlci *dlci = tty->driver_data;
|
||||
if (dlci->state == DLCI_CLOSED)
|
||||
@ -3063,7 +3066,7 @@ static int gsmtty_write_room(struct tty_struct *tty)
|
||||
return TX_SIZE - kfifo_len(&dlci->fifo);
|
||||
}
|
||||
|
||||
static int gsmtty_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int gsmtty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct gsm_dlci *dlci = tty->driver_data;
|
||||
if (dlci->state == DLCI_CLOSED)
|
||||
@ -3242,7 +3245,7 @@ static const struct tty_operations gsmtty_ops = {
|
||||
static int __init gsm_init(void)
|
||||
{
|
||||
/* Fill in our line protocol discipline, and register it */
|
||||
int status = tty_register_ldisc(N_GSM0710, &tty_ldisc_packet);
|
||||
int status = tty_register_ldisc(&tty_ldisc_packet);
|
||||
if (status != 0) {
|
||||
pr_err("n_gsm: can't register line discipline (err = %d)\n",
|
||||
status);
|
||||
@ -3251,9 +3254,9 @@ static int __init gsm_init(void)
|
||||
|
||||
gsm_tty_driver = alloc_tty_driver(256);
|
||||
if (!gsm_tty_driver) {
|
||||
tty_unregister_ldisc(N_GSM0710);
|
||||
pr_err("gsm_init: tty allocation failed.\n");
|
||||
return -EINVAL;
|
||||
status = -ENOMEM;
|
||||
goto err_unreg_ldisc;
|
||||
}
|
||||
gsm_tty_driver->driver_name = "gsmtty";
|
||||
gsm_tty_driver->name = "gsmtty";
|
||||
@ -3269,22 +3272,23 @@ static int __init gsm_init(void)
|
||||
tty_set_operations(gsm_tty_driver, &gsmtty_ops);
|
||||
|
||||
if (tty_register_driver(gsm_tty_driver)) {
|
||||
put_tty_driver(gsm_tty_driver);
|
||||
tty_unregister_ldisc(N_GSM0710);
|
||||
pr_err("gsm_init: tty registration failed.\n");
|
||||
return -EBUSY;
|
||||
status = -EBUSY;
|
||||
goto err_put_driver;
|
||||
}
|
||||
pr_debug("gsm_init: loaded as %d,%d.\n",
|
||||
gsm_tty_driver->major, gsm_tty_driver->minor_start);
|
||||
return 0;
|
||||
err_put_driver:
|
||||
put_tty_driver(gsm_tty_driver);
|
||||
err_unreg_ldisc:
|
||||
tty_unregister_ldisc(&tty_ldisc_packet);
|
||||
return status;
|
||||
}
|
||||
|
||||
static void __exit gsm_exit(void)
|
||||
{
|
||||
int status = tty_unregister_ldisc(N_GSM0710);
|
||||
if (status != 0)
|
||||
pr_err("n_gsm: can't unregister line discipline (err = %d)\n",
|
||||
status);
|
||||
tty_unregister_ldisc(&tty_ldisc_packet);
|
||||
tty_unregister_driver(gsm_tty_driver);
|
||||
put_tty_driver(gsm_tty_driver);
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ static void n_hdlc_tty_wakeup(struct tty_struct *tty)
|
||||
* interpreted as one HDLC frame.
|
||||
*/
|
||||
static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data,
|
||||
char *flags, int count)
|
||||
const char *flags, int count)
|
||||
{
|
||||
register struct n_hdlc *n_hdlc = tty->disc_data;
|
||||
register struct n_hdlc_buf *buf;
|
||||
@ -411,8 +411,10 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data,
|
||||
* n_hdlc_tty_read - Called to retrieve one frame of data (if available)
|
||||
* @tty: pointer to tty instance data
|
||||
* @file: pointer to open file object
|
||||
* @buf: pointer to returned data buffer
|
||||
* @kbuf: pointer to returned data buffer
|
||||
* @nr: size of returned data buffer
|
||||
* @cookie: stored rbuf from previous run
|
||||
* @offset: offset into the data buffer
|
||||
*
|
||||
* Returns the number of bytes returned or error code.
|
||||
*/
|
||||
@ -788,6 +790,7 @@ static struct n_hdlc_buf *n_hdlc_buf_get(struct n_hdlc_buf_list *buf_list)
|
||||
|
||||
static struct tty_ldisc_ops n_hdlc_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_HDLC,
|
||||
.name = "hdlc",
|
||||
.open = n_hdlc_tty_open,
|
||||
.close = n_hdlc_tty_close,
|
||||
@ -807,7 +810,7 @@ static int __init n_hdlc_init(void)
|
||||
/* range check maxframe arg */
|
||||
maxframe = clamp(maxframe, 4096, MAX_HDLC_FRAME_SIZE);
|
||||
|
||||
status = tty_register_ldisc(N_HDLC, &n_hdlc_ldisc);
|
||||
status = tty_register_ldisc(&n_hdlc_ldisc);
|
||||
if (!status)
|
||||
pr_info("N_HDLC line discipline registered with maxframe=%d\n",
|
||||
maxframe);
|
||||
@ -821,14 +824,7 @@ static int __init n_hdlc_init(void)
|
||||
|
||||
static void __exit n_hdlc_exit(void)
|
||||
{
|
||||
/* Release tty registration of line discipline */
|
||||
int status = tty_unregister_ldisc(N_HDLC);
|
||||
|
||||
if (status)
|
||||
pr_err("N_HDLC: can't unregister line discipline (err = %d)\n",
|
||||
status);
|
||||
else
|
||||
pr_info("N_HDLC: line discipline unregistered\n");
|
||||
tty_unregister_ldisc(&n_hdlc_ldisc);
|
||||
}
|
||||
|
||||
module_init(n_hdlc_init);
|
||||
|
@ -33,13 +33,14 @@ static ssize_t n_null_write(struct tty_struct *tty, struct file *file,
|
||||
}
|
||||
|
||||
static void n_null_receivebuf(struct tty_struct *tty,
|
||||
const unsigned char *cp, char *fp,
|
||||
const unsigned char *cp, const char *fp,
|
||||
int cnt)
|
||||
{
|
||||
}
|
||||
|
||||
static struct tty_ldisc_ops null_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_NULL,
|
||||
.name = "n_null",
|
||||
.open = n_null_open,
|
||||
.close = n_null_close,
|
||||
@ -50,13 +51,13 @@ static struct tty_ldisc_ops null_ldisc = {
|
||||
|
||||
static int __init n_null_init(void)
|
||||
{
|
||||
BUG_ON(tty_register_ldisc(N_NULL, &null_ldisc));
|
||||
BUG_ON(tty_register_ldisc(&null_ldisc));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit n_null_exit(void)
|
||||
{
|
||||
tty_unregister_ldisc(N_NULL);
|
||||
tty_unregister_ldisc(&null_ldisc);
|
||||
}
|
||||
|
||||
module_init(n_null_init);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -342,10 +342,10 @@ static void n_tty_packet_mode_flush(struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
if (tty->link->packet) {
|
||||
spin_lock_irqsave(&tty->ctrl_lock, flags);
|
||||
tty->ctrl_status |= TIOCPKT_FLUSHREAD;
|
||||
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
|
||||
if (tty->link->ctrl.packet) {
|
||||
spin_lock_irqsave(&tty->ctrl.lock, flags);
|
||||
tty->ctrl.pktstatus |= TIOCPKT_FLUSHREAD;
|
||||
spin_unlock_irqrestore(&tty->ctrl.lock, flags);
|
||||
wake_up_interruptible(&tty->link->read_wait);
|
||||
}
|
||||
}
|
||||
@ -361,7 +361,7 @@ static void n_tty_packet_mode_flush(struct tty_struct *tty)
|
||||
* Holds termios_rwsem to exclude producer/consumer while
|
||||
* buffer indices are reset.
|
||||
*
|
||||
* Locking: ctrl_lock, exclusive termios_rwsem
|
||||
* Locking: ctrl.lock, exclusive termios_rwsem
|
||||
*/
|
||||
|
||||
static void n_tty_flush_buffer(struct tty_struct *tty)
|
||||
@ -1103,7 +1103,7 @@ static void eraser(unsigned char c, struct tty_struct *tty)
|
||||
* buffer is 'output'. The signal is processed first to alert any current
|
||||
* readers or writers to discontinue and exit their i/o loops.
|
||||
*
|
||||
* Locking: ctrl_lock
|
||||
* Locking: ctrl.lock
|
||||
*/
|
||||
|
||||
static void __isig(int sig, struct tty_struct *tty)
|
||||
@ -1245,7 +1245,6 @@ n_tty_receive_signal_char(struct tty_struct *tty, int signal, unsigned char c)
|
||||
commit_echoes(tty);
|
||||
} else
|
||||
process_echoes(tty);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1260,12 +1259,8 @@ n_tty_receive_signal_char(struct tty_struct *tty, int signal, unsigned char c)
|
||||
* n_tty_receive_buf()/producer path:
|
||||
* caller holds non-exclusive termios_rwsem
|
||||
* publishes canon_head if canonical mode is active
|
||||
*
|
||||
* Returns 1 if LNEXT was received, else returns 0
|
||||
*/
|
||||
|
||||
static int
|
||||
n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
|
||||
static void n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
|
||||
@ -1273,35 +1268,35 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
|
||||
if (c == START_CHAR(tty)) {
|
||||
start_tty(tty);
|
||||
process_echoes(tty);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
if (c == STOP_CHAR(tty)) {
|
||||
stop_tty(tty);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (L_ISIG(tty)) {
|
||||
if (c == INTR_CHAR(tty)) {
|
||||
n_tty_receive_signal_char(tty, SIGINT, c);
|
||||
return 0;
|
||||
return;
|
||||
} else if (c == QUIT_CHAR(tty)) {
|
||||
n_tty_receive_signal_char(tty, SIGQUIT, c);
|
||||
return 0;
|
||||
return;
|
||||
} else if (c == SUSP_CHAR(tty)) {
|
||||
n_tty_receive_signal_char(tty, SIGTSTP, c);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && I_IXANY(tty)) {
|
||||
if (tty->flow.stopped && !tty->flow.tco_stopped && I_IXON(tty) && I_IXANY(tty)) {
|
||||
start_tty(tty);
|
||||
process_echoes(tty);
|
||||
}
|
||||
|
||||
if (c == '\r') {
|
||||
if (I_IGNCR(tty))
|
||||
return 0;
|
||||
return;
|
||||
if (I_ICRNL(tty))
|
||||
c = '\n';
|
||||
} else if (c == '\n' && I_INLCR(tty))
|
||||
@ -1312,7 +1307,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
|
||||
(c == WERASE_CHAR(tty) && L_IEXTEN(tty))) {
|
||||
eraser(c, tty);
|
||||
commit_echoes(tty);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
if (c == LNEXT_CHAR(tty) && L_IEXTEN(tty)) {
|
||||
ldata->lnext = 1;
|
||||
@ -1324,7 +1319,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
|
||||
commit_echoes(tty);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
if (c == REPRINT_CHAR(tty) && L_ECHO(tty) && L_IEXTEN(tty)) {
|
||||
size_t tail = ldata->canon_head;
|
||||
@ -1337,7 +1332,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
|
||||
tail++;
|
||||
}
|
||||
commit_echoes(tty);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
if (c == '\n') {
|
||||
if (L_ECHO(tty) || L_ECHONL(tty)) {
|
||||
@ -1375,7 +1370,7 @@ handle_newline:
|
||||
smp_store_release(&ldata->canon_head, ldata->read_head);
|
||||
kill_fasync(&tty->fasync, SIGIO, POLL_IN);
|
||||
wake_up_interruptible_poll(&tty->read_wait, EPOLLIN);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1397,15 +1392,13 @@ handle_newline:
|
||||
put_tty_queue(c, ldata);
|
||||
|
||||
put_tty_queue(c, ldata);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
n_tty_receive_char_inline(struct tty_struct *tty, unsigned char c)
|
||||
static void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
|
||||
if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && I_IXANY(tty)) {
|
||||
if (tty->flow.stopped && !tty->flow.tco_stopped && I_IXON(tty) && I_IXANY(tty)) {
|
||||
start_tty(tty);
|
||||
process_echoes(tty);
|
||||
}
|
||||
@ -1423,31 +1416,6 @@ n_tty_receive_char_inline(struct tty_struct *tty, unsigned char c)
|
||||
put_tty_queue(c, ldata);
|
||||
}
|
||||
|
||||
static void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
|
||||
{
|
||||
n_tty_receive_char_inline(tty, c);
|
||||
}
|
||||
|
||||
static inline void
|
||||
n_tty_receive_char_fast(struct tty_struct *tty, unsigned char c)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
|
||||
if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && I_IXANY(tty)) {
|
||||
start_tty(tty);
|
||||
process_echoes(tty);
|
||||
}
|
||||
if (L_ECHO(tty)) {
|
||||
finish_erasing(ldata);
|
||||
/* Record the column of first canon char. */
|
||||
if (ldata->canon_head == ldata->read_head)
|
||||
echo_set_canon_col(ldata);
|
||||
echo_char(c, tty);
|
||||
commit_echoes(tty);
|
||||
}
|
||||
put_tty_queue(c, ldata);
|
||||
}
|
||||
|
||||
static void n_tty_receive_char_closing(struct tty_struct *tty, unsigned char c)
|
||||
{
|
||||
if (I_ISTRIP(tty))
|
||||
@ -1459,7 +1427,7 @@ static void n_tty_receive_char_closing(struct tty_struct *tty, unsigned char c)
|
||||
if (c == STOP_CHAR(tty))
|
||||
stop_tty(tty);
|
||||
else if (c == START_CHAR(tty) ||
|
||||
(tty->stopped && !tty->flow_stopped && I_IXANY(tty) &&
|
||||
(tty->flow.stopped && !tty->flow.tco_stopped && I_IXANY(tty) &&
|
||||
c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) &&
|
||||
c != SUSP_CHAR(tty))) {
|
||||
start_tty(tty);
|
||||
@ -1506,7 +1474,7 @@ n_tty_receive_char_lnext(struct tty_struct *tty, unsigned char c, char flag)
|
||||
|
||||
static void
|
||||
n_tty_receive_buf_real_raw(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
size_t n, head;
|
||||
@ -1526,7 +1494,7 @@ n_tty_receive_buf_real_raw(struct tty_struct *tty, const unsigned char *cp,
|
||||
|
||||
static void
|
||||
n_tty_receive_buf_raw(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
char flag = TTY_NORMAL;
|
||||
@ -1543,7 +1511,7 @@ n_tty_receive_buf_raw(struct tty_struct *tty, const unsigned char *cp,
|
||||
|
||||
static void
|
||||
n_tty_receive_buf_closing(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
char flag = TTY_NORMAL;
|
||||
|
||||
@ -1555,68 +1523,46 @@ n_tty_receive_buf_closing(struct tty_struct *tty, const unsigned char *cp,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
n_tty_receive_buf_standard(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
static void n_tty_receive_buf_standard(struct tty_struct *tty,
|
||||
const unsigned char *cp, const char *fp, int count)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
char flag = TTY_NORMAL;
|
||||
|
||||
while (count--) {
|
||||
unsigned char c = *cp++;
|
||||
|
||||
if (fp)
|
||||
flag = *fp++;
|
||||
if (likely(flag == TTY_NORMAL)) {
|
||||
unsigned char c = *cp++;
|
||||
|
||||
if (I_ISTRIP(tty))
|
||||
c &= 0x7f;
|
||||
if (I_IUCLC(tty) && L_IEXTEN(tty))
|
||||
c = tolower(c);
|
||||
if (L_EXTPROC(tty)) {
|
||||
put_tty_queue(c, ldata);
|
||||
continue;
|
||||
}
|
||||
if (!test_bit(c, ldata->char_map))
|
||||
n_tty_receive_char_inline(tty, c);
|
||||
else if (n_tty_receive_char_special(tty, c) && count) {
|
||||
if (fp)
|
||||
flag = *fp++;
|
||||
n_tty_receive_char_lnext(tty, *cp++, flag);
|
||||
count--;
|
||||
}
|
||||
} else
|
||||
n_tty_receive_char_flagged(tty, *cp++, flag);
|
||||
}
|
||||
}
|
||||
if (ldata->lnext) {
|
||||
n_tty_receive_char_lnext(tty, c, flag);
|
||||
continue;
|
||||
}
|
||||
|
||||
static void
|
||||
n_tty_receive_buf_fast(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
char flag = TTY_NORMAL;
|
||||
if (unlikely(flag != TTY_NORMAL)) {
|
||||
n_tty_receive_char_flagged(tty, c, flag);
|
||||
continue;
|
||||
}
|
||||
|
||||
while (count--) {
|
||||
if (fp)
|
||||
flag = *fp++;
|
||||
if (likely(flag == TTY_NORMAL)) {
|
||||
unsigned char c = *cp++;
|
||||
if (I_ISTRIP(tty))
|
||||
c &= 0x7f;
|
||||
if (I_IUCLC(tty) && L_IEXTEN(tty))
|
||||
c = tolower(c);
|
||||
if (L_EXTPROC(tty)) {
|
||||
put_tty_queue(c, ldata);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!test_bit(c, ldata->char_map))
|
||||
n_tty_receive_char_fast(tty, c);
|
||||
else if (n_tty_receive_char_special(tty, c) && count) {
|
||||
if (fp)
|
||||
flag = *fp++;
|
||||
n_tty_receive_char_lnext(tty, *cp++, flag);
|
||||
count--;
|
||||
}
|
||||
} else
|
||||
n_tty_receive_char_flagged(tty, *cp++, flag);
|
||||
if (test_bit(c, ldata->char_map))
|
||||
n_tty_receive_char_special(tty, c);
|
||||
else
|
||||
n_tty_receive_char(tty, c);
|
||||
}
|
||||
}
|
||||
|
||||
static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
bool preops = I_ISTRIP(tty) || (I_IUCLC(tty) && L_IEXTEN(tty));
|
||||
@ -1628,19 +1574,7 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
else if (tty->closing && !L_EXTPROC(tty))
|
||||
n_tty_receive_buf_closing(tty, cp, fp, count);
|
||||
else {
|
||||
if (ldata->lnext) {
|
||||
char flag = TTY_NORMAL;
|
||||
|
||||
if (fp)
|
||||
flag = *fp++;
|
||||
n_tty_receive_char_lnext(tty, *cp++, flag);
|
||||
count--;
|
||||
}
|
||||
|
||||
if (!preops && !I_PARMRK(tty))
|
||||
n_tty_receive_buf_fast(tty, cp, fp, count);
|
||||
else
|
||||
n_tty_receive_buf_standard(tty, cp, fp, count);
|
||||
n_tty_receive_buf_standard(tty, cp, fp, count);
|
||||
|
||||
flush_echoes(tty);
|
||||
if (tty->ops->flush_chars)
|
||||
@ -1695,7 +1629,7 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
*/
|
||||
static int
|
||||
n_tty_receive_buf_common(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count, int flow)
|
||||
const char *fp, int count, int flow)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
int room, n, rcvd = 0, overflow;
|
||||
@ -1764,13 +1698,13 @@ n_tty_receive_buf_common(struct tty_struct *tty, const unsigned char *cp,
|
||||
}
|
||||
|
||||
static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
n_tty_receive_buf_common(tty, cp, fp, count, 0);
|
||||
}
|
||||
|
||||
static int n_tty_receive_buf2(struct tty_struct *tty, const unsigned char *cp,
|
||||
char *fp, int count)
|
||||
const char *fp, int count)
|
||||
{
|
||||
return n_tty_receive_buf_common(tty, cp, fp, count, 1);
|
||||
}
|
||||
@ -1863,7 +1797,7 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
|
||||
* Fix tty hang when I_IXON(tty) is cleared, but the tty
|
||||
* been stopped by STOP_CHAR(tty) before it.
|
||||
*/
|
||||
if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped) {
|
||||
if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow.tco_stopped) {
|
||||
start_tty(tty);
|
||||
process_echoes(tty);
|
||||
}
|
||||
@ -2091,7 +2025,7 @@ static bool canon_copy_from_read_buf(struct tty_struct *tty,
|
||||
*
|
||||
* Locking: redirected write test is safe
|
||||
* current->signal->tty check is safe
|
||||
* ctrl_lock to safely reference tty->pgrp
|
||||
* ctrl.lock to safely reference tty->ctrl.pgrp
|
||||
*/
|
||||
|
||||
static int job_control(struct tty_struct *tty, struct file *file)
|
||||
@ -2138,7 +2072,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
|
||||
int minimum, time;
|
||||
ssize_t retval = 0;
|
||||
long timeout;
|
||||
int packet;
|
||||
bool packet;
|
||||
size_t tail;
|
||||
|
||||
/*
|
||||
@ -2194,20 +2128,20 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
|
||||
}
|
||||
}
|
||||
|
||||
packet = tty->packet;
|
||||
packet = tty->ctrl.packet;
|
||||
tail = ldata->read_tail;
|
||||
|
||||
add_wait_queue(&tty->read_wait, &wait);
|
||||
while (nr) {
|
||||
/* First test for status change. */
|
||||
if (packet && tty->link->ctrl_status) {
|
||||
if (packet && tty->link->ctrl.pktstatus) {
|
||||
unsigned char cs;
|
||||
if (kb != kbuf)
|
||||
break;
|
||||
spin_lock_irq(&tty->link->ctrl_lock);
|
||||
cs = tty->link->ctrl_status;
|
||||
tty->link->ctrl_status = 0;
|
||||
spin_unlock_irq(&tty->link->ctrl_lock);
|
||||
spin_lock_irq(&tty->link->ctrl.lock);
|
||||
cs = tty->link->ctrl.pktstatus;
|
||||
tty->link->ctrl.pktstatus = 0;
|
||||
spin_unlock_irq(&tty->link->ctrl.lock);
|
||||
*kb++ = cs;
|
||||
nr--;
|
||||
break;
|
||||
@ -2434,7 +2368,7 @@ static __poll_t n_tty_poll(struct tty_struct *tty, struct file *file,
|
||||
if (input_available_p(tty, 1))
|
||||
mask |= EPOLLIN | EPOLLRDNORM;
|
||||
}
|
||||
if (tty->packet && tty->link->ctrl_status)
|
||||
if (tty->ctrl.packet && tty->link->ctrl.pktstatus)
|
||||
mask |= EPOLLPRI | EPOLLIN | EPOLLRDNORM;
|
||||
if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
|
||||
mask |= EPOLLHUP;
|
||||
@ -2490,6 +2424,7 @@ static int n_tty_ioctl(struct tty_struct *tty, struct file *file,
|
||||
|
||||
static struct tty_ldisc_ops n_tty_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.num = N_TTY,
|
||||
.name = "n_tty",
|
||||
.open = n_tty_open,
|
||||
.close = n_tty_close,
|
||||
@ -2515,11 +2450,11 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
|
||||
{
|
||||
*ops = n_tty_ops;
|
||||
ops->owner = NULL;
|
||||
ops->refcount = ops->flags = 0;
|
||||
ops->flags = 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
|
||||
|
||||
void __init n_tty_init(void)
|
||||
{
|
||||
tty_register_ldisc(N_TTY, &n_tty_ops);
|
||||
tty_register_ldisc(&n_tty_ops);
|
||||
}
|
||||
|
@ -1378,7 +1378,7 @@ static int nozomi_card_init(struct pci_dev *pdev,
|
||||
NOZOMI_NAME, dc);
|
||||
if (unlikely(ret)) {
|
||||
dev_err(&pdev->dev, "can't request irq %d\n", pdev->irq);
|
||||
goto err_free_kfifo;
|
||||
goto err_free_all_kfifo;
|
||||
}
|
||||
|
||||
DBG1("base_addr: %p", dc->base_addr);
|
||||
@ -1416,12 +1416,15 @@ static int nozomi_card_init(struct pci_dev *pdev,
|
||||
return 0;
|
||||
|
||||
err_free_tty:
|
||||
for (i = 0; i < MAX_PORT; ++i) {
|
||||
for (i--; i >= 0; i--) {
|
||||
tty_unregister_device(ntty_driver, dc->index_start + i);
|
||||
tty_port_destroy(&dc->port[i].port);
|
||||
}
|
||||
free_irq(pdev->irq, dc);
|
||||
err_free_all_kfifo:
|
||||
i = MAX_PORT;
|
||||
err_free_kfifo:
|
||||
for (i = 0; i < MAX_PORT; i++)
|
||||
for (i--; i >= PORT_MDM; i--)
|
||||
kfifo_free(&dc->port[i].fifo_ul);
|
||||
err_free_sbuf:
|
||||
kfree(dc->send_buf);
|
||||
@ -1636,10 +1639,10 @@ static int ntty_write(struct tty_struct *tty, const unsigned char *buffer,
|
||||
* If the port is unplugged report lots of room and let the bits
|
||||
* dribble away so we don't block anything.
|
||||
*/
|
||||
static int ntty_write_room(struct tty_struct *tty)
|
||||
static unsigned int ntty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct port *port = tty->driver_data;
|
||||
int room = 4096;
|
||||
unsigned int room = 4096;
|
||||
const struct nozomi *dc = get_dc_by_tty(tty);
|
||||
|
||||
if (dc)
|
||||
@ -1776,20 +1779,15 @@ static void ntty_throttle(struct tty_struct *tty)
|
||||
}
|
||||
|
||||
/* Returns number of chars in buffer, called by tty layer */
|
||||
static s32 ntty_chars_in_buffer(struct tty_struct *tty)
|
||||
static unsigned int ntty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct port *port = tty->driver_data;
|
||||
struct nozomi *dc = get_dc_by_tty(tty);
|
||||
s32 rval = 0;
|
||||
|
||||
if (unlikely(!dc || !port)) {
|
||||
goto exit_in_buffer;
|
||||
}
|
||||
if (unlikely(!dc || !port))
|
||||
return 0;
|
||||
|
||||
rval = kfifo_len(&port->fifo_ul);
|
||||
|
||||
exit_in_buffer:
|
||||
return rval;
|
||||
return kfifo_len(&port->fifo_ul);
|
||||
}
|
||||
|
||||
static const struct tty_port_operations noz_tty_port_ops = {
|
||||
|
@ -57,9 +57,9 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
|
||||
set_bit(TTY_IO_ERROR, &tty->flags);
|
||||
wake_up_interruptible(&tty->read_wait);
|
||||
wake_up_interruptible(&tty->write_wait);
|
||||
spin_lock_irq(&tty->ctrl_lock);
|
||||
tty->packet = 0;
|
||||
spin_unlock_irq(&tty->ctrl_lock);
|
||||
spin_lock_irq(&tty->ctrl.lock);
|
||||
tty->ctrl.packet = false;
|
||||
spin_unlock_irq(&tty->ctrl.lock);
|
||||
/* Review - krefs on tty_link ?? */
|
||||
if (!tty->link)
|
||||
return;
|
||||
@ -113,7 +113,7 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
|
||||
struct tty_struct *to = tty->link;
|
||||
unsigned long flags;
|
||||
|
||||
if (tty->stopped)
|
||||
if (tty->flow.stopped)
|
||||
return 0;
|
||||
|
||||
if (c > 0) {
|
||||
@ -136,26 +136,13 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
|
||||
* the other device.
|
||||
*/
|
||||
|
||||
static int pty_write_room(struct tty_struct *tty)
|
||||
static unsigned int pty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
if (tty->stopped)
|
||||
if (tty->flow.stopped)
|
||||
return 0;
|
||||
return tty_buffer_space_avail(tty->link->port);
|
||||
}
|
||||
|
||||
/**
|
||||
* pty_chars_in_buffer - characters currently in our tx queue
|
||||
* @tty: our tty
|
||||
*
|
||||
* Report how much we have in the transmit queue. As everything is
|
||||
* instantly at the other end this is easy to implement.
|
||||
*/
|
||||
|
||||
static int pty_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set the lock flag on a pty */
|
||||
static int pty_set_lock(struct tty_struct *tty, int __user *arg)
|
||||
{
|
||||
@ -185,16 +172,16 @@ static int pty_set_pktmode(struct tty_struct *tty, int __user *arg)
|
||||
if (get_user(pktmode, arg))
|
||||
return -EFAULT;
|
||||
|
||||
spin_lock_irq(&tty->ctrl_lock);
|
||||
spin_lock_irq(&tty->ctrl.lock);
|
||||
if (pktmode) {
|
||||
if (!tty->packet) {
|
||||
tty->link->ctrl_status = 0;
|
||||
if (!tty->ctrl.packet) {
|
||||
tty->link->ctrl.pktstatus = 0;
|
||||
smp_mb();
|
||||
tty->packet = 1;
|
||||
tty->ctrl.packet = true;
|
||||
}
|
||||
} else
|
||||
tty->packet = 0;
|
||||
spin_unlock_irq(&tty->ctrl_lock);
|
||||
tty->ctrl.packet = false;
|
||||
spin_unlock_irq(&tty->ctrl.lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -202,7 +189,7 @@ static int pty_set_pktmode(struct tty_struct *tty, int __user *arg)
|
||||
/* Get the packet mode of a pty */
|
||||
static int pty_get_pktmode(struct tty_struct *tty, int __user *arg)
|
||||
{
|
||||
int pktmode = tty->packet;
|
||||
int pktmode = tty->ctrl.packet;
|
||||
|
||||
return put_user(pktmode, arg);
|
||||
}
|
||||
@ -232,11 +219,11 @@ static void pty_flush_buffer(struct tty_struct *tty)
|
||||
return;
|
||||
|
||||
tty_buffer_flush(to, NULL);
|
||||
if (to->packet) {
|
||||
spin_lock_irq(&tty->ctrl_lock);
|
||||
tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
|
||||
if (to->ctrl.packet) {
|
||||
spin_lock_irq(&tty->ctrl.lock);
|
||||
tty->ctrl.pktstatus |= TIOCPKT_FLUSHWRITE;
|
||||
wake_up_interruptible(&to->read_wait);
|
||||
spin_unlock_irq(&tty->ctrl_lock);
|
||||
spin_unlock_irq(&tty->ctrl.lock);
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,7 +253,7 @@ static void pty_set_termios(struct tty_struct *tty,
|
||||
struct ktermios *old_termios)
|
||||
{
|
||||
/* See if packet mode change of state. */
|
||||
if (tty->link && tty->link->packet) {
|
||||
if (tty->link && tty->link->ctrl.packet) {
|
||||
int extproc = (old_termios->c_lflag & EXTPROC) | L_EXTPROC(tty);
|
||||
int old_flow = ((old_termios->c_iflag & IXON) &&
|
||||
(old_termios->c_cc[VSTOP] == '\023') &&
|
||||
@ -275,17 +262,17 @@ static void pty_set_termios(struct tty_struct *tty,
|
||||
STOP_CHAR(tty) == '\023' &&
|
||||
START_CHAR(tty) == '\021');
|
||||
if ((old_flow != new_flow) || extproc) {
|
||||
spin_lock_irq(&tty->ctrl_lock);
|
||||
spin_lock_irq(&tty->ctrl.lock);
|
||||
if (old_flow != new_flow) {
|
||||
tty->ctrl_status &= ~(TIOCPKT_DOSTOP | TIOCPKT_NOSTOP);
|
||||
tty->ctrl.pktstatus &= ~(TIOCPKT_DOSTOP | TIOCPKT_NOSTOP);
|
||||
if (new_flow)
|
||||
tty->ctrl_status |= TIOCPKT_DOSTOP;
|
||||
tty->ctrl.pktstatus |= TIOCPKT_DOSTOP;
|
||||
else
|
||||
tty->ctrl_status |= TIOCPKT_NOSTOP;
|
||||
tty->ctrl.pktstatus |= TIOCPKT_NOSTOP;
|
||||
}
|
||||
if (extproc)
|
||||
tty->ctrl_status |= TIOCPKT_IOCTL;
|
||||
spin_unlock_irq(&tty->ctrl_lock);
|
||||
tty->ctrl.pktstatus |= TIOCPKT_IOCTL;
|
||||
spin_unlock_irq(&tty->ctrl.lock);
|
||||
wake_up_interruptible(&tty->link->read_wait);
|
||||
}
|
||||
}
|
||||
@ -295,7 +282,7 @@ static void pty_set_termios(struct tty_struct *tty,
|
||||
}
|
||||
|
||||
/**
|
||||
* pty_do_resize - resize event
|
||||
* pty_resize - resize event
|
||||
* @tty: tty being resized
|
||||
* @ws: window size being set.
|
||||
*
|
||||
@ -346,11 +333,11 @@ static void pty_start(struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
if (tty->link && tty->link->packet) {
|
||||
spin_lock_irqsave(&tty->ctrl_lock, flags);
|
||||
tty->ctrl_status &= ~TIOCPKT_STOP;
|
||||
tty->ctrl_status |= TIOCPKT_START;
|
||||
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
|
||||
if (tty->link && tty->link->ctrl.packet) {
|
||||
spin_lock_irqsave(&tty->ctrl.lock, flags);
|
||||
tty->ctrl.pktstatus &= ~TIOCPKT_STOP;
|
||||
tty->ctrl.pktstatus |= TIOCPKT_START;
|
||||
spin_unlock_irqrestore(&tty->ctrl.lock, flags);
|
||||
wake_up_interruptible_poll(&tty->link->read_wait, EPOLLIN);
|
||||
}
|
||||
}
|
||||
@ -359,11 +346,11 @@ static void pty_stop(struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
if (tty->link && tty->link->packet) {
|
||||
spin_lock_irqsave(&tty->ctrl_lock, flags);
|
||||
tty->ctrl_status &= ~TIOCPKT_START;
|
||||
tty->ctrl_status |= TIOCPKT_STOP;
|
||||
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
|
||||
if (tty->link && tty->link->ctrl.packet) {
|
||||
spin_lock_irqsave(&tty->ctrl.lock, flags);
|
||||
tty->ctrl.pktstatus &= ~TIOCPKT_START;
|
||||
tty->ctrl.pktstatus |= TIOCPKT_STOP;
|
||||
spin_unlock_irqrestore(&tty->ctrl.lock, flags);
|
||||
wake_up_interruptible_poll(&tty->link->read_wait, EPOLLIN);
|
||||
}
|
||||
}
|
||||
@ -525,7 +512,6 @@ static const struct tty_operations master_pty_ops_bsd = {
|
||||
.write = pty_write,
|
||||
.write_room = pty_write_room,
|
||||
.flush_buffer = pty_flush_buffer,
|
||||
.chars_in_buffer = pty_chars_in_buffer,
|
||||
.unthrottle = pty_unthrottle,
|
||||
.ioctl = pty_bsd_ioctl,
|
||||
.compat_ioctl = pty_bsd_compat_ioctl,
|
||||
@ -541,7 +527,6 @@ static const struct tty_operations slave_pty_ops_bsd = {
|
||||
.write = pty_write,
|
||||
.write_room = pty_write_room,
|
||||
.flush_buffer = pty_flush_buffer,
|
||||
.chars_in_buffer = pty_chars_in_buffer,
|
||||
.unthrottle = pty_unthrottle,
|
||||
.set_termios = pty_set_termios,
|
||||
.cleanup = pty_cleanup,
|
||||
@ -626,7 +611,7 @@ static struct cdev ptmx_cdev;
|
||||
*/
|
||||
int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
|
||||
{
|
||||
int fd = -1;
|
||||
int fd;
|
||||
struct file *filp;
|
||||
int retval = -EINVAL;
|
||||
struct path path;
|
||||
@ -776,7 +761,6 @@ static const struct tty_operations ptm_unix98_ops = {
|
||||
.write = pty_write,
|
||||
.write_room = pty_write_room,
|
||||
.flush_buffer = pty_flush_buffer,
|
||||
.chars_in_buffer = pty_chars_in_buffer,
|
||||
.unthrottle = pty_unthrottle,
|
||||
.ioctl = pty_unix98_ioctl,
|
||||
.compat_ioctl = pty_unix98_compat_ioctl,
|
||||
@ -794,7 +778,6 @@ static const struct tty_operations pty_unix98_ops = {
|
||||
.write = pty_write,
|
||||
.write_room = pty_write_room,
|
||||
.flush_buffer = pty_flush_buffer,
|
||||
.chars_in_buffer = pty_chars_in_buffer,
|
||||
.unthrottle = pty_unthrottle,
|
||||
.set_termios = pty_set_termios,
|
||||
.start = pty_start,
|
||||
|
@ -798,7 +798,7 @@ void serdev_controller_remove(struct serdev_controller *ctrl)
|
||||
EXPORT_SYMBOL_GPL(serdev_controller_remove);
|
||||
|
||||
/**
|
||||
* serdev_driver_register() - Register client driver with serdev core
|
||||
* __serdev_device_driver_register() - Register client driver with serdev core
|
||||
* @sdrv: client driver to be associated with client-device.
|
||||
* @owner: client driver owner to set.
|
||||
*
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
struct aspeed_vuart {
|
||||
struct device *dev;
|
||||
void __iomem *regs;
|
||||
struct clk *clk;
|
||||
int line;
|
||||
struct timer_list unthrottle_timer;
|
||||
@ -64,14 +63,24 @@ static const int unthrottle_timeout = HZ/10;
|
||||
* different system (though most of them use 3f8/4).
|
||||
*/
|
||||
|
||||
static inline u8 aspeed_vuart_readb(struct aspeed_vuart *vuart, u8 reg)
|
||||
{
|
||||
return readb(vuart->port->port.membase + reg);
|
||||
}
|
||||
|
||||
static inline void aspeed_vuart_writeb(struct aspeed_vuart *vuart, u8 val, u8 reg)
|
||||
{
|
||||
writeb(val, vuart->port->port.membase + reg);
|
||||
}
|
||||
|
||||
static ssize_t lpc_address_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct aspeed_vuart *vuart = dev_get_drvdata(dev);
|
||||
u16 addr;
|
||||
|
||||
addr = (readb(vuart->regs + ASPEED_VUART_ADDRH) << 8) |
|
||||
(readb(vuart->regs + ASPEED_VUART_ADDRL));
|
||||
addr = (aspeed_vuart_readb(vuart, ASPEED_VUART_ADDRH) << 8) |
|
||||
(aspeed_vuart_readb(vuart, ASPEED_VUART_ADDRL));
|
||||
|
||||
return snprintf(buf, PAGE_SIZE - 1, "0x%x\n", addr);
|
||||
}
|
||||
@ -81,8 +90,8 @@ static int aspeed_vuart_set_lpc_address(struct aspeed_vuart *vuart, u32 addr)
|
||||
if (addr > U16_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
writeb(addr >> 8, vuart->regs + ASPEED_VUART_ADDRH);
|
||||
writeb(addr >> 0, vuart->regs + ASPEED_VUART_ADDRL);
|
||||
aspeed_vuart_writeb(vuart, addr >> 8, ASPEED_VUART_ADDRH);
|
||||
aspeed_vuart_writeb(vuart, addr >> 0, ASPEED_VUART_ADDRL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -111,7 +120,7 @@ static ssize_t sirq_show(struct device *dev,
|
||||
struct aspeed_vuart *vuart = dev_get_drvdata(dev);
|
||||
u8 reg;
|
||||
|
||||
reg = readb(vuart->regs + ASPEED_VUART_GCRB);
|
||||
reg = aspeed_vuart_readb(vuart, ASPEED_VUART_GCRB);
|
||||
reg &= ASPEED_VUART_GCRB_HOST_SIRQ_MASK;
|
||||
reg >>= ASPEED_VUART_GCRB_HOST_SIRQ_SHIFT;
|
||||
|
||||
@ -128,10 +137,10 @@ static int aspeed_vuart_set_sirq(struct aspeed_vuart *vuart, u32 sirq)
|
||||
sirq <<= ASPEED_VUART_GCRB_HOST_SIRQ_SHIFT;
|
||||
sirq &= ASPEED_VUART_GCRB_HOST_SIRQ_MASK;
|
||||
|
||||
reg = readb(vuart->regs + ASPEED_VUART_GCRB);
|
||||
reg = aspeed_vuart_readb(vuart, ASPEED_VUART_GCRB);
|
||||
reg &= ~ASPEED_VUART_GCRB_HOST_SIRQ_MASK;
|
||||
reg |= sirq;
|
||||
writeb(reg, vuart->regs + ASPEED_VUART_GCRB);
|
||||
aspeed_vuart_writeb(vuart, reg, ASPEED_VUART_GCRB);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -159,7 +168,7 @@ static ssize_t sirq_polarity_show(struct device *dev,
|
||||
struct aspeed_vuart *vuart = dev_get_drvdata(dev);
|
||||
u8 reg;
|
||||
|
||||
reg = readb(vuart->regs + ASPEED_VUART_GCRA);
|
||||
reg = aspeed_vuart_readb(vuart, ASPEED_VUART_GCRA);
|
||||
reg &= ASPEED_VUART_GCRA_HOST_SIRQ_POLARITY;
|
||||
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%u\n", reg ? 1 : 0);
|
||||
@ -168,14 +177,14 @@ static ssize_t sirq_polarity_show(struct device *dev,
|
||||
static void aspeed_vuart_set_sirq_polarity(struct aspeed_vuart *vuart,
|
||||
bool polarity)
|
||||
{
|
||||
u8 reg = readb(vuart->regs + ASPEED_VUART_GCRA);
|
||||
u8 reg = aspeed_vuart_readb(vuart, ASPEED_VUART_GCRA);
|
||||
|
||||
if (polarity)
|
||||
reg |= ASPEED_VUART_GCRA_HOST_SIRQ_POLARITY;
|
||||
else
|
||||
reg &= ~ASPEED_VUART_GCRA_HOST_SIRQ_POLARITY;
|
||||
|
||||
writeb(reg, vuart->regs + ASPEED_VUART_GCRA);
|
||||
aspeed_vuart_writeb(vuart, reg, ASPEED_VUART_GCRA);
|
||||
}
|
||||
|
||||
static ssize_t sirq_polarity_store(struct device *dev,
|
||||
@ -210,14 +219,14 @@ static const struct attribute_group aspeed_vuart_attr_group = {
|
||||
|
||||
static void aspeed_vuart_set_enabled(struct aspeed_vuart *vuart, bool enabled)
|
||||
{
|
||||
u8 reg = readb(vuart->regs + ASPEED_VUART_GCRA);
|
||||
u8 reg = aspeed_vuart_readb(vuart, ASPEED_VUART_GCRA);
|
||||
|
||||
if (enabled)
|
||||
reg |= ASPEED_VUART_GCRA_VUART_EN;
|
||||
else
|
||||
reg &= ~ASPEED_VUART_GCRA_VUART_EN;
|
||||
|
||||
writeb(reg, vuart->regs + ASPEED_VUART_GCRA);
|
||||
aspeed_vuart_writeb(vuart, reg, ASPEED_VUART_GCRA);
|
||||
}
|
||||
|
||||
static void aspeed_vuart_set_host_tx_discard(struct aspeed_vuart *vuart,
|
||||
@ -225,7 +234,7 @@ static void aspeed_vuart_set_host_tx_discard(struct aspeed_vuart *vuart,
|
||||
{
|
||||
u8 reg;
|
||||
|
||||
reg = readb(vuart->regs + ASPEED_VUART_GCRA);
|
||||
reg = aspeed_vuart_readb(vuart, ASPEED_VUART_GCRA);
|
||||
|
||||
/* If the DISABLE_HOST_TX_DISCARD bit is set, discard is disabled */
|
||||
if (!discard)
|
||||
@ -233,7 +242,7 @@ static void aspeed_vuart_set_host_tx_discard(struct aspeed_vuart *vuart,
|
||||
else
|
||||
reg &= ~ASPEED_VUART_GCRA_DISABLE_HOST_TX_DISCARD;
|
||||
|
||||
writeb(reg, vuart->regs + ASPEED_VUART_GCRA);
|
||||
aspeed_vuart_writeb(vuart, reg, ASPEED_VUART_GCRA);
|
||||
}
|
||||
|
||||
static int aspeed_vuart_startup(struct uart_port *uart_port)
|
||||
@ -320,7 +329,7 @@ static int aspeed_vuart_handle_irq(struct uart_port *port)
|
||||
{
|
||||
struct uart_8250_port *up = up_to_u8250p(port);
|
||||
unsigned int iir, lsr;
|
||||
int space, count;
|
||||
unsigned int space, count;
|
||||
|
||||
iir = serial_port_in(port, UART_IIR);
|
||||
|
||||
@ -339,14 +348,12 @@ static int aspeed_vuart_handle_irq(struct uart_port *port)
|
||||
struct aspeed_vuart *vuart = port->private_data;
|
||||
__aspeed_vuart_set_throttle(up, true);
|
||||
|
||||
if (!timer_pending(&vuart->unthrottle_timer)) {
|
||||
vuart->port = up;
|
||||
if (!timer_pending(&vuart->unthrottle_timer))
|
||||
mod_timer(&vuart->unthrottle_timer,
|
||||
jiffies + unthrottle_timeout);
|
||||
}
|
||||
|
||||
} else {
|
||||
count = min(space, 256);
|
||||
count = min(space, 256U);
|
||||
|
||||
do {
|
||||
serial8250_read_char(up, lsr);
|
||||
@ -421,13 +428,9 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
|
||||
timer_setup(&vuart->unthrottle_timer, aspeed_vuart_unthrottle_exp, 0);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
vuart->regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(vuart->regs))
|
||||
return PTR_ERR(vuart->regs);
|
||||
|
||||
memset(&port, 0, sizeof(port));
|
||||
port.port.private_data = vuart;
|
||||
port.port.membase = vuart->regs;
|
||||
port.port.mapbase = res->start;
|
||||
port.port.mapsize = resource_size(res);
|
||||
port.port.startup = aspeed_vuart_startup;
|
||||
@ -485,7 +488,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
|
||||
port.port.iotype = UPIO_MEM;
|
||||
port.port.type = PORT_16550A;
|
||||
port.port.uartclk = clk;
|
||||
port.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF
|
||||
port.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
|
||||
| UPF_FIXED_PORT | UPF_FIXED_TYPE | UPF_NO_THRE_TEST;
|
||||
|
||||
if (of_property_read_bool(np, "no-loopback-test"))
|
||||
@ -502,6 +505,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
|
||||
goto err_clk_disable;
|
||||
|
||||
vuart->line = rc;
|
||||
vuart->port = serial8250_get_port(vuart->line);
|
||||
|
||||
rc = of_parse_phandle_with_fixed_args(
|
||||
np, "aspeed,sirq-polarity-sense", 2, 0,
|
||||
|
@ -172,7 +172,6 @@ static void serial_do_unlink(struct irq_info *i, struct uart_8250_port *up)
|
||||
static int serial_link_irq_chain(struct uart_8250_port *up)
|
||||
{
|
||||
struct hlist_head *h;
|
||||
struct hlist_node *n;
|
||||
struct irq_info *i;
|
||||
int ret;
|
||||
|
||||
@ -180,13 +179,11 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
|
||||
|
||||
h = &irq_lists[up->port.irq % NR_IRQ_HASH];
|
||||
|
||||
hlist_for_each(n, h) {
|
||||
i = hlist_entry(n, struct irq_info, node);
|
||||
hlist_for_each_entry(i, h, node)
|
||||
if (i->irq == up->port.irq)
|
||||
break;
|
||||
}
|
||||
|
||||
if (n == NULL) {
|
||||
if (i == NULL) {
|
||||
i = kzalloc(sizeof(struct irq_info), GFP_KERNEL);
|
||||
if (i == NULL) {
|
||||
mutex_unlock(&hash_mutex);
|
||||
@ -220,25 +217,18 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
|
||||
|
||||
static void serial_unlink_irq_chain(struct uart_8250_port *up)
|
||||
{
|
||||
/*
|
||||
* yes, some broken gcc emit "warning: 'i' may be used uninitialized"
|
||||
* but no, we are not going to take a patch that assigns NULL below.
|
||||
*/
|
||||
struct irq_info *i;
|
||||
struct hlist_node *n;
|
||||
struct hlist_head *h;
|
||||
|
||||
mutex_lock(&hash_mutex);
|
||||
|
||||
h = &irq_lists[up->port.irq % NR_IRQ_HASH];
|
||||
|
||||
hlist_for_each(n, h) {
|
||||
i = hlist_entry(n, struct irq_info, node);
|
||||
hlist_for_each_entry(i, h, node)
|
||||
if (i->irq == up->port.irq)
|
||||
break;
|
||||
}
|
||||
|
||||
BUG_ON(n == NULL);
|
||||
BUG_ON(i == NULL);
|
||||
BUG_ON(i->head == NULL);
|
||||
|
||||
if (list_empty(i->head))
|
||||
@ -331,9 +321,9 @@ static int univ8250_setup_irq(struct uart_8250_port *up)
|
||||
* hardware interrupt, we use a timer-based system. The original
|
||||
* driver used to do this with IRQ0.
|
||||
*/
|
||||
if (!port->irq) {
|
||||
if (!port->irq)
|
||||
mod_timer(&up->timer, jiffies + uart_poll_timeout(port));
|
||||
} else
|
||||
else
|
||||
retval = serial_link_irq_chain(up);
|
||||
|
||||
return retval;
|
||||
@ -762,6 +752,7 @@ void serial8250_suspend_port(int line)
|
||||
if (!console_suspend_enabled && uart_console(port) &&
|
||||
port->type != PORT_8250) {
|
||||
unsigned char canary = 0xa5;
|
||||
|
||||
serial_out(up, UART_SCR, canary);
|
||||
if (serial_in(up, UART_SCR) == canary)
|
||||
up->canary = canary;
|
||||
@ -915,7 +906,7 @@ static struct platform_device *serial8250_isa_devs;
|
||||
*/
|
||||
static DEFINE_MUTEX(serial_mutex);
|
||||
|
||||
static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *port)
|
||||
static struct uart_8250_port *serial8250_find_match_or_unused(const struct uart_port *port)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -980,7 +971,7 @@ static void serial_8250_overrun_backoff_work(struct work_struct *work)
|
||||
*
|
||||
* On success the port is ready to use and the line number is returned.
|
||||
*/
|
||||
int serial8250_register_8250_port(struct uart_8250_port *up)
|
||||
int serial8250_register_8250_port(const struct uart_8250_port *up)
|
||||
{
|
||||
struct uart_8250_port *uart;
|
||||
int ret = -ENOSPC;
|
||||
|
@ -501,23 +501,27 @@ static const struct dmi_system_id exar_platforms[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct exar8250_platform *exar_get_platform(void)
|
||||
{
|
||||
const struct dmi_system_id *dmi_match;
|
||||
|
||||
dmi_match = dmi_first_match(exar_platforms);
|
||||
if (dmi_match)
|
||||
return dmi_match->driver_data;
|
||||
|
||||
return &exar8250_default_platform;
|
||||
}
|
||||
|
||||
static int
|
||||
pci_xr17v35x_setup(struct exar8250 *priv, struct pci_dev *pcidev,
|
||||
struct uart_8250_port *port, int idx)
|
||||
{
|
||||
const struct exar8250_platform *platform;
|
||||
const struct dmi_system_id *dmi_match;
|
||||
const struct exar8250_platform *platform = exar_get_platform();
|
||||
unsigned int offset = idx * 0x400;
|
||||
unsigned int baud = 7812500;
|
||||
u8 __iomem *p;
|
||||
int ret;
|
||||
|
||||
dmi_match = dmi_first_match(exar_platforms);
|
||||
if (dmi_match)
|
||||
platform = dmi_match->driver_data;
|
||||
else
|
||||
platform = &exar8250_default_platform;
|
||||
|
||||
port->port.uartclk = baud * 16;
|
||||
port->port.rs485_config = platform->rs485_config;
|
||||
|
||||
|
@ -192,6 +192,10 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
|
||||
u32 tx_threshold;
|
||||
int ret;
|
||||
|
||||
if (IS_ENABLED(CONFIG_SERIAL_8250_BCM7271) &&
|
||||
of_device_is_compatible(ofdev->dev.of_node, "brcm,bcm7271-uart"))
|
||||
return -ENODEV;
|
||||
|
||||
port_type = (unsigned long)of_device_get_match_data(&ofdev->dev);
|
||||
if (port_type == PORT_UNKNOWN)
|
||||
return -EINVAL;
|
||||
|
@ -43,6 +43,7 @@
|
||||
#define UART_ERRATA_CLOCK_DISABLE (1 << 3)
|
||||
#define UART_HAS_EFR2 BIT(4)
|
||||
#define UART_HAS_RHR_IT_DIS BIT(5)
|
||||
#define UART_RX_TIMEOUT_QUIRK BIT(6)
|
||||
|
||||
#define OMAP_UART_FCR_RX_TRIG 6
|
||||
#define OMAP_UART_FCR_TX_TRIG 4
|
||||
@ -104,6 +105,9 @@
|
||||
#define UART_OMAP_EFR2 0x23
|
||||
#define UART_OMAP_EFR2_TIMEOUT_BEHAVE BIT(6)
|
||||
|
||||
/* RX FIFO occupancy indicator */
|
||||
#define UART_OMAP_RX_LVL 0x64
|
||||
|
||||
struct omap8250_priv {
|
||||
int line;
|
||||
u8 habit;
|
||||
@ -611,6 +615,7 @@ static int omap_8250_dma_handle_irq(struct uart_port *port);
|
||||
static irqreturn_t omap8250_irq(int irq, void *dev_id)
|
||||
{
|
||||
struct uart_port *port = dev_id;
|
||||
struct omap8250_priv *priv = port->private_data;
|
||||
struct uart_8250_port *up = up_to_u8250p(port);
|
||||
unsigned int iir;
|
||||
int ret;
|
||||
@ -625,6 +630,18 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id)
|
||||
serial8250_rpm_get(up);
|
||||
iir = serial_port_in(port, UART_IIR);
|
||||
ret = serial8250_handle_irq(port, iir);
|
||||
|
||||
/*
|
||||
* On K3 SoCs, it is observed that RX TIMEOUT is signalled after
|
||||
* FIFO has been drained, in which case a dummy read of RX FIFO
|
||||
* is required to clear RX TIMEOUT condition.
|
||||
*/
|
||||
if (priv->habit & UART_RX_TIMEOUT_QUIRK &&
|
||||
(iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT &&
|
||||
serial_port_in(port, UART_OMAP_RX_LVL) == 0) {
|
||||
serial_port_in(port, UART_RX);
|
||||
}
|
||||
|
||||
serial8250_rpm_put(up);
|
||||
|
||||
return IRQ_RETVAL(ret);
|
||||
@ -813,7 +830,7 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
|
||||
poll_count--)
|
||||
cpu_relax();
|
||||
|
||||
if (!poll_count)
|
||||
if (poll_count == -1)
|
||||
dev_err(p->port.dev, "teardown incomplete\n");
|
||||
}
|
||||
}
|
||||
@ -1218,7 +1235,8 @@ static struct omap8250_dma_params am33xx_dma = {
|
||||
|
||||
static struct omap8250_platdata am654_platdata = {
|
||||
.dma_params = &am654_dma,
|
||||
.habit = UART_HAS_EFR2 | UART_HAS_RHR_IT_DIS,
|
||||
.habit = UART_HAS_EFR2 | UART_HAS_RHR_IT_DIS |
|
||||
UART_RX_TIMEOUT_QUIRK,
|
||||
};
|
||||
|
||||
static struct omap8250_platdata am33xx_platdata = {
|
||||
|
@ -2851,7 +2851,7 @@ enum pci_board_num_t {
|
||||
pbn_b0_2_1843200,
|
||||
pbn_b0_4_1843200,
|
||||
|
||||
pbn_b0_1_4000000,
|
||||
pbn_b0_1_3906250,
|
||||
|
||||
pbn_b0_bt_1_115200,
|
||||
pbn_b0_bt_2_115200,
|
||||
@ -2931,10 +2931,10 @@ enum pci_board_num_t {
|
||||
pbn_plx_romulus,
|
||||
pbn_endrun_2_4000000,
|
||||
pbn_oxsemi,
|
||||
pbn_oxsemi_1_4000000,
|
||||
pbn_oxsemi_2_4000000,
|
||||
pbn_oxsemi_4_4000000,
|
||||
pbn_oxsemi_8_4000000,
|
||||
pbn_oxsemi_1_3906250,
|
||||
pbn_oxsemi_2_3906250,
|
||||
pbn_oxsemi_4_3906250,
|
||||
pbn_oxsemi_8_3906250,
|
||||
pbn_intel_i960,
|
||||
pbn_sgi_ioc3,
|
||||
pbn_computone_4,
|
||||
@ -2972,6 +2972,10 @@ enum pci_board_num_t {
|
||||
pbn_sunix_pci_4s,
|
||||
pbn_sunix_pci_8s,
|
||||
pbn_sunix_pci_16s,
|
||||
pbn_titan_1_4000000,
|
||||
pbn_titan_2_4000000,
|
||||
pbn_titan_4_4000000,
|
||||
pbn_titan_8_4000000,
|
||||
pbn_moxa8250_2p,
|
||||
pbn_moxa8250_4p,
|
||||
pbn_moxa8250_8p,
|
||||
@ -3077,10 +3081,10 @@ static struct pciserial_board pci_boards[] = {
|
||||
.uart_offset = 8,
|
||||
},
|
||||
|
||||
[pbn_b0_1_4000000] = {
|
||||
[pbn_b0_1_3906250] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 1,
|
||||
.base_baud = 4000000,
|
||||
.base_baud = 3906250,
|
||||
.uart_offset = 8,
|
||||
},
|
||||
|
||||
@ -3475,31 +3479,31 @@ static struct pciserial_board pci_boards[] = {
|
||||
.base_baud = 115200,
|
||||
.uart_offset = 8,
|
||||
},
|
||||
[pbn_oxsemi_1_4000000] = {
|
||||
[pbn_oxsemi_1_3906250] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 1,
|
||||
.base_baud = 4000000,
|
||||
.base_baud = 3906250,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
[pbn_oxsemi_2_4000000] = {
|
||||
[pbn_oxsemi_2_3906250] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 2,
|
||||
.base_baud = 4000000,
|
||||
.base_baud = 3906250,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
[pbn_oxsemi_4_4000000] = {
|
||||
[pbn_oxsemi_4_3906250] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 4,
|
||||
.base_baud = 4000000,
|
||||
.base_baud = 3906250,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
[pbn_oxsemi_8_4000000] = {
|
||||
[pbn_oxsemi_8_3906250] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 8,
|
||||
.base_baud = 4000000,
|
||||
.base_baud = 3906250,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
@ -3759,6 +3763,34 @@ static struct pciserial_board pci_boards[] = {
|
||||
.base_baud = 921600,
|
||||
.uart_offset = 0x8,
|
||||
},
|
||||
[pbn_titan_1_4000000] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 1,
|
||||
.base_baud = 4000000,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
[pbn_titan_2_4000000] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 2,
|
||||
.base_baud = 4000000,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
[pbn_titan_4_4000000] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 4,
|
||||
.base_baud = 4000000,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
[pbn_titan_8_4000000] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 8,
|
||||
.base_baud = 4000000,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
[pbn_moxa8250_2p] = {
|
||||
.flags = FL_BASE1,
|
||||
.num_ports = 2,
|
||||
@ -4478,158 +4510,158 @@ static const struct pci_device_id serial_pci_tbl[] = {
|
||||
*/
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc101, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc105, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc11b, /* OXPCIe952 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc11f, /* OXPCIe952 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc120, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc124, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc138, /* OXPCIe952 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc13d, /* OXPCIe952 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc140, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc141, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc144, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc145, /* OXPCIe952 1 Legacy UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_1_4000000 },
|
||||
pbn_b0_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc158, /* OXPCIe952 2 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_2_4000000 },
|
||||
pbn_oxsemi_2_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc15d, /* OXPCIe952 2 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_2_4000000 },
|
||||
pbn_oxsemi_2_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc208, /* OXPCIe954 4 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_4_4000000 },
|
||||
pbn_oxsemi_4_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc20d, /* OXPCIe954 4 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_4_4000000 },
|
||||
pbn_oxsemi_4_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc308, /* OXPCIe958 8 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_8_4000000 },
|
||||
pbn_oxsemi_8_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc30d, /* OXPCIe958 8 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_8_4000000 },
|
||||
pbn_oxsemi_8_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc40b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc40f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc41b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc41f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc42b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc42f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc43b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc43f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc44b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc44f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc45b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc45f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc46b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc46f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc47b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc47f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc48b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc48f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc49b, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc49f, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc4ab, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc4af, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc4bb, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc4bf, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc4cb, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_OXSEMI, 0xc4cf, /* OXPCIe200 1 Native UART */
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
/*
|
||||
* Mainpine Inc. IQ Express "Rev3" utilizing OxSemi Tornado
|
||||
*/
|
||||
{ PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 1 Port V.34 Super-G3 Fax */
|
||||
PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_oxsemi_1_3906250 },
|
||||
{ PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 2 Port V.34 Super-G3 Fax */
|
||||
PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
|
||||
pbn_oxsemi_2_4000000 },
|
||||
pbn_oxsemi_2_3906250 },
|
||||
{ PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 4 Port V.34 Super-G3 Fax */
|
||||
PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
|
||||
pbn_oxsemi_4_4000000 },
|
||||
pbn_oxsemi_4_3906250 },
|
||||
{ PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 8 Port V.34 Super-G3 Fax */
|
||||
PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
|
||||
pbn_oxsemi_8_4000000 },
|
||||
pbn_oxsemi_8_3906250 },
|
||||
|
||||
/*
|
||||
* Digi/IBM PCIe 2-port Async EIA-232 Adapter utilizing OxSemi Tornado
|
||||
*/
|
||||
{ PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_2_OX_IBM,
|
||||
PCI_SUBVENDOR_ID_IBM, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_2_4000000 },
|
||||
pbn_oxsemi_2_3906250 },
|
||||
|
||||
/*
|
||||
* SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
|
||||
@ -4703,22 +4735,22 @@ static const struct pci_device_id serial_pci_tbl[] = {
|
||||
pbn_b0_4_921600 },
|
||||
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100E,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_1_4000000 },
|
||||
pbn_titan_1_4000000 },
|
||||
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200E,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_2_4000000 },
|
||||
pbn_titan_2_4000000 },
|
||||
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400E,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_4_4000000 },
|
||||
pbn_titan_4_4000000 },
|
||||
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800E,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_8_4000000 },
|
||||
pbn_titan_8_4000000 },
|
||||
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EI,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_2_4000000 },
|
||||
pbn_titan_2_4000000 },
|
||||
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_oxsemi_2_4000000 },
|
||||
pbn_titan_2_4000000 },
|
||||
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200V3,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_b0_bt_2_921600 },
|
||||
|
@ -2512,19 +2512,45 @@ static unsigned int serial8250_do_get_divisor(struct uart_port *port,
|
||||
unsigned int baud,
|
||||
unsigned int *frac)
|
||||
{
|
||||
upf_t magic_multiplier = port->flags & UPF_MAGIC_MULTIPLIER;
|
||||
struct uart_8250_port *up = up_to_u8250p(port);
|
||||
unsigned int quot;
|
||||
|
||||
/*
|
||||
* Handle magic divisors for baud rates above baud_base on
|
||||
* SMSC SuperIO chips.
|
||||
* Handle magic divisors for baud rates above baud_base on SMSC
|
||||
* Super I/O chips. We clamp custom rates from clk/6 and clk/12
|
||||
* up to clk/4 (0x8001) and clk/8 (0x8002) respectively. These
|
||||
* magic divisors actually reprogram the baud rate generator's
|
||||
* reference clock derived from chips's 14.318MHz clock input.
|
||||
*
|
||||
* Documentation claims that with these magic divisors the base
|
||||
* frequencies of 7.3728MHz and 3.6864MHz are used respectively
|
||||
* for the extra baud rates of 460800bps and 230400bps rather
|
||||
* than the usual base frequency of 1.8462MHz. However empirical
|
||||
* evidence contradicts that.
|
||||
*
|
||||
* Instead bit 7 of the DLM register (bit 15 of the divisor) is
|
||||
* effectively used as a clock prescaler selection bit for the
|
||||
* base frequency of 7.3728MHz, always used. If set to 0, then
|
||||
* the base frequency is divided by 4 for use by the Baud Rate
|
||||
* Generator, for the usual arrangement where the value of 1 of
|
||||
* the divisor produces the baud rate of 115200bps. Conversely,
|
||||
* if set to 1 and high-speed operation has been enabled with the
|
||||
* Serial Port Mode Register in the Device Configuration Space,
|
||||
* then the base frequency is supplied directly to the Baud Rate
|
||||
* Generator, so for the divisor values of 0x8001, 0x8002, 0x8003,
|
||||
* 0x8004, etc. the respective baud rates produced are 460800bps,
|
||||
* 230400bps, 153600bps, 115200bps, etc.
|
||||
*
|
||||
* In all cases only low 15 bits of the divisor are used to divide
|
||||
* the baud base and therefore 32767 is the maximum divisor value
|
||||
* possible, even though documentation says that the programmable
|
||||
* Baud Rate Generator is capable of dividing the internal PLL
|
||||
* clock by any divisor from 1 to 65535.
|
||||
*/
|
||||
if ((port->flags & UPF_MAGIC_MULTIPLIER) &&
|
||||
baud == (port->uartclk/4))
|
||||
if (magic_multiplier && baud >= port->uartclk / 6)
|
||||
quot = 0x8001;
|
||||
else if ((port->flags & UPF_MAGIC_MULTIPLIER) &&
|
||||
baud == (port->uartclk/8))
|
||||
else if (magic_multiplier && baud >= port->uartclk / 12)
|
||||
quot = 0x8002;
|
||||
else if (up->port.type == PORT_NPCM)
|
||||
quot = npcm_get_divisor(up, baud);
|
||||
@ -2629,6 +2655,21 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port,
|
||||
struct ktermios *old)
|
||||
{
|
||||
unsigned int tolerance = port->uartclk / 100;
|
||||
unsigned int min;
|
||||
unsigned int max;
|
||||
|
||||
/*
|
||||
* Handle magic divisors for baud rates above baud_base on SMSC
|
||||
* Super I/O chips. Enable custom rates of clk/4 and clk/8, but
|
||||
* disable divisor values beyond 32767, which are unavailable.
|
||||
*/
|
||||
if (port->flags & UPF_MAGIC_MULTIPLIER) {
|
||||
min = port->uartclk / 16 / UART_DIV_MAX >> 1;
|
||||
max = (port->uartclk + tolerance) / 4;
|
||||
} else {
|
||||
min = port->uartclk / 16 / UART_DIV_MAX;
|
||||
max = (port->uartclk + tolerance) / 16;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ask the core to calculate the divisor for us.
|
||||
@ -2636,9 +2677,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port,
|
||||
* slower than nominal still match standard baud rates without
|
||||
* causing transmission errors.
|
||||
*/
|
||||
return uart_get_baud_rate(port, termios, old,
|
||||
port->uartclk / 16 / UART_DIV_MAX,
|
||||
(port->uartclk + tolerance) / 16);
|
||||
return uart_get_baud_rate(port, termios, old, min, max);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -306,6 +306,7 @@ static int serial_resume(struct pcmcia_device *link)
|
||||
static int serial_probe(struct pcmcia_device *link)
|
||||
{
|
||||
struct serial_info *info;
|
||||
int ret;
|
||||
|
||||
dev_dbg(&link->dev, "serial_attach()\n");
|
||||
|
||||
@ -320,7 +321,15 @@ static int serial_probe(struct pcmcia_device *link)
|
||||
if (do_sound)
|
||||
link->config_flags |= CONF_ENABLE_SPKR;
|
||||
|
||||
return serial_config(link);
|
||||
ret = serial_config(link);
|
||||
if (ret)
|
||||
goto free_info;
|
||||
|
||||
return 0;
|
||||
|
||||
free_info:
|
||||
kfree(info);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void serial_detach(struct pcmcia_device *link)
|
||||
@ -777,6 +786,7 @@ static const struct pcmcia_device_id serial_ids[] = {
|
||||
PCMCIA_DEVICE_PROD_ID12("Multi-Tech", "MT2834LT", 0x5f73be51, 0x4cd7c09e),
|
||||
PCMCIA_DEVICE_PROD_ID12("OEM ", "C288MX ", 0xb572d360, 0xd2385b7a),
|
||||
PCMCIA_DEVICE_PROD_ID12("Option International", "V34bis GSM/PSTN Data/Fax Modem", 0x9d7cd6f5, 0x5cb8bf41),
|
||||
PCMCIA_DEVICE_PROD_ID12("Option International", "GSM-Ready 56K/ISDN", 0x9d7cd6f5, 0xb23844aa),
|
||||
PCMCIA_DEVICE_PROD_ID12("PCMCIA ", "C336MX ", 0x99bcafe9, 0xaa25bcab),
|
||||
PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "PCMCIA Dual RS-232 Serial Port Card", 0xc4420b35, 0x92abc92f),
|
||||
PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "Dual RS-232 Serial Port PC Card", 0xc4420b35, 0x031a380d),
|
||||
@ -804,7 +814,6 @@ static const struct pcmcia_device_id serial_ids[] = {
|
||||
PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "cis/COMpad4.cis"),
|
||||
PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "cis/COMpad2.cis"),
|
||||
PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "cis/RS-COM-2P.cis"),
|
||||
PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "cis/GLOBETROTTER.cis"),
|
||||
PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL100 1.00.", 0x19ca78af, 0xf964f42b),
|
||||
PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL100", 0x19ca78af, 0x71d98e83),
|
||||
PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL232 1.00.", 0x19ca78af, 0x69fb7490),
|
||||
|
@ -1553,6 +1553,7 @@ config SERIAL_LITEUART_CONSOLE
|
||||
bool "LiteUART serial port console support"
|
||||
depends on SERIAL_LITEUART=y
|
||||
select SERIAL_CORE_CONSOLE
|
||||
select SERIAL_EARLYCON
|
||||
help
|
||||
Say 'Y' or 'M' here if you wish to use the FPGA-based LiteUART serial
|
||||
controller from LiteX SoC builder as the system console
|
||||
|
@ -1062,7 +1062,7 @@ static void pl011_dma_rx_poll(struct timer_list *t)
|
||||
struct tty_port *port = &uap->port.state->port;
|
||||
struct pl011_dmarx_data *dmarx = &uap->dmarx;
|
||||
struct dma_chan *rxchan = uap->dmarx.chan;
|
||||
unsigned long flags = 0;
|
||||
unsigned long flags;
|
||||
unsigned int dmataken = 0;
|
||||
unsigned int size = 0;
|
||||
struct pl011_sgbuf *sgbuf;
|
||||
|
@ -149,7 +149,7 @@ static unsigned int arc_serial_tx_empty(struct uart_port *port)
|
||||
/*
|
||||
* Driver internal routine, used by both tty(serial core) as well as tx-isr
|
||||
* -Called under spinlock in either cases
|
||||
* -also tty->stopped has already been checked
|
||||
* -also tty->flow.stopped has already been checked
|
||||
* = by uart_start( ) before calling us
|
||||
* = tx_ist checks that too before calling
|
||||
*/
|
||||
|
@ -30,9 +30,9 @@
|
||||
#include <linux/irq.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <asm/div64.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/ioctls.h>
|
||||
|
||||
#define PDC_BUFFER_SIZE 512
|
||||
|
@ -524,24 +524,7 @@ static void cpm_uart_set_termios(struct uart_port *port,
|
||||
scval = 0;
|
||||
|
||||
/* byte size */
|
||||
switch (termios->c_cflag & CSIZE) {
|
||||
case CS5:
|
||||
bits = 5;
|
||||
break;
|
||||
case CS6:
|
||||
bits = 6;
|
||||
break;
|
||||
case CS7:
|
||||
bits = 7;
|
||||
break;
|
||||
case CS8:
|
||||
bits = 8;
|
||||
break;
|
||||
/* Never happens, but GCC is too dumb to figure it out */
|
||||
default:
|
||||
bits = 8;
|
||||
break;
|
||||
}
|
||||
bits = tty_get_char_size(termios->c_cflag);
|
||||
sbits = bits - 5;
|
||||
|
||||
if (termios->c_cflag & CSTOPB) {
|
||||
|
@ -47,8 +47,8 @@
|
||||
#include <linux/tty_flip.h>
|
||||
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/io.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <asm/dec/interrupts.h>
|
||||
#include <asm/dec/kn01.h>
|
||||
@ -115,7 +115,7 @@ static void dz_out(struct dz_port *dport, unsigned offset, u16 value)
|
||||
* rs_stop () and rs_start ()
|
||||
*
|
||||
* These routines are called before setting or resetting
|
||||
* tty->stopped. They enable or disable transmitter interrupts,
|
||||
* tty->flow.stopped. They enable or disable transmitter interrupts,
|
||||
* as necessary.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
|
@ -824,21 +824,18 @@ static unsigned int lpuart32_tx_empty(struct uart_port *port)
|
||||
|
||||
static void lpuart_txint(struct lpuart_port *sport)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
spin_lock(&sport->port.lock);
|
||||
lpuart_transmit_buffer(sport);
|
||||
spin_unlock_irqrestore(&sport->port.lock, flags);
|
||||
spin_unlock(&sport->port.lock);
|
||||
}
|
||||
|
||||
static void lpuart_rxint(struct lpuart_port *sport)
|
||||
{
|
||||
unsigned int flg, ignored = 0, overrun = 0;
|
||||
struct tty_port *port = &sport->port.state->port;
|
||||
unsigned long flags;
|
||||
unsigned char rx, sr;
|
||||
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
spin_lock(&sport->port.lock);
|
||||
|
||||
while (!(readb(sport->port.membase + UARTSFIFO) & UARTSFIFO_RXEMPT)) {
|
||||
flg = TTY_NORMAL;
|
||||
@ -850,7 +847,7 @@ static void lpuart_rxint(struct lpuart_port *sport)
|
||||
sr = readb(sport->port.membase + UARTSR1);
|
||||
rx = readb(sport->port.membase + UARTDR);
|
||||
|
||||
if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx))
|
||||
if (uart_prepare_sysrq_char(&sport->port, rx))
|
||||
continue;
|
||||
|
||||
if (sr & (UARTSR1_PE | UARTSR1_OR | UARTSR1_FE)) {
|
||||
@ -896,28 +893,26 @@ out:
|
||||
writeb(UARTSFIFO_RXOF, sport->port.membase + UARTSFIFO);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&sport->port.lock, flags);
|
||||
uart_unlock_and_check_sysrq(&sport->port);
|
||||
|
||||
tty_flip_buffer_push(port);
|
||||
}
|
||||
|
||||
static void lpuart32_txint(struct lpuart_port *sport)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
spin_lock(&sport->port.lock);
|
||||
lpuart32_transmit_buffer(sport);
|
||||
spin_unlock_irqrestore(&sport->port.lock, flags);
|
||||
spin_unlock(&sport->port.lock);
|
||||
}
|
||||
|
||||
static void lpuart32_rxint(struct lpuart_port *sport)
|
||||
{
|
||||
unsigned int flg, ignored = 0;
|
||||
struct tty_port *port = &sport->port.state->port;
|
||||
unsigned long flags;
|
||||
unsigned long rx, sr;
|
||||
bool is_break;
|
||||
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
spin_lock(&sport->port.lock);
|
||||
|
||||
while (!(lpuart32_read(&sport->port, UARTFIFO) & UARTFIFO_RXEMPT)) {
|
||||
flg = TTY_NORMAL;
|
||||
@ -928,16 +923,29 @@ static void lpuart32_rxint(struct lpuart_port *sport)
|
||||
*/
|
||||
sr = lpuart32_read(&sport->port, UARTSTAT);
|
||||
rx = lpuart32_read(&sport->port, UARTDATA);
|
||||
rx &= 0x3ff;
|
||||
rx &= UARTDATA_MASK;
|
||||
|
||||
if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx))
|
||||
/*
|
||||
* The LPUART can't distinguish between a break and a framing error,
|
||||
* thus we assume it is a break if the received data is zero.
|
||||
*/
|
||||
is_break = (sr & UARTSTAT_FE) && !rx;
|
||||
|
||||
if (is_break && uart_handle_break(&sport->port))
|
||||
continue;
|
||||
|
||||
if (uart_prepare_sysrq_char(&sport->port, rx))
|
||||
continue;
|
||||
|
||||
if (sr & (UARTSTAT_PE | UARTSTAT_OR | UARTSTAT_FE)) {
|
||||
if (sr & UARTSTAT_PE)
|
||||
sport->port.icount.parity++;
|
||||
else if (sr & UARTSTAT_FE)
|
||||
if (sr & UARTSTAT_PE) {
|
||||
if (is_break)
|
||||
sport->port.icount.brk++;
|
||||
else
|
||||
sport->port.icount.parity++;
|
||||
} else if (sr & UARTSTAT_FE) {
|
||||
sport->port.icount.frame++;
|
||||
}
|
||||
|
||||
if (sr & UARTSTAT_OR)
|
||||
sport->port.icount.overrun++;
|
||||
@ -950,22 +958,24 @@ static void lpuart32_rxint(struct lpuart_port *sport)
|
||||
|
||||
sr &= sport->port.read_status_mask;
|
||||
|
||||
if (sr & UARTSTAT_PE)
|
||||
flg = TTY_PARITY;
|
||||
else if (sr & UARTSTAT_FE)
|
||||
if (sr & UARTSTAT_PE) {
|
||||
if (is_break)
|
||||
flg = TTY_BREAK;
|
||||
else
|
||||
flg = TTY_PARITY;
|
||||
} else if (sr & UARTSTAT_FE) {
|
||||
flg = TTY_FRAME;
|
||||
}
|
||||
|
||||
if (sr & UARTSTAT_OR)
|
||||
flg = TTY_OVERRUN;
|
||||
|
||||
sport->port.sysrq = 0;
|
||||
}
|
||||
|
||||
tty_insert_flip_char(port, rx, flg);
|
||||
}
|
||||
|
||||
out:
|
||||
spin_unlock_irqrestore(&sport->port.lock, flags);
|
||||
uart_unlock_and_check_sysrq(&sport->port);
|
||||
|
||||
tty_flip_buffer_push(port);
|
||||
}
|
||||
@ -1393,58 +1403,54 @@ static int lpuart32_config_rs485(struct uart_port *port,
|
||||
|
||||
static unsigned int lpuart_get_mctrl(struct uart_port *port)
|
||||
{
|
||||
unsigned int temp = 0;
|
||||
unsigned char reg;
|
||||
unsigned int mctrl = 0;
|
||||
u8 reg;
|
||||
|
||||
reg = readb(port->membase + UARTMODEM);
|
||||
if (reg & UARTMODEM_TXCTSE)
|
||||
temp |= TIOCM_CTS;
|
||||
reg = readb(port->membase + UARTCR1);
|
||||
if (reg & UARTCR1_LOOPS)
|
||||
mctrl |= TIOCM_LOOP;
|
||||
|
||||
if (reg & UARTMODEM_RXRTSE)
|
||||
temp |= TIOCM_RTS;
|
||||
|
||||
return temp;
|
||||
return mctrl;
|
||||
}
|
||||
|
||||
static unsigned int lpuart32_get_mctrl(struct uart_port *port)
|
||||
{
|
||||
unsigned int temp = 0;
|
||||
unsigned long reg;
|
||||
unsigned int mctrl = 0;
|
||||
u32 reg;
|
||||
|
||||
reg = lpuart32_read(port, UARTMODIR);
|
||||
if (reg & UARTMODIR_TXCTSE)
|
||||
temp |= TIOCM_CTS;
|
||||
reg = lpuart32_read(port, UARTCTRL);
|
||||
if (reg & UARTCTRL_LOOPS)
|
||||
mctrl |= TIOCM_LOOP;
|
||||
|
||||
if (reg & UARTMODIR_RXRTSE)
|
||||
temp |= TIOCM_RTS;
|
||||
|
||||
return temp;
|
||||
return mctrl;
|
||||
}
|
||||
|
||||
static void lpuart_set_mctrl(struct uart_port *port, unsigned int mctrl)
|
||||
{
|
||||
unsigned char temp;
|
||||
struct lpuart_port *sport = container_of(port,
|
||||
struct lpuart_port, port);
|
||||
u8 reg;
|
||||
|
||||
/* Make sure RXRTSE bit is not set when RS485 is enabled */
|
||||
if (!(sport->port.rs485.flags & SER_RS485_ENABLED)) {
|
||||
temp = readb(sport->port.membase + UARTMODEM) &
|
||||
~(UARTMODEM_RXRTSE | UARTMODEM_TXCTSE);
|
||||
reg = readb(port->membase + UARTCR1);
|
||||
|
||||
if (mctrl & TIOCM_RTS)
|
||||
temp |= UARTMODEM_RXRTSE;
|
||||
/* for internal loopback we need LOOPS=1 and RSRC=0 */
|
||||
reg &= ~(UARTCR1_LOOPS | UARTCR1_RSRC);
|
||||
if (mctrl & TIOCM_LOOP)
|
||||
reg |= UARTCR1_LOOPS;
|
||||
|
||||
if (mctrl & TIOCM_CTS)
|
||||
temp |= UARTMODEM_TXCTSE;
|
||||
|
||||
writeb(temp, port->membase + UARTMODEM);
|
||||
}
|
||||
writeb(reg, port->membase + UARTCR1);
|
||||
}
|
||||
|
||||
static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
reg = lpuart32_read(port, UARTCTRL);
|
||||
|
||||
/* for internal loopback we need LOOPS=1 and RSRC=0 */
|
||||
reg &= ~(UARTCTRL_LOOPS | UARTCTRL_RSRC);
|
||||
if (mctrl & TIOCM_LOOP)
|
||||
reg |= UARTCTRL_LOOPS;
|
||||
|
||||
lpuart32_write(port, reg, UARTCTRL);
|
||||
}
|
||||
|
||||
static void lpuart_break_ctl(struct uart_port *port, int break_state)
|
||||
@ -1581,6 +1587,9 @@ static void lpuart_tx_dma_startup(struct lpuart_port *sport)
|
||||
u32 uartbaud;
|
||||
int ret;
|
||||
|
||||
if (uart_console(&sport->port))
|
||||
goto err;
|
||||
|
||||
if (!sport->dma_tx_chan)
|
||||
goto err;
|
||||
|
||||
@ -1610,6 +1619,9 @@ static void lpuart_rx_dma_startup(struct lpuart_port *sport)
|
||||
int ret;
|
||||
unsigned char cr3;
|
||||
|
||||
if (uart_console(&sport->port))
|
||||
goto err;
|
||||
|
||||
if (!sport->dma_rx_chan)
|
||||
goto err;
|
||||
|
||||
@ -1625,7 +1637,7 @@ static void lpuart_rx_dma_startup(struct lpuart_port *sport)
|
||||
sport->lpuart_dma_rx_use = true;
|
||||
rx_dma_timer_init(sport);
|
||||
|
||||
if (sport->port.has_sysrq) {
|
||||
if (sport->port.has_sysrq && !lpuart_is_32(sport)) {
|
||||
cr3 = readb(sport->port.membase + UARTCR3);
|
||||
cr3 |= UARTCR3_FEIE;
|
||||
writeb(cr3, sport->port.membase + UARTCR3);
|
||||
@ -2278,7 +2290,7 @@ lpuart_console_write(struct console *co, const char *s, unsigned int count)
|
||||
unsigned long flags;
|
||||
int locked = 1;
|
||||
|
||||
if (sport->port.sysrq || oops_in_progress)
|
||||
if (oops_in_progress)
|
||||
locked = spin_trylock_irqsave(&sport->port.lock, flags);
|
||||
else
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
@ -2308,7 +2320,7 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count)
|
||||
unsigned long flags;
|
||||
int locked = 1;
|
||||
|
||||
if (sport->port.sysrq || oops_in_progress)
|
||||
if (oops_in_progress)
|
||||
locked = spin_trylock_irqsave(&sport->port.lock, flags);
|
||||
else
|
||||
spin_lock_irqsave(&sport->port.lock, flags);
|
||||
@ -2414,6 +2426,9 @@ lpuart32_console_get_options(struct lpuart_port *sport, int *baud,
|
||||
|
||||
bd = lpuart32_read(&sport->port, UARTBAUD);
|
||||
bd &= UARTBAUD_SBR_MASK;
|
||||
if (!bd)
|
||||
return;
|
||||
|
||||
sbr = bd;
|
||||
uartclk = lpuart_get_baud_clk_rate(sport);
|
||||
/*
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <linux/io.h>
|
||||
#include <asm/irq.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user