Piggyback or line discipline, and how?

Morten Norman (marten.norman@intertex.se)
Wed, 24 Mar 1999 15:30:20 +0100


Ok, it's time to write my first linux driver...

I think I know enough to write a "normal" hardware driver, but I need some
advice for this project:

The device I target the driver for, is a combined V90 modem and smartcard
reader, IX36 SC, that connects to one RS232 port. Since IX36 SC uses one
serial line, it interleaves smartcard and modem data packets. Thus it
needs a driver that controls *one* COM port, and presents one modem device
(a "clone" of the COM port) and one ("new") smartcard device.

Now the questions:

What is the Right Way (tm) to hijack the serial data stream?
What I want is to look at every byte received and transmitted, and
optionally forward or change it.

Options i consider:

1) Present my driver as a serial driver, then piggybacking by opening the
serial driver to access the COM port. Not perfectly clean, but works.
But how do I open a port? I found sys_open(), but insmod didn't like it.

2) Use a line discipline. Does it work for me? I can't tell myself, since
I don't understand them. Everybody's talking about line disciplines,
and appears to know them by heart. Is there a document I have missed??
The source isn't too obvious to learn from here :-(

Please CC: answers to me <marten.norman@intertex.se>, since I'm not
subscribing to linux-kernel. I *will* watch this thread through the archives,
but I guess it's a little slower that a CC:

Thanks in advance for any help

Morten Norman

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