Re: Design issues serial PCI driver based on char/serial.c

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 15 Aug 1999 18:17:45 +0100 (BST)


> not PCI I/O space. Furthermore, for some unknown reason, the registers
> of the UART are separated 0x80 apart. Since char/serial.c uses I/O
> instructions to access the UART, I had to hack the driver to use readb()
> and friends. I am also multiplying the offset to compensate for the
> strange offsets.

This sounds like the problem I had with the mac68k ethernet cards.

> But then I have to decide runtime to use inb() and outb() or readb() and
> writeb(), since the driver also may be used for other cards that use I/O
> based access. Do you think that this would cause too much overhead in
> the interrupt handlers? It means that every I/O access will be slowed
> down by some extra memory references and a test.

Try it and see.

My personal feeling is that you want to define a macro used for each
read/write of the ports so that the serial code uses something like

READ_PORT(x)

and on x86 and other platforms it comes out as the old inb/outb code
and on your driver it comes out as your more complex code with scaling

Alan


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/