aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/epca.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-12-08 05:38:45 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:57 -0500
commit606d099cdd1080bbb50ea50dc52d98252f8f10a1 (patch)
tree80d17450a5fb78effce3f4312f672c058658e004 /drivers/char/epca.c
parentedc6afc5496875a640bef0913604be7550c1795d (diff)
[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: Alan Cox <alan@redhat.com> Signed-off-by: Martin Peschke <mp3@de.ibm.com> Acked-by: Peter Oberparleiter <oberpar@de.ibm.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/epca.c')
-rw-r--r--drivers/char/epca.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 7c71eb779802..a0f822c9d74d 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -199,7 +199,7 @@ static int pc_ioctl(struct tty_struct *, struct file *,
199 unsigned int, unsigned long); 199 unsigned int, unsigned long);
200static int info_ioctl(struct tty_struct *, struct file *, 200static int info_ioctl(struct tty_struct *, struct file *,
201 unsigned int, unsigned long); 201 unsigned int, unsigned long);
202static void pc_set_termios(struct tty_struct *, struct termios *); 202static void pc_set_termios(struct tty_struct *, struct ktermios *);
203static void do_softint(struct work_struct *work); 203static void do_softint(struct work_struct *work);
204static void pc_stop(struct tty_struct *); 204static void pc_stop(struct tty_struct *);
205static void pc_start(struct tty_struct *); 205static void pc_start(struct tty_struct *);
@@ -1236,6 +1236,8 @@ static int __init pc_init(void)
1236 pc_driver->init_termios.c_oflag = 0; 1236 pc_driver->init_termios.c_oflag = 0;
1237 pc_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; 1237 pc_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
1238 pc_driver->init_termios.c_lflag = 0; 1238 pc_driver->init_termios.c_lflag = 0;
1239 pc_driver->init_termios.c_ispeed = 9600;
1240 pc_driver->init_termios.c_ospeed = 9600;
1239 pc_driver->flags = TTY_DRIVER_REAL_RAW; 1241 pc_driver->flags = TTY_DRIVER_REAL_RAW;
1240 tty_set_operations(pc_driver, &pc_ops); 1242 tty_set_operations(pc_driver, &pc_ops);
1241 1243
@@ -1250,6 +1252,8 @@ static int __init pc_init(void)
1250 pc_info->init_termios.c_oflag = 0; 1252 pc_info->init_termios.c_oflag = 0;
1251 pc_info->init_termios.c_lflag = 0; 1253 pc_info->init_termios.c_lflag = 0;
1252 pc_info->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL; 1254 pc_info->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL;
1255 pc_info->init_termios.c_ispeed = 9600;
1256 pc_info->init_termios.c_ospeed = 9600;
1253 pc_info->flags = TTY_DRIVER_REAL_RAW; 1257 pc_info->flags = TTY_DRIVER_REAL_RAW;
1254 tty_set_operations(pc_info, &info_ops); 1258 tty_set_operations(pc_info, &info_ops);
1255 1259
@@ -1999,7 +2003,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch)
1999{ /* Begin epcaparam */ 2003{ /* Begin epcaparam */
2000 2004
2001 unsigned int cmdHead; 2005 unsigned int cmdHead;
2002 struct termios *ts; 2006 struct ktermios *ts;
2003 struct board_chan __iomem *bc; 2007 struct board_chan __iomem *bc;
2004 unsigned mval, hflow, cflag, iflag; 2008 unsigned mval, hflow, cflag, iflag;
2005 2009
@@ -2114,7 +2118,7 @@ static void receive_data(struct channel *ch)
2114{ /* Begin receive_data */ 2118{ /* Begin receive_data */
2115 2119
2116 unchar *rptr; 2120 unchar *rptr;
2117 struct termios *ts = NULL; 2121 struct ktermios *ts = NULL;
2118 struct tty_struct *tty; 2122 struct tty_struct *tty;
2119 struct board_chan __iomem *bc; 2123 struct board_chan __iomem *bc;
2120 int dataToRead, wrapgap, bytesAvailable; 2124 int dataToRead, wrapgap, bytesAvailable;
@@ -2362,12 +2366,14 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
2362 switch (cmd) 2366 switch (cmd)
2363 { /* Begin switch cmd */ 2367 { /* Begin switch cmd */
2364 2368
2369#if 0 /* Handled by calling layer properly */
2365 case TCGETS: 2370 case TCGETS:
2366 if (copy_to_user(argp, tty->termios, sizeof(struct termios))) 2371 if (copy_to_user(argp, tty->termios, sizeof(struct ktermios)))
2367 return -EFAULT; 2372 return -EFAULT;
2368 return 0; 2373 return 0;
2369 case TCGETA: 2374 case TCGETA:
2370 return get_termio(tty, argp); 2375 return get_termio(tty, argp);
2376#endif
2371 case TCSBRK: /* SVID version: non-zero arg --> no break */ 2377 case TCSBRK: /* SVID version: non-zero arg --> no break */
2372 retval = tty_check_change(tty); 2378 retval = tty_check_change(tty);
2373 if (retval) 2379 if (retval)
@@ -2536,7 +2542,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
2536 2542
2537/* --------------------- Begin pc_set_termios ----------------------- */ 2543/* --------------------- Begin pc_set_termios ----------------------- */
2538 2544
2539static void pc_set_termios(struct tty_struct *tty, struct termios *old_termios) 2545static void pc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
2540{ /* Begin pc_set_termios */ 2546{ /* Begin pc_set_termios */
2541 2547
2542 struct channel *ch; 2548 struct channel *ch;