From owner-p4-projects@FreeBSD.ORG Sun Dec 2 11:25:30 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4682016A420; Sun, 2 Dec 2007 11:25:30 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 023A316A41A for ; Sun, 2 Dec 2007 11:25:30 +0000 (UTC) (envelope-from zec@imunes.net) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id 8D14C13C447 for ; Sun, 2 Dec 2007 11:25:29 +0000 (UTC) (envelope-from zec@imunes.net) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id 2B2719B648; Sun, 2 Dec 2007 12:25:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.7 Received: from [192.168.200.100] (zec2.tel.fer.hr [161.53.19.79]) by xaqua.tel.fer.hr (Postfix) with ESMTP id B175C9B649 for ; Sun, 2 Dec 2007 12:25:27 +0100 (CET) From: Marko Zec To: Perforce Change Reviews Date: Sun, 2 Dec 2007 12:25:16 +0100 User-Agent: KMail/1.9.7 References: <200712021113.lB2BDefa043362@repoman.freebsd.org> In-Reply-To: <200712021113.lB2BDefa043362@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200712021225.16846.zec@imunes.net> Cc: Subject: Re: PERFORCE change 129994 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 11:25:30 -0000 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 > #include > #include > @@ -55,6 +57,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -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) <<<