aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/misc/legousbtower.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-18USB: convert drivers/usb/* to use module_usb_driver()Greg Kroah-Hartman1-45/+1
This converts the drivers in drivers/usb/* to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Simon Arlott <[email protected]> Cc: Duncan Sands <[email protected]> Cc: Matthieu CASTET <[email protected]> Cc: Stanislaw Gruszka <[email protected]> Cc: Pete Zaitcev <[email protected]> Cc: Oliver Neukum <[email protected]> Cc: Juergen Stuber <[email protected]> Cc: Cesar Miquel <[email protected]> Cc: Matthew Dharm <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Sarah Sharp <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Michael Hund <[email protected]> Cc: Zack Parsons <[email protected]> Cc: Melchior FRANZ <[email protected]> Cc: Tomoki Sekiyama <[email protected]> Cc: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-08-23USB: use usb_endpoint_maxp() instead of le16_to_cpu()Kuninori Morimoto1-2/+2
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]>
2010-08-10USB: misc: Remove unnecessary casts of private_dataJoe Perches1-3/+3
Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: Convert concatenated __FILE__ to %s, __FILE__Joe Perches1-4/+7
Reduces string space a bit Neaten a macro redefine of dbg Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: BKL removal: legousbtowerOliver Neukum1-3/+0
BKL was not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: Push BKL on open down into the driversOliver Neukum1-0/+3
Straightforward push into the drivers to allow auditing individual drivers separately Signed-off-by: Oliver Neukum <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Cc: Jiri Kosina <[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]>
2009-09-23USB: legousbtower: make poll notice disconnectOliver Neukum1-0/+6
poll needs to return an error if a device is disconnected - make poll check for device's presence - wake all waiters in disconnect Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-09-19Driver-Core: extend devnode callbacks to provide permissionsKay Sievers1-2/+2
This allows subsytems to provide devtmpfs with non-default permissions for the device node. Instead of the default mode of 0600, null, zero, random, urandom, full, tty, ptmx now have a mode of 0666, which allows non-privileged processes to access standard device nodes in case no other userspace process applies the expected permissions. This also fixes a wrong assignment in pktcdvd and a checkpatch.pl complain. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-06-15Driver Core: usb: add nodename support for usb drivers.Kay Sievers1-0/+6
This adds support for USB drivers to report their requested nodename to userspace. It also updates a number of USB drivers to provide the needed subdirectory and device name to be used for them. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Jan Blunck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-10-17USB: remove info() macro from usb/misc driversGreg Kroah-Hartman1-10/+13
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 <[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-44/+44
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-02-01USB: misc: legousbtower: semaphore to mutexDaniel Walker1-14/+16
The dev->sem conforms to mutex style usage. This patch converts it to use the struct mutex type, and new API. There is also a small style fix around this comment, /* unlock here as tower_delete frees dev */ Where I broke the line up to meet the 80 char limit. Signed-off-by: Daniel Walker <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-25USB: disconnect open race in legousbtowerOliver Neukum1-1/+13
again, possible use after free due to touching intfdata without lock. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-07-19USB: misc: legousbtower: clean up urb->status usageGreg Kroah-Hartman1-13/+15
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-12USB: prevent char device open/deregister raceAlan Stern1-18/+6
This patch (as908) adds central protection in usbcore for the prototypical race between opening and unregistering a char device. The spinlock used to protect the minor-numbers array is replaced with an rwsem, which can remain locked across a call to a driver's open() method. This guarantees that open() and deregister() will be mutually exclusive. The private locks currently used in several individual drivers for this purpose are no longer necessary, and the patch removes them. The following USB drivers are affected: usblcd, idmouse, auerswald, legousbtower, sisusbvga/sisusb, ldusb, adutux, iowarrior, and usb-skeleton. As a side effect of this change, usb_deregister_dev() must not be called while holding a lock that is acquired by open(). Unfortunately a number of drivers do this, but luckily the solution is simple: call usb_deregister_dev() before acquiring the lock. In addition to these changes (and their consequent code simplifications), the patch fixes a use-after-free bug in adutux and a race between open() and release() in iowarrior. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap1-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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-01usb: legousbtower free kill urb cleanupMariusz Kozlowski1-13/+5
Hello, - usb_free_urb() cleanup - usb_kill_urb() cleanup Signed-off-by: Mariusz Kozlowski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01USB: legousbtower: Use usb_endpoint_* functionsLuiz Fernando N. Capitulino1-8/+5
Signed-off-by: Luiz Fernando N. Capitulino <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells1-4/+4
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 <[email protected]> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-09-27USB: Make file operations structs in drivers/usb const.Luiz Fernando N. Capitulino1-1/+1
Making structs const prevents accidental bugs and with the proper debug options they're protected against corruption. Signed-off-by: Luiz Fernando N. Capitulino <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel1-1/+0
Signed-off-by: Jörn Engel <[email protected]> Signed-off-by: Adrian Bunk <[email protected]>
2006-03-20[PATCH] USB: convert a bunch of USB semaphores to mutexesArjan van de Ven1-5/+6
the patch below converts a bunch of semaphores-used-as-mutex in the USB code to mutexes Signed-off-by: Arjan van de Ven <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-04[PATCH] USB: remove .owner field from struct usb_driverGreg Kroah-Hartman1-1/+0
It is no longer needed, so let's remove it, saving a bit of memory. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-10-28[PATCH] devfs: Remove the mode field from usb_class_driver as it's no longer ↵Greg Kroah-Hartman1-3/+2
needed Also fixes all drivers that set this field, and removes some other devfs specfic USB logic. Signed-off-by: Greg Kroah-Hartman <[email protected]> drivers/usb/class/usblp.c | 3 +-- drivers/usb/core/file.c | 19 ++++--------------- drivers/usb/image/mdc800.c | 3 +-- drivers/usb/input/aiptek.c | 2 +- drivers/usb/input/hiddev.c | 3 +-- drivers/usb/media/dabusb.c | 3 +-- drivers/usb/misc/auerswald.c | 3 +-- drivers/usb/misc/idmouse.c | 5 ++--- drivers/usb/misc/legousbtower.c | 5 ++--- drivers/usb/misc/rio500.c | 3 +-- drivers/usb/misc/sisusbvga/sisusb.c | 5 ----- drivers/usb/misc/usblcd.c | 9 ++++----- drivers/usb/usb-skeleton.c | 3 +-- include/linux/usb.h | 7 ++----- 14 files changed, 22 insertions(+), 51 deletions(-)
2005-05-03[PATCH] USB: Spelling fixes for drivers/usb.Steven Cole1-1/+1
Here are some spelling corrections for drivers/usb. cancelation -> cancellation succesful -> successful cancelation -> cancellation decriptor -> descriptor Initalize -> Initialize wierd -> weird Protocoll -> Protocol occured -> occurred successfull -> successful Procesing -> Processing devide -> divide Isochronuous -> Isochronous noticable -> noticeable Basicly -> Basically transfering -> transferring intialize -> initialize Incomming -> Incoming additionnal -> additional asume -> assume Unfortunatly -> Unfortunately retreive -> retrieve tranceiver -> transceiver Compatiblity -> Compatibility Incorprated -> Incorporated existance -> existence Ununsual -> Unusual Signed-off-by: Steven Cole <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+1088
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!