All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Xenomai-help] RTDM interrupt questions
@ 2007-10-31 15:42 Wolfgang Grandegger
       [not found] ` <ff1d78710711050043h7ebe3bc1l88c180d36c800d3@domain.hid>
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Grandegger @ 2007-10-31 15:42 UTC (permalink / raw)
  To: Steven Kauffmann, xenomai



> 
> Hi
> 
> I'm writing a RTDM driver that works with a PCI FPGA card. This card
> generates an interrupt when its calculation is done. To deal with
interrupts
> I have to know the interrupt line number. I found this in Linux device
> drivers:
> 
> result = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &my_irq);

You should use "dev->irq". There is no need to read that PCI
configuration register (have a look to the PCI drivers in drivers/net").

> 
> The result is 10, but the result of lspci -v is:
> 
> 01:01.0 Bridge: Teradyne Inc Unknown device fa56
>         Subsystem: Unknown device 0004:0299
>         Flags: medium devsel, IRQ 22
>         Memory at fc000000 (32-bit, non-prefetchable) [size=32M]
> 
> So the interrupt line number is now 22. If I use this interrupt line
number
> in the function rtdm_irq_request, than the interrupt handler is working.
> When I use the interrupt line number received from the read_config_byte
> function nothing happens.
> In linux device drivers they write that the value of PCI_INTERRUPT_LINE is
> guaranteed to be the right one, but why is it not working?
> 
> The intention of the driver is that an user space application writes some
> data to the PCI card, the card does something with it. The user space
> application have to wait until an interrupt occures, than it reads the
> result from the PCI card. How can the driver informs the user space
> application that an interrupt occurred?

Even if it is not needed by the PCI card, the IRQ vector is normally
written to the card. What does the following command for your card
show:

  $ od -t x4 /proc/bus/pci/01/08.0

Wolfgang.




^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Xenomai-help] RTDM interrupt questions
@ 2007-10-31 14:23 Steven Kauffmann
  0 siblings, 0 replies; 6+ messages in thread
From: Steven Kauffmann @ 2007-10-31 14:23 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]

Hi

I'm writing a RTDM driver that works with a PCI FPGA card. This card
generates an interrupt when its calculation is done. To deal with interrupts
I have to know the interrupt line number. I found this in Linux device
drivers:

result = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &my_irq);

The result is 10, but the result of lspci -v is:

01:01.0 Bridge: Teradyne Inc Unknown device fa56
        Subsystem: Unknown device 0004:0299
        Flags: medium devsel, IRQ 22
        Memory at fc000000 (32-bit, non-prefetchable) [size=32M]

So the interrupt line number is now 22. If I use this interrupt line number
in the function rtdm_irq_request, than the interrupt handler is working.
When I use the interrupt line number received from the read_config_byte
function nothing happens.
In linux device drivers they write that the value of PCI_INTERRUPT_LINE is
guaranteed to be the right one, but why is it not working?

The intention of the driver is that an user space application writes some
data to the PCI card, the card does something with it. The user space
application have to wait until an interrupt occures, than it reads the
result from the PCI card. How can the driver informs the user space
application that an interrupt occurred?

thanks in advance

Steven

[-- Attachment #2: Type: text/html, Size: 1466 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-05 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31 15:42 [Xenomai-help] RTDM interrupt questions Wolfgang Grandegger
     [not found] ` <ff1d78710711050043h7ebe3bc1l88c180d36c800d3@domain.hid>
2007-11-05  8:46   ` Steven Kauffmann
2007-11-05  9:36     ` Wolfgang Grandegger
     [not found]     ` <fd6a47a90711050117h1d2afbd1p56add10625a8da6f@domain.hid>
2007-11-05 15:57       ` Steven Kauffmann
2007-11-05 16:34         ` Jan Kiszka
  -- strict thread matches above, loose matches on Subject: below --
2007-10-31 14:23 Steven Kauffmann

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.