Brynet-Inc wrote:OpenBSD has a driver for PCI com/lpt devices named
puc(4) - "PCI Universal Communications", glue for attaching MI com(4) and lpt(4) drivers.
There doesn't appear to be an actual standard for this though, it just so happens that generalizations could be made due to similarities.. from a comment in OpenBSD's driver:
Thank you for the links. I actually searched though linux kernel source code, before asking it here, but I didn't find anything similar, what I am trying to do. Maybe I have missed info. It is sad that there is no such standard.
BTW, I looked over these links. Can someone explain
first two members - 'rval' and 'rmask' of
struct puc_device_description structure? I didn't get them.
They are defined in
<dev/pci/pucvar.h>
Code: Select all
struct puc_device_description {
u_int16_t rval[4]; // 4 vendor(or device) ids ????
u_int16_t rmask[4]; // why mask?
struct {
u_char type;
u_char bar;
u_short offset;
} ports[PUC_MAX_PORTS];
};
It seems that 'rval' array contains PCI venid, PCI devid, PCI subsystem venid, PCI subsystem devid,
in order. Am I right?
But why is 'rmask' used?
After reading the source code, I realized, that many such cards implement
both parallel port and serial port in a single PCI function, and the base addresses of these parallel port and serial port are of course in
different bars. But if there is more than one serial port on a single card, then in some cards, they all share a single BAR. One is at offset 0 and other is at offset 0x08 say, and so on.
I wonder, what is the
Subclass code of such a PCI function? I guess it would be
either 02h or 80h. If that is the case, then I can't search for all parallel ports present in the system by simply searching for a parallel port subclass. Can someone clarify?