qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 9/9] Support pci=... in option argument of -audio
Date: Thu, 22 Jan 2009 20:31:05 +0100	[thread overview]
Message-ID: <1232652665-1710-9-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <87ocxzrvqb.fsf@pike.pond.sub.org>

From: Markus Armbruster <armbru@pond.sub.org>

---
 hw/ac97.c       |   11 +++--------
 hw/audiodev.h   |    4 ++--
 hw/es1370.c     |   11 +++--------
 hw/mips_malta.c |    6 +++---
 hw/pc.c         |   11 ++++-------
 sysemu.h        |    2 +-
 6 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/hw/ac97.c b/hw/ac97.c
index dc9a165..eab56a8 100644
--- a/hw/ac97.c
+++ b/hw/ac97.c
@@ -1308,25 +1308,20 @@ static void ac97_on_reset (void *opaque)
     mixer_reset (s);
 }
 
-int ac97_init (PCIBus *bus, AudioState *audio)
+int ac97_init (AudioState *audio, const char *opts)
 {
     PCIAC97LinkState *d;
     AC97LinkState *s;
     uint8_t *c;
 
-    if (!bus) {
-        AUD_log ("ac97", "No PCI bus\n");
-        return -1;
-    }
-
     if (!audio) {
         AUD_log ("ac97", "No audio state\n");
         return -1;
     }
 
-    d = (PCIAC97LinkState *) pci_register_device (bus, "AC97",
+    d = (PCIAC97LinkState *) pci_register_device_2("AC97", opts,
                                                   sizeof (PCIAC97LinkState),
-                                                  -1, NULL, NULL);
+                                                  NULL, NULL);
 
     if (!d) {
         AUD_log ("ac97", "Failed to register PCI device\n");
diff --git a/hw/audiodev.h b/hw/audiodev.h
index 5f4a211..8b7ff9b 100644
--- a/hw/audiodev.h
+++ b/hw/audiodev.h
@@ -1,5 +1,5 @@
 /* es1370.c */
-int es1370_init (PCIBus *bus, AudioState *s);
+int es1370_init (AudioState *s, const char *opts);
 
 /* sb16.c */
 int SB16_init (AudioState *s, qemu_irq *pic);
@@ -11,7 +11,7 @@ int Adlib_init (AudioState *s, qemu_irq *pic);
 int GUS_init (AudioState *s, qemu_irq *pic);
 
 /* ac97.c */
-int ac97_init (PCIBus *buf, AudioState *s);
+int ac97_init (AudioState *s, const char *opts);
 
 /* cs4231a.c */
 int cs4231a_init (AudioState *s, qemu_irq *pic);
diff --git a/hw/es1370.c b/hw/es1370.c
index bad237d..5f77ca4 100644
--- a/hw/es1370.c
+++ b/hw/es1370.c
@@ -1005,25 +1005,20 @@ static void es1370_on_reset (void *opaque)
     es1370_reset (s);
 }
 
-int es1370_init (PCIBus *bus, AudioState *audio)
+int es1370_init (AudioState *audio, const char *opts)
 {
     PCIES1370State *d;
     ES1370State *s;
     uint8_t *c;
 
-    if (!bus) {
-        dolog ("No PCI bus\n");
-        return -1;
-    }
-
     if (!audio) {
         dolog ("No audio state\n");
         return -1;
     }
 
-    d = (PCIES1370State *) pci_register_device (bus, "ES1370",
+    d = (PCIES1370State *) pci_register_device_2 ("ES1370", opts,
                                                 sizeof (PCIES1370State),
-                                                -1, NULL, NULL);
+                                                NULL, NULL);
 
     if (!d) {
         AUD_log (NULL, "Failed to register PCI device for ES1370\n");
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index bce141d..066bf15 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -459,7 +459,7 @@ static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, qemu_irq uart_ir
 
 /* Audio support */
 #ifdef HAS_AUDIO
-static void audio_init (PCIBus *pci_bus)
+static void audio_init (void)
 {
     struct soundhw *c;
     int audio_enabled = 0;
@@ -475,7 +475,7 @@ static void audio_init (PCIBus *pci_bus)
         if (s) {
             for (c = soundhw; c->name; ++c) {
                 if (c->enabled)
-                    c->init.init_pci (pci_bus, s);
+                    c->init.init_pci (s, c->opts);
             }
         }
     }
@@ -927,7 +927,7 @@ void mips_malta_init (ram_addr_t ram_size, int vga_ram_size,
 
     /* Sound card */
 #ifdef HAS_AUDIO
-    audio_init(pci_bus);
+    audio_init();
 #endif
 
     /* Network card */
diff --git a/hw/pc.c b/hw/pc.c
index 5fd8356..deb8dcb 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -709,7 +709,7 @@ static int parallel_io[MAX_PARALLEL_PORTS] = { 0x378, 0x278, 0x3bc };
 static int parallel_irq[MAX_PARALLEL_PORTS] = { 7, 7, 7 };
 
 #ifdef HAS_AUDIO
-static void audio_init (PCIBus *pci_bus, qemu_irq *pic)
+static void audio_init (qemu_irq *pic)
 {
     struct soundhw *c;
     int audio_enabled = 0;
@@ -727,11 +727,8 @@ static void audio_init (PCIBus *pci_bus, qemu_irq *pic)
                 if (c->enabled) {
                     if (c->isa) {
                         c->init.init_isa (s, pic);
-                    }
-                    else {
-                        if (pci_bus) {
-                            c->init.init_pci (pci_bus, s);
-                        }
+                    } else {
+			c->init.init_pci (s, c->opts);
                     }
                 }
             }
@@ -1034,7 +1031,7 @@ vga_bios_error:
     i8042_init(i8259[1], i8259[12], 0x60);
     DMA_init(0);
 #ifdef HAS_AUDIO
-    audio_init(pci_enabled ? pci_bus : NULL, i8259);
+    audio_init(i8259);
 #endif
 
     for(i = 0; i < MAX_FD; i++) {
diff --git a/sysemu.h b/sysemu.h
index c47318b..cac3fa7 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -204,7 +204,7 @@ struct soundhw {
     int isa;
     union {
         int (*init_isa) (AudioState *s, qemu_irq *pic);
-        int (*init_pci) (PCIBus *bus, AudioState *s);
+        int (*init_pci) (AudioState *s, const char *opts);
     } init;
 };
 
-- 
1.6.0.6

  parent reply	other threads:[~2009-01-22 19:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 19:23 [Qemu-devel] [RFC PATCH 0/9] Configurable PCI device addresses Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 1/9] PCI device registration helpers Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 2/9] Clean up handling of name=value, ... part of -vga option argument Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 3/9] Support pci=... in option argument of -vga Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 4/9] Convert virtio_init_pci() to pci_register_device_2() Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 5/9] Support pci=... in option argument of -net nic Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 6/9] Make drives_opt[] accessible from device initialization Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 7/9] Support pci=... in option argument of -drive if=virtio Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 8/9] New option -audio as a more flexible alternative to -soundhw Markus Armbruster
2009-01-22 22:03   ` malc
2009-01-23  8:32     ` Markus Armbruster
2009-01-23  9:29       ` Kevin Wolf
2009-01-23 10:04         ` Markus Armbruster
2009-01-23 10:24           ` Kevin Wolf
2009-01-23 11:51             ` Markus Armbruster
2009-01-22 19:31 ` Markus Armbruster [this message]
2009-01-22 20:06 ` [Qemu-devel] [RFC PATCH 0/9] Configurable PCI device addresses Anthony Liguori
2009-01-23  9:04   ` Markus Armbruster
2009-01-23 10:23   ` Daniel P. Berrange
2009-01-23 19:06   ` Paul Brook
2009-01-23 19:28     ` Anthony Liguori
2009-01-26  8:55       ` Markus Armbruster

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=1232652665-1710-9-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --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).