提交 c932ed0a 编写于 作者: L Linus Torvalds

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
  ...
无相关合并请求
......@@ -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:
......
# 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>,
......
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:
- |
......
......@@ -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 @@ int line_write(struct tty_struct *tty, const unsigned char *buf, int len)
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 @@ static int mgslpc_write(struct tty_struct * tty,
/* 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,40 +120,33 @@ 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.
* TTY operations hangup function.
*/
static int tpk_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
static void tpk_hangup(struct tty_struct *tty)
{
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_port_hangup(&tpkp->port);
}
/*
* TTY operations hangup function.
* TTY port operations shutdown function.
*/
static void tpk_hangup(struct tty_struct *tty)
static void tpk_port_shutdown(struct tty_port *tport)
{
struct ttyprintk_port *tpkp = tty->driver_data;
struct ttyprintk_port *tpkp =
container_of(tport, struct ttyprintk_port, port);
unsigned long flags;
tty_port_hangup(&tpkp->port);
spin_lock_irqsave(&tpkp->spinlock, flags);
tpk_flush();
spin_unlock_irqrestore(&tpkp->spinlock, flags);
}
static const struct tty_operations ttyprintk_ops = {
......@@ -173,11 +154,12 @@ static const struct tty_operations ttyprintk_ops = {
.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 @@ static void sixpack_write_wakeup(struct tty_struct *tty)
* 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 @@ static void mkiss_write_wakeup(struct tty_struct *tty)
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 @@ ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
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 @@ static int hso_serial_write(struct tty_struct *tty, const unsigned char *buf,
}
/* 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 @@ static void hvsi_write_worker(struct work_struct *work)
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;
......
此差异已折叠。
/* 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);
......
此差异已折叠。
......@@ -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 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
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 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
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);
}
}
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 (ldata->lnext) {
n_tty_receive_char_lnext(tty, c, flag);
continue;
}
while (count--) {
if (fp)
flag = *fp++;
if (likely(flag == TTY_NORMAL)) {
unsigned char c = *cp++;
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 (unlikely(flag != TTY_NORMAL)) {
n_tty_receive_char_flagged(tty, c, flag);
continue;
}
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_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;
}
rval = kfifo_len(&port->fifo_ul);
if (unlikely(!dc || !port))
return 0;
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.
*
......
......@@ -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;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部