Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2007 21:42:09 GMT
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 120347 for review
Message-ID:  <200705242142.l4OLg98K026890@repoman.freebsd.org>

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

Change 120347 by thompsa@thompsa_heff on 2007/05/24 21:41:28

	IFC for the clock_lock fix.

Affected files ...

.. //depot/projects/wifi/MAINTAINERS#16 integrate
.. //depot/projects/wifi/crypto/openssl/crypto/asn1/asn1.h#3 integrate
.. //depot/projects/wifi/crypto/openssl/crypto/ocsp/ocsp.h#3 integrate
.. //depot/projects/wifi/crypto/openssl/crypto/pem/pem.h#4 integrate
.. //depot/projects/wifi/etc/network.subr#11 integrate
.. //depot/projects/wifi/lib/libutil/flopen.c#2 integrate
.. //depot/projects/wifi/sbin/ifconfig/ifconfig.8#24 integrate
.. //depot/projects/wifi/sbin/ifconfig/ifconfig.c#21 integrate
.. //depot/projects/wifi/share/man/man4/bge.4#12 integrate
.. //depot/projects/wifi/share/man/man4/ng_car.4#2 integrate
.. //depot/projects/wifi/sys/amd64/amd64/support.S#7 integrate
.. //depot/projects/wifi/sys/amd64/linux32/linux32_support.s#1 branch
.. //depot/projects/wifi/sys/arm/arm/genassym.c#7 integrate
.. //depot/projects/wifi/sys/arm/arm/vm_machdep.c#16 integrate
.. //depot/projects/wifi/sys/arm/at91/kb920x_machdep.c#4 integrate
.. //depot/projects/wifi/sys/arm/conf/AVILA#3 integrate
.. //depot/projects/wifi/sys/arm/conf/AVILA.hints#1 branch
.. //depot/projects/wifi/sys/arm/xscale/i80321/ep80219_machdep.c#3 integrate
.. //depot/projects/wifi/sys/arm/xscale/i80321/iq31244_machdep.c#17 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/avila_ata.c#4 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/avila_machdep.c#4 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/if_npe.c#5 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/ixp425.c#5 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/ixp425_npe.c#4 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/ixp425_npevar.h#2 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/ixp425var.h#3 integrate
.. //depot/projects/wifi/sys/arm/xscale/ixp425/uart_bus_ixp425.c#2 integrate
.. //depot/projects/wifi/sys/cam/cam.c#4 integrate
.. //depot/projects/wifi/sys/cam/scsi/scsi_all.c#6 integrate
.. //depot/projects/wifi/sys/compat/freebsd32/freebsd32_misc.c#15 integrate
.. //depot/projects/wifi/sys/compat/linux/linux_futex.c#4 integrate
.. //depot/projects/wifi/sys/compat/opensolaris/sys/dnlc.h#1 branch
.. //depot/projects/wifi/sys/conf/files.amd64#23 integrate
.. //depot/projects/wifi/sys/conf/files.i386#27 integrate
.. //depot/projects/wifi/sys/conf/files.pc98#18 integrate
.. //depot/projects/wifi/sys/contrib/opensolaris/uts/common/fs/dnlc.c#4 delete
.. //depot/projects/wifi/sys/contrib/opensolaris/uts/common/fs/gfs.c#3 integrate
.. //depot/projects/wifi/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#4 integrate
.. //depot/projects/wifi/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c#2 integrate
.. //depot/projects/wifi/sys/contrib/opensolaris/uts/common/sys/dnlc.h#2 delete
.. //depot/projects/wifi/sys/dev/bge/if_bge.c#24 integrate
.. //depot/projects/wifi/sys/dev/bge/if_bgereg.h#16 integrate
.. //depot/projects/wifi/sys/dev/em/if_em.c#24 integrate
.. //depot/projects/wifi/sys/dev/mxge/if_mxge.c#9 integrate
.. //depot/projects/wifi/sys/dev/mxge/if_mxge_var.h#6 integrate
.. //depot/projects/wifi/sys/dev/pci/pci_pci.c#13 integrate
.. //depot/projects/wifi/sys/i386/i386/support.s#6 integrate
.. //depot/projects/wifi/sys/i386/linux/linux_support.s#1 branch
.. //depot/projects/wifi/sys/kern/kern_clock.c#11 integrate
.. //depot/projects/wifi/sys/kern/kern_sig.c#18 integrate
.. //depot/projects/wifi/sys/kern/subr_bus.c#22 integrate
.. //depot/projects/wifi/sys/kern/uipc_mqueue.c#7 integrate
.. //depot/projects/wifi/sys/kern/vfs_cache.c#12 integrate
.. //depot/projects/wifi/sys/modules/linux/Makefile#7 integrate
.. //depot/projects/wifi/sys/modules/zfs/Makefile#3 integrate
.. //depot/projects/wifi/sys/net/route.c#10 integrate
.. //depot/projects/wifi/sys/netinet/tcp.h#13 integrate
.. //depot/projects/wifi/sys/netinet/tcp_subr.c#30 integrate
.. //depot/projects/wifi/sys/security/audit/audit.c#5 integrate
.. //depot/projects/wifi/sys/sun4v/sun4v/machdep.c#3 integrate
.. //depot/projects/wifi/sys/sun4v/sun4v/pmap.c#4 integrate
.. //depot/projects/wifi/sys/sys/lock_profile.h#4 integrate
.. //depot/projects/wifi/sys/ufs/ufs/ufs_vnops.c#25 integrate
.. //depot/projects/wifi/tools/regression/usr.sbin/sa/prime.sh#2 integrate

Differences ...

==== //depot/projects/wifi/MAINTAINERS#16 (text+ko) ====

@@ -1,4 +1,4 @@
-$FreeBSD: src/MAINTAINERS,v 1.144 2007/04/26 21:30:16 imp Exp $
+$FreeBSD: src/MAINTAINERS,v 1.145 2007/05/23 21:47:19 jfv Exp $
 
 Please note that the content of this file is strictly advisory.
 No locks listed here are valid.  The only strict review requirements
@@ -51,7 +51,7 @@
 pass(4)		ken	Pre-commit review requested.
 ch(4)		ken	Pre-commit review requested.
 isp(4)		mjacob	Pre-commit review requested.
-em(4)		tackerman	Pre-commit review requested.
+em(4)		jfv	Pre-commit review requested.
 tdfx(4)		cokane  Just keep me informed of changes, try not to break it.
 sendmail	gshapiro	Pre-commit review requested.
 etc/mail	gshapiro	Pre-commit review requested.

==== //depot/projects/wifi/crypto/openssl/crypto/asn1/asn1.h#3 (text+ko) ====

@@ -903,22 +903,22 @@
 /* Used to implement other functions */
 void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
 #define ASN1_dup_of(type,i2d,d2i,x) \
-	((type *(*)(I2D_OF(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
+	((type *)ASN1_dup((i2d_of_void *)(i2d), (d2i_of_void *)(d2i), (char *)(x)))
 #define ASN1_dup_of_const(type,i2d,d2i,x) \
-	((type *(*)(I2D_OF_const(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
+	((type *)ASN1_dup((i2d_of_void *)(i2d), (d2i_of_void *)(d2i), (char *)(x)))
 
 void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
 
 #ifndef OPENSSL_NO_FP_API
 void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x);
 #define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
-	((type *(*)(type *(*)(void),D2I_OF(type),FILE *,type **))openssl_fcast(ASN1_d2i_fp))(xnew,d2i,in,x)
+	((type *)ASN1_d2i_fp((void *(*)(void))(xnew), (d2i_of_void *)(d2i), (in), (void **)(x)))
 void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
 int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x);
 #define ASN1_i2d_fp_of(type,i2d,out,x) \
-	((int (*)(I2D_OF(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
+	(ASN1_i2d_fp((i2d_of_void *)(i2d), (out), (x)))
 #define ASN1_i2d_fp_of_const(type,i2d,out,x) \
-	((int (*)(I2D_OF_const(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
+	(ASN1_i2d_fp((i2d_of_void *)(i2d), (out), (x)))
 int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
 int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
 #endif
@@ -928,13 +928,13 @@
 #ifndef OPENSSL_NO_BIO
 void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x);
 #define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
-	((type *(*)(type *(*)(void),D2I_OF(type),BIO *,type **))openssl_fcast(ASN1_d2i_bio))(xnew,d2i,in,x)
+	((type *)ASN1_d2i_bio( (void *(*)(void))(xnew), (d2i_of_void *)(d2i), (in), (void **)(x)))
 void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
 int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x);
 #define ASN1_i2d_bio_of(type,i2d,out,x) \
-	((int (*)(I2D_OF(type),BIO *,type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
+	(ASN1_i2d_bio((i2d_of_void *)(i2d), (out), (void *)(x)))
 #define ASN1_i2d_bio_of_const(type,i2d,out,x) \
-	((int (*)(I2D_OF_const(type),BIO *,const type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
+	(ASN1_i2d_bio((i2d_of_void *)(i2d), (out), (void *)(x)))
 int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
 int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
 int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
@@ -978,7 +978,7 @@
 ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
 			      ASN1_OCTET_STRING **oct);
 #define ASN1_pack_string_of(type,obj,i2d,oct) \
-	((ASN1_STRING *(*)(type *,I2D_OF(type),ASN1_OCTET_STRING **))openssl_fcast(ASN1_pack_string))(obj,i2d,oct)
+	(ASN1_pack_string((obj), (i2d_of_void *)(i2d), (oct)))
 ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
 
 void ASN1_STRING_set_default_mask(unsigned long mask);

==== //depot/projects/wifi/crypto/openssl/crypto/ocsp/ocsp.h#3 (text+ko) ====

@@ -469,7 +469,7 @@
 ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
 				void *data, STACK_OF(ASN1_OBJECT) *sk);
 #define ASN1_STRING_encode_of(type,s,i2d,data,sk) \
-((ASN1_STRING *(*)(ASN1_STRING *,I2D_OF(type),type *,STACK_OF(ASN1_OBJECT) *))openssl_fcast(ASN1_STRING_encode))(s,i2d,data,sk)
+(ASN1_STRING_encode((s), (i2d_of_void *)(i2d), (data), (STACK_OF(ASN1_OBJECT) *)(sk)))
 
 X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
 

==== //depot/projects/wifi/crypto/openssl/crypto/pem/pem.h#4 (text+ko) ====

@@ -220,19 +220,20 @@
 #define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
 type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\
 { \
-return(((type *(*)(D2I_OF(type),char *,FILE *,type **,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_read))(d2i_##asn1, str,fp,x,cb,u)); \
-} 
+return((type *)PEM_ASN1_read( \
+	(d2i_of_void *)d2i_##asn1,str,fp,(void **)x,cb,u)); \
+}
 
 #define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
 int PEM_write_##name(FILE *fp, type *x) \
 { \
-return(((int (*)(I2D_OF(type),const char *,FILE *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL)); \
+return(PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(char *)x,NULL,NULL,0,NULL,NULL)); \
 }
 
 #define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
 int PEM_write_##name(FILE *fp, const type *x) \
 { \
-return(((int (*)(I2D_OF_const(type),const char *,FILE *, const type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL)); \
+return(PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(char *)x,NULL,NULL,0,NULL,NULL)); \
 }
 
 #define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
@@ -240,7 +241,7 @@
 	     unsigned char *kstr, int klen, pem_password_cb *cb, \
 		  void *u) \
 	{ \
-	return(((int (*)(I2D_OF(type),const char *,FILE *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u)); \
+	return(PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(char *)x,enc,kstr,klen,cb,u)); \
 	}
 
 #define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
@@ -248,7 +249,7 @@
 	     unsigned char *kstr, int klen, pem_password_cb *cb, \
 		  void *u) \
 	{ \
-	return(((int (*)(I2D_OF_const(type),const char *,FILE *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u)); \
+	return(PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(char *)x,enc,kstr,klen,cb,u)); \
 	}
 
 #endif
@@ -256,33 +257,34 @@
 #define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
 type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
 { \
-return(((type *(*)(D2I_OF(type),const char *,BIO *,type **,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_read_bio))(d2i_##asn1, str,bp,x,cb,u)); \
+return((type *)PEM_ASN1_read_bio( \
+	(d2i_of_void *)d2i_##asn1,str,bp,(void **)x,cb,u)); \
 }
 
 #define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
 int PEM_write_bio_##name(BIO *bp, type *x) \
 { \
-return(((int (*)(I2D_OF(type),const char *,BIO *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL)); \
+return(PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(char *)x,NULL,NULL,0,NULL,NULL)); \
 }
 
 #define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
 int PEM_write_bio_##name(BIO *bp, const type *x) \
 { \
-return(((int (*)(I2D_OF_const(type),const char *,BIO *,const type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL)); \
+return(PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(char *)x,NULL,NULL,0,NULL,NULL)); \
 }
 
 #define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
 	     unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
 	{ \
-	return(((int (*)(I2D_OF(type),const char *,BIO *,type *,const EVP_CIPHER *,unsigned char *,int,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u)); \
+	return(PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(char *)x,enc,kstr,klen,cb,u)); \
 	}
 
 #define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
 	     unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
 	{ \
-	return(((int (*)(I2D_OF_const(type),const char *,BIO *,type *,const EVP_CIPHER *,unsigned char *,int,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u)); \
+	return(PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(char *)x,enc,kstr,klen,cb,u)); \
 	}
 
 #define IMPLEMENT_PEM_write(name, type, str, asn1) \
@@ -546,12 +548,12 @@
 void *	PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp,
 			  void **x, pem_password_cb *cb, void *u);
 #define PEM_ASN1_read_bio_of(type,d2i,name,bp,x,cb,u) \
-((type *(*)(D2I_OF(type),const char *,BIO *,type **,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_read_bio))(d2i,name,bp,x,cb,u)
+((type *)PEM_ASN1_read_bio((d2i_of_void *)d2i,name,bp,(void **)x,cb,u))
 int	PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x,
 			   const EVP_CIPHER *enc,unsigned char *kstr,int klen,
 			   pem_password_cb *cb, void *u);
 #define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \
-	((int (*)(I2D_OF(type),const char *,BIO *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d,name,bp,x,enc,kstr,klen,cb,u)
+	(PEM_ASN1_write_bio)((i2d_of_void *)i2d,name,bp,(char *)x,enc,kstr,klen,cb,u)
 
 STACK_OF(X509_INFO) *	PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
 int	PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc,

==== //depot/projects/wifi/etc/network.subr#11 (text+ko) ====

@@ -22,7 +22,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/etc/network.subr,v 1.179 2007/03/29 21:42:19 ache Exp $
+# $FreeBSD: src/etc/network.subr,v 1.180 2007/05/23 00:18:44 thompsa Exp $
 #
 
 #
@@ -265,7 +265,7 @@
 #	Returns 0 if the interface exists and 1 otherwise.
 ifexists()
 {
-	ifconfig $1 > /dev/null 2>&1
+	ifconfig -n $1 > /dev/null 2>&1
 }
 
 # ipv4_up if

==== //depot/projects/wifi/lib/libutil/flopen.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libutil/flopen.c,v 1.4 2007/05/10 15:01:42 des Exp $");
+__FBSDID("$FreeBSD: src/lib/libutil/flopen.c,v 1.7 2007/05/23 12:09:33 des Exp $");
 
 #include <sys/file.h>
 #include <sys/stat.h>
@@ -41,7 +41,7 @@
 int
 flopen(const char *path, int flags, ...)
 {
-	int fd, operation, serrno;
+	int fd, operation, serrno, trunc;
 	struct stat sb, fsb;
 	mode_t mode;
 
@@ -62,6 +62,9 @@
 	if (flags & O_NONBLOCK)
 		operation |= LOCK_NB;
 
+	trunc = (flags & O_TRUNC);
+	flags &= ~O_TRUNC;
+
 	for (;;) {
 		if ((fd = open(path, flags, mode)) == -1)
 			/* non-existent or no access */
@@ -91,6 +94,13 @@
 			close(fd);
 			continue;
 		}
+		if (trunc && ftruncate(fd, 0) != 0) {
+			/* can't happen [tm] */
+			serrno = errno;
+			close(fd);
+			errno = serrno;
+			return (-1);
+		}
 		return (fd);
 	}
 }

==== //depot/projects/wifi/sbin/ifconfig/ifconfig.8#24 (text+ko) ====

@@ -26,7 +26,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
-.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.137 2007/04/17 00:35:09 thompsa Exp $
+.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.138 2007/05/22 17:41:09 thompsa Exp $
 .\"
 .Dd April 10, 2007
 .Dt IFCONFIG 8
@@ -39,6 +39,7 @@
 .Op Fl L
 .Op Fl k
 .Op Fl m
+.Op Fl n
 .Ar interface
 .Op Cm create
 .Op Ar address_family
@@ -1622,6 +1623,13 @@
 the current user.
 This information is not printed by default, as it may be considered
 sensitive.
+.Pp 
+If the network interface driver is not present in the kernel then
+.Nm
+will attempt to load it.
+The
+.Fl n
+flag disables this behavior.
 .Pp
 Only the super-user may modify the configuration of a network interface.
 .Sh NOTES

==== //depot/projects/wifi/sbin/ifconfig/ifconfig.c#21 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)ifconfig.c	8.2 (Berkeley) 2/16/94";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/ifconfig/ifconfig.c,v 1.130 2007/03/24 20:26:54 yar Exp $";
+  "$FreeBSD: src/sbin/ifconfig/ifconfig.c,v 1.131 2007/05/22 17:41:09 thompsa Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -89,6 +89,7 @@
 int	clearaddr;
 int	newaddr = 1;
 int	verbose;
+int	noload;
 
 int	supmedia = 0;
 int	printkeys = 0;		/* Print keying material for interfaces. */
@@ -150,10 +151,10 @@
 	struct option *p;
 	size_t iflen;
 
-	all = downonly = uponly = namesonly = verbose = 0;
+	all = downonly = uponly = namesonly = noload = verbose = 0;
 
 	/* Parse leading line options */
-	strlcpy(options, "adklmuv", sizeof(options));
+	strlcpy(options, "adklmnuv", sizeof(options));
 	for (p = opts; p != NULL; p = p->next)
 		strlcat(options, p->opt, sizeof(options));
 	while ((c = getopt(argc, argv, options)) != -1) {
@@ -173,6 +174,9 @@
 		case 'm':	/* show media choices in status */
 			supmedia = 1;
 			break;
+		case 'n':	/* suppress module loading */
+			noload++;
+			break;
 		case 'u':	/* restrict scan to "up" interfaces */
 			uponly++;
 			break;
@@ -898,6 +902,10 @@
 	char ifkind[35], *dp;
 	const char *cp;
 
+	/* loading suppressed by the user */
+	if (noload)
+		return;
+
 	/* turn interface and unit into module name */
 	strcpy(ifkind, "if_");
 	for (cp = name, dp = ifkind + 3;

==== //depot/projects/wifi/share/man/man4/bge.4#12 (text+ko) ====

@@ -29,9 +29,9 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/bge.4,v 1.31 2007/01/30 09:47:31 brueffer Exp $
+.\" $FreeBSD: src/share/man/man4/bge.4,v 1.32 2007/05/22 19:35:34 jkim Exp $
 .\"
-.Dd January 30, 2007
+.Dd May 22, 2007
 .Dt BGE 4
 .Os
 .Sh NAME
@@ -205,14 +205,11 @@
 SysKonnect SK-9D41 (1000baseSX)
 .El
 .Sh LOADER TUNABLES
-Tunables can be set at the
+The following tunable can be set at the
 .Xr loader 8
 prompt before booting the kernel, or stored in
 .Xr loader.conf 5 .
 .Bl -tag -width indent
-.It Va hw.bge.fake_autoneg
-Set to 1 for special handling of the BCM5704 HW.
-Disabled by default.
 .It Va hw.bge.allow_asf
 Allow the ASF feature for cooperating with IPMI.
 Can cause system lockup problems on a small number of systems.

==== //depot/projects/wifi/share/man/man4/ng_car.4#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/ng_car.4,v 1.2 2007/05/16 12:00:22 mav Exp $
+.\" $FreeBSD: src/share/man/man4/ng_car.4,v 1.3 2007/05/22 18:14:35 brueffer Exp $
 .\"
 .Dd March 11, 2007
 .Dt NG_CAR 4
@@ -40,9 +40,9 @@
 .Pp
 .Bl -bullet -compact
 .It
-Single rate three color marker as described on RFC 2697,
+Single rate three color marker as described in RFC 2697,
 .It
-Two rate three color marker as described on RFC 2698,
+Two rate three color marker as described in RFC 2698,
 .It
 RED-like rate limit algorithm used by Cisco,
 .It
@@ -75,7 +75,7 @@
 Each hook can operate in one of the following modes:
 .Bl -tag -width indent
 .It Dv NG_CAR_SINGLE_RATE
-Single rate three color marker as described on RFC 2697.
+Single rate three color marker as described in RFC 2697.
 Committed burst packets are counted as green, extended burst packets are
 counted as yellow and exceeding packets are counted as red.
 Committed burst getting refilled with CIR (Committed Information Rate) speed.
@@ -157,7 +157,7 @@
 .It Dv NGM_CAR_CLR_STATS Pq Li clrstats
 Clear node statistics.
 .It Dv NGM_CAR_GETCLR_STATS Pq Li getclrstats
-Atomicaly return and clear node statistics.
+Atomically return and clear node statistics.
 .El
 .Sh SHUTDOWN
 This node shuts down upon receipt of a

==== //depot/projects/wifi/sys/amd64/amd64/support.S#7 (text+ko) ====

@@ -27,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.126 2007/03/31 01:47:37 jkim Exp $
+ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.127 2007/05/23 08:33:04 kib Exp $
  */
 
 #include "opt_ddb.h"
@@ -671,49 +671,6 @@
 	incl	%eax
 	ret
 
-/*****************************************************************************/
-/* linux_futex support                                                       */
-/*****************************************************************************/
-
-futex_fault:
-	movq	$0,PCB_ONFAULT(%rcx)
-	movq	$-EFAULT,%rax
-	ret
-
-ENTRY(futex_xchgl)
-	movq	PCPU(CURPCB),%rcx
-	movq	$futex_fault,PCB_ONFAULT(%rcx)
-
-	movq	$VM_MAXUSER_ADDRESS-4,%rax
-	cmpq	%rax,%rsi
-	ja	futex_fault
-
-#ifdef SMP
-	lock
-#endif
-	xchgl	%edi,(%rsi)
-	movl	%edi,(%rdx)
-	xorl	%eax,%eax
-	movq	%rax,PCB_ONFAULT(%rcx)
-	ret
-
-ENTRY(futex_addl)
-	movq	PCPU(CURPCB),%rcx
-	movq	$futex_fault,PCB_ONFAULT(%rcx)
-
-	movq	$VM_MAXUSER_ADDRESS-4,%rax
-	cmpq	%rax,%rsi
-	ja	futex_fault
-
-#ifdef SMP
-	lock
-#endif
-	xaddl	%edi,(%rsi)
-	movl	%edi,(%rdx)
-	xorl	%eax,%eax
-	movq	%rax,PCB_ONFAULT(%rcx)
-	ret
-
 /*
  * Support for BB-profiling (gcc -a).  The kernbb program will extract
  * the data from the kernel.

==== //depot/projects/wifi/sys/arm/arm/genassym.c#7 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/genassym.c,v 1.8 2006/11/30 04:17:04 jb Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/genassym.c,v 1.9 2007/05/23 13:21:57 cognet Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/assym.h>
@@ -41,7 +41,6 @@
 #include <machine/cpu.h>
 #include <machine/proc.h>
 #include <machine/cpufunc.h>
-#include <machine/pcb.h>
 #include <machine/pte.h>
 #include <machine/intr.h>
 #include <machine/sysarch.h>

==== //depot/projects/wifi/sys/arm/arm/vm_machdep.c#16 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.30 2007/01/17 00:53:05 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.31 2007/05/23 13:19:00 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -55,12 +55,11 @@
 #include <machine/cpu.h>
 #include <machine/pcb.h>
 #include <machine/sysarch.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
 
 #include <vm/vm.h>
+#include <vm/pmap.h>
 #include <vm/vm_extern.h>
 #include <vm/vm_kern.h>
 #include <vm/vm_page.h>

==== //depot/projects/wifi/sys/arm/at91/kb920x_machdep.c#4 (text) ====

@@ -48,7 +48,7 @@
 #include "opt_at91.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.21 2007/03/27 06:29:19 kevlo Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/kb920x_machdep.c,v 1.22 2007/05/23 13:20:50 cognet Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -77,7 +77,6 @@
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
-#include <vm/vm.h>
 #include <vm/vm_object.h>
 #include <vm/vm_page.h>
 #include <vm/vm_pager.h>

==== //depot/projects/wifi/sys/arm/conf/AVILA#3 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first 
 # in NOTES.
 #
-# $FreeBSD: src/sys/arm/conf/AVILA,v 1.3 2007/02/26 02:04:24 cognet Exp $
+# $FreeBSD: src/sys/arm/conf/AVILA,v 1.4 2007/05/24 16:27:48 sam Exp $
 
 machine		arm
 ident		AVILA
@@ -30,7 +30,7 @@
 options STARTUP_PAGETABLE_ADDR=0x10000000
 include		"../xscale/ixp425/std.avila"
 #To statically compile in device wiring instead of /boot/device.hints
-#hints		"GENERIC.hints"		#Default places to look for devices.
+hints		"AVILA.hints"		#Default places to look for devices.
 
 makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
 makeoptions	CONF_CFLAGS=-mcpu=xscale
@@ -137,3 +137,13 @@
 #device		crypto
 #device		cryptodev
 #device		hifn		# NB: Soekris minipci card known to work
+
+#device		usb
+#options 	USB_DEBUG
+#device		uhci
+#device		ohci
+#device		ehci
+#device		ugen
+#device		umass
+#device		scbus		# SCSI bus (required for SCSI)
+#device		da		# Direct Access (disks)

==== //depot/projects/wifi/sys/arm/xscale/i80321/ep80219_machdep.c#3 (text+ko) ====

@@ -49,7 +49,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.6 2007/05/03 09:51:12 kevlo Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.7 2007/05/23 13:20:50 cognet Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -78,7 +78,6 @@
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
-#include <vm/vm.h>
 #include <vm/vm_object.h>
 #include <vm/vm_page.h>
 #include <vm/vm_pager.h>

==== //depot/projects/wifi/sys/arm/xscale/i80321/iq31244_machdep.c#17 (text+ko) ====

@@ -49,7 +49,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.27 2007/05/03 09:51:12 kevlo Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.28 2007/05/23 13:20:50 cognet Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -78,7 +78,6 @@
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
-#include <vm/vm.h>
 #include <vm/vm_object.h>
 #include <vm/vm_page.h>
 #include <vm/vm_pager.h>

==== //depot/projects/wifi/sys/arm/xscale/ixp425/avila_ata.c#4 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_ata.c,v 1.3 2007/03/14 18:05:04 jhay Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_ata.c,v 1.4 2007/05/24 16:15:20 sam Exp $");
 
 /*
  * Compact Flash Support for the Avila Gateworks XScale boards.
@@ -120,17 +120,14 @@
 {
 	struct ata_avila_softc *sc = device_get_softc(dev);
 	struct ixp425_softc *sa = device_get_softc(device_get_parent(dev));
-	u_int32_t alt_t_off, board_type, ide_gpin, ide_irq;
+	u_int32_t alt_t_off, ide_gpin, ide_gptype, ide_irq;
 
-	board_type = 0;
 	sc->sc_dev = dev;
 	/* NB: borrow from parent */
 	sc->sc_iot = sa->sc_iot;
 	sc->sc_exp_ioh = sa->sc_exp_ioh;
-	if (EXP_BUS_READ_4(sc, EXP_TIMING_CS2_OFFSET) != 0)
-		board_type = 1;		/* Avila board */
-
-	if (board_type == 1) {
+	if (EXP_BUS_READ_4(sc, EXP_TIMING_CS2_OFFSET) != 0) {
+		/* Avila board */
 		if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS1_HWBASE,
 		    IXP425_EXP_BUS_CS1_SIZE, 0, &sc->sc_ioh))
 			panic("%s: unable to map Expansion Bus CS1 window",
@@ -140,10 +137,12 @@
 			panic("%s: unable to map Expansion Bus CS2 window",
 			    __func__);
 		ide_gpin = AVILA_IDE_GPIN;
+		ide_gptype = GPIO_TYPE(ide_gpin, GPIO_TYPE_EDG_RISING);
 		ide_irq = AVILA_IDE_IRQ;
 		sc->sc_16bit_off = EXP_TIMING_CS1_OFFSET;
 		alt_t_off = EXP_TIMING_CS2_OFFSET;
 	} else {
+		/* Pronghorn */
 		if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS3_HWBASE,
 		    IXP425_EXP_BUS_CS3_SIZE, 0, &sc->sc_ioh))
 			panic("%s: unable to map Expansion Bus CS3 window",
@@ -153,6 +152,7 @@
 			panic("%s: unable to map Expansion Bus CS4 window",
 			    __func__);
 		ide_gpin = PRONGHORN_IDE_GPIN;
+		ide_gptype = GPIO_TYPE(ide_gpin, GPIO_TYPE_ACT_HIGH);
 		ide_irq = PRONGHORN_IDE_IRQ;
 		sc->sc_16bit_off = EXP_TIMING_CS3_OFFSET;
 		alt_t_off = EXP_TIMING_CS4_OFFSET;
@@ -187,11 +187,10 @@
 
 	GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPOER, 
 	    GPIO_CONF_READ_4(sa, IXP425_GPIO_GPOER) | (1<<ide_gpin));
-	/* interrupt is active high */
+	/* set interrupt type */
 	GPIO_CONF_WRITE_4(sa, GPIO_TYPE_REG(ide_gpin),
-	    (GPIO_CONF_READ_4(sa, GPIO_TYPE_REG(ide_gpin)) &
-	    ~GPIO_TYPE(ide_gpin, GPIO_TYPE_MASK)) |
-	    GPIO_TYPE(ide_gpin, GPIO_TYPE_ACT_HIGH));
+	    (GPIO_CONF_READ_4(sa, GPIO_TYPE_REG(ide_gpin)) &~
+	     GPIO_TYPE(ide_gpin, GPIO_TYPE_MASK)) | ide_gptype);
 
 	/* clear ISR */
 	GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPISR, (1<<ide_gpin));

==== //depot/projects/wifi/sys/arm/xscale/ixp425/avila_machdep.c#4 (text+ko) ====

@@ -49,7 +49,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.4 2007/05/03 09:51:12 kevlo Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.5 2007/05/23 13:20:50 cognet Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -78,7 +78,6 @@
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
-#include <vm/vm.h>
 #include <vm/vm_object.h>
 #include <vm/vm_page.h>
 #include <vm/vm_pager.h>

==== //depot/projects/wifi/sys/arm/xscale/ixp425/if_npe.c#5 (text+ko) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.5 2007/02/10 15:43:58 mlaier Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.6 2007/05/24 16:31:22 sam Exp $");
 
 /*
  * Intel XScale NPE Ethernet driver.
@@ -550,11 +550,27 @@
 	struct npe_softc * sc = device_get_softc(dev);
 	int unit = device_get_unit(dev);
 	int error, i;
+	uint32_t imageid;
 
-	/* load NPE firmware and start it running */
-	error = ixpnpe_init(sc->sc_npe, "npe_fw", npeconfig[unit].imageid);
-	if (error != 0)
-		return error;
+	/*
+	 * Load NPE firmware and start it running.  We assume
+	 * that minor version bumps remain compatible so probe
+	 * the firmware image starting with the expected version
+	 * and then bump the minor version up to the max.
+	 */
+	imageid = npeconfig[unit].imageid;
+	for (;;) {
+		error = ixpnpe_init(sc->sc_npe, "npe_fw", imageid);
+		if (error == 0)
+			break;
+		/* ESRCH is returned when the requested image is not present */
+		if (error != ESRCH)
+			return error;
+		/* bump the minor version up to the max possible */
+		if (NPEIMAGE_MINOR(imageid) == 0xff)
+			return error;
+		imageid++;
+	}
 
 	if (bus_space_map(sc->sc_iot, npeconfig[unit].regbase,
 	    npeconfig[unit].regsize, 0, &sc->sc_ioh)) {

==== //depot/projects/wifi/sys/arm/xscale/ixp425/ixp425.c#5 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425.c,v 1.5 2007/03/14 19:03:07 jhay Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425.c,v 1.6 2007/05/24 16:25:49 sam Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -236,17 +236,14 @@
 	    rman_manage_region(&sc->sc_mem_rman, 0, ~0) != 0)
 		panic("ixp425_attach: failed to set up IRQ rman");
 
-	device_add_child(dev, "pcib", 0);
-	device_add_child(dev, "ixpclk", 0);
-	device_add_child(dev, "ixpwdog", 0);
-	device_add_child(dev, "ixpiic", 0);
-	device_add_child(dev, "uart", 0);
-	/* XXX these are optional, what if they are not configured? */
-	device_add_child(dev, "ixpqmgr", 0);
-	device_add_child(dev, "npe", 0);	/* NPE-B */
-	device_add_child(dev, "npe", 1);	/* NPE-C */
-	device_add_child(dev, "ata_avila", 0);	/* XXX */
-	device_add_child(dev, "led_avila", 0);
+	BUS_ADD_CHILD(dev, 0, "pcib", 0);
+	BUS_ADD_CHILD(dev, 0, "ixpclk", 0);
+	BUS_ADD_CHILD(dev, 0, "ixpiic", 0);
+	/* XXX move to hints? */
+	BUS_ADD_CHILD(dev, 0, "ixpwdog", 0);
+
+	/* attach wired devices via hints */
+	bus_enumerate_hinted_children(dev);
 
 	if (bus_space_map(sc->sc_iot, IXP425_GPIO_HWBASE, IXP425_GPIO_SIZE,
 	    0, &sc->sc_gpio_ioh))
@@ -261,6 +258,60 @@
 	return (0);
 }
 
+static void
+ixp425_hinted_child(device_t bus, const char *dname, int dunit)
+{
+	device_t child;
+	struct ixp425_ivar *ivar;
+
+	child = BUS_ADD_CHILD(bus, 0, dname, dunit);
+	ivar = IXP425_IVAR(child);
+	resource_int_value(dname, dunit, "addr", &ivar->addr);
+	resource_int_value(dname, dunit, "irq", &ivar->irq);
+}
+
+static device_t
+ixp425_add_child(device_t dev, int order, const char *name, int unit)
+{
+	device_t child;
+	struct ixp425_ivar *ivar;
+
+	child = device_add_child_ordered(dev, order, name, unit);
+	if (child == NULL)
+		return NULL;
+	ivar = malloc(sizeof(struct ixp425_ivar), M_DEVBUF, M_NOWAIT);
+	if (ivar == NULL) {
+		device_delete_child(dev, child);
+		return NULL;
+	}
+	ivar->addr = 0;
+	ivar->irq = -1;
+	device_set_ivars(child, ivar);
+	return child;
+}
+
+static int
+ixp425_read_ivar(device_t bus, device_t child, int which, u_char *result)
+{
+	struct ixp425_ivar *ivar = IXP425_IVAR(child);
+
+	switch (which) {
+	case IXP425_IVAR_ADDR:
+		if (ivar->addr != 0) {
+			*(uint32_t *)result = ivar->addr;
+			return 0;
+		}
+		break;
+	case IXP425_IVAR_IRQ:
+		if (ivar->irq != -1) {
+			*(int *)result = ivar->irq;
+			return 0;
+		}
+		break;
+	}
+	return EINVAL;
+}
+
 static struct resource *
 ixp425_alloc_resource(device_t dev, device_t child, int type, int *rid,
     u_long start, u_long end, u_long count, u_int flags)
@@ -268,51 +319,46 @@
 	struct ixp425_softc *sc = device_get_softc(dev);
 	struct rman *rmanp;
 	struct resource *rv;
-	uint32_t vbase;
-	int isuart = (start == 0 && end == ~0);	/* XXX how to do this right? */
+	uint32_t vbase, addr;
+	int irq;
 
-	rv = NULL;
-
 	switch (type) {
 	case SYS_RES_IRQ:
 		rmanp = &sc->sc_irq_rman;
-		if (isuart) {
-			if (device_get_unit(dev) == 0) 
-				start = IXP425_INT_UART0;
-			else
-				start = IXP425_INT_UART1;
-			end = start;
-		}
+		/* override per hints */
+		if (BUS_READ_IVAR(dev, child, IXP425_IVAR_IRQ, &irq) == 0)
+			start = end = irq;
+		rv = rman_reserve_resource(rmanp, start, end, count,
+			flags, child);
+		if (rv != NULL)
+			rman_set_rid(rv, *rid);
 		break;
 
 	case SYS_RES_MEMORY:
 		rmanp = &sc->sc_mem_rman;
-		if (isuart) {
-			if (device_get_unit(dev) == 0) 
-				start = IXP425_UART0_HWBASE;
+		/* override per hints */
+		if (BUS_READ_IVAR(dev, child, IXP425_IVAR_ADDR, &addr) == 0) {
+			start = addr;
+			end = start + 0x1000;	/* XXX */
+		}
+		if (getvbase(start, end - start, &vbase))
+			return NULL;
+		rv = rman_reserve_resource(rmanp, start, end, count,
+			flags, child);
+		if (rv != NULL) {
+			rman_set_rid(rv, *rid);
+			if (strcmp(device_get_name(child), "uart") == 0)
+				rman_set_bustag(rv, &ixp425_a4x_bs_tag);
 			else
-				start = IXP425_UART1_HWBASE;
-			end = start + 0x1000;
+				rman_set_bustag(rv, sc->sc_iot);
+			rman_set_bushandle(rv, vbase);
 		}
-		if (getvbase(start, end - start, &vbase))
-			return (rv);
 		break;
-
 	default:
-		return (rv);
+		rv = NULL;
+		break;
 	}
-
-	rv = rman_reserve_resource(rmanp, start, end, count, flags, child);
-	if (rv != NULL) {
-		rman_set_rid(rv, *rid);
-		if (type == SYS_RES_MEMORY) {
-			rman_set_bustag(rv,
-			    isuart ? &ixp425_a4x_bs_tag : sc->sc_iot);
-			rman_set_bushandle(rv, vbase);
-		}
-	}
-
-	return (rv);
+	return rv;
 }
 

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



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