Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2008 18:16:08 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 150130 for review
Message-ID:  <200809191816.m8JIG8pE001686@repoman.freebsd.org>

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

Change 150130 by sam@sam_ebb on 2008/09/19 18:15:23

	eliminate hardwired lists; use the media type to autoconfig

Affected files ...

.. //depot/projects/vap/tools/tools/net80211/scripts/config#7 edit

Differences ...

==== //depot/projects/vap/tools/tools/net80211/scripts/config#7 (text+ko) ====

@@ -4,17 +4,31 @@
 # $FreeBSD$
 #
 
+media_type()
+{
+	ifconfig $1 2>/dev/null | while read line; do
+		case "$line" in
+		*media:?Ethernet*)
+			echo 802.3
+			;;
+		*media:?IEEE?802.11*)
+			echo 802.11
+			;;
+		esac
+	done
+}
+
 #
 # Auto-detect WIRED and WIRELESS.
 # NB: takes first device of each type; to fix
 #     either specify them before . config.
 #
 for i in `ifconfig -l`; do
-	case $i in
-	bge*|em*|re*|nfe*|fxp*|vr*|msk*|tx*|dc*)
+	case `media_type $i`  in
+	802.3)
 		test -z "$WIRED" && WIRED=$i
 		;;
-	ath*|ral*|zyd*|ural*|rum*|bwi*)
+	802.11)
 		test -z "$WIRELESS" && WIRELESS=$i
 		;;
 	esac



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