tty: remove broken r3964 line discipline
Noone stepped up in the past two years since it was marked as BROKEN by
commit c7084edc3f
(tty: mark Siemens R3964 line discipline as BROKEN).
Remove the line discipline for good.
Three remarks:
* we remove also the uapi header (as noone is able to use that interface
anyway)
* we do *not* remove the N_R3964 constant definition from tty.h, so it
remains reserved.
* in_interrupt() check is now removed from vt's con_put_char. Noone else
calls tty_operations::put_char from interrupt context.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210505091928.22010-2-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d7e325aaa8
commit
ed5aecd3da
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3260,8 +3260,6 @@ static int con_write(struct tty_struct *tty, const unsigned char *buf, int count
|
|||
|
||||
static int con_put_char(struct tty_struct *tty, unsigned char ch)
|
||||
{
|
||||
if (in_interrupt())
|
||||
return 0; /* n_r3964 calls put_char() from interrupt context */
|
||||
return do_con_write(tty, &ch, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,175 +0,0 @@
|
|||
/* r3964 linediscipline for linux
|
||||
*
|
||||
* -----------------------------------------------------------
|
||||
* Copyright by
|
||||
* Philips Automation Projects
|
||||
* Kassel (Germany)
|
||||
* -----------------------------------------------------------
|
||||
* This software may be used and distributed according to the terms of
|
||||
* the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
* Author:
|
||||
* L. Haag
|
||||
*
|
||||
* $Log: r3964.h,v $
|
||||
* Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de>
|
||||
* Fixed HZ usage on 2.6 kernels
|
||||
* Removed unnecessary include
|
||||
*
|
||||
* Revision 1.3 2001/03/18 13:02:24 dwmw2
|
||||
* Fix timer usage, use spinlocks properly.
|
||||
*
|
||||
* Revision 1.2 2001/03/18 12:53:15 dwmw2
|
||||
* Merge changes in 2.4.2
|
||||
*
|
||||
* Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2
|
||||
* This'll screw the version control
|
||||
*
|
||||
* Revision 1.6 1998/09/30 00:40:38 dwmw2
|
||||
* Updated to use kernel's N_R3964 if available
|
||||
*
|
||||
* Revision 1.4 1998/04/02 20:29:44 lhaag
|
||||
* select, blocking, ...
|
||||
*
|
||||
* Revision 1.3 1998/02/12 18:58:43 root
|
||||
* fixed some memory leaks
|
||||
* calculation of checksum characters
|
||||
*
|
||||
* Revision 1.2 1998/02/07 13:03:17 root
|
||||
* ioctl read_telegram
|
||||
*
|
||||
* Revision 1.1 1998/02/06 19:19:43 root
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef __LINUX_N_R3964_H__
|
||||
#define __LINUX_N_R3964_H__
|
||||
|
||||
|
||||
#include <linux/param.h>
|
||||
#include <uapi/linux/n_r3964.h>
|
||||
|
||||
/*
|
||||
* Common ascii handshake characters:
|
||||
*/
|
||||
|
||||
#define STX 0x02
|
||||
#define ETX 0x03
|
||||
#define DLE 0x10
|
||||
#define NAK 0x15
|
||||
|
||||
/*
|
||||
* Timeouts (from milliseconds to jiffies)
|
||||
*/
|
||||
|
||||
#define R3964_TO_QVZ ((550)*HZ/1000)
|
||||
#define R3964_TO_ZVZ ((220)*HZ/1000)
|
||||
#define R3964_TO_NO_BUF ((400)*HZ/1000)
|
||||
#define R3964_NO_TX_ROOM ((100)*HZ/1000)
|
||||
#define R3964_TO_RX_PANIC ((4000)*HZ/1000)
|
||||
#define R3964_MAX_RETRIES 5
|
||||
|
||||
|
||||
enum { R3964_IDLE,
|
||||
R3964_TX_REQUEST, R3964_TRANSMITTING,
|
||||
R3964_WAIT_ZVZ_BEFORE_TX_RETRY, R3964_WAIT_FOR_TX_ACK,
|
||||
R3964_WAIT_FOR_RX_BUF,
|
||||
R3964_RECEIVING, R3964_WAIT_FOR_BCC, R3964_WAIT_FOR_RX_REPEAT
|
||||
};
|
||||
|
||||
/*
|
||||
* All open file-handles are 'clients' and are stored in a linked list:
|
||||
*/
|
||||
|
||||
struct r3964_message;
|
||||
|
||||
struct r3964_client_info {
|
||||
spinlock_t lock;
|
||||
struct pid *pid;
|
||||
unsigned int sig_flags;
|
||||
|
||||
struct r3964_client_info *next;
|
||||
|
||||
struct r3964_message *first_msg;
|
||||
struct r3964_message *last_msg;
|
||||
struct r3964_block_header *next_block_to_read;
|
||||
int msg_count;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct r3964_block_header;
|
||||
|
||||
/* internal version of client_message: */
|
||||
struct r3964_message {
|
||||
int msg_id;
|
||||
int arg;
|
||||
int error_code;
|
||||
struct r3964_block_header *block;
|
||||
struct r3964_message *next;
|
||||
};
|
||||
|
||||
/*
|
||||
* Header of received block in rx_buf/tx_buf:
|
||||
*/
|
||||
|
||||
struct r3964_block_header
|
||||
{
|
||||
unsigned int length; /* length in chars without header */
|
||||
unsigned char *data; /* usually data is located
|
||||
immediately behind this struct */
|
||||
unsigned int locks; /* only used in rx_buffer */
|
||||
|
||||
struct r3964_block_header *next;
|
||||
struct r3964_client_info *owner; /* =NULL in rx_buffer */
|
||||
};
|
||||
|
||||
/*
|
||||
* If rx_buf hasn't enough space to store R3964_MTU chars,
|
||||
* we will reject all incoming STX-requests by sending NAK.
|
||||
*/
|
||||
|
||||
#define RX_BUF_SIZE 4000
|
||||
#define TX_BUF_SIZE 4000
|
||||
#define R3964_MAX_BLOCKS_IN_RX_QUEUE 100
|
||||
|
||||
#define R3964_PARITY 0x0001
|
||||
#define R3964_FRAME 0x0002
|
||||
#define R3964_OVERRUN 0x0004
|
||||
#define R3964_UNKNOWN 0x0008
|
||||
#define R3964_BREAK 0x0010
|
||||
#define R3964_CHECKSUM 0x0020
|
||||
#define R3964_ERROR 0x003f
|
||||
#define R3964_BCC 0x4000
|
||||
#define R3964_DEBUG 0x8000
|
||||
|
||||
|
||||
struct r3964_info {
|
||||
spinlock_t lock;
|
||||
struct tty_struct *tty;
|
||||
unsigned char priority;
|
||||
unsigned char *rx_buf; /* ring buffer */
|
||||
unsigned char *tx_buf;
|
||||
|
||||
struct r3964_block_header *rx_first;
|
||||
struct r3964_block_header *rx_last;
|
||||
struct r3964_block_header *tx_first;
|
||||
struct r3964_block_header *tx_last;
|
||||
unsigned int tx_position;
|
||||
unsigned int rx_position;
|
||||
unsigned char last_rx;
|
||||
unsigned char bcc;
|
||||
unsigned int blocks_in_rx_queue;
|
||||
|
||||
struct mutex read_lock; /* serialize r3964_read */
|
||||
|
||||
struct r3964_client_info *firstClient;
|
||||
unsigned int state;
|
||||
unsigned int flags;
|
||||
|
||||
struct timer_list tmr;
|
||||
int nRetry;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,99 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
|
||||
/* r3964 linediscipline for linux
|
||||
*
|
||||
* -----------------------------------------------------------
|
||||
* Copyright by
|
||||
* Philips Automation Projects
|
||||
* Kassel (Germany)
|
||||
* -----------------------------------------------------------
|
||||
* This software may be used and distributed according to the terms of
|
||||
* the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
* Author:
|
||||
* L. Haag
|
||||
*
|
||||
* $Log: r3964.h,v $
|
||||
* Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de>
|
||||
* Fixed HZ usage on 2.6 kernels
|
||||
* Removed unnecessary include
|
||||
*
|
||||
* Revision 1.3 2001/03/18 13:02:24 dwmw2
|
||||
* Fix timer usage, use spinlocks properly.
|
||||
*
|
||||
* Revision 1.2 2001/03/18 12:53:15 dwmw2
|
||||
* Merge changes in 2.4.2
|
||||
*
|
||||
* Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2
|
||||
* This'll screw the version control
|
||||
*
|
||||
* Revision 1.6 1998/09/30 00:40:38 dwmw2
|
||||
* Updated to use kernel's N_R3964 if available
|
||||
*
|
||||
* Revision 1.4 1998/04/02 20:29:44 lhaag
|
||||
* select, blocking, ...
|
||||
*
|
||||
* Revision 1.3 1998/02/12 18:58:43 root
|
||||
* fixed some memory leaks
|
||||
* calculation of checksum characters
|
||||
*
|
||||
* Revision 1.2 1998/02/07 13:03:17 root
|
||||
* ioctl read_telegram
|
||||
*
|
||||
* Revision 1.1 1998/02/06 19:19:43 root
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _UAPI__LINUX_N_R3964_H__
|
||||
#define _UAPI__LINUX_N_R3964_H__
|
||||
|
||||
/* line disciplines for r3964 protocol */
|
||||
|
||||
|
||||
/*
|
||||
* Ioctl-commands
|
||||
*/
|
||||
|
||||
#define R3964_ENABLE_SIGNALS 0x5301
|
||||
#define R3964_SETPRIORITY 0x5302
|
||||
#define R3964_USE_BCC 0x5303
|
||||
#define R3964_READ_TELEGRAM 0x5304
|
||||
|
||||
/* Options for R3964_SETPRIORITY */
|
||||
#define R3964_MASTER 0
|
||||
#define R3964_SLAVE 1
|
||||
|
||||
/* Options for R3964_ENABLE_SIGNALS */
|
||||
#define R3964_SIG_ACK 0x0001
|
||||
#define R3964_SIG_DATA 0x0002
|
||||
#define R3964_SIG_ALL 0x000f
|
||||
#define R3964_SIG_NONE 0x0000
|
||||
#define R3964_USE_SIGIO 0x1000
|
||||
|
||||
/*
|
||||
* r3964 operation states:
|
||||
*/
|
||||
|
||||
/* types for msg_id: */
|
||||
enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
|
||||
|
||||
#define R3964_MAX_MSG_COUNT 32
|
||||
|
||||
/* error codes for client messages */
|
||||
#define R3964_OK 0 /* no error. */
|
||||
#define R3964_TX_FAIL -1 /* transmission error, block NOT sent */
|
||||
#define R3964_OVERFLOW -2 /* msg queue overflow */
|
||||
|
||||
/* the client gets this struct when calling read(fd,...): */
|
||||
struct r3964_client_message {
|
||||
int msg_id;
|
||||
int arg;
|
||||
int error_code;
|
||||
};
|
||||
|
||||
#define R3964_MTU 256
|
||||
|
||||
|
||||
|
||||
#endif /* _UAPI__LINUX_N_R3964_H__ */
|
Loading…
Reference in New Issue