Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 2009 11:07:14 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 161610 for review
Message-ID:  <200905051107.n45B7E7v034448@repoman.freebsd.org>

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

Change 161610 by zec@zec_amdx2 on 2009/05/05 11:06:49

	IFC @ 161608

Affected files ...

.. //depot/projects/vimage-commit2/src/sys/amd64/amd64/identcpu.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/amd64/amd64/local_apic.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/amd64/amd64/mp_machdep.c#14 integrate
.. //depot/projects/vimage-commit2/src/sys/amd64/include/apicvar.h#5 integrate
.. //depot/projects/vimage-commit2/src/sys/amd64/include/clock.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/amd64/isa/clock.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/amd64/linux32/linux32_sysvec.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_futex.c#7 integrate
.. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_futex.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_mib.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_socket.c#15 integrate
.. //depot/projects/vimage-commit2/src/sys/conf/files#34 integrate
.. //depot/projects/vimage-commit2/src/sys/conf/kern.post.mk#4 integrate
.. //depot/projects/vimage-commit2/src/sys/conf/options#26 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/acpica/acpi_cpu.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/ath/if_ath.c#13 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/bitops.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/bwimac.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/bwimac.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/bwiphy.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/bwiphy.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/bwirf.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/bwirf.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/if_bwi.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/if_bwi_pci.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/if_bwireg.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/bwi/if_bwivar.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c#21 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/if_ndis/if_ndis.c#12 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/if_ndis/if_ndisvar.h#7 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/ipw/if_ipw.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/ipw/if_ipwvar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/iwi/if_iwi.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/iwi/if_iwivar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/iwn/if_iwn.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/iwn/if_iwnvar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_rum.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_rumvar.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_uath.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_uathvar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_ural.c#6 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_uralvar.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_zyd.c#6 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/if_zydreg.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/wlan/usb_wlan.h#3 delete
.. //depot/projects/vimage-commit2/src/sys/dev/wi/if_wi.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/wi/if_wivar.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/wpi/if_wpi.c#7 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/wpi/if_wpivar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfs.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfs_commonacl.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfs_commonkrpc.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfs_commonport.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfs_commonsubs.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfs_var.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfscl.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsclstate.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsdport.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfskpiport.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsm_subs.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsport.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsproto.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsrvcache.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsrvstate.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/nfsv4_errstr.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/rpcv2.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfs/xdr_subs.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clbio.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clcomsubs.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clkrpc.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_cllock.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clnfsiod.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clnode.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clport.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clrpcops.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clstate.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clsubs.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clvfsops.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_clvnops.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfs_lock.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfsargs.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfsdiskless.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfsmount.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nfsnode.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsclient/nlminfo.h#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsserver/nfs_nfsdcache.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsserver/nfs_nfsdkrpc.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsserver/nfs_nfsdport.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsserver/nfs_nfsdserv.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsserver/nfs_nfsdsocket.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsserver/nfs_nfsdstate.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/fs/nfsserver/nfs_nfsdsubs.c#1 branch
.. //depot/projects/vimage-commit2/src/sys/geom/vinum/geom_vinum_var.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/bios/apm.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/i386/identcpu.c#11 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/i386/local_apic.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/i386/mp_machdep.c#12 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/include/apicvar.h#5 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/include/clock.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/isa/clock.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/linux/linux_sysvec.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/xen/clock.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/xen/mp_machdep.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/isa/atrtc.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/isa/rtc.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/init_main.c#7 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/kern_fork.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/kern_linker.c#11 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/kern_osd.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/kern_vimage.c#25 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/subr_pcpu.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/sys_socket.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/tty.c#20 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/uipc_socket.c#18 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/uipc_syscalls.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/uipc_usrreq.c#11 integrate
.. //depot/projects/vimage-commit2/src/sys/modules/bwi/Makefile#1 branch
.. //depot/projects/vimage-commit2/src/sys/net/bpf.c#16 integrate
.. //depot/projects/vimage-commit2/src/sys/net/if.c#52 integrate
.. //depot/projects/vimage-commit2/src/sys/net/if_clone.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/net/if_ethersubr.c#24 integrate
.. //depot/projects/vimage-commit2/src/sys/net/if_var.h#21 integrate
.. //depot/projects/vimage-commit2/src/sys/net/netisr.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/net/rtsock.c#26 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211.c#15 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211.h#7 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_adhoc.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_ddb.c#15 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_freebsd.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_freebsd.h#10 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_ht.h#6 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_ioctl.c#11 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_node.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_node.h#8 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_proto.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_scan.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_scan.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_scan_sta.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_superg.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_superg.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_var.h#12 integrate
.. //depot/projects/vimage-commit2/src/sys/netgraph/netgraph.h#24 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/if_ether.c#34 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#33 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#29 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/ip_input.c#38 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/tcp_hostcache.c#21 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#31 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/ip6_mroute.c#16 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/mld6.c#20 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/nd6.c#33 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/nd6_nbr.c#24 integrate
.. //depot/projects/vimage-commit2/src/sys/netipsec/xform_tcp.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/nfsclient/nfs_kdtrace.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/nfsclient/nfs_krpc.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/nfsclient/nfs_vnops.c#19 integrate
.. //depot/projects/vimage-commit2/src/sys/pc98/cbus/clock.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/sys/jail.h#8 integrate
.. //depot/projects/vimage-commit2/src/sys/sys/proc.h#14 integrate
.. //depot/projects/vimage-commit2/src/sys/sys/ucred.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#48 integrate
.. //depot/projects/vimage-commit2/src/sys/vm/vnode_pager.c#8 integrate

Differences ...

==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/identcpu.c#9 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.172 2009/04/29 06:54:40 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.173 2009/05/04 18:05:27 jkim Exp $");
 
 #include "opt_cpu.h"
 
@@ -472,6 +472,22 @@
 	cpu_feature = regs[3];
 	cpu_feature2 = regs[2];
 
+	/*
+	 * Clear "Limit CPUID Maxval" bit and get the largest standard CPUID
+	 * function number again if it is set from BIOS.  It is necessary
+	 * for probing correct CPU topology later.
+	 * XXX This is only done on the BSP package.
+	 */
+	if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_high > 0 && cpu_high < 4) {
+		uint64_t msr;
+		msr = rdmsr(MSR_IA32_MISC_ENABLE);
+		if ((msr & 0x400000ULL) != 0) {
+			wrmsr(MSR_IA32_MISC_ENABLE, msr & ~0x400000ULL);
+			do_cpuid(0, regs);
+			cpu_high = regs[0];
+		}
+	}
+
 	if (cpu_vendor_id == CPU_VENDOR_INTEL ||
 	    cpu_vendor_id == CPU_VENDOR_AMD ||
 	    cpu_vendor_id == CPU_VENDOR_CENTAUR) {

==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/local_apic.c#8 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.54 2009/05/01 20:53:37 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.55 2009/05/05 01:13:20 mav Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_kdtrace.h"
@@ -319,7 +319,7 @@
 	}
 
 	/* We don't setup the timer during boot on the BSP until later. */
-	if (!(boot && PCPU_GET(cpuid) == 0)) {
+	if (!(boot && PCPU_GET(cpuid) == 0) && lapic_timer_hz != 0) {
 		KASSERT(lapic_timer_period != 0, ("lapic%u: zero divisor",
 		    lapic_id()));
 		lapic_timer_set_divisor(lapic_timer_divisor);

==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/mp_machdep.c#14 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.305 2009/04/30 22:10:04 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.306 2009/05/02 12:20:43 mav Exp $");
 
 #include "opt_cpu.h"
 #include "opt_kstack_pages.h"
@@ -57,6 +57,7 @@
 #include <vm/vm_extern.h>
 
 #include <machine/apicreg.h>
+#include <machine/clock.h>
 #include <machine/cputypes.h>
 #include <machine/cpufunc.h>
 #include <machine/md_var.h>
@@ -1124,6 +1125,15 @@
 		sched_preempt(curthread);
 
 	/* Nothing to do for AST */
+
+	if (ipi_bitmap & (1 << IPI_HARDCLOCK))
+		hardclockintr(&frame);
+
+	if (ipi_bitmap & (1 << IPI_STATCLOCK))
+		statclockintr(&frame);
+
+	if (ipi_bitmap & (1 << IPI_PROFCLOCK))
+		profclockintr(&frame);
 }
 
 /*

==== //depot/projects/vimage-commit2/src/sys/amd64/include/apicvar.h#5 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.28 2009/03/17 00:48:11 jkim Exp $
+ * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.29 2009/05/02 12:20:43 mav Exp $
  */
 
 #ifndef _MACHINE_APICVAR_H_
@@ -126,7 +126,10 @@
 /* IPIs handled by IPI_BITMAPED_VECTOR  (XXX ups is there a better place?) */
 #define	IPI_AST		0 	/* Generate software trap. */
 #define IPI_PREEMPT     1
-#define IPI_BITMAP_LAST IPI_PREEMPT
+#define IPI_HARDCLOCK   2
+#define IPI_STATCLOCK   3
+#define IPI_PROFCLOCK   4
+#define IPI_BITMAP_LAST IPI_PROFCLOCK
 #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST)
 
 #define	IPI_STOP	(APIC_IPI_INTS + 7)	/* Stop CPU until restarted. */

==== //depot/projects/vimage-commit2/src/sys/amd64/include/clock.h#3 (text+ko) ====

@@ -3,7 +3,7 @@
  * Garrett Wollman, September 1994.
  * This file is in the public domain.
  *
- * $FreeBSD: src/sys/amd64/include/clock.h,v 1.61 2008/10/21 00:38:00 jkim Exp $
+ * $FreeBSD: src/sys/amd64/include/clock.h,v 1.63 2009/05/03 17:47:21 mav Exp $
  */
 
 #ifndef _MACHINE_CLOCK_H_
@@ -15,7 +15,6 @@
  * XXX large parts of the driver and its interface are misplaced.
  */
 extern int	clkintr_pending;
-extern int	statclock_disable;
 extern u_int	i8254_freq;
 extern int	i8254_max_count;
 extern uint64_t	tsc_freq;
@@ -24,6 +23,12 @@
 
 void	i8254_init(void);
 
+struct trapframe;
+
+int	hardclockintr(struct trapframe *frame);
+int	statclockintr(struct trapframe *frame);
+int	profclockintr(struct trapframe *frame);
+
 /*
  * Driver to clock driver interface.
  */

==== //depot/projects/vimage-commit2/src/sys/amd64/isa/clock.c#3 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.244 2009/05/01 21:43:04 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.246 2009/05/03 17:47:21 mav Exp $");
 
 /*
  * Routines to handle clock hardware.
@@ -53,6 +53,7 @@
 #include <sys/kernel.h>
 #include <sys/module.h>
 #include <sys/sched.h>
+#include <sys/smp.h>
 #include <sys/sysctl.h>
 
 #include <machine/clock.h>
@@ -62,6 +63,7 @@
 #include <machine/apicvar.h>
 #include <machine/ppireg.h>
 #include <machine/timerreg.h>
+#include <machine/smp.h>
 
 #include <isa/rtc.h>
 #ifdef DEV_ISA
@@ -74,7 +76,6 @@
 int	clkintr_pending;
 static int pscnt = 1;
 static int psdiv = 1;
-int	statclock_disable;
 #ifndef TIMER_FREQ
 #define TIMER_FREQ   1193182
 #endif
@@ -89,6 +90,7 @@
 static	u_int32_t i8254_offset;
 static	int	(*i8254_pending)(struct intsrc *);
 static	int	i8254_ticked;
+static	int	using_atrtc_timer;
 static	int	using_lapic_timer;
 
 /* Values for timerX_state: */
@@ -112,6 +114,37 @@
 	0			/* quality */
 };
 
+int
+hardclockintr(struct trapframe *frame)
+{
+
+	if (PCPU_GET(cpuid) == 0)
+		hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+	else
+		hardclock_cpu(TRAPF_USERMODE(frame));
+	if (!using_atrtc_timer)
+		statclockintr(frame);
+	return (FILTER_HANDLED);
+}
+
+int
+statclockintr(struct trapframe *frame)
+{
+
+	if (profprocs != 0)
+		profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+	statclock(TRAPF_USERMODE(frame));
+	return (FILTER_HANDLED);
+}
+
+int
+profclockintr(struct trapframe *frame)
+{
+
+	profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+	return (FILTER_HANDLED);
+}
+
 static int
 clkintr(struct trapframe *frame)
 {
@@ -128,7 +161,11 @@
 		mtx_unlock_spin(&clock_lock);
 	}
 	KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer"));
-	hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+#ifdef SMP
+	if (smp_started)
+		ipi_all_but_self(IPI_HARDCLOCK);
+#endif
+	hardclockintr(frame);
 	return (FILTER_HANDLED);
 }
 
@@ -209,10 +246,19 @@
 		if (profprocs != 0) {
 			if (--pscnt == 0)
 				pscnt = psdiv;
+#ifdef SMP
+			if (pscnt != psdiv && smp_started)
+				ipi_all_but_self(IPI_PROFCLOCK);
+#endif
 			profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 		}
-		if (pscnt == psdiv)
+		if (pscnt == psdiv) {
+#ifdef SMP
+			if (smp_started)
+				ipi_all_but_self(IPI_STATCLOCK);
+#endif
 			statclock(TRAPF_USERMODE(frame));
+		}
 	}
 	return(flag ? FILTER_HANDLED : FILTER_STRAY);
 }
@@ -414,7 +460,6 @@
 void
 cpu_initclocks()
 {
-	int diag;
 
 	using_lapic_timer = lapic_setup_clock();
 	/*
@@ -446,21 +491,17 @@
 	 * kernel clocks, then setup the RTC to periodically interrupt to
 	 * drive statclock() and profclock().
 	 */
-	if (!statclock_disable && !using_lapic_timer) {
-		diag = rtcin(RTC_DIAG);
-		if (diag != 0)
-			printf("RTC BIOS diagnostic error %b\n",
-			    diag, RTCDG_BITS);
-
-	        /* Setting stathz to nonzero early helps avoid races. */
-		stathz = RTC_NOPROFRATE;
-		profhz = RTC_PROFRATE;
-
-		/* Enable periodic interrupts from the RTC. */
-		intr_add_handler("rtc", 8,
-		    (driver_filter_t *)rtcintr, NULL, NULL,
-		    INTR_TYPE_CLK, NULL);
-		atrtc_enable_intr();
+	if (!using_lapic_timer) {
+		using_atrtc_timer = atrtc_setup_clock();
+		if (using_atrtc_timer) {
+			/* Enable periodic interrupts from the RTC. */
+			intr_add_handler("rtc", 8,
+			    (driver_filter_t *)rtcintr, NULL, NULL,
+			    INTR_TYPE_CLK, NULL);
+			atrtc_enable_intr();
+		} else {
+			profhz = stathz = hz;
+		}
 	}
 
 	init_TSC_tc();

==== //depot/projects/vimage-commit2/src/sys/amd64/linux32/linux32_sysvec.c#9 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.47 2009/05/01 15:36:02 dchagin Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.48 2009/05/02 10:06:49 dchagin Exp $");
 #include "opt_compat.h"
 
 #ifndef COMPAT_IA32
@@ -76,6 +76,7 @@
 
 #include <amd64/linux32/linux.h>
 #include <amd64/linux32/linux32_proto.h>
+#include <compat/linux/linux_futex.h>
 #include <compat/linux/linux_emul.h>
 #include <compat/linux/linux_mib.h>
 #include <compat/linux/linux_misc.h>
@@ -127,9 +128,6 @@
 				   u_long stack, u_long ps_strings);
 static void	linux32_fixlimit(struct rlimit *rl, int which);
 
-extern LIST_HEAD(futex_list, futex) futex_list;
-extern struct mtx futex_mtx;
-
 static eventhandler_tag linux_exit_tag;
 static eventhandler_tag linux_schedtail_tag;
 static eventhandler_tag linux_exec_tag;

==== //depot/projects/vimage-commit2/src/sys/compat/linux/linux_futex.c#7 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.20 2009/05/01 15:36:02 dchagin Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.21 2009/05/02 10:06:49 dchagin Exp $");
 #if 0
 __KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $");
 #endif
@@ -81,7 +81,7 @@
 	TAILQ_HEAD(lf_waiting_proc, waiting_proc) f_waiting_proc;
 };
 
-LIST_HEAD(futex_list, futex) futex_list;
+struct futex_list futex_list;
 
 #define FUTEX_LOCK(f)		sx_xlock(&(f)->f_lck)
 #define FUTEX_UNLOCK(f)		sx_xunlock(&(f)->f_lck)

==== //depot/projects/vimage-commit2/src/sys/compat/linux/linux_futex.h#4 (text+ko) ====

@@ -30,12 +30,15 @@
  * 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_futex.h,v 1.6 2009/03/15 19:38:34 dchagin Exp $
+ * $FreeBSD: src/sys/compat/linux/linux_futex.h,v 1.7 2009/05/02 10:06:49 dchagin Exp $
  */
 
 #ifndef _LINUX_FUTEX_H
 #define _LINUX_FUTEX_H
 
+extern LIST_HEAD(futex_list, futex) futex_list;
+extern struct mtx futex_mtx;
+
 #define LINUX_FUTEX_WAIT	0
 #define LINUX_FUTEX_WAKE	1
 #define LINUX_FUTEX_FD		2	/* unused */

==== //depot/projects/vimage-commit2/src/sys/compat/linux/linux_mib.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_mib.c,v 1.30 2008/06/03 17:50:13 rdivacky Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_mib.c,v 1.31 2009/05/04 19:06:05 jamie Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -78,7 +78,7 @@
 }
 
 SYSCTL_PROC(_compat_linux, OID_AUTO, osname,
-	    CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON,
+	    CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
 	    0, 0, linux_sysctl_osname, "A",
 	    "Linux kernel OS name");
 
@@ -100,7 +100,7 @@
 }
 
 SYSCTL_PROC(_compat_linux, OID_AUTO, osrelease,
-	    CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON,
+	    CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
 	    0, 0, linux_sysctl_osrelease, "A",
 	    "Linux kernel OS release");
 
@@ -121,7 +121,7 @@
 }
 
 SYSCTL_PROC(_compat_linux, OID_AUTO, oss_version,
-	    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_PRISON,
+	    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
 	    0, 0, linux_sysctl_oss_version, "I",
 	    "Linux OSS version");
 

==== //depot/projects/vimage-commit2/src/sys/compat/linux/linux_socket.c#15 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.81 2009/04/26 22:06:42 zec Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.82 2009/05/02 10:51:40 dchagin Exp $");
 
 /* XXX we use functions that might not exist. */
 #include "opt_compat.h"
@@ -859,7 +859,10 @@
 		return (EINVAL);
 
 	bsd_args.type = args->type;
-	bsd_args.protocol = args->protocol;
+	if (bsd_args.domain == AF_LOCAL && args->protocol == PF_UNIX)
+		bsd_args.protocol = 0;
+	else
+		bsd_args.protocol = args->protocol;
 	bsd_args.rsv = (int *)PTRIN(args->rsv);
 	return (socketpair(td, &bsd_args));
 }

==== //depot/projects/vimage-commit2/src/sys/conf/files#34 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1396 2009/05/01 17:16:33 sam Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1398 2009/05/05 10:56:12 zec Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -712,6 +712,11 @@
 dev/buslogic/bt_isa.c		optional bt isa
 dev/buslogic/bt_mca.c		optional bt mca
 dev/buslogic/bt_pci.c		optional bt pci
+dev/bwi/bwiirf.c		optional bwi
+dev/bwi/bwimac.c		optional bwi
+dev/bwi/bwiphy.c		optional bwi
+dev/bwi/if_bwi.c		optional bwi
+dev/bwi/if_bwi_pci.c		optional bwi pci
 dev/cardbus/cardbus.c		optional cardbus
 dev/cardbus/cardbus_cis.c	optional cardbus
 dev/cardbus/cardbus_device.c	optional cardbus

==== //depot/projects/vimage-commit2/src/sys/conf/kern.post.mk#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/kern.post.mk,v 1.104 2009/01/07 09:56:54 bz Exp $
+# $FreeBSD: src/sys/conf/kern.post.mk,v 1.105 2009/05/04 20:25:56 jhb Exp $
 
 # Part of a unified Makefile for building kernels.  This part includes all
 # the definitions that need to be after all the % directives except %RULES
@@ -12,7 +12,8 @@
 .if defined(DESTDIR)
 MKMODULESENV+=	DESTDIR="${DESTDIR}"
 .endif
-MKMODULESENV+=	KERNBUILDDIR="${.CURDIR}"
+SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
+MKMODULESENV+=	KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
 
 .MAIN: all
 
@@ -29,7 +30,6 @@
 
 # Handle out of tree ports 
 .if !defined(NO_MODULES) && defined(PORTS_MODULES)
-SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
 PORTSMODULESENV=SYSDIR=${SYSDIR}
 .for __target in all install reinstall clean
 ${__target}: ports-${__target}

==== //depot/projects/vimage-commit2/src/sys/conf/options#26 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.667 2009/05/01 17:18:45 sam Exp $
+# $FreeBSD: src/sys/conf/options,v 1.668 2009/05/03 04:01:43 imp Exp $
 #
 #        On the handling of kernel options
 #
@@ -763,6 +763,10 @@
 AH_USE_INIPDGAIN	opt_ah.h
 AH_MAXCHAN		opt_ah.h
 
+# options for the Broadcom BCM43xx driver (bwi)
+BWI_DEBUG		opt_bwi.h
+BWI_DEBUG_VERBOSE	opt_bwi.h
+
 # options for the Marvell 8335 wireless driver
 MALO_DEBUG		opt_malo.h
 MALO_TXBUF		opt_malo.h

==== //depot/projects/vimage-commit2/src/sys/dev/acpica/acpi_cpu.c#4 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.74 2009/03/26 21:10:35 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.77 2009/05/03 06:25:37 mav Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -79,7 +79,6 @@
     int			 cpu_features;	/* Child driver supported features. */
     /* Runtime state. */
     int			 cpu_non_c3;	/* Index of lowest non-C3 state. */
-    int			 cpu_short_slp;	/* Count of < 1us sleeps. */
     u_int		 cpu_cx_stats[MAX_CX_STATES];/* Cx usage history. */
     /* Values for sysctl. */
     struct sysctl_ctx_list cpu_sysctl_ctx;
@@ -882,43 +881,13 @@
 	return;
     }
 
-    /*
-     * If we slept 100 us or more, use the lowest Cx state.  Otherwise,
-     * find the lowest state that has a latency less than or equal to
-     * the length of our last sleep.
-     */
-    cx_next_idx = sc->cpu_cx_lowest;
-    if (sc->cpu_prev_sleep < 100) {
-	/*
-	 * If we sleep too short all the time, this system may not implement
-	 * C2/3 correctly (i.e. reads return immediately).  In this case,
-	 * back off and use the next higher level.
-	 * It seems that when you have a dual core cpu (like the Intel Core Duo)
-	 * that both cores will get out of C3 state as soon as one of them
-	 * requires it. This breaks the sleep detection logic as the sleep
-	 * counter is local to each cpu. Disable the sleep logic for now as a
-	 * workaround if there's more than one CPU. The right fix would probably
-	 * be to add quirks for system that don't really support C3 state.
-	 */
-	if (mp_ncpus < 2 && sc->cpu_prev_sleep <= 1) {
-	    sc->cpu_short_slp++;
-	    if (sc->cpu_short_slp == 1000 && sc->cpu_cx_lowest != 0) {
-		if (sc->cpu_non_c3 == sc->cpu_cx_lowest && sc->cpu_non_c3 != 0)
-		    sc->cpu_non_c3--;
-		sc->cpu_cx_lowest--;
-		sc->cpu_short_slp = 0;
-		device_printf(sc->cpu_dev,
-		    "too many short sleeps, backing off to C%d\n",
-		    sc->cpu_cx_lowest + 1);
-	    }
-	} else
-	    sc->cpu_short_slp = 0;
-
-	for (i = sc->cpu_cx_lowest; i >= 0; i--)
-	    if (sc->cpu_cx_states[i].trans_lat <= sc->cpu_prev_sleep) {
-		cx_next_idx = i;
-		break;
-	    }
+    /* Find the lowest state that has small enough latency. */
+    cx_next_idx = 0;
+    for (i = sc->cpu_cx_lowest; i >= 0; i--) {
+	if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) {
+	    cx_next_idx = i;
+	    break;
+	}
     }
 
     /*
@@ -943,10 +912,10 @@
     /*
      * Execute HLT (or equivalent) and wait for an interrupt.  We can't
      * calculate the time spent in C1 since the place we wake up is an
-     * ISR.  Assume we slept one quantum and return.
+     * ISR.  Assume we slept half of quantum and return.
      */
     if (cx_next->type == ACPI_STATE_C1) {
-	sc->cpu_prev_sleep = 1000000 / hz;
+	sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + 500000 / hz) / 4;
 	acpi_cpu_c1();
 	return;
     }
@@ -989,9 +958,9 @@
     }
     ACPI_ENABLE_IRQS();
 
-    /* Find the actual time asleep in microseconds, minus overhead. */
+    /* Find the actual time asleep in microseconds. */
     end_time = acpi_TimerDelta(end_time, start_time);
-    sc->cpu_prev_sleep = PM_USEC(end_time) - cx_next->trans_lat;
+    sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + PM_USEC(end_time)) / 4;
 }
 
 /*
@@ -1136,8 +1105,9 @@
 	    sbuf_printf(&sb, "%u.%02u%% ", (u_int)(whole / sum),
 		(u_int)(fract / sum));
 	} else
-	    sbuf_printf(&sb, "0%% ");
+	    sbuf_printf(&sb, "0.00%% ");
     }
+    sbuf_printf(&sb, "last %dus", sc->cpu_prev_sleep);
     sbuf_trim(&sb);
     sbuf_finish(&sb);
     sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);

==== //depot/projects/vimage-commit2/src/sys/dev/ath/if_ath.c#13 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.248 2009/04/13 20:58:47 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.249 2009/05/02 20:16:55 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -3995,12 +3995,7 @@
 
 	if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) {
 #ifdef IEEE80211_SUPPORT_SUPERG
-		if (ic->ic_stageqdepth) {
-			ieee80211_age_stageq(ic, WME_AC_VO, 100);
-			ieee80211_age_stageq(ic, WME_AC_VI, 100);
-			ieee80211_age_stageq(ic, WME_AC_BE, 100);
-			ieee80211_age_stageq(ic, WME_AC_BK, 100);
-		}
+		ieee80211_ff_age_all(ic, 100);
 #endif
 		if (!IFQ_IS_EMPTY(&ifp->if_snd))
 			ath_start(ifp);
@@ -4980,7 +4975,7 @@
 	 * Flush fast-frame staging queue when traffic slows.
 	 */
 	if (txq->axq_depth <= 1)
-		ieee80211_flush_stageq(ic, txq->axq_ac);
+		ieee80211_ff_flush(ic, txq->axq_ac);
 #endif
 	return nacked;
 }

==== //depot/projects/vimage-commit2/src/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c#21 (text+ko) ====

@@ -28,7 +28,7 @@
 ***************************************************************************/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c,v 1.30 2009/04/11 22:07:19 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c,v 1.31 2009/05/05 10:56:12 zec Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

==== //depot/projects/vimage-commit2/src/sys/dev/if_ndis/if_ndis.c#12 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.157 2009/04/16 23:42:00 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.158 2009/05/02 15:14:18 thompsa Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,7 +50,6 @@
 #include <sys/proc.h>
 #include <sys/sysctl.h>
 #include <sys/kthread.h>
-#include <sys/taskqueue.h>
 
 
 #include <net/if.h>
@@ -173,7 +172,7 @@
 	int);
 static int ndis_nettype_chan	(uint32_t);
 static int ndis_nettype_mode	(uint32_t);
-static void ndis_scan		(void *, int);
+static void ndis_scan		(void *);
 static void ndis_scan_results	(struct ndis_softc *);
 static void ndis_scan_start	(struct ieee80211com *);
 static void ndis_scan_end	(struct ieee80211com *);
@@ -184,8 +183,6 @@
 static void ndis_stop		(struct ndis_softc *);
 static int ndis_ifmedia_upd	(struct ifnet *);
 static void ndis_ifmedia_sts	(struct ifnet *, struct ifmediareq *);
-static void ndis_auth		(void *, int);
-static void ndis_assoc		(void *, int);
 static int ndis_get_assoc	(struct ndis_softc *, ndis_wlan_bssid_ex **);
 static int ndis_probe_offload	(struct ndis_softc *);
 static int ndis_set_offload	(struct ndis_softc *);
@@ -741,13 +738,7 @@
 		uint32_t		arg;
 		int			r;
 
-		sc->ndis_tq = taskqueue_create("nids_taskq", M_NOWAIT | M_ZERO,
-		    taskqueue_thread_enqueue, &sc->ndis_tq);
-		taskqueue_start_threads(&sc->ndis_tq, 1, PI_NET, "%s taskq",
-		    device_get_nameunit(dev));
-		TASK_INIT(&sc->ndis_scantask, 0, ndis_scan, sc);
-		TASK_INIT(&sc->ndis_authtask, 0, ndis_auth, sc);
-		TASK_INIT(&sc->ndis_assoctask, 0, ndis_assoc, sc);
+		callout_init(&sc->ndis_scan_callout, CALLOUT_MPSAFE);
 
 		ifp->if_ioctl = ndis_ioctl_80211;
 		ic->ic_ifp = ifp;
@@ -1054,12 +1045,6 @@
 	} else
 		NDIS_UNLOCK(sc);
 
-	if (sc->ndis_80211) {
-		taskqueue_drain(sc->ndis_tq, &sc->ndis_scantask);
-		taskqueue_drain(sc->ndis_tq, &sc->ndis_authtask);
-		taskqueue_drain(sc->ndis_tq, &sc->ndis_assoctask);
-	}
-
 	if (sc->ndis_tickitem != NULL)
 		IoFreeWorkItem(sc->ndis_tickitem);
 	if (sc->ndis_startitem != NULL)
@@ -1121,8 +1106,6 @@
 	if (sc->ndis_iftype == PCIBus)
 		bus_dma_tag_destroy(sc->ndis_parent_tag);
 
-	if (sc->ndis_80211)
-		taskqueue_free(sc->ndis_tq);
 	return(0);
 }
 
@@ -2419,30 +2402,6 @@
 }
 
 static void
-ndis_auth(void *arg, int npending)
-{
-	struct ndis_softc *sc = arg;
-	struct ifnet *ifp = sc->ifp;
-	struct ieee80211com *ic = ifp->if_l2com;
-	struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
-
-	vap->iv_state = IEEE80211_S_AUTH;
-	ndis_auth_and_assoc(sc, vap);
-}
-
-static void
-ndis_assoc(void *arg, int npending)
-{
-	struct ndis_softc *sc = arg;
-	struct ifnet *ifp = sc->ifp;
-	struct ieee80211com *ic = ifp->if_l2com;
-	struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
-
-	vap->iv_state = IEEE80211_S_ASSOC;
-	ndis_auth_and_assoc(sc, vap);
-}
-
-static void
 ndis_auth_and_assoc(sc, vap)
 	struct ndis_softc	*sc;
 	struct ieee80211vap	*vap;
@@ -2656,9 +2615,6 @@
 	if (rval)
 		device_printf (sc->ndis_dev, "set ssid failed: %d\n", rval);
 
-	if (vap->iv_state == IEEE80211_S_AUTH)
-		ieee80211_new_state(vap, IEEE80211_S_ASSOC, 0);
-
 	return;
 }
 
@@ -3304,13 +3260,18 @@
 		return nvp->newstate(vap, nstate, arg);
 	case IEEE80211_S_ASSOC:
 		if (ostate != IEEE80211_S_AUTH) {
-			taskqueue_enqueue(sc->ndis_tq, &sc->ndis_assoctask);
-			return EINPROGRESS;
+			IEEE80211_UNLOCK(ic);
+			ndis_auth_and_assoc(sc, vap);
+			IEEE80211_LOCK(ic);
 		}
 		break;
 	case IEEE80211_S_AUTH:
-		taskqueue_enqueue(sc->ndis_tq, &sc->ndis_authtask);
-		return EINPROGRESS;
+		IEEE80211_UNLOCK(ic);
+		ndis_auth_and_assoc(sc, vap);
+		if (vap->iv_state == IEEE80211_S_AUTH) /* XXX */
+			ieee80211_new_state(vap, IEEE80211_S_ASSOC, 0);
+		IEEE80211_LOCK(ic);
+		break;
 	default:
 		break;
 	}
@@ -3318,54 +3279,18 @@
 }
 
 static void
-ndis_scan(void *arg, int npending)
+ndis_scan(void *arg)
 {
 	struct ndis_softc *sc = arg;
 	struct ieee80211com *ic;
 	struct ieee80211vap *vap;
-	struct ieee80211_scan_state *ss;
-	ndis_80211_ssid ssid;
-	int error, len;
 
 	ic = sc->ifp->if_l2com;
-	ss = ic->ic_scan;
 	vap = TAILQ_FIRST(&ic->ic_vaps);
 
-	if (!NDIS_INITIALIZED(sc)) {
-		DPRINTF(("%s: scan aborted\n", __func__));
-		ieee80211_cancel_scan(vap);
-		return;
-	}
-
-	len = sizeof(ssid);
-	bzero((char *)&ssid, len);
-	if (ss->ss_nssid == 0)
-		ssid.ns_ssidlen = 1;

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



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