1 #ifndef _ASM_POWERPC_TERMIOS_H
2 #define _ASM_POWERPC_TERMIOS_H
5 * Liberally adapted from alpha/termios.h. In particular, the c_cc[]
6 * fields have been reordered so that termio & termios share the
7 * common subset in the same order (for brain dead programs that don't
8 * know or care about the differences).
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
16 #include <asm/ioctls.h>
17 #include <asm/termbits.h>
46 unsigned short ws_row;
47 unsigned short ws_col;
48 unsigned short ws_xpixel;
49 unsigned short ws_ypixel;
54 unsigned short c_iflag; /* input mode flags */
55 unsigned short c_oflag; /* output mode flags */
56 unsigned short c_cflag; /* control mode flags */
57 unsigned short c_lflag; /* local mode flags */
58 unsigned char c_line; /* line discipline */
59 unsigned char c_cc[NCC]; /* control characters */
74 /* line disciplines */
81 #define N_X25 6 /* X.25 async */
83 #define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
84 #define N_R3964 9 /* Reserved for Simatic R3964 module */
85 #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
86 #define N_IRDA 11 /* Linux IrDa - http://www.cs.uit.no/~dagb/irda/irda.html */
87 #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
88 #define N_HDLC 13 /* synchronous HDLC */
90 #define N_HCI 15 /* Bluetooth HCI UART */
93 /* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */
94 #define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025"
100 * Translate a "termio" structure into a "termios". Ugh.
102 #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
103 unsigned short __tmp; \
104 get_user(__tmp,&(termio)->x); \
105 (termios)->x = (0xffff0000 & (termios)->x) | __tmp; \
108 #define user_termio_to_kernel_termios(termios, termio) \
110 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
111 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
112 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
113 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
114 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
118 * Translate a "termios" structure into a "termio". Ugh.
120 #define kernel_termios_to_user_termio(termio, termios) \
122 put_user((termios)->c_iflag, &(termio)->c_iflag); \
123 put_user((termios)->c_oflag, &(termio)->c_oflag); \
124 put_user((termios)->c_cflag, &(termio)->c_cflag); \
125 put_user((termios)->c_lflag, &(termio)->c_lflag); \
126 put_user((termios)->c_line, &(termio)->c_line); \
127 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
130 #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
131 #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
133 #endif /* __KERNEL__ */
135 #endif /* _ASM_POWERPC_TERMIOS_H */