PERFORCE change 156589 for review

John Baldwin jhb at FreeBSD.org
Fri Jan 23 14:58:59 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=156589

Change 156589 by jhb at jhb_jhbbsd on 2009/01/23 22:58:19

	IFC @156588

Affected files ...

.. //depot/projects/smpng/sys/amd64/amd64/identcpu.c#32 integrate
.. //depot/projects/smpng/sys/arm/at91/at91.c#17 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_mci.c#12 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_twi.c#13 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_twireg.h#4 integrate
.. //depot/projects/smpng/sys/arm/at91/at91var.h#3 integrate
.. //depot/projects/smpng/sys/arm/at91/uart_bus_at91usart.c#4 integrate
.. //depot/projects/smpng/sys/arm/at91/uart_cpu_at91rm9200usart.c#6 integrate
.. //depot/projects/smpng/sys/arm/at91/uart_dev_at91usart.c#18 integrate
.. //depot/projects/smpng/sys/arm/include/vmparam.h#11 integrate
.. //depot/projects/smpng/sys/boot/forth/loader.conf#57 integrate
.. //depot/projects/smpng/sys/cam/cam_periph.c#28 integrate
.. //depot/projects/smpng/sys/cam/cam_xpt.c#52 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_low.c#18 integrate
.. //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#72 integrate
.. //depot/projects/smpng/sys/conf/files.amd64#60 integrate
.. //depot/projects/smpng/sys/conf/files.i386#117 integrate
.. //depot/projects/smpng/sys/conf/files.pc98#94 integrate
.. //depot/projects/smpng/sys/dev/agp/agp_via.c#2 integrate
.. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c#2 integrate
.. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c#2 integrate
.. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c#2 integrate
.. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c#2 integrate
.. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c#2 integrate
.. //depot/projects/smpng/sys/dev/ath/if_ath.c#63 integrate
.. //depot/projects/smpng/sys/dev/ppbus/if_plip.c#24 integrate
.. //depot/projects/smpng/sys/dev/ppbus/immio.c#6 integrate
.. //depot/projects/smpng/sys/dev/ppbus/lpbb.c#10 integrate
.. //depot/projects/smpng/sys/dev/ppbus/lpt.c#23 integrate
.. //depot/projects/smpng/sys/dev/ppbus/pcfclock.c#16 integrate
.. //depot/projects/smpng/sys/dev/ppbus/ppb_1284.c#5 integrate
.. //depot/projects/smpng/sys/dev/ppbus/ppb_base.c#5 integrate
.. //depot/projects/smpng/sys/dev/ppbus/ppb_msq.c#7 integrate
.. //depot/projects/smpng/sys/dev/ppbus/ppbconf.c#11 integrate
.. //depot/projects/smpng/sys/dev/ppbus/ppbconf.h#7 integrate
.. //depot/projects/smpng/sys/dev/ppbus/ppi.c#20 integrate
.. //depot/projects/smpng/sys/dev/ppbus/pps.c#24 integrate
.. //depot/projects/smpng/sys/dev/ppbus/vpo.c#15 integrate
.. //depot/projects/smpng/sys/dev/ppbus/vpoio.c#8 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppc.c#23 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppc_acpi.c#5 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppc_isa.c#4 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppc_pci.c#3 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppc_puc.c#6 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppcreg.h#6 integrate
.. //depot/projects/smpng/sys/dev/ppc/ppcvar.h#7 integrate
.. //depot/projects/smpng/sys/dev/usb/if_urtw.c#1 branch
.. //depot/projects/smpng/sys/dev/usb/if_urtwreg.h#1 branch
.. //depot/projects/smpng/sys/dev/usb/if_urtwvar.h#1 branch
.. //depot/projects/smpng/sys/dev/usb/usbdevs#123 integrate
.. //depot/projects/smpng/sys/dev/usb2/serial/ufoma2.c#3 integrate
.. //depot/projects/smpng/sys/i386/cpufreq/smist.c#5 integrate
.. //depot/projects/smpng/sys/i386/i386/identcpu.c#64 integrate
.. //depot/projects/smpng/sys/kern/kern_proc.c#102 integrate
.. //depot/projects/smpng/sys/kern/kern_sysctl.c#57 integrate
.. //depot/projects/smpng/sys/kern/vfs_aio.c#84 integrate
.. //depot/projects/smpng/sys/kern/vfs_cache.c#47 integrate
.. //depot/projects/smpng/sys/kern/vfs_subr.c#161 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#140 integrate
.. //depot/projects/smpng/sys/modules/Makefile#153 integrate
.. //depot/projects/smpng/sys/modules/agp/Makefile#14 integrate
.. //depot/projects/smpng/sys/modules/urtw/Makefile#1 branch
.. //depot/projects/smpng/sys/net/if.c#110 integrate
.. //depot/projects/smpng/sys/net80211/_ieee80211.h#13 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_regdomain.c#5 integrate
.. //depot/projects/smpng/sys/netinet/tcp_var.h#65 integrate
.. //depot/projects/smpng/sys/sys/sysctl.h#53 integrate
.. //depot/projects/smpng/sys/vm/vm_meter.c#37 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/amd64/identcpu.c#32 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.170 2009/01/12 19:17:35 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.171 2009/01/22 21:04:46 jkim Exp $");
 
 #include "opt_cpu.h"
 
@@ -392,7 +392,8 @@
 				break;
 			case CPU_VENDOR_CENTAUR:
 				if (AMD64_CPU_FAMILY(cpu_id) == 0x6 &&
-				    AMD64_CPU_MODEL(cpu_id) >= 0xf)
+				    AMD64_CPU_MODEL(cpu_id) >= 0xf &&
+				    (rdmsr(0x1203) & 0x100000000ULL) == 0)
 					tsc_is_invariant = 1;
 				break;
 			}

==== //depot/projects/smpng/sys/arm/at91/at91.c#17 (text) ====

@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.21 2008/11/25 00:13:26 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.22 2009/01/22 21:54:26 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,6 +50,8 @@
 
 static void at91_eoi(void *);
 
+uint32_t at91_master_clock = AT91C_MASTER_CLOCK;
+
 static int
 at91_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags,
     bus_space_handle_t *bshp)

==== //depot/projects/smpng/sys/arm/at91/at91_mci.c#12 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_mci.c,v 1.13 2009/01/21 17:39:11 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_mci.c,v 1.16 2009/01/23 00:51:25 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -67,6 +67,9 @@
 struct at91_mci_softc {
 	void *intrhand;			/* Interrupt handle */
 	device_t dev;
+	int sc_cap;
+#define	CAP_HAS_4WIRE		1	/* Has 4 wire bus */
+#define	CAP_NEEDS_BOUNCE	2	/* broken hardware needing bounce */
 	int flags;
 #define CMD_STARTED	1
 #define STOP_STARTED	2
@@ -77,7 +80,6 @@
 	bus_dmamap_t map;
 	int mapped;
 	struct mmc_host host;
-	int wire4;
 	int bus_busy;
 	struct mmc_request *req;
 	struct mmc_command *curcmd;
@@ -167,6 +169,7 @@
 	device_t child;
 
 	sc->dev = dev;
+	sc->sc_cap = CAP_NEEDS_BOUNCE;
 	err = at91_mci_activate(dev);
 	if (err)
 		goto out;
@@ -201,7 +204,7 @@
 	sc->host.f_min = 375000;
 	sc->host.f_max = at91_master_clock / 2;	/* Typically 30MHz */
 	sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
-	if (sc->wire4)
+	if (sc->sc_cap & CAP_HAS_4WIRE)
 		sc->host.caps = MMC_CAP_4_BIT_DATA;
 	else
 		sc->host.caps = 0;
@@ -277,7 +280,6 @@
 static int
 at91_mci_update_ios(device_t brdev, device_t reqdev)
 {
-	uint32_t at91_master_clock = AT91C_MASTER_CLOCK;
 	struct at91_mci_softc *sc;
 	struct mmc_host *host;
 	struct mmc_ios *ios;
@@ -302,6 +304,7 @@
 	else
 		WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) & ~MCI_SDCR_SDCBUS);
 	WR4(sc, MCI_MR, (RD4(sc, MCI_MR) & ~MCI_MR_CLKDIV) | clkdiv);
+	/* Do we need a settle time here? */
 	/* XXX We need to turn the device on/off here with a GPIO pin */
 	return (0);
 }
@@ -314,7 +317,6 @@
 	int i;
 	struct mmc_data *data;
 	struct mmc_request *req;
-	size_t block_size = 1 << 9;	// Fixed, per mmc/sd spec for 2GB cards
 	void *vaddr;
 	bus_addr_t paddr;
 
@@ -356,19 +358,21 @@
 	// Set block size and turn on PDC mode for dma xfer and disable
 	// PDC until we're ready.
 	mr = RD4(sc, MCI_MR) & ~MCI_MR_BLKLEN;
-	WR4(sc, MCI_MR, mr | (block_size << 16) | MCI_MR_PDCMODE);
+	WR4(sc, MCI_MR, mr | (data->len << 16) | MCI_MR_PDCMODE);
 	WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS);
 	if (cmdr & MCI_CMDR_TRCMD_START) {
 		if (cmdr & MCI_CMDR_TRDIR)
 			vaddr = cmd->data->data;
 		else {
-			if (data->len != BBSZ)
-				panic("Write multiblock write support");
-			vaddr = sc->bounce_buffer;
-			src = (uint32_t *)cmd->data->data;
-			dst = (uint32_t *)vaddr;
-			for (i = 0; i < data->len / 4; i++)
-				dst[i] = bswap32(src[i]);
+			if (sc->sc_cap & CAP_NEEDS_BOUNCE) {
+				vaddr = sc->bounce_buffer;
+				src = (uint32_t *)cmd->data->data;
+				dst = (uint32_t *)vaddr;
+				for (i = 0; i < data->len / 4; i++)
+					dst[i] = bswap32(src[i]);
+			}
+			else
+				vaddr = cmd->data->data;
 		}
 		data->xfer_len = 0;
 		if (bus_dmamap_load(sc->dmatag, sc->map, vaddr, data->len,
@@ -499,10 +503,12 @@
 	bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTREAD);
 	bus_dmamap_unload(sc->dmatag, sc->map);
 	sc->mapped--;
-	walker = (uint32_t *)cmd->data->data;
-	len = cmd->data->len / 4;
-	for (i = 0; i < len; i++)
-		walker[i] = bswap32(walker[i]);
+	if (sc->sc_cap & CAP_NEEDS_BOUNCE) {
+		walker = (uint32_t *)cmd->data->data;
+		len = cmd->data->len / 4;
+		for (i = 0; i < len; i++)
+			walker[i] = bswap32(walker[i]);
+	}
 	// Finish up the sequence...
 	WR4(sc, MCI_IDR, MCI_SR_ENDRX);
 	WR4(sc, MCI_IER, MCI_SR_RXBUFF);

==== //depot/projects/smpng/sys/arm/at91/at91_twi.c#13 (text) ====

@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_twi.c,v 1.13 2008/11/25 00:13:26 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_twi.c,v 1.14 2009/01/22 21:55:37 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,6 +41,7 @@
 
 #include <arm/at91/at91rm92reg.h>
 #include <arm/at91/at91_twireg.h>
+#include <arm/at91/at91var.h>
 
 #include <dev/iicbus/iiconf.h>
 #include <dev/iicbus/iicbus.h>
@@ -128,7 +129,7 @@
 		AT91_TWI_LOCK_DESTROY(sc);
 		goto out;
 	}
-	sc->cwgr = TWI_CWGR_CKDIV(8 * AT91C_MASTER_CLOCK / TWI_FASTEST_CLOCK) |
+	sc->cwgr = TWI_CWGR_CKDIV(8 * at91_master_clock / TWI_FASTEST_CLOCK) |
 	    TWI_CWGR_CHDIV(TWI_CWGR_DIV(TWI_DEF_CLK)) |
 	    TWI_CWGR_CLDIV(TWI_CWGR_DIV(TWI_DEF_CLK));
 	WR4(sc, TWI_CR, TWI_CR_SWRST);

==== //depot/projects/smpng/sys/arm/at91/at91_twireg.h#4 (text) ====

@@ -23,7 +23,7 @@
  * SUCH DAMAGE.
  */
 
-/* $FreeBSD: src/sys/arm/at91/at91_twireg.h,v 1.3 2008/11/25 00:13:26 imp Exp $ */
+/* $FreeBSD: src/sys/arm/at91/at91_twireg.h,v 1.4 2009/01/22 21:55:37 imp Exp $ */
 
 #ifndef ARM_AT91_AT91_TWIREG_H
 #define ARM_AT91_AT91_TWIREG_H
@@ -63,7 +63,7 @@
 #define TWI_CWGR_CKDIV(x) ((x) << 16)	/* Clock Divider */
 #define TWI_CWGR_CHDIV(x) ((x) << 8)	/* Clock High Divider */
 #define TWI_CWGR_CLDIV(x) ((x) << 0)	/* Clock Low Divider */
-#define TWI_CWGR_DIV(rate) ((AT91C_MASTER_CLOCK /(4*(rate))) - 2)
+#define TWI_CWGR_DIV(rate) ((at91_master_clock /(4*(rate))) - 2)
 
 /* TWI_SR */
 /* TWI_IER */

==== //depot/projects/smpng/sys/arm/at91/at91var.h#3 (text) ====

@@ -23,7 +23,7 @@
  * SUCH DAMAGE.
  */
 
-/* $FreeBSD: src/sys/arm/at91/at91var.h,v 1.3 2008/11/25 18:40:40 imp Exp $ */
+/* $FreeBSD: src/sys/arm/at91/at91var.h,v 1.4 2009/01/22 21:54:26 imp Exp $ */
 
 #ifndef _AT91VAR_H_
 #define _AT91VAR_H_
@@ -43,4 +43,6 @@
 	struct resource_list resources;
 };
 
+extern uint32_t at91_master_clock;
+
 #endif /* _AT91VAR_H_ */

==== //depot/projects/smpng/sys/arm/at91/uart_bus_at91usart.c#4 (text) ====

@@ -26,7 +26,7 @@
 #include "opt_uart.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/uart_bus_at91usart.c,v 1.4 2008/11/25 00:13:26 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/uart_bus_at91usart.c,v 1.5 2009/01/22 21:56:41 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -38,13 +38,12 @@
 #include <sys/rman.h>
 #include <machine/resource.h>
 
-#include <dev/pci/pcivar.h>
-
 #include <dev/uart/uart.h>
 #include <dev/uart/uart_bus.h>
 #include <dev/uart/uart_cpu.h>
 
 #include <arm/at91/at91rm92reg.h>
+#include <arm/at91/at91var.h>
 
 #include "uart_if.h"
 
@@ -103,6 +102,8 @@
 		break;
 	}
 	sc->sc_class = &at91_usart_class;
+	if (sc->sc_class->uc_rclk == 0)
+		sc->sc_class->uc_rclk = at91_master_clock;
 	return (uart_bus_probe(dev, 0, 0, 0, device_get_unit(dev)));
 }
 

==== //depot/projects/smpng/sys/arm/at91/uart_cpu_at91rm9200usart.c#6 (text) ====

@@ -29,18 +29,22 @@
 #include "opt_uart.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/uart_cpu_at91rm9200usart.c,v 1.6 2008/11/25 00:13:26 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/uart_cpu_at91rm9200usart.c,v 1.7 2009/01/22 21:56:41 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
 #include <sys/cons.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
 #include <machine/bus.h>
 
 #include <dev/uart/uart.h>
+#include <dev/uart/uart_bus.h>
 #include <dev/uart/uart_cpu.h>
 
 #include <arm/at91/at91rm92reg.h>
+#include <arm/at91/at91var.h>
 
 bus_space_tag_t uart_bus_space_io;
 bus_space_tag_t uart_bus_space_mem;
@@ -60,6 +64,8 @@
 	struct uart_class *class;
 
 	class = &at91_usart_class;
+	if (class->uc_rclk == 0)
+		class->uc_rclk = at91_master_clock;
 	di->ops = uart_getops(class);
 	di->bas.chan = 0;
 	di->bas.bst = &at91_bs_tag;

==== //depot/projects/smpng/sys/arm/at91/uart_dev_at91usart.c#18 (text) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.18 2008/11/25 00:13:26 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.19 2009/01/22 21:56:41 imp Exp $");
 
 #include "opt_comconsole.h"
 
@@ -45,10 +45,11 @@
 #include <arm/at91/at91rm92reg.h>
 #include <arm/at91/at91_usartreg.h>
 #include <arm/at91/at91_pdcreg.h>
+#include <arm/at91/at91var.h>
 
 #include "uart_if.h"
 
-#define DEFAULT_RCLK		AT91C_MASTER_CLOCK
+#define DEFAULT_RCLK		at91_master_clock
 #define	USART_BUFFER_SIZE	128
 
 /*
@@ -684,6 +685,5 @@
 	at91_usart_methods,
 	sizeof(struct at91_usart_softc),
 	.uc_ops = &at91_usart_ops,
-	.uc_range = 8,
-	.uc_rclk = DEFAULT_RCLK
+	.uc_range = 8
 };

==== //depot/projects/smpng/sys/arm/include/vmparam.h#11 (text+ko) ====

@@ -28,7 +28,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/arm/include/vmparam.h,v 1.12 2007/12/27 16:45:38 alc Exp $
+ * $FreeBSD: src/sys/arm/include/vmparam.h,v 1.13 2009/01/22 15:36:11 cognet Exp $
  */
 
 #ifndef	_MACHINE_VMPARAM_H_
@@ -97,6 +97,13 @@
 
 #define VM_MIN_ADDRESS          (0x00001000)
 #ifdef ARM_USE_SMALL_ALLOC
+/* 
+ * ARM_KERN_DIRECTMAP is used to make sure there's enough space between
+ * VM_MAXUSER_ADDRESS and KERNBASE to map the whole memory.
+ * It has to be a compile-time constant, even if arm_init_smallalloc(),
+ * which will do the mapping, gets the real amount of memory at runtime,
+ * because VM_MAXUSER_ADDRESS is a constant.
+ */
 #ifndef ARM_KERN_DIRECTMAP
 #define ARM_KERN_DIRECTMAP 512 * 1024 * 1024 /* 512 MB */
 #endif

==== //depot/projects/smpng/sys/boot/forth/loader.conf#57 (text+ko) ====

@@ -6,7 +6,7 @@
 #
 # All arguments must be in double quotes.
 #
-# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.135 2008/11/12 09:52:06 yongari Exp $
+# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.136 2009/01/23 05:56:09 weongyo Exp $
 
 ##############################################################
 ###  Basic configuration options  ############################
@@ -278,6 +278,7 @@
 if_udav_load="NO"		# Davicom DM9601 USB Ethernet
 if_upgt_load="NO"		# Conexant/Intersil PrismGT USB wireless
 if_ural_load="NO"		# Ralink Technology USB wireless
+if_urtw_load="NO"		# Realtek 8187L USB wireless
 if_vr_load="NO"			# VIA Rhine I and Rhine II
 if_vx_load="NO"			# 3Com 3C590 family
 if_wb_load="NO"			# Winbond W89C840F

==== //depot/projects/smpng/sys/cam/cam_periph.c#28 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.74 2008/12/19 14:31:40 trasz Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.75 2009/01/23 21:03:59 trasz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -171,6 +171,10 @@
 			break;
 	}
 	xpt_unlock_buses();
+	if (p_drv == NULL) {
+		printf("cam_periph_alloc: invalid periph name '%s'\n", name);
+		return (CAM_REQ_INVALID);
+	}
 
 	sim = xpt_path_sim(path);
 	path_id = xpt_path_path_id(path);

==== //depot/projects/smpng/sys/cam/cam_xpt.c#52 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.206 2009/01/14 21:29:20 trasz Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.208 2009/01/23 21:08:00 trasz Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -4177,7 +4177,10 @@
 {
 	struct sbuf sb;
 
-	mtx_assert(path->bus->sim->mtx, MA_OWNED);
+#ifdef INVARIANTS
+	if (path != NULL && path->bus != NULL && path->bus->sim != NULL)
+		mtx_assert(path->bus->sim->mtx, MA_OWNED);
+#endif
 
 	sbuf_new(&sb, str, str_len, 0);
 
@@ -5191,6 +5194,11 @@
 		/* Save some state for use while we probe for devices */
 		scan_info = (xpt_scan_bus_info *)
 		    malloc(sizeof(xpt_scan_bus_info), M_CAMXPT, M_NOWAIT);
+		if (scan_info == NULL) {
+			request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+			xpt_done(request_ccb);
+			return;
+		}
 		scan_info->request_ccb = request_ccb;
 		scan_info->cpi = &work_ccb->cpi;
 

==== //depot/projects/smpng/sys/cam/scsi/scsi_low.c#18 (text+ko) ====

@@ -2,7 +2,7 @@
 /*	$NetBSD$	*/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.29 2007/06/17 05:55:54 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.30 2009/01/23 21:06:16 trasz Exp $");
 
 #define	SCSI_LOW_STATICS
 #define	SCSI_LOW_DEBUG
@@ -966,16 +966,16 @@
 	struct scsi_low_softc *slp;
 {
   	struct cam_path *path;
-	union ccb *ccb = xpt_alloc_ccb();
+	union ccb *ccb; 
 	cam_status status;
 
-	bzero(ccb, sizeof(union ccb));
-
 	status = xpt_create_path(&path, xpt_periph,
 				 cam_sim_path(slp->sl_si.sim), -1, 0);
 	if (status != CAM_REQ_CMP)
 		return;
 
+	ccb = xpt_alloc_ccb();
+	bzero(ccb, sizeof(union ccb));
 	xpt_setup_ccb(&ccb->ccb_h, path, 5);
 	ccb->ccb_h.func_code = XPT_SCAN_BUS;
 	ccb->ccb_h.cbfcnp = scsi_low_cam_rescan_callback;

==== //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#72 (text+ko) ====

@@ -42,7 +42,7 @@
 #include "opt_compat.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.133 2008/12/29 12:45:11 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.134 2009/01/22 17:06:33 jkim Exp $");
 
 #include <sys/param.h>
 #include <sys/queue.h>
@@ -276,11 +276,17 @@
 
 	sbuf_cat(sb, "flags\t\t:");
 
-	if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) {
-		flags[16] = "fcmov";
-	} else if (!strcmp(cpu_vendor, "CyrixInstead")) {
+#ifdef __i386__
+	switch (cpu_vendor_id) {
+	case CPU_VENDOR_AMD:
+		if (class < 6)
+			flags[16] = "fcmov";
+		break;
+	case CPU_VENDOR_CYRIX:
 		flags[24] = "cxmmx";
+		break;
 	}
+#endif
 
 	for (i = 0; i < 32; i++)
 		if (cpu_feature & (1 << i))

==== //depot/projects/smpng/sys/conf/files.amd64#60 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.amd64,v 1.128 2009/01/12 19:23:46 jkim Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.129 2009/01/23 17:48:18 jkim Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -132,9 +132,10 @@
 crypto/via/padlock_cipher.c	optional	padlock
 crypto/via/padlock_hash.c	optional	padlock
 dev/acpica/acpi_if.m		standard
-dev/agp/agp_amd64.c			optional	agp
-dev/agp/agp_i810.c			optional	agp
-dev/agp/agp_intel.c			optional	agp
+dev/agp/agp_amd64.c		optional	agp
+dev/agp/agp_i810.c		optional	agp
+dev/agp/agp_intel.c		optional	agp
+dev/agp/agp_via.c		optional	agp
 dev/arcmsr/arcmsr.c		optional	arcmsr pci
 dev/asmc/asmc.c			optional	asmc isa
 dev/atkbdc/atkbd.c		optional	atkbd atkbdc

==== //depot/projects/smpng/sys/conf/files.i386#117 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.i386,v 1.612 2009/01/01 13:26:53 ed Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.613 2009/01/23 17:48:18 jkim Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -118,15 +118,15 @@
 crypto/via/padlock_cipher.c	optional padlock
 crypto/via/padlock_hash.c	optional padlock
 dev/advansys/adv_isa.c		optional adv isa
-dev/agp/agp_ali.c			optional agp
-dev/agp/agp_amd.c			optional agp
-dev/agp/agp_amd64.c			optional agp
-dev/agp/agp_ati.c			optional agp
-dev/agp/agp_i810.c			optional agp
-dev/agp/agp_intel.c			optional agp
+dev/agp/agp_ali.c		optional agp
+dev/agp/agp_amd.c		optional agp
+dev/agp/agp_amd64.c		optional agp
+dev/agp/agp_ati.c		optional agp
+dev/agp/agp_i810.c		optional agp
+dev/agp/agp_intel.c		optional agp
 dev/agp/agp_nvidia.c		optional agp
-dev/agp/agp_sis.c			optional agp
-dev/agp/agp_via.c			optional agp
+dev/agp/agp_sis.c		optional agp
+dev/agp/agp_via.c		optional agp
 dev/aic/aic_isa.c		optional aic isa
 dev/arcmsr/arcmsr.c		optional arcmsr pci
 dev/ar/if_ar.c			optional ar

==== //depot/projects/smpng/sys/conf/files.pc98#94 (text+ko) ====

@@ -3,7 +3,7 @@
 #
 # modified for PC-9801/PC-9821
 #
-# $FreeBSD: src/sys/conf/files.pc98,v 1.370 2008/12/01 16:53:01 sam Exp $
+# $FreeBSD: src/sys/conf/files.pc98,v 1.371 2009/01/23 17:48:18 jkim Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -77,13 +77,13 @@
 	compile-with	"${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \
 	no-implicit-rule
 crypto/des/arch/i386/des_enc.S	optional crypto | ipsec | netsmb
-dev/agp/agp_ali.c			optional agp
-dev/agp/agp_amd.c			optional agp
-dev/agp/agp_i810.c			optional agp
-dev/agp/agp_intel.c			optional agp
+dev/agp/agp_ali.c		optional agp
+dev/agp/agp_amd.c		optional agp
+dev/agp/agp_i810.c		optional agp
+dev/agp/agp_intel.c		optional agp
 dev/agp/agp_nvidia.c		optional agp
-dev/agp/agp_sis.c			optional agp
-dev/agp/agp_via.c			optional agp
+dev/agp/agp_sis.c		optional agp
+dev/agp/agp_via.c		optional agp
 dev/aic/aic_cbus.c		optional aic isa
 dev/ar/if_ar.c			optional ar
 dev/ar/if_ar_pci.c		optional ar pci

==== //depot/projects/smpng/sys/dev/agp/agp_via.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/agp/agp_via.c,v 1.26 2007/11/12 21:51:37 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/agp/agp_via.c,v 1.27 2009/01/23 17:48:18 jkim Exp $");
 
 #include "opt_bus.h"
 
@@ -85,8 +85,14 @@
 		return ("VIA 3296 (P4M800) host to PCI bridge");
 	case 0x03051106:
 		return ("VIA 82C8363 (Apollo KT133x/KM133) host to PCI bridge");
+	case 0x03141106:
+		return ("VIA 3314 (P4M800CE) host to PCI bridge");
 	case 0x03241106:
 		return ("VIA VT3324 (CX700) host to PCI bridge");
+	case 0x03271106:
+		return ("VIA 3327 (P4M890) host to PCI bridge");
+	case 0x03641106:
+		return ("VIA 3364 (P4M900) host to PCI bridge");
 	case 0x03911106:
 		return ("VIA 8371 (Apollo KX133) host to PCI bridge");
 	case 0x05011106:
@@ -168,7 +174,10 @@
 	case 0x02591106:
 	case 0x02691106:
 	case 0x02961106:
+	case 0x03141106:
 	case 0x03241106:
+	case 0x03271106:
+	case 0x03641106:
 	case 0x31231106:
 	case 0x31681106:
 	case 0x31891106:

==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c#2 (text+ko) ====

@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5210_reset.c,v 1.8 2008/11/11 17:25:16 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c,v 1.2 2009/01/23 05:33:48 sam Exp $
  */
 #include "opt_ah.h"
 
@@ -296,7 +296,7 @@
 
 	return AH_TRUE;
 bad:
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c#2 (text+ko) ====

@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5211_reset.c,v 1.9 2008/11/27 22:29:52 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c,v 1.2 2009/01/23 05:33:48 sam Exp $
  */
 #include "opt_ah.h"
 
@@ -552,7 +552,7 @@
 
 	return AH_TRUE;
 bad:
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c#2 (text+ko) ====

@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5212_reset.c,v 1.20 2008/11/27 22:30:00 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c,v 1.2 2009/01/23 05:33:48 sam Exp $
  */
 #include "opt_ah.h"
 
@@ -692,7 +692,7 @@
 	RESTORE_CCK(ah, chan, isBmode);
 
 	OS_MARK(ah, AH_MARK_RESET_DONE, ecode);
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c#2 (text+ko) ====

@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5312_reset.c,v 1.10 2008/11/22 07:41:37 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c,v 1.2 2009/01/23 05:33:48 sam Exp $
  */
 #include "opt_ah.h"
 
@@ -597,7 +597,7 @@
 	return AH_TRUE;
 bad:
 	OS_MARK(ah, AH_MARK_RESET_DONE, ecode);
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c#2 (text+ko) ====

@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416_reset.c,v 1.27 2008/11/27 22:30:08 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c,v 1.2 2009/01/23 05:33:48 sam Exp $
  */
 #include "opt_ah.h"
 
@@ -470,7 +470,7 @@
 	return AH_TRUE;
 bad:
 	OS_MARK(ah, AH_MARK_RESET_DONE, ecode);
-	if (*status)
+	if (status != AH_NULL)
 		*status = ecode;
 	return AH_FALSE;
 #undef FAIL

==== //depot/projects/smpng/sys/dev/ath/if_ath.c#63 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.224 2009/01/08 17:12:47 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.225 2009/01/23 03:15:28 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -5793,9 +5793,12 @@
 	struct ath_softc *sc = arg;
 	struct ath_hal *ah = sc->sc_ah;
 	struct ifnet *ifp = sc->sc_ifp;
+	struct ieee80211com *ic = ifp->if_l2com;
 	HAL_BOOL longCal, isCalDone;
 	int nextcal;
 
+	if (ic->ic_flags & IEEE80211_F_SCAN)	/* defer, off channel */
+		goto restart;
 	longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz);
 	if (longCal) {
 		sc->sc_stats.ast_per_cal++;
@@ -5833,6 +5836,7 @@
 		sc->sc_stats.ast_per_calfail++;
 	}
 	if (!isCalDone) {
+restart:
 		/*
 		 * Use a shorter interval to potentially collect multiple
 		 * data samples required to complete calibration.  Once

==== //depot/projects/smpng/sys/dev/ppbus/if_plip.c#24 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ppbus/if_plip.c,v 1.49 2008/11/16 17:42:02 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ppbus/if_plip.c,v 1.50 2009/01/21 23:10:06 jhb Exp $");
 
 /*
  * Parallel port TCP/IP interfaces added.  I looked at the driver from
@@ -152,8 +152,12 @@
 	int		sc_iferrs;
 
 	struct resource *res_irq;
+	void		*sc_intr_cookie;
 };
 
+static struct mtx lp_tables_lock;
+MTX_SYSINIT(lp_tables, &lp_tables_lock, "plip tables", MTX_DEF);
+
 /* Tables for the lp# interface */
 static u_char *txmith;
 #define	txmitl (txmith + (1 * LPIPTBLSIZE))
@@ -170,13 +174,41 @@
 static int lpioctl(struct ifnet *, u_long, caddr_t);
 static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
 	struct rtentry *);
+static void lpstop(struct lp_data *);
 static void lp_intr(void *);
+static int lp_module_handler(module_t, int, void *);
 
 #define	DEVTOSOFTC(dev) \
 	((struct lp_data *)device_get_softc(dev))
 
 static devclass_t lp_devclass;
 
+static int
+lp_module_handler(module_t mod, int what, void *arg)
+{
+
+	switch (what) {
+	case MOD_UNLOAD:
+		mtx_lock(&lp_tables_lock);
+		if (txmith != NULL) {
+			free(txmith, M_DEVBUF);
+			txmith = NULL;
+		}
+		if (ctxmith != NULL) {
+			free(ctxmith, M_DEVBUF);
+			ctxmith = NULL;
+		}
+		mtx_unlock(&lp_tables_lock);
+		break;
+	case MOD_LOAD:
+	case MOD_QUIESCE:
+		break;
+	default:
+		return (EOPNOTSUPP);
+	}
+	return (0);
+}
+
 static void
 lp_identify(driver_t *driver, device_t parent)
 {
@@ -201,7 +233,7 @@
 {
 	struct lp_data *lp = DEVTOSOFTC(dev);
 	struct ifnet *ifp;
-	int rid = 0;
+	int error, rid = 0;
 
 	lp->sc_dev = dev;
 
@@ -224,8 +256,7 @@
 	ifp->if_softc = lp;
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
 	ifp->if_mtu = LPMTU;
-	ifp->if_flags = IFF_SIMPLEX | IFF_POINTOPOINT | IFF_MULTICAST |
-	    IFF_NEEDSGIANT;
+	ifp->if_flags = IFF_SIMPLEX | IFF_POINTOPOINT | IFF_MULTICAST;
 	ifp->if_ioctl = lpioctl;
 	ifp->if_output = lpoutput;
 	ifp->if_hdrlen = 0;
@@ -235,8 +266,39 @@
 
 	bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
 
+	/*
+	 * Attach our interrupt handler.  It is only called while we
+	 * own the ppbus.
+	 */
+	error = bus_setup_intr(dev, lp->res_irq, INTR_TYPE_NET | INTR_MPSAFE,
+	    NULL, lp_intr, lp, &lp->sc_intr_cookie);
+	if (error) {
+		bpfdetach(ifp);
+		if_detach(ifp);
+		bus_release_resource(dev, SYS_RES_IRQ, 0, lp->res_irq);
+		device_printf(dev, "Unable to register interrupt handler\n");
+		return (error);
+	}
+
+	return (0);
+}
+
+static int
+lp_detach(device_t dev)
+{
+	struct lp_data *sc = device_get_softc(dev);
+	device_t ppbus = device_get_parent(dev);
+
+	ppb_lock(ppbus);
+	lpstop(sc);
+	ppb_unlock(ppbus);
+	bpfdetach(sc->sc_ifp);
+	if_detach(sc->sc_ifp);
+	bus_teardown_intr(dev, sc->res_irq, sc->sc_intr_cookie);
+	bus_release_resource(dev, SYS_RES_IRQ, 0, sc->res_irq);
 	return (0);
 }
+
 /*
  * Build the translation tables for the LPIP (BSD unix) protocol.
  * We don't want to calculate these nasties in our tight loop, so we
@@ -247,17 +309,22 @@
 {
 	int i;
 
+	mtx_lock(&lp_tables_lock);
 	if (txmith == NULL)
 		txmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT);
 
-	if (txmith == NULL)
+	if (txmith == NULL) {
+		mtx_unlock(&lp_tables_lock);
 		return (1);
+	}
 
 	if (ctxmith == NULL)
 		ctxmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT);
 
-	if (ctxmith == NULL)
+	if (ctxmith == NULL) {
+		mtx_unlock(&lp_tables_lock);
 		return (1);
+	}
 

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


More information about the p4-projects mailing list