All of lore.kernel.org
 help / color / mirror / Atom feed
From: pisa@cmp.felk.cvut.cz
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Konrad Frederic <fred.konrad@greensocs.com>,
	Deniz Eren <deniz.eren@icloud.com>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Marek Vasut <marex@denx.de>, Jan Kiszka <jan.kiszka@siemens.com>,
	Pavel Pisa <pisa@cmp.felk.cvut.cz>
Subject: [Qemu-devel] [PATCH 4/6] Fixed IRQ problem for CAN device can_pcm3680_pci.
Date: Wed, 25 Oct 2017 01:29:44 +0200	[thread overview]
Message-ID: <cbfe4b03919c677d132971ed0c352b0d90de5015.1508885974.git.pisa@cmp.felk.cvut.cz> (raw)
In-Reply-To: <7df70170550e3a10152a3571012f507dd035ba7c.1508885974.git.pisa@cmp.felk.cvut.cz>
In-Reply-To: <cover.1508885974.git.pisa@cmp.felk.cvut.cz>

From: Deniz Eren <deniz.eren@icloud.com>

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
---
 hw/can/can_pcm3680_pci.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hw/can/can_pcm3680_pci.c b/hw/can/can_pcm3680_pci.c
index 77523f2ddb..bc6b164ea7 100644
--- a/hw/can/can_pcm3680_pci.c
+++ b/hw/can/can_pcm3680_pci.c
@@ -61,6 +61,7 @@ typedef struct Pcm3680iPCIState {
     MemoryRegion    sja_io[2];
 
     CanSJA1000State sja_state[2];
+    qemu_irq        irq;
 
     char            *model; /* The model that support, only SJA1000 now. */
     char            *canbus[2];
@@ -69,10 +70,16 @@ typedef struct Pcm3680iPCIState {
 
 static void pcm3680i_pci_irq_raise(void *opaque)
 {
+    Pcm3680iPCIState *d = (Pcm3680iPCIState *)opaque;
+
+    qemu_irq_raise(d->irq);
 }
 
 static void pcm3680i_pci_irq_lower(void *opaque)
 {
+    Pcm3680iPCIState *d = (Pcm3680iPCIState *)opaque;
+
+    qemu_irq_lower(d->irq);
 }
 
 static void
@@ -206,6 +213,8 @@ static int pcm3680i_pci_init(PCIDevice *pci_dev)
     pci_conf = pci_dev->config;
     pci_conf[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin A */
 
+    d->irq = pci_allocate_irq(&d->dev);
+
     can_sja_init(s1, pcm3680i_pci_irq_raise, pcm3680i_pci_irq_lower, d);
     can_sja_init(s2, pcm3680i_pci_irq_raise, pcm3680i_pci_irq_lower, d);
 
@@ -254,6 +263,8 @@ static void pcm3680i_pci_exit(PCIDevice *pci_dev)
 
     can_sja_exit(s1);
     can_sja_exit(s2);
+
+    qemu_free_irq(d->irq);
 }
 
 static const VMStateDescription vmstate_pcm3680i_pci = {
-- 
2.11.0

  parent reply	other threads:[~2017-10-24 23:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 23:12 [Qemu-devel] [PATCH 0/6] CAN bus support for QEMU (SJA1000 PCI so far) pisa
2017-10-24 23:12 ` [Qemu-devel] [PATCH 1/6] CAN bus simple SJA1000 PCI card emulation for QEMU pisa
2017-10-27 14:18   ` KONRAD Frederic
2017-10-29 22:43     ` Pavel Pisa
2017-10-30  9:19       ` KONRAD Frederic
2017-10-30 10:51         ` Marek Vasut
2017-10-30 11:38           ` KONRAD Frederic
2017-10-30 12:27             ` Pavel Pisa
2017-10-24 23:29 ` [Qemu-devel] [PATCH 2/6] CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added pisa
2017-10-24 23:29 ` [Qemu-devel] [PATCH 3/6] CAN bus PCM-3680I PCI (dual " pisa
2017-10-24 23:29 ` pisa [this message]
2017-10-25  6:53   ` [Qemu-devel] [PATCH 4/6] Fixed IRQ problem for CAN device can_pcm3680_pci KONRAD Frederic
2017-10-25  7:40     ` Pavel Pisa
2017-10-25  7:46       ` KONRAD Frederic
2017-10-24 23:29 ` [Qemu-devel] [PATCH 5/6] Minor clean-up of can_pcm3680_pci pisa
2017-10-25  7:46   ` KONRAD Frederic
2017-10-24 23:29 ` [Qemu-devel] [PATCH 6/6] CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation added pisa
  -- strict thread matches above, loose matches on Subject: below --
2017-01-05 23:11 [Qemu-devel] [PATCH 0/6] CAN bus support for QEMU (SJA1000 PCI so far) pisa
2017-01-05 23:11 ` [Qemu-devel] [PATCH 4/6] Fixed IRQ problem for CAN device can_pcm3680_pci pisa

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=cbfe4b03919c677d132971ed0c352b0d90de5015.1508885974.git.pisa@cmp.felk.cvut.cz \
    --to=pisa@cmp.felk.cvut.cz \
    --cc=deniz.eren@icloud.com \
    --cc=fred.konrad@greensocs.com \
    --cc=jan.kiszka@siemens.com \
    --cc=marex@denx.de \
    --cc=qemu-devel@nongnu.org \
    --cc=socketcan@hartkopp.net \
    --cc=stefanha@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.