pandora-kernel.git
16 years agoMerge branch 'master' into upstream
Jeff Garzik [Wed, 27 Sep 2006 22:13:53 +0000 (18:13 -0400)]
Merge branch 'master' into upstream

16 years agoMerge branch 'upstream' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 into tmp
Jeff Garzik [Wed, 27 Sep 2006 22:01:53 +0000 (18:01 -0400)]
Merge branch 'upstream' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 into tmp

16 years ago[PATCH] spidernet: Use pci_dma_mapping_error()
Olof Johansson [Wed, 27 Sep 2006 19:02:26 +0000 (14:02 -0500)]
[PATCH] spidernet: Use pci_dma_mapping_error()

A driver shouldn't compare to DMA_ERROR_CODE directly, use
pci_dma_mapping_error() instead.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: version 1.9
Stephen Hemminger [Tue, 26 Sep 2006 18:57:44 +0000 (11:57 -0700)]
[PATCH] sky2: version 1.9

Version 1.9 is for 2.6.19.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: fragmented receive for large MTU
Stephen Hemminger [Tue, 26 Sep 2006 18:57:43 +0000 (11:57 -0700)]
[PATCH] sky2: fragmented receive for large MTU

Use hardware support for chained receive to break up large frames
into multiple pages. This avoids having to do a mult-page allocation
that can fail on a busy system due to fragmented memory.

For normal size MTU, this code behaves the same.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: use netif_tx_lock instead of LLTX
Stephen Hemminger [Tue, 26 Sep 2006 18:57:42 +0000 (11:57 -0700)]
[PATCH] sky2: use netif_tx_lock instead of LLTX

Use the netdevice transmit lock via netif_tx_lock rather than putting
lock in device specific code and using lockless transmit.  The code is
cleaner using netif_tx_lock, and the performance is same.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: incremental transmit completion
Stephen Hemminger [Tue, 26 Sep 2006 18:57:41 +0000 (11:57 -0700)]
[PATCH] sky2: incremental transmit completion

Since a transmit can take several control blocks, the old code waited
until the last control block was marked as done. This code processes
the return values incrementally. This makes slots in the tx ring available
and less chance of getting stuck.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: name irq after eth for irqbalance
Stephen Hemminger [Tue, 26 Sep 2006 18:57:40 +0000 (11:57 -0700)]
[PATCH] sky2: name irq after eth for irqbalance

Use the ethernet device name when requesting the irq because the
irqbalance daemon looks for the name when deciding policy.
Better to play along with this dubious heuristic.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: workarounds for some 88e806x chips
Stephen Hemminger [Tue, 26 Sep 2006 18:57:39 +0000 (11:57 -0700)]
[PATCH] sky2: workarounds for some 88e806x chips

Workarounds for 88e806x chips from the vendor driver.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: use standard pci register capabilties for error register
Stephen Hemminger [Tue, 26 Sep 2006 18:57:38 +0000 (11:57 -0700)]
[PATCH] sky2: use standard pci register capabilties for error register

Use the standard pci capability mechanism to access PCI express error
registers, rather than hard coding the offset. Mask off the PCI express
error from ever occuring on non-PCI express systems.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] sky2: gigabit full duplex negotiation
Stephen Hemminger [Tue, 26 Sep 2006 18:57:37 +0000 (11:57 -0700)]
[PATCH] sky2: gigabit full duplex negotiation

Look at the registers correctly, when doing gigabit full duplex.
Need to look for link partner result.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Wed, 27 Sep 2006 21:41:24 +0000 (14:41 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (48 commits)
  [PATCH] bonding: update version number
  [PATCH] git-netdev-all: pc300_tty build fix
  [PATCH] Make PC300 WAN driver compile again
  [PATCH] Modularize generic HDLC
  [PATCH] more s2io __iomem annotations
  [PATCH] restore __iomem annotations in e1000
  [PATCH] 64bit bugs in s2io
  [PATCH] bonding: Fix primary selection error at enslavement time
  [PATCH] bonding: Don't mangle LACPDUs
  [PATCH] bonding: Validate probe replies in ARP monitor
  [PATCH] bonding: Don't release slaves when master is admin down
  [PATCH] bonding: Add priv_flag to avoid event mishandling
  [PATCH] bonding: Handle large hard_header_len
  [PATCH] bonding: Remove unneeded NULL test
  [PATCH] bonding: Format fix in seq_printf call
  [PATCH] bonding: Convert delay value from s16 to int
  [PATCH] bonding: Allow bonding to enslave a 10 Gig adapter
  Delete unused drivers/net/gt64240eth.h
  [PATCH] skge: fiber support
  [PATCH] fix possible NULL ptr deref in forcedeth
  ...

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Wed, 27 Sep 2006 21:41:00 +0000 (14:41 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  [libata] Don't use old-EH ->eng_timeout() hook when not needed
  [libata] sata_mv: fix oops by filling in missing hook
  [libata] One more s/15/ATA_SECONDARY_IRQ/ substitution
  [libata] pata_serverworks: fill in ->irq_clear hook
  [PATCH] pata_serverworks: correct PCI ID in cable detection table
  [PATCH] libata-sff: use our IRQ defines
  [PATCH] libata-eh: Remove layering violation and duplication when handling absent ports
  [PATCH] libata: tighten rules for legacy dependancies
  [PATCH] libata: refuse to register IRQless ports

16 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
Linus Torvalds [Wed, 27 Sep 2006 21:40:30 +0000 (14:40 -0700)]
Merge /pub/scm/linux/kernel/git/gregkh/usb-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (129 commits)
  [PATCH] USB Storage: fix Rio Karma eject support build error
  USB: Airprime driver improvements to allow full speed EvDO transfers
  USB: remove OTG build warning
  USB: EHCI update VIA workaround
  USB: force root hub resume after power loss
  USB: ohci_usb can oops on shutdown
  USB: Dealias -110 code (more complete)
  USB: Remove unneeded void * casts in core files
  USB: u132-hcd: host controller driver for ELAN U132 adapter
  USB: ftdi-elan: client driver for ELAN Uxxx adapters
  usb serial: support Alcor Micro Corp. USB 2.0 TO RS-232 through pl2303 driver
  USB: Moschip 7840 USB-Serial Driver
  USB: add PlayStation 2 Trance Vibrator driver
  USB: Add ADU support for Ontrak ADU devices
  aircable: fix printk format warnings
  Add AIRcable USB Bluetooth Dongle Driver
  cypress_m8: implement graceful failure handling
  cypress_m8: improve control endpoint error handling
  cypress_m8: use usb_fill_int_urb where appropriate
  cypress_m8: use appropriate URB polling interval
  ...

16 years ago[PATCH] i386: Use early clobbers for semaphores now
Andi Kleen [Wed, 27 Sep 2006 19:38:56 +0000 (21:38 +0200)]
[PATCH] i386: Use early clobbers for semaphores now

The new code does clobber the result early, so make sure to tell
gcc to not put it into the same register as a input argument

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@osdl.org>
Acked-by: Kyle McMartin <kyle@parisc-linux.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
16 years ago[PATCH] bonding: update version number
Jay Vosburgh [Tue, 26 Sep 2006 17:55:00 +0000 (10:55 -0700)]
[PATCH] bonding: update version number

I neglected to properly update the version number in the recent
patch series; this sets it to something reasonable.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[PATCH] git-netdev-all: pc300_tty build fix
Andrew Morton [Wed, 27 Sep 2006 07:40:36 +0000 (00:40 -0700)]
[PATCH] git-netdev-all: pc300_tty build fix

In file included from drivers/net/wan/pc300_tty.c:59:
drivers/net/wan/pc300.h:335: error: field 'pppdev' has incomplete type

Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoe100, e1000, ixgb: increment version numbers
Auke Kok [Wed, 27 Sep 2006 19:54:22 +0000 (12:54 -0700)]
e100, e1000, ixgb: increment version numbers

e100-3.5.17-k2
e1000-7.2.9-k2
ixgb-1.0.117-k2

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoixgb: convert to netdev_priv(netdev)
Auke Kok [Wed, 27 Sep 2006 19:54:19 +0000 (12:54 -0700)]
ixgb: convert to netdev_priv(netdev)

PCI error recovery code recently merged needs to use netdev_priv

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoixgb: combine more rx descriptors to improve performance
Jesse Brandeburg [Wed, 27 Sep 2006 19:54:17 +0000 (12:54 -0700)]
ixgb: combine more rx descriptors to improve performance

We experimented with more descriptor buffer writebacks and found that
values larger than 8 give HW problems, but 8 is safe and gives us some
improved performance.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: possible memory leak in e1000_set_ringparam
Vasily Averin [Wed, 27 Sep 2006 19:54:14 +0000 (12:54 -0700)]
e1000: possible memory leak in e1000_set_ringparam

Memory allocated for new tx_ring and rx_ring leaks if
e1000_setup_XX_resources() fails.c Also this patch reduces stack usage
(removed tx_new and rx_new) and uses kzalloc instead kmalloc+memset(0)

Signed-off-by: Vasily Averin <vvs@sw.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: Janitor: Use #defined values for literals
Linas Vepstas [Wed, 27 Sep 2006 19:54:11 +0000 (12:54 -0700)]
e1000: Janitor: Use #defined values for literals

Minor janitorial patch: use #defines for literal values.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: don't strip vlan ID if 8021q claims it
Bruce Allan [Wed, 27 Sep 2006 19:54:08 +0000 (12:54 -0700)]
e1000: don't strip vlan ID if 8021q claims it

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: rework polarity, NVM, eeprom code and fixes.
Jeff Kirsher [Wed, 27 Sep 2006 19:54:05 +0000 (12:54 -0700)]
e1000: rework polarity, NVM, eeprom code and fixes.

Several minor issues exist in the low-level device handling code of
e1000. The NVM and EEPROM writing/reading code was updated which fixes
unneeded delays, adds proper eeprom aqcuiring steps and handle shadow
ram and flash access. Minor cosmetic adjustments to the polarity code
adding symbols. PHY reset code mistakenly distinguished between MAC
types instead of PHY types, and was fixes.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: driver state fixes (race fix)
Auke Kok [Wed, 27 Sep 2006 19:54:02 +0000 (12:54 -0700)]
e1000: driver state fixes (race fix)

We were plagued by our interrupt handler posting a watchdog event which
could occur when our adapter was going down in case a late packet arrived
just before e1000_down() finished. This caused the watchdog timer to start
after the NIC was down and keep rescheduling it every N seconds. Once
the driver unloaded it would panic.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: reduce RAR entries available for ICH8
Jeff Kirsher [Wed, 27 Sep 2006 19:53:59 +0000 (12:53 -0700)]
e1000: reduce RAR entries available for ICH8

Manageability is using one more RAR entry than we anticipated earlier
for ICH8.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: add PCI-E capability detection code
Jeff Kirsher [Wed, 27 Sep 2006 19:53:57 +0000 (12:53 -0700)]
e1000: add PCI-E capability detection code

Add code to display the detected PCI-E bus width.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: handle manageability for pci-e adapters at PHY powerdown
Bruce Allan [Wed, 27 Sep 2006 19:53:54 +0000 (12:53 -0700)]
e1000: handle manageability for pci-e adapters at PHY powerdown

When powering down the PHY (if WoL is disabled) we should only check
copper PHY's and handle PCI-E adapters differently.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: gather hardware bit tweaks.
Jeff Kirsher [Wed, 27 Sep 2006 19:53:51 +0000 (12:53 -0700)]
e1000: gather hardware bit tweaks.

Several hardware bits were set all over the driver and have been
consolidated into a single function.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: Maybe stop TX if not enough free descriptors
Jesse Brandeburg [Wed, 27 Sep 2006 19:53:48 +0000 (12:53 -0700)]
e1000: Maybe stop TX if not enough free descriptors

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: Jumbo frames fixes for 82573
Bruce Allan [Wed, 27 Sep 2006 19:53:45 +0000 (12:53 -0700)]
e1000: Jumbo frames fixes for 82573

Disable jumbo frames for 82573L alltogether and when ASPM is enabled
since the hardware has problems with it. For the NICs that do support
this in the 82573 series we set ERT_2048 to attempt to receive as much
traffic as early as we can.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: Fix MANC detection for PCIE adapters
Jeff Kirsher [Wed, 27 Sep 2006 19:53:42 +0000 (12:53 -0700)]
e1000: Fix MANC detection for PCIE adapters

Several manageability capability detection parts hinted towards
our code being incomplete for PCI-E. According to spec, we do not
want to poke any MANC bits at all.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: allow ethtool to pass arbitrary speed advertisment
Jeff Kirsher [Wed, 27 Sep 2006 19:53:40 +0000 (12:53 -0700)]
e1000: allow ethtool to pass arbitrary speed advertisment

With a patch, ethtool can now signify the driver to advertise more
than just a single speed/duplex setting. This allows you to tell the
card to advertise in 10/100 in any speed if you don't have a gigabit
switch for instance.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: add multicast stats counters
Mitch Williams [Wed, 27 Sep 2006 19:53:37 +0000 (12:53 -0700)]
e1000: add multicast stats counters

Add 4 multicast and broadcast hardware counters (rx/tx), and eliminate
as many non-hardware counters as possible.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: remove unused code and make symbols static
Nicholas Nunley [Wed, 27 Sep 2006 19:53:34 +0000 (12:53 -0700)]
e1000: remove unused code and make symbols static

Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: add enums for several link properties
Jeff Kirsher [Wed, 27 Sep 2006 19:53:31 +0000 (12:53 -0700)]
e1000: add enums for several link properties

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: rename flow control symbols
Jeff Kirsher [Wed, 27 Sep 2006 19:53:28 +0000 (12:53 -0700)]
e1000: rename flow control symbols

Sogned-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe100: rework WoL and shutdown handling
Auke Kok [Wed, 27 Sep 2006 19:53:25 +0000 (12:53 -0700)]
e100: rework WoL and shutdown handling

Unify our shutdown/suspend/resume code and make it similar to e1000:
e1000_shutdown now calls suspend which does the exact same thing on
shutdown except saving PCI config state on suspend. WoL setup code
is now also more simple and works even when CONFIG_PM is not set, which
was previously broken.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe100: Add debugging code for cb cleaning.
Jesse Brandeburg [Wed, 27 Sep 2006 19:53:22 +0000 (12:53 -0700)]
e100: Add debugging code for cb cleaning.

Refine cb cleaning debug printout and print out all cleaned cbs' status.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe1000: keep .suspend and .resume driver methods in CONFIG_PM
Auke Kok [Wed, 27 Sep 2006 19:53:19 +0000 (12:53 -0700)]
e1000: keep .suspend and .resume driver methods in CONFIG_PM

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe100, e1000, ixgb: Fix an impossible memory overwrite bug
Auke Kok [Wed, 27 Sep 2006 19:53:17 +0000 (12:53 -0700)]
e100, e1000, ixgb: Fix an impossible memory overwrite bug

We keep getting requests from people that think that this might be
an exploitable hole where we would overwrite 4 bytes in the netdev
struct if the pci name would exceed 15 characters. In reality this
will never happen but we fix it anyway.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years agoe100, e1000, ixgb: update copyright header and remove LICENSE
Auke Kok [Wed, 27 Sep 2006 19:53:14 +0000 (12:53 -0700)]
e100, e1000, ixgb: update copyright header and remove LICENSE

This update to the copyright header adds the mailinglist, and aligns it
with the kernel licensing as well as remove the offending 'all rights
reserved'.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
16 years ago[PATCH] USB Storage: fix Rio Karma eject support build error
Andrew Morton [Tue, 26 Sep 2006 00:00:52 +0000 (17:00 -0700)]
[PATCH] USB Storage: fix Rio Karma eject support build error

In file included from drivers/usb/storage/usb.c:180:
drivers/usb/storage/unusual_devs.h:221: error: 'US_PR_KARMA' undeclared here (not in a function)
drivers/usb/storage/unusual_devs.h:221: error: 'rio_karma_init' undeclared here (not in a function)

Cc: Keith Bennett <keith@mcs.st-and.ac.uk>
Acked-by: Bob Copeland <me@bobcopeland.com>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Airprime driver improvements to allow full speed EvDO transfers
Andy Gay [Mon, 3 Jul 2006 22:43:01 +0000 (18:43 -0400)]
USB: Airprime driver improvements to allow full speed EvDO transfers

Adapted from an earlier patch by Greg KH <gregkh@suse.de>.
That patch added multiple read urbs and larger transfer buffers to allow
data transfers at full EvDO speed.

This version includes additional device IDs and fixes a memory leak in
the transfer buffer allocation.

Some (maybe all?) of the supported devices present multiple bulk endpoints,
the additional EPs can be used for control and status functions,
This version allocates 3 EPs by default, that can be changed using
the 'endpoints' module parameter.

Tested with Sierra Wireless EM5625 and MC5720 embedded modules.

Device ID (0x0c88, 0x17da) for the Kyocera Wireless KPC650/Passport
was added but is not yet tested.

From: Andy Gay <andy@andynet.net>
Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove OTG build warning
David Brownell [Mon, 18 Sep 2006 23:53:26 +0000 (16:53 -0700)]
USB: remove OTG build warning

Somewhere along the line, a variable in a USB-OTG codepath
stopped being used; this removes the relevant compiler warning.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI update VIA workaround
David Brownell [Tue, 19 Sep 2006 00:03:16 +0000 (17:03 -0700)]
USB: EHCI update VIA workaround

This revamps handling of the hardware "async advance" IRQ, and its watchdog
timer.  Basically it dis-entangles that important timeout from the others,
simplifying the associated state and code to make it more robust.

This reportedly improves behavior of EHCI on some systems with VIA chips,
and AFAIK won't affect non-VIA hardware.  VIA systems need this code to
recover from silcon bugs whereby the "async advance" IRQ isn't issued.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: force root hub resume after power loss
Alan Stern [Tue, 19 Sep 2006 14:07:58 +0000 (10:07 -0400)]
USB: force root hub resume after power loss

This patch(as785) forces the PM core to resume a root hub after a
power loss during system sleep.  If the root hub had been suspended
before the system sleep then normally the PM core would not resume it
afterward.  Without this resume, various sorts of wakeup events (like
port change events) can get lost.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ohci_usb can oops on shutdown
Pete Zaitcev [Tue, 19 Sep 2006 05:57:22 +0000 (22:57 -0700)]
USB: ohci_usb can oops on shutdown

When ohci-hcd is shutting down (for rmmod or PC-card removal), there is
a window when the device is shut down, HC communication area (->hcca)
is freed, but the core has not called "free_irq" yet. If another device
triggers a shared interrupt in this window, we oops when trying to
access the freed ->hcca.

This patch removes the window by calling free_irq before ->hcca is freed.

The patch is tested at the PC hotplug test rig at Stratus, and with
rmmod by Rafael Wysocki.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Dealias -110 code (more complete)
Pete Zaitcev [Tue, 19 Sep 2006 05:49:02 +0000 (22:49 -0700)]
USB: Dealias -110 code (more complete)

The purpose of this patch is to split off the case when a device does
not reply on the lower level (which is reported by HC hardware), and
a case when the device accepted the request, but does not reply at
upper level. This redefinition allows to diagnose issues easier,
without asking the user if the -110 happened "immediately".

The usbmon splits such cases already thanks to its timestamp, but
it's not always available.

I adjusted all drivers which I found affected (by searching for "urb").
Out of tree drivers may suffer a little bit, but I do not expect much
breakage. At worst they may print a few messages.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Remove unneeded void * casts in core files
Tobias Klauser [Wed, 13 Sep 2006 19:38:41 +0000 (21:38 +0200)]
USB: Remove unneeded void * casts in core files

The patch removes unneeded casts for the following (void *) pointers:
 - struct file: private
 - struct urb: context
 - struct usb_bus: hcpriv
 - return value of kmalloc()

The patch also contains some whitespace cleanup in the relevant areas.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: u132-hcd: host controller driver for ELAN U132 adapter
Tony Olech [Wed, 13 Sep 2006 10:27:35 +0000 (11:27 +0100)]
USB: u132-hcd: host controller driver for ELAN U132 adapter

This "u132-hcd" module is one half of the "driver" for
ELAN's U132 which is a USB to CardBus OHCI controller
adapter. This module needs the "ftdi-elan" module in
order to communicate to CardBus OHCI controller inserted
into the U132 adapter.

When the "ftdi-elan" module detects a supported CardBus
OHCI controller in the U132 adapter it loads this "u132-hcd"
module.

Upon a successful device probe() the single workqueue
is started up which does all the processing of commands
from the USB core that implement the host controller.

The workqueue maintains the urb queues and issues commands
via the functions exported by the "ftdi-elan" module. Each
such command will result in a callback.

Note that the "ftdi-elan" module is a USB client driver.

Note that this "u132-hcd" module is a (cut-down OHCI)
host controller.

Thus we have a topology with the parent of a host controller
being a USB client! This really stresses the USB subsystem
semaphore/mutex handling in the module removal.

Signed-off-by: Tony Olech <tony.olech@elandigitalsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi-elan: client driver for ELAN Uxxx adapters
Tony Olech [Wed, 13 Sep 2006 10:26:04 +0000 (11:26 +0100)]
USB: ftdi-elan: client driver for ELAN Uxxx adapters

This "ftdi-elan" module is one half of the "driver" for
ELAN's Uxxx series adapters which are USB to PCMCIA CardBus
adapters. Currently only the U132 adapter is available and
it's module is called "u132-hcd".

When the USB hot plug subsystem detects a Uxxx series adapter
it should load this module.

Upon a successful device probe() the jtag device file interface
is created and the status workqueue started up.

The jtag device file interface exists for the purpose of
updating the firmware in the Uxxx series adapter, but as
yet it had never been used.

The status workqueue initializes the Uxxx and then sits there
polling the Uxxx until a supported PCMCIA CardBus device is
detected it will start the command and respond workqueues
and then load the module that handles the device. This will
initially be only the u132-hcd module. The status workqueue
then just polls the Uxxx looking for card ejects.

The command and respond workqueues implement a command
sequencer for communicating with the firmware on the other
side of the FTDI chip in the Uxxx. This "ftdi-elan" module
exports some functions to interface with the sequencer.

Note that this module is a USB client driver.

Note that the "u132-hcd" module is a (cut-down OHCI)
host controller.

Thus we have a topology with the parent of a host controller
being a USB client! This really stresses the USB subsystem
semaphore/mutex handling in the module removal.

Signed-off-by: Tony Olech <tony.olech@elandigitalsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb serial: support Alcor Micro Corp. USB 2.0 TO RS-232 through pl2303 driver
Johannes Steingraeber [Sat, 16 Sep 2006 14:17:34 +0000 (16:17 +0200)]
usb serial: support Alcor Micro Corp. USB 2.0 TO RS-232 through pl2303 driver

Patch to add support for Alcor Micro Corp. USB 2.0 TO RS-232 converter.
This patch adds VID and PID to pl2303.[ch], adds it to the "HORRIBLE
HACK FOR PL2303" in usb-serial.c and also prevents cdc-acm to claim
driving this device by blacklisting it in hid-core.

Signed-off-by: Johannes Steingraeber <Jo_Stein@web.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Moschip 7840 USB-Serial Driver
Paul B Schroeder [Fri, 1 Sep 2006 00:41:47 +0000 (19:41 -0500)]
USB: Moschip 7840 USB-Serial Driver

Signed-off-by: Paul B Schroeder <pschroeder@uplogix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add PlayStation 2 Trance Vibrator driver
Sam Hocevar [Wed, 30 Aug 2006 00:34:56 +0000 (02:34 +0200)]
USB: add PlayStation 2 Trance Vibrator driver

This patch is a driver for the PlayStation 2 specific Trance Vibrator
device. The only thing that device can do is vibrate at various speeds.

Signed-off-by: Sam Hocevar <sam@zoy.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Add ADU support for Ontrak ADU devices
Steven Haigh [Tue, 8 Aug 2006 21:42:06 +0000 (07:42 +1000)]
USB: Add ADU support for Ontrak ADU devices

This patch adds support for Ontrak ADU USB devices.

Fixed for printk issues by Randy Dunlap <rdunlap@xenotime.net>

Signed-off-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoaircable: fix printk format warnings
Randy Dunlap [Sat, 26 Aug 2006 17:56:10 +0000 (10:56 -0700)]
aircable: fix printk format warnings

Fix printk format warnings:
drivers/usb/serial/aircable.c:221: warning: format ‘%Zd’ expects type ‘signed size_t’, but argument 4 has type ‘int’
drivers/usb/serial/aircable.c:283: warning: format ‘%Zd’ expects type ‘signed size_t’, but argument 4 has type ‘int’

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoAdd AIRcable USB Bluetooth Dongle Driver
Manuel Francisco Naranjo [Wed, 9 Aug 2006 19:35:12 +0000 (16:35 -0300)]
Add AIRcable USB Bluetooth Dongle Driver

Add driver for AIRcable USB Bluetooth dongle.

Signed-off-by: Naranjo, Manuel Francisco <naranjo.manuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agocypress_m8: implement graceful failure handling
Mike Isely [Wed, 30 Aug 2006 03:07:11 +0000 (22:07 -0500)]
cypress_m8: implement graceful failure handling

When receiving a fatal error from the USB core, e.g. EILSEQ (which can
happen if the polling interval is too short), fail gracefully.
Previously the driver would fill the log with useless error messages
or (more alarmingly) silently spin forever trying to write updated
control information to the device.  This change implements a new flag
which if cleared indicates that the driver has failed.  The flag will
be set on initialization, cleared on fatal errors, and anything else
that touches the USB port in the driver will abort if the flag is
clear.  When the flag is cleared, a message will be logged indicating
that the driver has failed.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agocypress_m8: improve control endpoint error handling
Mike Isely [Wed, 30 Aug 2006 03:07:07 +0000 (22:07 -0500)]
cypress_m8: improve control endpoint error handling

Fix usb core function error return checks to look for negative errno
values, not positive errno values.  This bug had rendered those checks
useless.  Also remove attempted error recovery on control endpoints
for EPIPE - with control endpoints EPIPE does not indicate a halted
endpoint so trying to recover with usb_clear_halt() is not the correct
action.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agocypress_m8: use usb_fill_int_urb where appropriate
Mike Isely [Wed, 30 Aug 2006 03:07:04 +0000 (22:07 -0500)]
cypress_m8: use usb_fill_int_urb where appropriate

Rather than directly filling in URB fields, it's safer to use
usb_fill_int_urb().  This improves robustness of the driver; URB
changes in the future will not go uninitialized here.  That point not
withstanding, this driver should at least be self-consistent.  Either
use usb_fill_int_urb() everywhere or don't bother with it all.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agocypress_m8: use appropriate URB polling interval
Mike Isely [Wed, 30 Aug 2006 03:06:59 +0000 (22:06 -0500)]
cypress_m8: use appropriate URB polling interval

The polling interval for the device can't always be 1msec.  If it is
too quick, the device can fail causing a fatal (to the driver) EILSEQ
error from the USB core.  The actual correct value is reported by the
device as part of its configuration data, so use that value as the
default.  On a DeLorme Earthmate for example, the device reports that
it wants a 6msec interval.  As part of this fix, the "interval" module
option has been fixed as well; the device's default can be overridden
by specifying interval=<value> as a module option.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix __must_check warnings in drivers/usb/serial/
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
USB: fix __must_check warnings in drivers/usb/serial/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix __must_check warnings in drivers/usb/host/
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
USB: fix __must_check warnings in drivers/usb/host/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix __must_check warnings in drivers/usb/input/
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
USB: fix __must_check warnings in drivers/usb/input/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix __must_check warnings in drivers/usb/class/
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
USB: fix __must_check warnings in drivers/usb/class/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix __must_check warnings in drivers/usb/atm/
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
USB: fix __must_check warnings in drivers/usb/atm/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix __must_check warnings in drivers/usb/misc/
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
USB: fix __must_check warnings in drivers/usb/misc/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix __must_check warnings in drivers/usb/core/
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
USB: fix __must_check warnings in drivers/usb/core/

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix root-hub resume when CONFIG_USB_SUSPEND is not set
Alan Stern [Tue, 19 Sep 2006 14:08:43 +0000 (10:08 -0400)]
USB: fix root-hub resume when CONFIG_USB_SUSPEND is not set

This patch (as786) removes a redundant test and fixes a problem
involving repeated system sleeps when CONFIG_USB_SUSPEND is not set.
During the first wakeup, the root hub's dev.power.power_state.event
field doesn't get updated, causing it not to be suspended during the
second sleep transition.

This takes care of the issue raised by Rafael J. Wysocki and Mattia
Dongili.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: remove usb_suspend_root_hub
Alan Stern [Wed, 30 Aug 2006 19:47:11 +0000 (15:47 -0400)]
usbcore: remove usb_suspend_root_hub

This patch (as740) removes the existing support for autosuspend of
root hubs.  That support fit in rather awkwardly with the rest of
usbcore and it was used only by ohci-hcd.  It won't be needed any more
since the hub driver will take care of autosuspending all hubs, root
or external.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: non-hub-specific uses of autosuspend
Alan Stern [Wed, 30 Aug 2006 19:47:18 +0000 (15:47 -0400)]
usbcore: non-hub-specific uses of autosuspend

This patch (as741) makes the non-hub parts of usbcore actually use the
autosuspend facilities added by an earlier patch.

Devices opened through usbfs are autoresumed and then
autosuspended upon close.

Likewise for usb-skeleton.

Devices are autoresumed for usb_set_configuration.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: add autosuspend/autoresume infrastructure
Alan Stern [Wed, 30 Aug 2006 19:47:02 +0000 (15:47 -0400)]
usbcore: add autosuspend/autoresume infrastructure

This patch (as739) adds the basic infrastructure for USB autosuspend
and autoresume.  The main features are:

PM usage counters added to struct usb_device and struct
usb_interface, indicating whether it's okay to autosuspend
them or they are currently in use.

Flag added to usb_device indicating whether the current
suspend/resume operation originated from outside or as an
autosuspend/autoresume.

Flag added to usb_driver indicating whether the driver
supports autosuspend.  If not, no device bound to the driver
will be autosuspended.

Mutex added to usb_device for protecting PM operations.
Unlike the device semaphore, the locking rule for the pm_mutex
is that you must acquire the locks going _up_ the device tree.

New routines handling autosuspend/autoresume requests for
interfaces and devices.

Suspend and resume requests are propagated up the device tree
(but not outside the USB subsystem).

work_struct added to usb_device, for carrying out delayed
autosuspend requests.

Autoresume added (and autosuspend prevented) during probe and
disconnect.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: store each usb_device's level in the tree
Alan Stern [Wed, 30 Aug 2006 19:46:48 +0000 (15:46 -0400)]
usbcore: store each usb_device's level in the tree

This patch (as778) adds a field to struct usb_device to store the
device's level in the USB tree.  In itself this number isn't really
important.  But the overhead is very low, and in a later patch it will
be used for preventing bogus warnings from the lockdep checker.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: UB: Let cdrecord to see a device with media absent
Pete Zaitcev [Thu, 7 Sep 2006 23:54:22 +0000 (16:54 -0700)]
USB: UB: Let cdrecord to see a device with media absent

The command "cdrecord dev=/dev/uba x.iso" prints nasty garbage if a blank
is not in the drive. This happens because drivers have to set req->errors
separately from just returning zero uptodate with end_that_request_first,
end_that_request_last. These functions only set error in BIO, but sg_io()
ignores it.

Since we're on it, let cdrecord access a device when ->changed is set.
It's useful if someone wants to know device capabilities without burning
anything.

Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb/input/usbmouse.c: whitespace cleanup
Reiner Herrmann [Wed, 6 Sep 2006 00:37:21 +0000 (02:37 +0200)]
USB: usb/input/usbmouse.c: whitespace cleanup

Replace spaces with tab and change comment indention for better readability.

Signed-off-by: Reiner Herrmann <reiner@reiner-h.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ohci-at91, two one-liners
David Brownell [Sun, 3 Sep 2006 19:21:50 +0000 (12:21 -0700)]
USB: ohci-at91, two one-liners

This includes two one-liners forwarded to me for the OHCI support on at91:

 - KB920x (and other boards with CPUs in non-BGA packages) need a slightly
   different way to say "ignore that port, it's not pinned out";

 - On resume, if we turn clocks on, record that we did so.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: net2280: update dma buffer allocation
David Brownell [Sat, 2 Sep 2006 10:13:45 +0000 (03:13 -0700)]
USB: net2280: update dma buffer allocation

This updates the code handling dma-coherent buffer allocations, basically
reusing code from the musb_hdrc driver.  Instead of trying to work around two
significant limitations of the dma framework (memory wastage for buffers
smaller than a page, and inconsistency between calling context requirements
for allocation and free) this just works around one of them (the latter).

So count this as two steps forward (bugfixes:  the latter issue could cause
errors on some platforms, and some MIPS changes broke code for the former),
and one step back (increasing cross-platform memory wastage).

Plus linelength and whitespace fixes; and minor data segment shrinkage.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb serial gadget smp related bug
Eugeny S. Mints [Sat, 2 Sep 2006 10:59:19 +0000 (03:59 -0700)]
USB: usb serial gadget smp related bug

Adjust dev->dev_lock spinlock lock/unlock calls to be safe for SMP case.
Otherwise the following sequence may lead to a deadlock in SMP case:

gs_send()->usb_ep_queue()
->(in case a request is satisfied immediatly) gs_write_complete()

for ex for pxa2xx_udc.c:
usb_ep_queue()->pxa2xx_ep_queue()->write_fifo()->done()->gs_write_complete()
(through req.complete pointer)

Signed-off-by: Eugeny S. Mints <emints@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: replace kernel_thread() with kthread_run() in libusual.c
Matthew Dharm [Thu, 31 Aug 2006 20:37:29 +0000 (13:37 -0700)]
USB: replace kernel_thread() with kthread_run() in libusual.c

Replaced kernel_thread() with kthread_run() since kernel_thread() is
deprecated in drivers/modules.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agogadgetfs patch for ep0out
Skip Hansen [Fri, 1 Sep 2006 22:26:27 +0000 (15:26 -0700)]
gadgetfs patch for ep0out

For ep0out transfers (rare), be sure to copy the right data to userspace.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI whitespace fixes (cosmetic)
David Brownell [Wed, 30 Aug 2006 21:50:06 +0000 (14:50 -0700)]
USB: EHCI whitespace fixes (cosmetic)

[ ... when you have an editor set to remind you of whitespace bugs ... ]

Cosmetic EHCI changes: remove end-of-line whitespace, spaces before tabs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ethernet gadget avoids zlps for musb_hdrc
David Brownell [Wed, 30 Aug 2006 20:24:56 +0000 (13:24 -0700)]
USB: ethernet gadget avoids zlps for musb_hdrc

For systems using the Mentor HDRC controllers we get better TX DMA throughput
if we can avoid falling back to PIO to write zero length packets ... so tell
the driver to avoid ZLPs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbmon: don't call mon_dmapeek if DMA isn't being used
Alan Stern [Wed, 30 Aug 2006 15:35:21 +0000 (11:35 -0400)]
usbmon: don't call mon_dmapeek if DMA isn't being used

This patch (as755b) fixes a bug in usbmon.  Rather than assuming all
USB host controllers use DMA, the code will check the usb_bus data
structure.  If DMA isn't used, we don't want to try peeking into a
non-existent DMA buffer!

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: trim down usb_bus structure
Alan Stern [Wed, 30 Aug 2006 15:32:52 +0000 (11:32 -0400)]
usbcore: trim down usb_bus structure

As part of the ongoing program to flatten out the HCD bus-glue layer,
this patch (as771b) eliminates the hcpriv, release, and kref fields
from struct usb_bus.  hcpriv and release were not being used for
anything worthwhile, and kref has been moved into the enclosing
usb_hcd structure.

Along with those changes, the patch gets rid of usb_bus_get and
usb_bus_put, replacing them with usb_get_hcd and usb_put_hcd.

The one interesting aspect is that the dev_set_drvdata call was
removed from usb_put_hcd, where it clearly doesn't belong.  This means
the driver private data won't get reset to NULL.  It shouldn't cause
any problems, since the private data is undefined when no driver is
bound.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: Add flag for whether a host controller uses DMA
Alan Stern [Wed, 30 Aug 2006 15:29:56 +0000 (11:29 -0400)]
usbcore: Add flag for whether a host controller uses DMA

This patch (as770b) introduces a new field to usb_bus: a flag
indicating whether or not the host controller uses DMA.  This serves
to encapsulate the computation.  It also means we will have only one
spot to update if the DMA API changes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove struct usb_operations
Alan Stern [Wed, 30 Aug 2006 15:27:36 +0000 (11:27 -0400)]
USB: remove struct usb_operations

All of the currently-supported USB host controller drivers use the HCD
bus-glue framework.  As part of the program for flattening out the glue
layer, this patch (as769) removes the usb_operations structure.  All
function calls now go directly to the HCD routines (slightly renamed
to remain within the "usb_" namespace).

The patch also removes usb_alloc_bus(), because it's not useful in the
HCD framework and it wasn't referenced anywhere.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usb-hub-driver-improve-use-of-ifdef fix
Andrew Morton [Tue, 15 Aug 2006 06:11:02 +0000 (23:11 -0700)]
USB: usb-hub-driver-improve-use-of-ifdef fix

Fix CONFIG_PM=n build.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Turn usb_resume_both() into static inline
Alexey Dobriyan [Sun, 20 Aug 2006 14:58:42 +0000 (18:58 +0400)]
USB: Turn usb_resume_both() into static inline

drivers/usb/core/hub.c: In function `hub_events':
drivers/usb/core/hub.c:2591: warning: statement with no effect

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: help drivers to change device configs
Alan Stern [Mon, 21 Aug 2006 16:08:19 +0000 (12:08 -0400)]
usbcore: help drivers to change device configs

It's generally a bad idea for USB interface drivers to try to change a
device's configuration, and usbcore doesn't provide any way for them
to do it.  However in a few exceptional circumstances it can make
sense.  This patch (as767) adds a roundabout mechanism to help drivers
that may need it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb-storage: fix for UFI LUN detection
Alan Stern [Mon, 21 Aug 2006 16:00:53 +0000 (12:00 -0400)]
usb-storage: fix for UFI LUN detection

The UFI specification doesn't permit devices to indicate non-existent
LUNs in the manner prescribed by the SCSI spec.  This patch (as773)
sets a special flag so that the SCSI scanner will recognize these
devices and treat them specially.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix typo in drivers/usb/gadget/Kconfig
Jules Villard [Tue, 22 Aug 2006 20:40:15 +0000 (22:40 +0200)]
USB: fix typo in drivers/usb/gadget/Kconfig

This tiny patch fixes a typo in drivers/usb/gadget/Kconfig. The typo
is present in 2.6.18-rc4 and in the corresponding -mm tree (and AFAIK,
FYI and FWIW was present in previous kernel versions as well).

From: Jules Villard <jvillard@ens-lyon.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix signedness issue in drivers/usb/gadget/ether.c
Eric Sesterhenn [Mon, 21 Aug 2006 22:31:05 +0000 (15:31 -0700)]
USB: fix signedness issue in drivers/usb/gadget/ether.c

another gcc 4.1 signdness warning:

drivers/usb/gadget/ether.c:2028: warning: comparison of unsigned expression < 0 is always false

length is assigned the value of usb_ep_queue() which returns an int.
Directly after this it is checked for < 0, which can never be true.  Making
length an int makes the error check work again.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB core: Use const where possible.
Luiz Fernando N. Capitulino [Sun, 27 Aug 2006 02:48:11 +0000 (23:48 -0300)]
USB core: Use const where possible.

This patch marks some USB core's functions parameters as const. This
improves the design (we're saying to the caller that its parameter is
not going to be modified) and may help in compiler's optimisation work.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: pretty print new wireless USB devices when they connect
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:31 +0000 (19:35 -0700)]
wusb: pretty print new wireless USB devices when they connect

New code being pushed to linuxuwb.org requires this patch to connect
WUSB devices.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: handle wusb device ep0 speed settings
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:30 +0000 (19:35 -0700)]
wusb: handle wusb device ep0 speed settings

This patch teaches the USB stack handling of WUSB devices (those whose
speed is USB_SPEED_VARIABLE). For these devices, we need to set ep0's
maxpacketsize to 512 (even though the device descriptor reports it as
0xff).

New code being pushed to linuxuwb.org requires this patch to connect WUSB
devices.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agowusb: hub code recognizes wusb ports
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:29 +0000 (19:35 -0700)]
wusb: hub code recognizes wusb ports

This patch enables the USB stack to recognize WUSB devices (from a
WUSB HCD) and assigns them the proper speed setting
(USB_SPEED_VARIABLE).

1. Introduce usb_hcd->wireless to mark a host controller instance as
   being wireless, and thus having wireless 'fake' ports.

   [discarded previous model of using a reserved bit in the port_stat
   struct to do this; thanks to Alan Stern for indicating the
   proper way to do it].

2. Introduce hub.c:hub_is_wusb() that tests if a hub is a WUSB root
   hub (WUSB doesn't have non-root hubs).

New code being pushed to linuxuwb.org requires this patch to connect WUSB
devices.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: deal with broken config descriptors
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:28 +0000 (19:35 -0700)]
usb: deal with broken config descriptors

Change usb_get_configuration() so that it is more tolerant to devices
with bad configuration descriptors (it'll make it ignore
configurations that fail to load).

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB Storage: add rio karma eject support
Matthew Dharm [Mon, 14 Aug 2006 00:30:14 +0000 (17:30 -0700)]
USB Storage: add rio karma eject support

This changeset from Keith Bennett (via Bob Copeland) moves the Karma
initializer to its own file and adds trapping of the START_STOP command to
enable eject of the device.

Signed-off-by: Keith Bennett <keith@mcs.st-and.ac.uk>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb-skeleton: small update
Luiz Fernando N. Capitulino [Tue, 15 Aug 2006 01:44:29 +0000 (22:44 -0300)]
usb-skeleton: small update

o CodingStyle fixes
o Removes trailing spaces
o Do not make not needed initialiation of automatic variables
o Use usb_endpoint_* functions
o If we get an error in the write URB callback print an error message instead
  of a debug one

(Pretty unrelated changes, but spliting this up doesn't pay off as our main
changes are just CodingStyle fixes).

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>