sdk/emulator/qemu.git
12 years agotarget-xtensa: add ICOUNT SR and debug exception
Max Filippov [Sun, 15 Jan 2012 01:40:50 +0000 (05:40 +0400)]
target-xtensa: add ICOUNT SR and debug exception

ICOUNT SR gets incremented on every instruction completion provided that
CINTLEVEL at the beginning of the instruction execution is lower than
ICOUNTLEVEL.

When ICOUNT would increment to 0 a debug exception is raised if
CINTLEVEL is lower than DEBUGLEVEL.

See ISA, 4.7.7.5 for more details.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
12 years agotarget-xtensa: implement instruction breakpoints
Max Filippov [Fri, 13 Jan 2012 05:21:32 +0000 (09:21 +0400)]
target-xtensa: implement instruction breakpoints

Add IBREAKA/IBREAKENABLE SRs and implement debug exception, BREAK and
BREAK.N instructions and IBREAK breakpoints.

IBREAK breakpoint address is considered constant for TB lifetime.
On IBREAKA/IBREAKENABLE change corresponding TBs are invalidated.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
12 years agotarget-xtensa: add DEBUGCAUSE SR and configuration
Max Filippov [Tue, 13 Dec 2011 22:13:40 +0000 (02:13 +0400)]
target-xtensa: add DEBUGCAUSE SR and configuration

DEBUGCAUSE SR holds information about the most recent debug exception.
See ISA, 4.7.7 for more details.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
12 years agotarget-xtensa: fetch 3rd opcode byte only when needed
Max Filippov [Sat, 14 Jan 2012 09:29:29 +0000 (13:29 +0400)]
target-xtensa: fetch 3rd opcode byte only when needed

According to ISA, 3.5.4, third opcode byte should not be fetched for
2-byte instructions.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
12 years agotarget-xtensa: implement info tlb monitor command
Max Filippov [Sat, 7 Jan 2012 16:02:40 +0000 (20:02 +0400)]
target-xtensa: implement info tlb monitor command

Command dumps valid ITLB and DTLB entries.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
12 years agotarget-xtensa: define TLB_TEMPLATE for MMU-less cores
Max Filippov [Mon, 9 Jan 2012 02:42:11 +0000 (06:42 +0400)]
target-xtensa: define TLB_TEMPLATE for MMU-less cores

TLB_TEMPLATE macro specifies TLB geometry in the core configuration.
Make TLB_TEMPLATE available for region protection core variants,
defining 1 way ITLB and DTLB with 8 entries each.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
12 years agoinput: send kbd+mouse events only to running guests.
Gerd Hoffmann [Wed, 15 Feb 2012 08:15:37 +0000 (09:15 +0100)]
input: send kbd+mouse events only to running guests.

Trying to interact with a stopped guest will queue up the events,
then send them all at once when the guest continues running, with
a high chance to have them cause unwanted actions.

Avoid that by only injecting the input events only when the guest
is in running state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi8259: Do not clear level-triggered lines in IRR on init
Jan Kiszka [Tue, 24 Jan 2012 15:29:29 +0000 (16:29 +0100)]
i8259: Do not clear level-triggered lines in IRR on init

When an input line is handled as level-triggered, it will immediately
raise an IRQ on the output of a PIC again that goes through an init
reset. So only clear the edge-triggered inputs from IRR in that
scenario.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi8254: Factor out pit_get_channel_info
Jan Kiszka [Wed, 1 Feb 2012 19:31:43 +0000 (20:31 +0100)]
i8254: Factor out pit_get_channel_info

Instead of providing 4 individual query functions for mode, gate, output
and initial counter state, introduce a service that queries all
information at once. This comes with tiny additional costs for
pcspk_callback but with a much cleaner interface. Also, it will simplify
the implementation of the KVM in-kernel PIT model.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agopcspk: Convert to qdev
Jan Kiszka [Fri, 17 Feb 2012 10:24:34 +0000 (11:24 +0100)]
pcspk: Convert to qdev

Convert the PC speaker device to a qdev ISA model. Move the public
interface to a dedicated header file at this chance.

CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi8254: Rework & fix interaction with HPET in legacy mode
Jan Kiszka [Wed, 1 Feb 2012 19:31:41 +0000 (20:31 +0100)]
i8254: Rework & fix interaction with HPET in legacy mode

When the HPET enters legacy mode, the IRQ output of the PIT is
suppressed and replaced by the HPET timer 0. But the current code to
emulate this was broken in many ways. It reset the PIT state after
re-enabling, it worked against a stale static PIT structure, and it did
not properly saved/restored the IRQ output mask in the PIT vmstate.

This patch solves the PIT IRQ control in a different way. On x86, it
both redirects the PIT IRQ to the HPET, just like the RTC. But it also
keeps the control line from the HPET to the PIT. This allows to disable
the PIT QEMU timer when it is not needed. The PIT's view on the control
line state is now saved in the same format that qemu-kvm is already
using.

Note that, in contrast to the suppressed RTC IRQ line, we do not need to
save/restore the PIT line state in the HPET. As we trigger a PIT IRQ
update via the control line, the line state is reconstructed on mode
switch.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi8254: Pass alternative IRQ output object on initialization
Jan Kiszka [Wed, 1 Feb 2012 19:31:40 +0000 (20:31 +0100)]
i8254: Pass alternative IRQ output object on initialization

HPET legacy emulation will require control over the PIT IRQ output. To
enable this, add support for an alternative IRQ output object to the PIT
factory function. If the isa_irq number is < 0, this object will be
used.

This also removes the IRQ number property from the PIT class as we now
use a generic GPIO output pin that is connected by the factory function.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi8254: Factor out interface header
Jan Kiszka [Wed, 1 Feb 2012 19:31:39 +0000 (20:31 +0100)]
i8254: Factor out interface header

Move the public interface of the PIT into its own header file and update
all users.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agohpet: Save/restore cached RTC IRQ level
Jan Kiszka [Wed, 1 Feb 2012 19:31:38 +0000 (20:31 +0100)]
hpet: Save/restore cached RTC IRQ level

In legacy mode, the HPET suppresses the RTC interrupt delivery via IRQ
8 but keeps track of the RTC output level and applies it when legacy
mode is turned off again. This value has to be preserved across save/
restore as it cannot be reconstructed otherwise.

To document that a raised rtc_irq_level won't survive a vmload without
a hpet/rtc_irq_level subsection, add an explicit clearing to the reset
handler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi8254: Do not raise IRQ level on reset
Jan Kiszka [Wed, 1 Feb 2012 19:31:37 +0000 (20:31 +0100)]
i8254: Do not raise IRQ level on reset

Avoid changing the IRQ level to high on reset as it may trigger spurious
events. Instead, open-code the effects of pit_load_count(0) in the reset
handler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovnc: Don't demote authentication scheme when changing password/disabling login
Daniel P. Berrange [Tue, 14 Feb 2012 12:37:29 +0000 (12:37 +0000)]
vnc: Don't demote authentication scheme when changing password/disabling login

Currently when disabling login in VNC, the password is cleared out and the
authentication protocol is forced to AUTH_VNC.  If you're using a stronger
authentication protocol, this has the effect of downgrading your security
protocol.

Fix this by only changing the authentication protocol if the current
authentication protocol is AUTH_NONE.  That ensures we're never downgrading.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
--
NB. This patch is derived from one posted by Anthony last year, which got
accidentally lost after Luiz took over the QMP series work

  https://lists.gnu.org/archive/html/qemu-devel/2011-09/msg00392.html

 v1 -> v2
 - Make sure to not demote when changing password (Daniel)
 v2 -> v3
 - Rebase to latest GIT master wrt QMP changes

12 years agoqdev: Fix qdev_try_create() semantics
Andreas Färber [Fri, 17 Feb 2012 01:47:44 +0000 (02:47 +0100)]
qdev: Fix qdev_try_create() semantics

Since QOM'ification, qdev_try_create() uses object_new() internally,
which asserts "type != NULL" when the type is not registered.
This was revealed by the combination of kvmclock's kvm_enabled() check
and early QOM type registration.

Check whether the class exists before calling object_new(), so that
the caller (e.g., qdev_create) can fail gracefully, telling us which
device could not be created.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <aliguori@codemonkey.ws>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqom: Fix identifiers in documentation
Andreas Färber [Thu, 16 Feb 2012 17:03:19 +0000 (18:03 +0100)]
qom: Fix identifiers in documentation

Fixes gtk-doc warnings.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqom: Fix typo in Object's documentation
Andreas Färber [Thu, 16 Feb 2012 17:03:18 +0000 (18:03 +0100)]
qom: Fix typo in Object's documentation

Fixes a warning from gtk-doc.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoconfigure: Remove OpenBSD workaround for curses probe
Brad Smith [Fri, 10 Feb 2012 20:59:38 +0000 (15:59 -0500)]
configure: Remove OpenBSD workaround for curses probe

Remove the OpenBSD workaround for the curses probe. This has not been
necessary for 5 releases now.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agolibcacard configure fixes
Paul Brook [Thu, 9 Feb 2012 19:05:29 +0000 (19:05 +0000)]
libcacard configure fixes

libcacard is only used by system emulation.
Only define libcacard_libs/cflags once.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agocoroutine: switch to QSLIST
Paolo Bonzini [Fri, 13 Jan 2012 16:34:04 +0000 (17:34 +0100)]
coroutine: switch to QSLIST

QSLIST can be used for a free list, do it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-queue: drop QCIRCLEQ
Paolo Bonzini [Fri, 13 Jan 2012 16:34:03 +0000 (17:34 +0100)]
qemu-queue: drop QCIRCLEQ

The main advantage of circular lists (the fact that the head node
has the same memory layout as any other node) is completely negated
by the implementation in qemu-queue.h.  Not surprisingly, nobody
uses QCIRCLEQ.  While this might change if RCU is ever adopted by
QEMU, the QLIST is also RCU-friendly and in fact it is used in a
RCU-like manner by 9pfs already.  So, just kill QCIRCLEQ.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-queue: add QSLIST
Paolo Bonzini [Fri, 13 Jan 2012 16:34:02 +0000 (17:34 +0100)]
qemu-queue: add QSLIST

Based on http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.h?rev=1.53
with only the prefix change.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonotifier: switch to QLIST
Paolo Bonzini [Fri, 13 Jan 2012 16:34:01 +0000 (17:34 +0100)]
notifier: switch to QLIST

Notifiers do not need to access both ends of the list, and using
a QLIST also simplifies the API.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'bonzini/nbd-for-anthony' into staging
Anthony Liguori [Fri, 17 Feb 2012 12:50:58 +0000 (06:50 -0600)]
Merge remote-tracking branch 'bonzini/nbd-for-anthony' into staging

* bonzini/nbd-for-anthony:
  nbd: add git tree to MAINTAINERS
  open /dev/nbd in nbd_client_thread
  do not chdir(/) in qemu-nbd before opening all files

12 years agoMerge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
Anthony Liguori [Fri, 17 Feb 2012 12:50:07 +0000 (06:50 -0600)]
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging

* pmaydell/arm-devs.for-upstream: (22 commits)
  hw/pl031: Actually raise interrupt on timer expiry
  MAINTAINERS: Add hw/highbank.c maintainer
  Remove unnecessary includes of primecell.h
  hw/primecell.h: Remove obsolete pl080_init() declaration
  hw/arm_sysctl: Drop legacy init function
  hw/vexpress.c: Add vexpress-a15 machine
  arm_boot: Pass base address of GIC CPU interface, not whole GIC
  hw/vexpress.c: Instantiate the motherboard CLCD
  hw/vexpress.c: Factor out daughterboard-specific initialization
  hw/vexpress.c: Move secondary CPU boot code to SRAM
  hw/vexpress.c: Make motherboard peripheral memory map table-driven
  hw/a15mpcore.c: Add Cortex-A15 private peripheral model
  MAINTAINERS: Add maintainers for Exynos SOC.
  Exynos4210: added display controller implementation
  hw/exynos4210.c: Add LAN support for SMDKC210.
  hw/lan9118: Add basic 16-bit mode support.
  ARM: exynos4210: MCT support.
  ARM: exynos4210: basic Power Management Unit implementation
  ARM: exynos4210: PWM support.
  ARM: exynos4210: UART support
  ...

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 17 Feb 2012 12:48:47 +0000 (06:48 -0600)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  linux-user: brk() debugging
  virtio: Remove unneeded g_free() check in virtio_cleanup()
  net: remove extra spaces in help messages
  fmopl: Fix typo in function name
  vl.c: Fix typo in variable name
  ide: fix compilation errors when DEBUG_IDE is set
  cpu-exec.c: Correct comment about this file and indentation cleanup
  CODING_STYLE: Clarify style for enum and function type names
  linux-user: fail execve() if env/args too big

12 years agonbd: add git tree to MAINTAINERS
Paolo Bonzini [Wed, 18 Jan 2012 11:48:19 +0000 (12:48 +0100)]
nbd: add git tree to MAINTAINERS

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoopen /dev/nbd in nbd_client_thread
Paolo Bonzini [Tue, 6 Dec 2011 08:07:00 +0000 (09:07 +0100)]
open /dev/nbd in nbd_client_thread

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agodo not chdir(/) in qemu-nbd before opening all files
Michael Tokarev [Mon, 16 Jan 2012 14:37:44 +0000 (18:37 +0400)]
do not chdir(/) in qemu-nbd before opening all files

When qemu-nbd becomes a daemon it calls daemon(3) with
nochdir=0, so daemon(3) changes current directory to /.
But at this time, qemu-nbd did not open any user-specified
files yet, so by changing current directory, all non-absolute
paths becomes wrong.  The solution is to pass nochdir=1 to
daemon(3) function, and to chdir("/") after all init has
been performed, before entering the main loop, -- just like
a good daemon should do.

This patch is applicable for -stable.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agohw/pl031: Actually raise interrupt on timer expiry
Peter Maydell [Thu, 16 Feb 2012 09:56:10 +0000 (09:56 +0000)]
hw/pl031: Actually raise interrupt on timer expiry

Fix a typo in pl031_interrupt() which meant we were setting a bit
in the interrupt mask rather than the interrupt status register
and thus not actually raising an interrupt. This fix allows the
rtctest program from the kernel's Documentation/rtc.txt to pass
rather than hanging.

Reported-by: Daniel Forsgren <daniel.forsgren@enea.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
12 years agoMAINTAINERS: Add hw/highbank.c maintainer
Mark Langsdorf [Thu, 16 Feb 2012 09:56:10 +0000 (09:56 +0000)]
MAINTAINERS: Add hw/highbank.c maintainer

Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoRemove unnecessary includes of primecell.h
Peter Maydell [Thu, 16 Feb 2012 09:56:10 +0000 (09:56 +0000)]
Remove unnecessary includes of primecell.h

The primecell.h header now only has the definitions of constants
indicating the usage of the arm_sysctl GPIO lines; remove obsolete
includes of it from source files which don't care about those GPIO
lines.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/primecell.h: Remove obsolete pl080_init() declaration
Peter Maydell [Thu, 16 Feb 2012 09:56:10 +0000 (09:56 +0000)]
hw/primecell.h: Remove obsolete pl080_init() declaration

Remove an obsolete declaration of pl080_init(), which has been
incorrect since the conversion of pl080 to qdev back in 2009.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/arm_sysctl: Drop legacy init function
Peter Maydell [Thu, 16 Feb 2012 09:56:09 +0000 (09:56 +0000)]
hw/arm_sysctl: Drop legacy init function

Drop the legacy init function arm_sysctl_init(), since it has no
users left any more. This allows us to drop the awkward '1' from
the actual device init function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
12 years agohw/vexpress.c: Add vexpress-a15 machine
Peter Maydell [Thu, 16 Feb 2012 09:56:09 +0000 (09:56 +0000)]
hw/vexpress.c: Add vexpress-a15 machine

Add the vexpress-a15 machine, and the A-Series memory map it uses.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
12 years agoarm_boot: Pass base address of GIC CPU interface, not whole GIC
Peter Maydell [Thu, 16 Feb 2012 09:56:09 +0000 (09:56 +0000)]
arm_boot: Pass base address of GIC CPU interface, not whole GIC

The arm_boot secondary boot loader code needs the address of
the GIC CPU interface. Obtaining this from the base address
of the private peripheral region was possible for A9 and 11MPcore,
but the A15 puts the GIC CPU interface in a different place.
So make boards pass in the GIC CPU interface address directly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/vexpress.c: Instantiate the motherboard CLCD
Peter Maydell [Thu, 16 Feb 2012 09:56:09 +0000 (09:56 +0000)]
hw/vexpress.c: Instantiate the motherboard CLCD

Instantiate the CLCD on the vexpress motherboard as well as one on
the daughterboard -- the A15 daughterboard does not have a CLCD
and so relies on the motherboard one.

At the moment QEMU doesn't provide infrastructure for selecting
which display device gets to actually show graphics -- the first
one registered is it. Fortunately this works for the major use
case (Linux): if the daughterboard has a CLCD it will come first
and be used, otherwise we fall back to the motherboard CLCD.
So we don't (currently) need to implement the control register
which allows software to tell the mux which video output to pass
through to the outside world.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
12 years agohw/vexpress.c: Factor out daughterboard-specific initialization
Peter Maydell [Thu, 16 Feb 2012 09:56:09 +0000 (09:56 +0000)]
hw/vexpress.c: Factor out daughterboard-specific initialization

Factor out daughterboard specifics into a data structure and
daughterboard initialization function, in preparation for adding
vexpress-a15 support.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/vexpress.c: Move secondary CPU boot code to SRAM
Peter Maydell [Thu, 16 Feb 2012 09:56:08 +0000 (09:56 +0000)]
hw/vexpress.c: Move secondary CPU boot code to SRAM

On real Versatile Express hardware, the boot ROM puts the secondary
CPU bootcode/holding pen in SRAM. We can therefore rely on Linux not
trashing this memory until secondary CPUs have booted up, and can
put our QEMU-specific pen code in the same place. This allows us to
drop the odd "hack" RAM page we were using before.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/vexpress.c: Make motherboard peripheral memory map table-driven
Peter Maydell [Thu, 16 Feb 2012 09:56:08 +0000 (09:56 +0000)]
hw/vexpress.c: Make motherboard peripheral memory map table-driven

Pull the addresses used for mapping motherboard peripherals into
memory out into a table. This will allow us to simply provide a
second table to implement the "Cortex-A Series" memory map used by
the A15 variant of Versatile Express, as well as the current
"Legacy" map used by A9.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
12 years agohw/a15mpcore.c: Add Cortex-A15 private peripheral model
Peter Maydell [Thu, 16 Feb 2012 09:56:07 +0000 (09:56 +0000)]
hw/a15mpcore.c: Add Cortex-A15 private peripheral model

Add a model of the Cortex-A15 memory mapped private peripheral
space. This is fairly simple because the only memory mapped
bit of the A15 is the GIC.

Note that we don't currently model a VGIC and therefore don't
map the VGIC related bits of the GIC.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoMAINTAINERS: Add maintainers for Exynos SOC.
Evgeny Voevodin [Thu, 16 Feb 2012 09:56:06 +0000 (09:56 +0000)]
MAINTAINERS: Add maintainers for Exynos SOC.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoExynos4210: added display controller implementation
Mitsyanko Igor [Thu, 16 Feb 2012 09:56:06 +0000 (09:56 +0000)]
Exynos4210: added display controller implementation

Exynos4210 display controller (FIMD) has 5 hardware windows with alpha and
chroma key blending functions.

Signed-off-by: Mitsyanko Igor <i.mitsyanko@samsung.com>
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/exynos4210.c: Add LAN support for SMDKC210.
Evgeny Voevodin [Thu, 16 Feb 2012 09:56:06 +0000 (09:56 +0000)]
hw/exynos4210.c: Add LAN support for SMDKC210.

SMDKC210 uses lan9215 chip, but lan9118 in 16-bit mode seems to
be enough.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/lan9118: Add basic 16-bit mode support.
Evgeny Voevodin [Thu, 16 Feb 2012 09:56:06 +0000 (09:56 +0000)]
hw/lan9118: Add basic 16-bit mode support.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: exynos4210: MCT support.
Evgeny Voevodin [Thu, 16 Feb 2012 09:56:05 +0000 (09:56 +0000)]
ARM: exynos4210: MCT support.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: exynos4210: basic Power Management Unit implementation
Maksim Kozlov [Thu, 16 Feb 2012 09:56:05 +0000 (09:56 +0000)]
ARM: exynos4210: basic Power Management Unit implementation

Patch adds basic model for Exynos4210 SoC PMU.
This model implements PMU registers just as a bulk of memory. Currently,
the only reason this device exists is that secondary CPU boot loader
uses PMU INFORM5 register as a holding pen.

Signed-off-by: Maksim Kozlov <m.kozlov@samsung.com>
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: exynos4210: PWM support.
Evgeny Voevodin [Thu, 16 Feb 2012 09:56:05 +0000 (09:56 +0000)]
ARM: exynos4210: PWM support.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: exynos4210: UART support
Maksim Kozlov [Thu, 16 Feb 2012 09:56:05 +0000 (09:56 +0000)]
ARM: exynos4210: UART support

Add basic support of exynos4210 UART

Signed-off-by: Maksim Kozlov <m.kozlov@samsung.com>
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: Samsung exynos4210-based boards emulation
Evgeny Voevodin [Thu, 16 Feb 2012 09:56:05 +0000 (09:56 +0000)]
ARM: Samsung exynos4210-based boards emulation

Add initial support of NURI and SMDKC210 boards

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: exynos4210: IRQ subsystem support.
Evgeny Voevodin [Thu, 16 Feb 2012 09:56:04 +0000 (09:56 +0000)]
ARM: exynos4210: IRQ subsystem support.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoMake -machine/-enable-kvm options merge into a single list
Peter Maydell [Wed, 8 Feb 2012 05:41:38 +0000 (05:41 +0000)]
Make -machine/-enable-kvm options merge into a single list

Make the "machine" option list use list merging, so that multiple
-machine arguments (and the -enable-kvm argument) all merge together
into a single list. Drop the calls to qemu_opts_reset() which meant
that only the last -machine or -enable-kvm option had any effect.

This fixes the bug where "-enable-kvm -machine foo" would ignore
the '-enable-kvm' option, and "-machine foo -enable-kvm" would
ignore the '-machine foo' option.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agoqemu-option: Add support for merged QemuOptsLists
Peter Maydell [Wed, 8 Feb 2012 05:41:37 +0000 (05:41 +0000)]
qemu-option: Add support for merged QemuOptsLists

Add support for option lists which are merged together, so that
"-listname foo=bar -listname bar=baz" is equivalent to "-listname
foo=bar,bar=baz" rather than generating two separate lists of options.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agotarget-arm/helper.c: tb_flush() on CPU reset
Peter Maydell [Wed, 1 Feb 2012 17:23:04 +0000 (17:23 +0000)]
target-arm/helper.c: tb_flush() on CPU reset

Since target-arm has some CPUState fields for which we take the approach
of baking assumptions about them into translated code and then calling
tb_flush() when the fields change, we must also tb_flush on CPU reset,
because reset is a change of those fields.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agohw/arm: Remove redundant arguments from set_kernel_args*
Stefan Weil [Sun, 29 Jan 2012 07:52:15 +0000 (08:52 +0100)]
hw/arm: Remove redundant arguments from set_kernel_args*

The parameters initrd_size and base are already included
in the info parameter, so there is no need to pass them
separately.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>,
12 years agopxa2xx_lcd: SRAM is valid location for the framebuffer
Vasily Khoruzhick [Tue, 24 Jan 2012 19:32:30 +0000 (22:32 +0300)]
pxa2xx_lcd: SRAM is valid location for the framebuffer

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agotarget-arm/helper.c: Correct FPSID value for Cortex-A9
Peter Maydell [Tue, 7 Feb 2012 17:56:57 +0000 (17:56 +0000)]
target-arm/helper.c: Correct FPSID value for Cortex-A9

The correct FPSID for the Cortex-A9 (according to the TRM) is
0x41033090 for the r0p0 that we claim to model.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agonseries: attach monitor powerdown request to menelaus
Paolo Bonzini [Fri, 20 Jan 2012 11:10:34 +0000 (12:10 +0100)]
nseries: attach monitor powerdown request to menelaus

I noticed some unused code in the twl92230, probably from before
qdev-ification.  This patch makes the machine use the chip's pwrbtn
signal.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Thu, 16 Feb 2012 00:41:28 +0000 (18:41 -0600)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

* qemu-kvm/uq/master:
  apic: Fix legacy vmstate loading for KVM
  kvm: Implement kvm_irqchip_in_kernel like kvm_enabled
  kvm: Allow to set shadow MMU size

12 years agoMerge remote-tracking branch 'kraxel/vnc.2' into staging
Anthony Liguori [Thu, 16 Feb 2012 00:40:53 +0000 (18:40 -0600)]
Merge remote-tracking branch 'kraxel/vnc.2' into staging

* kraxel/vnc.2:
  vnc: lift modifier keys on client disconnect.
  vnc: implement shared flag handling.
  vnc: fix ctrl key in vnc terminal emulation
  Fix vnc memory corruption with width = 1400

12 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Thu, 16 Feb 2012 00:40:26 +0000 (18:40 -0600)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

* kiszka/queues/slirp:
  slirp: Prevent sending ICMP error replies to source-only addresses
  slirp: Remove unused variable and unused code

12 years agoMerge remote-tracking branch 'kraxel/usb.38' into staging
Anthony Liguori [Wed, 15 Feb 2012 23:25:25 +0000 (17:25 -0600)]
Merge remote-tracking branch 'kraxel/usb.38' into staging

* kraxel/usb.38: (28 commits)
  xhci: handle USB_RET_NAK
  xhci: remote wakeup support
  xhci: kill port arg from xhci_setup_packet
  xhci: stop on errors
  xhci: add trb type name lookup support.
  xhci: signal low- and fullspeed support
  usb: add USBBusOps->wakeup_endpoint
  usb: pass USBEndpoint to usb_wakeup
  usb: maintain async packet list per endpoint
  usb: Set USBEndpoint in usb_packet_setup().
  usb: add USBEndpoint->{nr,pid}
  usb: USBPacket: add status, rename owner -> ep
  usb: fold usb_generic_handle_packet into usb_handle_packet
  usb: kill handle_packet callback
  usb-xhci: switch to usb_find_device()
  usb-musb: switch to usb_find_device()
  usb-ohci: switch to usb_find_device()
  usb-ehci: switch to usb_find_device()
  usb-uhci: switch to usb_find_device()
  usb: handle dev == NULL in usb_handle_packet()
  ...

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Wed, 15 Feb 2012 23:18:04 +0000 (17:18 -0600)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony:
  AHCI: Masking of IRQs actually masks them
  sheepdog: fix co_recv coroutine context
  AHCI: Fix port reset race
  rewrite QEMU_BUILD_BUG_ON
  qcow2: Keep unknown header extension when rewriting header
  qcow2: Update whole header at once
  vpc: Round up image size during fixed image creation
  vpc: Add support for Fixed Disk type
  iSCSI: add configuration variables for iSCSI
  qemu-io: add write -z option for bdrv_co_write_zeroes
  qed: add .bdrv_co_write_zeroes() support
  qed: replace is_write with flags field
  block: perform zero-detection during copy-on-read
  block: add .bdrv_co_write_zeroes() interface
  cutils: extract buffer_is_zero() from qemu-img.c

12 years agodevice_add: don't add a /peripheral link until init is complete
Anthony Liguori [Sun, 12 Feb 2012 17:36:24 +0000 (11:36 -0600)]
device_add: don't add a /peripheral link until init is complete

Otherwise we end up with a dangling reference which causes qdev_free() to fail.

Reported-by: Michael Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqom: Unify type registration
Andreas Färber [Thu, 9 Feb 2012 14:20:55 +0000 (15:20 +0100)]
qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: malc <av1474@comtv.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: print error message before aborting
Paolo Bonzini [Tue, 14 Feb 2012 09:19:53 +0000 (10:19 +0100)]
qdev: print error message before aborting

qdev_prop_set_* functions are always called by machine init functions
that should know what they're doing, so they abort on error.  Still,
an assert(!errp) does not aid debugging.  Print an error before aborting.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqdev: allow setting properties to NULL
Paolo Bonzini [Tue, 14 Feb 2012 09:19:52 +0000 (10:19 +0100)]
qdev: allow setting properties to NULL

SPARC and PPC set properties to NULL.  This can be done with an
empty string value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoppc: remove unused variables
Blue Swirl [Sat, 4 Feb 2012 11:47:17 +0000 (11:47 +0000)]
ppc: remove unused variables

Fix this error:
/src/qemu/target-ppc/helper.c: In function 'booke206_tlb_to_page_size':
/src/qemu/target-ppc/helper.c:1296:14: error: variable 'tlbncfg' set but not used [-Werror=unused-but-set-variable]

Tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocfi02: Fix lazy ROMD switching - once again
Jan Kiszka [Sat, 4 Feb 2012 14:58:02 +0000 (15:58 +0100)]
cfi02: Fix lazy ROMD switching - once again

The conversion to memory regions broke lazy ROMD switching by forgetting
to update the rom_mode state variable.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomemory-region: Report if region is read-only or write-only on info mtree
Jan Kiszka [Sat, 4 Feb 2012 15:25:42 +0000 (16:25 +0100)]
memory-region: Report if region is read-only or write-only on info mtree

Helpful to understand guest configurations of things like the i440FX's
PAM or the state of ROM devices.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agovga: Fix full updates in graphic mode
Jan Kiszka [Tue, 7 Feb 2012 15:03:24 +0000 (16:03 +0100)]
vga: Fix full updates in graphic mode

This fixes the regression introduced by cd7a45c95e: We lost the or'ing
with the full_update flag.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix memory dirty getting API change fallout
Blue Swirl [Sat, 4 Feb 2012 17:09:14 +0000 (17:09 +0000)]
Fix memory dirty getting API change fallout

Fix confusion in length calculation in commit
cd7a45c95ecf2404810f3c6becb7cb83c5010ad8.

Reported-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoxhci: handle USB_RET_NAK
Gerd Hoffmann [Fri, 20 Jan 2012 12:29:16 +0000 (13:29 +0100)]
xhci: handle USB_RET_NAK

Add a field to XHCITransfer to correctly keep track of NAK'ed usb
packets.  Retry transfers when the endpoint is kicked again.  Implement
wakeup_endpoint bus op so we can kick the endpoint when needed.

With this patch applied the emulated hid devices are working correctly
when hooked up to xhci.  usb-tabled without polling, yay!

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoxhci: remote wakeup support
Gerd Hoffmann [Fri, 20 Jan 2012 16:09:58 +0000 (17:09 +0100)]
xhci: remote wakeup support

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoxhci: kill port arg from xhci_setup_packet
Gerd Hoffmann [Fri, 20 Jan 2012 14:25:16 +0000 (15:25 +0100)]
xhci: kill port arg from xhci_setup_packet

Unused argument, remove it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoxhci: stop on errors
Gerd Hoffmann [Tue, 17 Jan 2012 12:25:13 +0000 (13:25 +0100)]
xhci: stop on errors

When some error happened we'll have to stop processing the endpoint.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoxhci: add trb type name lookup support.
Gerd Hoffmann [Tue, 17 Jan 2012 10:21:06 +0000 (11:21 +0100)]
xhci: add trb type name lookup support.

When logging TRBs add a the type name for more readable debug output.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoxhci: signal low- and fullspeed support
Gerd Hoffmann [Fri, 13 Jan 2012 16:06:18 +0000 (17:06 +0100)]
xhci: signal low- and fullspeed support

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: add USBBusOps->wakeup_endpoint
Gerd Hoffmann [Fri, 20 Jan 2012 12:29:53 +0000 (13:29 +0100)]
usb: add USBBusOps->wakeup_endpoint

Add usb bus op which is called whenever a usb endpoint becomes ready,
so the host adapter emulation can react on that event.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: pass USBEndpoint to usb_wakeup
Gerd Hoffmann [Tue, 17 Jan 2012 12:25:46 +0000 (13:25 +0100)]
usb: pass USBEndpoint to usb_wakeup

Devices must specify which endpoint has data to transfer now.
The plan is to use the usb_wakeup() not only for remove wakeup support,
but for "data ready" signaling in general, so we can move away from
constant polling to event driven usb device emulation.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: maintain async packet list per endpoint
Gerd Hoffmann [Thu, 12 Jan 2012 13:26:13 +0000 (14:26 +0100)]
usb: maintain async packet list per endpoint

Maintain a list of async packets per endpoint.  With the current code
the list will never receive more than a single item.  I think you can
guess what the future plan is though ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agolinux-user: brk() debugging
Paul Brook [Thu, 9 Feb 2012 19:04:27 +0000 (19:04 +0000)]
linux-user: brk() debugging

Fix format type mismatches in do_brk debug printfs.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agovirtio: Remove unneeded g_free() check in virtio_cleanup()
Luiz Capitulino [Thu, 9 Feb 2012 13:29:42 +0000 (11:29 -0200)]
virtio: Remove unneeded g_free() check in virtio_cleanup()

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agonet: remove extra spaces in help messages
Benjamin MARSILI [Sun, 22 Jan 2012 18:42:38 +0000 (03:42 +0900)]
net: remove extra spaces in help messages

Signed-off-by: Benjamin MARSILI <mlspirat42@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agofmopl: Fix typo in function name
Stefan Weil [Tue, 7 Feb 2012 21:26:29 +0000 (22:26 +0100)]
fmopl: Fix typo in function name

Fix a typo in a local function name.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agovl.c: Fix typo in variable name
Peter Maydell [Tue, 7 Feb 2012 20:57:27 +0000 (20:57 +0000)]
vl.c: Fix typo in variable name

Fix a typo in a local variable name.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoide: fix compilation errors when DEBUG_IDE is set
Hervé Poussineau [Mon, 6 Feb 2012 21:19:42 +0000 (22:19 +0100)]
ide: fix compilation errors when DEBUG_IDE is set

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agocpu-exec.c: Correct comment about this file and indentation cleanup
陳韋任 [Mon, 6 Feb 2012 06:02:55 +0000 (14:02 +0800)]
cpu-exec.c: Correct comment about this file and indentation cleanup

Each target uses the #define macro (in target-xxx/cpu.h) to rename
cpu_exec (cpu-exec.c) to cpu_xxx_exec, then defines its own cpu_loop
which calls cpu_xxx_exec. So basically, cpu-exec.c is not only the i386
emulator main execution loop. This patch corrects the comment of this
file and does indentation cleanup.

Signed-off-by: Chen Wei-Ren (陳韋任) <chenwj@iis.sinica.edu.tw>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoCODING_STYLE: Clarify style for enum and function type names
Peter Maydell [Fri, 13 Jan 2012 20:29:49 +0000 (20:29 +0000)]
CODING_STYLE: Clarify style for enum and function type names

Clarify that enum type names and function type names should follow
the CamelCase style used for structured type names.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agolinux-user: fail execve() if env/args too big
Ulrich Hecht [Tue, 31 Jan 2012 11:43:16 +0000 (12:43 +0100)]
linux-user: fail execve() if env/args too big

If the host's page size is equal to or smaller than the target's, native
execve() will fail appropriately with E2BIG if called with too big an
environment for the target to handle. It may falsely succeed, however, if
the host's page size is bigger, and feed the executed target process an
environment that is too big for it to handle, at which point QEMU barfs and
exits, confusing procmail's autoconf script and causing the build to fail.

This patch makes sure that execve() will return E2BIG if the environment is
too large for the target.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agousb: Set USBEndpoint in usb_packet_setup().
Gerd Hoffmann [Thu, 12 Jan 2012 12:23:01 +0000 (13:23 +0100)]
usb: Set USBEndpoint in usb_packet_setup().

With the separation of the device lookup (via usb_find_device) and
packet processing we can lookup device and endpoint before setting up
the usb packet.  So we can initialize USBPacket->ep early and keep it
valid for the whole lifecycle of the USBPacket.  Also the devaddr and
devep fields are not needed any more.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: add USBEndpoint->{nr,pid}
Gerd Hoffmann [Thu, 12 Jan 2012 12:24:22 +0000 (13:24 +0100)]
usb: add USBEndpoint->{nr,pid}

Add a "nr" and "pid" fields to USBEndpoint so you can easily figure the
endpoint number and direction of any given endpoint.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: USBPacket: add status, rename owner -> ep
Gerd Hoffmann [Thu, 12 Jan 2012 11:51:48 +0000 (12:51 +0100)]
usb: USBPacket: add status, rename owner -> ep

Add enum to track the status of USBPackets, use that instead of the
owner pointer to figure whenever a usb packet is currently in flight
or not.  Add some more packet status sanity checks.  Also rename the
USBEndpoint pointer from "owner" to "ep".

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: fold usb_generic_handle_packet into usb_handle_packet
Gerd Hoffmann [Wed, 11 Jan 2012 11:14:02 +0000 (12:14 +0100)]
usb: fold usb_generic_handle_packet into usb_handle_packet

There is no reason to have a separate usb_generic_handle_packet function
any more, fold it into usb_handle_packet().  Also call the do_token_*
functions which handle control transfer emulation for control pipe
packets only.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: kill handle_packet callback
Gerd Hoffmann [Wed, 11 Jan 2012 10:16:20 +0000 (11:16 +0100)]
usb: kill handle_packet callback

All drivers except usb-hub use usb_generic_handle_packet.  The only
reason the usb hub has its own function is that it used to be called
with packets which are intended for downstream devices.  With the new,
separate device lookup step this doesn't happen any more, so the need
for a different handle_packet callback is gone.

So we can kill the handle_packet callback and just call
usb_generic_handle_packet directly.  The special hub handling in
usb_handle_packet() can go away for the same reason.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-xhci: switch to usb_find_device()
Gerd Hoffmann [Tue, 10 Jan 2012 17:05:22 +0000 (18:05 +0100)]
usb-xhci: switch to usb_find_device()

Switch over xHCI to use the new usb_find_device()
function for device lookup.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-musb: switch to usb_find_device()
Gerd Hoffmann [Tue, 10 Jan 2012 16:59:33 +0000 (17:59 +0100)]
usb-musb: switch to usb_find_device()

Switch over musb to use the new usb_find_device()
function for device lookup.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ohci: switch to usb_find_device()
Gerd Hoffmann [Tue, 10 Jan 2012 16:56:17 +0000 (17:56 +0100)]
usb-ohci: switch to usb_find_device()

Switch over OHCI to use the new usb_find_device()
function for device lookup.

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