Talking to PCI board

I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre

Look at the pci_*() functions.

For instance:

First steps:
ThreadCtrl(_NTO_TCTL_IO, 0) - allows the application IO privilige:
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/t/threadctl.html

For PCI plug and play functionality:
pci_attach() - for connecting to the PCI sub-system:
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_attach.html

pci_attach_device() - for finding and retrieving PCI device information:
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_attach_device.html

pci_detach() - disconnects from PCI sub-system:
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_detach.html

Memory mapping:
mmap_device_memory() - for mapping PCI device memory into virtual memory
space:
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/m/mmap_device_memory.html

IO:
in8() - reads 8 bit IO
in16() - 16 bit
in32() - 32 bit
out8() - write 8 bit IO
out16() - 16 bit
out32() - 32 bit
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/in8.html

Interrupt:
InterruptAttach() - sets up traditional ISR
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/interruptattach.html

InterruptAttachEvent() - sets up an event based ISR, which run in user
space. This is slower than the traditional ISR method.
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/interruptattachevent.html


Jens

“Andre Goddard Rosa” <goddard@audiolab.com.br> wrote in message
news:bkq8m2$h94$1@inn.qnx.com

I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at > www.plxtech.com> . They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre

Thank you very much, I will take a look at these and report later!!!

Best Regards,

Andre

“Jens H Jorgensen” <jhj@remove-nospam-videk.com> escreveu na mensagem
news:bks7uh$1dv$1@inn.qnx.com

Look at the pci_*() functions.

For instance:

First steps:
ThreadCtrl(_NTO_TCTL_IO, 0) - allows the application IO privilige:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/t/threa

dctl.html

For PCI plug and play functionality:
pci_attach() - for connecting to the PCI sub-system:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_a

ttach.html

pci_attach_device() - for finding and retrieving PCI device information:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_a

ttach_device.html

pci_detach() - disconnects from PCI sub-system:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_d

etach.html

Memory mapping:
mmap_device_memory() - for mapping PCI device memory into virtual memory
space:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/m/mmap> _

device_memory.html

IO:
in8() - reads 8 bit IO
in16() - 16 bit
in32() - 32 bit
out8() - write 8 bit IO
out16() - 16 bit
out32() - 32 bit

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/in8.h

tml

Interrupt:
InterruptAttach() - sets up traditional ISR

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/inter

ruptattach.html

InterruptAttachEvent() - sets up an event based ISR, which run in user
space. This is slower than the traditional ISR method.

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/inter

ruptattachevent.html


Jens

“Andre Goddard Rosa” <> goddard@audiolab.com.br> > wrote in message
news:bkq8m2$h94$> 1@inn.qnx.com> …
I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at > www.plxtech.com> . They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre
\

What can I do if I am using QNX4?

Thanks,

Andre

“Andre Goddard Rosa” <goddard@audiolab.com.br> escreveu na mensagem
news:bkq8m2$h94$1@inn.qnx.com

I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at > www.plxtech.com> . They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre

What can I do if I am using QNX4?

Thanks,

Andre

“Jens H Jorgensen” <jhj@remove-nospam-videk.com> escreveu na mensagem
news:bks7uh$1dv$1@inn.qnx.com

Look at the pci_*() functions.

For instance:

First steps:
ThreadCtrl(_NTO_TCTL_IO, 0) - allows the application IO privilige:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/t/threa

dctl.html

For PCI plug and play functionality:
pci_attach() - for connecting to the PCI sub-system:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_a

ttach.html

pci_attach_device() - for finding and retrieving PCI device information:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_a

ttach_device.html

pci_detach() - disconnects from PCI sub-system:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/p/pci_d

etach.html

Memory mapping:
mmap_device_memory() - for mapping PCI device memory into virtual memory
space:

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/m/mmap> _

device_memory.html

IO:
in8() - reads 8 bit IO
in16() - 16 bit
in32() - 32 bit
out8() - write 8 bit IO
out16() - 16 bit
out32() - 32 bit

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/in8.h

tml

Interrupt:
InterruptAttach() - sets up traditional ISR

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/inter

ruptattach.html

InterruptAttachEvent() - sets up an event based ISR, which run in user
space. This is slower than the traditional ISR method.

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/lib_ref/i/inter

ruptattachevent.html


Jens

“Andre Goddard Rosa” <> goddard@audiolab.com.br> > wrote in message
news:bkq8m2$h94$> 1@inn.qnx.com> …
I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at > www.plxtech.com> . They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre
\

Jens

“Andre Goddard Rosa” <> goddard@audiolab.com.br> > wrote in message
news:bkq8m2$h94$> 1@inn.qnx.com> …
I want to develop a driver to communicate with a PCI board that will
be
connected to a device that provides me with a regular time indicator
via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI
device.
This certainly exists but I could not find anywhere on the site by
searching it.

Maybe you were looking for something a little more too specific. Under QNX4
a driver is just like a normal program. Just need to be linked with -T1.
As for getting info about PCI look for CA_PCI_* fonctions.

All the doc you found on are mostly about QNX6, beware.

The board that I am using is a PCI9030 assembled by
PLX Technology at > www.plxtech.com> . They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre


\

Thanks, I just found how to access it using CA_PCI_* and using inp() to read
from an address, it is working
so I am getting the values I need.

Now I must install a handler to listen to interrupts, do you know how to do
that?

Thanks,

Andre

“Mario Charest” postmaster@127.0.0.1 escreveu na mensagem
news:bkvo9d$iki$1@inn.qnx.com

Jens

“Andre Goddard Rosa” <> goddard@audiolab.com.br> > wrote in message
news:bkq8m2$h94$> 1@inn.qnx.com> …
I want to develop a driver to communicate with a PCI board that will
be
connected to a device that provides me with a regular time indicator
via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI
register
of an arbitrary PCI device. I found references about Audio,
Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI
device.
This certainly exists but I could not find anywhere on the site by
searching it.

Maybe you were looking for something a little more too specific. Under
QNX4
a driver is just like a normal program. Just need to be linked with -T1.
As for getting info about PCI look for CA_PCI_* fonctions.

All the doc you found on are mostly about QNX6, beware.


The board that I am using is a PCI9030 assembled by
PLX Technology at > www.plxtech.com> . They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre




\

Thanks to you all, I got it working ok now,

Andre