diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-12-08 05:38:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:57 -0500 |
commit | 592ee3a5e5e2a981ef2829a0380093006d045661 (patch) | |
tree | 78fee67dc74a138a2edbc51247f6ec752071f488 /include | |
parent | 64bb6c5e1ddcd47c951740485026ef08975ee2e6 (diff) |
[PATCH] termios: Enable new style termios ioctls on x86-64
This turns on the split input/output speed features and arbitary baud rate
handling for the x86-64 platform. Nothing should break if you use existing
standard speeds. If you use the new speed stuff then you may see some
drivers failing to report the speed changes properly in error cases. This
will be worked on further. For the working cases this all seems happy.
I'll post a test suite used to test the basic stuff as well.
Patches for i386 will follow when I get a moment but are basically the
same. If people could patch/test-suite other architectures and submit them
that would be great.
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86_64/ioctls.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/termbits.h | 16 | ||||
-rw-r--r-- | include/asm-x86_64/termios.h | 6 |
3 files changed, 23 insertions, 3 deletions
diff --git a/include/asm-x86_64/ioctls.h b/include/asm-x86_64/ioctls.h index 62caf8b6e4e1..3fc0b15a0d7e 100644 --- a/include/asm-x86_64/ioctls.h +++ b/include/asm-x86_64/ioctls.h | |||
@@ -46,6 +46,10 @@ | |||
46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
49 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
50 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
51 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
52 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
49 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
50 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
51 | 55 | ||
diff --git a/include/asm-x86_64/termbits.h b/include/asm-x86_64/termbits.h index f31918cea510..6cfc3bb10c1a 100644 --- a/include/asm-x86_64/termbits.h +++ b/include/asm-x86_64/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
@@ -129,6 +140,7 @@ struct ktermios { | |||
129 | #define HUPCL 0002000 | 140 | #define HUPCL 0002000 |
130 | #define CLOCAL 0004000 | 141 | #define CLOCAL 0004000 |
131 | #define CBAUDEX 0010000 | 142 | #define CBAUDEX 0010000 |
143 | #define BOTHER 0010000 /* non standard rate */ | ||
132 | #define B57600 0010001 | 144 | #define B57600 0010001 |
133 | #define B115200 0010002 | 145 | #define B115200 0010002 |
134 | #define B230400 0010003 | 146 | #define B230400 0010003 |
@@ -144,10 +156,12 @@ struct ktermios { | |||
144 | #define B3000000 0010015 | 156 | #define B3000000 0010015 |
145 | #define B3500000 0010016 | 157 | #define B3500000 0010016 |
146 | #define B4000000 0010017 | 158 | #define B4000000 0010017 |
147 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 159 | #define CIBAUD 002003600000 /* input baud rate */ |
148 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 160 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
149 | #define CRTSCTS 020000000000 /* flow control */ | 161 | #define CRTSCTS 020000000000 /* flow control */ |
150 | 162 | ||
163 | #define IBSHIFT 8 /* Shift from CBAUD to CIBAUD */ | ||
164 | |||
151 | /* c_lflag bits */ | 165 | /* c_lflag bits */ |
152 | #define ISIG 0000001 | 166 | #define ISIG 0000001 |
153 | #define ICANON 0000002 | 167 | #define ICANON 0000002 |
diff --git a/include/asm-x86_64/termios.h b/include/asm-x86_64/termios.h index 041a91f7ddfb..443b225537f0 100644 --- a/include/asm-x86_64/termios.h +++ b/include/asm-x86_64/termios.h | |||
@@ -98,8 +98,10 @@ struct termio { | |||
98 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 98 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
99 | }) | 99 | }) |
100 | 100 | ||
101 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 101 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
102 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 102 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
103 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
104 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
103 | 105 | ||
104 | #endif /* __KERNEL__ */ | 106 | #endif /* __KERNEL__ */ |
105 | 107 | ||