aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/moxa.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/moxa.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/moxa.c')
-rw-r--r--drivers/char/moxa.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 8b316953173d..f391a24a1b44 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -234,7 +234,7 @@ static void moxa_put_char(struct tty_struct *, unsigned char);
234static int moxa_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long); 234static int moxa_ioctl(struct tty_struct *, struct file *, unsigned int, unsigned long);
235static void moxa_throttle(struct tty_struct *); 235static void moxa_throttle(struct tty_struct *);
236static void moxa_unthrottle(struct tty_struct *); 236static void moxa_unthrottle(struct tty_struct *);
237static void moxa_set_termios(struct tty_struct *, struct termios *); 237static void moxa_set_termios(struct tty_struct *, struct ktermios *);
238static void moxa_stop(struct tty_struct *); 238static void moxa_stop(struct tty_struct *);
239static void moxa_start(struct tty_struct *); 239static void moxa_start(struct tty_struct *);
240static void moxa_hangup(struct tty_struct *); 240static void moxa_hangup(struct tty_struct *);
@@ -261,7 +261,7 @@ static void MoxaPortEnable(int);
261static void MoxaPortDisable(int); 261static void MoxaPortDisable(int);
262static long MoxaPortGetMaxBaud(int); 262static long MoxaPortGetMaxBaud(int);
263static long MoxaPortSetBaud(int, long); 263static long MoxaPortSetBaud(int, long);
264static int MoxaPortSetTermio(int, struct termios *, speed_t); 264static int MoxaPortSetTermio(int, struct ktermios *, speed_t);
265static int MoxaPortGetLineOut(int, int *, int *); 265static int MoxaPortGetLineOut(int, int *, int *);
266static void MoxaPortLineCtrl(int, int, int); 266static void MoxaPortLineCtrl(int, int, int);
267static void MoxaPortFlowCtrl(int, int, int, int, int, int); 267static void MoxaPortFlowCtrl(int, int, int, int, int, int);
@@ -355,6 +355,8 @@ static int __init moxa_init(void)
355 moxaDriver->init_termios.c_oflag = 0; 355 moxaDriver->init_termios.c_oflag = 0;
356 moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; 356 moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
357 moxaDriver->init_termios.c_lflag = 0; 357 moxaDriver->init_termios.c_lflag = 0;
358 moxaDriver->init_termios.c_ispeed = 9600;
359 moxaDriver->init_termios.c_ospeed = 9600;
358 moxaDriver->flags = TTY_DRIVER_REAL_RAW; 360 moxaDriver->flags = TTY_DRIVER_REAL_RAW;
359 tty_set_operations(moxaDriver, &moxa_ops); 361 tty_set_operations(moxaDriver, &moxa_ops);
360 362
@@ -864,7 +866,7 @@ static void moxa_unthrottle(struct tty_struct *tty)
864} 866}
865 867
866static void moxa_set_termios(struct tty_struct *tty, 868static void moxa_set_termios(struct tty_struct *tty,
867 struct termios *old_termios) 869 struct ktermios *old_termios)
868{ 870{
869 struct moxa_str *ch = (struct moxa_str *) tty->driver_data; 871 struct moxa_str *ch = (struct moxa_str *) tty->driver_data;
870 872
@@ -978,7 +980,7 @@ static void moxa_poll(unsigned long ignored)
978 980
979static void set_tty_param(struct tty_struct *tty) 981static void set_tty_param(struct tty_struct *tty)
980{ 982{
981 register struct termios *ts; 983 register struct ktermios *ts;
982 struct moxa_str *ch; 984 struct moxa_str *ch;
983 int rts, cts, txflow, rxflow, xany; 985 int rts, cts, txflow, rxflow, xany;
984 986
@@ -1149,7 +1151,7 @@ static void shut_down(struct moxa_str *ch)
1149static void receive_data(struct moxa_str *ch) 1151static void receive_data(struct moxa_str *ch)
1150{ 1152{
1151 struct tty_struct *tp; 1153 struct tty_struct *tp;
1152 struct termios *ts; 1154 struct ktermios *ts;
1153 unsigned long flags; 1155 unsigned long flags;
1154 1156
1155 ts = NULL; 1157 ts = NULL;
@@ -1912,9 +1914,9 @@ int MoxaPortsOfCard(int cardno)
1912 * 1914 *
1913 * Function 12: Configure the port. 1915 * Function 12: Configure the port.
1914 * Syntax: 1916 * Syntax:
1915 * int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud); 1917 * int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud);
1916 * int port : port number (0 - 127) 1918 * int port : port number (0 - 127)
1917 * struct termios * termio : termio structure pointer 1919 * struct ktermios * termio : termio structure pointer
1918 * speed_t baud : baud rate 1920 * speed_t baud : baud rate
1919 * 1921 *
1920 * return: -1 : this port is invalid or termio == NULL 1922 * return: -1 : this port is invalid or termio == NULL
@@ -2195,7 +2197,7 @@ long MoxaPortSetBaud(int port, long baud)
2195 return (baud); 2197 return (baud);
2196} 2198}
2197 2199
2198int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud) 2200int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud)
2199{ 2201{
2200 void __iomem *ofsAddr; 2202 void __iomem *ofsAddr;
2201 tcflag_t cflag; 2203 tcflag_t cflag;