PERFORCE change 158799 for review

Andrew Thompson thompsa at FreeBSD.org
Fri Mar 6 11:30:40 PST 2009


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

Change 158799 by thompsa at thompsa_burger on 2009/03/06 19:30:07

	IFC @158796

Affected files ...

.. //depot/projects/usb/src/sys/amd64/acpica/madt.c#6 integrate
.. //depot/projects/usb/src/sys/amd64/amd64/fpu.c#5 integrate
.. //depot/projects/usb/src/sys/amd64/amd64/machdep.c#13 integrate
.. //depot/projects/usb/src/sys/amd64/amd64/pmap.c#17 integrate
.. //depot/projects/usb/src/sys/amd64/amd64/trap.c#11 integrate
.. //depot/projects/usb/src/sys/amd64/ia32/ia32_signal.c#7 integrate
.. //depot/projects/usb/src/sys/amd64/include/fpu.h#3 integrate
.. //depot/projects/usb/src/sys/amd64/include/pcb.h#6 integrate
.. //depot/projects/usb/src/sys/amd64/linux32/linux32_sysvec.c#15 integrate
.. //depot/projects/usb/src/sys/compat/linux/linux_misc.h#4 integrate
.. //depot/projects/usb/src/sys/dev/ale/if_ale.c#3 integrate
.. //depot/projects/usb/src/sys/dev/ath/if_ath.c#18 integrate
.. //depot/projects/usb/src/sys/dev/ath/if_athvar.h#14 integrate
.. //depot/projects/usb/src/sys/dev/pci/pci.c#17 integrate
.. //depot/projects/usb/src/sys/dev/pci/pcireg.h#12 integrate
.. //depot/projects/usb/src/sys/dev/puc/pucdata.c#11 integrate
.. //depot/projects/usb/src/sys/dev/uart/uart_bus_pci.c#5 integrate
.. //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#3 integrate
.. //depot/projects/usb/src/sys/dev/usb/serial/uftdi.c#3 integrate
.. //depot/projects/usb/src/sys/dev/usb/serial/umodem.c#4 integrate
.. //depot/projects/usb/src/sys/dev/usb/usb_dev.c#7 integrate
.. //depot/projects/usb/src/sys/dev/usb/usbdevs#48 integrate
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_rum.c#6 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_rumfw.h#3 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_rumreg.h#3 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_rumvar.h#4 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_ural.c#6 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_uralreg.h#3 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_uralvar.h#4 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_zyd.c#6 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_zydfw.h#3 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_zydreg.h#4 edit
.. //depot/projects/usb/src/sys/dev/usb/wlan/usb_wlan.h#3 edit
.. //depot/projects/usb/src/sys/fs/devfs/devfs_vnops.c#17 integrate
.. //depot/projects/usb/src/sys/i386/acpica/madt.c#7 integrate
.. //depot/projects/usb/src/sys/i386/i386/machdep.c#12 integrate
.. //depot/projects/usb/src/sys/i386/i386/mp_machdep.c#15 integrate
.. //depot/projects/usb/src/sys/i386/include/npx.h#3 integrate
.. //depot/projects/usb/src/sys/i386/include/pcb.h#2 integrate
.. //depot/projects/usb/src/sys/i386/isa/npx.c#9 integrate
.. //depot/projects/usb/src/sys/i386/linux/linux_sysvec.c#11 integrate
.. //depot/projects/usb/src/sys/i386/xen/mp_machdep.c#7 integrate
.. //depot/projects/usb/src/sys/isa/syscons_isa.c#4 integrate
.. //depot/projects/usb/src/sys/kern/kern_conf.c#14 integrate
.. //depot/projects/usb/src/sys/kern/sys_generic.c#12 integrate
.. //depot/projects/usb/src/sys/kern/sysv_shm.c#8 integrate
.. //depot/projects/usb/src/sys/kern/vfs_default.c#8 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_indata.c#14 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_output.c#17 integrate
.. //depot/projects/usb/src/sys/netipsec/key.c#11 integrate
.. //depot/projects/usb/src/sys/pc98/cbus/syscons_cbus.c#4 integrate
.. //depot/projects/usb/src/sys/pc98/pc98/machdep.c#10 integrate
.. //depot/projects/usb/src/sys/sys/systm.h#13 integrate

Differences ...

==== //depot/projects/usb/src/sys/amd64/acpica/madt.c#6 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.26 2008/03/16 10:58:02 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.27 2009/03/05 16:03:44 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -483,6 +483,10 @@
 			    apic->Id);
 		if (ioapics[apic->Id].io_apic != NULL)
 			panic("%s: Double APIC ID %u", __func__, apic->Id);
+		if (apic->GlobalIrqBase >= FIRST_MSI_INT) {
+			printf("MADT: Ignoring bogus I/O APIC ID %u", apic->Id);
+			break;
+		}
 		ioapics[apic->Id].io_apic = ioapic_create(apic->Address,
 		    apic->Id, apic->GlobalIrqBase);
 		ioapics[apic->Id].io_vector = apic->GlobalIrqBase;

==== //depot/projects/usb/src/sys/amd64/amd64/fpu.c#5 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/fpu.c,v 1.161 2009/02/23 15:39:24 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/fpu.c,v 1.163 2009/03/05 19:42:11 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -102,10 +102,11 @@
     NULL, 1, "Floating point instructions executed in hardware");
 
 static	struct savefpu		fpu_cleanstate;
-static	bool_t			fpu_cleanstate_ready;
 
 /*
- * Initialize floating point unit.
+ * Initialize the floating point unit.  On the boot CPU we generate a
+ * clean state that is used to initialize the floating point unit when
+ * it is first used by a process.
  */
 void
 fpuinit(void)
@@ -115,22 +116,22 @@
 	u_short control;
 
 	savecrit = intr_disable();
-	PCPU_SET(fpcurthread, 0);
 	stop_emulating();
 	fninit();
 	control = __INITIAL_FPUCW__;
 	fldcw(&control);
 	mxcsr = __INITIAL_MXCSR__;
 	ldmxcsr(mxcsr);
-	fxsave(&fpu_cleanstate);
-	if (fpu_cleanstate.sv_env.en_mxcsr_mask)
-		cpu_mxcsr_mask = fpu_cleanstate.sv_env.en_mxcsr_mask;
-	else
-		cpu_mxcsr_mask = 0xFFBF;
+	if (PCPU_GET(cpuid) == 0) {
+		fxsave(&fpu_cleanstate);
+		if (fpu_cleanstate.sv_env.en_mxcsr_mask)
+			cpu_mxcsr_mask = fpu_cleanstate.sv_env.en_mxcsr_mask;
+		else
+			cpu_mxcsr_mask = 0xFFBF;
+		bzero(fpu_cleanstate.sv_fp, sizeof(fpu_cleanstate.sv_fp));
+		bzero(fpu_cleanstate.sv_xmm, sizeof(fpu_cleanstate.sv_xmm));
+	}
 	start_emulating();
-	bzero(fpu_cleanstate.sv_fp, sizeof(fpu_cleanstate.sv_fp));
-	bzero(fpu_cleanstate.sv_xmm, sizeof(fpu_cleanstate.sv_xmm));
-	fpu_cleanstate_ready = 1;
 	intr_restore(savecrit);
 }
 
@@ -384,18 +385,17 @@
 
 static int err_count = 0;
 
-int
-fpudna()
+void
+fpudna(void)
 {
 	struct pcb *pcb;
 	register_t s;
-	u_short control;
 
 	if (PCPU_GET(fpcurthread) == curthread) {
 		printf("fpudna: fpcurthread == curthread %d times\n",
 		    ++err_count);
 		stop_emulating();
-		return (1);
+		return;
 	}
 	if (PCPU_GET(fpcurthread) != NULL) {
 		printf("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n",
@@ -420,16 +420,12 @@
 		 * explicitly load sanitized registers.
 		 */
 		fxrstor(&fpu_cleanstate);
-		if (pcb->pcb_flags & PCB_32BIT) {
-			control = __INITIAL_FPUCW_I386__;
-			fldcw(&control);
-		}
+		if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
+			fldcw(&pcb->pcb_initial_fpucw);
 		pcb->pcb_flags |= PCB_FPUINITDONE;
 	} else
 		fxrstor(&pcb->pcb_save);
 	intr_restore(s);
-
-	return (1);
 }
 
 /*
@@ -457,10 +453,8 @@
 	register_t s;
 
 	if ((td->td_pcb->pcb_flags & PCB_FPUINITDONE) == 0) {
-		if (fpu_cleanstate_ready)
-			bcopy(&fpu_cleanstate, addr, sizeof(fpu_cleanstate));
-		else
-			bzero(addr, sizeof(*addr));
+		bcopy(&fpu_cleanstate, addr, sizeof(fpu_cleanstate));
+		addr->sv_env.en_cw = td->td_pcb->pcb_initial_fpucw;
 		return (_MC_FPOWNED_NONE);
 	}
 	s = intr_disable();

==== //depot/projects/usb/src/sys/amd64/amd64/machdep.c#13 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.691 2009/02/03 09:01:45 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.692 2009/03/05 19:42:11 jhb Exp $");
 
 #include "opt_atalk.h"
 #include "opt_atpic.h"
@@ -716,7 +716,7 @@
     idle_sysctl, "A", "currently selected idle function");
 
 /*
- * Clear registers on exec
+ * Reset registers to default values on exec.
  */
 void
 exec_setregs(td, entry, stack, ps_strings)
@@ -743,6 +743,7 @@
 	pcb->pcb_es = _udatasel;
 	pcb->pcb_fs = _udatasel;
 	pcb->pcb_gs = _udatasel;
+	pcb->pcb_initial_fpucw = __INITIAL_FPUCW__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;

==== //depot/projects/usb/src/sys/amd64/amd64/pmap.c#17 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.649 2009/02/25 20:26:48 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.651 2009/03/06 17:40:58 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -3481,9 +3481,6 @@
 	if (dst_addr != src_addr)
 		return;
 
-	if (!pmap_is_current(src_pmap))
-		return;
-
 	vm_page_lock_queues();
 	if (dst_pmap < src_pmap) {
 		PMAP_LOCK(dst_pmap);
@@ -3545,14 +3542,16 @@
 			continue;
 		}
 
-		srcmpte = PHYS_TO_VM_PAGE(srcptepaddr & PG_FRAME);
+		srcptepaddr &= PG_FRAME;
+		srcmpte = PHYS_TO_VM_PAGE(srcptepaddr);
 		KASSERT(srcmpte->wire_count > 0,
 		    ("pmap_copy: source page table page is unused"));
 
 		if (va_next > end_addr)
 			va_next = end_addr;
 
-		src_pte = vtopte(addr);
+		src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr);
+		src_pte = &src_pte[pmap_pte_index(addr)];
 		while (addr < va_next) {
 			pt_entry_t ptetemp;
 			ptetemp = *src_pte;
@@ -3802,7 +3801,9 @@
 				if ((tpte & PG_PS) != 0)
 					pte = pde;
 				else {
-					pte = vtopte(pv->pv_va);
+					pte = (pt_entry_t *)PHYS_TO_DMAP(tpte &
+					    PG_FRAME);
+					pte = &pte[pmap_pte_index(pv->pv_va)];
 					tpte = *pte & ~PG_PTE_PAT;
 				}
 
@@ -4495,7 +4496,7 @@
 			if (!pmap_demote_pde(kernel_pmap, pde, tmpva))
 				return (ENOMEM);
 		}
-		pte = vtopte(tmpva);
+		pte = pmap_pde_to_pte(pde, tmpva);
 		if (*pte == 0)
 			return (EINVAL);
 		tmpva += PAGE_SIZE;
@@ -4571,7 +4572,7 @@
 		} else {
 			if (cache_bits_pte < 0)
 				cache_bits_pte = pmap_cache_bits(mode, 0);
-			pte = vtopte(tmpva);
+			pte = pmap_pde_to_pte(pde, tmpva);
 			if ((*pte & PG_PTE_CACHE) != cache_bits_pte) {
 				pmap_pte_attr(pte, cache_bits_pte);
 				if (!changed)

==== //depot/projects/usb/src/sys/amd64/amd64/trap.c#11 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.328 2008/09/08 09:55:51 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.329 2009/03/05 16:56:16 jhb Exp $");
 
 /*
  * AMD64 Trap and System call handling
@@ -416,13 +416,8 @@
 
 		case T_DNA:
 			/* transparent fault (due to context switch "late") */
-			if (fpudna())
-				goto userout;
-			printf("pid %d killed due to lack of floating point\n",
-				p->p_pid);
-			i = SIGKILL;
-			ucode = 0;
-			break;
+			fpudna();
+			goto userout;
 
 		case T_FPOPFLT:		/* FPU operand fetch fault */
 			ucode = ILL_COPROC;
@@ -450,11 +445,9 @@
 			 * XXX this should be fatal unless the kernel has
 			 * registered such use.
 			 */
-			if (fpudna()) {
-				printf("fpudna in kernel mode!\n");
-				goto out;
-			}
-			break;
+			fpudna();
+			printf("fpudna in kernel mode!\n");
+			goto out;
 
 		case T_STKFLT:		/* stack fault */
 			break;

==== //depot/projects/usb/src/sys/amd64/ia32/ia32_signal.c#7 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.20 2009/01/31 11:37:21 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.21 2009/03/05 19:42:11 jhb Exp $");
 
 #include "opt_compat.h"
 
@@ -729,6 +729,7 @@
 	pcb->pcb_es = _udatasel;
 	pcb->pcb_fs = _udatasel;
 	pcb->pcb_gs = _udatasel;
+	pcb->pcb_initial_fpucw = __INITIAL_FPUCW_I386__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;

==== //depot/projects/usb/src/sys/amd64/include/fpu.h#3 (text+ko) ====

@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)npx.h	5.3 (Berkeley) 1/18/91
- * $FreeBSD: src/sys/amd64/include/fpu.h,v 1.34 2009/01/28 20:35:16 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/fpu.h,v 1.35 2009/03/05 16:56:16 jhb Exp $
  */
 
 /*
@@ -97,7 +97,7 @@
 #define	__INITIAL_MXCSR_MASK__	0xFFBF
 
 #ifdef _KERNEL
-int	fpudna(void);
+void	fpudna(void);
 void	fpudrop(void);
 void	fpuexit(struct thread *td);
 int	fpuformat(void);

==== //depot/projects/usb/src/sys/amd64/include/pcb.h#6 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)pcb.h	5.10 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/amd64/include/pcb.h,v 1.66 2008/09/08 09:59:05 kib Exp $
+ * $FreeBSD: src/sys/amd64/include/pcb.h,v 1.68 2009/03/05 19:42:11 jhb Exp $
  */
 
 #ifndef _AMD64_PCB_H_
@@ -56,6 +56,12 @@
 	register_t	pcb_fsbase;
 	register_t	pcb_gsbase;
 	u_long		pcb_flags;
+#define	PCB_DBREGS	0x02	/* process using debug registers */
+#define	PCB_FPUINITDONE	0x08	/* fpu state is initialized */
+#define	PCB_GS32BIT	0x20	/* linux gs switch */
+#define	PCB_32BIT	0x40	/* process has 32 bit context (segs etc) */
+#define	PCB_FULLCTX	0x80	/* full context restore on sysret */
+
 	u_int32_t	pcb_ds;
 	u_int32_t	pcb_es;
 	u_int32_t	pcb_fs;
@@ -68,11 +74,7 @@
 	u_int64_t	pcb_dr7;
 
 	struct	savefpu	pcb_save;
-#define	PCB_DBREGS	0x02	/* process using debug registers */
-#define	PCB_FPUINITDONE	0x08	/* fpu state is initialized */
-#define	PCB_GS32BIT	0x20	/* linux gs switch */
-#define	PCB_32BIT	0x40	/* process has 32 bit context (segs etc) */
-#define	PCB_FULLCTX	0x80	/* full context restore on sysret */
+	uint16_t	pcb_initial_fpucw;
 
 	caddr_t	pcb_onfault;	/* copyin/out fault recovery */
 

==== //depot/projects/usb/src/sys/amd64/linux32/linux32_sysvec.c#15 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.42 2009/03/04 12:14:33 dchagin Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.43 2009/03/05 19:42:11 jhb Exp $");
 #include "opt_compat.h"
 
 #ifndef COMPAT_IA32
@@ -841,6 +841,7 @@
 	pcb->pcb_es = _udatasel;
 	pcb->pcb_fs = _udatasel;
 	pcb->pcb_gs = _udatasel;
+	pcb->pcb_initial_fpucw = __LINUX_NPXCW__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;

==== //depot/projects/usb/src/sys/compat/linux/linux_misc.h#4 (text+ko) ====

@@ -25,7 +25,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/compat/linux/linux_misc.h,v 1.4 2009/03/04 12:14:33 dchagin Exp $
+ * $FreeBSD: src/sys/compat/linux/linux_misc.h,v 1.5 2009/03/05 19:42:11 jhb Exp $
  */
 
 #ifndef _LINUX_MISC_H_
@@ -60,4 +60,9 @@
 					 */
 #define	LINUX_AT_EXECFN		31	/* filename of program */
 
+/* Linux sets the i387 to extended precision. */
+#if defined(__i386__) || defined(__amd64__)
+#define	__LINUX_NPXCW__		0x37f
+#endif
+
 #endif	/* _LINUX_MISC_H_ */

==== //depot/projects/usb/src/sys/dev/ale/if_ale.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ale/if_ale.c,v 1.3 2008/12/03 09:01:12 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ale/if_ale.c,v 1.4 2009/03/05 00:04:32 yongari Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1543,20 +1543,11 @@
 	struct ale_softc *sc;
 	struct ifnet *ifp;
 	int pmc;
-	uint16_t cmd, pmstat;
+	uint16_t pmstat;
 
 	sc = device_get_softc(dev);
 
 	ALE_LOCK(sc);
-	/*
-	 * Clear INTx emulation disable for hardwares that
-	 * is set in resume event. From Linux.
-	 */
-	cmd = pci_read_config(sc->ale_dev, PCIR_COMMAND, 2);
-	if ((cmd & 0x0400) != 0) {
-		cmd &= ~0x0400;
-		pci_write_config(sc->ale_dev, PCIR_COMMAND, cmd, 2);
-	}
 	if (pci_find_extcap(sc->ale_dev, PCIY_PMG, &pmc) == 0) {
 		/* Disable PME and clear PME status. */
 		pmstat = pci_read_config(sc->ale_dev,

==== //depot/projects/usb/src/sys/dev/ath/if_ath.c#18 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.238 2009/02/24 00:12:16 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.239 2009/03/05 00:15:43 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -6861,6 +6861,22 @@
 	return !ath_hal_setintmit(sc->sc_ah, intmit) ? EINVAL : 0;
 }
 
+#ifdef ATH_SUPPORT_TDMA
+static int
+ath_sysctl_setcca(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	int setcca, error;
+
+	setcca = sc->sc_setcca;
+	error = sysctl_handle_int(oidp, &setcca, 0, req);
+	if (error || !req->newptr)
+		return error;
+	sc->sc_setcca = (setcca != 0);
+	return 0;
+}
+#endif /* ATH_SUPPORT_TDMA */
+
 static void
 ath_sysctlattach(struct ath_softc *sc)
 {
@@ -6974,6 +6990,9 @@
 		SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
 			"superframe", CTLFLAG_RD, &sc->sc_tdmabintval, 0,
 			"TDMA calculated super frame");
+		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+			"setcca", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
+			ath_sysctl_setcca, "I", "enable CCA control");
 	}
 #endif
 }
@@ -7423,7 +7442,8 @@
 	ath_hal_intrset(ah, 0);
 
 	ath_beaconq_config(sc);			/* setup h/w beacon q */
-	ath_hal_setcca(ah, AH_FALSE);		/* disable CCA */
+	if (sc->sc_setcca)
+		ath_hal_setcca(ah, AH_FALSE);	/* disable CCA */
 	ath_tdma_bintvalsetup(sc, tdma);	/* calculate beacon interval */
 	ath_tdma_settimers(sc, sc->sc_tdmabintval,
 		sc->sc_tdmabintval | HAL_BEACON_RESET_TSF);

==== //depot/projects/usb/src/sys/dev/ath/if_athvar.h#14 (text+ko) ====

@@ -26,7 +26,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.80 2009/02/24 00:12:16 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.81 2009/03/05 00:15:43 sam Exp $
  */
 
 /*
@@ -255,6 +255,7 @@
 				sc_wmetkipmic:1,/* can do WME+TKIP MIC */
 				sc_resume_up: 1,/* on resume, start all vaps */
 				sc_tdma	    : 1,/* TDMA in use */
+				sc_setcca   : 1,/* set/clr CCA with TDMA */
 				sc_resetcal : 1;/* reset cal state next trip */
 	uint32_t		sc_eerd;	/* regdomain from EEPROM */
 	uint32_t		sc_eecc;	/* country code from EEPROM */

==== //depot/projects/usb/src/sys/dev/pci/pci.c#17 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.372 2009/03/04 18:23:48 rnoland Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.375 2009/03/06 11:24:42 rnoland Exp $");
 
 #include "opt_bus.h"
 
@@ -71,10 +71,10 @@
 #define	ACPI_PWR_FOR_SLEEP(x, y, z)
 #endif
 
-static uint32_t		pci_mapbase(unsigned mapreg);
-static const char	*pci_maptype(unsigned mapreg);
-static int		pci_mapsize(unsigned testval);
-static int		pci_maprange(unsigned mapreg);
+static pci_addr_t	pci_mapbase(uint64_t mapreg);
+static const char	*pci_maptype(uint64_t mapreg);
+static int		pci_mapsize(uint64_t testval);
+static int		pci_maprange(uint64_t mapreg);
 static void		pci_fixancient(pcicfgregs *cfg);
 
 static int		pci_porten(device_t pcib, int b, int s, int f);
@@ -316,8 +316,8 @@
 
 /* return base address of memory or port map */
 
-static uint32_t
-pci_mapbase(uint32_t mapreg)
+static pci_addr_t
+pci_mapbase(uint64_t mapreg)
 {
 
 	if (PCI_BAR_MEM(mapreg))
@@ -329,7 +329,7 @@
 /* return map type of memory or port map */
 
 static const char *
-pci_maptype(unsigned mapreg)
+pci_maptype(uint64_t mapreg)
 {
 
 	if (PCI_BAR_IO(mapreg))
@@ -342,7 +342,7 @@
 /* return log2 of map size decoded for memory or port map */
 
 static int
-pci_mapsize(uint32_t testval)
+pci_mapsize(uint64_t testval)
 {
 	int ln2size;
 
@@ -361,7 +361,7 @@
 /* return log2 of address range supported by map register */
 
 static int
-pci_maprange(unsigned mapreg)
+pci_maprange(uint64_t mapreg)
 {
 	int ln2range = 0;
 
@@ -2279,8 +2279,7 @@
     int b, int s, int f, int reg, struct resource_list *rl, int force,
     int prefetch)
 {
-	uint32_t map;
-	pci_addr_t base;
+	pci_addr_t base, map;
 	pci_addr_t start, end, count;
 	uint8_t ln2size;
 	uint8_t ln2range;
@@ -2291,6 +2290,10 @@
 	struct resource *res;
 
 	map = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4);
+	ln2range = pci_maprange(map);
+	if (ln2range == 64)
+		map |= (uint64_t)PCIB_READ_CONFIG(pcib, b, s, f, reg + 4, 4) <<
+		    32;
 
 	/*
 	 * Disable decoding via the command register before
@@ -2308,17 +2311,25 @@
 	 */
 	PCIB_WRITE_CONFIG(pcib, b, s, f, reg, 0xffffffff, 4);
 	testval = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4);
+	if (ln2range == 64) {
+		PCIB_WRITE_CONFIG(pcib, b, s, f, reg + 4, 0xffffffff, 4);
+		testval |= (uint64_t)PCIB_READ_CONFIG(pcib, b, s, f, reg + 4,
+		    4) << 32;
+	}
 
 	/* Restore the BAR and command register. */
 	PCIB_WRITE_CONFIG(pcib, b, s, f, reg, map, 4);
+	if (ln2range == 64)
+		PCIB_WRITE_CONFIG(pcib, b, s, f, reg + 4, map >> 32, 4);
 	PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, cmd, 2);
 
-	if (PCI_BAR_MEM(map))
+	if (PCI_BAR_MEM(map)) {
 		type = SYS_RES_MEMORY;
-	else
+		if (map & PCIM_BAR_MEM_PREFETCH)
+			prefetch = 1;
+	} else
 		type = SYS_RES_IOPORT;
 	ln2size = pci_mapsize(testval);
-	ln2range = pci_maprange(testval);
 	base = pci_mapbase(map);
 	barlen = ln2range == 64 ? 2 : 1;
 
@@ -2335,12 +2346,6 @@
 	    (type == SYS_RES_IOPORT && ln2size < 2))
 		return (barlen);
 
-	if (ln2range == 64)
-		/*
-		 * Read the other half of a 64bit map register.  We
-		 * assume that the size of the BAR is less than 2^32.
-		 */
-		base |= (uint64_t) PCIB_READ_CONFIG(pcib, b, s, f, reg + 4, 4) << 32;
 	if (bootverbose) {
 		printf("\tmap[%02x]: type %s, range %2d, base %#jx, size %2d",
 		    reg, pci_maptype(map), ln2range, (uintmax_t)base, ln2size);
@@ -2915,7 +2920,7 @@
 		return(bus_generic_teardown_intr(dev, child, irq, cookie));
 
 	rid = rman_get_rid(irq);
-	if (rid > 0) {
+	if (rid == 0) {
 		/* Mask INTx */
 		pci_set_command_bit(dev, child, PCIM_CMD_INTxDIS);
 	} else {
@@ -3419,7 +3424,7 @@
 	struct resource *res;
 	pci_addr_t map, testval;
 	uint16_t cmd;
-	int mapsize;
+	int maprange, mapsize;
 
 	/*
 	 * Weed out the bogons, and figure out how large the BAR/map
@@ -3430,6 +3435,9 @@
 	 */
 	res = NULL;
 	map = pci_read_config(child, *rid, 4);
+	maprange = pci_maprange(map);
+	if (maprange == 64)
+		map |= (pci_addr_t)pci_read_config(child, *rid + 4, 4) << 32;
 
 	/*
 	 * Disable decoding via the command register before
@@ -3443,8 +3451,11 @@
 	/* Determine the BAR's length. */
 	pci_write_config(child, *rid, 0xffffffff, 4);
 	testval = pci_read_config(child, *rid, 4);
-	if (pci_maprange(testval) == 64)
-		map |= (pci_addr_t)pci_read_config(child, *rid + 4, 4) << 32;
+	if (maprange == 64) {
+		pci_write_config(child, *rid + 4, 0xffffffff, 4);
+		testval |= (pci_addr_t)pci_read_config(child, *rid + 4, 4) <<
+		    32;
+	}
 
 	/*
 	 * Restore the original value of the BAR.  We may have reprogrammed
@@ -3452,6 +3463,8 @@
 	 * we need the console device addressable.
 	 */
 	pci_write_config(child, *rid, map, 4);
+	if (maprange == 64)
+		pci_write_config(child, *rid + 4, map, 4);
 	pci_write_config(child, PCIR_COMMAND, cmd, 2);
 
 	/* Ignore a BAR with a base of 0. */
@@ -3488,6 +3501,8 @@
 	count = 1UL << mapsize;
 	if (RF_ALIGNMENT(flags) < mapsize)
 		flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
+	if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH))
+		flags |= RF_PREFETCHABLE;
 
 	/*
 	 * Allocate enough resource, and then write back the
@@ -3516,7 +3531,7 @@
 		    count, *rid, type, rman_get_start(res));
 	map = rman_get_start(res);
 	pci_write_config(child, *rid, map, 4);
-	if (pci_maprange(testval) == 64)
+	if (maprange == 64)
 		pci_write_config(child, *rid + 4, map >> 32, 4);
 out:;
 	return (res);

==== //depot/projects/usb/src/sys/dev/pci/pcireg.h#12 (text+ko) ====

@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/pci/pcireg.h,v 1.70 2009/03/02 19:00:41 rnoland Exp $
+ * $FreeBSD: src/sys/dev/pci/pcireg.h,v 1.71 2009/03/05 15:33:04 jhb Exp $
  *
  */
 
@@ -132,7 +132,7 @@
 #define	PCIM_BAR_MEM_1MB	2	/* Locate below 1MB in PCI <= 2.1 */
 #define	PCIM_BAR_MEM_64		4
 #define	PCIM_BAR_MEM_PREFETCH	0x00000008
-#define	PCIM_BAR_MEM_BASE	0xfffffff0
+#define	PCIM_BAR_MEM_BASE	0xfffffffffffffff0ULL
 #define	PCIM_BAR_IO_RESERVED	0x00000002
 #define	PCIM_BAR_IO_BASE	0xfffffffc
 #define	PCIR_CIS	0x28

==== //depot/projects/usb/src/sys/dev/puc/pucdata.c#11 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/puc/pucdata.c,v 1.70 2009/02/12 10:39:19 kevlo Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/puc/pucdata.c,v 1.71 2009/03/05 16:43:33 jhb Exp $");
 
 /*
  * PCI "universal" communications card driver configuration data (used to
@@ -761,6 +761,18 @@
 	    PUC_PORT_2P, 0x10, 8, 0,
 	}, 
 
+	/*
+	 * This is more specific than the generic NM9835 entry that follows, and
+	 * is placed here to _prevent_ puc from claiming this single port card.
+	 *
+	 * uart(4) will claim this device.
+	 */
+	{   0x9710, 0x9835, 0x1000, 1,
+	    "NetMos NM9835 based 1-port serial",
+	    DEFAULT_RCLK,
+	    PUC_PORT_1S, 0x10, 4, 0,
+	},
+
 	{   0x9710, 0x9835, 0xffff, 0,
 	    "NetMos NM9835 Dual UART and 1284 Printer port",
 	    DEFAULT_RCLK,

==== //depot/projects/usb/src/sys/dev/uart/uart_bus_pci.c#5 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_pci.c,v 1.12 2009/02/11 00:08:03 kaiw Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_pci.c,v 1.13 2009/03/05 16:43:33 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -110,6 +110,7 @@
 { 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART",
 	0x10, 16384000 },
 { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
 { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 },
 { 0xffff, 0, 0xffff, 0, NULL, 0, 0}
 };

==== //depot/projects/usb/src/sys/dev/usb/controller/ehci.c#3 (text+ko) ====

@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.2 2009/02/24 03:39:13 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.3 2009/03/06 17:13:12 thompsa Exp $");
 
 #include <dev/usb/usb.h>
 #include <dev/usb/usb_mfunc.h>
@@ -2197,11 +2197,9 @@
 	/* put transfer on interrupt queue */
 	ehci_transfer_intr_enqueue(xfer);
 
-	/* Performance quirk: Some Host Controllers have a too low
+	/* XXX Performance quirk: Some Host Controllers have a too low
 	 * interrupt rate. Issue an IAAD to stimulate the Host
-	 * Controller after queueing the BULK transfer. Performance
-	 * increase seen using an off the shelf flash stick: 9
-	 * Mbytes/second. --hps
+	 * Controller after queueing the BULK transfer.
 	 */
 	temp = EOREAD4(sc, EHCI_USBCMD);
 	if (!(temp & EHCI_CMD_IAAD))

==== //depot/projects/usb/src/sys/dev/usb/serial/uftdi.c#3 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/serial/uftdi.c,v 1.3 2009/03/02 05:37:05 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/serial/uftdi.c,v 1.4 2009/03/06 14:53:51 joerg Exp $");
 
 /*
  * NOTE: all function names beginning like "uftdi_cfg_" can only
@@ -201,7 +201,9 @@
 MODULE_DEPEND(uftdi, usb, 1, 1, 1);
 
 static struct usb2_device_id uftdi_devs[] = {
+	{USB_VPI(USB_VENDOR_ATMEL, USB_PRODUCT_ATMEL_STK541, UFTDI_TYPE_8U232AM)},
 	{USB_VPI(USB_VENDOR_DRESDENELEKTRONIK, USB_PRODUCT_DRESDENELEKTRONIK_SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM)},
+	{USB_VPI(USB_VENDOR_DRESDENELEKTRONIK, USB_PRODUCT_DRESDENELEKTRONIK_WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM)},
 	{USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U100AX, UFTDI_TYPE_SIO)},
 	{USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_2232C, UFTDI_TYPE_8U232AM)},
 	{USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U232AM, UFTDI_TYPE_8U232AM)},

==== //depot/projects/usb/src/sys/dev/usb/serial/umodem.c#4 (text+ko) ====

@@ -1,7 +1,7 @@
 /*	$NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $	*/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/serial/umodem.c,v 1.4 2009/03/02 05:37:05 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/serial/umodem.c,v 1.5 2009/03/05 16:15:07 thompsa Exp $");
 
 /*-
  * Copyright (c) 2003, M. Warner Losh <imp at FreeBSD.org>.

==== //depot/projects/usb/src/sys/dev/usb/usb_dev.c#7 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/usb/usb_dev.c,v 1.7 2009/02/28 17:20:00 thompsa Exp $ */
+/* $FreeBSD: src/sys/dev/usb/usb_dev.c,v 1.8 2009/03/05 19:20:17 thompsa Exp $ */
 /*-
  * Copyright (c) 2006-2008 Hans Petter Selasky. All rights reserved.
  *
@@ -1072,16 +1072,12 @@
 	struct usb2_cdev_privdata* cpd;
 	struct usb2_fifo *f;
 	struct usb2_mbuf *m;
-	int fflags;
-	int err, revents;
+	int fflags, revents;
 
-	err = devfs_get_cdevpriv((void **)&cpd);
-	if (err != 0)
-		return (devfs_no_poll(dev, events, td));
-
-	err = usb2_ref_device(cpd, 0 /* no uref */ );
-	if (err)
-		return (devfs_no_poll(dev, events, td));
+	if (devfs_get_cdevpriv((void **)&cpd) != 0 ||
+	    usb2_ref_device(cpd, 0) != 0)
+		return (events &
+		    (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
 
 	fflags = cpd->fflags;
 

==== //depot/projects/usb/src/sys/dev/usb/usbdevs#48 (text+ko) ====

@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/dev/usb/usbdevs,v 1.404 2009/03/04 03:47:57 thompsa Exp $
+$FreeBSD: src/sys/dev/usb/usbdevs,v 1.405 2009/03/06 14:53:51 joerg Exp $
 /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */
 
 /*-
@@ -911,6 +911,7 @@
 product ATHEROS2 AR5523_3_NF	0x0006	AR5523 (no firmware)
 
 /* Atmel Comp. products */
+product ATMEL STK541		0x2109	Zigbee Controller
 product ATMEL UHB124		0x3301	UHB124 hub
 product ATMEL DWL120		0x7603	DWL-120 Wireless Adapter
 product ATMEL BW002		0x7605	BW002 Wireless Adapter
@@ -1174,6 +1175,7 @@
 
 /* dresden elektronik products */
 product DRESDENELEKTRONIK SENSORTERMINALBOARD  0x0001 SensorTerminalBoard
+product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL  0x0004 Wireless Handheld Terminal
 
 /* Dynastream Innovations */
 product DYNASTREAM ANTDEVBOARD	0x1003	ANT dev board

==== //depot/projects/usb/src/sys/dev/usb/wlan/if_rum.c#6 (text+ko) ====

@@ -1,9 +1,9 @@
-/*	$FreeBSD: src/sys/dev/usb/wlan/if_rum.c,v 1.6 2009/03/02 05:37:05 thompsa Exp $	*/
+/*	$FreeBSD: head/sys/dev/usb/wlan/if_rum.c 189275 2009-03-02 05:37:05Z thompsa $	*/
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini at free.fr>
  * Copyright (c) 2006 Niall O'Higgins <niallo at openbsd.org>
- * Copyright (c) 2007-2008 Hans Petter Selasky <hselasky at freebsd.org>
+ * Copyright (c) 2007-2008 Hans Petter Selasky <hselasky at FreeBSD.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/wlan/if_rum.c,v 1.6 2009/03/02 05:37:05 thompsa Exp $");
+__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_rum.c 189275 2009-03-02 05:37:05Z thompsa $");
 
 /*-
  * Ralink Technology RT2501USB/RT2601USB chipset driver
@@ -172,7 +172,6 @@
 static void		rum_update_slot(struct ifnet *);
 static void		rum_set_bssid(struct rum_softc *, const uint8_t *);
 static void		rum_set_macaddr(struct rum_softc *, const uint8_t *);
-static void		rum_update_mcast(struct ifnet *);
 static void		rum_update_promisc(struct ifnet *);
 static const char	*rum_get_rf(int);
 static void		rum_read_eeprom(struct rum_softc *);
@@ -194,7 +193,7 @@
 static void		rum_amrr_start(struct rum_softc *,
 			    struct ieee80211_node *);
 static void		rum_amrr_timeout(void *);
-static uint8_t		rum_pause(struct rum_softc *, unsigned int);
+static int		rum_pause(struct rum_softc *, int);
 static void		rum_queue_command(struct rum_softc *,
 			    usb2_proc_callback_t *, struct usb2_proc_msg *,
 			    struct usb2_proc_msg *);
@@ -450,7 +449,7 @@
 	uint8_t bands;
 
 	/* retrieve RT2573 rev. no */
-	for (ntries = 0; ntries != 100; ntries++) {
+	for (ntries = 0; ntries < 100; ntries++) {

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


More information about the p4-projects mailing list