svn commit: r197972 - in user/eri/pf45/head: . contrib/openpam contrib/openpam/doc/man crypto/openssh etc etc/rc.d lib/libc/include lib/libc/sys lib/libthr lib/libthr/thread libexec/rtld-elf share/...

Ermal Luçi eri at FreeBSD.org
Sun Oct 11 21:25:48 UTC 2009


Author: eri
Date: Sun Oct 11 21:25:47 2009
New Revision: 197972
URL: http://svn.freebsd.org/changeset/base/197972

Log:
  IFH

Added:
  user/eri/pf45/head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
     - copied unchanged from r197971, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
  user/eri/pf45/head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h
     - copied unchanged from r197971, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h
Modified:
  user/eri/pf45/head/   (props changed)
  user/eri/pf45/head/contrib/openpam/   (props changed)
  user/eri/pf45/head/contrib/openpam/doc/man/pam.conf.5
  user/eri/pf45/head/crypto/openssh/sshd_config
  user/eri/pf45/head/etc/rc.d/bgfsck
  user/eri/pf45/head/etc/rc.d/cleartmp
  user/eri/pf45/head/etc/rc.d/faith
  user/eri/pf45/head/etc/rc.d/fsck
  user/eri/pf45/head/etc/rc.d/hostid
  user/eri/pf45/head/etc/rc.d/hostname
  user/eri/pf45/head/etc/rc.d/ldconfig
  user/eri/pf45/head/etc/rc.d/motd
  user/eri/pf45/head/etc/rc.d/mountcritlocal
  user/eri/pf45/head/etc/rc.d/moused
  user/eri/pf45/head/etc/rc.d/netif
  user/eri/pf45/head/etc/rc.d/newsyslog
  user/eri/pf45/head/etc/rc.d/nfsclient
  user/eri/pf45/head/etc/rc.d/pf
  user/eri/pf45/head/etc/rc.d/savecore
  user/eri/pf45/head/etc/rc.d/stf
  user/eri/pf45/head/etc/rc.subr
  user/eri/pf45/head/lib/libc/include/namespace.h
  user/eri/pf45/head/lib/libc/include/un-namespace.h
  user/eri/pf45/head/lib/libc/sys/Symbol.map
  user/eri/pf45/head/lib/libc/sys/intro.2
  user/eri/pf45/head/lib/libc/sys/nanosleep.2
  user/eri/pf45/head/lib/libthr/pthread.map
  user/eri/pf45/head/lib/libthr/thread/thr_private.h
  user/eri/pf45/head/lib/libthr/thread/thr_syscalls.c
  user/eri/pf45/head/libexec/rtld-elf/rtld.c
  user/eri/pf45/head/share/man/man4/lindev.4
  user/eri/pf45/head/sys/amd64/include/atomic.h
  user/eri/pf45/head/sys/amd64/include/elf.h
  user/eri/pf45/head/sys/arm/include/elf.h
  user/eri/pf45/head/sys/cam/ata/ata_da.c
  user/eri/pf45/head/sys/conf/files
  user/eri/pf45/head/sys/conf/files.amd64
  user/eri/pf45/head/sys/conf/files.i386
  user/eri/pf45/head/sys/dev/agp/agp_i810.c
  user/eri/pf45/head/sys/dev/drm/drm_pciids.h
  user/eri/pf45/head/sys/dev/drm/i915_drv.h
  user/eri/pf45/head/sys/dev/fdc/fdc.c
  user/eri/pf45/head/sys/fs/tmpfs/tmpfs.h
  user/eri/pf45/head/sys/fs/tmpfs/tmpfs_subr.c
  user/eri/pf45/head/sys/fs/tmpfs/tmpfs_vnops.c
  user/eri/pf45/head/sys/geom/concat/g_concat.c
  user/eri/pf45/head/sys/geom/label/g_label.c
  user/eri/pf45/head/sys/geom/part/g_part.c
  user/eri/pf45/head/sys/geom/shsec/g_shsec.c
  user/eri/pf45/head/sys/geom/stripe/g_stripe.c
  user/eri/pf45/head/sys/geom/uzip/g_uzip.c
  user/eri/pf45/head/sys/i386/include/atomic.h
  user/eri/pf45/head/sys/i386/include/elf.h
  user/eri/pf45/head/sys/ia64/include/elf.h
  user/eri/pf45/head/sys/kern/imgact_elf.c
  user/eri/pf45/head/sys/kern/kern_event.c
  user/eri/pf45/head/sys/kern/kern_exit.c
  user/eri/pf45/head/sys/kern/kern_sig.c
  user/eri/pf45/head/sys/kern/kern_thr.c
  user/eri/pf45/head/sys/kern/subr_trap.c
  user/eri/pf45/head/sys/mips/include/elf.h
  user/eri/pf45/head/sys/net/if_bridge.c
  user/eri/pf45/head/sys/net/if_ethersubr.c
  user/eri/pf45/head/sys/net/pfil.c
  user/eri/pf45/head/sys/netgraph/ng_bridge.c
  user/eri/pf45/head/sys/netinet/ip_fastfwd.c
  user/eri/pf45/head/sys/netinet/ip_input.c
  user/eri/pf45/head/sys/netinet/ip_output.c
  user/eri/pf45/head/sys/netinet/ip_var.h
  user/eri/pf45/head/sys/netinet/ipfw/ip_fw2.c
  user/eri/pf45/head/sys/netinet/ipfw/ip_fw_pfil.c
  user/eri/pf45/head/sys/netinet/raw_ip.c
  user/eri/pf45/head/sys/netinet/sctp_bsd_addr.c
  user/eri/pf45/head/sys/netinet/sctp_os_bsd.h
  user/eri/pf45/head/sys/netinet/sctp_pcb.c
  user/eri/pf45/head/sys/netinet6/ip6_forward.c
  user/eri/pf45/head/sys/netinet6/ip6_input.c
  user/eri/pf45/head/sys/netinet6/ip6_output.c
  user/eri/pf45/head/sys/netinet6/ip6_var.h
  user/eri/pf45/head/sys/powerpc/aim/swtch.S
  user/eri/pf45/head/sys/powerpc/aim/trap_subr.S
  user/eri/pf45/head/sys/powerpc/include/elf.h
  user/eri/pf45/head/sys/sparc64/include/elf.h
  user/eri/pf45/head/sys/sun4v/include/elf.h
  user/eri/pf45/head/sys/sys/signalvar.h
  user/eri/pf45/head/tools/regression/sigqueue/sigqtest1/sigqtest1.c
  user/eri/pf45/head/tools/regression/sigqueue/sigqtest2/sigqtest2.c
  user/eri/pf45/head/usr.bin/systat/keyboard.c
  user/eri/pf45/head/usr.bin/systat/main.c
  user/eri/pf45/head/usr.sbin/mfiutil/mfiutil.8   (props changed)

Modified: user/eri/pf45/head/contrib/openpam/doc/man/pam.conf.5
==============================================================================
--- user/eri/pf45/head/contrib/openpam/doc/man/pam.conf.5	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/contrib/openpam/doc/man/pam.conf.5	Sun Oct 11 21:25:47 2009	(r197972)
@@ -109,7 +109,7 @@ will be failure regardless of the succes
 .It Cm requisite
 If this module succeeds, the result of the chain will be success
 unless a later module fails.
-If it module fails, the chain is broken and the result is failure.
+If the module fails, the chain is broken and the result is failure.
 .It Cm sufficient
 If this module succeeds, the chain is broken and the result is
 success.

Modified: user/eri/pf45/head/crypto/openssh/sshd_config
==============================================================================
--- user/eri/pf45/head/crypto/openssh/sshd_config	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/crypto/openssh/sshd_config	Sun Oct 11 21:25:47 2009	(r197972)
@@ -17,7 +17,6 @@
 #VersionAddendum FreeBSD-20091001
 
 #Port 22
-#Protocol 2
 #AddressFamily any
 #ListenAddress 0.0.0.0
 #ListenAddress ::

Modified: user/eri/pf45/head/etc/rc.d/bgfsck
==============================================================================
--- user/eri/pf45/head/etc/rc.d/bgfsck	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/bgfsck	Sun Oct 11 21:25:47 2009	(r197972)
@@ -31,7 +31,7 @@ bgfsck_start ()
 		bgfsck_msg="${bgfsck_msg} in ${background_fsck_delay} seconds"
 	fi
 	if [ -z "${rc_force}" ]; then
-		[ -z "${rc_quiet}" ] && echo "${bgfsck_msg}."
+		check_startmsgs && echo "${bgfsck_msg}."
 	fi
 
 	(sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \

Modified: user/eri/pf45/head/etc/rc.d/cleartmp
==============================================================================
--- user/eri/pf45/head/etc/rc.d/cleartmp	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/cleartmp	Sun Oct 11 21:25:47 2009	(r197972)
@@ -25,7 +25,7 @@ cleartmp_start()
 			       ${tmp}/.ICE-unix ${tmp}/.font-unix"
 
 	if checkyesno ${rcvar1}; then
-		[ -z "${rc_quiet}" ] && echo "Clearing ${tmp}."
+		check_startmsgs && echo "Clearing ${tmp}."
 
 		# This is not needed for mfs, but doesn't hurt anything.
 		# Things to note:
@@ -44,7 +44,7 @@ cleartmp_start()
 	elif checkyesno clear_tmp_X; then
 		# Remove X lock files, since they will prevent you from
 		# restarting X.  Remove other X related directories.
-		[ -z "${rc_quiet}" ] && echo "Clearing ${tmp} (X related)."
+		check_startmsgs && echo "Clearing ${tmp} (X related)."
 		rm -rf ${tmp}/.X[0-9]-lock ${x11_socket_dirs}
 	fi
 	if checkyesno clear_tmp_X; then

Modified: user/eri/pf45/head/etc/rc.d/faith
==============================================================================
--- user/eri/pf45/head/etc/rc.d/faith	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/faith	Sun Oct 11 21:25:47 2009	(r197972)
@@ -39,9 +39,7 @@ faith_up()
 			route change -inet6 ${prefix} -prefixlen ${prefixlen} \
 				-ifp faith0
 		done
-		if [ -z "${rc_quiet}" ]; then
-			ifconfig faith0
-		fi
+		check_startmsgs && ifconfig faith0
 		;;
 	esac
 }

Modified: user/eri/pf45/head/etc/rc.d/fsck
==============================================================================
--- user/eri/pf45/head/etc/rc.d/fsck	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/fsck	Sun Oct 11 21:25:47 2009	(r197972)
@@ -23,7 +23,7 @@ fsck_start()
 					# During fsck ignore SIGQUIT
 		trap : 3
 
-		[ -z "${rc_quiet}" ] && echo "Starting file system checks:"
+		check_startmsgs && echo "Starting file system checks:"
 		if checkyesno background_fsck; then
 			fsck -F -p
 		else

Modified: user/eri/pf45/head/etc/rc.d/hostid
==============================================================================
--- user/eri/pf45/head/etc/rc.d/hostid	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/hostid	Sun Oct 11 21:25:47 2009	(r197972)
@@ -49,9 +49,9 @@ hostid_set()
 
 	# Set both kern.hostuuid and kern.hostid.
 	#
-	[ -z "${rc_quiet}" ] && echo "Setting hostuuid: ${uuid}."
+	check_startmsgs && echo "Setting hostuuid: ${uuid}."
 	${SYSCTL_W} kern.hostuuid="${uuid}" >/dev/null
-	[ -z "${rc_quiet}" ] && echo "Setting hostid: ${id}."
+	check_startmsgs && echo "Setting hostid: ${id}."
 	${SYSCTL_W} kern.hostid=${id} >/dev/null
 }
 

Modified: user/eri/pf45/head/etc/rc.d/hostname
==============================================================================
--- user/eri/pf45/head/etc/rc.d/hostname	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/hostname	Sun Oct 11 21:25:47 2009	(r197972)
@@ -72,8 +72,9 @@ hostname_start()
 
 	# All right, it is safe to invoke hostname(1) now.
 	#
-	[ -z "${rc_quiet}" ] && echo "Setting hostname: ${hostname}."
+	check_startmsgs && echo -n "Setting hostname: ${hostname}"
 	/bin/hostname "${hostname}"
+	check_startmsgs && echo '.'
 }
 
 load_rc_config $name

Modified: user/eri/pf45/head/etc/rc.d/ldconfig
==============================================================================
--- user/eri/pf45/head/etc/rc.d/ldconfig	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/ldconfig	Sun Oct 11 21:25:47 2009	(r197972)
@@ -36,7 +36,7 @@ ldconfig_start()
 				_LDC="${_LDC} ${i}"
 			fi
 		done
-		[ -z "${rc_quiet}" ] && echo 'ELF ldconfig path:' ${_LDC}
+		check_startmsgs && echo 'ELF ldconfig path:' ${_LDC}
 		${ldconfig} -elf ${_ins} ${_LDC}
 
 		case `sysctl -n hw.machine_arch` in
@@ -55,7 +55,7 @@ ldconfig_start()
 					_LDC="${_LDC} ${i}"
 				fi
 			done
-			[ -z "${rc_quiet}" ] &&
+			check_startmsgs &&
 			    echo '32-bit compatibility ldconfig path:' ${_LDC}
 			${ldconfig} -32 -m ${_ins} ${_LDC}
 			;;
@@ -72,8 +72,7 @@ ldconfig_start()
 					_LDC="${_LDC} ${i}"
 				fi
 			done
-			[ -z "${rc_quiet}" ] &&
-			    echo 'a.out ldconfig path:' ${_LDC}
+			check_startmsgs && echo 'a.out ldconfig path:' ${_LDC}
 			${ldconfig} -aout ${_ins} ${_LDC}
 			;;
 		esac

Modified: user/eri/pf45/head/etc/rc.d/motd
==============================================================================
--- user/eri/pf45/head/etc/rc.d/motd	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/motd	Sun Oct 11 21:25:47 2009	(r197972)
@@ -22,7 +22,7 @@ motd_start()
 	#	Must be done *before* interactive logins are possible
 	#	to prevent possible race conditions.
 	#
-	[ -z "${rc_quiet}" ] && echo -n 'Updating motd:'
+	check_startmsgs && echo -n 'Updating motd:'
 	if [ ! -f /etc/motd ]; then
 		install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd
 	fi
@@ -42,7 +42,7 @@ motd_start()
 	}
 	rm -f $T
 
-	[ -z "${rc_quiet}" ] && echo .
+	check_startmsgs && echo '.'
 }
 
 load_rc_config $name

Modified: user/eri/pf45/head/etc/rc.d/mountcritlocal
==============================================================================
--- user/eri/pf45/head/etc/rc.d/mountcritlocal	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/mountcritlocal	Sun Oct 11 21:25:47 2009	(r197972)
@@ -28,7 +28,7 @@ mountcritlocal_start()
 	esac
 
 	# Mount everything except nfs filesystems.
-	[ -z "${rc_quiet}" ] && echo -n 'Mounting local file systems:'
+	check_startmsgs && echo -n 'Mounting local file systems:'
 	mount_excludes='no'
 	for i in ${netfs_types}; do
 		fstype=${i%:*}
@@ -37,7 +37,7 @@ mountcritlocal_start()
 	mount_excludes=${mount_excludes%,}
 	mount -a -t ${mount_excludes}
 	err=$?
-	[ -z "${rc_quiet}" ] && echo '.'
+	check_startmsgs && echo '.'
 
 	case ${err} in
 	0)

Modified: user/eri/pf45/head/etc/rc.d/moused
==============================================================================
--- user/eri/pf45/head/etc/rc.d/moused	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/moused	Sun Oct 11 21:25:47 2009	(r197972)
@@ -51,8 +51,9 @@ moused_start()
 		mytype="$moused_type"
 	fi
 
-	[ -z "${rc_quiet}" ] && echo -n "Starting ${ms} moused."
+	check_startmsgs && echo -n "Starting ${ms} moused"
 	/usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${pidarg}
+	check_startmsgs && echo '.'
 
 	mousechar_arg=
 	case ${mousechar_start} in

Modified: user/eri/pf45/head/etc/rc.d/netif
==============================================================================
--- user/eri/pf45/head/etc/rc.d/netif	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/netif	Sun Oct 11 21:25:47 2009	(r197972)
@@ -143,7 +143,7 @@ network_common()
 			;;
 		esac
 		echo "${_str} Network:${_ok}."
-		if [ -z "${rc_quiet}" ]; then
+		if check_startmsgs; then
 			for ifn in ${_ok}; do
 				/sbin/ifconfig ${ifn}
 			done

Modified: user/eri/pf45/head/etc/rc.d/newsyslog
==============================================================================
--- user/eri/pf45/head/etc/rc.d/newsyslog	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/newsyslog	Sun Oct 11 21:25:47 2009	(r197972)
@@ -17,9 +17,9 @@ stop_cmd=":"
 
 newsyslog_start()
 {
-	[ -z "${rc_quiet}" ] && echo -n "Creating and/or trimming log files:"
+	check_startmsgs && echo -n 'Creating and/or trimming log files'
 	${command} ${rc_flags}
-	[ -z "${rc_quiet}" ] && echo "."
+	check_startmsgs && echo '.'
 }
 
 load_rc_config $name

Modified: user/eri/pf45/head/etc/rc.d/nfsclient
==============================================================================
--- user/eri/pf45/head/etc/rc.d/nfsclient	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/nfsclient	Sun Oct 11 21:25:47 2009	(r197972)
@@ -22,7 +22,8 @@ nfsclient_start()
 	#
 
 	if [ -n "${nfs_access_cache}" ]; then
-		[ -z "${rc_quiet}" ] && echo "NFS access cache time=${nfs_access_cache}"
+		check_startmsgs &&
+			echo "NFS access cache time=${nfs_access_cache}"
 		if ! sysctl vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null; then
 			warn "failed to set access cache timeout"
 		fi

Modified: user/eri/pf45/head/etc/rc.d/pf
==============================================================================
--- user/eri/pf45/head/etc/rc.d/pf	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/pf	Sun Oct 11 21:25:47 2009	(r197972)
@@ -25,19 +25,21 @@ required_modules="pf"
 
 pf_start()
 {
-	[ -z "${rc_quiet}" ] && echo "Enabling pf."
+	check_startmsgs && echo -n 'Enabling pf'
 	$pf_program -F all > /dev/null 2>&1
 	$pf_program -f "$pf_rules" $pf_flags
 	if ! $pf_program -s info | grep -q "Enabled" ; then
 		$pf_program -e
 	fi
+	check_startmsgs && echo '.'
 }
 
 pf_stop()
 {
 	if $pf_program -s info | grep -q "Enabled" ; then
-		[ -z "${rc_quiet}" ] && echo "Disabling pf."
+		echo -n 'Disabling pf'
 		$pf_program -d
+		echo '.'
 	fi
 }
 

Modified: user/eri/pf45/head/etc/rc.d/savecore
==============================================================================
--- user/eri/pf45/head/etc/rc.d/savecore	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/savecore	Sun Oct 11 21:25:47 2009	(r197972)
@@ -69,7 +69,7 @@ savecore_start()
 			${crashinfo_program} -d ${dumpdir}
 		fi
 	else
-		[ -z "${rc_quiet}" ] && echo "No core dumps found"
+		check_startmsgs && echo 'No core dumps found.'
 	fi
 }
 

Modified: user/eri/pf45/head/etc/rc.d/stf
==============================================================================
--- user/eri/pf45/head/etc/rc.d/stf	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.d/stf	Sun Oct 11 21:25:47 2009	(r197972)
@@ -53,9 +53,8 @@ stf_up()
 		ifconfig stf0 create >/dev/null 2>&1
 		ifconfig stf0 inet6 2002:${ipv4_in_hexformat}:${stf_interface_ipv6_slaid:-0}:${stf_interface_ipv6_ifid} \
 			prefixlen ${stf_prefixlen}
-		if [ -z "${rc_quiet}" ]; then
-			/sbin/ifconfig stf0
-		fi
+		check_startmsgs && /sbin/ifconfig stf0
+
 		# disallow packets to malicious 6to4 prefix
 		route add -inet6 2002:e000:: -prefixlen 20 ::1 -reject
 		route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject

Modified: user/eri/pf45/head/etc/rc.subr
==============================================================================
--- user/eri/pf45/head/etc/rc.subr	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/etc/rc.subr	Sun Oct 11 21:25:47 2009	(r197972)
@@ -398,6 +398,20 @@ wait_for_pids()
 }
 
 #
+# check_startmsgs
+#	If rc_quiet is set (usually as a result of using faststart at
+#	boot time) check if rc_startmsgs is enabled.
+#
+check_startmsgs()
+{
+	if [ -n "$rc_quiet" ]; then
+		checkyesno rc_startmsgs
+	else
+		return 0
+	fi
+}
+
+#
 # run_rc_command argument
 #	Search for argument in the list of supported commands, which is:
 #		"start stop restart rcvar status poll ${extra_commands}"
@@ -708,13 +722,7 @@ run_rc_command()
 
 					# setup the full command to run
 					#
-			_show_startmsgs=1
-			if [ -n "${rc_quiet}" ]; then
-				if ! checkyesno rc_startmsgs; then
-					unset _show_startmsgs
-				fi
-			fi
-			[ -n "$_show_startmsgs" ] && echo "Starting ${name}."
+			check_startmsgs && echo "Starting ${name}."
 			if [ -n "$_chroot" ]; then
 				_doit="\
 ${_nice:+nice -n $_nice }\

Modified: user/eri/pf45/head/lib/libc/include/namespace.h
==============================================================================
--- user/eri/pf45/head/lib/libc/include/namespace.h	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libc/include/namespace.h	Sun Oct 11 21:25:47 2009	(r197972)
@@ -80,6 +80,7 @@
 #define		listen				_listen
 #define		nanosleep			_nanosleep
 #define		open				_open
+#define		openat				_openat
 #define		poll				_poll
 #define		pthread_atfork			_pthread_atfork
 #define		pthread_attr_destroy		_pthread_attr_destroy

Modified: user/eri/pf45/head/lib/libc/include/un-namespace.h
==============================================================================
--- user/eri/pf45/head/lib/libc/include/un-namespace.h	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libc/include/un-namespace.h	Sun Oct 11 21:25:47 2009	(r197972)
@@ -61,6 +61,7 @@
 #undef		listen
 #undef		nanosleep
 #undef		open
+#undef		openat
 #undef		poll
 #undef		pthread_atfork
 #undef		pthread_attr_destroy

Modified: user/eri/pf45/head/lib/libc/sys/Symbol.map
==============================================================================
--- user/eri/pf45/head/lib/libc/sys/Symbol.map	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libc/sys/Symbol.map	Sun Oct 11 21:25:47 2009	(r197972)
@@ -769,6 +769,8 @@ FBSDprivate_1.0 {
 	__sys_olio_listio;
 	_open;
 	__sys_open;
+	_openat;
+	__sys_openat;
 	_pathconf;
 	__sys_pathconf;
 	_pipe;

Modified: user/eri/pf45/head/lib/libc/sys/intro.2
==============================================================================
--- user/eri/pf45/head/lib/libc/sys/intro.2	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libc/sys/intro.2	Sun Oct 11 21:25:47 2009	(r197972)
@@ -456,6 +456,14 @@ The specified extended attribute does no
 .It Er 88 EDOOFUS Em "Programming error" .
 A function or API is being abused in a way which could only be detected
 at run-time.
+.It Er 89 EBADMSG Em "Bad message" .
+A corrupted message was detected.
+.It Er 90 EMULTIHOP Em "Multihop attempted" .
+This error code is unused, but present for compatibility with other systems.
+.It Er 91 ENOLINK Em "Link has been severed" .
+This error code is unused, but present for compatibility with other systems.
+.It Er 92 EPROTO Em "Protocol error" .
+A device or socket encountered an unrecoverable protocol error.
 .It Er 93 ENOTCAPABLE Em "Capabilities insufficient" .
 An operation on a capability file descriptor requires greater privilege than
 the capability allows.

Modified: user/eri/pf45/head/lib/libc/sys/nanosleep.2
==============================================================================
--- user/eri/pf45/head/lib/libc/sys/nanosleep.2	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libc/sys/nanosleep.2	Sun Oct 11 21:25:47 2009	(r197972)
@@ -47,7 +47,9 @@
 The
 .Fn nanosleep
 system call
-causes the process to sleep for the specified time.
+causes the calling thread to sleep until the time interval specified by
+.Fa rqtp
+has elapsed.
 An unmasked signal will
 cause it to terminate the sleep early, regardless of the
 .Dv SA_RESTART

Modified: user/eri/pf45/head/lib/libthr/pthread.map
==============================================================================
--- user/eri/pf45/head/lib/libthr/pthread.map	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libthr/pthread.map	Sun Oct 11 21:25:47 2009	(r197972)
@@ -195,6 +195,7 @@ FBSDprivate_1.0 {
 	__msync;
 	__nanosleep;
 	__open;
+	__openat;
 	__poll;
 	__pthread_cond_timedwait;
 	__pthread_cond_wait;
@@ -406,3 +407,7 @@ FBSD_1.1 {
 	pthread_mutex_setspinloops_np;
 	pthread_mutex_setyieldloops_np;
 };
+
+FBSD_1.2 {
+	openat;
+};

Modified: user/eri/pf45/head/lib/libthr/thread/thr_private.h
==============================================================================
--- user/eri/pf45/head/lib/libthr/thread/thr_private.h	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libthr/thread/thr_private.h	Sun Oct 11 21:25:47 2009	(r197972)
@@ -668,6 +668,7 @@ void	_pthread_cleanup_pop(int);
 #ifdef  _SYS_FCNTL_H_
 int     __sys_fcntl(int, int, ...);
 int     __sys_open(const char *, int, ...);
+int     __sys_openat(int, const char *, int, ...);
 #endif
 
 /* #include <signal.h> */

Modified: user/eri/pf45/head/lib/libthr/thread/thr_syscalls.c
==============================================================================
--- user/eri/pf45/head/lib/libthr/thread/thr_syscalls.c	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/lib/libthr/thread/thr_syscalls.c	Sun Oct 11 21:25:47 2009	(r197972)
@@ -139,6 +139,7 @@ int	__fsync(int);
 int	__msync(void *, size_t, int);
 int	__nanosleep(const struct timespec *, struct timespec *);
 int	__open(const char *, int,...);
+int	__openat(int, const char *, int,...);
 int	__poll(struct pollfd *, unsigned int, int);
 ssize_t	__read(int, void *buf, size_t);
 ssize_t	__readv(int, const struct iovec *, int);
@@ -341,6 +342,33 @@ __open(const char *path, int flags,...)
 	return ret;
 }
 
+__weak_reference(__openat, openat);
+
+int
+__openat(int fd, const char *path, int flags, ...)
+{
+	struct pthread *curthread = _get_curthread();
+	int	ret;
+	int	mode = 0;
+	va_list	ap;
+
+	_thr_cancel_enter(curthread);
+	
+	/* Check if the file is being created: */
+	if (flags & O_CREAT) {
+		/* Get the creation mode: */
+		va_start(ap, flags);
+		mode = va_arg(ap, int);
+		va_end(ap);
+	}
+	
+	ret = __sys_openat(fd, path, flags, mode);
+
+	_thr_cancel_leave(curthread);
+
+	return ret;
+}
+
 __weak_reference(__poll, poll);
 
 int

Modified: user/eri/pf45/head/libexec/rtld-elf/rtld.c
==============================================================================
--- user/eri/pf45/head/libexec/rtld-elf/rtld.c	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/libexec/rtld-elf/rtld.c	Sun Oct 11 21:25:47 2009	(r197972)
@@ -474,6 +474,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
     /* Initialize a fake symbol for resolving undefined weak references. */
     sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE);
     sym_zero.st_shndx = SHN_UNDEF;
+    sym_zero.st_value = -(uintptr_t)obj_main->relocbase;
 
     if (!libmap_disable)
         libmap_disable = (bool)lm_init(libmap_override);
@@ -991,26 +992,26 @@ digest_phdr(const Elf_Phdr *phdr, int ph
 
     obj = obj_new();
     for (ph = phdr;  ph < phlimit;  ph++) {
-	switch (ph->p_type) {
+	if (ph->p_type != PT_PHDR)
+	    continue;
 
-	case PT_PHDR:
-	    if ((const Elf_Phdr *)ph->p_vaddr != phdr) {
-		_rtld_error("%s: invalid PT_PHDR", path);
-		return NULL;
-	    }
-	    obj->phdr = (const Elf_Phdr *) ph->p_vaddr;
-	    obj->phsize = ph->p_memsz;
-	    break;
+	obj->phdr = phdr;
+	obj->phsize = ph->p_memsz;
+	obj->relocbase = (caddr_t)phdr - ph->p_vaddr;
+	break;
+    }
+
+    for (ph = phdr;  ph < phlimit;  ph++) {
+	switch (ph->p_type) {
 
 	case PT_INTERP:
-	    obj->interp = (const char *) ph->p_vaddr;
+	    obj->interp = (const char *)(ph->p_vaddr + obj->relocbase);
 	    break;
 
 	case PT_LOAD:
 	    if (nsegs == 0) {	/* First load segment */
 		obj->vaddrbase = trunc_page(ph->p_vaddr);
-		obj->mapbase = (caddr_t) obj->vaddrbase;
-		obj->relocbase = obj->mapbase - obj->vaddrbase;
+		obj->mapbase = obj->vaddrbase + obj->relocbase;
 		obj->textsize = round_page(ph->p_vaddr + ph->p_memsz) -
 		  obj->vaddrbase;
 	    } else {		/* Last load segment */
@@ -1021,7 +1022,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph
 	    break;
 
 	case PT_DYNAMIC:
-	    obj->dynamic = (const Elf_Dyn *) ph->p_vaddr;
+	    obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase);
 	    break;
 
 	case PT_TLS:
@@ -1029,7 +1030,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph
 	    obj->tlssize = ph->p_memsz;
 	    obj->tlsalign = ph->p_align;
 	    obj->tlsinitsize = ph->p_filesz;
-	    obj->tlsinit = (void*) ph->p_vaddr;
+	    obj->tlsinit = (void*)(ph->p_vaddr + obj->relocbase);
 	    break;
 	}
     }

Modified: user/eri/pf45/head/share/man/man4/lindev.4
==============================================================================
--- user/eri/pf45/head/share/man/man4/lindev.4	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/share/man/man4/lindev.4	Sun Oct 11 21:25:47 2009	(r197972)
@@ -30,7 +30,7 @@
 .Os
 .Sh NAME
 .Nm lindev
-.Nd the lindev module
+.Nd Linux-specific pseudo devices support
 .Sh SYNOPSIS
 To compile this collection of linux-specific pseudo devices into the kernel,
 place the following line in your kernel configuration file:

Modified: user/eri/pf45/head/sys/amd64/include/atomic.h
==============================================================================
--- user/eri/pf45/head/sys/amd64/include/atomic.h	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/amd64/include/atomic.h	Sun Oct 11 21:25:47 2009	(r197972)
@@ -78,8 +78,6 @@ void atomic_##NAME##_barr_##TYPE(volatil
 
 int	atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src);
 int	atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src);
-int	atomic_cmpset_barr_int(volatile u_int *dst, u_int exp, u_int src);
-int	atomic_cmpset_barr_long(volatile u_long *dst, u_long exp, u_long src);
 u_int	atomic_fetchadd_int(volatile u_int *p, u_int v);
 u_long	atomic_fetchadd_long(volatile u_long *p, u_long v);
 
@@ -131,33 +129,47 @@ struct __hack
  * Returns 0 on failure, non-zero on success
  */
 
-#define	DEFINE_CMPSET_GEN(NAME, TYPE, OP)		\
-static __inline int					\
-atomic_cmpset_##NAME(volatile u_##TYPE *dst, u_##TYPE exp, u_##TYPE src)\
-{							\
-	u_char res;					\
-							\
-	__asm __volatile(				\
-	"	" MPLOCKED "		"		\
-	"	" OP "	%2,%1 ;		"		\
-	"       sete	%0 ;		"		\
-	"1:				"		\
-	"# atomic_cmpset_##NAME"			\
-	: "=a" (res),			/* 0 */		\
-	  "=m" (*dst)			/* 1 */		\
-	: "r" (src),			/* 2 */		\
-	  "a" (exp),			/* 3 */		\
-	  "m" (*dst)			/* 4 */		\
-	: "memory");					\
-							\
-	return (res);					\
-}							\
-struct __hack
+static __inline int
+atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
+{
+	u_char res;
+
+	__asm __volatile(
+	"	" MPLOCKED "		"
+	"	cmpxchgl %2,%1 ;	"
+	"       sete	%0 ;		"
+	"1:				"
+	"# atomic_cmpset_int"
+	: "=a" (res),			/* 0 */
+	  "=m" (*dst)			/* 1 */
+	: "r" (src),			/* 2 */
+	  "a" (exp),			/* 3 */
+	  "m" (*dst)			/* 4 */
+	: "memory");
+
+	return (res);
+}
+
+static __inline int
+atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
+{
+	u_char res;
 
-DEFINE_CMPSET_GEN(int, int, "cmpxchgl");
-DEFINE_CMPSET_GEN(long, long, "cmpxchgq");
-DEFINE_CMPSET_GEN(barr_int, int, "cmpxchgl");
-DEFINE_CMPSET_GEN(barr_long, long, "cmpxchgq");
+	__asm __volatile(
+	"	" MPLOCKED "		"
+	"	cmpxchgq %2,%1 ;	"
+	"       sete	%0 ;		"
+	"1:				"
+	"# atomic_cmpset_long"
+	: "=a" (res),			/* 0 */
+	  "=m" (*dst)			/* 1 */
+	: "r" (src),			/* 2 */
+	  "a" (exp),			/* 3 */
+	  "m" (*dst)			/* 4 */
+	: "memory");
+
+	return (res);
+}
 
 /*
  * Atomically add the value of v to the integer pointed to by p and return
@@ -358,8 +370,8 @@ u_long	atomic_readandclear_long(volatile
 #define	atomic_add_rel_int		atomic_add_barr_int
 #define	atomic_subtract_acq_int		atomic_subtract_barr_int
 #define	atomic_subtract_rel_int		atomic_subtract_barr_int
-#define	atomic_cmpset_acq_int		atomic_cmpset_barr_int
-#define	atomic_cmpset_rel_int		atomic_cmpset_barr_int
+#define	atomic_cmpset_acq_int		atomic_cmpset_int
+#define	atomic_cmpset_rel_int		atomic_cmpset_int
 
 #define	atomic_set_acq_long		atomic_set_barr_long
 #define	atomic_set_rel_long		atomic_set_barr_long
@@ -369,8 +381,8 @@ u_long	atomic_readandclear_long(volatile
 #define	atomic_add_rel_long		atomic_add_barr_long
 #define	atomic_subtract_acq_long	atomic_subtract_barr_long
 #define	atomic_subtract_rel_long	atomic_subtract_barr_long
-#define	atomic_cmpset_acq_long		atomic_cmpset_barr_long
-#define	atomic_cmpset_rel_long		atomic_cmpset_barr_long
+#define	atomic_cmpset_acq_long		atomic_cmpset_long
+#define	atomic_cmpset_rel_long		atomic_cmpset_long
 
 /* Operations on 8-bit bytes. */
 #define	atomic_set_8		atomic_set_char

Modified: user/eri/pf45/head/sys/amd64/include/elf.h
==============================================================================
--- user/eri/pf45/head/sys/amd64/include/elf.h	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/amd64/include/elf.h	Sun Oct 11 21:25:47 2009	(r197972)
@@ -106,4 +106,10 @@ __ElfType(Auxinfo);
 #define	ELF_TARG_MACH	EM_X86_64
 #define	ELF_TARG_VER	1
 
+#if __ELF_WORD_SIZE == 32
+#define	ET_DYN_LOAD_ADDR 0x01001000
+#else
+#define	ET_DYN_LOAD_ADDR 0x01021000
+#endif
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: user/eri/pf45/head/sys/arm/include/elf.h
==============================================================================
--- user/eri/pf45/head/sys/arm/include/elf.h	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/arm/include/elf.h	Sun Oct 11 21:25:47 2009	(r197972)
@@ -97,4 +97,7 @@ __ElfType(Auxinfo);
  * value.
  */
 #define MAGIC_TRAMP_NUMBER	0x5c000003
+
+#define	ET_DYN_LOAD_ADDR 0x12000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: user/eri/pf45/head/sys/cam/ata/ata_da.c
==============================================================================
--- user/eri/pf45/head/sys/cam/ata/ata_da.c	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/cam/ata/ata_da.c	Sun Oct 11 21:25:47 2009	(r197972)
@@ -721,6 +721,8 @@ adaregister(struct cam_periph *periph, v
 	softc->disk->d_flags = 0;
 	if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE)
 		softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE;
+	strlcpy(softc->disk->d_ident, cgd->serial_num,
+	    MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1));
 
 	adasetgeom(periph, cgd);
 	softc->disk->d_sectorsize = softc->params.secsize;

Modified: user/eri/pf45/head/sys/conf/files
==============================================================================
--- user/eri/pf45/head/sys/conf/files	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/conf/files	Sun Oct 11 21:25:47 2009	(r197972)
@@ -1921,7 +1921,6 @@ gnu/fs/reiserfs/reiserfs_vnops.c	optiona
 isa/isa_if.m			standard
 isa/isa_common.c		optional isa
 isa/isahint.c			optional isa
-isa/orm.c			optional isa
 isa/pnp.c			optional isa isapnp
 isa/pnpparse.c			optional isa isapnp
 fs/cd9660/cd9660_bmap.c	optional cd9660

Modified: user/eri/pf45/head/sys/conf/files.amd64
==============================================================================
--- user/eri/pf45/head/sys/conf/files.amd64	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/conf/files.amd64	Sun Oct 11 21:25:47 2009	(r197972)
@@ -228,6 +228,7 @@ dev/syscons/scvtb.c		optional	sc
 dev/uart/uart_cpu_amd64.c	optional	uart
 dev/wpi/if_wpi.c		optional	wpi
 isa/atrtc.c			standard
+isa/orm.c			optional	isa
 isa/syscons_isa.c		optional	sc
 isa/vga_isa.c			optional	vga
 kern/link_elf_obj.c		standard

Modified: user/eri/pf45/head/sys/conf/files.i386
==============================================================================
--- user/eri/pf45/head/sys/conf/files.i386	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/conf/files.i386	Sun Oct 11 21:25:47 2009	(r197972)
@@ -362,6 +362,7 @@ i386/svr4/svr4_locore.s		optional compat
 i386/svr4/svr4_machdep.c	optional compat_svr4
 #
 isa/atrtc.c			optional atpic
+isa/orm.c			optional isa
 isa/syscons_isa.c		optional sc
 isa/vga_isa.c			optional vga
 kern/imgact_aout.c		optional compat_aout

Modified: user/eri/pf45/head/sys/dev/agp/agp_i810.c
==============================================================================
--- user/eri/pf45/head/sys/dev/agp/agp_i810.c	Sun Oct 11 20:52:18 2009	(r197971)
+++ user/eri/pf45/head/sys/dev/agp/agp_i810.c	Sun Oct 11 21:25:47 2009	(r197972)
@@ -175,6 +175,8 @@ static const struct agp_i810_match {
 	    "Intel Q45 SVGA controller"},
 	{0x2E228086, CHIP_G4X, 0x00020000,
 	    "Intel G45 SVGA controller"},
+	{0x2E328086, CHIP_G4X, 0x00020000,
+	    "Intel G41 SVGA controller"},
 	{0, 0, 0, NULL}
 };
 

Copied: user/eri/pf45/head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c (from r197971, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/eri/pf45/head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c	Sun Oct 11 21:25:47 2009	(r197972, copy of r197971, head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c)
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2009 Rui Paulo <rpaulo at FreeBSD.org>
+ * Copyright (c) 2008 Sam Leffler, Errno Consulting
+ * Copyright (c) 2008 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+#include "opt_ah.h"
+
+#include "ah.h"
+#include "ah_internal.h"
+#include "ah_eeprom_v14.h"
+#include "ah_eeprom_v4k.h"
+
+static HAL_STATUS
+v4kEepromGet(struct ath_hal *ah, int param, void *val)
+{
+#define	CHAN_A_IDX	0
+#define	CHAN_B_IDX	1
+#define	IS_VERS(op, v)	((pBase->version & AR5416_EEP_VER_MINOR_MASK) op (v))
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+	const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader;
+	const BASE_EEP4K_HEADER  *pBase  = &ee->ee_base.baseEepHeader;
+	uint32_t sum;
+	uint8_t *macaddr;
+	int i;
+
+	switch (param) {
+        case AR_EEP_NFTHRESH_5:
+		*(int16_t *)val = pModal[0].noiseFloorThreshCh[0];
+		return HAL_OK;
+        case AR_EEP_NFTHRESH_2:
+		*(int16_t *)val = pModal[1].noiseFloorThreshCh[0];
+		return HAL_OK;
+        case AR_EEP_MACADDR:		/* Get MAC Address */
+		sum = 0;
+		macaddr = val;
+		for (i = 0; i < 6; i++) {
+			macaddr[i] = pBase->macAddr[i];
+			sum += pBase->macAddr[i];
+		}
+		if (sum == 0 || sum == 0xffff*3) {
+			HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad mac address %s\n",
+			    __func__, ath_hal_ether_sprintf(macaddr));
+			return HAL_EEBADMAC;
+		}
+		return HAL_OK;
+        case AR_EEP_REGDMN_0:
+		return pBase->regDmn[0];
+        case AR_EEP_REGDMN_1:
+		return pBase->regDmn[1];
+        case AR_EEP_OPCAP:
+		return pBase->deviceCap;
+        case AR_EEP_OPMODE:
+		return pBase->opCapFlags;
+        case AR_EEP_RFSILENT:
+		return pBase->rfSilent;
+	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;
+	case AR_EEP_TXMASK:
+		return pBase->txMask;
+	case AR_EEP_RXMASK:
+		return pBase->rxMask;
+	case AR_EEP_RXGAIN_TYPE:
+		return AR5416_EEP_RXGAIN_ORIG;
+	case AR_EEP_TXGAIN_TYPE:
+		return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ?
+		    pBase->txGainType : AR5416_EEP_TXGAIN_ORIG;
+#if 0
+	case AR_EEP_OL_PWRCTRL:
+		HALASSERT(val == AH_NULL);
+		return pBase->openLoopPwrCntl ?  HAL_OK : HAL_EIO;
+#endif
+	case AR_EEP_AMODE:
+		HALASSERT(val == AH_NULL);
+		return pBase->opCapFlags & AR5416_OPFLAGS_11A ?
+		    HAL_OK : HAL_EIO;
+	case AR_EEP_BMODE:
+	case AR_EEP_GMODE:
+		HALASSERT(val == AH_NULL);
+		return pBase->opCapFlags & AR5416_OPFLAGS_11G ?
+		    HAL_OK : HAL_EIO;
+	case AR_EEP_32KHZCRYSTAL:
+	case AR_EEP_COMPRESS:
+	case AR_EEP_FASTFRAME:		/* XXX policy decision, h/w can do it */
+	case AR_EEP_WRITEPROTECT:	/* NB: no write protect bit */
+		HALASSERT(val == AH_NULL);
+		/* fall thru... */
+	case AR_EEP_MAXQCU:		/* NB: not in opCapFlags */
+	case AR_EEP_KCENTRIES:		/* NB: not in opCapFlags */
+		return HAL_EIO;
+	case AR_EEP_AES:
+	case AR_EEP_BURST:
+        case AR_EEP_RFKILL:
+	case AR_EEP_TURBO5DISABLE:
+	case AR_EEP_TURBO2DISABLE:
+		HALASSERT(val == AH_NULL);
+		return HAL_OK;
+	case AR_EEP_ANTGAINMAX_2:
+		*(int8_t *) val = ee->ee_antennaGainMax[1];
+		return HAL_OK;
+	case AR_EEP_ANTGAINMAX_5:
+		*(int8_t *) val = ee->ee_antennaGainMax[0];
+		return HAL_OK;
+        default:
+		HALASSERT(0);
+		return HAL_EINVAL;
+	}
+#undef IS_VERS
+#undef CHAN_A_IDX
+#undef CHAN_B_IDX
+}
+
+static HAL_BOOL
+v4kEepromSet(struct ath_hal *ah, int param, int v)
+{
+	HAL_EEPROM_v4k *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;
+	}
+	return HAL_EINVAL;
+}
+
+static HAL_BOOL
+v4kEepromDiag(struct ath_hal *ah, int request,
+     const void *args, uint32_t argsize, void **result, uint32_t *resultsize)
+{
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+
+	switch (request) {
+	case HAL_DIAG_EEPROM:
+		*result = &ee->ee_base;
+		*resultsize = sizeof(ee->ee_base);
+		return AH_TRUE;
+	}
+	return AH_FALSE;
+}
+
+/* Do structure specific swaps if Eeprom format is non native to host */
+static void
+eepromSwap(struct ar5416eeprom_4k *ee)
+{
+	uint32_t integer, i;
+	uint16_t word;
+	MODAL_EEP4K_HEADER *pModal;
+
+	/* convert Base Eep header */
+	word = __bswap16(ee->baseEepHeader.length);
+	ee->baseEepHeader.length = word;
+
+	word = __bswap16(ee->baseEepHeader.checksum);
+	ee->baseEepHeader.checksum = word;
+
+	word = __bswap16(ee->baseEepHeader.version);
+	ee->baseEepHeader.version = word;
+
+	word = __bswap16(ee->baseEepHeader.regDmn[0]);
+	ee->baseEepHeader.regDmn[0] = word;
+
+	word = __bswap16(ee->baseEepHeader.regDmn[1]);
+	ee->baseEepHeader.regDmn[1] = word;
+
+	word = __bswap16(ee->baseEepHeader.rfSilent);
+	ee->baseEepHeader.rfSilent = word;
+
+	word = __bswap16(ee->baseEepHeader.blueToothOptions);
+	ee->baseEepHeader.blueToothOptions = word; 
+
+	word = __bswap16(ee->baseEepHeader.deviceCap);
+	ee->baseEepHeader.deviceCap = word;
+
+	/* convert Modal Eep header */
+	pModal = &ee->modalHeader;
+
+	/* XXX linux/ah_osdep.h only defines __bswap32 for BE */
+	integer = __bswap32(pModal->antCtrlCommon);
+	pModal->antCtrlCommon = integer;
+
+	for (i = 0; i < AR5416_4K_MAX_CHAINS; i++) {
+		integer = __bswap32(pModal->antCtrlChain[i]);
+		pModal->antCtrlChain[i] = integer;
+	}
+
+	for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) {
+		word = __bswap16(pModal->spurChans[i].spurChan);
+		pModal->spurChans[i].spurChan = word;
+	}
+}
+
+static uint16_t 
+v4kEepromGetSpurChan(struct ath_hal *ah, int ix, HAL_BOOL is2GHz)
+{ 
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+	
+	HALASSERT(0 <= ix && ix <  AR5416_EEPROM_MODAL_SPURS);
+	HALASSERT(is2GHz);
+	return ee->ee_base.modalHeader.spurChans[ix].spurChan;
+}
+
+/**************************************************************************
+ * fbin2freq
+ *
+ * Get channel value from binary representation held in eeprom
+ * RETURNS: the frequency in MHz
+ */
+static uint16_t
+fbin2freq(uint8_t fbin, HAL_BOOL is2GHz)
+{
+	/*
+	 * Reserved value 0xFF provides an empty definition both as
+	 * an fbin and as a frequency - do not convert
+	 */
+	if (fbin == AR5416_BCHAN_UNUSED)
+		return fbin;
+	return (uint16_t)((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin));
+}
+
+/*
+ * Copy EEPROM Conformance Testing Limits contents 
+ * into the allocated space
+ */
+/* USE CTLS from chain zero */ 
+#define CTL_CHAIN	0 
+
+static void
+v4kEepromReadCTLInfo(struct ath_hal *ah, HAL_EEPROM_v4k *ee)
+{
+	RD_EDGES_POWER *rep = ee->ee_rdEdgesPower;
+	int i, j;
+	
+	HALASSERT(AR5416_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES);
+
+	for (i = 0; ee->ee_base.ctlIndex[i] != 0 && i < AR5416_4K_NUM_CTLS; i++) {
+		for (j = 0; j < NUM_EDGES; j ++) {
+			/* XXX Confirm this is the right thing to do when an invalid channel is stored */
+			if (ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) {
+				rep[j].rdEdge = 0;
+				rep[j].twice_rdEdgePower = 0;
+				rep[j].flag = 0;
+			} else {
+				rep[j].rdEdge = fbin2freq(
+				    ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel,
+				    (ee->ee_base.ctlIndex[i] & CTL_MODE_M) != CTL_11A);
+				rep[j].twice_rdEdgePower = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_POWER);
+				rep[j].flag = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_FLAG) != 0;
+			}
+		}
+		rep += NUM_EDGES;
+	}
+	ee->ee_numCtls = i;
+	HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM,
+	    "%s Numctls = %u\n",__func__,i);
+}
+
+/*
+ * Reclaim any EEPROM-related storage.
+ */
+static void
+v4kEepromDetach(struct ath_hal *ah)
+{
+	HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+
+	ath_hal_free(ee);
+	AH_PRIVATE(ah)->ah_eeprom = AH_NULL;
+}
+
+#define owl_get_eep_ver(_ee)   \
+    (((_ee)->ee_base.baseEepHeader.version >> 12) & 0xF)

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


More information about the svn-src-user mailing list