Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jan 2009 21:05:36 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r186978 - in projects/vap7: etc etc/defaults etc/rc.d sbin/ifconfig tools/tools/ath tools/tools/ath/athdebug tools/tools/ath/athkey tools/tools/ath/athpow tools/tools/ath/athprom tools/...
Message-ID:  <200901092105.n09L5ak0068932@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Fri Jan  9 21:05:36 2009
New Revision: 186978
URL: http://svn.freebsd.org/changeset/base/186978

Log:
  first cut at merging vap/wireless-related support from HEAD:
  o ifconfig
  o tools (net80211, atH)
  o wpa_supplicant
  o hostapd
  o rc support

Added:
  projects/vap7/etc/regdomain.xml
     - copied, changed from r178355, head/etc/regdomain.xml
  projects/vap7/sbin/ifconfig/regdomain.c
     - copied, changed from r178354, head/sbin/ifconfig/regdomain.c
  projects/vap7/sbin/ifconfig/regdomain.h
     - copied, changed from r178354, head/sbin/ifconfig/regdomain.h
  projects/vap7/tools/tools/ath/Makefile.inc
     - copied unchanged from r186961, head/tools/tools/ath/Makefile.inc
  projects/vap7/tools/tools/ath/athkey/
     - copied from r186961, head/tools/tools/ath/athkey/
  projects/vap7/tools/tools/ath/athpow/
     - copied from r186961, head/tools/tools/ath/athpow/
  projects/vap7/tools/tools/ath/athprom/
     - copied from r186961, head/tools/tools/ath/athprom/
  projects/vap7/tools/tools/ath/athregs/
     - copied from r186961, head/tools/tools/ath/athregs/
  projects/vap7/tools/tools/ath/common/
     - copied from r186961, head/tools/tools/ath/common/
  projects/vap7/tools/tools/net80211/scripts/
     - copied from r186961, head/tools/tools/net80211/scripts/
  projects/vap7/tools/tools/net80211/wlanwds/
     - copied from r186961, head/tools/tools/net80211/wlanwds/
  projects/vap7/usr.sbin/wpa/wpa_supplicant/driver_wired.c
     - copied unchanged from r178358, head/usr.sbin/wpa/wpa_supplicant/driver_wired.c
Modified:
  projects/vap7/etc/   (props changed)
  projects/vap7/etc/Makefile
  projects/vap7/etc/defaults/rc.conf
  projects/vap7/etc/network.subr
  projects/vap7/etc/pccard_ether
  projects/vap7/etc/rc.d/hostapd
  projects/vap7/etc/rc.d/netif
  projects/vap7/etc/rc.d/wpa_supplicant
  projects/vap7/sbin/ifconfig/   (props changed)
  projects/vap7/sbin/ifconfig/Makefile
  projects/vap7/sbin/ifconfig/ifconfig.8
  projects/vap7/sbin/ifconfig/ifconfig.c
  projects/vap7/sbin/ifconfig/ifieee80211.c
  projects/vap7/sbin/ifconfig/ifmedia.c
  projects/vap7/sbin/ifconfig/ifvlan.c
  projects/vap7/tools/tools/ath/   (props changed)
  projects/vap7/tools/tools/ath/Makefile
  projects/vap7/tools/tools/ath/athdebug/Makefile
  projects/vap7/tools/tools/ath/athdebug/athdebug.c
  projects/vap7/tools/tools/ath/athstats/Makefile
  projects/vap7/tools/tools/ath/athstats/athstats.c
  projects/vap7/tools/tools/ath/athstats/athstats.h
  projects/vap7/tools/tools/ath/athstats/main.c
  projects/vap7/tools/tools/ath/athstats/statfoo.c
  projects/vap7/tools/tools/ath/athstats/statfoo.h
  projects/vap7/tools/tools/net80211/   (props changed)
  projects/vap7/tools/tools/net80211/Makefile
  projects/vap7/tools/tools/net80211/README
  projects/vap7/tools/tools/net80211/wlanstats/main.c
  projects/vap7/tools/tools/net80211/wlanstats/statfoo.c
  projects/vap7/tools/tools/net80211/wlanstats/statfoo.h
  projects/vap7/tools/tools/net80211/wlanstats/wlanstats.c
  projects/vap7/tools/tools/net80211/wlanstats/wlanstats.h
  projects/vap7/tools/tools/net80211/wlanwatch/wlanwatch.c
  projects/vap7/usr.sbin/wlandebug/   (props changed)
  projects/vap7/usr.sbin/wlandebug/wlandebug.8
  projects/vap7/usr.sbin/wlandebug/wlandebug.c
  projects/vap7/usr.sbin/wpa/   (props changed)
  projects/vap7/usr.sbin/wpa/hostapd/Makefile
  projects/vap7/usr.sbin/wpa/hostapd/driver_freebsd.c
  projects/vap7/usr.sbin/wpa/wpa_supplicant/   (props changed)
  projects/vap7/usr.sbin/wpa/wpa_supplicant/Packet32.c
  projects/vap7/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c

Modified: projects/vap7/etc/Makefile
==============================================================================
--- projects/vap7/etc/Makefile	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/Makefile	Fri Jan  9 21:05:36 2009	(r186978)
@@ -17,7 +17,7 @@ BIN1=	amd.map apmd.conf auth.conf \
 	portsnap.conf pf.os phones profile protocols \
 	rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \
 	rc.sendmail rc.shutdown \
-	rc.subr remote rpc services shells \
+	rc.subr regdomain.xml remote rpc services shells \
 	snmpd.config sysctl.conf syslog.conf \
 	etc.${MACHINE_ARCH}/ttys \
 	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
@@ -49,6 +49,10 @@ SSH=	${.CURDIR}/../crypto/openssh/ssh_co
 SSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
 .endif
 
+.if ${MK_WIRELESS} != "no"
+BIN1+= regdomain.xml
+.endif
+
 # -rwxr-xr-x root:wheel, for the new cron root:wheel
 BIN2=	netstart pccard_ether rc.suspend rc.resume
 

Modified: projects/vap7/etc/defaults/rc.conf
==============================================================================
--- projects/vap7/etc/defaults/rc.conf	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/defaults/rc.conf	Fri Jan  9 21:05:36 2009	(r186978)
@@ -103,7 +103,7 @@ dhclient_flags=""		# Extra flags to pass
 #dhclient_flags_fxp0=""		# Extra dhclient flags for fxp0 only
 background_dhclient="NO"	# Start dhcp client in the background.
 #background_dhclient_fxp0="YES"	# Start dhcp client on fxp0 in the background.
-synchronous_dhclient="YES"	# Start dhclient directly on configured
+synchronous_dhclient="NO"	# Start dhclient directly on configured
 				# interfaces during startup.
 firewall_enable="NO"		# Set to YES to enable firewall functionality
 firewall_script="/etc/rc.firewall" # Which script to run to set up the firewall
@@ -185,12 +185,14 @@ tcp_drop_synfin="NO"		# Set to YES to dr
 icmp_drop_redirect="NO" 	# Set to YES to ignore ICMP REDIRECT packets
 icmp_log_redirect="NO"		# Set to YES to log ICMP REDIRECT packets
 network_interfaces="auto"	# List of network interfaces (or "auto").
+if_up_delay="30"		# Time to wait for interfaces to come up.
 cloned_interfaces=""		# List of cloned network interfaces to create.
 #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config.
 ifconfig_lo0="inet 127.0.0.1"	# default loopback device configuration.
 #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
 #ifconfig_ed0_ipx="ipx 0x00010010"	# Sample IPX address family entry.
 #ifconfig_fxp0_name="net0"	# Change interface name from fxp0 to net0.
+#vaps_ath0="wlan0"		# VAP interfaces for ath0 device
 #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.
 #
 #autobridge_interfaces="bridge0"	# List of bridges to check 

Modified: projects/vap7/etc/network.subr
==============================================================================
--- projects/vap7/etc/network.subr	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/network.subr	Fri Jan  9 21:05:36 2009	(r186978)
@@ -30,6 +30,48 @@
 # Requires that rc.conf be loaded first.
 #
 
+# ifn_start ifn
+# Bring up and configure an interface.  If some configuration is applied
+# print the interface configuration.
+#
+ifn_start()
+{
+	local ifn cfg
+	ifn="$1"
+	cfg=1
+
+	[ -z "$ifn" ] && err 1 "ifn_start called without an interface"
+
+	ifscript_up ${ifn} && cfg=0
+	ifconfig_up ${ifn} && cfg=0
+	ipv4_up ${ifn} && cfg=0
+	ipx_up ${ifn} && cfg=0
+	childif_create ${ifn}
+
+	return $cfg
+}
+
+# ifn_start ifn
+# Shutdown and de-configure an interface.  If action is taken print the
+# interface name.
+#
+ifn_stop()
+{
+	local ifn cfg
+	ifn="$1"
+	cfg=1
+
+	[ -z "$ifn" ] && return 1
+
+	ipx_down ${ifn} && cfg=0
+	ipv4_down ${ifn} && cfg=0
+	ifconfig_down ${ifn} && cfg=0
+	ifscript_down ${ifn} && cfg=0
+	childif_destroy ${ifn}
+
+	return $cfg
+}
+
 # ifconfig_up if
 #	Evaluate ifconfig(8) arguments for interface $if and
 #	run ifconfig(8) with those arguments. It returns 0 if
@@ -43,8 +85,8 @@ ifconfig_up()
 
 	ifconfig_args=`ifconfig_getargs $1`
 	if [ -n "${ifconfig_args}" ]; then
-		ifconfig $1 up
 		ifconfig $1 ${ifconfig_args}
+		ifconfig $1 up
 		_cfg=0
 	fi
 
@@ -426,7 +468,7 @@ clone_up()
 	_prefix=
 	_list=
 	for ifn in ${cloned_interfaces}; do
-		ifconfig ${ifn} create
+		ifconfig ${ifn} create `get_if_var ${ifn} create_args_IF`
 		if [ $? -eq 0 ]; then
 			_list="${_list}${_prefix}${ifn}"
 			[ -z "$_prefix" ] && _prefix=' '
@@ -452,6 +494,45 @@ clone_down()
 	debug "Destroyed clones: ${_list}"
 }
 
+# Create and configure child interfaces.
+# Return 0 if child interfaces are created.
+#
+childif_create()
+{
+	local cfg child child_wlans create_args ifn i
+	cfg=1
+
+	ifn=$1
+
+	# Create wireless interfaces
+	child_wlans=`get_if_var $ifn wlans_IF`
+
+	for child in ${child_wlans}; do
+		create_args="wlandev $ifn `get_if_var $child create_args_IF`"
+		if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then
+			ifconfig $child create ${create_args} && cfg=0
+		else
+			i=`ifconfig wlan create ${create_args}`
+			ifconfig $i name $child && cfg=0
+		fi
+		ifn_start $child
+	done
+
+	return ${cfg}
+}
+
+# Destroy child interfaces.
+#
+childif_destroy()
+{
+	local cfg child child_wlans ifn
+
+	child_wlans="`get_if_var $ifn wlans_IF` `get_if_var $ifn vaps_IF`"
+	for child in ${child_wlans}; do
+		ifconfig $child destroy && cfg=0
+	done
+}
+
 # Create netgraph nodes.
 #
 ng_mkpeer() {
@@ -676,6 +757,29 @@ list_net_interfaces()
 	return 0
 }
 
+# get_default_if -address_family
+#	Get the interface of the default route for the given address family.
+#	The -address_family argument must be suitable passing to route(8).
+#
+get_default_if()
+{
+	routeget="`route -n get $1 default 2>/dev/null`"
+	oldifs="$IFS"
+	IFS="
+"
+	defif=
+	for line in $routeget ; do
+		case $line in
+		*interface:*)
+			defif=${line##*: }
+			;;
+		esac
+	done
+	IFS=${oldifs}
+
+	echo $defif
+}
+
 hexdigit()
 {
 	if [ $1 -lt 10 ]; then

Modified: projects/vap7/etc/pccard_ether
==============================================================================
--- projects/vap7/etc/pccard_ether	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/pccard_ether	Fri Jan  9 21:05:36 2009	(r186978)
@@ -78,7 +78,7 @@ pccard_ether_start()
 		done
 	fi
 
-	/etc/rc.d/netif start $ifn
+	/etc/rc.d/netif quietstart $ifn
 
 	# Do route configuration if needed.
 	# XXX: should probably do this by calling rc.d/routing.
@@ -99,7 +99,7 @@ pccard_ether_stop()
 		fi
 	fi
 
-	/etc/rc.d/netif stop $ifn
+	/etc/rc.d/netif quietstop $ifn
 
 	# clean ARP table
 	ifexists $ifn && arp -d -i $ifn -a

Modified: projects/vap7/etc/rc.d/hostapd
==============================================================================
--- projects/vap7/etc/rc.d/hostapd	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/rc.d/hostapd	Fri Jan  9 21:05:36 2009	(r186978)
@@ -18,6 +18,7 @@ pidfile="/var/run/${name}.pid"
 
 command_args="-P ${pidfile} -B ${conf_file}"
 required_files="${conf_file}"
+required_modules="wlan_xauth wlan_wep wlan_tkip wlan_ccmp"
 extra_commands="reload"
 
 load_rc_config ${name}

Modified: projects/vap7/etc/rc.d/netif
==============================================================================
--- projects/vap7/etc/rc.d/netif	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/rc.d/netif	Fri Jan  9 21:05:36 2009	(r186978)
@@ -68,7 +68,30 @@ network_start()
 	fi
 
 	# Configure the interface(s).
-	network_common ifn_start verbose
+	network_common ifn_start
+
+	if [ -z "$cmdifn" ]; then
+		dhcp_interfaces=`list_net_interfaces dhcp`
+		if [ -n "${dhcp_interfaces}" ]; then
+			delay=${if_up_delay}
+			while [ ${delay} -gt 0 ]; do
+				defif=`get_default_if -inet`
+				if [ -n "${defif}" ]; then
+					if [ ${delay} -ne ${if_up_delay} ]; then
+						echo "($defif)"
+					fi
+					break
+				fi
+				if [ ${delay} -eq ${if_up_delay} ]; then
+					echo -n "Waiting for an interface to come up: "
+				else
+					echo -n .
+				fi
+				sleep 1
+				delay=`expr $delay - 1`
+			done
+		fi
+	fi
 
 	if [ -f /etc/rc.d/ipfilter ] ; then
 		# Resync ipfilter
@@ -85,100 +108,67 @@ network_stop()
 	#
 	cmdifn=$*
 
-	echo -n "Stopping network:"
-
 	# Deconfigure the interface(s)
 	network_common ifn_stop
-	echo '.'
 }
 
-# network_common routine verbose
+# network_common routine
 #	Common configuration subroutine for network interfaces. This
 #	routine takes all the preparatory steps needed for configuriing
-#	an interface and then calls $routine. If $verbose is specified,
-#	it will call ifconfig(8) to show, in long format, the configured
-#	interfaces. If $verbose is not given, it will simply output the
-#	configured interface(s).
+#	an interface and then calls $routine.
 network_common()
 {
-	local _cooked_list _fail _func _verbose
+	local _cooked_list _fail _func _ok _str
 
 	_func=
-	_verbose=
 
 	if [ -z "$1" ]; then
 		err 1 "network_common(): No function name specified."
 	else
 		_func="$1"
 	fi
-	[ -n "$2" ] && _verbose=yes
 
 	# Set the scope of the command (all interfaces or just one).
 	#
 	_cooked_list=
 	if [ -n "$cmdifn" ]; then
-		# Don't check that the interfaces exist.  We need to run
+		# Don't check that the interface(s) exist.  We need to run
 		# the down code even when the interface doesn't exist to
 		# kill off wpa_supplicant.
+		# XXXBED: is this really true or does wpa_supplicant die?
+		# if so, we should get rid of the devd entry
 		_cooked_list="$cmdifn"
 	else
 		_cooked_list="`list_net_interfaces`"
 	fi
 
 	_fail=
+	_ok=
 	for ifn in ${_cooked_list}; do
-		if ${_func} ${ifn} ; then
-			eval showstat_$ifn=1
+		if ${_func} ${ifn} $2; then
+			_ok="${_ok} ${ifn}"
 		else
-			_fail="$_fail $ifn"
+			_fail="${_fail} ${ifn}"
 		fi
 	done
 
-	# Display interfaces configured by this script
-	#
-	for ifn in ${_cooked_list}; do
-		eval showstat=\$showstat_${ifn}
-		if [ ! -z ${showstat} ]; then
-			if [ -n "$_verbose" ]; then
-				ifconfig ${ifn}
-			else
-				echo -n " ${ifn}"
-			fi
+	_str=
+	if [ -n "${_ok}" ]; then
+		case ${_func} in
+		ifn_start)
+			_str='Starting'
+			;;
+		ifn_stop)
+			_str='Stopping'
+			;;
+		esac
+		echo "${_str} Network:${_ok}."
+		if [ -z "${rc_quiet}" ]; then
+			/sbin/ifconfig ${_ok}
 		fi
-	done
-	debug "The following interfaces were not configured: $_fail"
-}
-
-ifn_start()
-{
-	local ifn cfg
-	ifn="$1"
-	cfg=1
-
-	[ -z "$ifn" ] && return 1
-
-	ifscript_up ${ifn} && cfg=0
-	ifconfig_up ${ifn} && cfg=0
-	ipv4_up ${ifn} && cfg=0
-	ipx_up ${ifn} && cfg=0
-
-	return $cfg
-}
-
-ifn_stop()
-{
-	local ifn cfg
-	ifn="$1"
-	cfg=1
-
-	[ -z "$ifn" ] && return 1
-
-	ipx_down ${ifn} && cfg=0
-	ipv4_down ${ifn} && cfg=0
-	ifconfig_down ${ifn} && cfg=0
-	ifscript_down ${ifn} && cfg=0
+	fi
 
-	return $cfg
+	debug "The following interfaces were not configured: $_fail"
 }
 
 load_rc_config $name

Modified: projects/vap7/etc/rc.d/wpa_supplicant
==============================================================================
--- projects/vap7/etc/rc.d/wpa_supplicant	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/etc/rc.d/wpa_supplicant	Fri Jan  9 21:05:36 2009	(r186978)
@@ -20,12 +20,25 @@ if [ -z "$ifn" ]; then
 	return 1
 fi
 
-case ${ifn} in
-ndis*)
+is_ndis_interface()
+{
+	case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in
+		ndis*) true ;;
+		*) false ;;
+	esac
+}
+
+if is_wired_interface ${ifn} ; then
+	driver="wired"
+elif is_ndis_interface ${ifn} ; then
 	driver="ndis"
 	;;
 *)
-	driver="bsd"
+	if is_wired_interface ${ifn} ; then
+		driver="wired"
+	else
+		driver="bsd"
+	fi
 	;;
 esac
 
@@ -34,5 +47,6 @@ load_rc_config $name
 pidfile="/var/run/${name}/${ifn}.pid"
 command_args="-B -q -i $ifn -c $conf_file -D $driver -P $pidfile"
 required_files=$conf_file
+required_modules="wlan_wep wlan_tkip wlan_ccmp"
 
 run_rc_command "$1"

Copied and modified: projects/vap7/etc/regdomain.xml (from r178355, head/etc/regdomain.xml)
==============================================================================
--- head/etc/regdomain.xml	Sun Apr 20 20:37:02 2008	(r178355, copy source)
+++ projects/vap7/etc/regdomain.xml	Fri Jan  9 21:05:36 2009	(r186978)
@@ -39,7 +39,7 @@
 -->
 <rd id="debug">
   <name>DEBUG</name>
-  <sku>0</sku>
+  <sku>0x1ff</sku>
 </rd>
 
 <rd id="fcc">
@@ -1080,6 +1080,75 @@
     </band>
   </netband>
 </rd>
+
+<rd id="sr9">
+  <name>SR9</name>
+  <sku>0x0298</sku>
+  <defcc ref="SR9"/>
+  <netband mode="11g">
+    <band>
+      <freqband ref="S1_907_922_5"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_907_922_10"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_912_917"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+  </netband>
+</rd>
+
+<rd id="xr9">
+  <name>XR9</name>
+  <sku>0x299</sku>
+  <defcc ref="XR9"/>
+  <netband mode="11g">
+    <band>
+      <freqband ref="S2_907_922_5"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S2_907_922_10"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S2_912_917"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+  </netband>
+</rd>
+
+<rd id="gz901">
+  <name>GZ901</name>
+  <sku>0x29a</sku>
+  <defcc ref="GZ901"/>
+  <netband mode="11g">
+    <band>
+      <freqband ref="S1_908_923_5"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_913_918_10"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+    <band>
+      <freqband ref="S1_913_918"/>
+      <maxpower>30</maxpower>
+      <flags>IEEE80211_CHAN_G</flags>
+    </band>
+  </netband>
+</rd>
 </regulatory-domains>
 
 <country-codes>
@@ -1201,6 +1270,9 @@
 <country id="GT">
   <isocc>320</isocc> <name>Guatemala</name> <rd ref="none"/>
 </country>
+<country id="GZ901">
+  <isocc>5002</isocc> <name>ZComax GZ-901</name> <rd ref="gz901"/>
+</country>
 <country id="HN">
   <isocc>340</isocc> <name>Honduras</name> <rd ref="none"/>
 </country>
@@ -1396,6 +1468,12 @@
 <country id="TR">
   <isocc>792</isocc> <name>Turkey</name> <rd ref="etsi"/>
 </country>
+<country id="SR9">
+  <isocc>5000</isocc> <name>Ubiquiti SR9</name> <rd ref="sr9"/>
+</country>
+<country id="XR9">
+  <isocc>5001</isocc> <name>Ubiquiti XR9</name> <rd ref="xr9"/>
+</country>
 <country id="UA">
   <isocc>804</isocc> <name>Ukraine</name> <rd ref="none"/>
 </country>
@@ -1426,6 +1504,10 @@
 <country id="ZW">
   <isocc>716</isocc> <name>Zimbabwe</name> <rd ref="none"/>
 </country>
+
+<country id="DEBUG">
+  <isocc>0</isocc> <name>Debug</name> <rd ref="debug"/>
+</country>
 </country-codes>
 
 <!--
@@ -1575,6 +1657,61 @@
   <freqstart>2512</freqstart> <freqend>2732</freqend>
   <chanwidth>20</chanwidth> <chansep>5</chansep>
 </freqband>
+
+<freqband id="S1_907_922_5">
+  <freqstart>2422</freqstart> <freqend>2437</freqend>
+  <chanwidth>5</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_QUARTER</flags>
+</freqband>
+<freqband id="S1_907_922_10">
+  <freqstart>2422</freqstart> <freqend>2437</freqend>
+  <chanwidth>10</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_HALF</flags>
+</freqband>
+<freqband id="S1_912_917">
+  <freqstart>2427</freqstart> <freqend>2432</freqend>
+  <chanwidth>20</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+</freqband>
+
+<freqband id="S2_907_922_5">
+  <freqstart>2427</freqstart> <freqend>2442</freqend>
+  <chanwidth>5</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_QUARTER</flags>
+</freqband>
+<freqband id="S2_907_922_10">
+  <freqstart>2427</freqstart> <freqend>2442</freqend>
+  <chanwidth>10</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_HALF</flags>
+</freqband>
+<freqband id="S2_912_917">
+  <freqstart>2432</freqstart> <freqend>2437</freqend>
+  <chanwidth>20</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+</freqband>
+
+<freqband id="S1_908_923_5">
+  <freqstart>2447</freqstart> <freqend>2467</freqend>
+  <chanwidth>5</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_QUARTER</flags>
+</freqband>
+<freqband id="S1_913_918_10">
+  <freqstart>2457</freqstart> <freqend>2462</freqend>
+  <chanwidth>10</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+  <flags>IEEE80211_CHAN_HALF</flags>
+</freqband>
+<freqband id="S1_913_918">
+  <freqstart>2457</freqstart> <freqend>2462</freqend>
+  <chanwidth>20</chanwidth> <chansep>5</chansep>
+  <flags>IEEE80211_CHAN_GSM</flags>
+</freqband>
+
 </shared-frequency-bands>
 
 </regulatory-data>

Modified: projects/vap7/sbin/ifconfig/Makefile
==============================================================================
--- projects/vap7/sbin/ifconfig/Makefile	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/sbin/ifconfig/Makefile	Fri Jan  9 21:05:36 2009	(r186978)
@@ -23,9 +23,12 @@ SRCS+=	ifclone.c		# clone device support
 SRCS+=	ifmac.c			# MAC support
 SRCS+=	ifmedia.c		# SIOC[GS]IFMEDIA support
 SRCS+=	ifvlan.c		# SIOC[GS]ETVLAN support
-SRCS+=	ifieee80211.c		# SIOC[GS]IEEE80211 support
 SRCS+=	ifgre.c			# GRE keys etc
 
+SRCS+=	ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support
+DPADD+=	${LIBBSDXML} ${LIBSBUF}
+LDADD+=	-lbsdxml -lsbuf
+
 SRCS+=	ifcarp.c		# SIOC[GS]VH support
 SRCS+=	ifgroup.c		# ...
 SRCS+=	ifpfsync.c		# pfsync(4) support
@@ -35,8 +38,8 @@ SRCS+=	iflagg.c		# lagg support
 
 .if ${MK_IPX_SUPPORT} != "no" && !defined(RELEASE_CRUNCH)
 SRCS+=	af_ipx.c		# IPX support
-DPADD=	${LIBIPX}
-LDADD=	-lipx
+DPADD+=	${LIBIPX}
+LDADD+=	-lipx
 .endif
 
 MAN=	ifconfig.8

Modified: projects/vap7/sbin/ifconfig/ifconfig.8
==============================================================================
--- projects/vap7/sbin/ifconfig/ifconfig.8	Fri Jan  9 21:04:09 2009	(r186977)
+++ projects/vap7/sbin/ifconfig/ifconfig.8	Fri Jan  9 21:05:36 2009	(r186978)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd June 20, 2008
+.Dd January 7, 2009
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -584,8 +584,143 @@ If the interface was reset when previous
 the hardware will be re-initialized.
 .El
 .Pp
-The following parameters are specific to IEEE 802.11 wireless interfaces:
+The following parameters are specific to cloning
+IEEE 802.11 wireless interfaces with the
+.Cm create
+request:
 .Bl -tag -width indent
+.It Cm wlandev Ar device
+Use
+.Ar device
+as the parent for the cloned device.
+.It Cm wlanmode Ar mode
+Specify the operating mode for this cloned device.
+.Ar mode
+is one of
+.Cm sta ,
+.Cm ahdemo 
+(or
+.Cm adhoc-demo ),
+.Cm ibss ,
+(or
+.Cm adhoc ),
+.Cm ap ,
+(or
+.Cm hostap ),
+.Cm wds ,
+.Cm tdma ,
+and
+.Cm monitor .
+The operating mode of a cloned interface cannot be changed.
+The
+.Cm tdma
+mode is actually implemented as an
+.Cm adhoc-demo
+interface with special properties.
+.It Cm wlanbssid Ar bssid
+The 802.11 mac address to use for the bssid.
+This must be specified at create time for a legacy
+.Cm wds
+device.
+.It Cm wlanaddr Ar address
+The local mac address.
+If this is not specified then a mac address will automatically be assigned
+to the cloned device.
+Typically this address is the same as the address of the parent device
+but if the
+.Cm bssid
+parameter is specified then the driver will craft a unique address for
+the device (if supported).
+.It Cm wdslegacy
+Mark a
+.Cm wds
+device as operating in ``legacy mode''.
+Legacy 
+.Cm wds
+devices have a fixed peer relationship and do not, for example, roam
+if their peer stops communicating.
+For completeness a Dynamic WDS (DWDS) interface may marked as
+.Fl wdslegacy .
+.It Cm bssid
+Request a unique local mac address for the cloned device.
+This is only possible if the device supports multiple mac addresses.
+To force use of the parent's mac address use
+.Fl bssid .
+.It Cm beacons
+Mark the cloned interface as depending on hardware support to
+track received beacons.
+To have beacons tracked in software use
+.Fl beacons .
+For 
+.Cm hostap
+mode 
+.Fl beacons
+can also be used to indicate no beacons should
+be transmitted; this can be useful when creating a WDS configuration but
+.Cm wds
+interfaces can only be created as companions to an access point.
+.El
+.Pp
+The following parameters are specific to IEEE 802.11 wireless interfaces
+cloned with a
+.Cm create
+operation:
+.Bl -tag -width indent
+.It Cm ampdu
+Enable sending and receiving AMPDU frames when using 802.11n (default).
+The 802.11n specification states a compliant station must be capable
+of receiving AMPDU frames but transmision is optional.
+Use
+.Fl ampdu
+to disable all use of AMPDU with 802.11n.
+For testing and/or to work around interoperability problems one can use
+.Cm ampdutx
+and
+.Cm ampdurx
+to control use of AMPDU in one direction.
+.It Cm ampdudensity Ar density
+Set the AMPDU density parameter used when operating with 802.11n.
+This parameter controls the inter-packet gap for AMPDU frames.
+The sending device normally controls this setting but a receiving station
+may request wider gaps.
+Legal values for
+.Ar density
+are 0, .25, .5, 1, 2, 4, 8, and 16 (microseconds).
+A value of
+.Cm -
+is treated the same as 0.
+.It Cm ampdulimit Ar limit
+Set the limit on packet size for receiving AMPDU frames when operating
+with 802.11n.
+Legal values for
+.Ar limit
+are 8192, 16384, 32768, and 65536 but one can also specify
+just the unique prefix: 8, 16, 32, 64.
+Note the sender may limit the size of AMPDU frames to be less
+than the maximum specified by the receiving station.
+.It Cm amsdu
+Enable sending and receiving AMSDU frames when using 802.11n.
+By default AMSDU is received but not transmitted.
+Use
+.Fl amsdu
+to disable all use of AMSDU with 802.11n.
+For testing and/or to work around interoperability problems one can use
+.Cm amsdutx
+and
+.Cm amsdurx
+to control use of AMSDU in one direction.
+.It Cm amsdulimit Ar limit
+Set the limit on packet size for sending and receiving AMSDU frames
+when operating with 802.11n.
+Legal values for
+.Ar limit
+are 7935 and 3839 (bytes).
+Note the sender may limit the size of AMSDU frames to be less
+than the maximum specified by the receiving station.
+Note also that devices are not required to support the 7935 limit,
+only 3839 is required by the specification and the larger value
+may require more memory to be dedicated to support functionality
+that is rarely used.
 .It Cm apbridge
 When operating as an access point, pass packets between
 wireless clients directly (default).
@@ -597,7 +732,7 @@ is useful when traffic is to be processe
 packet filtering.
 .It Cm authmode Ar mode
 Set the desired authentication mode in infrastructure mode.
-Not all adaptors support all modes.
+Not all adapters support all modes.
 The set of
 valid modes is
 .Cm none , open , shared
@@ -725,7 +860,7 @@ or
 .Cm -
 will give you the default for your adaptor.
 Some
-adaptors ignore this setting unless you are in ad-hoc mode.
+adapters ignore this setting unless you are in ad-hoc mode.
 Alternatively the frequency, in megahertz, may be specified
 instead of the channel number.
 .Pp
@@ -770,9 +905,61 @@ a 40MHz HT channel specification may inc
 of the extension channel by appending ``+'' or ``-'' for above and below,
 respectively; e.g. ``2437:ht/40+'' specifies 40MHz wide HT operation 
 with the center channel at frequency 2437 and the extension channel above.
+.It Cm country Ar name
+Set the country code to use in calculating the regulatory constraints
+for operation.
+In particular the set of available channels, how the wireless device
+will operation on the channels, and the maximum transmit power that
+can be used on a channel are defined by this setting.
+Country/Region codes are specified as a 2-character abbreviation
+defined by ISO 3166 or using a longer, but possibly ambiguous, spelling;
+e.g. "ES" and "Spain".
+The set of country codes are taken from /etc/regdomain.xml and can also
+be viewed with the ``list countries'' request.
+Note that not all devices support changing the country code from a default
+setting; typically stored in EEPROM.
+See also
+.Cm regdomain ,
+.Cm indoor ,
+.Cm outdoor ,
+and
+.Cm anywhere .
+.It Cm dfs
+Enable Dynamic Frequency Selection (DFS) as specified in 802.11h.
+DFS embodies several facilities including detection of overlapping
+radar signals, dynamic transmit power control, and channel selection
+according to a least-congested criteria.
+DFS support is mandatory for some 5Ghz frequencies in certain
+locales (e.g. ETSI).
+By default DFS is enabled according to the regulatory definitions
+specified in /etc/regdomain.xml and the curent country code, regdomain,
+and channel.
+Note the underlying device (and driver) must support radar detection
+for full DFS support to work.
+To be fully compliant with the local regulatory agency frequencies that
+require DFS should not be used unless it is fully supported.
+Use
+.Fl dfs
+to disable this functionality for testing.
+.It Cm dotd
+Enable support for the 802.11d specification (default).
+When this support is enabled in station mode, beacon frames that advertise
+a country code different than the currently configured country code will
+cause an event to be dispatched to user applications.
+This event can be used by the station to adopt that country code and
+operate according to the associated regulatory constraints.
+When operating as an access point with 802.11d enabled the beacon and
+probe response frames transmitted will advertise the current regulatory
+domain settings.
+To disable 802.11d use
+.Fl dotd .
 .It Cm doth
-Enable inclusion of an 802.11h country information element in beacon
-frames transmitted when operating as an access point.
+Enable 802.11h support including spectrum management.
+When 802.11h is enabled beacon and probe response frames will have
+the SpectrumMgt bit set in the capabilities field and
+country and power constraint information elements will be present.
+802.11h support also includes handling Channel Switch Announcements (CSA)
+which are a mechanism to coordinate channel changes by an access point.
 By default 802.11h is enabled if the device is capable.
 To disable 802.11h use
 .Fl doth .
@@ -811,6 +998,48 @@ channels depending on the regulatory con
 command to identify the channels where turbo mode may be used.
 To disable Dynamic Turbo mode use
 .Fl dturbo .
+.It Cm dwds
+Enable Dynamic WDS (DWDS) support.
+DWDS is a facility by which 4-address traffic can be carried between
+stations operating in infrastructure mode.
+A station first associates to an access point and authenticates using
+normal procedures (e.g. WPA).
+Then 4-address frames are passed to carry traffic for stations
+operating on either side of the wireless link.
+DWDS extends the normal WDS mechanism by leveraging existing security
+protocols and eliminating static binding.
+.Pp
+When DWDS is enabled on an access point 4-address frames received from
+an authorized station will generate a ``DWDS discovery'' event to user
+applications.
+This event should be used to create a WDS interface that is bound
+to the remote station (and usually plumbed into a bridge).
+Once the WDS interface is up and running 4-address traffic then logically
+flows through that interface.
+.Pp
+When DWDS is enabled on a station, traffic with a destination address
+different from the peer station are encapsulated in a 4-address frame
+and transmitted to the peer.
+All 4-address traffic uses the security information of the stations
+(e.g. cryptographic keys).
+A station is associated using 802.11n facilities may transport
+4-address traffic using these same mechanisms; this depends on available
+resources and capabilities of the device.
+The DWDS implementation guards against layer 2 routing loops of
+multicast traffic.
+.It Cm ff
+Enable the use of Atheros Fast Frames when communicating with
+another Fast Frames-capable station.
+Fast Frames are an encapsulation technique by which two 802.3
+frames are transmitted in a single 802.11 frame.
+This can noticeably improve throughput but requires that the
+receiving station understand how to decapsulate the frame.
+Fast frame use is negotiated using the Atheros 802.11 vendor-specific
+protocol extension so enabling use is safe when communicating with
+non-Atheros devices.
+By default, use of fast frames is enabled if the device is capable.
+To explicitly disable fast frames, use
+.Fl ff .
 .It Cm fragthreshold Ar length
 Set the threshold for which transmitted frames are broken into fragments.
 The
@@ -824,7 +1053,7 @@ to
 or
 .Cm -
 disables transmit fragmentation.
-Not all adaptors honor the fragmentation threshold.
+Not all adapters honor the fragmentation threshold.
 .It Cm hidessid
 When operating as an access point, do not broadcast the SSID
 in beacon frames or respond to probe request frames unless
@@ -833,19 +1062,76 @@ By default, the SSID is included in beac
 undirected probe request frames are answered.
 To re-enable the broadcast of the SSID etc., use
 .Fl hidessid .
-.It Cm ff
-Enable the use of Atheros Fast Frames when communicating with
-another Fast Frames-capable station.
-Fast Frames are an encapsulation technique by which two 802.3
-frames are transmitted in a single 802.11 frame.
-This can noticeably improve throughput but requires that the
-receiving station understand how to decapsulate the frame.
-Fast frame use is negotiated using the Atheros 802.11 vendor-specific
-protocol extension so enabling use is safe when communicating with
-non-Atheros devices.
-By default, use of fast frames is enabled if the device is capable.
-To explicitly disable fast frames, use
-.Fl ff .
+.It Cm ht
+Enable use of High Throughput (HT) when using 802.11n (default).
+The 802.11n specification includes mechanisms for operation
+on 20MHz and 40MHz wide channels using different signalling mechanisms
+than specified in 802.11b, 802.11g, and 802.11a.
+Stations negotiate use of these facilities, termed HT20 and HT40,
+when they associate.
+To disable all use of 802.11n use
+.Fl ht .
+To disable use of HT20 (e.g. to force only HT40 use) use
+.Fl ht20 .
+To disable use of HT40 use
+.Fl ht40 .
+.Pp
+HT configuration is used to ``auto promote'' operation
+when several choices are available.
+For example, if a station associates to an 11n-capable access point
+it controls whether the station uses legacy operation, HT20, or HT40.
+When an 11n-capable device is setup as an access point and
+Auto Channel Selection is used to locate a channel to operate on,
+HT configuration controls whether legacy, HT20, or HT40 operation is setup
+on the selected channel.
+If a fixed channel is specified for a station then HT configuration can
+be given as part of the channel specification; e.g. 6:ht/20 to setup
+HT20 operation on channel 6.
+.It Cm htcompat
+Enable use of compatibility support for pre-802.11n devices (default).
+The 802.11n protocol specification went through several incompatible iterations.
+Some vendors implemented 11n support to older specifications that
+will not interoperate with a purely 11n-compliant station.
+In particular the information elements included in management frames
+for old devices are different.
+When compatibility support is enabled both standard and compatible data
+will be provided.
+Stations that associate using the compatiblity mechanisms are flagged
+in ``list sta''.
+To disable compatiblity support use
+.Fl htcompat .
+.It Cm htprotmode Ar technique
+For interfaces operating in 802.11n, use the specified
+.Ar technique
+for protecting HT frames in a mixed legacy/HT network.
+The set of valid techniques is
+.Cm off ,
+and
+.Cm rts
+(RTS/CTS, default).
+Technique names are case insensitive.
+.It Cm inact
+Enable inactivity processing for stations associated to an
+access point (default).
+When operating as an access point the 802.11 layer monitors
+the activity of each associated station.
+When a station is inactive for 5 minutes it will send several
+``probe frames'' to see if the station is still present.

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



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