20 Sep, 2009
40 commits
-
We moved this into uart_state, now move the fields out of the separate
structure and kill it off.Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Again moving towards being able to add a common open method
Signed-off-by: Alan Cox
-
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
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman -
We have vt_kern.h for this
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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 insteadSigned-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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 hereSigned-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Signed-off-by: Alan Cox
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
These are handled by the tty_port core code which will raise and lower the
carrier correctly in tty_wait_until_readySigned-off-by: Alan Cox
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
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
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
This changed in 2006 so its about time the ACM driver caught up
Signed-off-by: Alan Cox
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman -
Convert cyclades to use the full tty_port_close helper
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
We need to kref this driver in order to use port_close
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Start to extract and build a model for a common tty_port_close()
Signed-off-by: Alan Cox
-
Prepare for the tty_port_close function by splitting out methods
Signed-off-by: Alan Cox
-
Moving towards a tty_port method for open/close
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
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 operationsp.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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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 driverChanges 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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman -
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Fix the tiocmget/mset handling on the mos7720 USB serial port.
[Minor space reformatting for coding style - Alan]
Signed-off-by: Kees Schoenmakers
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
- 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
themSigned-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
- 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_userSigned-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
There is a duplicated code for Y and Z in cy_startup, merge the paths.
Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Avoid long busy loops (5 ms) which may be replaced by sleeps.
Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
- 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/ variantsSigned-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Don't fetch firmware address and recompute channel control on each
port access. Precompute the values on init and use them later all
the time.The same for board control.
This simplify code and improves readability.
Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Use a tty_port common instead. This saves lots of .text and makes the
code a lot more readable.This involves separation of a dtr_rts handling, next patches will use
that to not duplicate the code all over the place.Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
While this is not problem for Y card handlers (they are protected
by card_lock), Z handlers and other functions may dereference NULL
at any point after hangup/close. Even if (tty == NULL) was already
performed in the handler.Note that it's not an issue for Y cards just for now. After
switching to tty_port_close_* et al. this will be a problem. So
add refcounting to them all.Also proc .show doesn't take a tty reference and it should (along
with a ldisc one).While at it and changing prototypes (adding tty param), prepend
cy_ to functions which don't have it yet.Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman -
Previously, if any bit other than CMD_SND_BREAK was set, CMD_SND_BREAK
was not unset.Signed-off-by: Roel Kluin
Signed-off-by: Greg Kroah-Hartman