i2400m/SDIO: probe/disconnect, dev init/shutdown and reset backends
Implements probe/disconnect for the SDIO device, as well as main
backends for the generic driver to control the SDIO device
(bus_dev_start(), bus_dev_stop() and bus_reset()).
Implements the backend so that the generic driver can TX/RX to/from
the USB device.
TX is implemented with a kthread sitting in a never-ending loop that
when kicked by the generic driver's TX code will pull data from the TX
FIFO and send it to the device until it drains it. Then it goes back
sleep, waiting for another kick.
RX is implemented in a similar fashion, but reads are kicked in by the
device notifying in the interrupt endpoint that data is ready. Device
reset notifications are also sent via the notification endpoint.
We need a thread contexts to run USB autopm functions (blocking) and
to process the received data (can get to be heavy in processing
time).
i2400m/USB: probe/disconnect, dev init/shutdown and reset backends
Implements probe/disconnect for the USB device, as well as main
backends for the generic driver to control the USB device
(bus_dev_start(), bus_dev_stop() and bus_reset()).
This contains the common function declaration and constants for the
USB driver for the 2400m Wireless WiMAX Connection, as well as it's
debug level settings.
This is a collection of functions used to control the device (plus a
few helpers).
There are utilities for handling TLV buffers, hooks on the device's
reports to act on device changes of state [i2400m_report_hook()], on
acks to commands [i2400m_msg_ack_hook()], a helper for sending
commands to the device and blocking until a reply arrives
[i2400m_msg_to_dev()], a few high level commands for manipulating the
device state, powersaving mode and configuration plus the routines to
setup the device once communication is established with it
[i2400m_dev_initialize()].
Handling of TX/RX data to/from the i2400m device (IP packets, control
and diagnostics). On RX, this parses the received read transaction
from the device, breaks it in chunks and passes it to the
corresponding subsystems (network and control).
Transmission to the device is done through a software FIFO, as
data/control frames can be coalesced (while the device is reading the
previous tx transaction, others accumulate). A FIFO is used because at
the end it is resource-cheaper that scatter/gather over USB. As well,
most traffic is going to be download (vs upload).
i2400m: firmware loading and bootrom initialization
Implements the firmware loader (using the bus-specific driver's
backends for the actual upload). The most critical thing in here is
the piece that puts the device in boot-mode from any other
(undetermined) state, otherwise, it is just pushing the bytes from the
firmware file to the device.
Implementation of the glue to the network stack so the WiMAX device
shows up as an Ethernet device.
Initially we shot for implementing a Pure IP device -- however, the
world seems to turn around Ethernet devices. Main issues were with the
ISC DHCP client and servers (as they don't understand types other than
Ethernet and Token Ring).
We proceeded to register with IANA the PureIP hw type, so that DHCP
requests could declare such. We also created patches to the main ISC
DHCP versions to support it. However, until all that permeates into
deployments, there is going to be a long time.
So we moved back to wrap Ethernet frames around the PureIP device. At
the time being this has overhead; we need to reallocate with space for
an Ethernet header. The reason is the device-to-host protocol
coalesces many network packets into a single message, so we can't
introduce Ethernet headers without overwriting valid data from other
packets.
Coming-soon versions of the firmware have this issue solved.
i2400m: host/device procotol and core driver definitions
The wimax/i2400m.h defines the structures and constants for the
host-device protocols:
- boot / firmware upload protocol
- general data transport protocol
- control protocol
It is done in such a way that can also be used verbatim by user space.
drivers/net/wimax/i2400m.h defines all the APIs used by the core,
bus-generic driver (i2400m) and the bus specific drivers
(i2400m-BUSNAME). It also gives a roadmap to the driver
implementation.
debug-levels.h adds the core driver's debug settings.
The driver for the i2400m is a stacked driver. There is a core driver,
the bus-generic driver that has no knowledge or dependencies on how
the device is connected to the system; it only knows how to speak the
device protocol. Then there are the bus-specific drivers (for USB and
SDIO) that provide backends for the generic driver to communicate with
the device.
The bus generic driver connects to the network and WiMAX stacks on the
top side, and on the bottom to the bus-specific drivers.
wimax: basic API: kernel/user messaging, rfkill and reset
Implements the three basic operations provided by the stack's control
interface to WiMAX devices:
- Messaging channel between user space and driver/device
This implements a direct communication channel between user space
and the driver/device, by which free form messages can be sent back
and forth.
This is intended for device-specific features, vendor quirks, etc.
- RF-kill framework integration
Provide most of the RF-Kill integration for WiMAX drivers so that
all device drivers have to do is after wimax_dev_add() is call
wimax_report_rfkill_{hw,sw}() to update initial state and then every
time it changes.
Provides wimax_rfkill() for the kernel to call to set software
RF-Kill status and/or query current hardware and software switch
status.
Exports wimax_rfkill() over generic netlink to user space.
- Reset a WiMAX device
Provides wimax_reset() for the kernel to reset a wimax device as
needed and exports it over generic netlink to user space.
This API is clearly limited, as it still provides no way to do the
basic scan, connect and disconnect in a hardware independent way. The
WiMAX case is more complex than WiFi due to the way networks are
discovered and provisioned.
The next developments are to add the basic operations so they can be
offerent by different drivers. However, we'd like to get more vendors
to jump in and provide feedback of how the user/kernel API/abstraction
layer should be.
The user space code for the i2400m, as of now, uses the messaging
channel, but that will change as the API evolves.
Add an EXPORT_SYMBOL() to genl_unregister_mc_group(), to allow
unregistering groups on the run. EXPORT_SYMBOL_GPL() is not used as
the rest of the functions exported by this module (eg:
genl_register_mc_group) are also not _GPL().
Cleanup is currently done when unregistering a family, but there is
no way to unregister a single multicast group due to that function not
being exported. Seems to be a mistake as it is documented as for
external consumption.
This is needed by the WiMAX stack to be able to cleanup unused mc
groups.
Implements the basic life cycles of a 'struct wimax_dev', some common
generic netlink functionality for marshalling calls to user space,
and the device state machine.
For looking up net devices based on their generic netlink family IDs,
use a low overhead method that optimizes for the case where most
systems have a single WiMAX device, or at most, a very low number of
WiMAX adaptors.
wimax: debug macros and debug settings for the WiMAX stack
This file contains a simple debug framework that is used in the stack;
it allows the debug level to be controlled at compile-time (so the
debug code is optimized out) and at run-time (for what wasn't compiled
out).
This is eventually going to be moved to use dynamic_printk(). Just
need to find time to do it.
debugfs: add helpers for exporting a size_t simple value
In the same spirit as debugfs_create_*(), introduce helpers for
exporting size_t values over debugfs.
The only trick done is that the format verifier is kept at %llu
instead of %zu; otherwise type warnings would pop up:
format ‘%zu’ expects type ‘size_t’, but argument 2 has type ‘long long unsigned int’
There is no real way to fix this one--however, we can consider %llu
and %zu to be compatible if we consider that we are using the same for
validating in debugfs_create_{x,u}{8,16,32}().
USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible. In the
few places that will not work out, use a basic printk().
Now that all in-tree users are gone, remove the macro.
SangSu Park [Thu, 1 Jan 2009 16:11:14 +0000 (01:11 +0900)]
USB: Fix goku_udc usb speed handling
The usb gadget framework revealed weakness in the godu_udc
gadget driver register function. Instead of checking if
speed asked for was USB_LOW_SPEED upon usb_gadget_register()
to deny service, it checked only for USB_FULL_SPEED, thus
denying service to usb high speed capable gadgets.
Signed-off-by: SangSu Park <sangsu@gmail.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 31 Dec 2008 16:31:33 +0000 (11:31 -0500)]
USB: re-enable interface after driver unbinds
This patch (as1197) fixes an error introduced recently. Since a
significant number of devices can't handle Set-Interface requests, we
no longer call usb_set_interface() when a driver unbinds from an
interface, provided the interface is already in altsetting 0. However
the interface still does get disabled, and the call to
usb_set_interface() was the only thing re-enabling it. Since the
interface doesn't get re-enabled, further attempts to use it fail.
So the patch adds a call to usb_enable_interface() when a driver
unbinds and the interface is in altsetting 0. For this to work
right, the interface's endpoints have to be re-enabled but their
toggles have to be left alone. Therefore an additional argument is
added to usb_enable_endpoint() and usb_enable_interface(), a flag
indicating whether or not the endpoint toggles should be reset.
This is a forward-ported version of a patch which fixes Bugzilla
#12301.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: David Roka <roka@dawid.hu> Reported-by: Erik Ekman <erik@kryo.se> Tested-by: Erik Ekman <erik@kryo.se> Tested-by: Alon Bar-Lev <alon.barlev@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 19 Dec 2008 15:27:56 +0000 (10:27 -0500)]
USB: cancel pending Set-Config requests if userspace gets there first
This patch (as1195) eliminates a potential problem identified by
Oliver Neukum. When a driver queues an asynchronous Set-Config
request using usb_driver_set_configuration(), the request should be
cancelled if userspace changes the configuration first. The patch
introduces a linked list of pending async Set-Config requests, and
uses it to invalidate the requests for a particular device whenever
that device's configuration is set.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 17 Dec 2008 22:20:38 +0000 (17:20 -0500)]
USB: automatically enable wakeup for PCI host controllers
This patch (as1193b) enables wakeup during initialization for all PCI
host controllers, and it removes some code (and comments!) that are no
longer needed now that the PCI core automatically initializes wakeup
settings for all new devices.
The idea is that the bus should initialize wakeup, and the bus glue
or controller driver should enable it.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 17 Dec 2008 20:06:03 +0000 (15:06 -0500)]
USB: fix up suspend and resume for PCI host controllers
This patch (as1192) rearranges the USB PCI host controller suspend and
resume and resume routines:
Use pci_wake_from_d3() for enabling and disabling wakeup,
instead of pci_enable_wake().
Carry out the actual state change while interrupts are
disabled.
Change the order of the preparations to agree with the
general recommendation for PCI devices, instead of
messing around with the wakeup settings while the device
is in D3.
In .suspend:
Call the underlying driver to disable IRQ
generation;
pci_wake_from_d3(device_may_wakeup());
pci_disable_device();
In .suspend_late:
pci_save_state();
pci_set_power_state(D3hot);
(for PPC_PMAC) Disable ASIC clocks
In .resume_early:
(for PPC_PMAC) Enable ASIC clocks
pci_set_power_state(D0);
pci_restore_state();
In .resume:
pci_enable_device();
pci_set_master();
pci_wake_from_d3(0);
Call the underlying driver to reenable IRQ
generation
Add the necessary .suspend_late and .resume_early method
pointers to the PCI host controller drivers.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 18 Dec 2008 21:41:49 +0000 (16:41 -0500)]
USB: storage: set CAPACITY_HEURISTICS flag for bad vendors
This patch (as1194) makes usb-storage set the CAPACITY_HEURISTICS flag
for all devices made by Nokia, Nikon, or Motorola. These companies
seem to include the READ CAPACITY bug in all of their devices.
Since cell phones and digital cameras rely on flash storage, which
always has an even number of sectors, setting CAPACITY_HEURISTICS
shouldn't cause any problems. Not even if the companies wise up and
start making devices without the bug.
A large number of unusual_devs entries are now unnecessary, so the
patch removes them.
Alan Stern [Mon, 15 Dec 2008 15:40:06 +0000 (10:40 -0500)]
USB: storage: make the "quirks=" module parameter writable
This patch (as1190) makes usb-storage's "quirks=" module parameter
writable, so that users can add entries for their devices at runtime
with no need to reboot or reload usb-storage.
New codes are added for the SANE_SENSE, CAPACITY_HEURISTICS, and
CAPACITY_OK flags.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Mon, 15 Dec 2008 17:43:41 +0000 (12:43 -0500)]
USB: storage: add last-sector hacks
This patch (as1189b) adds some hacks to usb-storage for dealing with
the growing problems involving bad capacity values and last-sector
accesses:
A new flag, US_FL_CAPACITY_OK, is created to indicate that
the device is known to report its capacity correctly. An
unusual_devs entry for Linux's own File-backed Storage Gadget
is added with this flag set, since g_file_storage always
reports the correct capacity and since the capacity need
not be even (it is determined by the size of the backing
file).
An entry in unusual_devs.h which has only the CAPACITY_OK
flag set shouldn't prejudice libusual, since the device will
work perfectly well with either usb-storage or ub. So a
new macro, COMPLIANT_DEV, is added to let libusual know
about these entries.
When a last-sector access succeeds and the total number of
sectors is odd (the unexpected case, in which guessing that
the number is even might cause trouble), a WARN is triggered.
The kerneloops.org project will collect these warnings,
allowing us to add CAPACITY_OK flags for the devices in
question before implementing the default-to-even heuristic.
If users want to prevent the stack dump produced by the WARN,
they can disable the hack by adding an unusual_devs entry
for their device with the CAPACITY_OK flag.
When a last-sector access fails three times in a row and
neither the FIX_CAPACITY nor the CAPACITY_OK flag is set,
we assume the last-sector bug is present. We replace the
existing status and sense data with values that will cause
the SCSI core to fail the access immediately rather than
retry indefinitely. This should fix the difficulties
people have been having with Nokia phones.
David Brownell [Thu, 18 Dec 2008 20:25:44 +0000 (12:25 -0800)]
USB: otg: twl4030 transceiver driver
Add driver for the high speed USB-OTG transceiver in TI's TWL4030
family of chips.
Given this and various other pending patches, OMAP3 hardware like
that from beagleboard.org, gumstix.com (Overo), and openpandora.org
should now have basic USB host and peripheral connectivity with
mainline kernels. Ditto for less widely-available boards.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Thomas Hommel [Thu, 18 Dec 2008 09:31:40 +0000 (10:31 +0100)]
USB: isp1760: don't auto disable Port1 on ISP1761
There is no need to disable port 1 on ISP1761. That port could
be used as an OTG port which would require a different init
sequence. However we don't have OTG support (yet) so we can use
it as a normal USB port.
This patch allows port 1 to be used a normal Port on the ISP1761.
Signed-off-by: Thomas Hommel <Thomas.Hommel@gefanuc.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dan Williams [Sun, 14 Dec 2008 17:39:22 +0000 (12:39 -0500)]
USB: unusual dev for Option N.V. ZeroCD modems
Many newer Option mobile broadband devices initially provide a
usb-storage "driver CD" device that's pretty useless on Linux since
any software on it most likely wouldn't be compatible with your
kernel or distro anyway. Thus, by default just kill the driver
CD device by sending the SCSI 'rezero' command, but allow override
of the default behavior via usb-storage module parameter so users
can keep the ZeroCD device if they really want to. Inspired by
the Sierra TruInstall patch.
Signed-off-by: Dan Williams <dcbw@redhat.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: Peter Henn <p.henn@option.com Cc: Denis Joseph Barrow <D.Barow@option.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Ming Lei [Fri, 12 Dec 2008 13:38:45 +0000 (21:38 +0800)]
USB: mark "reject" field of struct urb as atomic_t
It is enough to protect accesses to reject field of urb
by marking it as atomic_t,also it is the only reason of
existence of usb_reject_lock,so remove the lock to make
code more clean.
Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 5 Dec 2008 19:10:34 +0000 (14:10 -0500)]
USB: utilize the bus notifiers
This patch (as1185) makes usbcore take advantage of the bus
notifications sent out by the driver core. Now we can create all our
device and interface attribute files before the device or interface
uevent is broadcast.
A side effect is that we no longer create the endpoint "pseudo"
devices at the same time as a device or interface is registered -- it
seems like a bad idea to try registering an endpoint before the
registration of its parent is complete. So the routines for creating
and removing endpoint devices have been split out and renamed, and
they are called explicitly when needed. A new bitflag is used for
keeping track of whether or not the interface's endpoint devices have
been created, since (just as with the interface attributes) they vary
with the altsetting and hence can be changed at random times.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Mon, 1 Dec 2008 15:36:15 +0000 (10:36 -0500)]
USB: usb-storage: merge DPCM support into SDDR09
The DPCM subdriver is a little peculiar, in that it's meant to support
devices where LUN 0 is Compact Flash and uses the CB transport whereas
LUN 1 is SmartMedia and uses the SDDR09 transport. Thus DPCM isn't
really a transport in itself; it's more like a demultiplexer.
Much of the DPCM code is part of the SDDR09 subdriver already, and the
remaining part is fairly small. This patch (as1182) moves that extra
piece into sddr09.c, thereby eliminating dpcm.c. Also eliminated is
the Kconfig entry for DPCM support; it is now listed as part of the
SDDR09 entry.
In order to make sure that the semantics are the same as before, each
unusual_devs entry for DPCM is now present twice: once with DPCM
support if SDDR09 is configured (as before), and once with the
SINGLE_LUN flag and CB support otherwise.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: option: increase outgoing buffer size and number
This should speed up the option driver's upload speed quite a bit. It has been tested by a number of different people on different devices with success.
Cc: Roland Wolters <roland.wolters@credativ.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Karl Bongers [Mon, 1 Dec 2008 10:47:40 +0000 (11:47 +0100)]
USB: isp1760: Fix probe in PCI glue code
Contains fixes so probe on x86 PCI runs, apparently I'm first to try
this. Several fixes to memory access to probe host scratch register.
Previously would bug check on chip_addr var used uninitialized.
Scratch reg write failed in one instance due to 16-bit initial access
mode, so added "& 0x0000ffff" to the readl as fix.
Includes some general cleanup - remove global vars, organize memory map
resource use.
Signed-off-by: Karl Bongers <kbongers@jged.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: isp1760: use a specific PLX bridge instead of any bdridge
this driver can't handle (of course) any brdige class devices. So we
now are just active on one specific bridge which should be only the
isp1761 chip behind a PLX bridge.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Tested-by: Karl Bongers <kblists08@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Tue, 25 Nov 2008 21:39:18 +0000 (16:39 -0500)]
USB: Enhance usage of pm_message_t
This patch (as1177) modifies the USB core suspend and resume
routines. The resume functions now will take a pm_message_t argument,
so they will know what sort of resume is occurring. The new argument
is also passed to the port suspend/resume and bus suspend/resume
routines (although they don't use it for anything but debugging).
In addition, special pm_message_t values are used for user-initiated,
device-initiated (i.e., remote wakeup), and automatic suspend/resume.
By testing these values, drivers can tell whether or not a particular
suspend was an autosuspend. Unfortunately, they can't do the same for
resumes -- not until the pm_message_t argument is also passed to the
drivers' resume methods. That will require a bigger change.
IMO, the whole Power Management framework should have been set up this
way in the first place.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Tue, 25 Nov 2008 21:40:02 +0000 (16:40 -0500)]
USB: utilize round_jiffies_up_relative()
This patch (as1178) uses the new round_jiffies_up_relative() routine
for setting the autosuspend delayed_work timer. It's appropriate
since we don't care too much about the exact length of the delay, but
we don't want it to be too short (rounded down).
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Lindgren [Mon, 24 Nov 2008 20:02:21 +0000 (12:02 -0800)]
USB: otg: sharable otg transceiver ops
Move otg_get/set/put_transceiver() from omap specific code
to common otg.c so other upcoming drivers can share them.
[ dbrownell@users.sourceforge.net: move to drivers/usb/otg, dox ]
Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <me@felipebalbi.com> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Philipp Zabel [Mon, 24 Nov 2008 20:01:17 +0000 (12:01 -0800)]
USB: otg: add otg_put_transceiver()
As Russell King points out, calling put_device(otg_transceiver->dev)
directly in driver cleanup paths makes assumptions about otg_transceiver
internals.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Philipp Zabel [Mon, 24 Nov 2008 20:00:01 +0000 (12:00 -0800)]
USB: otg: gpio_vbus transceiver stub
gpio_vbus provides simple GPIO VBUS sensing for peripheral
controllers with an internal transceiver.
Optionally, a second GPIO can be used to control D+ pullup.
It also interfaces with the regulator framework to limit charging
currents when powered via USB. gpio_vbus requests the regulator
supplying "vbus_draw" and can enable/disable it or limit its
current depending on USB state.
[dbrownell@users.sourceforge.net: use drivers/otg, cleanups ]
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Mon, 24 Nov 2008 19:53:35 +0000 (11:53 -0800)]
USB: move isp1301_omap to drivers/usb/otg
This moves the isp1301-omap driver from the drivers/i2c/chips
directory (which will be shrinking) into a new drivers/usb/otg
directory (which will grow, with more drivers and utilities).
Note that OTG infrastructure needs to be initialized before
either host or peripheral side USB support, and may be needed
before for pure host or pure peripheral configurations.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Mon, 24 Nov 2008 19:43:30 +0000 (11:43 -0800)]
USB: gadget: pxa25x_udc vbus sense initialization
Some code in the pxa25x_udc driver wrongly expects the value
of is_vbus_present() to be 0/1, not zero/nonzero ... cope.
Issue noted by Jaya Kumar <jayakumar.lkml@gmail.com>
This bug has been around since July 2007, and has a simple
workaround: unplug the Linux gadget, then re-plug it.
David Brownell [Mon, 24 Nov 2008 11:06:50 +0000 (13:06 +0200)]
USB: musb: host side diagnostics tweaks
Random host-side MUSB updates, mostly relating to better diagnostics:
+ Improve diagnostics on host side:
- tx flush fifo:
* Avoid hundreds of duplicate TX FIFONOTEMPTY messages
* make "Can't flush TX fifo" a warning, and say which endpoint
- giveback:
* use correct status code
* show completion function name not just URB pointer
- Fix annoying "1 bytes" (should be "1 byte")
+ Be more consistent about failing init of unusable fifo_mode
It's not clear why that "can't flush TX fifo" message appears, though
it might relate to disconnection; I see it not infrequently
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Mon, 24 Nov 2008 11:06:47 +0000 (13:06 +0200)]
USB: musb: sysfs mode updates
Fix three omissions in the "mode" sysfs attribute support:
(a) inability to report errors;
(b) no DaVinci support ... just report an error;
(c) for omap2430, accepting unsupportable values
The 2430 stuff is still odd....
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Rusty Russell [Sat, 22 Nov 2008 02:31:06 +0000 (13:01 +1030)]
USB: Don't use __module_param_call; use core_param.
Impact: cleanup
Found this when I changed args to __module_param_call. We now have
core_param for exactly this, but Greg assures me "nousb" is used as a
module parameter, so we need the #ifdef MODULE.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 21 Nov 2008 16:46:17 +0000 (11:46 -0500)]
USB: storage: set bounce limit for non-DMA-capable host controllers
This patch (as1175) makes usb-storage set a SCSI device's
request-queue bounce limit such that all buffers will be located in
addressable memory (i.e., not in high memory) if the host controller's
dma_mask is NULL. This is necessary when the host controller doesn't
support DMA: If a buffer is in high memory then the both the virtual
and DMA addresses produced by the scatter-gather library will be NULL,
preventing the HCD from accessing the buffer's data.
In particular, the isp1760 driver needs this when used on a system
with more than 1 GB of memory.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Acked-by: Jens Axboe <jens.axboe@oracle.com> Tested-by: Thomas Hommel <Thomas.Hommel@gefanuc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 20 Nov 2008 19:22:18 +0000 (14:22 -0500)]
USB: usb-storage: merge ATAPI and QIC-157 protocol routines
This patch (as1174) merges usb-storage's QIC-157 and ATAPI protocol
routines. Since the two functions are identical, there's no reason to
keep them separate.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 20 Nov 2008 19:20:03 +0000 (14:20 -0500)]
USB: usb-storage: merge CB and CBI transport routines
This patch (as1173) merges usb-storage's CB and CBI transports into a
single routine. So much of their code is common, it's silly to keep
them separate.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 20 Nov 2008 19:13:12 +0000 (14:13 -0500)]
USB: g_file_storage: add CD-ROM emulation
This patch (as1172) adds the ability to emulate a CD-ROM drive to
g_file_storage. The emulation is limited, since it presents as a disc
containing a single data track and no audio tracks. Still, it may
come in useful on occasion.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Ben Efros [Tue, 18 Nov 2008 21:31:13 +0000 (13:31 -0800)]
USB: storage devices and SAT
Add the SANE SENSE flag to indicate that a device is capable of handling
more than 18-bytes of sense data. This functionality is required for
USB-ATA bridges implementing SAT. A future patch will actually enable this
function for several devices.
The logic behind this is that we can detect support for SANE_SENSE in a few ways:
1) ATA PASS THROUGH (12) or (16) execute successfully
2) SPC-3 or higher is in use
3) A previous CHECK CONDITION occurred with sense format 70-73 and had
a length greater than 18-bytes total
Signed-off-by: Ben Efros <ben@pc-doctor.com> Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Thu, 13 Nov 2008 20:08:30 +0000 (15:08 -0500)]
USB: announce new devices earlier
This patch (as1166) changes usb_new_device(). Now new devices will be
announced in the log _prior_ to being registered; this way the "new
device" lines will appear before all the output from driver probing,
which seems much more logical.
Also, the patch adds a call to usb_stop_pm() to the failure pathway,
so that the parent's count of unsuspended children will remain correct
if registration fails. In order for this to work properly, the code
to increment that count has to be moved forward, before the first
point where a failure can occur.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Pete Zaitcev [Fri, 14 Nov 2008 04:31:21 +0000 (21:31 -0700)]
USB: Allow usbmon as a module even if usbcore is builtin
usbmon can only be built as a module if usbcore is a module too. Trivial
changes to the relevant Kconfig and Makefile (and a few trivial changes
elsewhere) allow usbmon to be built as a module even if usbcore is
builtin.
This is verified to work in all 9 permutations (3 correctly prohibited
by Kconfig, 6 build a suitable result).
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Magnus Damm [Thu, 13 Nov 2008 06:46:37 +0000 (15:46 +0900)]
USB: m66592 and r8a66597 resource changes
Use the more common platform_get_resource() together with index instead
of depending on the resource name and platform_get_resource_by_name().
Replace the resource_len() implementation with resource_size().
USB: Introduce usb_queue_reset() to do resets from atomic contexts
This patch introduces a new call to be able to do a USB reset from an
atomic contect. This is quite helpful in USB callbacks to handle
errors (when the only thing that can be done is to do a device
reset).
It is done queuing a work struct that will do the actual reset. The
struct is "attached" to an interface so pending requests from an
interface are removed when said interface is unbound from the driver.
Note usb_cancel_queue_reset() needs smarts to try not to unqueue when
it is actually being executed. This happens when we run the reset from
the workqueue: usb_reset_device() is called and on interface unbind
time, usb_cancel_queue_reset() would be called. That would deadlock on
cancel_work_sync(). To avoid that, we set (before running
usb_reset_device()) usb_intf->reset_running and clear it inmediately
after returning.
Patch is against 2.6.28-rc2 and depends on
http://marc.info/?l=linux-usb&m=122581634925308&w=2 (as submitted by
Alan Stern).
Alan Stern [Wed, 12 Nov 2008 21:19:49 +0000 (16:19 -0500)]
USB: add asynchronous autosuspend/autoresume support
This patch (as1160b) adds support routines for asynchronous autosuspend
and autoresume, with accompanying documentation updates. There
already are several potential users of this interface, and others are
likely to arise as autosuspend support becomes more widespread.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Mon, 10 Nov 2008 19:07:45 +0000 (14:07 -0500)]
USB: usb-storage: add "quirks=" module parameter
This patch (as1163b) adds a "quirks=" module parameter to usb-storage.
This will allow people to make short-term changes to their
unusual_devs list without rebuilding the entire driver. Testing will
become much easier, and less-sophisticated users will be able to
access their buggy devices after a simple config-file change instead
of having to wait for a new kernel release.
The patch also adds a documentation entry for usb-storage's
"delay_use" parameter, which has been around for years but but was
never listed among the kernel parameters.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Vitaly Bordug [Sun, 9 Nov 2008 18:43:30 +0000 (19:43 +0100)]
USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]
A published errata for ppc440epx states, that when running Linux with
both EHCI and OHCI modules loaded, the EHCI module experiences a fatal
error when a high-speed device is connected to the USB2.0, and
functions normally if OHCI module is not loaded.
There used to be recommendation to use only hi-speed or full-speed
devices with specific conditions, when respective module was unloaded.
Later, it was observed that ohci suspend is enough to keep things
going, and it was turned into workaround, as explained below.
Quote from original descriprion:
The 440EPx USB 2.0 Host controller is an EHCI compliant controller. In
USB 2.0 Host controllers, each EHCI controller has one or more companion
controllers, which may be OHCI or UHCI. An USB 2.0 Host controller will
contain one or more ports. For each port, only one of the controllers
is connected at any one time. In the 440EPx, there is only one OHCI
companion controller, and only one USB 2.0 Host port.
All ports on an USB 2.0 controller default to the companion
controller. If you load only an ohci driver, it will have control of
the ports and any deviceplugged in will operate, although high speed
devices will be forced to operate at full speed. When an ehci driver
is loaded, it explicitly takes control of the ports. If there is a
device connected, and / or every time there is a new device connected,
the ehci driver determines if the device is high speed or not. If it
is high speed, the driver retains control of the port. If it is not,
the driver explicitly gives the companion controller control of the
port.
The is a software workaround that uses
Initial version of the software workaround was posted to
linux-usb-devel:
and later available from amcc.com:
http://www.amcc.com/Embedded/Downloads/download.html?cat=1&family=15&ins=2
The patch below is generally based on the latter, but reworked to
powerpc/of_device USB drivers, and uses a few devicetree inquiries to
get rid of (some) hardcoded defines.
Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org> Signed-off-by: Stefan Roese <sr@denx.de> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>