[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: How do I ...
From:       Mike Spengler <mks () networkcs ! com>
Date:       1998-12-29 20:50:05
[Download RAW message or body]

Warner Losh said:
> In message <199812290553.NAA70876@spinner.netplex.com.au> Peter Wemm writes:
> : The catch is that the driver in question has to support unloading.  All the
> : existing network interfaces are pseudo-modules and only have a load
> : routine.  Obviously this requires a fair amount of work to detach a network
> : interface from the stack (including cleaning up routing tables, pcbs,
> : queued data, etc) - nobody has done this yet as far as I'm aware.  I
> : suspect there is a fair amount of infrastructure required to implement
> : this.
> 
> I suspect that you are right.  I've been looking at all of the
> existing drivers (since I'm writing a new one), and have found they
> all cheat and use the compatibility cruft.  And even if they didn't
> cheat, they would have a heck of a time untangling things.
> 
> I suspect that you are right.  I had hoped to get away from
> understanding those internals.  It may make sense to have a "if_dead"
> that is similar to deadfs where all "orphaned" interfaces go when they
> die.  Hmmm, I'll have to look at this more closely....
> 
We originally developed the HARP ATM code under SunOS using LKMs and supported
loading/unloading the atm drivers.  We had to include a lot of the necessary
infrastructure stuff into our code.  When we ported the code to FreeBSD, the
PCI LKM stuff wasn't working and we knew that KLDs were the way of the future,
so that currently the ATM drivers are kernel compiled only.  However, nearly
all of the load/unload code is still there (some of it ifdef'd out), waiting 
for us to do the KLD port (see atm_nif_detach() in sys/netatm/atm_if.c for
one example).  Some (most?) of this code should be genericized for all network 
drivers to use - if_detach() anyone?

-- 
Mike Spengler				Network Computing Services, Inc.
Email: mks@networkcs.com		1200 Washington Ave. So.
Phone: +1 612 337 3557			Minneapolis MN 55415
FAX:   +1 612 337 3400			(aka Minnesota Supercomputer Center)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic