CVS commit: src
Module Name:src Committed By: dyoung Date: Fri Jan 8 06:25:14 UTC 2010 Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile Log Message: Install pcq.9 and links. Update set list accordingly. To generate a diff of this commit: cvs rdiff -u -r1.1355 -r1.1356 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.299 -r1.300 src/share/man/man9/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1355 src/distrib/sets/lists/comp/mi:1.1356 --- src/distrib/sets/lists/comp/mi:1.1355 Wed Jan 6 19:46:43 2010 +++ src/distrib/sets/lists/comp/mi Fri Jan 8 06:25:14 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1355 2010/01/06 19:46:43 skrll Exp $ +# $NetBSD: mi,v 1.1356 2010/01/08 06:25:14 dyoung Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -9088,6 +9088,13 @@ ./usr/share/man/cat9/pcmcia_mem_map.0 comp-sys-catman .cat ./usr/share/man/cat9/pcmcia_mem_unmap.0 comp-sys-catman .cat ./usr/share/man/cat9/pcmcia_scan_cis.0 comp-sys-catman .cat +./usr/share/man/cat9/pcq.0 comp-sys-catman .cat +./usr/share/man/cat9/pcq_create.0 comp-sys-catman .cat +./usr/share/man/cat9/pcq_destroy.0 comp-sys-catman .cat +./usr/share/man/cat9/pcq_get.0 comp-sys-catman .cat +./usr/share/man/cat9/pcq_maxitems.0 comp-sys-catman .cat +./usr/share/man/cat9/pcq_peek.0 comp-sys-catman .cat +./usr/share/man/cat9/pcq_put.0 comp-sys-catman .cat ./usr/share/man/cat9/pfil.0 comp-sys-catman .cat ./usr/share/man/cat9/pfil_add_hook.0 comp-sys-catman .cat ./usr/share/man/cat9/pfil_get_head.0 comp-obsolete obsolete @@ -14597,6 +14604,13 @@ ./usr/share/man/html9/pcmcia_mem_map.html comp-sys-htmlman html ./usr/share/man/html9/pcmcia_mem_unmap.html comp-sys-htmlman html ./usr/share/man/html9/pcmcia_scan_cis.html comp-sys-htmlman html +./usr/share/man/html9/pcq.html comp-sys-htmlman html +./usr/share/man/html9/pcq_create.html comp-sys-htmlman html +./usr/share/man/html9/pcq_destroy.html comp-sys-htmlman html +./usr/share/man/html9/pcq_get.html comp-sys-htmlman html +./usr/share/man/html9/pcq_maxitems.html comp-sys-htmlman html +./usr/share/man/html9/pcq_peek.html comp-sys-htmlman html +./usr/share/man/html9/pcq_put.html comp-sys-htmlman html ./usr/share/man/html9/pfil.html comp-sys-htmlman html ./usr/share/man/html9/pfil_add_hook.html comp-sys-htmlman html ./usr/share/man/html9/pfil_head_get.html comp-sys-htmlman html @@ -20273,6 +20287,13 @@ ./usr/share/man/man9/pcmcia_mem_map.9 comp-sys-man .man ./usr/share/man/man9/pcmcia_mem_unmap.9 comp-sys-man .man ./usr/share/man/man9/pcmcia_scan_cis.9 comp-sys-man .man +./usr/share/man/man9/pcq.9 comp-sys-man .man +./usr/share/man/man9/pcq_create.9 comp-sys-man .man +./usr/share/man/man9/pcq_destroy.9 comp-sys-man .man +./usr/share/man/man9/pcq_get.9 comp-sys-man .man +./usr/share/man/man9/pcq_maxitems.9 comp-sys-man .man +./usr/share/man/man9/pcq_peek.9 comp-sys-man .man +./usr/share/man/man9/pcq_put.9 comp-sys-man .man ./usr/share/man/man9/pfil.9 comp-sys-man .man ./usr/share/man/man9/pfil_add_hook.9 comp-sys-man .man ./usr/share/man/man9/pfil_get_head.9 comp-obsolete obsolete Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.299 src/share/man/man9/Makefile:1.300 --- src/share/man/man9/Makefile:1.299 Sat Dec 5 22:43:34 2009 +++ src/share/man/man9/Makefile Fri Jan 8 06:25:14 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.299 2009/12/05 22:43:34 pooka Exp $ +# $NetBSD: Makefile,v 1.300 2010/01/08 06:25:14 dyoung Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -38,7 +38,7 @@ mstohz.9 mutex.9 m_tag.9 namecache.9 \ namei.9 opencrypto.9 optstr.9 \ panic.9 pci.9 pci_configure_bus.9 pci_intr.9 pckbport.9 \ - pcmcia.9 pfil.9 physio.9 pmap.9 pmatch.9 pmc.9 pmf.9 \ + pcmcia.9 pcq.9 pfil.9 physio.9 pmap.9 pmatch.9 pmc.9 pmf.9 \ pool.9 pool_cache.9 powerhook_establish.9 ppsratecheck.9 \ preempt.9 putter.9 \ radio.9 ras.9 rasops.9 ratecheck.9 resettodr.9 rnd.9 rssadapt.9 \ @@ -526,6 +526,12 @@ pmc.9 pmc_start_profiling.9 \ pmc.9 pmc_stop_profiling.9 \ pmc.9 PMC_ENABLED.9 +MLINKS+=pcq.9 pcq_create.9 \ + pcq.9 pcq_destroy.9 \ + pcq.9 pcq_get.9 \ + pcq.9 pcq_peek.9 \ + pcq.9 pcq_maxitems.9 \ + pcq.9 pcq_put.9 MLINKS+=pmf.9 pmf_device_register.9 pmf.9 pmf_device_register1.9 \ pmf.9 pmf_device_deregister.9 \ pmf.9 pmf_device_suspend.9 pmf.9 pmf_device_resume.9 \
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: ober Date: Fri Jan 8 03:41:59 UTC 2010 Modified Files: src/external/cddl/osnet/sys/sys: kmem.h Log Message: Fix comment to meet style guidelines. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/sys/kmem.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sys/sys/kmem.h diff -u src/external/cddl/osnet/sys/sys/kmem.h:1.3 src/external/cddl/osnet/sys/sys/kmem.h:1.4 --- src/external/cddl/osnet/sys/sys/kmem.h:1.3 Sun Jan 3 11:33:13 2010 +++ src/external/cddl/osnet/sys/sys/kmem.h Fri Jan 8 03:41:58 2010 @@ -1,5 +1,5 @@ -/* $NetBSD: kmem.h,v 1.3 2010/01/03 11:33:13 ober Exp $ */ +/* $NetBSD: kmem.h,v 1.4 2010/01/08 03:41:58 ober Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -67,7 +67,9 @@ #define kmem_cache_free(cache, buf) pool_cache_put(cache, buf) #define kmem_cache_reap_now(cache) pool_cache_invalidate(cache) -#define KM_PUSHPAGE KM_SLEEP /* XXXNETBSD XXX HACK to prevent the crashes currently seen. Should be revisited once the uvm issues with zfs are fixed. */ +#define KM_PUSHPAGE KM_SLEEP /* XXXNETBSD XXX HACK to prevent the crashes currently seen. + * Should be revisited once the uvm issues with zfs are fixed. + */ #define KMC_NODEBUG 0x00 #endif /* _OPENSOLARIS_SYS_KMEM_H_ */
CVS commit: src/share/man/man9
Module Name:src Committed By: pooka Date: Fri Jan 8 00:45:50 UTC 2010 Modified Files: src/share/man/man9: vattr.9 Log Message: fix markup (this is how i have enough things to commit) To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/share/man/man9/vattr.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/vattr.9 diff -u src/share/man/man9/vattr.9:1.12 src/share/man/man9/vattr.9:1.13 --- src/share/man/man9/vattr.9:1.12 Fri Jan 8 00:43:57 2010 +++ src/share/man/man9/vattr.9 Fri Jan 8 00:45:50 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: vattr.9,v 1.12 2010/01/08 00:43:57 pooka Exp $ +.\" $NetBSD: vattr.9,v 1.13 2010/01/08 00:45:50 pooka Exp $ .\" .\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -110,7 +110,8 @@ All pathnames are relative to .Pa /usr/src . .Pp -.Fn vattr_null is implemented in +.Fn vattr_null +is implemented in .Pa sys/kern/vfs_subr.c . .Sh SEE ALSO .Xr intro 9 ,
CVS commit: src/share/man/man9
Module Name:src Committed By: pooka Date: Fri Jan 8 00:43:58 UTC 2010 Modified Files: src/share/man/man9: vattr.9 Log Message: * update copypasted struct vattr (nobody wants manpages autogenerated from interface descriptions because then we'd all be out of things to commit) * make "CODE REFERENCES" make a little more sense To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/vattr.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/vattr.9 diff -u src/share/man/man9/vattr.9:1.11 src/share/man/man9/vattr.9:1.12 --- src/share/man/man9/vattr.9:1.11 Wed Apr 22 20:53:44 2009 +++ src/share/man/man9/vattr.9 Fri Jan 8 00:43:57 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: vattr.9,v 1.11 2009/04/22 20:53:44 elad Exp $ +.\" $NetBSD: vattr.9,v 1.12 2010/01/08 00:43:57 pooka Exp $ .\" .\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 22, 2009 +.Dd January 8, 2010 .Dt VATTR 9 .Os .Sh NAME @@ -55,8 +55,8 @@ nlink_t va_nlink; /* number of references to file */ uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ -longva_fsid;/* file system id (dev for now) */ -longva_fileid; /* file id */ +dev_t va_fsid;/* file system id (dev for now) */ +ino_t va_fileid; /* file id */ u_quad_tva_size;/* file size in bytes */ longva_blocksize; /* blocksize preferred for i/o */ struct timespec va_atime; /* time of last access */ @@ -110,7 +110,7 @@ All pathnames are relative to .Pa /usr/src . .Pp -The vnode attributes ares implemented within the file +.Fn vattr_null is implemented in .Pa sys/kern/vfs_subr.c . .Sh SEE ALSO .Xr intro 9 ,
CVS commit: src/sys/dev/dm
Module Name:src Committed By: pooka Date: Fri Jan 8 00:27:48 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c Log Message: Fix this for non-module (which, i guess, is only i386/ALL). XXX: autoconfusion vs. modules is an intolerable mess of stepping on each others' toes. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/dev/dm/device-mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.14 src/sys/dev/dm/device-mapper.c:1.15 --- src/sys/dev/dm/device-mapper.c:1.14 Sun Jan 3 22:55:25 2010 +++ src/sys/dev/dm/device-mapper.c Fri Jan 8 00:27:48 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.14 2010/01/03 22:55:25 haad Exp $ */ +/*$NetBSD: device-mapper.c,v 1.15 2010/01/08 00:27:48 pooka Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -59,8 +59,8 @@ static dev_type_size(dmsize); /* attach and detach routines */ -static int dmattach(void); -static int dmdestroy(void); +int dmattach(void); +int dmdestroy(void); static int dm_cmd_to_fun(prop_dictionary_t); static int disk_ioctl_switch(dev_t, u_long, void *); @@ -101,8 +101,11 @@ .d_strategy = dmstrategy }; +#ifdef _MODULE /* Autoconf defines */ CFDRIVER_DECL(dm, DV_DISK, NULL); +#endif + CFATTACH_DECL3_NEW(dm, 0, dm_match, dm_attach, dm_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); @@ -273,7 +276,7 @@ } /* attach routine */ -static int +int dmattach(void) { @@ -285,7 +288,7 @@ } /* Destroy routine */ -static int +int dmdestroy(void) {
CVS commit: src/sys
Module Name:src Committed By: dyoung Date: Fri Jan 8 00:09:45 UTC 2010 Modified Files: src/sys/arch/i386/i386: mainbus.c src/sys/arch/i386/pci: elan520.c gscpcib.c src/sys/arch/x86/pci: ichlpcib.c pcib.c src/sys/dev/acpi: acpi.c src/sys/kern: subr_autoconf.c src/sys/sys: device.h Log Message: Move all copies of ifattr_match() to sys/kern/subr_autoconf.c. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/i386/i386/mainbus.c cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/pci/elan520.c cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/pci/gscpcib.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/x86/pci/ichlpcib.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/pci/pcib.c cvs rdiff -u -r1.140 -r1.141 src/sys/dev/acpi/acpi.c cvs rdiff -u -r1.192 -r1.193 src/sys/kern/subr_autoconf.c cvs rdiff -u -r1.129 -r1.130 src/sys/sys/device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/i386/mainbus.c diff -u src/sys/arch/i386/i386/mainbus.c:1.87 src/sys/arch/i386/i386/mainbus.c:1.88 --- src/sys/arch/i386/i386/mainbus.c:1.87 Tue Aug 18 16:41:02 2009 +++ src/sys/arch/i386/i386/mainbus.c Fri Jan 8 00:09:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.87 2009/08/18 16:41:02 jmcneill Exp $ */ +/* $NetBSD: mainbus.c,v 1.88 2010/01/08 00:09:44 dyoung Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.87 2009/08/18 16:41:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.88 2010/01/08 00:09:44 dyoung Exp $"); #include #include @@ -324,13 +324,6 @@ aprint_error_dev(self, "couldn't establish power handler\n"); } -/* XXX share this with sys/arch/i386/pci/elan520.c */ -static bool -ifattr_match(const char *snull, const char *t) -{ - return (snull == NULL) || strcmp(snull, t) == 0; -} - /* scan for new children */ static int mainbus_rescan(device_t self, const char *ifattr, const int *locators) Index: src/sys/arch/i386/pci/elan520.c diff -u src/sys/arch/i386/pci/elan520.c:1.44 src/sys/arch/i386/pci/elan520.c:1.45 --- src/sys/arch/i386/pci/elan520.c:1.44 Tue Dec 1 01:08:45 2009 +++ src/sys/arch/i386/pci/elan520.c Fri Jan 8 00:09:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: elan520.c,v 1.44 2009/12/01 01:08:45 dyoung Exp $ */ +/* $NetBSD: elan520.c,v 1.45 2010/01/08 00:09:44 dyoung Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: elan520.c,v 1.44 2009/12/01 01:08:45 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elan520.c,v 1.45 2010/01/08 00:09:44 dyoung Exp $"); #include #include @@ -1424,12 +1424,6 @@ return sc->sc_par == NULL; } -static bool -ifattr_match(const char *snull, const char *t) -{ - return (snull == NULL) || strcmp(snull, t) == 0; -} - /* scan for new children */ static int elansc_rescan(device_t self, const char *ifattr, const int *locators) Index: src/sys/arch/i386/pci/gscpcib.c diff -u src/sys/arch/i386/pci/gscpcib.c:1.14 src/sys/arch/i386/pci/gscpcib.c:1.15 --- src/sys/arch/i386/pci/gscpcib.c:1.14 Tue Aug 18 19:51:45 2009 +++ src/sys/arch/i386/pci/gscpcib.c Fri Jan 8 00:09:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: gscpcib.c,v 1.14 2009/08/18 19:51:45 dyoung Exp $ */ +/* $NetBSD: gscpcib.c,v 1.15 2010/01/08 00:09:44 dyoung Exp $ */ /* $OpenBSD: gscpcib.c,v 1.3 2004/10/05 19:02:33 grange Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko @@ -23,7 +23,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gscpcib.c,v 1.14 2009/08/18 19:51:45 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gscpcib.c,v 1.15 2010/01/08 00:09:44 dyoung Exp $"); #include #include @@ -82,13 +82,6 @@ pcibchilddet(self, child); } -/* XXX share this with sys/arch/i386/pci/elan520.c */ -static bool -ifattr_match(const char *snull, const char *t) -{ - return (snull == NULL) || strcmp(snull, t) == 0; -} - int gscpcib_rescan(device_t self, const char *ifattr, const int *loc) { Index: src/sys/arch/x86/pci/ichlpcib.c diff -u src/sys/arch/x86/pci/ichlpcib.c:1.21 src/sys/arch/x86/pci/ichlpcib.c:1.22 --- src/sys/arch/x86/pci/ichlpcib.c:1.21 Sun Sep 27 18:27:01 2009 +++ src/sys/arch/x86/pci/ichlpcib.c Fri Jan 8 00:09:45 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ichlpcib.c,v 1.21 2009/09/27 18:27:01 jakllsch Exp $ */ +/* $NetBSD: ichlpcib.c,v 1.22 2010/01/08 00:09:45 dyoung Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.21 2009/09/27 18:27:01 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.22 2010/01/08 00:09:45 dyoung Exp $"); #include #include @@ -347,15 +347,6 @@ } } -#if NHPET > 0 || NGPIO > 0 -/* XXX share this with sys/arch/i386/pci/elan520.c */ -static bool -ifattr_match(const char *snull, const char *t) -{ -
CVS commit: src/usr.sbin/puffs/mount_psshfs
Module Name:src Committed By: wiz Date: Thu Jan 7 23:35:45 UTC 2010 Modified Files: src/usr.sbin/puffs/mount_psshfs: mount_psshfs.8 Log Message: Don't be terse. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 diff -u src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8:1.22 src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8:1.23 --- src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8:1.22 Thu Jan 7 21:05:50 2010 +++ src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 Thu Jan 7 23:35:45 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_psshfs.8,v 1.22 2010/01/07 21:05:50 pooka Exp $ +.\" $NetBSD: mount_psshfs.8,v 1.23 2010/01/07 23:35:45 wiz Exp $ .\" .\" Copyright (c) 2007-2009 Antti Kantee. All rights reserved. .\" @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Jan 7, 2010 +.Dd January 7, 2010 .Dt MOUNT_PSSHFS 8 .Os .Sh NAME
CVS commit: src/lib/libpuffs
Module Name:src Committed By: pooka Date: Thu Jan 7 23:03:26 UTC 2010 Modified Files: src/lib/libpuffs: puffs.c Log Message: Use typecast instead of ULL for a less whiny lint on LP64. To generate a diff of this commit: cvs rdiff -u -r1.103 -r1.104 src/lib/libpuffs/puffs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpuffs/puffs.c diff -u src/lib/libpuffs/puffs.c:1.103 src/lib/libpuffs/puffs.c:1.104 --- src/lib/libpuffs/puffs.c:1.103 Thu Jan 7 22:49:19 2010 +++ src/lib/libpuffs/puffs.c Thu Jan 7 23:03:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs.c,v 1.103 2010/01/07 22:49:19 pooka Exp $ */ +/* $NetBSD: puffs.c,v 1.104 2010/01/07 23:03:26 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -31,7 +31,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: puffs.c,v 1.103 2010/01/07 22:49:19 pooka Exp $"); +__RCSID("$NetBSD: puffs.c,v 1.104 2010/01/07 23:03:26 pooka Exp $"); #endif /* !lint */ #include @@ -154,7 +154,7 @@ uint64_t rv; PU_LOCK(); - rv = pu->pu_nextreq++ | 1ULL<<63; + rv = pu->pu_nextreq++ | (uint64_t)1<<63; PU_UNLOCK(); return rv;
CVS commit: src/sys/fs/puffs
Module Name:src Committed By: pooka Date: Thu Jan 7 23:02:34 UTC 2010 Modified Files: src/sys/fs/puffs: puffs_msgif.c puffs_sys.h puffs_vfsops.c Log Message: Rename PUFFS_SOPREQ_EXIT to PUFFS_SOPREQSYS_EXIT to better signal it comes from within the kernel instead of as a direct result of a user request. no functional change To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/fs/puffs/puffs_msgif.c cvs rdiff -u -r1.74 -r1.75 src/sys/fs/puffs/puffs_sys.h cvs rdiff -u -r1.84 -r1.85 src/sys/fs/puffs/puffs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/puffs/puffs_msgif.c diff -u src/sys/fs/puffs/puffs_msgif.c:1.78 src/sys/fs/puffs/puffs_msgif.c:1.79 --- src/sys/fs/puffs/puffs_msgif.c:1.78 Thu Jan 7 22:59:27 2010 +++ src/sys/fs/puffs/puffs_msgif.c Thu Jan 7 23:02:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_msgif.c,v 1.78 2010/01/07 22:59:27 pooka Exp $ */ +/* $NetBSD: puffs_msgif.c,v 1.79 2010/01/07 23:02:34 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.78 2010/01/07 22:59:27 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.79 2010/01/07 23:02:34 pooka Exp $"); #include #include @@ -928,7 +928,7 @@ mutex_exit(&pmp->pmp_sopmtx); switch (psopr->psopr_sopreq) { - case PUFFS_SOPREQ_EXIT: + case PUFFS_SOPREQSYS_EXIT: keeprunning = false; break; case PUFFS_SOPREQ_FLUSH: Index: src/sys/fs/puffs/puffs_sys.h diff -u src/sys/fs/puffs/puffs_sys.h:1.74 src/sys/fs/puffs/puffs_sys.h:1.75 --- src/sys/fs/puffs/puffs_sys.h:1.74 Thu Jan 7 22:45:31 2010 +++ src/sys/fs/puffs/puffs_sys.h Thu Jan 7 23:02:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_sys.h,v 1.74 2010/01/07 22:45:31 pooka Exp $ */ +/* $NetBSD: puffs_sys.h,v 1.75 2010/01/07 23:02:34 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -99,7 +99,7 @@ }; enum puffs_sopreqtype { - PUFFS_SOPREQ_EXIT, + PUFFS_SOPREQSYS_EXIT, PUFFS_SOPREQ_FLUSH, PUFFS_SOPREQ_UNMOUNT, }; Index: src/sys/fs/puffs/puffs_vfsops.c diff -u src/sys/fs/puffs/puffs_vfsops.c:1.84 src/sys/fs/puffs/puffs_vfsops.c:1.85 --- src/sys/fs/puffs/puffs_vfsops.c:1.84 Mon Dec 7 20:57:55 2009 +++ src/sys/fs/puffs/puffs_vfsops.c Thu Jan 7 23:02:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vfsops.c,v 1.84 2009/12/07 20:57:55 pooka Exp $ */ +/* $NetBSD: puffs_vfsops.c,v 1.85 2010/01/07 23:02:34 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.84 2009/12/07 20:57:55 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.85 2010/01/07 23:02:34 pooka Exp $"); #include #include @@ -370,7 +370,7 @@ * it would be wanting to lock. */ psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP); - psopr->psopr_sopreq = PUFFS_SOPREQ_EXIT; + psopr->psopr_sopreq = PUFFS_SOPREQSYS_EXIT; mutex_enter(&pmp->pmp_sopmtx); TAILQ_INSERT_TAIL(&pmp->pmp_sopreqs, psopr, psopr_entries); cv_signal(&pmp->pmp_sopcv);
CVS commit: src/sys/fs/puffs
Module Name:src Committed By: pooka Date: Thu Jan 7 22:59:27 UTC 2010 Modified Files: src/sys/fs/puffs: puffs_msgif.c Log Message: Fix variable name in my commit tree too. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/fs/puffs/puffs_msgif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/puffs/puffs_msgif.c diff -u src/sys/fs/puffs/puffs_msgif.c:1.77 src/sys/fs/puffs/puffs_msgif.c:1.78 --- src/sys/fs/puffs/puffs_msgif.c:1.77 Thu Jan 7 22:45:31 2010 +++ src/sys/fs/puffs/puffs_msgif.c Thu Jan 7 22:59:27 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_msgif.c,v 1.77 2010/01/07 22:45:31 pooka Exp $ */ +/* $NetBSD: puffs_msgif.c,v 1.78 2010/01/07 22:59:27 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.77 2010/01/07 22:45:31 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.78 2010/01/07 22:59:27 pooka Exp $"); #include #include @@ -935,7 +935,7 @@ puffsop_flush(pmp, &psopr->psopr_pf); break; case PUFFS_SOPREQ_UNMOUNT: - puffs_msg_sendresp(pmp, &sopreq->psopr_preq, 0); + puffs_msg_sendresp(pmp, &psopr->psopr_preq, 0); unmountme = true; keeprunning = false;
CVS commit: src/lib/libpuffs
Module Name:src Committed By: pooka Date: Thu Jan 7 22:49:19 UTC 2010 Modified Files: src/lib/libpuffs: puffs.c Log Message: Rewrite puffs_exit() in terms of the PUFFSOP_UNMOUNT kernel request. Now server exit is a lot quite cleaner than previously. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/lib/libpuffs/puffs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpuffs/puffs.c diff -u src/lib/libpuffs/puffs.c:1.102 src/lib/libpuffs/puffs.c:1.103 --- src/lib/libpuffs/puffs.c:1.102 Thu Jan 7 22:40:11 2010 +++ src/lib/libpuffs/puffs.c Thu Jan 7 22:49:19 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs.c,v 1.102 2010/01/07 22:40:11 pooka Exp $ */ +/* $NetBSD: puffs.c,v 1.103 2010/01/07 22:49:19 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -31,7 +31,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: puffs.c,v 1.102 2010/01/07 22:40:11 pooka Exp $"); +__RCSID("$NetBSD: puffs.c,v 1.103 2010/01/07 22:49:19 pooka Exp $"); #endif /* !lint */ #include @@ -697,33 +697,38 @@ free(pu); } -/* - * XXX: there's currently no clean way to request unmount from - * within the user server, so be very brutal about it. - */ /*ARGSUSED1*/ int -puffs_exit(struct puffs_usermount *pu, int force) +puffs_exit(struct puffs_usermount *pu, int unused /* strict compat */) { - struct puffs_node *pn; + struct puffs_framebuf *pb; + struct puffs_req *preq; + void *winp; + size_t winlen; + int sverrno; - force = 1; /* currently */ - assert((pu->pu_state & PU_PUFFSDAEMON) == 0); + pb = puffs_framebuf_make(); + if (pb == NULL) { + errno = ENOMEM; + return -1; + } - if (pu->pu_fd) - close(pu->pu_fd); + winlen = sizeof(struct puffs_req); + if (puffs_framebuf_getwindow(pb, 0, &winp, &winlen) == -1) { + sverrno = errno; + puffs_framebuf_destroy(pb); + errno = sverrno; + return -1; + } + preq = winp; - while ((pn = LIST_FIRST(&pu->pu_pnodelst)) != NULL) - puffs_pn_put(pn); + preq->preq_buflen = sizeof(struct puffs_req); + preq->preq_opclass = PUFFSOP_UNMOUNT; + preq->preq_id = puffs__nextreq(pu); - finalpush(pu); - puffs__framev_exit(pu); - puffs__cc_exit(pu); - if (pu->pu_state & PU_HASKQ) - close(pu->pu_kq); - free(pu); + puffs_framev_enqueue_justsend(pu, puffs_getselectable(pu), pb, 1, 0); - return 0; /* always succesful for now, WILL CHANGE */ + return 0; } /*
CVS commit: src/lib/libpuffs
Module Name:src Committed By: pooka Date: Thu Jan 7 22:46:11 UTC 2010 Modified Files: src/lib/libpuffs: opdump.c Log Message: Be slightly more forgiving about unknown operation types. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/lib/libpuffs/opdump.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpuffs/opdump.c diff -u src/lib/libpuffs/opdump.c:1.29 src/lib/libpuffs/opdump.c:1.30 --- src/lib/libpuffs/opdump.c:1.29 Thu Jan 7 20:47:47 2010 +++ src/lib/libpuffs/opdump.c Thu Jan 7 22:46:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: opdump.c,v 1.29 2010/01/07 20:47:47 pooka Exp $ */ +/* $NetBSD: opdump.c,v 1.30 2010/01/07 22:46:11 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: opdump.c,v 1.29 2010/01/07 20:47:47 pooka Exp $"); +__RCSID("$NetBSD: opdump.c,v 1.30 2010/01/07 22:46:11 pooka Exp $"); #endif /* !lint */ #include @@ -147,7 +147,7 @@ const char **map; int isvn = 0; - map = NULL; /* yes, we are all interested in your opinion, gcc */ + printf("reqid: %" PRIu64 ", ", preq->preq_id); switch (PUFFSOP_OPCLASS(preq->preq_opclass)) { case PUFFSOP_VFS: map = vfsop_revmap; @@ -165,11 +165,14 @@ case PUFFSOP_FLUSH: map = flush_revmap; break; + default: + printf("unhandled opclass\n"); + return; } - printf("reqid: %" PRIu64 ", opclass %d%s, optype: %s, " + printf("opclass %d%s, optype: %s, " "cookie: %p,\n" DINT "aux: %p, auxlen: %zu, pid: %d, lwpid: %d\n", - preq->preq_id, PUFFSOP_OPCLASS(preq->preq_opclass), + PUFFSOP_OPCLASS(preq->preq_opclass), PUFFSOP_WANTREPLY(preq->preq_opclass) ? "" : " (FAF)", map[preq->preq_optype], preq->preq_cookie, preq->preq_buf, preq->preq_buflen,
CVS commit: src/sys/fs/puffs
Module Name:src Committed By: pooka Date: Thu Jan 7 22:45:31 UTC 2010 Modified Files: src/sys/fs/puffs: puffs_msgif.c puffs_msgif.h puffs_sys.h Log Message: Add a PUFFS_UNMOUNT server->kernel request, which causes the kernel to initiate self destruct, i.e. unmount(MNT_FORCE). This, however, is a semi-controlled self-destruct, since all caches are flushed before the (possibly) violent unmount takes place. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sys/fs/puffs/puffs_msgif.c cvs rdiff -u -r1.68 -r1.69 src/sys/fs/puffs/puffs_msgif.h cvs rdiff -u -r1.73 -r1.74 src/sys/fs/puffs/puffs_sys.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/fs/puffs/puffs_msgif.c diff -u src/sys/fs/puffs/puffs_msgif.c:1.76 src/sys/fs/puffs/puffs_msgif.c:1.77 --- src/sys/fs/puffs/puffs_msgif.c:1.76 Mon Dec 7 20:57:55 2009 +++ src/sys/fs/puffs/puffs_msgif.c Thu Jan 7 22:45:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_msgif.c,v 1.76 2009/12/07 20:57:55 pooka Exp $ */ +/* $NetBSD: puffs_msgif.c,v 1.77 2010/01/07 22:45:31 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.76 2009/12/07 20:57:55 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.77 2010/01/07 22:45:31 pooka Exp $"); #include #include @@ -855,6 +855,7 @@ DPRINTF(("dispatch: vn/vfs message 0x%x\n", preq->preq_optype)); puffsop_msg(pmp, preq); break; + case PUFFSOP_FLUSH: /* process in sop thread */ { struct puffs_flush *pf; @@ -877,6 +878,23 @@ mutex_exit(&pmp->pmp_sopmtx); break; } + + case PUFFSOP_UNMOUNT: /* process in sop thread */ + { + + DPRINTF(("dispatch: unmount 0x%x\n", preq->preq_optype)); + + psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP); + psopr->psopr_preq = *preq; + psopr->psopr_sopreq = PUFFS_SOPREQ_UNMOUNT; + + mutex_enter(&pmp->pmp_sopmtx); + TAILQ_INSERT_TAIL(&pmp->pmp_sopreqs, psopr, psopr_entries); + cv_signal(&pmp->pmp_sopcv); + mutex_exit(&pmp->pmp_sopmtx); + break; + } + default: DPRINTF(("dispatch: invalid class 0x%x\n", preq->preq_opclass)); puffs_msg_sendresp(pmp, preq, EOPNOTSUPP); @@ -897,8 +915,10 @@ puffs_sop_thread(void *arg) { struct puffs_mount *pmp = arg; + struct mount *mp = PMPTOMP(pmp); struct puffs_sopreq *psopr; bool keeprunning; + bool unmountme = false; mutex_enter(&pmp->pmp_sopmtx); for (keeprunning = true; keeprunning; ) { @@ -914,6 +934,18 @@ case PUFFS_SOPREQ_FLUSH: puffsop_flush(pmp, &psopr->psopr_pf); break; + case PUFFS_SOPREQ_UNMOUNT: + puffs_msg_sendresp(pmp, &sopreq->psopr_preq, 0); + + unmountme = true; + keeprunning = false; + + /* + * We know the mountpoint is still alive because + * the thread that is us (poetic?) is still alive. + */ + atomic_inc_uint((unsigned int*)&mp->mnt_refcnt); + break; } kmem_free(psopr, sizeof(*psopr)); @@ -921,8 +953,7 @@ } /* - * Purge remaining ops. could send error, but that is highly - * unlikely to reach the caller. + * Purge remaining ops. could send error, but ... */ while ((psopr = TAILQ_FIRST(&pmp->pmp_sopreqs)) != NULL) { TAILQ_REMOVE(&pmp->pmp_sopreqs, psopr, psopr_entries); @@ -932,9 +963,21 @@ } pmp->pmp_sopthrcount--; - cv_signal(&pmp->pmp_sopcv); + cv_broadcast(&pmp->pmp_sopcv); mutex_exit(&pmp->pmp_sopmtx); /* not allowed to access fs after this */ + /* + * If unmount was requested, we can now safely do it here, since + * our context is dead from the point-of-view of puffs_unmount() + * and we are just another thread. dounmount() makes internally + * sure that VFS_UNMOUNT() isn't called reentrantly and that it + * is eventually completed. + */ + if (unmountme) { + (void)dounmount(mp, MNT_FORCE, curlwp); + vfs_destroy(mp); + } + kthread_exit(0); } Index: src/sys/fs/puffs/puffs_msgif.h diff -u src/sys/fs/puffs/puffs_msgif.h:1.68 src/sys/fs/puffs/puffs_msgif.h:1.69 --- src/sys/fs/puffs/puffs_msgif.h:1.68 Sat Oct 17 23:22:04 2009 +++ src/sys/fs/puffs/puffs_msgif.h Thu Jan 7 22:45:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_msgif.h,v 1.68 2009/10/17 23:22:04 pooka Exp $ */ +/* $NetBSD: puffs_msgif.h,v 1.69 2010/01/07 22:45:31 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -52,6 +52,7 @@ #define PUFFSOP_ERROR 0x04 /* only kernel-> */ #define PUFFSOP_FLUSH 0x05 /* ->kernel */ #define PUFFSOP_SUSPEND 0x06 /* ->kernel */ +#define PUFFSOP_UNMOUNT 0x07 /* ->kernel */ #define PUFFSOPFLAG_FAF 0x10 /* fire-and-forget */ #define PUFFSOPFLAG_ISRESPONSE 0x20 /* req is actually a resp */ Index: src/sys/fs/puffs/puffs_sys.h diff -u src/sys/fs/puffs/puffs_sys.h:1.73 src/sys/fs/puffs/puffs_sys.h:1.74 --- src/sys/fs/puffs/puffs_sys.h:1.73 Mon Dec 7 20:57:55 2009 +++ src/sys/fs/puffs/puffs_sys.h Thu Jan 7 22:45:3
CVS commit: src/distrib/notes/common
Module Name:src Committed By: gls Date: Thu Jan 7 22:43:00 UTC 2010 Modified Files: src/distrib/notes/common: main Log Message: Add myself To generate a diff of this commit: cvs rdiff -u -r1.454 -r1.455 src/distrib/notes/common/main Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/notes/common/main diff -u src/distrib/notes/common/main:1.454 src/distrib/notes/common/main:1.455 --- src/distrib/notes/common/main:1.454 Sun Dec 20 16:59:39 2009 +++ src/distrib/notes/common/main Thu Jan 7 22:43:00 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: main,v 1.454 2009/12/20 16:59:39 jruoho Exp $ +.\" $NetBSD: main,v 1.455 2010/01/07 22:43:00 gls Exp $ .\" .\" Copyright (c) 1999-2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -1250,6 +1250,7 @@ .It Ta Kevin Lahey Ta Mt k...@netbsd.org .It Ta David Laight Ta Mt d...@netbsd.org .It Ta Johnny C. Lam Ta Mt j...@netbsd.org +.It Ta Guillaume Lasmayous Ta Mt g...@netbsd.org .It Ta Martin J. Laubach Ta Mt m...@netbsd.org .It Ta Greg Lehey Ta Mt g...@netbsd.org .It Ta Ted Lemon Ta Mt mel...@netbsd.org
CVS commit: src/lib/libpuffs
Module Name:src Committed By: pooka Date: Thu Jan 7 22:40:11 UTC 2010 Modified Files: src/lib/libpuffs: puffs.c Log Message: Set high bit on server->kernel requests to better differentiate between the direction of the request. To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/lib/libpuffs/puffs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpuffs/puffs.c diff -u src/lib/libpuffs/puffs.c:1.101 src/lib/libpuffs/puffs.c:1.102 --- src/lib/libpuffs/puffs.c:1.101 Sat Dec 5 20:54:10 2009 +++ src/lib/libpuffs/puffs.c Thu Jan 7 22:40:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs.c,v 1.101 2009/12/05 20:54:10 pooka Exp $ */ +/* $NetBSD: puffs.c,v 1.102 2010/01/07 22:40:11 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -31,7 +31,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: puffs.c,v 1.101 2009/12/05 20:54:10 pooka Exp $"); +__RCSID("$NetBSD: puffs.c,v 1.102 2010/01/07 22:40:11 pooka Exp $"); #endif /* !lint */ #include @@ -154,7 +154,7 @@ uint64_t rv; PU_LOCK(); - rv = pu->pu_nextreq++; + rv = pu->pu_nextreq++ | 1ULL<<63; PU_UNLOCK(); return rv;
CVS commit: src/sys
Module Name:src Committed By: dyoung Date: Thu Jan 7 22:39:52 UTC 2010 Modified Files: src/sys/kern: subr_autoconf.c src/sys/sys: device.h Log Message: Add a do-nothing child-detachment hook, null_childdetached(device_t, device_t). To generate a diff of this commit: cvs rdiff -u -r1.191 -r1.192 src/sys/kern/subr_autoconf.c cvs rdiff -u -r1.128 -r1.129 src/sys/sys/device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/subr_autoconf.c diff -u src/sys/kern/subr_autoconf.c:1.191 src/sys/kern/subr_autoconf.c:1.192 --- src/sys/kern/subr_autoconf.c:1.191 Tue Jan 5 22:42:16 2010 +++ src/sys/kern/subr_autoconf.c Thu Jan 7 22:39:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_autoconf.c,v 1.191 2010/01/05 22:42:16 dyoung Exp $ */ +/* $NetBSD: subr_autoconf.c,v 1.192 2010/01/07 22:39:52 dyoung Exp $ */ /* * Copyright (c) 1996, 2000 Christopher G. Demetriou @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.191 2010/01/05 22:42:16 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.192 2010/01/07 22:39:52 dyoung Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -2722,6 +2722,12 @@ config_alldevs_unlock(s); } +void +null_childdetached(device_t self, device_t child) +{ + /* do nothing */ +} + static void sysctl_detach_setup(struct sysctllog **clog) { Index: src/sys/sys/device.h diff -u src/sys/sys/device.h:1.128 src/sys/sys/device.h:1.129 --- src/sys/sys/device.h:1.128 Tue Dec 15 03:02:25 2009 +++ src/sys/sys/device.h Thu Jan 7 22:39:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.128 2009/12/15 03:02:25 dyoung Exp $ */ +/* $NetBSD: device.h,v 1.129 2010/01/07 22:39:52 dyoung Exp $ */ /* * Copyright (c) 1996, 2000 Christopher G. Demetriou @@ -479,6 +479,8 @@ void config_twiddle_init(void); void config_twiddle_fn(void *); +void null_childdetached(device_t, device_t); + device_t device_lookup(cfdriver_t, int); void *device_lookup_private(cfdriver_t, int); #ifdef __HAVE_DEVICE_REGISTER
CVS commit: src/usr.sbin/puffs/mount_psshfs
Module Name:src Committed By: pooka Date: Thu Jan 7 21:26:49 UTC 2010 Modified Files: src/usr.sbin/puffs/mount_psshfs: psshfs.c Log Message: errx() already contains progname ... To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/puffs/mount_psshfs/psshfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/puffs/mount_psshfs/psshfs.c diff -u src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.57 src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.58 --- src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.57 Thu Jan 7 21:23:10 2010 +++ src/usr.sbin/puffs/mount_psshfs/psshfs.c Thu Jan 7 21:26:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: psshfs.c,v 1.57 2010/01/07 21:23:10 pooka Exp $ */ +/* $NetBSD: psshfs.c,v 1.58 2010/01/07 21:26:49 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -41,7 +41,7 @@ #include #ifndef lint -__RCSID("$NetBSD: psshfs.c,v 1.57 2010/01/07 21:23:10 pooka Exp $"); +__RCSID("$NetBSD: psshfs.c,v 1.58 2010/01/07 21:26:49 pooka Exp $"); #endif /* !lint */ #include @@ -158,8 +158,7 @@ pctx.domanglegid = 1; pctx.manglegid = atoi(optarg); if (pctx.manglegid == (gid_t)-1) -errx(1, "%s: -1 not allowed for -g", -getprogname()); +errx(1, "-1 not allowed for -g"); pctx.mygid = getegid(); break; case 'O': @@ -190,8 +189,7 @@ pctx.domangleuid = 1; pctx.mangleuid = atoi(optarg); if (pctx.mangleuid == (uid_t)-1) -errx(1, "%s: -1 not allowed for -u", -getprogname()); +errx(1, "-1 not allowed for -u"); pctx.myuid = geteuid(); break; default:
CVS commit: src/usr.sbin/puffs/mount_psshfs
Module Name:src Committed By: pooka Date: Thu Jan 7 21:23:10 UTC 2010 Modified Files: src/usr.sbin/puffs/mount_psshfs: psshfs.c Log Message: Don't allow mangling of uid or gid -1, since they have a special meaning in the sftp protocol. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/puffs/mount_psshfs/psshfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/puffs/mount_psshfs/psshfs.c diff -u src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.56 src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.57 --- src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.56 Thu Jan 7 21:05:50 2010 +++ src/usr.sbin/puffs/mount_psshfs/psshfs.c Thu Jan 7 21:23:10 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: psshfs.c,v 1.56 2010/01/07 21:05:50 pooka Exp $ */ +/* $NetBSD: psshfs.c,v 1.57 2010/01/07 21:23:10 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -41,7 +41,7 @@ #include #ifndef lint -__RCSID("$NetBSD: psshfs.c,v 1.56 2010/01/07 21:05:50 pooka Exp $"); +__RCSID("$NetBSD: psshfs.c,v 1.57 2010/01/07 21:23:10 pooka Exp $"); #endif /* !lint */ #include @@ -157,6 +157,9 @@ case 'g': pctx.domanglegid = 1; pctx.manglegid = atoi(optarg); + if (pctx.manglegid == (gid_t)-1) +errx(1, "%s: -1 not allowed for -g", +getprogname()); pctx.mygid = getegid(); break; case 'O': @@ -186,6 +189,9 @@ case 'u': pctx.domangleuid = 1; pctx.mangleuid = atoi(optarg); + if (pctx.mangleuid == (uid_t)-1) +errx(1, "%s: -1 not allowed for -u", +getprogname()); pctx.myuid = geteuid(); break; default:
CVS commit: src/usr.sbin/puffs/mount_psshfs
Module Name:src Committed By: pooka Date: Thu Jan 7 21:19:45 UTC 2010 Modified Files: src/usr.sbin/puffs/mount_psshfs: psbuf.c Log Message: Fix chgrp (and don't rely on VNOVAL being -1, however unlikely that is to be broken). To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/puffs/mount_psshfs/psbuf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/puffs/mount_psshfs/psbuf.c diff -u src/usr.sbin/puffs/mount_psshfs/psbuf.c:1.16 src/usr.sbin/puffs/mount_psshfs/psbuf.c:1.17 --- src/usr.sbin/puffs/mount_psshfs/psbuf.c:1.16 Thu Jan 7 21:05:50 2010 +++ src/usr.sbin/puffs/mount_psshfs/psbuf.c Thu Jan 7 21:19:45 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: psbuf.c,v 1.16 2010/01/07 21:05:50 pooka Exp $*/ +/* $NetBSD: psbuf.c,v 1.17 2010/01/07 21:19:45 pooka Exp $*/ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: psbuf.c,v 1.16 2010/01/07 21:05:50 pooka Exp $"); +__RCSID("$NetBSD: psbuf.c,v 1.17 2010/01/07 21:19:45 pooka Exp $"); #endif /* !lint */ /* @@ -260,12 +260,23 @@ const struct psshfs_ctx *pctx) { uint32_t flags; + int32_t theuid = -1, thegid = -1; flags = 0; if (va->va_size != (uint64_t)PUFFS_VNOVAL) flags |= SSH_FILEXFER_ATTR_SIZE; - if (va->va_uid != (uid_t)PUFFS_VNOVAL) + if (va->va_uid != (uid_t)PUFFS_VNOVAL) { + theuid = va->va_uid; + if (pctx->domangleuid && theuid == pctx->myuid) + theuid = pctx->mangleuid; flags |= SSH_FILEXFER_ATTR_UIDGID; + } + if (va->va_gid != (gid_t)PUFFS_VNOVAL) { + thegid = va->va_gid; + if (pctx->domanglegid && thegid == pctx->mygid) + thegid = pctx->manglegid; + flags |= SSH_FILEXFER_ATTR_UIDGID; + } if (va->va_mode != (mode_t)PUFFS_VNOVAL) flags |= SSH_FILEXFER_ATTR_PERMISSIONS; @@ -276,16 +287,6 @@ if (flags & SSH_FILEXFER_ATTR_SIZE) psbuf_put_8(pb, va->va_size); if (flags & SSH_FILEXFER_ATTR_UIDGID) { - uid_t theuid; - gid_t thegid; - - theuid = va->va_uid; - if (pctx->domangleuid && theuid == pctx->myuid) - theuid = pctx->mangleuid; - thegid = va->va_gid; - if (pctx->domanglegid && thegid == pctx->mygid) - thegid = pctx->manglegid; - psbuf_put_4(pb, theuid); psbuf_put_4(pb, thegid); }
CVS commit: src/usr.sbin/puffs/mount_psshfs
Module Name:src Committed By: pooka Date: Thu Jan 7 21:05:50 UTC 2010 Modified Files: src/usr.sbin/puffs/mount_psshfs: mount_psshfs.8 node.c psbuf.c psshfs.c psshfs.h subr.c Log Message: Add -u and -g, which allow to remap one (local,remote) uidgid, i.e. umapfs without the fuss. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/puffs/mount_psshfs/node.c cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/puffs/mount_psshfs/psbuf.c cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/puffs/mount_psshfs/psshfs.c cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/puffs/mount_psshfs/psshfs.h cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/puffs/mount_psshfs/subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 diff -u src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8:1.21 src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8:1.22 --- src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8:1.21 Wed May 20 14:08:21 2009 +++ src/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 Thu Jan 7 21:05:50 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_psshfs.8,v 1.21 2009/05/20 14:08:21 pooka Exp $ +.\" $NetBSD: mount_psshfs.8,v 1.22 2010/01/07 21:05:50 pooka Exp $ .\" .\" Copyright (c) 2007-2009 Antti Kantee. All rights reserved. .\" @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 20, 2009 +.Dd Jan 7, 2010 .Dt MOUNT_PSSHFS 8 .Os .Sh NAME @@ -88,6 +88,12 @@ .Pa configfile instead of .Pa ~/.ssh/config . +.It Fl g Ar manglegid +Converts remote +.Ar manglegid +to the effective gid of the file server and vice versa. +See +.Fl u . .It Fl o Ar [no]option This flag can be used to give standard mount options and options to puffs. @@ -135,6 +141,23 @@ kernel and will lose all cached information in doing so. How frequently this happens depends on system activity and the total number of available vnodes in the system (kern.maxvnodes). +.It Fl u Ar mangleuid +Converts remote +.Ar mangleuid +to the effective uid of the file server and vice versa. +This is a simple special case of the functionality of +.Xr mount_umap 8 . +For example: you mount remote m...@darkmoon as the local user "me". +If the uid of "me" on the local system is 101 and on +darkmoon it is 202, you would use +.Fl u +.Ar 202 +to see files owned by 202 on darkmoon as owned by 101 when browsing the +mount point. +Apart from the cosmetic effect, this makes things like +"chown me file" work. +See +.Fl g . .El .Sh EXAMPLES The following example illustrates how to mount the directory Index: src/usr.sbin/puffs/mount_psshfs/node.c diff -u src/usr.sbin/puffs/mount_psshfs/node.c:1.59 src/usr.sbin/puffs/mount_psshfs/node.c:1.60 --- src/usr.sbin/puffs/mount_psshfs/node.c:1.59 Thu Nov 5 13:28:18 2009 +++ src/usr.sbin/puffs/mount_psshfs/node.c Thu Jan 7 21:05:50 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: node.c,v 1.59 2009/11/05 13:28:18 pooka Exp $ */ +/* $NetBSD: node.c,v 1.60 2010/01/07 21:05:50 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: node.c,v 1.59 2009/11/05 13:28:18 pooka Exp $"); +__RCSID("$NetBSD: node.c,v 1.60 2010/01/07 21:05:50 pooka Exp $"); #endif /* !lint */ #include @@ -147,7 +147,7 @@ kludgeva.va_atime.tv_sec = va->va_mtime.tv_sec; } - psbuf_put_vattr(pb, &kludgeva); + psbuf_put_vattr(pb, &kludgeva, pctx); GETRESPONSE(pb, pctx->sshfd); rv = psbuf_expect_status(pb); @@ -172,7 +172,7 @@ /* Create node on server first */ psbuf_req_str(pb, SSH_FXP_OPEN, reqid, PCNPATH(pcn)); psbuf_put_4(pb, SSH_FXF_WRITE | SSH_FXF_CREAT | SSH_FXF_TRUNC); - psbuf_put_vattr(pb, va); + psbuf_put_vattr(pb, va, pctx); GETRESPONSE(pb, pctx->sshfd); rv = psbuf_expect_handle(pb, &fhand, &fhandlen); if (rv) @@ -246,7 +246,7 @@ reqid = NEXTREQ(pctx); psbuf_req_str(pb, SSH_FXP_OPEN, reqid, PNPATH(pn)); psbuf_put_4(pb, SSH_FXF_READ); - psbuf_put_vattr(pb, &va); + psbuf_put_vattr(pb, &va, pctx); if (puffs_framev_enqueue_cb(pu, pctx->sshfd_data, pb, lazyopen_rresp, psn, 0) == -1) { @@ -264,7 +264,7 @@ reqid = NEXTREQ(pctx); psbuf_req_str(pb2, SSH_FXP_OPEN, reqid, PNPATH(pn)); psbuf_put_4(pb2, SSH_FXF_WRITE); - psbuf_put_vattr(pb2, &va); + psbuf_put_vattr(pb2, &va, pctx); if (puffs_framev_enqueue_cb(pu, pctx->sshfd_data, pb2, lazyopen_wresp, psn, 0) == -1) { @@ -715,7 +715,7 @@ struct puffs_node *pn_new; psbuf_req_str(pb, SSH_FXP_MKDIR, reqid, PCNPATH(pcn)); - psbuf_put_vattr(pb, va); + psbuf_put_vattr(pb, va, pctx); GETRESPONSE(pb, pctx->sshfd); rv = psbuf_expect_status(pb); Index: src/usr.sbin/puffs/mount_psshfs/psbuf.c diff -u src/usr.sbin/puffs/mount_psshfs/psbuf.c:1.15 src/usr.sbin/puffs/mount_psshfs/psbuf.c:1.1
CVS commit: src/lib/libpuffs
Module Name:src Committed By: pooka Date: Thu Jan 7 20:47:48 UTC 2010 Modified Files: src/lib/libpuffs: opdump.c puffsdump.h Log Message: Dump contents of struct vattr -- i never remember which members the kernel passes when, so this helps tapping that info. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/lib/libpuffs/opdump.c cvs rdiff -u -r1.13 -r1.14 src/lib/libpuffs/puffsdump.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpuffs/opdump.c diff -u src/lib/libpuffs/opdump.c:1.28 src/lib/libpuffs/opdump.c:1.29 --- src/lib/libpuffs/opdump.c:1.28 Thu Jan 7 18:09:07 2010 +++ src/lib/libpuffs/opdump.c Thu Jan 7 20:47:47 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: opdump.c,v 1.28 2010/01/07 18:09:07 pooka Exp $ */ +/* $NetBSD: opdump.c,v 1.29 2010/01/07 20:47:47 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: opdump.c,v 1.28 2010/01/07 18:09:07 pooka Exp $"); +__RCSID("$NetBSD: opdump.c,v 1.29 2010/01/07 20:47:47 pooka Exp $"); #endif /* !lint */ #include @@ -195,11 +195,20 @@ case PUFFS_VN_READDIR: puffsdump_readdir(preq); break; + case PUFFS_VN_CREATE: + case PUFFS_VN_MKDIR: + case PUFFS_VN_MKNOD: + case PUFFS_VN_SYMLINK: + puffsdump_create(preq); + break; + case PUFFS_VN_SETATTR: + puffsdump_attr(preq); + break; default: break; } } - + PU_LOCK(); gettimeofday(&tv_now, NULL); timersub(&tv_now, &tv_prev, &tv); @@ -231,6 +240,9 @@ case PUFFS_VN_READDIR: puffsdump_readdir_rv(preq); break; + case PUFFS_VN_GETATTR: + puffsdump_attr(preq); + break; default: break; } @@ -241,6 +253,137 @@ preq->preq_rv ? strerror(preq->preq_rv) : ""); } +/* + * Slightly tedious print-routine so that we get a nice NOVAL instead + * of some tedious output representations for -1, especially (uint64_t)-1 + * + * We use typecasting to make this work beyond time_t/dev_t size changes. + */ +static void +dumpattr(struct vattr *vap) +{ + const char * const vtypes[] = { VNODE_TYPES }; + char buf[128]; + +/* XXX: better readability. and this is debug, so no cycle-sweat */ +#define DEFAULTBUF() snprintf(buf, sizeof(buf), "NOVAL") + + printf(DINT "vattr:\n"); + printf(DINT DINT "type: %s, ", vtypes[vap->va_type]); + + DEFAULTBUF(); + if (vap->va_mode != (mode_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "0%o", vap->va_mode); + printf("mode: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_nlink != (nlink_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%d", vap->va_nlink); + printf("nlink: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_uid != (uid_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%d", vap->va_uid); + printf("uid: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_gid != (gid_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%d", vap->va_gid); + printf("gid: %s\n", buf); + + DEFAULTBUF(); + if (vap->va_fsid != (dev_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "0x%llx", + (unsigned long long)vap->va_fsid); + printf(DINT DINT "fsid: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_fileid != (ino_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%" PRIu64, vap->va_fileid); + printf("ino: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_size != (u_quad_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%" PRIu64, vap->va_size); + printf("size: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_blocksize != (long)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%ld", vap->va_blocksize); + printf("bsize: %s\n", buf); + + DEFAULTBUF(); + if (vap->va_atime.tv_sec != (time_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%lld", + (long long)vap->va_atime.tv_sec); + printf(DINT DINT "a.s: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_atime.tv_nsec != (long)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%ld", vap->va_atime.tv_nsec); + printf("a.ns: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_mtime.tv_sec != (time_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%lld", + (long long)vap->va_mtime.tv_sec); + printf("m.s: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_mtime.tv_nsec != (long)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%ld", vap->va_mtime.tv_nsec); + printf("m.ns: %s\n", buf); + + DEFAULTBUF(); + if (vap->va_ctime.tv_sec != (time_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%lld", + (long long)vap->va_ctime.tv_sec); + printf(DINT DINT "c.s: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_ctime.tv_nsec != (long)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%ld", vap->va_ctime.tv_nsec); + printf("c.ns: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_birthtime.tv_sec != (time_t)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%lld", + (long long)vap->va_birthtime.tv_sec); + printf("b.s: %s, ", buf); + + DEFAULTBUF(); + if (vap->va_birthtime.tv_nsec != (long)PUFFS_VNOVAL) + snprintf(buf, sizeof(buf), "%ld", vap->va_birthtime.tv_nsec); + p
CVS commit: src/sys/kern
Module Name:src Committed By: pooka Date: Thu Jan 7 19:54:40 UTC 2010 Modified Files: src/sys/kern: vfs_subr.c Log Message: Make sure struct vattr contains no random bits of kernel memory after vattr_null(). This is especially nice considering things like puffs, where the contents are copied to userspace. To generate a diff of this commit: cvs rdiff -u -r1.392 -r1.393 src/sys/kern/vfs_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/vfs_subr.c diff -u src/sys/kern/vfs_subr.c:1.392 src/sys/kern/vfs_subr.c:1.393 --- src/sys/kern/vfs_subr.c:1.392 Sat Nov 28 10:10:17 2009 +++ src/sys/kern/vfs_subr.c Thu Jan 7 19:54:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.392 2009/11/28 10:10:17 bouyer Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.393 2010/01/07 19:54:40 pooka Exp $ */ /*- * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.392 2009/11/28 10:10:17 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.393 2010/01/07 19:54:40 pooka Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -2665,6 +2665,8 @@ vattr_null(struct vattr *vap) { + memset(vap, 0, sizeof(*vap)); + vap->va_type = VNON; /* @@ -2691,7 +2693,6 @@ vap->va_flags = VNOVAL; vap->va_rdev = VNOVAL; vap->va_bytes = VNOVAL; - vap->va_vaflags = 0; } #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Thu Jan 7 18:57:10 UTC 2010 Modified Files: src/sys/dev/pci: pcidevs Log Message: Add PCH LAN and i82575 To generate a diff of this commit: cvs rdiff -u -r1.1008 -r1.1009 src/sys/dev/pci/pcidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/pcidevs diff -u src/sys/dev/pci/pcidevs:1.1008 src/sys/dev/pci/pcidevs:1.1009 --- src/sys/dev/pci/pcidevs:1.1008 Thu Jan 7 09:27:16 2010 +++ src/sys/dev/pci/pcidevs Thu Jan 7 18:57:10 2010 @@ -1,4 +1,4 @@ -$NetBSD: pcidevs,v 1.1008 2010/01/07 09:27:16 jdc Exp $ +$NetBSD: pcidevs,v 1.1009 2010/01/07 18:57:10 msaitoh Exp $ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou @@ -2274,16 +2274,18 @@ product INTEL PRO_100_VE_6 0x1092 PRO/100 VE Network Controller product INTEL PRO_100_VE_8 0x1093 PRO/100 VE Network Controller product INTEL PRO_100_VE_7 0x1094 PRO/100 VE Network Controller w/ 82562G PHY -product INTEL 80K3LAN_CPR_DPT 0x1096 i80003 Dual 1000baseT Ethernet -product INTEL 80K3LAN_FIB_DPT 0x1097 i80003 Dual 1000baseX Ethernet -product INTEL 80K3LAN_SDS_DPT 0x1098 i80003 Dual Gigabit Ethernet (SERDES) +product INTEL 80K3LAN_CPR_DPT 0x1096 i80003 Dual 1000baseT Ethernet +product INTEL 80K3LAN_FIB_DPT 0x1097 i80003 Dual 1000baseX Ethernet +product INTEL 80K3LAN_SDS_DPT 0x1098 i80003 Dual Gigabit Ethernet (SERDES) product INTEL 82546GB_QUAD_COPPER 0x1099 i82546GB Quad Port Gigabit Ethernet product INTEL 82573L 0x109a i82573L Gigabit Ethernet product INTEL 82571EB_QUAD_COPPER 0x10a4 i82571EB Quad Port Gigabit Ethernet +product INTEL 82575EB_COPPER 0x10a7 i82575EB dual-1000baseT Ethernet +product INTEL 82575EB_FIBER_SERDES 0x10a9 i82575EB dual-1000baseX Ethernet (SERDES) product INTEL 82546GB_QUAD_COPPER_KSP3 0x10b5 i82546GB Quad Port Gigabit Ethernet (KSP3) product INTEL 82572EI 0x10b9 i82572EI 1000baseT Ethernet -product INTEL 80K3LAN_CPR_SPT 0x10ba i80003 1000baseT Ethernet -product INTEL 80K3LAN_SDS_SPT 0x10bb i80003 Gigabit Ethernet (SERDES) +product INTEL 80K3LAN_CPR_SPT 0x10ba i80003 1000baseT Ethernet +product INTEL 80K3LAN_SDS_SPT 0x10bb i80003 Gigabit Ethernet (SERDES) product INTEL 82571GB_QUAD_COPPER 0x10bc i82571GB Quad 1000baseT Ethernet product INTEL 82801I_IGP_AMT 0x10bd 82801I (AMT) LAN Controller product INTEL 82801I_IGP_M 0x10bf 82801I Mobile LAN Controller @@ -2296,8 +2298,14 @@ product INTEL 82801J_D_BM_LF 0x10cd i82801J (LF) LAN Controller product INTEL 82567V 0x10ce i82567V LAN Controller product INTEL 82574L 0x10d3 i82574L 1000baseT Ethernet +product INTEL 82575GB_QUAD_COPPER 0x10d6 i82575GB quad-1000baseT Ethernet product INTEL 82567LM_3 0x10de i82567LM-3 LAN Controller product INTEL 82567LF_3 0x10df i82567LF-3 LAN Controller +product INTEL 82575GB_QUAD_COPPER_PM 0x10e2 i82575GB Quad-1000baseT Ethernet (PM) +product INTEL PCH_M_LM 0x10ea PCH LAN (82578LM) Controller +product INTEL PCH_M_LC 0x10eb PCH LAN (82578LC) Controller +product INTEL PCH_D_DM 0x10ef PCH LAN (82578DM) Controller +product INTEL PCH_D_DC 0x10f0 PCH LAN (82578DC) Controller product INTEL 82801I_IGP_M_AMT 0x10f5 82801I Mobile (AMT) LAN Controller product INTEL 82815_DC100_HUB 0x1100 82815 Hub product INTEL 82815_DC100_AGP 0x1101 82815 AGP
CVS commit: src/sys/arch
Module Name:src Committed By: tnn Date: Thu Jan 7 18:49:30 UTC 2010 Modified Files: src/sys/arch/amd64/conf: GENERIC src/sys/arch/i386/conf: ALL GENERIC XBOX XEN3_DOM0 Log Message: uhmodem(4) is superseded by u3g(4) and u3ginit(4). Prepare for uhmodem(4) removal by not building it anymore. This may fix PR kern/41174. To generate a diff of this commit: cvs rdiff -u -r1.261 -r1.262 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.226 -r1.227 src/sys/arch/i386/conf/ALL cvs rdiff -u -r1.958 -r1.959 src/sys/arch/i386/conf/GENERIC cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/conf/XBOX cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/conf/XEN3_DOM0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.261 src/sys/arch/amd64/conf/GENERIC:1.262 --- src/sys/arch/amd64/conf/GENERIC:1.261 Thu Jan 7 00:18:47 2010 +++ src/sys/arch/amd64/conf/GENERIC Thu Jan 7 18:49:30 2010 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.261 2010/01/07 00:18:47 martin Exp $ +# $NetBSD: GENERIC,v 1.262 2010/01/07 18:49:30 tnn Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.261 $" +#ident "GENERIC-$Revision: 1.262 $" maxusers 64 # estimated number of users @@ -804,10 +804,6 @@ umodem* at uhub? port ? configuration ? ucom* at umodem? -# Huawei E220 3G/HSDPA modem -uhmodem* at uhub? port ? configuration ? interface ? -ucom* at uhmodem? portno ? - # USB Mass Storage umass* at uhub? port ? configuration ? interface ? wd* at umass? Index: src/sys/arch/i386/conf/ALL diff -u src/sys/arch/i386/conf/ALL:1.226 src/sys/arch/i386/conf/ALL:1.227 --- src/sys/arch/i386/conf/ALL:1.226 Thu Jan 7 00:18:47 2010 +++ src/sys/arch/i386/conf/ALL Thu Jan 7 18:49:30 2010 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.226 2010/01/07 00:18:47 martin Exp $ +# $NetBSD: ALL,v 1.227 2010/01/07 18:49:30 tnn Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.226 $" +#ident "ALL-$Revision: 1.227 $" maxusers 64 # estimated number of users @@ -1183,10 +1183,6 @@ umodem* at uhub? port ? configuration ? ucom* at umodem? -# Huawei E220 3G/HSDPA modem -uhmodem* at uhub? port ? configuration ? interface ? -ucom* at uhmodem? portno ? - # USB Mass Storage umass* at uhub? port ? configuration ? interface ? wd* at umass? Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.958 src/sys/arch/i386/conf/GENERIC:1.959 --- src/sys/arch/i386/conf/GENERIC:1.958 Thu Jan 7 00:18:47 2010 +++ src/sys/arch/i386/conf/GENERIC Thu Jan 7 18:49:30 2010 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.958 2010/01/07 00:18:47 martin Exp $ +# $NetBSD: GENERIC,v 1.959 2010/01/07 18:49:30 tnn Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.958 $" +#ident "GENERIC-$Revision: 1.959 $" maxusers 64 # estimated number of users @@ -1133,10 +1133,6 @@ umodem* at uhub? port ? configuration ? ucom* at umodem? -# Huawei E220 3G/HSDPA modem -uhmodem* at uhub? port ? configuration ? interface ? -ucom* at uhmodem? portno ? - # USB Mass Storage umass* at uhub? port ? configuration ? interface ? wd* at umass? Index: src/sys/arch/i386/conf/XBOX diff -u src/sys/arch/i386/conf/XBOX:1.19 src/sys/arch/i386/conf/XBOX:1.20 --- src/sys/arch/i386/conf/XBOX:1.19 Sun Jan 3 03:53:34 2010 +++ src/sys/arch/i386/conf/XBOX Thu Jan 7 18:49:30 2010 @@ -1,4 +1,4 @@ -# $NetBSD: XBOX,v 1.19 2010/01/03 03:53:34 dholland Exp $ +# $NetBSD: XBOX,v 1.20 2010/01/07 18:49:30 tnn Exp $ # # XBOX -- A basic Microsoft XBox kernel config file. # @@ -203,10 +203,6 @@ umodem* at uhub? port ? configuration ? ucom* at umodem? -# Huawei E220 3G/HSDPA modem -uhmodem* at uhub? port ? configuration ? interface ? -ucom* at uhmodem? portno ? - # USB Mass Storage umass* at uhub? port ? configuration ? interface ? wd* at umass? Index: src/sys/arch/i386/conf/XEN3_DOM0 diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.26 src/sys/arch/i386/conf/XEN3_DOM0:1.27 --- src/sys/arch/i386/conf/XEN3_DOM0:1.26 Sun Jan 3 03:53:34 2010 +++ src/sys/arch/i386/conf/XEN3_DOM0 Thu Jan 7 18:49:30 2010 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.26 2010/01/03 03:53:34 dholland Exp $ +# $NetBSD: XEN3_DOM0,v 1.27 2010/01/07 18:49:30 tnn Exp $ # # XEN3_0: Xen 3.0 domain0 kernel @@ -549,10 +549,6 @@ umodem* at uhub? port ? configuration ? ucom* at umodem? -# Huawei E220 3G/HSDPA modem -uhmodem* at uhub? port ? configuration ? interface ? -ucom* at uhmodem? portno ? - # USB Mass Storage umass* at uhub? port ? configuration ? inte
CVS commit: src/lib/libpuffs
Module Name:src Committed By: pooka Date: Thu Jan 7 18:09:07 UTC 2010 Modified Files: src/lib/libpuffs: opdump.c puffsdump.h Log Message: * make indentation a little less ridiculous * note that interfaces provided by are not stable and are to be used only for debug builds * remove a few unimplemented/used dump interfaces To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/lib/libpuffs/opdump.c cvs rdiff -u -r1.12 -r1.13 src/lib/libpuffs/puffsdump.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpuffs/opdump.c diff -u src/lib/libpuffs/opdump.c:1.27 src/lib/libpuffs/opdump.c:1.28 --- src/lib/libpuffs/opdump.c:1.27 Mon Apr 6 20:47:17 2009 +++ src/lib/libpuffs/opdump.c Thu Jan 7 18:09:07 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: opdump.c,v 1.27 2009/04/06 20:47:17 pooka Exp $ */ +/* $NetBSD: opdump.c,v 1.28 2010/01/07 18:09:07 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: opdump.c,v 1.27 2009/04/06 20:47:17 pooka Exp $"); +__RCSID("$NetBSD: opdump.c,v 1.28 2010/01/07 18:09:07 pooka Exp $"); #endif /* !lint */ #include @@ -47,6 +47,8 @@ #include "puffs_priv.h" +#define DINT "" + /* XXX! */ const char *vfsop_revmap[] = { "PUFFS_VFS_MOUNT", @@ -165,8 +167,8 @@ break; } - printf("\treqid: %" PRIu64 ", opclass %d%s, optype: %s, " - "cookie: %p,\n\t\taux: %p, auxlen: %zu, pid: %d, lwpid: %d\n", + printf("reqid: %" PRIu64 ", opclass %d%s, optype: %s, " + "cookie: %p,\n" DINT "aux: %p, auxlen: %zu, pid: %d, lwpid: %d\n", preq->preq_id, PUFFSOP_OPCLASS(preq->preq_opclass), PUFFSOP_WANTREPLY(preq->preq_opclass) ? "" : " (FAF)", map[preq->preq_optype], preq->preq_cookie, @@ -201,7 +203,7 @@ PU_LOCK(); gettimeofday(&tv_now, NULL); timersub(&tv_now, &tv_prev, &tv); - printf("\t\tsince previous call: %lld.%06ld\n", + printf(DINT "since previous call: %lld.%06ld\n", (long long)tv.tv_sec, (long)tv.tv_usec); gettimeofday(&tv_prev, NULL); PU_UNLOCK(); @@ -234,7 +236,7 @@ } } - printf("\tRV reqid: %" PRIu64 ", result: %d %s\n", + printf("RV reqid: %" PRIu64 ", result: %d %s\n", preq->preq_id, preq->preq_rv, preq->preq_rv ? strerror(preq->preq_rv) : ""); } @@ -243,7 +245,7 @@ puffsdump_cookie(puffs_cookie_t c, const char *cookiename) { - printf("\t%scookie: at %p\n", cookiename, c); + printf("%scookie: at %p\n", cookiename, c); } static const char *cn_opnames[] = { @@ -257,7 +259,7 @@ puffsdump_cn(struct puffs_kcn *pkcn) { - printf("\t\tpuffs_cn: \"%s\", len %zu op %s (flags 0x%x)\n", + printf(DINT "puffs_cn: \"%s\", len %zu op %s (flags 0x%x)\n", pkcn->pkcn_name, pkcn->pkcn_namelen, cn_opnames[pkcn->pkcn_nameiop & NAMEI_OPMASK], pkcn->pkcn_flags); @@ -276,7 +278,7 @@ { struct puffs_vnmsg_lookup *lookup_msg = (void *)preq; - printf("\t\tnew node %p, type 0x%x,\n\t\tsize 0x%"PRIu64", dev 0x%llx\n", + printf(DINT "new %p, type 0x%x, size 0x%"PRIu64", dev 0x%llx\n", lookup_msg->pvnr_newnode, lookup_msg->pvnr_vtype, lookup_msg->pvnr_size, (unsigned long long)lookup_msg->pvnr_rdev); } @@ -287,7 +289,7 @@ /* XXX: wrong type, but we know it fits the slot */ struct puffs_vnmsg_create *create_msg = (void *)preq; - printf("\t\tnew node %p\n", create_msg->pvnr_newnode); + printf(DINT "new %p\n", create_msg->pvnr_newnode); } void @@ -295,7 +297,7 @@ { struct puffs_vnmsg_rw *rw_msg = (void *)preq; - printf("\t\toffset: %" PRId64 ", resid %zu, ioflag 0x%x\n", + printf(DINT "offset: %" PRId64 ", resid %zu, ioflag 0x%x\n", rw_msg->pvnr_offset, rw_msg->pvnr_resid, rw_msg->pvnr_ioflag); } @@ -304,7 +306,7 @@ { struct puffs_vnmsg_rw *rw_msg = (void *)preq; - printf("\t\tresid after op: %zu\n", rw_msg->pvnr_resid); + printf(DINT "resid after op: %zu\n", rw_msg->pvnr_resid); } void @@ -312,7 +314,7 @@ { struct puffs_vnmsg_readdir *readdir_msg = (void *)preq; - printf("\t\tresid after op: %zu, eofflag %d\n", + printf(DINT "resid after op: %zu, eofflag %d\n", readdir_msg->pvnr_resid, readdir_msg->pvnr_eofflag); } @@ -321,7 +323,7 @@ { struct puffs_vnmsg_open *open_msg = (void *)preq; - printf("\t\tmode: 0x%x\n", open_msg->pvnr_mode); + printf(DINT "mode: 0x%x\n", open_msg->pvnr_mode); } void @@ -329,7 +331,7 @@ { struct puffs_vnmsg_remove *remove_msg = (void *)preq; /* XXX! */ - printf("\t\ttarget cookie: %p\n", remove_msg->pvnr_cookie_targ); + printf(DINT "target cookie: %p\n", remove_msg->pvnr_cookie_targ); } void @@ -337,19 +339,5 @@ { struct puffs_vnmsg_readdir *readdir_msg = (void *)preq; - printf("\t\tread offset: %" PRId64 "\n", readdir_msg->pvnr_offset); -} - -void -/*ARGSUSED*/ -puffsdump_creds(struct puffs_cred *pcr) -{ - -} - -void -puffsdump_int(int value, const char *name) -{ - - printf("\t
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Thu Jan 7 17:45:58 UTC 2010 Modified Files: src/sys/dev/pci: if_wm.c if_wmreg.h if_wmvar.h Log Message: Make wm_reset() and wm_gmii_reset() close to e1000 driver. At least, this change make wm_attach() be stable on ICH9. To generate a diff of this commit: cvs rdiff -u -r1.188 -r1.189 src/sys/dev/pci/if_wm.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_wmreg.h cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_wmvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.188 src/sys/dev/pci/if_wm.c:1.189 --- src/sys/dev/pci/if_wm.c:1.188 Thu Jan 7 17:34:38 2010 +++ src/sys/dev/pci/if_wm.c Thu Jan 7 17:45:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.188 2010/01/07 17:34:38 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.189 2010/01/07 17:45:58 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.188 2010/01/07 17:34:38 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.189 2010/01/07 17:45:58 msaitoh Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -535,6 +535,8 @@ static void wm_attach(device_t, device_t, void *); static int wm_is_onboard_nvm_eeprom(struct wm_softc *); static void wm_get_auto_rd_done(struct wm_softc *); +static void wm_lan_init_done(struct wm_softc *); +static void wm_get_cfg_done(struct wm_softc *); static int wm_get_swsm_semaphore(struct wm_softc *); static void wm_put_swsm_semaphore(struct wm_softc *); static int wm_poll_eerd_eewr_done(struct wm_softc *, int); @@ -555,6 +557,7 @@ static int wm_check_mng_mode_ich8lan(struct wm_softc *); static int wm_check_mng_mode_82574(struct wm_softc *); static int wm_check_mng_mode_generic(struct wm_softc *); +static int wm_check_reset_block(struct wm_softc *); static void wm_get_hw_control(struct wm_softc *); static int wm_check_for_link(struct wm_softc *); @@ -994,6 +997,7 @@ break; default: memh_valid = 0; + break; } if (memh_valid) { @@ -1171,6 +1175,7 @@ "unknown PCIXSPD %d; assuming 66MHz\n", reg & STATUS_PCIXSPD_MASK); sc->sc_bus_speed = 66; +break; } } else sc->sc_bus_speed = (reg & STATUS_PCI66) ? 66 : 33; @@ -3013,7 +3018,9 @@ static void wm_reset(struct wm_softc *sc) { - uint32_t reg; + int phy_reset = 0; + uint32_t reg, func, mask; + int i; /* * Allocate on-chip memory according to the MTU size. @@ -3074,6 +3081,37 @@ /* clear interrupt */ CSR_WRITE(sc, WMREG_IMC, 0xU); + /* Stop the transmit and receive processes. */ + CSR_WRITE(sc, WMREG_RCTL, 0); + CSR_WRITE(sc, WMREG_TCTL, TCTL_PSP); + + /* set_tbi_sbp_82543() */ + + delay(10*1000); + + /* Must acquire the MDIO ownership before MAC reset */ + switch(sc->sc_type) { + case WM_T_82573: + case WM_T_82574: + case WM_T_82583: + i = 0; + reg = CSR_READ(sc, WMREG_EXTCNFCTR) + | EXTCNFCTR_MDIO_SW_OWNERSHIP; + do { + CSR_WRITE(sc, WMREG_EXTCNFCTR, + reg | EXTCNFCTR_MDIO_SW_OWNERSHIP); + reg = CSR_READ(sc, WMREG_EXTCNFCTR); + if ((reg & EXTCNFCTR_MDIO_SW_OWNERSHIP) != 0) +break; + reg |= EXTCNFCTR_MDIO_SW_OWNERSHIP; + delay(2*1000); + i++; + } while (i < WM_MDIO_OWNERSHIP_TIMEOUT); + break; + default: + break; + } + /* * 82541 Errata 29? & 82547 Errata 28? * See also the description about PHY_RST bit in CTRL register @@ -3086,12 +3124,11 @@ } switch (sc->sc_type) { - case WM_T_82544: - case WM_T_82540: - case WM_T_82545: - case WM_T_82546: + case WM_T_82544: /* XXX check whether WM_F_IOH_VALID is set */ case WM_T_82541: case WM_T_82541_2: + case WM_T_82547: + case WM_T_82547_2: /* * On some chipsets, a reset through a memory-mapped write * cycle can cause the chip to reset before completing the @@ -3108,26 +3145,51 @@ else CSR_WRITE(sc, WMREG_CTRL, CTRL_RST); break; - case WM_T_82545_3: case WM_T_82546_3: /* Use the shadow control register on these chips. */ CSR_WRITE(sc, WMREG_CTRL_SHADOW, CTRL_RST); break; - + case WM_T_80003: + func = (CSR_READ(sc, WMREG_STATUS) >> STATUS_FUNCID_SHIFT) & 1; + mask = func ? SWFW_PHY1_SM : SWFW_PHY0_SM; + reg = CSR_READ(sc, WMREG_CTRL) | CTRL_RST; + wm_get_swfw_semaphore(sc, mask); + CSR_WRITE(sc, WMREG_CTRL, reg); + wm_put_swfw_semaphore(sc, mask); + break; case WM_T_ICH8: case WM_T_ICH9: case WM_T_ICH10: + reg = CSR_READ(sc, WMREG_CTRL) | CTRL_RST; + if (wm_check_reset_block(sc) == 0) { + reg |= CTRL_PHY_RESET; + phy_reset = 1; + } wm_get_swfwhw_semaphore(sc); - CSR_WRITE(sc, WMREG_CTRL, CTRL_RST | CTRL_PHY_RESET); - delay(1); + CSR_WRITE(sc, WMREG_CTRL, reg); + delay(20*1000); + wm_put_swfwhw_semaphore(sc); break; + case WM_T_82542_2_0: + case WM_T_82542_2_1: + case WM_T_82543: + case WM_T_82540: + case WM_T_82545: + case WM_T_82
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Thu Jan 7 17:34:38 UTC 2010 Modified Files: src/sys/dev/pci: if_wm.c if_wmreg.h Log Message: bugfixes: - add missing break in wm_reset()... - fix the offset of WMREG_PBS... - fix length of some delay()s in wm_gmii_reset() To generate a diff of this commit: cvs rdiff -u -r1.187 -r1.188 src/sys/dev/pci/if_wm.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/if_wmreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.187 src/sys/dev/pci/if_wm.c:1.188 --- src/sys/dev/pci/if_wm.c:1.187 Tue Jan 5 10:02:01 2010 +++ src/sys/dev/pci/if_wm.c Thu Jan 7 17:34:38 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.187 2010/01/05 10:02:01 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.188 2010/01/07 17:34:38 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.187 2010/01/05 10:02:01 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.188 2010/01/07 17:34:38 msaitoh Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -3121,7 +3121,7 @@ wm_get_swfwhw_semaphore(sc); CSR_WRITE(sc, WMREG_CTRL, CTRL_RST | CTRL_PHY_RESET); delay(1); - + break; default: /* Everything else can safely use the documented method. */ CSR_WRITE(sc, WMREG_CTRL, CTRL_RST); @@ -4596,7 +4596,7 @@ CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl | CTRL_PHY_RESET); delay((sc->sc_type >= WM_T_82571) ? 100 : 10*1000); CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl); - delay(150*1000); + delay(150); if ((sc->sc_type == WM_T_82541) || (sc->sc_type == WM_T_82541_2) @@ -4613,7 +4613,7 @@ CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl | CTRL_PHY_RESET); delay(100); CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl); - delay(150*1000); + delay(150); /* Allow time for h/w to get to a quiescent state afer reset */ delay(10*1000); Index: src/sys/dev/pci/if_wmreg.h diff -u src/sys/dev/pci/if_wmreg.h:1.30 src/sys/dev/pci/if_wmreg.h:1.31 --- src/sys/dev/pci/if_wmreg.h:1.30 Tue Jan 5 10:02:01 2010 +++ src/sys/dev/pci/if_wmreg.h Thu Jan 7 17:34:38 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wmreg.h,v 1.30 2010/01/05 10:02:01 msaitoh Exp $ */ +/* $NetBSD: if_wmreg.h,v 1.31 2010/01/07 17:34:38 msaitoh Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -610,7 +610,7 @@ #define PBA_40K 0x0028 #define PBA_48K 0x0030 /* 48K, default Rx allocation */ -#define WMREG_PBS 0x1000 /* Packet Buffer Size (ICH8 only ?) */ +#define WMREG_PBS 0x1008 /* Packet Buffer Size (ICH) */ #define WMREG_TXDMAC 0x3000 /* Transfer DMA Control */ #define TXDMAC_DPP (1U << 0) /* disable packet prefetch */
CVS commit: src/usr.sbin/installboot
Module Name:src Committed By: tsutsui Date: Thu Jan 7 13:26:00 UTC 2010 Modified Files: src/usr.sbin/installboot: ext2fs.c ffs.c fstypes.c installboot.c installboot.h src/usr.sbin/installboot/arch: hp300.c next68k.c Log Message: Add a sectorsize parameter member in struct ib_params and use it where sector size (disk block size) is required, instead of DEV_BSIZE constant which means device I/O block size. "Looks reasonable" from dholland@, and fixes tools installboot(8) on Cygwin where DEV_BSIZE != 512 as mentioned in PR toolchain/42555. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/installboot/ext2fs.c cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/installboot/ffs.c cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/installboot/fstypes.c cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/installboot/installboot.c cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/installboot/installboot.h cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/installboot/arch/hp300.c cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/installboot/arch/next68k.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/installboot/ext2fs.c diff -u src/usr.sbin/installboot/ext2fs.c:1.4 src/usr.sbin/installboot/ext2fs.c:1.5 --- src/usr.sbin/installboot/ext2fs.c:1.4 Mon Oct 19 18:41:17 2009 +++ src/usr.sbin/installboot/ext2fs.c Thu Jan 7 13:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs.c,v 1.4 2009/10/19 18:41:17 bouyer Exp $ */ +/* $NetBSD: ext2fs.c,v 1.5 2010/01/07 13:26:00 tsutsui Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. @@ -59,7 +59,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ext2fs.c,v 1.4 2009/10/19 18:41:17 bouyer Exp $"); +__RCSID("$NetBSD: ext2fs.c,v 1.5 2010/01/07 13:26:00 tsutsui Exp $"); #endif /* !__lint */ #include @@ -108,7 +108,7 @@ assert(size > 0); assert(blk != NULL); - rv = pread(params->fsfd, blk, size, blkno * DEV_BSIZE); + rv = pread(params->fsfd, blk, size, blkno * params->sectorsize); if (rv == -1) { warn("Reading block %llu in `%s'", (unsigned long long)blkno, params->filesystem); @@ -127,7 +127,7 @@ { uint8_t sbbuf[SBSIZE]; - if (ext2fs_read_disk_block(params, SBOFF / DEV_BSIZE, SBSIZE, + if (ext2fs_read_disk_block(params, SBOFF / params->sectorsize, SBSIZE, sbbuf) == 0) e2fs_sbload((void *)sbbuf, &fs->e2fs); Index: src/usr.sbin/installboot/ffs.c diff -u src/usr.sbin/installboot/ffs.c:1.27 src/usr.sbin/installboot/ffs.c:1.28 --- src/usr.sbin/installboot/ffs.c:1.27 Sun Apr 5 12:03:48 2009 +++ src/usr.sbin/installboot/ffs.c Thu Jan 7 13:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.27 2009/04/05 12:03:48 lukem Exp $ */ +/* $NetBSD: ffs.c,v 1.28 2010/01/07 13:26:00 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ffs.c,v 1.27 2009/04/05 12:03:48 lukem Exp $"); +__RCSID("$NetBSD: ffs.c,v 1.28 2010/01/07 13:26:00 tsutsui Exp $"); #endif /* !__lint */ #include @@ -97,7 +97,7 @@ assert(size > 0); assert(blk != NULL); - rv = pread(params->fsfd, blk, size, blkno * DEV_BSIZE); + rv = pread(params->fsfd, blk, size, blkno * params->sectorsize); if (rv == -1) { warn("Reading block %llu in `%s'", (unsigned long long)blkno, params->filesystem); @@ -475,10 +475,10 @@ raid_match(ib_params *params) { /* XXX Assumes 512 bytes / sector */ - if (DEV_BSIZE != 512) { + if (params->sectorsize != 512) { warnx("Media is %d bytes/sector." " RAID is only supported on 512 bytes/sector media.", - DEV_BSIZE); + params->sectorsize); return 0; } return ffs_match_common(params, (off_t) RF_PROTECTED_SECTORS); @@ -497,7 +497,7 @@ fs = (struct fs *)sbbuf; for (i = 0; sblock_try[i] != -1; i++) { - loc = sblock_try[i] / DEV_BSIZE + offset; + loc = sblock_try[i] / params->sectorsize + offset; if (!ffs_read_disk_block(params, loc, SBLOCKSIZE, sbbuf)) continue; switch (fs->fs_magic) { Index: src/usr.sbin/installboot/fstypes.c diff -u src/usr.sbin/installboot/fstypes.c:1.11 src/usr.sbin/installboot/fstypes.c:1.12 --- src/usr.sbin/installboot/fstypes.c:1.11 Mon Apr 28 20:24:16 2008 +++ src/usr.sbin/installboot/fstypes.c Thu Jan 7 13:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fstypes.c,v 1.11 2008/04/28 20:24:16 martin Exp $ */ +/* $NetBSD: fstypes.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: fstypes.c,v 1.11 2008/04/28 20:24:16 martin Exp $"); +__RCSID("$NetBSD: fstypes.c,v 1.12 2010/01/07 13:26:00 tsutsui Exp $"); #endif /* !__lint */ #include @@ -95,7 +95,7 @@ for (i = 0; i < nblk; i++) { blocks[i].block = params->s2start + - i * (params->fstype->blocksize / 512); + i * (params->fstype->blocksize / par
CVS commit: src/lib/libc/arch/hppa/gen
Module Name:src Committed By: skrll Date: Thu Jan 7 12:31:10 UTC 2010 Modified Files: src/lib/libc/arch/hppa/gen: _lwp.c Log Message: Deal with PLABELs in _lwp_makecontext To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/hppa/gen/_lwp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/hppa/gen/_lwp.c diff -u src/lib/libc/arch/hppa/gen/_lwp.c:1.3 src/lib/libc/arch/hppa/gen/_lwp.c:1.4 --- src/lib/libc/arch/hppa/gen/_lwp.c:1.3 Mon Apr 28 20:22:56 2008 +++ src/lib/libc/arch/hppa/gen/_lwp.c Thu Jan 7 12:31:10 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _lwp.c,v 1.3 2008/04/28 20:22:56 martin Exp $ */ +/* $NetBSD: _lwp.c,v 1.4 2010/01/07 12:31:10 skrll Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: _lwp.c,v 1.3 2008/04/28 20:22:56 martin Exp $"); +__RCSID("$NetBSD: _lwp.c,v 1.4 2010/01/07 12:31:10 skrll Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -47,6 +47,8 @@ { caddr_t sp; __greg_t *gr; + __greg_t *gp; + __greg_t fp; getcontext(u); gr = u->uc_mcontext.__gregs; @@ -56,8 +58,14 @@ u->uc_stack.ss_size = stack_size; sp = stack_base + HPPA_FRAME_SIZE; - gr[_REG_PCOQH] = (__greg_t) start; - gr[_REG_PCOQT] = (__greg_t) start + 4; + fp = (__greg_t)start; + if (fp & 2) { + gp = (__greg_t *)(fp & ~3); + fp = gp[0]; + gr[_REG_R19] = gp[1]; + } + gr[_REG_PCOQH] = fp | HPPA_PC_PRIV_USER; + gr[_REG_PCOQT] = (fp + 4) | HPPA_PC_PRIV_USER; gr[_REG_RP] = (__greg_t) _lwp_exit; gr[_REG_ARG0] = (__greg_t) arg; gr[_REG_SP] = (__greg_t) sp;
CVS commit: src/share/man/man4
Module Name:src Committed By: wiz Date: Thu Jan 7 10:32:01 UTC 2010 Modified Files: src/share/man/man4: gphyter.4 Log Message: Bump date for previous. New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/gphyter.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/gphyter.4 diff -u src/share/man/man4/gphyter.4:1.3 src/share/man/man4/gphyter.4:1.4 --- src/share/man/man4/gphyter.4:1.3 Thu Jan 7 09:30:29 2010 +++ src/share/man/man4/gphyter.4 Thu Jan 7 10:32:01 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: gphyter.4,v 1.3 2010/01/07 09:30:29 jdc Exp $ +.\" $NetBSD: gphyter.4,v 1.4 2010/01/07 10:32:01 wiz Exp $ .\" .\" Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 31, 2001 +.Dd January 7, 2010 .Dt GPHYTER 4 .Os .Sh NAME @@ -41,8 +41,8 @@ The .Nm driver supports the National Semiconductor DP83861, DP83865 and DP83891 -(Gig PHYTER) 10/100/1000 Ethernet PHYs. These PHYs are found on a variety of -CAT5 Gigabit Ethernet interfaces. +(Gig PHYTER) 10/100/1000 Ethernet PHYs. +These PHYs are found on a variety of CAT5 Gigabit Ethernet interfaces. .Sh SEE ALSO .Xr ifmedia 4 , .Xr intro 4 ,
CVS commit: src/sys/arch/sparc64/conf
Module Name:src Committed By: jdc Date: Thu Jan 7 09:34:49 UTC 2010 Modified Files: src/sys/arch/sparc64/conf: GENERIC Log Message: Add cas, gentbi and gphyter for Sun Cassini/Cassini+ Ethernet. To generate a diff of this commit: cvs rdiff -u -r1.115 -r1.116 src/sys/arch/sparc64/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/conf/GENERIC diff -u src/sys/arch/sparc64/conf/GENERIC:1.115 src/sys/arch/sparc64/conf/GENERIC:1.116 --- src/sys/arch/sparc64/conf/GENERIC:1.115 Tue Dec 29 07:00:42 2009 +++ src/sys/arch/sparc64/conf/GENERIC Thu Jan 7 09:34:49 2010 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.115 2009/12/29 07:00:42 macallan Exp $ +# $NetBSD: GENERIC,v 1.116 2010/01/07 09:34:49 jdc Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.115 $" +#ident "GENERIC-$Revision: 1.116 $" maxusers 64 @@ -484,6 +484,7 @@ # UT marks untested. an* at pci? dev ? function ? # Aironet PC4500/PC4800 (802.11) UT ath* at pci? dev ? function ? # Atheros 5210/5211/5212 802.11 UT +cas* at pci? dev ? function ? # Sun Cassini/Cassini+ Ethernet en* at pci? dev ? function ? # ENI/Adaptec ATM UT # XXX causes ICE #ep* at pci? dev ? function ? # 3Com 3c59x @@ -524,6 +525,8 @@ ciphy* at mii? phy ? # Cicada CS8201 Gig-E PHYs dmphy* at mii? phy ? # Davicom DM9101 PHYs exphy* at mii? phy ? # 3Com internal PHYs +gentbi* at mii? phy ? # Generic Ten-Bit 1000BASE-[CLS]X PHYs +gphyter* at mii? phy ? # NS83861 Gig-E PHY icsphy* at mii? phy ? # Integrated Circuit Systems ICS189x ikphy* at mii? phy ? # Intel 82563 PHYs inphy* at mii? phy ? # Intel 82555 PHYs
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: jdc Date: Thu Jan 7 09:33:44 UTC 2010 Modified Files: src/sys/arch/sparc64/dev: pci_machdep.c Log Message: Cope with up to four "interrupts" properties for a node. Just use the first one for now. This should be improved. OK: m...@. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sparc64/dev/pci_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/dev/pci_machdep.c diff -u src/sys/arch/sparc64/dev/pci_machdep.c:1.66 src/sys/arch/sparc64/dev/pci_machdep.c:1.67 --- src/sys/arch/sparc64/dev/pci_machdep.c:1.66 Wed Jan 6 05:55:01 2010 +++ src/sys/arch/sparc64/dev/pci_machdep.c Thu Jan 7 09:33:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.66 2010/01/06 05:55:01 mrg Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.67 2010/01/07 09:33:44 jdc Exp $ */ /* * Copyright (c) 1999, 2000 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.66 2010/01/06 05:55:01 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.67 2010/01/07 09:33:44 jdc Exp $"); #include #include @@ -415,37 +415,44 @@ pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp) { pcitag_t tag = pa->pa_tag; - int interrupts, *intp; + int interrupts[4], *intp, int_used; int len, node = PCITAG_NODE(tag); char devtype[30]; - intp = &interrupts; - len = 1; - if (prom_getprop(node, "interrupts", sizeof(interrupts), + intp = &interrupts[0]; + len = prom_getproplen(node, "interrupts"); + if (len > sizeof(interrupts)) { + DPRINTF(SPDB_INTMAP, + ("pci_intr_map: too many available interrupts\n")); + return (ENODEV); + } + if (prom_getprop(node, "interrupts", len, &len, &intp) != 0 || len != 1) { DPRINTF(SPDB_INTMAP, ("pci_intr_map: could not read interrupts\n")); return (ENODEV); } - if (OF_mapintr(node, &interrupts, sizeof(interrupts), - sizeof(interrupts)) < 0) { + /* XXX We pick the first interrupt, but should do better */ + int_used = interrupts[0]; + if (OF_mapintr(node, &int_used, sizeof(int_used), + sizeof(int_used)) < 0) { printf("OF_mapintr failed\n"); KASSERT(pa->pa_pc->spc_find_ino); - pa->pa_pc->spc_find_ino(pa, &interrupts); + pa->pa_pc->spc_find_ino(pa, &int_used); } - DPRINTF(SPDB_INTMAP, ("OF_mapintr() gave %x\n", interrupts)); + DPRINTF(SPDB_INTMAP, ("OF_mapintr() gave %x\n", int_used)); /* Try to find an IPL for this type of device. */ prom_getpropstringA(node, "device_type", devtype, sizeof(devtype)); for (len = 0; intrmap[len].in_class != NULL; len++) if (strcmp(intrmap[len].in_class, devtype) == 0) { - interrupts |= INTLEVENCODE(intrmap[len].in_lev); - DPRINTF(SPDB_INTMAP, ("reset to %x\n", interrupts)); + int_used |= INTLEVENCODE(intrmap[len].in_lev); + DPRINTF(SPDB_INTMAP, ("reset to %x\n", int_used)); break; } - *ihp = interrupts; + *ihp = int_used; /* Call the sub-driver is necessary */ if (pa->pa_pc->spc_intr_map)
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jdc Date: Thu Jan 7 09:31:44 UTC 2010 Modified Files: src/sys/dev/mii: miidevs.h Log Message: Regenerate for: Add NS DP83865 To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 src/sys/dev/mii/miidevs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.93 src/sys/dev/mii/miidevs.h:1.94 --- src/sys/dev/mii/miidevs.h:1.93 Mon Dec 14 01:48:34 2009 +++ src/sys/dev/mii/miidevs.h Thu Jan 7 09:31:44 2010 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.93 2009/12/14 01:48:34 enami Exp $ */ +/* $NetBSD: miidevs.h,v 1.94 2010/01/07 09:31:44 jdc Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.91 2009/12/13 19:20:17 matt Exp + * NetBSD: miidevs,v 1.92 2010/01/07 09:31:19 jdc Exp */ /*- @@ -339,6 +339,8 @@ #define MII_STR_xxNATSEMI_DP83891 "DP83891 1000BASE-T media interface" #define MII_MODEL_xxNATSEMI_DP83861 0x0006 #define MII_STR_xxNATSEMI_DP83861 "DP83861 1000BASE-T media interface" +#define MII_MODEL_xxNATSEMI_DP83865 0x0007 +#define MII_STR_xxNATSEMI_DP83865 "DP83865 1000BASE-T media interface" /* PMC Sierra PHYs */ #define MII_MODEL_xxPMCSIERRA_PM8351 0x
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jdc Date: Thu Jan 7 09:31:19 UTC 2010 Modified Files: src/sys/dev/mii: miidevs Log Message: Add NS DP83865. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.91 src/sys/dev/mii/miidevs:1.92 --- src/sys/dev/mii/miidevs:1.91 Sun Dec 13 19:20:17 2009 +++ src/sys/dev/mii/miidevs Thu Jan 7 09:31:19 2010 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.91 2009/12/13 19:20:17 matt Exp $ +$NetBSD: miidevs,v 1.92 2010/01/07 09:31:19 jdc Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -239,6 +239,7 @@ model xxNATSEMI DP83847 0x0003 DP83847 10/100 media interface model xxNATSEMI DP83891 0x0005 DP83891 1000BASE-T media interface model xxNATSEMI DP83861 0x0006 DP83861 1000BASE-T media interface +model xxNATSEMI DP83865 0x0007 DP83865 1000BASE-T media interface /* PMC Sierra PHYs */ model xxPMCSIERRA PM8351 0x PM8351 OctalPHY Gigabit interface
CVS commit: src
Module Name:src Committed By: jdc Date: Thu Jan 7 09:30:29 UTC 2010 Modified Files: src/share/man/man4: gphyter.4 src/sys/dev/mii: gphyter.c Log Message: Add DP83865 to the supported PHY list (from OpenBSD). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/gphyter.4 cvs rdiff -u -r1.27 -r1.28 src/sys/dev/mii/gphyter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/gphyter.4 diff -u src/share/man/man4/gphyter.4:1.2 src/share/man/man4/gphyter.4:1.3 --- src/share/man/man4/gphyter.4:1.2 Wed Apr 30 13:10:54 2008 +++ src/share/man/man4/gphyter.4 Thu Jan 7 09:30:29 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: gphyter.4,v 1.2 2008/04/30 13:10:54 martin Exp $ +.\" $NetBSD: gphyter.4,v 1.3 2010/01/07 09:30:29 jdc Exp $ .\" .\" Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -33,15 +33,16 @@ .Os .Sh NAME .Nm gphyter -.Nd Driver for National Semiconductor DP83861 10/100/1000 Ethernet PHYs +.Nd Driver for National Semiconductor DP83861, DP83865 and DP83891 10/100/1000 +Ethernet PHYs .Sh SYNOPSIS .Cd "gphyter* at mii? phy ?" .Sh DESCRIPTION The .Nm -driver supports the National Semiconductor DP83861 and DP83891 (Gig PHYTER) -10/100/1000 Ethernet PHYs. These PHYs are found on a variety of CAT5 Gigabit -Ethernet interfaces. +driver supports the National Semiconductor DP83861, DP83865 and DP83891 +(Gig PHYTER) 10/100/1000 Ethernet PHYs. These PHYs are found on a variety of +CAT5 Gigabit Ethernet interfaces. .Sh SEE ALSO .Xr ifmedia 4 , .Xr intro 4 , Index: src/sys/dev/mii/gphyter.c diff -u src/sys/dev/mii/gphyter.c:1.27 src/sys/dev/mii/gphyter.c:1.28 --- src/sys/dev/mii/gphyter.c:1.27 Mon Oct 19 18:41:13 2009 +++ src/sys/dev/mii/gphyter.c Thu Jan 7 09:30:28 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: gphyter.c,v 1.27 2009/10/19 18:41:13 bouyer Exp $ */ +/* $NetBSD: gphyter.c,v 1.28 2010/01/07 09:30:28 jdc Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -55,15 +55,18 @@ */ /* - * driver for National Semiconductor's DP83891 and DP83861 `Gig PHYTER' - * ethernet 10/100/1000 PHYs. The DP83891 is an older, non-firmware- - * driven version of the DP83861. + * driver for National Semiconductor's DP83891, DP83861 and DP83865 + * `Gig PHYTER' ethernet 10/100/1000 PHYs. The DP83891 is an older, + * non-firmware-driven version of the DP83861. The DP83865 is a low + * power version of the DP83861. * - * Data Sheet available from www.national.com + * Data Sheets available from www.national.com: + * http://www.national.com/ds/DP/DP83861.pdf + * http://www.national.com/ds/DP/DP83865.pdf */ #include -__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.27 2009/10/19 18:41:13 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.28 2010/01/07 09:30:28 jdc Exp $"); #include #include @@ -99,6 +102,9 @@ { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83861, MII_STR_xxNATSEMI_DP83861 }, + { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83865, + MII_STR_xxNATSEMI_DP83865 }, + { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83891, MII_STR_xxNATSEMI_DP83891 },
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdc Date: Thu Jan 7 09:27:16 UTC 2010 Modified Files: src/sys/dev/pci: pcidevs Log Message: Add Sun Cassini/NS Saturn devices. To generate a diff of this commit: cvs rdiff -u -r1.1007 -r1.1008 src/sys/dev/pci/pcidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/pcidevs diff -u src/sys/dev/pci/pcidevs:1.1007 src/sys/dev/pci/pcidevs:1.1008 --- src/sys/dev/pci/pcidevs:1.1007 Sun Jan 3 04:26:26 2010 +++ src/sys/dev/pci/pcidevs Thu Jan 7 09:27:16 2010 @@ -1,4 +1,4 @@ -$NetBSD: pcidevs,v 1.1007 2010/01/03 04:26:26 jnemeth Exp $ +$NetBSD: pcidevs,v 1.1008 2010/01/07 09:27:16 jdc Exp $ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou @@ -3014,6 +3014,7 @@ product NS CS5535_AUDIO 0x002e CS5535 Audio Controller product NS CS5535_USB 0x002f CS5535 USB Host Controller product NS CS5535_VIDEO 0x0030 CS5535 Video Controller +product NS SATURN 0x0035 Saturn product NS SC1100_IDE 0x0502 SC1100 PCI IDE product NS SC1100_AUDIO 0x0503 SC1100 XpressAUDIO product NS SC1100_ISA 0x0510 SC1100 PCI-ISA Bridge @@ -3885,6 +3886,7 @@ product SUN MS_IIep 0x9000 microSPARC IIep PCI product SUN US_IIi 0xa000 UltraSPARC IIi PCI product SUN US_IIe 0xa001 UltraSPARC IIe PCI +product SUN CASSINI 0xabba Cassini Gigabit Ethernet /* Sundance Technology products */ product SUNDANCETI IP100A 0x0200 IP100A 10/100 Ethernet
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdc Date: Thu Jan 7 09:25:19 UTC 2010 Modified Files: src/sys/dev/pci: files.pci Log Message: Add cas (Sun Cassini/Cassini+ (GigaSwift) Ethernet). To generate a diff of this commit: cvs rdiff -u -r1.323 -r1.324 src/sys/dev/pci/files.pci Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/files.pci diff -u src/sys/dev/pci/files.pci:1.323 src/sys/dev/pci/files.pci:1.324 --- src/sys/dev/pci/files.pci:1.323 Wed Oct 28 02:10:27 2009 +++ src/sys/dev/pci/files.pci Thu Jan 7 09:25:19 2010 @@ -1,4 +1,4 @@ -# $NetBSD: files.pci,v 1.323 2009/10/28 02:10:27 macallan Exp $ +# $NetBSD: files.pci,v 1.324 2010/01/07 09:25:19 jdc Exp $ # # Config file and device description for machine-independent PCI code. # Included by ports that need it. Requires that the SCSI files be @@ -368,6 +368,11 @@ attach gem at pci with gem_pci file dev/pci/if_gem_pci.c gem_pci +# Sun Cassini-network +device cas: arp, ether, ifnet, mii +attach cas at pci +file dev/pci/if_cas.c cas + # JMicron JMC2[56]0 ethernet controllers device jme: ether, ifnet, arp, mii attach jme at pci
CVS commit: src/sys/dev
Module Name:src Committed By: jdc Date: Thu Jan 7 09:24:46 UTC 2010 Modified Files: src/sys/dev: DEVNAMES Log Message: Add cas (Sun Cassini/Cassini+ (GigaSwift) Ethernet). To generate a diff of this commit: cvs rdiff -u -r1.253 -r1.254 src/sys/dev/DEVNAMES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/DEVNAMES diff -u src/sys/dev/DEVNAMES:1.253 src/sys/dev/DEVNAMES:1.254 --- src/sys/dev/DEVNAMES:1.253 Sat Dec 5 16:29:14 2009 +++ src/sys/dev/DEVNAMES Thu Jan 7 09:24:45 2010 @@ -1,4 +1,4 @@ -# $NetBSD: DEVNAMES,v 1.253 2009/12/05 16:29:14 pooka Exp $ +# $NetBSD: DEVNAMES,v 1.254 2010/01/07 09:24:45 jdc Exp $ # # This file contains all used device names and defined attributes in # alphabetical order. New devices added to the system somewhere should first @@ -202,6 +202,7 @@ cac MI cardbus MI cardslot MI +cas MI cbb MI cbbus MI Attribute cbiiisc amiga
CVS commit: src
Module Name:src Committed By: jdc Date: Thu Jan 7 09:23:55 UTC 2010 Modified Files: src/distrib/sets/lists/man: mi src/share/man/man4: Makefile Log Message: Add cas(4) manual page. To generate a diff of this commit: cvs rdiff -u -r1.1180 -r1.1181 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.500 -r1.501 src/share/man/man4/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1180 src/distrib/sets/lists/man/mi:1.1181 --- src/distrib/sets/lists/man/mi:1.1180 Mon Jan 4 20:18:02 2010 +++ src/distrib/sets/lists/man/mi Thu Jan 7 09:23:54 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1180 2010/01/04 20:18:02 haad Exp $ +# $NetBSD: mi,v 1.1181 2010/01/07 09:23:54 jdc Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -816,6 +816,7 @@ ./usr/share/man/cat4/cardbus.0 man-sys-catman .cat ./usr/share/man/cat4/cardslot.0 man-sys-catman .cat ./usr/share/man/cat4/carp.0 man-sys-catman .cat +./usr/share/man/cat4/cas.0 man-sys-catman .cat ./usr/share/man/cat4/cbb.0 man-sys-catman .cat ./usr/share/man/cat4/ccd.0 man-sys-catman .cat ./usr/share/man/cat4/cd.0 man-sys-catman .cat @@ -3448,6 +3449,7 @@ ./usr/share/man/html4/cardbus.html man-sys-htmlman html ./usr/share/man/html4/cardslot.html man-sys-htmlman html ./usr/share/man/html4/carp.html man-sys-htmlman html +./usr/share/man/html4/cas.html man-sys-htmlman html ./usr/share/man/html4/cbb.html man-sys-htmlman html ./usr/share/man/html4/ccd.html man-sys-htmlman html ./usr/share/man/html4/cd.html man-sys-htmlman html @@ -5858,6 +5860,7 @@ ./usr/share/man/man4/cardbus.4 man-sys-man .man ./usr/share/man/man4/cardslot.4 man-sys-man .man ./usr/share/man/man4/carp.4 man-sys-man .man +./usr/share/man/man4/cas.4 man-sys-man .man ./usr/share/man/man4/cbb.4 man-sys-man .man ./usr/share/man/man4/ccd.4 man-sys-man .man ./usr/share/man/man4/cd.4 man-sys-man .man Index: src/share/man/man4/Makefile diff -u src/share/man/man4/Makefile:1.500 src/share/man/man4/Makefile:1.501 --- src/share/man/man4/Makefile:1.500 Mon Jan 4 16:57:48 2010 +++ src/share/man/man4/Makefile Thu Jan 7 09:23:54 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.500 2010/01/04 16:57:48 haad Exp $ +# $NetBSD: Makefile,v 1.501 2010/01/07 09:23:54 jdc Exp $ # @(#)Makefile 8.1 (Berkeley) 6/18/93 MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 acpidalb.4 \ @@ -15,7 +15,7 @@ bio.4 bktr.4 bluetooth.4 bmtphy.4 bpf.4 \ brgphy.4 bridge.4 bthidev.4 bthub.4 btkbd.4 btms.4 btsco.4 btuart.4 \ bwi.4 \ - cac.4 cardbus.4 carp.4 ccd.4 cd.4 \ + cac.4 cardbus.4 carp.4 cas.4 ccd.4 cd.4 \ cec.4 cgd.4 cfb.4 ch.4 chipsfb.4 ciphy.4 ciss.4 clcs.4 clct.4 clnp.4 \ clockctl.4 cltp.4 cmdide.4 cmpci.4 cms.4 cnw.4 \ com.4 coretemp.4 crypto.4 cs80bus.4 cuda.4 cypide.4 \
CVS commit: src/share/man/man4
Module Name:src Committed By: jdc Date: Thu Jan 7 09:20:45 UTC 2010 Added Files: src/share/man/man4: cas.4 Log Message: Manual page for cas (Sun Cassini/Cassini+ GigaSwift) Ethernet). To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/share/man/man4/cas.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/share/man/man4/cas.4 diff -u /dev/null src/share/man/man4/cas.4:1.1 --- /dev/null Thu Jan 7 09:20:45 2010 +++ src/share/man/man4/cas.4 Thu Jan 7 09:20:45 2010 @@ -0,0 +1,102 @@ +.\" $NetBSD: cas.4,v 1.1 2010/01/07 09:20:45 jdc Exp $ +.\" +.\" Copyright (c) 2010 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd January 7, 2010 +.Dt CAS 4 +.Os +.Sh NAME +.Nm cas +.Nd Cassini/Cassini+ (GigaSwift) Ethernet device driver +.Sh SYNOPSIS +.Cd "cas* at pci? dev ? function ?" +.Pp +Configuration of PHYs may also be necessary. +See +.Xr mii 4 . +.Sh DESCRIPTION +The +.Nm +driver provides support for the Sun Cassini and Cassini+ (GigaSwift) and the +National Semiconductor Saturn Ethernet hardware found in Sun UltraSPARC machines +and Sun GigaSwift PCI cards. +.Pp +Cards supported by this driver include: +.Bl -bullet -compact -offset indent +.It +Sun Gigaswift Ethernet (SX fibre variants) +.It +Sun Gigaswift Ethernet (UTP variants) +.It +Sun quad Gigaswift Ethernet +.El +.Sh SEE ALSO +.Xr brgphy 4 , +.Xr gentbi 4 , +.Xr gphyter 4 , +.Xr ifmedia 4 , +.Xr intro 4 , +.Xr mii 4 , +.Xr ifconfig 8 +.Rs +.%T "Cassini+ ASIC Specification" +.%A Sun Microsystems +.%O http://www.sun.com/processors/manuals/cs_plus.pdf +.Re +.Rs +.Re +.Sh HISTORY +The +.Nm +driver first appeared in +.Ox 4.1 . +.Nx +support was added in +.Nx 6.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written for +.Ox +by +.An Mark Kettenis +.Aq kette...@openbsd.org , +based on the +.Xr gem 4 +driver, and ported to +.Nx +by +.An Julian Coleman +.Aq j...@netbsd.org . +.Sh BUGS +The +.Nm +driver does not support any of the advanced features of the Cassini chip. +.Pp +On the SX fibre variants of the hardware, the link may stay down if media +options apart from +.Dv autoselect +are chosen.