Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-20 Thread Alexey Dokuchaev
On Wed, May 20, 2009 at 06:58:07PM +, Rick Macklem wrote:
> Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
> ==
> --- head/sys/fs/nfsserver/nfs_nfsdstate.c Wed May 20 18:45:49 2009
> (r192462)
> +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Wed May 20 18:58:07 2009
> (r192463)
> @@ -3709,7 +3709,7 @@ nfsrv_nextclientindex(void)
>* In practice, we'll never get here, but the reboot is here,
>* just for fun. (client_index will not wrap around on any real server)
>*/
> - printf("you must reboot now\n");
> + panic("nfsv4 server out of clientids");

Shouldn't the comment above be also tweaked?

./danfe
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192523 - stable/7/sys/cddl/compat/opensolaris/sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Thu May 21 05:58:29 2009
New Revision: 192523
URL: http://svn.freebsd.org/changeset/base/192523

Log:
  remove duplicated file contents
  
  Reported by: pluk...@gmail.com

Modified:
  stable/7/sys/cddl/compat/opensolaris/sys/file.h
  stable/7/sys/cddl/compat/opensolaris/sys/kidmap.h
  stable/7/sys/cddl/compat/opensolaris/sys/pathname.h

Modified: stable/7/sys/cddl/compat/opensolaris/sys/file.h
==
--- stable/7/sys/cddl/compat/opensolaris/sys/file.h Thu May 21 05:38:50 
2009(r192522)
+++ stable/7/sys/cddl/compat/opensolaris/sys/file.h Thu May 21 05:58:29 
2009(r192523)
@@ -55,174 +55,3 @@ releasef(file_t *fp)
 #endif /* _KERNEL */
 
 #endif /* !_OPENSOLARIS_SYS_FILE_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * 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 AUTHORS 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 AUTHORS 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.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_FILE_H_
-#define_OPENSOLARIS_SYS_FILE_H_
-
-#include_next 
-
-#ifdef _KERNEL
-typedefstruct file file_t;
-
-static __inline file_t *
-getf(int fd, int write)
-{
-   struct file *fp;
-
-   if (write && fget_write(curthread, fd, &fp) == 0)
-   return (fp);
-   else if (!write && fget_read(curthread, fd, &fp) == 0)
-   return (fp);
-   return (NULL);
-}
-
-static __inline void
-releasef(file_t *fp)
-{
-
-   fdrop(fp, curthread);
-}
-#endif /* _KERNEL */
-
-#endif /* !_OPENSOLARIS_SYS_FILE_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * 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 AUTHORS 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 AUTHORS 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.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_FILE_H_
-#define_OPENSOLARIS_SYS_FILE_H_
-
-#include_next 
-
-#ifdef _KERNEL
-typedefstruct file file_t;
-
-static __inline file_t *
-getf(int fd, int write)
-{
-   struct file *fp;
-
-   if (write && fget_write(curthread, fd, &fp) == 0)
-   return (fp);
-   else if (!write && fget_read(curthread, fd, &fp) == 0)
-   return (fp);
-   return (NULL);
-}
-
-static __inline void
-releasef(file_t *fp)
-{
-
-   fdrop(fp, curthread);
-}
-#endif /* _KERNEL */
-
-#endif /* !_OPENSOLARIS_SYS_FILE_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the followin

svn commit: r192522 - stable/7/cddl/compat/opensolaris/include

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Thu May 21 05:38:50 2009
New Revision: 192522
URL: http://svn.freebsd.org/changeset/base/192522

Log:
  remove duplicate patching

Modified:
  stable/7/cddl/compat/opensolaris/include/libshare.h

Modified: stable/7/cddl/compat/opensolaris/include/libshare.h
==
--- stable/7/cddl/compat/opensolaris/include/libshare.h Thu May 21 04:49:02 
2009(r192521)
+++ stable/7/cddl/compat/opensolaris/include/libshare.h Thu May 21 05:38:50 
2009(r192522)
@@ -34,111 +34,3 @@
 #defineSA_INIT_CONTROL_API 0
 
 #endif /* !_OPENSOLARIS_LIBSHARE_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * 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 AUTHORS 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 AUTHORS 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.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_LIBSHARE_H_
-#define _OPENSOLARIS_LIBSHARE_H_
-
-#defineSA_OK   0
-
-#defineSA_INIT_CONTROL_API 0
-
-#endif /* !_OPENSOLARIS_LIBSHARE_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * 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 AUTHORS 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 AUTHORS 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.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_LIBSHARE_H_
-#define _OPENSOLARIS_LIBSHARE_H_
-
-#defineSA_OK   0
-
-#defineSA_INIT_CONTROL_API 0
-
-#endif /* !_OPENSOLARIS_LIBSHARE_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * 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 AUTHORS 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 AUTHORS 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 

svn commit: r192521 - stable/7/usr.bin/ncal

2009-05-20 Thread Ruslan Ermilov
Author: ru
Date: Thu May 21 04:49:02 2009
New Revision: 192521
URL: http://svn.freebsd.org/changeset/base/192521

Log:
  Fixed multi-byte character support to actually work.

Modified:
  stable/7/usr.bin/ncal/   (props changed)
  stable/7/usr.bin/ncal/ncal.c

Modified: stable/7/usr.bin/ncal/ncal.c
==
--- stable/7/usr.bin/ncal/ncal.cThu May 21 04:44:21 2009
(r192520)
+++ stable/7/usr.bin/ncal/ncal.cThu May 21 04:49:02 2009
(r192521)
@@ -423,7 +423,7 @@ printmonth(int y, int m, int jd_flag)
mkweekdays(&wds);
printf("%ls %d\n", month.name, y);
for (i = 0; i != 7; i++)
-   printf("%.2ls%s\n", wds.names[i], month.lines[i]);
+   wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]);
if (flag_weeks)
printf("  %s\n", month.weeks);
 }
@@ -479,17 +479,17 @@ printyear(int y, int jd_flag)
printf("%s\n", center(t, s, mpl * mw));
 
for (j = 0; j != 12; j += mpl) {
-   printf("%-*ls%-*ls",
+   wprintf(L"%-*ls%-*ls",
mw, year[j].name,
mw, year[j + 1].name);
if (mpl == 3)
printf("%ls\n", year[j + 2].name);
else
-   printf("%-*ls%ls\n",
+   wprintf(L"%-*ls%ls\n",
mw, year[j + 2].name,
year[j + 3].name);
for (i = 0; i != 7; i++) {
-   printf("%.2ls%-*s%-*s",
+   wprintf(L"%.2ls%-*s%-*s",
wds.names[i],
mw, year[j].lines[i],
mw, year[j + 1].lines[i]);
@@ -537,11 +537,11 @@ printyearb(int y, int jd_flag)
printf("%s\n\n", center(t, s, mw * mpl + mpl));
 
for (j = 0; j != 12; j += mpl) {
-   printf("%-*ls  ", mw, wcenter(ws, year[j].name, mw));
+   wprintf(L"%-*ls  ", mw, wcenter(ws, year[j].name, mw));
if (mpl == 2)
printf("%ls\n", wcenter(ws, year[j + 1].name, mw));
else
-   printf("%-*ls  %ls\n", mw,
+   wprintf(L"%-*ls  %ls\n", mw,
wcenter(ws, year[j + 1].name, mw),
wcenter(wt, year[j + 2].name, mw));
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192517 - head/sys/dev/wi

2009-05-20 Thread Sam Leffler
Author: sam
Date: Thu May 21 04:00:31 2009
New Revision: 192517
URL: http://svn.freebsd.org/changeset/base/192517

Log:
  force type match

Modified:
  head/sys/dev/wi/if_wi.c

Modified: head/sys/dev/wi/if_wi.c
==
--- head/sys/dev/wi/if_wi.c Thu May 21 03:35:02 2009(r192516)
+++ head/sys/dev/wi/if_wi.c Thu May 21 04:00:31 2009(r192517)
@@ -1382,7 +1382,7 @@ wi_rx_intr(struct wi_softc *sc)
 
rstamp = (le16toh(frmhdr.wi_rx_tstamp0) << 16) |
le16toh(frmhdr.wi_rx_tstamp1);
-   tap->wr_tsf = htole64(rstamp);
+   tap->wr_tsf = htole64((uint64_t)rstamp);
/* XXX replace divide by table */
tap->wr_rate = frmhdr.wi_rx_rate / 5;
tap->wr_flags = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192515 - head/share/man/man4

2009-05-20 Thread Pyun YongHyeon
Author: yongari
Date: Thu May 21 02:47:46 2009
New Revision: 192515
URL: http://svn.freebsd.org/changeset/base/192515

Log:
  Add nge(4) to the list of drivers supporting ALTQ.

Modified:
  head/share/man/man4/altq.4

Modified: head/share/man/man4/altq.4
==
--- head/share/man/man4/altq.4  Thu May 21 02:44:32 2009(r192514)
+++ head/share/man/man4/altq.4  Thu May 21 02:47:46 2009(r192515)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 12, 2009
+.Dd May 21, 2009
 .Dt ALTQ 4
 .Os
 .Sh NAME
@@ -140,6 +140,7 @@ They have been applied to the following 
 .Xr mxge 4 ,
 .Xr my 4 ,
 .Xr nfe 4 ,
+.Xr nge 4 ,
 .Xr npe 4 ,
 .Xr nve 4 ,
 .Xr ral 4 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192514 - head/share/man/man4

2009-05-20 Thread Pyun YongHyeon
Author: yongari
Date: Thu May 21 02:44:32 2009
New Revision: 192514
URL: http://svn.freebsd.org/changeset/base/192514

Log:
  nge(4) supports altq(4). Xr altq

Modified:
  head/share/man/man4/nge.4

Modified: head/share/man/man4/nge.4
==
--- head/share/man/man4/nge.4   Thu May 21 02:42:15 2009(r192513)
+++ head/share/man/man4/nge.4   Thu May 21 02:44:32 2009(r192514)
@@ -220,6 +220,7 @@ The device has stopped responding to the
 the network connection (cable).
 .El
 .Sh SEE ALSO
+.Xr altq 4 ,
 .Xr arp 4 ,
 .Xr miibus 4 ,
 .Xr netintro 4 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192513 - head/share/man/man4

2009-05-20 Thread Pyun YongHyeon
Author: yongari
Date: Thu May 21 02:42:15 2009
New Revision: 192513
URL: http://svn.freebsd.org/changeset/base/192513

Log:
  DP83821 also supports jumbo frames.

Modified:
  head/share/man/man4/nge.4

Modified: head/share/man/man4/nge.4
==
--- head/share/man/man4/nge.4   Thu May 21 02:39:47 2009(r192512)
+++ head/share/man/man4/nge.4   Thu May 21 02:42:15 2009(r192513)
@@ -69,8 +69,8 @@ Most cards also use the DP83861 10/100/1
 chip, which supports autonegotiation of 10, 100 and 1000Mbps modes in
 full or half duplex.
 .Pp
-The DP83820 also supports jumbo frames, which can be configured
-via the interface MTU setting.
+The DP83820 and DP83821 also support jumbo frames, which can be
+configured via the interface MTU setting.
 Selecting an MTU larger than 1500 bytes with the
 .Xr ifconfig 8
 utility configures the adapter to receive and transmit jumbo frames.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192512 - head/share/man/man4

2009-05-20 Thread Pyun YongHyeon
Author: yongari
Date: Thu May 21 02:39:47 2009
New Revision: 192512
URL: http://svn.freebsd.org/changeset/base/192512

Log:
  Document sysctl variable dev.nge.%d.int_holdoff.

Modified:
  head/share/man/man4/nge.4

Modified: head/share/man/man4/nge.4
==
--- head/share/man/man4/nge.4   Thu May 21 02:26:51 2009(r192511)
+++ head/share/man/man4/nge.4   Thu May 21 02:39:47 2009(r192512)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2009
+.Dd May 21, 2009
 .Dt NGE 4
 .Os
 .Sh NAME
@@ -182,6 +182,21 @@ Surecom Technology EP-320G-TX
 .It
 Trendware TEG-PCITX (32-bit PCI) and TEG-PCITX2 (64-bit PCI)
 .El
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width "xx"
+.It Va dev.nge.%d.int_holdoff
+Maximum amount of time to delay interrupt processing in units of
+100us.
+The accepted range is 0 to 255, the default is 1(100us).
+Value 0 completely disables the interrupt moderation.
+The interface has to be brought down and up again before a change
+takes effect.
+.El
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "nge%d: couldn't map memory"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192511 - head/sys/dev/usb/wlan

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Thu May 21 02:26:51 2009
New Revision: 192511
URL: http://svn.freebsd.org/changeset/base/192511

Log:
  Print out device attachment.

Modified:
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c

Modified: head/sys/dev/usb/wlan/if_uath.c
==
--- head/sys/dev/usb/wlan/if_uath.c Thu May 21 02:25:32 2009
(r192510)
+++ head/sys/dev/usb/wlan/if_uath.c Thu May 21 02:26:51 2009
(r192511)
@@ -355,6 +355,7 @@ uath_attach(device_t dev)
 #ifdef UATH_DEBUG
sc->sc_debug = uath_debug;
 #endif
+   device_set_usb2_desc(dev);
 
/*
 * Only post-firmware devices here.

Modified: head/sys/dev/usb/wlan/if_upgt.c
==
--- head/sys/dev/usb/wlan/if_upgt.c Thu May 21 02:25:32 2009
(r192510)
+++ head/sys/dev/usb/wlan/if_upgt.c Thu May 21 02:26:51 2009
(r192511)
@@ -257,6 +257,7 @@ upgt_attach(device_t dev)
 #ifdef UPGT_DEBUG
sc->sc_debug = upgt_debug;
 #endif
+   device_set_usb2_desc(dev);
 
mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK,
MTX_DEF);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192508 - head/sys/sparc64/conf

2009-05-20 Thread Pyun YongHyeon
Author: yongari
Date: Thu May 21 02:19:01 2009
New Revision: 192508
URL: http://svn.freebsd.org/changeset/base/192508

Log:
  Add nge(4), nge(4) should work on all architectures.

Modified:
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/sparc64/conf/GENERIC
==
--- head/sys/sparc64/conf/GENERIC   Thu May 21 02:18:10 2009
(r192507)
+++ head/sys/sparc64/conf/GENERIC   Thu May 21 02:19:01 2009
(r192508)
@@ -177,6 +177,7 @@ device  dc  # DEC/Intel 21143 and 
variou
 device fxp # Intel EtherExpress PRO/100B (82557, 82558)
 device gem # Sun GEM/Sun ERI/Apple GMAC
 device hme # Sun HME (Happy Meal Ethernet)
+device nge # NatSemi DP83820 gigabit Ethernet
 #devicepcn # AMD Am79C97x PCI 10/100 (precedence 
over 'le')
 device re  # RealTek 8139C+/8169/8169S/8110S
 device rl  # RealTek 8129/8139
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192507 - stable/7

2009-05-20 Thread Brad Davis
Author: brd (doc committer)
Date: Thu May 21 02:18:10 2009
New Revision: 192507
URL: http://svn.freebsd.org/changeset/base/192507

Log:
  Add some missing blank lines.
  
  Approved by:  kmacy@

Modified:
  stable/7/UPDATING

Modified: stable/7/UPDATING
==
--- stable/7/UPDATING   Thu May 21 02:12:10 2009(r192506)
+++ stable/7/UPDATING   Thu May 21 02:18:10 2009(r192507)
@@ -7,12 +7,14 @@ done items, please see the COMMON ITEMS:
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
+
 20090520
Update ZFS to version 13. ZFS users will need to re-build
kernel and world. Existing pools will continue to work
without upgrade. If a pool is upgraded it will no longer be
usable by older kernel revs. ZFS send / recv between 
pool version 6 and pool version 13 is not supported.
+
 20090504:
FreeBSD 7.2-RELEASE
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192506 - head/sys/dev/nge

2009-05-20 Thread Pyun YongHyeon
Author: yongari
Date: Thu May 21 02:12:10 2009
New Revision: 192506
URL: http://svn.freebsd.org/changeset/base/192506

Log:
  bus_dma(9) conversion and make nge(4) work on all architectures.
  o Header file cleanup.
  o bus_dma(9) conversion.
- Removed all consumers of vtophys(9) and converted to use
  bus_dma(9).
- 64bit DMA support was disabled because DP83821 is not capable
  of handling the DMA request. 64bit DMA request on DP83820
  requires different descriptor structures and it's hard to
  dynamically change descriptor format at run time so I disabled
  it. Note, this is the same behavior as previous one but
  previously nge(4) didn't explicitly disable 64bit mode on
  DP83820.
- Added Tx/Rx descriptor ring alignment requirements(8 bytes
  alignment).
- Limit maximum number of Tx DMA segments to 16. In fact,
  controller does not seem to have limitations on number of Tx
  DMA segments but 16 should be enough for most cases and
  m_collapse(9) will handle highly fragmented frames without
  consuming a lot of CPU cycles.
- Added Rx buffer alignment requirements(8 bytes alignment). This
  means driver should fixup received frames to align on 16bits
  boundary on strict-alignment architectures.
- Nuked driver private data structure in descriptor ring.
- Added endianness support code in Tx/Rx descriptor access.
  o Prefer faster memory mapped register access to I/O mapped access.
 Added fall-back mechanism to use alternative register access.
 The hardware supports both memory and I/O mapped access.
  o Added suspend/resume methods but it wasn't tested as controller I
have does not support PCI PME.
  o Removed swap argument in nge_read_eeprom() since endianness
should be handled after reading EEPROM.
  o Implemented experimental 802.3x full-duplex flow-control. ATM
it was commented out but will be activated after we have generic
flow-control framework in mii(4) layer.
  o Rearranged promiscuous mode settings and simplified logic.
  o Always disable Rx filter prior to changing Rx filter functions as
indicated in DP83820/DP83821 datasheet.
  o Added an explicit DELAY in timeout loop of nge_reset().
  o Added a sysctl variable dev.nge.%d.int_holdoff to control
interrupt moderation. Valid ranges are 1 to 255(default 1) in
units of 100us. The actual delivery of interrupt would be delayed
based on the sysctl value. The interface has to be brought down
and up again before a change takes effect. With proper tuning
value, users do not need to resort to polling(4) anymore.
  o Added ALTQ(4) support.
  o Added missing IFCAP_VLAN_HWCSUM as nge(4) can offload Tx/Rx
checksum calculation on VLAN tagged frames as well as VLAN tag
insertion/stripping. Also add IFCAP_VLAN_MTU capability as nge(4)
can handle VLAN tagged oversized frames.
  o Fixed media header length for VLAN.
  o Rearranged nge_detach routine such that it's now used for general
clean-up routine.
  o Enabled MWI.
  o Accessing EEPROM takes very long time so read 6 bytes ethernet
address with one call instead of 3 separate accesses.
  o Don't set if_mtu in device attach, it's already set in
ether_ifattach().
  o Don't do any special things for TBI interface. Remove TBI
specific media handling in the driver and have gentbi(4) handle
it. Add glue code to read/write TBI PHY registers in miibus
method. This change removes a lot of PHY handling code in driver
and now its functionality is handled by mii(4).
  o Alignment fixup code is now applied only for strict-alignment
architectures. Previously the code was applied for all
architectures except i386. With this change amd64 will get
instant Rx performance boost.
  o When driver fails to allocate a new mbuf, update if_qdrops so
users can see what was wrong in Rx path.
  o Added a workaround for a hardware bug which resulted in short
VLAN tagged frames(e.g. ARP) was rejected as if runt frame was
received. With this workaround nge(4) now accepts the short VLAN
tagged frame and nge(4) can take full advantage of hardware VLAN
tag stripping. I have no idea how this bug wasn't known so far,
without the workaround nge(4) may never work on VLAN
environments.
  o Fixed Rx checksum offload logic such that it now honors active
interface capability configured with ifconfig(8).
  o In nge_start()/nge_txencap(), always leave at least one free
descriptor as indicated in datasheet. Without this the hardware
would be confused with ring descriptor structure(e.g. no clue
for the end of descriptor ring).
  o Removed dead-code that checks interrupts on PHY hardware. The
code was designed to detect link state changes but it was
disabled as driving nge_tick clock would break auto-negotiation
timer. This code is no longer needed as nge(4) now uses mii(4)
and link state change handling is done with 

svn commit: r192505 - in head/sys/dev: ata if_ndis sound/usb

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Thu May 21 02:09:12 2009
New Revision: 192505
URL: http://svn.freebsd.org/changeset/base/192505

Log:
  Fix a few variable renames of usb2_mode outside dev/usb.

Modified:
  head/sys/dev/ata/ata-usb.c
  head/sys/dev/if_ndis/if_ndis_usb.c
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/ata/ata-usb.c
==
--- head/sys/dev/ata/ata-usb.c  Thu May 21 02:04:42 2009(r192504)
+++ head/sys/dev/ata/ata-usb.c  Thu May 21 02:09:12 2009(r192505)
@@ -281,7 +281,7 @@ atausb2_probe(device_t dev)
struct usb2_attach_arg *uaa = device_get_ivars(dev);
struct usb2_interface_descriptor *id;
 
-   if (uaa->usb2_mode != USB_MODE_HOST) {
+   if (uaa->usb_mode != USB_MODE_HOST) {
return (ENXIO);
}
if (uaa->use_generic == 0) {

Modified: head/sys/dev/if_ndis/if_ndis_usb.c
==
--- head/sys/dev/if_ndis/if_ndis_usb.c  Thu May 21 02:04:42 2009
(r192504)
+++ head/sys/dev/if_ndis/if_ndis_usb.c  Thu May 21 02:09:12 2009
(r192505)
@@ -136,7 +136,7 @@ ndisusb_match(device_t self)
struct drvdb_ent *db;
struct usb2_attach_arg *uaa = device_get_ivars(self);
 
-   if (uaa->usb2_mode != USB_MODE_HOST)
+   if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
if (uaa->info.bConfigIndex != NDISUSB_CONFIG_NO)
return (ENXIO);

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Thu May 21 02:04:42 2009
(r192504)
+++ head/sys/dev/sound/usb/uaudio.c Thu May 21 02:09:12 2009
(r192505)
@@ -80,14 +80,14 @@ static int uaudio_default_channels = 2;
 #if USB_DEBUG
 static int uaudio_debug = 0;
 
-SYSCTL_NODE(_hw_usb2, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio");
-SYSCTL_INT(_hw_usb2_uaudio, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio");
+SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RW,
 &uaudio_debug, 0, "uaudio debug level");
-SYSCTL_INT(_hw_usb2_uaudio, OID_AUTO, default_rate, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RW,
 &uaudio_default_rate, 0, "uaudio default sample rate");
-SYSCTL_INT(_hw_usb2_uaudio, OID_AUTO, default_bits, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RW,
 &uaudio_default_bits, 0, "uaudio default sample bits");
-SYSCTL_INT(_hw_usb2_uaudio, OID_AUTO, default_channels, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RW,
 &uaudio_default_channels, 0, "uaudio default sample channels");
 #endif
 
@@ -532,7 +532,7 @@ uaudio_probe(device_t dev)
 {
struct usb2_attach_arg *uaa = device_get_ivars(dev);
 
-   if (uaa->usb2_mode != USB_MODE_HOST)
+   if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
 
if (uaa->use_generic == 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192503 - head/sys/fs/nfsserver

2009-05-20 Thread Rick Macklem
Author: rmacklem
Date: Thu May 21 01:50:27 2009
New Revision: 192503
URL: http://svn.freebsd.org/changeset/base/192503

Log:
  Modify sys/fs/nfsserver/nfs_nfsdport.c to use nlm_acquire_next_sysid()
  to set the l_sysid for locks correctly.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cThu May 21 01:48:42 2009
(r192502)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cThu May 21 01:50:27 2009
(r192503)
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
+#include 
 
 extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1;
 extern int nfsv4root_set;
@@ -56,6 +58,7 @@ struct mtx nfs_cache_mutex;
 struct mtx nfs_v4root_mutex;
 struct nfsrvfh nfs_rootfh, nfs_pubfh;
 int nfs_pubfhset = 0, nfs_rootfhset = 0;
+static uint32_t nfsv4_sysid = 0;
 
 static int nfssvc_srvcall(struct thread *, struct nfssvc_args *,
 struct ucred *);
@@ -2777,8 +2780,10 @@ nfsvno_localconflict(struct vnode *vp, i
 * Since an NFSv4 lockowner is a ClientID plus an array of up to 1024
 * bytes, so it can't be put in l_sysid.
 */
+   if (nfsv4_sysid == 0)
+   nfsv4_sysid = nlm_acquire_next_sysid();
fl.l_pid = (pid_t)0;
-   fl.l_sysid = 0;
+   fl.l_sysid = (int)nfsv4_sysid;
 
NFSVOPUNLOCK(vp, 0, td);
error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_GETLK, &fl,
@@ -2837,8 +2842,10 @@ nfsvno_advlock(struct vnode *vp, int fty
 * Since an NFSv4 lockowner is a ClientID plus an array of up to 1024
 * bytes, so it can't be put in l_sysid.
 */
+   if (nfsv4_sysid == 0)
+   nfsv4_sysid = nlm_acquire_next_sysid();
fl.l_pid = (pid_t)0;
-   fl.l_sysid = 0;
+   fl.l_sysid = (int)nfsv4_sysid;
 
NFSVOPUNLOCK(vp, 0, td);
error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192502 - in head: . sys/dev/usb sys/dev/usb/controller sys/dev/usb/input sys/dev/usb/misc sys/dev/usb/net sys/dev/usb/serial sys/dev/usb/storage sys/dev/usb/wlan

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Thu May 21 01:48:42 2009
New Revision: 192502
URL: http://svn.freebsd.org/changeset/base/192502

Log:
  Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/UPDATING
  head/sys/dev/usb/controller/at91dci.c
  head/sys/dev/usb/controller/atmegadci.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/musb_otg.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/controller/uss820dci.c
  head/sys/dev/usb/input/uhid.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/input/ums.c
  head/sys/dev/usb/misc/udbp.c
  head/sys/dev/usb/net/if_aue.c
  head/sys/dev/usb/net/if_axe.c
  head/sys/dev/usb/net/if_cdce.c
  head/sys/dev/usb/net/if_cue.c
  head/sys/dev/usb/net/if_kue.c
  head/sys/dev/usb/net/if_rue.c
  head/sys/dev/usb/net/if_udav.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/serial/ubsa.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/uchcom.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/ulpt.c
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/serial/umoscom.c
  head/sys/dev/usb/serial/uplcom.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/uslcom.c
  head/sys/dev/usb/serial/uvisor.c
  head/sys/dev/usb/serial/uvscom.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/storage/urio.c
  head/sys/dev/usb/storage/ustorage_fs.c
  head/sys/dev/usb/usb_debug.c
  head/sys/dev/usb/usb_debug.h
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_process.c
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/UPDATING
==
--- head/UPDATING   Thu May 21 01:14:12 2009(r192501)
+++ head/UPDATING   Thu May 21 01:48:42 2009(r192502)
@@ -23,6 +23,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
ln -s aj /etc/malloc.conf.)
 
 20090520:
+   The sysctl tree for the usb stack has renamed from hw.usb2.* to
+   hw.usb.* and is now consistent again with previous releases.
+
+20090520:
802.11 monitor mode support was revised and driver api's
were changed.  Drivers dependent on net80211 now support
DLT_IEEE802_11_RADIO instead of DLT_IEEE802_11.  No

Modified: head/sys/dev/usb/controller/at91dci.c
==
--- head/sys/dev/usb/controller/at91dci.c   Thu May 21 01:14:12 2009
(r192501)
+++ head/sys/dev/usb/controller/at91dci.c   Thu May 21 01:48:42 2009
(r192502)
@@ -73,8 +73,8 @@ __FBSDID("$FreeBSD$");
 #if USB_DEBUG
 static int at91dcidebug = 0;
 
-SYSCTL_NODE(_hw_usb2, OID_AUTO, at91dci, CTLFLAG_RW, 0, "USB at91dci");
-SYSCTL_INT(_hw_usb2_at91dci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_NODE(_hw_usb, OID_AUTO, at91dci, CTLFLAG_RW, 0, "USB at91dci");
+SYSCTL_INT(_hw_usb_at91dci, OID_AUTO, debug, CTLFLAG_RW,
 &at91dcidebug, 0, "at91dci debug level");
 #endif
 

Modified: head/sys/dev/usb/controller/atmegadci.c
==
--- head/sys/dev/usb/controller/atmegadci.c Thu May 21 01:14:12 2009
(r192501)
+++ head/sys/dev/usb/controller/atmegadci.c Thu May 21 01:48:42 2009
(r192502)
@@ -65,8 +65,8 @@ __FBSDID("$FreeBSD$");
 #if USB_DEBUG
 static int atmegadci_debug = 0;
 
-SYSCTL_NODE(_hw_usb2, OID_AUTO, atmegadci, CTLFLAG_RW, 0, "USB ATMEGA DCI");
-SYSCTL_INT(_hw_usb2_atmegadci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW, 0, "USB ATMEGA DCI");
+SYSCTL_INT(_hw_usb_atmegadci, OID_AUTO, debug, CTLFLAG_RW,
 &atmegadci_debug, 0, "ATMEGA DCI debug level");
 #endif
 

Modified: head/sys/dev/usb/controller/ehci.c
==
--- head/sys/dev/usb/controller/ehci.c  Thu May 21 01:14:12 2009
(r192501)
+++ head/sys/dev/usb/controller/ehci.c  Thu May 21 01:48:42 2009
(r192502)
@@ -73,10 +73,10 @@ __FBSDID("$FreeBSD$");
 static int ehcidebug = 0;
 static int ehcinohighspeed = 0;
 
-SYSCTL_NODE(_hw_usb2, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci");
-SYSCTL_INT(_hw_usb2_ehci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci");
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW,
 &ehcidebug, 0, "Debug level");
-SYSCTL_INT(_hw_usb2_ehci, OID_AUTO, no_hs, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW,
 &ehci

svn commit: r192501 - head/sys/nlm

2009-05-20 Thread Rick Macklem
Author: rmacklem
Date: Thu May 21 01:14:12 2009
New Revision: 192501
URL: http://svn.freebsd.org/changeset/base/192501

Log:
  Add a function to sys/nlm/nlm_prot_impl.c that returns a unique
  lock sysid to be used for non-nlm remote locking. This is required
  for the experimental nfsv4 server, so that it can acquire byte
  range locks correctly on behalf of nfsv4 clients.
  
  Reviewed by:  dfr
  Approved by:  kib (mentor)

Modified:
  head/sys/nlm/nlm.h
  head/sys/nlm/nlm_prot_impl.c

Modified: head/sys/nlm/nlm.h
==
--- head/sys/nlm/nlm.h  Thu May 21 01:05:21 2009(r192500)
+++ head/sys/nlm/nlm.h  Thu May 21 01:14:12 2009(r192501)
@@ -210,6 +210,11 @@ struct vop_reclaim_args;
 extern int nlm_advlock(struct vop_advlock_args *ap);
 extern int nlm_reclaim(struct vop_reclaim_args *ap);
 
+/*
+ * Acquire the next sysid for remote locks not handled by the NLM.
+ */
+extern uint32_t nlm_acquire_next_sysid(void);
+
 #endif
 
 #endif

Modified: head/sys/nlm/nlm_prot_impl.c
==
--- head/sys/nlm/nlm_prot_impl.cThu May 21 01:05:21 2009
(r192500)
+++ head/sys/nlm/nlm_prot_impl.cThu May 21 01:14:12 2009
(r192501)
@@ -835,6 +835,20 @@ nlm_create_host(const char* caller_name)
 }
 
 /*
+ * Acquire the next sysid for remote locks not handled by the NLM.
+ */
+uint32_t
+nlm_acquire_next_sysid(void)
+{
+   uint32_t next_sysid;
+
+   mtx_lock(&nlm_global_lock);
+   next_sysid = nlm_next_sysid++;
+   mtx_unlock(&nlm_global_lock);
+   return (next_sysid);
+}
+
+/*
  * Return non-zero if the address parts of the two sockaddrs are the
  * same.
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192500 - in head/sys/dev/usb: . controller template

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Thu May 21 01:05:21 2009
New Revision: 192500
URL: http://svn.freebsd.org/changeset/base/192500

Log:
  Use enums for speed and rev data types.

Modified:
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/template/usb_template.c
  head/sys/dev/usb/usb_bus.h
  head/sys/dev/usb/usb_compat_linux.h
  head/sys/dev/usb/usb_controller.h
  head/sys/dev/usb/usb_core.h
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_revision.h
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/usb_transfer.h

Modified: head/sys/dev/usb/controller/usb_controller.c
==
--- head/sys/dev/usb/controller/usb_controller.cThu May 21 00:04:17 
2009(r192499)
+++ head/sys/dev/usb/controller/usb_controller.cThu May 21 01:05:21 
2009(r192500)
@@ -290,7 +290,7 @@ usb2_bus_attach(struct usb2_proc_msg *pm
struct usb2_device *child;
device_t dev;
usb2_error_t err;
-   uint8_t speed;
+   enum usb_dev_speed speed;
 
bus = ((struct usb2_bus_msg *)pm)->bus;
dev = bus->bdev;

Modified: head/sys/dev/usb/template/usb_template.c
==
--- head/sys/dev/usb/template/usb_template.cThu May 21 00:04:17 2009
(r192499)
+++ head/sys/dev/usb/template/usb_template.cThu May 21 01:05:21 2009
(r192500)
@@ -167,7 +167,7 @@ usb2_make_endpoint_desc(struct usb2_temp
temp->err = USB_ERR_INVAL;
return;
}
-   mps = ted->pPacketSize->mps[temp->usb2_speed];
+   mps = ted->pPacketSize->mps[temp->usb_speed];
if (mps == 0) {
/* not initialized */
temp->err = USB_ERR_INVAL;
@@ -194,9 +194,9 @@ usb2_make_endpoint_desc(struct usb2_temp
/* setup bInterval parameter */
 
if (ted->pIntervals &&
-   ted->pIntervals->bInterval[temp->usb2_speed]) {
+   ted->pIntervals->bInterval[temp->usb_speed]) {
ed->bInterval =
-   ted->pIntervals->bInterval[temp->usb2_speed];
+   ted->pIntervals->bInterval[temp->usb_speed];
} else {
switch (et) {
case UE_BULK:
@@ -204,7 +204,7 @@ usb2_make_endpoint_desc(struct usb2_temp
ed->bInterval = 0;  /* not used */
break;
case UE_INTERRUPT:
-   switch (temp->usb2_speed) {
+   switch (temp->usb_speed) {
case USB_SPEED_LOW:
case USB_SPEED_FULL:
ed->bInterval = 1;  /* 1 ms */
@@ -215,7 +215,7 @@ usb2_make_endpoint_desc(struct usb2_temp
}
break;
default:/* UE_ISOCHRONOUS */
-   switch (temp->usb2_speed) {
+   switch (temp->usb_speed) {
case USB_SPEED_LOW:
case USB_SPEED_FULL:
ed->bInterval = 1;  /* 1 ms */
@@ -435,7 +435,7 @@ usb2_make_device_desc(struct usb2_temp_s
USETW(utd->udq.bcdUSB, 0x0200);
utd->udq.bMaxPacketSize0 = 0;
 
-   switch (temp->usb2_speed) {
+   switch (temp->usb_speed) {
case USB_SPEED_LOW:
USETW(utd->udd.bcdUSB, 0x0110);
utd->udd.bMaxPacketSize = 8;
@@ -622,9 +622,9 @@ usb2_hw_ep_get_needs(struct usb2_hw_ep_s
struct usb2_descriptor *desc;
struct usb2_interface_descriptor *id;
struct usb2_endpoint_descriptor *ed;
+   enum usb_dev_speed speed;
uint16_t wMaxPacketSize;
uint16_t temp;
-   uint8_t speed;
uint8_t ep_no;
 
ep_iface = ues->ep_max;
@@ -1192,7 +1192,7 @@ usb2_temp_setup(struct usb2_device *udev
 
bzero(uts, sizeof(*uts));
 
-   uts->usb2_speed = udev->speed;
+   uts->usb_speed = udev->speed;
uts->self_powered = udev->flags.self_powered;
 
/* first pass */

Modified: head/sys/dev/usb/usb_bus.h
==
--- head/sys/dev/usb/usb_bus.h  Thu May 21 00:04:17 2009(r192499)
+++ head/sys/dev/usb/usb_bus.h  Thu May 21 01:05:21 2009(r192500)
@@ -93,7 +93,7 @@ struct usb2_bus {
 
uint8_t alloc_failed;   /* Set if memory allocation failed. */
uint8_t driver_added_refcount;  /* Current driver generation count */
-   uint8_t usbrev; /* USB revision. See "USB_REV_XXX". */
+  

svn commit: r192499 - in head/sys/dev/usb: . bluetooth controller input misc net serial storage wlan

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Thu May 21 00:04:17 2009
New Revision: 192499
URL: http://svn.freebsd.org/changeset/base/192499

Log:
  - rename usb2_mode to usb_mode [1]
  - change variable types to use the enum
  
  Submitted by: Hans Petter Selasky [1]

Modified:
  head/sys/dev/usb/bluetooth/ng_ubt.c
  head/sys/dev/usb/bluetooth/ubtbcmfw.c
  head/sys/dev/usb/controller/at91dci.c
  head/sys/dev/usb/controller/atmegadci.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/musb_otg.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/uss820dci.c
  head/sys/dev/usb/input/uhid.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/input/ums.c
  head/sys/dev/usb/misc/udbp.c
  head/sys/dev/usb/misc/ufm.c
  head/sys/dev/usb/net/if_aue.c
  head/sys/dev/usb/net/if_axe.c
  head/sys/dev/usb/net/if_cdce.c
  head/sys/dev/usb/net/if_cue.c
  head/sys/dev/usb/net/if_kue.c
  head/sys/dev/usb/net/if_rue.c
  head/sys/dev/usb/net/if_udav.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/serial/uark.c
  head/sys/dev/usb/serial/ubsa.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/uchcom.c
  head/sys/dev/usb/serial/ucycom.c
  head/sys/dev/usb/serial/ufoma.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/ugensa.c
  head/sys/dev/usb/serial/uipaq.c
  head/sys/dev/usb/serial/ulpt.c
  head/sys/dev/usb/serial/umct.c
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/serial/umoscom.c
  head/sys/dev/usb/serial/uplcom.c
  head/sys/dev/usb/serial/uslcom.c
  head/sys/dev/usb/serial/uvisor.c
  head/sys/dev/usb/serial/uvscom.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/storage/urio.c
  head/sys/dev/usb/storage/ustorage_fs.c
  head/sys/dev/usb/usb_busdma.c
  head/sys/dev/usb/usb_compat_linux.c
  head/sys/dev/usb/usb_core.h
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_hub.h
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_revision.h
  head/sys/dev/usb/usb_transfer.c
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/sys/dev/usb/bluetooth/ng_ubt.c
==
--- head/sys/dev/usb/bluetooth/ng_ubt.c Wed May 20 23:34:59 2009
(r192498)
+++ head/sys/dev/usb/bluetooth/ng_ubt.c Thu May 21 00:04:17 2009
(r192499)
@@ -399,7 +399,7 @@ ubt_probe(device_t dev)
 {
struct usb2_attach_arg  *uaa = device_get_ivars(dev);
 
-   if (uaa->usb2_mode != USB_MODE_HOST)
+   if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
 
if (uaa->info.bIfaceIndex != 0)

Modified: head/sys/dev/usb/bluetooth/ubtbcmfw.c
==
--- head/sys/dev/usb/bluetooth/ubtbcmfw.c   Wed May 20 23:34:59 2009
(r192498)
+++ head/sys/dev/usb/bluetooth/ubtbcmfw.c   Thu May 21 00:04:17 2009
(r192499)
@@ -174,7 +174,7 @@ ubtbcmfw_probe(device_t dev)
 
struct usb2_attach_arg  *uaa = device_get_ivars(dev);
 
-   if (uaa->usb2_mode != USB_MODE_HOST)
+   if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
 
if (uaa->info.bIfaceIndex != 0)

Modified: head/sys/dev/usb/controller/at91dci.c
==
--- head/sys/dev/usb/controller/at91dci.c   Wed May 20 23:34:59 2009
(r192498)
+++ head/sys/dev/usb/controller/at91dci.c   Thu May 21 00:04:17 2009
(r192499)
@@ -1193,7 +1193,7 @@ at91dci_device_done(struct usb2_xfer *xf
DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n",
xfer, xfer->pipe, error);
 
-   if (xfer->flags_int.usb2_mode == USB_MODE_DEVICE) {
+   if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
ep_no = (xfer->endpoint & UE_ADDR);
 
/* disable endpoint interrupt */
@@ -1337,7 +1337,7 @@ at91dci_clear_stall(struct usb2_device *
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
 
/* check mode */
-   if (udev->flags.usb2_mode != USB_MODE_DEVICE) {
+   if (udev->flags.usb_mode != USB_MODE_DEVICE) {
/* not supported */
return;
}
@@ -2264,12 +2264,12 @@ at91dci_pipe_init(struct usb2_device *ud
 
DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n",
pipe, udev->address,
-   edesc->bEndpointAddress, udev->flags.usb2_mode,
+   edesc->bEndpointAddress, udev->flags.usb_mode,
sc->sc_rt_addr);
 
if (udev->device_index != sc->sc_rt_addr) {
 
-   if (udev->flags.usb2_mode != USB_MODE_DEVICE) {
+   if (udev->flags.usb_mode != USB_MODE_DEVICE) {
/* not supported */

svn commit: r192498 - in stable/7: . cddl cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd...

2009-05-20 Thread Kip Macy
s/uts/common/fs/zfs/zio.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/os/callb.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/os/list.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/byteorder.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/callb.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/cred.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dkio.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dklabel.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/protocol.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/util.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/list.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/synch.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod.c
  stable/7/sys/compat/linprocfs/linprocfs.c
  stable/7/sys/compat/pecoff/imgact_pecoff.c
  stable/7/sys/fs/coda/coda_vfsops.c
  stable/7/sys/fs/msdosfs/msdosfs_vfsops.c
  stable/7/sys/fs/nullfs/null_vfsops.c
  stable/7/sys/fs/unionfs/union_vfsops.c
  stable/7/sys/modules/opensolaris/Makefile
  stable/7/sys/modules/zfs/Makefile
  stable/7/sys/ufs/ffs/ffs_snapshot.c
  stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c

Modified: stable/7/UPDATING
==
--- stable/7/UPDATING   Wed May 20 23:33:40 2009(r192497)
+++ stable/7/UPDATING   Wed May 20 23:34:59 2009(r192498)
@@ -7,7 +7,12 @@ done items, please see the COMMON ITEMS:
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
-
+20090520
+   Update ZFS to version 13. ZFS users will need to re-build
+   kernel and world. Existing pools will continue to work
+   without upgrade. If a pool is upgraded it will no longer be
+   usable by older kernel revs. ZFS send / recv between 
+   pool version 6 and pool version 13 is not supported.
 20090504:
FreeBSD 7.2-RELEASE
 

Modified: stable/7/cddl/Makefile.inc
==
--- stable/7/cddl/Makefile.inc  Wed May 20 23:33:40 2009(r192497)
+++ stable/7/cddl/Makefile.inc  Wed May 20 23:34:59 2009(r192498)
@@ -6,3 +6,5 @@ OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../.
 IGNORE_PRAGMA= YES
 
 CFLAGS+=   -DNEED_SOLARIS_BOOLEAN
+
+CSTD?= gnu89

Added: stable/7/cddl/compat/opensolaris/include/libshare.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/7/cddl/compat/opensolaris/include/libshare.h Wed May 20 23:34:59 
2009(r192498)
@@ -0,0 +1,144 @@
+/*-
+ * Copyright (c) 2007 Pawel Jakub Dawidek 
+ * 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 AUTHORS 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 AUTHORS 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 (INCLUDIN

svn commit: r192497 - head/sys/dev/if_ndis

2009-05-20 Thread Sam Leffler
Author: sam
Date: Wed May 20 23:33:40 2009
New Revision: 192497
URL: http://svn.freebsd.org/changeset/base/192497

Log:
  update for net80211 rx api change

Modified:
  head/sys/dev/if_ndis/if_ndis.c

Modified: head/sys/dev/if_ndis/if_ndis.c
==
--- head/sys/dev/if_ndis/if_ndis.c  Wed May 20 23:07:10 2009
(r192496)
+++ head/sys/dev/if_ndis/if_ndis.c  Wed May 20 23:33:40 2009
(r192497)
@@ -3306,7 +3306,6 @@ ndis_scan_results(struct ndis_softc *sc)
struct ieee80211_channel *saved_chan;
int i, j;
int error, len, rssi, noise, freq, chanflag;
-   static long rstamp;
uint8_t ssid[2+IEEE80211_NWID_LEN];
uint8_t rates[2+IEEE80211_RATE_MAXSIZE];
uint8_t *frm, *efrm;
@@ -3337,7 +3336,6 @@ ndis_scan_results(struct ndis_softc *sc)
}
 
DPRINTF(("%s: %d results\n", __func__, bl->nblx_items));
-   rstamp++;
wb = &bl->nblx_bssid[0];
for (i = 0; i < bl->nblx_items; i++) {
memset(&sp, 0, sizeof(sp));
@@ -3408,7 +3406,7 @@ done:
DPRINTF(("scan: bssid %s chan %dMHz (%d/%d) rssi %d\n",
ether_sprintf(wb->nwbx_macaddr), freq, sp.bchan, chanflag,
rssi));
-   ieee80211_add_scan(vap, &sp, &wh, 0, rssi, noise, rstamp);
+   ieee80211_add_scan(vap, &sp, &wh, 0, rssi, noise);
wb = (ndis_wlan_bssid_ex *)((char *)wb + wb->nwbx_len);
}
free(bl, M_DEVBUF);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-20 Thread Carlos A. M. dos Santos
On Wed, May 20, 2009 at 5:01 PM, Peter Jeremy
 wrote:
> On 2009-May-19 17:40:22 +, "George V. Neville-Neil"  
> wrote:
>>Log:
>>  Add a new program, perror, which takes an errno as a command line argument
>>  and outputs the associated textual message in the same way that
>>  perror(3) would if called within a program.

Rename it to "strerror", please.

> Given how easy it is to "grep <> /usr/include/sys/errno.h" or
>  perl -e '$! = <>; print "$!\n";'
> I'm not sure of the utility of this tool.  One downside is that
>  man perror
> will now return perror(1) instead of perror(3)

So does "man printf", which is a pity. It bytes me each time I'm using
Vim and press "k" over the word. :-(

-- 
My preferred quotation of Robert Louis Stevenson is "You cannot
make an omelette without breaking eggs". Not because I like the
omelettes, but because I like the sound of eggs being broken.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192494 - stable/7/sys/kern

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:32:25 2009
New Revision: 192494
URL: http://svn.freebsd.org/changeset/base/192494

Log:
  MFC minimal zfs lock ordering for WITNESS
  
  (dnode -> dirty record -> dbuf)

Modified:
  stable/7/sys/kern/subr_witness.c

Modified: stable/7/sys/kern/subr_witness.c
==
--- stable/7/sys/kern/subr_witness.cWed May 20 22:30:57 2009
(r192493)
+++ stable/7/sys/kern/subr_witness.cWed May 20 22:32:25 2009
(r192494)
@@ -397,6 +397,13 @@ static struct witness_order_list_entry o
{ "vnode interlock", &lock_class_mtx_sleep },
{ NULL, NULL },
/*
+* ZFS locking
+*/
+   { "dn->dn_mtx", &lock_class_sx },
+   { "dr->dt.di.dr_mtx", &lock_class_sx },
+   { "db->db_mtx", &lock_class_sx },
+   { NULL, NULL },
+   /*
 * spin locks
 */
 #ifdef SMP
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192493 - stable/7/sys/kern

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:30:57 2009
New Revision: 192493
URL: http://svn.freebsd.org/changeset/base/192493

Log:
  td_osd is at the end of struct thread to avoid breaking the ABI
  as a side effect it is outside of the td_startzero-td_endzero range,
  requiring it to be separately zeroed

Modified:
  stable/7/sys/kern/kern_fork.c
  stable/7/sys/kern/kern_kse.c
  stable/7/sys/kern/kern_thr.c

Modified: stable/7/sys/kern/kern_fork.c
==
--- stable/7/sys/kern/kern_fork.c   Wed May 20 22:28:55 2009
(r192492)
+++ stable/7/sys/kern/kern_fork.c   Wed May 20 22:30:57 2009
(r192493)
@@ -507,6 +507,7 @@ again:
 
bcopy(&td->td_startcopy, &td2->td_startcopy,
__rangeof(struct thread, td_startcopy, td_endcopy));
+   bzero(&td2->td_osd, sizeof(struct osd));
 
td2->td_sigstk = td->td_sigstk;
td2->td_sigmask = td->td_sigmask;

Modified: stable/7/sys/kern/kern_kse.c
==
--- stable/7/sys/kern/kern_kse.cWed May 20 22:28:55 2009
(r192492)
+++ stable/7/sys/kern/kern_kse.cWed May 20 22:30:57 2009
(r192493)
@@ -1014,6 +1014,7 @@ thread_alloc_spare(struct thread *td)
td->td_standin = spare;
bzero(&spare->td_startzero,
__rangeof(struct thread, td_startzero, td_endzero));
+   bzero(&spare->td_osd, sizeof(struct osd));
spare->td_proc = td->td_proc;
spare->td_ucred = crhold(td->td_ucred);
spare->td_flags = TDF_INMEM;

Modified: stable/7/sys/kern/kern_thr.c
==
--- stable/7/sys/kern/kern_thr.cWed May 20 22:28:55 2009
(r192492)
+++ stable/7/sys/kern/kern_thr.cWed May 20 22:30:57 2009
(r192493)
@@ -199,6 +199,7 @@ create_thread(struct thread *td, mcontex
__rangeof(struct thread, td_startzero, td_endzero));
bcopy(&td->td_startcopy, &newtd->td_startcopy,
__rangeof(struct thread, td_startcopy, td_endcopy));
+   bzero(&newtd->td_osd, sizeof(struct osd));
newtd->td_proc = td->td_proc;
newtd->td_ucred = crhold(td->td_ucred);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192492 - head/sys/dev/wi

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 22:28:55 2009
New Revision: 192492
URL: http://svn.freebsd.org/changeset/base/192492

Log:
  Revert last junk...

Modified:
  head/sys/dev/wi/if_wavelan_ieee.h
  head/sys/dev/wi/if_wi.c
  head/sys/dev/wi/if_wivar.h

Modified: head/sys/dev/wi/if_wavelan_ieee.h
==
--- head/sys/dev/wi/if_wavelan_ieee.h   Wed May 20 22:28:39 2009
(r192491)
+++ head/sys/dev/wi/if_wavelan_ieee.h   Wed May 20 22:28:55 2009
(r192492)
@@ -58,11 +58,14 @@
  * value.
  */
 #define WI_MAX_DATALEN 512
+
+#if 0
 struct wi_req {
u_int16_t   wi_len;
u_int16_t   wi_type;
u_int16_t   wi_val[WI_MAX_DATALEN];
 };
+#endif
 
 /*
  * Private LTV records (interpreted only by the driver). This is

Modified: head/sys/dev/wi/if_wi.c
==
--- head/sys/dev/wi/if_wi.c Wed May 20 22:28:39 2009(r192491)
+++ head/sys/dev/wi/if_wi.c Wed May 20 22:28:55 2009(r192492)
@@ -145,6 +145,7 @@ static int  wi_alloc_fid(struct wi_softc
 static void wi_read_nicid(struct wi_softc *);
 static int  wi_write_ssid(struct wi_softc *, int, u_int8_t *, int);
 
+static int  wi_cmd(struct wi_softc *, int, int, int, int);
 static int  wi_seek_bap(struct wi_softc *, int, int);
 static int  wi_read_bap(struct wi_softc *, int, int, void *, int);
 static int  wi_write_bap(struct wi_softc *, int, int, void *, int);
@@ -1801,7 +1802,7 @@ wi_write_wep(struct wi_softc *sc, struct
return error;
 }
 
-int
+static int
 wi_cmd(struct wi_softc *sc, int cmd, int val0, int val1, int val2)
 {
int i, s = 0;
@@ -2120,5 +2121,3 @@ wi_free(device_t dev)
sc->mem = NULL;
}
 }
-
-MODULE_VERSION(wi, 1);

Modified: head/sys/dev/wi/if_wivar.h
==
--- head/sys/dev/wi/if_wivar.h  Wed May 20 22:28:39 2009(r192491)
+++ head/sys/dev/wi/if_wivar.h  Wed May 20 22:28:55 2009(r192492)
@@ -184,6 +184,3 @@ voidwi_init(void *);
 void   wi_intr(void *);
 intwi_mgmt_xmit(struct wi_softc *, caddr_t, int);
 void   wi_stop(struct wi_softc *, int);
-
-/* KLUDGE */
-intwi_cmd(struct wi_softc *, int, int, int, int);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192491 - in stable/7/sys: kern sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:28:39 2009
New Revision: 192491
URL: http://svn.freebsd.org/changeset/base/192491

Log:
  MFC quad tunables and sysctls for setting ZFS arc cache size

Modified:
  stable/7/sys/kern/kern_environment.c
  stable/7/sys/sys/kernel.h
  stable/7/sys/sys/sysctl.h

Modified: stable/7/sys/kern/kern_environment.c
==
--- stable/7/sys/kern/kern_environment.cWed May 20 22:27:18 2009
(r192490)
+++ stable/7/sys/kern/kern_environment.cWed May 20 22:28:39 2009
(r192491)
@@ -553,6 +553,14 @@ tunable_ulong_init(void *data)
 }
 
 void
+tunable_quad_init(void *data)
+{
+   struct tunable_quad *d = (struct tunable_quad *)data;
+
+   TUNABLE_QUAD_FETCH(d->path, d->var);
+}
+
+void
 tunable_str_init(void *data)
 {
struct tunable_str *d = (struct tunable_str *)data;

Modified: stable/7/sys/sys/kernel.h
==
--- stable/7/sys/sys/kernel.h   Wed May 20 22:27:18 2009(r192490)
+++ stable/7/sys/sys/kernel.h   Wed May 20 22:28:39 2009(r192491)
@@ -329,6 +329,25 @@ struct tunable_ulong {
 
 #defineTUNABLE_ULONG_FETCH(path, var)  getenv_ulong((path), (var))
 
+/*
+ * quad
+ */
+extern void tunable_quad_init(void *);
+struct tunable_quad {
+   const char *path;
+   quad_t *var;
+};
+#defineTUNABLE_QUAD(path, var) \
+   static struct tunable_quad __CONCAT(__tunable_quad_, __LINE__) = { \
+   (path), \
+   (var),  \
+   };  \
+   SYSINIT(__CONCAT(__Tunable_init_, __LINE__),\
+   SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_quad_init, \
+   &__CONCAT(__tunable_quad_, __LINE__))
+
+#defineTUNABLE_QUAD_FETCH(path, var)   getenv_quad((path), (var))
+
 extern void tunable_str_init(void *);
 struct tunable_str {
const char *path;

Modified: stable/7/sys/sys/sysctl.h
==
--- stable/7/sys/sys/sysctl.h   Wed May 20 22:27:18 2009(r192490)
+++ stable/7/sys/sys/sysctl.h   Wed May 20 22:28:39 2009(r192491)
@@ -295,6 +295,15 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
sysctl_add_oid(ctx, parent, nbr, name, 
CTLTYPE_ULONG|CTLFLAG_MPSAFE|(access),   \
ptr, 0, sysctl_handle_long, "LX", __DESCR(descr))
 
+/* Oid for a quad.  The pointer must be non NULL. */
+#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \
+   SYSCTL_OID(parent, nbr, name, CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access), \
+   ptr, val, sysctl_handle_quad, "Q", __DESCR(descr))
+
+#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr)\
+   sysctl_add_oid(ctx, parent, nbr, name, 
CTLTYPE_QUAD|CTLFLAG_MPSAFE|(access),\
+   ptr, 0, sysctl_handle_quad, "Q", __DESCR(descr))
+
 /* Oid for an opaque object.  Specified by a pointer and a length. */
 #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192490 - stable/7/sys/sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:27:18 2009
New Revision: 192490
URL: http://svn.freebsd.org/changeset/base/192490

Log:
  add vdestroy declaration now that it is no longer static
  - needed by ZFS

Modified:
  stable/7/sys/sys/vnode.h

Modified: stable/7/sys/sys/vnode.h
==
--- stable/7/sys/sys/vnode.hWed May 20 22:26:03 2009(r192489)
+++ stable/7/sys/sys/vnode.hWed May 20 22:27:18 2009(r192490)
@@ -717,6 +717,7 @@ voidvrele(struct vnode *vp);
 void   vref(struct vnode *vp);
 intvrefcnt(struct vnode *vp);
 void   v_addpollinfo(struct vnode *vp);
+void   vdestroy(struct vnode *vp);
 
 int vnode_create_vobject(struct vnode *vp, off_t size, struct thread *td);
 void vnode_destroy_vobject(struct vnode *vp);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192489 - stable/7/sys/kern

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:26:03 2009
New Revision: 192489
URL: http://svn.freebsd.org/changeset/base/192489

Log:
  make vdestroy globally visible for ZFS

Modified:
  stable/7/sys/kern/vfs_subr.c

Modified: stable/7/sys/kern/vfs_subr.c
==
--- stable/7/sys/kern/vfs_subr.cWed May 20 22:24:31 2009
(r192488)
+++ stable/7/sys/kern/vfs_subr.cWed May 20 22:26:03 2009
(r192489)
@@ -104,7 +104,6 @@ static void v_decr_useonly(struct vnode 
 static voidv_upgrade_usecount(struct vnode *);
 static voidvfree(struct vnode *);
 static voidvnlru_free(int);
-static voidvdestroy(struct vnode *);
 static voidvgonel(struct vnode *);
 static voidvfs_knllock(void *arg);
 static voidvfs_knlunlock(void *arg);
@@ -777,7 +776,7 @@ SYSINIT(vnlru, SI_SUB_KTHREAD_UPDATE, SI
  * Routines having to do with the management of the vnode table.
  */
 
-static void
+void
 vdestroy(struct vnode *vp)
 {
struct bufobj *bo;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192488 - stable/7/sys/kern

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:24:31 2009
New Revision: 192488
URL: http://svn.freebsd.org/changeset/base/192488

Log:
  make vfsopt globally visible for ZFS

Modified:
  stable/7/sys/kern/vfs_mount.c

Modified: stable/7/sys/kern/vfs_mount.c
==
--- stable/7/sys/kern/vfs_mount.c   Wed May 20 22:19:48 2009
(r192487)
+++ stable/7/sys/kern/vfs_mount.c   Wed May 20 22:24:31 2009
(r192488)
@@ -100,14 +100,6 @@ struct mntlist mountlist = TAILQ_HEAD_IN
 struct mtx mountlist_mtx;
 MTX_SYSINIT(mountlist, &mountlist_mtx, "mountlist", MTX_DEF);
 
-TAILQ_HEAD(vfsoptlist, vfsopt);
-struct vfsopt {
-   TAILQ_ENTRY(vfsopt) link;
-   char*name;
-   void*value;
-   int len;
-};
-
 /*
  * The vnode of the system's root (/ in the filesystem, without chroot
  * active.)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192487 - stable/7/sys/sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:19:48 2009
New Revision: 192487
URL: http://svn.freebsd.org/changeset/base/192487

Log:
  add UID_NOBODY

Modified:
  stable/7/sys/sys/conf.h

Modified: stable/7/sys/sys/conf.h
==
--- stable/7/sys/sys/conf.h Wed May 20 22:19:22 2009(r192486)
+++ stable/7/sys/sys/conf.h Wed May 20 22:19:48 2009(r192487)
@@ -290,6 +290,7 @@ voiddevfs_fpdrop(struct file *fp);  /* X
 #defineUID_ROOT0
 #defineUID_BIN 3
 #defineUID_UUCP66
+#defineUID_NOBODY  65534
 
 #defineGID_WHEEL   0
 #defineGID_KMEM2
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192486 - head/usr.bin/perror

2009-05-20 Thread George V. Neville-Neil
Author: gnn
Date: Wed May 20 22:19:22 2009
New Revision: 192486
URL: http://svn.freebsd.org/changeset/base/192486

Log:
  A few more style changes as well as a more broad allowance for
  errors to be given by the caller.  Change output to be easier
  for use in scripts.
  
  Submitted by: bce

Modified:
  head/usr.bin/perror/perror.c

Modified: head/usr.bin/perror/perror.c
==
--- head/usr.bin/perror/perror.cWed May 20 22:13:21 2009
(r192485)
+++ head/usr.bin/perror/perror.cWed May 20 22:19:22 2009
(r192486)
@@ -31,48 +31,40 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
-#define MAX_ERR 256
-
-static void 
-usage()
-{
-
-   fprintf(stderr, "usage: perror number\n");
-   fprintf(stderr, "number must be between 1 and %d\n", ELAST);
-   exit(1);
-}
+static void usage();
 
 int 
 main(int argc, char **argv)
 {
-
-   char errstr[MAX_ERR];
char *cp;
-   int errnum;
+   char *errstr;
+   long errnum;
 
if (argc != 2)
usage();
 
+   errno = 0;
+
errnum = strtol(argv[1], &cp, 0);
 
-   if (((errnum == 0) && (errno == EINVAL)) || (*cp != '\0')) {
-   fprintf(stderr, "Argument %s not a number.\n", argv[1]);
-   usage();
-   }
+   if (errno != 0)
+   err(1, NULL);
 
-   if ((errnum <=0) || (errnum > ELAST)) {
-   fprintf(stderr, "Number %d out of range.\n", errnum);
-   usage();
-   }
-   
-   if (strerror_r(errnum, errstr, sizeof(errstr)) < 0) {
-   fprintf(stderr, "Could not find error number %d.\n", errnum);
-   usage();
-   }
+   if ((errstr = strerror(errnum)) == NULL) 
+   err(1, NULL);
 
-   printf("Error %d is \"%s\"\n", errnum, errstr);
+   printf("%s\n", errstr);
 
exit(0);
 }
+
+static void 
+usage()
+{
+   fprintf(stderr, "usage: perror number\n");
+   exit(1);
+}
+
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192485 - in stable/7/sys: conf libkern sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:13:21 2009
New Revision: 192485
URL: http://svn.freebsd.org/changeset/base/192485

Log:
  MFC memmove support
  ZFS MFC dependency

Added:
  stable/7/sys/libkern/memmove.c   (contents, props changed)
Modified:
  stable/7/sys/conf/files
  stable/7/sys/sys/systm.h

Modified: stable/7/sys/conf/files
==
--- stable/7/sys/conf/files Wed May 20 22:10:34 2009(r192484)
+++ stable/7/sys/conf/files Wed May 20 22:13:21 2009(r192485)
@@ -1755,6 +1755,7 @@ libkern/iconv_xlat16.coptional libicon
 libkern/index.cstandard
 libkern/inet_ntoa.cstandard
 libkern/mcount.c   optional profiling-routine
+libkern/memmove.c  standard
 libkern/qsort.cstandard
 libkern/qsort_r.c  standard
 libkern/random.c   standard

Added: stable/7/sys/libkern/memmove.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/7/sys/libkern/memmove.c  Wed May 20 22:13:21 2009
(r192485)
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 2009 Roman Divacky 
+ * 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 AUTHOR 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 AUTHOR 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.
+*/
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+
+void *
+memmove(void *dest, const void *src, size_t n)
+{
+
+   bcopy(src, dest, n);
+   return (dest);
+}

Modified: stable/7/sys/sys/systm.h
==
--- stable/7/sys/sys/systm.hWed May 20 22:10:34 2009(r192484)
+++ stable/7/sys/sys/systm.hWed May 20 22:13:21 2009(r192485)
@@ -191,6 +191,7 @@ voidbcopy(const void *from, void *to, s
 void   bzero(void *buf, size_t len) __nonnull(1);
 
 void   *memcpy(void *to, const void *from, size_t len) __nonnull(1) 
__nonnull(2);
+void   *memmove(void *dest, const void *src, size_t len) __nonnull(1) 
__nonnull(2);
 
 intcopystr(const void * __restrict kfaddr, void * __restrict kdaddr,
size_t len, size_t * __restrict lencopied)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192256 - head/sys/fs/nfsserver

2009-05-20 Thread Rick Macklem



On Wed, 20 May 2009, Doug Rabson wrote:

[good stuff snipped]

Why do they need to be distinguished? The nfsv4 state subsystem handles
all conflicts between them, so they are just "nfsv4 locks".


Why? It seems a shame to re-implement all the record locking logic of the 
local lock manager in NFS.



The record locking would have been easy, but the nfsv4 RFC has a wonderful
couple of sentences under the description of Close that basically says
that, upon close, related byte range locks must be released or an error
returned. Those two sentences imply that there is a relationship between
Opens and Locks that the server must maintain and it gets complicated.

For example, a client can:
(i) Lock foo with OpenStateID-0 and Lockowner-A
(ii) Lock foo with OpenStateID-1 and Lockowner-A
- now, the above Locks are done by the same Lockowner-A, so they don't
  conflict if they overlap etc.
BUT
- the server cannot simply lump them to-gether, because when OpenStateID-0
  gets Closed, the i) lock(s) must be released, but the (ii) lock(s)
  remain.

Then, there are locks issued locally against a delegation, but the above
open/lock relationship must be maintained for them too, because a 
delegation can be recalled at any time and they must be correctly acquired

against the server at that point...

Basically, the nfsv4 server has no choice but to keep track of all this
stuff and the locks/lock_owners end up all over it. Using the lock manager
to keep track of the one small piece that it can really wouldn't make much
difference. (Beyond that, the code was written to be portable to the
various BSDen over several years, so I avoided making assumptions about
what the system might provide that I could use.)

Maybe it would be beneficial to extract the state handling stuff and let
a Cifs/SMB server use it as well, but I know diddly about Cifs/SMB and
know it would be a bunch of work.

Does this clarify it? rick



An nfsv4 lockowner is a ClientID + up to 1024 bytes of opaque name and it
might not persist in the server beyond the point where no locks are
held and the associated OpenOwner no longer has any Opens. After this,
the same lockowner could be "re-incarnated" (ie. create a new state
data structure in the server with the same ClientID + up to 1024 bytes)
when the client chooses to do more locking on it. If a pid is generated
sequentially, this second re-incarnation would end up with a different
pid although it is the same lockowner. (To ensure this doesn't happen,
the server would have to hold onto the lockowner state structure "forever"
and that obviously isn't practical.) Or a pid could be a 32bit checksum
on the ClientID + up to 1024 bytes instead of sequential assignment. In 
that case the re-incarnation would get the same pid, but it wouldn't be

guaranteed to be unique across all different lockowners.

As such, the most an assigned pid could be is a "hint" that the lockowner
is different/same. Is there some benefit to this over "held by nfsv4",
which is what using one  tuple gives you?

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192484 - stable/7/sys/sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:10:34 2009
New Revision: 192484
URL: http://svn.freebsd.org/changeset/base/192484

Log:
  MFC accmode_t
  ZFS MFC dependency

Modified:
  stable/7/sys/sys/_types.h
  stable/7/sys/sys/types.h

Modified: stable/7/sys/sys/_types.h
==
--- stable/7/sys/sys/_types.h   Wed May 20 22:09:49 2009(r192483)
+++ stable/7/sys/sys/_types.h   Wed May 20 22:10:34 2009(r192484)
@@ -47,6 +47,7 @@ typedef   __uint32_t  __ino_t;/* inode num
 typedeflong__key_t;/* IPC key (for Sys V IPC) */
 typedef__int32_t   __lwpid_t;  /* Thread ID (a.k.a. LWP) */
 typedef__uint16_t  __mode_t;   /* permissions */
+typedefint __accmode_t;/* access permissions */
 typedefint __nl_item;
 typedef__uint16_t  __nlink_t;  /* link count */
 typedef__int64_t   __off_t;/* file offset */

Modified: stable/7/sys/sys/types.h
==
--- stable/7/sys/sys/types.hWed May 20 22:09:49 2009(r192483)
+++ stable/7/sys/sys/types.hWed May 20 22:10:34 2009(r192484)
@@ -210,6 +210,11 @@ typedef__nlink_t   nlink_t;/* link count
 #define_NLINK_T_DECLARED
 #endif
 
+#ifndef _ACCMODE_T_DECLARED
+typedef__accmode_t accmode_t;  /* access permissions */
+#define_ACCMODE_T_DECLARED
+#endif
+
 #ifndef _OFF_T_DECLARED
 typedef__off_t off_t;  /* file offset */
 #define_OFF_T_DECLARED
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192483 - stable/7/sys/sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 22:09:49 2009
New Revision: 192483
URL: http://svn.freebsd.org/changeset/base/192483

Log:
  - make vfsoptlist globally visible
  - ZFS MFC dependency

Modified:
  stable/7/sys/sys/mount.h

Modified: stable/7/sys/sys/mount.h
==
--- stable/7/sys/sys/mount.hWed May 20 22:01:43 2009(r192482)
+++ stable/7/sys/sys/mount.hWed May 20 22:09:49 2009(r192483)
@@ -131,8 +131,16 @@ struct ostatfs {
 
 TAILQ_HEAD(vnodelst, vnode);
 
-struct vfsoptlist;
-struct vfsopt;
+/* Mount options list */
+TAILQ_HEAD(vfsoptlist, vfsopt);
+struct vfsopt {
+   TAILQ_ENTRY(vfsopt) link;
+   char*name;
+   void*value;
+   int len;
+   int pos;
+   int seen;
+};
 
 /*
  * Structure per mounted filesystem.  Each mounted filesystem has an
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192482 - head/tools/regression/bin/date

2009-05-20 Thread Edwin Groothuis
Author: edwin
Date: Wed May 20 22:01:43 2009
New Revision: 192482
URL: http://svn.freebsd.org/changeset/base/192482

Log:
  Add regression tests for the date(1) + argument for user-defined
  format strings.
  
  PR:   bin/127514
  Submitted by: edwin@
  MFC after:1 week

Added:
  head/tools/regression/bin/date/
  head/tools/regression/bin/date/Makefile   (contents, props changed)
  head/tools/regression/bin/date/regress.sh   (contents, props changed)
  head/tools/regression/bin/date/regress.t   (contents, props changed)

Added: head/tools/regression/bin/date/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/date/Makefile Wed May 20 22:01:43 2009
(r192482)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+all:
+   sh regress.sh

Added: head/tools/regression/bin/date/regress.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/date/regress.sh   Wed May 20 22:01:43 2009
(r192482)
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+#
+# Regression tests for date(1)
+#
+# Submitted by Edwin Groothuis 
+#
+# $FreeBSD$
+#
+
+#
+# These two date/times have been chosen carefully, they
+# create both the single digit and double/multidigit version of
+# the values.
+#
+# To create a new one, make sure you are using the UTC timezone!
+#
+
+TEST1=343  # 1970-02-07 07:04:03
+TEST2=100560   # 2001-11-12 21:11:12
+
+export LANG=C
+export TZ=UTC
+count=0
+
+check()
+{
+   S=$1
+   A1=$2
+   A2=$3
+
+   count=`expr ${count} + 1`
+
+   if [ -z "${A2}" ]; then A2=${A1}; fi
+
+   R=`date -r ${TEST1} +%${S}`
+   if [ "${R}" = "${A1}" ]; then
+   echo "${count}a. ${S} - ok"
+   else
+   echo "${count}a. ${S} - not ok (got ${R}, expected ${A1})"
+   fi
+
+   R=`date -r ${TEST2} +%${S}`
+   if [ "${R}" = "${A2}" ]; then
+   echo "${count}b. ${S} - ok"
+   else
+   echo "${count}b. ${S} - not ok (got ${R}, expected ${A2})"
+   fi
+}
+
+check A Saturday Monday
+check a Sat Mon
+check B February November
+check b Feb Nov
+check C 19 20
+check c "Sat Feb  7 07:04:03 1970" "Mon Nov 12 21:20:00 2001"
+check D 02/07/70 11/12/01
+check d 07 12
+check e " 7" 12
+check F "1970-02-07" "2001-11-12"
+check G 1970 2001
+check g 70 01
+check H 07 21
+check h Feb Nov
+check I 07 09
+check j 038 316
+check k " 7" 21
+check l " 7" " 9"
+check M 04 20
+check m 02 11
+check p AM PM
+check R 07:04 21:20
+check r "07:04:03 AM" "09:20:00 PM"
+check S 03 00
+check s ${TEST1} ${TEST2}
+check U 05 45
+check u 6 1
+check V 06 46
+check v " 7-Feb-1970" "12-Nov-2001"
+check W 05 46
+check w 6 1
+check X "07:04:03" "21:20:00"
+check x "02/07/70" "11/12/01"
+check Y 1970 2001
+check y 70 01
+check Z UTC UTC
+check z + +
+check % % %
+check + "Sat Feb  7 07:04:03 UTC 1970" "Mon Nov 12 21:20:00 UTC 2001"

Added: head/tools/regression/bin/date/regress.t
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/date/regress.tWed May 20 22:01:43 2009
(r192482)
@@ -0,0 +1,6 @@
+#!/bin/sh
+# $FreeBSD$
+
+cd `dirname $0`
+
+sh regress.sh
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192481 - head/sys/dev/pci

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 22:00:39 2009
New Revision: 192481
URL: http://svn.freebsd.org/changeset/base/192481

Log:
  Revert junk from last commit.  These are WIP and not ready (and don't
  match the description of the last commit).

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pcib_if.m

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed May 20 21:34:01 2009(r192480)
+++ head/sys/dev/pci/pci.c  Wed May 20 22:00:39 2009(r192481)
@@ -418,38 +418,6 @@ pci_hdrtypedata(device_t pcib, int b, in
 #undef REG
 }
 
-/*
- * This is a lame example: we should have some way of managing this table
- * from userland.  The user should be able to tell us from the boot loader
- * or at runtime what mapping to do.
- */
-static struct pci_remap_entry
-{
-   uint16_t vendor;
-   uint16_t device;
-   uint16_t mapped_vendor;
-   uint16_t mapped_device;
-} pci_remap[] =
-{
-   { 0x1039, 0x0901, 0x1039, 0x0900 }  /* Map sis 901 to sis 900 */
-};
-static int pci_remap_entries = 1;
-
-static void
-pci_apply_remap_table(pcicfgregs *cfg)
-{
-   int i;
-
-   for (i = 0; i < pci_remap_entries; i++) {
-   if (cfg->vendor == pci_remap[i].vendor &&
-   cfg->device == pci_remap[i].device) {
-   cfg->vendor = pci_remap[i].mapped_vendor;
-   cfg->device = pci_remap[i].mapped_device;
-   return;
-   }
-   }
-}
-
 /* read configuration header into pcicfgregs structure */
 struct pci_devinfo *
 pci_read_device(device_t pcib, int d, int b, int s, int f, size_t size)
@@ -496,7 +464,6 @@ pci_read_device(device_t pcib, int d, in
 
pci_fixancient(cfg);
pci_hdrtypedata(pcib, b, s, f, cfg);
-   pci_apply_remap_table(cfg);
 
if (REG(PCIR_STATUS, 2) & PCIM_STATUS_CAPPRESENT)
pci_read_extcap(pcib, cfg);
@@ -2652,59 +2619,6 @@ pci_add_resources(device_t bus, device_t
}
 }
 
-/*
- * After we've added the children to the pci bus device, we need to fixup
- * the children in various ways.  This function fixes things that require
- * multiple passes to get right, such as bus number and some resource
- * things (although the latter hasn't been implemented yet).  This must be
- * done before the children are probe/attached, sicne by that point these
- * things must be fixed.
- */
-static void
-pci_fix_bridges(device_t dev)
-{
-   int i, numdevs, error, secbus, subbus;
-   device_t child, *devlist;
-
-   if ((error = device_get_children(dev, &devlist, &numdevs)))
-   return;
-   /*
-* First pass, get the bus numbers that are in use
-*/
-   for (i = 0; i < numdevs; i++) {
-   child = devlist[i];
-   switch (pci_read_config(child, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) 
{
-   default:
-   continue;
-   case 1: /* PCI-PCI bridge */
-   case 2: /* CardBus bridge -- offsets are the same */
-   secbus = pci_read_config(child, PCIR_SECBUS_1, 1);
-   subbus = pci_read_config(child, PCIR_SUBBUS_1, 1);
-   break;
-   }
-   printf("%d:%d:%d:%d sec %d sub %d\n", pcib_get_domain(dev),
-   pci_get_bus(child), pci_get_slot(child),
-   pci_get_function(child), secbus, subbus);
-   }
-#if 0
-   /*
-* Second pass, Fix the bus numbers, as needed
-*/
-   for (i = 0; i < numdevs; i++) {
-   child = devlist[i];
-   switch (pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) {
-   case 1: /* PCI-PCI bridge */
-   break;
-   case 2: /* CardBus bridge */
-   break;
-   default:
-   continue;
-   }
-   }
-#endif
-   free(devlist, M_TEMP);
-}
-
 void
 pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size)
 {
@@ -2736,7 +2650,6 @@ pci_add_children(device_t dev, int domai
}
}
 #undef REG
-   pci_fix_bridges(dev);
 }
 
 void

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Wed May 20 21:34:01 2009(r192480)
+++ head/sys/dev/pci/pci_pci.c  Wed May 20 22:00:39 2009(r192481)
@@ -52,13 +52,6 @@ __FBSDID("$FreeBSD$");
 
 #include "pcib_if.h"
 
-// #define KLUDGE_O_MATIC
-#ifdef KLUDGE_O_MATIC
-inthack_unit = 1;
-u_long mem_base  = 0xc040ul;
-u_long mem_limit = 0x0010ul;
-#endif
-
 static int pcib_probe(device_t dev);
 
 static device_method_t pcib_methods[] = {
@@ -331,14 +324,6 @@ pcib_attach(device_t dev)
 struct pcib_softc  *sc;
 

Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-20 Thread Rick Macklem



On Wed, 20 May 2009, Juli Mallett wrote:


When client ids have been run out of, does that put something into a
dangerous state (insecure or crash-prone)?  Isn't it better to let the
administrator make the decision of when to reboot the machine?


Don't worry, it's never going to happen. A new clientid is typically issued
once/mount. This happens after 2**32 new ones are issued during this boot
instance. At an average rate of 1/sec, thats about 136 years.

Have fun, rick
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-20 Thread Rick Macklem



On Wed, 20 May 2009, Juli Mallett wrote:


When client ids have been run out of, does that put something into a
dangerous state (insecure or crash-prone)?  Isn't it better to let the
administrator make the decision of when to reboot the machine?


Don't worry, it's never gonna happen. A new clientid is typically issued
once/mount and this happens after 2**32 of them. (ie 136 years at an
average rate of 1/sec)

Why did I even code it? Who knows. Maybe I just wanted to document in
the comment that it wasn't a concern, as above.

Have fun, rick

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-20 Thread Juli Mallett
On Wed, May 20, 2009 at 2:36 PM, Rick Macklem  wrote:
> On Wed, 20 May 2009, Juli Mallett wrote:
>
>> When client ids have been run out of, does that put something into a
>> dangerous state (insecure or crash-prone)?  Isn't it better to let the
>> administrator make the decision of when to reboot the machine?
>>
> Well, first off, this will "never" happen in practice. the clientid
> generator is a 32bit unsigned, which means it will wrap around in 13.6
> years if there is an average rate of 10 new clientids/sec. Since a new
> clientid only typically happens once per mount (some clients might even
> do less), it seems highly unlikely that an "average rate of 10/sec"
> could happen even on the busiest server with clients doing short term
> mounts. (There was talk of a client inside a web browser, but I don't
> know that it has ever been written.)

What's to prevent using this as a DoS vector?  Is it really so hard to
exhaust the server of clientids, forcing a reboot / drop to debugger?

> When the 32bit # wraps around, rebooting would be the only solution,
> since re-issuing the same clientid is verboten by the RFC.
>
> If it was something I will see happen in my lifetime, I would be more
> concerned about it.
>
> The only reason I put it in is so no one can argue I can violate the RFC.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-20 Thread Rick Macklem



On Wed, 20 May 2009, Juli Mallett wrote:


When client ids have been run out of, does that put something into a
dangerous state (insecure or crash-prone)?  Isn't it better to let the
administrator make the decision of when to reboot the machine?


Well, first off, this will "never" happen in practice. the clientid
generator is a 32bit unsigned, which means it will wrap around in 13.6
years if there is an average rate of 10 new clientids/sec. Since a new
clientid only typically happens once per mount (some clients might even
do less), it seems highly unlikely that an "average rate of 10/sec"
could happen even on the busiest server with clients doing short term
mounts. (There was talk of a client inside a web browser, but I don't
know that it has ever been written.)

When the 32bit # wraps around, rebooting would be the only solution,
since re-issuing the same clientid is verboten by the RFC.

If it was something I will see happen in my lifetime, I would be more
concerned about it.

The only reason I put it in is so no one can argue I can violate the RFC.

Have fun, rick


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192479 - head/sys/dev/ata

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 21:31:47 2009
New Revision: 192479
URL: http://svn.freebsd.org/changeset/base/192479

Log:
  Last commit was in error, revert.

Modified:
  head/sys/dev/ata/ata-all.c

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Wed May 20 21:17:10 2009(r192478)
+++ head/sys/dev/ata/ata-all.c  Wed May 20 21:31:47 2009(r192479)
@@ -663,7 +663,7 @@ ata_getparam(struct ata_device *atadev, 
btrim(atacap->serial, sizeof(atacap->serial));
bpack(atacap->serial, atacap->serial, sizeof(atacap->serial));
 
-   if (bootverbose || 1)
+   if (bootverbose)
printf("ata%d-%s: pio=%s wdma=%s udma=%s cable=%s wire\n",
   device_get_unit(ch->dev),
   ata_unit2str(atadev),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192478 - in stable/7/sys: . dev/bge

2009-05-20 Thread Xin LI
Author: delphij
Date: Wed May 20 21:17:10 2009
New Revision: 192478
URL: http://svn.freebsd.org/changeset/base/192478

Log:
  MFC r192127:
  
  Try to workaround a race where bge_stop() may sneak in when bge_rxeof()
  drops and re-grabs the softc mutex in the middle, resulting in kernel
  trap 12.  This may happen when a lot of traffic is being hammered on
  one bge(4) interface while the system is shutting down.
  
  Reported by:  Alexander Sack 
  PR:   kern/134548

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/dev/bge/if_bge.c

Modified: stable/7/sys/dev/bge/if_bge.c
==
--- stable/7/sys/dev/bge/if_bge.c   Wed May 20 21:13:49 2009
(r192477)
+++ stable/7/sys/dev/bge/if_bge.c   Wed May 20 21:17:10 2009
(r192478)
@@ -3193,6 +3193,9 @@ bge_rxeof(struct bge_softc *sc)
BGE_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
BGE_LOCK(sc);
+
+   if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
+   return;
}
 
if (stdcnt > 0)
@@ -3301,6 +3304,10 @@ bge_poll(struct ifnet *ifp, enum poll_cm
 
sc->rxcycles = count;
bge_rxeof(sc);
+   if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+   BGE_UNLOCK(sc);
+   return;
+   }
bge_txeof(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
bge_start_locked(ifp);
@@ -3370,7 +3377,9 @@ bge_intr(void *xsc)
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
/* Check RX return ring producer/consumer. */
bge_rxeof(sc);
+   }
 
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
/* Check TX ring producer/consumer. */
bge_txeof(sc);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192477 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bce dev/cxgb

2009-05-20 Thread Xin LI
Author: delphij
Date: Wed May 20 21:13:49 2009
New Revision: 192477
URL: http://svn.freebsd.org/changeset/base/192477

Log:
  MFC r191923 (davidch):
  
- Fixed incorrect packet length problem caused be earlier change to
  support ZERO_COPY_SOCKETS.
- Created #define for context initialization retry count.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/bce/if_bce.c
  stable/7/sys/dev/bce/if_bcereg.h
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bce/if_bce.c
==
--- stable/7/sys/dev/bce/if_bce.c   Wed May 20 21:07:15 2009
(r192476)
+++ stable/7/sys/dev/bce/if_bce.c   Wed May 20 21:13:49 2009
(r192477)
@@ -4204,8 +4204,7 @@ bce_init_ctx(struct bce_softc *sc)
 
if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) ||
(BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) {
-   /* DRC: Replace this constant value with a #define. */
-   int i, retry_cnt = 10;
+   int i, retry_cnt = CTX_INIT_RETRY_COUNT;
u32 val;
 
DBPRINT(sc, BCE_INFO_CTX, "Initializing 5709 context.\n");
@@ -5895,6 +5894,9 @@ bce_rx_intr(struct bce_softc *sc)
/* Set the total packet length. */
m0->m_pkthdr.len = m0->m_len = pkt_len;
}
+#else
+/* Set the total packet length. */
+   m0->m_pkthdr.len = m0->m_len = pkt_len;
 #endif
 
/* Remove the trailing Ethernet FCS. */

Modified: stable/7/sys/dev/bce/if_bcereg.h
==
--- stable/7/sys/dev/bce/if_bcereg.hWed May 20 21:07:15 2009
(r192476)
+++ stable/7/sys/dev/bce/if_bcereg.hWed May 20 21:13:49 2009
(r192477)
@@ -6229,6 +6229,8 @@ struct l2_fhdr {
 
 #endif /* ZERO_COPY_SOCKETS */
 
+#define CTX_INIT_RETRY_COUNT10
+
 /* Context size. */
 #define CTX_SHIFT   7
 #define CTX_SIZE(1 << CTX_SHIFT)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192476 - in head/sys: net netinet netinet6

2009-05-20 Thread Qing Li
Author: qingli
Date: Wed May 20 21:07:15 2009
New Revision: 192476
URL: http://svn.freebsd.org/changeset/base/192476

Log:
  When an interface address is removed and the last prefix
  route is also being deleted, the link-layer address table
  (arp or nd6) will flush those L2 llinfo entries that match
  the removed prefix.
  
  Reviewed by:  kmacy

Modified:
  head/sys/net/if_llatbl.c
  head/sys/net/if_llatbl.h
  head/sys/netinet/in.c
  head/sys/netinet6/in6.c

Modified: head/sys/net/if_llatbl.c
==
--- head/sys/net/if_llatbl.cWed May 20 21:04:41 2009(r192475)
+++ head/sys/net/if_llatbl.cWed May 20 21:07:15 2009(r192476)
@@ -195,6 +195,23 @@ lltable_drain(int af)
IFNET_RUNLOCK();
 }
 
+void
+lltable_prefix_free(int af, struct sockaddr *prefix, struct sockaddr *mask)
+{
+   struct lltable *llt;
+
+   IFNET_RLOCK();
+   SLIST_FOREACH(llt, &lltables, llt_link) {
+   if (llt->llt_af != af)
+   continue;
+
+   llt->llt_prefix_free(llt, prefix, mask);
+   }
+   IFNET_RUNLOCK();
+}
+
+
+
 /*
  * Create a new lltable.
  */

Modified: head/sys/net/if_llatbl.h
==
--- head/sys/net/if_llatbl.hWed May 20 21:04:41 2009(r192475)
+++ head/sys/net/if_llatbl.hWed May 20 21:07:15 2009(r192476)
@@ -147,6 +147,9 @@ struct lltable {
 
struct llentry *(*llt_new)(const struct sockaddr *, u_int);
void(*llt_free)(struct lltable *, struct llentry *);
+   void(*llt_prefix_free)(struct lltable *,
+   const struct sockaddr *prefix,
+   const struct sockaddr *mask);
struct llentry *(*llt_lookup)(struct lltable *, u_int flags,
const struct sockaddr *l3addr);
int (*llt_rtcheck)(struct ifnet *,
@@ -174,6 +177,8 @@ MALLOC_DECLARE(M_LLTABLE);
 
 struct lltable *lltable_init(struct ifnet *, int);
 void   lltable_free(struct lltable *);
+void   lltable_prefix_free(int, struct sockaddr *, 
+   struct sockaddr *);
 void   lltable_drain(int);
 intlltable_sysctl_dumparp(int, struct sysctl_req *);
 

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Wed May 20 21:04:41 2009(r192475)
+++ head/sys/netinet/in.c   Wed May 20 21:07:15 2009(r192476)
@@ -1013,6 +1013,7 @@ in_scrubprefix(struct in_ifaddr *target)
struct in_ifaddr *ia;
struct in_addr prefix, mask, p;
int error;
+   struct sockaddr_in prefix0, mask0;
struct rt_addrinfo info;
struct sockaddr_dl null_sdl;
 
@@ -1082,6 +1083,20 @@ in_scrubprefix(struct in_ifaddr *target)
}
 
/*
+* remove all L2 entries on the given prefix
+*/
+   bzero(&prefix0, sizeof(prefix0));
+   prefix0.sin_len = sizeof(prefix0);
+   prefix0.sin_family = AF_INET;
+   prefix0.sin_addr.s_addr = target->ia_subnet;
+   bzero(&mask0, sizeof(mask0));
+   mask0.sin_len = sizeof(mask0);
+   mask0.sin_family = AF_INET;
+   mask0.sin_addr.s_addr = target->ia_subnetmask;
+   lltable_prefix_free(AF_INET, (struct sockaddr *)&prefix0, 
+   (struct sockaddr *)&mask0);
+
+   /*
 * As no-one seem to have this prefix, we can remove the route.
 */
rtinit(&(target->ia_ifa), (int)RTM_DELETE, rtinitflags(target));
@@ -1232,6 +1247,34 @@ in_lltable_free(struct lltable *llt, str
free(lle, M_LLTABLE);
 }
 
+
+#define IN_ARE_MASKED_ADDR_EQUAL(d, a, m)  (   \
+   (((ntohl((d)->sin_addr.s_addr) ^ (a)->sin_addr.s_addr) & 
(m)->sin_addr.s_addr)) == 0 )
+
+static void
+in_lltable_prefix_free(struct lltable *llt, 
+  const struct sockaddr *prefix,
+  const struct sockaddr *mask)
+{
+   const struct sockaddr_in *pfx = (const struct sockaddr_in *)prefix;
+   const struct sockaddr_in *msk = (const struct sockaddr_in *)mask;
+   struct llentry *lle, *next;
+   register int i;
+
+   for (i=0; i < LLTBL_HASHTBL_SIZE; i++) {
+   LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {
+
+   if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in 
*)L3_ADDR(lle), 
+pfx, msk)) {
+   callout_drain(&lle->la_timer);
+   LLE_WLOCK(lle);
+   llentry_free(lle);
+   }
+   }
+   }
+}
+
+
 static int
 in_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr)
 {
@@ -1

svn commit: r192475 - in stable/7/sys: conf kern sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 21:04:41 2009
New Revision: 192475
URL: http://svn.freebsd.org/changeset/base/192475

Log:
  - MFC "object specific data" support with rmlocks replaced with rwlocks
  
  - ZFS MFC dependency

Added:
  stable/7/sys/kern/kern_osd.c   (contents, props changed)
  stable/7/sys/sys/osd.h   (contents, props changed)
Modified:
  stable/7/sys/conf/files
  stable/7/sys/kern/kern_proc.c
  stable/7/sys/kern/kern_thread.c
  stable/7/sys/sys/jail.h
  stable/7/sys/sys/proc.h

Modified: stable/7/sys/conf/files
==
--- stable/7/sys/conf/files Wed May 20 20:57:40 2009(r192474)
+++ stable/7/sys/conf/files Wed May 20 21:04:41 2009(r192475)
@@ -1620,6 +1620,7 @@ kern/kern_module.cstandard
 kern/kern_mtxpool.cstandard
 kern/kern_mutex.c  standard
 kern/kern_ntptime.cstandard
+kern/kern_osd.cstandard
 kern/kern_physio.c standard
 kern/kern_pmc.cstandard
 kern/kern_poll.c   optional device_polling

Added: stable/7/sys/kern/kern_osd.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/7/sys/kern/kern_osd.cWed May 20 21:04:41 2009
(r192475)
@@ -0,0 +1,406 @@
+/*-
+ * Copyright (c) 2007 Pawel Jakub Dawidek 
+ * 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 AUTHORS 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 AUTHORS 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* OSD (Object Specific Data) */
+
+static MALLOC_DEFINE(M_OSD, "osd", "Object Specific Data");
+
+static int osd_debug = 0;
+TUNABLE_INT("debug.osd", &osd_debug);
+SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLAG_RW, &osd_debug, 0, "OSD debug 
level");
+
+#defineOSD_DEBUG(...)  do {
\
+   if (osd_debug) {\
+   printf("OSD (%s:%u): ", __func__, __LINE__);\
+   printf(__VA_ARGS__);\
+   printf("\n");   \
+   }   \
+} while (0)
+
+static void do_osd_del(u_int type, struct osd *osd, u_int slot);
+static void do_osd_del_locked(u_int type, struct osd *osd, u_int slot);
+
+/*
+ * Lists of objects with OSD.
+ *
+ * Lock key:
+ *  (m) osd_module_lock
+ *  (o) osd_object_lock
+ *  (l) osd_list_lock
+ */
+static LIST_HEAD(, osd)osd_list[OSD_LAST + 1]; /* (m) */
+static osd_method_t *osd_methods[OSD_LAST + 1];/* (m) */
+static u_int osd_nslots[OSD_LAST + 1]; /* (m) */
+static osd_destructor_t *osd_destructors[OSD_LAST + 1];/* (o) */
+static const u_int osd_nmethods[OSD_LAST + 1] = {
+   [OSD_JAIL] = PR_MAXMETHOD,
+};
+
+static struct sx osd_module_lock[OSD_LAST + 1];
+static struct rwlock osd_object_lock[OSD_LAST + 1];
+static struct mtx osd_list_lock[OSD_LAST + 1];
+
+static void
+osd_default_destructor(void *value __unused)
+{
+   /* Do nothing. */
+}
+
+int
+osd_register(u_int type, osd_destructor_t destructor, osd_method_t *methods)
+{
+   void *newptr;
+   u_int i, m;
+
+   KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type."));
+
+   /*
+* If no destructor is given, use default one. We need to use some
+* destructor, because NULL destructor means unused slot.
+*/
+ 

svn commit: r192474 - stable/7/sys/sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 20:57:40 2009
New Revision: 192474
URL: http://svn.freebsd.org/changeset/base/192474

Log:
  include fcntl.h to define AT_FDCWD

Modified:
  stable/7/sys/sys/namei.h

Modified: stable/7/sys/sys/namei.h
==
--- stable/7/sys/sys/namei.hWed May 20 20:18:01 2009(r192473)
+++ stable/7/sys/sys/namei.hWed May 20 20:57:40 2009(r192474)
@@ -92,6 +92,8 @@ struct nameidata {
 };
 
 #ifdef _KERNEL
+#include 
+
 /*
  * namei operations
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192473 - head/sys/net80211

2009-05-20 Thread Sam Leffler
Author: sam
Date: Wed May 20 20:18:01 2009
New Revision: 192473
URL: http://svn.freebsd.org/changeset/base/192473

Log:
  Prepare to distribute sysctl code to reduce global definitions:
  o expose net.wlan sysctl node
  o expose ieee80211_sysctl_msecs_ticks
  
  Reviewed by:  rpaulo, thompsa

Modified:
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Wed May 20 20:10:46 2009
(r192472)
+++ head/sys/net80211/ieee80211_freebsd.c   Wed May 20 20:18:01 2009
(r192473)
@@ -160,7 +160,7 @@ ieee80211_vap_destroy(struct ieee80211va
if_clone_destroyif(&wlan_cloner, vap->iv_ifp);
 }
 
-static int
+int
 ieee80211_sysctl_msecs_ticks(SYSCTL_HANDLER_ARGS)
 {
int msecs = ticks_to_msecs(*(int *)arg1);

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Wed May 20 20:10:46 2009
(r192472)
+++ head/sys/net80211/ieee80211_freebsd.h   Wed May 20 20:18:01 2009
(r192473)
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /*
@@ -276,6 +277,9 @@ voidieee80211_sysctl_detach(struct ieee
 void   ieee80211_sysctl_vattach(struct ieee80211vap *);
 void   ieee80211_sysctl_vdetach(struct ieee80211vap *);
 
+SYSCTL_DECL(_net_wlan);
+intieee80211_sysctl_msecs_ticks(SYSCTL_HANDLER_ARGS);
+
 void   ieee80211_load_module(const char *);
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192471 - stable/7/sys/sys

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 20:08:51 2009
New Revision: 192471
URL: http://svn.freebsd.org/changeset/base/192471

Log:
  MFC NDINIT macros without changing the size of nameidata

Modified:
  stable/7/sys/sys/fcntl.h
  stable/7/sys/sys/namei.h

Modified: stable/7/sys/sys/fcntl.h
==
--- stable/7/sys/sys/fcntl.hWed May 20 20:05:56 2009(r192470)
+++ stable/7/sys/sys/fcntl.hWed May 20 20:08:51 2009(r192471)
@@ -105,6 +105,12 @@ typedef__pid_t pid_t;
 #ifdef _KERNEL
 #defineFHASLOCK0x4000  /* descriptor holds advisory 
lock */
 #endif
+/*
+ * Magic value that specify the use of the current working directory
+ * to determine the target of relative file paths in the openat() and
+ * similar syscalls.
+ */
+#defineAT_FDCWD-100
 
 /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
 #defineO_NOCTTY0x8000  /* don't assign controlling 
terminal */

Modified: stable/7/sys/sys/namei.h
==
--- stable/7/sys/sys/namei.hWed May 20 20:05:56 2009(r192470)
+++ stable/7/sys/sys/namei.hWed May 20 20:08:51 2009(r192471)
@@ -86,6 +86,9 @@ struct nameidata {
 * through the VOP interface.
 */
struct componentname ni_cnd;
+#ifdef notyet
+   int ni_dirfd;   /* starting directory for *at functions 
*/  
+#endif
 };
 
 #ifdef _KERNEL
@@ -148,20 +151,31 @@ struct nameidata {
 /*
  * Initialization of a nameidata structure.
  */
-static void NDINIT(struct nameidata *, u_long, u_long, enum uio_seg,
-   const char *, struct thread *);
+#defineNDINIT(ndp, op, flags, segflg, namep, td)   
\
+   NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td)
+#defineNDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) 
\
+   NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td)
+#defineNDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td)  
\
+   NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td)
+
 static __inline void
-NDINIT(struct nameidata *ndp,
+NDINIT_ALL(struct nameidata *ndp,
u_long op, u_long flags,
enum uio_seg segflg,
const char *namep,
+   int dirfd,
+   struct vnode *startdir,
struct thread *td)
 {
ndp->ni_cnd.cn_nameiop = op;
ndp->ni_cnd.cn_flags = flags;
ndp->ni_segflg = segflg;
ndp->ni_dirp = namep;
+   ndp->ni_startdir = startdir;
ndp->ni_cnd.cn_thread = td;
+#ifdef notyet
+   ndp->ni_dirfd = dirfd;
+#endif
 }
 
 #define NDF_NO_DVP_RELE0x0001
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192470 - in head: . sys/sys

2009-05-20 Thread Sam Leffler
Author: sam
Date: Wed May 20 20:05:56 2009
New Revision: 192470
URL: http://svn.freebsd.org/changeset/base/192470

Log:
  bump for net80211 monitor mode changes

Modified:
  head/UPDATING
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Wed May 20 20:02:40 2009(r192469)
+++ head/UPDATING   Wed May 20 20:05:56 2009(r192470)
@@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20090520:
+   802.11 monitor mode support was revised and driver api's
+   were changed.  Drivers dependent on net80211 now support
+   DLT_IEEE802_11_RADIO instead of DLT_IEEE802_11.  No
+   user-visible data structures were changed but applications
+   that use DLT_IEEE802_11 may require changes.
+   Bump __FreeBSD_version to 800088.
+
 20090430:
The layout of the following structs has changed: sysctl_oid,
socket, ifnet, inpcbinfo, tcpcb, syncache_head, vnet_inet,

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed May 20 20:02:40 2009(r192469)
+++ head/sys/sys/param.hWed May 20 20:05:56 2009(r192470)
@@ -57,7 +57,7 @@
  * is created, otherwise 1.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 800087   /* Master, propagated to newvers */
+#define __FreeBSD_version 800088   /* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192469 - stable/7/sys/amd64/include

2009-05-20 Thread Kip Macy
Author: kmacy
Date: Wed May 20 20:02:40 2009
New Revision: 192469
URL: http://svn.freebsd.org/changeset/base/192469

Log:
  increase kmem map to 512GB
  
  discussed with: alc

Modified:
  stable/7/sys/amd64/include/vmparam.h

Modified: stable/7/sys/amd64/include/vmparam.h
==
--- stable/7/sys/amd64/include/vmparam.hWed May 20 20:00:40 2009
(r192468)
+++ stable/7/sys/amd64/include/vmparam.hWed May 20 20:02:40 2009
(r192469)
@@ -154,8 +154,7 @@
  * 0x8000 - 0x804020100fff   recursive page table (512GB slot)
  * 0x804020101000 - 0xfeff   unused
  * 0xff00 - 0xff7f   512GB direct map mappings
- * 0xff80 - 0xfffe7fff   unused (506GB)
- * 0xfffe8000 - 0x   6GB kernel map
+ * 0xff80 - 0x   512GB kernel map
  *
  * Within the kernel map:
  *
@@ -163,7 +162,7 @@
  */
 
 #defineVM_MAX_KERNEL_ADDRESS   KVADDR(KPML4I, NPDPEPG-1, NPDEPG-1, 
NPTEPG-1)
-#defineVM_MIN_KERNEL_ADDRESS   KVADDR(KPML4I, NPDPEPG-6, 0, 0)
+#defineVM_MIN_KERNEL_ADDRESS   KVADDR(KPML4I, NPDPEPG-512, 0, 0)
 
 #defineDMAP_MIN_ADDRESSKVADDR(DMPML4I, 0, 0, 0)
 #defineDMAP_MAX_ADDRESSKVADDR(DMPML4I+1, 0, 0, 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192398 - in head/usr.bin: . perror

2009-05-20 Thread Peter Jeremy
On 2009-May-19 17:40:22 +, "George V. Neville-Neil"  
wrote:
>Log:
>  Add a new program, perror, which takes an errno as a command line argument
>  and outputs the associated textual message in the same way that
>  perror(3) would if called within a program.

Given how easy it is to "grep <> /usr/include/sys/errno.h" or
  perl -e '$! = <>; print "$!\n";'
I'm not sure of the utility of this tool.  One downside is that
  man perror
will now return perror(1) instead of perror(3)

-- 
Peter Jeremy


pgpD4Lmz1pRzg.pgp
Description: PGP signature


svn commit: r192468 - in head/sys: conf dev/ath dev/bwi dev/ipw dev/iwi dev/iwn dev/malo dev/ral dev/usb/wlan dev/wi dev/wpi net80211

2009-05-20 Thread Sam Leffler
Author: sam
Date: Wed May 20 20:00:40 2009
New Revision: 192468
URL: http://svn.freebsd.org/changeset/base/192468

Log:
  Overhaul monitor mode handling:
  o replace DLT_IEEE802_11 support in net80211 with DLT_IEEE802_11_RADIO
and remove explicit bpf support from wireless drivers; drivers now
use ieee80211_radiotap_attach to setup shared data structures that
hold the radiotap header for each packet tx/rx
  o remove rx timestamp from the rx path; it was used only by the tdma support
for debugging and was mostly useless due to it being 32-bits and mostly
unavailable
  o track DLT_IEEE80211_RADIO bpf attachments and maintain per-vap and
per-com state when there are active taps
  o track the number of monitor mode vaps
  o use bpf tap and monitor mode vap state to decide when to collect radiotap
state and dispatch frames; drivers no longer explicitly directly check
bpf state or use bpf calls to tap frames
  o handle radiotap state updates on channel change in net80211; drivers
should not do this (unless they bypass net80211 which is almost always
a mistake)
  o update various drivers to be more consistent/correct in handling radiotap
  o update ral to include TSF in radiotap'd frames
  o add promisc mode callback to wi
  
  Reviewed by:  cbzimmer, rpaulo, thompsa

Added:
  head/sys/net80211/ieee80211_radiotap.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athvar.h
  head/sys/dev/bwi/if_bwi.c
  head/sys/dev/bwi/if_bwivar.h
  head/sys/dev/ipw/if_ipw.c
  head/sys/dev/ipw/if_ipwvar.h
  head/sys/dev/iwi/if_iwi.c
  head/sys/dev/iwi/if_iwivar.h
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnvar.h
  head/sys/dev/malo/if_malo.c
  head/sys/dev/malo/if_malo.h
  head/sys/dev/ral/rt2560.c
  head/sys/dev/ral/rt2560var.h
  head/sys/dev/ral/rt2661.c
  head/sys/dev/ral/rt2661var.h
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_rumvar.h
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_uathvar.h
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_uralvar.h
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/dev/wi/if_wi.c
  head/sys/dev/wi/if_wireg.h
  head/sys/dev/wi/if_wivar.h
  head/sys/dev/wpi/if_wpi.c
  head/sys/dev/wpi/if_wpivar.h
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_adhoc.c
  head/sys/net80211/ieee80211_ddb.c
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_input.c
  head/sys/net80211/ieee80211_monitor.c
  head/sys/net80211/ieee80211_node.c
  head/sys/net80211/ieee80211_node.h
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_proto.c
  head/sys/net80211/ieee80211_proto.h
  head/sys/net80211/ieee80211_scan.c
  head/sys/net80211/ieee80211_scan.h
  head/sys/net80211/ieee80211_scan_sta.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_superg.c
  head/sys/net80211/ieee80211_tdma.c
  head/sys/net80211/ieee80211_tdma.h
  head/sys/net80211/ieee80211_var.h
  head/sys/net80211/ieee80211_wds.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed May 20 19:53:10 2009(r192467)
+++ head/sys/conf/files Wed May 20 20:00:40 2009(r192468)
@@ -2218,6 +2218,7 @@ net80211/ieee80211_output.c   optional wla
 net80211/ieee80211_phy.c   optional wlan
 net80211/ieee80211_power.c optional wlan
 net80211/ieee80211_proto.c optional wlan
+net80211/ieee80211_radiotap.c  optional wlan
 net80211/ieee80211_regdomain.c optional wlan
 net80211/ieee80211_rssadapt.c  optional wlan wlan_rssadapt
 net80211/ieee80211_scan.c  optional wlan

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Wed May 20 19:53:10 2009(r192467)
+++ head/sys/dev/ath/if_ath.c   Wed May 20 20:00:40 2009(r192468)
@@ -172,7 +172,7 @@ static void ath_node_getsignal(const str
int8_t *, int8_t *);
 static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *);
 static voidath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
-   int subtype, int rssi, int noise, u_int32_t rstamp);
+   int subtype, int rssi, int nf);
 static voidath_setdefantenna(struct ath_softc *, u_int);
 static voidath_rx_proc(void *, int);
 static voidath_txq_init(struct ath_softc *sc, struct ath_txq *, int);
@@ -214,7 +214,6 @@ static void ath_setcurmode(struct ath_so
 static voidath_sysctlattach(struct ath_softc *);
 static int ath_raw_xmit(struct ieee80211_node *,
struct mbuf *, const struct ieee80211_bpf_params *);
-static voidath_bpfattach(struct ath_softc *);
 static voidath_announce(struct ath_softc *);
 
 #ifdef IEEE80211_SUPPORT_TDMA
@

Re: svn commit: r192463 - head/sys/fs/nfsserver

2009-05-20 Thread Juli Mallett
When client ids have been run out of, does that put something into a
dangerous state (insecure or crash-prone)?  Isn't it better to let the
administrator make the decision of when to reboot the machine?

On Wed, May 20, 2009 at 11:58 AM, Rick Macklem  wrote:
> Author: rmacklem
> Date: Wed May 20 18:58:07 2009
> New Revision: 192463
> URL: http://svn.freebsd.org/changeset/base/192463
>
> Log:
>  Although it should never happen, all the nfsv4 server can do
>  when it runs out of clientids is reboot. I had replaced cpu_reboot()
>  with printf(), since cpu_reboot() doesn't exist for sparc64.
>  This change replaces the printf() with panic(), so the reboot
>  would occur for this highly unlikely occurrence.
>
>  Approved by:  kib (mentor)
>
> Modified:
>  head/sys/fs/nfsserver/nfs_nfsdstate.c
>
> Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
> ==
> --- head/sys/fs/nfsserver/nfs_nfsdstate.c       Wed May 20 18:45:49 2009      
>   (r192462)
> +++ head/sys/fs/nfsserver/nfs_nfsdstate.c       Wed May 20 18:58:07 2009      
>   (r192463)
> @@ -3709,7 +3709,7 @@ nfsrv_nextclientindex(void)
>         * In practice, we'll never get here, but the reboot is here,
>         * just for fun. (client_index will not wrap around on any real server)
>         */
> -       printf("you must reboot now\n");
> +       panic("nfsv4 server out of clientids");
>        return (0);     /* Just to shut the compiler up */
>  }
>
>
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192450 - in head/sys/dev: aac acpica amr arcmsr ata ciss cxgb iir mfi mpt pci twa twe wi

2009-05-20 Thread M. Warner Losh
In message: <200905201355.24483@freebsd.org>
John Baldwin  writes:
: Also oops?

Yes.  Dang it.

Warner
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192463 - head/sys/fs/nfsserver

2009-05-20 Thread Rick Macklem
Author: rmacklem
Date: Wed May 20 18:58:07 2009
New Revision: 192463
URL: http://svn.freebsd.org/changeset/base/192463

Log:
  Although it should never happen, all the nfsv4 server can do
  when it runs out of clientids is reboot. I had replaced cpu_reboot()
  with printf(), since cpu_reboot() doesn't exist for sparc64.
  This change replaces the printf() with panic(), so the reboot
  would occur for this highly unlikely occurrence.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Wed May 20 18:45:49 2009
(r192462)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Wed May 20 18:58:07 2009
(r192463)
@@ -3709,7 +3709,7 @@ nfsrv_nextclientindex(void)
 * In practice, we'll never get here, but the reboot is here,
 * just for fun. (client_index will not wrap around on any real server)
 */
-   printf("you must reboot now\n");
+   panic("nfsv4 server out of clientids");
return (0); /* Just to shut the compiler up */
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192462 - head/sys/sys

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 18:45:49 2009
New Revision: 192462
URL: http://svn.freebsd.org/changeset/base/192462

Log:
  Add a new locking note for p_aioinfo as it is not a normal PROC_LOCK field.

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Wed May 20 18:42:04 2009(r192461)
+++ head/sys/sys/proc.h Wed May 20 18:45:49 2009(r192462)
@@ -148,6 +148,8 @@ struct pargs {
  *  r - p_peers lock
  *  t - thread lock
  *  x - created at fork, only changes during single threading in exec
+ *  y - created at first aio, doesn't change until exit or exec at which
+ *  point we are single-threaded and only curthread changes it
  *  z - zombie threads lock
  *
  * If the locking key specifies two identifiers (for example, p_pptr) then
@@ -503,7 +505,7 @@ struct proc {
charp_step; /* (c) Process is stopped. */
u_char  p_pfsflags; /* (c) Procfs flags. */
struct nlminfo  *p_nlminfo; /* (?) Only used by/for lockd. */
-   struct kaioinfo *p_aioinfo; /* (c) ASYNC I/O info. */
+   struct kaioinfo *p_aioinfo; /* (y) ASYNC I/O info. */
struct thread   *p_singlethread;/* (c + j) If single threading this is 
it */
int p_suspcount;/* (j) Num threads in suspended mode. */
struct thread   *p_xthread; /* (c) Trap thread */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192461 - head/sys/kern

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 18:42:04 2009
New Revision: 192461
URL: http://svn.freebsd.org/changeset/base/192461

Log:
  Set the umask in a new file descriptor table earlier in fdcopy() to remove
  two lock operations.

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cWed May 20 18:38:43 2009
(r192460)
+++ head/sys/kern/kern_descrip.cWed May 20 18:42:04 2009
(r192461)
@@ -1626,17 +1626,15 @@ fdcopy(struct filedesc *fdp)
newfdp->fd_freefile = i;
}
}
+   newfdp->fd_cmask = fdp->fd_cmask;
FILEDESC_SUNLOCK(fdp);
FILEDESC_XLOCK(newfdp);
for (i = 0; i <= newfdp->fd_lastfile; ++i)
if (newfdp->fd_ofiles[i] != NULL)
fdused(newfdp, i);
-   FILEDESC_XUNLOCK(newfdp);
-   FILEDESC_SLOCK(fdp);
if (newfdp->fd_freefile == -1)
newfdp->fd_freefile = i;
-   newfdp->fd_cmask = fdp->fd_cmask;
-   FILEDESC_SUNLOCK(fdp);
+   FILEDESC_XUNLOCK(newfdp);
return (newfdp);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192460 - head/sys/dev/sound/pci

2009-05-20 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May 20 18:38:43 2009
New Revision: 192460
URL: http://svn.freebsd.org/changeset/base/192460

Log:
  Slightly adjust copyright text.
  
  Approved by:  matk

Modified:
  head/sys/dev/sound/pci/emu10kx-midi.c

Modified: head/sys/dev/sound/pci/emu10kx-midi.c
==
--- head/sys/dev/sound/pci/emu10kx-midi.c   Wed May 20 18:36:17 2009
(r192459)
+++ head/sys/dev/sound/pci/emu10kx-midi.c   Wed May 20 18:38:43 2009
(r192460)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 1999 Seigo Tanimura
- * (c) 2003 Mathew Kanner
+ * Copyright (c) 2003 Mathew Kanner
  * Copyright (c) 2003-2006 Yuriy Tsibizov 
  * All rights reserved
  *
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192459 - head/sys/compat/svr4

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 18:36:17 2009
New Revision: 192459
URL: http://svn.freebsd.org/changeset/base/192459

Log:
  Comment nits.

Modified:
  head/sys/compat/svr4/svr4_misc.c

Modified: head/sys/compat/svr4/svr4_misc.c
==
--- head/sys/compat/svr4/svr4_misc.cWed May 20 18:34:26 2009
(r192458)
+++ head/sys/compat/svr4/svr4_misc.cWed May 20 18:36:17 2009
(r192459)
@@ -1199,12 +1199,12 @@ svr4_sys_waitsys(td, uap)
 
/*
 * Ok, handle the weird cases.  Either WNOWAIT is set (meaning we
-* just want to see if there is a process to harvest, we dont'
+* just want to see if there is a process to harvest, we don't
 * want to actually harvest it), or WEXIT and WTRAPPED are clear
 * meaning we want to ignore zombies.  Either way, we don't have
 * to handle harvesting zombies here.  We do have to duplicate the
-* other portions of kern_wait() though, especially for the
-* WCONTINUED and WSTOPPED.
+* other portions of kern_wait() though, especially for WCONTINUED
+* and WSTOPPED.
 */
 loop:
nfound = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192458 - head/sys/dev/sound/midi

2009-05-20 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May 20 18:34:26 2009
New Revision: 192458
URL: http://svn.freebsd.org/changeset/base/192458

Log:
  Remove license clauses 3 and 4 as per rev. 1.65 of midi.c in NetBSD.
  
  Approved by:  matk

Modified:
  head/sys/dev/sound/midi/midi.c

Modified: head/sys/dev/sound/midi/midi.c
==
--- head/sys/dev/sound/midi/midi.c  Wed May 20 18:31:11 2009
(r192457)
+++ head/sys/dev/sound/midi/midi.c  Wed May 20 18:34:26 2009
(r192458)
@@ -14,13 +14,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *This product includes software developed by the NetBSD
- *Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *contributors may be used to endorse or promote products derived
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192457 - head/sys/dev/sound/pci

2009-05-20 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May 20 18:31:11 2009
New Revision: 192457
URL: http://svn.freebsd.org/changeset/base/192457

Log:
  Remove license clauses 3 and 4 as per rev. 1.65 of auvia.c in NetBSD.

Modified:
  head/sys/dev/sound/pci/via82c686.h

Modified: head/sys/dev/sound/pci/via82c686.h
==
--- head/sys/dev/sound/pci/via82c686.h  Wed May 20 18:29:14 2009
(r192456)
+++ head/sys/dev/sound/pci/via82c686.h  Wed May 20 18:31:11 2009
(r192457)
@@ -13,13 +13,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *  This product includes software developed by the NetBSD
- *  Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *contributors may be used to endorse or promote products derived
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192456 - head/sys/kern

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 18:29:14 2009
New Revision: 192456
URL: http://svn.freebsd.org/changeset/base/192456

Log:
  Remove an obsolete assertion.  We always wake up all waiters when unlocking
  a mutex and never set the lock cookie == MTX_CONTESTED.

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Wed May 20 18:25:16 2009(r192455)
+++ head/sys/kern/kern_mutex.c  Wed May 20 18:29:14 2009(r192456)
@@ -364,8 +364,6 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t
continue;
}
 
-   MPASS(v != MTX_CONTESTED);
-
 #ifdef ADAPTIVE_MUTEXES
/*
 * If the current owner of the lock is executing on another
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192256 - head/sys/fs/nfsserver

2009-05-20 Thread Doug Rabson


On 20 May 2009, at 16:07, Rick Macklem wrote:




On Wed, 20 May 2009, Doug Rabson wrote:

Thinking about this for a few more minutes, I think you probably  
want to allocate a sysid for each client and then for each  
lock_owner of that client allocate a 'pid'. The value doesn't have  
to be a process identifier but it does have to allow different lock  
owners from the same client to be distinguished.


Why do they need to be distinguished? The nfsv4 state subsystem  
handles

all conflicts between them, so they are just "nfsv4 locks".


Why? It seems a shame to re-implement all the record locking logic of  
the local lock manager in NFS.




An nfsv4 lockowner is a ClientID + up to 1024 bytes of opaque name  
and it

might not persist in the server beyond the point where no locks are
held and the associated OpenOwner no longer has any Opens. After this,
the same lockowner could be "re-incarnated" (ie. create a new state
data structure in the server with the same ClientID + up to 1024  
bytes)
when the client chooses to do more locking on it. If a pid is  
generated

sequentially, this second re-incarnation would end up with a different
pid although it is the same lockowner. (To ensure this doesn't happen,
the server would have to hold onto the lockowner state structure  
"forever"
and that obviously isn't practical.) Or a pid could be a 32bit  
checksum
on the ClientID + up to 1024 bytes instead of sequential assignment.  
In that case the re-incarnation would get the same pid, but it  
wouldn't be

guaranteed to be unique across all different lockowners.

As such, the most an assigned pid could be is a "hint" that the  
lockowner

is different/same. Is there some benefit to this over "held by nfsv4",
which is what using one  tuple gives you?


The lock manager doesn't care much about the interpretation of the  
'pid' (wrong name but we are stuck with it). Its perfectly fine to use  
a different pid for the same lock owner, if and only if all locks from  
the first pid are released before using a new one. If you are worried  
about pids wrapping, you could use the 'unit allocator' code in  
subr_unit.c to manage them. I think you could just allocate a pid the  
first time a server sees a lock owner and free it when the server  
garbage collects an unused lock owner.





You probably also want to record locks in the local lock manager on  
the client. In NLM, I use a different range of sysids starting at  
0x10 for this. This lets you do lock recovery after a server  
restart by asking the local lock manager to enumerate locks for the  
right sysid.



The lock state all lives in the nfsv4 client (some associated with a
delegation and assigned locally, the rest tied to an associated  
Open) with the "up to 1024 byte" owner names generated by the  
client, etc. Maintaining the rather complex relationship between  
Opens (with Openowners) and their associated locks is probably the  
"most interesting"
part of implementing nfsv4. Then you must recover the locks,  
maintaining
that relationship. (The relationship is established via the  
open_to_lock_owner case of the Lock Op.) The recovery code uses  
client side data structures that reflect the open/lock relationship.  
The lock

manager wouldn't be able to provide that information and I think there
would be little gained by trying to make the major modifications that
would be required so that it could do so.


Ok. I was able to use the lock manager to keep track of client lock  
state for NLM but if it needs extra stuff that doesn't fit with NFSv4,  
don't worry about it.


Note: there is also a lock manager call to trash all the locks  
associated with a given sysid which may be useful on the server side  
for cleaning up after a client which held locks restarts.






On 20 May 2009, at 09:26, Doug Rabson wrote:

This is incorrect. A sysid of zero is reserved for local locks on  
local filesystems. You need to allocate a sysid when the client is  
created and it needs to not conflict with the sysids used by NLM.  
I suggest adding a function to nlm_prot_impl.c to return the next  
available sysid (and bump the counter).
Ok, when I looked at the code, l_sysid only seemed to be used when  
F_REMOTE is set, so I didn't realize that l_sysid == 0 was reserved

for local locks. I'll look at what you suggest and send you an nlm
patch for review.


Thanks.

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192455 - head/sys/compat/svr4

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 18:25:16 2009
New Revision: 192455
URL: http://svn.freebsd.org/changeset/base/192455

Log:
  Put the vnode returned from namei() immediately after namei() returns in
  svr4_sys_resolvepath().

Modified:
  head/sys/compat/svr4/svr4_misc.c

Modified: head/sys/compat/svr4/svr4_misc.c
==
--- head/sys/compat/svr4/svr4_misc.cWed May 20 18:16:45 2009
(r192454)
+++ head/sys/compat/svr4/svr4_misc.cWed May 20 18:25:16 2009
(r192455)
@@ -1611,14 +1611,14 @@ svr4_sys_resolvepath(td, uap)
struct nameidata nd;
int error, *retval = td->td_retval;
unsigned int ncopy;
-   int vfslocked;
 
NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME | MPSAFE, UIO_USERSPACE,
uap->path, td);
 
if ((error = namei(&nd)) != 0)
-   return error;
-   vfslocked = NDHASGIANT(&nd);
+   return (error);
+   NDFREE(&nd, NDF_NO_FREE_PNBUF);
+   VFS_UNLOCK_GIANT(NDHASGIANT(&nd));
 
ncopy = min(uap->bufsiz, strlen(nd.ni_cnd.cn_pnbuf) + 1);
if ((error = copyout(nd.ni_cnd.cn_pnbuf, uap->buf, ncopy)) != 0)
@@ -1627,7 +1627,5 @@ svr4_sys_resolvepath(td, uap)
*retval = ncopy;
 bad:
NDFREE(&nd, NDF_ONLY_PNBUF);
-   vput(nd.ni_vp);
-   VFS_UNLOCK_GIANT(vfslocked);
return error;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192453 - head/sys/dev/sound/usb

2009-05-20 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May 20 18:15:13 2009
New Revision: 192453
URL: http://svn.freebsd.org/changeset/base/192453

Log:
  Remove license clauses 3 and 4 as per rev. 1.112 of uaudio.c and rev. 1.15 of
  uaudioreg.h in NetBSD.

Modified:
  head/sys/dev/sound/usb/uaudio.c
  head/sys/dev/sound/usb/uaudioreg.h

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Wed May 20 18:04:56 2009
(r192452)
+++ head/sys/dev/sound/usb/uaudio.c Wed May 20 18:15:13 2009
(r192453)
@@ -17,13 +17,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *This product includes software developed by the NetBSD
- *Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *contributors may be used to endorse or promote products derived
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

Modified: head/sys/dev/sound/usb/uaudioreg.h
==
--- head/sys/dev/sound/usb/uaudioreg.h  Wed May 20 18:04:56 2009
(r192452)
+++ head/sys/dev/sound/usb/uaudioreg.h  Wed May 20 18:15:13 2009
(r192453)
@@ -17,13 +17,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *This product includes software developed by the NetBSD
- *Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *contributors may be used to endorse or promote products derived
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192452 - head/sys/dev/sound/sbus

2009-05-20 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May 20 18:04:56 2009
New Revision: 192452
URL: http://svn.freebsd.org/changeset/base/192452

Log:
  Remove license clauses 3 and 4 as per rev. 1.12 of cs4231reg.h in NetBSD.

Modified:
  head/sys/dev/sound/sbus/cs4231.h

Modified: head/sys/dev/sound/sbus/cs4231.h
==
--- head/sys/dev/sound/sbus/cs4231.hWed May 20 17:59:49 2009
(r192451)
+++ head/sys/dev/sound/sbus/cs4231.hWed May 20 18:04:56 2009
(r192452)
@@ -14,13 +14,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *This product includes software developed by the NetBSD 
- *   Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its 
- *contributors may be used to endorse or promote products derived 
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192451 - head/sys/sys

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 17:59:49 2009
New Revision: 192451
URL: http://svn.freebsd.org/changeset/base/192451

Log:
  Tweak some comments.

Modified:
  head/sys/sys/interrupt.h

Modified: head/sys/sys/interrupt.h
==
--- head/sys/sys/interrupt.hWed May 20 17:29:21 2009(r192450)
+++ head/sys/sys/interrupt.hWed May 20 17:59:49 2009(r192451)
@@ -43,9 +43,9 @@ struct trapframe;
  * together.
  */
 struct intr_handler {
-   driver_filter_t *ih_filter; /* Filter function. */
-   driver_intr_t   *ih_handler;/* Handler function. */
-   void*ih_argument;   /* Argument to pass to handler. */
+   driver_filter_t *ih_filter; /* Filter handler function. */
+   driver_intr_t   *ih_handler;/* Threaded handler function. */
+   void*ih_argument;   /* Argument to pass to handlers. */
int  ih_flags;
const char  *ih_name;   /* Name of handler. */
struct intr_event *ih_event;/* Event we are connected to. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192450 - in head/sys/dev: aac acpica amr arcmsr ata ciss cxgb iir mfi mpt pci twa twe wi

2009-05-20 Thread John Baldwin
On Wednesday 20 May 2009 1:29:21 pm Warner Losh wrote:
> Author: imp
> Date: Wed May 20 17:29:21 2009
> New Revision: 192450
> URL: http://svn.freebsd.org/changeset/base/192450
> 
> Log:
>   We no longer need to use d_thread_t, migrate to struct thread *.
> 
> Modified: head/sys/dev/ata/ata-all.c
> ==
> --- head/sys/dev/ata/ata-all.cWed May 20 17:19:30 2009
> (r192449)
> +++ head/sys/dev/ata/ata-all.cWed May 20 17:29:21 2009
> (r192450)
> @@ -663,7 +663,7 @@ ata_getparam(struct ata_device *atadev, 
>   btrim(atacap->serial, sizeof(atacap->serial));
>   bpack(atacap->serial, atacap->serial, sizeof(atacap->serial));
>  
> - if (bootverbose)
> + if (bootverbose || 1)
>   printf("ata%d-%s: pio=%s wdma=%s udma=%s cable=%s wire\n",
>  device_get_unit(ch->dev),
>  ata_unit2str(atadev),
> 

Oops?

> Modified: head/sys/dev/pci/pci.c
> ==
> --- head/sys/dev/pci/pci.cWed May 20 17:19:30 2009(r192449)
> +++ head/sys/dev/pci/pci.cWed May 20 17:29:21 2009(r192450)
> @@ -418,6 +418,38 @@ pci_hdrtypedata(device_t pcib, int b, in
>  #undef REG
>  }
>  
> +/*
> + * This is a lame example: we should have some way of managing this table
> + * from userland.  The user should be able to tell us from the boot loader
> + * or at runtime what mapping to do.
> + */
> +static struct pci_remap_entry
> +{
> + uint16_t vendor;
> + uint16_t device;
> + uint16_t mapped_vendor;
> + uint16_t mapped_device;
> +} pci_remap[] =
> +{
> + { 0x1039, 0x0901, 0x1039, 0x0900 }  /* Map sis 901 to sis 900 */
> +};
> +static int pci_remap_entries = 1;
> +
> +static void
> +pci_apply_remap_table(pcicfgregs *cfg)
> +{
> + int i;
> +
> + for (i = 0; i < pci_remap_entries; i++) {
> + if (cfg->vendor == pci_remap[i].vendor &&
> + cfg->device == pci_remap[i].device) {
> + cfg->vendor = pci_remap[i].mapped_vendor;
> + cfg->device = pci_remap[i].mapped_device;
> + return;
> + }
> + }
> +}
> +
>  /* read configuration header into pcicfgregs structure */
>  struct pci_devinfo *
>  pci_read_device(device_t pcib, int d, int b, int s, int f, size_t size)
> @@ -464,6 +496,7 @@ pci_read_device(device_t pcib, int d, in
>  
>   pci_fixancient(cfg);
>   pci_hdrtypedata(pcib, b, s, f, cfg);
> + pci_apply_remap_table(cfg);
>  
>   if (REG(PCIR_STATUS, 2) & PCIM_STATUS_CAPPRESENT)
>   pci_read_extcap(pcib, cfg);
> @@ -2619,6 +2652,59 @@ pci_add_resources(device_t bus, device_t
>   }
>  }
>  
> +/*
> + * After we've added the children to the pci bus device, we need to fixup
> + * the children in various ways.  This function fixes things that require
> + * multiple passes to get right, such as bus number and some resource
> + * things (although the latter hasn't been implemented yet).  This must be
> + * done before the children are probe/attached, sicne by that point these
> + * things must be fixed.
> + */
> +static void
> +pci_fix_bridges(device_t dev)
> +{
> + int i, numdevs, error, secbus, subbus;
> + device_t child, *devlist;
> +
> + if ((error = device_get_children(dev, &devlist, &numdevs)))
> + return;
> + /*
> +  * First pass, get the bus numbers that are in use
> +  */
> + for (i = 0; i < numdevs; i++) {
> + child = devlist[i];
> + switch (pci_read_config(child, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) 
> {
> + default:
> + continue;
> + case 1: /* PCI-PCI bridge */
> + case 2: /* CardBus bridge -- offsets are the same */
> + secbus = pci_read_config(child, PCIR_SECBUS_1, 1);
> + subbus = pci_read_config(child, PCIR_SUBBUS_1, 1);
> + break;
> + }
> + printf("%d:%d:%d:%d sec %d sub %d\n", pcib_get_domain(dev),
> + pci_get_bus(child), pci_get_slot(child),
> + pci_get_function(child), secbus, subbus);
> + }
> +#if 0
> + /*
> +  * Second pass, Fix the bus numbers, as needed
> +  */
> + for (i = 0; i < numdevs; i++) {
> + child = devlist[i];
> + switch (pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) {
> + case 1: /* PCI-PCI bridge */
> + break;
> + case 2: /* CardBus bridge */
> + break;
> + default:
> + continue;
> + }
> + }
> +#endif
> + free(devlist, M_TEMP);
> +}
> +
>  void
>  pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size)
>  {
> @@ -2650,6 +2736,7 @@ pci_add_children(device_t dev, int do

svn commit: r192450 - in head/sys/dev: aac acpica amr arcmsr ata ciss cxgb iir mfi mpt pci twa twe wi

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 17:29:21 2009
New Revision: 192450
URL: http://svn.freebsd.org/changeset/base/192450

Log:
  We no longer need to use d_thread_t, migrate to struct thread *.

Modified:
  head/sys/dev/aac/aac.c
  head/sys/dev/acpica/acpi.c
  head/sys/dev/amr/amr.c
  head/sys/dev/amr/amr_linux.c
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ciss/ciss.c
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/iir/iir_ctrl.c
  head/sys/dev/mfi/mfi.c
  head/sys/dev/mfi/mfi_linux.c
  head/sys/dev/mpt/mpt_user.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pcib_if.m
  head/sys/dev/twa/tw_osl_freebsd.c
  head/sys/dev/twe/twe_freebsd.c
  head/sys/dev/wi/if_wavelan_ieee.h
  head/sys/dev/wi/if_wi.c
  head/sys/dev/wi/if_wivar.h

Modified: head/sys/dev/aac/aac.c
==
--- head/sys/dev/aac/aac.c  Wed May 20 17:19:30 2009(r192449)
+++ head/sys/dev/aac/aac.c  Wed May 20 17:29:21 2009(r192450)
@@ -2905,7 +2905,7 @@ aac_describe_code(struct aac_code_lookup
  */
 
 static int
-aac_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+aac_open(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
struct aac_softc *sc;
 
@@ -2918,7 +2918,7 @@ aac_open(struct cdev *dev, int flags, in
 }
 
 static int
-aac_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+aac_close(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
struct aac_softc *sc;
 
@@ -2933,7 +2933,7 @@ aac_close(struct cdev *dev, int flags, i
 }
 
 static int
-aac_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
+aac_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread 
*td)
 {
union aac_statrequest *as;
struct aac_softc *sc;
@@ -3038,7 +3038,7 @@ aac_ioctl(struct cdev *dev, u_long cmd, 
 }
 
 static int
-aac_poll(struct cdev *dev, int poll_events, d_thread_t *td)
+aac_poll(struct cdev *dev, int poll_events, struct thread *td)
 {
struct aac_softc *sc;
struct aac_fib_context *ctx;

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Wed May 20 17:19:30 2009(r192449)
+++ head/sys/dev/acpica/acpi.c  Wed May 20 17:29:21 2009(r192450)
@@ -3186,19 +3186,19 @@ acpi_deregister_ioctl(u_long cmd, acpi_i
 }
 
 static int
-acpiopen(struct cdev *dev, int flag, int fmt, d_thread_t *td)
+acpiopen(struct cdev *dev, int flag, int fmt, struct thread *td)
 {
 return (0);
 }
 
 static int
-acpiclose(struct cdev *dev, int flag, int fmt, d_thread_t *td)
+acpiclose(struct cdev *dev, int flag, int fmt, struct thread *td)
 {
 return (0);
 }
 
 static int
-acpiioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
+acpiioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread 
*td)
 {
 struct acpi_softc  *sc;
 struct acpi_ioctl_hook *hp;

Modified: head/sys/dev/amr/amr.c
==
--- head/sys/dev/amr/amr.c  Wed May 20 17:19:30 2009(r192449)
+++ head/sys/dev/amr/amr.c  Wed May 20 17:29:21 2009(r192450)
@@ -173,7 +173,7 @@ static void amr_printcommand(struct amr_
 
 static voidamr_init_sysctl(struct amr_softc *sc);
 static int amr_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t addr,
-   int32_t flag, d_thread_t *td);
+   int32_t flag, struct thread *td);
 
 MALLOC_DEFINE(M_AMR, "amr", "AMR memory");
 
@@ -431,7 +431,7 @@ amr_submit_bio(struct amr_softc *sc, str
  * Accept an open operation on the control device.
  */
 static int
-amr_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+amr_open(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
 intunit = dev2unit(dev);
 struct amr_softc   *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -487,7 +487,7 @@ amr_prepare_ld_delete(struct amr_softc *
  * Accept the last close on the control device.
  */
 static int
-amr_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+amr_close(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
 intunit = dev2unit(dev);
 struct amr_softc   *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -537,7 +537,7 @@ shutdown_out:
 
 int
 amr_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag,
-d_thread_t *td)
+struct thread *td)
 {
 struct amr_softc   *sc = (struct amr_softc *)dev->si_drv1;
 struct amr_command *ac;
@@ -736,7 +736,7 @@ amr_linux_ioctl_int(struct cdev *dev, u_
 }
 
 static int
-amr_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t 
*td)
+amr_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct 
thread *td)
 {
 stru

svn commit: r192449 - head/sys/kern

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 17:19:30 2009
New Revision: 192449
URL: http://svn.freebsd.org/changeset/base/192449

Log:
  Fix a typo.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cWed May 20 17:03:12 2009(r192448)
+++ head/sys/kern/subr_bus.cWed May 20 17:19:30 2009(r192449)
@@ -712,7 +712,7 @@ fail:
 
 /*
  * Called when there's no match for this device.  This is only called
- * the first time that no match happens, so we don't keep getitng this
+ * the first time that no match happens, so we don't keep getting this
  * message.  Should that prove to be undesirable, we can change it.
  * This is called when all drivers that can attach to a given bus
  * decline to accept this device.  Other errrors may not be detected.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192448 - head/sys/dev/usb/controller

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Wed May 20 17:03:12 2009
New Revision: 192448
URL: http://svn.freebsd.org/changeset/base/192448

Log:
  Use defines for register offsets that do not change.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/uss820dci.c
  head/sys/dev/usb/controller/uss820dci.h

Modified: head/sys/dev/usb/controller/uss820dci.c
==
--- head/sys/dev/usb/controller/uss820dci.c Wed May 20 17:01:40 2009
(r192447)
+++ head/sys/dev/usb/controller/uss820dci.c Wed May 20 17:03:12 2009
(r192448)
@@ -230,11 +230,11 @@ uss820dci_setup_rx(struct uss820dci_td *
 
/* select the correct endpoint */
bus_space_write_1(td->io_tag, td->io_hdl,
-   td->ep_reg, td->ep_index);
+   USS820_EPINDEX, td->ep_index);
 
/* read out FIFO status */
rx_stat = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_stat_reg);
+   USS820_RXSTAT);
 
/* get pointer to softc */
sc = USS820_DCI_PC2SC(td->pc);
@@ -260,9 +260,9 @@ uss820dci_setup_rx(struct uss820dci_td *
 
/* get the packet byte count */
count = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_count_low_reg);
+   USS820_RXCNTL);
count |= (bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_count_high_reg) << 8);
+   USS820_RXCNTH) << 8);
count &= 0x3FF;
 
/* verify data length */
@@ -278,11 +278,11 @@ uss820dci_setup_rx(struct uss820dci_td *
}
/* receive data */
bus_space_read_multi_1(td->io_tag, td->io_hdl,
-   td->rx_fifo_reg, (void *)&req, sizeof(req));
+   USS820_RXDAT, (void *)&req, sizeof(req));
 
/* read out FIFO status */
rx_stat = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_stat_reg);
+   USS820_RXSTAT);
 
if (rx_stat & (USS820_RXSTAT_EDOVW |
USS820_RXSTAT_STOVW)) {
@@ -297,10 +297,10 @@ uss820dci_setup_rx(struct uss820dci_td *
 
/* set RXFFRC bit */
temp = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_cntl_reg);
+   USS820_RXCON);
temp |= USS820_RXCON_RXFFRC;
bus_space_write_1(td->io_tag, td->io_hdl,
-   td->rx_cntl_reg, temp);
+   USS820_RXCON, temp);
 
/* copy data into real buffer */
usb2_copy_in(td->pc, 0, &req, sizeof(req));
@@ -321,10 +321,10 @@ setup_not_complete:
 
/* set RXFFRC bit */
temp = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_cntl_reg);
+   USS820_RXCON);
temp |= USS820_RXCON_RXFFRC;
bus_space_write_1(td->io_tag, td->io_hdl,
-   td->rx_cntl_reg, temp);
+   USS820_RXCON, temp);
 
/* FALLTHROUGH */
 
@@ -365,16 +365,16 @@ uss820dci_data_rx(struct uss820dci_td *t
got_short = 0;
 
/* select the correct endpoint */
-   bus_space_write_1(td->io_tag, td->io_hdl, td->ep_reg, td->ep_index);
+   bus_space_write_1(td->io_tag, td->io_hdl, USS820_EPINDEX, td->ep_index);
 
/* check if any of the FIFO banks have data */
 repeat:
/* read out FIFO flag */
rx_flag = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_flag_reg);
+   USS820_RXFLG);
/* read out FIFO status */
rx_stat = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_stat_reg);
+   USS820_RXSTAT);
 
DPRINTFN(5, "rx_stat=0x%02x rx_flag=0x%02x rem=%u\n",
rx_stat, rx_flag, td->remainder);
@@ -419,10 +419,10 @@ repeat:
}
/* get the packet byte count */
count = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_count_low_reg);
+   USS820_RXCNTL);
 
count |= (bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_count_high_reg) << 8);
+   USS820_RXCNTH) << 8);
count &= 0x3FF;
 
DPRINTFN(5, "count=0x%04x\n", count);
@@ -454,7 +454,7 @@ repeat:
}
/* receive data */
bus_space_read_multi_1(td->io_tag, td->io_hdl,
-   td->rx_fifo_reg, buf_res.buffer, buf_res.length);
+   USS820_RXDAT, buf_res.buffer, buf_res.length);
 
/* update counters */
count -= buf_res.length;
@@ -464,10 +464,10 @@ repeat:
 
/* set RXFFRC bit */
rx_cntl = bus_space_read_1(td->io_tag, td->io_hdl,
-   td->rx_cntl_reg);
+   USS820_RXCON);
rx_cntl |= USS820_RXCON_RXFFRC;
bus_space_write_1(td->io_tag, td->io_hdl,
-   td->rx_cntl_reg, rx_cntl);
+   USS820_RXCON, rx_cntl);
 
/* check if we are complete */
if ((td->remainder == 0) || got_short) {
@@ -495,18 +495,18 @@ uss820dci_data_tx(struct uss820dci_td *t
 
/* select the correct endpoint */
bus_space_write_1(td->io_tag, td->io_hdl,
-   td->ep_reg, td->ep

svn commit: r192447 - head/sys/nfs4client

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 17:01:40 2009
New Revision: 192447
URL: http://svn.freebsd.org/changeset/base/192447

Log:
  Use struct thread instead of d_thread_t.

Modified:
  head/sys/nfs4client/nfs4_dev.c

Modified: head/sys/nfs4client/nfs4_dev.c
==
--- head/sys/nfs4client/nfs4_dev.c  Wed May 20 17:00:55 2009
(r192446)
+++ head/sys/nfs4client/nfs4_dev.c  Wed May 20 17:01:40 2009
(r192447)
@@ -255,7 +255,7 @@ nfs4dev_uninit(void)
 
 /* device interface functions */
 static int
-nfs4dev_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+nfs4dev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
if (dev != nfs4device) 
return ENODEV;
@@ -274,7 +274,7 @@ nfs4dev_open(struct cdev *dev, int flags
 }
 
 static int
-nfs4dev_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+nfs4dev_close(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
struct nfs4dev_upcall * u;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192446 - head/sys/dev/usb/controller

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Wed May 20 17:00:55 2009
New Revision: 192446
URL: http://svn.freebsd.org/changeset/base/192446

Log:
  - Add new register definitions
  - Enable the controller and wait for the PLL to start
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/atmegadci.c
  head/sys/dev/usb/controller/atmegadci.h

Modified: head/sys/dev/usb/controller/atmegadci.c
==
--- head/sys/dev/usb/controller/atmegadci.c Wed May 20 17:00:16 2009
(r192445)
+++ head/sys/dev/usb/controller/atmegadci.c Wed May 20 17:00:55 2009
(r192446)
@@ -672,7 +672,7 @@ atmegadci_interrupt(struct atmegadci_sof
 * that like RESUME. Resume is set when there is at least 3
 * milliseconds of inactivity on the USB BUS.
 */
-   if (status & ATMEGA_UDINT_EORSMI) {
+   if (status & ATMEGA_UDINT_WAKEUPI) {
 
DPRINTFN(5, "resume interrupt\n");
 
@@ -700,7 +700,7 @@ atmegadci_interrupt(struct atmegadci_sof
 
/* disable suspend interrupt */
ATMEGA_WRITE_1(sc, ATMEGA_UDIEN,
-   ATMEGA_UDINT_EORSMI |
+   ATMEGA_UDINT_WAKEUPE |
ATMEGA_UDINT_EORSTE);
 
/* complete root HUB interrupt endpoint */
@@ -1152,13 +1152,12 @@ atmegadci_clear_stall_sub(struct atmegad
ATMEGA_UECONX_STALLRQC);
 
do {
-   temp = 0;
if (ep_type == UE_BULK) {
-   temp |= ATMEGA_UECFG0X_EPTYPE2;
+   temp = ATMEGA_UECFG0X_EPTYPE2;
} else if (ep_type == UE_INTERRUPT) {
-   temp |= ATMEGA_UECFG0X_EPTYPE3;
+   temp = ATMEGA_UECFG0X_EPTYPE3;
} else {
-   temp |= ATMEGA_UECFG0X_EPTYPE1;
+   temp = ATMEGA_UECFG0X_EPTYPE1;
}
if (ep_dir & UE_DIR_IN) {
temp |= ATMEGA_UECFG0X_EPDIR;
@@ -1217,13 +1216,28 @@ atmegadci_init(struct atmegadci_softc *s
sc->sc_bus.methods = &atmegadci_bus_methods;
 
USB_BUS_LOCK(&sc->sc_bus);
-#if 0
-   /* XXX TODO - currently done by boot strap */
+
+   /* make sure USB is enabled */
+   ATMEGA_WRITE_1(sc, ATMEGA_USBCON,
+   ATMEGA_USBCON_USBE |
+   ATMEGA_USBCON_FRZCLK);
 
/* enable USB PAD regulator */
ATMEGA_WRITE_1(sc, ATMEGA_UHWCON,
-   ATMEGA_UHWCON_UVREGE | ATMEGA_UHWCON_UIMOD);
-#endif
+   ATMEGA_UHWCON_UVREGE |
+   ATMEGA_UHWCON_UIMOD);
+
+   /* the following register sets up the USB PLL, assuming 16MHz X-tal */
+   ATMEGA_WRITE_1(sc, 0x49 /* PLLCSR */, 0x14 | 0x02);
+
+   /* wait for PLL to lock */
+   for (n = 0; n != 20; n++) {
+   if (ATMEGA_READ_1(sc, 0x49) & 0x01)
+   break;
+   /* wait a little bit for PLL to start */
+   usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100);
+   }
+
/* make sure USB is enabled */
ATMEGA_WRITE_1(sc, ATMEGA_USBCON,
ATMEGA_USBCON_USBE |
@@ -1847,6 +1861,11 @@ tr_handle_clear_port_feature:
/* clear connect change flag */
sc->sc_flags.change_connect = 0;
 
+   if (!sc->sc_flags.status_bus_reset) {
+   /* we are not connected */
+   break;
+   }
+
/* configure the control endpoint */
 
/* select endpoint number */

Modified: head/sys/dev/usb/controller/atmegadci.h
==
--- head/sys/dev/usb/controller/atmegadci.h Wed May 20 17:00:16 2009
(r192445)
+++ head/sys/dev/usb/controller/atmegadci.h Wed May 20 17:00:55 2009
(r192446)
@@ -34,6 +34,10 @@
 
 #defineATMEGA_MAX_DEVICES (USB_MIN_DEVICES + 1)
 
+#defineATMEGA_OTGTCON 0xF9
+#defineATMEGA_OTGTCON_VALUE(x) ((x) << 0)
+#defineATMEGA_OTGTCON_PAGE(x) ((x) << 5)
+
 #defineATMEGA_UEINT 0xF4
 #defineATMEGA_UEINT_MASK(n) (1 << (n)) /* endpoint interrupt mask */
 
@@ -136,8 +140,19 @@
 #defineATMEGA_UDCON_LSM (1 << 2)
 #defineATMEGA_UDCON_RSTCPU (1 << 3)
 
+#defineATMEGA_OTGINT 0xDF
+
+#defineATMEGA_OTGCON 0xDD
+#defineATMEGA_OTGCON_VBUSRQC (1 << 0)
+#defineATMEGA_OTGCON_VBUSREQ (1 << 1)
+#defineATMEGA_OTGCON_VBUSHWC (1 << 2)
+#defineATMEGA_OTGCON_SRPSEL (1 << 3)
+#defineATMEGA_OTGCON_SRPREQ (1 << 4)
+#defineATMEGA_OTGCON_HNPREQ (1 << 5)
+
 #defineATMEGA_USBINT 0xDA
 #defineATMEGA_USBINT_VBUSTI (1 << 0)   /* USB VBUS interrupt */
+#defineATMEGA_USBINT_IDI (1 << 1)  /* USB ID interrupt */
 
 #defineATMEGA_USBSTA 0xD9
 #defineATMEGA_USBSTA_VBUS 

svn commit: r192445 - head/sys/netnatm

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 17:00:16 2009
New Revision: 192445
URL: http://svn.freebsd.org/changeset/base/192445

Log:
  Replace d_thread_t * with struct thread *.

Modified:
  head/sys/netnatm/natm.c

Modified: head/sys/netnatm/natm.c
==
--- head/sys/netnatm/natm.c Wed May 20 16:58:53 2009(r192444)
+++ head/sys/netnatm/natm.c Wed May 20 17:00:16 2009(r192445)
@@ -100,24 +100,24 @@ struct mtxnatm_mtx;
 /*
  * User socket requests.
  */
-static int natm_usr_attach(struct socket *, int, d_thread_t *);
+static int natm_usr_attach(struct socket *, int, struct thread *);
 static voidnatm_usr_detach(struct socket *);
 static int natm_usr_connect(struct socket *, struct sockaddr *,
-   d_thread_t *);
+   struct thread *);
 static int natm_usr_disconnect(struct socket *);
 static int natm_usr_shutdown(struct socket *);
 static int natm_usr_send(struct socket *, int, struct mbuf *,
-   struct sockaddr *, struct mbuf *, d_thread_t *);
+   struct sockaddr *, struct mbuf *, struct thread *);
 static int natm_usr_peeraddr(struct socket *, struct sockaddr **);
 static int natm_usr_control(struct socket *, u_long, caddr_t,
-   struct ifnet *, d_thread_t *);
+   struct ifnet *, struct thread *);
 static voidnatm_usr_abort(struct socket *);
 static int natm_usr_bind(struct socket *, struct sockaddr *,
-   d_thread_t *);
+   struct thread *);
 static int natm_usr_sockaddr(struct socket *, struct sockaddr **);
 
 static int
-natm_usr_attach(struct socket *so, int proto, d_thread_t *p)
+natm_usr_attach(struct socket *so, int proto, struct thread *p)
 {
struct natmpcb *npcb;
int error = 0;
@@ -155,7 +155,7 @@ natm_usr_detach(struct socket *so)
 }
 
 static int
-natm_usr_connect(struct socket *so, struct sockaddr *nam, d_thread_t *p)
+natm_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *p)
 {
struct natmpcb *npcb;
struct sockaddr_natm *snatm;
@@ -271,7 +271,7 @@ natm_usr_shutdown(struct socket *so)
 
 static int
 natm_usr_send(struct socket *so, int flags, struct mbuf *m, 
-   struct sockaddr *nam, struct mbuf *control, d_thread_t *p)
+   struct sockaddr *nam, struct mbuf *control, struct thread *p)
 {
struct natmpcb *npcb;
struct atm_pseudohdr *aph;
@@ -332,7 +332,7 @@ natm_usr_peeraddr(struct socket *so, str
 
 static int
 natm_usr_control(struct socket *so, u_long cmd, caddr_t arg,
-   struct ifnet *ifp, d_thread_t *p)
+   struct ifnet *ifp, struct thread *p)
 {
struct natmpcb *npcb;
 
@@ -357,7 +357,7 @@ natm_usr_close(struct socket *so)
 }
 
 static int
-natm_usr_bind(struct socket *so, struct sockaddr *nam, d_thread_t *p)
+natm_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *p)
 {
 
return (EOPNOTSUPP);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192444 - head/sys/dev/usb/controller

2009-05-20 Thread Andrew Thompson
Author: thompsa
Date: Wed May 20 16:58:53 2009
New Revision: 192444
URL: http://svn.freebsd.org/changeset/base/192444

Log:
  The register shift is not needed on this controller.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/uss820dci_atmelarm.c

Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c
==
--- head/sys/dev/usb/controller/uss820dci_atmelarm.cWed May 20 16:58:16 
2009(r192443)
+++ head/sys/dev/usb/controller/uss820dci_atmelarm.cWed May 20 16:58:53 
2009(r192444)
@@ -152,9 +152,6 @@ uss820_atmelarm_attach(device_t dev)
sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
sc->sc_io_size = rman_get_size(sc->sc_io_res);
 
-   /* multiply all addresses by 4 */
-   sc->sc_reg_shift = 2;
-
rid = 0;
sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_SHAREABLE | RF_ACTIVE);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192443 - head/sys/kern

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 16:58:16 2009
New Revision: 192443
URL: http://svn.freebsd.org/changeset/base/192443

Log:
  We no longer need to use d_thread_t for portability here, switch to
  struct thread *.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cWed May 20 16:47:40 2009(r192442)
+++ head/sys/kern/subr_bus.cWed May 20 16:58:16 2009(r192443)
@@ -403,7 +403,7 @@ devinit(void)
 }
 
 static int
-devopen(struct cdev *dev, int oflags, int devtype, d_thread_t *td)
+devopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
 {
if (devsoftc.inuse)
return (EBUSY);
@@ -415,7 +415,7 @@ devopen(struct cdev *dev, int oflags, in
 }
 
 static int
-devclose(struct cdev *dev, int fflag, int devtype, d_thread_t *td)
+devclose(struct cdev *dev, int fflag, int devtype, struct thread *td)
 {
devsoftc.inuse = 0;
mtx_lock(&devsoftc.mtx);
@@ -464,7 +464,7 @@ devread(struct cdev *dev, struct uio *ui
 }
 
 static int
-devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
+devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread 
*td)
 {
switch (cmd) {
 
@@ -494,7 +494,7 @@ devioctl(struct cdev *dev, u_long cmd, c
 }
 
 static int
-devpoll(struct cdev *dev, int events, d_thread_t *td)
+devpoll(struct cdev *dev, int events, struct thread *td)
 {
int revents = 0;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192442 - head/sys/i386/acpica

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 16:47:40 2009
New Revision: 192442
URL: http://svn.freebsd.org/changeset/base/192442

Log:
  We don't need d_thread_t for cross-branch portability here anymore.
  Move do struct thread * instead.

Modified:
  head/sys/i386/acpica/acpi_machdep.c

Modified: head/sys/i386/acpica/acpi_machdep.c
==
--- head/sys/i386/acpica/acpi_machdep.c Wed May 20 16:29:22 2009
(r192441)
+++ head/sys/i386/acpica/acpi_machdep.c Wed May 20 16:47:40 2009
(r192442)
@@ -277,7 +277,7 @@ apm_create_clone(struct cdev *dev, struc
 }
 
 static int
-apmopen(struct cdev *dev, int flag, int fmt, d_thread_t *td)
+apmopen(struct cdev *dev, int flag, int fmt, struct thread *td)
 {
struct  acpi_softc *acpi_sc;
struct  apm_clone_data *clone;
@@ -294,7 +294,7 @@ apmopen(struct cdev *dev, int flag, int 
 }
 
 static int
-apmclose(struct cdev *dev, int flag, int fmt, d_thread_t *td)
+apmclose(struct cdev *dev, int flag, int fmt, struct thread *td)
 {
struct  apm_clone_data *clone;
struct  acpi_softc *acpi_sc;
@@ -318,7 +318,7 @@ apmclose(struct cdev *dev, int flag, int
 }
 
 static int
-apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
+apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread 
*td)
 {
int error;
struct  apm_clone_data *clone;
@@ -436,7 +436,7 @@ apmwrite(struct cdev *dev, struct uio *u
 }
 
 static int
-apmpoll(struct cdev *dev, int events, d_thread_t *td)
+apmpoll(struct cdev *dev, int events, struct thread *td)
 {
struct  apm_clone_data *clone;
int revents;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192441 - head/sys/i386/bios

2009-05-20 Thread Warner Losh
Author: imp
Date: Wed May 20 16:29:22 2009
New Revision: 192441
URL: http://svn.freebsd.org/changeset/base/192441

Log:
  Some minor style changes:
  o Convert K&R function definitions to ANSI
  o Eliminate spaces/tabs that should have been deleted as part of the de__P
efforts
  o Use struct thread * in preference to d_thread_t *.

Modified:
  head/sys/i386/bios/smapi.c

Modified: head/sys/i386/bios/smapi.c
==
--- head/sys/i386/bios/smapi.c  Wed May 20 16:11:22 2009(r192440)
+++ head/sys/i386/bios/smapi.c  Wed May 20 16:29:22 2009(r192441)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
 #defineADDR2HDR(addr)  ((struct smapi_bios_header 
*)BIOS_PADDRTOVADDR(addr))
 
 struct smapi_softc {
-   struct cdev *cdev;
+   struct cdev *   cdev;
device_tdev;
struct resource *   res;
int rid;
@@ -82,27 +82,22 @@ static struct cdevsw smapi_cdevsw = {
.d_flags =  D_MEM | D_NEEDGIANT,
 };
 
-static voidsmapi_identify  (driver_t *, device_t);
-static int smapi_probe (device_t);
-static int smapi_attach(device_t);
-static int smapi_detach(device_t);
-static int smapi_modevent  (module_t, int, void *);
+static voidsmapi_identify(driver_t *, device_t);
+static int smapi_probe(device_t);
+static int smapi_attach(device_t);
+static int smapi_detach(device_t);
+static int smapi_modevent(module_t, int, void *);
 
-static int smapi_header_cksum  (struct smapi_bios_header *);
+static int smapi_header_cksum(struct smapi_bios_header *);
 
-extern int smapi32 (struct smapi_bios_parameter *,
-struct smapi_bios_parameter *);
-extern int smapi32_new (u_long, u_short,
-struct smapi_bios_parameter *,
-struct smapi_bios_parameter *);
+extern int smapi32(struct smapi_bios_parameter *,
+   struct smapi_bios_parameter *);
+extern int smapi32_new(u_long, u_short,
+   struct smapi_bios_parameter *,
+   struct smapi_bios_parameter *);
 
 static int
-smapi_ioctl (dev, cmd, data, fflag, td)
-   struct cdev *dev;
-   u_long  cmd;
-   caddr_t data;
-   int fflag;
-   d_thread_t *td;
+smapi_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct 
thread *td)
 {
struct smapi_softc *sc;
int error;
@@ -283,10 +278,7 @@ smapi_detach (device_t dev)
 }
 
 static int
-smapi_modevent (mod, what, arg)
-module_tmod;
-int what;
-void *  arg;
+smapi_modevent (module_t mod, int what, void *arg)
 {
device_t *  devs;
int count;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192440 - in head/sys: amd64/amd64 i386/i386

2009-05-20 Thread John Baldwin
Author: jhb
Date: Wed May 20 16:11:22 2009
New Revision: 192440
URL: http://svn.freebsd.org/changeset/base/192440

Log:
  Don't bother reading the initial value of the machine check banks during
  startup on Pentium 4 CPUs.  This wasn't safe to do on APs during AP startup,
  was of limited value, and won't be used for future processors.

Modified:
  head/sys/amd64/amd64/mca.c
  head/sys/i386/i386/mca.c

Modified: head/sys/amd64/amd64/mca.c
==
--- head/sys/amd64/amd64/mca.c  Wed May 20 15:11:20 2009(r192439)
+++ head/sys/amd64/amd64/mca.c  Wed May 20 16:11:22 2009(r192440)
@@ -491,10 +491,6 @@ mca_init(void)
if (!(i == 0 && (cpu_id & 0xf00) == 0x600))
wrmsr(MSR_MC_CTL(i), 0xUL);
 
-   /* XXX: Better CPU test needed here. */
-   if ((cpu_id & 0xf00) == 0xf00)
-   mca_record_entry(i);
-
/* Clear all errors. */
wrmsr(MSR_MC_STATUS(i), 0);
}

Modified: head/sys/i386/i386/mca.c
==
--- head/sys/i386/i386/mca.cWed May 20 15:11:20 2009(r192439)
+++ head/sys/i386/i386/mca.cWed May 20 16:11:22 2009(r192440)
@@ -491,10 +491,6 @@ mca_init(void)
if (!(i == 0 && (cpu_id & 0xf00) == 0x600))
wrmsr(MSR_MC_CTL(i), 0xUL);
 
-   /* XXX: Better CPU test needed here. */
-   if ((cpu_id & 0xf00) == 0xf00)
-   mca_record_entry(i);
-
/* Clear all errors. */
wrmsr(MSR_MC_STATUS(i), 0);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192256 - head/sys/fs/nfsserver

2009-05-20 Thread Rick Macklem



On Wed, 20 May 2009, Doug Rabson wrote:

Thinking about this for a few more minutes, I think you probably want to 
allocate a sysid for each client and then for each lock_owner of that client 
allocate a 'pid'. The value doesn't have to be a process identifier but it 
does have to allow different lock owners from the same client to be 
distinguished.



Why do they need to be distinguished? The nfsv4 state subsystem handles
all conflicts between them, so they are just "nfsv4 locks".

An nfsv4 lockowner is a ClientID + up to 1024 bytes of opaque name and it
might not persist in the server beyond the point where no locks are
held and the associated OpenOwner no longer has any Opens. After this,
the same lockowner could be "re-incarnated" (ie. create a new state
data structure in the server with the same ClientID + up to 1024 bytes)
when the client chooses to do more locking on it. If a pid is generated
sequentially, this second re-incarnation would end up with a different
pid although it is the same lockowner. (To ensure this doesn't happen,
the server would have to hold onto the lockowner state structure "forever"
and that obviously isn't practical.) Or a pid could be a 32bit checksum
on the ClientID + up to 1024 bytes instead of sequential assignment. In 
that case the re-incarnation would get the same pid, but it wouldn't be

guaranteed to be unique across all different lockowners.

As such, the most an assigned pid could be is a "hint" that the lockowner
is different/same. Is there some benefit to this over "held by nfsv4",
which is what using one  tuple gives you?

You probably also want to record locks in the local lock manager on the 
client. In NLM, I use a different range of sysids starting at 0x10 for 
this. This lets you do lock recovery after a server restart by asking the 
local lock manager to enumerate locks for the right sysid.



The lock state all lives in the nfsv4 client (some associated with a
delegation and assigned locally, the rest tied to an associated Open) with 
the "up to 1024 byte" owner names generated by the client, etc. 
Maintaining the rather complex relationship between Opens (with 
Openowners) and their associated locks is probably the "most interesting"

part of implementing nfsv4. Then you must recover the locks, maintaining
that relationship. (The relationship is established via the 
open_to_lock_owner case of the Lock Op.) The recovery code uses client 
side data structures that reflect the open/lock relationship. The lock

manager wouldn't be able to provide that information and I think there
would be little gained by trying to make the major modifications that
would be required so that it could do so.


On 20 May 2009, at 09:26, Doug Rabson wrote:

This is incorrect. A sysid of zero is reserved for local locks on local 
filesystems. You need to allocate a sysid when the client is created and it 
needs to not conflict with the sysids used by NLM. I suggest adding a 
function to nlm_prot_impl.c to return the next available sysid (and bump 
the counter).


Ok, when I looked at the code, l_sysid only seemed to be used when 
F_REMOTE is set, so I didn't realize that l_sysid == 0 was reserved

for local locks. I'll look at what you suggest and send you an nlm
patch for review.

rick

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192419 - head/sys/dev/usb/wlan

2009-05-20 Thread John Baldwin
On Tuesday 19 May 2009 11:49:17 pm Weongyo Jeong wrote:
> Author: weongyo
> Date: Wed May 20 03:49:16 2009
> New Revision: 192419
> URL: http://svn.freebsd.org/changeset/base/192419
> 
> Log:
>   try to unsetup USB xfers before calling ieee80211_ifdetach() to fix a
>   bug referencing a destroyed lock within TX callbacks during device
>   detach.
>   
>   Submitted by:   hps (original version)
>   Tested by:  Lucius Windschuh 
> 
> Modified:
>   head/sys/dev/usb/wlan/if_uath.c
>   head/sys/dev/usb/wlan/if_upgt.c
> 
> Modified: head/sys/dev/usb/wlan/if_uath.c
> 
==
> --- head/sys/dev/usb/wlan/if_uath.c   Wed May 20 03:33:27 2009
> (r192418)
> +++ head/sys/dev/usb/wlan/if_uath.c   Wed May 20 03:49:16 2009
> (r192419)
> @@ -517,12 +517,12 @@ uath_detach(device_t dev)
>  
>   sc->sc_flags |= UATH_FLAG_INVALID;
>   uath_stop(ifp);
> - ieee80211_ifdetach(ic);
>  
>   callout_drain(&sc->stat_ch);
>   callout_drain(&sc->watchdog_ch);
>  
>   usb2_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS);
> + ieee80211_ifdetach(ic);
>  
>   /* free buffers */
>   UATH_LOCK(sc);

This sequence looks very wrong.  You should not be stopping the interface or 
draining anything until after you have detached the interface.  Otherwise you 
have a race condition where a user 'ifconfig up' request may be processed 
after usb2_transfer_unsetup().  The proper order of operations should be 
something like:

bpfdetach()
ieee80211_ifdetach()

UATH_LOCK();
uath_stop();// calls callout_stop, clears IFF_DRV_RUNNING
UATH_UNLOCK();

callout_drain();
usb2_transfer_unsetup();

Note that one thing this requires you to do is explicitly check in various 
callbacks to see if IFF_DRV_RUNNING is not set at the start of the callback 
(or immediately after acquiring your driver's lock if you drop it (e.g. to 
call if_input()).  This is not needed for callout routines if you use 
callout_init_mtx() as in that case the callout code can effectively do that 
check for you as a result of the callout_stop().  However, any other 
callbacks from a framework that do not use the driver's lock directly will 
need to explicitly check IFF_DRV_RUNNING, and it sounds like that may be the 
correct fix here for your USB TX callbacks (either that or you need to 
somehow not destroy the lock until after usb_transfer_unsetup() has 
returned).

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192373 - head/sys/compat/linux

2009-05-20 Thread John Baldwin
On Tuesday 19 May 2009 4:19:56 pm Ben Kaduk wrote:
> On Tue, May 19, 2009 at 5:10 AM, Dmitry Chagin  wrote:
> > Author: dchagin
> > Date: Tue May 19 09:10:53 2009
> > New Revision: 192373
> > URL: http://svn.freebsd.org/changeset/base/192373
> >
> > Log:
> >  Validate user-supplied arguments values.
> >  Args argument is a pointer to the structure located in user space in
> >  which the socketcall arguments are packed. The structure must be
> >  copied to the kernel instead of direct dereferencing.
> >
> >  Approved by:  kib (mentor)
> >  MFC after:    1 week
> >
> > Modified:
> >  head/sys/compat/linux/linux_socket.c
> >
> > Modified: head/sys/compat/linux/linux_socket.c
> > 
==
> > --- head/sys/compat/linux/linux_socket.c        Tue May 19 05:36:10 
2009        (r192372)
> > +++ head/sys/compat/linux/linux_socket.c        Tue May 19 09:10:53 
2009        (r192373)
> > @@ -1467,11 +1467,38 @@ linux_getsockopt(struct thread *td, stru
> >        return (error);
> >  }
> >
> > +/* Argument list sizes for linux_socketcall */
> > +
> > +#define LINUX_AL(x) ((x) * sizeof(l_ulong))
> > +
> > +static const unsigned char lxs_args[] = {
> > +       LINUX_AL(0) /* unused*/,        LINUX_AL(3) /* socket */,
> > +       LINUX_AL(3) /* bind */,         LINUX_AL(3) /* connect */,
> > +       LINUX_AL(2) /* listen */,       LINUX_AL(3) /* accept */,
> > +       LINUX_AL(3) /* getsockname */,  LINUX_AL(3) /* getpeername */,
> > +       LINUX_AL(4) /* socketpair */,   LINUX_AL(4) /* send */,
> > +       LINUX_AL(4) /* recv */,         LINUX_AL(6) /* sendto */,
> > +       LINUX_AL(6) /* recvfrom */,     LINUX_AL(2) /* shutdown */,
> > +       LINUX_AL(5) /* setsockopt */,   LINUX_AL(5) /* getsockopt */,
> > +       LINUX_AL(3) /* sendmsg */,      LINUX_AL(3) /* recvmsg */
> > +};
> > +
> > +#define        LINUX_AL_SIZE   sizeof(lxs_args) / sizeof(lxs_args[0]) - 1
> > +
> >  int
> >  linux_socketcall(struct thread *td, struct linux_socketcall_args *args)
> >  {
> > -       void *arg = (void *)(intptr_t)args->args;
> > +       l_ulong a[6];
> > +       void *arg;
> > +       int error;
> > +
> > +       if (args->what < LINUX_SOCKET || args->what > LINUX_AL_SIZE)
> > +               return (EINVAL);
> > +       error = copyin(PTRIN(args->args), a, lxs_args[args->what]);
> > +       if (error)
> > +               return (error);
> >
> > +       arg = a;
> >        switch (args->what) {
> >        case LINUX_SOCKET:
> >                return (linux_socket(td, arg));
> 
> 
> What factors go into deciding to do bounds-checking before the copyin versus
> after the copyin?  Naively, I would be worried about the userland data 
changing
> out from under the kernel, but I'm not terribly familiar with this area.

Well, the 'args->what' can't change out from under us as we only read it once.  
If a user app does change the memory args->args points to then it will merely 
get undefined userland behavior (so it may get an unexpected error because we 
interpret the arg structure based on the value of 'args->what' at the time of 
the initial copyin of the direct args from userland).  This case is very 
similar to an ioctl that passes a structure with a pointer to another 
structure.  The top-level structure (just as the top-level system call args) 
is only read once, so there is no chance for userland to change it after the 
kernel has already done validation (as there is with things like systrace 
(and why systrace is fundamentally broken, but that's Robert's line)).  
Similar guarantees can be made when handling sub-structures by only reading 
them once so that all the various access checks and operations are performed 
on the same data.  In this case the args->args data is only being read once, 
so it is fine.  ioctl handlers should also only read nested structures once 
in their entirety before using their contents.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192438 - vendor/tzcode/tzcode2009e

2009-05-20 Thread Edwin Groothuis
Author: edwin
Date: Wed May 20 12:26:36 2009
New Revision: 192438
URL: http://svn.freebsd.org/changeset/base/192438

Log:
  Tag of tzcode2009e.

Added:
  vendor/tzcode/tzcode2009e/
 - copied from r192437, vendor/tzcode/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192437 - in vendor/tzcode/dist: libc/stdtime unused zic

2009-05-20 Thread Edwin Groothuis
Author: edwin
Date: Wed May 20 12:24:39 2009
New Revision: 192437
URL: http://svn.freebsd.org/changeset/base/192437

Log:
  Vendor import of tzcode2009e.
  Obtained from: ftp://elsie.nci.nih.gov/pub/

Added:
  vendor/tzcode/dist/libc/stdtime/time2posix.3
  vendor/tzcode/dist/libc/stdtime/tzfile.5
  vendor/tzcode/dist/unused/
  vendor/tzcode/dist/unused/Makefile
  vendor/tzcode/dist/unused/checktab.awk
  vendor/tzcode/dist/unused/date.1
  vendor/tzcode/dist/unused/date.1.txt
  vendor/tzcode/dist/unused/date.c
  vendor/tzcode/dist/unused/itca.jpg   (contents, props changed)
  vendor/tzcode/dist/unused/newctime.3
  vendor/tzcode/dist/unused/newctime.3.txt
  vendor/tzcode/dist/unused/newstrftime.3
  vendor/tzcode/dist/unused/newstrftime.3.txt
  vendor/tzcode/dist/unused/newtzset.3
  vendor/tzcode/dist/unused/newtzset.3.txt
  vendor/tzcode/dist/unused/time2posix.3.txt
  vendor/tzcode/dist/unused/tz-art.htm
 - copied, changed from r192431, vendor/tzcode/dist/zic/tz-art.htm
  vendor/tzcode/dist/unused/tz-link.htm
 - copied, changed from r192431, vendor/tzcode/dist/zic/tz-link.htm
  vendor/tzcode/dist/unused/tzfile.5.txt
  vendor/tzcode/dist/unused/tzselect.8
  vendor/tzcode/dist/unused/tzselect.8.txt
  vendor/tzcode/dist/unused/tzselect.ksh
  vendor/tzcode/dist/unused/usno1988
  vendor/tzcode/dist/unused/usno1989
  vendor/tzcode/dist/unused/usno1989a
  vendor/tzcode/dist/unused/usno1995
  vendor/tzcode/dist/unused/usno1997
  vendor/tzcode/dist/unused/usno1998
  vendor/tzcode/dist/unused/workman.sh
  vendor/tzcode/dist/unused/zdump.8.txt
  vendor/tzcode/dist/unused/zic.8.txt
  vendor/tzcode/dist/unused/zoneinfo2tdf.pl   (contents, props changed)
Deleted:
  vendor/tzcode/dist/zic/Music
  vendor/tzcode/dist/zic/tz-art.htm
  vendor/tzcode/dist/zic/tz-link.htm
Modified:
  vendor/tzcode/dist/libc/stdtime/asctime.c
  vendor/tzcode/dist/libc/stdtime/difftime.c
  vendor/tzcode/dist/libc/stdtime/localtime.c
  vendor/tzcode/dist/libc/stdtime/private.h
  vendor/tzcode/dist/libc/stdtime/strftime.c
  vendor/tzcode/dist/libc/stdtime/tzfile.h
  vendor/tzcode/dist/zic/README
  vendor/tzcode/dist/zic/Theory
  vendor/tzcode/dist/zic/ialloc.c
  vendor/tzcode/dist/zic/private.h
  vendor/tzcode/dist/zic/scheck.c
  vendor/tzcode/dist/zic/zdump.8
  vendor/tzcode/dist/zic/zdump.c
  vendor/tzcode/dist/zic/zic.8
  vendor/tzcode/dist/zic/zic.c

Modified: vendor/tzcode/dist/libc/stdtime/asctime.c
==
--- vendor/tzcode/dist/libc/stdtime/asctime.c   Wed May 20 10:07:20 2009
(r192436)
+++ vendor/tzcode/dist/libc/stdtime/asctime.c   Wed May 20 12:24:39 2009
(r192437)
@@ -1,11 +1,17 @@
 /*
 ** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_ol...@nih.gov).
+** 1996-06-05 by Arthur David Olson.
+*/
+
+/*
+** Avoid the temptation to punt entirely to strftime;
+** the output of strftime is supposed to be locale specific
+** whereas the output of asctime is supposed to be constant.
 */
 
 #ifndef lint
 #ifndef NOID
-static charelsieid[] = "@(#)asctime.c  7.9";
+static charelsieid[] = "@(#)asctime.c  8.2";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -15,7 +21,57 @@ static char  elsieid[] = "@(#)asctime.c  7
 #include "tzfile.h"
 
 /*
-** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, Second Edition, 1996-07-12.
+** Some systems only handle "%.2d"; others only handle "%02d";
+** "%02.2d" makes (most) everybody happy.
+** At least some versions of gcc warn about the %02.2d;
+** we conditionalize below to avoid the warning.
+*/
+/*
+** All years associated with 32-bit time_t values are exactly four digits long;
+** some years associated with 64-bit time_t values are not.
+** Vintage programs are coded for years that are always four digits long
+** and may assume that the newline always lands in the same place.
+** For years that are less than four digits, we pad the output with
+** leading zeroes to get the newline in the traditional place.
+** The -4 ensures that we get four characters of output even if
+** we call a strftime variant that produces fewer characters for some years.
+** The ISO C 1999 and POSIX 1003.1-2004 standards prohibit padding the year,
+** but many implementations pad anyway; most likely the standards are buggy.
+*/
+#ifdef __GNUC__
+#define ASCTIME_FMT"%.3s %.3s%3d %2.2d:%2.2d:%2.2d %-4s\n"
+#else /* !defined __GNUC__ */
+#define ASCTIME_FMT"%.3s %.3s%3d %02.2d:%02.2d:%02.2d %-4s\n"
+#endif /* !defined __GNUC__ */
+/*
+** For years that are more than four digits we put extra spaces before the year
+** so that code trying to overwrite the newline won't end up overwriting
+** a digit within a year and truncating the year (operating on the assumption
+** that no output is better than wrong output).
+*/
+#ifdef __GNUC__
+#define ASCTIME_FMT_B  "%.3s %.3s%3d %2.2d:%2.2d:%2.2d %s\n"
+#else /* !defined __GNUC__ */
+#define ASCTIME_FMT_B  "%.

svn commit: r192436 - stable/7/share/man/man9

2009-05-20 Thread Christian Brueffer
Author: brueffer
Date: Wed May 20 10:07:20 2009
New Revision: 192436
URL: http://svn.freebsd.org/changeset/base/192436

Log:
  MFC: r192265
  
  Document sbuf_new_auto().
  
  While here, add a missing `-' in phk's name.

Modified:
  stable/7/share/man/man9/   (props changed)
  stable/7/share/man/man9/sbuf.9

Modified: stable/7/share/man/man9/sbuf.9
==
--- stable/7/share/man/man9/sbuf.9  Wed May 20 10:05:44 2009
(r192435)
+++ stable/7/share/man/man9/sbuf.9  Wed May 20 10:07:20 2009
(r192436)
@@ -1,5 +1,5 @@
 .\"-
-.\" Copyright (c) 2000 Poul Henning Kamp and Dag-Erling Co�dan Sm�rgrav
+.\" Copyright (c) 2000 Poul-Henning Kamp and Dag-Erling Co�dan Sm�rgrav
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -25,12 +25,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 9, 2004
+.Dd May 17, 2009
 .Dt SBUF 9
 .Os
 .Sh NAME
 .Nm sbuf ,
 .Nm sbuf_new ,
+.Nm sbuf_new_auto ,
 .Nm sbuf_clear ,
 .Nm sbuf_setpos ,
 .Nm sbuf_bcat ,
@@ -55,6 +56,8 @@
 .In sys/sbuf.h
 .Ft struct sbuf *
 .Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags"
+.Ft struct sbuf *
+.Fn sbuf_new_auto
 .Ft void
 .Fn sbuf_clear "struct sbuf *s"
 .Ft int
@@ -148,6 +151,19 @@ The result of accessing that array direc
 sbuf is undefined.
 .Pp
 The
+.Fn sbuf_new_auto
+function is a shortcut for creating a completely dynamic
+.Nm .
+It is the equivalent of calling
+.Fn sbuf_new
+with values
+.Dv NULL ,
+.Dv NULL ,
+.Dv 0 ,
+and
+.Dv SBUF_AUTOEXTEND .
+.Pp
+The
 .Fn sbuf_delete
 function clears the
 .Fa sbuf
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192435 - stable/7/share/man/man4

2009-05-20 Thread Christian Brueffer
Author: brueffer
Date: Wed May 20 10:05:44 2009
New Revision: 192435
URL: http://svn.freebsd.org/changeset/base/192435

Log:
  MFC: r192228
  
  Drop clause 3 of the license as per rev. 1.35 from OpenBSD.
  
  Obtained from:OpenBSD

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/hifn.4
  stable/7/share/man/man4/igb.4   (props changed)

Modified: stable/7/share/man/man4/hifn.4
==
--- stable/7/share/man/man4/hifn.4  Wed May 20 10:04:17 2009
(r192434)
+++ stable/7/share/man/man4/hifn.4  Wed May 20 10:05:44 2009
(r192435)
@@ -11,8 +11,6 @@
 .\" 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.
-.\" 3. The name of the author may not be used to endorse or promote products
-.\"derived from this software without specific prior written permission.
 .\"
 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192434 - stable/7/share/man/man4

2009-05-20 Thread Christian Brueffer
Author: brueffer
Date: Wed May 20 10:04:17 2009
New Revision: 192434
URL: http://svn.freebsd.org/changeset/base/192434

Log:
  MFC: r192220
  
  Sync up to rev. 1.25 from OpenBSD:
  
  1.19: nop
  1.20: nop
  1.21: nop
  1.22: typo fixed
  1.23: license clauses 3 and 4 nuked
  1.24: nop
  1.25: Sun Crypto Accelerator 1000 has a 5821 chip on it
  
  Obtained from:OpenBSD

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/igb.4   (props changed)
  stable/7/share/man/man4/ubsec.4

Modified: stable/7/share/man/man4/ubsec.4
==
--- stable/7/share/man/man4/ubsec.4 Wed May 20 09:44:32 2009
(r192433)
+++ stable/7/share/man/man4/ubsec.4 Wed May 20 10:04:17 2009
(r192434)
@@ -1,4 +1,4 @@
-.\"$OpenBSD: ubsec.4,v 1.18 2002/09/26 07:55:41 miod Exp $
+.\"$OpenBSD: ubsec.4,v 1.25 2003/08/12 19:42:46 jason Exp $
 .\"
 .\" Copyright (c) 2000 Jason L. Wright (ja...@thought.net)
 .\" All rights reserved.
@@ -11,11 +11,6 @@
 .\" 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.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"must display the following acknowledgement:
-.\"This product includes software developed by Jason L. Wright
-.\" 4. The name of the author may not be used to endorse or promote products
-.\"derived from this software without specific prior written permission.
 .\"
 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -31,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 1, 2006
+.Dd May 16, 2009
 .Dt UBSEC 4
 .Os
 .Sh NAME
@@ -84,7 +79,7 @@ driver supports cards containing any of 
 .It Bluesteel 5501
 The original chipset, no longer made.
 This extremely rare unit
-was not very fast, lacked a RNG, and had a number of other bugs.
+was not very fast, lacked an RNG, and had a number of other bugs.
 .It Bluesteel 5601
 A faster and fixed version of the original, with a random number
 unit and large number engine added.
@@ -98,6 +93,7 @@ Faster version of Bluesteel 5601.
 64 bit version of the chip, and significantly more advanced.
 .It Broadcom BCM5821
 Faster version of the BCM5820.
+This is the chip found on the Sun Crypto Accelerator 1000.
 .It Broadcom BCM5822
 Faster version of the BCM5820.
 .It Broadcom BCM5823
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192433 - head/sys/dev/ata/chipsets

2009-05-20 Thread Alexander Motin
Author: mav
Date: Wed May 20 09:44:32 2009
New Revision: 192433
URL: http://svn.freebsd.org/changeset/base/192433

Log:
  Fix NULL dereference on Promise SX4 controllers, while executing commands
  that do not require data transfer (FLUSHCACHE).
  
  Tested by:Magnus Kling 
  MFC after:1 week

Modified:
  head/sys/dev/ata/chipsets/ata-promise.c

Modified: head/sys/dev/ata/chipsets/ata-promise.c
==
--- head/sys/dev/ata/chipsets/ata-promise.c Wed May 20 08:32:25 2009
(r192432)
+++ head/sys/dev/ata/chipsets/ata-promise.c Wed May 20 09:44:32 2009
(r192433)
@@ -1054,7 +1054,7 @@ ata_promise_sx4_command(struct ata_reque
 device_t gparent = GRANDPARENT(request->dev);
 struct ata_pci_controller *ctlr = device_get_softc(gparent);
 struct ata_channel *ch = device_get_softc(request->parent);
-struct ata_dma_prdentry *prd = request->dma->sg;
+struct ata_dma_prdentry *prd;
 caddr_t window = rman_get_virtual(ctlr->r_res1);
 u_int32_t *wordp;
 int i, idx, length = 0;
@@ -1098,6 +1098,7 @@ ata_promise_sx4_command(struct ata_reque
 case ATA_READ_DMA48:
 case ATA_WRITE_DMA:
 case ATA_WRITE_DMA48:
+   prd = request->dma->sg;
wordp = (u_int32_t *)
(window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HSG_OFFSET);
i = idx = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192256 - head/sys/fs/nfsserver

2009-05-20 Thread Doug Rabson
Thinking about this for a few more minutes, I think you probably want  
to allocate a sysid for each client and then for each lock_owner of  
that client allocate a 'pid'. The value doesn't have to be a process  
identifier but it does have to allow different lock owners from the  
same client to be distinguished.


You probably also want to record locks in the local lock manager on  
the client. In NLM, I use a different range of sysids starting at  
0x10 for this. This lets you do lock recovery after a server  
restart by asking the local lock manager to enumerate locks for the  
right sysid.



On 20 May 2009, at 09:26, Doug Rabson wrote:

This is incorrect. A sysid of zero is reserved for local locks on  
local filesystems. You need to allocate a sysid when the client is  
created and it needs to not conflict with the sysids used by NLM. I  
suggest adding a function to nlm_prot_impl.c to return the next  
available sysid (and bump the counter).


On 17 May 2009, at 20:33, Rick Macklem wrote:


Author: rmacklem
Date: Sun May 17 19:33:48 2009
New Revision: 192256
URL: http://svn.freebsd.org/changeset/base/192256

Log:
Fix the acquisition of local locks via VOP_ADVLOCK() by the
experimental nfsv4 server. It was setting the a_id argument
to a fixed value, but that wasn't sufficient for FreeBSD8.
Instead, set l_pid and l_sysid to 0 plus set the F_REMOTE
flag to indicate that these fields are used to check for
same lock owner. Since, for NFSv4, a lockowner is a ClientID plus
an up to 1024byte name, it can't be put in l_sysid easily.
I also renamed the p variable to td, since it's a thread ptr.

Approved by:kib (mentor)

Modified:
head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
= 
= 
= 
= 
= 
= 
= 
= 
= 
=
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Sun May 17 17:54:01 2009	 
(r192255)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Sun May 17 19:33:48 2009	 
(r192256)

@@ -2749,14 +2749,13 @@ nfsvno_getvp(fhandle_t *fhp)
return (vp);
}

-static int id_for_advlock;
/*
* Check to see it a byte range lock held by a process running
* locally on the server conflicts with the new lock.
*/
int
nfsvno_localconflict(struct vnode *vp, int ftype, u_int64_t first,
-u_int64_t end, struct nfslockconflict *cfp, struct thread *p)
+u_int64_t end, struct nfslockconflict *cfp, struct thread *td)
{
int error;
struct flock fl;
@@ -2771,11 +2770,20 @@ nfsvno_localconflict(struct vnode *vp, i
else
fl.l_len = (off_t)(end - first);
/*
-	 * FreeBSD8 doesn't like 0, so I'll use the address of  
id_for_advlock.

+* For FreeBSD8, the l_pid and l_sysid must be set to the same
+* values for all calls, so that all locks will be held by the
+* nfsd server. (The nfsd server handles conflicts between the
+* various clients.)
+	 * Since an NFSv4 lockowner is a ClientID plus an array of up to  
1024

+* bytes, so it can't be put in l_sysid.
 */
-   NFSVOPUNLOCK(vp, 0, p);
-   error = VOP_ADVLOCK(vp, &id_for_advlock, F_GETLK, &fl, F_POSIX);
-   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p);
+   fl.l_pid = (pid_t)0;
+   fl.l_sysid = 0;
+
+   NFSVOPUNLOCK(vp, 0, td);
+   error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_GETLK, &fl,
+   (F_POSIX | F_REMOTE));
+   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (error)
return (error);
if (fl.l_type == F_UNLCK)
@@ -2804,7 +2812,7 @@ nfsvno_localconflict(struct vnode *vp, i
*/
int
nfsvno_advlock(struct vnode *vp, int ftype, u_int64_t first,
-u_int64_t end, struct thread *p)
+u_int64_t end, struct thread *td)
{
int error;
struct flock fl;
@@ -2822,11 +2830,20 @@ nfsvno_advlock(struct vnode *vp, int fty
fl.l_len = (off_t)tlen;
}
/*
-	 * FreeBSD8 doesn't like 0, so I'll use the address of  
id_for_advlock.

+* For FreeBSD8, the l_pid and l_sysid must be set to the same
+* values for all calls, so that all locks will be held by the
+* nfsd server. (The nfsd server handles conflicts between the
+* various clients.)
+	 * Since an NFSv4 lockowner is a ClientID plus an array of up to  
1024

+* bytes, so it can't be put in l_sysid.
 */
-   NFSVOPUNLOCK(vp, 0, p);
-   error = VOP_ADVLOCK(vp, &id_for_advlock, F_SETLK, &fl, F_POSIX);
-   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p);
+   fl.l_pid = (pid_t)0;
+   fl.l_sysid = 0;
+
+   NFSVOPUNLOCK(vp, 0, td);
+   error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,
+   (F_POSIX | F_REMOTE));
+   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td);
return (error);
}





___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "

svn commit: r192432 - head/usr.sbin/pwd_mkdb

2009-05-20 Thread Brian Somers
Author: brian
Date: Wed May 20 08:32:25 2009
New Revision: 192432
URL: http://svn.freebsd.org/changeset/base/192432

Log:
  Verify that the username length is smaller than MAXLOGNAME when
  asked to verify a passwd file (pwd_mkdb -C).
  
  Entries with oversized usernames are still permitted when building
  the passwd database.
  
  When entries are >= MAXLOGNAME in length, they are correctly stored
  in passwd, pwd.db and spwd.db but are only correctly retrieved by
  getpwent*() and getpwuid*().  getpwnam*() truncates to MAXLOGNAME - 1
  when reading from a file (breaking at least sh, tcsh and bash)
  and utilities such as su(1) check, complain and fail if the
  passed name is >= MAXLOGNAME in length.
  
  MFC after:3 weeks

Modified:
  head/usr.sbin/pwd_mkdb/pwd_mkdb.c

Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c
==
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Wed May 20 07:31:11 2009
(r192431)
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Wed May 20 08:32:25 2009
(r192432)
@@ -204,7 +204,11 @@ main(int argc, char *argv[])
 
/* check only if password database is valid */
if (Cflag) {
-   for (cnt = 1; scan(fp, &pwd); ++cnt);
+   while (scan(fp, &pwd))
+   if (!is_comment && strlen(pwd.pw_name) >= MAXLOGNAME) {
+   warnx("%s: username too long", pwd.pw_name);
+   exit(1);
+   }
exit(0);
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r192256 - head/sys/fs/nfsserver

2009-05-20 Thread Doug Rabson
This is incorrect. A sysid of zero is reserved for local locks on  
local filesystems. You need to allocate a sysid when the client is  
created and it needs to not conflict with the sysids used by NLM. I  
suggest adding a function to nlm_prot_impl.c to return the next  
available sysid (and bump the counter).


On 17 May 2009, at 20:33, Rick Macklem wrote:


Author: rmacklem
Date: Sun May 17 19:33:48 2009
New Revision: 192256
URL: http://svn.freebsd.org/changeset/base/192256

Log:
 Fix the acquisition of local locks via VOP_ADVLOCK() by the
 experimental nfsv4 server. It was setting the a_id argument
 to a fixed value, but that wasn't sufficient for FreeBSD8.
 Instead, set l_pid and l_sysid to 0 plus set the F_REMOTE
 flag to indicate that these fields are used to check for
 same lock owner. Since, for NFSv4, a lockowner is a ClientID plus
 an up to 1024byte name, it can't be put in l_sysid easily.
 I also renamed the p variable to td, since it's a thread ptr.

 Approved by:   kib (mentor)

Modified:
 head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
= 
= 
= 
= 
= 
= 
= 
= 
==
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Sun May 17 17:54:01 2009	 
(r192255)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Sun May 17 19:33:48 2009	 
(r192256)

@@ -2749,14 +2749,13 @@ nfsvno_getvp(fhandle_t *fhp)
return (vp);
}

-static int id_for_advlock;
/*
 * Check to see it a byte range lock held by a process running
 * locally on the server conflicts with the new lock.
 */
int
nfsvno_localconflict(struct vnode *vp, int ftype, u_int64_t first,
-u_int64_t end, struct nfslockconflict *cfp, struct thread *p)
+u_int64_t end, struct nfslockconflict *cfp, struct thread *td)
{
int error;
struct flock fl;
@@ -2771,11 +2770,20 @@ nfsvno_localconflict(struct vnode *vp, i
else
fl.l_len = (off_t)(end - first);
/*
-	 * FreeBSD8 doesn't like 0, so I'll use the address of  
id_for_advlock.

+* For FreeBSD8, the l_pid and l_sysid must be set to the same
+* values for all calls, so that all locks will be held by the
+* nfsd server. (The nfsd server handles conflicts between the
+* various clients.)
+	 * Since an NFSv4 lockowner is a ClientID plus an array of up to  
1024

+* bytes, so it can't be put in l_sysid.
 */
-   NFSVOPUNLOCK(vp, 0, p);
-   error = VOP_ADVLOCK(vp, &id_for_advlock, F_GETLK, &fl, F_POSIX);
-   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p);
+   fl.l_pid = (pid_t)0;
+   fl.l_sysid = 0;
+
+   NFSVOPUNLOCK(vp, 0, td);
+   error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_GETLK, &fl,
+   (F_POSIX | F_REMOTE));
+   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (error)
return (error);
if (fl.l_type == F_UNLCK)
@@ -2804,7 +2812,7 @@ nfsvno_localconflict(struct vnode *vp, i
 */
int
nfsvno_advlock(struct vnode *vp, int ftype, u_int64_t first,
-u_int64_t end, struct thread *p)
+u_int64_t end, struct thread *td)
{
int error;
struct flock fl;
@@ -2822,11 +2830,20 @@ nfsvno_advlock(struct vnode *vp, int fty
fl.l_len = (off_t)tlen;
}
/*
-	 * FreeBSD8 doesn't like 0, so I'll use the address of  
id_for_advlock.

+* For FreeBSD8, the l_pid and l_sysid must be set to the same
+* values for all calls, so that all locks will be held by the
+* nfsd server. (The nfsd server handles conflicts between the
+* various clients.)
+	 * Since an NFSv4 lockowner is a ClientID plus an array of up to  
1024

+* bytes, so it can't be put in l_sysid.
 */
-   NFSVOPUNLOCK(vp, 0, p);
-   error = VOP_ADVLOCK(vp, &id_for_advlock, F_SETLK, &fl, F_POSIX);
-   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p);
+   fl.l_pid = (pid_t)0;
+   fl.l_sysid = 0;
+
+   NFSVOPUNLOCK(vp, 0, td);
+   error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,
+   (F_POSIX | F_REMOTE));
+   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td);
return (error);
}



___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"