Re: Writing driver for sync serial board

Krzysztof Halasa (khc@intrepid.pm.waw.pl)
02 Sep 1998 23:01:22 +0200


Jan Kasprzak <kas@informatics.muni.cz> writes:

[about a driver for (a)sync serial board]

> 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).

I've been hacking Riscom N2 drivers for some time, and I think it is best
to have three interfaces per port, and while one is open - block the rest.
That way you don't need to use any additional software - just ifconfig
is enough.

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

What version of N2 driver is it? AFAIR 1.33 works with 2.0.+ kernel,
while i.e. 1.27 does not.

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

Of course. It would be ok to have a separate layer for those modes,
independent of underlaying hardware driver (which would be your one,
SDL N2, Sangoma, ET, or other). I believe the hardware driver has to:
- open/init the board
- close the board
- open a port (speed, options like clock source, etc)
- close a port
- send a frame (for example, a HDLC frame - queue it)
- receive a frame (from internal queue)
- get statistics?

I don't exactly know what should it do with asynchronous port - is it
possible to use, say, FR or Cisco encapsulation over async line?

The higher level driver could implement raw IP, Cisco, sync PPP or FR
protocols, using the low-level services.

There should be some serial core, and the hardware driver should register
itself with it, like in case of sound drivers.

I've been thinking of (re)writing SDL driver that way, but got no time yet.

-- 
Krzysztof Halasa
Network Administrator of The Palace of Youth in Warsaw

- 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/faq.html