/*
* USB Serial Converter driver
*
* Copyright (C) 1999 - 2004 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (C) 2000 Peter Berger (pberger@brimson.com)
* Copyright (C) 2000 Al Borchers (borchers@steinerpoint.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
* This driver was originally based on the ACM driver by Armin Fuerst (which was
* based on a driver by Brad Keryan)
*
* See Documentation/usb/usb-serial.txt for more information on using this driver
*
* (12/10/2002) gkh
* Split the ports off into their own struct device, and added a
* usb-serial bus driver.
*
* (11/19/2002) gkh
* removed a few #ifdefs for the generic code and cleaned up the failure
* logic in initialization.
*
* (10/02/2002) gkh
* moved the console code to console.c and out of this file.
*
* (06/05/2002) gkh
* moved location of startup() call in serial_probe() until after all
* of the port information and endpoints are initialized. This makes
* things easier for some drivers.
*
* (04/10/2002) gkh
* added serial_read_proc function which creates a
* /proc/tty/driver/usb-serial file.
*
* (03/27/2002) gkh
* Got USB serial console code working properly and merged into the main
* version of the tree. Thanks to Randy Dunlap for the initial version
* of this code, and for pushing me to finish it up.
* The USB serial console works with any usb serial driver device.
*
* (03/21/2002) gkh
* Moved all manipulation of port->open_count into the core. Now the
* individual driver's open and close functions are called only when the
* first open() and last close() is called. Making the drivers a bit
* smaller and simpler.
* Fixed a bug if a driver didn't have the owner field set.
*
* (02/26/2002) gkh
* Moved all locking into the main serial_* functions, instead of having
* the individual drivers have to grab the port semaphore. This should
* reduce races.
* Reworked the MOD_INC logic a bit to always increment and decrement, even
* if the generic driver is being used.
*
* (10/10/2001) gkh
* usb_serial_disconnect() now sets the serial->dev pointer is to NULL to
* help prevent child drivers from accessing the device since it is now
* gone.
*
* (09/13/2001) gkh
* Moved generic driver initialize after we have registered with the USB
* core. Thanks to Randy Dunlap for pointing this problem out.
*
* (07/03/2001) gkh
* Fixed module paramater size. Thanks to John Brockmeyer for the pointer.
* Fixed vendor and product getting defined through the MODULE_PARM macro
* if the Generic driver wasn't compiled in.
* Fixed problem with generic_shutdown() not being called for drivers that
* don't have a shutdown() function.
*
* (06/06/2001) gkh
* added evil hack that is needed for the prolific pl2303 device due to the
* crazy way its endpoints are set up.
*
* (05/30/2001) gkh
* switched from using spinlock to a semaphore, which fixes lots of problems.
*
* (04/08/2001) gb
* Identify version on module load.
*
* 2001_02_05 gkh
* Fixed buffer overflows bug with the generic serial driver. Thanks to
* Todd Squires <squirest@ct0.com> for fixing this.
*
* (01/10/2001) gkh
* Fixed bug where the generic serial adaptor grabbed _any_ device that was
* offered to it.
*
* (12/12/2000) gkh
* Removed MOD_INC and MOD_DEC from poll and disconnect functions, and
* moved them to the serial_open and serial_close functions.
* Also fixed bug with there not being a MOD_DEC for the generic driver
* (thanks to Gary Brubaker for finding this.)
*
* (11/29/2000) gkh
* Small NULL pointer initialization cleanup which saves a bit of disk image
*
* (11/01/2000) Adam J. Richter
* instead of using idVendor/idProduct pairs, usb serial drivers
* now identify their hardware interest with usb_device_id tables,
* which they usually have anyhow for use with MODULE_DEVICE_TABLE.
*
* (10/05/2000) gkh
* Fixed bug with urb->dev not being set properly, now that the usb
* core needs it.
*
* (09/11/2000) gkh
* Removed DEBUG #ifdefs with call to usb_serial_debug_da