Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Dec 2008 05:02:17 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r185786 - in user/kmacy/head_arpv2/sys: amd64/amd64 arm/mv arm/mv/orion boot/common boot/forth boot/i386/boot0 boot/i386/btx/btxldr boot/zfs cddl/contrib/opensolaris/uts/common/sys comp...
Message-ID:  <200812090502.mB952HE5080680@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Tue Dec  9 05:02:17 2008
New Revision: 185786
URL: http://svn.freebsd.org/changeset/base/185786

Log:
  IFC 185596:185785

Added:
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_if.m
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbusvar.h
Deleted:
  user/kmacy/head_arpv2/sys/i386/include/xen/xenbus.h
Modified:
  user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c
  user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c
  user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c
  user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx
  user/kmacy/head_arpv2/sys/boot/common/loader.8
  user/kmacy/head_arpv2/sys/boot/forth/support.4th
  user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S
  user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S
  user/kmacy/head_arpv2/sys/boot/zfs/Makefile
  user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
  user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c
  user/kmacy/head_arpv2/sys/conf/files
  user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c
  user/kmacy/head_arpv2/sys/dev/adb/adb.h
  user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c
  user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c
  user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c
  user/kmacy/head_arpv2/sys/dev/adb/adbvar.h
  user/kmacy/head_arpv2/sys/dev/ae/if_ae.c
  user/kmacy/head_arpv2/sys/dev/ath/if_ath.c
  user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h
  user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c
  user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c
  user/kmacy/head_arpv2/sys/dev/cxgb/cxgb_main.c
  user/kmacy/head_arpv2/sys/dev/dc/if_dc.c
  user/kmacy/head_arpv2/sys/dev/dc/if_dcreg.h
  user/kmacy/head_arpv2/sys/dev/e1000/if_em.c
  user/kmacy/head_arpv2/sys/dev/fxp/if_fxp.c
  user/kmacy/head_arpv2/sys/dev/jme/if_jmereg.h
  user/kmacy/head_arpv2/sys/dev/jme/if_jmevar.h
  user/kmacy/head_arpv2/sys/dev/mmc/mmc.c
  user/kmacy/head_arpv2/sys/dev/mmc/mmcsd.c
  user/kmacy/head_arpv2/sys/dev/pccbb/pccbb.c
  user/kmacy/head_arpv2/sys/dev/pccbb/pccbb_pci.c
  user/kmacy/head_arpv2/sys/dev/pccbb/pccbbvar.h
  user/kmacy/head_arpv2/sys/dev/re/if_re.c
  user/kmacy/head_arpv2/sys/dev/sdhci/sdhci.c
  user/kmacy/head_arpv2/sys/dev/sis/if_sis.c
  user/kmacy/head_arpv2/sys/dev/sis/if_sisreg.h
  user/kmacy/head_arpv2/sys/dev/usb/if_ural.c
  user/kmacy/head_arpv2/sys/dev/xen/blkfront/blkfront.c
  user/kmacy/head_arpv2/sys/dev/xen/blkfront/block.h
  user/kmacy/head_arpv2/sys/dev/xen/netfront/netfront.c
  user/kmacy/head_arpv2/sys/fs/procfs/procfs_map.c
  user/kmacy/head_arpv2/sys/geom/geom_subr.c
  user/kmacy/head_arpv2/sys/geom/journal/g_journal.c
  user/kmacy/head_arpv2/sys/geom/journal/g_journal.h
  user/kmacy/head_arpv2/sys/i386/include/atomic.h
  user/kmacy/head_arpv2/sys/i386/xen/xen_machdep.c
  user/kmacy/head_arpv2/sys/kern/kern_exec.c
  user/kmacy/head_arpv2/sys/kern/kern_exit.c
  user/kmacy/head_arpv2/sys/kern/kern_fork.c
  user/kmacy/head_arpv2/sys/kern/kern_linker.c
  user/kmacy/head_arpv2/sys/kern/kern_module.c
  user/kmacy/head_arpv2/sys/kern/kern_proc.c
  user/kmacy/head_arpv2/sys/kern/kern_rwlock.c
  user/kmacy/head_arpv2/sys/kern/subr_param.c
  user/kmacy/head_arpv2/sys/kern/subr_witness.c
  user/kmacy/head_arpv2/sys/kern/vfs_export.c
  user/kmacy/head_arpv2/sys/libkern/iconv.c
  user/kmacy/head_arpv2/sys/net/radix.c
  user/kmacy/head_arpv2/sys/net/radix.h
  user/kmacy/head_arpv2/sys/net/route.c
  user/kmacy/head_arpv2/sys/net/route.h
  user/kmacy/head_arpv2/sys/net/rtsock.c
  user/kmacy/head_arpv2/sys/netgraph/ng_mppc.c
  user/kmacy/head_arpv2/sys/netinet/if_ether.c
  user/kmacy/head_arpv2/sys/netinet/in_pcb.c
  user/kmacy/head_arpv2/sys/netinet/in_pcb.h
  user/kmacy/head_arpv2/sys/netinet/ip_carp.c
  user/kmacy/head_arpv2/sys/netinet/sctp.h
  user/kmacy/head_arpv2/sys/netinet/sctp_asconf.c
  user/kmacy/head_arpv2/sys/netinet/sctp_asconf.h
  user/kmacy/head_arpv2/sys/netinet/sctp_auth.c
  user/kmacy/head_arpv2/sys/netinet/sctp_auth.h
  user/kmacy/head_arpv2/sys/netinet/sctp_constants.h
  user/kmacy/head_arpv2/sys/netinet/sctp_header.h
  user/kmacy/head_arpv2/sys/netinet/sctp_indata.c
  user/kmacy/head_arpv2/sys/netinet/sctp_indata.h
  user/kmacy/head_arpv2/sys/netinet/sctp_input.c
  user/kmacy/head_arpv2/sys/netinet/sctp_os_bsd.h
  user/kmacy/head_arpv2/sys/netinet/sctp_output.c
  user/kmacy/head_arpv2/sys/netinet/sctp_output.h
  user/kmacy/head_arpv2/sys/netinet/sctp_pcb.c
  user/kmacy/head_arpv2/sys/netinet/sctp_pcb.h
  user/kmacy/head_arpv2/sys/netinet/sctp_structs.h
  user/kmacy/head_arpv2/sys/netinet/sctp_sysctl.c
  user/kmacy/head_arpv2/sys/netinet/sctp_sysctl.h
  user/kmacy/head_arpv2/sys/netinet/sctp_timer.c
  user/kmacy/head_arpv2/sys/netinet/sctp_uio.h
  user/kmacy/head_arpv2/sys/netinet/sctp_usrreq.c
  user/kmacy/head_arpv2/sys/netinet/sctp_var.h
  user/kmacy/head_arpv2/sys/netinet/sctputil.c
  user/kmacy/head_arpv2/sys/netinet/sctputil.h
  user/kmacy/head_arpv2/sys/netinet/tcp_input.c
  user/kmacy/head_arpv2/sys/netinet6/in6_rmx.c
  user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c
  user/kmacy/head_arpv2/sys/netinet6/sctp6_usrreq.c
  user/kmacy/head_arpv2/sys/pci/if_rlreg.h
  user/kmacy/head_arpv2/sys/powerpc/conf/NOTES
  user/kmacy/head_arpv2/sys/powerpc/powermac/cuda.c
  user/kmacy/head_arpv2/sys/powerpc/powermac/cudavar.h
  user/kmacy/head_arpv2/sys/powerpc/powermac/macgpio.c
  user/kmacy/head_arpv2/sys/powerpc/powermac/macgpiovar.h
  user/kmacy/head_arpv2/sys/powerpc/powermac/pmu.c
  user/kmacy/head_arpv2/sys/powerpc/powermac/pmuvar.h
  user/kmacy/head_arpv2/sys/sys/module.h
  user/kmacy/head_arpv2/sys/sys/proc.h
  user/kmacy/head_arpv2/sys/sys/rwlock.h
  user/kmacy/head_arpv2/sys/ufs/ufs/ufs_quota.c
  user/kmacy/head_arpv2/sys/xen/gnttab.c
  user/kmacy/head_arpv2/sys/xen/gnttab.h
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_client.c
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_comms.c
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_comms.h
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_dev.c
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_probe.c
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_probe_backend.c
  user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_xs.c

Modified: user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c
==============================================================================
--- user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -27,6 +27,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_compat.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kdb.h>
@@ -318,6 +320,10 @@ db_nextframe(struct amd64_frame **fp, db
 			frame_type = INTERRUPT;
 		else if (strcmp(name, "Xfast_syscall") == 0)
 			frame_type = SYSCALL;
+#ifdef COMPAT_IA32
+		else if (strcmp(name, "Xint0x80_syscall") == 0)
+			frame_type = SYSCALL;
+#endif
 		/* XXX: These are interrupts with trap frames. */
 		else if (strcmp(name, "Xtimerint") == 0 ||
 		    strcmp(name, "Xcpustop") == 0 ||

Modified: user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c
==============================================================================
--- user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -180,7 +180,7 @@ pt_entry_t pg_nx;
 
 SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
 
-static int pg_ps_enabled;
+static int pg_ps_enabled = 1;
 SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0,
     "Are large page mappings enabled?");
 

Modified: user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c
==============================================================================
--- user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -598,6 +598,10 @@ pcib_mbus_init_bridge(struct pcib_mbus_s
 	mem_limit = mem_base + sc->sc_info->op_mem_size - 1;
 
 	/* Configure I/O decode registers */
+	pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOBASEL_1,
+	    io_base >> 8, 1);
+	pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOBASEH_1,
+	    io_base >> 16, 2);
 	pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOLIMITL_1,
 	    io_limit >> 8, 1);
 	pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOLIMITH_1,

Modified: user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx
==============================================================================
--- user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx	Tue Dec  9 05:02:17 2008	(r185786)
@@ -3,11 +3,11 @@
 include	"../mv/std.mv"
 files	"../mv/orion/files.db88f5xxx"
 
-makeoptions	KERNPHYSADDR=0x00400000
-makeoptions	KERNVIRTADDR=0xc0400000
+makeoptions	KERNPHYSADDR=0x00900000
+makeoptions	KERNVIRTADDR=0xc0900000
 
-options		KERNPHYSADDR=0x00400000
-options		KERNVIRTADDR=0xc0400000
+options		KERNPHYSADDR=0x00900000
+options		KERNVIRTADDR=0xc0900000
 options		PHYSADDR=0x00000000
 options		PHYSMEM_SIZE=0x08000000
 options		STARTUP_PAGETABLE_ADDR=0x00100000

Modified: user/kmacy/head_arpv2/sys/boot/common/loader.8
==============================================================================
--- user/kmacy/head_arpv2/sys/boot/common/loader.8	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/boot/common/loader.8	Tue Dec  9 05:02:17 2008	(r185786)
@@ -454,7 +454,7 @@ if the script terminates with a non-zero
 or if a SIGTERM is delivered to the
 .Xr init 8
 process (PID 1).
-.It Va init_script
+.It Va init_shell
 Defines the shell binary to be used for executing the various shell scripts.
 The default is
 .Dq Li /bin/sh .

Modified: user/kmacy/head_arpv2/sys/boot/forth/support.4th
==============================================================================
--- user/kmacy/head_arpv2/sys/boot/forth/support.4th	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/boot/forth/support.4th	Tue Dec  9 05:02:17 2008	(r185786)
@@ -288,6 +288,17 @@ only forth also support-functions defini
 
 : free-memory free if free_error throw then ;
 
+: strget { var -- addr len } var .addr @ var .len @ ;
+
+\ assign addr len to variable.
+: strset  { addr len var -- } addr var .addr ! len var .len ! ;
+
+\ free memory and reset fields
+: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ;
+
+\ free old content, make a copy of the string and assign to variable
+: string= { addr len var -- } var strfree addr len strdup var strset ;
+
 \ Assignment data temporary storage
 
 string name_buffer
@@ -712,19 +723,6 @@ only forth also support-functions also f
   module_loaderror_suffix suffix_type?
 ;
 
-: set_conf_files
-  conf_files .addr @ ?dup if
-    free-memory
-  then
-  value_buffer .addr @ c@ [char] " = if
-    value_buffer .addr @ char+ value_buffer .len @ 2 chars -
-  else
-    value_buffer .addr @ value_buffer .len @
-  then
-  strdup
-  conf_files .len ! conf_files .addr !
-;
-
 : set_nextboot_conf
   nextboot_conf_file .addr @ ?dup if
     free-memory
@@ -888,6 +886,11 @@ only forth also support-functions also f
   then
 ;
 
+: set_conf_files
+  set_environment_variable
+  s" loader_conf_files" getenv conf_files string=
+;
+
 : set_nextboot_flag
   yes_value? to nextboot?
 ;
@@ -1045,7 +1048,6 @@ only forth also support-functions defini
 \ Variables used for processing multiple conf files
 
 string current_file_name
-variable current_conf_files
 
 \ Indicates if any conf file was succesfully read
 
@@ -1053,16 +1055,8 @@ variable current_conf_files
 
 \ loader_conf_files processing support functions
 
-: set_current_conf_files
-  conf_files .addr @ current_conf_files !
-;
-
-: get_conf_files
-  conf_files .addr @ conf_files .len @ strdup
-;
-
-: recurse_on_conf_files?
-  current_conf_files @ conf_files .addr @ <>
+: get_conf_files ( -- addr len )  \ put addr/len on stack, reset var
+  conf_files strget 0 0 conf_files strset
 ;
 
 : skip_leading_spaces  { addr len pos -- addr len pos' }
@@ -1133,7 +1127,6 @@ variable current_conf_files
 \ Interface to loader_conf_files processing
 
 : include_conf_files
-  set_current_conf_files
   get_conf_files 0
   begin
     get_next_file ?dup
@@ -1141,7 +1134,7 @@ variable current_conf_files
     set_current_file_name
     ['] load_conf catch
     process_conf_errors
-    recurse_on_conf_files? if recurse then
+    conf_files .addr @ if recurse then
   repeat
 ;
 

Modified: user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S
==============================================================================
--- user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S	Tue Dec  9 05:02:17 2008	(r185786)
@@ -93,7 +93,7 @@
  *	%si	pointer to the partition table from which we were loaded.
  *		Some boot code (e.g. syslinux) use this info to relocate
  *		themselves, so we want to pass a valid one to the next stage.
- *		NOTE: the use of %is is not a standard.
+ *		NOTE: the use of %si is not a standard.
  *
  * This boot block first relocates itself at a different address (0:0x600),
  * to free the space at 0:0x7c00 for the next stage boot block.

Modified: user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S
==============================================================================
--- user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S	Tue Dec  9 05:02:17 2008	(r185786)
@@ -15,6 +15,9 @@
  * $FreeBSD$
  */
 
+#define	RBX_MUTE	0x10	/* -m */
+#define	OPT_SET(opt)	(1 << (opt))
+
 /*
  * Prototype BTX loader program, written in a couple of hours.  The
  * real thing should probably be more flexible, and in C.
@@ -64,6 +67,8 @@
  * BTX program loader for ELF clients.
  */
 start:		cld				# String ops inc
+		testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument
+		setnz muted			#  for RBX_MUTE, set flag
 		movl $m_logo,%esi		# Identify
 		call putstr			#  ourselves
 		movzwl BDA_MEM,%eax		# Get base memory
@@ -288,7 +293,9 @@ putstr: 	lodsb				# Load char
 /*
  * Output character AL to the console.
  */
-putchr: 	pusha				# Save
+putchr:		testb $1,muted			# Check muted
+		jnz putchr.5			#  do a nop
+		pusha				# Save
 		xorl %ecx,%ecx			# Zero for loops
 		movb $SCR_MAT,%ah		# Mode/attribute
 		movl $BDA_POS,%ebx		# BDA pointer
@@ -325,7 +332,7 @@ putchr.3:	cmpb $SCR_ROW,%dh		# Beyond sc
 		movb $SCR_ROW-1,%dh		# Bottom line
 putchr.4:	movw %dx,(%ebx) 		# Update position
 		popa				# Restore
-		ret				# To caller
+putchr.5:	ret				# To caller
 /*
  * Convert EAX, AX, or AL to hex, saving the result to [EDI].
  */
@@ -390,6 +397,12 @@ m_segs: 	.asciz "text segment: offset="
 		.asciz " memsz=\0\n"
 m_done: 	.asciz "Loading complete\n"
 #endif
+
+/*
+ * Flags
+ */
+muted:		.byte 0x0
+
 /*
  * Uninitialized data area.
  */

Modified: user/kmacy/head_arpv2/sys/boot/zfs/Makefile
==============================================================================
--- user/kmacy/head_arpv2/sys/boot/zfs/Makefile	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/boot/zfs/Makefile	Tue Dec  9 05:02:17 2008	(r185786)
@@ -29,7 +29,7 @@ CFLAGS+=	-Wformat -Wall
 .if ${MACHINE_ARCH} == "amd64"
 CLEANFILES+=    machine
 machine:
-	ln -sf ${.CURDIR}/../../../i386/include machine
+	ln -sf ${.CURDIR}/../../i386/include machine
 .endif
 
 .include <bsd.lib.mk>

Modified: user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
==============================================================================
--- user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h	Tue Dec  9 05:02:17 2008	(r185786)
@@ -387,6 +387,49 @@ extern "C" {
 #define	_DONT_USE_1275_GENERIC_NAMES
 #define	_HAVE_CPUID_INSN
 
+#elif defined(__mips__)
+
+/*
+ * Define the appropriate "processor characteristics"
+ */
+#define	_STACK_GROWS_DOWNWARD
+#define	_LONG_LONG_LTOH
+#define	_BIT_FIELDS_LTOH
+#define	_IEEE_754
+#define	_CHAR_IS_SIGNED
+#define	_BOOL_ALIGNMENT			1
+#define	_CHAR_ALIGNMENT			1
+#define	_SHORT_ALIGNMENT		2
+#define	_INT_ALIGNMENT			4
+#define	_FLOAT_ALIGNMENT		4
+#define	_FLOAT_COMPLEX_ALIGNMENT	4
+#define	_LONG_ALIGNMENT			4
+#define	_LONG_LONG_ALIGNMENT		4
+#define	_DOUBLE_ALIGNMENT		4
+#define	_DOUBLE_COMPLEX_ALIGNMENT	4
+#define	_LONG_DOUBLE_ALIGNMENT		4
+#define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
+#define	_POINTER_ALIGNMENT		4
+#define	_MAX_ALIGNMENT			4
+#define	_ALIGNMENT_REQUIRED		0
+
+#define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
+
+/*
+ * Define the appropriate "implementation choices".
+ */
+#define	_ILP32
+#if !defined(_I32LPx) && defined(_KERNEL)
+#define	_I32LPx
+#endif
+#define	_SUNOS_VTOC_16
+#define	_DMA_USES_PHYSADDR
+#define	_FIRMWARE_NEEDS_FDISK
+#define	_PSM_MODULES
+#define	_RTC_CONFIG
+#define	_DONT_USE_1275_GENERIC_NAMES
+#define	_HAVE_CPUID_INSN
+
 #elif defined(__powerpc__)
 
 /*

Modified: user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -273,8 +273,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
 		/* XXX per-cpu vendor / class / model / id? */
 	}
 
-	sbuf_cat(sb,
-	    "flags\t\t:");
+	sbuf_cat(sb, "flags\t\t:");
 
 	if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) {
 		flags[16] = "fcmov";
@@ -876,10 +875,12 @@ static int
 linprocfs_doprocmaps(PFS_FILL_ARGS)
 {
 	vm_map_t map = &p->p_vmspace->vm_map;
-	vm_map_entry_t entry;
+	vm_map_entry_t entry, tmp_entry;
 	vm_object_t obj, tobj, lobj;
-	vm_offset_t saved_end;
+	vm_offset_t e_start, e_end;
 	vm_ooffset_t off = 0;
+	vm_prot_t e_prot;
+	unsigned int last_timestamp;
 	char *name = "", *freename = NULL;
 	ino_t ino;
 	int ref_count, shadow_count, flags;
@@ -905,7 +906,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
 		freename = NULL;
 		if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)
 			continue;
-		saved_end = entry->end;
+		e_prot = entry->protection;
+		e_start = entry->start;
+		e_end = entry->end;
 		obj = entry->object.vm_object;
 		for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) {
 			VM_OBJECT_LOCK(tobj);
@@ -913,6 +916,8 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
 				VM_OBJECT_UNLOCK(lobj);
 			lobj = tobj;
 		}
+		last_timestamp = map->timestamp;
+		vm_map_unlock_read(map);
 		ino = 0;
 		if (lobj) {
 			off = IDX_TO_OFF(lobj->size);
@@ -950,10 +955,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
 		 */
 		error = sbuf_printf(sb,
 		    "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n",
-		    (u_long)entry->start, (u_long)entry->end,
-		    (entry->protection & VM_PROT_READ)?"r":"-",
-		    (entry->protection & VM_PROT_WRITE)?"w":"-",
-		    (entry->protection & VM_PROT_EXECUTE)?"x":"-",
+		    (u_long)e_start, (u_long)e_end,
+		    (e_prot & VM_PROT_READ)?"r":"-",
+		    (e_prot & VM_PROT_WRITE)?"w":"-",
+		    (e_prot & VM_PROT_EXECUTE)?"x":"-",
 		    "p",
 		    (u_long)off,
 		    0,
@@ -968,6 +973,16 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
 			error = 0;
 			break;
 		}
+		vm_map_lock_read(map);
+		if (last_timestamp + 1 != map->timestamp) {
+			/*
+			 * Look again for the entry because the map was
+			 * modified while it was unlocked.  Specifically,
+			 * the entry may have been clipped, merged, or deleted.
+			 */
+			vm_map_lookup_entry(map, e_end - 1, &tmp_entry);
+			entry = tmp_entry;
+		}
 	}
 	vm_map_unlock_read(map);
 

Modified: user/kmacy/head_arpv2/sys/conf/files
==============================================================================
--- user/kmacy/head_arpv2/sys/conf/files	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/conf/files	Tue Dec  9 05:02:17 2008	(r185786)
@@ -2764,10 +2764,14 @@ xen/evtchn/evtchn_dev.c                o
 xen/xenbus/xenbus_client.c     optional xen
 xen/xenbus/xenbus_comms.c      optional xen
 xen/xenbus/xenbus_dev.c                optional xen
+xen/xenbus/xenbus_if.m		optional xen
 xen/xenbus/xenbus_probe.c      optional xen
-xen/xenbus/xenbus_probe_backend.c      optional xen
+#xen/xenbus/xenbus_probe_backend.c      optional xen
 xen/xenbus/xenbus_xs.c         optional xen
 dev/xen/console/console.c      optional xen
 dev/xen/console/xencons_ring.c optional xen
 dev/xen/blkfront/blkfront.c    optional xen
 dev/xen/netfront/netfront.c    optional xen
+#dev/xen/xenpci/xenpci.c        optional xen
+#xen/xenbus/xenbus_newbus.c	optional xenhvm
+

Modified: user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c
==============================================================================
--- user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 #include <sys/mbuf.h>
 #include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/rwlock.h>
 #ifdef __FreeBSD__
 #include <sys/malloc.h>
 #endif

Modified: user/kmacy/head_arpv2/sys/dev/adb/adb.h
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/adb/adb.h	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/adb/adb.h	Tue Dec  9 05:02:17 2008	(r185786)
@@ -68,7 +68,7 @@ uint8_t adb_get_device_type(device_t dev
 uint8_t adb_get_device_handler(device_t dev);
 uint8_t adb_set_device_handler(device_t dev, uint8_t newhandler);
 
-uint8_t adb_read_register(device_t dev, u_char reg, size_t *len, void *data);
+size_t	adb_read_register(device_t dev, u_char reg, void *data);
 
 /* Bits for implementing ADB host bus adapters */
 extern devclass_t adb_devclass;

Modified: user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -48,7 +48,7 @@ static void adb_bus_enumerate(void *xdev
 static void adb_probe_nomatch(device_t dev, device_t child);
 static int adb_print_child(device_t dev, device_t child);
 
-static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data);
+static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data, u_char *reply);
 
 static char *adb_device_string[] = {
 	"HOST", "dongle", "keyboard", "mouse", "tablet", "modem", "RESERVED", "misc"
@@ -118,8 +118,7 @@ adb_bus_enumerate(void *xdev)
 
 	sc->packet_reply = 0;
 	sc->autopoll_mask = 0;
-
-	mtx_init(&sc->sc_sync_mtx,"adbsyn",NULL,MTX_DEF | MTX_RECURSE);
+	sc->sync_packet = 0xffff;
 
 	/* Initialize devinfo */
 	for (i = 0; i < 16; i++) {
@@ -128,7 +127,7 @@ adb_bus_enumerate(void *xdev)
 	}
 	
 	/* Reset ADB bus */
-	adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL);
+	adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL,NULL);
 	DELAY(1500);
 
 	/* Enumerate bus */
@@ -140,7 +139,7 @@ adb_bus_enumerate(void *xdev)
 
 	    do {
 		reply = adb_send_raw_packet_sync(dev,i,
-			    ADB_COMMAND_TALK,3,0,NULL);
+			    ADB_COMMAND_TALK,3,0,NULL,NULL);
 	
 		if (reply) {
 			/* If we got a response, relocate to next_free */
@@ -150,10 +149,10 @@ adb_bus_enumerate(void *xdev)
 			r3 |= 0x00fe;
 
 			adb_send_raw_packet_sync(dev,i, ADB_COMMAND_LISTEN,3,
-			    sizeof(uint16_t),(u_char *)(&r3));
+			    sizeof(uint16_t),(u_char *)(&r3),NULL);
 
 			adb_send_raw_packet_sync(dev,next_free,
-			    ADB_COMMAND_TALK,3,0,NULL);
+			    ADB_COMMAND_TALK,3,0,NULL,NULL);
 
 			sc->devinfo[next_free].default_address = i;
 			if (first_relocated < 0)
@@ -169,9 +168,9 @@ adb_bus_enumerate(void *xdev)
 			
 			adb_send_raw_packet_sync(dev,first_relocated,
 			    ADB_COMMAND_LISTEN,3,
-			    sizeof(uint16_t),(u_char *)(&r3));
+			    sizeof(uint16_t),(u_char *)(&r3),NULL);
 			adb_send_raw_packet_sync(dev,i,
-			    ADB_COMMAND_TALK,3,0,NULL);
+			    ADB_COMMAND_TALK,3,0,NULL,NULL);
 
 			sc->devinfo[i].default_address = i;
 			sc->devinfo[(int)(first_relocated)].default_address = 0;
@@ -194,10 +193,6 @@ adb_bus_enumerate(void *xdev)
 
 static int adb_bus_detach(device_t dev)
 {
-	struct adb_softc *sc = device_get_softc(dev);
-
-	mtx_destroy(&sc->sc_sync_mtx);
-
 	return (bus_generic_detach(dev));
 }
 	
@@ -230,6 +225,7 @@ adb_receive_raw_packet(device_t dev, u_c
 	if (sc->sync_packet == command)  {
 		memcpy(sc->syncreg,data,(len > 8) ? 8 : len);
 		atomic_store_rel_int(&sc->packet_reply,len + 1);
+		wakeup(sc);
 	}
 
 	if (sc->children[addr] != NULL) {
@@ -317,12 +313,12 @@ adb_get_device_handler(device_t dev) 
 
 static int 
 adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, 
-    uint8_t reg, int len, u_char *data) 
+    uint8_t reg, int len, u_char *data, u_char *reply) 
 {
 	u_char command_byte = 0;
 	struct adb_softc *sc;
 	int result = -1;
-	int i = 0;
+	int i = 1;
 
 	sc = device_get_softc(dev);
 	
@@ -331,7 +327,8 @@ adb_send_raw_packet_sync(device_t dev, u
 	command_byte |= reg;
 
 	/* Wait if someone else has a synchronous request pending */
-	mtx_lock(&sc->sc_sync_mtx);
+	while (!atomic_cmpset_int(&sc->sync_packet, 0xffff, command_byte))
+		tsleep(sc, 0, "ADB sync", hz/10);
 
 	sc->packet_reply = 0;
 	sc->sync_packet = command_byte;
@@ -343,21 +340,27 @@ adb_send_raw_packet_sync(device_t dev, u
 		 * Maybe the command got lost? Try resending and polling the 
 		 * controller.
 		 */
-		if (i > 40)
+		if (i % 40 == 0)
 			ADB_HB_SEND_RAW_PACKET(sc->parent, command_byte, 
 			    len, data, 1);
 
-		DELAY(100);
+		tsleep(sc, 0, "ADB sync", hz/10);
 		i++;
 	}
 
 	result = sc->packet_reply - 1;
 
+	if (reply != NULL && result > 0)
+		memcpy(reply,sc->syncreg,result);
+
 	/* Clear packet sync */
 	sc->packet_reply = 0;
-	sc->sync_packet = 0xffff; /* We can't match a 16 bit value */
 
-	mtx_unlock(&sc->sc_sync_mtx);
+	/*
+	 * We can't match a value beyond 8 bits, so set sync_packet to 
+	 * 0xffff to avoid collisions.
+	 */
+	atomic_set_int(&sc->sync_packet, 0xffff); 
 
 	return (result);
 }
@@ -375,37 +378,27 @@ adb_set_device_handler(device_t dev, uin
 	newr3 = dinfo->register3 & 0xff00;
 	newr3 |= (uint16_t)(newhandler);
 
+	adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, ADB_COMMAND_LISTEN, 
+	    3, sizeof(uint16_t), (u_char *)(&newr3), NULL);
 	adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, 
-	    ADB_COMMAND_LISTEN, 3, sizeof(uint16_t), (u_char *)(&newr3));
-	adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, 
-	    ADB_COMMAND_TALK, 3, 0, NULL);
+	    ADB_COMMAND_TALK, 3, 0, NULL, NULL);
 
 	return (dinfo->handler_id);
 }
 
-uint8_t 
-adb_read_register(device_t dev, u_char reg, 
-    size_t *len, void *data) 
+size_t 
+adb_read_register(device_t dev, u_char reg, void *data) 
 {
 	struct adb_softc *sc;
 	struct adb_devinfo *dinfo;
-	size_t orig_len;
+	size_t result;
 
 	dinfo = device_get_ivars(dev);
 	sc = device_get_softc(device_get_parent(dev));
 
-	orig_len = *len;
-
-	mtx_lock(&sc->sc_sync_mtx);
-	
-	*len = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address,
-	           ADB_COMMAND_TALK, reg, 0, NULL);
+	result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address,
+	           ADB_COMMAND_TALK, reg, 0, NULL, data);
 
-	if (*len > 0)
-		memcpy(data,sc->syncreg,*len);
-
-	mtx_unlock(&sc->sc_sync_mtx);
-
-	return ((*len > 0) ? 0 : -1);
+	return (result);
 }
 

Modified: user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -271,11 +271,12 @@ adb_kbd_attach(device_t dev) 
 	}
 #endif
 
-	adb_set_autopoll(dev,1);
-
-	/* Check (asynchronously) if we can read out the LED state from 
+	/* Check if we can read out the LED state from 
 	   this keyboard by reading the key state register */
-	adb_send_packet(dev,ADB_COMMAND_TALK,2,0,NULL);
+	if (adb_read_register(dev, 2, NULL) == 2)
+		sc->have_led_control = 1;
+
+	adb_set_autopoll(dev,1);
 
 	return (0);
 }
@@ -323,11 +324,6 @@ adb_kbd_receive_packet(device_t dev, u_c
 	if (command != ADB_COMMAND_TALK)
 		return 0;
 
-	if (reg == 2 && len == 2) {
-		sc->have_led_control = 1;
-		return 0;
-	}
-
 	if (reg != 0 || len != 2)
 		return (0);
 

Modified: user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -181,7 +181,7 @@ adb_mouse_attach(device_t dev) 
 		sc->mode.resolution = 200;
 		break;
 	case 4:
-		adb_read_register(dev,1,&r1_len,r1);
+		r1_len = adb_read_register(dev,1,r1);
 		if (r1_len < 8)
 			break;
 

Modified: user/kmacy/head_arpv2/sys/dev/adb/adbvar.h
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/adb/adbvar.h	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/adb/adbvar.h	Tue Dec  9 05:02:17 2008	(r185786)
@@ -40,7 +40,6 @@ struct adb_softc {
 	device_t	parent;
 
 	struct intr_config_hook enum_hook;
-	struct mtx	sc_sync_mtx;
 	
 	volatile int 	sync_packet;
 	volatile int	packet_reply;

Modified: user/kmacy/head_arpv2/sys/dev/ae/if_ae.c
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/ae/if_ae.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/ae/if_ae.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -1105,12 +1105,9 @@ ae_dmamap_cb(void *arg, bus_dma_segment_
 static int
 ae_alloc_rings(ae_softc_t *sc)
 {
-	bus_dma_tag_t bustag;
 	bus_addr_t busaddr;
 	int error;
 
-	bustag = bus_get_dma_tag(sc->dev);
-
 	/*
 	 * Create parent DMA tag.
 	 */
@@ -1903,8 +1900,8 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd)
 	if_printf(ifp, "Rx interrupt occuried.\n");
 #endif
 	size = le16toh(rxd->len) - ETHER_CRC_LEN;
-	if (size < 0) {
-		if_printf(ifp, "Negative length packet received.");
+	if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) {
+		if_printf(ifp, "Runt frame received.");
 		return (EIO);
 	}
 

Modified: user/kmacy/head_arpv2/sys/dev/ath/if_ath.c
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/ath/if_ath.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/ath/if_ath.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -219,9 +219,15 @@ static void	ath_announce(struct ath_soft
 SYSCTL_DECL(_hw_ath);
 
 /* XXX validate sysctl values */
-static	int ath_calinterval = 30;		/* calibrate every 30 secs */
-SYSCTL_INT(_hw_ath, OID_AUTO, calibrate, CTLFLAG_RW, &ath_calinterval,
-	    0, "chip calibration interval (secs)");
+static	int ath_longcalinterval = 30;		/* long cals every 30 secs */
+SYSCTL_INT(_hw_ath, OID_AUTO, longcal, CTLFLAG_RW, &ath_longcalinterval,
+	    0, "long chip calibration interval (secs)");
+static	int ath_shortcalinterval = 100;		/* short cals every 100 ms */
+SYSCTL_INT(_hw_ath, OID_AUTO, shortcal, CTLFLAG_RW, &ath_shortcalinterval,
+	    0, "short chip calibration interval (msecs)");
+static	int ath_resetcalinterval = 20*60;	/* reset cal state 20 mins */
+SYSCTL_INT(_hw_ath, OID_AUTO, resetcal, CTLFLAG_RW, &ath_resetcalinterval,
+	    0, "reset chip calibration results (secs)");
 
 static	int ath_rxbuf = ATH_RXBUF;		/* # rx buffers to allocate */
 SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf,
@@ -1433,8 +1439,9 @@ ath_init(void *arg)
 	 * state cached in the driver.
 	 */
 	sc->sc_diversity = ath_hal_getdiversity(ah);
-	sc->sc_calinterval = 1;
-	sc->sc_caltries = 0;
+	sc->sc_lastlongcal = 0;
+	sc->sc_resetcal = 1;
+	sc->sc_lastcalreset = 0;
 
 	/*
 	 * Setup the hardware after reset: the key cache
@@ -1566,8 +1573,6 @@ ath_reset(struct ifnet *ifp)
 		if_printf(ifp, "%s: unable to reset hardware; hal status %u\n",
 			__func__, status);
 	sc->sc_diversity = ath_hal_getdiversity(ah);
-	sc->sc_calinterval = 1;
-	sc->sc_caltries = 0;
 	if (ath_startrecv(sc) != 0)	/* restart recv */
 		if_printf(ifp, "%s: unable to start recv logic\n", __func__);
 	/*
@@ -5493,8 +5498,6 @@ ath_chan_set(struct ath_softc *sc, struc
 		}
 		sc->sc_curchan = hchan;
 		sc->sc_diversity = ath_hal_getdiversity(ah);
-		sc->sc_calinterval = 1;
-		sc->sc_caltries = 0;
 
 		/*
 		 * Re-enable rx framework.
@@ -5528,54 +5531,76 @@ ath_calibrate(void *arg)
 {
 	struct ath_softc *sc = arg;
 	struct ath_hal *ah = sc->sc_ah;
-	HAL_BOOL iqCalDone;
-
-	sc->sc_stats.ast_per_cal++;
+	struct ifnet *ifp = sc->sc_ifp;
+	HAL_BOOL longCal, isCalDone;
+	int nextcal;
 
-	if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) {
+	longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz);
+	if (longCal) {
+		sc->sc_stats.ast_per_cal++;
+		if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) {
+			/*
+			 * Rfgain is out of bounds, reset the chip
+			 * to load new gain values.
+			 */
+			DPRINTF(sc, ATH_DEBUG_CALIBRATE,
+				"%s: rfgain change\n", __func__);
+			sc->sc_stats.ast_per_rfgain++;
+			ath_reset(ifp);
+		}
 		/*
-		 * Rfgain is out of bounds, reset the chip
-		 * to load new gain values.
+		 * If this long cal is after an idle period, then
+		 * reset the data collection state so we start fresh.
 		 */
-		DPRINTF(sc, ATH_DEBUG_CALIBRATE,
-			"%s: rfgain change\n", __func__);
-		sc->sc_stats.ast_per_rfgain++;
-		ath_reset(sc->sc_ifp);
+		if (sc->sc_resetcal) {
+			(void) ath_hal_calreset(ah, &sc->sc_curchan);
+			sc->sc_lastcalreset = ticks;
+			sc->sc_resetcal = 0;
+		}
 	}
-	if (!ath_hal_calibrate(ah, &sc->sc_curchan, &iqCalDone)) {
+	if (ath_hal_calibrateN(ah, &sc->sc_curchan, longCal, &isCalDone)) {
+		if (longCal) {
+			/*
+			 * Calibrate noise floor data again in case of change.
+			 */
+			ath_hal_process_noisefloor(ah);
+		}
+	} else {
 		DPRINTF(sc, ATH_DEBUG_ANY,
 			"%s: calibration of channel %u failed\n",
 			__func__, sc->sc_curchan.channel);
 		sc->sc_stats.ast_per_calfail++;
 	}
-	/*
-	 * Calibrate noise floor data again in case of change.
-	 */
-	ath_hal_process_noisefloor(ah);
-	/*
-	 * Poll more frequently when the IQ calibration is in
-	 * progress to speedup loading the final settings.
-	 * We temper this aggressive polling with an exponential
-	 * back off after 4 tries up to ath_calinterval.
-	 */
-	if (iqCalDone || sc->sc_calinterval >= ath_calinterval) {
-		sc->sc_caltries = 0;
-		sc->sc_calinterval = ath_calinterval;
-	} else if (sc->sc_caltries > 4) {
-		sc->sc_caltries = 0;
-		sc->sc_calinterval <<= 1;
-		if (sc->sc_calinterval > ath_calinterval)
-			sc->sc_calinterval = ath_calinterval;
-	}
-	KASSERT(0 < sc->sc_calinterval && sc->sc_calinterval <= ath_calinterval,
-		("bad calibration interval %u", sc->sc_calinterval));
-
-	DPRINTF(sc, ATH_DEBUG_CALIBRATE,
-		"%s: next +%u (%siqCalDone tries %u)\n", __func__,
-		sc->sc_calinterval, iqCalDone ? "" : "!", sc->sc_caltries);
-	sc->sc_caltries++;
-	callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz,
-		ath_calibrate, sc);
+	if (!isCalDone) {
+		/*
+		 * Use a shorter interval to potentially collect multiple
+		 * data samples required to complete calibration.  Once
+		 * we're told the work is done we drop back to a longer
+		 * interval between requests.  We're more aggressive doing
+		 * work when operating as an AP to improve operation right
+		 * after startup.
+		 */
+		nextcal = (1000*ath_shortcalinterval)/hz;
+		if (sc->sc_opmode != HAL_M_HOSTAP)
+			nextcal *= 10;
+	} else {
+		nextcal = ath_longcalinterval*hz;
+		sc->sc_lastlongcal = ticks;
+		if (sc->sc_lastcalreset == 0)
+			sc->sc_lastcalreset = sc->sc_lastlongcal;
+		else if (ticks - sc->sc_lastcalreset >= ath_resetcalinterval*hz)
+			sc->sc_resetcal = 1;	/* setup reset next trip */
+	}
+
+	if (nextcal != 0) {
+		DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: next +%u (%sisCalDone)\n",
+		    __func__, nextcal, isCalDone ? "" : "!");
+		callout_reset(&sc->sc_cal_ch, nextcal, ath_calibrate, sc);
+	} else {
+		DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: calibration disabled\n",
+		    __func__);
+		/* NB: don't rearm timer */
+	}
 }
 
 static void
@@ -5803,10 +5828,12 @@ ath_newstate(struct ieee80211vap *vap, e
 		 * Finally, start any timers and the task q thread
 		 * (in case we didn't go through SCAN state).
 		 */
-		if (sc->sc_calinterval != 0) {
+		if (ath_longcalinterval != 0) {
 			/* start periodic recalibration timer */
-			callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz,
-				ath_calibrate, sc);
+			callout_reset(&sc->sc_cal_ch, 1, ath_calibrate, sc);
+		} else {
+			DPRINTF(sc, ATH_DEBUG_CALIBRATE,
+			    "%s: calibration disabled\n", __func__);
 		}
 		taskqueue_unblock(sc->sc_tq);
 	} else if (nstate == IEEE80211_S_INIT) {
@@ -6885,7 +6912,7 @@ ath_tx_raw_start(struct ath_softc *sc, s
 	struct ieee80211com *ic = ifp->if_l2com;
 	struct ath_hal *ah = sc->sc_ah;
 	int error, ismcast, ismrr;
-	int hdrlen, pktlen, try0, txantenna;
+	int keyix, hdrlen, pktlen, try0, txantenna;
 	u_int8_t rix, cix, txrate, ctsrate, rate1, rate2, rate3;
 	struct ieee80211_frame *wh;
 	u_int flags, ctsduration;
@@ -6904,6 +6931,54 @@ ath_tx_raw_start(struct ath_softc *sc, s
 	/* XXX honor IEEE80211_BPF_DATAPAD */
 	pktlen = m0->m_pkthdr.len - (hdrlen & 3) + IEEE80211_CRC_LEN;
 
+	if (params->ibp_flags & IEEE80211_BPF_CRYPTO) {
+		const struct ieee80211_cipher *cip;
+		struct ieee80211_key *k;
+
+		/*
+		 * Construct the 802.11 header+trailer for an encrypted
+		 * frame. The only reason this can fail is because of an
+		 * unknown or unsupported cipher/key type.
+		 */
+		k = ieee80211_crypto_encap(ni, m0);
+		if (k == NULL) {
+			/*
+			 * This can happen when the key is yanked after the
+			 * frame was queued.  Just discard the frame; the
+			 * 802.11 layer counts failures and provides
+			 * debugging/diagnostics.
+			 */
+			ath_freetx(m0);
+			return EIO;
+		}
+		/*
+		 * Adjust the packet + header lengths for the crypto
+		 * additions and calculate the h/w key index.  When
+		 * a s/w mic is done the frame will have had any mic
+		 * added to it prior to entry so m0->m_pkthdr.len will
+		 * account for it. Otherwise we need to add it to the
+		 * packet length.
+		 */
+		cip = k->wk_cipher;
+		hdrlen += cip->ic_header;
+		pktlen += cip->ic_header + cip->ic_trailer;
+		/* NB: frags always have any TKIP MIC done in s/w */
+		if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0)
+			pktlen += cip->ic_miclen;
+		keyix = k->wk_keyix;
+
+		/* packet header may have moved, reset our local pointer */
+		wh = mtod(m0, struct ieee80211_frame *);
+	} else if (ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) {
+		/*
+		 * Use station key cache slot, if assigned.
+		 */
+		keyix = ni->ni_ucastkey.wk_keyix;
+		if (keyix == IEEE80211_KEYIX_NONE)
+			keyix = HAL_TXKEYIX_INVALID;
+	} else
+		keyix = HAL_TXKEYIX_INVALID;
+
 	error = ath_tx_dmasetup(sc, bf, m0);
 	if (error != 0)
 		return error;
@@ -6992,7 +7067,7 @@ ath_tx_raw_start(struct ath_softc *sc, s
 		, atype			/* Atheros packet type */
 		, params->ibp_power	/* txpower */
 		, txrate, try0		/* series 0 rate/tries */
-		, HAL_TXKEYIX_INVALID	/* key cache index */
+		, keyix			/* key cache index */
 		, txantenna		/* antenna mode */
 		, flags			/* flags */
 		, ctsrate		/* rts/cts rate */

Modified: user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h	Tue Dec  9 05:02:17 2008	(r185786)
@@ -248,7 +248,8 @@ struct ath_softc {
 				sc_swbmiss  : 1,/* sta mode using sw bmiss */
 				sc_stagbeacons:1,/* use staggered beacons */
 				sc_wmetkipmic:1,/* can do WME+TKIP MIC */
-				sc_resume_up: 1;/* on resume, start all vaps */
+				sc_resume_up: 1,/* on resume, start all vaps */
+				sc_resetcal : 1;/* reset cal state next trip */
 	uint32_t		sc_eerd;	/* regdomain from EEPROM */
 	uint32_t		sc_eecc;	/* country code from EEPROM */
 						/* rate tables */
@@ -334,8 +335,8 @@ struct ath_softc {
 	int			sc_nbcnvaps;	/* # vaps with beacons */
 
 	struct callout		sc_cal_ch;	/* callout handle for cals */
-	int			sc_calinterval;	/* current polling interval */
-	int			sc_caltries;	/* cals at current interval */
+	int			sc_lastlongcal;	/* last long cal completed */
+	int			sc_lastcalreset;/* last cal reset done */
 	HAL_NODE_STATS		sc_halstats;	/* station-mode rssi stats */
 };
 
@@ -438,6 +439,16 @@ void	ath_intr(void *);
 	((*(_ah)->ah_setChannel)((_ah), (_chan)))
 #define	ath_hal_calibrate(_ah, _chan, _iqcal) \
 	((*(_ah)->ah_perCalibration)((_ah), (_chan), (_iqcal)))
+#if HAL_ABI_VERSION >= 0x08111000
+#define	ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \
+	((*(_ah)->ah_perCalibrationN)((_ah), (_chan), 0x1, (_lcal), (_isdone)))
+#define	ath_hal_calreset(_ah, _chan) \
+	((*(_ah)->ah_resetCalValid)((_ah), (_chan)))
+#else
+#define	ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \
+	ath_hal_calibrate(_ah, _chan, _isdone)
+#define	ath_hal_calreset(_ah, _chan)	(0)
+#endif
 #define	ath_hal_setledstate(_ah, _state) \
 	((*(_ah)->ah_setLedState)((_ah), (_state)))
 #define	ath_hal_beaconinit(_ah, _nextb, _bperiod) \

Modified: user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c	Tue Dec  9 05:02:17 2008	(r185786)
@@ -205,6 +205,16 @@ static int ael1006_reset(struct cphy *ph
 	t3_write_reg(phy->adapter, A_T3DBG_GPIO_EN, gpio_out);
 	msleep(125);
 	t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
+
+       /* Phy loopback work around for ael1006 */
+       /* Soft reset phy by toggling loopback  */
+       msleep(125);
+       /* Put phy into local loopback */
+       t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 0, 1);
+       msleep(125);
+       /* Take phy out of local loopback */
+       t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 1, 0);
+
 	return 0;
 }
 

Modified: user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c
==============================================================================
--- user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c	Tue Dec  9 04:54:17 2008	(r185785)
+++ user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c	Tue Dec  9 05:02:17 2008	(r185786)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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