[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 26/38] ehci: save device pointer in EHCIState
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 26/38] ehci: save device pointer in EHCIState |
Date: |
Wed, 25 Sep 2013 07:57:54 -0500 |
From: Gerd Hoffmann <address@hidden>
We'll need a pointer to the actual pci/sysbus device,
stick a pointer to it into the EHCIState struct.
https://bugzilla.redhat.com/show_bug.cgi?id=1005495
Signed-off-by: Gerd Hoffmann <address@hidden>
(cherry picked from commit adbecc89731cf3e0ae656d50ea9fa58c589c4bdc)
Signed-off-by: Michael Roth <address@hidden>
---
hw/usb/hcd-ehci.c | 7 +++----
hw/usb/hcd-ehci.h | 1 +
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 010a0d0..e9fb20c 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1241,13 +1241,11 @@ static int ehci_init_transfer(EHCIPacket *p)
{
uint32_t cpage, offset, bytes, plen;
dma_addr_t page;
- USBBus *bus = &p->queue->ehci->bus;
- BusState *qbus = BUS(bus);
cpage = get_field(p->qtd.token, QTD_TOKEN_CPAGE);
bytes = get_field(p->qtd.token, QTD_TOKEN_TBYTES);
offset = p->qtd.bufptr[0] & ~QTD_BUFPTR_MASK;
- qemu_sglist_init(&p->sgl, qbus->parent, 5, p->queue->ehci->as);
+ qemu_sglist_init(&p->sgl, p->queue->ehci->device, 5, p->queue->ehci->as);
while (bytes > 0) {
if (cpage > 4) {
@@ -1486,7 +1484,7 @@ static int ehci_process_itd(EHCIState *ehci,
return -1;
}
- qemu_sglist_init(&ehci->isgl, DEVICE(ehci), 2, ehci->as);
+ qemu_sglist_init(&ehci->isgl, ehci->device, 2, ehci->as);
if (off + len > 4096) {
/* transfer crosses page border */
uint32_t len2 = off + len - 4096;
@@ -2529,6 +2527,7 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev,
Error **errp)
s->frame_timer = qemu_new_timer_ns(vm_clock, ehci_frame_timer, s);
s->async_bh = qemu_bh_new(ehci_frame_timer, s);
+ s->device = dev;
qemu_register_reset(ehci_reset, s);
qemu_add_vm_change_state_handler(usb_ehci_vm_state_change, s);
diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h
index 15a28e8..065c9fa 100644
--- a/hw/usb/hcd-ehci.h
+++ b/hw/usb/hcd-ehci.h
@@ -255,6 +255,7 @@ typedef QTAILQ_HEAD(EHCIQueueHead, EHCIQueue) EHCIQueueHead;
struct EHCIState {
USBBus bus;
+ DeviceState *device;
qemu_irq irq;
MemoryRegion mem;
AddressSpace *as;
--
1.7.9.5
- [Qemu-devel] [PATCH 19/38] xhci: reset port when disabling slot, (continued)
- [Qemu-devel] [PATCH 19/38] xhci: reset port when disabling slot, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 20/38] usb: parallelize usb3 streams, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 21/38] w32: Fix access to host devices (regression), Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 23/38] Revert "memory: Return -1 again on reads from unsigned regions", Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 24/38] exec: check offset_within_address_space for register subpage, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 22/38] memory: Provide separate handling of unassigned io ports accesses, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 25/38] ne2000: mark I/O as LITTLE_ENDIAN, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 28/38] pc: Initializing ram_memory under Xen., Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 30/38] qapi-types.py: Fix enum struct sizes on i686, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 31/38] pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 26/38] ehci: save device pointer in EHCIState,
Michael Roth <=
- [Qemu-devel] [PATCH 29/38] pc_q35: Initialize Xen., Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 33/38] kvmvapic: Catch invalid ROM size, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 36/38] tci: Fix qemu-alpha on 32 bit hosts (wrong assertions), Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 34/38] kvmvapic: Enter inactive state on hardware reset, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 27/38] qxl: fix local renderer, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 35/38] kvmvapic: Clear also physical ROM address when entering INACTIVE state, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 32/38] chardev: fix pty_chr_timer, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 37/38] blockdev: do not default cache.no-flush to true, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 38/38] virtio-blk: do not relay a previous driver's WCE configuration to the current, Michael Roth, 2013/09/25
- Re: [Qemu-devel] [Qemu-stable] Patch Round-up for stable 1.6.1, freeze on 2013-09-30, Cole Robinson, 2013/09/25