Skip to contentSkip to conversation

PATCH: tty driver take 4 try 2

PATCH Alan Cox 1 participant 1 message Sep 23, 2004

Subsystems (5)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

Ok this should fix the bug

"We apologise for the inconvenience"

Documentation/tty.txt +4 -2
diff -u --new-file --recursive --exclude-from /usr/src/exclude tty.old/Documentation/tty.txt linux-2.6.9rc2/Documentation/tty.txt
@@ -58,8 +58,10 @@
 
 chars_in_buffer() -	Report the number of bytes in the buffer.
 
-set_termios()	-	Called on termios structure changes. Semantics 
-			deeply mysterious right now.
+set_termios()	-	Called on termios structure changes. The caller
+			passes the old termios data and the current data
+			is in the tty. Currently can be parallel entered
+			and ordering isn't predictable - FIXME
 
 read()		-	Move data from the line discipline to the user.
 			Multiple read calls may occur in parallel and the
drivers/char/n_tty.c +329 -53

584 lines not on this page · raw message

drivers/char/pcmcia/synclink_cs.c +40 -19

90 lines not on this page · raw message

drivers/char/synclink.c +41 -23

100 lines not on this page · raw message

drivers/char/synclinkmp.c +39 -21

90 lines not on this page · raw message

drivers/char/tty_io.c +68 -28

224 lines not on this page · raw message

drivers/char/tty_ioctl.c +34 -8

113 lines not on this page · raw message

drivers/usb/serial/ir-usb.c +4 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude tty.old/drivers/usb/serial/ir-usb.c linux-2.6.9rc2/drivers/usb/serial/ir-usb.c
@@ -449,6 +449,10 @@
 			 */
 			tty = port->tty;
 
+			/*
+			 *	FIXME: must not do this in IRQ context,
+			 *	must honour TTY_DONT_FLIP
+			 */
 			tty->ldisc.receive_buf(
 				tty,
 				data+1,
include/linux/tty.h +1 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude tty.old/include/linux/tty.h linux-2.6.9rc2/include/linux/tty.h
@@ -320,6 +320,7 @@
 #define TTY_HW_COOK_IN 		15	/* Hardware can do input cooking */
 #define TTY_PTY_LOCK 		16	/* pty private */
 #define TTY_NO_WRITE_SPLIT 	17	/* Preserve write boundaries to driver */
+#define TTY_HUPPED 		18	/* Post driver->hangup() */
 
 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
 
include/linux/tty_ldisc.h +8 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude tty.old/include/linux/tty_ldisc.h linux-2.6.9rc2/include/linux/tty_ldisc.h
@@ -95,6 +95,13 @@
  * 	that line discpline should try to send more characters to the
  * 	low-level driver for transmission.  If the line discpline does
  * 	not have any more data to send, it can just return.
+ *
+ * int (*hangup)(struct tty_struct *)
+ *
+ *	Called on a hangup. Tells the discipline that it should
+ *	cease I/O to the tty driver. Can sleep. The driver should
+ *	seek to perform this action quickly but should wait until
+ *	any pending driver I/O is completed.
  */
 
 #include <linux/fs.h>
@@ -122,6 +129,7 @@
 	void	(*set_termios)(struct tty_struct *tty, struct termios * old);
 	unsigned int (*poll)(struct tty_struct *, struct file *,
 			     struct poll_table_struct *);
+	int	(*hangup)(struct tty_struct *tty);
 	
 	/*
 	 * The following routines are called from below.