diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-15 02:05:52 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-15 02:05:52 +0300 |
commit | 5d6c413c92a3e6fc9399141891147d0d826517c9 (patch) | |
tree | 7ea322289131dd8c80d0013bc952f990a6260995 /drivers/tty/n_gsm.c | |
parent | e6037a753e8e9a4146f7d94c32eb30a6717c9c70 (diff) | |
parent | 4be87603b6dc9e49c2e07151bb51180dc0b6964a (diff) | |
download | linux-5d6c413c92a3e6fc9399141891147d0d826517c9.tar.xz |
Merge tag 'tty-5.10-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.10-rc1.
Lots of little things in here, including:
- tasklet_setup api conversions
- sysrq support for capital letters
- vt and vc cleanups and unwinding the mess some more
- serial driver updates and minor tweaks
- new device ids
- rs485 support for some drivers
- serial binding documentation updates
- lots of small serial driver changes for reported issues
All have been in linux-next for a while with no reported issues"
* tag 'tty-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (79 commits)
serial: mcf: add sysrq capability
serial: fsl_lpuart: add sysrq support when using dma
fbcon: remove no-op fbcon_set_origin()
tty/sysrq: Extend the sysrq_key_table to cover capital letters
serial: max310x: rework RX interrupt handling
serial: 8250_dw: Fix clk-notifier/port suspend deadlock
serial: 8250: Skip uninitialized TTY port baud rate update
serial: 8250: Discard RTS/DTS setting from clock update method
tty: serial: imx: disable TXDC IRQ in imx_uart_shutdown() to avoid IRQ storm
serial: 8250_fsl: Fix TX interrupt handling condition
serial: pl011: Fix lockdep splat when handling magic-sysrq interrupt
tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
tty: serial: lpuart: fix lpuart32_write usage
serial: qcom_geni_serial: To correct QUP Version detection logic
serial: mvebu-uart: fix unused variable warning
vt_ioctl: make VT_RESIZEX behave like VT_RESIZE
serial: mvebu-uart: simplify the return expression of mvebu_uart_probe()
tty: serial: imx: fix link error with CONFIG_SERIAL_CORE_CONSOLE=n
tty: hvc: fix link error with CONFIG_SERIAL_CORE_CONSOLE=n
pch_uart: drop double zeroing
...
Diffstat (limited to 'drivers/tty/n_gsm.c')
-rw-r--r-- | drivers/tty/n_gsm.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 35cf12147e39..25f3152089c2 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -76,10 +76,9 @@ module_param(debug, int, 0600); /** * struct gsm_mux_net - network interface - * @struct gsm_dlci* dlci * * Created when net interface is initialized. - **/ + */ struct gsm_mux_net { struct kref ref; struct gsm_dlci *dlci; @@ -222,11 +221,8 @@ struct gsm_mux { u8 received_fcs; u8 *txframe; /* TX framing buffer */ - /* Methods for the receiver side */ + /* Method for the receiver side */ void (*receive)(struct gsm_mux *gsm, u8 ch); - void (*error)(struct gsm_mux *gsm, u8 ch, u8 flag); - /* And transmit side */ - int (*output)(struct gsm_mux *mux, u8 *data, int len); /* Link Layer */ unsigned int mru; @@ -366,6 +362,8 @@ static const u8 gsm_fcs8[256] = { #define INIT_FCS 0xFF #define GOOD_FCS 0xCF +static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len); + /** * gsm_fcs_add - update FCS * @fcs: Current FCS @@ -400,7 +398,7 @@ static inline u8 gsm_fcs_add_block(u8 fcs, u8 *c, int len) /** * gsm_read_ea - read a byte into an EA * @val: variable holding value - * c: byte going into the EA + * @c: byte going into the EA * * Processes one byte of an EA. Updates the passed variable * and returns 1 if the EA is now completely read @@ -514,8 +512,8 @@ static void gsm_print_packet(const char *hdr, int addr, int cr, /** * gsm_stuff_packet - bytestuff a packet - * @ibuf: input - * @obuf: output + * @input: input buffer + * @output: output buffer * @len: length of input * * Expand a buffer by bytestuffing it. The worst case size change @@ -587,7 +585,7 @@ static void gsm_send(struct gsm_mux *gsm, int addr, int cr, int control) WARN_ON(1); return; } - gsm->output(gsm, cbuf, len); + gsmld_output(gsm, cbuf, len); gsm_print_packet("-->", addr, cr, control, NULL, 0); } @@ -687,7 +685,7 @@ static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci) print_hex_dump_bytes("gsm_data_kick: ", DUMP_PREFIX_OFFSET, gsm->txframe, len); - if (gsm->output(gsm, gsm->txframe, len) < 0) + if (gsmld_output(gsm, gsm->txframe, len) < 0) break; /* FIXME: Can eliminate one SOF in many more cases */ gsm->tx_bytes -= msg->len; @@ -1305,7 +1303,7 @@ static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl) /** * gsm_control_retransmit - retransmit a control frame - * @data: pointer to our gsm object + * @t: timer contained in our gsm object * * Called off the T2 timer expiry in order to retransmit control frames * that have been lost in the system somewhere. The control_lock protects @@ -1342,7 +1340,7 @@ static void gsm_control_retransmit(struct timer_list *t) * @gsm: the GSM channel * @command: command to send including CR bit * @data: bytes of data (must be kmalloced) - * @len: length of the block to send + * @clen: length of the block to send * * Queue and dispatch a control command. Only one command can be * active at a time. In theory more can be outstanding but the matching @@ -1454,7 +1452,7 @@ static void gsm_dlci_open(struct gsm_dlci *dlci) /** * gsm_dlci_t1 - T1 timer expiry - * @dlci: DLCI that opened + * @t: timer contained in the DLCI that opened * * The T1 timer handles retransmits of control frames (essentially of * SABM and DISC). We resend the command until the retry count runs out @@ -1550,7 +1548,7 @@ static void gsm_dlci_begin_close(struct gsm_dlci *dlci) * gsm_dlci_data - data arrived * @dlci: channel * @data: block of bytes received - * @len: length of received block + * @clen: length of received block * * A UI or UIH frame has arrived which contains data for a channel * other than the control channel. If the relevant virtual tty is @@ -1672,7 +1670,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) /** * gsm_dlci_free - free DLCI - * @dlci: DLCI to free + * @port: tty port for DLCI to free * * Free up a DLCI. * @@ -2128,7 +2126,6 @@ static int gsm_activate_mux(struct gsm_mux *gsm) gsm->receive = gsm0_receive; else gsm->receive = gsm1_receive; - gsm->error = gsm_error; spin_lock(&gsm_mux_lock); for (i = 0; i < MAX_MUX; i++) { @@ -2151,7 +2148,7 @@ static int gsm_activate_mux(struct gsm_mux *gsm) /** * gsm_free_mux - free up a mux - * @mux: mux to free + * @gsm: mux to free * * Dispose of allocated resources for a dead mux */ @@ -2164,7 +2161,7 @@ static void gsm_free_mux(struct gsm_mux *gsm) /** * gsm_free_muxr - free up a mux - * @mux: mux to free + * @ref: kreference to the mux to free * * Dispose of allocated resources for a dead mux */ @@ -2378,7 +2375,6 @@ static int gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm) int ret, i; gsm->tty = tty_kref_get(tty); - gsm->output = gsmld_output; ret = gsm_activate_mux(gsm); if (ret != 0) tty_kref_put(gsm->tty); @@ -2438,7 +2434,7 @@ static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp, case TTY_BREAK: case TTY_PARITY: case TTY_FRAME: - gsm->error(gsm, *dp, flags); + gsm_error(gsm, *dp, flags); break; default: WARN_ONCE(1, "%s: unknown flag %d\n", |