aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/class
AgeCommit message (Collapse)AuthorFilesLines
2008-07-21USB: fix disconnect bug in cdc-acmOliver Neukum1-13/+15
cdc-acm must give up secondary interfaces if the primary is disconnected and vice versa. This wasn't done correctly. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-07-21USB: autosuspend for cdc-wdmOliver Neukum1-6/+101
this patch implements - suspend/resume - aggressive autosuspend for the cdc-wdm driver - pre/post_reset Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-07-21USB: additional power savings for cdc-acm devices that support remote wakeupOliver Neukum2-21/+126
this patch saves power for cdc-acm devices that support remote wakeup while the device is connected. - request needs_remote_wakeup when needed - delayed write while a device is autoresumed - the device is marked busy when appropriate Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-07-21USB: cdc-wdm cleanupOliver Neukum1-6/+10
- fixes an error with filling out control requests - increases grepability and error logging - fixes the short read code path Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-07-03USB: fix cdc-acm resume()Oliver Neukum1-3/+0
cdc-acm has - a memory leak in resume() - will fail to reactivate the read code path if this is needed. his corrects it by deleting the useless relict code. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-06-04cdc-wdm endianness fixesAl Viro1-2/+2
* wMaxPacketSize is le16; copying it to a field of local structure and then using that field as host-endian (size of object to be allocated) is broken. * bMaxPacketSize0 is 8-bit; feeding it to le16_to_cpu() is bogus and since the result is used as host-endian, it's not even misspelled cpu_to_le16(). Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-05-20USB: CDC WDM driverOliver Neukum3-0/+752
Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-05-14USB: add Zoom Telephonics Model 3095F V.92 USB Mini External modem to cdc-acmIain McFarlane1-0/+3
The patch below is a necessary workaround to support the Zoom Telephonics Model 3095F V.92 USB Mini External modem, which fails to initialise properly during normal probing thus: May 3 22:53:00 imcfarla kernel: drivers/usb/class/cdc-acm.c: Zero length descriptor references May 3 22:53:00 imcfarla kernel: cdc_acm: probe of 5-2:1.0 failed with error -22 Adding the patch below causes the probing section to be skipped, and the modem then initialises correctly. Signed-off-by: Iain McFarlane <[email protected]> Acked-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-29usb: use get/put_unaligned_* helpersHarvey Harrison1-1/+1
Signed-off-by: Harvey Harrison <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Cc: Alan Stern <[email protected]> Cc: David Brownell <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-24USB: remove unnecessary type casting of urb->contextMing Lei1-1/+1
urb->context code cleanup Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: replace remaining __FUNCTION__ occurrencesHarvey Harrison1-3/+3
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: cdc-acm: signedness fixDavid Brownell1-3/+7
Fix bogus assignment of "unsigned char *" to "char *": preserve unsignedness. These values are used directly as descriptor lengths when iterating through the buffer, so this *could* cause oddness that potentially includes oopsing. (IMO not likely, except as part of a malicious device...) Fix the bogus warning in CDC ACM which highlighted this problem (by showing a negative descriptor type). It uses the undesirable legacy err() for something that's not even an error; switch to use dev_dbg, and show descriptor types in hex notation to match the convention for such codes. Signed-off-by: David Brownell <[email protected]> Acked-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: increase cdc-acm write throughputDavid Engraf2-43/+45
the following patch uses 16 write urbs and a writsize of wMaxPacketSize * 20. With this patch I get the maximum througput from my linux system with 20MB/sec read and 15 MB/sec write (full speed 1 MB/sec both) I also deleted the flag URB_NO_FSBR for the writeurbs, because this makes my full speed devices significant slower. Signed-off-by: David Engraf <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: cdc-acm tell tty layer not to split things up.David Engraf1-0/+1
It ensures that the tty level do not split the send buffer into 2KB blocks. Signed-off-by: David Engraf <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-02-21USB: fix usb open suspend race in cdc-acmOliver Neukum1-5/+5
this fixes a race between open and disconnect in the CDC ACM driver. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-02-21USB: fix pm counter leak in usblpOliver Neukum1-0/+1
if you fail in open() you must decrement the pm counter again. Signed-off-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Signed-off-by: Pete Zaitcev <[email protected]>
2008-02-01USB: Spelling fixesJoe Perches1-1/+1
Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-02-01USB: autosuspend for cdc-acmOliver Neukum2-15/+79
Here we go. This patch implements suspend/resume and autosuspend for the CDC ACM driver. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-18Add missing newlines to some uses of dev_<level> messagesJoe Perches1-17/+17
Found these while looking at printk uses. Add missing newlines to dev_<level> uses Add missing KERN_<level> prefixes to multiline dev_<level>s Fixed a wierd->weird spelling typo Added a newline to a printk Signed-off-by: Joe Perches <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Mark M. Hoffman <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Tilman Schmidt <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Greg KH <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: David Brownell <[email protected]> Cc: James Smart <[email protected]> Cc: Andrew Vasquez <[email protected]> Cc: "Antonino A. Daplas" <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Cc: Russell King <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-12usblp: Fix a double kfreePete Zaitcev1-12/+23
If submit fails, slab hits a BUG() because of a double kfree. The today's lesson is, you cannot just slap USB_FREE_BUFFER on code without adjusting the error paths. The patch is made bigger by opportunistic refactoring. Signed-Off-By: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-12usblp: CosmeticsPete Zaitcev1-4/+5
This is a small bunch of cosmetic fixes: - Timeout is not a write timeout anymore, rename - Condition in poll was confusingly backwards, invert and simplify - The comment log gave a wrong impression of version 0.13, terminate it. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-12usblp: mutex in usblp_check_statusPete Zaitcev1-3/+4
Add a mutex to protect the ->statusbuf. Not really an issue, because CUPS is single-threaded when it talks to the printer, but I feel safer this way. This should be deadlock-free, but I kept this as a separate patch in case someone ends running a git bisect. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-12usblp: Make use of URB_FREE_BUFFERPete Zaitcev1-3/+1
Employ the new API URB_FREE_BUFFER that we've got. There was talk of a combined constructor for this case, but apparently it's not happening, so just set the flag explicitly for now. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-12usblp: Implement the ENOSPC conventionPete Zaitcev1-26/+39
This patch implements a mode when a printer returns ENOSPC when it runs out of paper. The default remains the same as before. An application which wishes to use this function has to enable it explicitly with an ioctl LPABORT. This is done on a request by our (Fedora) CUPS guy, Tim Waugh. The API is similar enough to the lp0's one that CUPS works with both (but see below), but it's has some differences. Most importantly, the abort mode is persistent in case of lp0: once tunelp was run your cat fill blow up until you reboot or run tunelp again. For usblp, I made it so the abort mode is only in effect as long as device is open. This way you can mix and match CUPS and cat(1) freely and nothing bad happens even if you run out of paper. It is also safer in the face of any unexpected crashes. It has to be noted that mixing LPABORT and O_NONBLOCK is not advised. It probably does not do what you want: instead of returning -ENOSPC it will always return -EAGAIN (because it would otherwise block while waiting for the paper). Applications which use O_NONBLOCK should continue to use LPGETSTATUS like before. Finally, CUPS actually requires patching to take full advantage of this. It has several components; those which invoke LPABORT work, but some of them need the ioctl added. This is completely compatible, you can mix old CUPS and new kernels or vice versa. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-08-22USB: cdc-acm: fix sysfs attribute registration bugAlan Stern1-3/+9
This patch (as950) fixes a bug in the cdc-acm driver. It doesn't keep track of which interface (control or data) the sysfs attributes get registered for, and as a result, during disconnect it will sometimes attempt to remove the attributes from the wrong interface. The left-over attributes can cause a crash later on, particularly if the driver module has been unloaded. Signed-off-by: Alan Stern <[email protected]> Acked-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-07-19USB: class: usblp: clean up urb->status usageGreg Kroah-Hartman1-8/+10
This done in anticipation of removal of urb->status, which will make that patch easier to review and apply in the future. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-07-19USB: class: cdc-acm: clean up urb->status usageGreg Kroah-Hartman1-8/+10
This done in anticipation of removal of urb->status, which will make that patch easier to review and apply in the future. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-07-19USB: usblp: "Big cleanup" breaks O_NONBLOCKPete Zaitcev1-4/+5
I found the first regresson in the rewritten ("all dynamic" and "no races") driver. If application uses O_NONBLOCK, I return -EAGAIN despite the URB being submitted successfuly. This causes the application to resubmit the same data erroneously. The fix is to pretend that the transfer has succeeded even if URB was merely queued. It is the same behaviour as with the old version. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-07-12USB: cdc-acm: add new device id to option driverAndrey Arapov1-0/+3
USB: add new device id to option driver device is Samsung X180 China cellphone Signed-off-by: Andrey Arapov <[email protected]> Acked-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-07-12USB: usblp: add dynamic URBs, fix racesPete Zaitcev1-242/+376
This patch's main bulk aims to make usblp the premier driver for code pillaging once again. The code is as streamlined as possible and is bug-free as possible. The usb-skeleton performs the same function, but is somewhat abstract. The usblp is usb-skeleton which is actually used by many. Since I combed a few small bugs away, this also fixes the small races we had in usblp for a while. For example, now it's possible for several threads to make write(2) calls (sounds silly, but consider a printer for paper record, where every line of text is self-contained and thus it's all right to have them interleaved). Also gone are issues with interrupts using barriers dangerously. This patch makes use of Oliver's anchor, and so it must trail the anchor patch on the way to Linus. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-06-08usblp: Don't let suspend to kill ->usedPete Zaitcev1-3/+2
Suspend destroys refcounting for open/release. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-05-22USB: usblp: Use correct DMA address in case of probe errorPete Zaitcev1-1/+1
Looks like the error path had a copy-paste error. The normal exit path uses correct URB already. Signed-off-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap2-2/+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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-04-27USB: cdc-acm: export parsed capabilities through sysfsOliver Neukum2-5/+79
this patch exports the attributes cdc-acm knows about a device through sysfs. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-03-19usblp: quirk flag and device entry for Seiko Epson M129C printerAlan Stern1-1/+5
This patch (as872) adds a device table entry and a new quirk flag to the usblp driver for the Seiko Epson Receipt printer. This printer returns Vendor-Specific values for bInterfaceClass and bInterfaceSubClass, but the bInterfaceProtocol value is valid and it works with usblp. The new quirks flag tells the driver to ignore the Class and SubClass values in the interface descriptor. Signed-off-by: Alan Stern <[email protected]> Cc: Vojtech Pavlik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-03-09USB: fix spinlock recursion in cdc-acm.cOliver Neukum1-4/+4
this fixes the spinlock recursion issue. The older fix was incomplete. Signed-off-by: Oliver Neukum <[email protected]> Acked-by: Pete Zaitcev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: quirky device for cdc-acmOliver Neukum1-0/+4
here's a quirklist entry reported by Stephen Murphy. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-16USB: cdc-acm: fix incorrect throtteling, make set_control optionalOliver Neukum1-11/+18
this is Joris' fixes reshuffelled and features renamed as David requested. - acm_set_control is not mandatory, honour that - throtteling is reset upon open - throtteling is read consistently when processing input data Signed-off-by: Joris van Rantwijk <[email protected]> Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-02-07USB: autosuspend for usb printer driverOliver Neukum1-11/+5
this implements autosuspend for usb printers. It compiles and is tested. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-01-05USB: usblp.c - add Kyocera Mita FS 820 to list of "quirky" printersMartin Williges1-0/+1
This patch gets the Kyocera FS-820 working with cups 1.2 via usb again. It adds the printer to the list of "quirky" printers. The printer seems not answer to ID requests some seconds after plugging in. Patch is based on linux-2.6.19.1. Background: As far as I could see (strace, usbmon), the Kyocera FS-820 answers to ID requests only a few seconds after plugging it in. This applies to detecting it with cups and is also true for the printing itself, which is initiated with an ID request. Since I have little usb knowledge, maybe someone can interpret the data, especially the fist bulk transfer - why request 8192 bytes? This is the second version of the patch. usbmon output of printing an email without patch: tail -F /tmp/printlog.txt c636e140 3374734463 S Bi:002:02 -115 8192 < c9d43b40 3374734494 S Ci:002:00 s a1 00 0000 0000 03ff 1023 < c9d43b40 3379732301 C Ci:002:00 -104 0 c636e140 3379733294 C Bi:002:02 -2 0 [...repeating...] with patch: tail -F /tmp/printlog.txt d9cb82c0 3729790131 S Ci:002:00 s a1 00 0000 0000 03ff 1023 < d9cb82c0 3729791725 C Ci:002:00 0 91 = 005b4944 3a46532d 3832303b 4d46473a 4b796f63 6572613b 434d443a 50434c58 df956320 3732493190 S Bo:002:01 -115 1347 = 1b252d31 32333435 5840504a 4c0a4050 4a4c2053 4554204d 414e5541 4c464545 [...more data...] Signed-off-by: Martin Williges <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-20USB: mutexification of usblpOliver Neukum1-25/+29
this patch: - converts usblp fully to mutex - makes sleeping interruptible where EINTR can be returned anyway Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-08[PATCH] tty: switch to ktermiosAlan Cox1-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 [[email protected]: bluetooth fix] [[email protected]: sclp fix] [[email protected]: warning fix for tty3270] [[email protected]: fix tty_ioctl powerpc build] [[email protected]: uml: fix ->set_termios declaration] Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Martin Peschke <[email protected]> Acked-by: Peter Oberparleiter <[email protected]> Cc: Cornelia Huck <[email protected]> Signed-off-by: Hugh Dickins <[email protected]> Signed-off-by: Jeff Dike <[email protected]> Cc: Paolo 'Blaisorblade' Giarrusso <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-05Merge branch 'master' of ↵David Howells1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: drivers/infiniband/core/iwcm.c drivers/net/chelsio/cxgb2.c drivers/net/wireless/bcm43xx/bcm43xx_main.c drivers/net/wireless/prism54/islpci_eth.c drivers/usb/core/hub.h drivers/usb/input/hid-core.c net/core/netpoll.c Fix up merge failures with Linus's head and fix new compilation failures. Signed-Off-By: David Howells <[email protected]>
2006-12-01USB: cdc-acm: Use usb_endpoint_* functionsLuiz Fernando N. Capitulino1-1/+1
Signed-off-by: Luiz Fernando N. Capitulino <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-11-22WorkStruct: make allyesconfigDavid Howells1-3/+3
Fix up for make allyesconfig. Signed-Off-By: David Howells <[email protected]>
2006-11-03USB: usblp: fix system suspend for some systemsOliver Neukum1-2/+0
this has been confirmed to fix suspend problems with usblp. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-11-03USB: failure in usblp's error pathOliver Neukum1-0/+1
if urb submission fails due to a transient error here eg. ENOMEM , the driver is dead. This fixes it. Regards Oliver Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-10-17USB: fix suspend support for usblpOliver Neukum1-8/+71
this implements suspend support for usblp. According to the CUPS people ENODEV will make CUPS retry the job. Thus it is returned in the runtime case. My printer survives suspend/resume cycles with it. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Vojtech Pavlik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-10-17USB: fix cdc-acm problems with hard irq? (inconsistent lock state)Jarek Poplawski1-13/+13
Signed-off-by: Jarek Poplawski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-10-17USB: Support for BT On-Air USB modem in cdc-acm.cChris Malley1-0/+3
The patch below is a necessary workaround to support the BT On-Air USB modem, which fails to initialise properly during normal probing thus: Sep 30 17:34:57 sled kernel: drivers/usb/class/cdc-acm.c: Zero length descriptor references Sep 30 17:34:57 sled kernel: cdc_acm: probe of 1-1.2:1.0 failed with error -22 Adding the patch below causes the probing section to be skipped, and the modem then initialises correctly. Signed-off-by: Chris Malley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>