qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, alex.williamson@redhat.com
Subject: [Qemu-devel] [PATCH 08/24] ne2000: pass device to ne2000_setup_io, use it as owner
Date: Tue, 25 Jun 2013 16:14:49 +0200	[thread overview]
Message-ID: <1372169705-7645-9-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1372169705-7645-1-git-send-email-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/net/ne2000-isa.c | 2 +-
 hw/net/ne2000.c     | 6 +++---
 hw/net/ne2000.h     | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index 9232abd..e3c8076 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -72,7 +72,7 @@ static void isa_ne2000_realizefn(DeviceState *dev, Error **errp)
     ISANE2000State *isa = ISA_NE2000(dev);
     NE2000State *s = &isa->ne2000;
 
-    ne2000_setup_io(s, 0x20);
+    ne2000_setup_io(s, DEVICE(isadev), 0x20);
     isa_register_ioport(isadev, &s->io, isa->iobase);
 
     isa_init_irq(isadev, &s->irq, isa->isairq);
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 00940af..8d43fd9 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -699,9 +699,9 @@ static const MemoryRegionOps ne2000_ops = {
 /***********************************************************/
 /* PCI NE2000 definitions */
 
-void ne2000_setup_io(NE2000State *s, unsigned size)
+void ne2000_setup_io(NE2000State *s, DeviceState *dev, unsigned size)
 {
-    memory_region_init_io(&s->io, NULL, &ne2000_ops, s, "ne2000", size);
+    memory_region_init_io(&s->io, OBJECT(dev), &ne2000_ops, s, "ne2000", size);
 }
 
 static void ne2000_cleanup(NetClientState *nc)
@@ -729,7 +729,7 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
     pci_conf[PCI_INTERRUPT_PIN] = 1; /* interrupt pin A */
 
     s = &d->ne2000;
-    ne2000_setup_io(s, 0x100);
+    ne2000_setup_io(s, DEVICE(pci_dev), 0x100);
     pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io);
     s->irq = d->dev.irq[0];
 
diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h
index b31ae03..e500306 100644
--- a/hw/net/ne2000.h
+++ b/hw/net/ne2000.h
@@ -31,7 +31,7 @@ typedef struct NE2000State {
     uint8_t mem[NE2000_MEM_SIZE];
 } NE2000State;
 
-void ne2000_setup_io(NE2000State *s, unsigned size);
+void ne2000_setup_io(NE2000State *s, DeviceState *dev, unsigned size);
 extern const VMStateDescription vmstate_ne2000;
 void ne2000_reset(NE2000State *s);
 int ne2000_can_receive(NetClientState *nc);
-- 
1.8.1.4

  parent reply	other threads:[~2013-06-25 14:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 14:14 [Qemu-devel] [PATCH 00/24] Memory patches, part 4: region ownership (devices part) Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 01/24] escc: rename struct to ESCCState Paolo Bonzini
2013-06-25 15:10   ` Andreas Färber
2013-06-25 14:14 ` [Qemu-devel] [PATCH 02/24] vga: pass owner to vga_init Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 03/24] vga: pass owner to vga_common_init Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 04/24] vga: pass owner to cirrus_init_common Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 05/24] vga: pass owner to vga_init_vbe Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 06/24] vga: pass owner to vga_init_io Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 07/24] vga: set owner in vga_update_memory_access Paolo Bonzini
2013-06-25 14:14 ` Paolo Bonzini [this message]
2013-06-25 14:14 ` [Qemu-devel] [PATCH 09/24] vfio: pass device to vfio_mmap_bar and use it to set owner Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 10/24] spapr_iommu: pass device to spapr_tce_new_table " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 11/24] pam: pass device to init_pam " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 12/24] piolist: add owner argument to initialization functions and pass devices Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 13/24] hw/a*: pass owner to memory_region_init_io Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 14/24] hw/block: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 15/24] hw/c*: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 16/24] hw/d*: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 17/24] hw/gpio: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 18/24] hw/i*: " Paolo Bonzini
2013-07-01 23:27   ` Andreas Färber
2013-06-25 14:15 ` [Qemu-devel] [PATCH 19/24] hw/m*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 20/24] hw/n*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 21/24] hw/p*: " Paolo Bonzini
2013-07-01 23:31   ` Andreas Färber
2013-07-02  6:43     ` Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 22/24] hw/s*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 23/24] hw/t*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 24/24] hw/[u-x]*: " Paolo Bonzini
2013-07-01 23:42   ` Andreas Färber
2013-07-02  5:49     ` Paolo Bonzini

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=1372169705-7645-9-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).