aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2009-09-19n_tty: move echoctl check and clean up logicJoe Peterson1-28/+18
Check L_ECHOCTL before insertting a character in the echo buffer (rather than as the buffer is processed), to be more consistent with when all other L_ flags are checked. Also cleaned up the related logic. Note that this and the previous patch ("n_tty: honor opost flag for echoes") were verified together by the reporters of the bug that patch addresses (http://bugs.linuxbase.org/show_bug.cgi?id=2692), and the test now passes. Signed-off-by: Joe Peterson <joe@skyrush.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19n_tty: honor opost flag for echoesJoe Peterson1-11/+22
Fixes the following bug: http://bugs.linuxbase.org/show_bug.cgi?id=2692 Causes processing of echoed characters (output from the echo buffer) to honor the O_OPOST flag, which is consistent with the old behavior. Note that this and the next patch ("n_tty: move echoctl check and clean up logic") were verified together by the bug reporters, and the test now passes. Signed-off-by: Joe Peterson <joe@skyrush.com> Cc: Linux Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: USB serial termios bitsAlan Cox11-107/+106
Various drivers have hacks to mangle termios structures. This stems from the fact there is no nice setup hook for configuring the termios settings when the port is created Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19Set proper console speed on resume if console suspend is disabledDeepak Saxena1-14/+18
Commit b5b82df6, from May 2007, breaks no_console_suspend on the OLPC XO laptop. Basically what happens is that upon returning from resume, serial8250_resume_port() will reconfigure the port for high speed mode and all console output will be garbled, making debug of the resume path painful. This patch modifies uart_resume_port() to reset the port to the state it was in before we suspended. Original patch by Marcelo Tosatti Second patch by Deepak then reworked by Alan to fit with the tty changes before it got submitted. Also fixed the console path to set c_i/ospeed as some drivers require the termios fields are valid Signed-off-by: Deepak Saxena <dsaxena@laptop.org> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: introduce tty krefsAlan Cox1-3/+3
Initially just use the helper and thus krefs when we set and clear the port values. Signed-off-by: Alan Cox <alan@linux.intel.com>
2009-09-19serial: kill USF_CLOSING_* definitionsAlan Cox2-6/+3
The serial layer for some reason uses different defines for the special case close delays and then conditionally switches to/from the normal ones in the ioctls. Remove this rather pointless abstraction Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: move port users helperAlan Cox2-4/+7
This little helper is now tty_port specific and useful generally so move it Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: move delta_msr_wait into the tty_portAlan Cox32-54/+54
This is used by various drivers not just serial and can be extracted as commonality Signed-off-by: Alan Cox <alan@linux.intel.com>
2009-09-19serial: replace the state mutex with the tty port mutexAlan Cox3-114/+123
They cover essentially the same stuff and we can therefore fold it into the tty_port one. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: kill off uif_tAlan Cox1-11/+0
This typedef is now extinct Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: move the flags into the tty_port fieldAlan Cox3-105/+98
Fortunately the serial layer was designed to use the same flag values but with different names. It has its own SUSPENDED flag which is a free slot in the ASYNC flags so we allocate it in the ASYNC flags instead. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: move count into the tty_port versionAlan Cox2-19/+20
Remove more stuff from the serial special case code Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: use tty_port pointers in the core codeAlan Cox1-142/+146
Extract out a lot of the x.port. uses and also show up where there are things left to be isolated that prevent use using the port helpers in the serial layer at this point Signed-off-by: Alan Cox <alan@linux.intel.com>
2009-09-19serial: Fold closing_* fields into the tty_port onesAlan Cox3-17/+15
Remove some more serial specific use Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: kill off uart_infoAlan Cox50-432/+422
We moved this into uart_state, now move the fields out of the separate structure and kill it off. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19isicom: split the open method for the isicom deviceAlan Cox1-8/+24
Again moving towards being able to add a common open method Signed-off-by: Alan Cox <alan@linux.intel.com>
2009-09-19tty: USB does not need the filp argument in the driversAlan Cox41-131/+68
And indeed none of them use it. Clean this up as it will make moving to a standard open method rather easier. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19vt: add an activate and lockAlan Cox2-1/+44
X and other graphical interfaces need to be able to flip to a console and lock it into graphics mode without races. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19vt: move kernel stuff out of vt.hAlan Cox2-11/+12
We have vt_kern.h for this Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19vt: remove power stuff from kernel/powerAlan Cox3-58/+62
In the past someone gratuitiously borrowed chunks of kernel internal vt code and dumped them in kernel/power. They have all sorts of deep relations with the vt code so put them in the vt tree instead Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19vt: add an event interfaceAlan Cox4-52/+154
This is needed and requested in various forms for ConsoleKit, screenblank handling and the like so do the job with a single interface. Also build the interface so that unlike VT_WAITACTIVE and friends it won't miss events. FIXME: Should this be a waitactive ioctl or a new device file you can poll and read events from. We need the code anyway to fix up the existing broken wait for console switch logic but the ConsoleKit people would prefer the new device to the ioctl we have here Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: USB can now use the shutdown method for kref based freeing of portsAlan Cox1-21/+7
Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: remove dtr/rts use from the driver open methodsAlan Cox1-6/+0
These are handled by the tty_port core code which will raise and lower the carrier correctly in tty_wait_until_ready Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: USB hangup is racyAlan Cox1-4/+1
The USB layer uses tty_hangup to deal with unplugs of the physical hardware (analogous to loss of carrier) and then frees the resources. However the tty_hangup is asynchronous. As the hangup can sleep we can use tty_vhangup which is the non async version to avoid freeing resources too early. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cdc_acm: Fix to use modern speed interfacesAlan Cox1-4/+1
This changed in 2006 so its about time the ACM driver caught up Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: make the kref destructor occur asynchronouslyAlan Cox1-3/+16
We want to be able to sleep in the destructor for USB at least. It isn't a hot path so just pushing it to a work queue doesn't really cause any difficulty. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: use the full port_close functionAlan Cox1-19/+17
Convert cyclades to use the full tty_port_close helper Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: riscom8 kref and tty_port_closeAlan Cox1-72/+59
We need to kref this driver in order to use port_close Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19isicom: Split the close hardware bits outAlan Cox1-11/+14
Start to extract and build a model for a common tty_port_close() Signed-off-by: Alan Cox <alan@linux.intel.com>
2009-09-19mxser: Split close ready for a standard tty_port_close methodAlan Cox1-22/+23
Prepare for the tty_port_close function by splitting out methods Signed-off-by: Alan Cox <alan@linux.intel.com>
2009-09-19riscom8: split open and close methods upAlan Cox1-21/+26
Moving towards a tty_port method for open/close Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: Add a full port_close functionAlan Cox2-3/+34
Now we are extracting out methods for shutdown and the like we can add a proper tty_port_close method that knows all the innards of the tty closing process and hides the lot from the caller. At some point in the future this will be paired with a similar open() helper and the drivers can stick to hardware management. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-198250: Now honours baud rate lower boundsAnton Vorontsov1-1/+3
A platform clock drives 8250 ports in most SOC systems, the clock might run at high frequencies, and so it's not always possible to downscale uart clock to a desired value. Currently the 8250 uart driver accepts not supported baud rates, and what is worse, it is doing this silently, and then passes not accepted values to a new termios, so userspace has no chance to catch this kind of errors (userspace verifies that settings were accepted by reading back and comparing the settings). This patch fixes the issue by passing minimum baud rate to the uart_get_baud_rate() call, the call should take care of all bounds, so userspace should now report: # stty -F /dev/ttyS0 speed 300 115200 stty: /dev/ttyS0: unable to perform all requested operations p.s. uart_get_baud_rate() falls back to 9600, which still might be too low for some 10 GHz platforms, but that's a separate issue, and we can wait with fixing this till we find such a platform. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19serial: 8250: add IRQ trigger supportVikram Pandita4-5/+12
There is currently no provision for passing IRQ trigger flags for serial IRQs with triggering requirements (such as GPIO IRQs) This patch adds irqflags to plat_serial8250_port that can be passed from board file to reqest_irq() of 8250 driver Changes are backward compatible with boards passing UPF_SHARE_IRQ flag Tested on Zoom2 board that has IRQF_TRIGGER_RISING requirement for 8250 irq [Moved new flag to end to fix bugs in the original with the old_serial array -- Alan] Signed-off-by: Vikram Pandita <vikram.pandita@ti.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19mos7840: remove old dead modem logicAlan Cox1-115/+0
The modem ioctls are not routed via the ioctl method so kill the old dead code. The correct code is also already present and hooked in. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: Fix a typo noted in passingAlan Cox1-1/+1
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19tty: usb_serial_mos7720: Fix get_lsr_infoKees Schoenmakers1-4/+15
I made a correction for get_lsr_info, now it returns some meaningful information. I tested it with two simultaneous simplex modem channels. it is attached Signed-off-by: Kees Schoenmakers <k.schoenmakers@sigmae.nl> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19MOS7720 has no tiocmget methodKees Schoenmakers1-37/+64
Fix the tiocmget/mset handling on the mos7720 USB serial port. [Minor space reformatting for coding style - Alan] Signed-off-by: Kees Schoenmakers <k.schoenmakers@sigmae.nl> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19kfifo: Use "const" definitionsAlan Cox2-3/+3
Currently kfifo cannot be used by parts of the kernel that use "const" properly as kfifo itself does not use const for passed data blocks which are indeed const. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19slip: Clean up create and destroyAlan Cox1-73/+23
The network layer now has a destructor we can hook to clean up the slip devices array. That needs us to initiate unregister events in the right places which with the current tty layer we can do, and with network refcounting is safe to do. Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: remove more duplicated codeJiri Slaby1-31/+14
Remove duplicated code from cy_set_line_char. There were 2 if branches with same contents except flags. Branch only for the flags computation and use them in the only copy of the code. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: introduce cyy_readb/writebJiri Slaby2-285/+165
Add helpers for io operations, so that we can eliminate huge amount of supporting code. It is now centralized in those helpers and used values are precomputed in the init phase. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: tiocm cleanupJiri Slaby1-87/+66
- save one indent level by inverting !fw_loaded condition - read rs_status on Z and write it after we change all the flags, don't do that separately - remove Y inverted rts/dtr branching, precompute registers and use them Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: ioctls cleanupJiri Slaby1-112/+67
- add a cy_ prefix to functions with changed prototypes - cy_get_serial_info: initialize serial_struct by initializer, save a memset - inline simple functions (get_mon_info, {s,g}et_default_threshold, {s,g}et_default_timeout) directly in the ioctl handler - add a cy_cflags_changed helper to not copy its code by wait_event_interruptible - remove some ret_val = 0 assignments, it's preset to 0 - TIOCGICOUNT: don't do many put_user's, do one copy_to_user Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: merge cy_startup tailsJiri Slaby1-29/+16
There is a duplicated code for Y and Z in cy_startup, merge the paths. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: use dtr_rts helpersJiri Slaby1-201/+79
For Z cards, use tty helpers for dtr_rts. If we did the same for Y cards, it will cause a deadlock, because cyy_dtr_rts takes a lock which we already hold. Instead, we introduce a Y helper expecting card lock to be held. It may then be called with set/clear masks from other places. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: sleep instead busy-waitJiri Slaby1-2/+2
Avoid long busy loops (5 ms) which may be replaced by sleeps. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: overall cleanupJiri Slaby1-586/+12
- remove changelog from the file. we don't care about ancient history - update copyright year - update version - constify some stuff - empty lines removal - unused variables and macros removal - remove some asm/ includes, they are sucked by linux/ variants Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: close cleanupJiri Slaby1-68/+2
Use new tty helpers for close, which allows much code removal. The only real change is locking. card_lock for protecting was used inappropriately (just to have a critical section, no matter which lock is used), so the change to port->lock is fine. Remove also useless debug printks while being there. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19cyclades: switch to tty_port_hangupJiri Slaby1-17/+6
Do not duplicate common tty_port_hangup code. Use it instead. Also do not unset ASYNC_NORMAL_ACTIVE and wake up from the tty_hangup() caller. It makes no sense since we don't check that flag in sleepers. tty_port_hangup() performed later will do the right job. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>