On Oct 31, 2007 4:42 PM, Wolfgang Grandegger <[EMAIL PROTECTED]> wrote:
> > > > > > 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"). > Ok, dev->irq gives number 22 and interrupt is working. > > > > 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 The last number should be 01.0 instead of 08.0 I think or am I wrong? lspci give this result: lspci 01:01.0 Bridge: Teradyne Inc Unknown device fa56 01:08.0 Ethernet controller: Intel Corporation 82562EZ 10/100 Ethernet Controller (rev 02) od -t x4 /proc/bus/pci/01/01.0 0000000 fa561316 02000102 06800000 00000000 0000020 fc000000 00000000 00000000 00000000 0000040 00000000 00000000 00000000 02990004 0000060 00000000 00000000 00000000 0000010a 0000100 00000000 00000000 00000000 00000000 * 0000400 Is there not something like a signal I can set in the interrupt routine of the driver. The user space application have to wait its execution until the signal is set? Steven
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
