How to use register_serial ?

Karsten=?iso-8859-1?Q?_M=FCller?= (kmu@ratio.de)
Wed, 13 Jan 1999 19:08:40 +0100 (MET)


Hi folks...

We are developing a PCI board on which we have a 16550A UART.
Since we don't want to (re-?)implement all sublevel functions
for this serial device, we would like to use the existing
functionalities of the kernel.
We digged out the "register_serial" and "unregister_serial"
functions, and implemented a small kernel module which
at the moment just calls this functions with hardcoded
ioport and interupt:

...
int init_module(void)
{
struct serial_struct ss;
memset(&ss, 0, sizeof(ss));
ss.type = 0;
ss.line = 0;
ss.port = 0xb400;
ss.irq = 0x09;
ss.flags = 0;
ss.xmit_fifo_size = 0;
ss.custom_divisor = 0;
ss.close_delay = 0;
line = register_serial(&ss);
return 0;
}

void cleanup_module(void)
{
printk("kmu serial Testdriver closed\n");
if (line)
unregister_serial(line);
}
...

It seems to work fine, since the kernel messages are:

Jan 13 18:37:38 harlekin kernel: tty02 at 0xb400 (irq = 9) is a 16550A
Jan 13 18:37:56 harlekin kernel: tty02 unloaded

But how can we access this registered port from within the kernel ?
We've searched the mailing list archive for this with no luck...

Any ideas ?

Please CC your answer to me by email, since I am not subscribed
to this list.

Thanks in advance

Regards
Karsten

--
Karsten Müller              kmu@ratio.de
RATIO Entwicklungen GmbH    http://www.ratio.de
Admiralitätstr. 59          Tel.: +49 40 369007-20
20459 Hamburg

- 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/