aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/misc/usbtest.c
AgeCommit message (Collapse)AuthorFilesLines
2013-07-31USB: simplify the interface of usb_get_status()Alan Stern1-5/+4
This patch simplifies the interface presented by usb_get_status(). Instead of forcing callers to check for the proper data length and convert the status value to host byte order, the function will now do these things itself. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-31USB: altsetting overrides for usbtestAlan Stern1-1/+12
The usbtest driver includes some rather simple-minded logic for selecting an altsetting to test. It doesn't work well for the g_zero gadget, because it selects altsetting 0 (which doesn't have isochronous endpoints) rather than altsetting 1 (which does have them, if the gadget's hardware supports them). This prevents usbtest's isochronous tests (15, 16, 22, and 23) from working with g_zero. Since g_zero is one of the most common gadget drivers used for USB testing, usbtest should do a better job of supporting it. But since some programs may rely on the current scheme for selecting altsettings, I didn't want to change it. Instead, this patch (as1655) adds a module parameter to usbtest, which can be used to override the default altsetting. Since usbtest is never used by normal users (most distributions probably don't even build it), the new module parameter won't inconvenience anybody. In any case, it is entirely optional -- leaving it unset preserves the existing behavior. The patch also fixes a related bug in usbtest: After selecting an altsetting, the driver neglects to store its selection. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-07USB: usbtest: fix test number in log messageAlan Stern1-1/+1
This patch (as1639) fixes a minor bug in the usbtest driver. Due to concurrent changes, a test originally written as number 17 got changed to number 24, but the corresponding change was not made in the log message. This updates the log message. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-21USB: usbtest: prevent a divide by zero bugDan Carpenter1-0/+3
If param->length is zero, then this could lead to a divide by zero bug later in the function when we do: size %= max; Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-14usb: misc: usbtest: send ISO packets for g_zeroBoyan Nedeltchev1-0/+1
since commit b4036cc (usb: gadget: add isochronous support to gadget zero), g_zero has learned about isochronous transfers, which allows us to use usbtest.ko to exercise isochronous pipes. All we need to do to enable that functionality on usbtest.ko, is set the "iso" to 1 on struct usbtest_info Signed-off-by: Boyan Nedeltchev <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-01usb: usbtest: two super speed fixes for usbtestPaul Zimmerman1-5/+12
bMaxPacketSize0 field for super speed is a power of 2, not a count. The size itself is always 512. Max packet size for a super speed bulk endpoint is 1024, so allocate the urb size in halt_simple() accordingly. Signed-off-by: Paul Zimmerman <[email protected]> Acked-by: Felipe Balbi <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-04-18drivers/usb/misc/usbtest.c: add kfreesJulia Lawall1-0/+2
Free the two previously allocated buffers before exiting the function in an error case. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-04-17usb: usbtest: avoid integer overflow in alloc_sglist()Xi Wang1-1/+1
A large `nents' from userspace could overflow the allocation size, leading to memory corruption. | alloc_sglist() | usbtest_ioctl() Use kmalloc_array() to avoid the overflow. Signed-off-by: Xi Wang <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-04-17usb: usbtest: avoid integer overflow in test_ctrl_queue()Xi Wang1-2/+3
Avoid overflowing context.count = param->sglen * param->iterations, where both `sglen' and `iterations' are from userspace. | test_ctrl_queue() | usbtest_ioctl() Keep -EOPNOTSUPP for error code. Signed-off-by: Xi Wang <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-11-26USB: remove BKL commentsDavidlohr Bueso1-1/+0
The BKL is a gonner. Signed-off-by: Davidlohr Bueso <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-09-18usb: Provide usb_speed_string() functionMichal Nazarewicz1-19/+2
In a few places in the kernel, the code prints a human-readable USB device speed (eg. "high speed"). This involves a switch statement sometimes wrapped around in ({ ... }) block leading to code repetition. To mitigate this issue, this commit introduces usb_speed_string() function, which returns a human-readable name of provided speed. It also changes a few places switch was used to use this new function. This changes a bit the way the speed is printed in few instances at the same time standardising it. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-08-23USB: use usb_endpoint_maxp() instead of le16_to_cpu()Kuninori Morimoto1-3/+3
Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size instead of le16_to_cpu(desc->wMaxPacketSize). This patch fix it up Cc: Armin Fuerst <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Johannes Erdfelt <[email protected]> Cc: Vojtech Pavlik <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: David Kubicek <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Brad Hards <[email protected]> Acked-by: Felipe Balbi <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Thomas Dahlmann <[email protected]> Cc: David Brownell <[email protected]> Cc: David Lopo <[email protected]> Cc: Alan Stern <[email protected]> Cc: Michal Nazarewicz <[email protected]> Cc: Xie Xiaobo <[email protected]> Cc: Li Yang <[email protected]> Cc: Jiang Bo <[email protected]> Cc: Yuan-hsin Chen <[email protected]> Cc: Darius Augulis <[email protected]> Cc: Xiaochen Shen <[email protected]> Cc: Yoshihiro Shimoda <[email protected]> Cc: OKI SEMICONDUCTOR, <[email protected]> Cc: Robert Jarzmik <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Thomas Abraham <[email protected]> Cc: Herbert Pötzl <[email protected]> Cc: Arnaud Patard <[email protected]> Cc: Roman Weissgaerber <[email protected]> Acked-by: Sarah Sharp <[email protected]> Cc: Tony Olech <[email protected]> Cc: Florian Floe Echtler <[email protected]> Cc: Christian Lucht <[email protected]> Cc: Juergen Stuber <[email protected]> Cc: Georges Toth <[email protected]> Cc: Bill Ryder <[email protected]> Cc: Kuba Ober <[email protected]> Cc: Inaky Perez-Gonzalez <[email protected]> Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-08-23USB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfersSebastian Andrzej Siewior1-1/+3
Executing | testusb -a -c 1 -t 3 -v 421 -s 2048 does not complete on the gadget side. g_zero enqueues a 4096 bytes long buffer. The host sends 2048bytes which is a multiple of wMaxPacketSize (either 64 or 512 bytes). The host is done with sending data but the gadget waits for more. Since the protocol does not include transfer-length-field sending a terminating zero packet seems the only way out. Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-05-23Merge branch 'usb-next' of ↵Linus Torvalds1-5/+126
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 * 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (205 commits) USB: EHCI: Remove SPARC_LEON {read,write}_be definitions from ehci.h USB: UHCI: Support big endian GRUSBHC HC sparc: add {read,write}*_be routines USB: UHCI: Add support for big endian descriptors USB: UHCI: Use ACCESS_ONCE rather than using a full compiler barrier USB: UHCI: Add support for big endian mmio usb-storage: Correct adjust_quirks to include latest flags usb/isp1760: Fix possible unlink problems usb/isp1760: Move function isp1760_endpoint_disable() within file. USB: remove remaining usages of hcd->state from usbcore and fix regression usb: musb: ux500: add configuration and build options for ux500 dma usb: musb: ux500: add dma glue layer for ux500 usb: musb: ux500: add dma name for ux500 usb: musb: ux500: add ux500 specific code for gadget side usb: musb: fix compile error usb-storage: fix up the unusual_realtek device list USB: gadget: f_audio: Fix invalid dereference of initdata EHCI: don't rescan interrupt QHs needlessly OHCI: fix regression caused by nVidia shutdown workaround USB: OTG: msm: Free VCCCX regulator even if we can't set the voltage ...
2011-05-10usb: fix warning in usbtest module v2Greg Dietsche1-3/+3
On amd64 unsigned is not as wide as pointer and this causes a compiler warning. Switching to unsigned long corrects the problem. Signed-off-by: Greg Dietsche <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-05-10treewide: fix a few typos in commentsJustin P. Mattock1-1/+1
- kenrel -> kernel - whetehr -> whether - ttt -> tt - sss -> ss Signed-off-by: Justin P. Mattock <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2011-05-02usb/usbtest: fix test10 on superpseedSebastian Andrzej Siewior1-0/+2
dummy_hcd + g_zero: |./testusb -a -s 1024 -v 1024 -t 10 | usbtest 2-1:3.0: subtest 14 error, status 0 with patch: ./testusb -a -t 10 |unknown speed /proc/bus/usb/001/002 | dummy_udc dummy_udc: disabled ep-a | dummy_udc dummy_udc: disabled ep-b | dummy_udc dummy_udc: enabled ep-a (ep1in-bulk) maxpacket 1024 | dummy_udc dummy_udc: enabled ep-b (ep2out-bulk) maxpacket 1024 | zero gadget: source/sink enabled | usbtest 1-1:3.0: TEST 10: queue 32 control calls, 1000 times | dummy_hcd dummy_hcd: timer fired with no URBs pending? |/proc/bus/usb/001/002 test 10, 0.022370 secs Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-05-02usb/usbtest: print super on super speedSebastian Andrzej Siewior1-0/+3
Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-04-29USB: add queued-unlinks test case to usbtest driverAlan Stern1-2/+118
This patch (as1452b) adds a new test case to the usbtest driver. Test 24 exercises the unlink-from-queue pathways in the host. It queues a user-specified number of bulk-OUT URBs of user-specified size, unlinks the fourth- and second-from-last URBs in the queue, and then waits to see if all the URBs complete in the expected way (except of course that the unlinked URBs might complete normally, if they weren't unlinked soon enough). This new test has confirmed the existence of a bug in the ehci-hcd driver, to be fixed by a separate patch. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-01-22USB: usbtest - Add tests to ensure HCDs can accept byte aligned buffers.Martin Fuzzey1-24/+212
Add a set of new tests similar to the existing ones but using transfer buffers at an "odd" address [ie offset of +1 from the buffer obtained by kmalloc() or usb_alloc_coherent()] The new tests are: #17 : bulk out (like #1) using kmalloc and DMA mapping by USB core. #18 : bulk in (like #2) using kmalloc and DMA mapping by USB core. #19 : bulk out (like #1) using usb_alloc_coherent() #20 : bulk in (like #2) using usb_alloc_coherent() #21 : control write (like #14) #22 : isochonous out (like #15) #23 : isochonous in (like #16) Signed-off-by: Martin Fuzzey <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-10-22USB: usbtest - ensure correct isoc data lengthMartin Fuzzey1-0/+2
Check the data length of isochronous transfers is as expected. With this test #16 will now fail if the device side sends no data. Signed-off-by: Martin Fuzzey <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-10-22USB: usbtest fix coding styleMartin Fuzzey1-324/+341
Signed-off-by: Martin Fuzzey <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-08-10USB: usbtest: support test device with only one iso-in or iso-out endpointMing Lei1-1/+4
It is very common that one altsetting may include only one iso-in or iso-out single endpoint, especially for high bandwidth endpoint, so support it. Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-08-10USB: usbtest: avoid to free coherent buffer in atomic contextMing Lei1-1/+5
This patch fixes the warning below: [30753.755998] ------------[ cut here ]------------ [30753.755998] WARNING: at /home/tom/git/linux-2.6/linux-2.6-next/arch/x86/include/asm/dma-mapping.h:155 hcd_buffer_free+0xb1/0xd4 [usbcore]() [30753.755998] Hardware name: 6475EK2 [30753.755998] Modules linked in: uvcvideo ehci_hcd usbtest cdc_ether usbnet vfat fat usb_storage nfsd lockd nfs_acl auth_rpcgss exportfs mii tun videodev v4l1_compat v4l2_compat_ioctl32 fuse bridge stp llc sunrpc ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf kvm_intel kvm arc4 ecb ath5k usbhid mac80211 snd_hda_codec_conexant ch341 usbserial ath cfg80211 thinkpad_acpi snd_hda_intel pcspkr wmi hwmon yenta_socket iTCO_wdt iTCO_vendor_support i2c_i801 e1000e snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore snd_page_alloc pata_acpi uhci_hcd ohci_hcd usbcore i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: uvcvideo] [30753.755998] Pid: 0, comm: swapper Tainted: G W 2.6.35-rc6-gkh-wl+ #49 [30753.755998] Call Trace: [30753.755998] <IRQ> [<ffffffff8104478a>] warn_slowpath_common+0x80/0x98 [30753.755998] [<ffffffff810447b7>] warn_slowpath_null+0x15/0x17 [30753.755998] [<ffffffffa00ce02d>] hcd_buffer_free+0xb1/0xd4 [usbcore] [30753.755998] [<ffffffffa00c1345>] usb_free_coherent+0x1c/0x1e [usbcore] [30753.755998] [<ffffffffa00b13e4>] simple_free_urb+0x23/0x2f [usbtest] [30753.755998] [<ffffffffa00b210b>] iso_callback+0xbb/0x10f [usbtest] [30753.755998] [<ffffffffa00c7390>] usb_hcd_giveback_urb+0x8c/0xc0 [usbcore] [30753.755998] [<ffffffffa0449b35>] ehci_urb_done+0x84/0x95 [ehci_hcd] [30753.755998] [<ffffffffa044b5a5>] ehci_work+0x41a/0x7dd [ehci_hcd] [30753.755998] [<ffffffffa044e298>] ehci_irq+0x33b/0x370 [ehci_hcd] [30753.755998] [<ffffffff8100fb05>] ? sched_clock+0x9/0xd [30753.755998] [<ffffffff8105e641>] ? sched_clock_local+0x1c/0x82 [30753.755998] [<ffffffff8105e76a>] ? sched_clock_cpu+0xc3/0xce [30753.755998] [<ffffffff81067c7e>] ? trace_hardirqs_off+0xd/0xf [30753.755998] [<ffffffff8105e7b8>] ? cpu_clock+0x43/0x5e [30753.755998] [<ffffffffa00c6999>] usb_hcd_irq+0x45/0xa1 [usbcore] [30753.755998] [<ffffffff81092e02>] handle_IRQ_event+0x20/0xa5 [30753.755998] [<ffffffff81094cea>] handle_fasteoi_irq+0x92/0xd2 [30753.755998] [<ffffffff8100c0ed>] handle_irq+0x1f/0x2a [30753.755998] [<ffffffff8100b75d>] do_IRQ+0x57/0xbe [30753.755998] [<ffffffff8136a693>] ret_from_intr+0x0/0x16 [30753.755998] <EOI> [<ffffffff81223baa>] ? acpi_idle_enter_bm+0x231/0x269 [30753.755998] [<ffffffff81223ba3>] ? acpi_idle_enter_bm+0x22a/0x269 [30753.755998] [<ffffffff812c4b6b>] cpuidle_idle_call+0x99/0xce [30753.755998] [<ffffffff81008dd5>] cpu_idle+0x61/0xaa [30753.755998] [<ffffffff8136374b>] start_secondary+0x1c2/0x1c6 [30753.755998] ---[ end trace 904cfaf7ab4cb1a2 ]--- Signed-off-by: Ming Lei <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-08-10USB-BKL: Convert usb_driver ioctl to unlocked_ioctlAndi Kleen1-1/+2
And audit all the users. None needed the BKL. That was easy because there was only very few around. Tested with allmodconfig build on x86-64 Signed-off-by: Andi Kleen <[email protected]> Cc: Arnd Bergmann <[email protected]> From: Andi Kleen <[email protected]>
2010-05-20USB: rename usb_buffer_alloc() and usb_buffer_free() usersDaniel Mack1-4/+4
For more clearance what the functions actually do, usb_buffer_alloc() is renamed to usb_alloc_coherent() usb_buffer_free() is renamed to usb_free_coherent() They should only be used in code which really needs DMA coherency. All call sites have been changed accordingly, except for staging drivers. Signed-off-by: Daniel Mack <[email protected]> Cc: Alan Stern <[email protected]> Cc: Pedro Ribeiro <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: remove uses of URB_NO_SETUP_DMA_MAPAlan Stern1-7/+2
This patch (as1350) removes all usages of coherent buffers for USB control-request setup-packet buffers. There's no good reason to reserve coherent memory for these things; control requests are hardly ever used in large quantity (the major exception is firmware transfers, and they aren't time-critical). Furthermore, only seven drivers used it. We might as well always use streaming DMA mappings for setup-packet buffers, and remove some extra complexity from usbcore. The DMA-mapping portion of hcd.c is currently in flux. A separate patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP after everything else settles down. The removal should go smoothly, as by then nobody will be using it. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB misc: make USB device id constantNémeth Márton1-1/+1
The id_table field of the struct usb_device_id is constant in <linux/usb.h> so it is worth to make the initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Németh Márton <[email protected]> Cc: Julia Lawall <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: convert to the runtime PM frameworkAlan Stern1-4/+0
This patch (as1329) converts the USB stack over to the PM core's runtime PM framework. This involves numerous changes throughout usbcore, especially to hub.c and driver.c. Perhaps the most notable change is that CONFIG_USB_SUSPEND now depends on CONFIG_PM_RUNTIME instead of CONFIG_PM. Several fields in the usb_device and usb_interface structures are no longer needed. Some code which used to depend on CONFIG_USB_PM now depends on CONFIG_USB_SUSPEND (requiring some rearrangement of header files). The only visible change in behavior should be that following a system sleep (resume from RAM or resume from hibernation), autosuspended USB devices will be resumed just like everything else. They won't remain suspended. But if they aren't in use then they will naturally autosuspend again in a few seconds. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-12-11usbtest: make module param pattern writeableVikram Pandita1-2/+5
Allow module_param to be writeable. This allows us to change the parameter if usbtest is built-in in the kernel. Signed-off-by: Vikram Pandita <[email protected]> Signed-off-by: Anand Gadiyar <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-06-15USB: usbtest fix endless loop in unlink tests.Martin Fuzzey1-14/+25
In tests 11 and 12 if the URB completes with an error status (eg babble) the asynchrous unlink entered an endless loop trying to unlink a non resubmitted URB. Signed-off-by: Martin Fuzzey <[email protected]> Acked-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-01-07USB: clean up redundant tests on unsignedroel kluin1-2/+0
temp, bytes and param->{length,sglen,vary} are unsigned so these tests do nothing. Signed-off-by: Roel Kluin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-10-22USB: usbtest.c: length, sglen and vary are unsigned, so cannot be negativeroel kluin1-2/+1
length, sglen and vary are unsigned, so cannot be negative see vi drivers/usb/misc/usbtest.c +18 struct usbtest_param { ... unsigned iterations; unsigned length; unsigned vary; unsigned sglen; ... }; Signed-off-by: Roel Kluin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-07-25Rename WARN() to WARNING() to clear the namespaceArjan van de Ven1-2/+2
We want to use WARN() as a variant of WARN_ON(), however a few drivers are using WARN() internally. This patch renames these to WARNING() to avoid the namespace clash. A few cases were defining but not using the thing, for those cases I just deleted the definition. Signed-off-by: Arjan van de Ven <[email protected]> Acked-by: Greg KH <[email protected]> Cc: Karsten Keil <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-05-14usbtest: comment on why this code "expects" negative and positive errnosMarcin Slusarz1-0/+5
On Mon, May 12, 2008 at 01:02:22AM -0700, David Brownell wrote: > On Sunday 11 May 2008, Marcin Slusarz wrote: > > > > test_ctrl_queue expects (?) positive and negative errnos. > > what is going on here? > > The sign is just a way to flag something: > > /* some faults are allowed, not required */ > > The negative ones are required. Positive codes are optional, > in the sense that, depending on how the peripheral happens > to be implemented, they won't necessarily be triggered. > > For example, the test to fetch a device qualifier desriptor > must succeed if the device is running at high speed. So that > test is marked as negative. But when it's full speed, it > could legitimately fail; marked as positive. And so on for > other tests. > > Look at how the codes are *interpreted* to see it work. Lets document it. Based on comment from David Brownell <[email protected]>. Signed-off-by: Marcin Slusarz <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-05-02USB: usbtest displays diagnostics againDavid Brownell1-143/+133
Minor cleanup to the "usbtest" driver, mostly to resolve a regression: all the important diagnostics were at KERN_DEBUG, so that when the "#define DEBUG" was removed from the top of that file it stopped providing diagnostics. Fix by using KERN_ERROR. Also: - Stop using the legacy dbg() calls - Simplify the internal debug macros - Correct some test descriptions: * Test #10 subcase 7 should *always* stall * Test #10 subcase 8 *may* stall - Diagnostic about control queue test failures is more informative - Fix some whitespace "bugs" And add a warning about the rude interaction between usbfs ioctl() and khubd during device disconnect ... don't unplug a device under test, that will wedge. Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: remove unnecessary type casting of urb->contextMing Lei1-2/+2
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-2/+2
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: remove dev->power.power_stateAlan Stern1-1/+2
power.power_state is scheduled for removal. This patch (as1053) removes all uses of that field from drivers/usb. Almost all of them were write-only, the most significant exceptions being sl811-hcd.c and u132-hcd.c. Part of this patch was written by Pavel Machek. Signed-off-by: Alan Stern <[email protected]> Cc: David Brownell <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-24USB: use DIV_ROUND_UPJulia Lawall1-1/+1
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @haskernel@ @@ #include <linux/kernel.h> @depends on haskernel@ expression n,d; @@ ( - (n + d - 1) / d + DIV_ROUND_UP(n,d) | - (n + (d - 1)) / d + DIV_ROUND_UP(n,d) ) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP((n),d) + DIV_ROUND_UP(n,d) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP(n,(d)) + DIV_ROUND_UP(n,d) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-04-02USB: fix bug in sg initialization in usbtestAlan Stern1-1/+2
This patch (as1062) fixes a bug in the scatter-gather initialization code in the usbtest driver. When the sg-helper conversion was performed, it wasn't done correctly. Signed-off-by: Alan Stern <[email protected]> CC: Jens Axboe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[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: testing driver: don't free a locked mutexAndrew Morton1-2/+0
Dopey thing to do and lockdep will (or should) warn. Spotted by Daniel Walker. Cc: Matthias Kaehlcke <[email protected]> Cc: Daniel Walker <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-02-01USB: testing driver: convert dev->sem to mutexMatthias Kaehlcke1-8/+9
USB testing driver: convert semaphore dev->sem to the mutex API Signed-off-by: Matthias Kaehlcke <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-02-01usb: fix usbtest halt check on big endian systemsJan Andersson1-0/+1
usbtest did not swap the received status information when checking for a non-zero value and failed to discover halted endpoints on big endian systems. Cc: stable <[email protected]> Signed-off-by: Jan Andersson <[email protected]> Acked-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-22[SG] Update drivers to use sg helpersJens Axboe1-2/+2
Signed-off-by: Jens Axboe <[email protected]>
2007-07-19USB: misc: usbtest: clean up urb->status usageGreg Kroah-Hartman1-2/+2
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]>
2006-12-07[PATCH] slab: remove SLAB_KERNELChristoph Lameter1-14/+14
SLAB_KERNEL is an alias of GFP_KERNEL. Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] slab: remove SLAB_ATOMICChristoph Lameter1-4/+4
SLAB_ATOMIC is an alias of GFP_ATOMIC Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-01USB: usbtest: Use usb_endpoint_* functionsLuiz Fernando N. Capitulino1-2/+2
Signed-off-by: Luiz Fernando N. Capitulino <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>