History log of /drivers/usb/serial/visor.c
Revision Date Author Comments
29618e9fb5507b9fcf07f739a8506a3640495945 23-Feb-2012 Alan Stern <stern@rowland.harvard.edu> usb-serial: use new registration API in [t-z]* drivers

This patch (as1529) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:

ti_usb_3410_5052, usb_debug, visor, vivopay-serial,
whiteheat, and zio.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
90ab5ee94171b3e28de6bb42ee30b527014e0be7 13-Jan-2012 Rusty Russell <rusty@rustcorp.com.au> module_param: make bool parameters really bool (drivers & misc)

module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
acb52cb1613e1d3c8a8c650717cc51965c60d7d4 07-Feb-2011 Maciej Szmigiero <mhej@o2.pl> USB: Add Samsung SGH-I500/Android modem ID switch to visor driver

[USB]Add Samsung SGH-I500/Android modem ID switch to visor driver

Samsung decided to reuse USB ID of its old CDMA phone SGH-I500 for the
modem part of some of their Android phones. At least Galaxy Spica
is affected.

This modem needs ACM driver and does not work with visor driver which
binds the conflicting ID for SGH-I500.
Because SGH-I500 is pretty an old hardware its best to add switch to
visor
driver in cause somebody still wants to use that phone with Linux.

Note that this is needed only when using the Android phone as modem,
not in USB storage or ADB mode.

Signed-off-by: Maciej Szmigiero <mhej@o2.pl>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
cfb8da8f69b81d367b766888e83ec0483a31bf01 12-Oct-2010 Johan Hovold <jhovold@gmail.com> USB: visor: fix initialisation of UX50/TH55 devices

Fix regression introduced by commit
214916f2ec6701e1c9972f26c60b3dc37d3153c6 (USB: visor: reimplement using
generic framework) which broke initialisation of UX50/TH55 devices that
used re-mapped bulk-out endpoint addresses.

Reported-by: Robert Gadsdon <rgadsdon@bayarea.net>
Tested-by: Robert Gadsdon <rgadsdon@bayarea.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9a1f298f8bc92f21b09bd7ef396c2fc6544ce9aa 16-May-2010 Johan Hovold <jhovold@gmail.com> USB: visor: increase bulk-out buffer size

Increase the bulk-out buffer size to avoid any regression in throughput
after replacing the old writing scheme which used dynamic buffers (e.g.
up to 2k).

256b has been determined to be a good choice for several drivers
including ftdi_sio which used to have a more or less identical write
implementation.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
214916f2ec6701e1c9972f26c60b3dc37d3153c6 15-May-2010 Johan Hovold <jhovold@gmail.com> USB: visor: reimplement using generic framework

Kill custom read and write implementations (dynamically allocated write
urbs).

Note that I chose to remove the stat module parameter which was supposed
to keep count of the amount of data sent and received, but which has
been broken for three years (since b308e74d9c708ee2a9af14fbe235e0a41216f4ed
"USB: visor driver adapted to new tty buffering" -- bytes_in was
incorrectly updated and was thus always reported as 0).

Compile-only tested.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
199b113978015309dd02c69844c19a1be3f4dbcf 15-May-2010 Johan Hovold <jhovold@gmail.com> USB: visor: fix memory leak

Fix memory leak for some devices (Sony Clie 3.5) due to port private
data not being freed on release.

Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a108bfcb372d8c4452701039308fb95747911c59 18-Feb-2010 Alan Cox <alan@linux.intel.com> USB: tty: Prune uses of tty_request_room in the USB layer

We have lots of callers that do not need to do this in the first place.
Remove the calls as they both cost CPU and for big buffers can mess up the
multi-page allocation avoidance.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
759f3634267a67ac90f3fa7fc06510dfd43b4e45 06-Feb-2010 Joe Perches <joe@perches.com> USB: serial: Remove unnecessary \n's from dbg uses

#define dbg adds the newline, messages shouldn't.
Converted dbg("%s", "some string") to dbg("some string")

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
401711cb575bbbdb100bc1a14cb2024dfc9b4869 28-Dec-2009 Johan Hovold <jhovold@gmail.com> USB: visor: fix DMA buffers on stack

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a1c33952b729eba4cedb8dbe54765921f2b3062f 07-Oct-2009 Oliver Neukum <oliver@neukum.org> USB: serial: fix race between unthrottle and completion handler in visor

usb:usbserial:visor: fix race between unthrottle and completion handler

visor_unthrottle() mustn't resubmit the URB unconditionally
as the URB may still be running.

the same bug as opticon.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
638325154572ba2113a18669fe3b299caa2dabd9 07-Oct-2009 Oliver Neukum <oliver@neukum.org> USB: serial: fix assumption that throttle/unthrottle cannot sleep

many serial subdrivers are clearly written as if throttle/unthrottle
cannot sleep. This leads to unneeded atomic submissions. This
patch converts affected drivers in a way to makes very clear that
throttle/unthrottle can sleep. Thus future misdesigns can be avoided
and efficiency and reliability improved.

This removes any such assumption using GFP_KERNEL and spin_lock_irq()

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4c9fde9b860ccb27a7b026844eb3ef64c77e5a49 01-Oct-2009 Oliver Neukum <oliver@neukum.org> USB: visor: fix trivial accounting bug in visor driver

usb:usbserial:visor: fix accounting in error case

data not pushed to the tty layer due to an error mustn't be counted

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a509a7e478e4766114d69f12d19d644ac63e9765 19-Sep-2009 Alan Cox <alan@linux.intel.com> tty: USB does not need the filp argument in the drivers

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>
f9c99bb8b3a1ec81af68d484a551307326c2e933 02-Jun-2009 Alan Stern <stern@rowland.harvard.edu> USB: usb-serial: replace shutdown with disconnect, release

This patch (as1254) splits up the shutdown method of usb_serial_driver
into a disconnect and a release method.

The problem is that the usb-serial core was calling shutdown during
disconnect handling, but drivers didn't expect it to be called until
after all the open file references had been closed. The result was an
oops when the close method tried to use memory that had been
deallocated by shutdown.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
335f8514f200e63d689113d29cb7253a5c282967 11-Jun-2009 Alan Cox <alan@lxorguk.ukuu.org.uk> tty: Bring the usb tty port structure into more use

This allows us to clean stuff up, but is probably also going to cause
some app breakage with buggy apps as we now implement proper POSIX behaviour
for USB ports matching all the other ports. This does also mean other apps
that break on USB will now work properly.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2400a2bfbd0e912193fe3b077f492d4980141813 20-Apr-2009 Oliver Neukum <oliver@neukum.org> USB: removal of tty->low_latency hack dating back to the old serial code

This removes tty->low_latency from all USB serial drivers that push
data into the tty layer at hard interrupt context. It's no longer needed
and actually harmful.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
194343d9364ea07c9f27c4505380a15a905e8a24 21-Aug-2008 Greg Kroah-Hartman <gregkh@suse.de> USB: remove use of err() in drivers/usb/serial

err() is going away, so switch to dev_err() or printk() if it's really
needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
c197a8db59daf06dc5e77acd5a9681329cb22458 18-Aug-2008 Greg Kroah-Hartman <gregkh@suse.de> USB: remove info() macro from usb/serial drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4a90f09b20f4622dcbff1f0e1e6bae1704f8ad8c 13-Oct-2008 Alan Cox <alan@redhat.com> tty: usb-serial krefs

Use kref in the USB serial drivers so that we don't free tty structures
from under the URB receive handlers as has historically been the case if
you were unlucky. This also gives us a framework for general tty drivers to
use tty_port objects and refcount.

Contains two err->dev_err changes merged together to fix clashes in the
-next tree.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
d60d43965e46674b9097b422336a55c6ca08559a 22-Jul-2008 Alan Cox <alan@redhat.com> tty-usb-visor: Coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
95da310e66ee8090119596c70ca8432e57f9a97f 22-Jul-2008 Alan Cox <alan@redhat.com> usb_serial: API all change

USB serial likes to use port->tty back pointers for the real work it does and
to do so without any actual locking. Unfortunately when you consider hangup
events, hangup/parallel reopen or even worse hangup followed by parallel close
events the tty->port and port->tty pointers are not guaranteed to be the same
as port->tty is the active tty while tty->port is the port the tty may or
may not still be attached to.

So rework the entire API to pass the tty struct. For console cases we need
to pass both for now. This shows up multiple drivers that immediately crash
with USB console some of which have been fixed in the process.

Longer term we need a proper tty as console abstraction

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
cdc97792289179974af6dda781c855696358d307 24-Feb-2008 Ming Lei <tom.leiming@gmail.com> USB: remove unnecessary type casting of urb->context

urb->context code cleanup

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a5b6f60c5a30c494017c7a2d11c4067f90d3d0df 08-Apr-2008 Alan Cox <alan@lxorguk.ukuu.org.uk> usb serial: more fixes and groundwork for tty changes

- If a termios change fails due to lack of memory we should copy the
old settings back over as the device has not changed
- Note various locking problems
- kl5kusb105 had various remaining tty flag handling problems
- Make safe_serial use tty_insert_flip_string not open coded loops
- set termios speed properly in usb_serial

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
441b62c1edb986827154768d89bbac0ba779984f 04-Mar-2008 Harvey Harrison <harvey.harrison@gmail.com> USB: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
0ba4034e20abf372dae6c6cabeeeab600acb5889 16-Apr-2008 Greg Kroah-Hartman <gregkh@suse.de> USB: serial: remove unneeded number endpoints settings

The usb-serial core no longer checks these fields so remove them from
all of the individual drivers. They will be removed from the usb-serial
core in a patch later in the series.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d04863e9e65767feff7807c8f693ac2719dd1944 26-Mar-2008 Brad Sawatzky <brad+kernel@swatter.net> USB: serial: fix regression in Visor/Palm OS module for kernels >= 2.6.24

Fixes a bug/inconsistency revealed by the additional sanity checking in
commit 063a2da8f01806906f7d7b1a1424b9afddebc443
introduced in the original 2.6.24 branch.

The Handspring Visor / PalmOS 4 device structure defines .num_bulk_out=2
but the usb-serial probe returns num_bulk_out=3, triggering the check in
the above commit and forcing a bail out when the device (a Garmin iQue in
my case) attempts to connect. The patch bumps the expected number of
endpoints to 3.

FWIW, this patch will probably solve the following kernel bug report for
Treo users (identical symptoms, different model PalmOS units):
<http://bugzilla.kernel.org/show_bug.cgi?id=10118>


Signed-off-by: Brad Sawatzky <brad+kernel@swatter.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
95bef012ea4a3cce437a4fcf59bb097d14944b0d 22-Jan-2008 Oliver Neukum <oliver@neukum.org> USB: more serial drivers writing after disconnect

this covers the rest of the obvious cases by using the flags
and locks to guard against disconnect which were introduced
in the earlier patch against mos7720.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e33fe4d86f91127f6f7d931ff59ed6cbda06e72b 21-Jan-2008 Oliver Neukum <oliver@neukum.org> USB: make sure usb serial drivers don't flush to logically disconnected devices

If disconnect() is called for a logical disconnect, no more IO must be
done after disconnect() returns, or the old and new drivers may conflict.
This patch avoids this by using the flag and lock introduced by the earlier
patch for the mos7720 driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d9c563626d9a136636385209d59d0c4f16c4a7ab 27-Sep-2007 Alan Cox <alan@lxorguk.ukuu.org.uk> USB: visor: termios bits

Visor has a huge complex routine which displays termios bits for debug
but doesn't do anything. Get the correct behaviour by removing it all

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
c8ba84a0c682068a55a5892d6e12e3f196fd792c 04-Aug-2007 Maximilian Attems <max@stro.at> USB: visor add ACER S10 palm device id

modprobe visor vendor=0x502 product=0x1
is said to work, plus there are patch instructions for it.
fixes http://bugs.debian.org/340547
see http://www.chinaitpower.com/A/2004-07-28/87909.html

Signed-off-by: Maximilian Attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9a64f251326154dcd40b21a6980fe2ab9537dde7 09-Jul-2007 Alan Cox <alan@lxorguk.ukuu.org.uk> USB: visor and whiteheat: remove bogus termios change checks

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
38e8c910ff7a1aafe2923f085df0f74a60f9de3c 16-Jun-2007 Greg Kroah-Hartman <gregkh@suse.de> USB: serial: visor: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4d0dce3e0b794942407391c52f8dd2760802f391 12-Jun-2007 Greg Kroah-Hartman <gregkh@suse.de> USB: fix up license wording on some of my usb-serial drivers

Also update the copyright date on the pl2303 driver, as it was out of date.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
b308e74d9c708ee2a9af14fbe235e0a41216f4ed 07-May-2007 Oliver Neukum <oneukum@suse.de> USB: visor driver adapted to new tty buffering

the new tty buffering code allows usb drivers to stop private buffering.
In fact we must do so to allow flushing to work correctly. This does so
for the visor driver.


Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
b80349b17c6e1236a24616f71e59ed31279de25a 23-Mar-2007 Oliver Neukum <oneukum@suse.de> USB: fix race in visor_write

this fixes a small race in visor_write.


Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9da88d78bcb5610a4bb9e0e10dfb31cc9b4fdb1b 26-Jan-2007 Greg Kroah-Hartman <gregkh@suse.de> USB: remove duplicate device id from visor

As pointed out by Kay Sievers <kay.sievers@suse.de>

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d9b1b787736852f462dbf277b3ca708cbbf693ae 17-Dec-2006 Johannes Hölzl <johannes.hoelzl@gmx.de> USB serial: add driver pointer to all usb-serial drivers

Every usb serial driver should have a pointer to the corresponding usb driver.
So the usb serial core can add a new id not only to the usb serial driver, but
also to the usb driver.

Also the usb drivers of ark3116, mos7720 and mos7840 missed the flag
no_dynamic_id=1. This is added now.

Signed-off-by: Johannes Hölzl <johannes.hoelzl@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
606d099cdd1080bbb50ea50dc52d98252f8f10a1 08-Dec-2006 Alan Cox <alan@lxorguk.ukuu.org.uk> [PATCH] tty: switch to ktermios

This is the grungy swap all the occurrences in the right places patch that
goes with the updates. At this point we have the same functionality as
before (except that sgttyb() returns speeds not zero) and are ready to
begin turning new stuff on providing nobody reports lots of bugs

If you are a tty driver author converting an out of tree driver the only
impact should be termios->ktermios name changes for the speed/property
setting functions from your upper layers.

If you are implementing your own TCGETS function before then your driver
was broken already and its about to get a whole lot more painful for you so
please fix it 8)

Also fill in c_ispeed/ospeed on init for most devices, although the current
code will do this for you anyway but I'd like eventually to lose that extra
paranoia

[akpm@osdl.org: bluetooth fix]
[mp3@de.ibm.com: sclp fix]
[mp3@de.ibm.com: warning fix for tty3270]
[hugh@veritas.com: fix tty_ioctl powerpc build]
[jdike@addtoit.com: uml: fix ->set_termios declaration]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Acked-by: Peter Oberparleiter <oberpar@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
bcb54a54033ff9359cf64e4283e4f4b92bf9132f 08-Nov-2006 Mariusz Kozlowski <m.kozlowski@tuxland.pl> usb: visor kill urb cleanup

- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7d12e780e003f93433d49ce78cfedf4b4c52adc5 05-Oct-2006 David Howells <dhowells@redhat.com> IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
a969888ce91673c7f4b86520d851a6f0d5a5fa7d 12-Jul-2006 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB: move usb-serial.h to include/linux/usb/

USB serial outside of the kernel tree can not build properly due to
usb-serial.h being buried down in the source tree. This patch moves the
location of the file to include/linux/usb and fixes up all of the usb
serial drivers to handle the move properly.

Cc: Sergei Organov <osv@javad.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
00d6058ac93048b525b86fa48b413dcb87ac2728 26-Jun-2006 Ian Abbott <abbotti@mev.co.uk> [PATCH] USB serial visor: fix race in open/close

The anti user-DoS mechanism in the USB serial 'visor' driver can fail in
the following way:

visor_open: priv->outstanding_urbs = 0
visor_write: ++priv->outstanding_urbs
visor_close:
visor_open: priv->outstanding_urbs = 0
visor_write_bulk_callback: --priv->outstanding_urbs

So priv->outstanding_urbs ends up as (unsigned long)(-1). Not good!

I haven't seen this happen with the visor driver as I don't have the
hardware, but I have seen it while testing a patch to implement the same
functionality in the ftdi_sio driver (patch not yet submitted).

The fix is pretty simple: don't reinitialize outstanding_urbs in
visor_open. (Again, I haven't tested the fix in visor, but I have
tested it in ftdi_sio.)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bd97c4f035b47c1a3ae5cc5ceccdda028b25e9d5 22-Jun-2006 Pete Zaitcev <zaitcev@redhat.com> [PATCH] USB: fix visor leaks

This patch fixes blatant leaks in visor driver and makes it report
mode sensible things in ->write_room (this is only needed if your visor
is a terminal though).

It is made to fit into 80 columns with a temporary variable.
Might even save a few instructions...

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
cf2c7481d2ff7f0c266de873b2fe93883e9782f9 23-May-2006 Pete Zaitcev <zaitcev@redhat.com> [PATCH] USB serial: encapsulate schedule_work, remove double-calling

I'm going to throw schedule_work away, it's retarded. But for starters,
let's have it encapsulated.

Also, generic and whiteheat were both calling usb_serial_port_softint
and scheduled work. Only one was necessary.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
80b6ca48321974a6566a1c9048ba34f60420bca6 27-Feb-2006 Eric Sesterhenn <snakebyte@gmx.de> [PATCH] USB: kzalloc() conversion for rest of drivers/usb

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
04d52461c6ecfc5b72e688b0eb2ead7b555eca25 19-Feb-2006 Hendrik Schweppe <hendrik@somehost.de> [PATCH] USB: visor.c id for gspda smartphone

Added the USB vendorID of GSPDA and the productID of GSPDA's palm
smartphone 'xplore m68' to the list of known devices.

Signed-off-by: Hendrik Schweppe <linuxkpatch@hendrik.fam-schweppe.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
33f0f88f1c51ae5c2d593d26960c760ea154c2e2 10-Jan-2006 Alan Cox <alan@lxorguk.ukuu.org.uk> [PATCH] TTY layer buffering revamp

The API and code have been through various bits of initial review by
serial driver people but they definitely need to live somewhere for a
while so the unconverted drivers can get knocked into shape, existing
drivers that have been updated can be better tuned and bugs whacked out.

This replaces the tty flip buffers with kmalloc objects in rings. In the
normal situation for an IRQ driven serial port at typical speeds the
behaviour is pretty much the same, two buffers end up allocated and the
kernel cycles between them as before.

When there are delays or at high speed we now behave far better as the
buffer pool can grow a bit rather than lose characters. This also means
that we can operate at higher speeds reliably.

For drivers that receive characters in blocks (DMA based, USB and
especially virtualisation) the layer allows a lot of driver specific
code that works around the tty layer with private secondary queues to be
removed. The IBM folks need this sort of layer, the smart serial port
people do, the virtualisers do (because a virtualised tty typically
operates at infinite speed rather than emulating 9600 baud).

Finally many drivers had invalid and unsafe attempts to avoid buffer
overflows by directly invoking tty methods extracted out of the innards
of work queue structs. These are no longer needed and all go away. That
fixes various random hangs with serial ports on overflow.

The other change in here is to optimise the receive_room path that is
used by some callers. It turns out that only one ldisc uses receive room
except asa constant and it updates it far far less than the value is
read. We thus make it a variable not a function call.

I expect the code to contain bugs due to the size alone but I'll be
watching and squashing them and feeding out new patches as it goes.

Because the buffers now dynamically expand you should only run out of
buffering when the kernel runs out of memory for real. That means a lot of
the horrible hacks high performance drivers used to do just aren't needed any
more.

Description:

tty_insert_flip_char is an old API and continues to work as before, as does
tty_flip_buffer_push() [this is why many drivers dont need modification]. It
does now also return the number of chars inserted

There are also

tty_buffer_request_room(tty, len)

which asks for a buffer block of the length requested and returns the space
found. This improves efficiency with hardware that knows how much to
transfer.

and tty_insert_flip_string_flags(tty, str, flags, len)

to insert a string of characters and flags

For a smart interface the usual code is

len = tty_request_buffer_room(tty, amount_hardware_says);
tty_insert_flip_string(tty, buffer_from_card, len);

More description!

At the moment tty buffers are attached directly to the tty. This is causing a
lot of the problems related to tty layer locking, also problems at high speed
and also with bursty data (such as occurs in virtualised environments)

I'm working on ripping out the flip buffers and replacing them with a pool of
dynamically allocated buffers. This allows both for old style "byte I/O"
devices and also helps virtualisation and smart devices where large blocks of
data suddenely materialise and need storing.

So far so good. Lots of drivers reference tty->flip.*. Several of them also
call directly and unsafely into function pointers it provides. This will all
break. Most drivers can use tty_insert_flip_char which can be kept as an API
but others need more.

At the moment I've added the following interfaces, if people think more will
be needed now is a good time to say

int tty_buffer_request_room(tty, size)

Try and ensure at least size bytes are available, returns actual room (may be
zero). At the moment it just uses the flipbuf space but that will change.
Repeated calls without characters being added are not cumulative. (ie if you
call it with 1, 1, 1, and then 4 you'll have four characters of space. The
other functions will also try and grow buffers in future but this will be a
more efficient way when you know block sizes.

int tty_insert_flip_char(tty, ch, flag)

As before insert a character if there is room. Now returns 1 for success, 0
for failure.

int tty_insert_flip_string(tty, str, len)

Insert a block of non error characters. Returns the number inserted.

int tty_prepare_flip_string(tty, strptr, len)

Adjust the buffer to allow len characters to be added. Returns a buffer
pointer in strptr and the length available. This allows for hardware that
needs to use functions like insl or mencpy_fromio.

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: John Hawkes <hawkes@sgi.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
75318d2d7cab77b14c5d3dbd5e69f2680a769e16 21-Nov-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB: remove .owner field from struct usb_driver

It is no longer needed, so let's remove it, saving a bit of memory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ba9dc657af86d05d2971633e57d1f6f94ed60472 16-Nov-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB: allow usb drivers to disable dynamic ids

This lets drivers, like the usb-serial ones, disable the ability to add
ids from sysfs.

The usb-serial drivers are "odd" in that they are really usb-serial bus
drivers, not usb bus drivers, so the dynamic id logic will have to go
into the usb-serial bus core for those drivers to get that ability.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17a882fc0c91477b2582a6dfd4ca93ae7eb58cd3 21-Jun-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB Serial: remove driver version from a few drivers

These numbers are pointless, as they have not been changed in _years_,
so we should just remove them to stop pretending there is an actual
"version number" for these drivers.

This should also help reduce confusion when people try to ask for
support of a specific driver version, as there has been no way to tell
what they are talking about.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
269bda1c123c7caf88e1deb2264f9086f0344192 21-Jun-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB Serial: move name to driver structure

This fixes up a lot of problems in sysfs with some of the usb serial
drivers, they had incorrect driver names. Also saves a tiny ammount
of memory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
502b95c1cc9e2c855a26f90fc999c5211b8ba957 21-Jun-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB Serial: move old changelog comments out of source code

Create a new file just for these things, as they just get in the
way in the source files.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18fcac353fdc7cd072b0d24c8667042e675a4c11 21-Jun-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB Serial: get rid of the .owner field in usb_serial_driver

Don't duplicate something that's already in struct driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ea65370d025f5005649e5cb37c4d025e92c6fc38 21-Jun-2005 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] USB Serial: rename usb_serial_device_type to usb_serial_driver

I'm tired of trying to explain why a "device_type" is really a driver.
This better describes exactly what this structure is.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
115c1ce524869309e4bddcfc3dd112ac76b92def 19-Apr-2005 Larry Battraw <lbattraw@insightbb.com> [PATCH] USB: visor Tapwave Zodiac support patch

Here's a tiny patch to add support for the Tapwave Zodiac (for
2.6.11.6). I've been meaning to send it in for a while but kept
upgrading my kernel and losing the changes :-) I own the device and it
works fine with the latest pilot-link beta.

From: Larry Battraw <lbattraw@insightbb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ac21e9ff08db3d6fac41d356c77fcb531c2e03e1 19-Apr-2005 gregkh@suse.de <gregkh@suse.de> [PATCH] USB: add new visor id for Treo 650

Thanks to Jamieson Becker <jamie@jamiebecker.com> for the info

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

diff -Naur -X dontdiff-osdl tmp/linux-2.6.12-rc2/drivers/usb/serial/visor.h linux-2.6/drivers/usb/serial/visor.h
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!