Subject: Question about SPLs
To: NetBSD Amiga Developer List <amiga-dev@sun-lamp.cs.berkeley.edu>
From: Gregory Kritsch <gkritsch@sail.uwaterloo.ca>
List: amiga-dev
Date: 03/16/1994 11:54:13
Okay, I've been playing with adding a driver for my Supra modem and I've
come across a few problems.  I'm wondering if anyone out there can shed
any light on some of them.  Incidentally, in discussions with R Miranda,
it seems that this driver could very easily be adapted to support the
GVP IOExtender card as well, and anything else that uses an NS16450 or
NS16550.

Both the Supra and GVP cards generate EXTER interrupts (ipl 6).  I'm
reasonably sure of my io addresses, but it is a modem card so I can't
really test just the serial portion of the driver.  

First, major device numbers.  Is there any proper protocol I should go
through to allocate one?  For now, I've taken device 17.

Second, the spl macros.  I think there's a problem.  spltty is currently 4,
splimp is 3, and splnet is <= 3.  When I pump spltty up to 6, a number
of strange things in my driver stop happening, however, my slip connection
also stops happening.  A brief inspection of if_sl.c shows a comment,
something like  ``splimp()  /* actually max (splnet, spltty) */''.  The
same kernel, recompiled with spltty at 4, can maintain a working slip
connection.  (The slip connection is through the internal serial port,
not my driver).

[ I didn't exhaustively test this, but I think I had serious problems
running mkdep when trying to build a kernel from scratch, with spltty at
6. ]

Third, interrupts.  I think my technique for adding an interrupt server
for the modem was rather nasty (locore.s).  I noticed some neat looking
code in the Zeus siop driver.  Has anyone given any thought to sharing out
EXTER interrupts in a slightly nicer way?

Finally, about spl*().  What should I do.  As the code stands, I have a
conditional definition of spltty based on NCOM (the 16x50 driver is called
com, since it is mostly based on the com driver from i386/isa).  What
dependancies exist between the various spl levels (like the thing in
if_sl.c).  Running with tty at 6 sounds like a bad idea offhand, what
does everyone else think.  I don't really want to write a buffered driver
like the internal serial port, but it looks like I may have to.

That's all I can think of for now.  Any help anyone can provide would be
greatly appreciated.

Gregory

------------------------------------------------------------------------------