qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-stable@nongnu.org, "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] ehci: save device pointer in EHCIState
Date: Mon, 09 Sep 2013 12:48:48 +0200	[thread overview]
Message-ID: <522DA790.6050105@redhat.com> (raw)
In-Reply-To: <1378720637-27473-1-git-send-email-kraxel@redhat.com>

Hi,

On 09/09/2013 11:57 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 good, note you've forgotten to add qemu-stable,
I've done so now.

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   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 137e200..22bdbf4 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 = 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;
>

      reply	other threads:[~2013-09-09 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09  9:57 [Qemu-devel] [PATCH v2] ehci: save device pointer in EHCIState Gerd Hoffmann
2013-09-09 10:48 ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522DA790.6050105@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).