This patch converts the inode semaphore to a mutex. I have tested it on
XFS and compiled as much as one can consider on an ia64. Anyway your
luck with it might be different.
Modified-by: Ingo Molnar <mingo@elte.hu>
(finished the conversion)
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Here's a small patch with a few tiny fixups for the EHCI Kconfig help
text. Please consider applying.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
This moves the 32 bit ioctl compatibility handlers for
Video4Linux into a new file and adds explicit calls to them
to each v4l device driver.
Unfortunately, there does not seem to be any code handling
the v4l2 ioctls, so quite often the code goes through two
separate conversions, first from 32 bit v4l to 64 bit v4l,
and from there to 64 bit v4l2. My patch does not change
that, so there is still much room for improvement.
Also, some drivers have additional ioctl numbers, for
which the conversion should be handled internally to
that driver.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Some long time ago, dentry struct was carefully tuned so that on 32 bits
UP, sizeof(struct dentry) was exactly 128, ie a power of 2, and a multiple
of memory cache lines.
Then RCU was added and dentry struct enlarged by two pointers, with nice
results for SMP, but not so good on UP, because breaking the above tuning
(128 + 8 = 136 bytes)
This patch reverts this unwanted side effect, by using an union (d_u),
where d_rcu and d_child are placed so that these two fields can share their
memory needs.
At the time d_free() is called (and d_rcu is really used), d_child is known
to be empty and not touched by the dentry freeing.
Lockless lookups only access d_name, d_parent, d_lock, d_op, d_flags (so
the previous content of d_child is not needed if said dentry was unhashed
but still accessed by a CPU because of RCU constraints)
As dentry cache easily contains millions of entries, a size reduction is
worth the extra complexity of the ugly C union.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Maneesh Soni <maneesh@in.ibm.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Paul Jackson <pj@sgi.com>
Cc: Al Viro <viro@ftp.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: James Morris <jmorris@namei.org>
Cc: Stephen Smalley <sds@epoch.ncsc.mil>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Include fixes for 2.6.14-git11. Should allow to remove sched.h from
module.h on i386, x86_64, arm, ia64, ppc, ppc64, and s390. Probably more
to come since I haven't yet checked the other archs.
Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
We should use the i2c_driver.driver's .name and .owner fields
instead of the i2c_driver's ones.
This patch updates the drivers/media/video and usb/media drivers.
Signed-off-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified
probe() callback. As all in-kernel drivers are changed to this new
callback, there will be no temporary backwards-compatibility. Inside a
probe() function, each driver _must_ set struct pcmcia_device
*p_dev->instance and instance->handle correctly.
With these patches, the basic driver interface for 16-bit PCMCIA drivers
now has the classic four callbacks known also from other buses:
int (*probe) (struct pcmcia_device *dev);
void (*remove) (struct pcmcia_device *dev);
int (*suspend) (struct pcmcia_device *dev);
int (*resume) (struct pcmcia_device *dev);
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
The linked list of devices managed by each PCMCIA driver is, in very most
cases, unused. Therefore, remove it from many drivers.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Unify the "detach" and REMOVAL_EVENT handlers to one "remove" function.
Old functionality is preserved, for the moment.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Move the suspend and resume methods out of the event handler, and into
special functions. Also use these functions for pre- and post-reset, as
almost all drivers already do, and the remaining ones can easily be
converted.
Bugfix to include/pcmcia/ds.c
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Leave the overloaded "hotplug" word to susbsystems which are handling
real devices. The driver core does not "plug" anything, it just exports
the state to userspace and generates events.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Prevents a compiler warning and uses down_interruptible() instead of down() in
process context.
Signed-off-by: Sam Bishop <sam@bishop.dhs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Fix usb_find_interface. You cannot case pointers to int and long on
a big-endian 64-bitter without consequences.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
I looked at the userspace code which uses the LPIOC_GET_DEVICE_ID ioctl
and I almost went blind. Let's export it in sysfs instead, and just as a
string instead of with a big-endian length at the beginning of it.
This also prints the message about finding the printer _after_ we know
the minor device number it's going to have, rather than reporting all
printers as 'usblp0'.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
From: David Woodhouse <dwmw2>
David has a G5 with a printer. I am quite surprised that nobody else noticed
this before. Linus has a G5. Hackers hate printing in general, maybe.
We do not use BKL anymore, because one of code paths had a sleeping call,
so we had to use a semaphore. I am sure it's safe to use unlocked_ioctl.
The new ioctls return long and retval is int. It looks completely fine to me.
We never want these extra bits, and the sign extension ought to work right.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--
Noticed that my zd1201 adapter isn't "seen" by hal and NetworkManager.
The problem seems to be that unlike other network device drivers I
checked, zd1201 does not do a SET_NETDEV_DEV(), which makes it so a
"device" symlink is created under /sys/class/net/wlan0.
With the following patch the device symlink shows up, and now I am
happily using NetworkManager to control the adapter:
$ ls -l /sys/class/net/wlan0
total 0
-r--r--r-- 1 root root 4096 Dec 18 13:42 address
-r--r--r-- 1 root root 4096 Dec 18 13:42 addr_len
-r--r--r-- 1 root root 4096 Dec 18 13:42 broadcast
-r--r--r-- 1 root root 4096 Dec 18 13:42 carrier
lrwxrwxrwx 1 root root 0 Dec 18 13:42 device -> ../../../devices/pci0001:10/0001:10:1b.1/usb4/4-1
-r--r--r-- 1 root root 4096 Dec 18 13:42 features
Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Fedora users complain that passing "nousbstorage" to the installer causes
the rest of the USB support to disappear. The installer uses kernel command
line as a way to pass options through Syslinux. The problem stems from the
use of strncmp() in obsolete_checksetup().
I used __module_param_call() instead of module_param because I wanted to
preserve the old syntax in grub.conf, and it's the only macro which allows
to remove the prefix.
The fix is tested to accept the option "nousb" correctly now.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Attached patch adds device IDs for the Linksys USB200M Rev 2 device
which uses the AX88772 chipset.
Signed-off-by: David Hollis <dhollis@davehollis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern pointed out there was an ordering issue in unusual_devs.h,
and this patch fixes it.
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Remove kmalloc() return value casts that we don't need from
drivers/usb/*
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch adds vendor and product IDs to the ftdi_sio driver's device
ID table for two devices from teratronik.de. The device IDs were
submitted by O. Wlfelschneider of Teratronik Elektronische Systeme
GmbH.
The charset of the patch is latin-1, same as the original files.
Please apply, thanks! (I've tried to avoid a clash with Andrew Morton's
patch to add support for Posiflex PP-7700 printer to the same driver.)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This little patch adds recognition of Posiflex PP-7000 retail printer to
ftdo_sio module. The printer uses FT232BM bridge programmed with custom
VID/PID. The patch posted to lkml and sf.net was for 2.6.11.1 kernel,
here is one reworked for 2.6.12.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Summary: Driver for ATI/Philips USB RF remotes
This is a new input driver for ATI/Philips USB RF remotes (eg. ATI
Remote Wonder II).
Signed-off-by: Ville Syrjl <syrjala@sci.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of ARRAY_SIZE. Some trailing whitespaces are also removed.
Patch is compile-tested on i386.
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as621) fixes a local variable conflict I accidently
introduced into usb_set_configuration.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Bugs involving the REPORT LUNS SCSI-3 command are much easier to track
down if usb-storage displays the command's name, rather than "(Unknown
command)".
Signed-off-by: Paul Walmsley <paul@booyaka.com>
Cc: <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch adds another usb-storage subdriver, which supports two fairly
old dual-XD/SmartMedia reader-writers (USB1.1 devices).
This driver was written by Daniel Drake <dsd@gentoo.org> -- he notes
that he wrote this driver without specs, however a vendor-supplied GPL
driver for the previous generation of products ("sma03") did prove to be
quite useful, as did the sddr09 driver which also has to deal with
low-level physical block layout on SmartMedia.
The original patch has been reformed by me, as it clashed with the
libusual patches.
We really need to consolidate some of this common SmartMedia code, and
get together with the MTD guys to share it with them as well.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is the third of three patches to prepare the sddr09 subdriver for
conversion to the Sim-SCSI framework. This patch (as596) moves the
computation of the LBA to the start of the read/write routines, so that
addresses completely beyond the end of the device can be detected and
reported differently from transfers that are partially within the
device's capacity.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Andries Brouwer <Andries.Brouwer@cwi.nl>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is the second of three patches to prepare the sddr09 subdriver for
conversion to the Sim-SCSI framework. This patch (as595) updates the
code to use standard error values for return codes instead of our
special-purpose USB_STOR_TRANSPORT_... codes. The reverse update is
then needed in the transport routine, but with the Sim-SCSI framework
that routine will go away.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Andries Brouwer <Andries.Brouwer@cwi.nl>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is the first of three patches to prepare the sddr09 subdriver for
conversion to the Sim-SCSI framework. This patch (as594) straightens
out the initialization procedures and headers:
Some ugly code from usb.c was moved into sddr09.c.
Set-up of the private data structures was moved into the
initialization routine.
The connection between the "dpcm" version and the standalone
version was clarified.
A private declaration was moved from a header file into the
subdriver's .c file.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Andries Brouwer <Andries.Brouwer@cwi.nl>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The OneTouch subdriver submits its own interrupt URB for notifications
about button presses. Consequently it needs to know about suspend and
resume events, so it can cancel or restart the URB.
This patch (as593) adds a hook to struct us_data, to be used for
notifying subdrivers about Power Management events, and it implements
the hook in the OneTouch driver.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Nick Sillik <n.sillik@temple.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern pointed out that (in 2.6 kernel) one successful submission results
in one callback, even for ISO-out transfers. Thus, the silly check can be
removed from usbmon. This reduces the amount of garbage printed in case
of ISO and Interrupt transfers.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as615b) edits a large number of comments in the uhci-hcd code,
mainly removing excess apostrophes.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as616) changed the uhci_explen macro in uhci-hcd.h so that
it now accepts the desired length, rather than length - 1 with special
handling for 0. This also fixes a minor bug that would show up only
when a driver submits a 0-length bulk URB.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
They deal with wrapping correctly and are nicer to read.
Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Minimum data length must be UART_STATE + 1, as data[UART_STATE] is being
accessed for the new line_state. Although PL-2303 hardware is not
expected to send data with exactly UART_STATE length, this keeps it on
the safe side.
Signed-off-by: Horst Schirmeier <horst@schirmeier.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The device data in ohci-pxa27x is a struct hcd, not a struct ohci_hcd.
This correct the suspend/resume calls to account for this and adds some
code to invalidate the platform data when the module is removed.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
patch below marks various USB tables and variables as const so that they
end up in .rodata section and don't cacheline share with things that get
written to. For the non-array variables it also allows gcc to optimize
more.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as614) makes a small change to the part of the hub driver
responsible for remote wakeup of root hubs. When these wakeups occur
the driver is suspended, and in case the resume fails the driver should
remain suspended -- it shouldn't try to proceed with its normal
processing.
This will hardly ever matter in normal use, but it did crop up while I
was debugging a different problem.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as613) moves the updates to hcd->state in the dummy_hcd
driver to where they now belong. It also uses the new
HC_FLAG_HW_ACCESSIBLE flag in a way that simulates a real PCI
controller, and it adds checks for attempts to resume the bus while the
controller is suspended or to suspend the controller while the bus is
active.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as612) removes the "volatile" declarations from the
file-storage gadget. It turns out that they aren't needed for anything
much; adding a few memory barriers does a sufficient job.
The patch also removes a wait_queue. Not much point having a queue when
only one task is ever going to be on it!
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: don't allocate dma pools for PIO HCDs
hcd_buffer_alloc() and hcd_buffer_free() have a similar dma_mask
check and revert to kmalloc()/kfree(), but hcd_buffer_create()
doesn't check dma_mask and allocates unused dma pools.
Signed-off-by: Chris Humbert <mahadri-kernel@drigon.com>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Some versions of the controller seem to put multiple report packet into a
single urb. also it can happen that a packet is split across multiple urbs.
unpatched you get a jumpy cursor on some screens.
the patch does:
- handle multiple packets per urb
- handle packets split across multiple urb
- check packet type
- cleanups
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
There is a race-condition in usb-serial driver that can be triggered if
a processes does 'port->tty->driver_data = NULL' in serial_close() while
other processes is in kernel-space about to call serial_ioctl() on the
same port.
This happens because a process can open the device while there is
another one closing it.
The patch below fixes that by adding a semaphore to ensure that no
process will open the device while another process is closing it.
Note that we can't use spinlocks here, since serial_open() and
serial_close() can sleep.
Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Checks if 'port' is NULL before using it in all tty operations, this
can avoid NULL pointer dereferences.
Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
When going to suspend, there's no point in setting HC state in
host controller driver as USB core takes care of this.
Signed-off-by: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as610) adds a field to struct usb_device to store the device's
port number. This allows us to remove several loops in the hub driver
(searching for a particular device among all the entries in the parent's
array of children).
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as609) changes the way we keep track of power budgeting for
USB hubs and devices, and it updates the choose_configuration routine to
take this information into account. (This is something we should have
been doing all along.) A new field in struct usb_device holds the amount
of bus current available from the upstream port, and the usb_hub structure
keeps track of the current available for each downstream port.
Two new rules for configuration selection are added:
Don't select a self-powered configuration when only bus power
is available.
Don't select a configuration requiring more bus power than is
available.
However the first rule is #if-ed out, because I found that the internal
hub in my HP USB keyboard claims that its only configuration is
self-powered. The rule would prevent the configuration from being chosen,
leaving the hub & keyboard unconfigured. Since similar descriptor errors
may turn out to be fairly common, it seemed wise not to include a rule
that would break automatic configuration unnecessarily for such devices.
The second rule may also trigger unnecessarily, although this should be
less common. More likely it will annoy people by sometimes failing to
accept configurations that should never have been chosen in the first
place.
The patch also changes usbcore's reaction when no configuration is
suitable. Instead of raising an error and rejecting the device, now
the core will simply leave the device unconfigured. People can always
work around such problems by installing configurations manually through
sysfs.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
It looks like that the gs_serial module maybe sleep with spinlock in gs_close.
Sometimes, system hang when I remove the gs_serial module.
From: Fengwei Yin <xaityyy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch contains the following cleanups:
- make needlessly global functions static
- every file should #include the headers containing the prototypes for
it's global functions
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The earlier USB locking updates didn't touch the suspend/resume
routines. They need updating as well, since now the caller holds the
device semaphore. This patch (as608) makes the necessary changes. It
also adds a line to store the correct power state when a device is
resumed, something which was unaccountably missing.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as606b) is an updated version of my earlier patch to
disconnect children from a hub device when the hub driver is unbound.
Thanks to the changes in the driver core locking, we now know that the
entire hub device (and not just the interface) is locked whenever the
hub driver's disconnect method runs. Hence it is safe to disconnect the
child device structures immediately instead of deferring the job.
The earlier version of the patch neglected to disable the hub's ports.
We don't want to forget that; otherwise we'd end up with live devices
using addresses that have been recycled. This update adds the necessary
code.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as605) removes the private udev->serialize semaphore,
relying instead on the locking provided by the embedded struct device's
semaphore. The changes are confined to the core, except that the
usb_trylock_device routine now uses the return convention of
down_trylock rather than down_read_trylock (they return opposite values
for no good reason).
A couple of other associated changes are included as well:
Now that we aren't concerned about HCDs that avoid using the
hcd glue layer, usb_disconnect no longer needs to acquire the
usb_bus_lock -- that can be done by usb_remove_hcd where it
belongs.
Devices aren't locked over the same scope of code in
usb_new_device and hub_port_connect_change as they used to be.
This shouldn't cause any trouble.
Along with the preceding driver core patch, this needs a lot of testing.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This fixes the driver that forgot to set the module owner up. Now we
can remove the unneeded pointer from the usb driver structure. The idea
for how to do this was from Al Viro, who did this for the PCI drivers.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This lets drivers, like the usb-serial ones, disable the ability to add
ids from sysfs.
The usb-serial drivers are "odd" in that they are really usb-serial bus
drivers, not usb bus drivers, so the dynamic id logic will have to go
into the usb-serial bus core for those drivers to get that ability.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Echo the usb vendor and product id to the "new_id" file in the driver's
sysfs directory, and then that driver will be able to bind to a device
with those ids if it is present.
Example:
echo 0557 2008 > /sys/bus/usb/drivers/foo_driver/new_id
adds the hex values 0557 and 2008 to the device id table for the foo_driver.
Note, usb-serial drivers do not currently work with this capability yet.
usb-storage also might have some oddities.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This will make the dynamic-id stuff easier to do, as it will be
self-contained.
No logic was changed at all.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Make the bias parameter writeable. Writing the parameter does not trigger
a rebind of currently attached storage devices.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch adds a shim driver libusual, which routes devices between
usb-storage and ub according to the common table, based on unusual_devs.h.
The help and example syntax is in Kconfig.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as515b) adds a routine to usbcore to simplify handling of
host controllers that lost power or were reset during suspend/resume.
The new core routine marks all the child devices of the root hub as
NOTATTACHED and tells khubd to disconnect the device structures as soon
as possible.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The recent platform_device update has reintroduced into dummy_hcd.c the
dreaded dev->dev syndrome. This harkens back to when an earlier version
of that driver included the unforgettable line:
dev->dev.dev.driver_data = dev;
This patch (as602) renames the platform_device variables to "pdev", in
the hope of reducing confusion.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
adds new module parameter "devid" that points to a string with format
"device_name:vendor_id:device_id:flags". if provided at module load
time, this string is being parsed and a new entry is created in
usb_dev_id[] and pegasus_ids[] so the new device can later be recognized
by the probe routine. this might be helpful for someone who don't
know/wish to build new module/kernel, but want to use his new usb-to-eth
device that is not yet listed in pegasus.h
Signed-off-by: Petko Manolov <petkan@nucleusys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
removes all redundant collecting of the return value from
get/set_registers() and suchlike. can't remember who put all of those
some time ago, but they doesn't make any sense to me. where needed only
a few references remained;
Signed-off-by: Petko Manolov <petkan@nucleusys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as601) adds a proper reference count to the file-storage
gadget's main data structure, to keep track of references held by child
devices (LUNs in this case). Before this, the driver would wait for
each child to be released before unbinding.
While there's nothing really wrong with that (you can't create a hang by
doing "rmmod g_file_storage </sys/.../lun0/ro" since the open file will
prevent rmmod from running), the code might as well follow the standard
procedures. Besides, this shrinks the size of the structure by a few
words... :-)
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This modifies the HCD builds to automatically "-DDEBUG" if
CONFIG_USB_DEBUG is selected. It's just a minor source code cleanup,
guaranteeing consistency.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This makes the ISP116x HCD use the driver model wakeup flags for its
controller, not the flags in the HCD glue (which will be removed).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This makes UHCI stop using the HCD glue wakeup flags to report whether
the controller can wake the system. The existing code was wrong anyway;
having a PCI PM capability doesn't imply it reports PME# is supported.
I skimmed Intel's ICH7 datasheet and that basically says the wakeup
signaling gets routed only through ACPI registers. (On the other hand,
many VIA chips provide the PCI PM capabilities...) I think that doing
this correctly with UHCI is going to require the ACPI folk to associate
the /proc/acpi/wakeup identifiers (and wakeup enable/disable flags)
with the relevant /sys/devices/pci*/... devices.
From: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This makes the SL811 HCD use the driver model wakeup flags for its
controller, not the flags in the HCD glue (which will be removed).
From: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/sl811-hcd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
On some systems, EHCI seems to be getting IRQs too early during driver
setup ... before the root hub is allocated, in particular, making trouble
for any code chasing down root hub pointers! In this case, it seems to
be safe to just ignore the root hub setting. Thanks to Rafael J. Wysocki
for getting this properly tested.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This teaches the EHCI driver to use the new driver model wakeup flags,
replacing the similar ones in the HCD glue. It also adds a workaround
for the current glitch whereby PCI init doesn't init the wakeup flags
from the PCI PM capabilities. (EHCI controllers don't worry about
legacy mode; the PCI PM capability would always do the job.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
More care on loading firmware, take into account fw->size can't be zero.
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
A driver for USB ADSL modems based on the ADI eagle chipset using the
usb_atm infrastructure.
The managing part was taken from bsd ueagle driver, other parts were
written from scratch.
The driver uses the in-kernel firmware loader :
- to load a first usb firmware when the modem is in pre-firmware state
- to load the dsp firmware that are swapped in host memory.
- to load CMV (configuration and management variables) when the modem
boot. (We can't use options or sysfs for this as there many possible
values. See
https://mail.gna.org/public/eagleusb-dev/2005-04/msg00031.html for a
description of some)
- to load fpga code for 930 chipset.
The device had 4 endpoints :
* 2 for data (use by usbatm). The incoming
endpoint could be iso or bulk. The modem seems buggy and produce lot's
of atm errors when using it in bulk mode for speed > 3Mbps, so iso
endpoint is need for speed > 3Mbps. At the moment iso endpoint need a
patched usbatm library and for this reason is not included in this patch.
* One bulk endpoint for uploading dsp firmware
* One irq endpoint that notices the driver
- if we need to upload a page of the dsp firmware
- an ack for read or write CMV and the value (for the read case).
If order to make the driver cleaner, we design synchronous
(read|write)_cmv :
-send a synchronous control message to the modem
-wait for an ack or a timeout
-return the value if needed.
In order to run these synchronous usb messages we need a kernel thread.
The driver has been tested with sagem fast 800 modems with different
eagle chipset revision and with ADI 930 since April 2005.
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
When the ehci-hcd driver prepares a control URB, it tests for a
zero-length data stage by looking at the transfer_dma value instead of
the transfer_buffer_length. (In fact it does this even for non-control
URBs, which is an additional aspect of the same bug.)
However, under certain circumstances it's possible for transfer_dma to
be 0 while transfer_buffer_length is non-zero. This can happen when a
freshly allocated page (mapped to address 0 and marked Copy-On-Write,
but never written to) is used as the source buffer for an OUT transfer.
This patch (as598) fixes the problem.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The attached patch makes a cleanup of isp116x-hcd. Most of the volume of
the patch comes from 2 sources: moving the code around to get rid of a
few function prototypes and reworking register dumping functions/macros.
Among other things, switched over from using procfs to debugfs.
Cleanup. The following changes were made:
- Rework register dumping code so it can be used for dumping
to both syslog and debugfs.
- Switch from procfs to debugfs..
- Die gracefully on Unrecoverable Error interrupt.
- Fix memory leak in isp116x_urb_enqueue(), if HC happens to
die in a narrow time window.
- Fix a 'sparce' warning (unnecessary cast).
- Report Devices Removable for root hub ports by default
(was Devices Permanently Attached).
- Move bus suspend/resume functions down in code to get rid of
a few function prototypes.
- A number of one-line cleanups.
- Add an entry to MAINTAINERS.
Signed-off-by: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
MAINTAINERS | 6
drivers/usb/host/isp116x-hcd.c | 429 ++++++++++++++++-------------------------
drivers/usb/host/isp116x.h | 83 +++++--
3 files changed, 230 insertions(+), 288 deletions(-)
Until now the isp116x-hcd had no support to reinitialize the HC on
resume, if the controller lost its state during suspend. This patch,
generated against your Oct 26 git tree, adds that support. The patch is
basically the same as the one tested by Ivan Kalatchev, who reported the
problem, on 2.6.13.
Please apply,
Support reinitializing the isp116x host controller from scratch on
resume, if the controller has lost its state.
Signed-off-by: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
this patch by David converts the sending queue of the CDC ACM driver
to a queue of URBs. This is needed for quicker devices. Please apply.
Signed-Off-By: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/cdc-acm.c | 229 ++++++++++++++++++++++++++++++--------------
drivers/usb/class/cdc-acm.h | 33 +++++-
2 files changed, 185 insertions(+), 77 deletions(-)
Add power management functions for the pxa27x USB OHCI host controller.
This is a totally rewritten version of the patch by Nicolas Pitre and
Todd Poynor which accounts for recent USB changes.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
To allow multiple platforms to use the PXA27x OHCI driver, the platform
code needs to be moved into the board specific files in
arch/arm/mach-pxa. This patch does this for mainstone and adds
preliminary hooks to allow other boards to use the driver.
This has been compile tested for mainstone and successfully run on Spitz
(Sharp Zaurus SL-C3000) with the addition of an appropriate board
support file.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
It seems that clk_use() and clk_unuse() are additional complexity
which isn't required anymore. Remove them from the clock framework
to avoid the additional confusion which they cause, and update all
ARM machine types except for OMAP.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This patch removes all references to the bouncing address
rddunlap@osdl.org and one dead web page from the kernel.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
This patch fixes a typo introduced by conversion to dynamic input_dev
allocation.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This patch fixes a typo introduced by conversion to dynamic input_dev
allocation.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This patch fixes a typo introduced by conversion to dynamic input_dev
allocation.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>