From owner-p4-projects@FreeBSD.ORG Sun May 11 16:06:51 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 081CE1065670; Sun, 11 May 2008 16:06:50 +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 89ECC106564A for ; Sun, 11 May 2008 16:06:50 +0000 (UTC) (envelope-from diego@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 781948FC1D for ; Sun, 11 May 2008 16:06:50 +0000 (UTC) (envelope-from diego@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4BG6oaC087368 for ; Sun, 11 May 2008 16:06:50 GMT (envelope-from diego@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4BG6ovS087366 for perforce@freebsd.org; Sun, 11 May 2008 16:06:50 GMT (envelope-from diego@FreeBSD.org) Date: Sun, 11 May 2008 16:06:50 GMT Message-Id: <200805111606.m4BG6ovS087366@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to diego@FreeBSD.org using -f From: Diego Giagio To: Perforce Change Reviews Cc: Subject: PERFORCE change 141466 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, 11 May 2008 16:06:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=141466 Change 141466 by diego@diego_black on 2008/05/11 16:06:23 IFC Affected files ... .. //depot/projects/soc2008/diego-audit/src/sys/conf/kern.mk#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/firewire/firewire.c#2 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/firewire/fwohci.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/if_ndis/if_ndis.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/if_ndis/if_ndisvar.h#2 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/ipw/if_ipw.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/ral/rt2560.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/ral/rt2661.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/dev/wi/if_wi.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/kern/kern_malloc.c#2 integrate .. //depot/projects/soc2008/diego-audit/src/sys/net/if_ethersubr.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/vm/memguard.c#2 integrate .. //depot/projects/soc2008/diego-audit/src/sys/vm/vm_extern.h#2 integrate .. //depot/projects/soc2008/diego-audit/src/sys/vm/vm_init.c#2 integrate .. //depot/projects/soc2008/diego-audit/src/sys/vm/vm_kern.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/vm/vm_map.c#3 integrate .. //depot/projects/soc2008/diego-audit/src/sys/vm/vm_map.h#3 integrate Differences ... ==== //depot/projects/soc2008/diego-audit/src/sys/conf/kern.mk#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/kern.mk,v 1.53 2008/04/29 11:28:10 gonzo Exp $ +# $FreeBSD: src/sys/conf/kern.mk,v 1.54 2008/05/10 20:46:07 ache Exp $ # # Warning flags for compiling the kernel and components of the kernel. @@ -70,7 +70,7 @@ # .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -mcmodel=kernel -mno-red-zone \ - -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow \ + -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ -msoft-float -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif ==== //depot/projects/soc2008/diego-audit/src/sys/dev/firewire/firewire.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.101 2007/10/20 23:23:14 julian Exp $ + * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.102 2008/05/10 13:40:41 simokawa Exp $ * */ @@ -508,6 +508,9 @@ printf("firewire probe thread didn't die\n"); mtx_unlock(&fc->wait_lock); + if (fc->arq !=0 && fc->arq->maxq > 0) + fw_drain_txq(fc); + if ((err = fwdev_destroydev(sc)) != 0) return err; @@ -518,7 +521,7 @@ callout_stop(&fc->bmr_callout); callout_stop(&fc->busprobe_callout); - /* XXX xfree_free and untimeout on all xfers */ + /* XXX xfer_free and untimeout on all xfers */ for (fwdev = STAILQ_FIRST(&fc->devices); fwdev != NULL; fwdev = fwdev_next) { fwdev_next = STAILQ_NEXT(fwdev, link); ==== //depot/projects/soc2008/diego-audit/src/sys/dev/firewire/fwohci.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.94 2008/05/10 09:22:06 simokawa Exp $ + * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.95 2008/05/10 13:40:42 simokawa Exp $ * */ @@ -1758,9 +1758,6 @@ OWRITE(sc, OHCI_ITCTLCLR(i), OHCI_CNTL_DMA_RUN); } - if (sc->fc.arq !=0 && sc->fc.arq->maxq > 0) - fw_drain_txq(&sc->fc); - #if 0 /* Let dcons(4) be accessed */ /* Stop interrupt */ OWRITE(sc, FWOHCI_INTMASKCLR, ==== //depot/projects/soc2008/diego-audit/src/sys/dev/if_ndis/if_ndis.c#3 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.136 2008/05/01 05:11:33 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.138 2008/05/10 20:12:43 thompsa Exp $"); #include #include @@ -164,11 +164,14 @@ static void ndis_watchdog (struct ifnet *); static int ndis_ifmedia_upd (struct ifnet *); static void ndis_ifmedia_sts (struct ifnet *, struct ifmediareq *); +static void ndis_auth (void *, int); +static void ndis_assoc (void *, int); static int ndis_get_assoc (struct ndis_softc *, ndis_wlan_bssid_ex **); static int ndis_probe_offload (struct ndis_softc *); static int ndis_set_offload (struct ndis_softc *); static void ndis_getstate_80211 (struct ndis_softc *); static void ndis_setstate_80211 (struct ndis_softc *); +static void ndis_auth_and_assoc (struct ndis_softc *, struct ieee80211vap *); static int ndis_set_cipher (struct ndis_softc *, int); static int ndis_set_wpa (struct ndis_softc *, void *, int); static int ndis_add_key (struct ieee80211vap *, @@ -714,6 +717,8 @@ taskqueue_start_threads(&sc->ndis_tq, 1, PI_NET, "%s taskq", device_get_nameunit(dev)); TASK_INIT(&sc->ndis_scantask, 0, ndis_scan, sc); + TASK_INIT(&sc->ndis_authtask, 0, ndis_auth, sc); + TASK_INIT(&sc->ndis_assoctask, 0, ndis_assoc, sc); ifp->if_ioctl = ndis_ioctl_80211; ic->ic_ifp = ifp; @@ -1003,8 +1008,11 @@ } else NDIS_UNLOCK(sc); - if (sc->ndis_80211) + if (sc->ndis_80211) { taskqueue_drain(sc->ndis_tq, &sc->ndis_scantask); + taskqueue_drain(sc->ndis_tq, &sc->ndis_authtask); + taskqueue_drain(sc->ndis_tq, &sc->ndis_assoctask); + } if (sc->ndis_tickitem != NULL) IoFreeWorkItem(sc->ndis_tickitem); @@ -1960,6 +1968,10 @@ /* Setup task offload. */ ndis_set_offload(sc); + + if (sc->ndis_80211) + ndis_setstate_80211(sc); + NDIS_LOCK(sc); sc->ndis_txidx = 0; @@ -2200,20 +2212,14 @@ struct ndis_softc *sc; { struct ieee80211com *ic; - struct ieee80211vap *vap; - struct ieee80211_node *ni; - ndis_80211_ssid ssid; ndis_80211_macaddr bssid; ndis_80211_config config; - ndis_80211_wep wep; - int i, rval = 0, len, error; + int rval = 0, len; uint32_t arg; struct ifnet *ifp; ifp = sc->ifp; ic = ifp->if_l2com; - vap = TAILQ_FIRST(&ic->ic_vaps); - ni = vap->iv_bss; if (!NDIS_INITIALIZED(sc)) { DPRINTF(("%s: NDIS not initialized\n", __func__)); @@ -2229,7 +2235,7 @@ /* Set network infrastructure mode. */ len = sizeof(arg); - if (vap->iv_opmode == IEEE80211_M_IBSS) + if (ic->ic_opmode == IEEE80211_M_IBSS) arg = NDIS_80211_NET_INFRA_IBSS; else arg = NDIS_80211_NET_INFRA_BSS; @@ -2239,18 +2245,6 @@ if (rval) device_printf (sc->ndis_dev, "set infra failed: %d\n", rval); - /* Set RTS threshold */ - - len = sizeof(arg); - arg = vap->iv_rtsthreshold; - ndis_set_info(sc, OID_802_11_RTS_THRESHOLD, &arg, &len); - - /* Set fragmentation threshold */ - - len = sizeof(arg); - arg = vap->iv_fragthreshold; - ndis_set_info(sc, OID_802_11_FRAGMENTATION_THRESHOLD, &arg, &len); - /* Set power management */ len = sizeof(arg); @@ -2281,6 +2275,134 @@ arg = NDIS_80211_PRIVFILT_8021XWEP; ndis_set_info(sc, OID_802_11_PRIVACY_FILTER, &arg, &len); + len = sizeof(config); + bzero((char *)&config, len); + config.nc_length = len; + config.nc_fhconfig.ncf_length = sizeof(ndis_80211_config_fh); + rval = ndis_get_info(sc, OID_802_11_CONFIGURATION, &config, &len); + + /* + * Some drivers expect us to initialize these values, so + * provide some defaults. + */ + + if (config.nc_beaconperiod == 0) + config.nc_beaconperiod = 100; + if (config.nc_atimwin == 0) + config.nc_atimwin = 100; + if (config.nc_fhconfig.ncf_dwelltime == 0) + config.nc_fhconfig.ncf_dwelltime = 200; + if (rval == 0 && ic->ic_bsschan != IEEE80211_CHAN_ANYC) { + int chan, chanflag; + + chan = ieee80211_chan2ieee(ic, ic->ic_bsschan); + chanflag = config.nc_dsconfig > 2500000 ? IEEE80211_CHAN_2GHZ : + IEEE80211_CHAN_5GHZ; + if (chan != ieee80211_mhz2ieee(config.nc_dsconfig / 1000, 0)) { + config.nc_dsconfig = + ic->ic_bsschan->ic_freq * 1000; + len = sizeof(config); + config.nc_length = len; + config.nc_fhconfig.ncf_length = + sizeof(ndis_80211_config_fh); + DPRINTF(("Setting channel to %ukHz\n", config.nc_dsconfig)); + rval = ndis_set_info(sc, OID_802_11_CONFIGURATION, + &config, &len); + if (rval) + device_printf(sc->ndis_dev, "couldn't change " + "DS config to %ukHz: %d\n", + config.nc_dsconfig, rval); + } + } else if (rval) + device_printf(sc->ndis_dev, "couldn't retrieve " + "channel info: %d\n", rval); + + /* Set the BSSID to our value so the driver doesn't associate */ + len = IEEE80211_ADDR_LEN; + bcopy(ic->ic_myaddr, bssid, len); + DPRINTF(("Setting BSSID to %6D\n", (uint8_t *)&bssid, ":")); + rval = ndis_set_info(sc, OID_802_11_BSSID, &bssid, &len); + if (rval) + device_printf(sc->ndis_dev, + "setting BSSID failed: %d\n", rval); + +} + +static void +ndis_auth(void *arg, int npending) +{ + struct ndis_softc *sc = arg; + struct ifnet *ifp = sc->ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + + vap->iv_state = IEEE80211_S_AUTH; + ndis_auth_and_assoc(sc, vap); +} + +static void +ndis_assoc(void *arg, int npending) +{ + struct ndis_softc *sc = arg; + struct ifnet *ifp = sc->ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + + vap->iv_state = IEEE80211_S_ASSOC; + ndis_auth_and_assoc(sc, vap); +} + +static void +ndis_auth_and_assoc(sc, vap) + struct ndis_softc *sc; + struct ieee80211vap *vap; +{ + struct ieee80211com *ic; + struct ieee80211_node *ni; + ndis_80211_ssid ssid; + ndis_80211_macaddr bssid; + ndis_80211_wep wep; + int i, rval = 0, len, error; + uint32_t arg; + struct ifnet *ifp; + + ifp = sc->ifp; + ic = ifp->if_l2com; + ni = vap->iv_bss; + + if (!NDIS_INITIALIZED(sc)) { + DPRINTF(("%s: NDIS not initialized\n", __func__)); + return; + } + + /* Initial setup */ + ndis_setstate_80211(sc); + + /* Set network infrastructure mode. */ + + len = sizeof(arg); + if (vap->iv_opmode == IEEE80211_M_IBSS) + arg = NDIS_80211_NET_INFRA_IBSS; + else + arg = NDIS_80211_NET_INFRA_BSS; + + rval = ndis_set_info(sc, OID_802_11_INFRASTRUCTURE_MODE, &arg, &len); + + if (rval) + device_printf (sc->ndis_dev, "set infra failed: %d\n", rval); + + /* Set RTS threshold */ + + len = sizeof(arg); + arg = vap->iv_rtsthreshold; + ndis_set_info(sc, OID_802_11_RTS_THRESHOLD, &arg, &len); + + /* Set fragmentation threshold */ + + len = sizeof(arg); + arg = vap->iv_fragthreshold; + ndis_set_info(sc, OID_802_11_FRAGMENTATION_THRESHOLD, &arg, &len); + /* Set WEP */ if (vap->iv_flags & IEEE80211_F_PRIVACY && @@ -2394,50 +2516,7 @@ } #endif - len = sizeof(config); - bzero((char *)&config, len); - config.nc_length = len; - config.nc_fhconfig.ncf_length = sizeof(ndis_80211_config_fh); - rval = ndis_get_info(sc, OID_802_11_CONFIGURATION, &config, &len); - /* - * Some drivers expect us to initialize these values, so - * provide some defaults. - */ - - if (config.nc_beaconperiod == 0) - config.nc_beaconperiod = 100; - if (config.nc_atimwin == 0) - config.nc_atimwin = 100; - if (config.nc_fhconfig.ncf_dwelltime == 0) - config.nc_fhconfig.ncf_dwelltime = 200; - if (rval == 0 && ic->ic_bsschan != IEEE80211_CHAN_ANYC) { - int chan, chanflag; - - chan = ieee80211_chan2ieee(ic, ic->ic_bsschan); - chanflag = config.nc_dsconfig > 2500000 ? IEEE80211_CHAN_2GHZ : - IEEE80211_CHAN_5GHZ; - if (chan != ieee80211_mhz2ieee(config.nc_dsconfig / 1000, 0)) { - config.nc_dsconfig = - ic->ic_bsschan->ic_freq * 1000; - ni->ni_chan = ic->ic_bsschan; - len = sizeof(config); - config.nc_length = len; - config.nc_fhconfig.ncf_length = - sizeof(ndis_80211_config_fh); - DPRINTF(("Setting channel to %ukHz\n", config.nc_dsconfig)); - rval = ndis_set_info(sc, OID_802_11_CONFIGURATION, - &config, &len); - if (rval) - device_printf(sc->ndis_dev, "couldn't change " - "DS config to %ukHz: %d\n", - config.nc_dsconfig, rval); - } - } else if (rval) - device_printf(sc->ndis_dev, "couldn't retrieve " - "channel info: %d\n", rval); - - /* * If the user selected a specific BSSID, try * to use that one. This is useful in the case where * there are several APs in range with the same network @@ -2783,10 +2862,8 @@ case SIOCSIFFLAGS: /*NDIS_LOCK(sc);*/ if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ndis_init(sc); - ieee80211_start_all(ic); - } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) ndis_stop(sc); @@ -3131,16 +3208,15 @@ case IEEE80211_S_INIT: case IEEE80211_S_SCAN: return nvp->newstate(vap, nstate, arg); - case IEEE80211_S_ASSOC: - if (ostate != IEEE80211_S_AUTH) - ndis_setstate_80211(sc); + if (ostate != IEEE80211_S_AUTH) { + taskqueue_enqueue(sc->ndis_tq, &sc->ndis_assoctask); + return EINPROGRESS; + } break; - case IEEE80211_S_AUTH: - ndis_setstate_80211(sc); - break; - + taskqueue_enqueue(sc->ndis_tq, &sc->ndis_authtask); + return EINPROGRESS; default: break; } @@ -3208,6 +3284,7 @@ ndis_wlan_bssid_ex *wb; struct ieee80211_scanparams sp; struct ieee80211_frame wh; + struct ieee80211_channel *saved_chan; int i, j; int error, len, rssi, noise, freq, chanflag; static long rstamp; @@ -3217,6 +3294,7 @@ ic = sc->ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); + saved_chan = ic->ic_curchan; noise = -96; len = sizeof(uint32_t) + (sizeof(ndis_wlan_bssid_ex) * 16); @@ -3277,6 +3355,10 @@ chanflag = ndis_nettype_chan(wb->nwbx_nettype); freq = wb->nwbx_config.nc_dsconfig / 1000; sp.chan = sp.bchan = ieee80211_mhz2ieee(freq, chanflag); + /* Hack ic->ic_curchan to be in sync with the scan result */ + ic->ic_curchan = ieee80211_find_channel(ic, freq, chanflag); + if (ic->ic_curchan == NULL) + ic->ic_curchan = &ic->ic_channels[0]; /* Process extended info from AP */ if (wb->nwbx_len > sizeof(ndis_wlan_bssid)) { @@ -3311,6 +3393,8 @@ wb = (ndis_wlan_bssid_ex *)((char *)wb + wb->nwbx_len); } free(bl, M_DEVBUF); + /* Restore the channel after messing with it */ + ic->ic_curchan = saved_chan; } static void ==== //depot/projects/soc2008/diego-audit/src/sys/dev/if_ndis/if_ndisvar.h#2 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/if_ndis/if_ndisvar.h,v 1.30 2008/04/20 20:35:36 sam Exp $ + * $FreeBSD: src/sys/dev/if_ndis/if_ndisvar.h,v 1.31 2008/05/10 20:12:43 thompsa Exp $ */ #define NDIS_DEFAULT_NODENAME "FreeBSD NDIS node" @@ -177,6 +177,8 @@ struct taskqueue *ndis_tq; /* private task queue */ struct task ndis_scantask; + struct task ndis_authtask; + struct task ndis_assoctask; int (*ndis_newstate)(struct ieee80211com *, enum ieee80211_state, int); }; ==== //depot/projects/soc2008/diego-audit/src/sys/dev/ipw/if_ipw.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.36 2008/05/01 04:54:59 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.37 2008/05/10 20:25:58 thompsa Exp $ */ /*- * Copyright (c) 2004-2006 @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.36 2008/05/01 04:54:59 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.37 2008/05/10 20:25:58 thompsa Exp $"); /*- * Intel(R) PRO/Wireless 2100 MiniPCI driver @@ -2404,7 +2404,8 @@ ipw_init_locked(sc); IPW_UNLOCK(sc); - ieee80211_start_all(ic); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ieee80211_start_all(ic); /* start all vap's */ } static void ==== //depot/projects/soc2008/diego-audit/src/sys/dev/ral/rt2560.c#3 (text) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/ral/rt2560.c,v 1.21 2008/05/01 04:55:00 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/ral/rt2560.c,v 1.22 2008/05/10 20:25:58 thompsa Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -18,7 +18,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ral/rt2560.c,v 1.21 2008/05/01 04:55:00 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ral/rt2560.c,v 1.22 2008/05/10 20:25:58 thompsa Exp $"); /*- * Ralink Technology RT2560 chipset driver @@ -2726,7 +2726,8 @@ rt2560_init_locked(sc); RAL_UNLOCK(sc); - ieee80211_start_all(ic); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ieee80211_start_all(ic); /* start all vap's */ } static void ==== //depot/projects/soc2008/diego-audit/src/sys/dev/ral/rt2661.c#3 (text) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/ral/rt2661.c,v 1.21 2008/05/01 04:55:00 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/ral/rt2661.c,v 1.22 2008/05/10 20:25:58 thompsa Exp $ */ /*- * Copyright (c) 2006 @@ -18,7 +18,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ral/rt2661.c,v 1.21 2008/05/01 04:55:00 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ral/rt2661.c,v 1.22 2008/05/10 20:25:58 thompsa Exp $"); /*- * Ralink Technology RT2561, RT2561S and RT2661 chipset driver @@ -2471,7 +2471,8 @@ rt2661_init_locked(sc); RAL_UNLOCK(sc); - ieee80211_start_all(ic); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ieee80211_start_all(ic); /* start all vap's */ } void ==== //depot/projects/soc2008/diego-audit/src/sys/dev/wi/if_wi.c#3 (text+ko) ==== @@ -60,7 +60,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.216 2008/05/01 04:55:00 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.217 2008/05/10 20:25:59 thompsa Exp $"); #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ @@ -703,7 +703,8 @@ wi_init_locked(sc); WI_UNLOCK(sc); - ieee80211_start_all(ic); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ieee80211_start_all(ic); /* start all vap's */ } static void ==== //depot/projects/soc2008/diego-audit/src/sys/kern/kern_malloc.c#2 (text+ko) ==== @@ -43,7 +43,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_malloc.c,v 1.163 2008/03/16 10:58:05 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_malloc.c,v 1.164 2008/05/10 21:46:19 alc Exp $"); #include "opt_ddb.h" #include "opt_vm.h" @@ -594,7 +594,7 @@ init_param3(vm_kmem_size / PAGE_SIZE); kmem_map = kmem_suballoc(kernel_map, &kmembase, &kmemlimit, - vm_kmem_size); + vm_kmem_size, TRUE); kmem_map->system_map = 1; #ifdef DEBUG_MEMGUARD ==== //depot/projects/soc2008/diego-audit/src/sys/net/if_ethersubr.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.245 2008/04/29 21:23:20 julian Exp $ + * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.246 2008/05/10 18:33:38 antoine Exp $ */ #include "opt_atalk.h" @@ -952,11 +952,12 @@ crc = 0xffffffff; /* initial value */ for (i = 0; i < len; i++) { - for (data = *buf++, bit = 0; bit < 8; bit++, data >>= 1) + for (data = *buf++, bit = 0; bit < 8; bit++, data >>= 1) { carry = (crc ^ data) & 1; crc >>= 1; if (carry) crc = (crc ^ ETHER_CRC_POLY_LE); + } } return (crc); ==== //depot/projects/soc2008/diego-audit/src/sys/vm/memguard.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/memguard.c,v 1.6 2005/12/30 11:45:07 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/memguard.c,v 1.7 2008/05/10 23:39:27 alc Exp $"); /* * MemGuard is a simple replacement allocator for debugging only @@ -174,7 +174,7 @@ size *= PAGE_SIZE; memguard_map = kmem_suballoc(parent_map, (vm_offset_t *)&base, - (vm_offset_t *)&limit, (vm_size_t)size); + (vm_offset_t *)&limit, (vm_size_t)size, FALSE); memguard_map->system_map = 1; memguard_mapsize = size; memguard_mapused = 0; ==== //depot/projects/soc2008/diego-audit/src/sys/vm/vm_extern.h#2 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)vm_extern.h 8.2 (Berkeley) 1/12/94 - * $FreeBSD: src/sys/vm/vm_extern.h,v 1.79 2007/11/05 11:36:16 kib Exp $ + * $FreeBSD: src/sys/vm/vm_extern.h,v 1.80 2008/05/10 21:46:20 alc Exp $ */ #ifndef _VM_EXTERN_H_ @@ -63,7 +63,8 @@ void kmem_free_wakeup(vm_map_t, vm_offset_t, vm_size_t); void kmem_init(vm_offset_t, vm_offset_t); vm_offset_t kmem_malloc(vm_map_t, vm_size_t, boolean_t); -vm_map_t kmem_suballoc(vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t); +vm_map_t kmem_suballoc(vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t, + boolean_t); void swapout_procs(int); int useracc(void *, int, int); int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); ==== //depot/projects/soc2008/diego-audit/src/sys/vm/vm_init.c#2 (text+ko) ==== @@ -63,7 +63,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/vm_init.c,v 1.47 2008/03/16 10:58:09 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_init.c,v 1.48 2008/05/10 21:46:20 alc Exp $"); #include #include @@ -186,16 +186,17 @@ panic("startup: table size inconsistency"); clean_map = kmem_suballoc(kernel_map, &kmi->clean_sva, &kmi->clean_eva, - (nbuf*BKVASIZE) + (nswbuf*MAXPHYS)); + nbuf * BKVASIZE + nswbuf * MAXPHYS, FALSE); buffer_map = kmem_suballoc(clean_map, &kmi->buffer_sva, - &kmi->buffer_eva, (nbuf*BKVASIZE)); + &kmi->buffer_eva, nbuf * BKVASIZE, FALSE); buffer_map->system_map = 1; pager_map = kmem_suballoc(clean_map, &kmi->pager_sva, &kmi->pager_eva, - (nswbuf*MAXPHYS)); + nswbuf * MAXPHYS, FALSE); pager_map->system_map = 1; exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, - (exec_map_entries*(ARG_MAX+(PAGE_SIZE*3)))); - pipe_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, maxpipekva); + exec_map_entries * (ARG_MAX + (PAGE_SIZE * 3)), FALSE); + pipe_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, maxpipekva, + FALSE); /* * XXX: Mbuf system machine-specific initializations should ==== //depot/projects/soc2008/diego-audit/src/sys/vm/vm_kern.c#3 (text+ko) ==== @@ -63,7 +63,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/vm_kern.c,v 1.133 2008/04/28 17:25:27 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_kern.c,v 1.134 2008/05/10 21:46:20 alc Exp $"); #include #include @@ -109,8 +109,8 @@ size = round_page(size); addr = vm_map_min(map); - result = vm_map_find(map, NULL, 0, - &addr, size, TRUE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); + result = vm_map_find(map, NULL, 0, &addr, size, VMFS_ANY_SPACE, + VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); if (result != KERN_SUCCESS) { return (0); } @@ -221,12 +221,11 @@ * parent Map to take range from * min, max Returned endpoints of map * size Size of range to find + * superpage_align Request that min is superpage aligned */ vm_map_t -kmem_suballoc(parent, min, max, size) - vm_map_t parent; - vm_offset_t *min, *max; - vm_size_t size; +kmem_suballoc(vm_map_t parent, vm_offset_t *min, vm_offset_t *max, + vm_size_t size, boolean_t superpage_align) { int ret; vm_map_t result; @@ -234,8 +233,8 @@ size = round_page(size); *min = vm_map_min(parent); - ret = vm_map_find(parent, NULL, 0, - min, size, TRUE, VM_PROT_ALL, VM_PROT_ALL, 0); + ret = vm_map_find(parent, NULL, 0, min, size, superpage_align ? + VMFS_ALIGNED_SPACE : VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); if (ret != KERN_SUCCESS) panic("kmem_suballoc: bad status return of %d", ret); *max = *min + size; @@ -259,9 +258,6 @@ * (kmem_object). This, combined with the fact that only malloc uses * this routine, ensures that we will never block in map or object waits. * - * Note that this still only works in a uni-processor environment and - * when called at splhigh(). - * * We don't worry about expanding the map (adding entries) since entries * for wired maps are statically allocated. * ==== //depot/projects/soc2008/diego-audit/src/sys/vm/vm_map.c#3 (text+ko) ==== @@ -63,7 +63,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.395 2008/04/28 05:30:23 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.396 2008/05/10 18:55:35 alc Exp $"); #include #include @@ -1200,7 +1200,7 @@ int vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, /* IN/OUT */ - vm_size_t length, boolean_t find_space, vm_prot_t prot, + vm_size_t length, int find_space, vm_prot_t prot, vm_prot_t max, int cow) { vm_offset_t start; @@ -1208,15 +1208,20 @@ start = *addr; vm_map_lock(map); - if (find_space) { - if (vm_map_findspace(map, start, length, addr)) { - vm_map_unlock(map); - return (KERN_NO_SPACE); + do { + if (find_space != VMFS_NO_SPACE) { + if (vm_map_findspace(map, start, length, addr)) { + vm_map_unlock(map); + return (KERN_NO_SPACE); + } + if (find_space == VMFS_ALIGNED_SPACE) + pmap_align_superpage(object, offset, addr, + length); + start = *addr; } - start = *addr; - } - result = vm_map_insert(map, object, offset, - start, start + length, prot, max, cow); + result = vm_map_insert(map, object, offset, start, start + + length, prot, max, cow); + } while (result == KERN_NO_SPACE && find_space == VMFS_ALIGNED_SPACE); vm_map_unlock(map); return (result); } ==== //depot/projects/soc2008/diego-audit/src/sys/vm/vm_map.h#3 (text+ko) ==== @@ -57,7 +57,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $FreeBSD: src/sys/vm/vm_map.h,v 1.123 2008/04/28 05:30:23 alc Exp $ + * $FreeBSD: src/sys/vm/vm_map.h,v 1.124 2008/05/10 18:55:35 alc Exp $ */ /* @@ -325,6 +325,13 @@ #define VM_FAULT_DIRTY 8 /* Dirty the page */ /* + * The following "find_space" options are supported by vm_map_find() + */ +#define VMFS_NO_SPACE 0 /* don't find; use the given range */ +#define VMFS_ANY_SPACE 1 /* find a range with any alignment */ +#define VMFS_ALIGNED_SPACE 2 /* find a superpage-aligned range */ + +/* * vm_map_wire and vm_map_unwire option flags */ #define VM_MAP_WIRE_SYSTEM 0 /* wiring in a kernel map */ @@ -337,7 +344,8 @@ boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); int vm_map_delete (vm_map_t, vm_offset_t, vm_offset_t); -int vm_map_find (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, boolean_t, vm_prot_t, vm_prot_t, int); +int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, + int, vm_prot_t, vm_prot_t, int); int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); int vm_map_findspace (vm_map_t, vm_offset_t, vm_size_t, vm_offset_t *);