Date: Sun, 2 Dec 2007 12:25:16 +0100 From: Marko Zec <zec@imunes.net> To: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 129994 for review Message-ID: <200712021225.16846.zec@imunes.net> In-Reply-To: <200712021113.lB2BDefa043362@repoman.freebsd.org> References: <200712021113.lB2BDefa043362@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 02 December 2007 12:13:40 Marko Zec wrote: > http://perforce.freebsd.org/chv.cgi?CH=3D129994 > > Change 129994 by zec@zec_tpx32 on 2007/12/02 11:13:11 > > IFC > > Affected files ... > > .. //depot/projects/vimage/src/sys/dev/iwi/if_iwi.c#7 edit > .. //depot/projects/vimage/src/sys/net80211/ieee80211.c#8 edit > .. //depot/projects/vimage/src/sys/net80211/ieee80211_var.h#7 edit Ahm, those three changes that unintentionally slipped into an IFC for a=20 private branch were actually intended to provide capability for moving=20 80211 ifnets among vnets. =A0This doesn't work quite properly yet, and the= =20 biggest issue here is that for the first time we are pushing stack=20 virtualization hacks into device driver level, something that I think=20 should be avoided like a plaque in general. Marko > .. //depot/user/zec/forwarding/sys/amd64/amd64/busdma_machdep.c#2 =2E.. > Differences ... > > =3D=3D=3D=3D //depot/projects/vimage/src/sys/dev/iwi/if_iwi.c#7 (text+ko) > =3D=3D=3D=3D > > @@ -35,6 +35,8 @@ > * > http://www.intel.com/network/connectivity/products/wireless/prowirele >ss_mobile.htm */ > > +#include "opt_vimage.h" > + > #include <sys/param.h> > #include <sys/sysctl.h> > #include <sys/sockio.h> > @@ -55,6 +57,7 @@ > #include <sys/firmware.h> > #include <sys/kthread.h> > #include <sys/taskqueue.h> > +#include <sys/vimage.h> > > #include <machine/bus.h> > #include <machine/resource.h> > @@ -193,6 +196,7 @@ > static int iwi_probe(device_t); > static int iwi_attach(device_t); > static int iwi_detach(device_t); > +static void iwi_reassign(struct ifnet *, struct vnet *, char *); > static int iwi_shutdown(device_t); > static int iwi_suspend(device_t); > static int iwi_resume(device_t); > @@ -407,6 +411,9 @@ > ieee80211_ifattach(ic); > ic->ic_bmissthreshold =3D 10; /* override default */ > /* override default methods */ > +#ifdef VIMAGE > + ifp->if_reassign =3D iwi_reassign; > +#endif > ic->ic_node_alloc =3D iwi_node_alloc; > sc->sc_node_free =3D ic->ic_node_free; > ic->ic_node_free =3D iwi_node_free; > @@ -505,6 +512,28 @@ > return 0; > } > > +#ifdef VIMAGE > +static void > +iwi_reassign(struct ifnet *ifp, struct vnet *vnet, char *dname) > +{ > + struct iwi_softc *sc =3D ifp->if_softc; > + struct ieee80211com *ic =3D &sc->sc_ic; > + IWI_LOCK_DECL; > + > + IWI_LOCK(sc); > + bpfdetach(ifp); > + sc->sc_drvbpf =3D NULL; > + ieee80211_reassign(ic, vnet, dname); > + > + CURVNET_SET_QUIET(vnet); > + bpfattach2(ifp, DLT_IEEE802_11_RADIO, > + sizeof (struct ieee80211_frame) + sizeof (sc->sc_txtap), > + &sc->sc_drvbpf); > + CURVNET_RESTORE(); > + IWI_UNLOCK(sc); > +} > +#endif > > >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712021225.16846.zec>