Need help with serial line device driver

Steve Dyer dyer at arktouros.MIT.EDU
Sat Oct 22 09:24:54 AEST 1988


In article <477 at tank.uchicago.edu> matt at oddjob.uchicago.edu (Matt Crawford) writes:
>I think the answers I've seen are on the wrong track.  I believe Bill
>just needs to know how to have his driver put the received packet on the
>input queue for the IP module.
>...in 4.[23] ... look for macros or functions with names like IF_ENQUEUE
>or schednetisr.

Since Bill is using FTP's own IP support in the XENIX kernel, I'd assume he'd
know how his IP input routine works.  The problem stems from viewing serial
ports as entities whose data necessarily originates and ends with a user
process reading and writing /dev/ttyMN, which is a reasonable assumption
for anyone who hasn't addressed this problem before.  Line disciplines
allow a kernel programmer to "splice" into the TTY read/write/start/input
routines and change the normal serial line behavior, including, in the case
of SLIP, wresting control from user-level reads/writes and giving the
control to the IP input and output modules in the kernel.

You can be sure that if they had been using the new AT&T-free Berkeley code,
they'd already have the SLIP code which uses line disciplines under 4.x.  End of
problem, almost, except for differences between 4.x and Sys V tty drivers,
which at the line discipline level aren't many,  and a lot of 4.3-mbuf-
specificity which wouldn't apply to code which doesn't use mbufs.

OK, that's a lot for an "almost", granted, but by examining net/if_sl.c
you should get a feel for what routines need to comprise the line discipline
switch table entry for SLIP under any flavor of UNIX and with any
implementation of IP.

---
Steve Dyer
dyer at arktouros.MIT.EDU
dyer at spdcc.COM aka {harvard,husc6,ima,bbn,m2c,mipseast}!spdcc!dyer



More information about the Comp.unix.xenix mailing list