Writing driver for sync serial board

Jan Kasprzak (kas@informatics.muni.cz)
Wed, 02 Sep 1998 11:39:59 +0200


Hello all,

I am writing a driver for a sync/async serial board
(see ftp://ftp.ics.muni.cz/pub/cosa/cosa.html -- it is in Czech language :-)
and I need help with the driver structure. At present I have
the driver working as the character device - I can download the
microcode to the board, send and receive packets, and reset the board's CPU.
My work is at http://www.linux.cz/~kas/cosa/ (it is a CVS tree browsable
by the cvsweb.cgi).

I would like to be able to use this board in (at least) four modes:
- as a character device /dev/cosa* (I already have this up and running).
- as the raw IP interface (I think it will not be difficult - I can do this
with a help of drivers/net/skeleton.c)
- as the sync PPP interface
- as the Cisco HDLC interface (probably I should do this the same way as
SDL Riscom/N2 does)

The main question is how to structure the driver to allow these
modes. Should I register_netdev() three interfaces (rawip, sppp and hdlc)
for each channel I have, or should I have one net interface per channel
and switch modes on the fly (maybe via an ioctl() on the corresponding
character device).

As for the sync PPP interface: Can it work on top of the character
device driver? What should I add to the character
driver to allow pppd work on top of it? I have looked at the ppp driver
of the SDL Riscom/N2 and added the TIOC[GS]ETD ioctls, but it is still not
sufficient.

The Riscom/N2 driver has its own interfaces ppp-X (not pppX) and
ciscoX for sync PPP and cisco HDLC modes. I think this is quite ugly
- there should be a generic sync PPP and Cisco HDLC/SLARP layers.

Thanks in advance,

-Yenya

--
\ Jan "Yenya" Kasprzak <kas at fi.muni.cz>       http://www.fi.muni.cz/~kas/
\\ PGP: finger kas at aisa.fi.muni.cz   0D99A7FB206605D7 8B35FCDE05B18A5E //
\\\             Czech Linux Homepage:  http://www.linux.cz/              ///
If there are race conditions in programs fix them. The "my programs suck fix
something else" mentality leads you to things like Java.         -- Alan Cox

- 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.altern.org/andrebalsa/doc/lkml-faq.html