Commit 606d099c authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

[PATCH] tty: switch to ktermios



This is the grungy swap all the occurrences in the right places patch that
goes with the updates.  At this point we have the same functionality as
before (except that sgttyb() returns speeds not zero) and are ready to
begin turning new stuff on providing nobody reports lots of bugs

If you are a tty driver author converting an out of tree driver the only
impact should be termios->ktermios name changes for the speed/property
setting functions from your upper layers.

If you are implementing your own TCGETS function before then your driver
was broken already and its about to get a whole lot more painful for you so
please fix it 8)

Also fill in c_ispeed/ospeed on init for most devices, although the current
code will do this for you anyway but I'd like eventually to lose that extra
paranoia

[akpm@osdl.org: bluetooth fix]
[mp3@de.ibm.com: sclp fix]
[mp3@de.ibm.com: warning fix for tty3270]
[hugh@veritas.com: fix tty_ioctl powerpc build]
[jdike@addtoit.com: uml: fix ->set_termios declaration]
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarMartin Peschke <mp3@de.ibm.com>
Acked-by: default avatarPeter Oberparleiter <oberpar@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent edc6afc5
......@@ -246,7 +246,7 @@ out_up:
return ret;
}
void line_set_termios(struct tty_struct *tty, struct termios * old)
void line_set_termios(struct tty_struct *tty, struct ktermios * old)
{
/* nothing */
}
......
......@@ -76,7 +76,7 @@ extern int line_setup(struct line *lines, unsigned int sizeof_lines,
extern int line_write(struct tty_struct *tty, const unsigned char *buf,
int len);
extern void line_put_char(struct tty_struct *tty, unsigned char ch);
extern void line_set_termios(struct tty_struct *tty, struct termios * old);
extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
extern 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);
......
......@@ -104,7 +104,7 @@ static struct async_struct *IRQ_ports;
static unsigned char current_ctl_bits;
static void change_speed(struct async_struct *info, struct termios *old);
static void change_speed(struct async_struct *info, struct ktermios *old);
static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
......@@ -694,7 +694,7 @@ static void shutdown(struct async_struct * info)
* the specified baud rate for a serial port.
*/
static void change_speed(struct async_struct *info,
struct termios *old_termios)
struct ktermios *old_termios)
{
int quot = 0, baud_base, baud;
unsigned cflag, cval = 0;
......@@ -1365,7 +1365,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
return 0;
}
static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
......
......@@ -4101,7 +4101,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
* where old == NULL, and try to do something rational.
*/
static void
cy_set_termios(struct tty_struct *tty, struct termios * old_termios)
cy_set_termios(struct tty_struct *tty, struct ktermios * old_termios)
{
struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
......
......@@ -199,7 +199,7 @@ static int pc_ioctl(struct tty_struct *, struct file *,
unsigned int, unsigned long);
static int info_ioctl(struct tty_struct *, struct file *,
unsigned int, unsigned long);
static void pc_set_termios(struct tty_struct *, struct termios *);
static void pc_set_termios(struct tty_struct *, struct ktermios *);
static void do_softint(struct work_struct *work);
static void pc_stop(struct tty_struct *);
static void pc_start(struct tty_struct *);
......@@ -1236,6 +1236,8 @@ static int __init pc_init(void)
pc_driver->init_termios.c_oflag = 0;
pc_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
pc_driver->init_termios.c_lflag = 0;
pc_driver->init_termios.c_ispeed = 9600;
pc_driver->init_termios.c_ospeed = 9600;
pc_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(pc_driver, &pc_ops);
......@@ -1250,6 +1252,8 @@ static int __init pc_init(void)
pc_info->init_termios.c_oflag = 0;
pc_info->init_termios.c_lflag = 0;
pc_info->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL;
pc_info->init_termios.c_ispeed = 9600;
pc_info->init_termios.c_ospeed = 9600;
pc_info->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(pc_info, &info_ops);
......@@ -1999,7 +2003,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch)
{ /* Begin epcaparam */
unsigned int cmdHead;
struct termios *ts;
struct ktermios *ts;
struct board_chan __iomem *bc;
unsigned mval, hflow, cflag, iflag;
......@@ -2114,7 +2118,7 @@ static void receive_data(struct channel *ch)
{ /* Begin receive_data */
unchar *rptr;
struct termios *ts = NULL;
struct ktermios *ts = NULL;
struct tty_struct *tty;
struct board_chan __iomem *bc;
int dataToRead, wrapgap, bytesAvailable;
......@@ -2362,12 +2366,14 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
switch (cmd)
{ /* Begin switch cmd */
#if 0 /* Handled by calling layer properly */
case TCGETS:
if (copy_to_user(argp, tty->termios, sizeof(struct termios)))
if (copy_to_user(argp, tty->termios, sizeof(struct ktermios)))
return -EFAULT;
return 0;
case TCGETA:
return get_termio(tty, argp);
#endif
case TCSBRK: /* SVID version: non-zero arg --> no break */
retval = tty_check_change(tty);
if (retval)
......@@ -2536,7 +2542,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
/* --------------------- Begin pc_set_termios ----------------------- */
static void pc_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void pc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{ /* Begin pc_set_termios */
struct channel *ch;
......
......@@ -1915,7 +1915,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
return 0;
}
static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
......
......@@ -718,11 +718,11 @@ static unsigned int gs_baudrates[] = {
void gs_set_termios (struct tty_struct * tty,
struct termios * old_termios)
struct ktermios * old_termios)
{
struct gs_port *port;
int baudrate, tmp, rv;
struct termios *tiosp;
struct ktermios *tiosp;
func_enter();
......
......@@ -192,11 +192,13 @@ MODULE_VERSION(HVCS_DRIVER_VERSION);
* that will cause echoing or we'll go into recursive loop echoing chars back
* and forth with the console drivers.
*/
static struct termios hvcs_tty_termios = {
static struct ktermios hvcs_tty_termios = {
.c_iflag = IGNBRK | IGNPAR,
.c_oflag = OPOST,
.c_cflag = B38400 | CS8 | CREAD | HUPCL,
.c_cc = INIT_C_CC
.c_cc = INIT_C_CC,
.c_ispeed = 38400,
.c_ospeed = 38400
};
/*
......
......@@ -1161,6 +1161,8 @@ static int __init hvsi_init(void)
hvsi_driver->type = TTY_DRIVER_TYPE_SYSTEM;
hvsi_driver->init_termios = tty_std_termios;
hvsi_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL;
hvsi_driver->init_termios.c_ispeed = 9600;
hvsi_driver->init_termios.c_ospeed = 9600;
hvsi_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(hvsi_driver, &hvsi_ops);
......
......@@ -177,7 +177,7 @@ static int ip2_write_room(PTTY);
static int ip2_chars_in_buf(PTTY);
static void ip2_flush_buffer(PTTY);
static int ip2_ioctl(PTTY, struct file *, UINT, ULONG);
static void ip2_set_termios(PTTY, struct termios *);
static void ip2_set_termios(PTTY, struct ktermios *);
static void ip2_set_line_discipline(PTTY);
static void ip2_throttle(PTTY);
static void ip2_unthrottle(PTTY);
......@@ -198,7 +198,7 @@ static void do_status(struct work_struct *);
static void ip2_wait_until_sent(PTTY,int);
static void set_params (i2ChanStrPtr, struct termios *);
static void set_params (i2ChanStrPtr, struct ktermios *);
static int get_serial_info(i2ChanStrPtr, struct serial_struct __user *);
static int set_serial_info(i2ChanStrPtr, struct serial_struct __user *);
......@@ -2398,7 +2398,7 @@ set_serial_info( i2ChanStrPtr pCh, struct serial_struct __user *new_info )
/* */
/******************************************************************************/
static void
ip2_set_termios( PTTY tty, struct termios *old_termios )
ip2_set_termios( PTTY tty, struct ktermios *old_termios )
{
i2ChanStrPtr pCh = (i2ChanStrPtr)tty->driver_data;
......@@ -2440,11 +2440,11 @@ ip2_set_line_discipline ( PTTY tty )
/* change. */
/******************************************************************************/
static void
set_params( i2ChanStrPtr pCh, struct termios *o_tios )
set_params( i2ChanStrPtr pCh, struct ktermios *o_tios )
{
tcflag_t cflag, iflag, lflag;
char stop_char, start_char;
struct termios dummy;
struct ktermios dummy;
lflag = pCh->pTTY->termios->c_lflag;
cflag = pCh->pTTY->termios->c_cflag;
......
......@@ -1399,7 +1399,7 @@ static int isicom_ioctl(struct tty_struct *tty, struct file *filp,
/* set_termios et all */
static void isicom_set_termios(struct tty_struct *tty,
struct termios *old_termios)
struct ktermios *old_termios)
{
struct isi_port *port = tty->driver_data;
......
......@@ -194,9 +194,11 @@ static struct tty_struct *stli_txcooktty;
* with this termios initially. Basically all it defines is a raw port
* at 9600 baud, 8 data bits, no parity, 1 stop bit.
*/
static struct termios stli_deftermios = {
static struct ktermios stli_deftermios = {
.c_cflag = (B9600 | CS8 | CREAD | HUPCL | CLOCAL),
.c_cc = INIT_C_CC,
.c_ispeed = 9600,
.c_ospeed = 9600,
};
/*
......@@ -639,7 +641,7 @@ static void stli_flushchars(struct tty_struct *tty);
static int stli_writeroom(struct tty_struct *tty);
static int stli_charsinbuffer(struct tty_struct *tty);
static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg);
static void stli_settermios(struct tty_struct *tty, struct termios *old);
static void stli_settermios(struct tty_struct *tty, struct ktermios *old);
static void stli_throttle(struct tty_struct *tty);
static void stli_unthrottle(struct tty_struct *tty);
static void stli_stop(struct tty_struct *tty);
......@@ -669,7 +671,7 @@ static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, v
static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback);
static void __stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback);
static void stli_dodelaycmd(stliport_t *portp, cdkctrl_t __iomem *cp);
static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp);
static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct ktermios *tiosp);
static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts);
static long stli_mktiocm(unsigned long sigvalue);
static void stli_read(stlibrd_t *brdp, stliport_t *portp);
......@@ -1889,11 +1891,11 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
* Looks like it is true for the current ttys implementation..!!
*/
static void stli_settermios(struct tty_struct *tty, struct termios *old)
static void stli_settermios(struct tty_struct *tty, struct ktermios *old)
{
stliport_t *portp;
stlibrd_t *brdp;
struct termios *tiosp;
struct ktermios *tiosp;
asyport_t aport;
if (tty == NULL)
......@@ -2730,7 +2732,7 @@ static void stli_poll(unsigned long arg)
* the slave.
*/
static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp)
static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct ktermios *tiosp)
{
memset(pp, 0, sizeof(asyport_t));
......
......@@ -234,7 +234,7 @@ static void moxa_put_char(struct tty_struct *, unsigned char);
static int moxa_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long);
static void moxa_throttle(struct tty_struct *);
static void moxa_unthrottle(struct tty_struct *);
static void moxa_set_termios(struct tty_struct *, struct termios *);
static void moxa_set_termios(struct tty_struct *, struct ktermios *);
static void moxa_stop(struct tty_struct *);
static void moxa_start(struct tty_struct *);
static void moxa_hangup(struct tty_struct *);
......@@ -261,7 +261,7 @@ static void MoxaPortEnable(int);
static void MoxaPortDisable(int);
static long MoxaPortGetMaxBaud(int);
static long MoxaPortSetBaud(int, long);
static int MoxaPortSetTermio(int, struct termios *, speed_t);
static int MoxaPortSetTermio(int, struct ktermios *, speed_t);
static int MoxaPortGetLineOut(int, int *, int *);
static void MoxaPortLineCtrl(int, int, int);
static void MoxaPortFlowCtrl(int, int, int, int, int, int);
......@@ -355,6 +355,8 @@ static int __init moxa_init(void)
moxaDriver->init_termios.c_oflag = 0;
moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
moxaDriver->init_termios.c_lflag = 0;
moxaDriver->init_termios.c_ispeed = 9600;
moxaDriver->init_termios.c_ospeed = 9600;
moxaDriver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(moxaDriver, &moxa_ops);
......@@ -864,7 +866,7 @@ static void moxa_unthrottle(struct tty_struct *tty)
}
static void moxa_set_termios(struct tty_struct *tty,
struct termios *old_termios)
struct ktermios *old_termios)
{
struct moxa_str *ch = (struct moxa_str *) tty->driver_data;
......@@ -978,7 +980,7 @@ static void moxa_poll(unsigned long ignored)
static void set_tty_param(struct tty_struct *tty)
{
register struct termios *ts;
register struct ktermios *ts;
struct moxa_str *ch;
int rts, cts, txflow, rxflow, xany;
......@@ -1149,7 +1151,7 @@ static void shut_down(struct moxa_str *ch)
static void receive_data(struct moxa_str *ch)
{
struct tty_struct *tp;
struct termios *ts;
struct ktermios *ts;
unsigned long flags;
ts = NULL;
......@@ -1912,9 +1914,9 @@ int MoxaPortsOfCard(int cardno)
*
* Function 12: Configure the port.
* Syntax:
* int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud);
* int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud);
* int port : port number (0 - 127)
* struct termios * termio : termio structure pointer
* struct ktermios * termio : termio structure pointer
* speed_t baud : baud rate
*
* return: -1 : this port is invalid or termio == NULL
......@@ -2195,7 +2197,7 @@ long MoxaPortSetBaud(int port, long baud)
return (baud);
}
int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud)
int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud)
{
void __iomem *ofsAddr;
tcflag_t cflag;
......
......@@ -328,8 +328,8 @@ struct mxser_struct {
int xmit_tail;
int xmit_cnt;
struct work_struct tqueue;
struct termios normal_termios;
struct termios callout_termios;
struct ktermios normal_termios;
struct ktermios callout_termios;
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
wait_queue_head_t delta_msr_wait;
......@@ -364,8 +364,8 @@ static int mxserBoardCAP[MXSER_BOARDS] = {
static struct tty_driver *mxvar_sdriver;
static struct mxser_struct mxvar_table[MXSER_PORTS];
static struct tty_struct *mxvar_tty[MXSER_PORTS + 1];
static struct termios *mxvar_termios[MXSER_PORTS + 1];
static struct termios *mxvar_termios_locked[MXSER_PORTS + 1];
static struct ktermios *mxvar_termios[MXSER_PORTS + 1];
static struct ktermios *mxvar_termios_locked[MXSER_PORTS + 1];
static struct mxser_log mxvar_log;
static int mxvar_diagflag;
static unsigned char mxser_msr[MXSER_PORTS + 1];
......@@ -402,7 +402,7 @@ static int mxser_ioctl(struct tty_struct *, struct file *, uint, ulong);
static int mxser_ioctl_special(unsigned int, void __user *);
static void mxser_throttle(struct tty_struct *);
static void mxser_unthrottle(struct tty_struct *);
static void mxser_set_termios(struct tty_struct *, struct termios *);
static void mxser_set_termios(struct tty_struct *, struct ktermios *);
static void mxser_stop(struct tty_struct *);
static void mxser_start(struct tty_struct *);
static void mxser_hangup(struct tty_struct *);
......@@ -414,7 +414,7 @@ static void mxser_check_modem_status(struct mxser_struct *, int);
static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *);
static int mxser_startup(struct mxser_struct *);
static void mxser_shutdown(struct mxser_struct *);
static int mxser_change_speed(struct mxser_struct *, struct termios *old_termios);
static int mxser_change_speed(struct mxser_struct *, struct ktermios *old_termios);
static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *);
static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *);
static int mxser_get_lsr_info(struct mxser_struct *, unsigned int __user *);
......@@ -726,6 +726,8 @@ static int mxser_init(void)
mxvar_sdriver->subtype = SERIAL_TYPE_NORMAL;
mxvar_sdriver->init_termios = tty_std_termios;
mxvar_sdriver->init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL;
mxvar_sdriver->init_termios.c_ispeed = 9600;
mxvar_sdriver->init_termios.c_ospeed = 9600;
mxvar_sdriver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(mxvar_sdriver, &mxser_ops);
mxvar_sdriver->ttys = mxvar_tty;
......@@ -1749,7 +1751,7 @@ static void mxser_unthrottle(struct tty_struct *tty)
/* MX_UNLOCK(&info->slock); */
}
static void mxser_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
struct mxser_struct *info = tty->driver_data;
unsigned long flags;
......@@ -2541,7 +2543,7 @@ static void mxser_shutdown(struct mxser_struct *info)
* This routine is called to set the UART divisor registers to match
* the specified baud rate for a serial port.
*/
static int mxser_change_speed(struct mxser_struct *info, struct termios *old_termios)
static int mxser_change_speed(struct mxser_struct *info, struct ktermios *old_termios)
{
unsigned cflag, cval, fcr;
int ret = 0;
......
......@@ -266,8 +266,8 @@ struct mxser_port {
int xmit_tail;
int xmit_cnt;
struct termios normal_termios;
struct termios callout_termios;
struct ktermios normal_termios;
struct ktermios callout_termios;
struct mxser_mon mon_data;
......@@ -512,7 +512,7 @@ static int mxser_set_baud(struct mxser_port *info, long newspd)
* the specified baud rate for a serial port.
*/
static int mxser_change_speed(struct mxser_port *info,
struct termios *old_termios)
struct ktermios *old_termios)
{
unsigned cflag, cval, fcr;
int ret = 0;
......@@ -1966,7 +1966,7 @@ static void mxser_start(struct tty_struct *tty)
spin_unlock_irqrestore(&info->slock, flags);
}
static void mxser_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
struct mxser_port *info = tty->driver_data;
unsigned long flags;
......
......@@ -142,7 +142,7 @@ static ssize_t r3964_write(struct tty_struct * tty, struct file * file,
const unsigned char * buf, size_t nr);
static int r3964_ioctl(struct tty_struct * tty, struct file * file,
unsigned int cmd, unsigned long arg);
static void r3964_set_termios(struct tty_struct *tty, struct termios * old);
static void r3964_set_termios(struct tty_struct *tty, struct ktermios * old);
static unsigned int r3964_poll(struct tty_struct * tty, struct file * file,
struct poll_table_struct *wait);
static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
......@@ -1347,7 +1347,7 @@ static int r3964_ioctl(struct tty_struct * tty, struct file * file,
}
}
static void r3964_set_termios(struct tty_struct *tty, struct termios * old)
static void r3964_set_termios(struct tty_struct *tty, struct ktermios * old)
{
TRACE_L("set_termios");
}
......
......@@ -994,7 +994,7 @@ int is_ignored(int sig)
* when the ldisc is closed.
*/
static void n_tty_set_termios(struct tty_struct *tty, struct termios * old)
static void n_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
{
if (!tty)
return;
......
......@@ -2375,7 +2375,7 @@ static int ioctl_common(MGSLPC_INFO *info, unsigned int cmd, unsigned long arg)
* tty pointer to tty structure
* termios pointer to buffer to hold returned old termios
*/
static void mgslpc_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
unsigned long flags;
......
......@@ -218,7 +218,7 @@ out:
return retval;
}
static void pty_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void pty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
{
tty->termios->c_cflag &= ~(CSIZE | PARENB);
tty->termios->c_cflag |= (CS8 | CREAD);
......@@ -272,6 +272,8 @@ static void __init legacy_pty_init(void)
pty_driver->init_termios.c_oflag = 0;
pty_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
pty_driver->init_termios.c_lflag = 0;
pty_driver->init_termios.c_ispeed = 38400;
pty_driver->init_termios.c_ospeed = 38400;
pty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW;
pty_driver->other = pty_slave_driver;
tty_set_operations(pty_driver, &pty_ops);
......@@ -286,6 +288,8 @@ static void __init legacy_pty_init(void)
pty_slave_driver->subtype = PTY_TYPE_SLAVE;
pty_slave_driver->init_termios = tty_std_termios;
pty_slave_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
pty_slave_driver->init_termios.c_ispeed = 38400;
pty_slave_driver->init_termios.c_ospeed = 38400;
pty_slave_driver->flags = TTY_DRIVER_RESET_TERMIOS |
TTY_DRIVER_REAL_RAW;
pty_slave_driver->other = pty_driver;
......@@ -366,6 +370,8 @@ static void __init unix98_pty_init(void)
ptm_driver->init_termios.c_oflag = 0;
ptm_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
ptm_driver->init_termios.c_lflag = 0;
ptm_driver->init_termios.c_ispeed = 38400;
ptm_driver->init_termios.c_ospeed = 38400;
ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM;
ptm_driver->other = pts_driver;
......@@ -381,6 +387,8 @@ static void __init unix98_pty_init(void)
pts_driver->subtype = PTY_TYPE_SLAVE;
pts_driver->init_termios = tty_std_termios;
pts_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
pts_driver->init_termios.c_ispeed = 38400;
pts_driver->init_termios.c_ospeed = 38400;
pts_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM;
pts_driver->other = ptm_driver;
......
......@@ -1539,7 +1539,7 @@ static void rc_hangup(struct tty_struct * tty)
wake_up_interruptible(&port->open_wait);
}
static void rc_set_termios(struct tty_struct * tty, struct termios * old_termios)
static void rc_set_termios(struct tty_struct * tty, struct ktermios * old_termios)
{
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
unsigned long flags;
......@@ -1614,6 +1614,8 @@ static inline int rc_init_drivers(void)
riscom_driver->init_termios = tty_std_termios;
riscom_driver->init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
riscom_driver->init_termios.c_ispeed = 9600;
riscom_driver->init_termios.c_ospeed = 9600;
riscom_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(riscom_driver, &riscom_ops);
if ((error = tty_register_driver(riscom_driver))) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment