Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 May 2008 17:58:53 GMT
From:      Vincenzo Iozzo <snagg@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 141470 for review
Message-ID:  <200805111758.m4BHwrTf001296@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=141470

Change 141470 by snagg@snagg_macosx on 2008/05/11 17:58:09

	IFC

Affected files ...

.. //depot/projects/soc2008/snagg-audit/sys/conf/kern.mk#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/firewire/firewire.c#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/firewire/fwohci.c#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/if_ndis/if_ndis.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/if_ndis/if_ndisvar.h#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/ipw/if_ipw.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/mpt/mpt_pci.c#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/ral/rt2560.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/ral/rt2661.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/dev/wi/if_wi.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/kern/kern_event.c#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/kern/kern_malloc.c#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/net/if_ethersubr.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/net/route.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/net/route.h#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/vm/memguard.c#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/vm/vm_extern.h#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/vm/vm_init.c#2 integrate
.. //depot/projects/soc2008/snagg-audit/sys/vm/vm_kern.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/vm/vm_map.c#3 integrate
.. //depot/projects/soc2008/snagg-audit/sys/vm/vm_map.h#3 integrate

Differences ...

==== //depot/projects/soc2008/snagg-audit/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/snagg-audit/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/snagg-audit/sys/dev/firewire/fwohci.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/fwohci.c,v 1.93 2007/06/08 09:04:30 simokawa Exp $
+ * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.95 2008/05/10 13:40:42 simokawa Exp $
  *
  */
 
@@ -1745,6 +1745,8 @@
 {
 	u_int i;
 
+	fwohci_set_intr(&sc->fc, 0);
+
 /* Now stopping all DMA channel */
 	OWRITE(sc,  OHCI_ARQCTLCLR, OHCI_CNTL_DMA_RUN);
 	OWRITE(sc,  OHCI_ARSCTLCLR, OHCI_CNTL_DMA_RUN);
@@ -1756,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,
@@ -2601,10 +2600,13 @@
 
 	ir = &dbch->xferq;
 	if (ir->buf == NULL && (dbch->xferq.flag & FWXFERQ_EXTBUF) == 0) {
-		db_tr->buf = fwdma_malloc_size(dbch->dmat, &db_tr->dma_map,
-			ir->psize, &dbuf[0], BUS_DMA_NOWAIT);
-		if (db_tr->buf == NULL)
-			return(ENOMEM);
+		if (db_tr->buf == NULL) {
+			db_tr->buf = fwdma_malloc_size(dbch->dmat,
+			    &db_tr->dma_map, ir->psize, &dbuf[0],
+			    BUS_DMA_NOWAIT);
+			if (db_tr->buf == NULL)
+				return(ENOMEM);
+		}
 		db_tr->dbcnt = 1;
 		dsiz[0] = ir->psize;
 		bus_dmamap_sync(dbch->dmat, db_tr->dma_map,

==== //depot/projects/soc2008/snagg-audit/sys/dev/if_ndis/if_ndis.c#3 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/systm.h>
@@ -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/snagg-audit/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/snagg-audit/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 <sys/cdefs.h>
-__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/snagg-audit/sys/dev/mpt/mpt_pci.c#2 (text+ko) ====

@@ -99,7 +99,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.51 2007/09/18 16:39:24 ambrisko Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.52 2008/05/10 01:27:23 delphij Exp $");
 
 #include <dev/mpt/mpt.h>
 #include <dev/mpt/mpt_cam.h>
@@ -185,6 +185,10 @@
 #define PCI_PRODUCT_LSI_SAS1078		0x0062
 #endif
 
+#ifndef	PCI_PRODUCT_LSI_SAS1078DE
+#define	PCI_PRODUCT_LSI_SAS1078DE	0x007C
+#endif
+
 #ifndef	PCIM_CMD_SERRESPEN
 #define	PCIM_CMD_SERRESPEN	0x0100
 #endif
@@ -265,6 +269,7 @@
 	case PCI_PRODUCT_LSI_SAS1068:
 	case PCI_PRODUCT_LSI_SAS1068E:
 	case PCI_PRODUCT_LSI_SAS1078:
+	case PCI_PRODUCT_LSI_SAS1078DE:
 		desc = "LSILogic SAS/SATA Adapter";
 		break;
 	default:
@@ -441,6 +446,7 @@
 	case PCI_PRODUCT_LSI_SAS1068:
 	case PCI_PRODUCT_LSI_SAS1068E:
 	case PCI_PRODUCT_LSI_SAS1078:
+	case PCI_PRODUCT_LSI_SAS1078DE:
 		mpt->is_sas = 1;
 		break;
 	default:

==== //depot/projects/soc2008/snagg-audit/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 <sys/cdefs.h>
-__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/snagg-audit/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 <sys/cdefs.h>
-__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/snagg-audit/sys/dev/wi/if_wi.c#3 (text+ko) ====

@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__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/snagg-audit/sys/kern/kern_event.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_event.c,v 1.118 2008/04/02 11:21:42 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_event.c,v 1.120 2008/05/10 11:37:05 kib Exp $");
 
 #include "opt_ktrace.h"
 
@@ -1134,7 +1134,7 @@
 	struct kevent *kevp;
 	struct timeval atv, rtv, ttv;
 	struct knote *kn, *marker;
-	int count, timeout, nkev, error;
+	int count, timeout, nkev, error, influx;
 	int haskqglobal;
 
 	count = maxevents;
@@ -1204,6 +1204,7 @@
 	}
 
 	TAILQ_INSERT_TAIL(&kq->kq_head, marker, kn_tqe);
+	influx = 0;
 	while (count) {
 		KQ_OWNED(kq);
 		kn = TAILQ_FIRST(&kq->kq_head);
@@ -1211,6 +1212,11 @@
 		if ((kn->kn_status == KN_MARKER && kn != marker) ||
 		    (kn->kn_status & KN_INFLUX) == KN_INFLUX) {
 			kq->kq_state |= KQ_FLUXWAIT;
+			if (influx) {
+				influx = 0;
+				KQ_FLUX_WAKEUP(kq);
+			}
+
 			error = msleep(kq, &kq->kq_lock, PSOCK,
 			    "kqflxwt", 0);
 			continue;
@@ -1259,6 +1265,7 @@
 				    ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX);
 				kq->kq_count--;
 				KN_LIST_UNLOCK(kn);
+				influx = 1;
 				continue;
 			}
 			*kevp = kn->kn_kevent;
@@ -1274,6 +1281,7 @@
 			
 			kn->kn_status &= ~(KN_INFLUX);
 			KN_LIST_UNLOCK(kn);
+			influx = 1;
 		}
 
 		/* we are returning a copy to the user */
@@ -1282,6 +1290,7 @@
 		count--;
 
 		if (nkev == KQ_NEVENTS) {
+			influx = 0;
 			KQ_UNLOCK_FLUX(kq);
 			error = k_ops->k_copyout(k_ops->arg, keva, nkev);
 			nkev = 0;
@@ -1455,8 +1464,11 @@
 
 	for (i = 0; i < kq->kq_knlistsize; i++) {
 		while ((kn = SLIST_FIRST(&kq->kq_knlist[i])) != NULL) {
-			KASSERT((kn->kn_status & KN_INFLUX) == 0,
-			    ("KN_INFLUX set when not suppose to be"));
+			if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+				kq->kq_state |= KQ_FLUXWAIT;
+				msleep(kq, &kq->kq_lock, PSOCK, "kqclo1", 0);
+				continue;
+			}
 			kn->kn_status |= KN_INFLUX;
 			KQ_UNLOCK(kq);
 			if (!(kn->kn_status & KN_DETACHED))
@@ -1468,8 +1480,12 @@
 	if (kq->kq_knhashmask != 0) {
 		for (i = 0; i <= kq->kq_knhashmask; i++) {
 			while ((kn = SLIST_FIRST(&kq->kq_knhash[i])) != NULL) {
-				KASSERT((kn->kn_status & KN_INFLUX) == 0,
-				    ("KN_INFLUX set when not suppose to be"));
+				if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+					kq->kq_state |= KQ_FLUXWAIT;
+					msleep(kq, &kq->kq_lock, PSOCK,
+					       "kqclo2", 0);
+					continue;
+				}
 				kn->kn_status |= KN_INFLUX;
 				KQ_UNLOCK(kq);
 				if (!(kn->kn_status & KN_DETACHED))

==== //depot/projects/soc2008/snagg-audit/sys/kern/kern_malloc.c#2 (text+ko) ====

@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__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/snagg-audit/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/snagg-audit/sys/net/route.c#3 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)route.c	8.3.1.1 (Berkeley) 2/23/95
- * $FreeBSD: src/sys/net/route.c,v 1.129 2008/05/09 23:02:56 julian Exp $
+ * $FreeBSD: src/sys/net/route.c,v 1.131 2008/05/10 04:32:58 julian Exp $
  */
 /************************************************************************
  * Note: In this file a 'fib' is a "forwarding information base"	*
@@ -69,6 +69,7 @@
  /* while we use 4 bits in the mbuf flags,
   * we are limited to 16
   */
+ #define RT_MAXFIBS 16
  #if ROUTETABLES > RT_MAXFIBS
   #define RT_NUMFIBS RT_MAXFIBS
   #error "ROUTETABLES defined too big"
@@ -149,7 +150,7 @@
 	struct domain *dom;
 	int fam;
 
-	/* whack teh tunable ints into  line. */
+	/* whack the tunable ints into  line. */
 	if (rt_numfibs > RT_MAXFIBS)
 		rt_numfibs = RT_MAXFIBS;
 	if (rt_numfibs == 0)

==== //depot/projects/soc2008/snagg-audit/sys/net/route.h#3 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)route.h	8.4 (Berkeley) 1/9/95
- * $FreeBSD: src/sys/net/route.h,v 1.70 2008/05/09 23:02:56 julian Exp $
+ * $FreeBSD: src/sys/net/route.h,v 1.71 2008/05/10 04:32:58 julian Exp $
  */
 
 #ifndef _NET_ROUTE_H_
@@ -82,7 +82,6 @@
 #define	RTM_RTTUNIT	1000000	/* units for rtt, rttvar, as units per sec */
 #define	RTTTOPRHZ(r)	((r) / (RTM_RTTUNIT / PR_SLOWHZ))
 
-#define RT_MAXFIBS 16
 extern u_int rt_numfibs;	/* number fo usable routing tables */
 extern u_int tunnel_fib;	/* tunnels use these */
 extern u_int fwd_fib;		/* packets being forwarded use these routes */
@@ -330,7 +329,7 @@
 		RTFREE_LOCKED(_rt);				\
 	} while (0)
 
-extern struct radix_node_head *rt_tables[RT_MAXFIBS][AF_MAX+1];
+extern struct radix_node_head *rt_tables[][AF_MAX+1];
 
 struct ifmultiaddr;
 

==== //depot/projects/soc2008/snagg-audit/sys/vm/memguard.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__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/snagg-audit/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/snagg-audit/sys/vm/vm_init.c#2 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/kernel.h>
@@ -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/snagg-audit/sys/vm/vm_kern.c#3 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/systm.h>
@@ -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/snagg-audit/sys/vm/vm_map.c#3 (text+ko) ====


>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805111758.m4BHwrTf001296>