2001-08-11 Tim Waugh <twaugh@redhat.com> * serial.c (get_pci_port): Deal with awkward Titan cards. 1998-08-26 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (rs_open): Correctly decrement the module in-use count on errors. Thu Feb 19 14:24:08 1998 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (tty_name): Remove the non-reentrant (and non-SMP safe) version of tty_name, and rename the reentrant _tty_name function to be tty_name. (tty_open): Add a warning message stating callout devices are deprecated. Mon Dec 1 08:24:15 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (tty_get_baud_rate): Print a warning syslog if the tty->alt_speed kludge is used; this means the system is using the deprecated SPD_HI ioctls. Mon Nov 24 10:37:49 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c, esp.c, rocket.c: Change drivers to take advantage of tty_get_baud_rate(). * tty_io.c (tty_get_baud_rate): New function which computes the correct baud rate for the tty. More factoring out of common code out of the serial driver to the high-level tty functions.... Sat Nov 22 07:53:36 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c, esp.c, rocket.c: Add tty->driver.break() routine, and allow high-level tty code to handle the break and soft carrier ioctls. * tty_ioctl.c (n_tty_ioctl): Support TIOCGSOFTCAR and TIOCSSOFTCAR, so that device drivers don't have to support it. * serial.c (autoconfig): Change 16750 test to hopefully eliminate false results by people with strange 16550As being detected as 16750s. Hopefully 16750s will still be detected as 16750, and other weird UARTs won't get poorly autodetected. If this doesn't work, I'll have to disable the auto identification for the 16750. * tty_io.c (tty_hangup): Now actually do the tty hangup processing during the timer processing, and disable interrupts while doing the hangup processing. This avoids several nasty race conditions which happened when the hangup processing was done asynchronously. (tty_ioctl): Do break handling in the tty driver if driver's break function is supported. (tty_flip_buffer_push): New exported function which should be used by drivers to push characters in the flip buffer to the tty handler. This may either be done using a task queue function for better CPU efficiency, or directly for low latency operation. * serial.c (rs_set_termios): Fix bug rs_set_termios when transitioning away from B0, submitted by Stanislav Voronyi. Thu Jun 19 20:05:58 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (begin_break, end_break, rs_ioctl): Applied patch to support BSD ioctls to set and clear the break condition explicitly. * console.c (scrup, scrdown, insert_line, delete_line): Applied fix suggested by Aaron Tiensivu to speed up block scrolls up and down. * n_tty.c (opost_block, write_chan): Added a modified "fast console" patch which processes a block of text via "cooking" efficiently. Wed Jun 18 15:25:50 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (init_dev, release_dev): Applied fix suggested by Bill Hawes to prevent race conditions in the tty code. * n_tty.c (n_tty_chars_in_buffer): Applied fix suggested by Bill Hawes so that n_tty_chars_in_buffer returns the correct value in the case when the tty is in cannonical mode. (To avoid a pty deadlock with telnetd.) Thu Feb 27 01:53:08 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (change_speed): Add support for the termios flag CMSPAR, which allows the user to select stick parity. (i.e, if PARODD is set, the parity bit is always 1; if PARRODD is not set, then the parity bit is always 0). Wed Feb 26 19:03:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (cleanup_module): Fix memory leak when using the serial driver as a module; make sure tmp_buf gets freed! Tue Feb 25 11:01:59 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (set_modem_info): Add support for setting and clearing the OUT1 and OUT2 bits. (For special case UART's, usually for half-duplex.) (autoconfig, change_speed): Fix TI 16750 support. Sun Feb 16 00:14:43 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (release_dev): Add sanity check to make sure there are no waiters on tty->read_wait or tty->write_wait. * serial.c (rs_init): Don't autoconfig a device if the I/O region is already reserved. * serial.c (serial_proc_info): Add support for /proc/serial. Thu Feb 13 00:49:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (receive_chars): When the UART repotrs an overrun condition, it does so with a valid character. Changed to not throw away the valid character, but instead report the overrun after the valid character. * serial.c: Added new #ifdef's for some of the advanced serial driver features. A minimal driver that only supports COM 1/2/3/4 without sharing serial interrupts only takes 17k; the full driver takes 32k. Wed Feb 12 14:50:44 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * vt.c: * pty.c: * tty_ioctl.c: * serial.c: Update routines to use the new 2.1 memory access routines. Wed Dec 4 07:51:52 1996 Theodore Ts'o <tytso@localhost.mit.edu> * serial.c (change_speed): Use save_flags(); cli() and restore_flags() in order to ensure we don't accidentally turn on interrupts when starting up the port. (startup): Move the insertion of serial structure into the IRQ chain earlier into the startup processing. Interrupts should be off this whole time, but we eventually will want to reduce this window. Thu Nov 21 10:05:22 1996 Theodore Ts'o <tytso@localhost.mit.edu> * tty_ioctl.c (tty_wait_until_sent): Always check the driver wait_until_ready routine, even if there are no characters in the xmit buffer. (There may be charactes in the device FIFO.) (n_tty_ioctl): Add new flag tty->flow_stopped which indicates whether the tty is stopped due to a request by the TCXONC ioctl (used by tcflow). If so, don't let an incoming XOFF character restart the tty. The tty can only be restarted by another TCXONC request. * tty_io.c (start_tty): Don't allow the tty to be restarted if tty->flow_stopped is true. * n_tty.c (n_tty_receive_char): If tty->flow_stopped is true, and IXANY is set, don't eat a character trying to restart the tty. * serial.c (startup): Remove need for MCR_noint from the async_struct structure. Only turn on DTR and RTS if the baud rate is not zero. (change_speed): More accurately calculate the timeout value based on the word size. Move responsibility of hangup when speed becomes B0 to rs_set_termios() (set_serial_info): When changing the UART type set the current xmit_fifo_size as well as the permanent xmit_fifo_size. (rs_ioctl): Fix TCSBRK (used by tcdrain) and TCSBRKP ioctls to return EINTR if interrupted by a signal. (rs_set_termios): If the baud rate changes to or from B0, this function is now responsible for setting or clearing DTR and RTS. DTR and RTS are only be changed on the transition to or from the B0 state. (rs_close): Wait for the characters to drain based on info->timeout. At low baud rates (50 bps), it may take a long time for the FIFO to completely drain out! (rs_wait_until_sent): Fixed timeout handling. Now releases control to the scheduler, but checks frequently enough so that the function is sensitive enough to pass the timing requirements of the NIST-PCTS. (block_til_ready): When opening the device, don't turn on DTR and RTS if the baud rate is B0. Thu Nov 14 00:06:09 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (autoconfig): Fix autoconfiguration problems; info->flags wasn't getting initialized from the state structure. Put in more paranoid test for the 16750. Fri Nov 8 20:19:50 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * n_tty.c (n_tty_flush_buffer): Only call driver->unthrottle() if the tty was previous throttled. (n_tty_set_termios, write_chan): Add changes suggested by Simon P. Allen to allow hardware cooking. * tty_ioctl.c (set_termios): If we get a signal while waiting for the tty to drain, return -EINTR. * serial.c (change_speed): Add support for CREAD, as required by POSIX. Sat Nov 2 20:43:10 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c: Wholesale changes. Added support for the Startech 16650 and 16650V2 chips. (WARNING: the new startech 16650A may or may not work!) Added support for the TI16750 (not yet tested). Split async_struct into a transient part (async_struct) and a permanent part (serial_state) which contains the configuration information for the ports. Added new driver routines wait_until_sent() and send_xchar() to help with POSIX compliance. Added support for radio clocks which waggle the carrier detect line (CONFIG_HARD_PPS). * tty_ioctl.c (tty_wait_until_sent): Added call to new driver function tty->driver.wait_until_sent(), which returns when the tty's device xmit buffers are drained. Needed for full POSIX compliance. (send_prio_char): New function, called by the ioctl's TCIOFF and TCION; uses the new driver call send_xchar(), which will send the XON or XOFF character at high priority (and even if tty output is stopped). Wed Jun 5 18:52:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * pty.c (pty_close): When closing a pty, make sure packet mode is cleared. Sun May 26 09:33:52 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * vesa_blank.c (set_vesa_blanking): Add missing verify_area() call. * selection.c (set_selection): Add missing verify_area() call. * tty_io.c (tty_ioctl): Add missing verify_area() calls. * serial.c (rs_ioctl): Add missing verify_area() calls. (rs_init): Allow initialization of serial driver configuration from a module. * random.c (extract_entropy): Add missing verify_area call. Don't limit number of characters returned to 32,768. Extract entropy is now no longer a inlined function. (random_read): Check return value in case extract_entropy returns an error. (secure_tcp_sequence_number): New function which returns a secure TCP sequence number. This is needed to prevent some nasty TCP hijacking attacks. (init_std_data): Initialize using gettimeofday() instead of struct timeval xtime. (fast_add_entropy_word, add_entropy_word): Rename the inline function add_entropy_word() to fast_add_entropy_word(). Make add_entropy_word() be the non-inlined function which is used in non-timing critical places, in order to save space. (initialize_benchmark, begin_benchmark, end_benchmark): New functions defined when RANDOM_BENCHMARK is defined. They allow us to benchmark the speed of the add_timer_randomness() call. (int_ln, rotate_left): Add two new inline functions with i386 optimized asm instructions. This speeds up the critical add_entropy_word() and add_timer_randomness() functions, which are called from interrupt handlers. Tue May 7 22:51:11 1996 <tytso@rsts-11.mit.edu> * random.c (add_timer_randomness): Limit the amount randomness that we estimate to 12 bits. (An arbitrary amount). (extract_entropy): To make it harder to analyze the hash function, fold the hash function in half using XOR, and use the folded result as the value to emit to the user. Also, add timer randomness each pass through the exact_entropy call, to increase the amount of unknown values during the extraction process. (random_ioctl): Use IOR/IOW definitions to define the ioctl values used by the /dev/random driver. Allow the old ioctl values to be used for backwards compatibility (for a limited amount of time). Wed Apr 24 14:02:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * random.c (add_timer_randomness): Use 2nd derivative as well to better estimate entropy. (rand_initialize): Explicitly initialize all the pointers to NULL. (Clearing pointers using memset isn't portable.) Initialize the random pool with OS-dependent data. (random_write): Add sanity checking to the arguments to random_write(), so that bad arguments won't cause a kernel SEGV. (random_read): Update the access time of the device inode when you return data to the user. (random_ioctl): Wake up the random_wait channel when there are only WAIT_INPUT_BITS available. Add more paranoia checks to make sure entropy_count doesn't go beyond the bounds of (0, POOLSIZE). Add a few missing verify_area checks. Add support for the RNDCLEARPOOL ioctl, which zaps the random pool. (add_timer_randomness): Wake up the random_wait channel only when there are WAIT_INPUT_BITS available. (random_select): Allow a random refresh daemon process to select on /dev/random for writing; wake up the daemon when there are less than WAIT_OUTPUT_BITS bits of randomness available. Tue Apr 23 22:56:07 1996 <tytso@rsts-11.mit.edu> * tty_io.c (init_dev): Change return code when user attempts to open master pty which is already open from EAGAIN to EIO, to match with BSD expectations. EIO is more correct anyway, since EAGAIN implies that retrying will be successful --- which it might be.... Eventually!! * pty.c (pty_open, pty_close): Fix wait loop so that we don't busy loop while waiting for the master side to open. Fix tty opening/closing logic. TTY_SLAVE_CLOSED was renamed to TTY_OTHER_CLOSED, so that the name is more descriptive. Also fixed code so that the tty flag actually works correctly now.... Mon Apr 1 10:22:01 1996 <tytso@rsts-11.mit.edu> * serial.c (rs_close): Cleaned up modularization changes. Remove code which forced line discipline back to N_TTY this is done in the tty upper layers, and there's no reason to do it here. (Making this change also removed the requirement that the serial module access the internal kernel symbol "ldiscs".) * tty_io.c (tty_init): Formally register a tty_driver entry for /dev/tty (device 4, 0) and /dev/console (device 5, 0). This guarantees that major device numbers 4 and 5 will be reserved for the tty subsystem (as they have to be because of /dev/tty and /dev/console). Removed tty_regdev, as this interface is no longer necessary. Sun Mar 17 20:42:47 GMT 1996 <ah@doc.ic.ac.uk> * serial.c : modularisation (changes in linux/fs/device.c allow kerneld to automatically load the serial module). * Makefile, Config.in : serial modularisation adds. * tty_io.c : tty_init_ctty used by to register "cua" driver just for the /dev/tty device (5,0). Added tty_regdev. * serial.c (shutdown, rs_ioctl) : when port shuts down wakeup processes waiting on delta_msr_wait. The TIOCMIWAIT ioctl returns EIO if no change was done since the time of call. Sat Mar 16 14:33:13 1996 <aeb@cwi.nl> * tty_io.c (disassociate_ctty): If disassociate_ctty is called by exit, do not perform an implicit vhangup on a pty. Fri Feb 9 14:15:47 1996 <tytso@rsts-11.mit.edu> * serial.c (block_til_ready): Fixed another race condition which happens if a hangup happens during the open. Wed Jan 10 10:08:00 1996 <tytso@rsts-11.mit.edu> * serial.c (block_til_ready): Remove race condition which happened if a hangup condition happened during the setup of the UART, before rs_open() called block_til_ready(). This caused the info->count counter to be erroneously decremented. * serial.c (startup, rs_open): Remove race condition that could cause a memory leak of one page. (Fortunately, both race conditions were relatively rare in practice.) Tue Dec 5 13:21:27 1995 <tytso@rsts-11.mit.edu> * serial.c (check_modem_status, rs_ioctl): Support the new ioctl()'s TIOCGICOUNT, TIOCMIWAIT. These allow an application program to wait on a modem serial register status bit change, and to find out how many changes have taken place for the MSR bits. (rs_write): Eliminate a race condition which is introduced if it is necessary to wait for the semaphore. Sat Nov 4 17:14:45 1995 <tytso@rsts-11.mit.edu> * tty_io.c (tty_init): Move registration of TTY_MAJOR and TTY_AUX_MAJOR to the end, so that /proc/devices looks prettier. * pty.c (pty_init): Use new major numbers for PTY master and slave devices. This allow us to have more than 64 pty's. We register the old pty devices for backwards compatibility. Note that a system should either be using the old pty devices or the new pty devices --- in general, it should try to use both, since they map into the same pty table. The old pty devices are strictly for backwards compatibility. Wed Oct 11 12:45:24 1995 <tytso@rsts-11.mit.edu> * tty_io.c (disassociate_ctty): If disassociate_ctty is called by exit, perform an implicit vhangup on the tty. * pty.c (pty_close): When the master pty is closed, send a hangup to the slave pty. (pty_open): Use the flag TTY_SLAVE_CLOSED to test to see if there are any open slave ptys, instead of using tty->link->count. The old method got confused if there were processes that had hung-up file descriptors on the slave tty. Tue May 2 00:53:25 1995 <tytso@rsx-11.mit.edu> * tty_io.c (tty_set_ldisc): Wait until the output buffer is drained before closing the old line discipline --- needed in only one case: XON/XOFF processing. * n_tty.c (n_tty_close): Don't bother waiting until the output driver is closed; in general, the line discipline shouldn't care if the hardware is finished transmitting before the line discipline terminates. * tty_io.c (release_dev): Shutdown the line discipline after decrementing the tty count variable; but set the TTY_CLOSING flag so that we know that this tty structure isn't long for this world. * tty_io.c (init_dev): Add sanity code to check to see if TTY_CLOSING is set on a tty structure; if so, something bad has happened (probably a line discipline close blocked when it shouldn't have; so do a kernel printk and then return an error). Wed Apr 26 10:23:44 1995 Theodore Y. Ts'o <tytso@localhost> * tty_io.c (release_dev): Try to shutdown the line discipline *before* decrementing the tty count variable; this removes a potential race condition which occurs when the line discipline close blocks, and another process then tries open the same serial port. * serial.c (rs_hangup): When hanging up, flush the output buffer before shutting down the UART. Otherwise the line discipline close blocks waiting for the characters to get flushed, which never happens until the serial port gets reused. Wed Apr 12 08:06:16 1995 Theodore Y. Ts'o <tytso@localhost> * serial.c (do_serial_hangup, do_softint, check_modem_status, rs_init): Hangups are now scheduled via a separate tqueue structure in the async_struct structure, tqueue_hangup. This task is pushed on to the tq_schedule queue, so that it is processed synchronously by the scheduler. Sat Feb 18 12:13:51 1995 Theodore Y. Ts'o (tytso@rt-11) * tty_io.c (disassociate_ctty, tty_open, tty_ioctl): Clear current->tty_old_pgrp field when a session leader acquires a controlling tty, and after a session leader has disassociated from a controlling tty. Fri Feb 17 09:34:09 1995 Theodore Y. Ts'o (tytso@rt-11) * serial.c (rs_interrupt_single, rs_interrupt, rs_interrupt_multi): Change the number of passes made from 64 to be 256, configurable with the #define RS_ISR_PASS_LIMIT. * serial.c (rs_init, set_serial_info, get_serial_info, rs_close): Remove support for closing_wait2. Instead, set tty->closing and rely on the line discipline to prevent echo wars. * n_tty.c (n_tty_receive_char): IEXTEN does not need to be enabled in order for IXANY to be active.Lines 1–500 of 775. Load more
2001-08-11 Tim Waugh <twaugh@redhat.com> * serial.c (get_pci_port): Deal with awkward Titan cards. 1998-08-26 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (rs_open): Correctly decrement the module in-use count on errors. Thu Feb 19 14:24:08 1998 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (tty_name): Remove the non-reentrant (and non-SMP safe) version of tty_name, and rename the reentrant _tty_name function to be tty_name. (tty_open): Add a warning message stating callout devices are deprecated. Mon Dec 1 08:24:15 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (tty_get_baud_rate): Print a warning syslog if the tty->alt_speed kludge is used; this means the system is using the deprecated SPD_HI ioctls. Mon Nov 24 10:37:49 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c, esp.c, rocket.c: Change drivers to take advantage of tty_get_baud_rate(). * tty_io.c (tty_get_baud_rate): New function which computes the correct baud rate for the tty. More factoring out of common code out of the serial driver to the high-level tty functions.... Sat Nov 22 07:53:36 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c, esp.c, rocket.c: Add tty->driver.break() routine, and allow high-level tty code to handle the break and soft carrier ioctls. * tty_ioctl.c (n_tty_ioctl): Support TIOCGSOFTCAR and TIOCSSOFTCAR, so that device drivers don't have to support it. * serial.c (autoconfig): Change 16750 test to hopefully eliminate false results by people with strange 16550As being detected as 16750s. Hopefully 16750s will still be detected as 16750, and other weird UARTs won't get poorly autodetected. If this doesn't work, I'll have to disable the auto identification for the 16750. * tty_io.c (tty_hangup): Now actually do the tty hangup processing during the timer processing, and disable interrupts while doing the hangup processing. This avoids several nasty race conditions which happened when the hangup processing was done asynchronously. (tty_ioctl): Do break handling in the tty driver if driver's break function is supported. (tty_flip_buffer_push): New exported function which should be used by drivers to push characters in the flip buffer to the tty handler. This may either be done using a task queue function for better CPU efficiency, or directly for low latency operation. * serial.c (rs_set_termios): Fix bug rs_set_termios when transitioning away from B0, submitted by Stanislav Voronyi. Thu Jun 19 20:05:58 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (begin_break, end_break, rs_ioctl): Applied patch to support BSD ioctls to set and clear the break condition explicitly. * console.c (scrup, scrdown, insert_line, delete_line): Applied fix suggested by Aaron Tiensivu to speed up block scrolls up and down. * n_tty.c (opost_block, write_chan): Added a modified "fast console" patch which processes a block of text via "cooking" efficiently. Wed Jun 18 15:25:50 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (init_dev, release_dev): Applied fix suggested by Bill Hawes to prevent race conditions in the tty code. * n_tty.c (n_tty_chars_in_buffer): Applied fix suggested by Bill Hawes so that n_tty_chars_in_buffer returns the correct value in the case when the tty is in cannonical mode. (To avoid a pty deadlock with telnetd.) Thu Feb 27 01:53:08 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (change_speed): Add support for the termios flag CMSPAR, which allows the user to select stick parity. (i.e, if PARODD is set, the parity bit is always 1; if PARRODD is not set, then the parity bit is always 0). Wed Feb 26 19:03:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (cleanup_module): Fix memory leak when using the serial driver as a module; make sure tmp_buf gets freed! Tue Feb 25 11:01:59 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (set_modem_info): Add support for setting and clearing the OUT1 and OUT2 bits. (For special case UART's, usually for half-duplex.) (autoconfig, change_speed): Fix TI 16750 support. Sun Feb 16 00:14:43 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * tty_io.c (release_dev): Add sanity check to make sure there are no waiters on tty->read_wait or tty->write_wait. * serial.c (rs_init): Don't autoconfig a device if the I/O region is already reserved. * serial.c (serial_proc_info): Add support for /proc/serial. Thu Feb 13 00:49:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (receive_chars): When the UART repotrs an overrun condition, it does so with a valid character. Changed to not throw away the valid character, but instead report the overrun after the valid character. * serial.c: Added new #ifdef's for some of the advanced serial driver features. A minimal driver that only supports COM 1/2/3/4 without sharing serial interrupts only takes 17k; the full driver takes 32k. Wed Feb 12 14:50:44 1997 Theodore Ts'o <tytso@rsts-11.mit.edu> * vt.c: * pty.c: * tty_ioctl.c: * serial.c: Update routines to use the new 2.1 memory access routines. Wed Dec 4 07:51:52 1996 Theodore Ts'o <tytso@localhost.mit.edu> * serial.c (change_speed): Use save_flags(); cli() and restore_flags() in order to ensure we don't accidentally turn on interrupts when starting up the port. (startup): Move the insertion of serial structure into the IRQ chain earlier into the startup processing. Interrupts should be off this whole time, but we eventually will want to reduce this window. Thu Nov 21 10:05:22 1996 Theodore Ts'o <tytso@localhost.mit.edu> * tty_ioctl.c (tty_wait_until_sent): Always check the driver wait_until_ready routine, even if there are no characters in the xmit buffer. (There may be charactes in the device FIFO.) (n_tty_ioctl): Add new flag tty->flow_stopped which indicates whether the tty is stopped due to a request by the TCXONC ioctl (used by tcflow). If so, don't let an incoming XOFF character restart the tty. The tty can only be restarted by another TCXONC request. * tty_io.c (start_tty): Don't allow the tty to be restarted if tty->flow_stopped is true. * n_tty.c (n_tty_receive_char): If tty->flow_stopped is true, and IXANY is set, don't eat a character trying to restart the tty. * serial.c (startup): Remove need for MCR_noint from the async_struct structure. Only turn on DTR and RTS if the baud rate is not zero. (change_speed): More accurately calculate the timeout value based on the word size. Move responsibility of hangup when speed becomes B0 to rs_set_termios() (set_serial_info): When changing the UART type set the current xmit_fifo_size as well as the permanent xmit_fifo_size. (rs_ioctl): Fix TCSBRK (used by tcdrain) and TCSBRKP ioctls to return EINTR if interrupted by a signal. (rs_set_termios): If the baud rate changes to or from B0, this function is now responsible for setting or clearing DTR and RTS. DTR and RTS are only be changed on the transition to or from the B0 state. (rs_close): Wait for the characters to drain based on info->timeout. At low baud rates (50 bps), it may take a long time for the FIFO to completely drain out! (rs_wait_until_sent): Fixed timeout handling. Now releases control to the scheduler, but checks frequently enough so that the function is sensitive enough to pass the timing requirements of the NIST-PCTS. (block_til_ready): When opening the device, don't turn on DTR and RTS if the baud rate is B0. Thu Nov 14 00:06:09 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c (autoconfig): Fix autoconfiguration problems; info->flags wasn't getting initialized from the state structure. Put in more paranoid test for the 16750. Fri Nov 8 20:19:50 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * n_tty.c (n_tty_flush_buffer): Only call driver->unthrottle() if the tty was previous throttled. (n_tty_set_termios, write_chan): Add changes suggested by Simon P. Allen to allow hardware cooking. * tty_ioctl.c (set_termios): If we get a signal while waiting for the tty to drain, return -EINTR. * serial.c (change_speed): Add support for CREAD, as required by POSIX. Sat Nov 2 20:43:10 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * serial.c: Wholesale changes. Added support for the Startech 16650 and 16650V2 chips. (WARNING: the new startech 16650A may or may not work!) Added support for the TI16750 (not yet tested). Split async_struct into a transient part (async_struct) and a permanent part (serial_state) which contains the configuration information for the ports. Added new driver routines wait_until_sent() and send_xchar() to help with POSIX compliance. Added support for radio clocks which waggle the carrier detect line (CONFIG_HARD_PPS). * tty_ioctl.c (tty_wait_until_sent): Added call to new driver function tty->driver.wait_until_sent(), which returns when the tty's device xmit buffers are drained. Needed for full POSIX compliance. (send_prio_char): New function, called by the ioctl's TCIOFF and TCION; uses the new driver call send_xchar(), which will send the XON or XOFF character at high priority (and even if tty output is stopped). Wed Jun 5 18:52:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * pty.c (pty_close): When closing a pty, make sure packet mode is cleared. Sun May 26 09:33:52 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * vesa_blank.c (set_vesa_blanking): Add missing verify_area() call. * selection.c (set_selection): Add missing verify_area() call. * tty_io.c (tty_ioctl): Add missing verify_area() calls. * serial.c (rs_ioctl): Add missing verify_area() calls. (rs_init): Allow initialization of serial driver configuration from a module. * random.c (extract_entropy): Add missing verify_area call. Don't limit number of characters returned to 32,768. Extract entropy is now no longer a inlined function. (random_read): Check return value in case extract_entropy returns an error. (secure_tcp_sequence_number): New function which returns a secure TCP sequence number. This is needed to prevent some nasty TCP hijacking attacks. (init_std_data): Initialize using gettimeofday() instead of struct timeval xtime. (fast_add_entropy_word, add_entropy_word): Rename the inline function add_entropy_word() to fast_add_entropy_word(). Make add_entropy_word() be the non-inlined function which is used in non-timing critical places, in order to save space. (initialize_benchmark, begin_benchmark, end_benchmark): New functions defined when RANDOM_BENCHMARK is defined. They allow us to benchmark the speed of the add_timer_randomness() call. (int_ln, rotate_left): Add two new inline functions with i386 optimized asm instructions. This speeds up the critical add_entropy_word() and add_timer_randomness() functions, which are called from interrupt handlers. Tue May 7 22:51:11 1996 <tytso@rsts-11.mit.edu> * random.c (add_timer_randomness): Limit the amount randomness that we estimate to 12 bits. (An arbitrary amount). (extract_entropy): To make it harder to analyze the hash function, fold the hash function in half using XOR, and use the folded result as the value to emit to the user. Also, add timer randomness each pass through the exact_entropy call, to increase the amount of unknown values during the extraction process. (random_ioctl): Use IOR/IOW definitions to define the ioctl values used by the /dev/random driver. Allow the old ioctl values to be used for backwards compatibility (for a limited amount of time). Wed Apr 24 14:02:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu> * random.c (add_timer_randomness): Use 2nd derivative as well to better estimate entropy. (rand_initialize): Explicitly initialize all the pointers to NULL. (Clearing pointers using memset isn't portable.) Initialize the random pool with OS-dependent data. (random_write): Add sanity checking to the arguments to random_write(), so that bad arguments won't cause a kernel SEGV. (random_read): Update the access time of the device inode when you return data to the user. (random_ioctl): Wake up the random_wait channel when there are only WAIT_INPUT_BITS available. Add more paranoia checks to make sure entropy_count doesn't go beyond the bounds of (0, POOLSIZE). Add a few missing verify_area checks. Add support for the RNDCLEARPOOL ioctl, which zaps the random pool. (add_timer_randomness): Wake up the random_wait channel only when there are WAIT_INPUT_BITS available. (random_select): Allow a random refresh daemon process to select on /dev/random for writing; wake up the daemon when there are less than WAIT_OUTPUT_BITS bits of randomness available. Tue Apr 23 22:56:07 1996 <tytso@rsts-11.mit.edu> * tty_io.c (init_dev): Change return code when user attempts to open master pty which is already open from EAGAIN to EIO, to match with BSD expectations. EIO is more correct anyway, since EAGAIN implies that retrying will be successful --- which it might be.... Eventually!! * pty.c (pty_open, pty_close): Fix wait loop so that we don't busy loop while waiting for the master side to open. Fix tty opening/closing logic. TTY_SLAVE_CLOSED was renamed to TTY_OTHER_CLOSED, so that the name is more descriptive. Also fixed code so that the tty flag actually works correctly now.... Mon Apr 1 10:22:01 1996 <tytso@rsts-11.mit.edu> * serial.c (rs_close): Cleaned up modularization changes. Remove code which forced line discipline back to N_TTY this is done in the tty upper layers, and there's no reason to do it here. (Making this change also removed the requirement that the serial module access the internal kernel symbol "ldiscs".) * tty_io.c (tty_init): Formally register a tty_driver entry for /dev/tty (device 4, 0) and /dev/console (device 5, 0). This guarantees that major device numbers 4 and 5 will be reserved for the tty subsystem (as they have to be because of /dev/tty and /dev/console). Removed tty_regdev, as this interface is no longer necessary. Sun Mar 17 20:42:47 GMT 1996 <ah@doc.ic.ac.uk> * serial.c : modularisation (changes in linux/fs/device.c allow kerneld to automatically load the serial module). * Makefile, Config.in : serial modularisation adds. * tty_io.c : tty_init_ctty used by to register "cua" driver just for the /dev/tty device (5,0). Added tty_regdev. * serial.c (shutdown, rs_ioctl) : when port shuts down wakeup processes waiting on delta_msr_wait. The TIOCMIWAIT ioctl returns EIO if no change was done since the time of call. Sat Mar 16 14:33:13 1996 <aeb@cwi.nl> * tty_io.c (disassociate_ctty): If disassociate_ctty is called by exit, do not perform an implicit vhangup on a pty. Fri Feb 9 14:15:47 1996 <tytso@rsts-11.mit.edu> * serial.c (block_til_ready): Fixed another race condition which happens if a hangup happens during the open. Wed Jan 10 10:08:00 1996 <tytso@rsts-11.mit.edu> * serial.c (block_til_ready): Remove race condition which happened if a hangup condition happened during the setup of the UART, before rs_open() called block_til_ready(). This caused the info->count counter to be erroneously decremented. * serial.c (startup, rs_open): Remove race condition that could cause a memory leak of one page. (Fortunately, both race conditions were relatively rare in practice.) Tue Dec 5 13:21:27 1995 <tytso@rsts-11.mit.edu> * serial.c (check_modem_status, rs_ioctl): Support the new ioctl()'s TIOCGICOUNT, TIOCMIWAIT. These allow an application program to wait on a modem serial register status bit change, and to find out how many changes have taken place for the MSR bits. (rs_write): Eliminate a race condition which is introduced if it is necessary to wait for the semaphore. Sat Nov 4 17:14:45 1995 <tytso@rsts-11.mit.edu> * tty_io.c (tty_init): Move registration of TTY_MAJOR and TTY_AUX_MAJOR to the end, so that /proc/devices looks prettier. * pty.c (pty_init): Use new major numbers for PTY master and slave devices. This allow us to have more than 64 pty's. We register the old pty devices for backwards compatibility. Note that a system should either be using the old pty devices or the new pty devices --- in general, it should try to use both, since they map into the same pty table. The old pty devices are strictly for backwards compatibility. Wed Oct 11 12:45:24 1995 <tytso@rsts-11.mit.edu> * tty_io.c (disassociate_ctty): If disassociate_ctty is called by exit, perform an implicit vhangup on the tty. * pty.c (pty_close): When the master pty is closed, send a hangup to the slave pty. (pty_open): Use the flag TTY_SLAVE_CLOSED to test to see if there are any open slave ptys, instead of using tty->link->count. The old method got confused if there were processes that had hung-up file descriptors on the slave tty. Tue May 2 00:53:25 1995 <tytso@rsx-11.mit.edu> * tty_io.c (tty_set_ldisc): Wait until the output buffer is drained before closing the old line discipline --- needed in only one case: XON/XOFF processing. * n_tty.c (n_tty_close): Don't bother waiting until the output driver is closed; in general, the line discipline shouldn't care if the hardware is finished transmitting before the line discipline terminates. * tty_io.c (release_dev): Shutdown the line discipline after decrementing the tty count variable; but set the TTY_CLOSING flag so that we know that this tty structure isn't long for this world. * tty_io.c (init_dev): Add sanity code to check to see if TTY_CLOSING is set on a tty structure; if so, something bad has happened (probably a line discipline close blocked when it shouldn't have; so do a kernel printk and then return an error). Wed Apr 26 10:23:44 1995 Theodore Y. Ts'o <tytso@localhost> * tty_io.c (release_dev): Try to shutdown the line discipline *before* decrementing the tty count variable; this removes a potential race condition which occurs when the line discipline close blocks, and another process then tries open the same serial port. * serial.c (rs_hangup): When hanging up, flush the output buffer before shutting down the UART. Otherwise the line discipline close blocks waiting for the characters to get flushed, which never happens until the serial port gets reused. Wed Apr 12 08:06:16 1995 Theodore Y. Ts'o <tytso@localhost> * serial.c (do_serial_hangup, do_softint, check_modem_status, rs_init): Hangups are now scheduled via a separate tqueue structure in the async_struct structure, tqueue_hangup. This task is pushed on to the tq_schedule queue, so that it is processed synchronously by the scheduler. Sat Feb 18 12:13:51 1995 Theodore Y. Ts'o (tytso@rt-11) * tty_io.c (disassociate_ctty, tty_open, tty_ioctl): Clear current->tty_old_pgrp field when a session leader acquires a controlling tty, and after a session leader has disassociated from a controlling tty. Fri Feb 17 09:34:09 1995 Theodore Y. Ts'o (tytso@rt-11) * serial.c (rs_interrupt_single, rs_interrupt, rs_interrupt_multi): Change the number of passes made from 64 to be 256, configurable with the #define RS_ISR_PASS_LIMIT. * serial.c (rs_init, set_serial_info, get_serial_info, rs_close): Remove support for closing_wait2. Instead, set tty->closing and rely on the line discipline to prevent echo wars. * n_tty.c (n_tty_receive_char): IEXTEN does not need to be enabled in order for IXANY to be active.