* [Qemu-devel] [PATCH] ehci: save device pointer in EHCIState
@ 2013-09-09 8:20 Gerd Hoffmann
2013-09-09 9:04 ` Hans de Goede
0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2013-09-09 8:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
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 <kraxel@redhat.com>
---
hw/usb/hcd-ehci.c | 3 ++-
hw/usb/hcd-ehci.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 137e200..162680c 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1486,7 +1486,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 +2529,7 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp)
s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, 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.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] ehci: save device pointer in EHCIState
2013-09-09 8:20 [Qemu-devel] [PATCH] ehci: save device pointer in EHCIState Gerd Hoffmann
@ 2013-09-09 9:04 ` Hans de Goede
2013-09-09 9:58 ` Gerd Hoffmann
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2013-09-09 9:04 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
Hi,
On 09/09/2013 10:20 AM, Gerd Hoffmann wrote:
> 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
Looks like we've been working on exactly the same bug at the
same time, but we've come up with slightly different solutions.
If we're going to go this way (which seems the best), you
should also modify the qemu_sglist_init call in
ehci_init_transfer for consistency, and drop the bus and qbus
variable declarations at the top of the functions as those will
be unused then.
Regards,
Hans
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] ehci: save device pointer in EHCIState
2013-09-09 9:04 ` Hans de Goede
@ 2013-09-09 9:58 ` Gerd Hoffmann
0 siblings, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2013-09-09 9:58 UTC (permalink / raw)
To: Hans de Goede; +Cc: qemu-devel
On Mo, 2013-09-09 at 11:04 +0200, Hans de Goede wrote:
> Hi,
>
> On 09/09/2013 10:20 AM, Gerd Hoffmann wrote:
> > 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
>
> Looks like we've been working on exactly the same bug at the
> same time, but we've come up with slightly different solutions.
Yep, and then "git send-email" exactly the same minute ;)
> If we're going to go this way (which seems the best), you
> should also modify the qemu_sglist_init call in
> ehci_init_transfer for consistency, and drop the bus and qbus
> variable declarations at the top of the functions as those will
> be unused then.
Makes sense indeed. Done, v2 sent.
cheers,
Gerd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-09 9:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 8:20 [Qemu-devel] [PATCH] ehci: save device pointer in EHCIState Gerd Hoffmann
2013-09-09 9:04 ` Hans de Goede
2013-09-09 9:58 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).