1. 18 7月, 2012 1 次提交
  2. 17 7月, 2012 1 次提交
  3. 29 3月, 2012 1 次提交
  4. 19 10月, 2011 1 次提交
    • T
      tty: Support compat_ioctl get/set termios_locked · 8193c429
      Thomas Meyer 提交于
      When running a Fedora 15 (x86) on an x86_64 kernel, in the boot process
      plymouthd complains about those two missing ioctls:
      [    2.581783] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005457){t:'T';sz:0} arg(ffb6a5d0) on /dev/tty1
      [    2.581803] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005456){t:'T';sz:0} arg(ffb6a680) on /dev/tty1
      
      both ioctl functions work on the 'struct termios' resp. 'struct termios2',
      which has the same size (36 bytes resp. 44 bytes) on x86 and x86_64,
      so it's just a matter of converting the pointer from userland.
      Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8193c429
  5. 20 4月, 2011 1 次提交
  6. 12 4月, 2011 1 次提交
  7. 31 3月, 2011 1 次提交
  8. 18 2月, 2011 1 次提交
  9. 05 11月, 2010 1 次提交
  10. 11 8月, 2010 1 次提交
    • H
      tty: Add EXTPROC support for LINEMODE · 26df6d13
      hyc@symas.com 提交于
      This patch is against the 2.6.34 source.
      
      Paraphrased from the 1989 BSD patch by David Borman @ cray.com:
      
           These are the changes needed for the kernel to support
           LINEMODE in the server.
      
           There is a new bit in the termios local flag word, EXTPROC.
           When this bit is set, several aspects of the terminal driver
           are disabled.  Input line editing, character echo, and mapping
           of signals are all disabled.  This allows the telnetd to turn
           off these functions when in linemode, but still keep track of
           what state the user wants the terminal to be in.
      
           New ioctl:
               TIOCSIG         Generate a signal to processes in the
                               current process group of the pty.
      
           There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
           When packet mode is turned on in the pty, and the EXTPROC bit
           is set, then whenever the state of the pty is changed, the
           next read on the master side of the pty will have the TIOCPKT_IOCTL
           bit set.  This allows the process on the server side of the pty
           to know when the state of the terminal has changed; it can then
           issue the appropriate ioctl to retrieve the new state.
      
      Since the original BSD patches accompanied the source code for telnet
      I've left that reference here, but obviously the feature is useful for
      any remote terminal protocol, including ssh.
      
      The corresponding feature has existed in the BSD tty driver since 1989.
      For historical reference, a good copy of the relevant files can be found
      here:
      
      http://anonsvn.mit.edu/viewvc/krb5/trunk/src/appl/telnet/?pathrev=17741Signed-off-by: NHoward Chu <hyc@symas.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      26df6d13
  11. 09 11月, 2009 1 次提交
  12. 20 9月, 2009 1 次提交
  13. 13 7月, 2009 1 次提交
  14. 17 6月, 2009 1 次提交
  15. 11 6月, 2009 2 次提交
    • A
      tty: Untangle termios and mm mutex dependencies · 26a2e20f
      Alan Cox 提交于
      Although this doesn't cause any problems it could potentially do so for
      future mmap using devices. No real work is needed to sort it out so untangle
      it before it causes problems
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26a2e20f
    • A
      tty: throttling race fix · 38db8979
      Alan Cox 提交于
      The tty throttling code can race due to the lock drops. It takes very high
      loads but this has been observed and verified by Rob Duncan.
      
      The basic problem is that on an SMP box we can go
      
      	CPU #1				CPU #2
      	need to throttle ?
      	suppose we should		buffer space cleared
      					are we throttled
      					yes ? - unthrottle
      	call throttle method
      
      This changeet take the termios lock to protect against this. The termios
      lock isn't the initial obvious candidate but many implementations of throttle
      methods already need to poke around their own termios structures (and nobody
      really locks them against a racing change of flow control).
      
      This does mean that anyone who is setting tty->low_latency = 1 and then
      calling tty_flip_buffer_push from their unthrottle method is going to end up
      collapsing in a pile of locks. However we've removed all the known bogus
      users of low_latency = 1 and such use isn't safe anyway for other reasons so
      catching it would be an improvement.
      Signed-off-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      38db8979
  16. 16 1月, 2009 1 次提交
  17. 14 10月, 2008 4 次提交
  18. 28 8月, 2008 1 次提交
  19. 21 7月, 2008 1 次提交
    • A
      tty: Ldisc revamp · a352def2
      Alan Cox 提交于
      Move the line disciplines towards a conventional ->ops arrangement.  For
      the moment the actual 'tty_ldisc' struct in the tty is kept as part of
      the tty struct but this can then be changed if it turns out that when it
      all settles down we want to refcount ldiscs separately to the tty.
      
      Pull the ldisc code out of /proc and put it with our ldisc code.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a352def2
  20. 24 6月, 2008 1 次提交
  21. 30 4月, 2008 6 次提交
  22. 09 2月, 2008 1 次提交
  23. 09 1月, 2008 1 次提交
  24. 24 12月, 2007 1 次提交
    • C
      tty: fix logic change introduced by wait_event_interruptible_timeout() · db99247a
      Cory T. Tusar 提交于
      Commit 5a52bd4a introduced a subtle logic
      change in tty_wait_until_sent().  The original version would only error out
      of the 'do { ...  } while (timeout)' loop if signal_pending() evaluated to
      true; a timeout or break due to an empty buffer would fall out of the loop
      and into the tty->driver->wait_until_sent handling.  The current
      implementation will error out on either a pending signal or an empty
      buffer, falling through to the tty->driver->wait_until_sent handling only
      on a timeout.
      
      The ->wait_until_sent() will not be reached if the buffer empties before
      timeout jiffies have elapsed.  This behavior differs from that prior to commit
      5a52bd4a.
      
      I turned this up while using a little serial download utility to bootstrap an
      ARM-based eval board.  The util worked fine on 2.6.22.x, but consistently
      failed on 2.6.23.x.  Once I'd determined that, I narrowed things down with git
      bisect, and found the above difference in logic in tty_wait_until_sent() by
      inspection.
      
      This change reverts the logic flow in tty_wait_until_sent() to match that
      prior to the aforementioned commit.
      Signed-off-by: NCory T. Tusar <ctusar@videon-central.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Acked-by: NJiri Slaby <jirislaby@gmail.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      db99247a
  25. 07 11月, 2007 1 次提交
    • A
      [TTY]: Fix network driver interactions with TCGET/SET calls. · 0fc00e24
      Alan Cox 提交于
      Dave Miller noted various cases where line disciplines for things like
      ppp go poking around in termios themselves in ways that broke with the
      new termios code. Rather than have them all learning about termios
      internals provide proper methods for this
      
      - tty_mode_ioctl()
      
      	This handles all the terminal mode handling for speed/carrier
      etc and none of the methods are ldisc dependant so they can be called
      by any user
      
      - tty_perform_flush()
      
      	This extracts the flush functionality and enables pppd the ppp
      layer to share it cleanly.
      
      The existing n_tty_ioctl code is refactored in this patch to provide
      the new functions and to call them itself appropriately. This patch
      has no (intended) behaviour changes and simply prepares for the other
      fixes.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0fc00e24
  26. 20 10月, 2007 1 次提交
  27. 19 10月, 2007 1 次提交
  28. 17 10月, 2007 1 次提交
    • A
      tty: expose new methods needed for drivers to get termios right · 5f519d72
      Alan Cox 提交于
      This adds three new functions (or in one case to be more exact makes it
      always available)
      
      tty_termios_copy_hw
      
      Copies all the hardware settings from one termios structure to the other.
      This is intended for drivers that support little or no hardware setting
      
      tty_termios_encode_baud_rate
      
      Allows you to set the input and output baud rate in a termios structure.  A
      driver is supposed to set the resulting baud rate from a request so most
      will want to use this function to set the resulting input and output rates
      to match the hardware values.  Internally it knows about keeping Bxxx
      encoding when possible to maximise compatibility.
      
      tty_encode_baud_rate
      
      As above but for the tty's own current termios structure
      
      I suspect this will initially need some tweaking as it gets enabled by
      driver patches over the next few mm cycles so consider this lot -mm only
      for the moment so it can stabilize and end up neat before it goes to base.
      
      I've tried not to break any obscure architectures - if you get a speed you
      can't represent the code will print warnings on non updated termios systems
      but not break.
      
      Once this is merged and seems sane I've got a growing pile of driver
      updates to use it - notably for USB serial drivers.
      
      [akpm@linux-foundation.org: cleanups]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f519d72
  29. 15 9月, 2007 1 次提交
  30. 12 9月, 2007 1 次提交
    • D
      tty: termios locking functions break with new termios type · f629307c
      David Miller 提交于
      I ran into a few problems.
      
      n_tty_ioctl() for instance:
      
      drivers/char/tty_ioctl.c:799: error: $,1rxstruct termios$,1ry has no
      member named $,1rxc_ispeed$,1ry
      
      This is calling the copy interface that is supposed to be using
      a termios2 when the new interfaces are defined, however:
      
      	case TIOCGLCKTRMIOS:
      		if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
      			return -EFAULT;
      		return 0;
      
      This is going to write over the end of the userspace
      structure by a few bytes, and wasn't caught by you yet
      because the i386 implementation is simply copy_to_user()
      which does zero type checking.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f629307c
  31. 17 7月, 2007 1 次提交