svn commit: r222318 - in projects/largeSMP: bin/sh cddl/compat/opensolaris/misc contrib/openbsm/libbsm contrib/top gnu/usr.bin gnu/usr.bin/grep lib/libc/gen sbin/geom/class/part share/man/man4 shar...

Attilio Rao attilio at FreeBSD.org
Thu May 26 17:38:01 UTC 2011


Author: attilio
Date: Thu May 26 17:38:00 2011
New Revision: 222318
URL: http://svn.freebsd.org/changeset/base/222318

Log:
  MFC

Added:
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.c
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.h
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.ini
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287.ini
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287an.h
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287an.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287phy.h
     - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287phy.h
Modified:
  projects/largeSMP/bin/sh/cd.c
  projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c
  projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3
  projects/largeSMP/gnu/usr.bin/Makefile
  projects/largeSMP/gnu/usr.bin/grep/Makefile
  projects/largeSMP/lib/libc/gen/feature_present.3
  projects/largeSMP/sbin/geom/class/part/geom_part.c
  projects/largeSMP/share/man/man4/atrtc.4
  projects/largeSMP/share/man/man4/attimer.4
  projects/largeSMP/share/man/man4/cc.4
  projects/largeSMP/share/man/man4/h_ertt.4
  projects/largeSMP/share/man/man4/nvram2env.4
  projects/largeSMP/share/man/man7/eventtimers.7
  projects/largeSMP/share/man/man7/ports.7
  projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9
  projects/largeSMP/share/man/man9/hhook.9
  projects/largeSMP/share/man/man9/khelp.9
  projects/largeSMP/share/misc/committers-src.dot
  projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
  projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h
  projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
  projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  projects/largeSMP/sys/conf/kern.mk
  projects/largeSMP/sys/dev/ahci/ahci.c
  projects/largeSMP/sys/dev/ath/ath_hal/ah.c
  projects/largeSMP/sys/dev/ath/ath_hal/ah.h
  projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h
  projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h
  projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c
  projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416phy.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  projects/largeSMP/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c
  projects/largeSMP/sys/dev/ath/if_athvar.h
  projects/largeSMP/sys/dev/msk/if_msk.c
  projects/largeSMP/sys/dev/mvs/mvs.c
  projects/largeSMP/sys/dev/siis/siis.c
  projects/largeSMP/sys/dev/sound/pci/hda/hdac.c
  projects/largeSMP/sys/dev/uart/uart_dev_ns8250.c
  projects/largeSMP/sys/fs/nfs/nfs_var.h
  projects/largeSMP/sys/fs/nfsclient/nfs_clrpcops.c
  projects/largeSMP/sys/fs/nfsclient/nfs_clvnops.c
  projects/largeSMP/sys/geom/part/g_part_ebr.c
  projects/largeSMP/sys/geom/part/g_part_mbr.c
  projects/largeSMP/sys/geom/part/g_part_pc98.c
  projects/largeSMP/sys/geom/vinum/geom_vinum_drive.c
  projects/largeSMP/sys/geom/vinum/geom_vinum_events.c
  projects/largeSMP/sys/kern/device_if.m
  projects/largeSMP/sys/kern/kern_synch.c
  projects/largeSMP/sys/kern/subr_smp.c
  projects/largeSMP/sys/net/if_epair.c
  projects/largeSMP/sys/net/netisr.c
  projects/largeSMP/sys/net/netisr.h
  projects/largeSMP/sys/net/netisr_internal.h
  projects/largeSMP/sys/netgraph/ng_eiface.c
  projects/largeSMP/sys/netgraph/ng_pipe.c
  projects/largeSMP/sys/netinet/in_pcb.c
  projects/largeSMP/sys/netinet/in_proto.c
  projects/largeSMP/sys/netinet6/in6_proto.c
  projects/largeSMP/sys/powerpc/aim/trap_subr64.S
  projects/largeSMP/sys/powerpc/ps3/ps3bus.c
  projects/largeSMP/tools/build/make_check/Makefile
  projects/largeSMP/tools/build/options/WITH_BSD_GREP
  projects/largeSMP/tools/tools/ether_reflect/ether_reflect.1
  projects/largeSMP/usr.bin/Makefile
  projects/largeSMP/usr.bin/calendar/calendars/calendar.freebsd
  projects/largeSMP/usr.bin/grep/Makefile
  projects/largeSMP/usr.bin/gzip/gzip.c
  projects/largeSMP/usr.bin/mkcsmapper/mkcsmapper.1
  projects/largeSMP/usr.bin/mkesdb/mkesdb.1
  projects/largeSMP/usr.bin/netstat/netisr.c
  projects/largeSMP/usr.bin/showmount/showmount.c
  projects/largeSMP/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
  projects/largeSMP/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
  projects/largeSMP/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3
  projects/largeSMP/usr.sbin/gpioctl/gpioctl.8
  projects/largeSMP/usr.sbin/usbdump/usbdump.8
Directory Properties:
  projects/largeSMP/   (props changed)
  projects/largeSMP/cddl/contrib/opensolaris/   (props changed)
  projects/largeSMP/contrib/bind9/   (props changed)
  projects/largeSMP/contrib/binutils/   (props changed)
  projects/largeSMP/contrib/bzip2/   (props changed)
  projects/largeSMP/contrib/dialog/   (props changed)
  projects/largeSMP/contrib/ee/   (props changed)
  projects/largeSMP/contrib/expat/   (props changed)
  projects/largeSMP/contrib/file/   (props changed)
  projects/largeSMP/contrib/gcc/   (props changed)
  projects/largeSMP/contrib/gdb/   (props changed)
  projects/largeSMP/contrib/gdtoa/   (props changed)
  projects/largeSMP/contrib/gnu-sort/   (props changed)
  projects/largeSMP/contrib/groff/   (props changed)
  projects/largeSMP/contrib/less/   (props changed)
  projects/largeSMP/contrib/libpcap/   (props changed)
  projects/largeSMP/contrib/libstdc++/   (props changed)
  projects/largeSMP/contrib/llvm/   (props changed)
  projects/largeSMP/contrib/llvm/tools/clang/   (props changed)
  projects/largeSMP/contrib/ncurses/   (props changed)
  projects/largeSMP/contrib/netcat/   (props changed)
  projects/largeSMP/contrib/ntp/   (props changed)
  projects/largeSMP/contrib/one-true-awk/   (props changed)
  projects/largeSMP/contrib/openbsm/   (props changed)
  projects/largeSMP/contrib/openpam/   (props changed)
  projects/largeSMP/contrib/pf/   (props changed)
  projects/largeSMP/contrib/sendmail/   (props changed)
  projects/largeSMP/contrib/tcpdump/   (props changed)
  projects/largeSMP/contrib/tcsh/   (props changed)
  projects/largeSMP/contrib/top/   (props changed)
  projects/largeSMP/contrib/top/install-sh   (props changed)
  projects/largeSMP/contrib/tzcode/stdtime/   (props changed)
  projects/largeSMP/contrib/tzcode/zic/   (props changed)
  projects/largeSMP/contrib/tzdata/   (props changed)
  projects/largeSMP/contrib/wpa/   (props changed)
  projects/largeSMP/contrib/xz/   (props changed)
  projects/largeSMP/crypto/openssh/   (props changed)
  projects/largeSMP/crypto/openssl/   (props changed)
  projects/largeSMP/gnu/lib/   (props changed)
  projects/largeSMP/gnu/usr.bin/binutils/   (props changed)
  projects/largeSMP/gnu/usr.bin/cc/cc_tools/   (props changed)
  projects/largeSMP/gnu/usr.bin/gdb/   (props changed)
  projects/largeSMP/lib/libc/   (props changed)
  projects/largeSMP/lib/libc/stdtime/   (props changed)
  projects/largeSMP/lib/libutil/   (props changed)
  projects/largeSMP/lib/libz/   (props changed)
  projects/largeSMP/sbin/   (props changed)
  projects/largeSMP/sbin/ipfw/   (props changed)
  projects/largeSMP/share/mk/bsd.arch.inc.mk   (props changed)
  projects/largeSMP/share/zoneinfo/   (props changed)
  projects/largeSMP/sys/   (props changed)
  projects/largeSMP/sys/amd64/include/xen/   (props changed)
  projects/largeSMP/sys/boot/   (props changed)
  projects/largeSMP/sys/boot/i386/efi/   (props changed)
  projects/largeSMP/sys/boot/ia64/efi/   (props changed)
  projects/largeSMP/sys/boot/ia64/ski/   (props changed)
  projects/largeSMP/sys/boot/powerpc/boot1.chrp/   (props changed)
  projects/largeSMP/sys/boot/powerpc/ofw/   (props changed)
  projects/largeSMP/sys/cddl/contrib/opensolaris/   (props changed)
  projects/largeSMP/sys/conf/   (props changed)
  projects/largeSMP/sys/contrib/dev/acpica/   (props changed)
  projects/largeSMP/sys/contrib/octeon-sdk/   (props changed)
  projects/largeSMP/sys/contrib/pf/   (props changed)
  projects/largeSMP/sys/contrib/x86emu/   (props changed)
  projects/largeSMP/usr.bin/calendar/   (props changed)
  projects/largeSMP/usr.bin/csup/   (props changed)
  projects/largeSMP/usr.bin/procstat/   (props changed)
  projects/largeSMP/usr.sbin/ndiscvt/   (props changed)
  projects/largeSMP/usr.sbin/zic/   (props changed)

Modified: projects/largeSMP/bin/sh/cd.c
==============================================================================
--- projects/largeSMP/bin/sh/cd.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/bin/sh/cd.c	Thu May 26 17:38:00 2011	(r222318)
@@ -86,6 +86,7 @@ cdcmd(int argc, char **argv)
 	struct stat statb;
 	int ch, phys, print = 0, getcwderr = 0;
 	int rc;
+	int errno1 = ENOENT;
 
 	optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
 	phys = Pflag;
@@ -138,9 +139,11 @@ cdcmd(int argc, char **argv)
 			rc = docd(p, print, phys);
 			if (rc >= 0)
 				return getcwderr ? rc : 0;
+			if (errno != ENOENT)
+				errno1 = errno;
 		}
 	}
-	error("can't cd to %s", dest);
+	error("%s: %s", dest, strerror(errno1));
 	/*NOTREACHED*/
 	return 0;
 }

Modified: projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c
==============================================================================
--- projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c	Thu May 26 17:38:00 2011	(r222318)
@@ -223,6 +223,7 @@ out:
 			error = errno;
 			unlink(tmpfile);
 		} else {
+			fflush(newfd);
 			/*
 			 * Send SIGHUP to mountd, but unlock exports file later.
 			 */

Modified: projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3
==============================================================================
--- projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3	Thu May 26 17:38:00 2011	(r222318)
@@ -30,7 +30,7 @@
 .\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/audit_submit.3#17 $
 .\"
 .Dd January 18, 2008
-.Dt audit_submit 3
+.Dt AUDIT_SUBMIT 3
 .Os
 .Sh NAME
 .Nm audit_submit

Modified: projects/largeSMP/gnu/usr.bin/Makefile
==============================================================================
--- projects/largeSMP/gnu/usr.bin/Makefile	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/gnu/usr.bin/Makefile	Thu May 26 17:38:00 2011	(r222318)
@@ -27,9 +27,7 @@ _groff=		groff
 .endif
 .endif
 
-.if ${MK_BSD_GREP} != "yes"
 _grep=          grep
-.endif
 
 .if ${MK_CVS} != "no"
 _cvs=		cvs

Modified: projects/largeSMP/gnu/usr.bin/grep/Makefile
==============================================================================
--- projects/largeSMP/gnu/usr.bin/grep/Makefile	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/gnu/usr.bin/grep/Makefile	Thu May 26 17:38:00 2011	(r222318)
@@ -1,35 +1,50 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 GREP_LIBZ=YES
 
+.if ${MK_BSD_GREP} != "yes"
 PROG=	grep
+.else
+PROG=	gnugrep
+.endif
 SRCS=	closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
 	isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \
 	xstrtoumax.c
 
 CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H
 
+.if ${MK_BSD_GREP} != "yes"
 LINKS+=	${BINDIR}/grep ${BINDIR}/egrep \
 	${BINDIR}/grep ${BINDIR}/fgrep
 MLINKS=	grep.1 egrep.1 grep.1 fgrep.1
+.endif
 
 DPADD=	${LIBGNUREGEX} ${LIBBZ2}
 LDADD=	-lgnuregex -lbz2
 
+.if ${MK_BSD_GREP} != "yes"
 LINKS+=	${BINDIR}/grep ${BINDIR}/bzgrep \
 	${BINDIR}/grep ${BINDIR}/bzegrep \
 	${BINDIR}/grep ${BINDIR}/bzfgrep
 MLINKS+=grep.1 bzgrep.1 grep.1 bzegrep.1 grep.1 bzfgrep.1
+.endif
 
 .if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
 LDADD+=	-lz
 DPADD+=	${LIBZ}
 CFLAGS+=-DHAVE_LIBZ=1
+.if ${MK_BSD_GREP} != "yes"
 LINKS+=	${BINDIR}/grep ${BINDIR}/zgrep \
 	${BINDIR}/grep ${BINDIR}/zegrep \
 	${BINDIR}/grep ${BINDIR}/zfgrep
 MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1
 .endif
+.endif
+
+gnugrep.1: grep.1
+	cp ${.ALLSRC} ${.TARGET}
 
 SUBDIR+=doc
 

Modified: projects/largeSMP/lib/libc/gen/feature_present.3
==============================================================================
--- projects/largeSMP/lib/libc/gen/feature_present.3	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/lib/libc/gen/feature_present.3	Thu May 26 17:38:00 2011	(r222318)
@@ -29,7 +29,7 @@
 .\" $FreeBSD$
 .\"
 .Dd January 8, 2008
-.Dt feature_present 3
+.Dt FEATURE_PRESENT 3
 .Os
 .Sh NAME
 .Nm feature_present

Modified: projects/largeSMP/sbin/geom/class/part/geom_part.c
==============================================================================
--- projects/largeSMP/sbin/geom/class/part/geom_part.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sbin/geom/class/part/geom_part.c	Thu May 26 17:38:00 2011	(r222318)
@@ -295,8 +295,8 @@ fmtattrib(struct gprovider *pp)
 	return (buf);
 }
 
-#define	ALIGNDOWN(d, a)		(-(a) & (d))
-#define	ALIGNUP(d, a)		(-(-(a) & -(d)))
+#define	ALIGNDOWN(d, a)	((d) - (d) % (a))
+#define	ALIGNUP(d, a)	((d) % (a) ? (d) - (d) % (a) + (a): (d))
 
 static int
 gpart_autofill_resize(struct gctl_req *req)

Modified: projects/largeSMP/share/man/man4/atrtc.4
==============================================================================
--- projects/largeSMP/share/man/man4/atrtc.4	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man4/atrtc.4	Thu May 26 17:38:00 2011	(r222318)
@@ -25,7 +25,7 @@
 .\" $FreeBSD$
 .\"
 .Dd September 17, 2010
-.Dt atrtc 4
+.Dt ATRTC 4
 .Os
 .Sh NAME
 .Nm atrtc

Modified: projects/largeSMP/share/man/man4/attimer.4
==============================================================================
--- projects/largeSMP/share/man/man4/attimer.4	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man4/attimer.4	Thu May 26 17:38:00 2011	(r222318)
@@ -25,7 +25,7 @@
 .\" $FreeBSD$
 .\"
 .Dd September 14, 2010
-.Dt attimer 4
+.Dt ATTIMER 4
 .Os
 .Sh NAME
 .Nm attimer

Modified: projects/largeSMP/share/man/man4/cc.4
==============================================================================
--- projects/largeSMP/share/man/man4/cc.4	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man4/cc.4	Thu May 26 17:38:00 2011	(r222318)
@@ -31,7 +31,7 @@
 .\" $FreeBSD$
 .\"
 .Dd February 15, 2011
-.Dt cc 4
+.Dt CC 4
 .Os
 .Sh NAME
 .Nm cc

Modified: projects/largeSMP/share/man/man4/h_ertt.4
==============================================================================
--- projects/largeSMP/share/man/man4/h_ertt.4	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man4/h_ertt.4	Thu May 26 17:38:00 2011	(r222318)
@@ -30,7 +30,7 @@
 .\" $FreeBSD$
 .\"
 .Dd February 15, 2011
-.Dt h_ertt 9
+.Dt H_ERTT 9
 .Os
 .Sh NAME
 .Nm h_ertt

Modified: projects/largeSMP/share/man/man4/nvram2env.4
==============================================================================
--- projects/largeSMP/share/man/man4/nvram2env.4	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man4/nvram2env.4	Thu May 26 17:38:00 2011	(r222318)
@@ -25,7 +25,7 @@
 .\" $FreeBSD$
 .\"
 .Dd April 3, 2011
-.Dt nvram2env 4
+.Dt NVRAM2ENV 4
 .Os
 .Sh NAME
 .Nm nvram2env

Modified: projects/largeSMP/share/man/man7/eventtimers.7
==============================================================================
--- projects/largeSMP/share/man/man7/eventtimers.7	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man7/eventtimers.7	Thu May 26 17:38:00 2011	(r222318)
@@ -25,7 +25,7 @@
 .\" $FreeBSD$
 .\"
 .Dd September 15, 2010
-.Dt eventtimers 4
+.Dt EVENTTIMERS 4
 .Os
 .Sh NAME
 .Nm eventtimers

Modified: projects/largeSMP/share/man/man7/ports.7
==============================================================================
--- projects/largeSMP/share/man/man7/ports.7	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man7/ports.7	Thu May 26 17:38:00 2011	(r222318)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 14, 2009
+.Dd May 25, 2011
 .Dt PORTS 7
 .Os
 .Sh NAME
@@ -124,6 +124,8 @@ and
 .It Cm checksum
 Verify that the fetched distfile's checksum matches the one the port was
 tested against.
+If the distfile's checksum does not match, it also fetches the distfiles
+which are missing or failed the checksum calculation.
 Defining
 .Va NO_CHECKSUM
 will skip this step.

Modified: projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9
==============================================================================
--- projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9	Thu May 26 17:38:00 2011	(r222318)
@@ -25,7 +25,7 @@
 .\" $FreeBSD$
 .\"
 .Dd September 8, 2008
-.Dt DEVFS_CDEVPRIV
+.Dt DEVFS_CDEVPRIV 9
 .Os
 .Sh NAME
 .Nm devfs_set_cdevpriv ,

Modified: projects/largeSMP/share/man/man9/hhook.9
==============================================================================
--- projects/largeSMP/share/man/man9/hhook.9	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man9/hhook.9	Thu May 26 17:38:00 2011	(r222318)
@@ -31,7 +31,7 @@
 .\" $FreeBSD$
 .\"
 .Dd February 15, 2011
-.Dt hhook 9
+.Dt HHOOK 9
 .Os
 .Sh NAME
 .Nm hhook ,

Modified: projects/largeSMP/share/man/man9/khelp.9
==============================================================================
--- projects/largeSMP/share/man/man9/khelp.9	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/man/man9/khelp.9	Thu May 26 17:38:00 2011	(r222318)
@@ -31,7 +31,7 @@
 .\" $FreeBSD$
 .\"
 .Dd February 15, 2011
-.Dt khelp 9
+.Dt KHELP 9
 .Os
 .Sh NAME
 .Nm khelp ,

Modified: projects/largeSMP/share/misc/committers-src.dot
==============================================================================
--- projects/largeSMP/share/misc/committers-src.dot	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/share/misc/committers-src.dot	Thu May 26 17:38:00 2011	(r222318)
@@ -206,6 +206,7 @@ ps [label="Paul Saab\nps at FreeBSD.org\n20
 qingli [label="Qing Li\nqingli at FreeBSD.org\n2005/04/13"]
 rafan [label="Rong-En Fan\nrafan at FreeBSD.org\n2007/01/31"]
 randi [label="Randi Harper\nrandi at FreeBSD.org\n2010/04/20"]
+ray [label="Aleksandr Rybalko\nray at FreeBSD.org\n2011/05/25"]
 rdivacky [label="Roman Divacky\nrdivacky at FreeBSD.org\n2008/03/13"]
 remko [label="Remko Lodder\nremko at FreeBSD.org\n2007/02/23"]
 rik [label="Roman Kurakin\nrik at FreeBSD.org\n2003/12/18"]
@@ -268,6 +269,8 @@ day1 -> rgrimes
 day1 -> alm
 day1 -> dg
 
+adrian -> ray
+
 andre -> qingli
 
 anholt -> jkim

Modified: projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
==============================================================================
--- projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c	Thu May 26 17:38:00 2011	(r222318)
@@ -147,9 +147,7 @@ taskq_run_safe(void *arg, int pending __
 {
 	struct ostask *task = arg;
 
-	ASSERT(task->ost_magic == TASKQ_MAGIC);
 	task->ost_func(task->ost_arg);
-	task->ost_magic = 0;
 }
 
 taskqid_t
@@ -158,15 +156,12 @@ taskq_dispatch_safe(taskq_t *tq, task_fu
 {
 	int prio;
 
-	ASSERT(task->ost_magic != TASKQ_MAGIC);
-
 	/* 
 	 * If TQ_FRONT is given, we want higher priority for this task, so it
 	 * can go at the front of the queue.
 	 */
 	prio = !!(flags & TQ_FRONT);
 
-	task->ost_magic = TASKQ_MAGIC;
 	task->ost_func = func;
 	task->ost_arg = arg;
 

Modified: projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h
==============================================================================
--- projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h	Thu May 26 17:38:00 2011	(r222318)
@@ -35,7 +35,6 @@ struct ostask {
 	struct task	 ost_task;
 	task_func_t	*ost_func;
 	void		*ost_arg;
-	int		 ost_magic;
 };
 
 taskqid_t taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg,

Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
==============================================================================
--- projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Thu May 26 17:38:00 2011	(r222318)
@@ -421,8 +421,7 @@ struct zio {
 
 #ifdef _KERNEL
 	/* FreeBSD only. */
-	struct ostask	io_task_issue;
-	struct ostask	io_task_interrupt;
+	struct ostask	io_task;
 #endif
 };
 

Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
==============================================================================
--- projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Thu May 26 17:38:00 2011	(r222318)
@@ -239,15 +239,20 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn
 			return (ENOENT);
 		}
 		if (dl == NULL)	{
+			size_t namesize;
+
 			/*
 			 * Allocate a new dirlock and add it to the list.
 			 */
-			dl = kmem_alloc(sizeof (zfs_dirlock_t), KM_SLEEP);
+			namesize = strlen(name) + 1;
+			dl = kmem_alloc(sizeof (zfs_dirlock_t) + namesize,
+			    KM_SLEEP);
 			cv_init(&dl->dl_cv, NULL, CV_DEFAULT, NULL);
-			dl->dl_name = name;
+			dl->dl_name = (char *)(dl + 1);
+			bcopy(name, dl->dl_name, namesize);
 			dl->dl_sharecnt = 0;
 			dl->dl_namelock = 0;
-			dl->dl_namesize = 0;
+			dl->dl_namesize = namesize;
 			dl->dl_dzp = dzp;
 			dl->dl_next = dzp->z_dirlocks;
 			dzp->z_dirlocks = dl;
@@ -264,20 +269,8 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn
 	if (flag & ZHAVELOCK)
 		dl->dl_namelock = 1;
 
-	if ((flag & ZSHARED) && ++dl->dl_sharecnt > 1 && dl->dl_namesize == 0) {
-		/*
-		 * We're the second shared reference to dl.  Make a copy of
-		 * dl_name in case the first thread goes away before we do.
-		 * Note that we initialize the new name before storing its
-		 * pointer into dl_name, because the first thread may load
-		 * dl->dl_name at any time.  He'll either see the old value,
-		 * which is his, or the new shared copy; either is OK.
-		 */
-		dl->dl_namesize = strlen(dl->dl_name) + 1;
-		name = kmem_alloc(dl->dl_namesize, KM_SLEEP);
-		bcopy(dl->dl_name, name, dl->dl_namesize);
-		dl->dl_name = name;
-	}
+	if (flag & ZSHARED)
+		dl->dl_sharecnt++;
 
 	mutex_exit(&dzp->z_lock);
 
@@ -361,10 +354,8 @@ zfs_dirent_unlock(zfs_dirlock_t *dl)
 	cv_broadcast(&dl->dl_cv);
 	mutex_exit(&dzp->z_lock);
 
-	if (dl->dl_namesize != 0)
-		kmem_free(dl->dl_name, dl->dl_namesize);
 	cv_destroy(&dl->dl_cv);
-	kmem_free(dl, sizeof (*dl));
+	kmem_free(dl, sizeof (*dl) + dl->dl_namesize);
 }
 
 /*

Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu May 26 17:38:00 2011	(r222318)
@@ -1068,19 +1068,9 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
 	spa_t *spa = zio->io_spa;
 	zio_type_t t = zio->io_type;
 	int flags = TQ_SLEEP | (cutinline ? TQ_FRONT : 0);
-#ifdef _KERNEL
-	struct ostask *task;
-#endif
 
 	ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT);
 
-#ifdef _KERNEL
-	if (q == ZIO_TASKQ_ISSUE)
-		task = &zio->io_task_issue;
-	else /* if (q == ZIO_TASKQ_INTERRUPT) */
-		task = &zio->io_task_interrupt;
-#endif
-
 	/*
 	 * If we're a config writer or a probe, the normal issue and
 	 * interrupt threads may all be blocked waiting for the config lock.
@@ -1105,7 +1095,7 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
 	ASSERT3U(q, <, ZIO_TASKQ_TYPES);
 #ifdef _KERNEL
 	(void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q],
-	    (task_func_t *)zio_execute, zio, flags, task);
+	    (task_func_t *)zio_execute, zio, flags, &zio->io_task);
 #else
 	(void) taskq_dispatch(spa->spa_zio_taskq[t][q],
 	    (task_func_t *)zio_execute, zio, flags);
@@ -2904,7 +2894,7 @@ zio_done(zio_t *zio)
 			(void) taskq_dispatch_safe(
 			    spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
 			    (task_func_t *)zio_reexecute, zio, TQ_SLEEP,
-			    &zio->io_task_issue);
+			    &zio->io_task);
 #else
 			(void) taskq_dispatch(
 			    spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],

Modified: projects/largeSMP/sys/conf/kern.mk
==============================================================================
--- projects/largeSMP/sys/conf/kern.mk	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/conf/kern.mk	Thu May 26 17:38:00 2011	(r222318)
@@ -1,15 +1,12 @@
 # $FreeBSD$
 
 #
-# Warning flags for compiling the kernel and components of the kernel.
+# Warning flags for compiling the kernel and components of the kernel:
 #
-# Note that the newly added -Wcast-qual is responsible for generating
-# most of the remaining warnings.  Warnings introduced with -Wall will
-# also pop up, but are easier to fix.
 CWARNFLAGS?=	-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
 		-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
 		-Wundef -Wno-pointer-sign -fformat-extensions \
-		-Wmissing-include-dirs
+		-Wmissing-include-dirs -fdiagnostics-show-option
 #
 # The following flags are next up for working on:
 #	-Wextra

Modified: projects/largeSMP/sys/dev/ahci/ahci.c
==============================================================================
--- projects/largeSMP/sys/dev/ahci/ahci.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ahci/ahci.c	Thu May 26 17:38:00 2011	(r222318)
@@ -119,6 +119,7 @@ static struct {
 #define AHCI_Q_NOBSYRES	256
 #define AHCI_Q_NOAA	512
 #define AHCI_Q_NOCOUNT	1024
+#define AHCI_Q_ALTSIG	2048
 } ahci_ids[] = {
 	{0x43801002, 0x00, "ATI IXP600",	0},
 	{0x43901002, 0x00, "ATI IXP700",	0},
@@ -192,8 +193,9 @@ static struct {
 	{0x614511ab, 0x00, "Marvell 88SX6145",	AHCI_Q_NOFORCE | AHCI_Q_4CH |
 	    AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
 	{0x91201b4b, 0x00, "Marvell 88SE912x",	AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES},
-	{0x91231b4b, 0x11, "Marvell 88SE912x",	AHCI_Q_NOBSYRES},
+	{0x91231b4b, 0x11, "Marvell 88SE912x",	AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x91231b4b, 0x00, "Marvell 88SE912x",	AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES},
+	{0x91721b4b, 0x00, "Marvell 88SE9172",	AHCI_Q_NOBSYRES},
 	{0x91821b4b, 0x00, "Marvell 88SE9182",	AHCI_Q_NOBSYRES},
 	{0x06201103, 0x00, "HighPoint RocketRAID 620",	AHCI_Q_NOBSYRES},
 	{0x06201b4b, 0x00, "HighPoint RocketRAID 620",	AHCI_Q_NOBSYRES},
@@ -398,6 +400,13 @@ ahci_attach(device_t dev)
 	if (ctlr->caps & AHCI_CAP_EMS)
 		ctlr->capsem = ATA_INL(ctlr->r_mem, AHCI_EM_CTL);
 	ctlr->ichannels = ATA_INL(ctlr->r_mem, AHCI_PI);
+
+	/* Identify and set separate quirks for HBA and RAID f/w Marvells. */
+	if ((ctlr->quirks & AHCI_Q_NOBSYRES) &&
+	    (ctlr->quirks & AHCI_Q_ALTSIG) &&
+	    (ctlr->caps & AHCI_CAP_SPM) == 0)
+		ctlr->quirks &= ~AHCI_Q_NOBSYRES;
+
 	if (ctlr->quirks & AHCI_Q_1CH) {
 		ctlr->caps &= ~AHCI_CAP_NPMASK;
 		ctlr->ichannels &= 0x01;
@@ -1764,7 +1773,7 @@ ahci_execute_transaction(struct ahci_slo
 	struct ahci_cmd_list *clp;
 	union ccb *ccb = slot->ccb;
 	int port = ccb->ccb_h.target_id & 0x0f;
-	int fis_size, i;
+	int fis_size, i, softreset;
 	uint8_t *fis = ch->dma.rfis + 0x40;
 	uint8_t val;
 
@@ -1791,17 +1800,20 @@ ahci_execute_transaction(struct ahci_slo
 	if ((ccb->ccb_h.func_code == XPT_ATA_IO) &&
 	    (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) {
 		if (ccb->ataio.cmd.control & ATA_A_RESET) {
+			softreset = 1;
 			/* Kick controller into sane state */
 			ahci_stop(dev);
 			ahci_clo(dev);
 			ahci_start(dev, 0);
 			clp->cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY;
 		} else {
+			softreset = 2;
 			/* Prepare FIS receive area for check. */
 			for (i = 0; i < 20; i++)
 				fis[i] = 0xff;
 		}
-	}
+	} else
+		softreset = 0;
 	clp->bytecount = 0;
 	clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET +
 				  (AHCI_CT_SIZE * slot->slot));
@@ -1825,8 +1837,7 @@ ahci_execute_transaction(struct ahci_slo
 	ATA_OUTL(ch->r_mem, AHCI_P_CI, (1 << slot->slot));
 	/* Device reset commands doesn't interrupt. Poll them. */
 	if (ccb->ccb_h.func_code == XPT_ATA_IO &&
-	    (ccb->ataio.cmd.command == ATA_DEVICE_RESET ||
-	    (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL))) {
+	    (ccb->ataio.cmd.command == ATA_DEVICE_RESET || softreset)) {
 		int count, timeout = ccb->ccb_h.timeout * 100;
 		enum ahci_err_type et = AHCI_ERR_NONE;
 
@@ -1834,10 +1845,13 @@ ahci_execute_transaction(struct ahci_slo
 			DELAY(10);
 			if (!(ATA_INL(ch->r_mem, AHCI_P_CI) & (1 << slot->slot)))
 				break;
-			if (ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) {
+			if ((ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) &&
+			    softreset != 1) {
+#if 0
 				device_printf(ch->dev,
 				    "Poll error on slot %d, TFD: %04x\n",
 				    slot->slot, ATA_INL(ch->r_mem, AHCI_P_TFD));
+#endif
 				et = AHCI_ERR_TFE;
 				break;
 			}
@@ -1849,9 +1863,20 @@ ahci_execute_transaction(struct ahci_slo
 				break;
 			}
 		}
+
+		/* Marvell controllers do not wait for readyness. */
+		if ((ch->quirks & AHCI_Q_NOBSYRES) && softreset == 2 &&
+		    et == AHCI_ERR_NONE) {
+			while ((val = fis[2]) & ATA_S_BUSY) {
+				DELAY(10);
+				if (count++ >= timeout)
+					break;
+			}
+		}
+
 		if (timeout && (count >= timeout)) {
-			device_printf(ch->dev,
-			    "Poll timeout on slot %d\n", slot->slot);
+			device_printf(dev, "Poll timeout on slot %d port %d\n",
+			    slot->slot, port);
 			device_printf(dev, "is %08x cs %08x ss %08x "
 			    "rs %08x tfd %02x serr %08x\n",
 			    ATA_INL(ch->r_mem, AHCI_P_IS),
@@ -1861,30 +1886,11 @@ ahci_execute_transaction(struct ahci_slo
 			    ATA_INL(ch->r_mem, AHCI_P_SERR));
 			et = AHCI_ERR_TIMEOUT;
 		}
-		/* Marvell controllers do not wait for readyness. */
-		if ((ch->quirks & AHCI_Q_NOBSYRES) &&
-		    (ccb->ccb_h.func_code == XPT_ATA_IO) &&
-		    (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
-		    (ccb->ataio.cmd.control & ATA_A_RESET) == 0) {
-			while ((val = fis[2]) & (ATA_S_BUSY | ATA_S_DRQ)) {
-				DELAY(10);
-				if (count++ >= timeout) {
-					device_printf(dev, "device is not "
-					    "ready after soft-reset: "
-					    "tfd = %08x\n", val);
-	    				et = AHCI_ERR_TIMEOUT;
-	    				break;
-				}
-			} 
-		}
-		ahci_end_transaction(slot, et);
+
 		/* Kick controller into sane state and enable FBS. */
-		if ((ccb->ccb_h.func_code == XPT_ATA_IO) &&
-		    (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
-		    (ccb->ataio.cmd.control & ATA_A_RESET) == 0) {
-			ahci_stop(ch->dev);
-			ahci_start(ch->dev, 1);
-		}
+		if (softreset == 2)
+			ch->eslots |= (1 << slot->slot);
+		ahci_end_transaction(slot, et);
 		return;
 	}
 	/* Start command execution timeout */
@@ -1962,7 +1968,8 @@ ahci_timeout(struct ahci_slot *slot)
 		return;
 	}
 
-	device_printf(dev, "Timeout on slot %d\n", slot->slot);
+	device_printf(dev, "Timeout on slot %d port %d\n",
+	    slot->slot, slot->ccb->ccb_h.target_id & 0x0f);
 	device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n",
 	    ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI),
 	    ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots,
@@ -2013,6 +2020,7 @@ ahci_end_transaction(struct ahci_slot *s
 	union ccb *ccb = slot->ccb;
 	struct ahci_cmd_list *clp;
 	int lastto;
+	uint32_t sig;
 
 	bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
 	    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
@@ -2050,6 +2058,20 @@ ahci_end_transaction(struct ahci_slot *s
 			res->lba_high_exp = fis[10];
 			res->sector_count = fis[12];
 			res->sector_count_exp = fis[13];
+
+			/*
+			 * Some weird controllers do not return signature in
+			 * FIS receive area. Read it from PxSIG register.
+			 */
+			if ((ch->quirks & AHCI_Q_ALTSIG) &&
+			    (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
+			    (ccb->ataio.cmd.control & ATA_A_RESET) == 0) {
+				sig = ATA_INL(ch->r_mem,  AHCI_P_SIG);
+				res->lba_high = sig >> 24;
+				res->lba_mid = sig >> 16;
+				res->lba_low = sig >> 8;
+				res->sector_count = sig;
+			}
 		} else
 			bzero(res, sizeof(*res));
 		if ((ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) == 0 &&
@@ -2169,13 +2191,6 @@ ahci_end_transaction(struct ahci_slot *s
 		ch->numhslots++;
 	} else
 		xpt_done(ccb);
-	/* Unfreeze frozen command. */
-	if (ch->frozen && !ahci_check_collision(dev, ch->frozen)) {
-		union ccb *fccb = ch->frozen;
-		ch->frozen = NULL;
-		ahci_begin_transaction(dev, fccb);
-		xpt_release_simq(ch->sim, TRUE);
-	}
 	/* If we have no other active commands, ... */
 	if (ch->rslots == 0) {
 		/* if there was fatal error - reset port. */
@@ -2185,6 +2200,7 @@ ahci_end_transaction(struct ahci_slot *s
 			/* if we have slots in error, we can reinit port. */
 			if (ch->eslots != 0) {
 				ahci_stop(dev);
+				ahci_clo(dev);
 				ahci_start(dev, 1);
 			}
 			/* if there commands on hold, we can do READ LOG. */
@@ -2195,6 +2211,13 @@ ahci_end_transaction(struct ahci_slot *s
 	} else if ((ch->rslots & ~ch->toslots) == 0 &&
 	    et != AHCI_ERR_TIMEOUT)
 		ahci_rearm_timeout(dev);
+	/* Unfreeze frozen command. */
+	if (ch->frozen && !ahci_check_collision(dev, ch->frozen)) {
+		union ccb *fccb = ch->frozen;
+		ch->frozen = NULL;
+		ahci_begin_transaction(dev, fccb);
+		xpt_release_simq(ch->sim, TRUE);
+	}
 	/* Start PM timer. */
 	if (ch->numrslots == 0 && ch->pm_level > 3 &&
 	    (ch->curr[ch->pm_present ? 15 : 0].caps & CTS_SATA_CAPS_D_PMREQ)) {

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ah.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ah.c	Thu May 26 17:38:00 2011	(r222318)
@@ -117,6 +117,8 @@ ath_hal_mac_name(struct ath_hal *ah)
 		return "9280";
 	case AR_XSREV_VERSION_KITE:
 		return "9285";
+	case AR_XSREV_VERSION_KIWI:
+		return "9287";
 	}
 	return "????";
 }

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ah.h	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ah.h	Thu May 26 17:38:00 2011	(r222318)
@@ -669,6 +669,41 @@ typedef struct {
 } HAL_CHANNEL_SURVEY;
 
 /*
+ * ANI commands.
+ *
+ * These are used both internally and externally via the diagnostic
+ * API.
+ *
+ * Note that this is NOT the ANI commands being used via the INTMIT
+ * capability - that has a different mapping for some reason.
+ */
+typedef enum {
+	HAL_ANI_PRESENT = 0,			/* is ANI support present */
+	HAL_ANI_NOISE_IMMUNITY_LEVEL = 1,	/* set level */
+	HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION = 2,	/* enable/disable */
+	HAL_ANI_CCK_WEAK_SIGNAL_THR = 3,	/* enable/disable */
+	HAL_ANI_FIRSTEP_LEVEL = 4,		/* set level */
+	HAL_ANI_SPUR_IMMUNITY_LEVEL = 5,	/* set level */
+	HAL_ANI_MODE = 6,			/* 0 => manual, 1 => auto (XXX do not change) */
+	HAL_ANI_PHYERR_RESET = 7,		/* reset phy error stats */
+} HAL_ANI_CMD;
+
+/*
+ * This is the layout of the ANI INTMIT capability.
+ *
+ * Notice that the command values differ to HAL_ANI_CMD.
+ */
+typedef enum {
+	HAL_CAP_INTMIT_PRESENT = 0,
+	HAL_CAP_INTMIT_ENABLE = 1,
+	HAL_CAP_INTMIT_NOISE_IMMUNITY_LEVEL = 2,
+	HAL_CAP_INTMIT_OFDM_WEAK_SIGNAL_LEVEL = 3,
+	HAL_CAP_INTMIT_CCK_WEAK_SIGNAL_THR = 4,
+	HAL_CAP_INTMIT_FIRSTEP_LEVEL = 5,
+	HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL = 6
+} HAL_CAP_INTMIT_CMD;
+
+/*
  * Hardware Access Layer (HAL) API.
  *
  * Clients of the HAL call ath_hal_attach to obtain a reference to an

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h	Thu May 26 17:38:00 2011	(r222318)
@@ -80,6 +80,8 @@
 #define AR9280_DEVID_PCIE	0x002a          /* AR9280 PCI-E Merlin */
 #define AR9285_DEVID_PCIE	0x002b          /* AR9285 PCI-E Kite */
 #define	AR2427_DEVID_PCIE	0x002c		/* AR2427 PCI-E w/ 802.11n bonded out */
+#define	AR9287_DEVID_PCI	0x002d		/* AR9227 PCI Kiwi */
+#define	AR9287_DEVID_PCIE	0x002e		/* AR9287 PCI-E Kiwi */
 
 #define	AR_SUBVENDOR_ID_NOG	0x0e11		/* No 11G subvendor ID */
 #define AR_SUBVENDOR_ID_NEW_A	0x7065		/* Update device to new RD */

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h	Thu May 26 17:38:00 2011	(r222318)
@@ -101,7 +101,9 @@ enum {
 	AR_EEP_ANTGAINMAX_2,	/* int8_t* */
 	AR_EEP_WRITEPROTECT,	/* use ath_hal_eepromGetFlag */
 	AR_EEP_PWR_TABLE_OFFSET,/* int8_t* */
-	AR_EEP_PWDCLKIND	/* uint8_t* */
+	AR_EEP_PWDCLKIND,	/* uint8_t* */
+	AR_EEP_TEMPSENSE_SLOPE,	/* int8_t* */
+	AR_EEP_TEMPSENSE_SLOPE_PAL_ON,	/* int8_t* */
 };
 
 typedef struct {

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c	Thu May 26 17:38:00 2011	(r222318)
@@ -63,28 +63,10 @@ v9287EepromGet(struct ath_hal *ah, int p
 		return pBase->opCapFlags;
         case AR_EEP_RFSILENT:
 		return pBase->rfSilent;
-#if 0
-	case AR_EEP_OB_5:
-		return pModal[CHAN_A_IDX].ob;
-    	case AR_EEP_DB_5:
-		return pModal[CHAN_A_IDX].db;
-    	case AR_EEP_OB_2:
-		return pModal[CHAN_B_IDX].ob;
-    	case AR_EEP_DB_2:
-		return pModal[CHAN_B_IDX].db;
-#endif
 	case AR_EEP_TXMASK:
 		return pBase->txMask;
 	case AR_EEP_RXMASK:
 		return pBase->rxMask;
-#if 0
-	case AR_EEP_RXGAIN_TYPE:
-		return IS_VERS(>=, AR5416_EEP_MINOR_VER_17) ?
-		    pBase->rxGainType : AR5416_EEP_RXGAIN_ORIG;
-	case AR_EEP_TXGAIN_TYPE:
-		return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ?
-		    pBase->txGainType : AR5416_EEP_TXGAIN_ORIG;
-#endif
 	case AR_EEP_OL_PWRCTRL:
 		HALASSERT(val == AH_NULL);
 		return pBase->openLoopPwrCntl ?  HAL_OK : HAL_EIO;
@@ -117,6 +99,18 @@ v9287EepromGet(struct ath_hal *ah, int p
 	case AR_EEP_PWR_TABLE_OFFSET:
 		*(int8_t *) val = pBase->pwrTableOffset;
 		return HAL_OK;
+	case AR_EEP_TEMPSENSE_SLOPE:
+		if (IS_VERS(>=,  AR9287_EEP_MINOR_VER_2))
+			*(int8_t *)val = pBase->tempSensSlope;
+		else
+			*(int8_t *)val = 0;
+		return HAL_OK;
+	case AR_EEP_TEMPSENSE_SLOPE_PAL_ON:
+		if (IS_VERS(>=,  AR9287_EEP_MINOR_VER_3))
+			*(int8_t *)val = pBase->tempSensSlopePalOn;
+		else
+			*(int8_t *)val = 0;
+		return HAL_OK;
         default:
 		HALASSERT(0);
 		return HAL_EINVAL;
@@ -132,14 +126,12 @@ v9287EepromSet(struct ath_hal *ah, int p
 	HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom;
 
 	switch (param) {
-	case AR_EEP_ANTGAINMAX_2:
-		ee->ee_antennaGainMax[1] = (int8_t) v;
-		return HAL_OK;
-	case AR_EEP_ANTGAINMAX_5:
-		ee->ee_antennaGainMax[0] = (int8_t) v;
-		return HAL_OK;
+		case AR_EEP_ANTGAINMAX_2:
+			ee->ee_antennaGainMax[1] = (int8_t) v;
+			return HAL_OK;
+		default:
+			return HAL_EINVAL;
 	}
-	return HAL_EINVAL;
 }
 
 static HAL_BOOL

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h	Thu May 26 17:38:00 2011	(r222318)
@@ -418,18 +418,6 @@ extern	HAL_BOOL ath_hal_setTxQProps(stru
 extern	HAL_BOOL ath_hal_getTxQProps(struct ath_hal *ah,
 		HAL_TXQ_INFO *qInfo, const HAL_TX_QUEUE_INFO *qi);
 
-typedef enum {
-	HAL_ANI_PRESENT = 0x1,			/* is ANI support present */
-	HAL_ANI_NOISE_IMMUNITY_LEVEL = 0x2,	/* set level */
-	HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4,	/* enable/disable */
-	HAL_ANI_CCK_WEAK_SIGNAL_THR = 0x8,		/* enable/disable */
-	HAL_ANI_FIRSTEP_LEVEL = 0x10,			/* set level */
-	HAL_ANI_SPUR_IMMUNITY_LEVEL = 0x20,		/* set level */
-	HAL_ANI_MODE = 0x40,	/* 0 => manual, 1 => auto (XXX do not change) */
-	HAL_ANI_PHYERR_RESET =0x80,			/* reset phy error stats */
-	HAL_ANI_ALL = 0xff
-} HAL_ANI_CMD;
-
 #define	HAL_SPUR_VAL_MASK		0x3FFF
 #define	HAL_SPUR_CHAN_WIDTH		87
 #define	HAL_BIN_WIDTH_BASE_100HZ	3125

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h	Thu May 26 17:38:00 2011	(r222318)
@@ -320,6 +320,9 @@ struct ath_hal_5212 {
 	struct ar5212AniState	*ah_curani;	/* cached last reference */
 	struct ar5212AniState	ah_ani[AH_MAXCHAN]; /* per-channel state */
 
+	/* AR5416 uses some of the AR5212 ANI code; these are the ANI methods */
+	HAL_BOOL	(*ah_aniControl) (struct ath_hal *, HAL_ANI_CMD cmd, int param);
+
 	/*
 	 * Transmit power state.  Note these are maintained
 	 * here so they can be retrieved by diagnostic tools.

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c	Thu May 26 17:38:00 2011	(r222318)
@@ -203,6 +203,9 @@ ar5212AniSetup(struct ath_hal *ah)
 		ar5212AniAttach(ah, &tmp, &tmp, AH_TRUE);
 	} else
 		ar5212AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
+
+	/* Set overridable ANI methods */
+	AH5212(ah)->ah_aniControl = ar5212AniControl;
 }
 
 /*

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Thu May 26 17:38:00 2011	(r222318)
@@ -880,16 +880,16 @@ ar5212GetCapability(struct ath_hal *ah, 
 		return HAL_OK;
 	case HAL_CAP_INTMIT:		/* interference mitigation */
 		switch (capability) {
-		case 0:			/* hardware capability */
+		case HAL_CAP_INTMIT_PRESENT:		/* hardware capability */
 			return HAL_OK;
-		case 1:
+		case HAL_CAP_INTMIT_ENABLE:
 			return (ahp->ah_procPhyErr & HAL_ANI_ENA) ?
 				HAL_OK : HAL_ENXIO;
-		case 2:			/* HAL_ANI_NOISE_IMMUNITY_LEVEL */
-		case 3:			/* HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION */
-		case 4:			/* HAL_ANI_CCK_WEAK_SIGNAL_THR */
-		case 5:			/* HAL_ANI_FIRSTEP_LEVEL */
-		case 6:			/* HAL_ANI_SPUR_IMMUNITY_LEVEL */
+		case HAL_CAP_INTMIT_NOISE_IMMUNITY_LEVEL:
+		case HAL_CAP_INTMIT_OFDM_WEAK_SIGNAL_LEVEL:
+		case HAL_CAP_INTMIT_CCK_WEAK_SIGNAL_THR:
+		case HAL_CAP_INTMIT_FIRSTEP_LEVEL:
+		case HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL:
 			ani = ar5212AniGetCurrentState(ah);
 			if (ani == AH_NULL)
 				return HAL_ENXIO;
@@ -980,6 +980,8 @@ ar5212SetCapability(struct ath_hal *ah, 
 		OS_REG_WRITE(ah, AR_TPC, ahp->ah_macTPC);
 		return AH_TRUE;
 	case HAL_CAP_INTMIT: {		/* interference mitigation */
+		/* This maps the public ANI commands to the internal ANI commands */
+		/* Private: HAL_ANI_CMD; Public: HAL_CAP_INTMIT_CMD */
 		static const HAL_ANI_CMD cmds[] = {
 			HAL_ANI_PRESENT,
 			HAL_ANI_MODE,
@@ -990,7 +992,7 @@ ar5212SetCapability(struct ath_hal *ah, 
 			HAL_ANI_SPUR_IMMUNITY_LEVEL,
 		};
 		return capability < N(cmds) ?
-			ar5212AniControl(ah, cmds[capability], setting) :
+			AH5212(ah)->ah_aniControl(ah, cmds[capability], setting) :
 			AH_FALSE;
 	}
 	case HAL_CAP_TSF_ADJUST:	/* hardware has beacon tsf adjust */
@@ -1053,7 +1055,7 @@ ar5212GetDiagState(struct ath_hal *ah, i
 	case HAL_DIAG_ANI_CMD:
 		if (argsize != 2*sizeof(uint32_t))
 			return AH_FALSE;
-		ar5212AniControl(ah, ((const uint32_t *)args)[0],
+		AH5212(ah)->ah_aniControl(ah, ((const uint32_t *)args)[0],
 			((const uint32_t *)args)[1]);
 		return AH_TRUE;
 	case HAL_DIAG_ANI_PARAMS:

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu May 26 17:38:00 2011	(r222318)
@@ -175,9 +175,17 @@ ar5416AniControl(struct ath_hal *ah, HAL
 	struct ar5212AniState *aniState = ahp->ah_curani;
 	const struct ar5212AniParams *params = aniState->params;
 
+	/* Check whether the particular function is enabled */
+	if (((1 << cmd) & AH5416(ah)->ah_ani_function) == 0) {
+		HALDEBUG(ah, HAL_DEBUG_ANI, "%s: command %d disabled\n",
+		    __func__, cmd);
+		HALDEBUG(ah, HAL_DEBUG_ANI, "%s: cmd %d; mask %x\n", __func__, cmd, AH5416(ah)->ah_ani_function);
+		return AH_FALSE;
+	}
+
 	OS_MARK(ah, AH_MARK_ANI_CONTROL, cmd);
 
-	switch (cmd & AH5416(ah)->ah_ani_function) {
+	switch (cmd) {
 	case HAL_ANI_NOISE_IMMUNITY_LEVEL: {
 		u_int level = param;
 
@@ -356,14 +364,14 @@ ar5416AniOfdmErrTrigger(struct ath_hal *
 	aniState = ahp->ah_curani;
 	params = aniState->params;
 	/* First, raise noise immunity level, up to max */
-	if ((AH5416(ah)->ah_ani_function & HAL_ANI_NOISE_IMMUNITY_LEVEL) &&
+	if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL)) &&
 	    (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) {
 		ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, 
 				 aniState->noiseImmunityLevel + 1);
 		return;
 	}
 	/* then, raise spur immunity level, up to max */
-	if ((AH5416(ah)->ah_ani_function & HAL_ANI_SPUR_IMMUNITY_LEVEL) &&
+	if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL)) &&
 	    (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel)) {
 		ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL,
 				 aniState->spurImmunityLevel + 1);
@@ -443,7 +451,8 @@ ar5416AniCckErrTrigger(struct ath_hal *a
 	/* first, raise noise immunity level, up to max */
 	aniState = ahp->ah_curani;
 	params = aniState->params;
-	if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) {
+	if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL) &&
+	    aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) {
 		ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL,
 				 aniState->noiseImmunityLevel + 1);
 		return;

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Thu May 26 17:38:00 2011	(r222318)
@@ -58,7 +58,7 @@ ar5416AniSetup(struct ath_hal *ah)
 		.period			= 100,
 	};
 	/* NB: disable ANI noise immmunity for reliable RIFS rx */
-	AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
+	AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL);
 	ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
 }
 
@@ -199,7 +199,10 @@ ar5416InitState(struct ath_hal_5416 *ahp
 	AH5416(ah)->ah_tx_chainmask = AR5416_DEFAULT_TXCHAINMASK;
 
 	/* Enable all ANI functions to begin with */
-	AH5416(ah)->ah_ani_function = HAL_ANI_ALL;
+	AH5416(ah)->ah_ani_function = 0xffffffff;
+
+        /* Set overridable ANI methods */
+        AH5212(ah)->ah_aniControl = ar5416AniControl;
 }
 
 uint32_t

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Thu May 26 17:38:00 2011	(r222318)
@@ -594,8 +594,8 @@ ar5416LoadNF(struct ath_hal *ah, const s
 	if (AR_SREV_KITE(ah)) {
 		/* Kite has only one chain */
 		chainmask = 0x9;
-	} else if (AR_SREV_MERLIN(ah)) {
-		/* Merlin has only two chains */
+	} else if (AR_SREV_MERLIN(ah) || AR_SREV_KIWI(ah)) {
+		/* Merlin/Kiwi has only two chains */
 		chainmask = 0x1B;
 	} else {
 		chainmask = 0x3F;

Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu May 26 17:02:56 2011	(r222317)
+++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu May 26 17:38:00 2011	(r222318)
@@ -167,6 +167,17 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO

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


More information about the svn-src-projects mailing list