usb-host: rip out legacy procfs support

This patch removes support for parsing /proc/bus/usb/devices for device
discovery.  The code lacks a few features compared to the sysfs code and
is also bitrotting as everybody has sysfs these days.

This implies having sysfs mounted is mandatory now to use the usb-host
driver.  udev isn't required though.  qemu will prefer the udev-managed
device nodes below /dev/bus/usb, but in case this directory isn't preset
qemu will use the device nodes below /proc/bus/usb (default usbfs mount
point).

Bottom line: make sure you have both sysfs and usbfs mounted properly,
and everything should continue to work as it did before.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: track configuration and interface count in USBDevice.

Move fields from USBHostDevice to USBDevice.
Add bits to usb-desc.c to fill them for emulated devices too.
Also allow to set configuration 0 (== None) for emulated devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: track altsetting in USBDevice

Also handle {GET,SET}_INTERFACE in common code (usb-desc.c).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-desc: audio endpoint support

Add support for audio endpoints which have two more fields in the
descriptor.  Also add support for extra class specific endpoint
descriptors.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add audio device model

This brings a usb audio device to qemu.  Output only, fixed at
16bit stereo @ 480000 Hz.  Based on a patch from
H. Peter Anvin <hpa@linux.intel.com>

Usage: add '-device usb-audio' to your qemu command line.

Works sorta ok on a idle machine.  Known issues:

 * Is *very* sensitive to latencies.
 * Burns quite some CPU due to usb polling.

In short:  It brings the qemu usb emulation to its limits.  Enjoy!

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
kvm: flush the dirty log when unregistering a slot

Otherwise, the dirty log information is lost in the kernel forever.

Fixes opensuse-12.1 boot screen, which changes the vga windows rapidly.

Signed-off-by: Avi Kivity <avi@redhat.com>
isapc: Fix segfault during initialization

Obviously, linking the RTC device state to the PIIX does not belong into
the common path that is shared with the isapc.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
seabios: Update to release 1.6.3.1

User visible changes in seabios:
 - Probe HPET existence (fix for -no-hpet)
 - Probe PCI existence (fix for -machine isapc)
 - usb: fix boot paths

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
pxa2xx_lcd: fix palette parser

Pallete entry size for 16bpp format is 2 bytes, not 4

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
pxa2xx_keypad: make single automatic scans work

u-boot uses single automatic scans and polling in
pxa2xx_keypad driver, so clear KPC_AS bit immediately
and update keys state even if KPC_AS and KPC_ASACT are
cleared.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/sysbus.h: Increase maximum number of device IRQs.

Samsung exynos4210 Interrupt Combiner needs 512 IRQ sources.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/arm_boot.c: Make SMP boards specify address to poll in bootup loop

The secondary CPU bootloader in arm_boot.c holds secondary CPUs in a
pen until the primary CPU releases them. Make boards specify the
address to be polled to determine whether to leave the pen (it was
previously hardcoded to 0x10000030, which is a Versatile Express/
Realview specific system register address).

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
pxa2xx_keypad: fix unbalanced parenthesis.

Breakage introduced by me when ammending a previous patch, sorry.
xhci: Initial xHCI implementation

Based on the implementation from Hector Martin <hector@marcansoft.com>

Hectors's implementation completely sidestepped the qemu usb system and
used libusb directly for usb device pass through.  So I've ripped out
the libusb bits (or left them in disabled, as reference for further
coding) and hooked up the qemu subsystem instead.  That work is not
complete yet though, partly due to limitations of the qemu usb
subsystem.  Nevertheless I think it is better to continue development
in-tree, especially as the qemu usb bits need a bunch of improvements
too for decent usb 3.0 support.

Current state:
  - usb-storage emulation should work ok.
  - Devices which need constant polling (HID emulation like usb-tablet)
    are known to not work.
  - ISO xfers are not implemented yet.
  - superspeed ports are not implemented yet.
  - usb pass-through is completely untested so far.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add USBEndpoint

Start maintaining endpoint state at USBDevice level.  Add USBEndpoint
struct and some helper functions to deal with it.  For now it contains
the endpoint type only.  Moved over some bits from usb-linux.c

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add ifnum to USBEndpoint

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-desc: USBEndpoint support

Initialize USBEndpoint structs from USBDesc* data.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb/debug: add usb_ep_dump

Add function to dump endpoint data, for debugging purposes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add max_packet_size to USBEndpoint

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: link packets to endpoints not devices

Add USBEndpoint for the control endpoint to USBDevices.  Link async
packets to the USBEndpoint instead of the USBDevice.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>