summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/serial.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: gadget serial: don't shift bcd version left by 16Sebastian Andrzej Siewior2012-09-101-1/+1
| | | | | | | | | | | | | Fengguang Wu reported: |drivers/usb/gadget/serial.c:89:22: sparse: cast truncates bits from |constant value (24000000 becomes 0) I obviously let the version number shift away. Since the version is a 16bit number it can be applied as it. Cc: fengguang.wu@intel.com Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: remove usb_gadget_controller_number()Sebastian Andrzej Siewior2012-09-101-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bcdDevice field is defined as |Device release number in binary-coded decimal in the USB 2.0 specification. We use this field to distinguish the UDCs from each other. In theory this could be used on the host side to apply certain quirks if the "special" UDC in combination with this gadget is used. This hasn't been done as far as I am aware. In practice it would be better to fix the UDC driver before shipping since a later release might not need this quirk anymore. There are some driver in tree (on the host side) which use the bcdDevice field to figure out special workarounds for a given firmware revision. This seems to make sense. Therefore this patch converts all gadgets (except a few) to use the kernel version instead a random 2 or 3 plus the UDC number. The few that don't report kernel's version are: - webcam This one reports always a version 0x10 so allow it to do so in future. - nokia This one reports always 0x211. The comment says that this gadget works only if the UDC supports altsettings so I added a check for this. - serial This one reports 0x2400 + UDC number. Since the gadget version is 2.4 this could make sense. Therefore bcdDevice is 0x2400 here. I also remove various gadget_is_<name> macros which are unused. The remaining few macros should be moved to feature / bug bitfield. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: libcomposite: move composite.c into libcompositeSebastian Andrzej Siewior2012-09-101-2/+0
| | | | | | | | | This moves composite.c into libcomposite and updates all gadgets. Finally! Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: Provide a default implementation of default manufacturer stringSebastian Andrzej Siewior2012-09-101-8/+1
| | | | | | | | | | | | | | | | | Some gadgets provide custom entry here. Some may override it with an etntry that is also created by composite if there was no value sumbitted at all. This patch removes all "custom manufacturer" strings which are the same as these which are created by composite. Then it moves the creation of the default manufacturer string to usb_composite_overwrite_options() in case no command line argument has been used and the entry is still an empty string. By doing this we get rid of the global variable "composite_manufacturer" in composite. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: make sure each gadget is using same index for Product, Serial,…Sebastian Andrzej Siewior2012-09-101-7/+6
| | | | | | | | | | | | | | The index in usb_string array is defined by the gadget. The gadget can choose which index entry it assigns for the serial number and which the product name. The gadget has just to ensure that the descriptor contains the proper string id which is assigned by composite. If the composite layer knows the index of the "default" information which will be overwritten by module parameters, it can be used later to overwrite it. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: push VID/PID/USB BCD module option into gadgetsSebastian Andrzej Siewior2012-09-101-0/+2
| | | | | | | | | | | This patch moves the module options idVendor, idProduct and bcdDevice from composite.c into each gadgets. This ensures compatibility with current gadgets and removes the global variable which brings me step closer towards composite.c in libcomposite Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: use usb_string_ids_tab instead multiple usb_string_id()Sebastian Andrzej Siewior2012-09-101-18/+4
| | | | | | | | | Using usb_string_ids_tab() instead multiple calls of usb_string_id() seems to be handy. It also allows to add string without many checks. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: libcomposite: add epautoconf.c to libcompositeSebastian Andrzej Siewior2012-09-101-1/+0
| | | | | | | | This patch adds epautoconf.c into libcomposite and updates all gadgets. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: libcomposite: move config.c into libcompositeSebastian Andrzej Siewior2012-09-101-1/+0
| | | | | | | | This patch moves config.c into libcomposite and updates all gadgets. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: start with libcompositeSebastian Andrzej Siewior2012-09-101-1/+0
| | | | | | | | | | This patch aims to be simple. It removes #include usbstribgs.c line from each gadget and creates libcomposite.ko which has only one member, that is usbstribgs.c. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: move bind() callback back to struct usb_composite_driverSebastian Andrzej Siewior2012-09-101-1/+2
| | | | | | | | | | | This partly reverts 07a18bd7 ("usb gadget: don't save bind callback in struct usb_composite_driver") and fixes new drivers. The section missmatch problems was solved by whitelisting structs in question via __ref. Cc: devel@driverdev.osuosl.org Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: push all usb_composite_driver structs into __refdataSebastian Andrzej Siewior2012-09-101-1/+1
| | | | | | | | | | | | | | As it turns out, Sam's comment was better than I initially assumed. This patch pushes as struct usb_composite_driver data structures into __refdata section to avoid a section missmatch report from modpost because the ->bind() can be marked __init. The only downside is that modpost does not check between ->bind() and other member. However, it is temporary. Cc: Sam Ravnborg <sam@ravnborg.org> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: add usb3.0 descriptors to serial gadgetsSebastian Andrzej Siewior2012-02-091-1/+1
| | | | | | | | | | | | This patch adds SS descriptors to the ACM & generic serial gadget. The ACM part was tested with minicom + dummy + send / receive files over ttyACM <=> ttyGS0. The generic serial part (f_serial) was not tested (haven't found a driver on the host side). The nokia & multi gadget use HS at most. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* module_param: make bool parameters really bool (drivers & misc)Rusty Russell2012-01-131-2/+2
| | | | | | | | | | | | 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>
* usb: gadget: add max_speed to usb_composite_driverTatyana Brokhman2011-07-011-0/+1
| | | | | | | | | | | | | | | This field is used by the Gadget drivers to specify the maximum speed they support, meaning: the maximum speed they can provide descriptors for. The driver speed will be set in consideration of this value. [ balbi@ti.com : dropped the ifdeffery ] Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget: don't save bind callback in struct usb_configurationUwe Kleine-König2010-10-221-2/+2
| | | | | | | | | | | | | The bind function is most of the time only called at init time so there is no need to save a pointer to it in the configuration structure. This fixes many section mismatches reported by modpost. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [m.nazarewicz@samsung.com: updated for -next] Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget: don't save bind callback in struct usb_composite_driverMichal Nazarewicz2010-10-221-2/+1
| | | | | | | | | | | The bind function is most of the time only called at init time so there is no need to save a pointer to it in the composite driver structure. This fixes many section mismatches reported by modpost. Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Revert "USB: gadget: section mismatch warning fixed"Michal Nazarewicz2010-10-221-2/+2
| | | | | | | | | | | | | This reverts a commit which proposed an invalid solution for a section mismatch. Next 3 commits will fix it correctly. Conflicts: drivers/usb/gadget/mass_storage.c Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: section mismatch warning fixedMichal Nazarewicz2010-08-101-2/+2
| | | | | | | | | | | | | In may gadgets bind and bind like functions were in a init section as they were only run during initialisation. However, being callback functions they were referenced from structures in “normal” sections. Changing the tag from “__init” to “__ref” fixes the warnings. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: replace uses of __constant_{endian}Harvey Harrison2009-03-241-6/+6
| | | | | | | | The base versions handle constant folding now. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget: USB_GADGET_VBUS_DRAW Kconfig optionDavid Brownell2008-10-171-1/+0
| | | | | | | | | | | | | | | | | | Offer a "how much VBUS power to request" configuration option for USB gadgets that aren't using board-specific customization of their gadget or (composite) configuration drivers. Also remove a couple pointless "depends on USB_GADGET" bits from the Kconfig text; booleans inside an "if USB_GADGET" will already have that dependency. Based on a patch from Justin Clacherty. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Justin Clacherty <justin@redfish-group.com> Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget: cdc obex glueFelipe Balbi2008-10-171-0/+14
| | | | | | | | | | | | | The following patch introduces a new f_obex.c function driver. It allows userspace obex servers to use usb as transport layer for their messages. [ dbrownell@users.sourceforge.net: various fixes and cleanups ] Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget: link fixes for serial gadgetDavid Brownell2008-10-161-0/+18
| | | | | | | | | | | Change how the serial gadget driver builds: don't use separate compilation, since it works poorly when key parts are library code (with init sections etc). Instead be as close as we can to "gcc --combine ...". Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget serial: use composite gadget frameworkDavid Brownell2008-07-211-928/+145
| | | | | | | | | | This switches the serial gadget over to using the new "function" versions of the serial port interfacing code. The remaining code in the main source file is quite small... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget: use new serial coreDavid Brownell2008-07-211-1316/+76
| | | | | | | | | | | | | | | | | | | | | Teach "gadget serial" to use the new abstracted (and bugfixed) TTY glue, and remove all the orignal tangled-up code. Update the documentation accordingly. This is a net object code shrink and cleanup; it should make it a lot easier to see how the TTY glue should accomodate updates to the TTY layer, be bugfixed, etc. Notable behavior changes include: it can now support getty even when there's no USB connection; it fits properly into the mdev/udev world; and RX handling is better (throttling works, and low latency). Configurations with scripts setting up the /dev/ttygserial device node (with "experimental" major number) may want to change that to be a symlink pointing to the /dev/ttyGS0 file, as a migration aid; else, just switch entirely over to mdev/udev. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial gadget: descriptor cleanupDavid Brownell2008-05-141-4/+2
| | | | | | | | | | | | | | | | | | | Bugfix some serial gadget descriptors: - Stop mangling the low bits (controller type ID) of bcdDevice; just use the high bits for a driver revision code. - Serial numbers that aren't specific to individual devices are useless; stop reporting "0" for this. - Since it's not part of a CDC-conformant function, the "bulk only" configuration shouldn't be using "CDC Data" as its interface class. Switch over to using CLASS_VENDOR_SPEC (different value, 0xff). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial gadget: simplify endpoint handlingDavid Brownell2008-05-141-89/+57
| | | | | | | | | | | | | | Switch serial gadget away from a *very* old idiom: just remember the endpoints we'll be using, instead of looking them up by name each time. This is a net code and data (globals) shrink. Also fix a small memory leak in the rmmod path, by working the same as the disconnect code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial gadget: remove needless data structureDavid Brownell2008-05-141-72/+13
| | | | | | | | | | | | | | | This removes a needless data structure from the serial gadget code; it's a small code shrink, and a larger data shrink. Since "struct usb_request" already has a "struct list_head" reserved for use by gadget drivers, the serial gadget code doesn't need to allocate wrapper structs to hold that list ... it can (and should!) just use the list_head provided for that exact use. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial gadget: cleanup/reorgDavid Brownell2008-05-141-290/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some cleanup/reorg of g_serial ... simplifying it, and disentangling its structure so morphing it into a "function" driver (combinable with other interfaces) should be less painful. - Remove most forward declarations * put tty and gadget driver structs after their contents * snug module init/exit decls next to their functions * reordered some functions - Other cleanup: * convert a funky macro to an inline function * snug up module params next to their declarations * add missing driver.owner * add separator lines between major driver sections - Add comments re potential parameter/#define changes: * only supports one port (shrank GS_NUM_PORTS) * changing from 9600-8-N-1 affects multiple sites - Remove net2280-specific optimization ... it was being done way too late, can be done by net2280 module options, and in any case doesn't matter at any sane serial data rates. There are no behavioral changes, but the macro thing saves I-space. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Al Borchers <alborchers@steinerpoint.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb serial gadget: CDC ACM fixesDavid Brownell2008-05-021-17/+73
| | | | | | | | | | | | | | | | Based on a patch from <Aurel.Thomi@ruag.com>, this makes the CDC-ACM support in the serial gadget handle the SET_LINE_CODING and SET_CONTROL_LINE_STATE requests ... which should improve interop with at least MS-Windows "usbser.sys" if not some other ACM host drivers. It also adds a few REVISIT comments where this code plays a bit loose with the CDC ACM spec. If this were used to hook up to a real RS232 or modem link, those places would need a bit of work. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb gadget: switch to put_char returning intAlan Cox2008-04-301-4/+6
| | | | | | | | Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: gadget: Hangup tty on g_serial disconnectSavin Zlobec2008-04-241-2/+1
| | | | | | | | | | | | | | On USB cable disconnect g_serial doesn't hangup the port tty, which results in an endless read on the tty device. With the following patch the read and select behave correctly when the cable is unplugged. Tested on at91rm9200 Signed-off-by: Savin Zlobec <savin@epiko.si> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget code switches to pr_err() and friendsDavid Brownell2008-02-011-74/+79
| | | | | | | | | | We now have pr_err(), pr_warning(), and friends ... start using them in the gadget stack instead of printk(KERN_ERR) and friends. This gives us shorter lines and somewhat increased readability. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: move <linux/usb_gadget.h> to <linux/usb/gadget.h>David Brownell2007-10-121-1/+1
| | | | | | | | | Move <linux/usb_gadget.h> to <linux/usb/gadget.h>, reducing some of the clutter in the main include directory. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial gadget: Disable endpoints on unloadVitaly Bordug2007-10-121-0/+6
| | | | | | | | | After Serial gadget is being unloaded, neither serial itself, nor other gadget stuff can be loaded subsequently. Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: serial gadget cleanupsDavid Brownell2007-10-121-93/+73
| | | | | | | | | | | | | | | | | | | | | Clean up the serial gadget, using newer APIs and conventions: - gadget_is_dualspeed() and gadget_is_otg() ... #ifdef removal - Remove many now-needless #includes - Use the DEBUG and VERBOSE_DEBUG conventions; turned up a bug in the original debug messaging - Various whitespace fixes. This gave only a minor object code shrinkage, but the source looks much cleaner in various places. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: fix serial gadget ACM breakageDavid Brownell2007-09-111-10/+15
| | | | | | | | | | | | | | Two of the CDC ACM control requests in the serial gadget have never been correct, and have been reported to cause serious troubles ... as in, soft lockup and maybe watchdog reset (depending on hardware). This patch makes those request fail cleanly, rather than misbehaving. Someone using CDC ACM should fix them according to the FIXME comments which now replace the previous bugs. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: use mutex instead of semaphore in the USB gadget serial driverMatthias Kaehlcke2007-07-191-12/+13
| | | | | | | | | | The USB gadget serial driver uses a semaphore as mutex. Use the mutex API instead of the (binary) semaphore. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Acked-by: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* some kmalloc/memset ->kzalloc (tree wide)Yoann Padioleau2007-07-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc). Here is a short excerpt of the semantic patch performing this transformation: @@ type T2; expression x; identifier f,fld; expression E; expression E1,E2; expression e1,e2,e3,y; statement S; @@ x = - kmalloc + kzalloc (E1,E2) ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\) - memset((T2)x,0,E1); @@ expression E1,E2,E3; @@ - kzalloc(E1 * E2,E3) + kcalloc(E1,E2,E3) [akpm@linux-foundation.org: get kcalloc args the right way around] Signed-off-by: Yoann Padioleau <padator@wanadoo.fr> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Acked-by: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <bryan.wu@analog.com> Acked-by: Jiri Slaby <jirislaby@gmail.com> Cc: Dave Airlie <airlied@linux.ie> Acked-by: Roland Dreier <rolandd@cisco.com> Cc: Jiri Kosina <jkosina@suse.cz> Acked-by: Dmitry Torokhov <dtor@mail.ru> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Acked-by: Pierre Ossman <drzeus-list@drzeus.cx> Cc: Jeff Garzik <jeff@garzik.org> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Greg KH <greg@kroah.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: usb serial gadget, sparse fixesDavid Brownell2007-07-121-6/+8
| | | | | | | | | | Fix a few serial gadget issues reported by the latest "sparse": some functions should have been defined as static, not just declared that way. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* header cleaning: don't include smp_lock.h when not usedRandy Dunlap2007-05-081-1/+0
| | | | | | | | | | | | Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: fix g_serial small errorBryan O'Donoghue2007-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | A SET_LINE_CODING control request should return a zero length packet as an ACK to the host, during the status phase of a USB transaction. The return value of gs_setup_class() is treated as the number of bytes to write in the status phase of the control request, by gs_setup(). For this case, the value returned by gs_setup_class should be zero for SET_LINE_CODING but, right now, appears to be sizeof(struct usb_cdc_line_coding). However, if after doing the memcpy of the line coding descriptor we set the variable "ret" to be zero, we should return the appropiate ZLP to the host as an ACK in the status phase of the control request. I've tested this out using Linux as both host and slave and confirmed that the following small change fixes the spurious return of sizeof(struct usb_cdc_line_coding)/wLength bytes in the status phase of a USB_CDC_REQ_SET_LINE_CODING request. It's not a huge bug but, it is worth fixing. Signed-off-by: Bryan O'Donoghue <bodonoghue@codehermit.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] remove many unneeded #includes of sched.hTim Schmielau2007-02-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: <linux/usb_ch9.h> becomes <linux/usb/ch9.h>David Brownell2007-02-071-1/+1
| | | | | | | | | This moves <linux/usb_ch9.h> to <linux/usb/ch9.h> to reduce some of the clutter of usb header files. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget driver unbind() is optional; section fixes; miscDavid Brownell2006-12-201-1/+1
| | | | | | | | | | | | | | | | | | Allow gadget drivers to omit the unbind() method. When they're statically linked, that's an appropriate memory saving tweak. Similarly, provide consistent/simpler handling for a should-not-happen error case: removing a peripheral controller driver when a gadget driver is still loaded. Such code dates back to early versions of the first implementation of the gadget API, and has never been triggered. Includes relevant section annotation fixs for gmidi.c, file_storage.c, and serial.c; we don't yet have an "init or exit" annotation. Also some whitespace fixes in gmidi.c (space at EOL, before tabs, etc). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] getting rid of all casts of k[cmz]alloc() callsRobert P. J. Day2006-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run this: #!/bin/sh for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do echo "De-casting $f..." perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f done And then go through and reinstate those cases where code is casting pointers to non-pointers. And then drop a few hunks which conflicted with outstanding work. Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Greg KH <greg@kroah.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Paul Fulghum <paulkf@microgate.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Karsten Keil <kkeil@suse.de> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Ian Kent <raven@themaw.net> Cc: Steven French <sfrench@us.ibm.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Neil Brown <neilb@cse.unsw.edu.au> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] tty: switch to ktermiosAlan Cox2006-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [PATCH] namespaces: utsname: use init_utsname when appropriateSerge E. Hallyn2006-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | In some places, particularly drivers and __init code, the init utsns is the appropriate one to use. This patch replaces those with a the init_utsname helper. Changes: Removed several uses of init_utsname(). Hope I picked all the right ones in net/ipv4/ipconfig.c. These are now changed to utsname() (the per-process namespace utsname) in the previous patch (2/7) [akpm@osdl.org: CIFS fix] Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Andrey Savochkin <saw@sw.ru> Cc: Serge Hallyn <serue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] const struct tty_operationsJeff Dike2006-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | As part of an SMP cleanliness pass over UML, I consted a bunch of structures in order to not have to document their locking. One of these structures was a struct tty_operations. In order to const it in UML without introducing compiler complaints, the declaration of tty_set_operations needs to be changed, and then all of its callers need to be fixed. This patch declares all struct tty_operations in the tree as const. In all cases, they are static and used only as input to tty_set_operations. As an extra check, I ran an i386 allyesconfig build which produced no extra warnings. 53 drivers are affected. I checked the history of a bunch of them, and in most cases, there have been only a handful of maintenance changes in the last six months. serial_core.c was the busiest one that I looked at. Signed-off-by: Jeff Dike <jdike@addtoit.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* USB: usb serial gadget smp related bugEugeny S. Mints2006-09-271-0/+3
| | | | | | | | | | | | | | | | | | Adjust dev->dev_lock spinlock lock/unlock calls to be safe for SMP case. Otherwise the following sequence may lead to a deadlock in SMP case: gs_send()->usb_ep_queue() ->(in case a request is satisfied immediatly) gs_write_complete() for ex for pxa2xx_udc.c: usb_ep_queue()->pxa2xx_ep_queue()->write_fifo()->done()->gs_write_complete() (through req.complete pointer) Signed-off-by: Eugeny S. Mints <emints@ru.mvista.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud