How to access the I/O bits of PCI printer card?

662 views Asked by At

enter image description here

In older time on a P4 mother board of my PC there was an integrated parallel printer port with a DB-25 connector. These I/O pins was very handy to communicate with an external digital equipment. I could use these I/O pins to control my external hardware from my C programs under Linux because:

I knew the I/O map on 0x378 or 0x278, and I used the ioperm(0x378,2,1) function to give privilege to direct access under Linux. After it I could simple write and read with outb(data, 0x378), inb(0x378+1) functions (with #include <sys/io.h> ). (I have it run with root privilege or I used the setuid rights).

But now I have a newer mother board GA-870A-USB3 without any parallel port. I bought a parallel PCI card seems on the picture. I had to choose PCI interface due to mother board.(I think with ISA bus I wouldn't any problem but today no ISA bus on the motherboard.)

Can I access the DB-25 pins on this PCI printer card under Linux from my C programs in the same way as above or how could I use this card's I/O pins? (The preferable bit changing speed is about .5-1 ms. This bite rate is easily performed with an old P4 mother board on the default parallel port (0x378). Although my communication protocol of my hardware isn't sensible for bit rate.)

Cont. at Oct 5.
I plugged and unplugged the above PCI I/O card and I could realize that this line
03:06.0 Serial controller: TXIC Device 5073 (rev 10)
is related for my card.
Here is a detailed list:

lspci -vvvxxxs 03:06.0
03:06.0 Serial controller: TXIC Device 5073 (rev 10) (prog-if 02 [16550])
Subsystem: TXIC Device 3273
Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 20
NUMA node: 0
Region 0: I/O ports at cf00 [size=8]
Region 1: I/O ports at ce00 [size=8]
Region 2: I/O ports at cd00 [size=8]
Region 3: I/O ports at cc00 [size=8]
Kernel driver in use: serial
00: 51 46 73 50 01 00 00 02 10 02 00 07 00 00 00 00
10: 01 cf 00 00 01 ce 00 00 01 cd 00 00 01 cc 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 51 46 73 32
30: 00 00 00 00 00 00 00 00 00 00 00 00 03 01 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 51 46 73 50 01 00 00 02 10 02 00 07 00 00 00 00
90: 01 cf 00 00 01 ce 00 00 01 cd 00 00 01 cc 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 51 46 73 32
b0: 00 00 00 00 00 00 00 00 00 00 00 00 03 01 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Is it normal that there is only one record for this I/O card, but this card occupies two serial and one parallel port ?

I can see there are some pretty docs from writing device driver:
https://lwn.net/Kernel/LDD3/
https://www.kernel.org/doc/html/latest/PCI/pci.html#

But I hope that I can access my I/O card from user context with my C prg. I have installed PCI Utilities package:pciutils-3.7.0.tar.gz
from: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
I have run the example.c from user context with root user and I could get a similar list as lspci's.

Would it be a right plan to access I/O card ?

I think this is my main problem: How could I know the meaning of the 256 bytes of my PCI card ? I think they provides the control/status and data transfer for two serial and one parallel interface.

0

There are 0 answers