PERFORCE change 108128 for review

Robert Watson rwatson at FreeBSD.org
Thu Oct 19 16:03:29 PDT 2006


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

Change 108128 by rwatson at rwatson_zoo on 2006/10/19 23:02:40

	Integrate TrustedBSD priv6 branch from FreeBSD CVS:
	
	- 6.2-BETA series.
	- Audit event identifier tweaks.
	- IPMI improvements
	- syscons ioctl fixes for sparc64.
	- More VFS deadlock/crash fixes.
	- Multicast teardown for ifnet removal fixes.
	- Audit limits for jail.
	- Misc.

Affected files ...

.. //depot/projects/trustedbsd/priv6/src/sys/alpha/conf/GENERIC#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/amd64/conf/GENERIC#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/amd64/include/intr_machdep.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/arm/at91/at91.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/arm/at91/at91rm92reg.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/arm/at91/kb920x_machdep.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/boot/common/help.common#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/boot/common/loader.8#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/boot/common/merge_help.awk#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/boot/forth/support.4th#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/boot/i386/libi386/biossmap.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/boot/i386/loader/help.i386#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/cam/cam_periph.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_proto.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_syscall.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_syscalls.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_sysent.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/syscalls.master#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/conf/NOTES#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/conf/files#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/conf/kern.pre.mk#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/contrib/dev/ath/freebsd/ah_if.m#2 delete
.. //depot/projects/trustedbsd/priv6/src/sys/contrib/dev/ath/freebsd/ah_osdep.c#3 delete
.. //depot/projects/trustedbsd/priv6/src/sys/contrib/dev/ath/freebsd/ah_osdep.h#2 delete
.. //depot/projects/trustedbsd/priv6/src/sys/ddb/db_main.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/acpica/Osd/OsdHardware.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/acpica/acpi.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ata/ata-chipset.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ata/ata-usb.c#1 branch
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ath/ah_osdep.c#1 branch
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ath/ah_osdep.h#1 branch
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ath/if_ath.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ath/if_athvar.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/atkbdc/atkbd.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/bge/if_bge.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/bge/if_bgereg.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/bktr/bktr_os.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/digi/digi.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ipmi/ipmi.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/ipmi/ipmi_smic.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/iwi/if_iwi.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/kbdmux/kbdmux.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/pci/pci_user.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/syscons/scvidctl.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/syscons/syscons.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/uart/uart_kbd_sun.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/usb/ukbd.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/dev/vkbd/vkbd.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/devfs/devfs_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/hpfs/hpfs_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/msdosfs/msdosfs_vfsops.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/ntfs/ntfs_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/nullfs/null_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/nwfs/nwfs_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/portalfs/portal_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/procfs/procfs_ioctl.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/smbfs/smbfs_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/udf/udf_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/umapfs/umap_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/fs/unionfs/union_vfsops.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/gnu/fs/reiserfs/reiserfs_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/i386/conf/GENERIC#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/i386/include/intr_machdep.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/ia64/conf/GENERIC#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/isofs/cd9660/cd9660_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/init_sysent.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/kern_lock.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/subr_stack.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/sys_generic.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/syscalls.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/syscalls.master#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/tty_pty.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/uipc_socket2.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/vfs_bio.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/vfs_export.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/vfs_mount.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/vfs_subr.c#5 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/kern/vfs_syscalls.c#5 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/modules/ath/Makefile#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/modules/ath_hal/Makefile#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/modules/ath_rate_amrr/Makefile#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/modules/ath_rate_onoe/Makefile#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/modules/ath_rate_sample/Makefile#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/net/bpf.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/net/if.c#5 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/net/if_tap.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/net/if_tap.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/net/if_var.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/net/if_vlan.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netgraph/ng_base.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/in.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/in_var.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/ip_carp.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/ip_fw2.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/ip_mroute.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/ip_output.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/raw_ip.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet/udp_usrreq.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet6/in6_ifattach.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet6/in6_proto.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/netinet6/nd6.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/nfsclient/nfs_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/pc98/cbus/pckbd.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/pc98/conf/GENERIC#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/pci/if_rl.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/pci/intpm.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/pci/intpmreg.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/powerpc/conf/GENERIC#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/security/audit/audit_bsm.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/security/audit/audit_syscalls.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/security/mac_portacl/mac_portacl.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sparc64/conf/GENERIC#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/buf.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/consio.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/digiio.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/ioccom.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/kbio.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/lockmgr.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/mount.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/pioctl.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/proc.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/syscall.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/syscall.mk#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/sysproto.h#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/sys/ttycom.h#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/ufs/ffs/ffs_snapshot.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/ufs/ffs/ffs_softdep.c#2 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/ufs/ffs/ffs_vfsops.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/ufs/ufs/ufs_quota.c#3 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/ufs/ufs/ufs_vnops.c#4 integrate
.. //depot/projects/trustedbsd/priv6/src/sys/vm/vnode_pager.c#2 integrate

Differences ...

==== //depot/projects/trustedbsd/priv6/src/sys/alpha/conf/GENERIC#2 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.186.2.8 2006/07/13 08:11:46 delphij Exp $
+# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.186.2.9 2006/10/09 18:41:36 simon Exp $
 
 machine		alpha
 cpu		EV4
@@ -43,7 +43,6 @@
 options 	DEC_KN300		# AlphaServer 4100 (Rawhide),
 					# AlphaServer 1200 (Tincup)
 
-#options 	SCHED_ULE		# ULE scheduler
 # PREEMPTION appears to have a negative impact on stability (locking related 
 # panics) at least on SMP machines.
 #options 	PREEMPTION		# Enable kernel thread preemption

==== //depot/projects/trustedbsd/priv6/src/sys/amd64/conf/GENERIC#2 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.439.2.13 2006/07/13 08:11:46 delphij Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.439.2.14 2006/10/09 18:41:36 simon Exp $
 
 machine		amd64
 cpu		HAMMER
@@ -27,7 +27,6 @@
 
 makeoptions	DEBUG=-g		# Build kernel with gdb(1) debug symbols
 
-#options 	SCHED_ULE		# ULE scheduler
 options 	SCHED_4BSD		# 4BSD scheduler
 options 	PREEMPTION		# Enable kernel thread preemption
 options 	INET			# InterNETworking

==== //depot/projects/trustedbsd/priv6/src/sys/amd64/include/intr_machdep.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.5.2.3 2006/03/10 19:37:31 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.5.2.4 2006/10/19 14:52:02 jhb Exp $
  */
 
 #ifndef __MACHINE_INTR_MACHDEP_H__
@@ -56,9 +56,9 @@
  * - 7 counters for each CPU for IPI counters for SMP.
  */
 #ifdef SMP
+#define	INTRCNT_COUNT	(1 + NUM_IO_INTS * 2 + (1 + 7) * MAXCPU)
+#else
 #define	INTRCNT_COUNT	(1 + NUM_IO_INTS * 2 + 1)
-#else
-#define	INTRCNT_COUNT	(1 + NUM_IO_INTS * 2 + (1 + 7) * MAXCPU)
 #endif
 
 #ifndef LOCORE

==== //depot/projects/trustedbsd/priv6/src/sys/arm/at91/at91.c#2 (text+ko) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.7.2.1 2006/06/23 23:35:36 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.7.2.2 2006/10/04 11:44:12 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,7 +54,11 @@
 	vm_paddr_t pa, endpa;
 
 	pa = trunc_page(bpa);
-	if (pa >= 0xfff00000)
+	if (pa >= 0xfff00000) {
+		*bshp = pa - 0xf0000000 + 0xd0000000;
+		return (0);
+	}
+	if (pa >= 0xdff00000)
 		return (0);
 	endpa = round_page(bpa + size);
 
@@ -417,8 +421,8 @@
 	    rman_manage_region(&sc->sc_irq_rman, 1, 31) != 0)
 		panic("at91_attach: failed to set up IRQ rman");
 	if (rman_init(&sc->sc_mem_rman) != 0 ||
-	    rman_manage_region(&sc->sc_mem_rman, 0xfff00000ul,
-	    0xfffffffful) != 0)
+	    rman_manage_region(&sc->sc_mem_rman, 0xdff00000ul,
+	    0xdffffffful) != 0)
 		panic("at91_attach: failed to set up memory rman");
 	if (rman_manage_region(&sc->sc_mem_rman, AT91RM92_OHCI_BASE,
 	    AT91RM92_OHCI_BASE + AT91RM92_OHCI_SIZE - 1) != 0)
@@ -543,7 +547,7 @@
     void **cookiep)
 {
 	struct at91_softc *sc = device_get_softc(dev);
-	
+
 	if (rman_get_start(ires) == AT91RM92_IRQ_SYSTEM && !(flags & INTR_FAST))
 		panic("All system interrupt ISRs must be type INTR_FAST");
 	BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg,

==== //depot/projects/trustedbsd/priv6/src/sys/arm/at91/at91rm92reg.h#2 (text+ko) ====

@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* $$FreeBSD: src/sys/arm/at91/at91rm92reg.h,v 1.3.2.1 2006/06/23 23:35:36 cognet Exp $ */
+/* $$FreeBSD: src/sys/arm/at91/at91rm92reg.h,v 1.3.2.2 2006/10/04 11:44:12 cognet Exp $ */
 
 #ifndef AT91RM92REG_H_
 #define AT91RM92REG_H_
@@ -41,7 +41,7 @@
  * 0xf0000000 - 0xfffffffff : Peripherals
  */
 
-#define AT91RM92_BASE		0xf0000000
+#define AT91RM92_BASE		0xd0000000
 /* Usart */
 
 #define AT91RM92_USART0_BASE	0xffc0000

==== //depot/projects/trustedbsd/priv6/src/sys/arm/at91/kb920x_machdep.c#2 (text+ko) ====

@@ -48,7 +48,7 @@
 #include "opt_at91.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.8.2.2 2006/07/18 22:01:22 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.8.2.3 2006/10/04 11:44:12 cognet Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -153,8 +153,8 @@
 		 * and the timer. Other devices should use newbus to
 		 * map their memory anyway.
 		 */
+		0xdff00000,
 		0xfff00000,
-		0xfff00000,
 		0x100000,
 		VM_PROT_READ|VM_PROT_WRITE,                             
 		PTE_NOCACHE,
@@ -364,7 +364,7 @@
 	l1pagetable = kernel_l1pt.pv_va;
 
 	/* Map the L2 pages tables in the L1 page table */
-	pmap_link_l2pt(l1pagetable, ARM_VECTORS_LOW,
+	pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH,
 	    &kernel_pt_table[KERNEL_PT_SYS]);
 	for (i = 0; i < KERNEL_PT_KERN_NUM; i++)
 		pmap_link_l2pt(l1pagetable, KERNBASE + i * 0x100000,
@@ -383,7 +383,7 @@
 	
 
 	/* Map the vector page. */
-	pmap_map_entry(l1pagetable, ARM_VECTORS_LOW, systempage.pv_pa,
+	pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa,
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	/* Map the stack pages */
 	pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
@@ -462,7 +462,7 @@
 	thread0.td_frame = &proc0_tf;
 	pcpup->pc_curpcb = thread0.td_pcb;
 	
-	arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL);
+	arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL);
 
 	pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1);
 	pmap_bootstrap(freemempos,
@@ -478,7 +478,7 @@
 	dump_avail[2] = 0;
 	dump_avail[3] = 0;
 	
-	phys_avail[0] = freemempos - KERNVIRTADDR + KERNPHYSADDR;
+	phys_avail[0] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR;
 	phys_avail[1] = KERNPHYSADDR + memsize;
 	phys_avail[2] = 0;
 	phys_avail[3] = 0;

==== //depot/projects/trustedbsd/priv6/src/sys/boot/common/help.common#2 (text+ko) ====

@@ -44,7 +44,7 @@
 
 	bcachestat
 
-	Displays statistics about disk cache usage.  For depuration only.
+	Displays statistics about disk cache usage.  For debugging only.
 
 ################################################################################
 # Techo DEcho arguments

==== //depot/projects/trustedbsd/priv6/src/sys/boot/common/loader.8#3 (text+ko) ====

@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.82.2.4 2006/10/01 12:07:06 ru Exp $
+.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.82.2.5 2006/10/16 12:32:37 ru Exp $
 .\"
 .Dd August 18, 2006
 .Dt LOADER 8
@@ -159,7 +159,7 @@
 .Pp
 .It Ic bcachestat
 Displays statistics about disk cache usage.
-For depuration only.
+For debugging only.
 .Pp
 .It Ic boot
 .It Ic boot Ar kernelname Op Cm ...

==== //depot/projects/trustedbsd/priv6/src/sys/boot/common/merge_help.awk#2 (text+ko) ====

@@ -1,6 +1,6 @@
 #!/usr/bin/awk -f
 #
-# $FreeBSD: src/sys/boot/common/merge_help.awk,v 1.5 2001/11/07 17:53:25 fenner Exp $
+# $FreeBSD: src/sys/boot/common/merge_help.awk,v 1.5.14.1 2006/10/19 14:47:21 jhb Exp $
 #
 # Merge two boot loader help files for FreeBSD 3.0
 # Joe Abley <jabley at patho.gen.nz>
@@ -25,9 +25,12 @@
   match($0, " T[[:graph:]]+");
   T = substr($0, RSTART + 2, RLENGTH - 2);
   match($0, " S[[:graph:]]+");
+  SSTART = RSTART
   S = (RLENGTH == -1) ? "" : substr($0, RSTART + 2, RLENGTH - 2);
   match($0, " D[[:graph:]][[:print:]]*$");
   D = substr($0, RSTART + 2);
+  if (SSTART > RSTART)
+    S = "";
 
   # find a suitable place to store this one...
   ind++;

==== //depot/projects/trustedbsd/priv6/src/sys/boot/forth/support.4th#2 (text+ko) ====

@@ -22,7 +22,7 @@
 \ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 \ SUCH DAMAGE.
 \
-\ $FreeBSD: src/sys/boot/forth/support.4th,v 1.15 2002/05/24 02:28:58 gordon Exp $
+\ $FreeBSD: src/sys/boot/forth/support.4th,v 1.15.14.1 2006/10/16 12:32:38 ru Exp $
 
 \ Loader.rc support functions:
 \
@@ -1012,7 +1012,7 @@
   ." ^" cr
 ;
 
-\ Depuration support functions
+\ Debugging support functions
 
 only forth definitions also support-functions
 

==== //depot/projects/trustedbsd/priv6/src/sys/boot/i386/libi386/biossmap.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.3.2.1 2006/10/01 12:07:07 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.3.2.2 2006/10/19 14:47:21 jhb Exp $");
 
 /*
  * Obtain memory configuration information from the BIOS
@@ -95,6 +95,7 @@
 			break;
 	} while (v86.ebx != 0 && smaplen < n);
 }
+
 void
 bios_addsmapdata(struct preloaded_file *kfp)
 {
@@ -105,3 +106,18 @@
 	len = smaplen * sizeof(*smapbase);
 	file_addmetadata(kfp, MODINFOMD_SMAP, len, smapbase);
 }
+
+COMMAND_SET(smap, "smap", "show BIOS SMAP", command_smap);
+
+static int
+command_smap(int argc, char *argv[])
+{
+	int i;
+
+	if (smapbase == 0 || smaplen == 0)
+		return (CMD_ERROR);
+	for (i = 0; i < smaplen; i++)
+		printf("SMAP type=%02x base=%016llx len=%016llx\n",
+		    smapbase[i].type, smapbase[i].base, smapbase[i].length);
+	return (CMD_OK);
+}

==== //depot/projects/trustedbsd/priv6/src/sys/boot/i386/loader/help.i386#2 (text+ko) ====

@@ -54,3 +54,10 @@
 	forced by setting this variable.
 
 ################################################################################
+# Tsmap DDisplay BIOS SMAP table
+
+	smap
+
+	Displays the BIOS SMAP (system memory map) table.
+
+################################################################################

==== //depot/projects/trustedbsd/priv6/src/sys/cam/cam_periph.c#2 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.60.2.1 2006/02/26 22:38:39 iedowse Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.60.2.2 2006/10/09 21:44:23 mjacob Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,6 +86,14 @@
 
 MALLOC_DEFINE(M_CAMPERIPH, "CAM periph", "CAM peripheral buffers");
 
+static int periph_selto_delay = 1000;
+TUNABLE_INT("kern.cam.periph_selto_delay", &periph_selto_delay);
+static int periph_noresrc_delay = 500;
+TUNABLE_INT("kern.cam.periph_noresrc_delay", &periph_noresrc_delay);
+static int periph_busy_delay = 500;
+TUNABLE_INT("kern.cam.periph_busy_delay", &periph_busy_delay);
+
+
 void
 periphdriver_register(void *data)
 {
@@ -1534,7 +1542,7 @@
 	int	    error, printed = 0;
 	int         openings;
 	u_int32_t   relsim_flags;
-	u_int32_t   timeout;
+	u_int32_t   timeout = 0;
 	
 	action_string = NULL;
 	status = ccb->ccb_h.status;
@@ -1626,11 +1634,11 @@
 				}
 
 				/*
-				 * Wait a second to give the device
+				 * Wait a bit to give the device
 				 * time to recover before we try again.
 				 */
 				relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT;
-				timeout = 1000;
+				timeout = periph_selto_delay;
 				break;
 			}
 		}
@@ -1689,8 +1697,16 @@
 		}
 		break;
 	case CAM_RESRC_UNAVAIL:
+		/* Wait a bit for the resource shortage to abate. */
+		timeout = periph_noresrc_delay;
+		/* FALLTHROUGH */
 	case CAM_BUSY:
-		/* timeout??? */
+		if (timeout == 0) {
+			/* Wait a bit for the busy condition to abate. */
+			timeout = periph_busy_delay;
+		}
+		relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT;
+		/* FALLTHROUGH */
 	default:
 		/* decrement the number of retries */
 		if (ccb->ccb_h.retry_count > 0) {

==== //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_proto.h#3 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.38.2.7 2006/09/21 14:06:49 rwatson Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.7 2006/09/21 14:06:19 rwatson Exp 
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.38.2.9 2006/10/10 13:22:05 rwatson Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.8 2006/10/10 13:20:49 rwatson Exp 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

==== //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_syscall.h#3 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.38.2.7 2006/09/21 14:06:49 rwatson Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.7 2006/09/21 14:06:19 rwatson Exp 
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.38.2.9 2006/10/10 13:22:05 rwatson Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.8 2006/10/10 13:20:49 rwatson Exp 
  */
 
 #define	FREEBSD32_SYS_syscall	0

==== //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_syscalls.c#3 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.29.2.7 2006/09/21 14:06:49 rwatson Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.7 2006/09/21 14:06:19 rwatson Exp 
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.29.2.9 2006/10/10 13:22:05 rwatson Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.8 2006/10/10 13:20:49 rwatson Exp 
  */
 
 const char *freebsd32_syscallnames[] = {

==== //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/freebsd32_sysent.c#3 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.39.2.7 2006/09/21 14:06:49 rwatson Exp $
- * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.7 2006/09/21 14:06:19 rwatson Exp 
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.39.2.9 2006/10/10 13:22:05 rwatson Exp $
+ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.8 2006/10/10 13:20:49 rwatson Exp 
  */
 
 #include "opt_compat.h"

==== //depot/projects/trustedbsd/priv6/src/sys/compat/freebsd32/syscalls.master#3 (text+ko) ====

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.7 2006/09/21 14:06:19 rwatson Exp $
+ $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.8 2006/10/10 13:20:49 rwatson Exp $
 ;	from: @(#)syscalls.master	8.2 (Berkeley) 1/13/94
 ;	from: src/sys/kern/syscalls.master 1.107
 ;
@@ -144,7 +144,7 @@
 61	AUE_CHROOT	MNOPROTO	{ int chroot(char *path); }
 62	AUE_FSTAT	OBSOL	ofstat
 63	AUE_NULL	OBSOL	ogetkerninfo
-64	AUE_GETPAGESIZE	OBSOL	ogetpagesize
+64	AUE_NULL	OBSOL	ogetpagesize
 ; XXX implement (not OBSOL at all)
 65	AUE_MSYNC	MNOPROTO { int msync(void *addr, size_t len, \
 				    int flags); }

==== //depot/projects/trustedbsd/priv6/src/sys/conf/NOTES#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1325.2.21 2006/09/02 13:12:08 rwatson Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1325.2.23 2006/10/15 18:24:30 kris Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -169,7 +169,8 @@
 #
 # SCHED_ULE is a new scheduler that has been designed for SMP and has some
 # advantages for UP as well.  It is intended to replace the 4BSD scheduler
-# over time.
+# over time.  NOTE: SCHED_ULE is currently considered experimental and is
+# not recommended for production use at this time.
 #
 options 	SCHED_4BSD
 #options 	SCHED_ULE
@@ -342,16 +343,18 @@
 options 	KTRACE_REQUEST_POOL=101
 
 #
-# KTR is a kernel tracing mechanism imported from BSD/OS.  Currently it
-# has no userland interface aside from a few sysctl's.  It is enabled with
-# the KTR option.  KTR_ENTRIES defines the number of entries in the circular
-# trace buffer.  KTR_COMPILE defines the mask of events to compile into the
-# kernel as defined by the KTR_* constants in <sys/ktr.h>.  KTR_MASK defines the
-# initial value of the ktr_mask variable which determines at runtime what
-# events to trace.  KTR_CPUMASK determines which CPU's log events, with
-# bit X corresponding to cpu X.  KTR_VERBOSE enables dumping of KTR events
-# to the console by default.  This functionality can be toggled via the
-# debug.ktr_verbose sysctl and defaults to off if KTR_VERBOSE is not defined.
+# KTR is a kernel tracing mechanism imported from BSD/OS.  Currently
+# it has no userland interface aside from a few sysctl's.  It is
+# enabled with the KTR option.  KTR_ENTRIES defines the number of
+# entries in the circular trace buffer; it must be a power of two.
+# KTR_COMPILE defines the mask of events to compile into the kernel as
+# defined by the KTR_* constants in <sys/ktr.h>.  KTR_MASK defines the
+# initial value of the ktr_mask variable which determines at runtime
+# what events to trace.  KTR_CPUMASK determines which CPU's log
+# events, with bit X corresponding to cpu X.  KTR_VERBOSE enables
+# dumping of KTR events to the console by default.  This functionality
+# can be toggled via the debug.ktr_verbose sysctl and defaults to off
+# if KTR_VERBOSE is not defined.
 #
 options 	KTR
 options 	KTR_ENTRIES=1024

==== //depot/projects/trustedbsd/priv6/src/sys/conf/files#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1031.2.41 2006/09/04 15:39:10 pjd Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1031.2.44 2006/10/16 05:36:19 delphij Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -246,7 +246,6 @@
 contrib/dev/acpica/utmisc.c	optional acpi
 contrib/dev/acpica/utobject.c	optional acpi
 contrib/dev/acpica/utxface.c	optional acpi
-contrib/dev/ath/freebsd/ah_osdep.c optional ath_hal
 contrib/ipfilter/netinet/fil.c	optional ipfilter inet
 contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet
 contrib/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet
@@ -433,15 +432,23 @@
 dev/ata/ata-pci.c		optional ata pci
 dev/ata/ata-queue.c		optional ata
 dev/ata/ata-raid.c		optional ataraid
+dev/ata/ata-usb.c		optional atausb
 dev/ata/atapi-cam.c		optional atapicam
 dev/ata/atapi-cd.c		optional atapicd
 dev/ata/atapi-fd.c		optional atapifd
 dev/ata/atapi-tape.c		optional atapist
-dev/ath/ath_rate/amrr/amrr.c 	optional ath_rate_amrr
-dev/ath/ath_rate/onoe/onoe.c 	optional ath_rate_onoe
-dev/ath/ath_rate/sample/sample.c 	optional ath_rate_sample
-dev/ath/if_ath.c		optional ath
-dev/ath/if_ath_pci.c		optional ath pci
+dev/ath/ah_osdep.c optional ath_hal \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_rate/amrr/amrr.c	optional ath_rate_amrr \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_rate/onoe/onoe.c	optional ath_rate_onoe \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_rate/sample/sample.c	optional ath_rate_sample \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/if_ath.c		optional ath \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/if_ath_pci.c		optional ath pci \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/awi/am79c930.c		optional awi
 dev/awi/awi.c			optional awi
 dev/awi/if_awi_pccard.c		optional awi pccard

==== //depot/projects/trustedbsd/priv6/src/sys/conf/kern.pre.mk#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.65.2.2 2005/11/07 09:55:47 obrien Exp $
+# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.65.2.3 2006/10/16 01:26:13 sam Exp $
 
 # Part of a unified Makefile for building kernels.  This part contains all
 # of the definitions that need to be before %BEFORE_DEPEND.
@@ -59,7 +59,7 @@
 INCLUDES+= -I$S/contrib/pf
 
 # ... and the same for Atheros HAL
-INCLUDES+= -I$S/contrib/dev/ath -I$S/contrib/dev/ath/freebsd
+INCLUDES+= -I$S/dev/ath
 
 # ... and the same for the NgATM stuff
 INCLUDES+= -I$S/contrib/ngatm

==== //depot/projects/trustedbsd/priv6/src/sys/ddb/db_main.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_main.c,v 1.4 2005/01/06 01:34:41 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_main.c,v 1.4.2.1 2006/10/16 09:00:30 bde Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -198,6 +198,7 @@
 	if (cnunavailable())
 		return (0);
 
+	cndbctl(TRUE);
 	bkpt = IS_BREAKPOINT_TRAP(type, code);
 	watchpt = IS_WATCHPOINT_TRAP(type, code);
 
@@ -224,5 +225,6 @@
 
 	db_restart_at_pc(watchpt);
 
+	cndbctl(FALSE);
 	return (1);
 }

==== //depot/projects/trustedbsd/priv6/src/sys/dev/acpica/Osd/OsdHardware.c#2 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdHardware.c,v 1.15.2.3 2006/05/11 17:41:00 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdHardware.c,v 1.15.2.4 2006/10/09 12:44:53 hrs Exp $");
 
 #include <contrib/dev/acpica/acpi.h>
 
@@ -126,7 +126,9 @@
 
     error = acpi_os_check_port(InPort, Width);
     if (error != 0) {
-	printf("acpi: bad read from port 0x%03x (%d)\n", (int)InPort, Width);
+	if (bootverbose)
+		printf("acpi: bad read from port 0x%03x (%d)\n",
+			(int)InPort, Width);
 	if (error == -1)
 	    return (AE_BAD_PARAMETER);
     }
@@ -159,8 +161,9 @@
 
     error = acpi_os_check_port(OutPort, Width);
     if (error != 0) {
-	printf("acpi: bad write to port 0x%03x (%d), val %#x\n", (int)OutPort,
-	    Width, Value);
+	if (bootverbose)
+		printf("acpi: bad write to port 0x%03x (%d), val %#x\n",
+			(int)OutPort, Width, Value);
 	if (error == -1)
 	    return (AE_BAD_PARAMETER);
     }

==== //depot/projects/trustedbsd/priv6/src/sys/dev/acpica/acpi.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.214.2.7 2006/09/19 19:08:52 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.214.2.8 2006/10/04 19:08:23 jhb Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -1083,7 +1083,7 @@
      * If we know about this address, deactivate it and release it to the
      * local pool.  If we don't, pass this request up to the parent.
      */
-    if (acpi_sysres_find(bus, type, rman_get_start(r)) == NULL) {
+    if (acpi_sysres_find(bus, type, rman_get_start(r)) != NULL) {
 	if (rman_get_flags(r) & RF_ACTIVE) {
 	    ret = bus_deactivate_resource(child, type, rid, r);
 	    if (ret != 0)

==== //depot/projects/trustedbsd/priv6/src/sys/dev/ata/ata-chipset.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.126.2.14 2006/09/30 14:51:49 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.126.2.15 2006/10/09 16:01:35 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -950,6 +950,7 @@
     struct ata_chip_id *idx;
     static struct ata_chip_id ids[] =
     {{ ATA_ALI_5289, 0x00, 2, ALISATA, ATA_SA150, "M5289" },
+     { ATA_ALI_5288, 0x00, 4, ALISATA, ATA_SA300, "M5288" },
      { ATA_ALI_5287, 0x00, 4, ALISATA, ATA_SA150, "M5287" },
      { ATA_ALI_5281, 0x00, 2, ALISATA, ATA_SA150, "M5281" },
      { ATA_ALI_5229, 0xc5, 0, ALINEW,  ATA_UDMA6, "M5229" },

==== //depot/projects/trustedbsd/priv6/src/sys/dev/ath/if_ath.c#3 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.94.2.27 2006/09/30 21:25:11 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.94.2.28 2006/10/16 01:01:41 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -254,7 +254,7 @@
 } while (0)
 #define	KEYPRINTF(sc, ix, hk, mac) do {				\
 	if (sc->sc_debug & ATH_DEBUG_KEYCACHE)			\
-		ath_keyprint(__func__, ix, hk, mac);		\
+		ath_keyprint(sc, __func__, ix, hk, mac);	\
 } while (0)
 static	void ath_printrxbuf(struct ath_buf *bf, u_int ix, int);
 static	void ath_printtxbuf(struct ath_buf *bf, u_int qnum, u_int ix, int done);
@@ -342,18 +342,6 @@
 	 */
 	for (i = 0; i < sc->sc_keymax; i++)
 		ath_hal_keyreset(ah, i);
-	/*
-	 * Mark key cache slots associated with global keys
-	 * as in use.  If we knew TKIP was not to be used we
-	 * could leave the +32, +64, and +32+64 slots free.
-	 * XXX only for splitmic.
-	 */
-	for (i = 0; i < IEEE80211_WEP_NKID; i++) {
-		setbit(sc->sc_keymap, i);
-		setbit(sc->sc_keymap, i+32);
-		setbit(sc->sc_keymap, i+64);
-		setbit(sc->sc_keymap, i+32+64);
-	}
 
 	/*
 	 * Collect the channel list using the default country
@@ -541,12 +529,30 @@
 		 */
 		if (ath_hal_ciphersupported(ah, HAL_CIPHER_MIC))
 			ic->ic_caps |= IEEE80211_C_TKIPMIC;
-		if (ath_hal_tkipsplit(ah))
+		/*
+		 * If the h/w supports storing tx+rx MIC keys
+		 * in one cache slot automatically enable use.
+		 */
+		if (ath_hal_hastkipsplit(ah) ||
+		    !ath_hal_settkipsplit(ah, AH_FALSE))
 			sc->sc_splitmic = 1;
 	}
 	sc->sc_hasclrkey = ath_hal_ciphersupported(ah, HAL_CIPHER_CLR);
 	sc->sc_mcastkey = ath_hal_getmcastkeysearch(ah);
 	/*
+	 * Mark key cache slots associated with global keys
+	 * as in use.  If we knew TKIP was not to be used we
+	 * could leave the +32, +64, and +32+64 slots free.
+	 */
+	for (i = 0; i < IEEE80211_WEP_NKID; i++) {
+		setbit(sc->sc_keymap, i);
+		setbit(sc->sc_keymap, i+64);
+		if (sc->sc_splitmic) {
+			setbit(sc->sc_keymap, i+32);
+			setbit(sc->sc_keymap, i+32+64);
+		}
+	}
+	/*
 	 * TPC support can be done either with a global cap or
 	 * per-packet support.  The latter is not available on
 	 * all parts.  We're a bit pedantic here as all parts
@@ -1300,7 +1306,7 @@
 
 #ifdef ATH_DEBUG
 static void
-ath_keyprint(const char *tag, u_int ix,
+ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix,
 	const HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN])
 {
 	static const char *ciphers[] = {
@@ -1318,9 +1324,16 @@
 		printf("%02x", hk->kv_val[i]);
 	printf(" mac %s", ether_sprintf(mac));
 	if (hk->kv_type == HAL_CIPHER_TKIP) {
-		printf(" mic ");
+		printf(" %s ", sc->sc_splitmic ? "mic" : "rxmic");
 		for (i = 0; i < sizeof(hk->kv_mic); i++)
 			printf("%02x", hk->kv_mic[i]);
+#if HAL_ABI_VERSION > 0x06052200
+		if (!sc->sc_splitmic) {
+			printf(" txmic ");
+			for (i = 0; i < sizeof(hk->kv_txmic); i++)
+				printf("%02x", hk->kv_txmic[i]);
+		}
+#endif
 	}
 	printf("\n");
 }
@@ -1341,21 +1354,34 @@
 
 	KASSERT(k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP,
 		("got a non-TKIP key, cipher %u", k->wk_cipher->ic_cipher));
-	KASSERT(sc->sc_splitmic, ("key cache !split"));
 	if ((k->wk_flags & IEEE80211_KEY_XR) == IEEE80211_KEY_XR) {
-		/*
-		 * TX key goes at first index, RX key at the rx index.
-		 * The hal handles the MIC keys at index+64.
-		 */
-		memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic));
-		KEYPRINTF(sc, k->wk_keyix, hk, zerobssid);
-		if (!ath_hal_keyset(ah, k->wk_keyix, hk, zerobssid))
-			return 0;
+		if (sc->sc_splitmic) {
+			/*
+			 * TX key goes at first index, RX key at the rx index.
+			 * The hal handles the MIC keys at index+64.
+			 */
+			memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic));
+			KEYPRINTF(sc, k->wk_keyix, hk, zerobssid);
+			if (!ath_hal_keyset(ah, k->wk_keyix, hk, zerobssid))
+				return 0;
 
-		memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
-		KEYPRINTF(sc, k->wk_keyix+32, hk, mac);
-		/* XXX delete tx key on failure? */
-		return ath_hal_keyset(ah, k->wk_keyix+32, hk, mac);
+			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
+			KEYPRINTF(sc, k->wk_keyix+32, hk, mac);
+			/* XXX delete tx key on failure? */
+			return ath_hal_keyset(ah, k->wk_keyix+32, hk, mac);
+		} else {
+			/*
+			 * Room for both TX+RX MIC keys in one key cache
+			 * slot, just set key at the first index; the hal
+			 * will handle the reset.
+			 */
+			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
+#if HAL_ABI_VERSION > 0x06052200
+			memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
+#endif
+			KEYPRINTF(sc, k->wk_keyix, hk, mac);
+			return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
+		}
 	} else if (k->wk_flags & IEEE80211_KEY_XR) {
 		/*
 		 * TX/RX key goes at first index.
@@ -1424,8 +1450,7 @@
 		mac = mac0;
 
 	if (hk.kv_type == HAL_CIPHER_TKIP &&
-	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 &&
-	    sc->sc_splitmic) {
+	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) {
 		return ath_keyset_tkip(sc, k, &hk, mac);
 	} else {
 		KEYPRINTF(sc, k->wk_keyix, &hk, mac);
@@ -1490,6 +1515,54 @@
 }
 
 /*
+ * Allocate tx/rx key slots for TKIP.  We allocate two slots for
+ * each key, one for decrypt/encrypt and the other for the MIC.
+ */
+static u_int16_t
+key_alloc_pair(struct ath_softc *sc,
+	ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
+{
+#define	N(a)	(sizeof(a)/sizeof(a[0]))
+	u_int i, keyix;
+
+	KASSERT(!sc->sc_splitmic, ("key cache split"));
+	/* XXX could optimize */
+	for (i = 0; i < N(sc->sc_keymap)/4; i++) {
+		u_int8_t b = sc->sc_keymap[i];

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


More information about the trustedbsd-cvs mailing list