Subject: Re: if_delete * if_alloc
To: None <thorpej@nas.nasa.gov>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: tech-kern
Date: 07/09/1997 10:13:23
> On Tue, 08 Jul 1997 21:47:00 -0400
> Matt Thomas <matt@3am-software.com> wrote:
>
> > I can see if_delete for slip/ppp/tun/* but not real ethernet hardware
> > which will be known at boot time. (unless we want to LKM's.)
>
> Not necessarily... c.f. pcmcia devices... hot swap in and hot swap out.
>
> You want to be able to completely release everything at "pop out" time,
> but just can't release ifnets until all of the pkthdr mbufs that reference
> it are gone.
Would it be ok to postpone deleting the softc a bit? The idea would be to
leave the ifnet in the ethercom, and add all the refcount stuff. When
the count gets to zero, an (*if_iffree) routine'd get called which'd
delete the ifnet, probably by deleting the softc it's within. The softc
could already have been unhooked from the config tree.
Take care,
Bill