From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 00:13:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F0CC1065670; Sun, 13 Dec 2009 00:13:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8D988FC13; Sun, 13 Dec 2009 00:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD0DLOQ068109; Sun, 13 Dec 2009 00:13:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD0DL9F068105; Sun, 13 Dec 2009 00:13:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912130013.nBD0DL9F068105@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 00:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200459 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 00:13:22 -0000 Author: marius Date: Sun Dec 13 00:13:21 2009 New Revision: 200459 URL: http://svn.freebsd.org/changeset/base/200459 Log: Unbreak the ata_atapi() usage. Since r200171 the mode setting functions get a ata_device type device passed instead of a ata_channel one, thus ata_atapi() has to be adjusted accordingly. Reviewed by: mav MFC after: 3 days Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/chipsets/ata-ite.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Dec 12 23:57:19 2009 (r200458) +++ head/sys/dev/ata/ata-all.c Sun Dec 13 00:13:21 2009 (r200459) @@ -1150,12 +1150,11 @@ ata_satarev2str(int rev) } int -ata_atapi(device_t dev) +ata_atapi(device_t dev, int target) { - struct ata_channel *ch = device_get_softc(device_get_parent(dev)); - struct ata_device *atadev = device_get_softc(dev); + struct ata_channel *ch = device_get_softc(dev); - return (ch->devices & (ATA_ATAPI_MASTER << atadev->unit)); + return (ch->devices & (ATA_ATAPI_MASTER << target)); } int Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sat Dec 12 23:57:19 2009 (r200458) +++ head/sys/dev/ata/ata-all.h Sun Dec 13 00:13:21 2009 (r200459) @@ -622,7 +622,7 @@ void ata_udelay(int interval); char *ata_unit2str(struct ata_device *atadev); const char *ata_mode2str(int mode); const char *ata_satarev2str(int rev); -int ata_atapi(device_t dev); +int ata_atapi(device_t dev, int target); int ata_pmode(struct ata_params *ap); int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Sat Dec 12 23:57:19 2009 (r200458) +++ head/sys/dev/ata/chipsets/ata-ite.c Sun Dec 13 00:13:21 2009 (r200459) @@ -212,12 +212,12 @@ ata_ite_8213_setmode(device_t dev, int t reg40 |= 0x4033; /* Set PIO/WDMA timings. */ if (target == 0) { - reg40 |= (ata_atapi(dev) ? 0x04 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x04 : 0x00); mask40 = 0x3300; new40 = timings[ata_mode2idx(piomode)] << 8; } else { - reg40 |= (ata_atapi(dev) ? 0x40 : 0x00); + reg40 |= (ata_atapi(dev, target) ? 0x40 : 0x00); mask44 = 0x0f; new44 = ((timings[ata_mode2idx(piomode)] & 0x30) >> 2) | (timings[ata_mode2idx(piomode)] & 0x03); From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 01:20:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0BE1065692; Sun, 13 Dec 2009 01:20:33 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF9378FC1C; Sun, 13 Dec 2009 01:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD1KWWV069435; Sun, 13 Dec 2009 01:20:32 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD1KWF6069432; Sun, 13 Dec 2009 01:20:32 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912130120.nBD1KWF6069432@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Dec 2009 01:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200460 - head/sys/boot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 01:20:33 -0000 Author: marcel Date: Sun Dec 13 01:20:32 2009 New Revision: 200460 URL: http://svn.freebsd.org/changeset/base/200460 Log: Add support for memory disk (md). The size of the memory disk is determined by MD_IMAGE_SIZE. A file system can be embedded into the loader with /sys/tools/embed_mfs.sh. Note that md.c is not included when MD_IMAGE_SIZE is not set. Added: head/sys/boot/common/md.c (contents, props changed) Modified: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Sun Dec 13 00:13:21 2009 (r200459) +++ head/sys/boot/common/Makefile.inc Sun Dec 13 01:20:32 2009 (r200460) @@ -23,6 +23,11 @@ SRCS+= dev_net.c SRCS+= bcache.c .endif +.if defined(MD_IMAGE_SIZE) +CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE} +SRCS+= md.c +.endif + # Machine-independant ISA PnP .if defined(HAVE_ISABUS) SRCS+= isapnp.c Added: head/sys/boot/common/md.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/md.c Sun Dec 13 01:20:32 2009 (r200460) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2009 Marcel Moolenaar + * 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 +#include +#include +#include +#include + +#include "bootstrap.h" + +#define MD_BLOCK_SIZE 512 + +#ifndef MD_IMAGE_SIZE +#error Must be compiled with MD_IMAGE_SIZE defined +#endif +#if (MD_IMAGE_SIZE == 0 || MD_IMAGE_SIZE % MD_BLOCK_SIZE) +#error Image size must be a multiple of 512. +#endif + +/* + * Preloaded image gets put here. + * Applications that patch the object with the image can determine + * the size looking at the start and end markers (strings), + * so we want them contiguous. + */ +static struct { + u_char start[MD_IMAGE_SIZE]; + u_char end[128]; +} md_image = { + .start = "MFS Filesystem goes here", + .end = "MFS Filesystem had better STOP here", +}; + +/* devsw I/F */ +static int md_init(void); +static int md_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static int md_open(struct open_file *, ...); +static int md_close(struct open_file *); +static void md_print(int); + +struct devsw md_dev = { + "md", + DEVT_DISK, + md_init, + md_strategy, + md_open, + md_close, + noioctl, + md_print +}; + +static int +md_init(void) +{ + + return (0); +} + +static int +md_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, + size_t *rsize) +{ + struct devdesc *dev = (struct devdesc *)devdata; + size_t ofs; + + if (dev->d_unit != 0) + return (ENXIO); + + if (blk < 0 || blk >= (MD_IMAGE_SIZE / MD_BLOCK_SIZE)) + return (EIO); + + if (size % MD_BLOCK_SIZE) + return (EIO); + + ofs = blk * MD_BLOCK_SIZE; + if ((ofs + size) > MD_IMAGE_SIZE) + size = MD_IMAGE_SIZE - ofs; + + if (rsize != 0) + *rsize = size; + + switch (rw) { + case F_READ: + bcopy(md_image.start + ofs, buf, size); + return (0); + case F_WRITE: + bcopy(buf, md_image.start + ofs, size); + return (0); + } + + return (ENODEV); +} + +static int +md_open(struct open_file *f, ...) +{ + va_list ap; + struct devdesc *dev; + + va_start(ap, f); + dev = va_arg(ap, struct devdesc *); + va_end(ap); + + if (dev->d_unit != 0) + return (ENXIO); + + return (0); +} + +static int +md_close(struct open_file *f) +{ + struct devdesc *dev; + + dev = (struct devdesc *)(f->f_devdata); + return ((dev->d_unit != 0) ? ENXIO : 0); +} + +static void +md_print(int verbose) +{ + + printf("MD (%u bytes)\n", MD_IMAGE_SIZE); +} From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 03:14:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D275D106566C; Sun, 13 Dec 2009 03:14:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC8308FC0C; Sun, 13 Dec 2009 03:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD3E7h9072031; Sun, 13 Dec 2009 03:14:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3E6pO071938; Sun, 13 Dec 2009 03:14:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130314.nBD3E6pO071938@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200462 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:14:08 -0000 Author: delphij Date: Sun Dec 13 03:14:06 2009 New Revision: 200462 URL: http://svn.freebsd.org/changeset/base/200462 Log: Revert most part of 200420 as requested, as more review and polish is needed. Modified: head/usr.bin/ar/util.c head/usr.bin/c89/c89.c head/usr.bin/calendar/calendar.c head/usr.bin/calendar/day.c head/usr.bin/calendar/ostern.c head/usr.bin/calendar/paskha.c head/usr.bin/cksum/Makefile head/usr.bin/cksum/crc.c head/usr.bin/cksum/crc32.c head/usr.bin/cksum/sum1.c head/usr.bin/cksum/sum2.c head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c head/usr.bin/colcrt/colcrt.c head/usr.bin/colrm/colrm.c head/usr.bin/compress/zopen.c head/usr.bin/cpuset/cpuset.c head/usr.bin/expand/expand.c head/usr.bin/fetch/fetch.c head/usr.bin/file2c/file2c.c head/usr.bin/find/find.c head/usr.bin/find/getdate.y head/usr.bin/find/ls.c head/usr.bin/find/main.c head/usr.bin/find/misc.c head/usr.bin/find/option.c head/usr.bin/finger/lprint.c head/usr.bin/finger/net.c head/usr.bin/finger/util.c head/usr.bin/fmt/fmt.c head/usr.bin/fold/fold.c head/usr.bin/gcore/gcore.c head/usr.bin/getopt/getopt.c head/usr.bin/hexdump/display.c head/usr.bin/hexdump/hexdump.c head/usr.bin/jot/jot.c head/usr.bin/killall/killall.c head/usr.bin/ktrace/subr.c head/usr.bin/lastcomm/lastcomm.c head/usr.bin/lastcomm/readrec.c head/usr.bin/limits/limits.c head/usr.bin/lock/lock.c head/usr.bin/login/login.c head/usr.bin/login/login_fbtab.c head/usr.bin/login/pathnames.h head/usr.bin/mesg/mesg.c head/usr.bin/mkfifo/mkfifo.c head/usr.bin/mklocale/yacc.y head/usr.bin/mktemp/mktemp.c head/usr.bin/ncal/ncal.c head/usr.bin/netstat/atalk.c head/usr.bin/netstat/bpf.c head/usr.bin/netstat/if.c head/usr.bin/netstat/ipsec.c head/usr.bin/netstat/ipx.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mbuf.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/pfkey.c head/usr.bin/netstat/route.c head/usr.bin/netstat/sctp.c head/usr.bin/newgrp/newgrp.c head/usr.bin/newkey/update.c head/usr.bin/nfsstat/nfsstat.c head/usr.bin/nohup/nohup.c head/usr.bin/passwd/passwd.c head/usr.bin/paste/paste.c head/usr.bin/pr/egetopt.c head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_vm.c head/usr.bin/rev/rev.c head/usr.bin/rlogin/rlogin.c head/usr.bin/rpcgen/rpc_clntout.c head/usr.bin/rpcgen/rpc_hout.c head/usr.bin/rpcgen/rpc_tblout.c head/usr.bin/rpcgen/rpc_util.c head/usr.bin/ruptime/ruptime.c head/usr.bin/rwall/rwall.c head/usr.bin/sed/main.c head/usr.bin/sed/misc.c head/usr.bin/showmount/showmount.c head/usr.bin/su/su.c head/usr.bin/systat/fetch.c head/usr.bin/systat/icmp.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/main.c head/usr.bin/systat/mbufs.c head/usr.bin/systat/mode.c head/usr.bin/systat/netstat.c head/usr.bin/systat/swap.c head/usr.bin/systat/tcp.c head/usr.bin/systat/vmstat.c head/usr.bin/tar/getdate.c head/usr.bin/tee/tee.c head/usr.bin/time/time.c head/usr.bin/tput/tput.c head/usr.bin/tr/cmap.c head/usr.bin/tr/cmap.h head/usr.bin/tr/cset.c head/usr.bin/tr/cset.h head/usr.bin/tr/str.c head/usr.bin/tr/tr.c head/usr.bin/truss/main.c head/usr.bin/truss/setup.c head/usr.bin/tsort/tsort.c head/usr.bin/ul/ul.c head/usr.bin/unexpand/unexpand.c head/usr.bin/usbhidaction/usbhidaction.c head/usr.bin/vis/foldit.c head/usr.bin/w/pr_time.c head/usr.bin/w/w.c head/usr.bin/wall/ttymsg.c head/usr.bin/who/who.c head/usr.bin/xinstall/xinstall.c head/usr.bin/ypcat/ypcat.c head/usr.bin/ypmatch/ypmatch.c head/usr.bin/ypwhich/ypwhich.c Modified: head/usr.bin/ar/util.c ============================================================================== --- head/usr.bin/ar/util.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ar/util.c Sun Dec 13 03:14:06 2009 (r200462) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/c89/c89.c ============================================================================== --- head/usr.bin/c89/c89.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/c89/c89.c Sun Dec 13 03:14:06 2009 (r200462) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/calendar.c Sun Dec 13 03:14:06 2009 (r200462) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pathnames.h" #include "calendar.h" struct passwd *pw; Modified: head/usr.bin/calendar/day.c ============================================================================== --- head/usr.bin/calendar/day.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/day.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pathnames.h" #include "calendar.h" struct tm *tp; Modified: head/usr.bin/calendar/ostern.c ============================================================================== --- head/usr.bin/calendar/ostern.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/ostern.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "calendar.h" Modified: head/usr.bin/calendar/paskha.c ============================================================================== --- head/usr.bin/calendar/paskha.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/calendar/paskha.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "calendar.h" Modified: head/usr.bin/cksum/Makefile ============================================================================== --- head/usr.bin/cksum/Makefile Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/Makefile Sun Dec 13 03:14:06 2009 (r200462) @@ -5,6 +5,5 @@ PROG= cksum SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c LINKS= ${BINDIR}/cksum ${BINDIR}/sum MLINKS= cksum.1 sum.1 -WARNS?= 6 .include Modified: head/usr.bin/cksum/crc.c ============================================================================== --- head/usr.bin/cksum/crc.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/crc.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include "extern.h" Modified: head/usr.bin/cksum/crc32.c ============================================================================== --- head/usr.bin/cksum/crc32.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/crc32.c Sun Dec 13 03:14:06 2009 (r200462) @@ -17,6 +17,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "extern.h" Modified: head/usr.bin/cksum/sum1.c ============================================================================== --- head/usr.bin/cksum/sum1.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/sum1.c Sun Dec 13 03:14:06 2009 (r200462) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "extern.h" Modified: head/usr.bin/cksum/sum2.c ============================================================================== --- head/usr.bin/cksum/sum2.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cksum/sum2.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "extern.h" Modified: head/usr.bin/cmp/regular.c ============================================================================== --- head/usr.bin/cmp/regular.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cmp/regular.c Sun Dec 13 03:14:06 2009 (r200462) @@ -45,10 +45,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include "extern.h" Modified: head/usr.bin/cmp/special.c ============================================================================== --- head/usr.bin/cmp/special.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cmp/special.c Sun Dec 13 03:14:06 2009 (r200462) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" Modified: head/usr.bin/colcrt/colcrt.c ============================================================================== --- head/usr.bin/colcrt/colcrt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/colcrt/colcrt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/colrm/colrm.c ============================================================================== --- head/usr.bin/colrm/colrm.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/colrm/colrm.c Sun Dec 13 03:14:06 2009 (r200462) @@ -48,9 +48,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include +#include #include #include Modified: head/usr.bin/compress/zopen.c ============================================================================== --- head/usr.bin/compress/zopen.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/compress/zopen.c Sun Dec 13 03:14:06 2009 (r200462) @@ -67,11 +67,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include "zopen.h" #define BITS 16 /* Default bits. */ Modified: head/usr.bin/cpuset/cpuset.c ============================================================================== --- head/usr.bin/cpuset/cpuset.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/cpuset/cpuset.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include int cflag; int gflag; Modified: head/usr.bin/expand/expand.c ============================================================================== --- head/usr.bin/expand/expand.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/expand/expand.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * expand - expand tabs to equivalent spaces Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/fetch/fetch.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/file2c/file2c.c ============================================================================== --- head/usr.bin/file2c/file2c.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/file2c/file2c.c Sun Dec 13 03:14:06 2009 (r200462) @@ -10,6 +10,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/find.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "find.h" Modified: head/usr.bin/find/getdate.y ============================================================================== --- head/usr.bin/find/getdate.y Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/getdate.y Sun Dec 13 03:14:06 2009 (r200462) @@ -15,6 +15,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include /* The code at the top of get_date which figures out the offset of the Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/ls.c Sun Dec 13 03:14:06 2009 (r200462) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/find/main.c ============================================================================== --- head/usr.bin/find/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/find/misc.c ============================================================================== --- head/usr.bin/find/misc.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/misc.c Sun Dec 13 03:14:06 2009 (r200462) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/find/option.c Sun Dec 13 03:14:06 2009 (r200462) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/finger/lprint.c ============================================================================== --- head/usr.bin/finger/lprint.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/finger/lprint.c Sun Dec 13 03:14:06 2009 (r200462) @@ -310,7 +310,7 @@ show_text(const char *directory, const c return(0); /* If short enough, and no newlines, show it on a single line.*/ - if (sb.st_size <= (int)(LINE_LEN - strlen(header) - 5)) { + if (sb.st_size <= LINE_LEN - strlen(header) - 5) { nr = read(fd, tbuf, sizeof(tbuf)); if (nr <= 0) { (void)close(fd); Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/finger/net.c Sun Dec 13 03:14:06 2009 (r200462) @@ -230,7 +230,7 @@ trying(const struct addrinfo *ai) printf("Trying %s...\n", buf); } -static void +void cleanup(int sig __unused) { #define ERRSTR "Timed out.\n" Modified: head/usr.bin/finger/util.c ============================================================================== --- head/usr.bin/finger/util.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/finger/util.c Sun Dec 13 03:14:06 2009 (r200462) @@ -120,7 +120,7 @@ enter_lastlog(PERSON *pn) } if (fd == -1 || lseek(fd, (long)pn->uid * sizeof(ll), SEEK_SET) != - (off_t)(pn->uid * sizeof(ll)) || + (long)pn->uid * sizeof(ll) || read(fd, (char *)&ll, sizeof(ll)) != sizeof(ll)) { /* as if never logged in */ ll.ll_line[0] = ll.ll_host[0] = '\0'; Modified: head/usr.bin/fmt/fmt.c ============================================================================== --- head/usr.bin/fmt/fmt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/fmt/fmt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -180,6 +180,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/fold/fold.c ============================================================================== --- head/usr.bin/fold/fold.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/fold/fold.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/gcore/gcore.c ============================================================================== --- head/usr.bin/gcore/gcore.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/gcore/gcore.c Sun Dec 13 03:14:06 2009 (r200462) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "extern.h" Modified: head/usr.bin/getopt/getopt.c ============================================================================== --- head/usr.bin/getopt/getopt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/getopt/getopt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -7,6 +7,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include int Modified: head/usr.bin/hexdump/display.c ============================================================================== --- head/usr.bin/hexdump/display.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/hexdump/display.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "hexdump.h" enum _vflag vflag = FIRST; Modified: head/usr.bin/hexdump/hexdump.c ============================================================================== --- head/usr.bin/hexdump/hexdump.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/hexdump/hexdump.c Sun Dec 13 03:14:06 2009 (r200462) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "hexdump.h" Modified: head/usr.bin/jot/jot.c ============================================================================== --- head/usr.bin/jot/jot.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/jot/jot.c Sun Dec 13 03:14:06 2009 (r200462) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Defaults */ Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/killall/killall.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/usr.bin/ktrace/subr.c ============================================================================== --- head/usr.bin/ktrace/subr.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ktrace/subr.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "ktrace.h" void timevaladd(struct timeval *, struct timeval *); Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/lastcomm/lastcomm.c Sun Dec 13 03:14:06 2009 (r200462) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include #include Modified: head/usr.bin/lastcomm/readrec.c ============================================================================== --- head/usr.bin/lastcomm/readrec.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/lastcomm/readrec.c Sun Dec 13 03:14:06 2009 (r200462) @@ -33,9 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include +#include #include #include +#include #include int readrec_forward(FILE *f, struct acctv2 *av2); Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/limits/limits.c Sun Dec 13 03:14:06 2009 (r200462) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/lock/lock.c Sun Dec 13 03:14:06 2009 (r200462) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/usr.bin/login/login.c ============================================================================== --- head/usr.bin/login/login.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/login/login.c Sun Dec 13 03:14:06 2009 (r200462) @@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #include #include Modified: head/usr.bin/login/login_fbtab.c ============================================================================== --- head/usr.bin/login/login_fbtab.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/login/login_fbtab.c Sun Dec 13 03:14:06 2009 (r200462) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "login.h" #include "pathnames.h" static void login_protect(const char *, char *, int, uid_t, gid_t); Modified: head/usr.bin/login/pathnames.h ============================================================================== --- head/usr.bin/login/pathnames.h Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/login/pathnames.h Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include + #define _PATH_HUSHLOGIN ".hushlogin" #define _PATH_MOTDFILE "/etc/motd" #define _PATH_FBTAB "/etc/fbtab" Modified: head/usr.bin/mesg/mesg.c ============================================================================== --- head/usr.bin/mesg/mesg.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mesg/mesg.c Sun Dec 13 03:14:06 2009 (r200462) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static void usage(void); Modified: head/usr.bin/mkfifo/mkfifo.c ============================================================================== --- head/usr.bin/mkfifo/mkfifo.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mkfifo/mkfifo.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define BASEMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \ Modified: head/usr.bin/mklocale/yacc.y ============================================================================== --- head/usr.bin/mklocale/yacc.y Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mklocale/yacc.y Sun Dec 13 03:14:06 2009 (r200462) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/mktemp/mktemp.c ============================================================================== --- head/usr.bin/mktemp/mktemp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/mktemp/mktemp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -143,7 +143,7 @@ main(int argc, char **argv) } static void -usage(void) +usage() { fprintf(stderr, "usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n"); Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ncal/ncal.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ static const char rcsid[] = #endif /* not lint */ #include +#include #include #include #include Modified: head/usr.bin/netstat/atalk.c ============================================================================== --- head/usr.bin/netstat/atalk.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/atalk.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include Modified: head/usr.bin/netstat/bpf.c ============================================================================== --- head/usr.bin/netstat/bpf.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/bpf.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "netstat.h" Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/if.c Sun Dec 13 03:14:06 2009 (r200462) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "netstat.h" Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/ipsec.c Sun Dec 13 03:14:06 2009 (r200462) @@ -111,6 +111,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include "netstat.h" #ifdef IPSEC Modified: head/usr.bin/netstat/ipx.c ============================================================================== --- head/usr.bin/netstat/ipx.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/ipx.c Sun Dec 13 03:14:06 2009 (r200462) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #define SANAMES #include +#include +#include #include #include #include Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -60,10 +60,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include #include Modified: head/usr.bin/netstat/mbuf.c ============================================================================== --- head/usr.bin/netstat/mbuf.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/mbuf.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "netstat.h" /* Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/netgraph.c Sun Dec 13 03:14:06 2009 (r200462) @@ -50,9 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include "netstat.h" Modified: head/usr.bin/netstat/pfkey.c ============================================================================== --- head/usr.bin/netstat/pfkey.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/pfkey.c Sun Dec 13 03:14:06 2009 (r200462) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include "netstat.h" #ifdef IPSEC Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/route.c Sun Dec 13 03:14:06 2009 (r200462) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "netstat.h" Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/netstat/sctp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,10 +52,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include #include +#include #include "netstat.h" #ifdef SCTP Modified: head/usr.bin/newgrp/newgrp.c ============================================================================== --- head/usr.bin/newgrp/newgrp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/newgrp/newgrp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include #include Modified: head/usr.bin/newkey/update.c ============================================================================== --- head/usr.bin/newkey/update.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/newkey/update.c Sun Dec 13 03:14:06 2009 (r200462) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #endif /* YP */ +#include #include #include #include Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/nfsstat/nfsstat.c Sun Dec 13 03:14:06 2009 (r200462) @@ -62,6 +62,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -70,6 +71,7 @@ static const char rcsid[] = #include #include #include +#include #include struct nlist nl[] = { Modified: head/usr.bin/nohup/nohup.c ============================================================================== --- head/usr.bin/nohup/nohup.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/nohup/nohup.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static void dofile(void); Modified: head/usr.bin/passwd/passwd.c ============================================================================== --- head/usr.bin/passwd/passwd.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/passwd/passwd.c Sun Dec 13 03:14:06 2009 (r200462) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/paste/paste.c ============================================================================== --- head/usr.bin/paste/paste.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/paste/paste.c Sun Dec 13 03:14:06 2009 (r200462) @@ -52,9 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include +#include #include #include Modified: head/usr.bin/pr/egetopt.c ============================================================================== --- head/usr.bin/pr/egetopt.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/pr/egetopt.c Sun Dec 13 03:14:06 2009 (r200462) @@ -46,8 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include "extern.h" + /* * egetopt: get option letter from argument vector (an extended * version of getopt). Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_args.c Sun Dec 13 03:14:06 2009 (r200462) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "procstat.h" Modified: head/usr.bin/procstat/procstat_basic.c ============================================================================== --- head/usr.bin/procstat/procstat_basic.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_basic.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ #include #include +#include #include #include Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_files.c Sun Dec 13 03:14:06 2009 (r200462) @@ -36,6 +36,7 @@ #include +#include #include #include #include Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/procstat/procstat_vm.c Sun Dec 13 03:14:06 2009 (r200462) @@ -30,6 +30,7 @@ #include #include +#include #include #include #include Modified: head/usr.bin/rev/rev.c ============================================================================== --- head/usr.bin/rev/rev.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rev/rev.c Sun Dec 13 03:14:06 2009 (r200462) @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include Modified: head/usr.bin/rlogin/rlogin.c ============================================================================== --- head/usr.bin/rlogin/rlogin.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rlogin/rlogin.c Sun Dec 13 03:14:06 2009 (r200462) @@ -72,7 +72,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include Modified: head/usr.bin/rpcgen/rpc_clntout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_clntout.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_clntout.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1987, Sun Microsytsems, Inc. */ #include +#include #include #include "rpc_parse.h" #include "rpc_scan.h" Modified: head/usr.bin/rpcgen/rpc_hout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_hout.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_hout.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1987, Sun Microsystems, Inc. */ #include +#include #include "rpc_parse.h" #include "rpc_scan.h" #include "rpc_util.h" Modified: head/usr.bin/rpcgen/rpc_tblout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_tblout.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_tblout.c Sun Dec 13 03:14:06 2009 (r200462) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include "rpc_parse.h" #include "rpc_scan.h" #include "rpc_util.h" Modified: head/usr.bin/rpcgen/rpc_util.c ============================================================================== --- head/usr.bin/rpcgen/rpc_util.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rpcgen/rpc_util.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1989, Sun Microsystems, Inc. */ #include +#include #include #include #include Modified: head/usr.bin/ruptime/ruptime.c ============================================================================== --- head/usr.bin/ruptime/ruptime.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/ruptime/ruptime.c Sun Dec 13 03:14:06 2009 (r200462) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/rwall/rwall.c ============================================================================== --- head/usr.bin/rwall/rwall.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/rwall/rwall.c Sun Dec 13 03:14:06 2009 (r200462) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/sed/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -51,10 +51,12 @@ static const char sccsid[] = "@(#)main.c #include #include +#include #include #include #include #include +#include #include #include #include Modified: head/usr.bin/sed/misc.c ============================================================================== --- head/usr.bin/sed/misc.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/sed/misc.c Sun Dec 13 03:14:06 2009 (r200462) @@ -41,8 +41,14 @@ static const char sccsid[] = "@(#)misc.c #include #include +#include #include +#include #include +#include + +#include "defs.h" +#include "extern.h" /* * Return a string for a regular expression error passed. This is overkill, Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/showmount/showmount.c Sun Dec 13 03:14:06 2009 (r200462) @@ -55,6 +55,7 @@ static const char rcsid[] = #include #include +#include #include #include #include Modified: head/usr.bin/su/su.c ============================================================================== --- head/usr.bin/su/su.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/su/su.c Sun Dec 13 03:14:06 2009 (r200462) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/usr.bin/systat/fetch.c ============================================================================== --- head/usr.bin/systat/fetch.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/fetch.c Sun Dec 13 03:14:06 2009 (r200462) @@ -42,6 +42,7 @@ static const char sccsid[] = "@(#)fetch. #include #include +#include #include #include #include Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/icmp.c Sun Dec 13 03:14:06 2009 (r200462) @@ -54,7 +54,9 @@ static char sccsid[] = "@(#)mbufs.c 8.1 #include #include +#include #include +#include #include "systat.h" #include "extern.h" #include "mode.h" Modified: head/usr.bin/systat/iostat.c ============================================================================== --- head/usr.bin/systat/iostat.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/iostat.c Sun Dec 13 03:14:06 2009 (r200462) @@ -73,6 +73,7 @@ static const char sccsid[] = "@(#)iostat #include #include #include +#include #include #include Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/ip.c Sun Dec 13 03:14:06 2009 (r200462) @@ -55,6 +55,10 @@ static const char sccsid[] = "@(#)mbufs. #include #include +#include +#include +#include + #include "systat.h" #include "extern.h" #include "mode.h" Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/main.c Sun Dec 13 03:14:06 2009 (r200462) @@ -53,6 +53,7 @@ static const char copyright[] = #include #include #include +#include #include #include #include Modified: head/usr.bin/systat/mbufs.c ============================================================================== --- head/usr.bin/systat/mbufs.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/mbufs.c Sun Dec 13 03:14:06 2009 (r200462) @@ -47,6 +47,7 @@ static const char sccsid[] = "@(#)mbufs. #include #include #include +#include #include "systat.h" #include "extern.h" Modified: head/usr.bin/systat/mode.c ============================================================================== --- head/usr.bin/systat/mode.c Sun Dec 13 02:00:41 2009 (r200461) +++ head/usr.bin/systat/mode.c Sun Dec 13 03:14:06 2009 (r200462) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 03:18:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EB8A1065693; Sun, 13 Dec 2009 03:18:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 345F38FC0A; Sun, 13 Dec 2009 03:18:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD3Icfw072179; Sun, 13 Dec 2009 03:18:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3IcBL072177; Sun, 13 Dec 2009 03:18:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130318.nBD3IcBL072177@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200463 - head/usr.bin/mktemp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:18:38 -0000 Author: delphij Date: Sun Dec 13 03:18:37 2009 New Revision: 200463 URL: http://svn.freebsd.org/changeset/base/200463 Log: Use prototype for usage(). Modified: head/usr.bin/mktemp/mktemp.c Modified: head/usr.bin/mktemp/mktemp.c ============================================================================== --- head/usr.bin/mktemp/mktemp.c Sun Dec 13 03:14:06 2009 (r200462) +++ head/usr.bin/mktemp/mktemp.c Sun Dec 13 03:18:37 2009 (r200463) @@ -143,7 +143,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n"); From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 03:29:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32120106566B; Sun, 13 Dec 2009 03:29:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 209688FC13; Sun, 13 Dec 2009 03:29:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD3T6nQ072394; Sun, 13 Dec 2009 03:29:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3T6R8072392; Sun, 13 Dec 2009 03:29:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130329.nBD3T6R8072392@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200464 - head/lib/libexpat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:29:06 -0000 Author: delphij Date: Sun Dec 13 03:29:05 2009 New Revision: 200464 URL: http://svn.freebsd.org/changeset/base/200464 Log: Explicitly say that this is an internal library which is intended to be used within FreeBSD base system only, and discourage user applications from using it. User applications should use the expat version from the ports/package collection. Reviewed by: simon (earlier version) MFC after: 2 weeks Modified: head/lib/libexpat/libbsdxml.3 Modified: head/lib/libexpat/libbsdxml.3 ============================================================================== --- head/lib/libexpat/libbsdxml.3 Sun Dec 13 03:18:37 2009 (r200463) +++ head/lib/libexpat/libbsdxml.3 Sun Dec 13 03:29:05 2009 (r200464) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 5, 2008 +.Dd December 12, 2009 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -38,6 +38,15 @@ The .Nm library is a verbatim copy of the eXpat XML library version 2.0.1. .Pp +The +.Nm +library is intended to use within the +.Fx +base system only. +Use of the +.Nm +library for other purposes is not supported and discouraged. +.Pp To avoid version and autoconfiguration issues, the library has been renamed to .Nm From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 03:34:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29B11065672; Sun, 13 Dec 2009 03:34:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0F7C8FC13; Sun, 13 Dec 2009 03:34:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD3YJ66072558; Sun, 13 Dec 2009 03:34:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3YJbO072556; Sun, 13 Dec 2009 03:34:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130334.nBD3YJbO072556@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200465 - head/usr.bin/xinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:34:19 -0000 Author: delphij Date: Sun Dec 13 03:34:19 2009 New Revision: 200465 URL: http://svn.freebsd.org/changeset/base/200465 Log: Staticify internal functions and make usage() a prototype. Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:29:05 2009 (r200464) +++ head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:34:19 2009 (r200465) @@ -86,16 +86,16 @@ int dobackup, docompare, dodir, dopreser mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; const char *suffix = BACKUP_SUFFIX; -void copy(int, const char *, int, const char *, off_t); -int compare(int, const char *, size_t, int, const char *, size_t); -int create_newfile(const char *, int, struct stat *); -int create_tempfile(const char *, char *, size_t); -void install(const char *, const char *, u_long, u_int); -void install_dir(char *); -u_long numeric_id(const char *, const char *); -void strip(const char *); -int trymmap(int); -void usage(void); +static void copy(int, const char *, int, const char *, off_t); +static int compare(int, const char *, size_t, int, const char *, size_t); +static int create_newfile(const char *, int, struct stat *); +static int create_tempfile(const char *, char *, size_t); +static void install(const char *, const char *, u_long, u_int); +static void install_dir(char *); +static u_long numeric_id(const char *, const char *); +static void strip(const char *); +static int trymmap(int); +static void usage(void); int main(int argc, char *argv[]) @@ -771,7 +771,7 @@ install_dir(char *path) * print a usage message and die */ void -usage() +usage(void) { (void)fprintf(stderr, "usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n" From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 03:53:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C303F106566C; Sun, 13 Dec 2009 03:53:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B13608FC0C; Sun, 13 Dec 2009 03:53:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD3rFkS072916; Sun, 13 Dec 2009 03:53:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD3rFon072914; Sun, 13 Dec 2009 03:53:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130353.nBD3rFon072914@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 03:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200466 - head/usr.bin/xinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 03:53:15 -0000 Author: delphij Date: Sun Dec 13 03:53:15 2009 New Revision: 200466 URL: http://svn.freebsd.org/changeset/base/200466 Log: xinstall.c does not require ctype functions, so ctype.h is not necessary here. Note: this would change the md5 checksum due to change caused by different register layout. Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:34:19 2009 (r200465) +++ head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:53:15 2009 (r200466) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 04:08:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 452E71065670; Sun, 13 Dec 2009 04:08:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A8498FC1A; Sun, 13 Dec 2009 04:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD485fw073259; Sun, 13 Dec 2009 04:08:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD484B8073258; Sun, 13 Dec 2009 04:08:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130408.nBD484B8073258@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200467 - head/usr.sbin/ndp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:08:05 -0000 Author: delphij Date: Sun Dec 13 04:08:04 2009 New Revision: 200467 URL: http://svn.freebsd.org/changeset/base/200467 Log: We use gmt2local code from tcpdump and gnuc.h is no longer being used there, so remove this dummy header. Deleted: head/usr.sbin/ndp/gnuc.h From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 04:14:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09D00106566C; Sun, 13 Dec 2009 04:14:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC8EA8FC0C; Sun, 13 Dec 2009 04:14:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD4EtpV073429; Sun, 13 Dec 2009 04:14:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD4Et64073427; Sun, 13 Dec 2009 04:14:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130414.nBD4Et64073427@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200468 - head/usr.bin/vis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:14:56 -0000 Author: delphij Date: Sun Dec 13 04:14:55 2009 New Revision: 200468 URL: http://svn.freebsd.org/changeset/base/200468 Log: Use ANSI prototype for foldit(). Modified: head/usr.bin/vis/foldit.c Modified: head/usr.bin/vis/foldit.c ============================================================================== --- head/usr.bin/vis/foldit.c Sun Dec 13 04:08:04 2009 (r200467) +++ head/usr.bin/vis/foldit.c Sun Dec 13 04:14:55 2009 (r200468) @@ -44,9 +44,7 @@ static const char sccsid[] = "@(#)foldit #include "extern.h" int -foldit(chunk, col, max) - char *chunk; - int col, max; +foldit(char *chunk, int col, int max) { char *cp; From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 04:34:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C1C1065679; Sun, 13 Dec 2009 04:34:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37F008FC17; Sun, 13 Dec 2009 04:34:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD4YqYF073860; Sun, 13 Dec 2009 04:34:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD4Yqn0073858; Sun, 13 Dec 2009 04:34:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130434.nBD4Yqn0073858@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200469 - head/usr.bin/pr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:34:52 -0000 Author: delphij Date: Sun Dec 13 04:34:51 2009 New Revision: 200469 URL: http://svn.freebsd.org/changeset/base/200469 Log: egetopt.c does not use any stdlib.h definations, nor it referenced any symbol from other module, so remove reference of stdlib.h and extern.h. Verified with: md5(1) Modified: head/usr.bin/pr/egetopt.c Modified: head/usr.bin/pr/egetopt.c ============================================================================== --- head/usr.bin/pr/egetopt.c Sun Dec 13 04:14:55 2009 (r200468) +++ head/usr.bin/pr/egetopt.c Sun Dec 13 04:34:51 2009 (r200469) @@ -46,11 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include "extern.h" - /* * egetopt: get option letter from argument vector (an extended * version of getopt). From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 04:50:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F7FC106566B; Sun, 13 Dec 2009 04:50:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1476C8FC1A; Sun, 13 Dec 2009 04:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBD4oBoG074249; Sun, 13 Dec 2009 04:50:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBD4oBmm074244; Sun, 13 Dec 2009 04:50:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912130450.nBD4oBmm074244@svn.freebsd.org> From: Xin LI Date: Sun, 13 Dec 2009 04:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200470 - head/usr.bin/calendar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 04:50:12 -0000 Author: delphij Date: Sun Dec 13 04:50:11 2009 New Revision: 200470 URL: http://svn.freebsd.org/changeset/base/200470 Log: - Remove times.h from C programs that does not manipulate with time at all. - Remove pathnames.h from all but io.c since it's the only module that used these definations. Modified: head/usr.bin/calendar/calendar.c head/usr.bin/calendar/day.c head/usr.bin/calendar/ostern.c head/usr.bin/calendar/paskha.c Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/calendar.c Sun Dec 13 04:50:11 2009 (r200470) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" #include "calendar.h" struct passwd *pw; Modified: head/usr.bin/calendar/day.c ============================================================================== --- head/usr.bin/calendar/day.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/day.c Sun Dec 13 04:50:11 2009 (r200470) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" #include "calendar.h" struct tm *tp; Modified: head/usr.bin/calendar/ostern.c ============================================================================== --- head/usr.bin/calendar/ostern.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/ostern.c Sun Dec 13 04:50:11 2009 (r200470) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "calendar.h" Modified: head/usr.bin/calendar/paskha.c ============================================================================== --- head/usr.bin/calendar/paskha.c Sun Dec 13 04:34:51 2009 (r200469) +++ head/usr.bin/calendar/paskha.c Sun Dec 13 04:50:11 2009 (r200470) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "calendar.h" From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 08:49:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE1181065670; Sun, 13 Dec 2009 08:49:10 +0000 (UTC) (envelope-from netch@segfault.kiev.ua) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE2E8FC17; Sun, 13 Dec 2009 08:49:09 +0000 (UTC) Received: from segfault.kiev.ua (localhost.segfault.kiev.ua [127.0.0.1]) by segfault.kiev.ua (8.14.3/8.14.3/8.Who.Cares) with ESMTP id nBD8bUFb076678; Sun, 13 Dec 2009 10:37:30 +0200 (EET) (envelope-from netch@segfault.kiev.ua) Received: (from netch@localhost) by segfault.kiev.ua (8.14.3/8.14.3/Submit) id nBD8bPuH076675; Sun, 13 Dec 2009 10:37:25 +0200 (EET) (envelope-from netch) Date: Sun, 13 Dec 2009 10:37:25 +0200 From: Valentin Nechayev To: Garrett Wollman Message-ID: <20091213083725.GH1260@netch.kiev.ua> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19235.10488.325168.267306@hergotha.csail.mit.edu> X-42: On Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: netch@netch.kiev.ua List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 08:49:10 -0000 Sat, Dec 12, 2009 at 00:24:08, wollman wrote about "Re: svn commit: r200369 - in head: etc share/termcap": > > It's great, thank!! > > I believe that our xterm entry was modified not to clear screen when > > applications such as less(1) are terminated. Are there any chance to > > back to the behavior? > > > > I don't understand why people put up with the unspeakably obnoxious > "alternate screen" behavior. Please don't tell me someone actually > thinks it's *useful*. I also vote for old variant. If anybody wants to keep previous screen contents, there are many ways for this (another xterm, screen, less, etc.), and all they are more predictable and controllable than alternate screen which isn't loggable and isn't provided by many terminal implementations. -netch- From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 11:06:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C8141065672; Sun, 13 Dec 2009 11:06:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B75A8FC19; Sun, 13 Dec 2009 11:06:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDB6ere084722; Sun, 13 Dec 2009 11:06:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDB6dOb084717; Sun, 13 Dec 2009 11:06:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912131106.nBDB6dOb084717@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Dec 2009 11:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200471 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 11:06:40 -0000 Author: bz Date: Sun Dec 13 11:06:39 2009 New Revision: 200471 URL: http://svn.freebsd.org/changeset/base/200471 Log: Add a few more V_hacks to nfsclient to allow machines with a VIMAGE kernel to boot from NFS. [1] Note: this is not a full virtualization of nfsclient. It is only does what advertised above and nothing more. Requested by: public demand [1] Tested by: kris, .. MFC after: 5 days Modified: head/sys/nfsclient/bootp_subr.c head/sys/nfsclient/krpc_subr.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/bootp_subr.c Sun Dec 13 11:06:39 2009 (r200471) @@ -584,6 +584,8 @@ bootpc_call(struct bootpc_globalcontext int retry; const char *s; + CURVNET_SET(TD_TO_VNET(td)); + /* * Create socket and set its recieve timeout. */ @@ -960,6 +962,7 @@ gotreply: out: soclose(so); out0: + CURVNET_RESTORE(); return error; } @@ -974,6 +977,8 @@ bootpc_fakeup_interface(struct bootpc_if struct ifaddr *ifa; struct sockaddr_dl *sdl; + CURVNET_SET(TD_TO_VNET(td)); + error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, td->td_ucred, td); if (error != 0) panic("nfs_boot: socreate, error=%d", error); @@ -1048,6 +1053,8 @@ bootpc_fakeup_interface(struct bootpc_if ifctx->ireq.ifr_name); ifctx->sdl = sdl; + CURVNET_RESTORE(); + return error; } Modified: head/sys/nfsclient/krpc_subr.c ============================================================================== --- head/sys/nfsclient/krpc_subr.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/krpc_subr.c Sun Dec 13 11:06:39 2009 (r200471) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -213,6 +215,8 @@ krpc_call(struct sockaddr_in *sa, u_int nam = mhead = NULL; from = NULL; + CURVNET_SET(TD_TO_VNET(td)); + /* * Create socket and set its recieve timeout. */ @@ -425,6 +429,7 @@ krpc_call(struct sockaddr_in *sa, u_int if (mhead) m_freem(mhead); if (from) free(from, M_SONAME); soclose(so); + CURVNET_RESTORE(); return error; } Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/nfs_vfsops.c Sun Dec 13 11:06:39 2009 (r200471) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -825,6 +827,8 @@ nfs_mount(struct mount *mp) has_fh_opt = 0; has_hostname_opt = 0; + CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); + if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; goto out; @@ -1124,6 +1128,7 @@ out: mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED); MNT_IUNLOCK(mp); } + CURVNET_RESTORE(); return (error); } Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Sun Dec 13 04:50:11 2009 (r200470) +++ head/sys/nfsclient/nfs_vnops.c Sun Dec 13 11:06:39 2009 (r200471) @@ -1555,14 +1555,21 @@ nfs_create(struct vop_create_args *ap) struct vattr vattr; int v3 = NFS_ISV3(dvp); + CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); + /* * Oops, not for me.. */ - if (vap->va_type == VSOCK) - return (nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap)); + if (vap->va_type == VSOCK) { + error = nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap); + CURVNET_RESTORE(); + return (error); + } - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) { + CURVNET_RESTORE(); return (error); + } if (vap->va_vaflags & VA_EXCLUSIVE) fmode |= O_EXCL; again: @@ -1658,6 +1665,7 @@ nfsmout: KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } mtx_unlock(&(VTONFS(dvp))->n_mtx); + CURVNET_RESTORE(); return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 12:00:50 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6640210656AC; Sun, 13 Dec 2009 12:00:50 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 22DC38FC1D; Sun, 13 Dec 2009 12:00:50 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4CB8F6D41B; Sun, 13 Dec 2009 12:00:49 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1EE1A84530; Sun, 13 Dec 2009 13:00:49 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Wollman References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> Date: Sun, 13 Dec 2009 13:00:49 +0100 In-Reply-To: <19235.10488.325168.267306@hergotha.csail.mit.edu> (Garrett Wollman's message of "Sat, 12 Dec 2009 00:24:08 -0500") Message-ID: <86tyvvjd72.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hajimu UMEMOTO Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:00:50 -0000 Garrett Wollman writes: > I don't understand why people put up with the unspeakably obnoxious > "alternate screen" behavior. Please don't tell me someone actually > thinks it's *useful*. Lots of people think it's useful. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 12:03:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08A0C1065697; Sun, 13 Dec 2009 12:03:44 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id B56A78FC12; Sun, 13 Dec 2009 12:03:43 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 9D2AC6D41C; Sun, 13 Dec 2009 12:03:42 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 7E2E3844E9; Sun, 13 Dec 2009 13:03:42 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Barton References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> Date: Sun, 13 Dec 2009 13:03:42 +0100 In-Reply-To: <4B23F090.10207@FreeBSD.org> (Doug Barton's message of "Sat, 12 Dec 2009 11:35:44 -0800") Message-ID: <86pr6jjd29.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, Garrett Wollman , Ronald Klop , svn-src-head@freebsd.org, Christoph Mallon Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:03:44 -0000 Doug Barton writes: > To be clear, I am NOT asking for a backout ... IIRC in the thread that > discussed this issue there were quite a few people who thought that > FreeBSD not clearing the screen was a POLA violation since that's what > linux does, and it's what most people are used to. It's not "what Linux does", it's what xterm does. Xterm did not originate with Linux; in fact, it predates Linux by about ten years. FreeBSD's xterm entry was deliberately crippled to lie about xterm's capabilities. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 12:04:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6EF106566B; Sun, 13 Dec 2009 12:04:42 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 08C8C8FC0C; Sun, 13 Dec 2009 12:04:41 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4091E6D450; Sun, 13 Dec 2009 12:04:41 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 22383844E9; Sun, 13 Dec 2009 13:04:41 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: netch@netch.kiev.ua References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <20091213083725.GH1260@netch.kiev.ua> Date: Sun, 13 Dec 2009 13:04:41 +0100 In-Reply-To: <20091213083725.GH1260@netch.kiev.ua> (Valentin Nechayev's message of "Sun, 13 Dec 2009 10:37:25 +0200") Message-ID: <86ljh7jd0m.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO , Garrett Wollman Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:04:42 -0000 Valentin Nechayev writes: > I also vote for old variant. If anybody wants to keep previous screen > contents, there are many ways for this (another xterm, screen, less, > etc.), and all they are more predictable and controllable than > alternate screen which isn't loggable and isn't provided by many terminal > implementations. That last part is simply untrue. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 12:13:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D390B1065670; Sun, 13 Dec 2009 12:13:41 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 917788FC15; Sun, 13 Dec 2009 12:13:41 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 8D0376D41D; Sun, 13 Dec 2009 12:13:40 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 4A705844E9; Sun, 13 Dec 2009 13:13:40 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI References: <200912130314.nBD3E6pO071938@svn.freebsd.org> Date: Sun, 13 Dec 2009 13:13:40 +0100 In-Reply-To: <200912130314.nBD3E6pO071938@svn.freebsd.org> (Xin LI's message of "Sun, 13 Dec 2009 03:14:06 +0000 (UTC)") Message-ID: <86hbrvjcln.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200462 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 12:13:41 -0000 Xin LI writes: > Author: delphij > Date: Sun Dec 13 03:14:06 2009 > New Revision: 200462 > URL: http://svn.freebsd.org/changeset/base/200462 > > Log: > Revert most part of 200420 as requested, as more review and polish is > needed. It's a good idea, but it's also very hard to get right. I skimmed through the patch, and some of it is obviously correct (e.g. removing "pathnames.h" in one case) but some of it is almost certainly incorrect (e.g. removing which is actually required even if you don't notice it due to pollution from other headers). Is anybody working on POSIXizing our headers? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 13:57:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92FAB106566C; Sun, 13 Dec 2009 13:57:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 812858FC21; Sun, 13 Dec 2009 13:57:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDDvX6l088065; Sun, 13 Dec 2009 13:57:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDDvXVT088059; Sun, 13 Dec 2009 13:57:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912131357.nBDDvXVT088059@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Dec 2009 13:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200473 - in head/sys: kern net netinet netinet6 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 13:57:33 -0000 Author: bz Date: Sun Dec 13 13:57:32 2009 New Revision: 200473 URL: http://svn.freebsd.org/changeset/base/200473 Log: Throughout the network stack we have a few places of if (jailed(cred)) left. If you are running with a vnet (virtual network stack) those will return true and defer you to classic IP-jails handling and thus things will be "denied" or returned with an error. Work around this problem by introducing another "jailed()" function, jailed_without_vnet(), that also takes vnets into account, and permits the calls, should the jail from the given cred have its own virtual network stack. We cannot change the classic jailed() call to do that, as it is used outside the network stack as well. Discussed with: julian, zec, jamie, rwatson (back in Sept) MFC after: 5 days Modified: head/sys/kern/kern_jail.c head/sys/net/rtsock.c head/sys/netinet/raw_ip.c head/sys/netinet6/raw_ip6.c head/sys/sys/jail.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/kern/kern_jail.c Sun Dec 13 13:57:32 2009 (r200473) @@ -3161,7 +3161,7 @@ prison_check_af(struct ucred *cred, int pr = cred->cr_prison; #ifdef VIMAGE /* Prisons with their own network stack are not limited. */ - if (pr->pr_flags & PR_VNET) + if (prison_owns_vnet(cred)) return (0); #endif @@ -3222,6 +3222,11 @@ prison_if(struct ucred *cred, struct soc KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); KASSERT(sa != NULL, ("%s: sa is NULL", __func__)); +#ifdef VIMAGE + if (prison_owns_vnet(cred)) + return (0); +#endif + error = 0; switch (sa->sa_family) { @@ -3279,6 +3284,24 @@ jailed(struct ucred *cred) } /* + * Return 1 if the passed credential is in a jail and that jail does not + * have its own virtual network stack, otherwise 0. + */ +int +jailed_without_vnet(struct ucred *cred) +{ + + if (!jailed(cred)) + return (0); +#ifdef VIMAGE + if (prison_owns_vnet(cred)) + return (0); +#endif + + return (1); +} + +/* * Return the correct hostname (domainname, et al) for the passed credential. */ void Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/net/rtsock.c Sun Dec 13 13:57:32 2009 (r200473) @@ -651,7 +651,7 @@ route_output(struct mbuf *m, struct sock report: RT_LOCK_ASSERT(rt); if ((rt->rt_flags & RTF_HOST) == 0 - ? jailed(curthread->td_ucred) + ? jailed_without_vnet(curthread->td_ucred) : prison_if(curthread->td_ucred, rt_key(rt)) != 0) { RT_UNLOCK(rt); @@ -1312,7 +1312,7 @@ sysctl_dumpentry(struct radix_node *rn, if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg)) return 0; if ((rt->rt_flags & RTF_HOST) == 0 - ? jailed(w->w_req->td->td_ucred) + ? jailed_without_vnet(w->w_req->td->td_ucred) : prison_if(w->w_req->td->td_ucred, rt_key(rt)) != 0) return (0); bzero((caddr_t)&info, sizeof(info)); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/netinet/raw_ip.c Sun Dec 13 13:57:32 2009 (r200473) @@ -291,7 +291,7 @@ rip_input(struct mbuf *m, int off) continue; if (inp->inp_faddr.s_addr != ip->ip_src.s_addr) continue; - if (jailed(inp->inp_cred)) { + if (jailed_without_vnet(inp->inp_cred)) { /* * XXX: If faddr was bound to multicast group, * jailed raw socket will drop datagram. @@ -325,7 +325,7 @@ rip_input(struct mbuf *m, int off) if (!in_nullhost(inp->inp_faddr) && !in_hosteq(inp->inp_faddr, ip->ip_src)) continue; - if (jailed(inp->inp_cred)) { + if (jailed_without_vnet(inp->inp_cred)) { /* * Allow raw socket in jail to receive multicast; * assume process had PRIV_NETINET_RAW at attach, Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/netinet6/raw_ip6.c Sun Dec 13 13:57:32 2009 (r200473) @@ -184,7 +184,7 @@ rip6_input(struct mbuf **mp, int *offp, if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr) && !IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &ip6->ip6_src)) continue; - if (jailed(in6p->inp_cred)) { + if (jailed_without_vnet(in6p->inp_cred)) { /* * Allow raw socket in jail to receive multicast; * assume process had PRIV_NETINET_RAW at attach, Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sun Dec 13 13:40:41 2009 (r200472) +++ head/sys/sys/jail.h Sun Dec 13 13:57:32 2009 (r200473) @@ -335,6 +335,7 @@ struct mount; struct sockaddr; struct statfs; int jailed(struct ucred *cred); +int jailed_without_vnet(struct ucred *); void getcredhostname(struct ucred *, char *, size_t); void getcreddomainname(struct ucred *, char *, size_t); void getcredhostuuid(struct ucred *, char *, size_t); From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 15:19:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20CC81065670; Sun, 13 Dec 2009 15:19:02 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E9CA8FC08; Sun, 13 Dec 2009 15:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDFJ2FW090062; Sun, 13 Dec 2009 15:19:02 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDFJ2bT090059; Sun, 13 Dec 2009 15:19:02 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200912131519.nBDFJ2bT090059@svn.freebsd.org> From: Hiroki Sato Date: Sun, 13 Dec 2009 15:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200478 - head/usr.sbin/ypserv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 15:19:02 -0000 Author: hrs Date: Sun Dec 13 15:19:01 2009 New Revision: 200478 URL: http://svn.freebsd.org/changeset/base/200478 Log: - Fix main() to use two separated sockets for the two transports when "-P port" is specified. It invoked svc{tcp,udp}_create() for only one of the two allocated sockets, and prevented the TCP socket from binding to as the result. - Use TI-RPC functions and handle sockets in a transport-independent way. At this moment only AF_INET ("udp" and "tcp") is supported because others need rewrites of ACL handling and yp clients. - Add '-h addr' to specify addresses to bind to. - Convert _msgout() to use variable argument lists and remove asprintf() for error strings. - Remove register storage class specifier. Discussed with: kuriyama MFC after: 1 week Modified: head/usr.sbin/ypserv/yp_main.c head/usr.sbin/ypserv/ypserv.8 Modified: head/usr.sbin/ypserv/yp_main.c ============================================================================== --- head/usr.sbin/ypserv/yp_main.c Sun Dec 13 15:12:40 2009 (r200477) +++ head/usr.sbin/ypserv/yp_main.c Sun Dec 13 15:19:01 2009 (r200478) @@ -40,25 +40,30 @@ __FBSDID("$FreeBSD$"); * rpcgen.new, and later modified. */ +#include +#include +#include +#include #include "yp.h" #include #include #include #include #include +#include #include /* getenv, exit */ #include /* strcmp */ #include #include -#include /* for pmap_unset */ #ifdef __cplusplus #include /* getdtablesize, open */ #endif /* __cplusplus */ -#include #include -#include +#include #include "yp_extern.h" +#include #include +#include #ifndef SIG_PF #define SIG_PF void(*)(int) @@ -68,14 +73,17 @@ __FBSDID("$FreeBSD$"); int _rpcpmstart; /* Started by a port monitor ? */ static int _rpcfdtype; /* Whether Stream or Datagram ? */ +static int _rpcaf; +static int _rpcfd; + /* States a server can be in wrt request */ #define _IDLE 0 #define _SERVED 1 #define _SERVING 2 -extern void ypprog_1(struct svc_req *, register SVCXPRT *); -extern void ypprog_2(struct svc_req *, register SVCXPRT *); +extern void ypprog_1(struct svc_req *, SVCXPRT *); +extern void ypprog_2(struct svc_req *, SVCXPRT *); extern int _rpc_dtablesize(void); extern int _rpcsvcstate; /* Set when a request is serviced */ char *progname = "ypserv"; @@ -84,26 +92,37 @@ char *yp_dir = _PATH_YP; int do_dns = 0; int resfd; -struct socktype { - const char *st_name; - int st_type; +struct socklistent { + int sle_sock; + struct sockaddr_storage sle_ss; + SLIST_ENTRY(socklistent) sle_next; }; -static struct socktype stlist[] = { - { "tcp", SOCK_STREAM }, - { "udp", SOCK_DGRAM }, - { NULL, 0 } +static SLIST_HEAD(, socklistent) sle_head = + SLIST_HEAD_INITIALIZER(&sle_head); + +struct bindaddrlistent { + const char *ble_hostname; + SLIST_ENTRY(bindaddrlistent) ble_next; }; +static SLIST_HEAD(, bindaddrlistent) ble_head = + SLIST_HEAD_INITIALIZER(&ble_head); + +static char *servname = "0"; static -void _msgout(char* msg) +void _msgout(char* msg, ...) { + va_list ap; + + va_start(ap, msg); if (debug) { if (_rpcpmstart) - syslog(LOG_ERR, "%s", msg); + vsyslog(LOG_ERR, msg, ap); else - warnx("%s", msg); + vwarnx(msg, ap); } else - syslog(LOG_ERR, "%s", msg); + vsyslog(LOG_ERR, msg, ap); + va_end(ap); } pid_t yp_pid; @@ -162,8 +181,8 @@ yp_svc_run(void) static void unregister(void) { - (void) pmap_unset(YPPROG, YPVERS); - (void) pmap_unset(YPPROG, YPOLDVERS); + (void)svc_unreg(YPPROG, YPVERS); + (void)svc_unreg(YPPROG, YPOLDVERS); } static void @@ -231,24 +250,222 @@ closedown(int sig) (void) alarm(_RPCSVC_CLOSEDOWN/2); } +static int +create_service(const int sock, const struct netconfig *nconf, + const struct __rpc_sockinfo *si) +{ + int error; + + SVCXPRT *transp; + struct addrinfo hints, *res, *res0; + struct socklistent *slep; + struct bindaddrlistent *blep; + struct netbuf svcaddr; + + SLIST_INIT(&sle_head); + memset(&hints, 0, sizeof(hints)); + memset(&svcaddr, 0, sizeof(svcaddr)); + + hints.ai_family = si->si_af; + hints.ai_socktype = si->si_socktype; + hints.ai_protocol = si->si_proto; + + /* + * Build socketlist from bindaddrlist. + */ + if (sock == RPC_ANYFD) { + SLIST_FOREACH(blep, &ble_head, ble_next) { + if (blep->ble_hostname == NULL) + hints.ai_flags = AI_PASSIVE; + else + hints.ai_flags = 0; + error = getaddrinfo(blep->ble_hostname, servname, + &hints, &res0); + if (error) { + _msgout("getaddrinfo(): %s", + gai_strerror(error)); + return -1; + } + for (res = res0; res; res = res->ai_next) { + int s; + + s = __rpc_nconf2fd(nconf); + if (s < 0) { + if (errno == EPROTONOSUPPORT) + _msgout("unsupported" + " transport: %s", + nconf->nc_netid); + else + _msgout("cannot create" + " %s socket: %s", + nconf->nc_netid, + strerror(errno)); + freeaddrinfo(res0); + return -1; + } + if (bind(s, res->ai_addr, + res->ai_addrlen) == -1) { + _msgout("cannot bind %s socket: %s", + nconf->nc_netid, strerror(errno)); + freeaddrinfo(res0); + close(sock); + return -1; + } + if (nconf->nc_semantics != NC_TPI_CLTS) + listen(s, SOMAXCONN); + + slep = malloc(sizeof(*slep)); + if (slep == NULL) { + _msgout("malloc failed: %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + memset(slep, 0, sizeof(*slep)); + memcpy(&slep->sle_ss, + (struct sockaddr *)(res->ai_addr), + sizeof(res->ai_addr)); + slep->sle_sock = s; + SLIST_INSERT_HEAD(&sle_head, slep, sle_next); + + /* + * If servname == "0", redefine it by using + * the bound socket. + */ + if (strncmp("0", servname, 1) == 0) { + struct sockaddr *sap; + socklen_t slen; + char *sname; + + sname = malloc(NI_MAXSERV); + if (sname == NULL) { + _msgout("malloc(): %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + memset(sname, 0, NI_MAXSERV); + + sap = (struct sockaddr *)&slep->sle_ss; + slen = sizeof(*sap); + error = getsockname(s, sap, &slen); + if (error) { + _msgout("getsockname(): %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + error = getnameinfo(sap, slen, + NULL, 0, + sname, NI_MAXSERV, + NI_NUMERICHOST | NI_NUMERICSERV); + if (error) { + _msgout("getnameinfo(): %s", + strerror(errno)); + freeaddrinfo(res0); + close(s); + return -1; + } + servname = sname; + } + } + freeaddrinfo(res0); + } + } else { + slep = malloc(sizeof(*slep)); + if (slep == NULL) { + _msgout("malloc failed: %s", strerror(errno)); + return -1; + } + memset(slep, 0, sizeof(*slep)); + slep->sle_sock = sock; + SLIST_INSERT_HEAD(&sle_head, slep, sle_next); + } + + /* + * Traverse socketlist and create rpc service handles for each socket. + */ + SLIST_FOREACH(slep, &sle_head, sle_next) { + if (nconf->nc_semantics == NC_TPI_CLTS) + transp = svc_dg_create(slep->sle_sock, 0, 0); + else + transp = svc_vc_create(slep->sle_sock, RPC_MAXDATASIZE, + RPC_MAXDATASIZE); + if (transp == NULL) { + _msgout("unable to create service: %s", + nconf->nc_netid); + continue; + } + if (!svc_reg(transp, YPPROG, YPOLDVERS, ypprog_1, NULL)) { + svc_destroy(transp); + close(slep->sle_sock); + _msgout("unable to register (YPPROG, YPOLDVERS, %s):" + " %s", nconf->nc_netid, strerror(errno)); + continue; + } + if (!svc_reg(transp, YPPROG, YPVERS, ypprog_2, NULL)) { + svc_destroy(transp); + close(slep->sle_sock); + _msgout("unable to register (YPPROG, YPVERS, %s): %s", + nconf->nc_netid, strerror(errno)); + continue; + } + } + while(!(SLIST_EMPTY(&sle_head))) + SLIST_REMOVE_HEAD(&sle_head, sle_next); + + /* + * Register RPC service to rpcbind by using AI_PASSIVE address. + */ + hints.ai_flags = AI_PASSIVE; + error = getaddrinfo(NULL, servname, &hints, &res0); + if (error) { + _msgout("getaddrinfo(): %s", gai_strerror(error)); + return -1; + } + svcaddr.buf = res0->ai_addr; + svcaddr.len = res0->ai_addrlen; + + if (si->si_af == AF_INET) { + /* XXX: ignore error intentionally */ + rpcb_set(YPPROG, YPOLDVERS, nconf, &svcaddr); + } + /* XXX: ignore error intentionally */ + rpcb_set(YPPROG, YPVERS, nconf, &svcaddr); + + freeaddrinfo(res0); + return 0; +} + int main(int argc, char *argv[]) { - register SVCXPRT *transp = NULL; - int sock; - int proto = 0; - struct sockaddr_in saddr; - socklen_t asize = sizeof (saddr); int ch; - in_port_t yp_port = 0; - char *errstr; - struct socktype *st; + int error; + + void *nc_handle; + struct netconfig *nconf; + struct __rpc_sockinfo si; + struct bindaddrlistent *blep; + + memset(&si, 0, sizeof(si)); + SLIST_INIT(&ble_head); - while ((ch = getopt(argc, argv, "hdnp:P:")) != -1) { + while ((ch = getopt(argc, argv, "dh:np:P:")) != -1) { switch (ch) { case 'd': debug = ypdb_debug = 1; break; + case 'h': + blep = malloc(sizeof(*blep)); + if (blep == NULL) + err(1, "malloc() failed: -h %s", optarg); + blep->ble_hostname = optarg; + SLIST_INSERT_HEAD(&ble_head, blep, ble_next); + break; case 'n': do_dns = 1; break; @@ -256,121 +473,79 @@ main(int argc, char *argv[]) yp_dir = optarg; break; case 'P': - yp_port = (in_port_t)strtonum(optarg, 1, 65535, - (const char **)&errstr); - if (yp_port == 0 && errstr != NULL) { - _msgout("invalid port number provided"); - exit(1); - } + servname = optarg; break; - case 'h': default: usage(); } } + /* + * Add "anyaddr" entry if no -h is specified. + */ + if (SLIST_EMPTY(&ble_head)) { + blep = malloc(sizeof(*blep)); + if (blep == NULL) + err(1, "malloc() failed"); + memset(blep, 0, sizeof(*blep)); + SLIST_INSERT_HEAD(&ble_head, blep, ble_next); + } load_securenets(); yp_init_resolver(); #ifdef DB_CACHE yp_init_dbs(); #endif - if (getsockname(0, (struct sockaddr *)&saddr, &asize) == 0) { - int ssize = sizeof (int); - - if (saddr.sin_family != AF_INET) - exit(1); - if (getsockopt(0, SOL_SOCKET, SO_TYPE, - (char *)&_rpcfdtype, &ssize) == -1) - exit(1); - sock = 0; + nc_handle = setnetconfig(); + if (nc_handle == NULL) + err(1, "cannot read %s", NETCONFIG); + if (__rpc_fd2sockinfo(0, &si) != 0) { + /* invoked from inetd */ _rpcpmstart = 1; - proto = 0; + _rpcfdtype = si.si_socktype; + _rpcaf = si.si_af; + _rpcfd = 0; openlog("ypserv", LOG_PID, LOG_DAEMON); } else { + /* standalone mode */ if (!debug) { if (daemon(0,0)) { err(1,"cannot fork"); } openlog("ypserv", LOG_PID, LOG_DAEMON); } - sock = RPC_ANYSOCK; - (void) pmap_unset(YPPROG, YPVERS); - (void) pmap_unset(YPPROG, YPOLDVERS); + _rpcpmstart = 0; + _rpcaf = AF_INET; + _rpcfd = RPC_ANYFD; + unregister(); } /* - * Initialize TCP/UDP sockets. + * Create RPC service for each transport. */ - memset((char *)&saddr, 0, sizeof(saddr)); - saddr.sin_family = AF_INET; - saddr.sin_addr.s_addr = htonl(INADDR_ANY); - saddr.sin_port = htons(yp_port); - for (st = stlist; st->st_name != NULL; st++) { - /* Do not bind the socket if the user didn't specify a port */ - if (yp_port == 0) - break; - - sock = socket(AF_INET, st->st_type, 0); - if (sock == -1) { - if ((asprintf(&errstr, "cannot create a %s socket", - st->st_name)) == -1) - err(1, "unexpected failure in asprintf()"); - _msgout(errstr); - free((void *)errstr); - exit(1); - } - if (bind(sock, (struct sockaddr *) &saddr, sizeof(saddr)) - == -1) { - if ((asprintf(&errstr, "cannot bind %s socket", - st->st_name)) == -1) - err(1, "unexpected failure in asprintf()"); - _msgout(errstr); - free((void *)errstr); - exit(1); - } - errstr = NULL; - } - - if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_DGRAM)) { - transp = svcudp_create(sock); - if (transp == NULL) { - _msgout("cannot create udp service"); - exit(1); - } - if (!_rpcpmstart) - proto = IPPROTO_UDP; - if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) { - _msgout("unable to register (YPPROG, YPOLDVERS, udp)"); - exit(1); - } - if (!svc_register(transp, YPPROG, YPVERS, ypprog_2, proto)) { - _msgout("unable to register (YPPROG, YPVERS, udp)"); - exit(1); - } - } - - if ((_rpcfdtype == 0) || (_rpcfdtype == SOCK_STREAM)) { - transp = svctcp_create(sock, 0, 0); - if (transp == NULL) { - _msgout("cannot create tcp service"); - exit(1); - } - if (!_rpcpmstart) - proto = IPPROTO_TCP; - if (!svc_register(transp, YPPROG, YPOLDVERS, ypprog_1, proto)) { - _msgout("unable to register (YPPROG, YPOLDVERS, tcp)"); - exit(1); - } - if (!svc_register(transp, YPPROG, YPVERS, ypprog_2, proto)) { - _msgout("unable to register (YPPROG, YPVERS, tcp)"); - exit(1); + while((nconf = getnetconfig(nc_handle))) { + if ((nconf->nc_flag & NC_VISIBLE)) { + if (__rpc_nconf2sockinfo(nconf, &si) == 0) { + _msgout("cannot get information for %s", + nconf->nc_netid); + exit(1); + } + if (_rpcpmstart) { + if (si.si_socktype != _rpcfdtype || + si.si_af != _rpcaf) + continue; + } else if (si.si_af != _rpcaf) + continue; + error = create_service(_rpcfd, nconf, &si); + if (error) { + endnetconfig(nc_handle); + exit(1); + } } } + endnetconfig(nc_handle); + while(!(SLIST_EMPTY(&ble_head))) + SLIST_REMOVE_HEAD(&ble_head, ble_next); - if (transp == (SVCXPRT *)NULL) { - _msgout("could not create a handle"); - exit(1); - } if (_rpcpmstart) { (void) signal(SIGALRM, (SIG_PF) closedown); (void) alarm(_RPCSVC_CLOSEDOWN/2); Modified: head/usr.sbin/ypserv/ypserv.8 ============================================================================== --- head/usr.sbin/ypserv/ypserv.8 Sun Dec 13 15:12:40 2009 (r200477) +++ head/usr.sbin/ypserv/ypserv.8 Sun Dec 13 15:19:01 2009 (r200478) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd December 13, 2009 .Dt YPSERV 8 .Os .Sh NAME @@ -408,6 +408,15 @@ in subprocesses, allowing the parent ser other requests.) This makes it easier to trace the server with a debugging tool. +.It Fl h Ar addr +Specify a specific address to bind to for requests. This option may be +specified multiple times. If no +.Fl h +option is specified, +.Nm +will bind to default passive address +.Pq e.g. INADDR_ANY for IPv4 +for each transport. .It Fl P Ar port Force ypserv to bind to a specific TCP/UDP port, rather than selecting its own. From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 16:04:47 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9F781065672; Sun, 13 Dec 2009 16:04:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 5285E8FC0C; Sun, 13 Dec 2009 16:04:47 +0000 (UTC) Received: from c220-239-235-116.carlnfd3.nsw.optusnet.com.au (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBDG4hI4004213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 03:04:45 +1100 Date: Mon, 14 Dec 2009 03:04:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Xin LI In-Reply-To: <200912130314.nBD3E6pO071938@svn.freebsd.org> Message-ID: <20091214025232.H33073@delplex.bde.org> References: <200912130314.nBD3E6pO071938@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200462 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 16:04:47 -0000 On Sun, 13 Dec 2009, Xin LI wrote: > Log: > Revert most part of 200420 as requested, as more review and polish is > needed. Thanks. Look at removing includes of time.h last -- the nesting and pollution of time.h, sys/time.h, sys/[_]timespec.h, sys/[_]timeval.h, and headers for other APIs using timevals and/or timespecs is most convoluted, starting with sys/time.h vs time.h being mostly backwards (sys/time.h includes time.h if !_KERNEL...). Bruce From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 16:45:46 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E71C1065670; Sun, 13 Dec 2009 16:45:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 144798FC15; Sun, 13 Dec 2009 16:45:45 +0000 (UTC) Received: from c220-239-235-116.carlnfd3.nsw.optusnet.com.au (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBDGjgW6005647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 03:45:43 +1100 Date: Mon, 14 Dec 2009 03:45:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Xin LI In-Reply-To: <200912130334.nBD3YJbO072556@svn.freebsd.org> Message-ID: <20091214031938.E33347@delplex.bde.org> References: <200912130334.nBD3YJbO072556@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200465 - head/usr.bin/xinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 16:45:46 -0000 On Sun, 13 Dec 2009, Xin LI wrote: > Log: > Staticify internal functions and make usage() a prototype. Please actually declare them static. > Modified: head/usr.bin/xinstall/xinstall.c > ============================================================================== > --- head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:29:05 2009 (r200464) > +++ head/usr.bin/xinstall/xinstall.c Sun Dec 13 03:34:19 2009 (r200465) > @@ -86,16 +86,16 @@ int dobackup, docompare, dodir, dopreser > mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; > const char *suffix = BACKUP_SUFFIX; > > -void copy(int, const char *, int, const char *, off_t); > -int compare(int, const char *, size_t, int, const char *, size_t); > -int create_newfile(const char *, int, struct stat *); > -int create_tempfile(const char *, char *, size_t); > -void install(const char *, const char *, u_long, u_int); > -void install_dir(char *); > -u_long numeric_id(const char *, const char *); > -void strip(const char *); > -int trymmap(int); > -void usage(void); > +static void copy(int, const char *, int, const char *, off_t); > +static int compare(int, const char *, size_t, int, const char *, size_t); Sorting errors like copy < compare could be fixed when making changes to all the prototypes like this. > +static int create_newfile(const char *, int, struct stat *); > +static int create_tempfile(const char *, char *, size_t); > +static void install(const char *, const char *, u_long, u_int); > +static void install_dir(char *); > +static u_long numeric_id(const char *, const char *); > +static void strip(const char *); > +static int trymmap(int); > +static void usage(void); > > int > main(int argc, char *argv[]) > @@ -771,7 +771,7 @@ install_dir(char *path) > * print a usage message and die > */ > void > -usage() > +usage(void) > { > (void)fprintf(stderr, > "usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n" It is a good obfuscation to declare functions as static only in the prototype, so that you can't see the static for the actual function. The reverse obfuscation (with static only in the function definition) would make more sense, but is a constraint error. (C99 allows building up a declaration by accumulating type or linkage details in some cases but not here. Last time I checked, gcc didn't understand this, and warns about "redundant redeclarations" for non-redundant non-re declarations.) With C90 function definitions (not prototypes!) and almost all functions staticized, most of foward declarations involving prototypes are unnecessary. We couldn't agree if style requires having them (it is sometimes useful to have a complete list of static functions as prototypes near the top of the file). We should agree before large staicization sweeps. The bad style of having everything extern, combined prototyping all extern functions, left us many thousands of lines of non-static prototypes near the tops of files. (In 4.4BSD, prototypes had to be done like that, using __P(()), even for static functions, since that was the only reasonable way to ifdef prototypes. After use of __P(()) was removed, extern prototypes still had to be done like that since -Wmissing-prototypes forces it at high WARNS even for functions that should be static and are defined before they are called. But static prototypes don't have to be done like that.) Bruce From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 17:31:52 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 443D5106566B; Sun, 13 Dec 2009 17:31:52 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id DCBFE8FC0C; Sun, 13 Dec 2009 17:31:51 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.3/8.14.3) with ESMTP id nBDHVmrm033982; Sun, 13 Dec 2009 12:31:48 -0500 (EST) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.3/8.14.3/Submit) id nBDHVmGZ033978; Sun, 13 Dec 2009 12:31:48 -0500 (EST) (envelope-from wollman) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <19237.9476.489430.11780@hergotha.csail.mit.edu> Date: Sun, 13 Dec 2009 12:31:48 -0500 From: Garrett Wollman To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <86pr6jjd29.fsf@ds4.des.no> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> X-Mailer: VM 7.17 under 21.4 (patch 21) "Educational Television" XEmacs Lucid X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hergotha.csail.mit.edu [127.0.0.1]); Sun, 13 Dec 2009 12:31:49 -0500 (EST) X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hergotha.csail.mit.edu Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 17:31:52 -0000 < said: > It's not "what Linux does", it's what xterm does. It's also, not to put too fine a point on it, obnoxious and stupid. Let's please have the useful behavior. There's a good reason why our "xterm" termcap entry has never had this bogus behavior enabled (except for brief periods after someone "updates" termcap). -GAWollman From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 18:19:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE9FB106566B; Sun, 13 Dec 2009 18:19:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2588FC16; Sun, 13 Dec 2009 18:19:41 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 88EED1CC5D; Sun, 13 Dec 2009 19:19:40 +0100 (CET) Date: Sun, 13 Dec 2009 19:19:40 +0100 From: Ed Schouten To: Andriy Gapon Message-ID: <20091213181940.GR64905@hoeg.nl> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B236520.7040204@freebsd.org> <20091212095118.GN64905@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xGBdya926SPBMGqW" Content-Disposition: inline In-Reply-To: <20091212095118.GN64905@hoeg.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Christoph Mallon , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:19:42 -0000 --xGBdya926SPBMGqW Content-Type: multipart/mixed; boundary="jphhXT5dWBdc8q08" Content-Disposition: inline --jphhXT5dWBdc8q08 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > * Andriy Gapon wrote: > > Seriously, I think that this change is a mild POLA violation, which > > neither was discussed nor welcome as it seems. Perhaps, not even > > planned. So I believe that termcap should be changed back to > > traditional behavior for FreeBSD. At least for now. >=20 > Sure. It wasn't planned to do so. >=20 > I can't fix it right now (sitting at a conference, as we speak), but > I'll try to get a patch into SVN tomorrow. I've attached a patch that fixes at least the TERM=3Dxterm and TERM=3Dxterm-color entries. Comments? --=20 Ed Schouten WWW: http://80386.nl/ --jphhXT5dWBdc8q08 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="termcap.diff" Index: share/termcap/termcap.src =================================================================== --- share/termcap/termcap.src (revision 200435) +++ share/termcap/termcap.src (working copy) @@ -2862,7 +2862,7 @@ # be painted in spots. xterm-color|generic "ANSI" color xterm:\ :Co#8:NC@:pa#64:\ - :AB=\E[4%dm:AF=\E[3%dm:ac=:op=\E[m:tc=xterm-r6: + :AB=\E[4%dm:AF=\E[3%dm:ac=:op=\E[m:te@:ti@:tc=xterm-r6: # # These aliases are for compatibility with the terminfo; termcap cannot provide # the extra features such as color initialization, but termcap applications @@ -2985,7 +2985,7 @@ # is widely used for a variety of incompatible terminal emulations including # color_xterm and rxvt. xterm|X11 terminal emulator:\ - :tc=xterm-new: + :te@:ti@:tc=xterm-new: # :tc=xterm-r6: # dtterm termcap entry - Obtained from Xinside's CDE with permission # from Thomas Roell Index: etc/termcap.small =================================================================== --- etc/termcap.small (revision 200435) +++ etc/termcap.small (working copy) @@ -319,4 +319,4 @@ # is widely used for a variety of incompatible terminal emulations including # color_xterm and rxvt. xterm|X11 terminal emulator:\ - :tc=xterm-new: + :te@:ti@:tc=xterm-new: --jphhXT5dWBdc8q08-- --xGBdya926SPBMGqW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkslMDwACgkQ52SDGA2eCwU+1wCeIsrQxGfFKnDkjE6R9qYsquMe XrYAni/P6j8m2jJTsqC8WOUAbncAycms =OYc4 -----END PGP SIGNATURE----- --xGBdya926SPBMGqW-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 18:24:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EDBB106568B for ; Sun, 13 Dec 2009 18:24:21 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 34A458FC08 for ; Sun, 13 Dec 2009 18:24:21 +0000 (UTC) Received: from c83-255-48-78.bredband.comhem.se ([83.255.48.78]:59892 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1NJt5w-00035N-8U for svn-src-head@freebsd.org; Sun, 13 Dec 2009 19:23:02 +0100 Received: (qmail 4190 invoked by uid 1001); 13 Dec 2009 19:22:57 +0100 Date: Sun, 13 Dec 2009 19:22:56 +0100 From: Erik Trulsson To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20091213182256.GA4117@falcon.midgard.homeip.net> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <86pr6jjd29.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.255.48.78 X-Scan-Result: No virus found in message 1NJt5w-00035N-8U. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1NJt5w-00035N-8U 0900e6f74425a7a272683ec051e72694 Cc: Doug Barton , Hajimu UMEMOTO , svn-src-all@freebsd.org, Garrett Wollman , src-committers@freebsd.org, Ronald Klop , svn-src-head@freebsd.org, Christoph Mallon Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:24:21 -0000 On Sun, Dec 13, 2009 at 01:03:42PM +0100, Dag-Erling Sm=F8rgrav wrote: > Doug Barton writes: > > To be clear, I am NOT asking for a backout ... IIRC in the thread that > > discussed this issue there were quite a few people who thought that > > FreeBSD not clearing the screen was a POLA violation since that's what > > linux does, and it's what most people are used to. >=20 > It's not "what Linux does", it's what xterm does. Xterm did not > originate with Linux; in fact, it predates Linux by about ten years. > FreeBSD's xterm entry was deliberately crippled to lie about xterm's > capabilities. Actually it is when the 'ti'/'te' termcap entries are *provided* that one lies about xterm's capabilities. The presence of the 'ti'/'te' termcap capabilities implies that programs must use them when entering/leaving full-screen mode. (Some terminal types need to be in some special mode to allow you to move around the cursor to arbitrary positions.) This is not needed for xterm, and therefore those capabilities should not appear in the termcap entry for xterm. --=20 Erik Trulsson ertr1013@student.uu.se From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 18:26:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8B44106566B; Sun, 13 Dec 2009 18:26:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7CF88FC16; Sun, 13 Dec 2009 18:26:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDIQJmV093848; Sun, 13 Dec 2009 18:26:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDIQJWa093845; Sun, 13 Dec 2009 18:26:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912131826.nBDIQJWa093845@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 18:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200481 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:26:19 -0000 Author: marius Date: Sun Dec 13 18:26:19 2009 New Revision: 200481 URL: http://svn.freebsd.org/changeset/base/200481 Log: Specify the capability and media bits of the capabilities page in native, i.e. big-endian, format and convert as appropriate like we also do with the multibyte fields of the other pages. This fixes the output of acd_describe() to match reality on big-endian machines without breaking it on little-endian ones. While at it, also convert the remaining multibyte fields of the pages read although they are currently unused for consistency and in order to prevent possible similar bugs in the future. MFC after: 1 week Modified: head/sys/dev/ata/atapi-cd.c head/sys/dev/ata/atapi-cd.h Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Sun Dec 13 17:49:22 2009 (r200480) +++ head/sys/dev/ata/atapi-cd.c Sun Dec 13 18:26:19 2009 (r200481) @@ -1206,6 +1206,7 @@ acd_read_track_info(device_t dev, int32_ if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), ATA_R_READ, 30))) return error; + info->data_length = ntohs(info->data_length); info->track_start_addr = ntohl(info->track_start_addr); info->next_writeable_addr = ntohl(info->next_writeable_addr); info->free_blocks = ntohl(info->free_blocks); @@ -1644,12 +1645,17 @@ acd_get_cap(device_t dev) for (count = 0 ; count < 5 ; count++) { if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), ATA_R_READ | ATA_R_QUIET, 5)) { + cdp->cap.data_length = ntohs(cdp->cap.data_length); + cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); + cdp->cap.media = ntohs(cdp->cap.media); + cdp->cap.capabilities = ntohs(cdp->cap.capabilities); cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); + cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); + cdp->cap.buf_size = ntohs(cdp->cap.buf_size); cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); cdp->cap.cur_write_speed = max(ntohs(cdp->cap.cur_write_speed),177); - cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); - cdp->cap.buf_size = ntohs(cdp->cap.buf_size); + cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); } } } Modified: head/sys/dev/ata/atapi-cd.h ============================================================================== --- head/sys/dev/ata/atapi-cd.h Sun Dec 13 17:49:22 2009 (r200480) +++ head/sys/dev/ata/atapi-cd.h Sun Dec 13 18:26:19 2009 (r200481) @@ -112,34 +112,34 @@ struct cappage { u_int8_t param_len; u_int16_t media; -#define MST_READ_CDR 0x0001 -#define MST_READ_CDRW 0x0002 -#define MST_READ_PACKET 0x0004 -#define MST_READ_DVDROM 0x0008 -#define MST_READ_DVDR 0x0010 -#define MST_READ_DVDRAM 0x0020 -#define MST_WRITE_CDR 0x0100 -#define MST_WRITE_CDRW 0x0200 -#define MST_WRITE_TEST 0x0400 -#define MST_WRITE_DVDR 0x1000 -#define MST_WRITE_DVDRAM 0x2000 +#define MST_READ_CDR 0x0100 +#define MST_READ_CDRW 0x0200 +#define MST_READ_PACKET 0x0400 +#define MST_READ_DVDROM 0x0800 +#define MST_READ_DVDR 0x1000 +#define MST_READ_DVDRAM 0x2000 +#define MST_WRITE_CDR 0x0001 +#define MST_WRITE_CDRW 0x0002 +#define MST_WRITE_TEST 0x0004 +#define MST_WRITE_DVDR 0x0010 +#define MST_WRITE_DVDRAM 0x0020 u_int16_t capabilities; -#define MST_AUDIO_PLAY 0x0001 -#define MST_COMPOSITE 0x0002 -#define MST_AUDIO_P1 0x0004 -#define MST_AUDIO_P2 0x0008 -#define MST_MODE2_f1 0x0010 -#define MST_MODE2_f2 0x0020 -#define MST_MULTISESSION 0x0040 -#define MST_BURNPROOF 0x0080 -#define MST_READ_CDDA 0x0100 -#define MST_CDDA_STREAM 0x0200 -#define MST_COMBINED_RW 0x0400 -#define MST_CORRECTED_RW 0x0800 -#define MST_SUPPORT_C2 0x1000 -#define MST_ISRC 0x2000 -#define MST_UPC 0x4000 +#define MST_AUDIO_PLAY 0x0100 +#define MST_COMPOSITE 0x0200 +#define MST_AUDIO_P1 0x0400 +#define MST_AUDIO_P2 0x0800 +#define MST_MODE2_f1 0x1000 +#define MST_MODE2_f2 0x2000 +#define MST_MULTISESSION 0x4000 +#define MST_BURNPROOF 0x8000 +#define MST_READ_CDDA 0x0001 +#define MST_CDDA_STREAM 0x0002 +#define MST_COMBINED_RW 0x0004 +#define MST_CORRECTED_RW 0x0008 +#define MST_SUPPORT_C2 0x0010 +#define MST_ISRC 0x0020 +#define MST_UPC 0x0040 u_int8_t mechanism; #define MST_LOCKABLE 0x01 From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 18:32:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37DC51065693; Sun, 13 Dec 2009 18:32:08 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id DEFAD8FC13; Sun, 13 Dec 2009 18:32:07 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id nBDIA1LF028473; Sun, 13 Dec 2009 13:10:01 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Sun, 13 Dec 2009 13:10:01 -0500 (EST) Date: Sun, 13 Dec 2009 13:10:01 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Garrett Wollman In-Reply-To: <19237.9476.489430.11780@hergotha.csail.mit.edu> Message-ID: References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> <19237.9476.489430.11780@hergotha.csail.mit.edu> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-1260727801=:11994" Cc: svn-src-head@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:32:08 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-1804928587-1260727801=:11994 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 13 Dec 2009, Garrett Wollman wrote: > < said: > >> It's not "what Linux does", it's what xterm does. > > It's also, not to put too fine a point on it, obnoxious and stupid. > > Let's please have the useful behavior. There's a good reason why > our "xterm" termcap entry has never had this bogus behavior enabled > (except for brief periods after someone "updates" termcap). I agree. Please, please, keep the useful behavior. I think Solaris must also have similar xterm entries, as I haven't had the silly clear screen behavior on Solaris 2.4 through Solaris 10. --=20 DE ---559023410-1804928587-1260727801=:11994-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 18:42:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADF93106568B; Sun, 13 Dec 2009 18:42:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 839A28FC08; Sun, 13 Dec 2009 18:42:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDIg65X094159; Sun, 13 Dec 2009 18:42:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDIg67B094157; Sun, 13 Dec 2009 18:42:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912131842.nBDIg67B094157@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 18:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200482 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 18:42:06 -0000 Author: marius Date: Sun Dec 13 18:42:06 2009 New Revision: 200482 URL: http://svn.freebsd.org/changeset/base/200482 Log: Properly support M5229 revision 0xc7 and 0xc8: - These revisions no longer have cable detection capability. - The UDMA support bit of register 0x4b has been dropped without an replacement. - According to Linux it's crucial for working ATAPI DMA support to also set the reserved bit 1 of regsiter 0x53 with these revisions. MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 18:26:19 2009 (r200481) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 18:42:06 2009 (r200482) @@ -141,11 +141,14 @@ ata_ali_chipinit(device_t dev) /* use device interrupt as byte count end */ pci_write_config(dev, 0x4a, pci_read_config(dev, 0x4a, 1) | 0x20, 1); - /* enable cable detection and UDMA support on newer chips */ - pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | 0x09, 1); - - /* enable ATAPI UDMA mode */ - pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | 0x01, 1); + /* enable cable detection and UDMA support on revisions < 0xc7 */ + if (ctlr->chip->chiprev < 0xc7) + pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | + 0x09, 1); + + /* enable ATAPI UDMA mode (even if we are going to do PIO) */ + pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | + (ctlr->chip->chiprev >= 0xc7 ? 0x03 : 0x01), 1); /* only chips with revision > 0xc4 can do 48bit DMA */ if (ctlr->chip->chiprev <= 0xc4) @@ -276,7 +279,7 @@ ata_ali_setmode(device_t dev, int target mode = min(mode, ctlr->chip->max_dma); - if (ctlr->chip->cfg2 & ALI_NEW) { + if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) { if (mode > ATA_UDMA2 && pci_read_config(parent, 0x4a, 1) & (1 << ch->unit)) { ata_print_cable(dev, "controller"); From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 19:44:14 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78A42106566B; Sun, 13 Dec 2009 19:44:14 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 260728FC0C; Sun, 13 Dec 2009 19:44:13 +0000 (UTC) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id nBDJiDYU041792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Dec 2009 11:44:13 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <4B25440D.3050107@errno.com> Date: Sun, 13 Dec 2009 11:44:13 -0800 From: Sam Leffler User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Marius Strobl References: <200912131826.nBDIQJWa093845@svn.freebsd.org> In-Reply-To: <200912131826.nBDIQJWa093845@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200481 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 19:44:14 -0000 Marius Strobl wrote: > Author: marius > Date: Sun Dec 13 18:26:19 2009 > New Revision: 200481 > URL: http://svn.freebsd.org/changeset/base/200481 > > Log: > Specify the capability and media bits of the capabilities page in > native, i.e. big-endian, format and convert as appropriate like we > also do with the multibyte fields of the other pages. This fixes > the output of acd_describe() to match reality on big-endian machines > without breaking it on little-endian ones. While at it, also convert > the remaining multibyte fields of the pages read although they are > currently unused for consistency and in order to prevent possible > similar bugs in the future. > > MFC after: 1 week > > Modified: > head/sys/dev/ata/atapi-cd.c > head/sys/dev/ata/atapi-cd.h > > Modified: head/sys/dev/ata/atapi-cd.c > ============================================================================== > --- head/sys/dev/ata/atapi-cd.c Sun Dec 13 17:49:22 2009 (r200480) > +++ head/sys/dev/ata/atapi-cd.c Sun Dec 13 18:26:19 2009 (r200481) > @@ -1206,6 +1206,7 @@ acd_read_track_info(device_t dev, int32_ > if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), > ATA_R_READ, 30))) > return error; > + info->data_length = ntohs(info->data_length); > info->track_start_addr = ntohl(info->track_start_addr); > info->next_writeable_addr = ntohl(info->next_writeable_addr); > info->free_blocks = ntohl(info->free_blocks); > @@ -1644,12 +1645,17 @@ acd_get_cap(device_t dev) > for (count = 0 ; count < 5 ; count++) { > if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), > ATA_R_READ | ATA_R_QUIET, 5)) { > + cdp->cap.data_length = ntohs(cdp->cap.data_length); > + cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); > + cdp->cap.media = ntohs(cdp->cap.media); > + cdp->cap.capabilities = ntohs(cdp->cap.capabilities); > cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); > + cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > + cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); > cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); > cdp->cap.cur_write_speed = max(ntohs(cdp->cap.cur_write_speed),177); > - cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > - cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > + cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); > } > } > } I don't think this should use ntoh* but instead use le*/be* macros. Separately the ata code was very broken in it's handling of big-endian byte order; e.g. for arm I had to supply wrong bus space methods as a workaround. Do these changes take this byte-order confusion into account? Sam From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 20:16:51 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A0B01065692; Sun, 13 Dec 2009 20:16:51 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2308FC0A; Sun, 13 Dec 2009 20:16:50 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id nBDKGiTK063772; Sun, 13 Dec 2009 21:16:44 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id nBDKGiZD063771; Sun, 13 Dec 2009 21:16:44 +0100 (CET) (envelope-from marius) Date: Sun, 13 Dec 2009 21:16:43 +0100 From: Marius Strobl To: Sam Leffler Message-ID: <20091213201643.GH74529@alchemy.franken.de> References: <200912131826.nBDIQJWa093845@svn.freebsd.org> <4B25440D.3050107@errno.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B25440D.3050107@errno.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200481 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:16:51 -0000 On Sun, Dec 13, 2009 at 11:44:13AM -0800, Sam Leffler wrote: > Marius Strobl wrote: > >Author: marius > >Date: Sun Dec 13 18:26:19 2009 > >New Revision: 200481 > >URL: http://svn.freebsd.org/changeset/base/200481 > > > >Log: > > Specify the capability and media bits of the capabilities page in > > native, i.e. big-endian, format and convert as appropriate like we > > also do with the multibyte fields of the other pages. This fixes > > the output of acd_describe() to match reality on big-endian machines > > without breaking it on little-endian ones. While at it, also convert > > the remaining multibyte fields of the pages read although they are > > currently unused for consistency and in order to prevent possible > > similar bugs in the future. > > > > MFC after: 1 week > > > >Modified: > > head/sys/dev/ata/atapi-cd.c > > head/sys/dev/ata/atapi-cd.h > > > >Modified: head/sys/dev/ata/atapi-cd.c > >============================================================================== > >--- head/sys/dev/ata/atapi-cd.c Sun Dec 13 17:49:22 2009 (r200480) > >+++ head/sys/dev/ata/atapi-cd.c Sun Dec 13 18:26:19 2009 (r200481) > >@@ -1206,6 +1206,7 @@ acd_read_track_info(device_t dev, int32_ > > if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), > > ATA_R_READ, 30))) > > return error; > >+ info->data_length = ntohs(info->data_length); > > info->track_start_addr = ntohl(info->track_start_addr); > > info->next_writeable_addr = ntohl(info->next_writeable_addr); > > info->free_blocks = ntohl(info->free_blocks); > >@@ -1644,12 +1645,17 @@ acd_get_cap(device_t dev) > > for (count = 0 ; count < 5 ; count++) { > > if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), > > ATA_R_READ | ATA_R_QUIET, 5)) { > >+ cdp->cap.data_length = ntohs(cdp->cap.data_length); > >+ cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); > >+ cdp->cap.media = ntohs(cdp->cap.media); > >+ cdp->cap.capabilities = ntohs(cdp->cap.capabilities); > > cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); > >+ cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > >+ cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > > cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); > > cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); > > cdp->cap.cur_write_speed = > > max(ntohs(cdp->cap.cur_write_speed),177); > >- cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); > >- cdp->cap.buf_size = ntohs(cdp->cap.buf_size); > >+ cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); > > } > > } > > } > > I don't think this should use ntoh* but instead use le*/be* macros. > I agree but ata(4) uses hton*(9) and ntoh*(9) throughout its source so changing it to use bytorder(9) functions instead should be a separate style change. > Separately the ata code was very broken in it's handling of big-endian > byte order; e.g. for arm I had to supply wrong bus space methods as a > workaround. Do these changes take this byte-order confusion into account? > At least on sparc64 I haven't seen such problems. There all ATA controllers are PCI which uses little-endian bus space accessors. AFAICT at least atapi-cd(4) now does the right things as the native byteorder of the pages indeed is big-endian as explicitly mentioned in MMC-5. Marius From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 20:27:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A70F1065679; Sun, 13 Dec 2009 20:27:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682E78FC15; Sun, 13 Dec 2009 20:27:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDKRkwV096325; Sun, 13 Dec 2009 20:27:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDKRkhM096316; Sun, 13 Dec 2009 20:27:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912132027.nBDKRkhM096316@svn.freebsd.org> From: Robert Watson Date: Sun, 13 Dec 2009 20:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200483 - head/tools/regression/kqueue X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:27:46 -0000 Author: rwatson Date: Sun Dec 13 20:27:46 2009 New Revision: 200483 URL: http://svn.freebsd.org/changeset/base/200483 Log: Add Mark Heily's libkqueue test suite as a general kqueue test suite to tools/regression. It tests a number of aspects of kqueue behavior, although not all currently pass (possibly bugs in the test suite?). Submitted by: Mark Heily Obtained from: svn://mark.heily.com/libkqueue/trunk/test (r114) Added: head/tools/regression/kqueue/ head/tools/regression/kqueue/Makefile (contents, props changed) head/tools/regression/kqueue/common.h (contents, props changed) head/tools/regression/kqueue/config.h (contents, props changed) head/tools/regression/kqueue/main.c (contents, props changed) head/tools/regression/kqueue/proc.c (contents, props changed) head/tools/regression/kqueue/read.c (contents, props changed) head/tools/regression/kqueue/signal.c (contents, props changed) head/tools/regression/kqueue/timer.c (contents, props changed) head/tools/regression/kqueue/user.c (contents, props changed) head/tools/regression/kqueue/vnode.c (contents, props changed) Added: head/tools/regression/kqueue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/Makefile Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,21 @@ +# $FreeBSD$ +# +# svn://mark.heily.com/libkqueue/trunk/test +# Last update: r114 +# +# libkqueue and test suite by Mark Heily +# + +PROG=kqtest +SRCS= \ + main.c \ + read.c \ + timer.c \ + vnode.c \ + proc.c \ + signal.c \ + user.c +NO_MAN= +WARNS=2 + +.include "bsd.prog.mk" Added: head/tools/regression/kqueue/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/common.h Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#ifndef _COMMON_H +#define _COMMON_H + + +#if HAVE_ERR_H +# include +#else +# define err(rc,msg,...) do { perror(msg); exit(rc); } while (0) +# define errx(rc,msg,...) do { puts(msg); exit(rc); } while (0) +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "config.h" + +extern char *cur_test_id; +int vnode_fd; + +extern const char * kevent_to_str(struct kevent *); +struct kevent * kevent_get(int); + + +void kevent_cmp(struct kevent *, struct kevent *); + +void +kevent_add(int kqfd, struct kevent *kev, + uintptr_t ident, + short filter, + u_short flags, + u_int fflags, + intptr_t data, + void *udata); + +/* DEPRECATED: */ +#define KEV_CMP(kev,_ident,_filter,_flags) do { \ + if (kev.ident != (_ident) || \ + kev.filter != (_filter) || \ + kev.flags != (_flags)) \ + err(1, "kevent mismatch: got [%d,%d,%d] but expecting [%d,%d,%d]", \ + (int)_ident, (int)_filter, (int)_flags,\ + (int)kev.ident, kev.filter, kev.flags);\ +} while (0); + +/* Checks if any events are pending, which is an error. */ +extern void test_no_kevents(void); + +extern void test_begin(const char *); +extern void success(void); + +#endif /* _COMMON_H */ Added: head/tools/regression/kqueue/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/config.h Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,12 @@ +/* AUTOMATICALLY GENERATED -- DO NOT EDIT */ +/* $FreeBSD$ */ +#define HAVE_SYS_EVENT_H +#define HAVE_EV_DISPATCH 1 +#define HAVE_EV_RECEIPT 1 +#undef HAVE_NOTE_TRUNCATE +#define HAVE_EVFILT_TIMER 1 +#define HAVE_EVFILT_USER 1 +#define PROGRAM "libkqueue-test" +#define VERSION "0.1" +#define TARGET "freebsd" +#define CFLAGS "-g -O0 -Wall -Werror" Added: head/tools/regression/kqueue/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/main.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include + +#include "common.h" + +int testnum = 1; +char *cur_test_id = NULL; +int kqfd; + +extern void test_evfilt_read(); +extern void test_evfilt_signal(); +extern void test_evfilt_vnode(); +extern void test_evfilt_timer(); +extern void test_evfilt_proc(); +#if HAVE_EVFILT_USER +extern void test_evfilt_user(); +#endif + +/* Checks if any events are pending, which is an error. */ +void +test_no_kevents(void) +{ + int nfds; + struct timespec timeo; + struct kevent kev; + + puts("confirming that there are no events pending"); + memset(&timeo, 0, sizeof(timeo)); + nfds = kevent(kqfd, NULL, 0, &kev, 1, &timeo); + if (nfds != 0) { + puts("\nUnexpected event:"); + puts(kevent_to_str(&kev)); + errx(1, "%d event(s) pending, but none expected:", nfds); + } +} + +/* Retrieve a single kevent */ +struct kevent * +kevent_get(int kqfd) +{ + int nfds; + struct kevent *kev; + + if ((kev = calloc(1, sizeof(*kev))) == NULL) + err(1, "out of memory"); + + nfds = kevent(kqfd, NULL, 0, kev, 1, NULL); + if (nfds < 1) + err(1, "kevent(2)"); + + return (kev); +} + +char * +kevent_fflags_dump(struct kevent *kev) +{ + char *buf; + +#define KEVFFL_DUMP(attrib) \ + if (kev->fflags & attrib) \ + strncat(buf, #attrib" ", 64); + + if ((buf = calloc(1, 1024)) == NULL) + abort(); + + /* Not every filter has meaningful fflags */ + if (kev->filter != EVFILT_VNODE) { + snprintf(buf, 1024, "fflags = %d", kev->fflags); + return (buf); + } + + snprintf(buf, 1024, "fflags = %d (", kev->fflags); + KEVFFL_DUMP(NOTE_DELETE); + KEVFFL_DUMP(NOTE_WRITE); + KEVFFL_DUMP(NOTE_EXTEND); +#if HAVE_NOTE_TRUNCATE + KEVFFL_DUMP(NOTE_TRUNCATE); +#endif + KEVFFL_DUMP(NOTE_ATTRIB); + KEVFFL_DUMP(NOTE_LINK); + KEVFFL_DUMP(NOTE_RENAME); +#if HAVE_NOTE_REVOKE + KEVFFL_DUMP(NOTE_REVOKE); +#endif + buf[strlen(buf) - 1] = ')'; + + return (buf); +} + +char * +kevent_flags_dump(struct kevent *kev) +{ + char *buf; + +#define KEVFL_DUMP(attrib) \ + if (kev->flags & attrib) \ + strncat(buf, #attrib" ", 64); + + if ((buf = calloc(1, 1024)) == NULL) + abort(); + + snprintf(buf, 1024, "flags = %d (", kev->flags); + KEVFL_DUMP(EV_ADD); + KEVFL_DUMP(EV_ENABLE); + KEVFL_DUMP(EV_DISABLE); + KEVFL_DUMP(EV_DELETE); + KEVFL_DUMP(EV_ONESHOT); + KEVFL_DUMP(EV_CLEAR); + KEVFL_DUMP(EV_EOF); + KEVFL_DUMP(EV_ERROR); +#if HAVE_EV_DISPATCH + KEVFL_DUMP(EV_DISPATCH); +#endif +#if HAVE_EV_RECEIPT + KEVFL_DUMP(EV_RECEIPT); +#endif + buf[strlen(buf) - 1] = ')'; + + return (buf); +} + +/* Copied from ../kevent.c kevent_dump() and improved */ +const char * +kevent_to_str(struct kevent *kev) +{ + char buf[512]; + + snprintf(&buf[0], sizeof(buf), + "[ident=%d, filter=%d, %s, %s, data=%d, udata=%p]", + (u_int) kev->ident, + kev->filter, + kevent_flags_dump(kev), + kevent_fflags_dump(kev), + (int) kev->data, + kev->udata); + + return (strdup(buf)); +} + +void +kevent_add(int kqfd, struct kevent *kev, + uintptr_t ident, + short filter, + u_short flags, + u_int fflags, + intptr_t data, + void *udata) +{ + EV_SET(kev, ident, filter, flags, fflags, data, NULL); + if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { + printf("Unable to add the following kevent:\n%s\n", + kevent_to_str(kev)); + err(1, "kevent(): %s", strerror(errno)); + } +} + +void +kevent_cmp(struct kevent *k1, struct kevent *k2) +{ +/* XXX- + Workaround for inconsistent implementation of kevent(2) + */ +#ifdef __FreeBSD__ + if (k1->flags & EV_ADD) + k2->flags |= EV_ADD; +#endif + if (memcmp(k1, k2, sizeof(*k1)) != 0) { + printf("kevent_cmp: mismatch:\n %s !=\n %s\n", + kevent_to_str(k1), kevent_to_str(k2)); + abort(); + } +} + +void +test_begin(const char *func) +{ + if (cur_test_id) + free(cur_test_id); + cur_test_id = strdup(func); + if (!cur_test_id) + err(1, "strdup failed"); + + printf("\n\nTest %d: %s\n", testnum++, func); +} + +void +success(void) +{ + printf("%-70s %s\n", cur_test_id, "passed"); + free(cur_test_id); + cur_test_id = NULL; +} + +void +test_kqueue(void) +{ + test_begin("kqueue()"); + if ((kqfd = kqueue()) < 0) + err(1, "kqueue()"); + test_no_kevents(); + success(); +} + +void +test_kqueue_close(void) +{ + test_begin("close(kq)"); + if (close(kqfd) < 0) + err(1, "close()"); + success(); +} + +int +main(int argc, char **argv) +{ + int test_proc = 0; /* XXX-FIXME */ + int test_socket = 1; + int test_signal = 1; + int test_vnode = 1; + int test_timer = 1; + int test_user = 1; + + while (argc) { + if (strcmp(argv[0], "--no-proc") == 0) + test_proc = 0; + if (strcmp(argv[0], "--no-socket") == 0) + test_socket = 0; + if (strcmp(argv[0], "--no-timer") == 0) + test_timer = 0; + if (strcmp(argv[0], "--no-signal") == 0) + test_signal = 0; + if (strcmp(argv[0], "--no-vnode") == 0) + test_vnode = 0; + if (strcmp(argv[0], "--no-user") == 0) + test_user = 0; + argv++; + argc--; + } + + test_kqueue(); + test_kqueue_close(); + + if (test_socket) + test_evfilt_read(); + if (test_signal) + test_evfilt_signal(); + if (test_vnode) + test_evfilt_vnode(); +#if HAVE_EVFILT_USER + if (test_user) + test_evfilt_user(); +#endif + if (test_timer) + test_evfilt_timer(); + if (test_proc) + test_evfilt_proc(); + + printf("\n---\n" + "+OK All %d tests completed.\n", testnum - 1); + return (0); +} Added: head/tools/regression/kqueue/proc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/proc.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include "common.h" + +static int sigusr1_caught = 0; + +int kqfd; + +static void +sig_handler(int signum) +{ + sigusr1_caught = 1; +} + +static void +add_and_delete(void) +{ + struct kevent kev; + pid_t pid; + + /* Create a child that waits to be killed and then exits */ + pid = fork(); + if (pid == 0) { + pause(); + exit(2); + } + printf(" -- child created (pid %d)\n", (int) pid); + + test_begin("kevent(EVFILT_PROC, EV_ADD)"); + + test_no_kevents(); + kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_ADD, 0, 0, NULL); + test_no_kevents(); + + success(); + + test_begin("kevent(EVFILT_PROC, EV_DELETE)"); + + test_no_kevents(); + kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_DELETE, 0, 0, NULL); + if (kill(pid, SIGKILL) < 0) + err(1, "kill"); + sleep(1); + test_no_kevents(); + + success(); + +} + +static void +event_trigger(void) +{ + struct kevent kev; + pid_t pid; + + test_begin("kevent(EVFILT_PROC, wait)"); + + /* Create a child that waits to be killed and then exits */ + pid = fork(); + if (pid == 0) { + pause(); + printf(" -- child caught signal, exiting\n"); + exit(2); + } + printf(" -- child created (pid %d)\n", (int) pid); + + test_no_kevents(); + kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_ADD, 0, 0, NULL); + + /* Cause the child to exit, then retrieve the event */ + printf(" -- killing process %d\n", (int) pid); + if (kill(pid, SIGUSR1) < 0) + err(1, "kill"); + kevent_cmp(&kev, kevent_get(kqfd)); + test_no_kevents(); + + success(); +} + +#ifdef TODO +void +test_kevent_signal_disable(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_DISABLE)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_DISABLE, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGKILL) < 0) + err(1, "kill"); + + test_no_kevents(); + + success(); +} + +void +test_kevent_signal_enable(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_ENABLE)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_ENABLE, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + + kev.flags = EV_ADD | EV_CLEAR; +#if LIBKQUEUE + kev.data = 1; /* WORKAROUND */ +#else + kev.data = 2; // one extra time from test_kevent_signal_disable() +#endif + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Delete the watch */ + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_signal_del(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_DELETE)"; + struct kevent kev; + + test_begin(test_id); + + /* Delete the kevent */ + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_DELETE, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + + test_no_kevents(); + success(); +} + +void +test_kevent_signal_oneshot(void) +{ + const char *test_id = "kevent(EVFILT_SIGNAL, EV_ONESHOT)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_ADD | EV_ONESHOT, 0, 0, NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Block SIGUSR1, then send it to ourselves */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) + err(1, "sigprocmask"); + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + + kev.flags |= EV_CLEAR; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Send another one and make sure we get no events */ + if (kill(getpid(), SIGUSR1) < 0) + err(1, "kill"); + test_no_kevents(); + + success(); +} +#endif + +void +test_evfilt_proc() +{ + kqfd = kqueue(); + + signal(SIGUSR1, sig_handler); + + add_and_delete(); + event_trigger(); + + signal(SIGUSR1, SIG_DFL); + +#if TODO + test_kevent_signal_add(); + test_kevent_signal_del(); + test_kevent_signal_get(); + test_kevent_signal_disable(); + test_kevent_signal_enable(); + test_kevent_signal_oneshot(); +#endif + close(kqfd); +} Added: head/tools/regression/kqueue/read.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/read.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include "common.h" + +int kqfd; +int sockfd[2]; + +static void +kevent_socket_drain(void) +{ + char buf[1]; + + /* Drain the read buffer, then make sure there are no more events. */ + puts("draining the read buffer"); + if (read(sockfd[0], &buf[0], 1) < 1) + err(1, "read(2)"); +} + +static void +kevent_socket_fill(void) +{ + puts("filling the read buffer"); + if (write(sockfd[1], ".", 1) < 1) + err(1, "write(2)"); +} + + +void +test_kevent_socket_add(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_ADD)"; + struct kevent kev; + + test_begin(test_id); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_get(void) +{ + const char *test_id = "kevent(EVFILT_READ) wait"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + kevent_socket_drain(); + test_no_kevents(); + + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_clear(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_CLEAR)"; + struct kevent kev; + + test_begin(test_id); + + test_no_kevents(); + + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + kevent_socket_fill(); + + kev.data = 2; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* We filled twice, but drain once. Edge-triggered would not generate + additional events. + */ + kevent_socket_drain(); + test_no_kevents(); + + kevent_socket_drain(); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_disable_and_enable(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_DISABLE)"; + struct kevent kev; + + test_begin(test_id); + + /* Add an event, then disable it. */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DISABLE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + test_no_kevents(); + + /* Re-enable the knote, then see if an event is generated */ + kev.flags = EV_ENABLE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + kev.flags = EV_ADD; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + kevent_socket_drain(); + + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_kevent_socket_del(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_DELETE)"; + struct kevent kev; + + test_begin(test_id); + + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_fill(); + test_no_kevents(); + kevent_socket_drain(); + + success(); +} + +void +test_kevent_socket_oneshot(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_ONESHOT)"; + struct kevent kev; + + test_begin(test_id); + + /* Re-add the watch and make sure no events are pending */ + puts("-- re-adding knote"); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + puts("-- getting one event"); + kevent_socket_fill(); + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + puts("-- checking knote disabled"); + test_no_kevents(); + + /* Try to delete the knote, it should already be deleted */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) == 0) + err(1, "%s", test_id); + + kevent_socket_drain(); + + success(); +} + + +#if HAVE_EV_DISPATCH +void +test_kevent_socket_dispatch(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_DISPATCH)"; + + test_begin(test_id); + + struct kevent kev; + + /* Re-add the watch and make sure no events are pending */ + puts("-- re-adding knote"); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_DISPATCH, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + /* The event will occur only once, even though EV_CLEAR is not + specified. */ + kevent_socket_fill(); + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + test_no_kevents(); + + /* Since the knote is disabled, the EV_DELETE operation succeeds. */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + kevent_socket_drain(); + + success(); +} +#endif /* HAVE_EV_DISPATCH */ + +#if BROKEN +void +test_kevent_socket_lowat(void) +{ + const char *test_id = "kevent(EVFILT_READ, NOTE_LOWAT)"; + struct kevent kev; + + test_begin(test_id); + + /* Re-add the watch and make sure no events are pending */ + puts("-- re-adding knote, setting low watermark to 2 bytes"); + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_ONESHOT, NOTE_LOWAT, 2, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + puts("-- checking that one byte does not trigger an event.."); + kevent_socket_fill(); + test_no_kevents(); + + puts("-- checking that two bytes triggers an event.."); + kevent_socket_fill(); + if (kevent(kqfd, NULL, 0, &kev, 1, NULL) != 1) + err(1, "%s", test_id); + KEV_CMP(kev, sockfd[0], EVFILT_READ, 0); + test_no_kevents(); + + kevent_socket_drain(); + kevent_socket_drain(); + + success(); +} +#endif + +void +test_kevent_socket_eof(void) +{ + const char *test_id = "kevent(EVFILT_READ, EV_EOF)"; + struct kevent kev; + + test_begin(test_id); + + /* Re-add the watch and make sure no events are pending */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + test_no_kevents(); + + if (close(sockfd[1]) < 0) + err(1, "close(2)"); + + kev.flags |= EV_EOF; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Delete the watch */ + EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DELETE, 0, 0, &sockfd[0]); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +void +test_evfilt_read() +{ + /* Create a connected pair of full-duplex sockets for testing socket events */ + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockfd) < 0) + abort(); + + kqfd = kqueue(); + test_kevent_socket_add(); + test_kevent_socket_del(); + test_kevent_socket_get(); + test_kevent_socket_disable_and_enable(); + test_kevent_socket_oneshot(); + test_kevent_socket_clear(); +#if HAVE_EV_DISPATCH + test_kevent_socket_dispatch(); +#endif + test_kevent_socket_eof(); + close(kqfd); +} Added: head/tools/regression/kqueue/signal.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kqueue/signal.c Sun Dec 13 20:27:46 2009 (r200483) @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2009 Mark Heily + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include "common.h" + +int kqfd; + +void +test_kevent_signal_add(void) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 20:27:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D64381065780; Sun, 13 Dec 2009 20:27:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C64A88FC1B; Sun, 13 Dec 2009 20:27:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDKRxxS096364; Sun, 13 Dec 2009 20:27:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDKRxHp096362; Sun, 13 Dec 2009 20:27:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912132027.nBDKRxHp096362@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Dec 2009 20:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200484 - head/sys/mips/adm5120 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:27:59 -0000 Author: bz Date: Sun Dec 13 20:27:59 2009 New Revision: 200484 URL: http://svn.freebsd.org/changeset/base/200484 Log: Make admsw(4) compile again fixing typos and adding the missing variable after r199762. Modified: head/sys/mips/adm5120/if_admsw.c Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Sun Dec 13 20:27:46 2009 (r200483) +++ head/sys/mips/adm5120/if_admsw.c Sun Dec 13 20:27:59 2009 (r200484) @@ -745,10 +745,11 @@ static void admsw_watchdog(void *arg) { struct admsw_softc *sc = arg; + struct ifnet *ifp; int vlan; - callout_reset(&sc->watchdog, hz, admsw_watchdog, sc); - if (sc->sc_timer == 0 || --sc->timer > 0) + callout_reset(&sc->sc_watchdog, hz, admsw_watchdog, sc); + if (sc->sc_timer == 0 || --sc->sc_timer > 0) return; /* Check if an interrupt was lost. */ @@ -775,6 +776,8 @@ admsw_watchdog(void *arg) admsw_stop(sc->sc_ifnet[vlan], 0); admsw_init(sc); + ifp = sc->sc_ifnet[0]; + /* Try to get more packets going. */ admsw_start(ifp); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 20:36:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FBE7106566B; Sun, 13 Dec 2009 20:36:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F26F8FC0C; Sun, 13 Dec 2009 20:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDKahSs096566; Sun, 13 Dec 2009 20:36:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDKahGa096564; Sun, 13 Dec 2009 20:36:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912132036.nBDKahGa096564@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Dec 2009 20:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200485 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:36:43 -0000 Author: marius Date: Sun Dec 13 20:36:42 2009 New Revision: 200485 URL: http://svn.freebsd.org/changeset/base/200485 Log: Only set ATA_CHECKS_CABLE for chip versions that actually support cable detection, i.e. neither for ALI_OLD nor for ALI_NEW revisions >= 0xc7. MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 20:27:59 2009 (r200484) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 13 20:36:42 2009 (r200485) @@ -180,7 +180,8 @@ ata_ali_ch_attach(device_t dev) if (ata_pci_ch_attach(dev)) return ENXIO; - ch->flags |= ATA_CHECKS_CABLE; + if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) + ch->flags |= ATA_CHECKS_CABLE; /* older chips can't do 48bit DMA transfers */ if (ctlr->chip->chiprev <= 0xc4) ch->flags |= ATA_NO_48BIT_DMA; From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 20:52:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1D97106566B for ; Sun, 13 Dec 2009 20:52:37 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 586168FC0A for ; Sun, 13 Dec 2009 20:52:37 +0000 (UTC) Received: (qmail 24881 invoked by uid 399); 13 Dec 2009 20:52:36 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 13 Dec 2009 20:52:36 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B255419.3090301@FreeBSD.org> Date: Sun, 13 Dec 2009 12:52:41 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:52:37 -0000 Erik Trulsson wrote: > On Sun, Dec 13, 2009 at 01:03:42PM +0100, Dag-Erling Smørgrav wrote: >> Doug Barton writes: >>> To be clear, I am NOT asking for a backout ... IIRC in the thread that >>> discussed this issue there were quite a few people who thought that >>> FreeBSD not clearing the screen was a POLA violation since that's what >>> linux does, and it's what most people are used to. >> It's not "what Linux does", it's what xterm does. Xterm did not >> originate with Linux; in fact, it predates Linux by about ten years. >> FreeBSD's xterm entry was deliberately crippled to lie about xterm's >> capabilities. > > Actually it is when the 'ti'/'te' termcap entries are *provided* that one > lies about xterm's capabilities. Thanks for the lesson in terminal history. :) What I meant by "what linux does" is "the default behavior in linux is to clear the screen, which is what users coming from a linux background are accustomed to." Who is lying about xterm's capabilities is not relevant here (although I'm serious that it's kind of interesting). Ed, what I had in mind for a fix was something more like this: http://people.freebsd.org/~dougb/termcap.src-diff.txt That restores the default behavior and gives our linuxy friends an easy way to get the behavior they are familiar with. If folks agree that this is the right way to go I can also write up a section for termcap.5. I did not change the xterm-clone definitions since I'm not sure what the previous default for them was, but that can easily be done as well. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 01:26:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3D651065670; Mon, 14 Dec 2009 01:26:01 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A281C8FC08; Mon, 14 Dec 2009 01:26:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE1Q1Hk003703; Mon, 14 Dec 2009 01:26:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE1Q1Zv003701; Mon, 14 Dec 2009 01:26:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912140126.nBE1Q1Zv003701@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Dec 2009 01:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200498 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:26:01 -0000 Author: marcel Date: Mon Dec 14 01:26:01 2009 New Revision: 200498 URL: http://svn.freebsd.org/changeset/base/200498 Log: Work-around a race condition on ia64 while unlocking a contested lock. The race condition is believed to be in UMTX_OP_MUTEX_WAKE. On ia64, we simply go to the kernel to unlock. The big question is why this is only a race condition on ia64... MFC after: 3 days Modified: head/lib/libthr/thread/thr_umtx.c Modified: head/lib/libthr/thread/thr_umtx.c ============================================================================== --- head/lib/libthr/thread/thr_umtx.c Mon Dec 14 01:10:05 2009 (r200497) +++ head/lib/libthr/thread/thr_umtx.c Mon Dec 14 01:26:01 2009 (r200498) @@ -112,10 +112,13 @@ __thr_umutex_timedlock(struct umutex *mt int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) { +#ifndef __ia64__ + /* XXX this logic has a race-condition on ia64. */ if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED); return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0); } +#endif /* __ia64__ */ return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 01:51:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D2A31065693; Mon, 14 Dec 2009 01:51:23 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C26C8FC16; Mon, 14 Dec 2009 01:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE1pNFd004341; Mon, 14 Dec 2009 01:51:23 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE1pNLA004339; Mon, 14 Dec 2009 01:51:23 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200912140151.nBE1pNLA004339@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 14 Dec 2009 01:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200499 - head/gnu/lib/libgcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 01:51:23 -0000 Author: kan Date: Mon Dec 14 01:51:23 2009 New Revision: 200499 URL: http://svn.freebsd.org/changeset/base/200499 Log: Fix one spelling and one copy&paste error in comments. Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Mon Dec 14 01:26:01 2009 (r200498) +++ head/gnu/lib/libgcc/Makefile Mon Dec 14 01:51:23 2009 (r200499) @@ -297,7 +297,7 @@ CLEANFILES += cs-*.h option* #----------------------------------------------------------------------- # -# Build additional static libgcc_eh[_p].a librarries. +# Build symbol version map # SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk SHLIB_MKMAP_OPTS = @@ -316,7 +316,7 @@ CLEANFILES += libgcc.map #----------------------------------------------------------------------- # -# Build additional static libgcc_eh[_p].a librarries. +# Build additional static libgcc_eh[_p].a libraries. # lib${LIB}_eh.a: ${EH_OBJS_T} @${ECHO} building static ${LIB}_eh library From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 04:50:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BB6E1065670; Mon, 14 Dec 2009 04:50:07 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 8E8168FC13; Mon, 14 Dec 2009 04:50:06 +0000 (UTC) Received: from lstewart-laptop.caia.swin.edu.au (lstewart-laptop.caia.swin.edu.au [136.186.229.148]) (authenticated bits=0) by lauren.room52.net (8.14.3/8.14.3) with ESMTP id nBE4nv9r024671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 15:49:58 +1100 (EST) (envelope-from lstewart@freebsd.org) Message-ID: <4B25C3EF.5010009@freebsd.org> Date: Mon, 14 Dec 2009 15:49:51 +1100 From: Lawrence Stewart User-Agent: Thunderbird 2.0.0.23 (X11/20090909) MIME-Version: 1.0 To: Jack F Vogel References: <200912081854.nB8IsbrP096592@svn.freebsd.org> In-Reply-To: <200912081854.nB8IsbrP096592@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lauren.room52.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200268 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 04:50:07 -0000 [picking a recent e1000 commit] Hi Jack, I'm getting the following panic on head r200376 on my HP DC7800 work desktop: mtx_lock() of spin mutex &dev_spec->swflag_mutex @ /usr/src/sys/dev/e1000/e1000_ich8lan.c:651 I don't experience the panic with an 8.0-RELEASE kernel. Anything obviously wrong with that line of code as far as you're concerned, or do I need to dig some more detail out? Debugging with this system is painful, hence the initial hand transcribed minimal detail, but if you need more info I'll try figure out how to get you what you need. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sun Dec 13 20:51:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00251065676; Sun, 13 Dec 2009 20:51:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5BF8FC16; Sun, 13 Dec 2009 20:51:59 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id CE9411CC5D; Sun, 13 Dec 2009 21:51:58 +0100 (CET) Date: Sun, 13 Dec 2009 21:51:58 +0100 From: Ed Schouten To: Doug Barton Message-ID: <20091213205158.GT64905@hoeg.nl> References: <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> <86pr6jjd29.fsf@ds4.des.no> <20091213182256.GA4117@falcon.midgard.homeip.net> <4B255253.9020904@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WXyDHq/2XkIy2Hyf" Content-Disposition: inline In-Reply-To: <4B255253.9020904@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Mon, 14 Dec 2009 05:29:36 +0000 Cc: Erik Trulsson , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, Garrett Wollman , Ronald Klop , svn-src-head@freebsd.org, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , Christoph Mallon Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 20:51:59 -0000 --WXyDHq/2XkIy2Hyf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Doug Barton wrote: > what I had in mind for a fix was something more like this: > http://people.freebsd.org/~dougb/termcap.src-diff.txt Looks okay. Unfortunately it causes us to massively deviate from the version shipped with xterm, but I guess that's the only solution. Could you write a similar patch for termcap.small and commit it to SVN? Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --WXyDHq/2XkIy2Hyf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkslU+4ACgkQ52SDGA2eCwVxMgCdFyimeLzC0jhtw1NomxOpJkO2 i+8AniyDgnnOhOtUL4We0iyLyni0hFpz =Gmau -----END PGP SIGNATURE----- --WXyDHq/2XkIy2Hyf-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 07:18:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9141B1065693; Mon, 14 Dec 2009 07:18:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8050F8FC17; Mon, 14 Dec 2009 07:18:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBE7IVx9012139; Mon, 14 Dec 2009 07:18:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBE7IVQP012135; Mon, 14 Dec 2009 07:18:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912140718.nBE7IVQP012135@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 07:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200503 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 07:18:31 -0000 Author: dougb Date: Mon Dec 14 07:18:31 2009 New Revision: 200503 URL: http://svn.freebsd.org/changeset/base/200503 Log: Revert the xterm terminal behavior to NOT clear the screen after exiting a pager, vi, etc. Add some example xterm*-clear entries to the termcap files to make it easier for people to enable that behavior. Document the examples in the man page to make them easier to find. Modified: head/etc/termcap.small head/share/termcap/termcap.5 head/share/termcap/termcap.src Modified: head/etc/termcap.small ============================================================================== --- head/etc/termcap.small Mon Dec 14 03:54:47 2009 (r200502) +++ head/etc/termcap.small Mon Dec 14 07:18:31 2009 (r200503) @@ -312,7 +312,7 @@ xterm-basic|modern xterm common:\ :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ - :so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\ + :so=\E[7m:sr=\EM:st=\EH:\ :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: # # This is the only entry which you should have to customize, since "xterm" @@ -320,3 +320,8 @@ xterm-basic|modern xterm common:\ # color_xterm and rxvt. xterm|X11 terminal emulator:\ :tc=xterm-new: +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +xterm-clear:\ + :te=\E[?1049l:ti=\E[?1049h:\ + :tc=xterm-new: Modified: head/share/termcap/termcap.5 ============================================================================== --- head/share/termcap/termcap.5 Mon Dec 14 03:54:47 2009 (r200502) +++ head/share/termcap/termcap.5 Mon Dec 14 07:18:31 2009 (r200503) @@ -53,7 +53,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 16, 1994 +.Dd December 13, 2009 .Dt TERMCAP 5 .Os .Sh NAME @@ -1999,6 +1999,22 @@ Unfortunately, due to lack of a definiti only .Xr terminfo 5 supports these capabilities. +.Pp +For the +.Xr xterm 1 +terminal emulator the traditional behavior in +FreeBSD when exiting a pager such as +.Xr less 1 +or +.Xr more 1 , +or an editor such as +.Xr vi 1 +is NOT to clear the screen after the program exits. +If you prefer to clear the screen there are a number of +.Dq xterm-clear +entries that add this capability in the +.Nm +file that you can use directly, or as examples. .Ss Glitches and Braindamage Hazeltine terminals, which do not allow `~' characters to be displayed, should indicate @@ -2105,6 +2121,7 @@ Hash database file containing terminal d .Xr tset 1 , .Xr ul 1 , .Xr vi 1 , +.Xr xterm 1 , .Xr ncurses 3 , .Xr printf 3 , .Xr termcap 3 , Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Mon Dec 14 03:54:47 2009 (r200502) +++ head/share/termcap/termcap.src Mon Dec 14 07:18:31 2009 (r200503) @@ -2800,7 +2800,12 @@ SW|screen-w|VT 100/ANSI X3.64 virtual te # # I checked the limits using ncurses "captoinfo -CrTUvx", which prints # the resolved length of each entry in a comment at the end - T.Dickey + +# Add the capability to "clear the screen" after exiting vi, more/less, etc. # +xterm-clear:\ + :te=\E[?1049l:ti=\E[?1049h:\ + :tc=xterm-new: xterm-new|modern xterm:\ :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ @@ -2820,7 +2825,7 @@ xterm-basic|modern xterm common:\ :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ - :so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\ + :so=\E[7m:sr=\EM:st=\EH:\ :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: # The xterm-new description has all of the features, but is not completely @@ -2886,6 +2891,12 @@ xterm-xmc|xterm alias 6:\ # # An 8-bit description is doable with termcap, but there are probably no # termcap (or BSD curses) applications that are able to use it. +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +# +xterm-8bit-clear:\ + :te=\233?1049l:ti=\233?1049h:ue=\23324m:\ + :tc=xterm-8bit: xterm-8bit|xterm terminal emulator 8-bit controls (X Window System):\ :am:km:mi:ms:xn:\ :co#80:it#8:li#24:\ @@ -2902,7 +2913,7 @@ xterm-8bit|xterm terminal emulator 8-bit :ke=\233?1l\E>:kh=\2331~:kl=\217D:kr=\217C:ks=\233?1h\E=:\ :ku=\217A:le=^H:mb=\2335m:md=\2331m:me=\233m:mr=\2337m:\ :nd=\233C:rc=\E8:sc=\E7:se=\23327m:sf=^J:so=\2337m:sr=\215:\ - :st=\210:ta=^I:te=\233?1049l:ti=\233?1049h:ue=\23324m:\ + :st=\210:ta=^I:ue=\23324m:\ :up=\233A:us=\2334m:vb=\233?5h\233?5l:ve=\233?25l\233?25h:\ :vs=\233?12;25h:vi=\233?25l: # @@ -2941,6 +2952,12 @@ xterm-ic|xterm-vi|xterm with insert char :IC=\E[%d@:ei@:ic=\E[@:im@:tc=xterm: # # Compatible with the X11R6.3 xterm +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +# +xterm-r6-clear:\ + :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[m:\ + :tc=xterm-r6: xterm-r6|xterm-old|X11R6 xterm:\ :am:bs:km:mi:ms:pt:xn:\ :co#80:kn#20:li#24:\ @@ -2958,10 +2975,16 @@ xterm-r6|xterm-old|X11R6 xterm:\ :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ :ku=\EOA:md=\E[1m:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:\ :rc=\E8:rs=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\ - :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\ - :ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m: + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:\ + :ue=\E[m:up=\E[A:us=\E[4m: # # Compatible with the R5 xterm +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +# +xterm-r5-clear:\ + :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[m:\ + :tc=xterm-r5: xterm-r5|X11R5 xterm X11R5:\ :am:bs:km:mi:ms:pt:xn:\ :co#80:kn#4:li#24:\ @@ -2974,8 +2997,8 @@ xterm-r5|X11R5 xterm X11R5:\ :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ :ku=\EOA:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:rc=\E8:\ :rs=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H:\ - :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\ - :ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m: + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:\ + :up=\E[A:us=\E[4m: # # Customization begins here. xterm-xfree86|xterm terminal emulator (XFree86):\ From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 07:34:31 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826DC106566C; Mon, 14 Dec 2009 07:34:31 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 38AFA8FC16; Mon, 14 Dec 2009 07:34:31 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:cYA7EL/adAjUkbddPdY01rXRj68CYxDzHofK/+FWBlGgBkQjiFbJ4/ok1glbLYh2@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nBE7YJH6070062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 16:34:23 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 14 Dec 2009 16:34:19 +0900 Message-ID: From: Hajimu UMEMOTO To: Doug Barton In-Reply-To: <200912140718.nBE7IVQP012135@svn.freebsd.org> References: <200912140718.nBE7IVQP012135@svn.freebsd.org> User-Agent: xcite1.58> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RELEASE-p1 X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Mon, 14 Dec 2009 16:34:23 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200503 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 07:34:31 -0000 Hi, >>>>> On Mon, 14 Dec 2009 07:18:31 +0000 (UTC) >>>>> Doug Barton said: dougb> Author: dougb dougb> Date: Mon Dec 14 07:18:31 2009 dougb> New Revision: 200503 dougb> URL: http://svn.freebsd.org/changeset/base/200503 dougb> Log: dougb> Revert the xterm terminal behavior to NOT clear the screen after dougb> exiting a pager, vi, etc. dougb> dougb> Add some example xterm*-clear entries to the termcap files to make dougb> it easier for people to enable that behavior. dougb> dougb> Document the examples in the man page to make them easier to find. Thank you! Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 12:23:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D8CB106566B; Mon, 14 Dec 2009 12:23:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CD848FC12; Mon, 14 Dec 2009 12:23:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBECNlsA026383; Mon, 14 Dec 2009 12:23:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBECNlDZ026381; Mon, 14 Dec 2009 12:23:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912141223.nBECNlDZ026381@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 14 Dec 2009 12:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 12:23:47 -0000 Author: luigi Date: Mon Dec 14 12:23:46 2009 New Revision: 200510 URL: http://svn.freebsd.org/changeset/base/200510 Log: Properly fix callout handling by putting all the per-cpu info in struct callout_cpu. From the comment in the file: + * There is one struct callout_cpu per cpu, holding all relevant + * state for the callout processing thread on the individual CPU. + * In particular: + * cc_ticks is incremented once per tick in callout_cpu(). + * It tracks the global 'ticks' but in a way that the individual + * threads should not worry about races in the order in which + * hardclock() and hardclock_cpu() run on the various CPUs. + * cc_softclock is advanced in callout_cpu() to point to the + * first entry in cc_callwheel that may need handling. In turn, + * a softclock() is scheduled so it can serve the various entries i + * such that cc_softclock <= i <= cc_ticks . Together with a smaller patch committed in september, this fixes a bug that affects 8.0 with apps that rely on callouts to fire exactly in the number of ticks specified (qemu among them). Right now, callouts in 8.0 fire one tick late. This was discussed in september with JeffR and jhb MFC after: 3 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Dec 14 12:19:21 2009 (r200509) +++ head/sys/kern/kern_timeout.c Mon Dec 14 12:23:46 2009 (r200510) @@ -82,6 +82,23 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca */ int callwheelsize, callwheelbits, callwheelmask; +/* + * There is one struct callout_cpu per cpu, holding all relevant + * state for the callout processing thread on the individual CPU. + * In particular: + * cc_ticks is incremented once per tick in callout_cpu(). + * It tracks the global 'ticks' but in a way that the individual + * threads should not worry about races in the order in which + * hardclock() and hardclock_cpu() run on the various CPUs. + * cc_softclock is advanced in callout_cpu() to point to the + * first entry in cc_callwheel that may need handling. In turn, + * a softclock() is scheduled so it can serve the various entries i + * such that cc_softclock <= i <= cc_ticks . + * XXX maybe cc_softclock and cc_ticks should be volatile ? + * + * cc_ticks is also used in callout_reset_cpu() to determine + * when the callout should be served. + */ struct callout_cpu { struct mtx cc_lock; struct callout *cc_callout; @@ -90,6 +107,7 @@ struct callout_cpu { struct callout *cc_next; struct callout *cc_curr; void *cc_cookie; + int cc_ticks; int cc_softticks; int cc_cancel; int cc_waiting; @@ -244,7 +262,8 @@ callout_tick(void) need_softclock = 0; cc = CC_SELF(); mtx_lock_spin_flags(&cc->cc_lock, MTX_QUIET); - for (; (cc->cc_softticks - ticks) <= 0; cc->cc_softticks++) { + cc->cc_ticks++; + for (; (cc->cc_softticks - cc->cc_ticks) <= 0; cc->cc_softticks++) { bucket = cc->cc_softticks & callwheelmask; if (!TAILQ_EMPTY(&cc->cc_callwheel[bucket])) { need_softclock = 1; @@ -323,7 +342,7 @@ softclock(void *arg) steps = 0; cc = (struct callout_cpu *)arg; CC_LOCK(cc); - while (cc->cc_softticks - 1 != ticks) { + while (cc->cc_softticks - 1 != cc->cc_ticks) { /* * cc_softticks may be modified by hard clock, so cache * it while we work on a given bucket. @@ -622,7 +641,7 @@ retry: c->c_arg = arg; c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); c->c_func = ftn; - c->c_time = ticks + to_ticks; + c->c_time = cc->cc_ticks + to_ticks; TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], c, c_links.tqe); CTR5(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d", From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 14:18:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A109106566B; Mon, 14 Dec 2009 14:18:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 565398FC0C; Mon, 14 Dec 2009 14:18:43 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id ED85B46B2E; Mon, 14 Dec 2009 09:18:42 -0500 (EST) Date: Mon, 14 Dec 2009 14:18:42 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <200912141223.nBECNlDZ026381@svn.freebsd.org> Message-ID: References: <200912141223.nBECNlDZ026381@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 14:18:43 -0000 On Mon, 14 Dec 2009, Luigi Rizzo wrote: > Properly fix callout handling by putting all the per-cpu info in > struct callout_cpu. From the comment in the file: > > + * There is one struct callout_cpu per cpu, holding all relevant > + * state for the callout processing thread on the individual CPU. > + * In particular: > + * cc_ticks is incremented once per tick in callout_cpu(). > + * It tracks the global 'ticks' but in a way that the individual > + * threads should not worry about races in the order in which > + * hardclock() and hardclock_cpu() run on the various CPUs. > + * cc_softclock is advanced in callout_cpu() to point to the > + * first entry in cc_callwheel that may need handling. In turn, > + * a softclock() is scheduled so it can serve the various entries i > + * such that cc_softclock <= i <= cc_ticks . > > Together with a smaller patch committed in september, this fixes a > bug that affects 8.0 with apps that rely on callouts to fire exactly > in the number of ticks specified (qemu among them). > Right now, callouts in 8.0 fire one tick late. > > This was discussed in september with JeffR and jhb Once this has burned in, is it something you would consider appropriate to be an errata note candidate? Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 14:39:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E5CA1065670; Mon, 14 Dec 2009 14:39:14 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF9D8FC0A; Mon, 14 Dec 2009 14:39:13 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 8872973098; Mon, 14 Dec 2009 15:46:35 +0100 (CET) Date: Mon, 14 Dec 2009 15:46:35 +0100 From: Luigi Rizzo To: Robert Watson Message-ID: <20091214144635.GA91618@onelab2.iet.unipi.it> References: <200912141223.nBECNlDZ026381@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 14:39:14 -0000 On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: > On Mon, 14 Dec 2009, Luigi Rizzo wrote: ... > > Together with a smaller patch committed in september, this fixes a > > bug that affects 8.0 with apps that rely on callouts to fire exactly > > in the number of ticks specified (qemu among them). > > Right now, callouts in 8.0 fire one tick late. > > > > This was discussed in september with JeffR and jhb > > Once this has burned in, is it something you would consider appropriate to > be an errata note candidate? i have no objection, but at the time someone commented that callouts do not _guarantee_ when they will run so strictly speaking this is not a bug (i do think that being always a tick late _is_ a bug). cheers luigi From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 15:32:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F91E1065670; Mon, 14 Dec 2009 15:32:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DAD58FC08; Mon, 14 Dec 2009 15:32:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEFWYQn030448; Mon, 14 Dec 2009 15:32:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEFWY2o030446; Mon, 14 Dec 2009 15:32:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912141532.nBEFWY2o030446@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Dec 2009 15:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200514 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 15:32:35 -0000 Author: jhb Date: Mon Dec 14 15:32:32 2009 New Revision: 200514 URL: http://svn.freebsd.org/changeset/base/200514 Log: Remove comment claiming that building acpi into the kernel is deprecated. PR: docs/141353 Submitted by: Bruce Cran MFC after: 1 week Modified: head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Dec 14 13:23:33 2009 (r200513) +++ head/sys/i386/conf/NOTES Mon Dec 14 15:32:32 2009 (r200514) @@ -469,9 +469,6 @@ device tdfx_linux # Enable Linuxulator # kernel environment variables to select initial debugging levels for the # Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER # defined when it is built). -# -# Note that building ACPI into the kernel is deprecated; the module is -# normally loaded automatically by the loader. device acpi options ACPI_DEBUG From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 16:46:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD02810656AE; Mon, 14 Dec 2009 16:46:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8CD888FC1E; Mon, 14 Dec 2009 16:46:55 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2B93246B38; Mon, 14 Dec 2009 11:46:55 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 5AF718A025; Mon, 14 Dec 2009 11:46:54 -0500 (EST) From: John Baldwin To: Attilio Rao Date: Mon, 14 Dec 2009 10:13:32 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912122131.nBCLV71f064304@svn.freebsd.org> In-Reply-To: <200912122131.nBCLV71f064304@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141013.32839.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 11:46:54 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200447 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 16:46:55 -0000 On Saturday 12 December 2009 4:31:07 pm Attilio Rao wrote: > Author: attilio > Date: Sat Dec 12 21:31:07 2009 > New Revision: 200447 > URL: http://svn.freebsd.org/changeset/base/200447 > > Log: > In current code, threads performing an interruptible sleep (on both > sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will > leave the waiters flag on forcing the owner to do a wakeup even when if > the waiter queue is empty. > That operation may lead to a deadlock in the case of doing a fake wakeup > on the "preferred" (based on the wakeup algorithm) queue while the other > queue has real waiters on it, because nobody is going to wakeup the 2nd > queue waiters and they will sleep indefinitively. > > A similar bug, is present, for lockmgr in the case the waiters are > sleeping with LK_SLEEPFAIL on. In this case, even if the waiters queue > is not empty, the waiters won't progress after being awake but they will > just fail, still not taking care of the 2nd queue waiters (as instead the > lock owned doing the wakeup would expect). > > In order to fix this bug in a cheap way (without adding too much locking > and complicating too much the semantic) add a sleepqueue interface which > does report the actual number of waiters on a specified queue of a > waitchannel (sleepq_sleepcnt()) and use it in order to determine if the > exclusive waiters (or shared waiters) are actually present on the lockmgr > (or sx) before to give them precedence in the wakeup algorithm. > This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to > cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters > a lockmgr has and if all the waiters on the exclusive waiters queue are > LK_SLEEPFAIL just wake both queues. > > The sleepq_sleepcnt() introduction and ABI breakage require > __FreeBSD_version bumping. Hmm, do you need an actual count of waiters or would a 'sleepq_empty()' (similar to turnstile_empty()) method be sufficient? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 16:54:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7599E1065670; Mon, 14 Dec 2009 16:54:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 631148FC13; Mon, 14 Dec 2009 16:54:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEGsdV2032118; Mon, 14 Dec 2009 16:54:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEGsdWk032116; Mon, 14 Dec 2009 16:54:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912141654.nBEGsdWk032116@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 16:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200515 - head/usr.bin/xinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 16:54:39 -0000 Author: delphij Date: Mon Dec 14 16:54:39 2009 New Revision: 200515 URL: http://svn.freebsd.org/changeset/base/200515 Log: Style improvements: - Sort function prototypes; - Apply static on all function bodies. To quote bde@: > It is a good obfuscation to declare functions as static only in the > prototype, so that you can't see the static for the actual function. > The reverse obfuscation (with static only in the function definition) > would make more sense, but is a constraint error. Reviewed by: bde Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Mon Dec 14 15:32:32 2009 (r200514) +++ head/usr.bin/xinstall/xinstall.c Mon Dec 14 16:54:39 2009 (r200515) @@ -85,8 +85,8 @@ int dobackup, docompare, dodir, dopreser mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; const char *suffix = BACKUP_SUFFIX; -static void copy(int, const char *, int, const char *, off_t); static int compare(int, const char *, size_t, int, const char *, size_t); +static void copy(int, const char *, int, const char *, off_t); static int create_newfile(const char *, int, struct stat *); static int create_tempfile(const char *, char *, size_t); static void install(const char *, const char *, u_long, u_int); @@ -246,7 +246,7 @@ main(int argc, char *argv[]) /* NOTREACHED */ } -u_long +static u_long numeric_id(const char *name, const char *type) { u_long val; @@ -269,7 +269,7 @@ numeric_id(const char *name, const char * install -- * build a path name and install the file */ -void +static void install(const char *from_name, const char *to_name, u_long fset, u_int flags) { struct stat from_sb, temp_sb, to_sb; @@ -523,7 +523,7 @@ install(const char *from_name, const cha * compare -- * compare two files; non-zero means files differ */ -int +static int compare(int from_fd, const char *from_name __unused, size_t from_len, int to_fd, const char *to_name __unused, size_t to_len) { @@ -587,7 +587,7 @@ compare(int from_fd, const char *from_na * create_tempfile -- * create a temporary file based on path and open it */ -int +static int create_tempfile(const char *path, char *temp, size_t tsize) { char *p; @@ -607,7 +607,7 @@ create_tempfile(const char *path, char * * create_newfile -- * create a new file, overwriting an existing one if necessary */ -int +static int create_newfile(const char *path, int target, struct stat *sbp) { char backup[MAXPATHLEN]; @@ -650,7 +650,7 @@ create_newfile(const char *path, int tar * copy -- * copy from one file to another */ -void +static void copy(int from_fd, const char *from_name, int to_fd, const char *to_name, off_t size) { @@ -703,7 +703,7 @@ copy(int from_fd, const char *from_name, * strip -- * use strip(1) to strip the target file */ -void +static void strip(const char *to_name) { const char *stripbin; @@ -735,7 +735,7 @@ strip(const char *to_name) * install_dir -- * build directory heirarchy */ -void +static void install_dir(char *path) { char *p; @@ -769,7 +769,7 @@ install_dir(char *path) * usage -- * print a usage message and die */ -void +static void usage(void) { (void)fprintf(stderr, @@ -786,7 +786,7 @@ usage(void) * trymmap -- * return true (1) if mmap should be tried, false (0) if not. */ -int +static int trymmap(int fd) { /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 17:02:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49ED81065670; Mon, 14 Dec 2009 17:02:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by mx1.freebsd.org (Postfix) with ESMTP id 579168FC0C; Mon, 14 Dec 2009 17:02:54 +0000 (UTC) Received: by fxm28 with SMTP id 28so1564120fxm.13 for ; Mon, 14 Dec 2009 09:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=W2xRpXMey+cd37jIZyWYza8uUQCBzPYZBhEfk5ymopQ=; b=wEtbrsBPbgokXHcIE85NHiCJgBO6Pgj5Ij0d3PCZadyw92ZW5DQMArBxu5lPe7o6jT hLXY2L88HumZrCXtgOY/4hj7AkjY3sn54lz5anK6Tv83QAVxnJRjBlYDIz4nrDsW+G6C YirgV/izcy7eqGX5dDByzewFyhid6+vJ5qdAA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=MxVBbD8sp5+pEhAIHahXpB5TxpbU8vfwrKzkJ5hYtNWnv9mX+b5fREkYNTdSt2pqFs JdPPFc3nOD+YT/PCe/MVcG9CspRNEIqAUAu0+/buaypGnpr7h8+e/613gDnkK6xLIpLV bWXL/lVoBiM0FlRjhfgfaEdp12JMdVUcu7LYg= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.29.193 with SMTP id r1mr475972fac.29.1260810174202; Mon, 14 Dec 2009 09:02:54 -0800 (PST) In-Reply-To: <200912141013.32839.jhb@freebsd.org> References: <200912122131.nBCLV71f064304@svn.freebsd.org> <200912141013.32839.jhb@freebsd.org> Date: Mon, 14 Dec 2009 18:02:54 +0100 X-Google-Sender-Auth: f0750340a242f4b8 Message-ID: <3bbf2fe10912140902m407fa766q3a5e5bb6993723f9@mail.gmail.com> From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200447 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:02:56 -0000 2009/12/14 John Baldwin : > On Saturday 12 December 2009 4:31:07 pm Attilio Rao wrote: >> Author: attilio >> Date: Sat Dec 12 21:31:07 2009 >> New Revision: 200447 >> URL: http://svn.freebsd.org/changeset/base/200447 >> >> Log: >> =C2=A0 In current code, threads performing an interruptible sleep (on bo= th >> =C2=A0 sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr),= will >> =C2=A0 leave the waiters flag on forcing the owner to do a wakeup even w= hen if >> =C2=A0 the waiter queue is empty. >> =C2=A0 That operation may lead to a deadlock in the case of doing a fake= wakeup >> =C2=A0 on the "preferred" (based on the wakeup algorithm) queue while th= e other >> =C2=A0 queue has real waiters on it, because nobody is going to wakeup t= he 2nd >> =C2=A0 queue waiters and they will sleep indefinitively. >> >> =C2=A0 A similar bug, is present, for lockmgr in the case the waiters ar= e >> =C2=A0 sleeping with LK_SLEEPFAIL on. =C2=A0In this case, even if the wa= iters queue >> =C2=A0 is not empty, the waiters won't progress after being awake but th= ey will >> =C2=A0 just fail, still not taking care of the 2nd queue waiters (as ins= tead the >> =C2=A0 lock owned doing the wakeup would expect). >> >> =C2=A0 In order to fix this bug in a cheap way (without adding too much = locking >> =C2=A0 and complicating too much the semantic) add a sleepqueue interfac= e which >> =C2=A0 does report the actual number of waiters on a specified queue of = a >> =C2=A0 waitchannel (sleepq_sleepcnt()) and use it in order to determine = if the >> =C2=A0 exclusive waiters (or shared waiters) are actually present on the= lockmgr >> =C2=A0 (or sx) before to give them precedence in the wakeup algorithm. >> =C2=A0 This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In or= der to >> =C2=A0 cope with it, add the tracking of how many exclusive LK_SLEEPFAIL= waiters >> =C2=A0 a lockmgr has and if all the waiters on the exclusive waiters que= ue are >> =C2=A0 LK_SLEEPFAIL just wake both queues. >> >> =C2=A0 The sleepq_sleepcnt() introduction and ABI breakage require >> =C2=A0 __FreeBSD_version bumping. > > Hmm, do you need an actual count of waiters or would a 'sleepq_empty()' > (similar to turnstile_empty()) method be sufficient? I need the count in order to fix properly LK_SLEEPFAIL case (the idea is: track exclusive waiters with LK_SLEEPFAIL on; if the number is equal to the actual sleepers on the queue then wake up both queues, otherwise nobody is going to take care of the shared waiters queue). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 17:04:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 156AE1065670; Mon, 14 Dec 2009 17:04:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED7588FC12; Mon, 14 Dec 2009 17:04:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEH4iuE032381; Mon, 14 Dec 2009 17:04:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEH4imp032377; Mon, 14 Dec 2009 17:04:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912141704.nBEH4imp032377@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 17:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200516 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:04:45 -0000 Author: delphij Date: Mon Dec 14 17:04:44 2009 New Revision: 200516 URL: http://svn.freebsd.org/changeset/base/200516 Log: Add an option to specify that the received ZFS should not be automatically mounted (receive -u). Obtained from: OpenSolaris (onnv revision 8584:327a1b6dd944) Approved by: pjd Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Dec 14 16:54:39 2009 (r200515) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Dec 14 17:04:44 2009 (r200516) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -2457,7 +2457,7 @@ zfs_do_receive(int argc, char **argv) bzero(&flags, sizeof (recvflags_t)); /* check options */ - while ((c = getopt(argc, argv, ":dnvF")) != -1) { + while ((c = getopt(argc, argv, ":dnuvF")) != -1) { switch (c) { case 'd': flags.isprefix = B_TRUE; @@ -2465,6 +2465,9 @@ zfs_do_receive(int argc, char **argv) case 'n': flags.dryrun = B_TRUE; break; + case 'u': + flags.nomount = B_TRUE; + break; case 'v': flags.verbose = B_TRUE; break; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Dec 14 16:54:39 2009 (r200515) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Dec 14 17:04:44 2009 (r200516) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -457,6 +457,9 @@ typedef struct recvflags { /* byteswap flag is used internally; callers need not specify */ int byteswap : 1; + + /* do not mount file systems as they are extracted (private) */ + int nomount : 1; } recvflags_t; extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Dec 14 16:54:39 2009 (r200515) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Dec 14 17:04:44 2009 (r200516) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -2080,7 +2080,7 @@ zfs_receive(libzfs_handle_t *hdl, const err = zfs_receive_impl(hdl, tosnap, flags, infd, stream_avl, &top_zfs); - if (err == 0 && top_zfs) { + if (err == 0 && !flags.nomount && top_zfs) { zfs_handle_t *zhp; prop_changelist_t *clp; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 17:53:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70306106568F; Mon, 14 Dec 2009 17:53:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E47D8FC15; Mon, 14 Dec 2009 17:53:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEHrArI033433; Mon, 14 Dec 2009 17:53:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEHrATZ033431; Mon, 14 Dec 2009 17:53:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141753.nBEHrATZ033431@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 17:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200519 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 17:53:10 -0000 Author: yongari Date: Mon Dec 14 17:53:10 2009 New Revision: 200519 URL: http://svn.freebsd.org/changeset/base/200519 Log: Remove register keyword. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 17:45:16 2009 (r200518) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 17:53:10 2009 (r200519) @@ -233,7 +233,7 @@ vge_eeprom_getword(sc, addr, dest) int addr; u_int16_t *dest; { - register int i; + int i; u_int16_t word = 0; /* @@ -602,7 +602,7 @@ static void vge_reset(sc) struct vge_softc *sc; { - register int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -2261,7 +2261,7 @@ static void vge_stop(sc) struct vge_softc *sc; { - register int i; + int i; struct ifnet *ifp; VGE_LOCK_ASSERT(sc); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:00:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7628106566C; Mon, 14 Dec 2009 18:00:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A95498FC1E; Mon, 14 Dec 2009 18:00:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEI08qC033623; Mon, 14 Dec 2009 18:00:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEI08I3033621; Mon, 14 Dec 2009 18:00:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141800.nBEI08I3033621@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200520 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:00:09 -0000 Author: yongari Date: Mon Dec 14 18:00:08 2009 New Revision: 200520 URL: http://svn.freebsd.org/changeset/base/200520 Log: Prefer device_printf(9) to printf(9). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 17:53:10 2009 (r200519) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:00:08 2009 (r200520) @@ -918,10 +918,9 @@ vge_attach(dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int unit, error = 0, rid; + int error = 0, rid; sc = device_get_softc(dev); - unit = device_get_unit(dev); sc->vge_dev = dev; mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, @@ -938,7 +937,7 @@ vge_attach(dev) 0, ~0, 1, RF_ACTIVE); if (sc->vge_res == NULL) { - printf ("vge%d: couldn't map ports/memory\n", unit); + device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } @@ -949,7 +948,7 @@ vge_attach(dev) 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); if (sc->vge_irq == NULL) { - printf("vge%d: couldn't map interrupt\n", unit); + device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; goto fail; } @@ -1027,7 +1026,7 @@ vge_attach(dev) NULL, vge_intr, sc, &sc->vge_intrhand); if (error) { - printf("vge%d: couldn't set up irq\n", unit); + device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); goto fail; } From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:19:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B32E11065676; Mon, 14 Dec 2009 18:19:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1DFB8FC1C; Mon, 14 Dec 2009 18:19:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEIJu7D034033; Mon, 14 Dec 2009 18:19:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIJuxQ034031; Mon, 14 Dec 2009 18:19:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141819.nBEIJuxQ034031@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200521 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:19:56 -0000 Author: yongari Date: Mon Dec 14 18:19:56 2009 New Revision: 200521 URL: http://svn.freebsd.org/changeset/base/200521 Log: Fix spelling in comment. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:00:08 2009 (r200520) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:19:56 2009 (r200521) @@ -536,7 +536,7 @@ fail: /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, - * we use the hash filter insted. + * we use the hash filter instead. */ static void vge_setmulti(sc) @@ -1178,7 +1178,7 @@ vge_newbuf(sc, idx, m) /* * Note: the manual fails to document the fact that for - * proper opration, the driver needs to replentish the RX + * proper operation, the driver needs to replenish the RX * DMA ring 4 descriptors at a time (rather than one at a * time, like most chips). We can allocate the new buffers * but we should not set the OWN bits until we're ready @@ -1970,7 +1970,7 @@ vge_init_locked(struct vge_softc *sc) /* * Configure one-shot timer for microsecond - * resulution and load it for 500 usecs. + * resolution and load it for 500 usecs. */ CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); CSR_WRITE_2(sc, VGE_SSTIMER, 400); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:27:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A6C0106566B; Mon, 14 Dec 2009 18:27:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293038FC18; Mon, 14 Dec 2009 18:27:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEIRZPe034245; Mon, 14 Dec 2009 18:27:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIRZEQ034243; Mon, 14 Dec 2009 18:27:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141827.nBEIRZEQ034243@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200522 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:27:35 -0000 Author: yongari Date: Mon Dec 14 18:27:34 2009 New Revision: 200522 URL: http://svn.freebsd.org/changeset/base/200522 Log: Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:19:56 2009 (r200521) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:27:34 2009 (r200522) @@ -933,8 +933,8 @@ vge_attach(dev) pci_enable_busmaster(dev); rid = VGE_PCI_LOMEM; - sc->vge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->vge_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); @@ -944,8 +944,8 @@ vge_attach(dev) /* Allocate interrupt */ rid = 0; - sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->vge_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:43:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90B7106566B; Mon, 14 Dec 2009 18:43:18 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82A68FC0C; Mon, 14 Dec 2009 18:43:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEIhIIQ034644; Mon, 14 Dec 2009 18:43:18 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIhIsA034642; Mon, 14 Dec 2009 18:43:18 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200912141843.nBEIhIsA034642@svn.freebsd.org> From: Jack F Vogel Date: Mon, 14 Dec 2009 18:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200523 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:43:18 -0000 Author: jfv Date: Mon Dec 14 18:43:18 2009 New Revision: 200523 URL: http://svn.freebsd.org/changeset/base/200523 Log: Remove the MTX_SPIN flag to the shared code MUTEX as it was causing a panic, also took the opportunity to rename the lock for clarity. Modified: head/sys/dev/e1000/e1000_osdep.h Modified: head/sys/dev/e1000/e1000_osdep.h ============================================================================== --- head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:27:34 2009 (r200522) +++ head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:43:18 2009 (r200523) @@ -82,8 +82,7 @@ /* Mutex used in the shared code */ #define E1000_MUTEX struct mtx #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ - MTX_NETWORK_LOCK, \ - MTX_DEF | MTX_SPIN) + "E1000 Shared Lock", MTX_DEF) #define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex) #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex) #define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex) From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:43:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80A9F106566B; Mon, 14 Dec 2009 18:43:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8288FC14; Mon, 14 Dec 2009 18:43:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEIhRmc034683; Mon, 14 Dec 2009 18:43:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIhRUo034681; Mon, 14 Dec 2009 18:43:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912141843.nBEIhRUo034681@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 18:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200524 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:43:27 -0000 Author: rpaulo Date: Mon Dec 14 18:43:27 2009 New Revision: 200524 URL: http://svn.freebsd.org/changeset/base/200524 Log: Pass all IEs to net80211. PR: 141376 Submitted by: Paul MFC after: 1 week 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 Mon Dec 14 18:43:18 2009 (r200523) +++ head/sys/dev/if_ndis/if_ndis.c Mon Dec 14 18:43:27 2009 (r200524) @@ -3299,24 +3299,11 @@ ndis_scan_results(struct ndis_softc *sc) efrm = frm + wb->nwbx_ielen; if (efrm - frm < 12) goto done; - sp.tstamp = frm; - frm += 8; - sp.bintval = le16toh(*(uint16_t *)frm); - frm += 2; - sp.capinfo = le16toh(*(uint16_t *)frm); - frm += 2; - - /* Grab variable length ies */ - while (efrm - frm > 1) { - if (efrm - frm < frm[1] + 2) - break; - switch (*frm) { - case IEEE80211_ELEMID_RSN: - sp.rsn = frm; - break; - } - frm += frm[1] + 2; - } + sp.tstamp = frm; frm += 8; + sp.bintval = le16toh(*(uint16_t *)frm); frm += 2; + sp.capinfo = le16toh(*(uint16_t *)frm); frm += 2; + sp.ies = frm; + sp.ies_len = efrm - frm; } done: DPRINTF(("scan: bssid %s chan %dMHz (%d/%d) rssi %d\n", From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:44:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B7C106568F; Mon, 14 Dec 2009 18:44:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F8818FC1A; Mon, 14 Dec 2009 18:44:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEIiOPr034752; Mon, 14 Dec 2009 18:44:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIiOZa034749; Mon, 14 Dec 2009 18:44:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141844.nBEIiOZa034749@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200525 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:44:24 -0000 Author: yongari Date: Mon Dec 14 18:44:23 2009 New Revision: 200525 URL: http://svn.freebsd.org/changeset/base/200525 Log: Overhaul bus_dma(9) usage and fix various things. o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag. o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA tag has different restriction compared to TX DMA tag. o Add 40bit DMA address support. o Adjust TX/RX descriptor ring alignment to 64 bytes from 256 bytes as documented in datasheet. o Added check to ensure TX/RX ring reside within a 4GB boundary. Since TX/RX ring shares the same high address register they should have the same high address. o TX/RX side bus_dmamap_load_mbuf_sg(9) support. o Add lock assertion to vge_setmulti(). o Add RX spare DMA map to recover from DMA map load failure. o Add optimized RX buffer handler, vge_discard_rxbuf which is activated when vge(4) sees bad frames. o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet says the register should be updated only when number of available RX descriptors are multiple of 4. o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which is only set for i386 architecture. Previously vge(4) also performed expensive copy operation to align IP header on amd64. This change should give RX performance boost on amd64 architecture. o Don't reinitialize controller if driver is already running. This should reduce number of link state flipping. o Since vge(4) drops a driver lock before passing received frame to upper layer, make sure vge(4) is still running after re-acquiring driver lock. o Add second argument count to vge_rxeof(). The argument will limit number of packets could be processed in RX handler. o Rearrange vge_rxeof() not to allocate RX buffer if received frame was bad packet. o Removed if_printf that prints DMA map failure. This type of message shouldn't be used in fast path of driver. o Reduce number of allowed TX buffer fragments to 6 from 7. A TX descriptor allows 7 fragments of a frame. However the CMZ field of descriptor has just 3bits and the controller wants to see fragment + 1 in the field. So if we have 7 fragments the field value would be 0 which seems to cause unexpected results under certain conditions. This change should fix occasional TX hang observed on vge(4). o Simplify vge_stat_locked() and add number of available TX descriptor check. o vge(4) controllers lack padding short frames. Make sure to fill zero for the padded bytes. This closes unintended information disclosure. o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether this bit should be set by driver or write-back status bit after transmission. At least vendor's driver does not set this bit so remove it. Without this bit vge(4) still can send jumbo frames. o Don't start driver when vge(4) know there are not enough RX buffers. o Remove volatile keyword in RX descriptor structure. This should be handled by bus_dma(9). o Collapse two 16bits member of TX/RX descriptor into single 32bits member. o Reduce number of RX descriptors to 252 from 256. The VGE_RXDESCNUM is 16bits register but only lower 8bits are valid. So the maximum number of RX descriptors would be 255. However the number of should be multiple of 4 as controller wants to update 4 RX descriptors at a time. This limits the maximum number of RX descriptor to be 252. Tested by: Dewayne Geraghty (dewayne.geraghty <> heuristicsystems dot com dot au) Carey Jones (m.carey.jones <> gmail dot com) Yoshiaki Kasahara (kasahara <> nc dor kyushu-u dot ac dotjp) Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:43:27 2009 (r200524) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:44:23 2009 (r200525) @@ -140,22 +140,21 @@ static int vge_probe (device_t); static int vge_attach (device_t); static int vge_detach (device_t); -static int vge_encap (struct vge_softc *, struct mbuf *, int); +static int vge_encap (struct vge_softc *, struct mbuf **); -static void vge_dma_map_addr (void *, bus_dma_segment_t *, int, int); -static void vge_dma_map_rx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static void vge_dma_map_tx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static int vge_allocmem (device_t, struct vge_softc *); -static int vge_newbuf (struct vge_softc *, int, struct mbuf *); +static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); +static int vge_dma_alloc (struct vge_softc *); +static void vge_dma_free (struct vge_softc *); +static void vge_discard_rxbuf (struct vge_softc *, int); +static int vge_newbuf (struct vge_softc *, int); static int vge_rx_list_init (struct vge_softc *); static int vge_tx_list_init (struct vge_softc *); -#ifdef VGE_FIXUP_RX +static void vge_freebufs (struct vge_softc *); +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx (struct mbuf *); #endif -static int vge_rxeof (struct vge_softc *); +static int vge_rxeof (struct vge_softc *, int); static void vge_txeof (struct vge_softc *); static void vge_intr (void *); static void vge_tick (void *); @@ -547,6 +546,8 @@ vge_setmulti(sc) struct ifmultiaddr *ifma; u_int32_t h, hashes[2] = { 0, 0 }; + VGE_LOCK_ASSERT(sc); + ifp = sc->vge_ifp; /* First, zot all the multicast entries. */ @@ -662,249 +663,326 @@ vge_probe(dev) return (ENXIO); } -static void -vge_dma_map_rx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - - struct vge_dmaload_arg *ctx; - struct vge_rx_desc *d = NULL; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* - * Map the segment array into descriptors. - */ - - d = &ctx->sc->vge_ldata.vge_rx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_RDSTS_OWN) { - device_printf(ctx->sc->vge_dev, - "tried to map busy descriptor\n"); - ctx->vge_maxsegs = 0; - return; - } - - d->vge_buflen = htole16(VGE_BUFLEN(segs[0].ds_len) | VGE_RXDESC_I); - d->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - d->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - d->vge_sts = 0; - d->vge_ctl = 0; - - ctx->vge_maxsegs = 1; - - return; -} - -static void -vge_dma_map_tx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - struct vge_dmaload_arg *ctx; - struct vge_tx_desc *d = NULL; - struct vge_tx_frag *f; - int i = 0; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* Map the segment array into descriptors. */ - - d = &ctx->sc->vge_ldata.vge_tx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_TDSTS_OWN) { - ctx->vge_maxsegs = 0; - return; - } - - for (i = 0; i < nseg; i++) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(segs[i].ds_len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[i].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[i].ds_addr) & 0xFFFF); - } - - /* Argh. This chip does not autopad short frames */ - - if (ctx->vge_m0->m_pkthdr.len < VGE_MIN_FRAMELEN) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(VGE_MIN_FRAMELEN - - ctx->vge_m0->m_pkthdr.len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - ctx->vge_m0->m_pkthdr.len = VGE_MIN_FRAMELEN; - i++; - } - - /* - * When telling the chip how many segments there are, we - * must use nsegs + 1 instead of just nsegs. Darned if I - * know why. - */ - i++; - - d->vge_sts = ctx->vge_m0->m_pkthdr.len << 16; - d->vge_ctl = ctx->vge_flags|(i << 28)|VGE_TD_LS_NORM; - - if (ctx->vge_m0->m_pkthdr.len > ETHERMTU + ETHER_HDR_LEN) - d->vge_ctl |= VGE_TDCTL_JUMBO; - - ctx->vge_maxsegs = nseg; - - return; -} - /* * Map a single buffer address. */ +struct vge_dmamap_arg { + bus_addr_t vge_busaddr; +}; + static void -vge_dma_map_addr(arg, segs, nseg, error) +vge_dmamap_cb(arg, segs, nsegs, error) void *arg; bus_dma_segment_t *segs; - int nseg; + int nsegs; int error; { - bus_addr_t *addr; + struct vge_dmamap_arg *ctx; - if (error) + if (error != 0) return; - KASSERT(nseg == 1, ("too many DMA segments, %d should be 1", nseg)); - addr = arg; - *addr = segs->ds_addr; + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - return; + ctx = (struct vge_dmamap_arg *)arg; + ctx->vge_busaddr = segs[0].ds_addr; } static int -vge_allocmem(dev, sc) - device_t dev; - struct vge_softc *sc; +vge_dma_alloc(sc) + struct vge_softc *sc; { - int error; - int nseg; - int i; - - /* - * Allocate map for RX mbufs. - */ - nseg = 32; - error = bus_dma_tag_create(sc->vge_parent_tag, ETHER_ALIGN, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, MCLBYTES * nseg, nseg, MCLBYTES, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_mtag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; + + lowaddr = BUS_SPACE_MAXADDR; + +again: + /* Create parent ring tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent DMA tag.\n"); + goto fail; } - /* - * Allocate map for TX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_tx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Create tag for Tx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_TX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_TX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_TX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Tx ring DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the TX ring */ - - error = bus_dmamem_alloc(sc->vge_ldata.vge_tx_list_tag, - (void **)&sc->vge_ldata.vge_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_tx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_RX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_RX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_RX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Rx ring DMA tag.\n"); + goto fail; + } - /* Load the map for the TX ring. */ + /* Allocate DMA'able memory and load the DMA map for Tx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_tx_ring_tag, + (void **)&sc->vge_rdata.vge_tx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_tx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Tx ring.\n"); + goto fail; + } - error = bus_dmamap_load(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, sc->vge_ldata.vge_tx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_tx_list_addr, BUS_DMA_NOWAIT); + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, sc->vge_rdata.vge_tx_ring, + VGE_TX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Tx ring.\n"); + goto fail; + } + sc->vge_rdata.vge_tx_ring_paddr = ctx.vge_busaddr; - /* Create DMA maps for TX buffers */ + /* Allocate DMA'able memory and load the DMA map for Rx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_rx_ring_tag, + (void **)&sc->vge_rdata.vge_rx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_rx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Rx ring.\n"); + goto fail; + } - for (i = 0; i < VGE_TX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_tx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for TX\n"); - return (ENOMEM); - } + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, sc->vge_rdata.vge_rx_ring, + VGE_RX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Rx ring.\n"); + goto fail; } + sc->vge_rdata.vge_rx_ring_paddr = ctx.vge_busaddr; - /* - * Allocate map for RX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_rx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Tx/Rx descriptor queue should reside within 4GB boundary. */ + tx_ring_end = sc->vge_rdata.vge_tx_ring_paddr + VGE_TX_LIST_SZ; + rx_ring_end = sc->vge_rdata.vge_rx_ring_paddr + VGE_RX_LIST_SZ; + if ((VGE_ADDR_HI(tx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_tx_ring_paddr)) || + (VGE_ADDR_HI(rx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_rx_ring_paddr)) || + VGE_ADDR_HI(tx_ring_end) != VGE_ADDR_HI(rx_ring_end)) { + device_printf(sc->vge_dev, "4GB boundary crossed, " + "switching to 32bit DMA address mode.\n"); + vge_dma_free(sc); + /* Limit DMA address space to 32bit and try again. */ + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } + + /* Create parent buffer tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + VGE_BUF_DMA_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_buffer_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent buffer DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the RX ring */ + /* Create tag for Tx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + 1, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * VGE_MAXTXSEGS, /* maxsize */ + VGE_MAXTXSEGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Tx DMA tag.\n"); + goto fail; + } - error = bus_dmamem_alloc(sc->vge_ldata.vge_rx_list_tag, - (void **)&sc->vge_ldata.vge_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_rx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + VGE_RX_BUF_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Rx DMA tag.\n"); + goto fail; + } - /* Load the map for the RX ring. */ + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_tx_tag, 0, + &txd->tx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for Rx buffers. */ + if ((error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &sc->vge_cdata.vge_rx_sparemap)) != 0) { + device_printf(sc->vge_dev, + "could not create spare Rx dmamap.\n"); + goto fail; + } + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &rxd->rx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Rx dmamap.\n"); + goto fail; + } + } - error = bus_dmamap_load(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, sc->vge_ldata.vge_rx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_rx_list_addr, BUS_DMA_NOWAIT); +fail: + return (error); +} - /* Create DMA maps for RX buffers */ +static void +vge_dma_free(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; - for (i = 0; i < VGE_RX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_rx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for RX\n"); - return (ENOMEM); + /* Tx ring. */ + if (sc->vge_cdata.vge_tx_ring_tag != NULL) { + if (sc->vge_cdata.vge_tx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map); + if (sc->vge_cdata.vge_tx_ring_map && + sc->vge_rdata.vge_tx_ring) + bus_dmamem_free(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_rdata.vge_tx_ring, + sc->vge_cdata.vge_tx_ring_map); + sc->vge_rdata.vge_tx_ring = NULL; + sc->vge_cdata.vge_tx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_ring_tag); + sc->vge_cdata.vge_tx_ring_tag = NULL; + } + /* Rx ring. */ + if (sc->vge_cdata.vge_rx_ring_tag != NULL) { + if (sc->vge_cdata.vge_rx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map); + if (sc->vge_cdata.vge_rx_ring_map && + sc->vge_rdata.vge_rx_ring) + bus_dmamem_free(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_rdata.vge_rx_ring, + sc->vge_cdata.vge_rx_ring_map); + sc->vge_rdata.vge_rx_ring = NULL; + sc->vge_cdata.vge_rx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_ring_tag); + sc->vge_cdata.vge_rx_ring_tag = NULL; + } + /* Tx buffers. */ + if (sc->vge_cdata.vge_tx_tag != NULL) { + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + txd->tx_dmamap = NULL; + } } + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_tag); + sc->vge_cdata.vge_tx_tag = NULL; + } + /* Rx buffers. */ + if (sc->vge_cdata.vge_rx_tag != NULL) { + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + rxd->rx_dmamap = NULL; + } + } + if (sc->vge_cdata.vge_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap); + sc->vge_cdata.vge_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_tag); + sc->vge_cdata.vge_rx_tag = NULL; + } + + if (sc->vge_cdata.vge_buffer_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_buffer_tag); + sc->vge_cdata.vge_buffer_tag = NULL; + } + if (sc->vge_cdata.vge_ring_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_ring_tag); + sc->vge_cdata.vge_ring_tag = NULL; } - - return (0); } /* @@ -961,25 +1039,7 @@ vge_attach(dev) */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define VGE_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, VGE_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->vge_parent_tag); - if (error) - goto fail; - - error = vge_allocmem(dev, sc); - + error = vge_dma_alloc(sc); if (error) goto fail; @@ -1051,7 +1111,6 @@ vge_detach(dev) { struct vge_softc *sc; struct ifnet *ifp; - int i; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1084,97 +1143,93 @@ vge_detach(dev) if (ifp) if_free(ifp); - /* Unload and free the RX DMA ring memory and map */ + vge_dma_free(sc); + mtx_destroy(&sc->vge_mtx); - if (sc->vge_ldata.vge_rx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list, - sc->vge_ldata.vge_rx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_rx_list_tag); - } - - /* Unload and free the TX DMA ring memory and map */ - - if (sc->vge_ldata.vge_tx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list, - sc->vge_ldata.vge_tx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_tx_list_tag); - } - - /* Destroy all the RX and TX buffer maps */ - - if (sc->vge_ldata.vge_mtag) { - for (i = 0; i < VGE_TX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_tx_dmamap[i]); - for (i = 0; i < VGE_RX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[i]); - bus_dma_tag_destroy(sc->vge_ldata.vge_mtag); - } + return (0); +} - if (sc->vge_parent_tag) - bus_dma_tag_destroy(sc->vge_parent_tag); +static void +vge_discard_rxbuf(sc, prod) + struct vge_softc *sc; + int prod; +{ + struct vge_rxdesc *rxd; + int i; - mtx_destroy(&sc->vge_mtx); + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; - return (0); + /* + * Note: the manual fails to document the fact that for + * proper opration, the driver needs to replentish the RX + * DMA ring 4 descriptors at a time (rather than one at a + * time, like most chips). We can allocate the new buffers + * but we should not set the OWN bits until we're ready + * to hand back 4 of them in one shot. + */ + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; + } } static int -vge_newbuf(sc, idx, m) +vge_newbuf(sc, prod) struct vge_softc *sc; - int idx; - struct mbuf *m; + int prod; { - struct vge_dmaload_arg arg; - struct mbuf *n = NULL; - int i, error; - - if (m == NULL) { - n = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (n == NULL) - return (ENOBUFS); - m = n; - } else - m->m_data = m->m_ext.ext_buf; - - -#ifdef VGE_FIXUP_RX - /* - * This is part of an evil trick to deal with non-x86 platforms. - * The VIA chip requires RX buffers to be aligned on 32-bit - * boundaries, but that will hose non-x86 machines. To get around - * this, we leave some empty space at the start of each buffer - * and for non-x86 hosts, we copy the buffer back two bytes - * to achieve word alignment. This is slightly more efficient - * than allocating a new buffer, copying the contents, and - * discarding the old buffer. + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + /* + * This is part of an evil trick to deal with strict-alignment + * architectures. The VIA chip requires RX buffers to be aligned + * on 32-bit boundaries, but that will hose strict-alignment + * architectures. To get around this, we leave some empty space + * at the start of each buffer and for non-strict-alignment hosts, + * we copy the buffer back two bytes to achieve word alignment. + * This is slightly more efficient than allocating a new buffer, + * copying the contents, and discarding the old buffer. */ - m->m_len = m->m_pkthdr.len = MCLBYTES - VGE_ETHER_ALIGN; - m_adj(m, VGE_ETHER_ALIGN); -#else m->m_len = m->m_pkthdr.len = MCLBYTES; -#endif + m_adj(m, VGE_RX_BUF_ALIGN); - arg.sc = sc; - arg.vge_idx = idx; - arg.vge_maxsegs = 1; - arg.vge_flags = 0; - - error = bus_dmamap_load_mbuf(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], m, vge_dma_map_rx_desc, - &arg, BUS_DMA_NOWAIT); - if (error || arg.vge_maxsegs != 1) { - if (n != NULL) - m_freem(n); - return (ENOMEM); + if (bus_dmamap_load_mbuf_sg(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap, m, segs, &nsegs, 0) != 0) { + m_freem(m); + return (ENOBUFS); } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap); + } + map = rxd->rx_dmamap; + rxd->rx_dmamap = sc->vge_cdata.vge_rx_sparemap; + sc->vge_cdata.vge_rx_sparemap = map; + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_PREREAD); + rxd->rx_m = m; + + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; + rxd->rx_desc->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); + rxd->rx_desc->vge_addrhi = htole32(VGE_ADDR_HI(segs[0].ds_addr) | + (VGE_BUFLEN(segs[0].ds_len) << 16) | VGE_RXDESC_I); /* * Note: the manual fails to document the fact that for @@ -1184,73 +1239,127 @@ vge_newbuf(sc, idx, m) * but we should not set the OWN bits until we're ready * to hand back 4 of them in one shot. */ - -#define VGE_RXCHUNK 4 - sc->vge_rx_consumed++; - if (sc->vge_rx_consumed == VGE_RXCHUNK) { - for (i = idx; i != idx - sc->vge_rx_consumed; i--) - sc->vge_ldata.vge_rx_list[i].vge_sts |= - htole32(VGE_RDSTS_OWN); - sc->vge_rx_consumed = 0; + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; } - sc->vge_ldata.vge_rx_mbuf[idx] = m; - - bus_dmamap_sync(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], - BUS_DMASYNC_PREREAD); - return (0); } static int vge_tx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { - bzero ((char *)sc->vge_ldata.vge_tx_list, VGE_TX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_tx_mbuf, - (VGE_TX_DESC_CNT * sizeof(struct mbuf *))); - - bus_dmamap_sync(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, BUS_DMASYNC_PREWRITE); - sc->vge_ldata.vge_tx_prodidx = 0; - sc->vge_ldata.vge_tx_considx = 0; - sc->vge_ldata.vge_tx_free = VGE_TX_DESC_CNT; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; + + VGE_LOCK_ASSERT(sc); + + sc->vge_cdata.vge_tx_prodidx = 0; + sc->vge_cdata.vge_tx_considx = 0; + sc->vge_cdata.vge_tx_cnt = 0; + + rd = &sc->vge_rdata; + bzero(rd->vge_tx_ring, VGE_TX_LIST_SZ); + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_desc = &rd->vge_tx_ring[i]; + } + + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } static int vge_rx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; int i; - bzero ((char *)sc->vge_ldata.vge_rx_list, VGE_RX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_rx_mbuf, - (VGE_RX_DESC_CNT * sizeof(struct mbuf *))); + VGE_LOCK_ASSERT(sc); - sc->vge_rx_consumed = 0; + sc->vge_cdata.vge_rx_prodidx = 0; + sc->vge_cdata.vge_head = NULL; + sc->vge_cdata.vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; + rd = &sc->vge_rdata; + bzero(rd->vge_rx_ring, VGE_RX_LIST_SZ); for (i = 0; i < VGE_RX_DESC_CNT; i++) { - if (vge_newbuf(sc, i, NULL) == ENOBUFS) + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_desc = &rd->vge_rx_ring[i]; + if (i == 0) + rxd->rxd_prev = + &sc->vge_cdata.vge_rxdesc[VGE_RX_DESC_CNT - 1]; + else + rxd->rxd_prev = &sc->vge_cdata.vge_rxdesc[i - 1]; + if (vge_newbuf(sc, i) != 0) return (ENOBUFS); } - /* Flush the RX descriptors */ + bus_dmamap_sync(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD); - - sc->vge_ldata.vge_rx_prodidx = 0; - sc->vge_rx_consumed = 0; - sc->vge_head = sc->vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; return (0); } -#ifdef VGE_FIXUP_RX +static void +vge_freebufs(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + /* + * Free RX and TX mbufs still in the queues. + */ + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + m_freem(rxd->rx_m); + rxd->rx_m = NULL; + } + } + + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + ifp->if_oerrors++; + } + } +} + +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx(m) struct mbuf *m; @@ -1265,8 +1374,6 @@ vge_fixup_rx(m) *dst++ = *src++; m->m_data -= ETHER_ALIGN; - - return; } #endif @@ -1275,49 +1382,39 @@ vge_fixup_rx(m) * been fragmented across multiple 2K mbuf cluster buffers. */ static int -vge_rxeof(sc) +vge_rxeof(sc, count) struct vge_softc *sc; + int count; { struct mbuf *m; struct ifnet *ifp; - int i, total_len; - int lim = 0; + int prod, prog, total_len; + struct vge_rxdesc *rxd; struct vge_rx_desc *cur_rx; - u_int32_t rxstat, rxctl; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - i = sc->vge_ldata.vge_rx_prodidx; - - /* Invalidate the descriptor memory */ - - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_POSTREAD); - - while (!VGE_OWN(&sc->vge_ldata.vge_rx_list[i])) { -#ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->rxcycles <= 0) - break; - sc->rxcycles--; - } -#endif + ifp = sc->vge_ifp; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:49:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8CB71065672; Mon, 14 Dec 2009 18:49:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7EB28FC13; Mon, 14 Dec 2009 18:49:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEInGaC034941; Mon, 14 Dec 2009 18:49:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEInGB7034939; Mon, 14 Dec 2009 18:49:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141849.nBEInGB7034939@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200526 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:49:16 -0000 Author: yongari Date: Mon Dec 14 18:49:16 2009 New Revision: 200526 URL: http://svn.freebsd.org/changeset/base/200526 Log: Use PCIR_BAR instead of hard-coded value. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 18:44:23 2009 (r200525) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 18:49:16 2009 (r200526) @@ -187,9 +187,6 @@ static int vge_cam_set (struct vge_soft static void vge_setmulti (struct vge_softc *); static void vge_reset (struct vge_softc *); -#define VGE_PCI_LOIO 0x10 -#define VGE_PCI_LOMEM 0x14 - static device_method_t vge_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vge_probe), @@ -1010,7 +1007,7 @@ vge_attach(dev) */ pci_enable_busmaster(dev); - rid = VGE_PCI_LOMEM; + rid = PCIR_BAR(1); sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1139,7 +1136,7 @@ vge_detach(dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, - VGE_PCI_LOMEM, sc->vge_res); + PCIR_BAR(1), sc->vge_res); if (ifp) if_free(ifp); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 18:50:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47521065692; Mon, 14 Dec 2009 18:50:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF4FD8FC14; Mon, 14 Dec 2009 18:50:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEIoQo9035006; Mon, 14 Dec 2009 18:50:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEIoQwA035004; Mon, 14 Dec 2009 18:50:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141850.nBEIoQwA035004@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 18:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200527 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 18:50:26 -0000 Author: yongari Date: Mon Dec 14 18:50:26 2009 New Revision: 200527 URL: http://svn.freebsd.org/changeset/base/200527 Log: Fix typo in register definition. Modified: head/sys/dev/vge/if_vgereg.h Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Mon Dec 14 18:49:16 2009 (r200526) +++ head/sys/dev/vge/if_vgereg.h Mon Dec 14 18:50:26 2009 (r200527) @@ -339,19 +339,19 @@ #define VGE_TXQCSR_RUN0 0x0001 /* Enable TX queue 0 */ #define VGE_TXQCSR_ACT0 0x0002 /* queue 0 active indicator */ #define VGE_TXQCSR_WAK0 0x0004 /* Wake up (poll) queue 0 */ -#define VGE_TXQCST_DEAD0 0x0008 /* queue 0 dead indicator */ +#define VGE_TXQCSR_DEAD0 0x0008 /* queue 0 dead indicator */ #define VGE_TXQCSR_RUN1 0x0010 /* Enable TX queue 1 */ #define VGE_TXQCSR_ACT1 0x0020 /* queue 1 active indicator */ #define VGE_TXQCSR_WAK1 0x0040 /* Wake up (poll) queue 1 */ -#define VGE_TXQCST_DEAD1 0x0080 /* queue 1 dead indicator */ +#define VGE_TXQCSR_DEAD1 0x0080 /* queue 1 dead indicator */ #define VGE_TXQCSR_RUN2 0x0100 /* Enable TX queue 2 */ #define VGE_TXQCSR_ACT2 0x0200 /* queue 2 active indicator */ #define VGE_TXQCSR_WAK2 0x0400 /* Wake up (poll) queue 2 */ -#define VGE_TXQCST_DEAD2 0x0800 /* queue 2 dead indicator */ +#define VGE_TXQCSR_DEAD2 0x0800 /* queue 2 dead indicator */ #define VGE_TXQCSR_RUN3 0x1000 /* Enable TX queue 3 */ #define VGE_TXQCSR_ACT3 0x2000 /* queue 3 active indicator */ #define VGE_TXQCSR_WAK3 0x4000 /* Wake up (poll) queue 3 */ -#define VGE_TXQCST_DEAD3 0x8000 /* queue 3 dead indicator */ +#define VGE_TXQCSR_DEAD3 0x8000 /* queue 3 dead indicator */ /* RX descriptor queue control/status register */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:05:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EE811065670; Mon, 14 Dec 2009 19:05:17 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24E3A8FC0A; Mon, 14 Dec 2009 19:05:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEJ5HGL035336; Mon, 14 Dec 2009 19:05:17 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJ5HuS035334; Mon, 14 Dec 2009 19:05:17 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200912141905.nBEJ5HuS035334@svn.freebsd.org> From: Jack F Vogel Date: Mon, 14 Dec 2009 19:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200528 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:05:17 -0000 Author: jfv Date: Mon Dec 14 19:05:16 2009 New Revision: 200528 URL: http://svn.freebsd.org/changeset/base/200528 Log: Add old read_mac_addr routine to this module since a customer report of an Invalid MAC Address has occurred. Modified: head/sys/dev/e1000/e1000_82543.c Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Mon Dec 14 18:50:26 2009 (r200527) +++ head/sys/dev/e1000/e1000_82543.c Mon Dec 14 19:05:16 2009 (r200528) @@ -75,6 +75,8 @@ static void e1000_shift_out_mdi_bits_825 u16 count); static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw); static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state); +static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw); + /** * e1000_init_phy_params_82543 - Init PHY func ptrs. @@ -246,6 +248,8 @@ static s32 e1000_init_mac_params_82543(s mac->ops.clear_vfta = e1000_clear_vfta_generic; /* setting MTA */ mac->ops.mta_set = e1000_mta_set_82543; + /* read mac address */ + mac->ops.read_mac_addr = e1000_read_mac_addr_82543; /* turn on/off LED */ mac->ops.led_on = e1000_led_on_82543; mac->ops.led_off = e1000_led_off_82543; @@ -1600,3 +1604,41 @@ static void e1000_clear_hw_cntrs_82543(s E1000_READ_REG(hw, E1000_TSCTC); E1000_READ_REG(hw, E1000_TSCTFC); } + +/** + * e1000_read_mac_addr_82543 - Read device MAC address + * @hw: pointer to the HW structure + * + * Reads the device MAC address from the EEPROM and stores the value. + * Since devices with two ports use the same EEPROM, we increment the + * last bit in the MAC address for the second port. + * + **/ +s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + u16 offset, nvm_data, i; + + DEBUGFUNC("e1000_read_mac_addr"); + + for (i = 0; i < ETH_ADDR_LEN; i += 2) { + offset = i >> 1; + ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + goto out; + } + hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); + hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); + } + + /* Flip last bit of mac address if we're on second port */ + if (hw->bus.func == E1000_FUNC_1) + hw->mac.perm_addr[5] ^= 1; + + for (i = 0; i < ETH_ADDR_LEN; i++) + hw->mac.addr[i] = hw->mac.perm_addr[i]; + +out: + return ret_val; +} From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:08:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81C5F106566B; Mon, 14 Dec 2009 19:08:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70FE78FC13; Mon, 14 Dec 2009 19:08:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEJ8BJN035429; Mon, 14 Dec 2009 19:08:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJ8BUA035427; Mon, 14 Dec 2009 19:08:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141908.nBEJ8BUA035427@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200529 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:08:11 -0000 Author: yongari Date: Mon Dec 14 19:08:11 2009 New Revision: 200529 URL: http://svn.freebsd.org/changeset/base/200529 Log: Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit seems to work like a tag that indicates 'not list end' of queued frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So the last frame of multiple queued frames has no VGE_TXDESC_Q bit. The hardware has peculiar behavior for VGE_TXDESC_Q bit handling. If the VGE_TXDESC_Q bit of descriptor was set the controller would fetch next descriptor. However if next descriptor's OWN bit was cleared but VGE_TXDESC_Q was set, it could confuse controller. Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct behavior. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:05:16 2009 (r200528) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:08:11 2009 (r200529) @@ -1596,8 +1596,11 @@ vge_txeof(sc) __func__)); m_freem(txd->tx_m); txd->tx_m = NULL; + txd->tx_desc->vge_frag[0].vge_addrhi = 0; } - + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:16:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F349106566B; Mon, 14 Dec 2009 19:16:10 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id F17218FC17; Mon, 14 Dec 2009 19:16:09 +0000 (UTC) Received: by ewy26 with SMTP id 26so4006499ewy.3 for ; Mon, 14 Dec 2009 11:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Rz/4De+R6pBOk7jcJA2DJoEOQK6evu6SAgj0dvVjqXU=; b=YGlvjD3Co+vQ5xU4Ty3c+z9yaiwVES4CE0ppxOU6AxTjoqULraSLh3TSoqnGNaBTSs fW07IgrG4Jtcelg4SSTZs7Al6u6g9ZkH1+5Z3bXxVJE7pOcw1zFOJCvfdIP/ysjxsuTn sQdlzdkG7Q74BZ2Nq3zdEZxn9P7ORpLUCxh0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=bZkl46wYgMDTgsjf0QaqvxRUNKGKK7d5idiCQ16q+xZ2hrH5a3atNczp3L6Eptrx2w OQXY1WfNSA/97A0qGi1S0M0NP8gndbvB7aOApoXPig35shmssoDET9Pt1AXCTtiVhe/s Wt0ZDos5sNv7wD2/f3/wRVeZKpGXr/RAbqtWE= MIME-Version: 1.0 Received: by 10.216.85.130 with SMTP id u2mr2168668wee.135.1260816346014; Mon, 14 Dec 2009 10:45:46 -0800 (PST) In-Reply-To: <4B25C3EF.5010009@freebsd.org> References: <200912081854.nB8IsbrP096592@svn.freebsd.org> <4B25C3EF.5010009@freebsd.org> Date: Mon, 14 Dec 2009 10:45:45 -0800 Message-ID: <2a41acea0912141045m7f1b7a8cq3eb40475f5672e7d@mail.gmail.com> From: Jack Vogel To: Lawrence Stewart Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200268 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:16:10 -0000 Fixed in the commit today. Test again please. Jack On Sun, Dec 13, 2009 at 8:49 PM, Lawrence Stewart wrote: > [picking a recent e1000 commit] > > Hi Jack, > > I'm getting the following panic on head r200376 on my HP DC7800 work > desktop: > > mtx_lock() of spin mutex &dev_spec->swflag_mutex @ > /usr/src/sys/dev/e1000/e1000_ich8lan.c:651 > > I don't experience the panic with an 8.0-RELEASE kernel. > > Anything obviously wrong with that line of code as far as you're concerned, > or do I need to dig some more detail out? Debugging with this system is > painful, hence the initial hand transcribed minimal detail, but if you need > more info I'll try figure out how to get you what you need. > > Cheers, > Lawrence > From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:18:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD2F51065670; Mon, 14 Dec 2009 19:18:02 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CC0A8FC14; Mon, 14 Dec 2009 19:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEJI2jL035668; Mon, 14 Dec 2009 19:18:02 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJI2AS035666; Mon, 14 Dec 2009 19:18:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912141918.nBEJI2AS035666@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 14 Dec 2009 19:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200530 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:18:02 -0000 Author: gavin Date: Mon Dec 14 19:18:02 2009 New Revision: 200530 URL: http://svn.freebsd.org/changeset/base/200530 Log: Don't panic on failure to attach if we fail before or during the if_alloc() of ifp. This fixes the panic reported in the PR, but not the attach failure. PR: kern/139079 Tested by: Steven Noonan Reviewed by: thompsa Approved by: ed (mentor) MFC after: 2 weeks` Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Dec 14 19:08:11 2009 (r200529) +++ head/sys/dev/wpi/if_wpi.c Mon Dec 14 19:18:02 2009 (r200530) @@ -713,13 +713,14 @@ wpi_detach(device_t dev) { struct wpi_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; int ac; - ieee80211_draintask(ic, &sc->sc_restarttask); - ieee80211_draintask(ic, &sc->sc_radiotask); - if (ifp != NULL) { + ic = ifp->if_l2com; + + ieee80211_draintask(ic, &sc->sc_restarttask); + ieee80211_draintask(ic, &sc->sc_radiotask); wpi_stop(sc); callout_drain(&sc->watchdog_to); callout_drain(&sc->calib_to); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:44:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A4F5106566C; Mon, 14 Dec 2009 19:44:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38FBC8FC19; Mon, 14 Dec 2009 19:44:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEJitpD036219; Mon, 14 Dec 2009 19:44:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJitH6036217; Mon, 14 Dec 2009 19:44:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141944.nBEJitH6036217@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200531 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:44:55 -0000 Author: yongari Date: Mon Dec 14 19:44:54 2009 New Revision: 200531 URL: http://svn.freebsd.org/changeset/base/200531 Log: Use ANSI function definations. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:18:02 2009 (r200530) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:44:54 2009 (r200531) @@ -224,10 +224,7 @@ DRIVER_MODULE(miibus, vge, miibus_driver * Read a word of data stored in the EEPROM at address 'addr.' */ static void -vge_eeprom_getword(sc, addr, dest) - struct vge_softc *sc; - int addr; - u_int16_t *dest; +vge_eeprom_getword(struct vge_softc *sc, int addr, u_int16_t *dest) { int i; u_int16_t word = 0; @@ -275,12 +272,7 @@ vge_eeprom_getword(sc, addr, dest) * Read a sequence of words from the EEPROM. */ static void -vge_read_eeprom(sc, dest, off, cnt, swap) - struct vge_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +vge_read_eeprom(struct vge_softc *sc, caddr_t dest, int off, int cnt, int swap) { int i; #ifdef VGE_EEPROM @@ -301,8 +293,7 @@ vge_read_eeprom(sc, dest, off, cnt, swap } static void -vge_miipoll_stop(sc) - struct vge_softc *sc; +vge_miipoll_stop(struct vge_softc *sc) { int i; @@ -321,8 +312,7 @@ vge_miipoll_stop(sc) } static void -vge_miipoll_start(sc) - struct vge_softc *sc; +vge_miipoll_start(struct vge_softc *sc) { int i; @@ -361,9 +351,7 @@ vge_miipoll_start(sc) } static int -vge_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +vge_miibus_readreg(device_t dev, int phy, int reg) { struct vge_softc *sc; int i; @@ -400,9 +388,7 @@ vge_miibus_readreg(dev, phy, reg) } static int -vge_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +vge_miibus_writereg(device_t dev, int phy, int reg, int data) { struct vge_softc *sc; int i, rval = 0; @@ -441,8 +427,7 @@ vge_miibus_writereg(dev, phy, reg, data) } static void -vge_cam_clear(sc) - struct vge_softc *sc; +vge_cam_clear(struct vge_softc *sc) { int i; @@ -474,9 +459,7 @@ vge_cam_clear(sc) } static int -vge_cam_set(sc, addr) - struct vge_softc *sc; - uint8_t *addr; +vge_cam_set(struct vge_softc *sc, uint8_t *addr) { int i, error = 0; @@ -535,8 +518,7 @@ fail: * we use the hash filter instead. */ static void -vge_setmulti(sc) - struct vge_softc *sc; +vge_setmulti(struct vge_softc *sc) { struct ifnet *ifp; int error = 0/*, h = 0*/; @@ -597,8 +579,7 @@ vge_setmulti(sc) } static void -vge_reset(sc) - struct vge_softc *sc; +vge_reset(struct vge_softc *sc) { int i; @@ -641,8 +622,7 @@ vge_reset(sc) * IDs against our list and return a device name if we find a match. */ static int -vge_probe(dev) - device_t dev; +vge_probe(device_t dev) { struct vge_type *t; @@ -669,11 +649,7 @@ struct vge_dmamap_arg { }; static void -vge_dmamap_cb(arg, segs, nsegs, error) - void *arg; - bus_dma_segment_t *segs; - int nsegs; - int error; +vge_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { struct vge_dmamap_arg *ctx; @@ -687,8 +663,7 @@ vge_dmamap_cb(arg, segs, nsegs, error) } static int -vge_dma_alloc(sc) - struct vge_softc *sc; +vge_dma_alloc(struct vge_softc *sc) { struct vge_dmamap_arg ctx; struct vge_txdesc *txd; @@ -903,8 +878,7 @@ fail: } static void -vge_dma_free(sc) - struct vge_softc *sc; +vge_dma_free(struct vge_softc *sc) { struct vge_txdesc *txd; struct vge_rxdesc *rxd; @@ -987,8 +961,7 @@ vge_dma_free(sc) * setup and ethernet/BPF attach. */ static int -vge_attach(dev) - device_t dev; +vge_attach(device_t dev) { u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; @@ -1103,8 +1076,7 @@ fail: * allocated. */ static int -vge_detach(dev) - device_t dev; +vge_detach(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; @@ -1147,9 +1119,7 @@ vge_detach(dev) } static void -vge_discard_rxbuf(sc, prod) - struct vge_softc *sc; - int prod; +vge_discard_rxbuf(struct vge_softc *sc, int prod) { struct vge_rxdesc *rxd; int i; @@ -1176,9 +1146,7 @@ vge_discard_rxbuf(sc, prod) } static int -vge_newbuf(sc, prod) - struct vge_softc *sc; - int prod; +vge_newbuf(struct vge_softc *sc, int prod) { struct vge_rxdesc *rxd; struct mbuf *m; @@ -1248,8 +1216,7 @@ vge_newbuf(sc, prod) } static int -vge_tx_list_init(sc) - struct vge_softc *sc; +vge_tx_list_init(struct vge_softc *sc) { struct vge_ring_data *rd; struct vge_txdesc *txd; @@ -1277,8 +1244,7 @@ vge_tx_list_init(sc) } static int -vge_rx_list_init(sc) - struct vge_softc *sc; +vge_rx_list_init(struct vge_softc *sc) { struct vge_ring_data *rd; struct vge_rxdesc *rxd; @@ -1316,8 +1282,7 @@ vge_rx_list_init(sc) } static void -vge_freebufs(sc) - struct vge_softc *sc; +vge_freebufs(struct vge_softc *sc) { struct vge_txdesc *txd; struct vge_rxdesc *rxd; @@ -1358,8 +1323,7 @@ vge_freebufs(sc) #ifndef __NO_STRICT_ALIGNMENT static __inline void -vge_fixup_rx(m) - struct mbuf *m; +vge_fixup_rx(struct mbuf *m) { int i; uint16_t *src, *dst; @@ -1379,9 +1343,7 @@ vge_fixup_rx(m) * been fragmented across multiple 2K mbuf cluster buffers. */ static int -vge_rxeof(sc, count) - struct vge_softc *sc; - int count; +vge_rxeof(struct vge_softc *sc, int count) { struct mbuf *m; struct ifnet *ifp; @@ -1553,8 +1515,7 @@ vge_rxeof(sc, count) } static void -vge_txeof(sc) - struct vge_softc *sc; +vge_txeof(struct vge_softc *sc) { struct ifnet *ifp; struct vge_tx_desc *cur_tx; @@ -1616,8 +1577,7 @@ vge_txeof(sc) } static void -vge_tick(xsc) - void *xsc; +vge_tick(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; @@ -1698,8 +1658,7 @@ done: #endif /* DEVICE_POLLING */ static void -vge_intr(arg) - void *arg; +vge_intr(void *arg) { struct vge_softc *sc; struct ifnet *ifp; @@ -1775,9 +1734,7 @@ vge_intr(arg) } static int -vge_encap(sc, m_head) - struct vge_softc *sc; - struct mbuf **m_head; +vge_encap(struct vge_softc *sc, struct mbuf **m_head) { struct vge_txdesc *txd; struct vge_tx_frag *frag; @@ -1904,8 +1861,7 @@ vge_encap(sc, m_head) */ static void -vge_start(ifp) - struct ifnet *ifp; +vge_start(struct ifnet *ifp) { struct vge_softc *sc; @@ -1917,8 +1873,7 @@ vge_start(ifp) static void -vge_start_locked(ifp) - struct ifnet *ifp; +vge_start_locked(struct ifnet *ifp) { struct vge_softc *sc; struct vge_txdesc *txd; @@ -1991,8 +1946,7 @@ vge_start_locked(ifp) } static void -vge_init(xsc) - void *xsc; +vge_init(void *xsc) { struct vge_softc *sc = xsc; @@ -2182,8 +2136,7 @@ vge_init_locked(struct vge_softc *sc) * Set media options. */ static int -vge_ifmedia_upd(ifp) - struct ifnet *ifp; +vge_ifmedia_upd(struct ifnet *ifp) { struct vge_softc *sc; struct mii_data *mii; @@ -2201,9 +2154,7 @@ vge_ifmedia_upd(ifp) * Report current media status. */ static void -vge_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { struct vge_softc *sc; struct mii_data *mii; @@ -2221,8 +2172,7 @@ vge_ifmedia_sts(ifp, ifmr) } static void -vge_miibus_statchg(dev) - device_t dev; +vge_miibus_statchg(device_t dev) { struct vge_softc *sc; struct mii_data *mii; @@ -2271,10 +2221,7 @@ vge_miibus_statchg(dev) } static int -vge_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; +vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct vge_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; @@ -2403,8 +2350,7 @@ vge_watchdog(void *arg) * RX and TX lists. */ static void -vge_stop(sc) - struct vge_softc *sc; +vge_stop(struct vge_softc *sc) { struct ifnet *ifp; @@ -2433,8 +2379,7 @@ vge_stop(sc) * resume. */ static int -vge_suspend(dev) - device_t dev; +vge_suspend(device_t dev) { struct vge_softc *sc; @@ -2455,8 +2400,7 @@ vge_suspend(dev) * appropriate. */ static int -vge_resume(dev) - device_t dev; +vge_resume(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; @@ -2485,8 +2429,7 @@ vge_resume(dev) * get confused by errant DMAs when rebooting. */ static int -vge_shutdown(dev) - device_t dev; +vge_shutdown(device_t dev) { struct vge_softc *sc; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:49:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2A8E1065693; Mon, 14 Dec 2009 19:49:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8D618FC13; Mon, 14 Dec 2009 19:49:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEJnK9L036340; Mon, 14 Dec 2009 19:49:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJnKmH036338; Mon, 14 Dec 2009 19:49:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141949.nBEJnKmH036338@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200532 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:49:21 -0000 Author: yongari Date: Mon Dec 14 19:49:20 2009 New Revision: 200532 URL: http://svn.freebsd.org/changeset/base/200532 Log: Remove unnecessary return statement. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:44:54 2009 (r200531) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:49:20 2009 (r200532) @@ -263,8 +263,6 @@ vge_eeprom_getword(struct vge_softc *sc, CSR_CLRBIT_1(sc, VGE_CHIPCFG2, VGE_CHIPCFG2_EELOAD); *dest = word; - - return; } #endif @@ -307,8 +305,6 @@ vge_miipoll_stop(struct vge_softc *sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to idle MII autopoll\n"); - - return; } static void @@ -346,8 +342,6 @@ vge_miipoll_start(struct vge_softc *sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to start MII autopoll\n"); - - return; } static int @@ -454,8 +448,6 @@ vge_cam_clear(struct vge_softc *sc) CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); sc->vge_camidx = 0; - - return; } static int @@ -574,8 +566,6 @@ vge_setmulti(struct vge_softc *sc) CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } if_maddr_runlock(ifp); - - return; } static void @@ -613,8 +603,6 @@ vge_reset(struct vge_softc *sc) } CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); - - return; } /* @@ -1605,8 +1593,6 @@ vge_tick(void *xsc) vge_start_locked(ifp); } } - - return; } #ifdef DEVICE_POLLING @@ -1729,8 +1715,6 @@ vge_intr(void *arg) vge_start_locked(ifp); VGE_UNLOCK(sc); - - return; } static int @@ -2167,8 +2151,6 @@ vge_ifmedia_sts(struct ifnet *ifp, struc VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; - - return; } static void @@ -2216,8 +2198,6 @@ vge_miibus_statchg(device_t dev) IFM_SUBTYPE(ife->ifm_media)); break; } - - return; } static int @@ -2341,8 +2321,6 @@ vge_watchdog(void *arg) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); - - return; } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:49:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CD7106568D; Mon, 14 Dec 2009 19:49:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DB5B68FC19; Mon, 14 Dec 2009 19:49:56 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 88D4046B37; Mon, 14 Dec 2009 14:49:56 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 3CF828A025; Mon, 14 Dec 2009 14:49:55 -0500 (EST) From: John Baldwin To: Attilio Rao Date: Mon, 14 Dec 2009 14:18:33 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912122131.nBCLV71f064304@svn.freebsd.org> <200912141013.32839.jhb@freebsd.org> <3bbf2fe10912140902m407fa766q3a5e5bb6993723f9@mail.gmail.com> In-Reply-To: <3bbf2fe10912140902m407fa766q3a5e5bb6993723f9@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141418.33255.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 14:49:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200447 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:49:57 -0000 On Monday 14 December 2009 12:02:54 pm Attilio Rao wrote: > 2009/12/14 John Baldwin : > > On Saturday 12 December 2009 4:31:07 pm Attilio Rao wrote: > >> Author: attilio > >> Date: Sat Dec 12 21:31:07 2009 > >> New Revision: 200447 > >> URL: http://svn.freebsd.org/changeset/base/200447 > >> > >> Log: > >> In current code, threads performing an interruptible sleep (on both > >> sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will > >> leave the waiters flag on forcing the owner to do a wakeup even when if > >> the waiter queue is empty. > >> That operation may lead to a deadlock in the case of doing a fake wakeup > >> on the "preferred" (based on the wakeup algorithm) queue while the other > >> queue has real waiters on it, because nobody is going to wakeup the 2nd > >> queue waiters and they will sleep indefinitively. > >> > >> A similar bug, is present, for lockmgr in the case the waiters are > >> sleeping with LK_SLEEPFAIL on. In this case, even if the waiters queue > >> is not empty, the waiters won't progress after being awake but they will > >> just fail, still not taking care of the 2nd queue waiters (as instead the > >> lock owned doing the wakeup would expect). > >> > >> In order to fix this bug in a cheap way (without adding too much locking > >> and complicating too much the semantic) add a sleepqueue interface which > >> does report the actual number of waiters on a specified queue of a > >> waitchannel (sleepq_sleepcnt()) and use it in order to determine if the > >> exclusive waiters (or shared waiters) are actually present on the lockmgr > >> (or sx) before to give them precedence in the wakeup algorithm. > >> This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to > >> cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters > >> a lockmgr has and if all the waiters on the exclusive waiters queue are > >> LK_SLEEPFAIL just wake both queues. > >> > >> The sleepq_sleepcnt() introduction and ABI breakage require > >> __FreeBSD_version bumping. > > > > Hmm, do you need an actual count of waiters or would a 'sleepq_empty()' > > (similar to turnstile_empty()) method be sufficient? > > I need the count in order to fix properly LK_SLEEPFAIL case (the idea > is: track exclusive waiters with LK_SLEEPFAIL on; if the number is > equal to the actual sleepers on the queue then wake up both queues, > otherwise nobody is going to take care of the shared waiters queue). Ok. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:49:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA3611065694; Mon, 14 Dec 2009 19:49:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AC1538FC14; Mon, 14 Dec 2009 19:49:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4FEA946B37; Mon, 14 Dec 2009 14:49:59 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id EAD218A021; Mon, 14 Dec 2009 14:49:57 -0500 (EST) From: John Baldwin To: Jack F Vogel Date: Mon, 14 Dec 2009 14:31:10 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912141843.nBEIhIsA034642@svn.freebsd.org> In-Reply-To: <200912141843.nBEIhIsA034642@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141431.10603.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 14:49:58 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200523 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:50:00 -0000 On Monday 14 December 2009 1:43:18 pm Jack F Vogel wrote: > Author: jfv > Date: Mon Dec 14 18:43:18 2009 > New Revision: 200523 > URL: http://svn.freebsd.org/changeset/base/200523 > > Log: > Remove the MTX_SPIN flag to the shared code MUTEX > as it was causing a panic, also took the opportunity > to rename the lock for clarity. > > Modified: > head/sys/dev/e1000/e1000_osdep.h > > Modified: head/sys/dev/e1000/e1000_osdep.h > ============================================================================== > --- head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:27:34 2009 (r200522) > +++ head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:43:18 2009 (r200523) > @@ -82,8 +82,7 @@ > /* Mutex used in the shared code */ > #define E1000_MUTEX struct mtx > #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ > - MTX_NETWORK_LOCK, \ > - MTX_DEF | MTX_SPIN) > + "E1000 Shared Lock", MTX_DEF) > #define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex) > #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex) > #define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex) Hmm, most NIC drivers use MTX_NETWORK_LOCK so that WITNESS will report LORs that happen if any two NIC drivers locks "cross" (e.g. if one driver leaked a lock while passing a packet up the stack that was forwarded to another interface). Not sure if that is relevant to this particular lock though. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:50:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CABAB1065697; Mon, 14 Dec 2009 19:50:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9C67F8FC13; Mon, 14 Dec 2009 19:50:01 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 42EFB46B39; Mon, 14 Dec 2009 14:50:01 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 546E48A024; Mon, 14 Dec 2009 14:49:59 -0500 (EST) From: John Baldwin To: Pyun YongHyeon Date: Mon, 14 Dec 2009 14:49:12 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912120006.nBC06iQ9024485@svn.freebsd.org> In-Reply-To: <200912120006.nBC06iQ9024485@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912141449.12347.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Dec 2009 14:49:59 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200422 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:50:01 -0000 On Friday 11 December 2009 7:06:44 pm Pyun YongHyeon wrote: > Author: yongari > Date: Sat Dec 12 00:06:43 2009 > New Revision: 200422 > URL: http://svn.freebsd.org/changeset/base/200422 > > Log: > Remove driver lock assertion in MII register access. This change > was made in r199543 to remove MTX_RECURSE. These routines can be > called in device attach phase(e.g. mii_phy_probe()) so checking > assertion here is not right as caller does not hold a driver lock. Thanks for fixing this. Have you been able to test my other vge(4) changes such as removing the task for TX? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:51:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93DD7106566B; Mon, 14 Dec 2009 19:51:50 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 7748C8FC22; Mon, 14 Dec 2009 19:51:49 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 16so102117fgg.13 for ; Mon, 14 Dec 2009 11:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=ScDIKovZmvnENA/NZ002xGlhjafgxrs3gi9HdgQ0ANA=; b=Ym+STE6Ilta3T1D+oFcV/iFfWfRgr3fOsq3agoS4yserWBpHnRApeugCf2NnGIFSX6 eNowOz/lOf4oaUiH+IJ20sQcPiV9gYSlITcF8B4KTwTw+mziEdnhQcaRX65o/9Vj6UbU bdKEt+//0qR+yEeUDim9J9LLODxA0Y5z20Gyk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=v/lCz8jTL4YimeBzrbmy48A8kL10vzvwwdsvKyxoveF1O8WaBIIWBrJurOuYKLXwUS MxFJxjsEtgNKJtBvIKBGsGPDvYaC9YU0qtW74OdTLOHtV9wGiLKWuegJH9gNBIrLw1Co 15+Ilb+xBmUY1cYdzTpQqLkCJ1TTnikMNlHXE= MIME-Version: 1.0 Received: by 10.216.88.208 with SMTP id a58mr847782wef.115.1260820307726; Mon, 14 Dec 2009 11:51:47 -0800 (PST) In-Reply-To: <200912141431.10603.jhb@freebsd.org> References: <200912141843.nBEIhIsA034642@svn.freebsd.org> <200912141431.10603.jhb@freebsd.org> Date: Mon, 14 Dec 2009 11:51:47 -0800 Message-ID: <2a41acea0912141151p5d596118h6900ea8e2731256f@mail.gmail.com> From: Jack Vogel To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200523 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:51:50 -0000 Well, its a unique lock in the shared code, and I was already naming the other em locks, if there is some big loss in my doing that I don't have any big emotional investment in them being that way :) Jack On Mon, Dec 14, 2009 at 11:31 AM, John Baldwin wrote: > On Monday 14 December 2009 1:43:18 pm Jack F Vogel wrote: > > Author: jfv > > Date: Mon Dec 14 18:43:18 2009 > > New Revision: 200523 > > URL: http://svn.freebsd.org/changeset/base/200523 > > > > Log: > > Remove the MTX_SPIN flag to the shared code MUTEX > > as it was causing a panic, also took the opportunity > > to rename the lock for clarity. > > > > Modified: > > head/sys/dev/e1000/e1000_osdep.h > > > > Modified: head/sys/dev/e1000/e1000_osdep.h > > > > ============================================================================== > > --- head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:27:34 2009 > (r200522) > > +++ head/sys/dev/e1000/e1000_osdep.h Mon Dec 14 18:43:18 2009 > (r200523) > > @@ -82,8 +82,7 @@ > > /* Mutex used in the shared code */ > > #define E1000_MUTEX struct mtx > > #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \ > > - MTX_NETWORK_LOCK, \ > > - MTX_DEF | MTX_SPIN) > > + "E1000 Shared Lock", MTX_DEF) > > #define E1000_MUTEX_DESTROY(mutex) mtx_destroy(mutex) > > #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex) > > #define E1000_MUTEX_TRYLOCK(mutex) mtx_trylock(mutex) > > Hmm, most NIC drivers use MTX_NETWORK_LOCK so that WITNESS will report LORs > that happen if any two NIC drivers locks "cross" (e.g. if one driver leaked > a > lock while passing a packet up the stack that was forwarded to another > interface). Not sure if that is relevant to this particular lock though. > > -- > John Baldwin > From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:53:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69D75106566B; Mon, 14 Dec 2009 19:53:58 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FBC58FC13; Mon, 14 Dec 2009 19:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEJrwUM036461; Mon, 14 Dec 2009 19:53:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEJrwpE036458; Mon, 14 Dec 2009 19:53:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912141953.nBEJrwpE036458@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 19:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200533 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:53:58 -0000 Author: yongari Date: Mon Dec 14 19:53:57 2009 New Revision: 200533 URL: http://svn.freebsd.org/changeset/base/200533 Log: s/u_intXX_t/uintXX_t/g Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 19:49:20 2009 (r200532) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 19:53:57 2009 (r200533) @@ -172,7 +172,7 @@ static int vge_ifmedia_upd (struct ifnet static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, u_int16_t *); +static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); #endif static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); @@ -224,10 +224,10 @@ DRIVER_MODULE(miibus, vge, miibus_driver * Read a word of data stored in the EEPROM at address 'addr.' */ static void -vge_eeprom_getword(struct vge_softc *sc, int addr, u_int16_t *dest) +vge_eeprom_getword(struct vge_softc *sc, int addr, uint16_t *dest) { int i; - u_int16_t word = 0; + uint16_t word = 0; /* * Enter EEPROM embedded programming mode. In order to @@ -274,11 +274,11 @@ vge_read_eeprom(struct vge_softc *sc, ca { int i; #ifdef VGE_EEPROM - u_int16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { vge_eeprom_getword(sc, off + i, &word); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else @@ -349,7 +349,7 @@ vge_miibus_readreg(device_t dev, int phy { struct vge_softc *sc; int i; - u_int16_t rval = 0; + uint16_t rval = 0; sc = device_get_softc(dev); @@ -515,7 +515,7 @@ vge_setmulti(struct vge_softc *sc) struct ifnet *ifp; int error = 0/*, h = 0*/; struct ifmultiaddr *ifma; - u_int32_t h, hashes[2] = { 0, 0 }; + uint32_t h, hashes[2] = { 0, 0 }; VGE_LOCK_ASSERT(sc); @@ -1613,7 +1613,7 @@ vge_poll (struct ifnet *ifp, enum poll_c vge_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ - u_int32_t status; + uint32_t status; status = CSR_READ_4(sc, VGE_ISR); if (status == 0xFFFFFFFF) goto done; @@ -1648,7 +1648,7 @@ vge_intr(void *arg) { struct vge_softc *sc; struct ifnet *ifp; - u_int32_t status; + uint32_t status; sc = arg; Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 19:49:20 2009 (r200532) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 19:53:57 2009 (r200533) @@ -139,7 +139,7 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - u_int8_t vge_type; + uint8_t vge_type; int vge_if_flags; int vge_link; int vge_camidx; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 19:57:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 920111065670; Mon, 14 Dec 2009 19:57:58 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-qy0-f176.google.com (mail-qy0-f176.google.com [209.85.221.176]) by mx1.freebsd.org (Postfix) with ESMTP id E4D118FC1C; Mon, 14 Dec 2009 19:57:57 +0000 (UTC) Received: by qyk6 with SMTP id 6so1666430qyk.3 for ; Mon, 14 Dec 2009 11:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=R7r+6klZqZCjsU5AdOzTlFAGZNpSm1Rj8bVseWLjWUU=; b=VJs8zeTSqWgPDWdefkK1dhShXD8X/+Dq6GQH7ts325zIkPxTGpkVXgjxPYA3iOmJFb 1mUYsB1AO0x3kg3RzPd02mY3IXKokmEZORR+T9jhkC68M5+oLUCSkXnJKZ1xYrRRShZz QZnMftkdP8IZmHPOtfptGjUhPwlPpHGvF+kAA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ZJ+9/ayiT3xW6x94SbUMj/Iud6++3JmUlod96PRV82MetFkT8Kc2OsMEX/dp8jKrd2 JB0C1/DY/5907kO8DhXuKr2yH2KsKl2LoO38N365eWTrtZT+FtTrZZ3YOhzu6DbOEJ/d IexeycG9E8H2e0LhASuhNDb1eB7pvLaSvMS/o= Received: by 10.224.35.101 with SMTP id o37mr3291181qad.25.1260820677010; Mon, 14 Dec 2009 11:57:57 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 7sm12763957qwb.32.2009.12.14.11.57.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 14 Dec 2009 11:57:56 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 14 Dec 2009 11:57:42 -0800 From: Pyun YongHyeon Date: Mon, 14 Dec 2009 11:57:42 -0800 To: John Baldwin Message-ID: <20091214195742.GA1122@michelle.cdnetworks.com> References: <200912120006.nBC06iQ9024485@svn.freebsd.org> <200912141449.12347.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912141449.12347.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r200422 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 19:57:58 -0000 On Mon, Dec 14, 2009 at 02:49:12PM -0500, John Baldwin wrote: > On Friday 11 December 2009 7:06:44 pm Pyun YongHyeon wrote: > > Author: yongari > > Date: Sat Dec 12 00:06:43 2009 > > New Revision: 200422 > > URL: http://svn.freebsd.org/changeset/base/200422 > > > > Log: > > Remove driver lock assertion in MII register access. This change > > was made in r199543 to remove MTX_RECURSE. These routines can be > > called in device attach phase(e.g. mii_phy_probe()) so checking > > assertion here is not right as caller does not hold a driver lock. > > Thanks for fixing this. Have you been able to test my other vge(4) changes > such as removing the task for TX? > Yes, it works as expected. From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:04:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D7DC106568B; Mon, 14 Dec 2009 20:04:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0BF8FC12; Mon, 14 Dec 2009 20:04:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEK468u036728; Mon, 14 Dec 2009 20:04:06 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEK462J036724; Mon, 14 Dec 2009 20:04:06 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142004.nBEK462J036724@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 20:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200534 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:04:06 -0000 Author: rpaulo Date: Mon Dec 14 20:04:06 2009 New Revision: 200534 URL: http://svn.freebsd.org/changeset/base/200534 Log: Simplify partition type parsing by using a data-oriented model. While there add more Apple and Linux partition types. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon Dec 14 19:53:57 2009 (r200533) +++ head/sys/geom/part/g_part.c Mon Dec 14 20:04:06 2009 (r200534) @@ -69,7 +69,13 @@ struct g_part_alias_list { const char *lexeme; enum g_part_alias alias; } g_part_alias_list[G_PART_ALIAS_COUNT] = { + { "apple-boot", G_PART_ALIAS_APPLE_BOOT }, { "apple-hfs", G_PART_ALIAS_APPLE_HFS }, + { "apple-label", G_PART_ALIAS_APPLE_LABEL }, + { "apple-raid", G_PART_ALIAS_APPLE_RAID }, + { "apple-raid-offline", G_PART_ALIAS_APPLE_RAID_OFFLINE }, + { "apple-tv-recovery", G_PART_ALIAS_APPLE_TV_RECOVERY }, + { "apple-ufs", G_PART_ALIAS_APPLE_UFS }, { "efi", G_PART_ALIAS_EFI }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, @@ -77,6 +83,10 @@ struct g_part_alias_list { { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, { "freebsd-zfs", G_PART_ALIAS_FREEBSD_ZFS }, + { "linux-data", G_PART_ALIAS_LINUX_DATA }, + { "linux-lvm", G_PART_ALIAS_LINUX_LVM }, + { "linux-raid", G_PART_ALIAS_LINUX_RAID }, + { "linux-swap", G_PART_ALIAS_LINUX_SWAP }, { "mbr", G_PART_ALIAS_MBR } }; Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Mon Dec 14 19:53:57 2009 (r200533) +++ head/sys/geom/part/g_part.h Mon Dec 14 20:04:06 2009 (r200534) @@ -36,7 +36,13 @@ #define G_PART_PROBE_PRI_HIGH 0 enum g_part_alias { - G_PART_ALIAS_APPLE_HFS, /* An HFS file system entry. */ + G_PART_ALIAS_APPLE_BOOT, /* An Apple boot partition entry. */ + G_PART_ALIAS_APPLE_HFS, /* An HFS+ file system entry. */ + G_PART_ALIAS_APPLE_LABEL, /* An Apple label partition entry. */ + G_PART_ALIAS_APPLE_RAID, /* An Apple RAID partition entry. */ + G_PART_ALIAS_APPLE_RAID_OFFLINE,/* An Apple RAID (offline) part entry.*/ + G_PART_ALIAS_APPLE_TV_RECOVERY, /* An Apple TV recovery part entry. */ + G_PART_ALIAS_APPLE_UFS, /* An Apple UFS partition entry. */ G_PART_ALIAS_EFI, /* A EFI system partition entry. */ G_PART_ALIAS_FREEBSD, /* A BSD labeled partition entry. */ G_PART_ALIAS_FREEBSD_BOOT, /* A FreeBSD boot partition entry. */ @@ -45,6 +51,10 @@ enum g_part_alias { G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ G_PART_ALIAS_FREEBSD_ZFS, /* A ZFS file system entry. */ G_PART_ALIAS_MBR, /* A MBR (extended) partition entry. */ + G_PART_ALIAS_LINUX_DATA, /* A Linux data partition entry. */ + G_PART_ALIAS_LINUX_LVM, /* A Linux LVM partition entry. */ + G_PART_ALIAS_LINUX_RAID, /* A Linux RAID partition entry. */ + G_PART_ALIAS_LINUX_SWAP, /* A Linux swap partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Mon Dec 14 19:53:57 2009 (r200533) +++ head/sys/geom/part/g_part_gpt.c Mon Dec 14 20:04:06 2009 (r200534) @@ -131,7 +131,13 @@ static struct g_part_scheme g_part_gpt_s }; G_PART_SCHEME_DECLARE(g_part_gpt); +static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; static struct uuid gpt_uuid_apple_hfs = GPT_ENT_TYPE_APPLE_HFS; +static struct uuid gpt_uuid_apple_label = GPT_ENT_TYPE_APPLE_LABEL; +static struct uuid gpt_uuid_apple_raid = GPT_ENT_TYPE_APPLE_RAID; +static struct uuid gpt_uuid_apple_raid_offline = GPT_ENT_TYPE_APPLE_RAID_OFFLINE; +static struct uuid gpt_uuid_apple_tv_recovery = GPT_ENT_TYPE_APPLE_TV_RECOVERY; +static struct uuid gpt_uuid_apple_ufs = GPT_ENT_TYPE_APPLE_UFS; static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; @@ -139,10 +145,39 @@ static struct uuid gpt_uuid_freebsd_swap static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; static struct uuid gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; +static struct uuid gpt_uuid_linux_data = GPT_ENT_TYPE_LINUX_DATA; +static struct uuid gpt_uuid_linux_lvm = GPT_ENT_TYPE_LINUX_LVM; +static struct uuid gpt_uuid_linux_raid = GPT_ENT_TYPE_LINUX_RAID; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; +static struct g_part_uuid_alias { + struct uuid *uuid; + int alias; +} gpt_uuid_alias_match[] = { + { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT }, + { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS }, + { &gpt_uuid_apple_label, G_PART_ALIAS_APPLE_LABEL }, + { &gpt_uuid_apple_raid, G_PART_ALIAS_APPLE_RAID }, + { &gpt_uuid_apple_raid_offline, G_PART_ALIAS_APPLE_RAID_OFFLINE }, + { &gpt_uuid_apple_tv_recovery, G_PART_ALIAS_APPLE_TV_RECOVERY }, + { &gpt_uuid_apple_ufs, G_PART_ALIAS_APPLE_UFS }, + { &gpt_uuid_efi, G_PART_ALIAS_EFI }, + { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD }, + { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT }, + { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP }, + { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS }, + { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM }, + { &gpt_uuid_freebsd_zfs, G_PART_ALIAS_FREEBSD_ZFS }, + { &gpt_uuid_linux_data, G_PART_ALIAS_LINUX_DATA }, + { &gpt_uuid_linux_lvm, G_PART_ALIAS_LINUX_LVM }, + { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID }, + { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP }, + { &gpt_uuid_mbr, G_PART_ALIAS_MBR }, + { NULL, 0 } +}; + static struct gpt_hdr * gpt_read_hdr(struct g_part_gpt_table *table, struct g_consumer *cp, enum gpt_elt elt) @@ -305,6 +340,7 @@ gpt_parse_type(const char *type, struct struct uuid tmp; const char *alias; int error; + struct g_part_uuid_alias *uap; if (type[0] == '!') { error = parse_uuid(type + 1, &tmp); @@ -315,50 +351,12 @@ gpt_parse_type(const char *type, struct *uuid = tmp; return (0); } - alias = g_part_alias_name(G_PART_ALIAS_EFI); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_efi; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_boot; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_swap; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_ufs; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_vinum; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_freebsd_zfs; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_MBR); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_mbr; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_APPLE_HFS); - if (!strcasecmp(type, alias)) { - *uuid = gpt_uuid_apple_hfs; - return (0); + for (uap = &gpt_uuid_alias_match[0]; uap->uuid; uap++) { + alias = g_part_alias_name(uap->alias); + if (!strcasecmp(type, alias)) { + uuid = uap->uuid; + return (0); + } } return (EINVAL); } @@ -717,29 +715,16 @@ g_part_gpt_type(struct g_part_table *bas { struct g_part_gpt_entry *entry; struct uuid *type; + struct g_part_uuid_alias *uap; entry = (struct g_part_gpt_entry *)baseentry; type = &entry->ent.ent_type; - if (EQUUID(type, &gpt_uuid_efi)) - return (g_part_alias_name(G_PART_ALIAS_EFI)); - if (EQUUID(type, &gpt_uuid_freebsd)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); - if (EQUUID(type, &gpt_uuid_freebsd_boot)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT)); - if (EQUUID(type, &gpt_uuid_freebsd_swap)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); - if (EQUUID(type, &gpt_uuid_freebsd_ufs)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS)); - if (EQUUID(type, &gpt_uuid_freebsd_vinum)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM)); - if (EQUUID(type, &gpt_uuid_freebsd_zfs)) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS)); - if (EQUUID(type, &gpt_uuid_mbr)) - return (g_part_alias_name(G_PART_ALIAS_MBR)); - if (EQUUID(type, &gpt_uuid_apple_hfs)) - return (g_part_alias_name(G_PART_ALIAS_APPLE_HFS)); + for (uap = &gpt_uuid_alias_match[0]; uap->uuid; uap++) + if (EQUUID(type, uap->uuid)) + return (g_part_alias_name(uap->alias)); buf[0] = '!'; snprintf_uuid(buf + 1, bufsz - 1, type); + return (buf); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:04:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9321E10656C0; Mon, 14 Dec 2009 20:04:28 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F358FC0C; Mon, 14 Dec 2009 20:04:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEK4SB7036771; Mon, 14 Dec 2009 20:04:28 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEK4Slb036769; Mon, 14 Dec 2009 20:04:28 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142004.nBEK4Slb036769@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 20:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200535 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:04:28 -0000 Author: rpaulo Date: Mon Dec 14 20:04:28 2009 New Revision: 200535 URL: http://svn.freebsd.org/changeset/base/200535 Log: Add more Apple partition types. Modified: head/sys/sys/gpt.h Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Mon Dec 14 20:04:06 2009 (r200534) +++ head/sys/sys/gpt.h Mon Dec 14 20:04:28 2009 (r200535) @@ -117,6 +117,8 @@ struct gpt_ent { #define GPT_ENT_TYPE_LINUX_LVM \ {0xe6d6d379,0xf507,0x44c2,0xa2,0x3c,{0x23,0x8f,0x2a,0x3d,0xf9,0x28}} +#define GPT_ENT_TYPE_APPLE_BOOT \ + {0x426F6F74,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_HFS \ {0x48465300,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_UFS \ @@ -127,6 +129,10 @@ struct gpt_ent { {0x52414944,0x0000,0x11aa,0xaa,0x22,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_RAID_OFFLINE \ {0x52414944,0x5f4f,0x11aa,0xaa,0x22,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_LABEL \ + {0x4C616265,0x6c00,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_TV_RECOVERY \ + {0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_NETBSD_FFS \ {0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:07:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170181065672; Mon, 14 Dec 2009 20:07:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05CA88FC17; Mon, 14 Dec 2009 20:07:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEK7P4E036869; Mon, 14 Dec 2009 20:07:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEK7PdT036868; Mon, 14 Dec 2009 20:07:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142007.nBEK7PdT036868@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200536 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:07:26 -0000 Author: yongari Date: Mon Dec 14 20:07:25 2009 New Revision: 200536 URL: http://svn.freebsd.org/changeset/base/200536 Log: style(9). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:04:28 2009 (r200535) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:07:25 2009 (r200536) @@ -226,8 +226,8 @@ DRIVER_MODULE(miibus, vge, miibus_driver static void vge_eeprom_getword(struct vge_softc *sc, int addr, uint16_t *dest) { - int i; - uint16_t word = 0; + int i; + uint16_t word = 0; /* * Enter EEPROM embedded programming mode. In order to @@ -272,9 +272,9 @@ vge_eeprom_getword(struct vge_softc *sc, static void vge_read_eeprom(struct vge_softc *sc, caddr_t dest, int off, int cnt, int swap) { - int i; + int i; #ifdef VGE_EEPROM - uint16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { vge_eeprom_getword(sc, off + i, &word); @@ -293,7 +293,7 @@ vge_read_eeprom(struct vge_softc *sc, ca static void vge_miipoll_stop(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_MIICMD, 0); @@ -310,7 +310,7 @@ vge_miipoll_stop(struct vge_softc *sc) static void vge_miipoll_start(struct vge_softc *sc) { - int i; + int i; /* First, make sure we're idle. */ @@ -347,14 +347,14 @@ vge_miipoll_start(struct vge_softc *sc) static int vge_miibus_readreg(device_t dev, int phy, int reg) { - struct vge_softc *sc; - int i; - uint16_t rval = 0; + struct vge_softc *sc; + int i; + uint16_t rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -384,13 +384,13 @@ vge_miibus_readreg(device_t dev, int phy static int vge_miibus_writereg(device_t dev, int phy, int reg, int data) { - struct vge_softc *sc; - int i, rval = 0; + struct vge_softc *sc; + int i, rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -423,7 +423,7 @@ vge_miibus_writereg(device_t dev, int ph static void vge_cam_clear(struct vge_softc *sc) { - int i; + int i; /* * Turn off all the mask bits. This tells the chip @@ -453,10 +453,10 @@ vge_cam_clear(struct vge_softc *sc) static int vge_cam_set(struct vge_softc *sc, uint8_t *addr) { - int i, error = 0; + int i, error = 0; if (sc->vge_camidx == VGE_CAM_MAXADDRS) - return(ENOSPC); + return (ENOSPC); /* Select the CAM data page. */ CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); @@ -512,10 +512,10 @@ fail: static void vge_setmulti(struct vge_softc *sc) { - struct ifnet *ifp; - int error = 0/*, h = 0*/; - struct ifmultiaddr *ifma; - uint32_t h, hashes[2] = { 0, 0 }; + struct ifnet *ifp; + int error = 0/*, h = 0*/; + struct ifmultiaddr *ifma; + uint32_t h, hashes[2] = { 0, 0 }; VGE_LOCK_ASSERT(sc); @@ -571,7 +571,7 @@ vge_setmulti(struct vge_softc *sc) static void vge_reset(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -612,7 +612,7 @@ vge_reset(struct vge_softc *sc) static int vge_probe(device_t dev) { - struct vge_type *t; + struct vge_type *t; t = vge_devs; @@ -639,7 +639,7 @@ struct vge_dmamap_arg { static void vge_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { - struct vge_dmamap_arg *ctx; + struct vge_dmamap_arg *ctx; if (error != 0) return; @@ -653,11 +653,11 @@ vge_dmamap_cb(void *arg, bus_dma_segment static int vge_dma_alloc(struct vge_softc *sc) { - struct vge_dmamap_arg ctx; - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - bus_addr_t lowaddr, tx_ring_end, rx_ring_end; - int error, i; + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; lowaddr = BUS_SPACE_MAXADDR; @@ -868,9 +868,9 @@ fail: static void vge_dma_free(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; /* Tx ring. */ if (sc->vge_cdata.vge_tx_ring_tag != NULL) { @@ -951,10 +951,10 @@ vge_dma_free(struct vge_softc *sc) static int vge_attach(device_t dev) { - u_char eaddr[ETHER_ADDR_LEN]; - struct vge_softc *sc; - struct ifnet *ifp; - int error = 0, rid; + u_char eaddr[ETHER_ADDR_LEN]; + struct vge_softc *sc; + struct ifnet *ifp; + int error = 0, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -1066,8 +1066,8 @@ fail: static int vge_detach(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1109,8 +1109,8 @@ vge_detach(device_t dev) static void vge_discard_rxbuf(struct vge_softc *sc, int prod) { - struct vge_rxdesc *rxd; - int i; + struct vge_rxdesc *rxd; + int i; rxd = &sc->vge_cdata.vge_rxdesc[prod]; rxd->rx_desc->vge_sts = 0; @@ -1136,11 +1136,11 @@ vge_discard_rxbuf(struct vge_softc *sc, static int vge_newbuf(struct vge_softc *sc, int prod) { - struct vge_rxdesc *rxd; - struct mbuf *m; - bus_dma_segment_t segs[1]; - bus_dmamap_t map; - int i, nsegs; + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) @@ -1206,9 +1206,9 @@ vge_newbuf(struct vge_softc *sc, int pro static int vge_tx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_txdesc *txd; - int i; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; VGE_LOCK_ASSERT(sc); @@ -1234,9 +1234,9 @@ vge_tx_list_init(struct vge_softc *sc) static int vge_rx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_rxdesc *rxd; - int i; + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; + int i; VGE_LOCK_ASSERT(sc); @@ -1272,10 +1272,10 @@ vge_rx_list_init(struct vge_softc *sc) static void vge_freebufs(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - struct ifnet *ifp; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; VGE_LOCK_ASSERT(sc); @@ -1313,8 +1313,8 @@ vge_freebufs(struct vge_softc *sc) static __inline void vge_fixup_rx(struct mbuf *m) { - int i; - uint16_t *src, *dst; + int i; + uint16_t *src, *dst; src = mtod(m, uint16_t *); dst = src - 1; @@ -1333,12 +1333,12 @@ vge_fixup_rx(struct mbuf *m) static int vge_rxeof(struct vge_softc *sc, int count) { - struct mbuf *m; - struct ifnet *ifp; - int prod, prog, total_len; - struct vge_rxdesc *rxd; - struct vge_rx_desc *cur_rx; - uint32_t rxstat, rxctl; + struct mbuf *m; + struct ifnet *ifp; + int prod, prog, total_len; + struct vge_rxdesc *rxd; + struct vge_rx_desc *cur_rx; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); @@ -1505,11 +1505,11 @@ vge_rxeof(struct vge_softc *sc, int coun static void vge_txeof(struct vge_softc *sc) { - struct ifnet *ifp; - struct vge_tx_desc *cur_tx; - struct vge_txdesc *txd; - uint32_t txstat; - int cons, prod; + struct ifnet *ifp; + struct vge_tx_desc *cur_tx; + struct vge_txdesc *txd; + uint32_t txstat; + int cons, prod; VGE_LOCK_ASSERT(sc); @@ -1567,9 +1567,9 @@ vge_txeof(struct vge_softc *sc) static void vge_tick(void *xsc) { - struct vge_softc *sc; - struct ifnet *ifp; - struct mii_data *mii; + struct vge_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; sc = xsc; ifp = sc->vge_ifp; @@ -1646,9 +1646,9 @@ done: static void vge_intr(void *arg) { - struct vge_softc *sc; - struct ifnet *ifp; - uint32_t status; + struct vge_softc *sc; + struct ifnet *ifp; + uint32_t status; sc = arg; @@ -1720,12 +1720,12 @@ vge_intr(void *arg) static int vge_encap(struct vge_softc *sc, struct mbuf **m_head) { - struct vge_txdesc *txd; - struct vge_tx_frag *frag; - struct mbuf *m; - bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; - int error, i, nsegs, padlen; - uint32_t cflags; + struct vge_txdesc *txd; + struct vge_tx_frag *frag; + struct mbuf *m; + bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; + int error, i, nsegs, padlen; + uint32_t cflags; VGE_LOCK_ASSERT(sc); @@ -1847,7 +1847,7 @@ vge_encap(struct vge_softc *sc, struct m static void vge_start(struct ifnet *ifp) { - struct vge_softc *sc; + struct vge_softc *sc; sc = ifp->if_softc; VGE_LOCK(sc); @@ -1859,10 +1859,10 @@ vge_start(struct ifnet *ifp) static void vge_start_locked(struct ifnet *ifp) { - struct vge_softc *sc; - struct vge_txdesc *txd; - struct mbuf *m_head; - int enq, idx; + struct vge_softc *sc; + struct vge_txdesc *txd; + struct mbuf *m_head; + int enq, idx; sc = ifp->if_softc; @@ -1932,7 +1932,7 @@ vge_start_locked(struct ifnet *ifp) static void vge_init(void *xsc) { - struct vge_softc *sc = xsc; + struct vge_softc *sc = xsc; VGE_LOCK(sc); vge_init_locked(sc); @@ -1942,9 +1942,9 @@ vge_init(void *xsc) static void vge_init_locked(struct vge_softc *sc) { - struct ifnet *ifp = sc->vge_ifp; - struct mii_data *mii; - int error, i; + struct ifnet *ifp = sc->vge_ifp; + struct mii_data *mii; + int error, i; VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); @@ -2122,8 +2122,8 @@ vge_init_locked(struct vge_softc *sc) static int vge_ifmedia_upd(struct ifnet *ifp) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; VGE_LOCK(sc); @@ -2140,8 +2140,8 @@ vge_ifmedia_upd(struct ifnet *ifp) static void vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; mii = device_get_softc(sc->vge_miibus); @@ -2156,9 +2156,9 @@ vge_ifmedia_sts(struct ifnet *ifp, struc static void vge_miibus_statchg(device_t dev) { - struct vge_softc *sc; - struct mii_data *mii; - struct ifmedia_entry *ife; + struct vge_softc *sc; + struct mii_data *mii; + struct ifmedia_entry *ife; sc = device_get_softc(dev); mii = device_get_softc(sc->vge_miibus); @@ -2203,10 +2203,10 @@ vge_miibus_statchg(device_t dev) static int vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { - struct vge_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *) data; - struct mii_data *mii; - int error = 0; + struct vge_softc *sc = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *) data; + struct mii_data *mii; + int error = 0; switch (command) { case SIOCSIFMTU: @@ -2258,7 +2258,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm if (ifr->ifr_reqcap & IFCAP_POLLING) { error = ether_poll_register(vge_poll, ifp); if (error) - return(error); + return (error); VGE_LOCK(sc); /* Disable interrupts */ CSR_WRITE_4(sc, VGE_IMR, 0); @@ -2330,7 +2330,7 @@ vge_watchdog(void *arg) static void vge_stop(struct vge_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp; VGE_LOCK_ASSERT(sc); ifp = sc->vge_ifp; @@ -2359,7 +2359,7 @@ vge_stop(struct vge_softc *sc) static int vge_suspend(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); @@ -2380,8 +2380,8 @@ vge_suspend(device_t dev) static int vge_resume(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); ifp = sc->vge_ifp; @@ -2409,7 +2409,7 @@ vge_resume(device_t dev) static int vge_shutdown(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:12:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 000D91065676; Mon, 14 Dec 2009 20:12:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D92A88FC0A; Mon, 14 Dec 2009 20:12:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKCpgC037013; Mon, 14 Dec 2009 20:12:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKCpdn037009; Mon, 14 Dec 2009 20:12:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912142012.nBEKCpdn037009@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 14 Dec 2009 20:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200537 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:12:52 -0000 Author: luigi Date: Mon Dec 14 20:12:51 2009 New Revision: 200537 URL: http://svn.freebsd.org/changeset/base/200537 Log: Move the scan for max_keylen into route.c::route_init(), and make max_keylen an argument for rn_init(). This removes an unnecessary dependency on domain.h from radix.c MFC after: 7 days Modified: head/sys/net/radix.c head/sys/net/radix.h head/sys/net/route.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Mon Dec 14 20:07:25 2009 (r200536) +++ head/sys/net/radix.c Mon Dec 14 20:12:51 2009 (r200537) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include "opt_mpath.h" @@ -1163,16 +1162,11 @@ rn_inithead(head, off) } void -rn_init() +rn_init(int maxk) { char *cp, *cplim; -#ifdef _KERNEL - struct domain *dom; - for (dom = domains; dom; dom = dom->dom_next) - if (dom->dom_maxrtkey > max_keylen) - max_keylen = dom->dom_maxrtkey; -#endif + max_keylen = maxk; if (max_keylen == 0) { log(LOG_ERR, "rn_init: radix functions require max_keylen be set\n"); @@ -1189,19 +1183,3 @@ rn_init() if (rn_inithead((void **)(void *)&mask_rnhead, 0) == 0) panic("rn_init 2"); } - -#ifndef _KERNEL -/* - * A simple function to make the code usable from userland. - * A proper fix (maybe later) would be to change rn_init() so that it - * takes maxkeylen as an argument, and move the scan of - * domains into net/route.c::route_init(). - */ -void rn_init2(int maxk); -void -rn_init2(int maxk) -{ - max_keylen = maxk; - rn_init(); -} -#endif /* !_KERNEL */ Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Mon Dec 14 20:07:25 2009 (r200536) +++ head/sys/net/radix.h Mon Dec 14 20:12:51 2009 (r200537) @@ -160,7 +160,7 @@ struct radix_node_head { #define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) #endif /* _KERNEL */ -void rn_init(void); +void rn_init(int); int rn_inithead(void **, int); int rn_refines(void *, void *); struct radix_node Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Dec 14 20:07:25 2009 (r200536) +++ head/sys/net/route.c Mon Dec 14 20:12:51 2009 (r200537) @@ -171,13 +171,20 @@ rt_tables_get_rnh(int table, int fam) static void route_init(void) { + struct domain *dom; + int max_keylen = 0; /* whack the tunable ints into line. */ if (rt_numfibs > RT_MAXFIBS) rt_numfibs = RT_MAXFIBS; if (rt_numfibs == 0) rt_numfibs = 1; - rn_init(); /* initialize all zeroes, all ones, mask table */ + + for (dom = domains; dom; dom = dom->dom_next) + if (dom->dom_maxrtkey > max_keylen) + max_keylen = dom->dom_maxrtkey; + + rn_init(max_keylen); /* init all zeroes, all ones, mask table */ } SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:17:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3B201065692; Mon, 14 Dec 2009 20:17:53 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9A318FC1D; Mon, 14 Dec 2009 20:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKHrjb037147; Mon, 14 Dec 2009 20:17:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKHrRE037144; Mon, 14 Dec 2009 20:17:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142017.nBEKHrRE037144@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200538 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:17:53 -0000 Author: yongari Date: Mon Dec 14 20:17:53 2009 New Revision: 200538 URL: http://svn.freebsd.org/changeset/base/200538 Log: Introduce vge_flags member in softc. The vge_flags member will record device specific bits. Remove vge_link and use vge_flags. While here, move clearing link state before mii_mediachg() as mii_mediachg() may affect link state. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:12:51 2009 (r200537) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:17:53 2009 (r200538) @@ -1577,16 +1577,16 @@ vge_tick(void *xsc) mii = device_get_softc(sc->vge_miibus); mii_tick(mii); - if (sc->vge_link) { + if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { - sc->vge_link = 0; + sc->vge_flags &= ~VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_DOWN); } } else { if (mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->vge_link = 1; + sc->vge_flags |= VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1868,7 +1868,7 @@ vge_start_locked(struct ifnet *ifp) VGE_LOCK_ASSERT(sc); - if (sc->vge_link == 0 || + if ((sc->vge_flags & VGE_FLAG_LINK) == 0 || (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; @@ -2107,13 +2107,12 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } + sc->vge_flags &= ~VGE_FLAG_LINK; mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); - - sc->vge_link = 0; } /* Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:12:51 2009 (r200537) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:17:53 2009 (r200538) @@ -141,7 +141,8 @@ struct vge_softc { device_t vge_miibus; uint8_t vge_type; int vge_if_flags; - int vge_link; + int vge_flags; +#define VGE_FLAG_LINK 0x8000 int vge_camidx; struct mtx vge_mtx; struct callout vge_watchdog; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:26:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4B06106566C; Mon, 14 Dec 2009 20:26:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B878FC0C; Mon, 14 Dec 2009 20:26:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKQRse037373; Mon, 14 Dec 2009 20:26:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKQRD9037369; Mon, 14 Dec 2009 20:26:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142026.nBEKQRD9037369@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 20:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200539 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:26:27 -0000 Author: rpaulo Date: Mon Dec 14 20:26:27 2009 New Revision: 200539 URL: http://svn.freebsd.org/changeset/base/200539 Log: Add Microsoft and NetBSD partition types handling. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Mon Dec 14 20:17:53 2009 (r200538) +++ head/sys/geom/part/g_part.c Mon Dec 14 20:26:27 2009 (r200539) @@ -87,6 +87,16 @@ struct g_part_alias_list { { "linux-lvm", G_PART_ALIAS_LINUX_LVM }, { "linux-raid", G_PART_ALIAS_LINUX_RAID }, { "linux-swap", G_PART_ALIAS_LINUX_SWAP }, + { "ms-basic-data", G_PART_ALIAS_MS_BASIC_DATA }, + { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA }, + { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA }, + { "ms-reserved", G_PART_ALIAS_MS_RESERVED }, + { "netbsd-ccd", G_PART_ALIAS_NETBSD_CCD }, + { "netbsd-cgd", G_PART_ALIAS_NETBSD_CGD }, + { "netbsd-ffs", G_PART_ALIAS_NETBSD_FFS }, + { "netbsd-lfs", G_PART_ALIAS_NETBSD_LFS }, + { "netbsd-raid", G_PART_ALIAS_NETBSD_RAID }, + { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP }, { "mbr", G_PART_ALIAS_MBR } }; Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Mon Dec 14 20:17:53 2009 (r200538) +++ head/sys/geom/part/g_part.h Mon Dec 14 20:26:27 2009 (r200539) @@ -55,6 +55,16 @@ enum g_part_alias { G_PART_ALIAS_LINUX_LVM, /* A Linux LVM partition entry. */ G_PART_ALIAS_LINUX_RAID, /* A Linux RAID partition entry. */ G_PART_ALIAS_LINUX_SWAP, /* A Linux swap partition entry. */ + G_PART_ALIAS_MS_BASIC_DATA, /* A Microsoft Data part. entry. */ + G_PART_ALIAS_MS_LDM_DATA, /* A Microsoft LDM Data part. entry. */ + G_PART_ALIAS_MS_LDM_METADATA, /* A Microsoft LDM Metadata entry. */ + G_PART_ALIAS_MS_RESERVED, /* A Microsoft Reserved part. entry. */ + G_PART_ALIAS_NETBSD_CCD, /* A NetBSD CCD partition entry. */ + G_PART_ALIAS_NETBSD_CGD, /* A NetBSD CGD partition entry. */ + G_PART_ALIAS_NETBSD_FFS, /* A NetBSD FFS partition entry. */ + G_PART_ALIAS_NETBSD_RAID, /* A NetBSD RAID partition entry. */ + G_PART_ALIAS_NETBSD_SWAP, /* A NetBSD swap partition entry. */ + G_PART_ALIAS_NETBSD_LFS, /* A NetBSD LFS partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Mon Dec 14 20:17:53 2009 (r200538) +++ head/sys/geom/part/g_part_gpt.c Mon Dec 14 20:26:27 2009 (r200539) @@ -149,6 +149,16 @@ static struct uuid gpt_uuid_linux_data = static struct uuid gpt_uuid_linux_lvm = GPT_ENT_TYPE_LINUX_LVM; static struct uuid gpt_uuid_linux_raid = GPT_ENT_TYPE_LINUX_RAID; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; +static struct uuid gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static struct uuid gpt_uuid_ms_reserved = GPT_ENT_TYPE_MS_RESERVED; +static struct uuid gpt_uuid_ms_ldm_data = GPT_ENT_TYPE_MS_LDM_DATA; +static struct uuid gpt_uuid_ms_ldm_metadata = GPT_ENT_TYPE_MS_LDM_METADATA; +static struct uuid gpt_uuid_netbsd_ccd = GPT_ENT_TYPE_NETBSD_CCD; +static struct uuid gpt_uuid_netbsd_cgd = GPT_ENT_TYPE_NETBSD_CGD; +static struct uuid gpt_uuid_netbsd_ffs = GPT_ENT_TYPE_NETBSD_FFS; +static struct uuid gpt_uuid_netbsd_lfs = GPT_ENT_TYPE_NETBSD_LFS; +static struct uuid gpt_uuid_netbsd_raid = GPT_ENT_TYPE_NETBSD_RAID; +static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; @@ -175,6 +185,17 @@ static struct g_part_uuid_alias { { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID }, { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP }, { &gpt_uuid_mbr, G_PART_ALIAS_MBR }, + { &gpt_uuid_ms_basic_data, G_PART_ALIAS_MS_BASIC_DATA }, + { &gpt_uuid_ms_ldm_data, G_PART_ALIAS_MS_LDM_DATA }, + { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA }, + { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED }, + { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD }, + { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD }, + { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS }, + { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS }, + { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID }, + { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP }, + { NULL, 0 } }; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:39:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6D551065670; Mon, 14 Dec 2009 20:39:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CC3C8FC12; Mon, 14 Dec 2009 20:39:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKdg3x037675; Mon, 14 Dec 2009 20:39:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKdgvT037672; Mon, 14 Dec 2009 20:39:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142039.nBEKdgvT037672@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200540 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:39:42 -0000 Author: yongari Date: Mon Dec 14 20:39:42 2009 New Revision: 200540 URL: http://svn.freebsd.org/changeset/base/200540 Log: Save PHY address by reading VGE_MIICFG register. For PCIe controllers(VT613x), we assume the PHY address is 1. Use the saved PHY address in MII register access routines and remove accessing VGE_MIICFG register. While I'm here save PCI express capability register which will be used in near future. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:26:27 2009 (r200539) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:39:42 2009 (r200540) @@ -353,7 +353,7 @@ vge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -389,7 +389,7 @@ vge_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -954,7 +954,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, rid; + int error = 0, cap, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -978,6 +978,11 @@ vge_attach(device_t dev) goto fail; } + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PCIE; + sc->vge_expcap = cap; + } + /* Allocate interrupt */ rid = 0; sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -996,7 +1001,17 @@ vge_attach(device_t dev) * Get station address from the EEPROM. */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - + /* + * Save configured PHY address. + * It seems the PHY address of PCIe controllers just + * reflects media jump strapping status so we assume the + * internal PHY address of PCIe controller is at 1. + */ + if ((sc->vge_flags & VGE_FLAG_PCIE) != 0) + sc->vge_phyaddr = 1; + else + sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & + VGE_MIICFG_PHYADDR; error = vge_dma_alloc(sc); if (error) goto fail; Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:26:27 2009 (r200539) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:39:42 2009 (r200540) @@ -141,8 +141,11 @@ struct vge_softc { device_t vge_miibus; uint8_t vge_type; int vge_if_flags; + int vge_phyaddr; int vge_flags; +#define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_LINK 0x8000 + int vge_expcap; int vge_camidx; struct mtx vge_mtx; struct callout vge_watchdog; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:49:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF776106568F; Mon, 14 Dec 2009 20:49:50 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C55E78FC0A; Mon, 14 Dec 2009 20:49:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKnodl037899; Mon, 14 Dec 2009 20:49:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKnoAo037896; Mon, 14 Dec 2009 20:49:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142049.nBEKnoAo037896@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200541 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:49:51 -0000 Author: yongari Date: Mon Dec 14 20:49:50 2009 New Revision: 200541 URL: http://svn.freebsd.org/changeset/base/200541 Log: Add MSI support for VT613x controllers. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:39:42 2009 (r200540) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:49:50 2009 (r200541) @@ -127,6 +127,10 @@ MODULE_DEPEND(vge, miibus, 1, 1, 1); #define VGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) +/* Tunables */ +static int msi_disable = 0; +TUNABLE_INT("hw.vge.msi_disable", &msi_disable); + /* * Various supported device vendors/types and their names. */ @@ -954,7 +958,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, cap, rid; + int error = 0, cap, msic, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -982,12 +986,24 @@ vge_attach(device_t dev) sc->vge_flags |= VGE_FLAG_PCIE; sc->vge_expcap = cap; } + rid = 0; + msic = pci_msi_count(dev); + if (msi_disable == 0 && msic > 0) { + msic = 1; + if (pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { + sc->vge_flags |= VGE_FLAG_MSI; + device_printf(dev, "Using %d MSI message\n", + msic); + rid = 1; + } else + pci_release_msi(dev); + } + } /* Allocate interrupt */ - rid = 0; sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - + ((sc->vge_flags & VGE_FLAG_MSI) ? 0 : RF_SHAREABLE) | RF_ACTIVE); if (sc->vge_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; @@ -1108,7 +1124,10 @@ vge_detach(device_t dev) if (sc->vge_intrhand) bus_teardown_intr(dev, sc->vge_irq, sc->vge_intrhand); if (sc->vge_irq) - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); + bus_release_resource(dev, SYS_RES_IRQ, + sc->vge_flags & VGE_FLAG_MSI ? 1 : 0, sc->vge_irq); + if (sc->vge_flags & VGE_FLAG_MSI) + pci_release_msi(dev); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(1), sc->vge_res); Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:39:42 2009 (r200540) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:49:50 2009 (r200541) @@ -144,6 +144,7 @@ struct vge_softc { int vge_phyaddr; int vge_flags; #define VGE_FLAG_PCIE 0x0001 +#define VGE_FLAG_MSI 0x0002 #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:59:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034E81065676; Mon, 14 Dec 2009 20:59:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E57BF8FC08; Mon, 14 Dec 2009 20:59:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKx1FL038161; Mon, 14 Dec 2009 20:59:01 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKx1M3038159; Mon, 14 Dec 2009 20:59:01 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912142059.nBEKx1M3038159@svn.freebsd.org> From: Doug Barton Date: Mon, 14 Dec 2009 20:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200542 - head/share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:59:02 -0000 Author: dougb Date: Mon Dec 14 20:59:01 2009 New Revision: 200542 URL: http://svn.freebsd.org/changeset/base/200542 Log: Improve the markup Submitted by: ru Modified: head/share/termcap/termcap.5 Modified: head/share/termcap/termcap.5 ============================================================================== --- head/share/termcap/termcap.5 Mon Dec 14 20:49:50 2009 (r200541) +++ head/share/termcap/termcap.5 Mon Dec 14 20:59:01 2009 (r200542) @@ -2003,13 +2003,16 @@ supports these capabilities. For the .Xr xterm 1 terminal emulator the traditional behavior in -FreeBSD when exiting a pager such as +.Fx +when exiting a pager such as .Xr less 1 or .Xr more 1 , or an editor such as .Xr vi 1 -is NOT to clear the screen after the program exits. +is +.Em NOT +to clear the screen after the program exits. If you prefer to clear the screen there are a number of .Dq xterm-clear entries that add this capability in the From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 20:59:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FE3B1065740; Mon, 14 Dec 2009 20:59:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8128FC15; Mon, 14 Dec 2009 20:59:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEKxIB6038204; Mon, 14 Dec 2009 20:59:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEKxIIx038201; Mon, 14 Dec 2009 20:59:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142059.nBEKxIIx038201@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 20:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200543 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 20:59:19 -0000 Author: yongari Date: Mon Dec 14 20:59:18 2009 New Revision: 200543 URL: http://svn.freebsd.org/changeset/base/200543 Log: Increase output queue size from 64 to 255. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 20:59:01 2009 (r200542) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 20:59:18 2009 (r200543) @@ -1061,8 +1061,8 @@ vge_attach(device_t dev) ifp->if_capabilities |= IFCAP_POLLING; #endif ifp->if_init = vge_init; - IFQ_SET_MAXLEN(&ifp->if_snd, VGE_IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = VGE_IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, VGE_TX_DESC_CNT - 1); + ifp->if_snd.ifq_drv_maxlen = VGE_TX_DESC_CNT - 1; IFQ_SET_READY(&ifp->if_snd); /* Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:59:01 2009 (r200542) +++ head/sys/dev/vge/if_vgevar.h Mon Dec 14 20:59:18 2009 (r200543) @@ -34,8 +34,6 @@ #define VGE_JUMBO_MTU 9000 -#define VGE_IFQ_MAXLEN 64 - #define VGE_TX_DESC_CNT 256 #define VGE_RX_DESC_CNT 252 /* Must be a multiple of 4!! */ #define VGE_TX_RING_ALIGN 64 From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 21:02:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBA811065692; Mon, 14 Dec 2009 21:02:17 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id A31578FC15; Mon, 14 Dec 2009 21:02:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KUN00FSNUFJ9060@asmtp029.mac.com>; Mon, 14 Dec 2009 13:02:08 -0800 (PST) From: Marcel Moolenaar In-reply-to: <200912142004.nBEK462J036724@svn.freebsd.org> Date: Mon, 14 Dec 2009 13:02:07 -0800 Message-id: <4888543E-3E2A-4630-AB03-DD2C5C6224E0@mac.com> References: <200912142004.nBEK462J036724@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200534 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:02:17 -0000 On Dec 14, 2009, at 12:04 PM, Rui Paulo wrote: > Author: rpaulo > Date: Mon Dec 14 20:04:06 2009 > New Revision: 200534 > URL: http://svn.freebsd.org/changeset/base/200534 > > Log: > Simplify partition type parsing by using a data-oriented model. > While there add more Apple and Linux partition types. If you add new aliases, you should update *all* schemes (where applicable). "apple-hfs" is known to APM as well (the scheme- specific type is "Apple_HFS"). I'm sure Linux and MS Windows partition types exist for MBR and EBR. Linux partitition types exist also for VTOC8 and APM. NetBSD partition types can be found on pretty much all schemes. Please update the other schemes as well. Thanks, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 21:11:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D55106566C; Mon, 14 Dec 2009 21:11:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 834598FC14; Mon, 14 Dec 2009 21:11:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBELBomi038551; Mon, 14 Dec 2009 21:11:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELBogp038549; Mon, 14 Dec 2009 21:11:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912142111.nBELBogp038549@svn.freebsd.org> From: Marius Strobl Date: Mon, 14 Dec 2009 21:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200544 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:11:50 -0000 Author: marius Date: Mon Dec 14 21:11:50 2009 New Revision: 200544 URL: http://svn.freebsd.org/changeset/base/200544 Log: Set ATA_CHECKS_CABLE when appropriate. Reviewed by: mav MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-amd.c Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Mon Dec 14 20:59:18 2009 (r200543) +++ head/sys/dev/ata/chipsets/ata-amd.c Mon Dec 14 21:11:50 2009 (r200544) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ +static int ata_amd_ch_attach(device_t dev); static int ata_amd_chipinit(device_t dev); static int ata_amd_setmode(device_t dev, int target, int mode); @@ -59,7 +60,6 @@ static int ata_amd_setmode(device_t dev, #define AMD_BUG 0x01 #define AMD_CABLE 0x02 - /* * American Micro Devices (AMD) chipset support functions */ @@ -100,6 +100,7 @@ ata_amd_chipinit(device_t dev) else pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1); + ctlr->ch_attach = ata_amd_ch_attach; ctlr->setmode = ata_amd_setmode; return 0; } @@ -137,4 +138,19 @@ ata_amd_setmode(device_t dev, int target return (mode); } +static int +ata_amd_ch_attach(device_t dev) +{ + struct ata_pci_controller *ctlr; + struct ata_channel *ch; + int error; + + ctlr = device_get_softc(device_get_parent(dev)); + ch = device_get_softc(dev); + error = ata_pci_ch_attach(dev); + if (ctlr->chip->cfg1 & AMD_CABLE) + ch->flags |= ATA_CHECKS_CABLE; + return (error); +} + ATA_DECLARE_DRIVER(ata_amd); From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 21:16:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C392F106566C; Mon, 14 Dec 2009 21:16:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99A208FC17; Mon, 14 Dec 2009 21:16:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBELG2gB038706; Mon, 14 Dec 2009 21:16:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELG2uh038704; Mon, 14 Dec 2009 21:16:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142116.nBELG2uh038704@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 21:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200545 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:16:02 -0000 Author: yongari Date: Mon Dec 14 21:16:02 2009 New Revision: 200545 URL: http://svn.freebsd.org/changeset/base/200545 Log: We don't have to reload EEPROM in vge_reset(). Because vge_reset() is called in vge_init_lock(), vge(4) always used to reload EEPROM. Also add more comment why vge(4) clears VGE_CHIPCFG0_PACPI bit. While I'm here add missing new line in vge_reset(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 21:11:50 2009 (r200544) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 21:16:02 2009 (r200545) @@ -586,27 +586,12 @@ vge_reset(struct vge_softc *sc) } if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "soft reset timed out"); + device_printf(sc->vge_dev, "soft reset timed out\n"); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_STOP_FORCE); DELAY(2000); } DELAY(5000); - - CSR_SETBIT_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); - - for (i = 0; i < VGE_TIMEOUT; i++) { - DELAY(5); - if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) - break; - } - - if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "EEPROM reload timed out\n"); - return; - } - - CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); } /* @@ -958,7 +943,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, cap, msic, rid; + int error = 0, cap, i, msic, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -1012,6 +997,21 @@ vge_attach(device_t dev) /* Reset the adapter. */ vge_reset(sc); + /* Reload EEPROM. */ + CSR_WRITE_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); + for (i = 0; i < VGE_TIMEOUT; i++) { + DELAY(5); + if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) + break; + } + if (i == VGE_TIMEOUT) + device_printf(dev, "EEPROM reload timed out\n"); + /* + * Clear PACPI as EEPROM reload will set the bit. Otherwise + * MAC will receive magic packet which in turn confuses + * controller. + */ + CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); /* * Get station address from the EEPROM. From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:00:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF66E1065676; Mon, 14 Dec 2009 22:00:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE8138FC15; Mon, 14 Dec 2009 22:00:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEM0B07039840; Mon, 14 Dec 2009 22:00:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEM0Bj5039838; Mon, 14 Dec 2009 22:00:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142200.nBEM0Bj5039838@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200548 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:00:12 -0000 Author: yongari Date: Mon Dec 14 22:00:11 2009 New Revision: 200548 URL: http://svn.freebsd.org/changeset/base/200548 Log: Sort function prototyes. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 21:51:36 2009 (r200547) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:00:11 2009 (r200548) @@ -140,56 +140,52 @@ static struct vge_type vge_devs[] = { { 0, 0, NULL } }; -static int vge_probe (device_t); -static int vge_attach (device_t); -static int vge_detach (device_t); - -static int vge_encap (struct vge_softc *, struct mbuf **); - -static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); -static int vge_dma_alloc (struct vge_softc *); -static void vge_dma_free (struct vge_softc *); -static void vge_discard_rxbuf (struct vge_softc *, int); -static int vge_newbuf (struct vge_softc *, int); -static int vge_rx_list_init (struct vge_softc *); -static int vge_tx_list_init (struct vge_softc *); -static void vge_freebufs (struct vge_softc *); -#ifndef __NO_STRICT_ALIGNMENT -static __inline void vge_fixup_rx - (struct mbuf *); -#endif -static int vge_rxeof (struct vge_softc *, int); -static void vge_txeof (struct vge_softc *); -static void vge_intr (void *); -static void vge_tick (void *); -static void vge_start (struct ifnet *); -static void vge_start_locked (struct ifnet *); -static int vge_ioctl (struct ifnet *, u_long, caddr_t); -static void vge_init (void *); -static void vge_init_locked (struct vge_softc *); -static void vge_stop (struct vge_softc *); -static void vge_watchdog (void *); -static int vge_suspend (device_t); -static int vge_resume (device_t); -static int vge_shutdown (device_t); -static int vge_ifmedia_upd (struct ifnet *); -static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); - +static int vge_attach(device_t); +static int vge_detach(device_t); +static int vge_probe(device_t); +static int vge_resume(device_t); +static int vge_shutdown(device_t); +static int vge_suspend(device_t); + +static void vge_cam_clear(struct vge_softc *); +static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_discard_rxbuf(struct vge_softc *, int); +static int vge_dma_alloc(struct vge_softc *); +static void vge_dma_free(struct vge_softc *); +static void vge_dmamap_cb(void *, bus_dma_segment_t *, int, int); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); +static void vge_eeprom_getword(struct vge_softc *, int, uint16_t *); #endif -static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); - -static void vge_miipoll_start (struct vge_softc *); -static void vge_miipoll_stop (struct vge_softc *); -static int vge_miibus_readreg (device_t, int, int); -static int vge_miibus_writereg (device_t, int, int, int); -static void vge_miibus_statchg (device_t); - -static void vge_cam_clear (struct vge_softc *); -static int vge_cam_set (struct vge_softc *, uint8_t *); -static void vge_setmulti (struct vge_softc *); -static void vge_reset (struct vge_softc *); +static int vge_encap(struct vge_softc *, struct mbuf **); +#ifndef __NO_STRICT_ALIGNMENT +static __inline void + vge_fixup_rx(struct mbuf *); +#endif +static void vge_freebufs(struct vge_softc *); +static void vge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int vge_ifmedia_upd(struct ifnet *); +static void vge_init(void *); +static void vge_init_locked(struct vge_softc *); +static void vge_intr(void *); +static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static int vge_miibus_readreg(device_t, int, int); +static void vge_miibus_statchg(device_t); +static int vge_miibus_writereg(device_t, int, int, int); +static void vge_miipoll_start(struct vge_softc *); +static void vge_miipoll_stop(struct vge_softc *); +static int vge_newbuf(struct vge_softc *, int); +static void vge_read_eeprom(struct vge_softc *, caddr_t, int, int, int); +static void vge_reset(struct vge_softc *); +static int vge_rx_list_init(struct vge_softc *); +static int vge_rxeof(struct vge_softc *, int); +static void vge_setmulti(struct vge_softc *); +static void vge_start(struct ifnet *); +static void vge_start_locked(struct ifnet *); +static void vge_stop(struct vge_softc *); +static void vge_tick(void *); +static int vge_tx_list_init(struct vge_softc *); +static void vge_txeof(struct vge_softc *); +static void vge_watchdog(void *); static device_method_t vge_methods[] = { /* Device interface */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:20:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8446D106566B; Mon, 14 Dec 2009 22:20:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 250738FC08; Mon, 14 Dec 2009 22:20:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMK6cB040418; Mon, 14 Dec 2009 22:20:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMK6VO040416; Mon, 14 Dec 2009 22:20:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142220.nBEMK6VO040416@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200551 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:20:06 -0000 Author: yongari Date: Mon Dec 14 22:20:05 2009 New Revision: 200551 URL: http://svn.freebsd.org/changeset/base/200551 Log: Whenever link state change interrupt is raised, vge_tick() is called and vge(4) used to drive auto-negotiation timer(mii_tick) in vge_tick(). Therefore the mii_tick was not called for every hz such that auto-negotiation complete was never handled in vge(4). Use mii_pollstat to extract current negotiated speed/duplex instead of mii_tick. The latter is valid only for auto-negotiation case. While I'm here change the confusing function name vge_tick() to vge_link_statchg(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:08:35 2009 (r200550) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:20:05 2009 (r200551) @@ -168,6 +168,7 @@ static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); static void vge_miibus_statchg(device_t); static int vge_miibus_writereg(device_t, int, int, int); @@ -182,7 +183,6 @@ static void vge_setmulti(struct vge_soft static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stop(struct vge_softc *); -static void vge_tick(void *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -1595,7 +1595,7 @@ vge_txeof(struct vge_softc *sc) } static void -vge_tick(void *xsc) +vge_link_statchg(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; @@ -1606,7 +1606,7 @@ vge_tick(void *xsc) VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); - mii_tick(mii); + mii_pollstat(mii); if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { sc->vge_flags &= ~VGE_FLAG_LINK; @@ -1735,7 +1735,7 @@ vge_intr(void *arg) } if (status & VGE_ISR_LINKSTS) - vge_tick(sc); + vge_link_statchg(sc); } /* Re-enable interrupts */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:23:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9040E1065670; Mon, 14 Dec 2009 22:23:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 803218FC18; Mon, 14 Dec 2009 22:23:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMN6JF040524; Mon, 14 Dec 2009 22:23:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMN6hq040522; Mon, 14 Dec 2009 22:23:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142223.nBEMN6hq040522@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200552 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:23:06 -0000 Author: yongari Date: Mon Dec 14 22:23:06 2009 New Revision: 200552 URL: http://svn.freebsd.org/changeset/base/200552 Log: Report media change result to caller instead of returning success without regard to the result. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:20:05 2009 (r200551) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:23:06 2009 (r200552) @@ -2153,14 +2153,15 @@ vge_ifmedia_upd(struct ifnet *ifp) { struct vge_softc *sc; struct mii_data *mii; + int error; sc = ifp->if_softc; VGE_LOCK(sc); mii = device_get_softc(sc->vge_miibus); - mii_mediachg(mii); + error = mii_mediachg(mii); VGE_UNLOCK(sc); - return (0); + return (error); } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:24:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7BE106566C; Mon, 14 Dec 2009 22:24:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293078FC08; Mon, 14 Dec 2009 22:24:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMO5LW040600; Mon, 14 Dec 2009 22:24:05 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMO4rC040576; Mon, 14 Dec 2009 22:24:04 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912142224.nBEMO4rC040576@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Dec 2009 22:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200553 - in head/sys/contrib/dev/acpica: . compiler debugger disassembler dispatcher events executer include namespace parser resources tools/acpiexec utilities X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:24:05 -0000 Author: jkim Date: Mon Dec 14 22:24:04 2009 New Revision: 200553 URL: http://svn.freebsd.org/changeset/base/200553 Log: Merge ACPICA 20091214. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/debugger/dbutils.c head/sys/contrib/dev/acpica/disassembler/dmwalk.c head/sys/contrib/dev/acpica/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/dispatcher/dswload.c head/sys/contrib/dev/acpica/events/evregion.c head/sys/contrib/dev/acpica/events/evrgnini.c head/sys/contrib/dev/acpica/events/evxface.c head/sys/contrib/dev/acpica/events/evxfevnt.c head/sys/contrib/dev/acpica/events/evxfregn.c head/sys/contrib/dev/acpica/executer/exmutex.c head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/namespace/nsaccess.c head/sys/contrib/dev/acpica/namespace/nsdump.c head/sys/contrib/dev/acpica/namespace/nseval.c head/sys/contrib/dev/acpica/namespace/nsnames.c head/sys/contrib/dev/acpica/namespace/nspredef.c head/sys/contrib/dev/acpica/namespace/nsrepair.c head/sys/contrib/dev/acpica/namespace/nsrepair2.c head/sys/contrib/dev/acpica/namespace/nsutils.c head/sys/contrib/dev/acpica/namespace/nsxfeval.c head/sys/contrib/dev/acpica/namespace/nsxfname.c head/sys/contrib/dev/acpica/namespace/nsxfobj.c head/sys/contrib/dev/acpica/parser/psxface.c head/sys/contrib/dev/acpica/resources/rsxface.c head/sys/contrib/dev/acpica/tools/acpiexec/aecommon.h head/sys/contrib/dev/acpica/utilities/utcopy.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/changes.txt Mon Dec 14 22:24:04 2009 (r200553) @@ -1,4 +1,71 @@ ---------------------------------------- +14 December 2009. Summary of changes for version 20091214: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Enhanced automatic data type conversions for predefined name repairs. This +change expands the automatic repairs/conversions for predefined name return +values to make Integers, Strings, and Buffers fully interchangeable. Also, a +Buffer can be converted to a Package of Integers if necessary. The nsrepair.c +module was completely restructured. Lin Ming, Bob Moore. + +Implemented automatic removal of null package elements during predefined name +repairs. This change will automatically remove embedded and trailing NULL +package elements from returned package objects that are defined to contain a +variable number of sub-packages. The driver is then presented with a package +with no null elements to deal with. ACPICA BZ 819. + +Implemented a repair for the predefined _FDE and _GTM names. The expected +return value for both names is a Buffer of 5 DWORDs. This repair fixes two +possible problems (both seen in the field), where a package of integers is +returned, or a buffer of BYTEs is returned. With assistance from Jung-uk Kim. + +Implemented additional module-level code support. This change will properly +execute module-level code that is not at the root of the namespace (under a +Device object, etc.). Now executes the code within the current scope instead +of the root. ACPICA BZ 762. Lin Ming. + +Fixed possible mutex acquisition errors when running _REG methods. Fixes a +problem where mutex errors can occur when running a _REG method that is in +the same scope as a method-defined operation region or an operation region +under a module-level IF block. This type of code is rare, so the problem has +not been seen before. ACPICA BZ 826. Lin Ming, Bob Moore. + +Fixed a possible memory leak during module-level code execution. An object +could be leaked for each block of executed module-level code if the +interpreter slack mode is enabled This change deletes any implicitly returned +object from the module-level code block. Lin Ming. + +Removed messages for successful predefined repair(s). The repair mechanism +was considered too wordy. Now, messages are only unconditionally emitted if +the return object cannot be repaired. Existing messages for successful +repairs were converted to ACPI_DEBUG_PRINT messages for now. ACPICA BZ 827. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 86.6K Code, 18.2K Data, 104.8K Total + Debug Version: 162.7K Code, 50.8K Data, 213.5K Total + Current Release: + Non-Debug Version: 87.0K Code, 18.0K Data, 105.0K Total + Debug Version: 163.4K Code, 50.8K Data, 214.2K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a regression introduced in 20091112 where intermediate .SRC files +were no longer automatically removed at the termination of the compile. + +acpiexec: Implemented the -f option to specify default region fill value. +This option specifies the value used to initialize buffers that simulate +operation regions. Default value is zero. Useful for debugging problems that +depend on a specific initial value for a region or field. + +---------------------------------------- 12 November 2009. Summary of changes for version 20091112: This release is available at www.acpica.org/downloads Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Mon Dec 14 22:24:04 2009 (r200553) @@ -895,20 +895,6 @@ CmCleanupAndExit ( 10) / Gbl_NsLookupCount); } - /* - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? - */ - if (!Gbl_SourceOutputFlag) - { - remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - - /* Delete AML file if there are errors */ - - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) - { - remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); - } if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { @@ -923,6 +909,27 @@ CmCleanupAndExit ( { FlCloseFile (i); } + + /* Delete AML file if there are errors */ + + if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) + { + remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); + } + + /* + * Delete intermediate ("combined") source file (if -ls flag not set) + * + * TBD: SourceOutput should be .TMP, then rename if we want to keep it? + */ + if (!Gbl_SourceOutputFlag) + { + if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) + { + printf ("Could not remove SRC file, %s\n", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } + } } Modified: head/sys/contrib/dev/acpica/debugger/dbutils.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbutils.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/debugger/dbutils.c Mon Dec 14 22:24:04 2009 (r200553) @@ -275,6 +275,10 @@ AcpiDbDumpExternalObject ( AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { + if (ObjDesc->Buffer.Length > 16) + { + AcpiOsPrintf ("\n"); + } AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); } Modified: head/sys/contrib/dev/acpica/disassembler/dmwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Dec 14 22:24:04 2009 (r200553) @@ -160,7 +160,6 @@ AcpiDmBlockType ( ACPI_PARSE_OBJECT *Op); - /******************************************************************************* * * FUNCTION: AcpiDmDisassemble Modified: head/sys/contrib/dev/acpica/dispatcher/dsmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/dispatcher/dsmethod.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/dispatcher/dsmethod.c Mon Dec 14 22:24:04 2009 (r200553) @@ -519,7 +519,7 @@ AcpiDsCallControlMethod ( if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { - Status = ObjDesc->Method.Implementation (NextWalkState); + Status = ObjDesc->Method.Extra.Implementation (NextWalkState); if (Status == AE_OK) { Status = AE_CTRL_TERMINATE; Modified: head/sys/contrib/dev/acpica/dispatcher/dswload.c ============================================================================== --- head/sys/contrib/dev/acpica/dispatcher/dswload.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/dispatcher/dswload.c Mon Dec 14 22:24:04 2009 (r200553) @@ -296,18 +296,19 @@ AcpiDsLoad1BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } * - * Note: silently change the type here. On the second pass, we will report - * a warning + * Note: silently change the type here. On the second pass, + * we will report a warning */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", - Path, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -318,8 +319,9 @@ AcpiDsLoad1BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", - AcpiUtGetTypeName (Node->Type), Path)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -794,15 +796,16 @@ AcpiDsLoad2BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } */ ACPI_WARNING ((AE_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", - BufferPtr, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -813,8 +816,9 @@ AcpiDsLoad2BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s]", - AcpiUtGetTypeName (Node->Type), BufferPtr)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return (AE_AML_OPERAND_TYPE); } @@ -1154,33 +1158,40 @@ AcpiDsLoad2EndOp ( } /* - * If we are executing a method, initialize the region + * The OpRegion is not fully parsed at this time. The only valid + * argument is the SpaceId. (We must save the address of the + * AML of the address and length operands) + * + * If we have a valid region, initialize it. The namespace is + * unlocked at this point. + * + * Need to unlock interpreter if it is locked (if we are running + * a control method), in order to allow _REG methods to be run + * during AcpiEvInitializeRegion. */ if (WalkState->MethodNode) { + /* + * Executing a method: initialize the region and unlock + * the interpreter + */ Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length, RegionSpace, WalkState); if (ACPI_FAILURE (Status)) { return (Status); } - } - /* - * The OpRegion is not fully parsed at this time. Only valid - * argument is the SpaceId. (We must save the address of the - * AML of the address and length operands) - */ + AcpiExExitInterpreter (); + } - /* - * If we have a valid region, initialize it - * Namespace is NOT locked at this point. - * - * TBD: need to unlock interpreter if it is locked, in order - * to allow _REG methods to be run. - */ Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node), FALSE); + if (WalkState->MethodNode) + { + AcpiExEnterInterpreter (); + } + if (ACPI_FAILURE (Status)) { /* Modified: head/sys/contrib/dev/acpica/events/evregion.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evregion.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evregion.c Mon Dec 14 22:24:04 2009 (r200553) @@ -845,7 +845,7 @@ AcpiEvInstallHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); @@ -1243,7 +1243,7 @@ AcpiEvRegRun ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); Modified: head/sys/contrib/dev/acpica/events/evrgnini.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evrgnini.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evrgnini.c Mon Dec 14 22:24:04 2009 (r200553) @@ -716,6 +716,20 @@ AcpiEvInitializeRegion ( HandlerObj = ObjDesc->ThermalZone.Handler; break; + case ACPI_TYPE_METHOD: + /* + * If we are executing module level code, the original + * Node's object was replaced by this Method object and we + * saved the handler in the method object. + * + * See AcpiNsExecModuleCode + */ + if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL) + { + HandlerObj = ObjDesc->Method.Extra.Handler; + } + break; + default: /* Ignore other objects */ break; Modified: head/sys/contrib/dev/acpica/events/evxface.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxface.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evxface.c Mon Dec 14 22:24:04 2009 (r200553) @@ -368,7 +368,7 @@ AcpiInstallNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -555,7 +555,7 @@ AcpiRemoveNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; Modified: head/sys/contrib/dev/acpica/events/evxfevnt.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxfevnt.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evxfevnt.c Mon Dec 14 22:24:04 2009 (r200553) @@ -805,7 +805,7 @@ AcpiInstallGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; @@ -905,7 +905,7 @@ AcpiRemoveGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; Modified: head/sys/contrib/dev/acpica/events/evxfregn.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxfregn.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/events/evxfregn.c Mon Dec 14 22:24:04 2009 (r200553) @@ -171,7 +171,7 @@ AcpiInstallAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -244,7 +244,7 @@ AcpiRemoveAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node || ((Node->Type != ACPI_TYPE_DEVICE) && (Node->Type != ACPI_TYPE_PROCESSOR) && Modified: head/sys/contrib/dev/acpica/executer/exmutex.c ============================================================================== --- head/sys/contrib/dev/acpica/executer/exmutex.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/executer/exmutex.c Mon Dec 14 22:24:04 2009 (r200553) @@ -490,6 +490,15 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); } + /* Must have a valid thread ID */ + + if (!WalkState->Thread) + { + ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", + AcpiUtGetNodeName (ObjDesc->Mutex.Node))); + return_ACPI_STATUS (AE_AML_INTERNAL); + } + /* * The Mutex is owned, but this thread must be the owner. * Special case for Global Lock, any thread can release @@ -505,15 +514,6 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_NOT_OWNER); } - /* Must have a valid thread ID */ - - if (!WalkState->Thread) - { - ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", - AcpiUtGetNodeName (ObjDesc->Mutex.Node))); - return_ACPI_STATUS (AE_AML_INTERNAL); - } - /* * The sync level of the mutex must be equal to the current sync level. In * other words, the current level means that at least one mutex at that Modified: head/sys/contrib/dev/acpica/include/acnamesp.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acnamesp.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acnamesp.h Mon Dec 14 22:24:04 2009 (r200553) @@ -456,6 +456,11 @@ AcpiNsComplexRepairs ( ACPI_STATUS ValidateStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr); +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc); /* * nssearch - Namespace searching and entry @@ -542,13 +547,9 @@ AcpiNsExternalizeName ( char **ConvertedName); ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle); -ACPI_HANDLE -AcpiNsConvertEntryToHandle( - ACPI_NAMESPACE_NODE *Node); - void AcpiNsTerminate ( void); Modified: head/sys/contrib/dev/acpica/include/acobject.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acobject.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acobject.h Mon Dec 14 22:24:04 2009 (r200553) @@ -288,7 +288,12 @@ typedef struct acpi_object_method UINT8 SyncLevel; union acpi_operand_object *Mutex; UINT8 *AmlStart; - ACPI_INTERNAL_METHOD Implementation; + union + { + ACPI_INTERNAL_METHOD Implementation; + union acpi_operand_object *Handler; + } Extra; + UINT32 AmlLength; UINT8 ThreadCount; ACPI_OWNER_ID OwnerId; Modified: head/sys/contrib/dev/acpica/include/acoutput.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acoutput.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acoutput.h Mon Dec 14 22:24:04 2009 (r200553) @@ -158,7 +158,8 @@ #define ACPI_LV_INIT 0x00000001 #define ACPI_LV_DEBUG_OBJECT 0x00000002 #define ACPI_LV_INFO 0x00000004 -#define ACPI_LV_ALL_EXCEPTIONS 0x00000007 +#define ACPI_LV_REPAIR 0x00000008 +#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F /* Trace verbosity level 1 [Standard Trace Level] */ @@ -217,6 +218,7 @@ #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) +#define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) /* Trace level -- also used in the global "DebugLevel" */ @@ -248,8 +250,8 @@ /* Defaults for DebugLevel, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/include/acpixf.h Mon Dec 14 22:24:04 2009 (r200553) @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20091112 +#define ACPI_CA_VERSION 0x20091214 #include #include Modified: head/sys/contrib/dev/acpica/namespace/nsaccess.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsaccess.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsaccess.c Mon Dec 14 22:24:04 2009 (r200553) @@ -251,7 +251,7 @@ AcpiNsRootInitialize ( /* Mark this as a very SPECIAL method */ ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY; - ObjDesc->Method.Implementation = AcpiUtOsiImplementation; + ObjDesc->Method.Extra.Implementation = AcpiUtOsiImplementation; #endif break; Modified: head/sys/contrib/dev/acpica/namespace/nsdump.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsdump.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsdump.c Mon Dec 14 22:24:04 2009 (r200553) @@ -286,7 +286,7 @@ AcpiNsDumpOneObject ( return (AE_OK); } - ThisNode = AcpiNsMapHandleToNode (ObjHandle); + ThisNode = AcpiNsValidateHandle (ObjHandle); if (!ThisNode) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", Modified: head/sys/contrib/dev/acpica/namespace/nseval.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nseval.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nseval.c Mon Dec 14 22:24:04 2009 (r200553) @@ -477,6 +477,19 @@ AcpiNsExecModuleCode ( MethodObj->Method.NextObject); Type = AcpiNsGetType (ParentNode); + /* + * Get the region handler and save it in the method object. We may need + * this if an operation region declaration causes a _REG method to be run. + * + * We can't do this in AcpiPsLinkModuleCode because + * AcpiGbl_RootNode->Object is NULL at PASS1. + */ + if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object) + { + MethodObj->Method.Extra.Handler = + ParentNode->Object->Device.Handler; + } + /* Must clear NextObject (AcpiNsAttachObject needs the field) */ MethodObj->Method.NextObject = NULL; @@ -513,6 +526,13 @@ AcpiNsExecModuleCode ( ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n", MethodObj->Method.AmlStart)); + /* Delete a possible implicit return value (in slack mode) */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + } + /* Detach the temporary method object */ AcpiNsDetachObject (ParentNode); Modified: head/sys/contrib/dev/acpica/namespace/nsnames.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsnames.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsnames.c Mon Dec 14 22:24:04 2009 (r200553) @@ -337,7 +337,7 @@ AcpiNsHandleToPathname ( ACPI_FUNCTION_TRACE_PTR (NsHandleToPathname, TargetHandle); - Node = AcpiNsMapHandleToNode (TargetHandle); + Node = AcpiNsValidateHandle (TargetHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); Modified: head/sys/contrib/dev/acpica/namespace/nspredef.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nspredef.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nspredef.c Mon Dec 14 22:24:04 2009 (r200553) @@ -313,31 +313,40 @@ AcpiNsCheckPredefinedNames ( Data->Pathname = Pathname; /* - * Check that the type of the return object is what is expected for - * this predefined name + * Check that the type of the main return object is what is expected + * for this predefined name */ Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr, Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); if (ACPI_FAILURE (Status)) { - goto CheckValidationStatus; + goto Exit; } - /* For returned Package objects, check the type of all sub-objects */ - - if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE) + /* + * For returned Package objects, check the type of all sub-objects. + * Note: Package may have been newly created by call above. + */ + if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE) { Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); + if (ACPI_FAILURE (Status)) + { + goto Exit; + } } /* - * Perform additional, more complicated repairs on a per-name - * basis. + * The return object was OK, or it was successfully repaired above. + * Now make some additional checks such as verifying that package + * objects are sorted correctly (if required) or buffer objects have + * the correct data width (bytes vs. dwords). These repairs are + * performed on a per-name basis, i.e., the code is specific to + * particular predefined names. */ Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr); - -CheckValidationStatus: +Exit: /* * If the object validation failed or if we successfully repaired one * or more objects, mark the parent node to suppress further warning @@ -349,7 +358,6 @@ CheckValidationStatus: } ACPI_FREE (Data); - Cleanup: ACPI_FREE (Pathname); return (Status); @@ -544,6 +552,12 @@ AcpiNsCheckPackage ( "%s Validating return Package of Type %X, Count %X\n", Data->Pathname, Package->RetInfo.Type, ReturnObject->Package.Count)); + /* + * For variable-length Packages, we can safely remove all embedded + * and trailing NULL package elements + */ + AcpiNsRemoveNullElements (Data, Package->RetInfo.Type, ReturnObject); + /* Extract package count and elements array */ Elements = ReturnObject->Package.Elements; @@ -582,9 +596,10 @@ AcpiNsCheckPackage ( } else if (Count > ExpectedCount) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Package is larger than needed - " - "found %u, expected %u", Count, ExpectedCount)); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Return Package is larger than needed - " + "found %u, expected %u\n", + Data->Pathname, Count, ExpectedCount)); } /* Validate all elements of the returned package */ @@ -800,56 +815,20 @@ AcpiNsCheckPackageList ( ACPI_OPERAND_OBJECT *SubPackage; ACPI_OPERAND_OBJECT **SubElements; ACPI_STATUS Status; - BOOLEAN NonTrailingNull = FALSE; UINT32 ExpectedCount; UINT32 i; UINT32 j; - /* Validate each sub-Package in the parent Package */ - + /* + * Validate each sub-Package in the parent Package + * + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. + */ for (i = 0; i < Count; i++) { - /* - * Handling for NULL package elements. For now, we will simply allow - * a parent package with trailing NULL elements. This can happen if - * the package was defined to be longer than the initializer list. - * This is legal as per the ACPI specification. It is often used - * to allow for dynamic initialization of a Package. - * - * A future enhancement may be to simply truncate the package to - * remove the trailing NULL elements. - */ - if (!(*Elements)) - { - if (!NonTrailingNull) - { - /* Ensure the remaining elements are all NULL */ - - for (j = 1; j < (Count - i + 1); j++) - { - if (Elements[j]) - { - NonTrailingNull = TRUE; - } - } - - if (!NonTrailingNull) - { - /* Ignore the trailing NULL elements */ - - return (AE_OK); - } - } - - /* There are trailing non-null elements, issue warning */ - - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Found NULL element at package index %u", i)); - Elements++; - continue; - } - SubPackage = *Elements; SubElements = SubPackage->Package.Elements; Modified: head/sys/contrib/dev/acpica/namespace/nsrepair.c ============================================================================== --- head/sys/contrib/dev/acpica/namespace/nsrepair.c Mon Dec 14 22:23:06 2009 (r200552) +++ head/sys/contrib/dev/acpica/namespace/nsrepair.c Mon Dec 14 22:24:04 2009 (r200553) @@ -119,7 +119,6 @@ #include #include #include -#include #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") @@ -127,6 +126,54 @@ /******************************************************************************* * + * This module attempts to repair or convert objects returned by the + * predefined methods to an object type that is expected, as per the ACPI + * specification. The need for this code is dictated by the many machines that + * return incorrect types for the standard predefined methods. Performing these + * conversions here, in one place, eliminates the need for individual ACPI + * device drivers to do the same. Note: Most of these conversions are different + * than the internal object conversion routines used for implicit object + * conversion. + * + * The following conversions can be performed as necessary: + * + * Integer -> String + * Integer -> Buffer + * String -> Integer + * String -> Buffer + * Buffer -> Integer + * Buffer -> String + * Buffer -> Package of Integers + * Package -> Package of one Package + * + ******************************************************************************/ + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToPackage ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + + +/******************************************************************************* + * * FUNCTION: AcpiNsRepairObject * * PARAMETERS: Data - Pointer to validation data structure @@ -153,35 +200,230 @@ AcpiNsRepairObject ( { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_OPERAND_OBJECT *NewObject; - ACPI_SIZE Length; ACPI_STATUS Status; + ACPI_FUNCTION_NAME (NsRepairObject); + + /* * At this point, we know that the type of the returned object was not * one of the expected types for this predefined name. Attempt to - * repair the object. Only a limited number of repairs are possible. + * repair the object by converting it to one of the expected object + * types for this predefined name. */ - switch (ReturnObject->Common.Type) + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) + { + Status = AcpiNsConvertToInteger (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_STRING) + { + Status = AcpiNsConvertToString (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_BUFFER) + { + Status = AcpiNsConvertToBuffer (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) + { + Status = AcpiNsConvertToPackage (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + + /* We cannot repair this object */ + + return (AE_AML_OPERAND_TYPE); + + +ObjectRepaired: + + /* Object was successfully repaired */ + + /* + * If the original object is a package element, we need to: + * 1. Set the reference count of the new object to match the + * reference count of the old object. + * 2. Decrement the reference count of the original object. + */ + if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) + { + NewObject->Common.ReferenceCount = + ReturnObject->Common.ReferenceCount; + + if (ReturnObject->Common.ReferenceCount > 1) + { + ReturnObject->Common.ReferenceCount--; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s at index %u\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject), PackageIndex)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject))); + } + + /* Delete old object, install the new return object */ + + AcpiUtRemoveReference (ReturnObject); + *ReturnObjectPtr = NewObject; + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToInteger + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + UINT64 Value = 0; + UINT32 i; + + + switch (OriginalObject->Common.Type) { + case ACPI_TYPE_STRING: + + /* String-to-Integer conversion */ + + Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, + ACPI_ANY_BASE, &Value); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + case ACPI_TYPE_BUFFER: - /* Does the method/object legally return a string? */ + /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */ - if (!(ExpectedBtypes & ACPI_RTYPE_STRING)) + if (OriginalObject->Buffer.Length > 8) { return (AE_AML_OPERAND_TYPE); } + /* Extract each buffer byte to create the integer */ + + for (i = 0; i < OriginalObject->Buffer.Length; i++) + { + Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8)); + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + NewObject = AcpiUtCreateIntegerObject (Value); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToString + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_SIZE Length; + ACPI_STATUS Status; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: /* - * Have a Buffer, expected a String, convert. Use a ToString + * Integer-to-String conversion. Commonly, convert + * an integer of value 0 to a NULL string. The last element of + * _BIF and _BIX packages occasionally need this fix. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:28:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACE01065670; Mon, 14 Dec 2009 22:28:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 910AF8FC18; Mon, 14 Dec 2009 22:28:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMSWub040718; Mon, 14 Dec 2009 22:28:32 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMSW1s040716; Mon, 14 Dec 2009 22:28:32 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912142228.nBEMSW1s040716@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Dec 2009 22:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200554 - head/sys/dev/fdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:28:32 -0000 Author: jkim Date: Mon Dec 14 22:28:32 2009 New Revision: 200554 URL: http://svn.freebsd.org/changeset/base/200554 Log: Remove _FDE quirk handling as these quirks are automatically repaired by ACPICA layer since ACPICA 20091214. Modified: head/sys/dev/fdc/fdc_acpi.c Modified: head/sys/dev/fdc/fdc_acpi.c ============================================================================== --- head/sys/dev/fdc/fdc_acpi.c Mon Dec 14 22:24:04 2009 (r200553) +++ head/sys/dev/fdc/fdc_acpi.c Mon Dec 14 22:28:32 2009 (r200554) @@ -97,9 +97,7 @@ fdc_acpi_attach(device_t dev) struct fdc_data *sc; ACPI_BUFFER buf; device_t bus; - int error, fde_count, i; - ACPI_OBJECT *obj, *pkg; - uint32_t fde[ACPI_FDC_MAXDEVS]; + int error; /* Get our softc and use the same accessor as ISA. */ sc = device_get_softc(dev); @@ -128,63 +126,12 @@ fdc_acpi_attach(device_t dev) */ bus = device_get_parent(dev); if (ACPI_FAILURE(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, &buf))) { - error = ENXIO; - goto out_hintsprobe; - } - - /* Parse the output of _FDE in various ways. */ - obj = pkg = (ACPI_OBJECT *)buf.Pointer; - switch (obj->Type) { - case ACPI_TYPE_BUFFER: - /* - * The spec says _FDE should be a buffer of five 32-bit - * integers. In violation of the spec, some systems use - * five bytes instead. - */ - switch (obj->Buffer.Length) { - case ACPI_FDC_FDE_LEN: - bcopy(obj->Buffer.Pointer, fde, ACPI_FDC_FDE_LEN); - break; - case ACPI_FDC_MAXDEVS: - for (i = 0; i < ACPI_FDC_MAXDEVS; i++) - fde[i] = ((uint8_t *)obj->Buffer.Pointer)[i]; - break; - default: - device_printf(dev, "_FDE wrong length: %d\n", - obj->Buffer.Length); - error = ENXIO; - goto out_hintsprobe; - } - break; - case ACPI_TYPE_PACKAGE: - /* - * In violation of the spec, systems including the ASUS - * K8V return a package of five integers instead of a - * buffer of five 32-bit integers. - */ - fde_count = min(ACPI_FDC_MAXDEVS, pkg->Package.Count); - for (i = 0; i < fde_count; i++) { - obj = &pkg->Package.Elements[i]; - if (obj->Type == ACPI_TYPE_INTEGER) - fde[i] = (uint32_t)obj->Integer.Value; - } - break; - default: - device_printf(dev, "invalid _FDE type %d\n", obj->Type); - error = ENXIO; - goto out_hintsprobe; + error = fdc_hints_probe(dev); + goto out; } /* Add fd child devices as specified. */ - error = fdc_acpi_probe_children(bus, dev, fde); - -out_hintsprobe: - /* - * If there was a problem with the _FDE drive enumeration, fall - * back to the hints-based probe. - */ - if (error) - error = fdc_hints_probe(dev); + error = fdc_acpi_probe_children(bus, dev, buf.Pointer); out: if (buf.Pointer) From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:30:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A790106566C; Mon, 14 Dec 2009 22:30:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3FF8FC13; Mon, 14 Dec 2009 22:30:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMU7rj040811; Mon, 14 Dec 2009 22:30:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMU7L6040809; Mon, 14 Dec 2009 22:30:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142230.nBEMU7L6040809@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200555 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:30:07 -0000 Author: yongari Date: Mon Dec 14 22:30:07 2009 New Revision: 200555 URL: http://svn.freebsd.org/changeset/base/200555 Log: Don't report current link status if interface is not UP. If interface is not UP, the current link status wouldn't reflect the negotiated status. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:28:32 2009 (r200554) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:30:07 2009 (r200555) @@ -2177,6 +2177,10 @@ vge_ifmedia_sts(struct ifnet *ifp, struc mii = device_get_softc(sc->vge_miibus); VGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + VGE_UNLOCK(sc); + return; + } mii_pollstat(mii); VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:47:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C721065679; Mon, 14 Dec 2009 22:47:10 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06B218FC18; Mon, 14 Dec 2009 22:47:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMl9Ig041256; Mon, 14 Dec 2009 22:47:09 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMl91u041254; Mon, 14 Dec 2009 22:47:09 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912142247.nBEMl91u041254@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Dec 2009 22:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200557 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:47:10 -0000 Author: rpaulo Date: Mon Dec 14 22:47:09 2009 New Revision: 200557 URL: http://svn.freebsd.org/changeset/base/200557 Log: Add apple-boot and apple-ufs. Submitted by: nwhitehorn Modified: head/sys/sys/apm.h Modified: head/sys/sys/apm.h ============================================================================== --- head/sys/sys/apm.h Mon Dec 14 22:38:51 2009 (r200556) +++ head/sys/sys/apm.h Mon Dec 14 22:47:09 2009 (r200557) @@ -61,6 +61,8 @@ struct apm_ent { #define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" #define APM_ENT_TYPE_FREEBSD_ZFS "FreeBSD-ZFS" +#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" #define APM_ENT_TYPE_APPLE_HFS "Apple_HFS" +#define APM_ENT_TYPE_APPLE_UFS "Apple_UNIX_SVR2" #endif /* _SYS_APM_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 22:55:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22AC51065693; Mon, 14 Dec 2009 22:55:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2DF8FC19; Mon, 14 Dec 2009 22:55:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEMtKht041453; Mon, 14 Dec 2009 22:55:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEMtKTp041451; Mon, 14 Dec 2009 22:55:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912142255.nBEMtKTp041451@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Dec 2009 22:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200558 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 22:55:21 -0000 Author: yongari Date: Mon Dec 14 22:55:20 2009 New Revision: 200558 URL: http://svn.freebsd.org/changeset/base/200558 Log: Tell upper layer vge(4) supports long frames. This should be done after ether_ifattach(), as ether_ifattach() initializes it with ETHER_HDR_LEN. While I'm here remove setting if_mtu, it's already handled in ether_ifattach(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Mon Dec 14 22:47:09 2009 (r200557) +++ head/sys/dev/vge/if_vge.c Mon Dec 14 22:55:20 2009 (r200558) @@ -1045,7 +1045,6 @@ vge_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = vge_ioctl; ifp->if_capabilities = IFCAP_VLAN_MTU; @@ -1066,6 +1065,9 @@ vge_attach(device_t dev) */ ether_ifattach(ifp, eaddr); + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->vge_irq, INTR_TYPE_NET|INTR_MPSAFE, NULL, vge_intr, sc, &sc->vge_intrhand); From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 05:14:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B15D1065670; Tue, 15 Dec 2009 05:14:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 281F28FC0C; Tue, 15 Dec 2009 05:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF5Eenn050813; Tue, 15 Dec 2009 05:14:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF5Eej4050810; Tue, 15 Dec 2009 05:14:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912150514.nBF5Eej4050810@svn.freebsd.org> From: Doug Barton Date: Tue, 15 Dec 2009 05:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200563 - in head/etc: mtree namedb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 05:14:40 -0000 Author: dougb Date: Tue Dec 15 05:14:39 2009 New Revision: 200563 URL: http://svn.freebsd.org/changeset/base/200563 Log: The named process needs to have a "working directory" that it can write to. This is specified in "options { directory }" in named.conf. So, create /etc/namedb/working with appropriate permissions, and update the entry in named.conf to match. In addition to specifying the working directory, file and path names in named.conf can be specified relative to the directory listed. However, since that directory is now different from /etc/namedb (where the configuration, zone, rndc.*, and other files are located) further update named.conf to specify all file names with fully qualified paths. Also update the comment about file and path names so users know this should be done for all file/path names in the file. This change will eliminate the 'working directory is not writable' messages at boot time without sacrificing security. It will also allow for features in newer versions of BIND (9.7+) to work as designed. Modified: head/etc/mtree/BIND.chroot.dist head/etc/namedb/named.conf Modified: head/etc/mtree/BIND.chroot.dist ============================================================================== --- head/etc/mtree/BIND.chroot.dist Tue Dec 15 01:14:33 2009 (r200562) +++ head/etc/mtree/BIND.chroot.dist Tue Dec 15 05:14:39 2009 (r200563) @@ -15,6 +15,8 @@ .. slave uname=bind .. + working uname=bind + .. .. .. /set type=dir uname=bind gname=wheel mode=0755 Modified: head/etc/namedb/named.conf ============================================================================== --- head/etc/namedb/named.conf Tue Dec 15 01:14:33 2009 (r200562) +++ head/etc/namedb/named.conf Tue Dec 15 05:14:39 2009 (r200563) @@ -9,8 +9,9 @@ // or cause huge amounts of useless Internet traffic. options { - // Relative to the chroot directory, if any - directory "/etc/namedb"; + // All file and path names are relative to the chroot directory, + // if any, and should be fully qualified. + directory "/etc/namedb/working"; pid-file "/var/run/named/pid"; dump-file "/var/dump/named_dump.db"; statistics-file "/var/stats/named.stats"; @@ -74,7 +75,7 @@ options { // Also, make sure to enable it in /etc/rc.conf. // The traditional root hints mechanism. Use this, OR the slave zones below. -zone "." { type hint; file "named.root"; }; +zone "." { type hint; file "/etc/namedb/named.root"; }; /* Slaving the following zones from the root name servers has some significant advantages: @@ -94,7 +95,7 @@ zone "." { type hint; file "named.root"; /* zone "." { type slave; - file "slave/root.slave"; + file "/etc/namedb/slave/root.slave"; masters { 192.5.5.241; // F.ROOT-SERVERS.NET. }; @@ -102,7 +103,7 @@ zone "." { }; zone "arpa" { type slave; - file "slave/arpa.slave"; + file "/etc/namedb/slave/arpa.slave"; masters { 192.5.5.241; // F.ROOT-SERVERS.NET. }; @@ -110,7 +111,7 @@ zone "arpa" { }; zone "in-addr.arpa" { type slave; - file "slave/in-addr.arpa.slave"; + file "/etc/namedb/slave/in-addr.arpa.slave"; masters { 192.5.5.241; // F.ROOT-SERVERS.NET. }; @@ -125,116 +126,116 @@ zone "in-addr.arpa" { 2. No spurious traffic will be sent from your network to the roots */ // RFC 1912 -zone "localhost" { type master; file "master/localhost-forward.db"; }; -zone "127.in-addr.arpa" { type master; file "master/localhost-reverse.db"; }; -zone "255.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "localhost" { type master; file "/etc/namedb/master/localhost-forward.db"; }; +zone "127.in-addr.arpa" { type master; file "/etc/namedb/master/localhost-reverse.db"; }; +zone "255.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // RFC 1912-style zone for IPv6 localhost address -zone "0.ip6.arpa" { type master; file "master/localhost-reverse.db"; }; +zone "0.ip6.arpa" { type master; file "/etc/namedb/master/localhost-reverse.db"; }; // "This" Network (RFCs 1912 and 3330) -zone "0.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "0.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // Private Use Networks (RFC 1918) -zone "10.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "16.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "17.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "18.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "19.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "20.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "21.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "22.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "23.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "24.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "25.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "26.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "27.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "28.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "29.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "30.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "31.172.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "168.192.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "10.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "16.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "17.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "18.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "19.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "20.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "21.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "22.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "23.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "24.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "25.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "26.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "27.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "28.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "29.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "30.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // Link-local/APIPA (RFCs 3330 and 3927) -zone "254.169.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // TEST-NET for Documentation (RFC 3330) -zone "2.0.192.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "2.0.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // Router Benchmark Testing (RFC 3330) -zone "18.198.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "19.198.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "18.198.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "19.198.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IANA Reserved - Old Class E Space -zone "240.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "241.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "242.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "243.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "244.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "245.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "246.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "247.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "248.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "249.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "250.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "251.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "252.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "253.in-addr.arpa" { type master; file "master/empty.db"; }; -zone "254.in-addr.arpa" { type master; file "master/empty.db"; }; +zone "240.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "241.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "242.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "243.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "244.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "245.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "246.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "247.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "248.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "249.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "250.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "251.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "252.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "253.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "254.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 Unassigned Addresses (RFC 4291) -zone "1.ip6.arpa" { type master; file "master/empty.db"; }; -zone "3.ip6.arpa" { type master; file "master/empty.db"; }; -zone "4.ip6.arpa" { type master; file "master/empty.db"; }; -zone "5.ip6.arpa" { type master; file "master/empty.db"; }; -zone "6.ip6.arpa" { type master; file "master/empty.db"; }; -zone "7.ip6.arpa" { type master; file "master/empty.db"; }; -zone "8.ip6.arpa" { type master; file "master/empty.db"; }; -zone "9.ip6.arpa" { type master; file "master/empty.db"; }; -zone "a.ip6.arpa" { type master; file "master/empty.db"; }; -zone "b.ip6.arpa" { type master; file "master/empty.db"; }; -zone "c.ip6.arpa" { type master; file "master/empty.db"; }; -zone "d.ip6.arpa" { type master; file "master/empty.db"; }; -zone "e.ip6.arpa" { type master; file "master/empty.db"; }; -zone "0.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "1.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "2.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "3.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "4.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "5.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "6.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "7.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "8.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "9.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "a.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "b.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "0.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "1.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "2.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "3.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "4.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "5.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "6.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "7.e.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "1.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "3.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "4.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "5.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "6.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "7.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "8.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "9.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "a.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "b.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "c.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "d.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "e.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "0.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "1.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "2.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "3.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "4.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "5.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "6.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "7.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "8.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "9.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "a.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "b.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "0.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "1.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "2.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "3.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "4.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "5.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "6.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "7.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 ULA (RFC 4193) -zone "c.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "d.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "c.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "d.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 Link Local (RFC 4291) -zone "8.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "9.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "a.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "b.e.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "8.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "9.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "a.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "b.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IPv6 Deprecated Site-Local Addresses (RFC 3879) -zone "c.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "d.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "e.e.f.ip6.arpa" { type master; file "master/empty.db"; }; -zone "f.e.f.ip6.arpa" { type master; file "master/empty.db"; }; +zone "c.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "d.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "e.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "f.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IP6.INT is Deprecated (RFC 4159) -zone "ip6.int" { type master; file "master/empty.db"; }; +zone "ip6.int" { type master; file "/etc/namedb/master/empty.db"; }; // NB: Do not use the IP addresses below, they are faked, and only // serve demonstration/documentation purposes! @@ -265,17 +266,16 @@ zone "example.org" { allow-update { key "exampleorgkey"; }; - file "dynamic/example.org"; + file "/etc/namedb/dynamic/example.org"; }; */ /* Example of a slave reverse zone zone "1.168.192.in-addr.arpa" { type slave; - file "slave/1.168.192.in-addr.arpa"; + file "/etc/namedb/slave/1.168.192.in-addr.arpa"; masters { 192.168.1.1; }; }; */ - From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 09:32:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B6B21065754; Tue, 15 Dec 2009 09:32:36 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF0408FC22; Tue, 15 Dec 2009 09:32:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF9WZW1056613; Tue, 15 Dec 2009 09:32:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF9WZCL056611; Tue, 15 Dec 2009 09:32:35 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150932.nBF9WZCL056611@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 09:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200566 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 09:32:36 -0000 Author: luigi Date: Tue Dec 15 09:32:35 2009 New Revision: 200566 URL: http://svn.freebsd.org/changeset/base/200566 Log: fix the indentation for addr: values MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Dec 15 07:32:08 2009 (r200565) +++ head/sbin/ipfw/ipfw.8 Tue Dec 15 09:32:35 2009 (r200566) @@ -1002,6 +1002,7 @@ The second format with multiple addresses) is provided for convenience only and its use is discouraged. .It Ar addr : Oo Cm not Oc Bro +.Bl -tag -width indent .Cm any | me | me6 | .Cm table Ns Pq Ar number Ns Op , Ns Ar value .Ar | addr-list | addr-set @@ -1023,6 +1024,7 @@ is also specified, an entry will match o See the .Sx LOOKUP TABLES section below for more information on lookup tables. +.El .It Ar addr-list : ip-addr Ns Op Ns , Ns Ar addr-list .It Ar ip-addr : A host or subnet address specified in one of the following ways: From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 09:46:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 134361065676; Tue, 15 Dec 2009 09:46:28 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0255E8FC15; Tue, 15 Dec 2009 09:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBF9kRU3056944; Tue, 15 Dec 2009 09:46:27 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBF9kRHE056939; Tue, 15 Dec 2009 09:46:27 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912150946.nBF9kRHE056939@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 09:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200567 - in head: sbin/ipfw sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 09:46:28 -0000 Author: luigi Date: Tue Dec 15 09:46:27 2009 New Revision: 200567 URL: http://svn.freebsd.org/changeset/base/200567 Log: implement a new match option, lookup {dst-ip|src-ip|dst-port|src-port|uid|jail} N which searches the specified field in table N and sets tablearg accordingly. With dst-ip or src-ip the option replicates two existing options. When used with other arguments, the option can be useful to quickly dispatch traffic based on other fields. Work supported by the Onelab project. MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sys/netinet/ipfw/ip_fw2.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Dec 15 09:32:35 2009 (r200566) +++ head/sbin/ipfw/ipfw.8 Tue Dec 15 09:46:27 2009 (r200567) @@ -1391,6 +1391,20 @@ of source and destination addresses and specified. Currently, only IPv4 flows are supported. +.It Cm lookup Bro Cm dst-ip | dst-port | src-ip | src-port | uid | jail Brc Ar N +Search an entry in lookup table +.Ar N +that matches the field specified as argument. +If not found, the match fails. +Otherwise, the match succeeds and +.Cm tablearg +is set to the value extracted from the table. +.Br +This option can be useful to quickly dispatch traffic based on +certain packet fields. +See the +.Sx LOOKUP TABLES +section below for more information on lookup tables. .It Cm { MAC | mac } Ar dst-mac src-mac Match packets with a given .Ar dst-mac Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Dec 15 09:32:35 2009 (r200566) +++ head/sbin/ipfw/ipfw2.c Tue Dec 15 09:46:27 2009 (r200567) @@ -224,6 +224,15 @@ static struct _s_x rule_action_params[] { NULL, 0 } /* terminator */ }; +/* + * The 'lookup' instruction accepts one of the following arguments. + * -1 is a terminator for the list. + * Arguments are passed as v[1] in O_DST_LOOKUP options. + */ +static int lookup_key[] = { + TOK_DSTIP, TOK_SRCIP, TOK_DSTPORT, TOK_SRCPORT, + TOK_UID, TOK_JAIL, -1 }; + static struct _s_x rule_options[] = { { "tagged", TOK_TAGGED }, { "uid", TOK_UID }, @@ -290,6 +299,7 @@ static struct _s_x rule_options[] = { { "dst-ip6", TOK_DSTIP6}, { "src-ipv6", TOK_SRCIP6}, { "src-ip6", TOK_SRCIP6}, + { "lookup", TOK_LOOKUP}, { "//", TOK_COMMENT }, { "not", TOK_NOT }, /* pseudo option */ @@ -742,6 +752,16 @@ print_ip(ipfw_insn_ip *cmd, char const * int len = F_LEN((ipfw_insn *)cmd); uint32_t *a = ((ipfw_insn_u32 *)cmd)->d; + if (cmd->o.opcode == O_IP_DST_LOOKUP && len > F_INSN_SIZE(ipfw_insn_u32)) { + uint32_t d = a[1]; + const char *arg = ""; + + if (d < sizeof(lookup_key)/sizeof(lookup_key[0])) + arg = match_value(rule_options, lookup_key[d]); + printf("%s lookup %s %d", cmd->o.len & F_NOT ? " not": "", + arg, cmd->o.arg1); + return; + } printf("%s%s ", cmd->o.len & F_NOT ? " not": "", s); if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { @@ -3479,6 +3499,31 @@ read_options: ac--; av++; break; + case TOK_LOOKUP: { + ipfw_insn_u32 *c = (ipfw_insn_u32 *)cmd; + char *p; + int j; + + if (ac < 2) + errx(EX_USAGE, "format: lookup argument tablenum"); + cmd->opcode = O_IP_DST_LOOKUP; + cmd->len |= F_INSN_SIZE(ipfw_insn) + 2; + i = match_token(rule_options, *av); + for (j = 0; lookup_key[j] >= 0 ; j++) { + if (i == lookup_key[j]) + break; + } + if (lookup_key[j] <= 0) + errx(EX_USAGE, "format: cannot lookup on %s", *av); + c->d[1] = j; // i converted to option + ac--; av++; + cmd->arg1 = strtoul(*av, &p, 0); + if (p && *p) + errx(EX_USAGE, "format: lookup argument tablenum"); + ac--; av++; + } + break; + default: errx(EX_USAGE, "unrecognised option [%d] %s\n", i, s); } Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Tue Dec 15 09:32:35 2009 (r200566) +++ head/sbin/ipfw/ipfw2.h Tue Dec 15 09:46:27 2009 (r200567) @@ -186,6 +186,7 @@ enum tokens { TOK_FIB, TOK_SETFIB, + TOK_LOOKUP, }; /* * the following macro returns an error message if we run out of Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 09:32:35 2009 (r200566) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 09:46:27 2009 (r200567) @@ -2819,6 +2819,36 @@ do { \ dst_ip.s_addr : src_ip.s_addr; uint32_t v = 0; + if (cmdlen > F_INSN_SIZE(ipfw_insn_u32)) { + /* generic lookup */ + v = ((ipfw_insn_u32 *)cmd)->d[1]; + if (v == 0) + a = dst_ip.s_addr; + else if (v == 1) + a = src_ip.s_addr; + else if (offset != 0) + break; + else if (proto != IPPROTO_TCP && + proto != IPPROTO_UDP) + break; + else if (v == 2) + a = dst_port; + else if (v == 3) + a = src_port; + else if (v == 4 || v == 5) { + check_uidgid( + (ipfw_insn_u32 *)cmd, + proto, oif, + dst_ip, dst_port, + src_ip, src_port, &ucred_cache, + &ucred_lookup, args->inp); + if (v == 4 /* O_UID */) + a = ucred_cache->cr_uid; + else if (v == 5 /* O_JAIL */) + a = ucred_cache->cr_prison->pr_id; + } else + break; + } match = lookup_table(chain, cmd->arg1, a, &v); if (!match) @@ -4160,6 +4190,7 @@ check_ipfw_struct(struct ip_fw *rule, in return (EINVAL); } if (cmdlen != F_INSN_SIZE(ipfw_insn) && + cmdlen != F_INSN_SIZE(ipfw_insn_u32) + 1 && cmdlen != F_INSN_SIZE(ipfw_insn_u32)) goto bad_size; break; From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 10:40:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1979B1065679; Tue, 15 Dec 2009 10:40:41 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07F658FC16; Tue, 15 Dec 2009 10:40:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFAeeUJ061026; Tue, 15 Dec 2009 10:40:40 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAeexh061025; Tue, 15 Dec 2009 10:40:40 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200912151040.nBFAeexh061025@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 15 Dec 2009 10:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200572 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:40:41 -0000 Author: bms Date: Tue Dec 15 10:40:40 2009 New Revision: 200572 URL: http://svn.freebsd.org/changeset/base/200572 Log: Add missing #include . Submitted by: Hideki Yamamoto MFC after: 1 week Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Tue Dec 15 10:36:08 2009 (r200571) +++ head/sys/netinet6/mld6.c Tue Dec 15 10:40:40 2009 (r200572) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 10:43:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13B9D106568F; Tue, 15 Dec 2009 10:43:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02B328FC15; Tue, 15 Dec 2009 10:43:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFAhKRo061114; Tue, 15 Dec 2009 10:43:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAhKHR061110; Tue, 15 Dec 2009 10:43:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200912151043.nBFAhKHR061110@svn.freebsd.org> From: Robert Watson Date: Tue, 15 Dec 2009 10:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200573 - head/tools/regression/kqueue X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:43:21 -0000 Author: rwatson Date: Tue Dec 15 10:43:20 2009 New Revision: 200573 URL: http://svn.freebsd.org/changeset/base/200573 Log: Merge libkqueue test suite through r119 Submitted by: Mark Heily Modified: head/tools/regression/kqueue/config.h head/tools/regression/kqueue/main.c head/tools/regression/kqueue/user.c Modified: head/tools/regression/kqueue/config.h ============================================================================== --- head/tools/regression/kqueue/config.h Tue Dec 15 10:40:40 2009 (r200572) +++ head/tools/regression/kqueue/config.h Tue Dec 15 10:43:20 2009 (r200573) @@ -1,5 +1,6 @@ /* AUTOMATICALLY GENERATED -- DO NOT EDIT */ /* $FreeBSD$ */ +#define HAVE_ERR_H #define HAVE_SYS_EVENT_H #define HAVE_EV_DISPATCH 1 #define HAVE_EV_RECEIPT 1 Modified: head/tools/regression/kqueue/main.c ============================================================================== --- head/tools/regression/kqueue/main.c Tue Dec 15 10:40:40 2009 (r200572) +++ head/tools/regression/kqueue/main.c Tue Dec 15 10:43:20 2009 (r200573) @@ -235,7 +235,12 @@ main(int argc, char **argv) int test_signal = 1; int test_vnode = 1; int test_timer = 1; +#ifdef __FreeBSD__ int test_user = 1; +#else + /* XXX-FIXME temporary */ + int test_user = 0; +#endif while (argc) { if (strcmp(argv[0], "--no-proc") == 0) Modified: head/tools/regression/kqueue/user.c ============================================================================== --- head/tools/regression/kqueue/user.c Tue Dec 15 10:40:40 2009 (r200572) +++ head/tools/regression/kqueue/user.c Tue Dec 15 10:43:20 2009 (r200573) @@ -45,12 +45,15 @@ event_wait(void) test_begin(test_id); + test_no_kevents(); + /* Add the event, and then trigger it */ - kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL); + kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_CLEAR, 0, 0, NULL); kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); kev.fflags &= ~NOTE_FFCTRLMASK; kev.fflags &= ~NOTE_TRIGGER; + kev.flags = EV_CLEAR; kevent_cmp(&kev, kevent_get(kqfd)); test_no_kevents(); @@ -66,6 +69,8 @@ disable_and_enable(void) test_begin(test_id); + test_no_kevents(); + kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL); kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_DISABLE, 0, 0, NULL); @@ -76,7 +81,7 @@ disable_and_enable(void) kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ENABLE, 0, 0, NULL); kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); - kev.flags = 0; + kev.flags = EV_CLEAR; kev.fflags &= ~NOTE_FFCTRLMASK; kev.fflags &= ~NOTE_TRIGGER; kevent_cmp(&kev, kevent_get(kqfd)); @@ -92,26 +97,18 @@ oneshot(void) test_begin(test_id); - kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL); + test_no_kevents(); + + kevent_add(kqfd, &kev, 2, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL); puts(" -- event 1"); - kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); + kevent_add(kqfd, &kev, 2, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); - kev.flags = 0; + kev.flags = EV_ONESHOT; kev.fflags &= ~NOTE_FFCTRLMASK; kev.fflags &= ~NOTE_TRIGGER; kevent_cmp(&kev, kevent_get(kqfd)); - /* Try to trigger the event again. It is deleted, so that - should be an error. However, on FreeBSD 8 it is not an error, - so the event is ignored. - */ - puts(" -- triggering an event that will be ignored"); - kev.flags = 0; - kev.fflags |= NOTE_TRIGGER; - if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) - err(1, "%s", test_id); - test_no_kevents(); success(); From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 10:58:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27873106568F; Tue, 15 Dec 2009 10:58:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 02C618FC17; Tue, 15 Dec 2009 10:58:07 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 8A9EC46B39; Tue, 15 Dec 2009 05:58:06 -0500 (EST) Date: Tue, 15 Dec 2009 10:58:06 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Doug Barton In-Reply-To: <200912150514.nBF5Eej4050810@svn.freebsd.org> Message-ID: References: <200912150514.nBF5Eej4050810@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200563 - in head/etc: mtree namedb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:58:07 -0000 On Tue, 15 Dec 2009, Doug Barton wrote: > The named process needs to have a "working directory" that it can > write to. This is specified in "options { directory }" in named.conf. > So, create /etc/namedb/working with appropriate permissions, and > update the entry in named.conf to match. > > In addition to specifying the working directory, file and path names > in named.conf can be specified relative to the directory listed. > However, since that directory is now different from /etc/namedb > (where the configuration, zone, rndc.*, and other files are located) > further update named.conf to specify all file names with fully > qualified paths. Also update the comment about file and path names > so users know this should be done for all file/path names in the file. > > This change will eliminate the 'working directory is not writable' > messages at boot time without sacrificing security. It will also > allow for features in newer versions of BIND (9.7+) to work as > designed. On a couple of occasions, I've found myself trying to help people get BIND to core dump on a bug, which is a bit tricky in practice. It involves setting appropriate sysctls so that sugid processes generate cores, arranging for a writable core dump directory in the chroot and setting a sysctl so it is found, etc. Does this change simplify that process down to "enable core dump for sugid processes"? If not, are there other things we could do to make this easier? Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 13:29:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2EF11065679; Tue, 15 Dec 2009 13:29:04 +0000 (UTC) (envelope-from pdegoeje@service2media.com) Received: from s2m-is-001.service2media.com (rev-130-102.virtu.nl [217.114.102.130]) by mx1.freebsd.org (Postfix) with ESMTP id 66C4C8FC08; Tue, 15 Dec 2009 13:29:03 +0000 (UTC) Received: from pieter-dev-linux.localnet ([10.0.1.18] RDNS failed) by s2m-is-001.service2media.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 15 Dec 2009 14:16:56 +0100 From: Pieter de Goeje Organization: Service2Media To: svn-src-all@freebsd.org Date: Tue, 15 Dec 2009 14:16:56 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31-16-generic; KDE/4.3.2; i686; ; ) References: <200912141223.nBECNlDZ026381@svn.freebsd.org> <20091214144635.GA91618@onelab2.iet.unipi.it> In-Reply-To: <20091214144635.GA91618@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912151416.56348.pieter@service2media.com> X-OriginalArrivalTime: 15 Dec 2009 13:16:56.0977 (UTC) FILETIME=[E08BE810:01CA7D88] Cc: svn-src-head@freebsd.org, Robert Watson , Luigi Rizzo , src-committers@freebsd.org, Luigi Rizzo Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 13:29:04 -0000 On Monday 14 December 2009 15:46:35 Luigi Rizzo wrote: > On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: > > On Mon, 14 Dec 2009, Luigi Rizzo wrote: > > ... > > > > Together with a smaller patch committed in september, this fixes a > > > bug that affects 8.0 with apps that rely on callouts to fire exactly > > > in the number of ticks specified (qemu among them). > > > Right now, callouts in 8.0 fire one tick late. > > > > > > This was discussed in september with JeffR and jhb > > > > Once this has burned in, is it something you would consider appropriate > > to be an errata note candidate? > > i have no objection, but at the time someone commented that > callouts do not _guarantee_ when they will run so strictly speaking > this is not a bug (i do think that being always a tick late _is_ a bug). As a person running a couple of game servers which rely on nanosleep to get a fixed number of frames per second, I'd say that it is a bug. This might also affect video players which want to show their frames on time. The default HZ of 1000 mitigates the problem somewhat, but on for example a laptop running at HZ=100 the error is noticeable. To illustrate my point, calling usleep(1) 100 times in a loop results in a running time of 3 seconds with kern.hz=100 (measured on 8.x from Dec 9th), which is 3 times as long as one might reasonably expect. This suggests that the callout fires 2 ticks late ... - Pieter de Goeje From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 14:38:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D145106568D; Tue, 15 Dec 2009 14:38:08 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 030408FC08; Tue, 15 Dec 2009 14:38:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFEc719066135; Tue, 15 Dec 2009 14:38:07 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFEc7BV066134; Tue, 15 Dec 2009 14:38:07 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912151438.nBFEc7BV066134@svn.freebsd.org> From: Ollivier Robert Date: Tue, 15 Dec 2009 14:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200575 - head/contrib/ntp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 14:38:08 -0000 Author: roberto Date: Tue Dec 15 14:38:07 2009 New Revision: 200575 URL: http://svn.freebsd.org/changeset/base/200575 Log: Bootstrap mergeinfo (thanks des@). Modified: Directory Properties: head/contrib/ntp/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 14:58:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C9E0106566C; Tue, 15 Dec 2009 14:58:11 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26D018FC15; Tue, 15 Dec 2009 14:58:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFEwBRv066634; Tue, 15 Dec 2009 14:58:11 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFEwBjW066629; Tue, 15 Dec 2009 14:58:11 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912151458.nBFEwBjW066629@svn.freebsd.org> From: Ollivier Robert Date: Tue, 15 Dec 2009 14:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200576 - in head/contrib/ntp: . adjtimed arlib clockstuff html html/build/hints html/drivers include include/isc kernel kernel/sys libntp libopts libparse ntpd ntpdate ntpdc ntpq parse... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 14:58:11 -0000 Author: roberto Date: Tue Dec 15 14:58:10 2009 New Revision: 200576 URL: http://svn.freebsd.org/changeset/base/200576 Log: Merge 4.2.4p8 into contrib (r200452 & r200454). Subversion is being difficult here so take a hammer and get it in. MFC after: 2 weeks Security: CVE-2009-3563 Added: head/contrib/ntp/html/build/hints/solaris.xtra.4095849 - copied unchanged from r200575, vendor/ntp/dist/html/build/hints/solaris.xtra.4095849 Modified: head/contrib/ntp/COPYRIGHT head/contrib/ntp/ChangeLog head/contrib/ntp/CommitLog head/contrib/ntp/Makefile.in head/contrib/ntp/NEWS head/contrib/ntp/README head/contrib/ntp/README.bk head/contrib/ntp/README.patches head/contrib/ntp/WHERE-TO-START head/contrib/ntp/aclocal.m4 head/contrib/ntp/adjtimed/Makefile.in head/contrib/ntp/arlib/Makefile.in head/contrib/ntp/arlib/aclocal.m4 head/contrib/ntp/arlib/configure head/contrib/ntp/build head/contrib/ntp/clockstuff/Makefile.in head/contrib/ntp/config.h.in head/contrib/ntp/configure head/contrib/ntp/configure.ac head/contrib/ntp/flock-build head/contrib/ntp/html/copyright.html head/contrib/ntp/html/drivers/driver40.html head/contrib/ntp/include/Makefile.in head/contrib/ntp/include/copyright.def head/contrib/ntp/include/isc/Makefile.in head/contrib/ntp/include/ntp_debug.h head/contrib/ntp/include/version.def head/contrib/ntp/kernel/Makefile.in head/contrib/ntp/kernel/sys/Makefile.in head/contrib/ntp/libntp/Makefile.in head/contrib/ntp/libopts/Makefile.in head/contrib/ntp/libparse/Makefile.am head/contrib/ntp/libparse/Makefile.in head/contrib/ntp/libparse/clk_rawdcf.c head/contrib/ntp/ntpd/Makefile.in head/contrib/ntp/ntpd/cmd_args.c head/contrib/ntp/ntpd/ntp_crypto.c head/contrib/ntp/ntpd/ntp_intres.c head/contrib/ntp/ntpd/ntp_io.c head/contrib/ntp/ntpd/ntp_request.c head/contrib/ntp/ntpd/ntp_timer.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd-opts.texi head/contrib/ntp/ntpd/ntpd.1 head/contrib/ntp/ntpd/ntpd.c head/contrib/ntp/ntpd/ntpdsim-opts.c head/contrib/ntp/ntpd/ntpdsim-opts.h head/contrib/ntp/ntpd/ntpdsim-opts.texi head/contrib/ntp/ntpd/ntpdsim.1 head/contrib/ntp/ntpd/refclock_dumbclock.c head/contrib/ntp/ntpd/refclock_hopfser.c head/contrib/ntp/ntpd/refclock_jjy.c head/contrib/ntp/ntpd/refclock_nmea.c head/contrib/ntp/ntpd/refclock_palisade.c head/contrib/ntp/ntpdate/Makefile.in head/contrib/ntp/ntpdc/Makefile.in head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc-opts.texi head/contrib/ntp/ntpdc/ntpdc.1 head/contrib/ntp/ntpq/Makefile.in head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq-opts.texi head/contrib/ntp/ntpq/ntpq.1 head/contrib/ntp/ntpq/ntpq.c head/contrib/ntp/packageinfo.sh head/contrib/ntp/parseutil/Makefile.in head/contrib/ntp/scripts/Makefile.in head/contrib/ntp/sntp/Makefile.in head/contrib/ntp/sntp/aclocal.m4 head/contrib/ntp/sntp/config.h.in head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/configure.ac head/contrib/ntp/sntp/libopts/Makefile.in head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.def head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp-opts.texi head/contrib/ntp/sntp/sntp.1 head/contrib/ntp/sntp/version.def head/contrib/ntp/util/Makefile.in head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen-opts.texi head/contrib/ntp/util/ntp-keygen.1 head/contrib/ntp/version head/contrib/ntp/version.m4 Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/COPYRIGHT ============================================================================== --- head/contrib/ntp/COPYRIGHT Tue Dec 15 14:38:07 2009 (r200575) +++ head/contrib/ntp/COPYRIGHT Tue Dec 15 14:58:10 2009 (r200576) @@ -13,7 +13,7 @@ This file is automatically generated fro applies as if the text was explicitly included in the file. *********************************************************************** * * -* Copyright (c) David L. Mills 1992-2008 * +* Copyright (c) David L. Mills 1992-2009 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose with or without fee is hereby * Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Tue Dec 15 14:38:07 2009 (r200575) +++ head/contrib/ntp/ChangeLog Tue Dec 15 14:58:10 2009 (r200576) @@ -1,6 +1,85 @@ -(4.2.4p5) 2008/08/17 Released by Harlan Stenn --- -(4.2.4p5) 2008/08/17 Released by Harlan Stenn +(4.2.4p8) 2009/12/08 Released by Harlan Stenn + +* [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. + +--- +(4.2.4p7) 2009/05/18 Released by Harlan Stenn + +* [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252. +* [Bug 1187] Update the copyright date. +* [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. + +--- +(4.2.4p7-RC7) 2009/05/12 Released by Harlan Stenn + +* ntp.isc.org -> ntp.org cleanup. +* [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime, + add configure --enable-ignore-dns-errors to be even more stubborn + +--- +(4.2.4p7-RC6) 2009/05/08 Released by Harlan Stenn + +* [Bug 784] Make --enable-linuxcaps the default when available +* [Bug 1179] error messages for -u/--user and -i lacking droproot +* Updated JJY reference clock driver from Takao Abe +* [Bug 1071] Log a message and exit before trying to use FD_SET with a + descriptor larger than FD_SETSIZE, which will corrupt memory +* On corruption of the iface list head in add_interface, log and exit + +--- +(4.2.4p7-RC5) 2009/05/02 Released by Harlan Stenn + +* [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux. +* flock-build script unportable 'set -m' use removed + +--- +(4.2.4p7-RC4) 2009/04/29 Released by Harlan Stenn + +* [Bug 1167] use gcc -Winit-self only if it is understood + +--- +(4.2.4p7-RC3) 2009/04/22 Released by Harlan Stenn + +* [Bug 787] Bug fixes for 64-bit time_t on Windows +* [Bug 813] Conditional naming of Event +* [Bug 1147] System errors should be logged to msyslog() +* [Bug 1155] Fix compile problem on Windows with VS2005 +* [Bug 1156] lock_thread_to_processor() should be declared in header +* [Bug 1157] quiet OpenSSL warnings, clean up configure.ac +* [Bug 1158] support for aix6.1 +* [Bug 1160] MacOS X is like BSD regarding F_SETOWN + +--- +(4.2.4p7-RC2) 2009/04/09 Released by Harlan Stenn + +* [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159 +* [Sec 1149] use SO_EXCLUSIVEADDRUSE on Windows + +--- +(4.2.4p7-RC1) 2009/03/30 Released by Harlan Stenn + +* [Bug 1131] UDP sockets should not use SIGPOLL on Solaris. +* build system email address cleanup +* [Bug 774] parsesolaris.c does not compile under the new Solaris +* [Bug 873] Windows serial refclock proper TTY line discipline emulation +* [Bug 1014] Enable building with VC9 (in Visual Studio 2008, + Visual C++ 2008, or SDK) +* [Bug 1117] Deferred interface binding under Windows works only correctly + if FORCE_DNSRETRY is defined +* [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU +* DPRINTF macro made safer, always evaluates to a statement and will not + misassociate an else which follows the macro. + +--- +(4.2.4p6) 2009/01/08 Released by Harlan Stenn + +* [Bug 1113] Fixed build errors with recent versions of openSSL. +* [Sec 1111] Fix incorrect check of EVP_VerifyFinal()'s return value. +* Update the copyright year. + +--- (4.2.4p5) 2008/08/17 Released by Harlan Stenn * [BUG 1051] Month off by one in leap second message written to clockstats Modified: head/contrib/ntp/CommitLog ============================================================================== --- head/contrib/ntp/CommitLog Tue Dec 15 14:38:07 2009 (r200575) +++ head/contrib/ntp/CommitLog Tue Dec 15 14:58:10 2009 (r200576) @@ -1,1772 +1,3496 @@ -ChangeSet@1.1541, 2008-08-17 05:30:47-04:00, stenn@whimsy.udel.edu +26 -0 - NTP_4_2_4P5 - TAG: NTP_4_2_4P5 +ChangeSet@1.1612, 2009-12-08 08:30:54-05:00, stenn@whimsy.udel.edu +1 -0 + ChangeLog: + typo - ChangeLog@1.44, 2008-08-17 05:30:27-04:00, stenn@whimsy.udel.edu +3 -0 - NTP_4_2_4P5 + ChangeLog@1.95, 2009-12-08 08:30:44-05:00, stenn@whimsy.udel.edu +0 -1 + typo - ntpd/ntpd-opts.c@1.74, 2008-08-17 05:30:28-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 +ChangeSet@1.1611, 2009-12-08 08:23:12-05:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P8 + TAG: NTP_4_2_4P8 - ntpd/ntpd-opts.h@1.74, 2008-08-17 05:30:28-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ChangeLog@1.94, 2009-12-08 08:23:01-05:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P8 - ntpd/ntpd-opts.texi@1.73, 2008-08-17 05:30:29-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpd/ntpd-opts.c@1.86, 2009-12-08 08:23:02-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpd.1@1.72, 2008-08-17 05:30:30-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpd-opts.h@1.86, 2009-12-08 08:23:02-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.c@1.74, 2008-08-17 05:30:30-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpd-opts.texi@1.85, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.h@1.74, 2008-08-17 05:30:31-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpd/ntpd.1@1.84, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.texi@1.72, 2008-08-17 05:30:32-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.c@1.86, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpdsim.1@1.72, 2008-08-17 05:30:33-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.h@1.86, 2009-12-08 08:23:04-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.c@1.74, 2008-08-17 05:30:33-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.texi@1.84, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.h@1.74, 2008-08-17 05:30:34-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpd/ntpdsim.1@1.84, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.texi@1.72, 2008-08-17 05:30:34-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.c@1.86, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpdc/ntpdc.1@1.72, 2008-08-17 05:30:35-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.h@1.86, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpq/ntpq-opts.c@1.76, 2008-08-17 05:30:35-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.texi@1.84, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpq/ntpq-opts.h@1.76, 2008-08-17 05:30:36-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpdc/ntpdc.1@1.84, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpq/ntpq-opts.texi@1.73, 2008-08-17 05:30:36-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpq/ntpq-opts.c@1.88, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpq/ntpq.1@1.72, 2008-08-17 05:30:37-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq-opts.h@1.88, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - packageinfo.sh@1.101, 2008-08-17 05:30:37-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq-opts.texi@1.85, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - sntp/sntp-opts.c@1.72, 2008-08-17 05:30:38-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq.1@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - sntp/sntp-opts.h@1.72, 2008-08-17 05:30:39-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + packageinfo.sh@1.118, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P8 - sntp/sntp-opts.texi@1.69, 2008-08-17 05:30:39-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + sntp/sntp-opts.c@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - sntp/sntp.1@1.72, 2008-08-17 05:30:40-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + sntp/sntp-opts.h@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - util/ntp-keygen-opts.c@1.73, 2008-08-17 05:30:40-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + sntp/sntp-opts.texi@1.81, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - util/ntp-keygen-opts.h@1.73, 2008-08-17 05:30:41-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + sntp/sntp.1@1.84, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - util/ntp-keygen-opts.texi@1.71, 2008-08-17 05:30:42-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + util/ntp-keygen-opts.c@1.85, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - util/ntp-keygen.1@1.71, 2008-08-17 05:30:42-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + util/ntp-keygen-opts.h@1.85, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 -ChangeSet@1.1540, 2008-08-17 05:29:47-04:00, stenn@whimsy.udel.edu +1 -0 - typo + util/ntp-keygen-opts.texi@1.83, 2009-12-08 08:23:09-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - scripts/addChangeLogTag@1.2, 2008-08-17 05:29:37-04:00, stenn@whimsy.udel.edu +1 -1 - typo + util/ntp-keygen.1@1.83, 2009-12-08 08:23:09-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 -ChangeSet@1.1539, 2008-08-17 03:28:53-04:00, stenn@whimsy.udel.edu +5 -0 - 4.2.4p5 prep +ChangeSet@1.1610, 2009-12-08 07:45:28-05:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P9_RC1 + TAG: NTP_4_2_4P9_RC1 - .point-changed-filelist@1.2, 2008-08-17 03:27:42-04:00, stenn@whimsy.udel.edu +1 -0 - 4.2.4p5 prep + ChangeLog@1.93, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P9_RC1 - NEWS@1.99, 2008-08-17 03:27:42-04:00, stenn@whimsy.udel.edu +17 -0 - 4.2.4p5 prep + ntpd/ntpd-opts.c@1.85, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - packageinfo.sh@1.100, 2008-08-17 03:27:43-04:00, stenn@whimsy.udel.edu +1 -1 - 4.2.4p5 prep + ntpd/ntpd-opts.h@1.85, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - scripts/addChangeLogTag@1.1, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +27 -0 - BitKeeper file /deacon/backroom/ntp-stable/scripts/addChangeLogTag + ntpd/ntpd-opts.texi@1.84, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +13 -6 + NTP_4_2_4P9_RC1 - scripts/addChangeLogTag@1.0, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +0 -0 + ntpd/ntpd.1@1.83, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - scripts/genChangeLogTag@1.1, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +6 -0 - BitKeeper file /deacon/backroom/ntp-stable/scripts/genChangeLogTag + ntpd/ntpdsim-opts.c@1.85, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - scripts/genChangeLogTag@1.0, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +0 -0 + ntpd/ntpdsim-opts.h@1.85, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 -ChangeSet@1.1538, 2008-08-16 22:42:08-04:00, stenn@whimsy.udel.edu +2 -0 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpd/ntpdsim-opts.texi@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +61 -2 + NTP_4_2_4P9_RC1 - ChangeLog@1.43, 2008-08-16 22:41:50-04:00, stenn@whimsy.udel.edu +2 -0 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpd/ntpdsim.1@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/refclock_oncore.c@1.63, 2008-08-16 22:41:50-04:00, stenn@whimsy.udel.edu +1 -1 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpdc/ntpdc-opts.c@1.85, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 -ChangeSet@1.1537, 2008-08-10 07:44:31-04:00, stenn@whimsy.udel.edu +25 -0 - NTP_4_2_4P5_RC2 - TAG: NTP_4_2_4P5_RC2 + ntpdc/ntpdc-opts.h@1.85, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.c@1.73, 2008-08-10 07:44:09-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpdc/ntpdc-opts.texi@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +7 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.h@1.73, 2008-08-10 07:44:09-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpdc/ntpdc.1@1.83, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.texi@1.72, 2008-08-10 07:44:10-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.c@1.87, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpd/ntpd.1@1.71, 2008-08-10 07:44:10-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.h@1.87, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.c@1.73, 2008-08-10 07:44:11-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.texi@1.84, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +8 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.h@1.73, 2008-08-10 07:44:12-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpq/ntpq.1@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.texi@1.71, 2008-08-10 07:44:12-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + packageinfo.sh@1.117, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim.1@1.71, 2008-08-10 07:44:13-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.c@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.c@1.73, 2008-08-10 07:44:14-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.h@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.h@1.73, 2008-08-10 07:44:15-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.texi@1.80, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +54 -2 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.texi@1.71, 2008-08-10 07:44:16-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + sntp/sntp.1@1.83, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc.1@1.71, 2008-08-10 07:44:17-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.c@1.84, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.c@1.75, 2008-08-10 07:44:17-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.h@1.84, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.h@1.75, 2008-08-10 07:44:18-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.texi@1.82, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.texi@1.72, 2008-08-10 07:44:19-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + util/ntp-keygen.1@1.82, 2009-12-08 07:45:25-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpq/ntpq.1@1.71, 2008-08-10 07:44:20-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 +ChangeSet@1.1609, 2009-12-08 05:36:47-05:00, stenn@whimsy.udel.edu +2 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - packageinfo.sh@1.99, 2008-08-10 07:44:20-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + NEWS@1.102, 2009-12-08 05:36:36-05:00, stenn@whimsy.udel.edu +34 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - sntp/sntp-opts.c@1.71, 2008-08-10 07:44:22-04:00, stenn@whimsy.udel.edu +4 -5 - NTP_4_2_4P5_RC2 + packageinfo.sh@1.116, 2009-12-08 05:36:36-05:00, stenn@whimsy.udel.edu +2 -2 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - sntp/sntp-opts.h@1.71, 2008-08-10 07:44:23-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC2 +ChangeSet@1.1608, 2009-10-07 01:33:22+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - sntp/sntp-opts.texi@1.68, 2008-08-10 07:44:23-04:00, stenn@whimsy.udel.edu +2 -3 - NTP_4_2_4P5_RC2 + ChangeLog@1.92, 2009-10-07 01:33:21+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - sntp/sntp.1@1.71, 2008-08-10 07:44:24-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpd/ntp_request.c@1.68, 2009-10-07 01:33:21+00:00, davehart@shiny.ad.hartbrothers.com +9 -2 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - util/ntp-keygen-opts.c@1.72, 2008-08-10 07:44:25-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 +ChangeSet@1.1607, 2009-05-18 05:04:41-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7 + TAG: NTP_4_2_4P7 - util/ntp-keygen-opts.h@1.72, 2008-08-10 07:44:25-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ChangeLog@1.91, 2009-05-18 05:04:18-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7 - util/ntp-keygen-opts.texi@1.70, 2008-08-10 07:44:27-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + ntpd/ntpd-opts.c@1.84, 2009-05-18 05:04:19-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - util/ntp-keygen.1@1.70, 2008-08-10 07:44:27-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpd/ntpd-opts.h@1.84, 2009-05-18 05:04:20-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 -ChangeSet@1.1531.3.1, 2008-08-10 02:22:22-04:00, stenn@whimsy.udel.edu +1 -0 - triggert needs to handle rooted RESYNC paths now + ntpd/ntpd-opts.texi@1.83, 2009-05-18 05:04:21-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - BitKeeper/triggers/triggert@1.5, 2008-08-10 02:22:11-04:00, stenn@whimsy.udel.edu +3 -2 - triggert needs to handle rooted RESYNC paths now + ntpd/ntpd.1@1.82, 2009-05-18 05:04:22-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 -ChangeSet@1.1534, 2008-08-09 20:05:06-04:00, stenn@whimsy.udel.edu +2 -0 - AutoGen'd files must be writable + ntpd/ntpdsim-opts.c@1.84, 2009-05-18 05:04:22-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - sntp/Makefile.am@1.23, 2008-08-09 20:04:56-04:00, stenn@whimsy.udel.edu +2 -2 - AutoGen'd files must be writable + ntpd/ntpdsim-opts.h@1.84, 2009-05-18 05:04:23-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - sntp/sntp-opts.menu@1.3, 2008-08-09 20:04:10-04:00, stenn@whimsy.udel.edu +0 -0 - Change mode to -rw-rw-r-- + ntpd/ntpdsim-opts.texi@1.82, 2009-05-18 05:04:24-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1531.2.1, 2008-08-07 20:44:31+02:00, burnicki@pogo.udel.edu +3 -0 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpd/ntpdsim.1@1.82, 2009-05-18 05:04:25-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ChangeLog@1.39.2.1, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +2 -0 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.c@1.84, 2009-05-18 05:04:26-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpd/ntp_peer.c@1.99.1.1, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +10 -2 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.h@1.84, 2009-05-18 05:04:26-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ports/winnt/ntpd/ntservice.c@1.11, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +8 -1 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.texi@1.82, 2009-05-18 05:04:27-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1531.1.2, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu +1 -0 - Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. + ntpdc/ntpdc.1@1.82, 2009-05-18 05:04:28-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ports/winnt/ntpd/ntp_iocompletionport.c@1.26, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu +0 -8 - Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. + ntpq/ntpq-opts.c@1.86, 2009-05-18 05:04:29-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 -ChangeSet@1.1531.1.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +10 -0 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + ntpq/ntpq-opts.h@1.86, 2009-05-18 05:04:29-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ChangeLog@1.39.1.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +3 -0 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + ntpq/ntpq-opts.texi@1.83, 2009-05-18 05:04:30-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - html/confopt.html@1.36, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -2 - Bug 841: Obsolete the "dynamic" keyword. + ntpq/ntpq.1@1.82, 2009-05-18 05:04:31-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - html/ntpdc.html@1.27, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +2 -3 - Bug 841: Obsolete the "dynamic" keyword. + packageinfo.sh@1.115, 2009-05-18 05:04:32-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - include/ntp.h@1.129, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -1 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp-opts.c@1.82, 2009-05-18 05:04:32-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - include/ntp_request.h@1.31, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -1 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp-opts.h@1.82, 2009-05-18 05:04:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7 - ntpd/ntp_config.c@1.144, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +4 -2 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + sntp/sntp-opts.texi@1.79, 2009-05-18 05:04:34-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - ntpd/ntp_intres.c@1.52, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +1 -3 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp.1@1.82, 2009-05-18 05:04:34-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ntpd/ntp_peer.c@1.100, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +5 -25 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. + util/ntp-keygen-opts.c@1.83, 2009-05-18 05:04:35-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpd/ntp_request.c@1.66, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +1 -3 - Bug 841: Obsolete the "dynamic" keyword. + util/ntp-keygen-opts.h@1.83, 2009-05-18 05:04:36-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpdc/ntpdc_ops.c@1.50, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +3 -3 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. + util/ntp-keygen-opts.texi@1.81, 2009-05-18 05:04:37-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1532, 2008-07-22 11:41:26+02:00, burnicki@pogo.udel.edu +2 -0 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. + util/ntp-keygen.1@1.81, 2009-05-18 05:04:37-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ChangeLog@1.40, 2008-07-22 11:41:25+02:00, burnicki@pogo.udel.edu +1 -0 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. +ChangeSet@1.1606, 2009-05-18 03:14:59-04:00, stenn@whimsy.udel.edu +2 -0 + 4.2.4p7 - libntp/machines.c@1.19, 2008-07-22 11:41:25+02:00, burnicki@pogo.udel.edu +2 -2 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. + NEWS@1.101, 2009-05-18 03:14:49-04:00, stenn@whimsy.udel.edu +38 -0 + 4.2.4p7 -ChangeSet@1.1531, 2008-05-20 03:51:01-04:00, stenn@whimsy.udel.edu +25 -0 - NTP_4_2_4P5_RC1 - TAG: NTP_4_2_4P5_RC1 + packageinfo.sh@1.114, 2009-05-18 03:14:50-04:00, stenn@whimsy.udel.edu +1 -1 + 4.2.4p7 - ntpd/ntpd-opts.c@1.72, 2008-05-20 03:50:37-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 +ChangeSet@1.1605, 2009-05-18 02:56:36-04:00, stenn@whimsy.udel.edu +2 -0 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd-opts.h@1.72, 2008-05-20 03:50:37-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.90, 2009-05-18 02:56:22-04:00, stenn@whimsy.udel.edu +1 -0 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd-opts.texi@1.71, 2008-05-20 03:50:38-04:00, stenn@whimsy.udel.edu +8 -11 - NTP_4_2_4P5_RC1 + ntpd/ntp_crypto.c@1.110, 2009-05-18 02:56:22-04:00, stenn@whimsy.udel.edu +22 -17 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd.1@1.70, 2008-05-20 03:50:39-04:00, stenn@whimsy.udel.edu +4 -4 - NTP_4_2_4P5_RC1 +ChangeSet@1.1604, 2009-05-18 02:24:31-04:00, stenn@whimsy.udel.edu +2 -0 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.c@1.72, 2008-05-20 03:50:40-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.89, 2009-05-18 02:24:21-04:00, stenn@whimsy.udel.edu +1 -0 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.h@1.72, 2008-05-20 03:50:41-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + include/copyright.def@1.8, 2009-05-18 02:24:22-04:00, stenn@whimsy.udel.edu +1 -1 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.texi@1.70, 2008-05-20 03:50:42-04:00, stenn@whimsy.udel.edu +3 -4 - NTP_4_2_4P5_RC1 +ChangeSet@1.1603, 2009-05-17 08:59:06+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpd/ntpdsim.1@1.70, 2008-05-20 03:50:43-04:00, stenn@whimsy.udel.edu +4 -4 - NTP_4_2_4P5_RC1 + ChangeLog@1.88, 2009-05-17 08:59:05+00:00, davehart@shiny.ad.hartbrothers.com +5 -0 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpdc/ntpdc-opts.c@1.72, 2008-05-20 03:50:44-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpd/ntp_io.c@1.261, 2009-05-17 08:59:05+00:00, davehart@shiny.ad.hartbrothers.com +45 -34 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpdc/ntpdc-opts.h@1.72, 2008-05-20 03:50:44-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 +ChangeSet@1.1602, 2009-05-14 04:42:10+00:00, davehart@shiny.ad.hartbrothers.com +1 -0 + fix error from BitKeeper/triggers/pre-resolve.licfix triggered (ahem) + by recent BitKeeper/etc/config delta updating repologs email address - ntpdc/ntpdc-opts.texi@1.70, 2008-05-20 03:50:45-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC1 + BitKeeper/triggers/pre-resolve.licfix@1.5, 2009-05-14 04:42:09+00:00, davehart@shiny.ad.hartbrothers.com +4 -1 + bk sccscat has been removed, replaced by bk annotate -R + -q grep -> grep -q (untested until recent BitKeeper/etc/config commit + changing repologs@ntp.isc.org to repologs@ntp.org - ntpdc/ntpdc.1@1.70, 2008-05-20 03:50:46-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 +ChangeSet@1.1601, 2009-05-12 02:41:56-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7_RC7 + TAG: NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.c@1.74, 2008-05-20 03:50:47-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.87, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.h@1.74, 2008-05-20 03:50:47-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.c@1.83, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.texi@1.71, 2008-05-20 03:50:48-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.h@1.83, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpq/ntpq.1@1.70, 2008-05-20 03:50:49-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.texi@1.82, 2009-05-12 02:41:35-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - packageinfo.sh@1.98, 2008-05-20 03:50:50-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpd.1@1.81, 2009-05-12 02:41:35-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.c@1.70, 2008-05-20 03:50:51-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.c@1.83, 2009-05-12 02:41:36-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.h@1.70, 2008-05-20 03:50:52-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.h@1.83, 2009-05-12 02:41:37-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.texi@1.67, 2008-05-20 03:50:52-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.texi@1.81, 2009-05-12 02:41:37-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - sntp/sntp.1@1.70, 2008-05-20 03:50:53-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim.1@1.81, 2009-05-12 02:41:38-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.c@1.71, 2008-05-20 03:50:54-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.c@1.83, 2009-05-12 02:41:39-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.h@1.71, 2008-05-20 03:50:54-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.h@1.83, 2009-05-12 02:41:40-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.texi@1.69, 2008-05-20 03:50:55-04:00, stenn@whimsy.udel.edu +7 -9 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.texi@1.81, 2009-05-12 02:41:41-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - util/ntp-keygen.1@1.69, 2008-05-20 03:50:56-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc.1@1.81, 2009-05-12 02:41:42-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1530, 2008-05-18 05:14:37-04:00, stenn@whimsy.udel.edu +1 -0 - Start the 4.2.4p5 release candidate cycle + ntpq/ntpq-opts.c@1.85, 2009-05-12 02:41:43-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - packageinfo.sh@1.97, 2008-05-18 05:14:27-04:00, stenn@whimsy.udel.edu +1 -1 - Start the 4.2.4p5 release candidate cycle + ntpq/ntpq-opts.h@1.85, 2009-05-12 02:41:44-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1529, 2008-04-11 18:41:57-04:00, stenn@whimsy.udel.edu +1 -0 - Solaris _XOPEN_SOURCE updates + ntpq/ntpq-opts.texi@1.82, 2009-05-12 02:41:45-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - configure.ac@1.401, 2008-04-11 18:41:47-04:00, stenn@whimsy.udel.edu +5 -1 - Solaris _XOPEN_SOURCE updates + ntpq/ntpq.1@1.81, 2009-05-12 02:41:46-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.3, 2008-04-10 02:09:52-04:00, stenn@pogo.udel.edu +1 -0 - Changelog cleanup + packageinfo.sh@1.113, 2009-05-12 02:41:47-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - ChangeLog@1.37.1.2, 2008-04-10 02:08:57-04:00, stenn@pogo.udel.edu +2 -1 + sntp/sntp-opts.c@1.81, 2009-05-12 02:41:47-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.2, 2008-04-08 12:20:22+02:00, burnicki@pogo.udel.edu +1 -0 - Always sleep a little before calling doconfigure() to make sure the network is completely up. + sntp/sntp-opts.h@1.81, 2009-05-12 02:41:48-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_intres.c@1.51, 2008-04-08 12:20:21+02:00, burnicki@pogo.udel.edu +5 -6 - Always sleep a little before calling doconfigure() to make sure the network is completely up. + sntp/sntp-opts.texi@1.78, 2009-05-12 02:41:49-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.1, 2008-04-03 10:19:03-04:00, burnicki@pogo.udel.edu +5 -0 - [Bug 987] Wake up the resolver thread/process when a new interface has become available. + sntp/sntp.1@1.81, 2009-05-12 02:41:50-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ChangeLog@1.37.1.1, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +1 -0 - [Bug 987] Wake up the resolver thread/process when a new interface has become available. + util/ntp-keygen-opts.c@1.82, 2009-05-12 02:41:51-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - include/ntpd.h@1.98, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +5 -0 - Added vars used to wake up the resolver process/thread. + util/ntp-keygen-opts.h@1.82, 2009-05-12 02:41:51-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_config.c@1.143, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +34 -1 - Initialize synchronization variables when the resolver process/thread is started. + util/ntp-keygen-opts.texi@1.80, 2009-05-12 02:41:52-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - ntpd/ntp_intres.c@1.50, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +64 -65 - Enable the resolver to be woken up when a new interface has become available. + util/ntp-keygen.1@1.80, 2009-05-12 02:41:53-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_io.c@1.256, 2008-04-03 10:19:00-04:00, burnicki@pogo.udel.edu +25 -5 - Wake up the resolver thread/process when a new interface has become available. +ChangeSet@1.1600, 2009-05-12 01:07:37-04:00, stenn@whimsy.udel.edu +9 -0 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1527, 2008-03-24 22:12:42-04:00, mayer@pogo.udel.edu +1 -0 - bugs 993 a d 959 + BitKeeper/etc/config@1.10, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ChangeLog@1.38, 2008-03-24 22:12:26-04:00, mayer@pogo.udel.edu +2 -0 - bugs 993 a d 959 + ChangeLog@1.86, 2009-05-12 01:06:01-04:00, stenn@whimsy.udel.edu +1 -0 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1526, 2008-03-24 21:41:55-04:00, mayer@pogo.udel.edu +1 -0 - [Bug 959] Refclock on Windows not properly releasing recvbuffs + README@1.23, 2009-05-12 01:06:02-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ports/winnt/ntpd/ntp_iocompletionport.c@1.25, 2008-03-24 21:41:37-04:00, mayer@pogo.udel.edu +25 -13 - [Bug 959] Refclock on Windows not properly releasing recvbuffs + README.bk@1.19, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1525, 2008-03-24 21:40:32-04:00, mayer@pogo.udel.edu +1 -0 - [Bug 993] Windows: Fix memory leak when fetching system messages + README.patches@1.4, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ports/winnt/libisc/isc_strerror.c@1.5, 2008-03-24 21:40:07-04:00, mayer@pogo.udel.edu +78 -18 - [Bug 993] Windows: Fix memory leak when fetching system messages + WHERE-TO-START@1.7, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1520.3.5, 2008-03-22 02:12:10-05:00, stenn@whimsy.udel.edu +2 -0 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + configure.ac@1.418, 2009-05-12 01:06:04-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ChangeLog@1.35.3.4, 2008-03-22 02:11:57-05:00, stenn@whimsy.udel.edu +1 -0 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + include/copyright.def@1.7, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - libisc/net.c@1.9, 2008-03-22 02:11:58-05:00, stenn@whimsy.udel.edu +1 -1 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + sntp/sntp-opts.def@1.11, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1520.3.4, 2008-03-22 02:02:36-05:00, stenn@whimsy.udel.edu +3 -0 - Update the copyright year +ChangeSet@1.1597.1.1, 2009-05-08 18:11:36+00:00, davehart@shiny.ad.hartbrothers.com +1 -0 + configure.ac: + correct help text - ChangeLog@1.35.3.3, 2008-03-22 02:02:24-05:00, stenn@whimsy.udel.edu +8 -6 - Update the copyright year + configure.ac@1.415.1.1, 2009-05-08 18:11:24+00:00, davehart@shiny.ad.hartbrothers.com +11 -5 + correct help text - html/copyright.html@1.37, 2008-03-22 02:02:25-05:00, stenn@whimsy.udel.edu +1 -1 - Update the copyright year +ChangeSet@1.1598, 2009-05-08 17:50:37+00:00, davehart@shiny.ad.hartbrothers.com +3 -0 + add configure --enable-ignore-dns-errors to retry on any failure - include/copyright.def@1.6, 2008-03-22 02:02:25-05:00, stenn@whimsy.udel.edu +1 -1 - Update the copyright year + ChangeLog@1.85, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +2 -1 + add configure --enable-ignore-dns-errors to retry on any failure -ChangeSet@1.1520.3.3, 2008-03-22 01:58:52-05:00, stenn@whimsy.udel.edu +5 -0 - Make autogen-generated files writable + configure.ac@1.416, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +26 -4 + add configure --enable-ignore-dns-errors to retry on any failure - ntpd/Makefile.am@1.54, 2008-03-22 01:57:08-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_intres.c@1.55, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + add configure --enable-ignore-dns-errors to retry on any failure - ntpdc/Makefile.am@1.35, 2008-03-22 01:57:09-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable +ChangeSet@1.1597, 2009-05-08 15:34:46+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + Do not exceed FD_SETSIZE in ntp_intres.c + --- + ntp_intres.c: + typo + --- + ntp_intres.c: + missing comma typo + --- + ntp_intres.c: + typo - ntpq/Makefile.am@1.27, 2008-03-22 01:57:10-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_intres.c@1.54, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +64 -33 + fix typos, refine "host name not found" log message, stay under FD_SETSIZE - sntp/Makefile.am@1.22, 2008-03-22 01:57:11-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_request.c@1.67, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +21 -3 + after ntp_intres adds a server entry, rescan interfaces, to notice the + return of connectivity sooner. - util/Makefile.am@1.36, 2008-03-22 01:57:11-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_timer.c@1.34, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +3 -5 + indent cleanup -ChangeSet@1.1520.4.1, 2008-03-16 09:15:13-04:00, burnicki@pogo.udel.edu +2 -0 - [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. + ports/winnt/include/config.h@1.52, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +4 -10 + remove FORCE_DNSRETRY, no longer used + indent cleanup - ChangeLog@1.35.4.1, 2008-03-16 09:15:10-04:00, burnicki@pogo.udel.edu +3 -0 - [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. +ChangeSet@1.1587.1.1, 2009-05-08 11:24:43+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime - ports/winnt/ntpd/ntservice.c@1.10, 2008-03-16 09:15:11-04:00, burnicki@pogo.udel.edu +11 -2 - [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. + ChangeLog@1.76.1.1, 2009-05-08 11:24:42+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime -ChangeSet@1.1520.3.1, 2008-03-03 11:50:50+01:00, martin@pc-martin.py.meinberg.de +2 -0 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). + ntpd/ntp_intres.c@1.53, 2009-05-08 11:24:42+00:00, davehart@shiny.ad.hartbrothers.com +53 -55 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime - ChangeLog@1.35.3.1, 2008-03-03 11:50:49+01:00, martin@pc-martin.py.meinberg.de +10 -0 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). +ChangeSet@1.1595, 2009-05-08 04:42:52-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7_RC6 + TAG: NTP_4_2_4P7_RC6 - ntpdate/ntpdate.c@1.62, 2008-03-03 11:50:49+01:00, martin@pc-martin.py.meinberg.de +101 -82 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). + ChangeLog@1.83, 2009-05-08 04:42:28-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.7, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +2 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.c@1.82, 2009-05-08 04:42:28-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - ChangeLog@1.35.2.3, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +1 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.h@1.82, 2009-05-08 04:42:29-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ports/winnt/include/config.h@1.47, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +2 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.texi@1.81, 2009-05-08 04:42:30-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.6, 2008-02-19 11:08:55-05:00, burnicki@pogo.udel.edu +1 -0 - Fixed indentation. + ntpd/ntpd.1@1.80, 2009-05-08 04:42:30-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - ntpd/ntp_io.c@1.255, 2008-02-19 11:08:52-05:00, burnicki@pogo.udel.edu +1 -1 - Fixed indentation. + ntpd/ntpdsim-opts.c@1.82, 2009-05-08 04:42:31-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.5, 2008-02-18 09:30:34-05:00, burnicki@pogo.udel.edu +1 -0 - Use new get_free_recv_buffer_alloc(). + ntpd/ntpdsim-opts.h@1.82, 2009-05-08 04:42:32-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ports/winnt/ntpd/ntp_iocompletionport.c@1.24, 2008-02-18 09:30:31-05:00, burnicki@pogo.udel.edu +4 -4 - Use new get_free_recv_buffer_alloc(). + ntpd/ntpdsim-opts.texi@1.80, 2009-05-08 04:42:33-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.4, 2008-02-17 17:48:29+00:00, kardel@pogo.udel.edu +1 -0 - recvbuff.c: - Bug 1000: add some pico optimizations + ntpd/ntpdsim.1@1.80, 2009-05-08 04:42:34-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - libntp/recvbuff.c@1.29, 2008-02-17 17:42:21+00:00, kardel@pogo.udel.edu +5 -8 - Bug 1000: add some pico optimizations + ntpdc/ntpdc-opts.c@1.82, 2009-05-08 04:42:35-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.3, 2008-02-17 08:38:07+00:00, kardel@pogo.udel.edu +2 -0 - ntpd.c: - Bug 1000: avoid timer() starvation during high load conditions - ChangeLog: - Bug 1000: additionally fix timer() starvation during high load + ntpdc/ntpdc-opts.h@1.82, 2009-05-08 04:42:35-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ChangeLog@1.35.2.2, 2008-02-17 08:37:20+00:00, kardel@pogo.udel.edu +1 -0 - Bug 1000: additionally fix timer() starvation during high load + ntpdc/ntpdc-opts.texi@1.80, 2009-05-08 04:42:36-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 14:59:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87A3106566C; Tue, 15 Dec 2009 14:59:58 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A751E8FC14; Tue, 15 Dec 2009 14:59:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFExwD1066720; Tue, 15 Dec 2009 14:59:58 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFExwN7066718; Tue, 15 Dec 2009 14:59:58 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912151459.nBFExwN7066718@svn.freebsd.org> From: Ollivier Robert Date: Tue, 15 Dec 2009 14:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200577 - in head/usr.sbin/ntp: . ntptrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 14:59:58 -0000 Author: roberto Date: Tue Dec 15 14:59:58 2009 New Revision: 200577 URL: http://svn.freebsd.org/changeset/base/200577 Log: ntpd 4.2.4p8 is now in the tree, ntptrace is dead RIP. Security: CVE-2009-3563 Deleted: head/usr.sbin/ntp/ntptrace/Makefile Modified: head/usr.sbin/ntp/Makefile Modified: head/usr.sbin/ntp/Makefile ============================================================================== --- head/usr.sbin/ntp/Makefile Tue Dec 15 14:58:10 2009 (r200576) +++ head/usr.sbin/ntp/Makefile Tue Dec 15 14:59:58 2009 (r200577) @@ -1,7 +1,7 @@ # Makefile for ntpd. # $FreeBSD$ -SUBDIR= libopts libntp libparse ntpd ntpdc ntpq ntpdate ntptrace \ +SUBDIR= libopts libntp libparse ntpd ntpdc ntpq ntpdate \ ntptime ntp-keygen sntp SUBDIR+= doc From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 15:46:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29BE11065693; Tue, 15 Dec 2009 15:46:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id ACB3D8FC08; Tue, 15 Dec 2009 15:46:11 +0000 (UTC) Received: from besplex.bde.org (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBFFk79K027238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Dec 2009 02:46:08 +1100 Date: Wed, 16 Dec 2009 02:46:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pieter de Goeje In-Reply-To: <200912151416.56348.pieter@service2media.com> Message-ID: <20091216014431.U1425@besplex.bde.org> References: <200912141223.nBECNlDZ026381@svn.freebsd.org> <20091214144635.GA91618@onelab2.iet.unipi.it> <200912151416.56348.pieter@service2media.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, Robert Watson , svn-src-head@freebsd.org, Luigi Rizzo Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 15:46:12 -0000 On Tue, 15 Dec 2009, Pieter de Goeje wrote: > On Monday 14 December 2009 15:46:35 Luigi Rizzo wrote: >> On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: >>> On Mon, 14 Dec 2009, Luigi Rizzo wrote: >> >> ... >> >>>> Together with a smaller patch committed in september, this fixes a >>>> bug that affects 8.0 with apps that rely on callouts to fire exactly >>>> in the number of ticks specified (qemu among them). >>>> Right now, callouts in 8.0 fire one tick late. >>>> >>>> This was discussed in september with JeffR and jhb >>> >>> Once this has burned in, is it something you would consider appropriate >>> to be an errata note candidate? >> >> i have no objection, but at the time someone commented that >> callouts do not _guarantee_ when they will run so strictly speaking >> this is not a bug (i do think that being always a tick late _is_ a bug). > > As a person running a couple of game servers which rely on nanosleep to get a > fixed number of frames per second, I'd say that it is a bug. Being a tick late is certainly a bug. Relying on nanosleep to get a fixed number of frames per second is another bug. If you want a periodic timer, setitimer(2) with a nonzero it_value (so that the timer repeats automatically) must be used. > This might also > affect video players which want to show their frames on time. The default HZ > of 1000 mitigates the problem somewhat, but on for example a laptop running at > HZ=100 the error is noticeable. > To illustrate my point, calling usleep(1) 100 times in a loop results in a > running time of 3 seconds with kern.hz=100 (measured on 8.x from Dec 9th), > which is 3 times as long as one might reasonably expect. This suggests that > the callout fires 2 ticks late ... Only 1 tick late. I get a running time of 2 seconds with hz = 100 under FreeBSD-~5.2, presumably because 5.2 didn't have the 1-tick-late bug. The time is expected to be 2 seconds instead of 1 because nanosleep() adds an extra 1 tick though it would work right (but slower) with other small changes (also pessimizations) if it didn't. To sleep for 1 microsecond, it is always necessary to wait until the next tick for obvious reasons. The next tick might occur in less than a microsecond (when the timeout happens to be set up just before the tick), so nanosleep() can't just return when the tick occurs. It should check if the timeout has expired (in real time, not ticks) and wait for another tick if not. In fact, it already does this in order to be reasonably accurate for long timeouts. However, to be simple and efficient, it just waits for an extra tick initially, using generic code that adds 1 to the tick count. Other uses of the generic code don't check that the timeout has expired so they need this extra 1 for correctness, but nanosleep() only needs it for efficiency. This optimization for efficiency is more historical than intentional. nanosleep() also uses a fuzzy check (getnanouptime() instead of nanouptime() for the expiry, which can give an error of about 1 tick With the fuzzy check, the extra 1 might still be needed for correctness Thus when hz = 100, 100 nanosleeps for 1 microsecond (or even 1 nanosecond) take between about 1 and 2 seconds, with an average of 1.5 seconds for random calls and an average of 2 seconds for synchronized calls. Sequential calls with no other system activity give synchronized calls. The time of 2/hz for synchronized calls can be depended on if there is no other system activity, but it is better to use setitimer() as above -- then cases with other system activity have a better chance of working, and you can also get a time of 1/hz. nanosleep() is correct but very sloppy for for long sleeps. E.g., with hz = 1000 on i386(i8254), the average absolute error for a set of perfectly calibrated i8254 ticks is about 0.02%, so for sleeps of 1 year the error will be at best 1.82 hours on average. If the hz clock runs faster than real time, then nanosleep() wakes up early and does shorter sleeps to reach the correct real time, but if the hz clock runs slow then nanosleep() normally wakes up hours per year late. This is easy to fix at a cost of efficiency by intentionally underestimating the timeout in ticks, which goes well with not adding 1. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 16:15:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7B53106566B; Tue, 15 Dec 2009 16:15:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4A708FC12; Tue, 15 Dec 2009 16:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFGFEI9068607; Tue, 15 Dec 2009 16:15:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFGFEOq068598; Tue, 15 Dec 2009 16:15:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912151615.nBFGFEOq068598@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 16:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200580 - in head/sys: conf net netinet netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 16:15:14 -0000 Author: luigi Date: Tue Dec 15 16:15:14 2009 New Revision: 200580 URL: http://svn.freebsd.org/changeset/base/200580 Log: Start splitting ip_fw2.c and ip_fw.h into smaller components. At this time we pull out from ip_fw2.c the logging functions, and support for dynamic rules, and move kernel-only stuff into netinet/ipfw/ip_fw_private.h No ABI change involved in this commit, unless I made some mistake. ip_fw.h has changed, though not in the userland-visible part. Files touched by this commit: conf/files now references the two new source files netinet/ip_fw.h remove kernel-only definitions gone into netinet/ipfw/ip_fw_private.h. netinet/ipfw/ip_fw_private.h new file with kernel-specific ipfw definitions netinet/ipfw/ip_fw_log.c ipfw_log and related functions netinet/ipfw/ip_fw_dynamic.c code related to dynamic rules netinet/ipfw/ip_fw2.c removed the pieces that goes in the new files netinet/ipfw/ip_fw_nat.c minor rearrangement to remove LOOKUP_NAT from the main headers. This require a new function pointer. A bunch of other kernel files that included netinet/ip_fw.h now require netinet/ipfw/ip_fw_private.h as well. Not 100% sure i caught all of them. MFC after: 1 month Added: head/sys/netinet/ipfw/ip_fw_dynamic.c (contents, props changed) head/sys/netinet/ipfw/ip_fw_log.c (contents, props changed) head/sys/netinet/ipfw/ip_fw_private.h (contents, props changed) Modified: head/sys/conf/files head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_fw.h head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/conf/files Tue Dec 15 16:15:14 2009 (r200580) @@ -2427,6 +2427,8 @@ netinet/ip_encap.c optional inet | inet netinet/ip_fastfwd.c optional inet netinet/ipfw/ip_fw2.c optional inet ipfirewall \ compile-with "${NORMAL_C} -I$S/contrib/pf" +netinet/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netinet/ipfw/ip_fw_log.c optional inet ipfirewall netinet/ipfw/ip_fw_pfil.c optional inet ipfirewall netinet/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netinet/ip_icmp.c optional inet Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/net/if_bridge.c Tue Dec 15 16:15:14 2009 (r200580) @@ -134,6 +134,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include /* Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/net/if_ethersubr.c Tue Dec 15 16:15:14 2009 (r200580) @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #endif Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ip_divert.c Tue Dec 15 16:15:14 2009 (r200580) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef SCTP #include #endif Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ip_fw.h Tue Dec 15 16:15:14 2009 (r200580) @@ -571,133 +571,4 @@ typedef struct _ipfw_table { ipfw_table_entry ent[0]; /* entries */ } ipfw_table; -/* - * Main firewall chains definitions and global var's definitions. - */ -#ifdef _KERNEL - -#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ - -/* Return values from ipfw_chk() */ -enum { - IP_FW_PASS = 0, - IP_FW_DENY, - IP_FW_DIVERT, - IP_FW_TEE, - IP_FW_DUMMYNET, - IP_FW_NETGRAPH, - IP_FW_NGTEE, - IP_FW_NAT, - IP_FW_REASS, -}; - -/* flags for divert mtag */ -#define IP_FW_DIVERT_LOOPBACK_FLAG 0x00080000 -#define IP_FW_DIVERT_OUTPUT_FLAG 0x00100000 - -/* - * Structure for collecting parameters to dummynet for ip6_output forwarding - */ -struct _ip6dn_args { - struct ip6_pktopts *opt_or; - struct route_in6 ro_or; - int flags_or; - struct ip6_moptions *im6o_or; - struct ifnet *origifp_or; - struct ifnet *ifp_or; - struct sockaddr_in6 dst_or; - u_long mtu_or; - struct route_in6 ro_pmtu_or; -}; - -/* - * Arguments for calling ipfw_chk() and dummynet_io(). We put them - * all into a structure because this way it is easier and more - * efficient to pass variables around and extend the interface. - */ -struct ip_fw_args { - struct mbuf *m; /* the mbuf chain */ - struct ifnet *oif; /* output interface */ - struct sockaddr_in *next_hop; /* forward address */ - struct ip_fw *rule; /* matching rule */ - uint32_t rule_id; /* matching rule id */ - uint32_t chain_id; /* ruleset id */ - struct ether_header *eh; /* for bridged packets */ - - struct ipfw_flow_id f_id; /* grabbed from IP header */ - uint32_t cookie; /* a cookie depending on rule action */ - struct inpcb *inp; - - struct _ip6dn_args dummypar; /* dummynet->ip6_output */ - struct sockaddr_in hopstore; /* store here if cannot use a pointer */ -}; - -/* - * Function definitions. - */ - -/* Firewall hooks */ -struct sockopt; -struct dn_flow_set; - -int ipfw_check_in(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); -int ipfw_check_out(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); - -int ipfw_chk(struct ip_fw_args *); - -int ipfw_hook(void); -int ipfw6_hook(void); -int ipfw_unhook(void); -int ipfw6_unhook(void); -#ifdef NOTYET -void ipfw_nat_destroy(void); -#endif - -VNET_DECLARE(int, fw_one_pass); -VNET_DECLARE(int, fw_enable); -#define V_fw_one_pass VNET(fw_one_pass) -#define V_fw_enable VNET(fw_enable) - -#ifdef INET6 -VNET_DECLARE(int, fw6_enable); -#define V_fw6_enable VNET(fw6_enable) -#endif - -struct ip_fw_chain { - struct ip_fw *rules; /* list of rules */ - struct ip_fw *reap; /* list of rules to reap */ - LIST_HEAD(, cfg_nat) nat; /* list of nat entries */ - struct radix_node_head *tables[IPFW_TABLES_MAX]; - struct rwlock rwmtx; - uint32_t id; /* ruleset id */ -}; - -#ifdef IPFW_INTERNAL - -#define IPFW_LOCK_INIT(_chain) \ - rw_init(&(_chain)->rwmtx, "IPFW static rules") -#define IPFW_LOCK_DESTROY(_chain) rw_destroy(&(_chain)->rwmtx) -#define IPFW_WLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_WLOCKED) - -#define IPFW_RLOCK(p) rw_rlock(&(p)->rwmtx) -#define IPFW_RUNLOCK(p) rw_runlock(&(p)->rwmtx) -#define IPFW_WLOCK(p) rw_wlock(&(p)->rwmtx) -#define IPFW_WUNLOCK(p) rw_wunlock(&(p)->rwmtx) - -#define LOOKUP_NAT(l, i, p) do { \ - LIST_FOREACH((p), &(l.nat), _next) { \ - if ((p)->id == (i)) { \ - break; \ - } \ - } \ - } while (0) - -typedef int ipfw_nat_t(struct ip_fw_args *, struct cfg_nat *, struct mbuf *); -typedef int ipfw_nat_cfg_t(struct sockopt *); -#endif - -VNET_DECLARE(struct ip_fw_chain, layer3_chain); -#define V_layer3_chain VNET(layer3_chain) - -#endif /* _KERNEL */ #endif /* _IPFW2_H */ Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ipfw/ip_dummynet.c Tue Dec 15 16:15:14 2009 (r200580) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include /* ip_len, ip_off */ #include +#include #include #include /* ip_output(), IP_FORWARDING */ Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 15:13:41 2009 (r200579) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 16:15:14 2009 (r200580) @@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define IPFW_INTERNAL /* Access to protected data structures in ip_fw.h. */ - #include #include #include @@ -79,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,13 +113,9 @@ static VNET_DEFINE(int, ipfw_vnet_ready) * Rules in set RESVD_SET can only be deleted explicitly. */ static VNET_DEFINE(u_int32_t, set_disable); -static VNET_DEFINE(int, fw_verbose); -static VNET_DEFINE(struct callout, ipfw_timeout); -static VNET_DEFINE(int, verbose_limit); +VNET_DEFINE(int, fw_verbose); #define V_set_disable VNET(set_disable) -#define V_fw_verbose VNET(fw_verbose) -#define V_ipfw_timeout VNET(ipfw_timeout) #define V_verbose_limit VNET(verbose_limit) #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT @@ -128,7 +123,6 @@ static int default_to_accept = 1; #else static int default_to_accept; #endif -static uma_zone_t ipfw_dyn_rule_zone; struct ip_fw *ip_fw_default_rule; @@ -141,6 +135,7 @@ MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "Ip MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables"); #define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) ipfw_nat_t *ipfw_nat_ptr = NULL; +struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; ipfw_nat_cfg_t *ipfw_nat_del_ptr; ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; @@ -157,6 +152,10 @@ static VNET_DEFINE(int, autoinc_step); static VNET_DEFINE(int, fw_deny_unknown_exthdrs); #define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) +static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ +static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ +#define V_static_count VNET(static_count) +#define V_static_len VNET(static_len) extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); #ifdef SYSCTL_NODE @@ -198,146 +197,12 @@ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_A "Deny packets with unknown IPv6 Extension Headers"); #endif /* INET6 */ -#endif /* SYSCTL_NODE */ - -/* - * Description of dynamic rules. - * - * Dynamic rules are stored in lists accessed through a hash table - * (ipfw_dyn_v) whose size is curr_dyn_buckets. This value can - * be modified through the sysctl variable dyn_buckets which is - * updated when the table becomes empty. - * - * XXX currently there is only one list, ipfw_dyn. - * - * When a packet is received, its address fields are first masked - * with the mask defined for the rule, then hashed, then matched - * against the entries in the corresponding list. - * Dynamic rules can be used for different purposes: - * + stateful rules; - * + enforcing limits on the number of sessions; - * + in-kernel NAT (not implemented yet) - * - * The lifetime of dynamic rules is regulated by dyn_*_lifetime, - * measured in seconds and depending on the flags. - * - * The total number of dynamic rules is stored in dyn_count. - * The max number of dynamic rules is dyn_max. When we reach - * the maximum number of rules we do not create anymore. This is - * done to avoid consuming too much memory, but also too much - * time when searching on each packet (ideally, we should try instead - * to put a limit on the length of the list on each bucket...). - * - * Each dynamic rule holds a pointer to the parent ipfw rule so - * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. XXX we should make them survive. - * - * There are some limitations with dynamic rules -- we do not - * obey the 'randomized match', and we do not do multiple - * passes through the firewall. XXX check the latter!!! - */ -static VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets); -static VNET_DEFINE(u_int32_t, curr_dyn_buckets); - -#define V_ipfw_dyn_v VNET(ipfw_dyn_v) -#define V_dyn_buckets VNET(dyn_buckets) -#define V_curr_dyn_buckets VNET(curr_dyn_buckets) - -static struct mtx ipfw_dyn_mtx; /* mutex guarding dynamic rules */ -#define IPFW_DYN_LOCK_INIT() \ - mtx_init(&ipfw_dyn_mtx, "IPFW dynamic rules", NULL, MTX_DEF) -#define IPFW_DYN_LOCK_DESTROY() mtx_destroy(&ipfw_dyn_mtx) -#define IPFW_DYN_LOCK() mtx_lock(&ipfw_dyn_mtx) -#define IPFW_DYN_UNLOCK() mtx_unlock(&ipfw_dyn_mtx) -#define IPFW_DYN_LOCK_ASSERT() mtx_assert(&ipfw_dyn_mtx, MA_OWNED) - -static struct mbuf *send_pkt(struct mbuf *, struct ipfw_flow_id *, - u_int32_t, u_int32_t, int); - - -/* - * Timeouts for various events in handing dynamic rules. - */ -static VNET_DEFINE(u_int32_t, dyn_ack_lifetime); -static VNET_DEFINE(u_int32_t, dyn_syn_lifetime); -static VNET_DEFINE(u_int32_t, dyn_fin_lifetime); -static VNET_DEFINE(u_int32_t, dyn_rst_lifetime); -static VNET_DEFINE(u_int32_t, dyn_udp_lifetime); -static VNET_DEFINE(u_int32_t, dyn_short_lifetime); - -#define V_dyn_ack_lifetime VNET(dyn_ack_lifetime) -#define V_dyn_syn_lifetime VNET(dyn_syn_lifetime) -#define V_dyn_fin_lifetime VNET(dyn_fin_lifetime) -#define V_dyn_rst_lifetime VNET(dyn_rst_lifetime) -#define V_dyn_udp_lifetime VNET(dyn_udp_lifetime) -#define V_dyn_short_lifetime VNET(dyn_short_lifetime) - -/* - * Keepalives are sent if dyn_keepalive is set. They are sent every - * dyn_keepalive_period seconds, in the last dyn_keepalive_interval - * seconds of lifetime of a rule. - * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower - * than dyn_keepalive_period. - */ - -static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); -static VNET_DEFINE(u_int32_t, dyn_keepalive_period); -static VNET_DEFINE(u_int32_t, dyn_keepalive); - -#define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) -#define V_dyn_keepalive_period VNET(dyn_keepalive_period) -#define V_dyn_keepalive VNET(dyn_keepalive) - -static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ -static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ -static VNET_DEFINE(u_int32_t, dyn_count); /* # of dynamic rules */ -static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ - -#define V_static_count VNET(static_count) -#define V_static_len VNET(static_len) -#define V_dyn_count VNET(dyn_count) -#define V_dyn_max VNET(dyn_max) - -#ifdef SYSCTL_NODE -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_RW, &VNET_NAME(dyn_buckets), 0, - "Number of dyn. buckets"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, - CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, - "Current Number of dyn. buckets"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_RD, &VNET_NAME(dyn_count), 0, - "Number of dyn. rules"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_RW, &VNET_NAME(dyn_max), 0, - "Max number of dyn. rules"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, CTLFLAG_RD, &VNET_NAME(static_count), 0, "Number of static rules"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, - "Lifetime of dyn. rules for acks"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_syn_lifetime), 0, - "Lifetime of dyn. rules for syn"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_fin_lifetime), 0, - "Lifetime of dyn. rules for fin"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_rst_lifetime), 0, - "Lifetime of dyn. rules for rst"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_udp_lifetime), 0, - "Lifetime of dyn. rules for UDP"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, - CTLFLAG_RW, &VNET_NAME(dyn_short_lifetime), 0, - "Lifetime of dyn. rules for other situations"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, - CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, - "Enable keepalives for dyn. rules"); #endif /* SYSCTL_NODE */ + /* * L3HDR maps an ipv4 pointer into a layer3 header pointer of type T * Other macros just cast void * into the appropriate type @@ -681,18 +546,6 @@ verify_path6(struct in6_addr *src, struc return 1; } -static __inline int -hash_packet6(struct ipfw_flow_id *id) -{ - u_int32_t i; - i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->dst_port) ^ (id->src_port); - return i; -} - static int is_icmp6_query(int icmp6_type) { @@ -749,1072 +602,6 @@ send_reject6(struct ip_fw_args *args, in #endif /* INET6 */ -/* counter for ipfw_log(NULL...) */ -static VNET_DEFINE(u_int64_t, norule_counter); -#define V_norule_counter VNET(norule_counter) - -#define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 -#define SNP(buf) buf, sizeof(buf) - -/* - * We enter here when we have a rule with O_LOG. - * XXX this function alone takes about 2Kbytes of code! - */ -static void -ipfw_log(struct ip_fw *f, u_int hlen, struct ip_fw_args *args, - struct mbuf *m, struct ifnet *oif, u_short offset, uint32_t tablearg, - struct ip *ip) -{ - struct ether_header *eh = args->eh; - char *action; - int limit_reached = 0; - char action2[40], proto[128], fragment[32]; - - fragment[0] = '\0'; - proto[0] = '\0'; - - if (f == NULL) { /* bogus pkt */ - if (V_verbose_limit != 0 && V_norule_counter >= V_verbose_limit) - return; - V_norule_counter++; - if (V_norule_counter == V_verbose_limit) - limit_reached = V_verbose_limit; - action = "Refuse"; - } else { /* O_LOG is the first action, find the real one */ - ipfw_insn *cmd = ACTION_PTR(f); - ipfw_insn_log *l = (ipfw_insn_log *)cmd; - - if (l->max_log != 0 && l->log_left == 0) - return; - l->log_left--; - if (l->log_left == 0) - limit_reached = l->max_log; - cmd += F_LEN(cmd); /* point to first action */ - if (cmd->opcode == O_ALTQ) { - ipfw_insn_altq *altq = (ipfw_insn_altq *)cmd; - - snprintf(SNPARGS(action2, 0), "Altq %d", - altq->qid); - cmd += F_LEN(cmd); - } - if (cmd->opcode == O_PROB) - cmd += F_LEN(cmd); - - if (cmd->opcode == O_TAG) - cmd += F_LEN(cmd); - - action = action2; - switch (cmd->opcode) { - case O_DENY: - action = "Deny"; - break; - - case O_REJECT: - if (cmd->arg1==ICMP_REJECT_RST) - action = "Reset"; - else if (cmd->arg1==ICMP_UNREACH_HOST) - action = "Reject"; - else - snprintf(SNPARGS(action2, 0), "Unreach %d", - cmd->arg1); - break; - - case O_UNREACH6: - if (cmd->arg1==ICMP6_UNREACH_RST) - action = "Reset"; - else - snprintf(SNPARGS(action2, 0), "Unreach %d", - cmd->arg1); - break; - - case O_ACCEPT: - action = "Accept"; - break; - case O_COUNT: - action = "Count"; - break; - case O_DIVERT: - snprintf(SNPARGS(action2, 0), "Divert %d", - cmd->arg1); - break; - case O_TEE: - snprintf(SNPARGS(action2, 0), "Tee %d", - cmd->arg1); - break; - case O_SETFIB: - snprintf(SNPARGS(action2, 0), "SetFib %d", - cmd->arg1); - break; - case O_SKIPTO: - snprintf(SNPARGS(action2, 0), "SkipTo %d", - cmd->arg1); - break; - case O_PIPE: - snprintf(SNPARGS(action2, 0), "Pipe %d", - cmd->arg1); - break; - case O_QUEUE: - snprintf(SNPARGS(action2, 0), "Queue %d", - cmd->arg1); - break; - case O_FORWARD_IP: { - ipfw_insn_sa *sa = (ipfw_insn_sa *)cmd; - int len; - struct in_addr dummyaddr; - if (sa->sa.sin_addr.s_addr == INADDR_ANY) - dummyaddr.s_addr = htonl(tablearg); - else - dummyaddr.s_addr = sa->sa.sin_addr.s_addr; - - len = snprintf(SNPARGS(action2, 0), "Forward to %s", - inet_ntoa(dummyaddr)); - - if (sa->sa.sin_port) - snprintf(SNPARGS(action2, len), ":%d", - sa->sa.sin_port); - } - break; - case O_NETGRAPH: - snprintf(SNPARGS(action2, 0), "Netgraph %d", - cmd->arg1); - break; - case O_NGTEE: - snprintf(SNPARGS(action2, 0), "Ngtee %d", - cmd->arg1); - break; - case O_NAT: - action = "Nat"; - break; - case O_REASS: - action = "Reass"; - break; - default: - action = "UNKNOWN"; - break; - } - } - - if (hlen == 0) { /* non-ip */ - snprintf(SNPARGS(proto, 0), "MAC"); - - } else { - int len; -#ifdef INET6 - char src[INET6_ADDRSTRLEN + 2], dst[INET6_ADDRSTRLEN + 2]; -#else - char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; -#endif - struct icmphdr *icmp; - struct tcphdr *tcp; - struct udphdr *udp; -#ifdef INET6 - struct ip6_hdr *ip6 = NULL; - struct icmp6_hdr *icmp6; -#endif - src[0] = '\0'; - dst[0] = '\0'; -#ifdef INET6 - if (IS_IP6_FLOW_ID(&(args->f_id))) { - char ip6buf[INET6_ADDRSTRLEN]; - snprintf(src, sizeof(src), "[%s]", - ip6_sprintf(ip6buf, &args->f_id.src_ip6)); - snprintf(dst, sizeof(dst), "[%s]", - ip6_sprintf(ip6buf, &args->f_id.dst_ip6)); - - ip6 = (struct ip6_hdr *)ip; - tcp = (struct tcphdr *)(((char *)ip) + hlen); - udp = (struct udphdr *)(((char *)ip) + hlen); - } else -#endif - { - tcp = L3HDR(struct tcphdr, ip); - udp = L3HDR(struct udphdr, ip); - - inet_ntoa_r(ip->ip_src, src); - inet_ntoa_r(ip->ip_dst, dst); - } - - switch (args->f_id.proto) { - case IPPROTO_TCP: - len = snprintf(SNPARGS(proto, 0), "TCP %s", src); - if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d %s:%d", - ntohs(tcp->th_sport), - dst, - ntohs(tcp->th_dport)); - else - snprintf(SNPARGS(proto, len), " %s", dst); - break; - - case IPPROTO_UDP: - len = snprintf(SNPARGS(proto, 0), "UDP %s", src); - if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d %s:%d", - ntohs(udp->uh_sport), - dst, - ntohs(udp->uh_dport)); - else - snprintf(SNPARGS(proto, len), " %s", dst); - break; - - case IPPROTO_ICMP: - icmp = L3HDR(struct icmphdr, ip); - if (offset == 0) - len = snprintf(SNPARGS(proto, 0), - "ICMP:%u.%u ", - icmp->icmp_type, icmp->icmp_code); - else - len = snprintf(SNPARGS(proto, 0), "ICMP "); - len += snprintf(SNPARGS(proto, len), "%s", src); - snprintf(SNPARGS(proto, len), " %s", dst); - break; -#ifdef INET6 - case IPPROTO_ICMPV6: - icmp6 = (struct icmp6_hdr *)(((char *)ip) + hlen); - if (offset == 0) - len = snprintf(SNPARGS(proto, 0), - "ICMPv6:%u.%u ", - icmp6->icmp6_type, icmp6->icmp6_code); - else - len = snprintf(SNPARGS(proto, 0), "ICMPv6 "); - len += snprintf(SNPARGS(proto, len), "%s", src); - snprintf(SNPARGS(proto, len), " %s", dst); - break; -#endif - default: - len = snprintf(SNPARGS(proto, 0), "P:%d %s", - args->f_id.proto, src); - snprintf(SNPARGS(proto, len), " %s", dst); - break; - } - -#ifdef INET6 - if (IS_IP6_FLOW_ID(&(args->f_id))) { - if (offset & (IP6F_OFF_MASK | IP6F_MORE_FRAG)) - snprintf(SNPARGS(fragment, 0), - " (frag %08x:%d@%d%s)", - args->f_id.frag_id6, - ntohs(ip6->ip6_plen) - hlen, - ntohs(offset & IP6F_OFF_MASK) << 3, - (offset & IP6F_MORE_FRAG) ? "+" : ""); - } else -#endif - { - int ip_off, ip_len; - if (eh != NULL) { /* layer 2 packets are as on the wire */ - ip_off = ntohs(ip->ip_off); - ip_len = ntohs(ip->ip_len); - } else { - ip_off = ip->ip_off; - ip_len = ip->ip_len; - } - if (ip_off & (IP_MF | IP_OFFMASK)) - snprintf(SNPARGS(fragment, 0), - " (frag %d:%d@%d%s)", - ntohs(ip->ip_id), ip_len - (ip->ip_hl << 2), - offset << 3, - (ip_off & IP_MF) ? "+" : ""); - } - } - if (oif || m->m_pkthdr.rcvif) - log(LOG_SECURITY | LOG_INFO, - "ipfw: %d %s %s %s via %s%s\n", - f ? f->rulenum : -1, - action, proto, oif ? "out" : "in", - oif ? oif->if_xname : m->m_pkthdr.rcvif->if_xname, - fragment); - else - log(LOG_SECURITY | LOG_INFO, - "ipfw: %d %s %s [no if info]%s\n", - f ? f->rulenum : -1, - action, proto, fragment); - if (limit_reached) - log(LOG_SECURITY | LOG_NOTICE, - "ipfw: limit %d reached on entry %d\n", - limit_reached, f ? f->rulenum : -1); -} - -/* - * IMPORTANT: the hash function for dynamic rules must be commutative - * in source and destination (ip,port), because rules are bidirectional - * and we want to find both in the same bucket. - */ -static __inline int -hash_packet(struct ipfw_flow_id *id) -{ - u_int32_t i; - -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) - i = hash_packet6(id); - else -#endif /* INET6 */ - i = (id->dst_ip) ^ (id->src_ip) ^ (id->dst_port) ^ (id->src_port); - i &= (V_curr_dyn_buckets - 1); - return i; -} - -static __inline void -unlink_dyn_rule_print(struct ipfw_flow_id *id) -{ - struct in_addr da; -#ifdef INET6 - char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN]; -#else - char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; -#endif - -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) { - ip6_sprintf(src, &id->src_ip6); - ip6_sprintf(dst, &id->dst_ip6); - } else -#endif - { - da.s_addr = htonl(id->src_ip); - inet_ntoa_r(da, src); - da.s_addr = htonl(id->dst_ip); - inet_ntoa_r(da, dst); - } - printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", - src, id->src_port, dst, id->dst_port, V_dyn_count - 1); -} - -/** - * unlink a dynamic rule from a chain. prev is a pointer to - * the previous one, q is a pointer to the rule to delete, - * head is a pointer to the head of the queue. - * Modifies q and potentially also head. - */ -#define UNLINK_DYN_RULE(prev, head, q) { \ - ipfw_dyn_rule *old_q = q; \ - \ - /* remove a refcount to the parent */ \ - if (q->dyn_type == O_LIMIT) \ - q->parent->count--; \ - DEB(unlink_dyn_rule_print(&q->id);) \ - if (prev != NULL) \ - prev->next = q = q->next; \ - else \ - head = q = q->next; \ - V_dyn_count--; \ - uma_zfree(ipfw_dyn_rule_zone, old_q); } - -#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) - -/** - * Remove dynamic rules pointing to "rule", or all of them if rule == NULL. - * - * If keep_me == NULL, rules are deleted even if not expired, - * otherwise only expired rules are removed. - * - * The value of the second parameter is also used to point to identify - * a rule we absolutely do not want to remove (e.g. because we are - * holding a reference to it -- this is the case with O_LIMIT_PARENT - * rules). The pointer is only used for comparison, so any non-null - * value will do. - */ -static void -remove_dyn_rule(struct ip_fw *rule, ipfw_dyn_rule *keep_me) -{ - static u_int32_t last_remove = 0; - -#define FORCE (keep_me == NULL) - - ipfw_dyn_rule *prev, *q; - int i, pass = 0, max_pass = 0; - - IPFW_DYN_LOCK_ASSERT(); - - if (V_ipfw_dyn_v == NULL || V_dyn_count == 0) - return; - /* do not expire more than once per second, it is useless */ - if (!FORCE && last_remove == time_uptime) - return; - last_remove = time_uptime; - - /* - * because O_LIMIT refer to parent rules, during the first pass only - * remove child and mark any pending LIMIT_PARENT, and remove - * them in a second pass. - */ -next_pass: - for (i = 0 ; i < V_curr_dyn_buckets ; i++) { - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q ; ) { - /* - * Logic can become complex here, so we split tests. - */ - if (q == keep_me) - goto next; - if (rule != NULL && rule != q->rule) - goto next; /* not the one we are looking for */ - if (q->dyn_type == O_LIMIT_PARENT) { - /* - * handle parent in the second pass, - * record we need one. - */ - max_pass = 1; - if (pass == 0) - goto next; - if (FORCE && q->count != 0 ) { - /* XXX should not happen! */ - printf("ipfw: OUCH! cannot remove rule," - " count %d\n", q->count); - } - } else { - if (!FORCE && - !TIME_LEQ( q->expire, time_uptime )) - goto next; - } - if (q->dyn_type != O_LIMIT_PARENT || !q->count) { - UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); - continue; - } -next: - prev=q; - q=q->next; - } - } - if (pass++ < max_pass) - goto next_pass; -} - - -/** - * lookup a dynamic rule. - */ -static ipfw_dyn_rule * -lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp) -{ - /* - * stateful ipfw extensions. - * Lookup into dynamic session queue - */ -#define MATCH_REVERSE 0 -#define MATCH_FORWARD 1 -#define MATCH_NONE 2 -#define MATCH_UNKNOWN 3 - int i, dir = MATCH_NONE; - ipfw_dyn_rule *prev, *q=NULL; - - IPFW_DYN_LOCK_ASSERT(); - - if (V_ipfw_dyn_v == NULL) - goto done; /* not found */ - i = hash_packet( pkt ); - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q != NULL ; ) { - if (q->dyn_type == O_LIMIT_PARENT && q->count) - goto next; - if (TIME_LEQ( q->expire, time_uptime)) { /* expire entry */ - UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); - continue; - } - if (pkt->proto == q->id.proto && - q->dyn_type != O_LIMIT_PARENT) { - if (IS_IP6_FLOW_ID(pkt)) { - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.src_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.dst_ip6)) && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { - dir = MATCH_FORWARD; - break; - } - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.dst_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.src_ip6)) && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } - } else { - if (pkt->src_ip == q->id.src_ip && - pkt->dst_ip == q->id.dst_ip && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { - dir = MATCH_FORWARD; - break; - } - if (pkt->src_ip == q->id.dst_ip && - pkt->dst_ip == q->id.src_ip && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } - } - } -next: - prev = q; - q = q->next; - } - if (q == NULL) - goto done; /* q = NULL, not found */ - - if ( prev != NULL) { /* found and not in front */ - prev->next = q->next; - q->next = V_ipfw_dyn_v[i]; - V_ipfw_dyn_v[i] = q; - } - if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ - u_char flags = pkt->flags & (TH_FIN|TH_SYN|TH_RST); - -#define BOTH_SYN (TH_SYN | (TH_SYN << 8)) -#define BOTH_FIN (TH_FIN | (TH_FIN << 8)) - q->state |= (dir == MATCH_FORWARD ) ? flags : (flags << 8); - switch (q->state) { - case TH_SYN: /* opening */ - q->expire = time_uptime + V_dyn_syn_lifetime; - break; - - case BOTH_SYN: /* move to established */ - case BOTH_SYN | TH_FIN : /* one side tries to close */ - case BOTH_SYN | (TH_FIN << 8) : - if (tcp) { -#define _SEQ_GE(a,b) ((int)(a) - (int)(b) >= 0) - u_int32_t ack = ntohl(tcp->th_ack); - if (dir == MATCH_FORWARD) { - if (q->ack_fwd == 0 || _SEQ_GE(ack, q->ack_fwd)) - q->ack_fwd = ack; - else { /* ignore out-of-sequence */ - break; - } - } else { - if (q->ack_rev == 0 || _SEQ_GE(ack, q->ack_rev)) - q->ack_rev = ack; - else { /* ignore out-of-sequence */ - break; - } - } - } - q->expire = time_uptime + V_dyn_ack_lifetime; - break; - - case BOTH_SYN | BOTH_FIN: /* both sides closed */ - if (V_dyn_fin_lifetime >= V_dyn_keepalive_period) - V_dyn_fin_lifetime = V_dyn_keepalive_period - 1; - q->expire = time_uptime + V_dyn_fin_lifetime; - break; - - default: -#if 0 - /* - * reset or some invalid combination, but can also - * occur if we use keep-state the wrong way. - */ - if ( (q->state & ((TH_RST << 8)|TH_RST)) == 0) - printf("invalid state: 0x%x\n", q->state); -#endif - if (V_dyn_rst_lifetime >= V_dyn_keepalive_period) - V_dyn_rst_lifetime = V_dyn_keepalive_period - 1; - q->expire = time_uptime + V_dyn_rst_lifetime; - break; - } - } else if (pkt->proto == IPPROTO_UDP) { - q->expire = time_uptime + V_dyn_udp_lifetime; - } else { - /* other protocols */ - q->expire = time_uptime + V_dyn_short_lifetime; - } -done: - if (match_direction) - *match_direction = dir; - return q; -} - -static ipfw_dyn_rule * -lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp) -{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 17:39:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C35E81065695; Tue, 15 Dec 2009 17:39:14 +0000 (UTC) (envelope-from pdegoeje@service2media.com) Received: from s2m-is-001.service2media.com (rev-130-102.virtu.nl [217.114.102.130]) by mx1.freebsd.org (Postfix) with ESMTP id 463588FC16; Tue, 15 Dec 2009 17:39:13 +0000 (UTC) Received: from pieter-dev-linux.localnet ([10.0.1.18] RDNS failed) by s2m-is-001.service2media.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 15 Dec 2009 18:39:11 +0100 From: Pieter de Goeje Organization: Service2Media To: Bruce Evans Date: Tue, 15 Dec 2009 18:39:10 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31-16-generic; KDE/4.3.2; i686; ; ) References: <200912141223.nBECNlDZ026381@svn.freebsd.org> <200912151416.56348.pieter@service2media.com> <20091216014431.U1425@besplex.bde.org> In-Reply-To: <20091216014431.U1425@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912151839.11024.pieter@service2media.com> X-OriginalArrivalTime: 15 Dec 2009 17:39:11.0793 (UTC) FILETIME=[833A4A10:01CA7DAD] Cc: Luigi Rizzo , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Robert Watson , "svn-src-head@freebsd.org" , Luigi Rizzo , Pieter de Goeje Subject: Re: svn commit: r200510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 17:39:14 -0000 On Tuesday 15 December 2009 16:46:07 Bruce Evans wrote: > On Tue, 15 Dec 2009, Pieter de Goeje wrote: > > On Monday 14 December 2009 15:46:35 Luigi Rizzo wrote: > >> On Mon, Dec 14, 2009 at 02:18:42PM +0000, Robert Watson wrote: > >>> On Mon, 14 Dec 2009, Luigi Rizzo wrote: > >> > >> ... > >> > >>>> Together with a smaller patch committed in september, this fixes a > >>>> bug that affects 8.0 with apps that rely on callouts to fire exactly > >>>> in the number of ticks specified (qemu among them). > >>>> Right now, callouts in 8.0 fire one tick late. > >>>> > >>>> This was discussed in september with JeffR and jhb > >>> > >>> Once this has burned in, is it something you would consider appropriate > >>> to be an errata note candidate? > >> > >> i have no objection, but at the time someone commented that > >> callouts do not _guarantee_ when they will run so strictly speaking > >> this is not a bug (i do think that being always a tick late _is_ a bug). > > > > As a person running a couple of game servers which rely on nanosleep to > > get a fixed number of frames per second, I'd say that it is a bug. > > Being a tick late is certainly a bug. Relying on nanosleep to get a > fixed number of frames per second is another bug. If you want a > periodic timer, setitimer(2) with a nonzero it_value (so that the timer > repeats automatically) must be used. > > > This might also > > affect video players which want to show their frames on time. The > > default HZ of 1000 mitigates the problem somewhat, but on for example a > > laptop running at HZ=100 the error is noticeable. > > To illustrate my point, calling usleep(1) 100 times in a loop results in > > a running time of 3 seconds with kern.hz=100 (measured on 8.x from Dec > > 9th), which is 3 times as long as one might reasonably expect. This > > suggests that the callout fires 2 ticks late ... > > Only 1 tick late. I get a running time of 2 seconds with hz = 100 under > FreeBSD-~5.2, presumably because 5.2 didn't have the 1-tick-late bug. > > The time is expected to be 2 seconds instead of 1 because nanosleep() > adds an extra 1 tick though it would work right (but slower) with other > small changes (also pessimizations) if it didn't. To sleep for 1 > microsecond, it is always necessary to wait until the next tick for > obvious reasons. The next tick might occur in less than a microsecond > (when the timeout happens to be set up just before the tick), so > nanosleep() can't just return when the tick occurs. It should check > if the timeout has expired (in real time, not ticks) and wait for > another tick if not. In fact, it already does this in order to be > reasonably accurate for long timeouts. However, to be simple and > efficient, it just waits for an extra tick initially, using generic > code that adds 1 to the tick count. Other uses of the generic code > don't check that the timeout has expired so they need this extra 1 > for correctness, but nanosleep() only needs it for efficiency. This > optimization for efficiency is more historical than intentional. > nanosleep() also uses a fuzzy check (getnanouptime() instead of > nanouptime() for the expiry, which can give an error of about 1 tick > With the fuzzy check, the extra 1 might still be needed for correctness > > Thus when hz = 100, 100 nanosleeps for 1 microsecond (or even 1 > nanosecond) take between about 1 and 2 seconds, with an average of 1.5 > seconds for random calls and an average of 2 seconds for synchronized > calls. Sequential calls with no other system activity give synchronized > calls. The time of 2/hz for synchronized calls can be depended on if > there is no other system activity, but it is better to use setitimer() > as above -- then cases with other system activity have a better chance > of working, and you can also get a time of 1/hz. > > nanosleep() is correct but very sloppy for for long sleeps. E.g., with > hz = 1000 on i386(i8254), the average absolute error for a set of perfectly > calibrated i8254 ticks is about 0.02%, so for sleeps of 1 year the error > will be at best 1.82 hours on average. If the hz clock runs faster than > real time, then nanosleep() wakes up early and does shorter sleeps to > reach the correct real time, but if the hz clock runs slow then nanosleep() > normally wakes up hours per year late. This is easy to fix at a cost of > efficiency by intentionally underestimating the timeout in ticks, which > goes well with not adding 1. > > Bruce > Thank you for your very thorough explanation. To recap, nanosleep() will always be one tick too late in the synchronous case unless a check of sleep time left is implemented in addition to not blindly adding 1 to the amount of ticks to wait. To get the minimum latency of 1/hz with the current implementation nanosleep() should be called right before the next tick fires. - Pieter From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 18:03:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A20106566B; Tue, 15 Dec 2009 18:03:59 +0000 (UTC) (envelope-from kwm@rainbow-runner.nl) Received: from viefep16-int.chello.at (viefep16-int.chello.at [62.179.121.36]) by mx1.freebsd.org (Postfix) with ESMTP id 69A528FC15; Tue, 15 Dec 2009 18:03:57 +0000 (UTC) Received: from edge05.upc.biz ([192.168.13.212]) by viefep20-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091215174706.LDBX23910.viefep20-int.chello.at@edge05.upc.biz>; Tue, 15 Dec 2009 18:47:06 +0100 Received: from [192.168.0.105] ([80.56.73.45]) by edge05.upc.biz with edge id HVn21d05C0ydU7k05Vn3bf; Tue, 15 Dec 2009 18:47:06 +0100 X-SourceIP: 80.56.73.45 From: Koop Mast To: Ollivier Robert In-Reply-To: <200912151459.nBFExwN7066718@svn.freebsd.org> References: <200912151459.nBFExwN7066718@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 15 Dec 2009 18:50:37 +0100 Message-ID: <1260899437.73150.645.camel@headache.rainbow-runner.nl> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200577 - in head/usr.sbin/ntp: . ntptrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 18:03:59 -0000 On Tue, 2009-12-15 at 14:59 +0000, Ollivier Robert wrote: > Author: roberto > Date: Tue Dec 15 14:59:58 2009 > New Revision: 200577 > URL: http://svn.freebsd.org/changeset/base/200577 > > Log: > ntpd 4.2.4p8 is now in the tree, ntptrace is dead RIP. > > Security: CVE-2009-3563 > Shouldn't ntptrace be added to ObsoleteFiles.inc now? -Koop From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 18:33:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1E68106566C; Tue, 15 Dec 2009 18:33:12 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0FA18FC12; Tue, 15 Dec 2009 18:33:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFIXCmc071536; Tue, 15 Dec 2009 18:33:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFIXC3x071533; Tue, 15 Dec 2009 18:33:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912151833.nBFIXC3x071533@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 18:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200582 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 18:33:12 -0000 Author: luigi Date: Tue Dec 15 18:33:12 2009 New Revision: 200582 URL: http://svn.freebsd.org/changeset/base/200582 Log: add ip_fw_private.h to ng_ipfw.c, forgotten in previous commit; comment out remove ip_fw.h from ng_bridge.c, as it seems unused. MFC after: 1 month Modified: head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_ipfw.c Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Tue Dec 15 18:09:07 2009 (r200581) +++ head/sys/netgraph/ng_bridge.c Tue Dec 15 18:33:12 2009 (r200582) @@ -75,8 +75,9 @@ #include #include +#if 0 /* not used yet */ #include - +#endif #include #include #include Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Tue Dec 15 18:09:07 2009 (r200581) +++ head/sys/netgraph/ng_ipfw.c Tue Dec 15 18:33:12 2009 (r200582) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 19:58:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFCEF1065676; Tue, 15 Dec 2009 19:58:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF9DD8FC15; Tue, 15 Dec 2009 19:58:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFJwNK7073503; Tue, 15 Dec 2009 19:58:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFJwNS4073500; Tue, 15 Dec 2009 19:58:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912151958.nBFJwNS4073500@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Dec 2009 19:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200584 - in head/sys: dev/dpms isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 19:58:23 -0000 Author: jkim Date: Tue Dec 15 19:58:23 2009 New Revision: 200584 URL: http://svn.freebsd.org/changeset/base/200584 Log: Attach dpms(4) to vgapm and make sure to restore DPMS state after VGA is resumed properly. Reviewed by: jhb Modified: head/sys/dev/dpms/dpms.c head/sys/isa/vga_isa.c Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Tue Dec 15 18:49:47 2009 (r200583) +++ head/sys/dev/dpms/dpms.c Tue Dec 15 19:58:23 2009 (r200584) @@ -118,15 +118,14 @@ static driver_t dpms_driver = { static devclass_t dpms_devclass; -DRIVER_MODULE(dpms, vgapci, dpms_driver, dpms_devclass, NULL, NULL); +DRIVER_MODULE(dpms, vgapm, dpms_driver, dpms_devclass, NULL, NULL); MODULE_DEPEND(dpms, x86bios, 1, 1, 1); static void dpms_identify(driver_t *driver, device_t parent) { - if (device_get_flags(parent) != 0 && - x86bios_match_device(0xc0000, parent)) + if (x86bios_match_device(0xc0000, device_get_parent(parent))) device_add_child(parent, "dpms", 0); } Modified: head/sys/isa/vga_isa.c ============================================================================== --- head/sys/isa/vga_isa.c Tue Dec 15 18:49:47 2009 (r200583) +++ head/sys/isa/vga_isa.c Tue Dec 15 19:58:23 2009 (r200584) @@ -328,6 +328,9 @@ static int vgapm_attach(device_t dev) { + bus_generic_probe(dev); + bus_generic_attach(dev); + return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 20:44:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0252C10656A4; Tue, 15 Dec 2009 20:44:13 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6A4E8FC1B; Tue, 15 Dec 2009 20:44:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFKiCNs074825; Tue, 15 Dec 2009 20:44:12 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFKiCUQ074823; Tue, 15 Dec 2009 20:44:12 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912152044.nBFKiCUQ074823@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 15 Dec 2009 20:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200587 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 20:44:13 -0000 Author: gavin Date: Tue Dec 15 20:44:12 2009 New Revision: 200587 URL: http://svn.freebsd.org/changeset/base/200587 Log: ifconfig(8) is documented to take a ISO 3166-1 country code to set the regulatory domain with the "country" parameter, but will also take a full country name. The man page warns that only the ISO code is unambiguous. In reality, however, the first match on either would be accepted, leading to "DE" being interpreted as the "DEBUG" country rather than Germany, and "MO" selecting Morocco rather than the correct country, Macau. Fix this by always checking for an ISO CC match first, and only search on the full country name if that fails. PR: bin/140571 Tested by: Dirk Meyer dirk.meyer dinoex.sub.org Reviewed by: sam Approved by: ed (mentor) MFC after: 1 month Modified: head/sbin/ifconfig/regdomain.c Modified: head/sbin/ifconfig/regdomain.c ============================================================================== --- head/sbin/ifconfig/regdomain.c Tue Dec 15 20:20:05 2009 (r200586) +++ head/sbin/ifconfig/regdomain.c Tue Dec 15 20:44:12 2009 (r200587) @@ -694,8 +694,11 @@ lib80211_country_findbyname(const struct len = strlen(name); LIST_FOREACH(cp, &rdp->countries, next) { - if (strcasecmp(cp->isoname, name) == 0 || - strncasecmp(cp->name, name, len) == 0) + if (strcasecmp(cp->isoname, name) == 0) + return cp; + } + LIST_FOREACH(cp, &rdp->countries, next) { + if (strncasecmp(cp->name, name, len) == 0) return cp; } return NULL; From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 21:02:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1B351065679; Tue, 15 Dec 2009 21:02:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1AB78FC15; Tue, 15 Dec 2009 21:02:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFL2Tuo075309; Tue, 15 Dec 2009 21:02:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFL2TgD075307; Tue, 15 Dec 2009 21:02:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912152102.nBFL2TgD075307@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Dec 2009 21:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200589 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:02:29 -0000 Author: jilles Date: Tue Dec 15 21:02:29 2009 New Revision: 200589 URL: http://svn.freebsd.org/changeset/base/200589 Log: cpuset(2): fix a typo and a markup error in the man page MFC after: 1 week Modified: head/lib/libc/sys/cpuset.2 Modified: head/lib/libc/sys/cpuset.2 ============================================================================== --- head/lib/libc/sys/cpuset.2 Tue Dec 15 20:47:51 2009 (r200588) +++ head/lib/libc/sys/cpuset.2 Tue Dec 15 21:02:29 2009 (r200589) @@ -96,7 +96,7 @@ The .Fa which argument may have the following values: .Bl -column CPU_WHICH_CPUSET -offset indent -.It Dv CPU_WHICH_TID Ta "id is lpwid_t (thread id)" +.It Dv CPU_WHICH_TID Ta "id is lwpid_t (thread id)" .It Dv CPU_WHICH_PID Ta "id is pid_t (process id)" .It Dv CPU_WHICH_CPUSET Ta "id is a cpusetid_t (cpuset id)" .It Dv CPU_WHICH_IRQ Ta "id is an irq number" @@ -209,7 +209,7 @@ The calling process did not have the cre operation. .It Bq Er ENFILE There was no free -.Fn cpusetid_t +.Ft cpusetid_t for allocation. .El .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 21:10:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 200151065694 for ; Tue, 15 Dec 2009 21:10:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id AF42F8FC14 for ; Tue, 15 Dec 2009 21:10:22 +0000 (UTC) Received: (qmail 5890 invoked by uid 399); 15 Dec 2009 21:10:21 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Dec 2009 21:10:21 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B27FB3D.9010905@FreeBSD.org> Date: Tue, 15 Dec 2009 13:10:21 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ollivier Robert References: <200912151459.nBFExwN7066718@svn.freebsd.org> In-Reply-To: <200912151459.nBFExwN7066718@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200577 - in head/usr.sbin/ntp: . ntptrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:10:23 -0000 Ollivier Robert wrote: > Author: roberto > Date: Tue Dec 15 14:59:58 2009 > New Revision: 200577 > URL: http://svn.freebsd.org/changeset/base/200577 > > Log: > ntpd 4.2.4p8 is now in the tree, ntptrace is dead RIP. Perhaps a note in UPDATING this, and what to do instead? Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 21:12:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7941065694 for ; Tue, 15 Dec 2009 21:12:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id A08298FC1C for ; Tue, 15 Dec 2009 21:12:10 +0000 (UTC) Received: (qmail 8360 invoked by uid 399); 15 Dec 2009 21:12:10 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Dec 2009 21:12:10 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B27FBA9.8090204@FreeBSD.org> Date: Tue, 15 Dec 2009 13:12:09 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Robert Watson References: <200912150514.nBF5Eej4050810@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200563 - in head/etc: mtree namedb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:12:11 -0000 Robert Watson wrote: > On Tue, 15 Dec 2009, Doug Barton wrote: > >> The named process needs to have a "working directory" that it can >> write to. This is specified in "options { directory }" in named.conf. >> So, create /etc/namedb/working with appropriate permissions, and >> update the entry in named.conf to match. >> >> In addition to specifying the working directory, file and path names >> in named.conf can be specified relative to the directory listed. >> However, since that directory is now different from /etc/namedb >> (where the configuration, zone, rndc.*, and other files are located) >> further update named.conf to specify all file names with fully >> qualified paths. Also update the comment about file and path names >> so users know this should be done for all file/path names in the file. >> >> This change will eliminate the 'working directory is not writable' >> messages at boot time without sacrificing security. It will also >> allow for features in newer versions of BIND (9.7+) to work as >> designed. > > On a couple of occasions, I've found myself trying to help people get > BIND to core dump on a bug, which is a bit tricky in practice. It > involves setting appropriate sysctls so that sugid processes generate > cores, arranging for a writable core dump directory in the chroot and > setting a sysctl so it is found, etc. Does this change simplify that > process down to "enable core dump for sugid processes"? It should, yes. I was able to test all the other use cases for an unprivileged named process so I have every reason to believe that dumping a core will work too. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 21:24:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F8D11065670; Tue, 15 Dec 2009 21:24:12 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E39F8FC1F; Tue, 15 Dec 2009 21:24:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFLOCoc075765; Tue, 15 Dec 2009 21:24:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFLOCPm075761; Tue, 15 Dec 2009 21:24:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912152124.nBFLOCPm075761@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 15 Dec 2009 21:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200590 - in head/sys: conf netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 21:24:12 -0000 Author: luigi Date: Tue Dec 15 21:24:12 2009 New Revision: 200590 URL: http://svn.freebsd.org/changeset/base/200590 Log: more splitting of ip_fw2.c, now extract the 'table' routines and the sockopt routines (the upper half of the kernel). Whoever is the author of the 'table' code (Ruslan/glebius/oleg ?) please change the attribution in ip_fw_table.c. I have copied the copyright line from ip_fw2.c but it carries my name and I have neither written nor designed the feature so I don't deserve the credit. MFC after: 1 month Added: head/sys/netinet/ipfw/ip_fw_sockopt.c (contents, props changed) head/sys/netinet/ipfw/ip_fw_table.c (contents, props changed) Modified: head/sys/conf/files head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_private.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 15 21:02:29 2009 (r200589) +++ head/sys/conf/files Tue Dec 15 21:24:12 2009 (r200590) @@ -2430,6 +2430,8 @@ netinet/ipfw/ip_fw2.c optional inet ipf netinet/ipfw/ip_fw_dynamic.c optional inet ipfirewall netinet/ipfw/ip_fw_log.c optional inet ipfirewall netinet/ipfw/ip_fw_pfil.c optional inet ipfirewall +netinet/ipfw/ip_fw_sockopt.c optional inet ipfirewall +netinet/ipfw/ip_fw_table.c optional inet ipfirewall netinet/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netinet/ip_icmp.c optional inet netinet/ip_input.c optional inet Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 21:02:29 2009 (r200589) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Dec 15 21:24:12 2009 (r200590) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include /* for ETHERTYPE_IP */ #include -#include #include #include #include @@ -112,7 +111,7 @@ static VNET_DEFINE(int, ipfw_vnet_ready) * and CANNOT be disabled. * Rules in set RESVD_SET can only be deleted explicitly. */ -static VNET_DEFINE(u_int32_t, set_disable); +VNET_DEFINE(u_int32_t, set_disable); VNET_DEFINE(int, fw_verbose); #define V_set_disable VNET(set_disable) @@ -132,8 +131,6 @@ struct ip_fw *ip_fw_default_rule; VNET_DEFINE(struct ip_fw_chain, layer3_chain); MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); -MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables"); -#define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) ipfw_nat_t *ipfw_nat_ptr = NULL; struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; @@ -152,10 +149,6 @@ static VNET_DEFINE(int, autoinc_step); static VNET_DEFINE(int, fw_deny_unknown_exthdrs); #define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) -static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ -static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ -#define V_static_count VNET(static_count) -#define V_static_len VNET(static_len) extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); #ifdef SYSCTL_NODE @@ -197,9 +190,6 @@ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_A "Deny packets with unknown IPv6 Extension Headers"); #endif /* INET6 */ -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, - CTLFLAG_RD, &VNET_NAME(static_count), 0, - "Number of static rules"); #endif /* SYSCTL_NODE */ @@ -693,193 +683,6 @@ lookup_next_rule(struct ip_fw *me, u_int } static int -add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, - uint8_t mlen, uint32_t value) -{ - struct radix_node_head *rnh; - struct table_entry *ent; - struct radix_node *rn; - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - ent = malloc(sizeof(*ent), M_IPFW_TBL, M_NOWAIT | M_ZERO); - if (ent == NULL) - return (ENOMEM); - ent->value = value; - ent->addr.sin_len = ent->mask.sin_len = 8; - ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); - ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; - IPFW_WLOCK(ch); - rn = rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent); - if (rn == NULL) { - IPFW_WUNLOCK(ch); - free(ent, M_IPFW_TBL); - return (EEXIST); - } - IPFW_WUNLOCK(ch); - return (0); -} - -static int -del_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, - uint8_t mlen) -{ - struct radix_node_head *rnh; - struct table_entry *ent; - struct sockaddr_in sa, mask; - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - sa.sin_len = mask.sin_len = 8; - mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); - sa.sin_addr.s_addr = addr & mask.sin_addr.s_addr; - IPFW_WLOCK(ch); - ent = (struct table_entry *)rnh->rnh_deladdr(&sa, &mask, rnh); - if (ent == NULL) { - IPFW_WUNLOCK(ch); - return (ESRCH); - } - IPFW_WUNLOCK(ch); - free(ent, M_IPFW_TBL); - return (0); -} - -static int -flush_table_entry(struct radix_node *rn, void *arg) -{ - struct radix_node_head * const rnh = arg; - struct table_entry *ent; - - ent = (struct table_entry *) - rnh->rnh_deladdr(rn->rn_key, rn->rn_mask, rnh); - if (ent != NULL) - free(ent, M_IPFW_TBL); - return (0); -} - -static int -flush_table(struct ip_fw_chain *ch, uint16_t tbl) -{ - struct radix_node_head *rnh; - - IPFW_WLOCK_ASSERT(ch); - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - KASSERT(rnh != NULL, ("NULL IPFW table")); - rnh->rnh_walktree(rnh, flush_table_entry, rnh); - return (0); -} - -static void -flush_tables(struct ip_fw_chain *ch) -{ - uint16_t tbl; - - IPFW_WLOCK_ASSERT(ch); - - for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) - flush_table(ch, tbl); -} - -static int -init_tables(struct ip_fw_chain *ch) -{ - int i; - uint16_t j; - - for (i = 0; i < IPFW_TABLES_MAX; i++) { - if (!rn_inithead((void **)&ch->tables[i], 32)) { - for (j = 0; j < i; j++) { - (void) flush_table(ch, j); - } - return (ENOMEM); - } - } - return (0); -} - -static int -lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, - uint32_t *val) -{ - struct radix_node_head *rnh; - struct table_entry *ent; - struct sockaddr_in sa; - - if (tbl >= IPFW_TABLES_MAX) - return (0); - rnh = ch->tables[tbl]; - sa.sin_len = 8; - sa.sin_addr.s_addr = addr; - ent = (struct table_entry *)(rnh->rnh_lookup(&sa, NULL, rnh)); - if (ent != NULL) { - *val = ent->value; - return (1); - } - return (0); -} - -static int -count_table_entry(struct radix_node *rn, void *arg) -{ - u_int32_t * const cnt = arg; - - (*cnt)++; - return (0); -} - -static int -count_table(struct ip_fw_chain *ch, uint32_t tbl, uint32_t *cnt) -{ - struct radix_node_head *rnh; - - if (tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl]; - *cnt = 0; - rnh->rnh_walktree(rnh, count_table_entry, cnt); - return (0); -} - -static int -dump_table_entry(struct radix_node *rn, void *arg) -{ - struct table_entry * const n = (struct table_entry *)rn; - ipfw_table * const tbl = arg; - ipfw_table_entry *ent; - - if (tbl->cnt == tbl->size) - return (1); - ent = &tbl->ent[tbl->cnt]; - ent->tbl = tbl->tbl; - if (in_nullhost(n->mask.sin_addr)) - ent->masklen = 0; - else - ent->masklen = 33 - ffs(ntohl(n->mask.sin_addr.s_addr)); - ent->addr = n->addr.sin_addr.s_addr; - ent->value = n->value; - tbl->cnt++; - return (0); -} - -static int -dump_table(struct ip_fw_chain *ch, ipfw_table *tbl) -{ - struct radix_node_head *rnh; - - if (tbl->tbl >= IPFW_TABLES_MAX) - return (EINVAL); - rnh = ch->tables[tbl->tbl]; - tbl->cnt = 0; - rnh->rnh_walktree(rnh, dump_table_entry, tbl); - return (0); -} - -static int check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif, struct in_addr dst_ip, u_int16_t dst_port, struct in_addr src_ip, u_int16_t src_port, struct ucred **uc, int *ugid_lookupp, @@ -1636,7 +1439,7 @@ do { \ } else break; } - match = lookup_table(chain, cmd->arg1, a, + match = ipfw_lookup_table(chain, cmd->arg1, a, &v); if (!match) break; @@ -2448,1010 +2251,6 @@ pullup_failed: return (IP_FW_DENY); } -/* - * When a rule is added/deleted, clear the next_rule pointers in all rules. - * These will be reconstructed on the fly as packets are matched. - */ -static void -flush_rule_ptrs(struct ip_fw_chain *chain) -{ - struct ip_fw *rule; - - IPFW_WLOCK_ASSERT(chain); - - chain->id++; - - for (rule = chain->rules; rule; rule = rule->next) - rule->next_rule = NULL; -} - -/* - * Add a new rule to the list. Copy the rule into a malloc'ed area, then - * possibly create a rule number and add the rule to the list. - * Update the rule_number in the input struct so the caller knows it as well. - */ -static int -add_rule(struct ip_fw_chain *chain, struct ip_fw *input_rule) -{ - struct ip_fw *rule, *f, *prev; - int l = RULESIZE(input_rule); - - if (chain->rules == NULL && input_rule->rulenum != IPFW_DEFAULT_RULE) - return (EINVAL); - - rule = malloc(l, M_IPFW, M_NOWAIT | M_ZERO); - if (rule == NULL) - return (ENOSPC); - - bcopy(input_rule, rule, l); - - rule->next = NULL; - rule->next_rule = NULL; - - rule->pcnt = 0; - rule->bcnt = 0; - rule->timestamp = 0; - - IPFW_WLOCK(chain); - - if (chain->rules == NULL) { /* default rule */ - chain->rules = rule; - rule->id = ++chain->id; - goto done; - } - - /* - * If rulenum is 0, find highest numbered rule before the - * default rule, and add autoinc_step - */ - if (V_autoinc_step < 1) - V_autoinc_step = 1; - else if (V_autoinc_step > 1000) - V_autoinc_step = 1000; - if (rule->rulenum == 0) { - /* - * locate the highest numbered rule before default - */ - for (f = chain->rules; f; f = f->next) { - if (f->rulenum == IPFW_DEFAULT_RULE) - break; - rule->rulenum = f->rulenum; - } - if (rule->rulenum < IPFW_DEFAULT_RULE - V_autoinc_step) - rule->rulenum += V_autoinc_step; - input_rule->rulenum = rule->rulenum; - } - - /* - * Now insert the new rule in the right place in the sorted list. - */ - for (prev = NULL, f = chain->rules; f; prev = f, f = f->next) { - if (f->rulenum > rule->rulenum) { /* found the location */ - if (prev) { - rule->next = f; - prev->next = rule; - } else { /* head insert */ - rule->next = chain->rules; - chain->rules = rule; - } - break; - } - } - flush_rule_ptrs(chain); - /* chain->id incremented inside flush_rule_ptrs() */ - rule->id = chain->id; -done: - V_static_count++; - V_static_len += l; - IPFW_WUNLOCK(chain); - DEB(printf("ipfw: installed rule %d, static count now %d\n", - rule->rulenum, V_static_count);) - return (0); -} - -/** - * Remove a static rule (including derived * dynamic rules) - * and place it on the ``reap list'' for later reclamation. - * The caller is in charge of clearing rule pointers to avoid - * dangling pointers. - * @return a pointer to the next entry. - * Arguments are not checked, so they better be correct. - */ -static struct ip_fw * -remove_rule(struct ip_fw_chain *chain, struct ip_fw *rule, - struct ip_fw *prev) -{ - struct ip_fw *n; - int l = RULESIZE(rule); - - IPFW_WLOCK_ASSERT(chain); - - n = rule->next; - remove_dyn_children(rule); - if (prev == NULL) - chain->rules = n; - else - prev->next = n; - V_static_count--; - V_static_len -= l; - - rule->next = chain->reap; - chain->reap = rule; - - return n; -} - -/* - * Reclaim storage associated with a list of rules. This is - * typically the list created using remove_rule. - * A NULL pointer on input is handled correctly. - */ -static void -reap_rules(struct ip_fw *head) -{ - struct ip_fw *rule; - - while ((rule = head) != NULL) { - head = head->next; - free(rule, M_IPFW); - } -} - -/* - * Remove all rules from a chain (except rules in set RESVD_SET - * unless kill_default = 1). The caller is responsible for - * reclaiming storage for the rules left in chain->reap. - */ -static void -free_chain(struct ip_fw_chain *chain, int kill_default) -{ - struct ip_fw *prev, *rule; - - IPFW_WLOCK_ASSERT(chain); - - chain->reap = NULL; - flush_rule_ptrs(chain); /* more efficient to do outside the loop */ - for (prev = NULL, rule = chain->rules; rule ; ) - if (kill_default || rule->set != RESVD_SET) - rule = remove_rule(chain, rule, prev); - else { - prev = rule; - rule = rule->next; - } -} - -/** - * Remove all rules with given number, and also do set manipulation. - * Assumes chain != NULL && *chain != NULL. - * - * The argument is an u_int32_t. The low 16 bit are the rule or set number, - * the next 8 bits are the new set, the top 8 bits are the command: - * - * 0 delete rules with given number - * 1 delete rules with given set number - * 2 move rules with given number to new set - * 3 move rules with given set number to new set - * 4 swap sets with given numbers - * 5 delete rules with given number and with given set number - */ -static int -del_entry(struct ip_fw_chain *chain, u_int32_t arg) -{ - struct ip_fw *prev = NULL, *rule; - u_int16_t rulenum; /* rule or old_set */ - u_int8_t cmd, new_set; - - rulenum = arg & 0xffff; - cmd = (arg >> 24) & 0xff; - new_set = (arg >> 16) & 0xff; - - if (cmd > 5 || new_set > RESVD_SET) - return EINVAL; - if (cmd == 0 || cmd == 2 || cmd == 5) { - if (rulenum >= IPFW_DEFAULT_RULE) - return EINVAL; - } else { - if (rulenum > RESVD_SET) /* old_set */ - return EINVAL; - } - - IPFW_WLOCK(chain); - rule = chain->rules; /* common starting point */ - chain->reap = NULL; /* prepare for deletions */ - switch (cmd) { - case 0: /* delete rules with given number */ - /* - * locate first rule to delete - */ - for (; rule->rulenum < rulenum; prev = rule, rule = rule->next) - ; - if (rule->rulenum != rulenum) { - IPFW_WUNLOCK(chain); - return EINVAL; - } - - /* - * flush pointers outside the loop, then delete all matching - * rules. prev remains the same throughout the cycle. - */ - flush_rule_ptrs(chain); - while (rule->rulenum == rulenum) - rule = remove_rule(chain, rule, prev); - break; - - case 1: /* delete all rules with given set number */ - flush_rule_ptrs(chain); - while (rule->rulenum < IPFW_DEFAULT_RULE) { - if (rule->set == rulenum) - rule = remove_rule(chain, rule, prev); - else { - prev = rule; - rule = rule->next; - } - } - break; - - case 2: /* move rules with given number to new set */ - for (; rule->rulenum < IPFW_DEFAULT_RULE; rule = rule->next) - if (rule->rulenum == rulenum) - rule->set = new_set; - break; - - case 3: /* move rules with given set number to new set */ - for (; rule->rulenum < IPFW_DEFAULT_RULE; rule = rule->next) - if (rule->set == rulenum) - rule->set = new_set; - break; - - case 4: /* swap two sets */ - for (; rule->rulenum < IPFW_DEFAULT_RULE; rule = rule->next) - if (rule->set == rulenum) - rule->set = new_set; - else if (rule->set == new_set) - rule->set = rulenum; - break; - - case 5: /* delete rules with given number and with given set number. - * rulenum - given rule number; - * new_set - given set number. - */ - for (; rule->rulenum < rulenum; prev = rule, rule = rule->next) - ; - if (rule->rulenum != rulenum) { - IPFW_WUNLOCK(chain); - return (EINVAL); - } - flush_rule_ptrs(chain); - while (rule->rulenum == rulenum) { - if (rule->set == new_set) - rule = remove_rule(chain, rule, prev); - else { - prev = rule; - rule = rule->next; - } - } - } - /* - * Look for rules to reclaim. We grab the list before - * releasing the lock then reclaim them w/o the lock to - * avoid a LOR with dummynet. - */ - rule = chain->reap; - IPFW_WUNLOCK(chain); - reap_rules(rule); - return 0; -} - -/* - * Clear counters for a specific rule. - * The enclosing "table" is assumed locked. - */ -static void -clear_counters(struct ip_fw *rule, int log_only) -{ - ipfw_insn_log *l = (ipfw_insn_log *)ACTION_PTR(rule); - - if (log_only == 0) { - rule->bcnt = rule->pcnt = 0; - rule->timestamp = 0; - } - if (l->o.opcode == O_LOG) - l->log_left = l->max_log; -} - -/** - * Reset some or all counters on firewall rules. - * The argument `arg' is an u_int32_t. The low 16 bit are the rule number, - * the next 8 bits are the set number, the top 8 bits are the command: - * 0 work with rules from all set's; - * 1 work with rules only from specified set. - * Specified rule number is zero if we want to clear all entries. - * log_only is 1 if we only want to reset logs, zero otherwise. - */ -static int -zero_entry(struct ip_fw_chain *chain, u_int32_t arg, int log_only) -{ - struct ip_fw *rule; - char *msg; - - uint16_t rulenum = arg & 0xffff; - uint8_t set = (arg >> 16) & 0xff; - uint8_t cmd = (arg >> 24) & 0xff; - - if (cmd > 1) - return (EINVAL); - if (cmd == 1 && set > RESVD_SET) - return (EINVAL); - - IPFW_WLOCK(chain); - if (rulenum == 0) { - V_norule_counter = 0; - for (rule = chain->rules; rule; rule = rule->next) { - /* Skip rules from another set. */ - if (cmd == 1 && rule->set != set) - continue; - clear_counters(rule, log_only); - } - msg = log_only ? "All logging counts reset" : - "Accounting cleared"; - } else { - int cleared = 0; - /* - * We can have multiple rules with the same number, so we - * need to clear them all. - */ - for (rule = chain->rules; rule; rule = rule->next) - if (rule->rulenum == rulenum) { - while (rule && rule->rulenum == rulenum) { - if (cmd == 0 || rule->set == set) - clear_counters(rule, log_only); - rule = rule->next; - } - cleared = 1; - break; - } - if (!cleared) { /* we did not find any matching rules */ - IPFW_WUNLOCK(chain); - return (EINVAL); - } - msg = log_only ? "logging count reset" : "cleared"; - } - IPFW_WUNLOCK(chain); - - if (V_fw_verbose) { - int lev = LOG_SECURITY | LOG_NOTICE; - - if (rulenum) - log(lev, "ipfw: Entry %d %s.\n", rulenum, msg); - else - log(lev, "ipfw: %s.\n", msg); - } - return (0); -} - -/* - * Check validity of the structure before insert. - * Fortunately rules are simple, so this mostly need to check rule sizes. - */ -static int -check_ipfw_struct(struct ip_fw *rule, int size) -{ - int l, cmdlen = 0; - int have_action=0; - ipfw_insn *cmd; - - if (size < sizeof(*rule)) { - printf("ipfw: rule too short\n"); - return (EINVAL); - } - /* first, check for valid size */ - l = RULESIZE(rule); - if (l != size) { - printf("ipfw: size mismatch (have %d want %d)\n", size, l); - return (EINVAL); - } - if (rule->act_ofs >= rule->cmd_len) { - printf("ipfw: bogus action offset (%u > %u)\n", - rule->act_ofs, rule->cmd_len - 1); - return (EINVAL); - } - /* - * Now go for the individual checks. Very simple ones, basically only - * instruction sizes. - */ - for (l = rule->cmd_len, cmd = rule->cmd ; - l > 0 ; l -= cmdlen, cmd += cmdlen) { - cmdlen = F_LEN(cmd); - if (cmdlen > l) { - printf("ipfw: opcode %d size truncated\n", - cmd->opcode); - return EINVAL; - } - DEB(printf("ipfw: opcode %d\n", cmd->opcode);) - switch (cmd->opcode) { - case O_PROBE_STATE: - case O_KEEP_STATE: - case O_PROTO: - case O_IP_SRC_ME: - case O_IP_DST_ME: - case O_LAYER2: - case O_IN: - case O_FRAG: - case O_DIVERTED: - case O_IPOPT: - case O_IPTOS: - case O_IPPRECEDENCE: - case O_IPVER: - case O_TCPWIN: - case O_TCPFLAGS: - case O_TCPOPTS: - case O_ESTAB: - case O_VERREVPATH: - case O_VERSRCREACH: - case O_ANTISPOOF: - case O_IPSEC: -#ifdef INET6 - case O_IP6_SRC_ME: - case O_IP6_DST_ME: - case O_EXT_HDR: - case O_IP6: -#endif - case O_IP4: - case O_TAG: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - break; - - case O_FIB: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - if (cmd->arg1 >= rt_numfibs) { - printf("ipfw: invalid fib number %d\n", - cmd->arg1); - return EINVAL; - } - break; - - case O_SETFIB: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - if (cmd->arg1 >= rt_numfibs) { - printf("ipfw: invalid fib number %d\n", - cmd->arg1); - return EINVAL; - } - goto check_action; - - case O_UID: - case O_GID: - case O_JAIL: - case O_IP_SRC: - case O_IP_DST: - case O_TCPSEQ: - case O_TCPACK: - case O_PROB: - case O_ICMPTYPE: - if (cmdlen != F_INSN_SIZE(ipfw_insn_u32)) - goto bad_size; - break; - - case O_LIMIT: - if (cmdlen != F_INSN_SIZE(ipfw_insn_limit)) - goto bad_size; - break; - - case O_LOG: - if (cmdlen != F_INSN_SIZE(ipfw_insn_log)) - goto bad_size; - - ((ipfw_insn_log *)cmd)->log_left = - ((ipfw_insn_log *)cmd)->max_log; - - break; - - case O_IP_SRC_MASK: - case O_IP_DST_MASK: - /* only odd command lengths */ - if ( !(cmdlen & 1) || cmdlen > 31) - goto bad_size; - break; - - case O_IP_SRC_SET: - case O_IP_DST_SET: - if (cmd->arg1 == 0 || cmd->arg1 > 256) { - printf("ipfw: invalid set size %d\n", - cmd->arg1); - return EINVAL; - } - if (cmdlen != F_INSN_SIZE(ipfw_insn_u32) + - (cmd->arg1+31)/32 ) - goto bad_size; - break; - - case O_IP_SRC_LOOKUP: - case O_IP_DST_LOOKUP: - if (cmd->arg1 >= IPFW_TABLES_MAX) { - printf("ipfw: invalid table number %d\n", - cmd->arg1); - return (EINVAL); - } - if (cmdlen != F_INSN_SIZE(ipfw_insn) && - cmdlen != F_INSN_SIZE(ipfw_insn_u32) + 1 && - cmdlen != F_INSN_SIZE(ipfw_insn_u32)) - goto bad_size; - break; - - case O_MACADDR2: - if (cmdlen != F_INSN_SIZE(ipfw_insn_mac)) - goto bad_size; - break; - - case O_NOP: - case O_IPID: - case O_IPTTL: - case O_IPLEN: - case O_TCPDATALEN: - case O_TAGGED: - if (cmdlen < 1 || cmdlen > 31) - goto bad_size; - break; - - case O_MAC_TYPE: - case O_IP_SRCPORT: - case O_IP_DSTPORT: /* XXX artificial limit, 30 port pairs */ - if (cmdlen < 2 || cmdlen > 31) - goto bad_size; - break; - - case O_RECV: - case O_XMIT: - case O_VIA: - if (cmdlen != F_INSN_SIZE(ipfw_insn_if)) - goto bad_size; - break; - - case O_ALTQ: - if (cmdlen != F_INSN_SIZE(ipfw_insn_altq)) - goto bad_size; - break; - - case O_PIPE: - case O_QUEUE: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; - goto check_action; - - case O_FORWARD_IP: -#ifdef IPFIREWALL_FORWARD - if (cmdlen != F_INSN_SIZE(ipfw_insn_sa)) - goto bad_size; - goto check_action; -#else - return EINVAL; -#endif - - case O_DIVERT: - case O_TEE: - if (ip_divert_ptr == NULL) - return EINVAL; - else - goto check_size; - case O_NETGRAPH: - case O_NGTEE: - if (!NG_IPFW_LOADED) - return EINVAL; - else - goto check_size; - case O_NAT: - if (!IPFW_NAT_LOADED) - return EINVAL; - if (cmdlen != F_INSN_SIZE(ipfw_insn_nat)) - goto bad_size; - goto check_action; - case O_FORWARD_MAC: /* XXX not implemented yet */ - case O_CHECK_STATE: - case O_COUNT: - case O_ACCEPT: - case O_DENY: - case O_REJECT: -#ifdef INET6 - case O_UNREACH6: -#endif - case O_SKIPTO: - case O_REASS: -check_size: - if (cmdlen != F_INSN_SIZE(ipfw_insn)) - goto bad_size; -check_action: - if (have_action) { - printf("ipfw: opcode %d, multiple actions" - " not allowed\n", - cmd->opcode); - return EINVAL; - } - have_action = 1; - if (l != cmdlen) { - printf("ipfw: opcode %d, action must be" - " last opcode\n", - cmd->opcode); - return EINVAL; - } - break; -#ifdef INET6 - case O_IP6_SRC: - case O_IP6_DST: - if (cmdlen != F_INSN_SIZE(struct in6_addr) + - F_INSN_SIZE(ipfw_insn)) - goto bad_size; - break; - - case O_FLOW6ID: - if (cmdlen != F_INSN_SIZE(ipfw_insn_u32) + - ((ipfw_insn_u32 *)cmd)->o.arg1) - goto bad_size; - break; - - case O_IP6_SRC_MASK: - case O_IP6_DST_MASK: - if ( !(cmdlen & 1) || cmdlen > 127) - goto bad_size; - break; - case O_ICMP6TYPE: - if( cmdlen != F_INSN_SIZE( ipfw_insn_icmp6 ) ) - goto bad_size; - break; -#endif - - default: - switch (cmd->opcode) { -#ifndef INET6 - case O_IP6_SRC_ME: - case O_IP6_DST_ME: - case O_EXT_HDR: - case O_IP6: - case O_UNREACH6: - case O_IP6_SRC: - case O_IP6_DST: - case O_FLOW6ID: - case O_IP6_SRC_MASK: - case O_IP6_DST_MASK: - case O_ICMP6TYPE: - printf("ipfw: no IPv6 support in kernel\n"); - return EPROTONOSUPPORT; -#endif - default: - printf("ipfw: opcode %d, unknown opcode\n", - cmd->opcode); - return EINVAL; - } - } - } - if (have_action == 0) { - printf("ipfw: missing action\n"); - return EINVAL; - } - return 0; - -bad_size: - printf("ipfw: opcode %d size %d wrong\n", - cmd->opcode, cmdlen); - return EINVAL; -} - -/* - * Copy the static and dynamic rules to the supplied buffer - * and return the amount of space actually used. - */ -static size_t -ipfw_getrules(struct ip_fw_chain *chain, void *buf, size_t space) -{ - char *bp = buf; - char *ep = bp + space; - struct ip_fw *rule; - int i; - time_t boot_seconds; - - boot_seconds = boottime.tv_sec; - /* XXX this can take a long time and locking will block packet flow */ - IPFW_RLOCK(chain); - for (rule = chain->rules; rule ; rule = rule->next) { - /* - * Verify the entry fits in the buffer in case the - * rules changed between calculating buffer space and - * now. This would be better done using a generation - * number but should suffice for now. - */ - i = RULESIZE(rule); - if (bp + i <= ep) { - bcopy(rule, bp, i); - /* - * XXX HACK. Store the disable mask in the "next" - * pointer in a wild attempt to keep the ABI the same. - * Why do we do this on EVERY rule? - */ - bcopy(&V_set_disable, - &(((struct ip_fw *)bp)->next_rule), - sizeof(V_set_disable)); - if (((struct ip_fw *)bp)->timestamp) - ((struct ip_fw *)bp)->timestamp += boot_seconds; - bp += i; - } - } - IPFW_RUNLOCK(chain); - ipfw_get_dynamic(&bp, ep); - return (bp - (char *)buf); -} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Dec 15 22:44:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A8651065670; Tue, 15 Dec 2009 22:44:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 306C78FC1B; Tue, 15 Dec 2009 22:44:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFMiT4a077328; Tue, 15 Dec 2009 22:44:29 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFMiTlf077326; Tue, 15 Dec 2009 22:44:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912152244.nBFMiTlf077326@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Dec 2009 22:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200591 - head/sys/compat/x86bios X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 22:44:29 -0000 Author: jkim Date: Tue Dec 15 22:44:28 2009 New Revision: 200591 URL: http://svn.freebsd.org/changeset/base/200591 Log: Add two new debugging tunables for x86bios instead of abusing bootverbose, i.e., debug.x86bios.call and debug.x86bios.int. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Tue Dec 15 21:24:12 2009 (r200590) +++ head/sys/compat/x86bios/x86bios.c Tue Dec 15 22:44:28 2009 (r200591) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,6 +81,16 @@ static vm_offset_t *x86bios_map; static vm_paddr_t x86bios_seg_phys; +SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging"); +static int x86bios_trace_call; +TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call); +SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0, + "Trace far function calls"); +static int x86bios_trace_int; +TUNABLE_INT("debug.x86bios.int", &x86bios_trace_int); +SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RW, &x86bios_trace_int, 0, + "Trace software interrupt handlers"); + static void * x86bios_get_pages(uint32_t offset, size_t size) { @@ -312,7 +323,7 @@ x86bios_call(struct x86regs *regs, uint1 if (x86bios_map == NULL) return; - if (bootverbose) + if (x86bios_trace_call) printf("Calling 0x%05x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, @@ -324,7 +335,7 @@ x86bios_call(struct x86regs *regs, uint1 memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); mtx_unlock_spin(&x86bios_lock); - if (bootverbose) + if (x86bios_trace_call) printf("Exiting 0x%05x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, @@ -351,7 +362,7 @@ x86bios_intr(struct x86regs *regs, int i if (x86bios_map == NULL) return; - if (bootverbose) + if (x86bios_trace_int) printf("Calling int 0x%x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", intno, regs->R_AX, regs->R_BX, regs->R_CX, @@ -363,7 +374,7 @@ x86bios_intr(struct x86regs *regs, int i memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); mtx_unlock_spin(&x86bios_lock); - if (bootverbose) + if (x86bios_trace_int) printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", intno, regs->R_AX, regs->R_BX, regs->R_CX, From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 02:17:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58004106566C; Wed, 16 Dec 2009 02:17:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43D048FC0A; Wed, 16 Dec 2009 02:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG2HiYt081760; Wed, 16 Dec 2009 02:17:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG2Hir1081750; Wed, 16 Dec 2009 02:17:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912160217.nBG2Hir1081750@svn.freebsd.org> From: Doug Barton Date: Wed, 16 Dec 2009 02:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200594 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 02:17:44 -0000 Author: dougb Date: Wed Dec 16 02:17:43 2009 New Revision: 200594 URL: http://svn.freebsd.org/changeset/base/200594 Log: Add INCLUDE_CONFIG_FILE, and a note in comments about how to also include the comments with CONFIGARGS Modified: head/sys/amd64/conf/DEFAULTS head/sys/arm/conf/DEFAULTS head/sys/i386/conf/DEFAULTS head/sys/ia64/conf/DEFAULTS head/sys/mips/conf/DEFAULTS head/sys/pc98/conf/DEFAULTS head/sys/powerpc/conf/DEFAULTS head/sys/sparc64/conf/DEFAULTS head/sys/sun4v/conf/DEFAULTS Modified: head/sys/amd64/conf/DEFAULTS ============================================================================== --- head/sys/amd64/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/amd64/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -21,3 +21,9 @@ options GEOM_PART_EBR options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/arm/conf/DEFAULTS ============================================================================== --- head/sys/arm/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/arm/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -9,3 +9,10 @@ device mem options GEOM_PART_BSD options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/i386/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -28,3 +28,10 @@ options GEOM_PART_MBR # enable support for native hardware options NATIVE device atpic + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/ia64/conf/DEFAULTS ============================================================================== --- head/sys/ia64/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/ia64/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -17,3 +17,10 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_GPT options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/mips/conf/DEFAULTS ============================================================================== --- head/sys/mips/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/mips/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -11,3 +11,10 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/pc98/conf/DEFAULTS ============================================================================== --- head/sys/pc98/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/pc98/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -24,3 +24,10 @@ device uart_ns8250 # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_PC98 + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/powerpc/conf/DEFAULTS ============================================================================== --- head/sys/powerpc/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/powerpc/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -14,3 +14,10 @@ device uart_z8530 options GEOM_PART_APM options GEOM_PART_MBR + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/sparc64/conf/DEFAULTS ============================================================================== --- head/sys/sparc64/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/sparc64/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -19,3 +19,10 @@ options GEOM_PART_VTOC8 # Let sunkbd emulate an AT keyboard by default. options SUNKBD_EMULATE_ATKBD + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/sun4v/conf/DEFAULTS ============================================================================== --- head/sys/sun4v/conf/DEFAULTS Tue Dec 15 23:22:19 2009 (r200593) +++ head/sys/sun4v/conf/DEFAULTS Wed Dec 16 02:17:43 2009 (r200594) @@ -11,3 +11,10 @@ device mem # Memory and kernel memory # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_VTOC8 + +# Store the plain version of the configuration file in the kernel itself. +# To store the entire file, including comments, put this in /etc/src.conf: +# CONFIGARGS= -C +# See config(8) for more details. +# +options INCLUDE_CONFIG_FILE # Include this file in kernel From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 02:54:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 714671065670; Wed, 16 Dec 2009 02:54:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 469BA8FC29; Wed, 16 Dec 2009 02:54:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG2sYwK082661; Wed, 16 Dec 2009 02:54:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG2sYLP082659; Wed, 16 Dec 2009 02:54:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160254.nBG2sYLP082659@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 02:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200596 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 02:54:34 -0000 Author: imp Date: Wed Dec 16 02:54:34 2009 New Revision: 200596 URL: http://svn.freebsd.org/changeset/base/200596 Log: Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN}, which disables doing a make obj. Use it when you know it will work only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep doing obj when doing incremental kernel builds. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 16 02:52:33 2009 (r200595) +++ head/Makefile.inc1 Wed Dec 16 02:54:34 2009 (r200596) @@ -5,10 +5,11 @@ # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir # -DNO_CLEAN do not clean at all # -DNO_SHARE do not go into share subdir -# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELDEPEND +# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel +# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects @@ -694,6 +695,7 @@ distrib-dirs distribution: NO_KERNELCLEAN= t NO_KERNELCONFIG= t NO_KERNELDEPEND= t +NO_KERNELOBJ= t # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah .if !defined(KERNCONF) && ${KERNFAST} != "1" KERNCONF=${KERNFAST} @@ -763,11 +765,13 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} .endif +.if !defined(NO_KERNELOBJ) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj +.endif @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.3: build tools" From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 03:22:45 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F170F106566B; Wed, 16 Dec 2009 03:22:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ADE878FC13; Wed, 16 Dec 2009 03:22:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBG3FqKU002339; Tue, 15 Dec 2009 20:15:52 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 15 Dec 2009 20:16:21 -0700 (MST) Message-Id: <20091215.201621.756168950458235997.imp@bsdimp.com> To: luigi@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200912151615.nBFGFEOq068598@svn.freebsd.org> References: <200912151615.nBFGFEOq068598@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200580 - in head/sys: conf net netinet netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:22:46 -0000 In message: <200912151615.nBFGFEOq068598@svn.freebsd.org> Luigi Rizzo writes: : Log: : Start splitting ip_fw2.c and ip_fw.h into smaller components. : At this time we pull out from ip_fw2.c the logging functions, and : support for dynamic rules, and move kernel-only stuff into : netinet/ipfw/ip_fw_private.h : : No ABI change involved in this commit, unless I made some mistake. : ip_fw.h has changed, though not in the userland-visible part. ... : netinet/ipfw/ip_fw_nat.c : minor rearrangement to remove LOOKUP_NAT from the : main headers. This require a new function pointer. This broke the build. Here's the fix: Index: sys/netinet/ipfw/ip_fw_nat.c =================================================================== --- sys/netinet/ipfw/ip_fw_nat.c (revision 200593) +++ sys/netinet/ipfw/ip_fw_nat.c (working copy) @@ -70,12 +70,6 @@ static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); #define V_ifaddr_event_tag VNET(ifaddr_event_tag) -extern ipfw_nat_t *ipfw_nat_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; - static void ifaddr_change(void *arg __unused, struct ifnet *ifp) { Warner From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 03:25:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E943106566B; Wed, 16 Dec 2009 03:25:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 642A68FC1B; Wed, 16 Dec 2009 03:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG3PhKC083555; Wed, 16 Dec 2009 03:25:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG3PhOx083552; Wed, 16 Dec 2009 03:25:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160325.nBG3PhOx083552@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 03:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200597 - in head/share/man: man5 man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:25:43 -0000 Author: imp Date: Wed Dec 16 03:25:43 2009 New Revision: 200597 URL: http://svn.freebsd.org/changeset/base/200597 Log: Docmuent NO_KERNEL{CLEAN,CONFIG,DEPEND,OBJ} as necessary. Update documentation on KERNFAST meaning. Modified: head/share/man/man5/make.conf.5 head/share/man/man7/build.7 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Wed Dec 16 02:54:34 2009 (r200596) +++ head/share/man/man5/make.conf.5 Wed Dec 16 03:25:43 2009 (r200597) @@ -369,6 +369,12 @@ It defaults to .It Va MODULES_OVERRIDE .Pq Vt str Set to a list of modules to build instead of all of them. +.It Va NO_KERNELCLEAN +.Pq Vt bool +Set this to skip running +.Dq Li "${MAKE} clean" +during +.Dq Li "${MAKE} buildkernel" . .It Va NO_KERNELCONFIG .Pq Vt bool Set this to skip running @@ -381,6 +387,12 @@ Set this to skip running .Dq Li "${MAKE} depend" during .Dq Li "${MAKE} buildkernel" . +.It Va NO_KERNELOBJ +.Pq Vt bool +Set this to skip running +.Dq Li "${MAKE} obj" +during +.Dq Li "${MAKE} buildkernel" . .It Va NO_MODULES .Pq Vt bool Set to not build modules with the kernel. Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Dec 16 02:54:34 2009 (r200596) +++ head/share/man/man7/build.7 Wed Dec 16 03:25:43 2009 (r200597) @@ -345,9 +345,10 @@ If set, the build target .Cm buildkernel defaults to setting .Va NO_KERNELCLEAN , -.Va NO_KERNELCONFIG +.Va NO_KERNELCONFIG , +.Va NO_KERNELDEPEND and -.Va NO_KERNELDEPEND . +.Va NO_KERNELOBJ . When set to a value other than .Cm 1 then @@ -444,6 +445,12 @@ If set, the build process does not run as part of the .Cm buildkernel target. +.It Va NO_KERNELOBJ +If set, the build process does not run +.Dq make obj +as part of the +.Cm buildkernel +target. .It Va NO_DOCUPDATE If set, the update process does not update the source of the .Fx From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 03:26:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04DB91065676; Wed, 16 Dec 2009 03:26:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E80A48FC16; Wed, 16 Dec 2009 03:26:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG3QbkX083610; Wed, 16 Dec 2009 03:26:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG3QbeH083608; Wed, 16 Dec 2009 03:26:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160326.nBG3QbeH083608@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 03:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200598 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:26:38 -0000 Author: imp Date: Wed Dec 16 03:26:37 2009 New Revision: 200598 URL: http://svn.freebsd.org/changeset/base/200598 Log: Quick fix to make this compile: Remove redundant extern declearations. If the maintainer has a better fix, then feel free to back this out. Modified: head/sys/netinet/ipfw/ip_fw_nat.c Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 03:25:43 2009 (r200597) +++ head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 03:26:37 2009 (r200598) @@ -70,12 +70,6 @@ __FBSDID("$FreeBSD$"); static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); #define V_ifaddr_event_tag VNET(ifaddr_event_tag) -extern ipfw_nat_t *ipfw_nat_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; -extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; - static void ifaddr_change(void *arg __unused, struct ifnet *ifp) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 03:29:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87A88106566C; Wed, 16 Dec 2009 03:29:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76AA28FC18; Wed, 16 Dec 2009 03:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG3T0m4083688; Wed, 16 Dec 2009 03:29:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG3T0tw083685; Wed, 16 Dec 2009 03:29:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912160329.nBG3T0tw083685@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 03:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200599 - in head/share/man: man5 man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:29:00 -0000 Author: imp Date: Wed Dec 16 03:29:00 2009 New Revision: 200599 URL: http://svn.freebsd.org/changeset/base/200599 Log: Forgot to bump .Dd, so do it with this commit. Chose local time over UTC time for the date... Modified: head/share/man/man5/make.conf.5 head/share/man/man7/build.7 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Wed Dec 16 03:26:37 2009 (r200598) +++ head/share/man/man5/make.conf.5 Wed Dec 16 03:29:00 2009 (r200599) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2009 +.Dd December 15, 2009 .Dt MAKE.CONF 5 .Os .Sh NAME Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Dec 16 03:26:37 2009 (r200598) +++ head/share/man/man7/build.7 Wed Dec 16 03:29:00 2009 (r200599) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd December 15, 2009 .Dt BUILD 7 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 03:38:24 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52708106566C; Wed, 16 Dec 2009 03:38:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0C15C8FC08; Wed, 16 Dec 2009 03:38:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBG3WpIx003024; Tue, 15 Dec 2009 20:32:51 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 15 Dec 2009 20:33:20 -0700 (MST) Message-Id: <20091215.203320.789626515546446979.imp@bsdimp.com> To: luigi@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20091215.201621.756168950458235997.imp@bsdimp.com> References: <200912151615.nBFGFEOq068598@svn.freebsd.org> <20091215.201621.756168950458235997.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200580 - in head/sys: conf net netinet netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 03:38:24 -0000 In message: <20091215.201621.756168950458235997.imp@bsdimp.com> "M. Warner Losh" writes: : In message: <200912151615.nBFGFEOq068598@svn.freebsd.org> : Luigi Rizzo writes: : : Log: : : Start splitting ip_fw2.c and ip_fw.h into smaller components. : : At this time we pull out from ip_fw2.c the logging functions, and : : support for dynamic rules, and move kernel-only stuff into : : netinet/ipfw/ip_fw_private.h : : : : No ABI change involved in this commit, unless I made some mistake. : : ip_fw.h has changed, though not in the userland-visible part. : ... : : netinet/ipfw/ip_fw_nat.c : : minor rearrangement to remove LOOKUP_NAT from the : : main headers. This require a new function pointer. : : This broke the build. : : Here's the fix: : : Index: sys/netinet/ipfw/ip_fw_nat.c : =================================================================== : --- sys/netinet/ipfw/ip_fw_nat.c (revision 200593) : +++ sys/netinet/ipfw/ip_fw_nat.c (working copy) : @@ -70,12 +70,6 @@ : static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); : #define V_ifaddr_event_tag VNET(ifaddr_event_tag) : : -extern ipfw_nat_t *ipfw_nat_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; : -extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; : - : static void : ifaddr_change(void *arg __unused, struct ifnet *ifp) : { I committed this fix. If there's a problem, feel free to back it out. Warner From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 04:19:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A84EA106566B; Wed, 16 Dec 2009 04:19:23 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A4C8FC18; Wed, 16 Dec 2009 04:19:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBG4JNrB084770; Wed, 16 Dec 2009 04:19:23 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBG4JNbR084768; Wed, 16 Dec 2009 04:19:23 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200912160419.nBG4JNbR084768@svn.freebsd.org> From: Matteo Riondato Date: Wed, 16 Dec 2009 04:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200600 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 04:19:23 -0000 Author: matteo Date: Wed Dec 16 04:19:23 2009 New Revision: 200600 URL: http://svn.freebsd.org/changeset/base/200600 Log: Modified: head/lib/libc/stdio/getline.3 Modified: head/lib/libc/stdio/getline.3 ============================================================================== --- head/lib/libc/stdio/getline.3 Wed Dec 16 03:29:00 2009 (r200599) +++ head/lib/libc/stdio/getline.3 Wed Dec 16 04:19:23 2009 (r200600) @@ -78,7 +78,8 @@ and .Fn getline functions return the number of characters written, excluding the terminating -.Dv NUL . +.Dv NUL +character. The value \-1 is returned if an error occurs, or if end-of-file is reached. .Sh EXAMPLES The following code fragment reads lines from a file and From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 05:43:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BAC61065670; Wed, 16 Dec 2009 05:43:44 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id AC50D8FC1A; Wed, 16 Dec 2009 05:43:43 +0000 (UTC) Received: from lstewart-laptop.caia.swin.edu.au (lstewart-laptop.caia.swin.edu.au [136.186.229.148]) (authenticated bits=0) by lauren.room52.net (8.14.3/8.14.3) with ESMTP id nBG5hV19098255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Dec 2009 16:43:36 +1100 (EST) (envelope-from lstewart@freebsd.org) Message-ID: <4B27684E.5050908@freebsd.org> Date: Tue, 15 Dec 2009 21:43:26 +1100 From: Lawrence Stewart User-Agent: Thunderbird 2.0.0.23 (X11/20090909) MIME-Version: 1.0 To: Jack Vogel References: <200912081854.nB8IsbrP096592@svn.freebsd.org> <4B25C3EF.5010009@freebsd.org> <2a41acea0912141045m7f1b7a8cq3eb40475f5672e7d@mail.gmail.com> In-Reply-To: <2a41acea0912141045m7f1b7a8cq3eb40475f5672e7d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_12_24,SPF_SOFTFAIL autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lauren.room52.net Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200268 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 05:43:44 -0000 Jack Vogel wrote: > Fixed in the commit today. Test again please. > > Jack > > > On Sun, Dec 13, 2009 at 8:49 PM, Lawrence Stewart > wrote: > > [picking a recent e1000 commit] > > Hi Jack, > > I'm getting the following panic on head r200376 on my HP DC7800 work > desktop: > > mtx_lock() of spin mutex &dev_spec->swflag_mutex @ > /usr/src/sys/dev/e1000/e1000_ich8lan.c:651 > > I don't experience the panic with an 8.0-RELEASE kernel. > > Anything obviously wrong with that line of code as far as you're > concerned, or do I need to dig some more detail out? Debugging with > this system is painful, hence the initial hand transcribed minimal > detail, but if you need more info I'll try figure out how to get you > what you need. Looks good, thanks for the fix. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 10:48:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15DD11065670; Wed, 16 Dec 2009 10:48:41 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01FBE8FC14; Wed, 16 Dec 2009 10:48:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGAmeFs096553; Wed, 16 Dec 2009 10:48:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGAmeON096543; Wed, 16 Dec 2009 10:48:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912161048.nBGAmeON096543@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 16 Dec 2009 10:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200601 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 10:48:41 -0000 Author: luigi Date: Wed Dec 16 10:48:40 2009 New Revision: 200601 URL: http://svn.freebsd.org/changeset/base/200601 Log: Various cosmetic cleanup of the files: - move global variables around to reduce the scope and make them static if possible; - add an ipfw_ prefix to all public functions to prevent conflicts (the same should be done for variables); - try to pack variable declaration in an uniform way across files; - clarify some comments; - remove some misspelling of names (#define V_foo VNET(bar)) that slipped in due to cut&paste - remove duplicate static variables in different files; MFC after: 1 month Modified: head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_dynamic.c head/sys/netinet/ipfw/ip_fw_log.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_private.h head/sys/netinet/ipfw/ip_fw_sockopt.c head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_dummynet.c Wed Dec 16 10:48:40 2009 (r200601) @@ -2364,3 +2364,4 @@ static moduledata_t dummynet_mod = { DECLARE_MODULE(dummynet, dummynet_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); MODULE_DEPEND(dummynet, ipfw, 2, 2, 2); MODULE_VERSION(dummynet, 1); +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw2.c Wed Dec 16 10:48:40 2009 (r200601) @@ -26,11 +26,8 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - /* - * Implement IP packet firewall (new version) + * The FreeBSD IP packet firewall, main file */ #if !defined(KLD_MODULE) @@ -101,21 +98,17 @@ __FBSDID("$FreeBSD$"); #include #endif -static VNET_DEFINE(int, ipfw_vnet_ready) = 0; -#define V_ipfw_vnet_ready VNET(ipfw_vnet_ready) /* - * set_disable contains one bit per set value (0..31). - * If the bit is set, all rules with the corresponding set - * are disabled. Set RESVD_SET(31) is reserved for the default rule - * and rules that are not deleted by the flush command, - * and CANNOT be disabled. - * Rules in set RESVD_SET can only be deleted explicitly. + * static variables followed by global ones. + * All ipfw global variables are here. */ -VNET_DEFINE(u_int32_t, set_disable); -VNET_DEFINE(int, fw_verbose); -#define V_set_disable VNET(set_disable) -#define V_verbose_limit VNET(verbose_limit) +/* ipfw_vnet_ready controls when we are open for business */ +static VNET_DEFINE(int, ipfw_vnet_ready) = 0; +#define V_ipfw_vnet_ready VNET(ipfw_vnet_ready) + +static VNET_DEFINE(int, fw_deny_unknown_exthdrs); +#define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT static int default_to_accept = 1; @@ -123,14 +116,30 @@ static int default_to_accept = 1; static int default_to_accept; #endif -struct ip_fw *ip_fw_default_rule; +VNET_DEFINE(int, autoinc_step); /* - * list of rules for layer 3 + * Each rule belongs to one of 32 different sets (0..31). + * The variable set_disable contains one bit per set. + * If the bit is set, all rules in the corresponding set + * are disabled. Set RESVD_SET(31) is reserved for the default rule + * and rules that are not deleted by the flush command, + * and CANNOT be disabled. + * Rules in set RESVD_SET can only be deleted individually. */ +VNET_DEFINE(u_int32_t, set_disable); +#define V_set_disable VNET(set_disable) + +VNET_DEFINE(int, fw_verbose); +//#define V_verbose_limit VNET(verbose_limit) +/* counter for ipfw_log(NULL...) */ +VNET_DEFINE(u_int64_t, norule_counter); +VNET_DEFINE(int, verbose_limit); + + +/* layer3_chain contains the list of rules for layer 3 */ VNET_DEFINE(struct ip_fw_chain, layer3_chain); -MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); ipfw_nat_t *ipfw_nat_ptr = NULL; struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; @@ -138,30 +147,16 @@ ipfw_nat_cfg_t *ipfw_nat_del_ptr; ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; -struct table_entry { - struct radix_node rn[2]; - struct sockaddr_in addr, mask; - u_int32_t value; -}; - -static VNET_DEFINE(int, autoinc_step); -#define V_autoinc_step VNET(autoinc_step) -static VNET_DEFINE(int, fw_deny_unknown_exthdrs); -#define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) - extern int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); #ifdef SYSCTL_NODE SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); -SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AUTO, enable, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_enable), 0, - ipfw_chg_hook, "I", "Enable ipfw"); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, - CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, - "Rule number auto-increment step"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, one_pass, CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_one_pass), 0, "Only do a single pass through ipfw when using dummynet(4)"); +SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, + CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, + "Rule number auto-increment step"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_verbose), 0, "Log matches to ipfw rules"); @@ -182,9 +177,6 @@ TUNABLE_INT("net.inet.ip.fw.default_to_a #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); -SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw6_enable), 0, - ipfw_chg_hook, "I", "Enable ipfw+6"); SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, "Deny packets with unknown IPv6 Extension Headers"); @@ -194,6 +186,7 @@ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_A /* + * Some macros used in the various matching options. * L3HDR maps an ipv4 pointer into a layer3 header pointer of type T * Other macros just cast void * into the appropriate type */ @@ -379,19 +372,20 @@ iface_match(struct ifnet *ifp, ipfw_insn * * The 'verrevpath' option checks that the interface that an IP packet * arrives on is the same interface that traffic destined for the - * packet's source address would be routed out of. The 'versrcreach' - * option just checks that the source address is reachable via any route - * (except default) in the routing table. These two are a measure to block - * forged packets. This is also commonly known as "anti-spoofing" or Unicast - * Reverse Path Forwarding (Unicast RFP) in Cisco-ese. The name of the knobs + * packet's source address would be routed out of. + * The 'versrcreach' option just checks that the source address is + * reachable via any route (except default) in the routing table. + * These two are a measure to block forged packets. This is also + * commonly known as "anti-spoofing" or Unicast Reverse Path + * Forwarding (Unicast RFP) in Cisco-ese. The name of the knobs * is purposely reminiscent of the Cisco IOS command, * * ip verify unicast reverse-path * ip verify unicast source reachable-via any * - * which implements the same functionality. But note that syntax is - * misleading. The check may be performed on all IP packets whether unicast, - * multicast, or broadcast. + * which implements the same functionality. But note that the syntax + * is misleading, and the check may be performed on all IP packets + * whether unicast, multicast, or broadcast. */ static int verify_path(struct in_addr src, struct ifnet *ifp, u_int fib) @@ -536,6 +530,7 @@ verify_path6(struct in6_addr *src, struc return 1; } + static int is_icmp6_query(int icmp6_type) { @@ -562,7 +557,7 @@ send_reject6(struct ip_fw_args *args, in if ((tcp->th_flags & TH_RST) == 0) { struct mbuf *m0; - m0 = send_pkt(args->m, &(args->f_id), + m0 = ipfw_send_pkt(args->m, &(args->f_id), ntohl(tcp->th_seq), ntohl(tcp->th_ack), tcp->th_flags | TH_RST); if (m0 != NULL) @@ -622,7 +617,7 @@ send_reject(struct ip_fw_args *args, int L3HDR(struct tcphdr, mtod(args->m, struct ip *)); if ( (tcp->th_flags & TH_RST) == 0) { struct mbuf *m; - m = send_pkt(args->m, &(args->f_id), + m = ipfw_send_pkt(args->m, &(args->f_id), ntohl(tcp->th_seq), ntohl(tcp->th_ack), tcp->th_flags | TH_RST); if (m != NULL) @@ -635,18 +630,18 @@ send_reject(struct ip_fw_args *args, int } /** - * * Given an ip_fw *, lookup_next_rule will return a pointer * to the next rule, which can be either the jump * target (for skipto instructions) or the next one in the list (in * all other cases including a missing jump target). * The result is also written in the "next_rule" field of the rule. - * Backward jumps are not allowed, so start looking from the next - * rule... + * Backward jumps are not allowed, so we start the search from the + * rule following the current one. * - * This never returns NULL -- in case we do not have an exact match, - * the next rule is returned. When the ruleset is changed, - * pointers are flushed so we are always correct. + * The function never returns NULL: if the requested rule is not + * present, it returns the next rule in the chain. + * As a side effect, the rule pointer is also set so next time + * the jump will not require a scan of the list. */ static struct ip_fw * @@ -676,12 +671,22 @@ lookup_next_rule(struct ip_fw *me, u_int } } } - if (rule == NULL) /* failure or not a skipto */ + if (rule == NULL) /* failure or not a skipto */ rule = me->next; me->next_rule = rule; return rule; } +/* + * Support for uid/gid/jail lookup. These tests are expensive + * (because we may need to look into the list of active sockets) + * so we cache the results. ugid_lookupp is 0 if we have not + * yet done a lookup, 1 if we succeeded, and -1 if we tried + * and failed. The function always returns the match value. + * We could actually spare the variable and use *uc, setting + * it to '(void *)check_uidgid if we have no info, NULL if + * we tried and failed, or any other value if successful. + */ static int check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif, struct in_addr dst_ip, u_int16_t dst_port, struct in_addr src_ip, @@ -740,10 +745,8 @@ check_uidgid(ipfw_insn_u32 *insn, int pr INP_INFO_RUNLOCK(pi); if (*ugid_lookupp == 0) { /* - * If the lookup did not yield any results, there - * is no sense in coming back and trying again. So - * we can set lookup to -1 and ensure that we wont - * bother the pcb system again. + * We tried and failed, set the variable to -1 + * so we will not try again on this packet. */ *ugid_lookupp = -1; return (0); @@ -768,10 +771,10 @@ check_uidgid(ipfw_insn_u32 *insn, int pr * * args->m (in/out) The packet; we set to NULL when/if we nuke it. * Starts with the IP header. - * args->eh (in) Mac header if present, or NULL for layer3 packet. + * args->eh (in) Mac header if present, NULL for layer3 packet. * args->L3offset Number of bytes bypassed if we came from L2. * e.g. often sizeof(eh) ** NOTYET ** - * args->oif Outgoing interface, or NULL if packet is incoming. + * args->oif Outgoing interface, NULL if packet is incoming. * The incoming interface is in the mbuf. (in) * args->divert_rule (in/out) * Skip up to the first rule past this rule number; @@ -797,7 +800,7 @@ ipfw_chk(struct ip_fw_args *args) { /* - * Local variables holding state during the processing of a packet: + * Local variables holding state while processing a packet: * * IMPORTANT NOTE: to speed up the processing of rules, there * are some assumption on the values of the variables, which @@ -932,15 +935,15 @@ ipfw_chk(struct ip_fw_args *args) * pointer might become stale after other pullups (but we never use it * this way). */ -#define PULLUP_TO(_len, p, T) \ -do { \ - int x = (_len) + sizeof(T); \ - if ((m)->m_len < x) { \ - args->m = m = m_pullup(m, x); \ - if (m == NULL) \ - goto pullup_failed; \ - } \ - p = (mtod(m, char *) + (_len)); \ +#define PULLUP_TO(_len, p, T) \ +do { \ + int x = (_len) + sizeof(T); \ + if ((m)->m_len < x) { \ + args->m = m = m_pullup(m, x); \ + if (m == NULL) \ + goto pullup_failed; \ + } \ + p = (mtod(m, char *) + (_len)); \ } while (0) /* @@ -1199,7 +1202,7 @@ do { \ if (f != NULL) f = f->next_rule; else - f = ip_fw_default_rule; + f = V_layer3_chain.default_rule; } else f = args->rule->next_rule; @@ -1905,7 +1908,7 @@ do { \ */ case O_LIMIT: case O_KEEP_STATE: - if (install_state(f, + if (ipfw_install_state(f, (ipfw_insn_limit *)cmd, args, tablearg)) { /* error or limit violation */ retval = IP_FW_DENY; @@ -1927,7 +1930,7 @@ do { \ * to be run first). */ if (dyn_dir == MATCH_UNKNOWN && - (q = lookup_dyn_rule(&args->f_id, + (q = ipfw_lookup_dyn_rule(&args->f_id, &dyn_dir, proto == IPPROTO_TCP ? TCP(ulp) : NULL)) != NULL) { @@ -2251,7 +2254,11 @@ pullup_failed: return (IP_FW_DENY); } -/**************** +/* + * Module and VNET glue + */ + +/* * Stuff that must be initialised only on boot or module load */ static int @@ -2306,7 +2313,7 @@ ipfw_init(void) return (error); } -/********************** +/* * Called for the removal of the last instance only on module unload. */ static void @@ -2317,7 +2324,7 @@ ipfw_destroy(void) printf("IP firewall unloaded\n"); } -/**************** +/* * Stuff that must be initialized for every instance * (including the first of course). */ @@ -2345,7 +2352,6 @@ vnet_ipfw_init(const void *unused) V_autoinc_step = 100; /* bounded to 1..1000 in add_rule() */ - V_fw_deny_unknown_exthdrs = 1; V_layer3_chain.rules = NULL; @@ -2368,7 +2374,7 @@ vnet_ipfw_init(const void *unused) return (error); } - ip_fw_default_rule = V_layer3_chain.rules; + V_layer3_chain.default_rule = V_layer3_chain.rules; ipfw_dyn_init(); @@ -2391,20 +2397,11 @@ vnet_ipfw_init(const void *unused) */ V_ip_fw_ctl_ptr = ipfw_ctl; V_ip_fw_chk_ptr = ipfw_chk; - if (V_fw_enable && ipfw_hook() != 0) { - error = ENOENT; /* see ip_fw_pfil.c::ipfw_hook() */ - printf("ipfw_hook() error\n"); - } -#ifdef INET6 - if (V_fw6_enable && ipfw6_hook() != 0) { - error = ENOENT; - printf("ipfw6_hook() error\n"); - } -#endif + error = ipfw_attach_hooks(); return (error); } -/*********************** +/* * Called for the removal of each instance. */ static int @@ -2514,4 +2511,4 @@ SYSUNINIT(ipfw_destroy, IPFW_SI_SUB_FIRE ipfw_destroy, NULL); VNET_SYSUNINIT(vnet_ipfw_uninit, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, vnet_ipfw_uninit, NULL); - +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 10:48:40 2009 (r200601) @@ -114,6 +114,10 @@ __FBSDID("$FreeBSD$"); * obey the 'randomized match', and we do not do multiple * passes through the firewall. XXX check the latter!!! */ + +/* + * Static variables followed by global ones + */ static VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); static VNET_DEFINE(u_int32_t, dyn_buckets); static VNET_DEFINE(u_int32_t, curr_dyn_buckets); @@ -374,7 +378,7 @@ next: } void -remove_dyn_children(struct ip_fw *rule) +ipfw_remove_dyn_children(struct ip_fw *rule) { IPFW_DYN_LOCK(); remove_dyn_rule(rule, NULL /* force removal */); @@ -382,9 +386,9 @@ remove_dyn_children(struct ip_fw *rule) } /** - * lookup a dynamic rule. + * lookup a dynamic rule, locked version */ -ipfw_dyn_rule * +static ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, struct tcphdr *tcp) { @@ -528,7 +532,7 @@ done: } ipfw_dyn_rule * -lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, +ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, struct tcphdr *tcp) { ipfw_dyn_rule *q; @@ -699,7 +703,7 @@ lookup_dyn_parent(struct ipfw_flow_id *p * session limitations are enforced. */ int -install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, +ipfw_install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg) { static int last_log; @@ -877,7 +881,7 @@ install_state(struct ip_fw *rule, ipfw_i * so that MAC can label the reply appropriately. */ struct mbuf * -send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, +ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, u_int32_t ack, int flags) { struct mbuf *m; @@ -1065,9 +1069,9 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(q->expire, time_uptime)) continue; /* too late, rule expired */ - m = send_pkt(NULL, &(q->id), q->ack_rev - 1, + m = ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, q->ack_fwd, TH_SYN); - mnext = send_pkt(NULL, &(q->id), q->ack_fwd - 1, + mnext = ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, q->ack_rev, 0); switch (q->id.addr_type) { @@ -1222,3 +1226,4 @@ ipfw_get_dynamic(char **pbp, const char bzero(&last->next, sizeof(last)); *pbp = bp; } +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_log.c Wed Dec 16 10:48:40 2009 (r200601) @@ -85,10 +85,6 @@ __FBSDID("$FreeBSD$"); #define ICMP(p) ((struct icmphdr *)(p)) #define ICMP6(p) ((struct icmp6_hdr *)(p)) -/* counter for ipfw_log(NULL...) */ -VNET_DEFINE(u_int64_t, norule_counter); -VNET_DEFINE(int, verbose_limit); - #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 #define SNP(buf) buf, sizeof(buf) @@ -369,3 +365,4 @@ ipfw_log(struct ip_fw *f, u_int hlen, st "ipfw: limit %d reached on entry %d\n", limit_reached, f ? f->rulenum : -1); } +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_nat.c Wed Dec 16 10:48:40 2009 (r200601) @@ -671,3 +671,4 @@ DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, S MODULE_DEPEND(ipfw_nat, libalias, 1, 1, 1); MODULE_DEPEND(ipfw_nat, ipfw, 2, 2, 2); MODULE_VERSION(ipfw_nat, 1); +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Wed Dec 16 10:48:40 2009 (r200601) @@ -68,9 +68,12 @@ __FBSDID("$FreeBSD$"); #include -VNET_DEFINE(int, fw_enable) = 1; +static VNET_DEFINE(int, fw_enable) = 1; +#define V_fw_enable VNET(fw_enable) + #ifdef INET6 -VNET_DEFINE(int, fw6_enable) = 1; +static VNET_DEFINE(int, fw6_enable) = 1; +#define V_fw6_enable VNET(fw6_enable) #endif int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); @@ -86,6 +89,19 @@ static int ipfw_divert(struct mbuf **, i #define DIV_DIR_IN 1 #define DIV_DIR_OUT 0 +#ifdef SYSCTL_NODE +SYSCTL_DECL(_net_inet_ip_fw); +SYSCTL_VNET_PROC(_net_inet_ip_fw, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_enable), 0, + ipfw_chg_hook, "I", "Enable ipfw"); +#ifdef INET6 +SYSCTL_DECL(_net_inet6_ip6_fw); +SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw6_enable), 0, + ipfw_chg_hook, "I", "Enable ipfw+6"); +#endif /* INET6 */ +#endif /* SYSCTL_NODE */ + int ipfw_check_in(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, struct inpcb *inp) @@ -443,7 +459,7 @@ nodivert: return 1; } -int +static int ipfw_hook(void) { struct pfil_head *pfh_inet; @@ -478,7 +494,7 @@ ipfw_unhook(void) } #ifdef INET6 -int +static int ipfw6_hook(void) { struct pfil_head *pfh_inet6; @@ -514,6 +530,24 @@ ipfw6_unhook(void) #endif /* INET6 */ int +ipfw_attach_hooks(void) +{ + int error = 0; + + if (V_fw_enable && ipfw_hook() != 0) { + error = ENOENT; /* see ip_fw_pfil.c::ipfw_hook() */ + printf("ipfw_hook() error\n"); + } +#ifdef INET6 + if (V_fw6_enable && ipfw6_hook() != 0) { + error = ENOENT; + printf("ipfw6_hook() error\n"); + } +#endif + return error; +} + +int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { int enable; @@ -566,4 +600,4 @@ ipfw_chg_hook(SYSCTL_HANDLER_ARGS) return (0); } - +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_private.h Wed Dec 16 10:48:40 2009 (r200601) @@ -99,12 +99,12 @@ MALLOC_DECLARE(M_IPFW); /* Firewall hooks */ -int ipfw_check_in(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); -int ipfw_check_out(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); +int ipfw_check_in(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *inp); +int ipfw_check_out(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *inp); - -int ipfw_hook(void); -int ipfw6_hook(void); +int ipfw_attach_hooks(void); int ipfw_unhook(void); int ipfw6_unhook(void); #ifdef NOTYET @@ -138,15 +138,13 @@ enum { /* result for matching dynamic ru void ipfw_dyn_unlock(void); struct tcphdr; -struct mbuf *send_pkt(struct mbuf *, struct ipfw_flow_id *, +struct mbuf *ipfw_send_pkt(struct mbuf *, struct ipfw_flow_id *, u_int32_t, u_int32_t, int); -int install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, +int ipfw_install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg); -ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp); -ipfw_dyn_rule * lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp); -void remove_dyn_children(struct ip_fw *rule); +ipfw_dyn_rule *ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, + int *match_direction, struct tcphdr *tcp); +void ipfw_remove_dyn_children(struct ip_fw *rule); void ipfw_get_dynamic(char **bp, const char *ep); void ipfw_dyn_attach(void); /* uma_zcreate .... */ @@ -157,25 +155,24 @@ int ipfw_dyn_len(void); /* common variables */ VNET_DECLARE(int, fw_one_pass); -VNET_DECLARE(int, fw_enable); +#define V_fw_one_pass VNET(fw_one_pass) + VNET_DECLARE(int, fw_verbose); -VNET_DECLARE(struct ip_fw_chain, layer3_chain); -VNET_DECLARE(u_int32_t, set_disable); +#define V_fw_verbose VNET(fw_verbose) -#define V_fw_one_pass VNET(fw_one_pass) -#define V_fw_enable VNET(fw_enable) -#define V_fw_verbose VNET(fw_enable) +VNET_DECLARE(struct ip_fw_chain, layer3_chain); #define V_layer3_chain VNET(layer3_chain) + +VNET_DECLARE(u_int32_t, set_disable); #define V_set_disable VNET(set_disable) -#ifdef INET6 -VNET_DECLARE(int, fw6_enable); -#define V_fw6_enable VNET(fw6_enable) -#endif +VNET_DECLARE(int, autoinc_step); +#define V_autoinc_step VNET(autoinc_step) struct ip_fw_chain { struct ip_fw *rules; /* list of rules */ struct ip_fw *reap; /* list of rules to reap */ + struct ip_fw *default_rule; LIST_HEAD(nat_list, cfg_nat) nat; /* list of nat entries */ struct radix_node_head *tables[IPFW_TABLES_MAX]; struct rwlock rwmtx; @@ -236,6 +233,5 @@ extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; - #endif /* _KERNEL */ #endif /* _IPFW2_PRIVATE_H */ Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 10:48:40 2009 (r200601) @@ -30,7 +30,8 @@ __FBSDID("$FreeBSD$"); #define DDB(x) x /* - * Sockopt support for ipfw + * Sockopt support for ipfw. The routines here implement + * the upper half of the ipfw code. */ #if !defined(KLD_MODULE) @@ -72,8 +73,11 @@ __FBSDID("$FreeBSD$"); #include #endif -static VNET_DEFINE(int, autoinc_step); -#define V_autoinc_step VNET(autoinc_step) +MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); + +/* + * static variables followed by global ones + */ static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ @@ -210,7 +214,7 @@ remove_rule(struct ip_fw_chain *chain, s IPFW_WLOCK_ASSERT(chain); n = rule->next; - remove_dyn_children(rule); + ipfw_remove_dyn_children(rule); if (prev == NULL) chain->rules = n; else @@ -474,7 +478,7 @@ zero_entry(struct ip_fw_chain *chain, u_ /* * Check validity of the structure before insert. - * Fortunately rules are simple, so this mostly need to check rule sizes. + * Rules are simple, so this mostly need to check rule sizes. */ static int check_ipfw_struct(struct ip_fw *rule, int size) @@ -821,7 +825,7 @@ ipfw_getrules(struct ip_fw_chain *chain, } } IPFW_RUNLOCK(chain); - ipfw_get_dynamic(&bp, ep); + ipfw_get_dynamic(&bp, ep); /* protected by the dynamic lock */ return (bp - (char *)buf); } @@ -1094,3 +1098,4 @@ ipfw_ctl(struct sockopt *sopt) return (error); #undef RULE_MAXSIZE } +/* end of file */ Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Wed Dec 16 04:19:23 2009 (r200600) +++ head/sys/netinet/ipfw/ip_fw_table.c Wed Dec 16 10:48:40 2009 (r200601) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * Copyright (c) 2002 ......... * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,14 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - /* - * Sockopt support for ipfw + * Lookup table support for ipfw + * + * Lookup tables are implemented (at the moment) using the radix + * tree used for routing tables. Tables store key-value entries, where + * keys are network prefixes (addr/masklen), and values are integers. + * As a degenerate case we can interpret keys as 32-bit integers + * (with a /32 mask). */ #if !defined(KLD_MODULE) @@ -259,3 +262,4 @@ ipfw_dump_table(struct ip_fw_chain *ch, rnh->rnh_walktree(rnh, dump_table_entry, tbl); return (0); } +/* end of file */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 12:25:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87C4210656A4; Wed, 16 Dec 2009 12:25:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 762D68FC1F; Wed, 16 Dec 2009 12:25:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGCPRe2098626; Wed, 16 Dec 2009 12:25:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGCPRVQ098624; Wed, 16 Dec 2009 12:25:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912161225.nBGCPRVQ098624@svn.freebsd.org> From: Andriy Gapon Date: Wed, 16 Dec 2009 12:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200602 - head/sys/dev/ichsmb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 12:25:27 -0000 Author: avg Date: Wed Dec 16 12:25:27 2009 New Revision: 200602 URL: http://svn.freebsd.org/changeset/base/200602 Log: ichsmb: add another pci id This is SMBus controller found in Intel Platform Controller Hub (PCH), which is a general name that refers to Intel 5 Series chipsets and 3400 Series chipsets. Submitted by: Dmitry S. Luhtionov MFC after: 3 days Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 16 10:48:40 2009 (r200601) +++ head/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 16 12:25:27 2009 (r200602) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define ID_82801H 0x283e8086 #define ID_82801I 0x29308086 #define ID_82801JI 0x3a308086 +#define ID_PCH 0x3b308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -164,6 +165,9 @@ ichsmb_pci_probe(device_t dev) case ID_82801JI: device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); break; + case ID_PCH: + device_set_desc(dev, "Intel PCH SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 13:00:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D24106568D; Wed, 16 Dec 2009 13:00:39 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644D58FC0A; Wed, 16 Dec 2009 13:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGD0dI1099410; Wed, 16 Dec 2009 13:00:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGD0dEV099407; Wed, 16 Dec 2009 13:00:39 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912161300.nBGD0dEV099407@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 16 Dec 2009 13:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200603 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 13:00:39 -0000 Author: luigi Date: Wed Dec 16 13:00:37 2009 New Revision: 200603 URL: http://svn.freebsd.org/changeset/base/200603 Log: bring back a couple of #include that are supplied by nesting, and explain why they are used. Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 12:25:27 2009 (r200602) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Dec 16 13:00:37 2009 (r200603) @@ -66,8 +66,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* IN6_ARE_ADDR_EQUAL */ #ifdef INET6 -#include #include #include #endif Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 12:25:27 2009 (r200602) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 13:00:37 2009 (r200603) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* struct m_tag used by nested headers */ #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 14:34:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DF30106566B; Wed, 16 Dec 2009 14:34:49 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 140F38FC29; Wed, 16 Dec 2009 14:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGEYmTi001717; Wed, 16 Dec 2009 14:34:48 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGEYm6u001716; Wed, 16 Dec 2009 14:34:48 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912161434.nBGEYm6u001716@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 16 Dec 2009 14:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200604 - head/usr.bin/comm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 14:34:49 -0000 Author: jh Date: Wed Dec 16 14:34:48 2009 New Revision: 200604 URL: http://svn.freebsd.org/changeset/base/200604 Log: - Prevent overflowing of the buffer length variable in getline() by limiting its maximum value. - Exit if reallocf(3) fails in getline(). Failure was silently considered as end-of-file. Reviewed by: ghelmer Approved by: trasz (mentor) Modified: head/usr.bin/comm/comm.c Modified: head/usr.bin/comm/comm.c ============================================================================== --- head/usr.bin/comm/comm.c Wed Dec 16 13:00:37 2009 (r200603) +++ head/usr.bin/comm/comm.c Wed Dec 16 14:34:48 2009 (r200604) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -59,7 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define MAXLINELEN (LINE_MAX + 1) +#define INITLINELEN (LINE_MAX + 1) +#define MAXLINELEN ((SIZE_MAX / sizeof(wchar_t)) / 2) const wchar_t *tabs[] = { L"", L"\t", L"\t\t" }; @@ -83,8 +85,8 @@ main(int argc, char *argv[]) flag1 = flag2 = flag3 = 1; iflag = 0; - line1len = MAXLINELEN; - line2len = MAXLINELEN; + line1len = INITLINELEN; + line2len = INITLINELEN; line1 = malloc(line1len * sizeof(*line1)); line2 = malloc(line2len * sizeof(*line2)); if (line1 == NULL || line2 == NULL) @@ -193,9 +195,13 @@ getline(wchar_t *buf, size_t *buflen, FI while ((ch = getwc(fp)) != WEOF && ch != '\n') { if (bufpos + 1 >= *buflen) { *buflen = *buflen * 2; + if (*buflen > MAXLINELEN) + errx(1, + "Maximum line buffer length (%zu) exceeded", + MAXLINELEN); buf = reallocf(buf, *buflen * sizeof(*buf)); if (buf == NULL) - return (NULL); + err(1, "reallocf"); } buf[bufpos++] = ch; } @@ -251,13 +257,13 @@ wcsicoll(const wchar_t *s1, const wchar_ new_l2_buflen = wcsicoll_l2_buflen; while (new_l1_buflen < l1) { if (new_l1_buflen == 0) - new_l1_buflen = MAXLINELEN; + new_l1_buflen = INITLINELEN; else new_l1_buflen *= 2; } while (new_l2_buflen < l2) { if (new_l2_buflen == 0) - new_l2_buflen = MAXLINELEN; + new_l2_buflen = INITLINELEN; else new_l2_buflen *= 2; } From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 16:24:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70BB1106568D; Wed, 16 Dec 2009 16:24:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46E0E8FC18; Wed, 16 Dec 2009 16:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGGOXcu004301; Wed, 16 Dec 2009 16:24:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGGOXfR004300; Wed, 16 Dec 2009 16:24:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912161624.nBGGOXfR004300@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Dec 2009 16:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200605 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 16:24:33 -0000 Author: jhb Date: Wed Dec 16 16:24:32 2009 New Revision: 200605 URL: http://svn.freebsd.org/changeset/base/200605 Log: Add entries to NOTES for the modular phy support so that these options are documented. PR: docs/141358 Submitted by: Bruce Cran Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Dec 16 14:34:48 2009 (r200604) +++ head/sys/conf/NOTES Wed Dec 16 16:24:32 2009 (r200605) @@ -1812,14 +1812,47 @@ device puc # # Network interfaces: # -# MII bus support is required for some PCI 10/100 ethernet NICs, +# MII bus support is required for many PCI Ethernet NICs, # namely those which use MII-compliant transceivers or implement -# transceiver control interfaces that operate like an MII. Adding +# transceiver control interfaces that operate like an MII. Adding # "device miibus" to the kernel config pulls in support for # the generic miibus API and all of the PHY drivers, including a # generic one for PHYs that aren't specifically handled by an -# individual driver. -device miibus +# individual driver. Support for specific PHYs may be built by adding +# "device mii" then adding the appropriate PHY driver. +device miibus # MII support including all PHYs +device mii # Minimal MII support + +device acphy # Altima Communications AC101 +device amphy # AMD AM79c873 / Davicom DM910{1,2} +device atphy # Attansic/Atheros F1 +device axphy # Asix Semiconductor AX88x9x +device bmtphy # Broadcom BCM5201/BCM5202 and 3Com 3c905C +device brgphy # Broadcom BCM54xx/57xx 1000baseTX +device ciphy # Cicada/Vitesse CS/VSC8xxx +device e1000phy # Marvell 88E1000 1000/100/10-BT +device exphy # 3Com internal PHY +device gentbi # Generic 10-bit 1000BASE-{LX,SX} fiber ifaces +device icsphy # ICS ICS1889-1893 +device inphy # Intel 82553/82555 +device ip1000phy # IC Plus IP1000A/IP1001 +device jmphy # JMicron JMP211/JMP202 +device lxtphy # Level One LXT-970 +device mlphy # Micro Linear 6692 +device nsgphy # NatSemi DP8361/DP83865/DP83891 +device nsphy # NatSemi DP83840A +device nsphyter # NatSemi DP83843/DP83815 +device pnaphy # HomePNA +device qsphy # Quality Semiconductor QS6612 +device rgephy # RealTek 8169S/8110S/8211B/8211C +device rlphy # RealTek 8139 +device rlswitch # RealTek 8305 +device ruephy # RealTek RTL8150 +device smcphy # SMSC LAN91C111 +device tdkphy # TDK 89Q2120 +device tlphy # Texas Instruments ThunderLAN +device truephy # LSI TruePHY +device xmphy # XaQti XMAC II # an: Aironet 4500/4800 802.11 wireless adapters. Supports the PCMCIA, # PCI and ISA varieties. From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 17:17:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049CE1065670; Wed, 16 Dec 2009 17:17:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E78788FC0C; Wed, 16 Dec 2009 17:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGHHeF2005544; Wed, 16 Dec 2009 17:17:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGHHeQZ005541; Wed, 16 Dec 2009 17:17:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912161717.nBGHHeQZ005541@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 17:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 17:17:41 -0000 Author: imp Date: Wed Dec 16 17:17:40 2009 New Revision: 200606 URL: http://svn.freebsd.org/changeset/base/200606 Log: Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. Note: Not sure this is the right way to do compat, but it makes the headers consistent with the implementations. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 16:24:32 2009 (r200605) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 17:17:40 2009 (r200606) @@ -692,7 +692,8 @@ int freebsd6_freebsd32_ftruncate(struct #endif /* COMPAT_FREEBSD6 */ -#ifdef COMPAT_FREEBSD7 +#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) struct freebsd7_freebsd32_semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -714,7 +715,7 @@ int freebsd7_freebsd32_semctl(struct thr int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); -#endif /* COMPAT_FREEBSD7 */ +#endif #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Dec 16 16:24:32 2009 (r200605) +++ head/sys/sys/sysproto.h Wed Dec 16 17:17:40 2009 (r200606) @@ -2242,13 +2242,8 @@ int freebsd4_sigreturn(struct thread *, #endif /* COMPAT_FREEBSD4 */ -#ifdef COMPAT_FREEBSD6 - - -#endif /* COMPAT_FREEBSD6 */ - - -#ifdef COMPAT_FREEBSD7 +#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) struct freebsd7___semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -2270,7 +2265,7 @@ int freebsd7___semctl(struct thread *, s int freebsd7_msgctl(struct thread *, struct freebsd7_msgctl_args *); int freebsd7_shmctl(struct thread *, struct freebsd7_shmctl_args *); -#endif /* COMPAT_FREEBSD7 */ +#endif #define SYS_AUE_syscall AUE_NULL #define SYS_AUE_exit AUE_EXIT From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 17:42:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EF5B1065672; Wed, 16 Dec 2009 17:42:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E2098FC12; Wed, 16 Dec 2009 17:42:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGHg3Li006087; Wed, 16 Dec 2009 17:42:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGHg3Cc006085; Wed, 16 Dec 2009 17:42:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912161742.nBGHg3Cc006085@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Dec 2009 17:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200607 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 17:42:03 -0000 Author: mav Date: Wed Dec 16 17:42:02 2009 New Revision: 200607 URL: http://svn.freebsd.org/changeset/base/200607 Log: Large I/Os on Promise controllers reported to cause UDMA ICRC errors and subsequent timeouts. Restore previous limit for now, at least until I will have hardware to experiment. PR: kern/141438 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 Dec 16 17:17:40 2009 (r200606) +++ head/sys/dev/ata/chipsets/ata-promise.c Wed Dec 16 17:42:02 2009 (r200607) @@ -957,6 +957,7 @@ ata_promise_mio_dmainit(device_t dev) ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_promise_mio_setprd; + ch->dma.max_iosize = 65536; } From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 18:03:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D108F1065670; Wed, 16 Dec 2009 18:03:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6AAE8FC23; Wed, 16 Dec 2009 18:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGI3Qli006628; Wed, 16 Dec 2009 18:03:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGI3Qk3006626; Wed, 16 Dec 2009 18:03:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161803.nBGI3Qk3006626@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 18:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200609 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 18:03:27 -0000 Author: yongari Date: Wed Dec 16 18:03:25 2009 New Revision: 200609 URL: http://svn.freebsd.org/changeset/base/200609 Log: All vge(4) controllers support RX/TX checksum offloading for VLAN tagged frames so add checksum offloading capabilities. Also add missing VLAN hardware tagging control in ioctl handler and let upper stack know current VLAN capabilities. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 17:48:26 2009 (r200608) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 18:03:25 2009 (r200609) @@ -180,6 +180,7 @@ static void vge_reset(struct vge_softc * static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); static void vge_setmulti(struct vge_softc *); +static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stop(struct vge_softc *); @@ -504,6 +505,23 @@ fail: return (error); } +static void +vge_setvlan(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint8_t cfg; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + cfg = CSR_READ_1(sc, VGE_RXCFG); + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) + cfg |= VGE_VTAG_OPT2; + else + cfg &= ~VGE_VTAG_OPT2; + CSR_WRITE_1(sc, VGE_RXCFG, cfg); +} + /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, @@ -1050,7 +1068,8 @@ vge_attach(device_t dev) ifp->if_capabilities = IFCAP_VLAN_MTU; ifp->if_start = vge_start; ifp->if_hwassist = VGE_CSUM_FEATURES; - ifp->if_capabilities |= IFCAP_HWCSUM|IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | + IFCAP_VLAN_HWTAGGING; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2010,7 +2029,7 @@ vge_init_locked(struct vge_softc *sc) * reception of VLAN tagged frames. */ CSR_CLRBIT_1(sc, VGE_RXCFG, VGE_RXCFG_FIFO_THR|VGE_RXCFG_VTAGOPT); - CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES|VGE_VTAG_OPT2); + CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES); /* Set DMA burst length */ CSR_CLRBIT_1(sc, VGE_DMACFG0, VGE_DMACFG0_BURSTLEN); @@ -2072,6 +2091,7 @@ vge_init_locked(struct vge_softc *sc) /* Init the multicast filter. */ vge_setmulti(sc); + vge_setvlan(sc); /* Enable flow control */ @@ -2242,7 +2262,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm struct vge_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFMTU: @@ -2287,8 +2307,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - { - int mask = ifr->ifr_reqcap ^ ifp->if_capenable; + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { @@ -2325,8 +2344,16 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + vge_setvlan(sc); + } VGE_UNLOCK(sc); - } + VLAN_CAPABILITIES(ifp); break; default: error = ether_ioctl(ifp, command, data); From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 18:03:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F214B10656EE; Wed, 16 Dec 2009 18:03:36 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 028838FC0C; Wed, 16 Dec 2009 18:03:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGI3ZuE006671; Wed, 16 Dec 2009 18:03:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGI3Zoh006669; Wed, 16 Dec 2009 18:03:35 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912161803.nBGI3Zoh006669@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 16 Dec 2009 18:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200610 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 18:03:37 -0000 Author: luigi Date: Wed Dec 16 18:03:35 2009 New Revision: 200610 URL: http://svn.freebsd.org/changeset/base/200610 Log: remove a duplicate sysctl entry Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 18:03:25 2009 (r200609) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Dec 16 18:03:35 2009 (r200610) @@ -81,15 +81,13 @@ MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "Ip */ static VNET_DEFINE(u_int32_t, static_count); /* # of static rules */ -static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ #define V_static_count VNET(static_count) + +static VNET_DEFINE(u_int32_t, static_len); /* bytes of static rules */ #define V_static_len VNET(static_len) #ifdef SYSCTL_NODE SYSCTL_DECL(_net_inet_ip_fw); -SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, autoinc_step, - CTLFLAG_RW, &VNET_NAME(autoinc_step), 0, - "Rule number auto-increment step"); SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, CTLFLAG_RD, &VNET_NAME(static_count), 0, "Number of static rules"); From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 19:32:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D08621065672; Wed, 16 Dec 2009 19:32:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF35A8FC12; Wed, 16 Dec 2009 19:32:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGJWi3Y008557; Wed, 16 Dec 2009 19:32:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJWih7008555; Wed, 16 Dec 2009 19:32:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161932.nBGJWih7008555@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 19:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200613 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:32:44 -0000 Author: yongari Date: Wed Dec 16 19:32:44 2009 New Revision: 200613 URL: http://svn.freebsd.org/changeset/base/200613 Log: Rewrite RX filter setup and simplify code. Now promiscuous mode and multicast handling is performed in single function, vge_rxfilter(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:27:54 2009 (r200612) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 19:32:44 2009 (r200613) @@ -179,7 +179,7 @@ static void vge_read_eeprom(struct vge_s static void vge_reset(struct vge_softc *); static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); -static void vge_setmulti(struct vge_softc *); +static void vge_rxfilter(struct vge_softc *); static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); @@ -528,32 +528,43 @@ vge_setvlan(struct vge_softc *sc) * we use the hash filter instead. */ static void -vge_setmulti(struct vge_softc *sc) +vge_rxfilter(struct vge_softc *sc) { struct ifnet *ifp; - int error = 0/*, h = 0*/; struct ifmultiaddr *ifma; - uint32_t h, hashes[2] = { 0, 0 }; + uint32_t h, hashes[2]; + uint8_t rxcfg; + int error = 0; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - /* First, zot all the multicast entries. */ - vge_cam_clear(sc); - CSR_WRITE_4(sc, VGE_MAR0, 0); - CSR_WRITE_4(sc, VGE_MAR1, 0); + hashes[0] = 0; + hashes[1] = 0; + rxcfg = CSR_READ_1(sc, VGE_RXCTL); + rxcfg &= ~(VGE_RXCTL_RX_MCAST | VGE_RXCTL_RX_BCAST | + VGE_RXCTL_RX_PROMISC); /* - * If the user wants allmulti or promisc mode, enable reception - * of all multicast frames. + * Always allow VLAN oversized frames and frames for + * this host. */ - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - CSR_WRITE_4(sc, VGE_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, VGE_MAR1, 0xFFFFFFFF); - return; + rxcfg |= VGE_RXCTL_RX_GIANT | VGE_RXCTL_RX_UCAST; + + ifp = sc->vge_ifp; + if ((ifp->if_flags & IFF_BROADCAST) != 0) + rxcfg |= VGE_RXCTL_RX_BCAST; + if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxcfg |= VGE_RXCTL_RX_PROMISC; + if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + } + goto done; } + vge_cam_clear(sc); /* Now program new ones */ if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -579,11 +590,15 @@ vge_setmulti(struct vge_softc *sc) else hashes[1] |= (1 << (h - 32)); } - - CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); - CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } if_maddr_runlock(ifp); + +done: + if (hashes[0] != 0 || hashes[1] != 0) + rxcfg |= VGE_RXCTL_RX_MCAST; + CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); + CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); + CSR_WRITE_1(sc, VGE_RXCTL, rxcfg); } static void @@ -2068,29 +2083,11 @@ vge_init_locked(struct vge_softc *sc) /* Enable the TX descriptor queue */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_RUN0); - /* Set up the receive filter -- allow large frames for VLANs. */ - CSR_WRITE_1(sc, VGE_RXCTL, VGE_RXCTL_RX_UCAST|VGE_RXCTL_RX_GIANT); - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC); - } - - /* Set capture broadcast bit to capture broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_BCAST); - } - - /* Set multicast bit to capture multicast frames. */ - if (ifp->if_flags & IFF_MULTICAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_MCAST); - } - /* Init the cam filter. */ vge_cam_clear(sc); - /* Init the multicast filter. */ - vge_setmulti(sc); + /* Set up receiver filter. */ + vge_rxfilter(sc); vge_setvlan(sc); /* Enable flow control */ @@ -2272,25 +2269,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm break; case SIOCSIFFLAGS: VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->vge_if_flags & IFF_PROMISC)) { - CSR_SETBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->vge_if_flags & IFF_PROMISC) { - CSR_CLRBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->vge_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + vge_rxfilter(sc); + else vge_init_locked(sc); - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_stop(sc); - } + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + vge_stop(sc); sc->vge_if_flags = ifp->if_flags; VGE_UNLOCK(sc); break; @@ -2298,7 +2285,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm case SIOCDELMULTI: VGE_LOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_setmulti(sc); + vge_rxfilter(sc); VGE_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 19:37:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228C6106566C; Wed, 16 Dec 2009 19:37:39 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 120698FC18; Wed, 16 Dec 2009 19:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGJbcMP008732; Wed, 16 Dec 2009 19:37:38 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJbcdi008730; Wed, 16 Dec 2009 19:37:38 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200912161937.nBGJbcdi008730@svn.freebsd.org> From: Julian Elischer Date: Wed, 16 Dec 2009 19:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200614 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:37:39 -0000 Author: julian Date: Wed Dec 16 19:37:38 2009 New Revision: 200614 URL: http://svn.freebsd.org/changeset/base/200614 Log: Make man page reflect the output columns MFC after: 1 week Modified: head/share/man/man9/LOCK_PROFILING.9 Modified: head/share/man/man9/LOCK_PROFILING.9 ============================================================================== --- head/share/man/man9/LOCK_PROFILING.9 Wed Dec 16 19:32:44 2009 (r200613) +++ head/share/man/man9/LOCK_PROFILING.9 Wed Dec 16 19:37:38 2009 (r200614) @@ -114,6 +114,8 @@ The columns are as follows, from left to .Bl -tag -width ".Va cnt_hold" .It Va max The longest continuous hold time in microseconds. +.It Va wait_max +The longest continuous wait time in microseconds. .It Va total The total (accumulated) hold time in microseconds. .It Va wait_total From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 19:41:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 112891065670; Wed, 16 Dec 2009 19:41:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2FFD8FC12; Wed, 16 Dec 2009 19:41:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGJfe3T008838; Wed, 16 Dec 2009 19:41:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJfelg008834; Wed, 16 Dec 2009 19:41:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161941.nBGJfelg008834@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 19:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200615 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:41:41 -0000 Author: yongari Date: Wed Dec 16 19:41:40 2009 New Revision: 200615 URL: http://svn.freebsd.org/changeset/base/200615 Log: Add hardware MAC statistics support. This statistics could be extracted from dev.vge.%d.stats sysctl node. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:37:38 2009 (r200614) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 19:41:40 2009 (r200615) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -132,6 +133,13 @@ static int msi_disable = 0; TUNABLE_INT("hw.vge.msi_disable", &msi_disable); /* + * The SQE error counter of MIB seems to report bogus value. + * Vendor's workaround does not seem to work on PCIe based + * controllers. Disable it until we find better workaround. + */ +#undef VGE_ENABLE_SQEERR + +/* * Various supported device vendors/types and their names. */ static struct vge_type vge_devs[] = { @@ -183,7 +191,10 @@ static void vge_rxfilter(struct vge_soft static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); +static void vge_stats_clear(struct vge_softc *); +static void vge_stats_update(struct vge_softc *); static void vge_stop(struct vge_softc *); +static void vge_sysctl_node(struct vge_softc *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -1057,6 +1068,7 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) goto fail; @@ -1698,7 +1710,6 @@ vge_poll (struct ifnet *ifp, enum poll_c if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, count); - ifp->if_ierrors++; CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } @@ -2034,7 +2045,8 @@ vge_init_locked(struct vge_softc *sc) return; } vge_tx_list_init(sc); - + /* Clear MAC statistics. */ + vge_stats_clear(sc); /* Set our station address */ for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, VGE_PAR0 + i, IF_LLADDR(sc->vge_ifp)[i]); @@ -2358,6 +2370,7 @@ vge_watchdog(void *arg) sc = arg; VGE_LOCK_ASSERT(sc); + vge_stats_update(sc); callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); if (sc->vge_timer == 0 || --sc->vge_timer > 0) return; @@ -2396,6 +2409,7 @@ vge_stop(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_RXQCSRC, 0xFF); CSR_WRITE_4(sc, VGE_RXDESC_ADDR_LO, 0); + vge_stats_update(sc); VGE_CHAIN_RESET(sc); vge_txeof(sc); vge_freebufs(sc); @@ -2469,3 +2483,223 @@ vge_shutdown(device_t dev) return (0); } + +#define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +static void +vge_sysctl_node(struct vge_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct vge_hw_stats *stats; + + stats = &sc->vge_stats; + ctx = device_get_sysctl_ctx(sc->vge_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "VGE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "RX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames", + &stats->rx_frames, "frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Too short frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts_errs", + &stats->rx_runts_errs, "Too short frames with errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->rx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->rx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->rx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->rx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->rx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->rx_pkts_1519_max, "1519 to max frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max_errs", + &stats->rx_pkts_1519_max_errs, "1519 to max frames with error"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->rx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "crcerrs", + &stats->rx_crcerrs, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->rx_pause_frames, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "align_errs", + &stats->rx_alignerrs, "Alignment errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "nobufs", + &stats->rx_nobufs, "Frames with no buffer event"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "sym_errs", + &stats->rx_symerrs, "Frames with symbol errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "len_errs", + &stats->rx_lenerrs, "Frames with length mismatched"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "TX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->tx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->tx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->tx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->tx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->tx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->tx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "colls", + &stats->tx_colls, "Collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_latecolls, "Late collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->tx_pause, "Pause frames"); +#ifdef VGE_ENABLE_SQEERR + VGE_SYSCTL_STAT_ADD32(ctx, child, "sqeerrs", + &stats->tx_sqeerrs, "SQE errors"); +#endif + /* Clear MAC statistics. */ + vge_stats_clear(sc); +} + +#undef VGE_SYSCTL_STAT_ADD32 + +static void +vge_stats_clear(struct vge_softc *sc) +{ + int i; + + VGE_LOCK_ASSERT(sc); + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FREEZE); + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_CLR); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_CLR) == 0) + break; + } + if (i == 0) + device_printf(sc->vge_dev, "MIB clear timed out!\n"); + CSR_WRITE_1(sc, VGE_MIBCSR, CSR_READ_1(sc, VGE_MIBCSR) & + ~VGE_MIBCSR_FREEZE); +} + +static void +vge_stats_update(struct vge_softc *sc) +{ + struct vge_hw_stats *stats; + struct ifnet *ifp; + uint32_t mib[VGE_MIB_CNT], val; + int i; + + VGE_LOCK_ASSERT(sc); + + stats = &sc->vge_stats; + ifp = sc->vge_ifp; + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FLUSH); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_FLUSH) == 0) + break; + } + if (i == 0) { + device_printf(sc->vge_dev, "MIB counter dump timed out!\n"); + vge_stats_clear(sc); + return; + } + + bzero(mib, sizeof(mib)); +reset_idx: + /* Set MIB read index to 0. */ + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_RINI); + for (i = 0; i < VGE_MIB_CNT; i++) { + val = CSR_READ_4(sc, VGE_MIBDATA); + if (i != VGE_MIB_DATA_IDX(val)) { + /* Reading interrupted. */ + goto reset_idx; + } + mib[i] = val & VGE_MIB_DATA_MASK; + } + + /* Rx stats. */ + stats->rx_frames += mib[VGE_MIB_RX_FRAMES]; + stats->rx_good_frames += mib[VGE_MIB_RX_GOOD_FRAMES]; + stats->rx_fifo_oflows += mib[VGE_MIB_RX_FIFO_OVERRUNS]; + stats->rx_runts += mib[VGE_MIB_RX_RUNTS]; + stats->rx_runts_errs += mib[VGE_MIB_RX_RUNTS_ERRS]; + stats->rx_pkts_64 += mib[VGE_MIB_RX_PKTS_64]; + stats->rx_pkts_65_127 += mib[VGE_MIB_RX_PKTS_65_127]; + stats->rx_pkts_128_255 += mib[VGE_MIB_RX_PKTS_128_255]; + stats->rx_pkts_256_511 += mib[VGE_MIB_RX_PKTS_256_511]; + stats->rx_pkts_512_1023 += mib[VGE_MIB_RX_PKTS_512_1023]; + stats->rx_pkts_1024_1518 += mib[VGE_MIB_RX_PKTS_1024_1518]; + stats->rx_pkts_1519_max += mib[VGE_MIB_RX_PKTS_1519_MAX]; + stats->rx_pkts_1519_max_errs += mib[VGE_MIB_RX_PKTS_1519_MAX_ERRS]; + stats->rx_jumbos += mib[VGE_MIB_RX_JUMBOS]; + stats->rx_crcerrs += mib[VGE_MIB_RX_CRCERRS]; + stats->rx_pause_frames += mib[VGE_MIB_RX_PAUSE]; + stats->rx_alignerrs += mib[VGE_MIB_RX_ALIGNERRS]; + stats->rx_nobufs += mib[VGE_MIB_RX_NOBUFS]; + stats->rx_symerrs += mib[VGE_MIB_RX_SYMERRS]; + stats->rx_lenerrs += mib[VGE_MIB_RX_LENERRS]; + + /* Tx stats. */ + stats->tx_good_frames += mib[VGE_MIB_TX_GOOD_FRAMES]; + stats->tx_pkts_64 += mib[VGE_MIB_TX_PKTS_64]; + stats->tx_pkts_65_127 += mib[VGE_MIB_TX_PKTS_65_127]; + stats->tx_pkts_128_255 += mib[VGE_MIB_TX_PKTS_128_255]; + stats->tx_pkts_256_511 += mib[VGE_MIB_TX_PKTS_256_511]; + stats->tx_pkts_512_1023 += mib[VGE_MIB_TX_PKTS_512_1023]; + stats->tx_pkts_1024_1518 += mib[VGE_MIB_TX_PKTS_1024_1518]; + stats->tx_jumbos += mib[VGE_MIB_TX_JUMBOS]; + stats->tx_colls += mib[VGE_MIB_TX_COLLS]; + stats->tx_pause += mib[VGE_MIB_TX_PAUSE]; +#ifdef VGE_ENABLE_SQEERR + stats->tx_sqeerrs += mib[VGE_MIB_TX_SQEERRS]; +#endif + stats->tx_latecolls += mib[VGE_MIB_TX_LATECOLLS]; + + /* Update counters in ifnet. */ + ifp->if_opackets += mib[VGE_MIB_TX_GOOD_FRAMES]; + + ifp->if_collisions += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_oerrors += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_ipackets += mib[VGE_MIB_RX_GOOD_FRAMES]; + + ifp->if_ierrors += mib[VGE_MIB_RX_FIFO_OVERRUNS] + + mib[VGE_MIB_RX_RUNTS] + + mib[VGE_MIB_RX_RUNTS_ERRS] + + mib[VGE_MIB_RX_CRCERRS] + + mib[VGE_MIB_RX_ALIGNERRS] + + mib[VGE_MIB_RX_NOBUFS] + + mib[VGE_MIB_RX_SYMERRS] + + mib[VGE_MIB_RX_LENERRS]; +} Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Wed Dec 16 19:37:38 2009 (r200614) +++ head/sys/dev/vge/if_vgereg.h Wed Dec 16 19:41:40 2009 (r200615) @@ -301,7 +301,7 @@ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_MIBOFLOW|VGE_ISR_TIMER0) + VGE_ISR_TIMER0) /* Interrupt mask register */ @@ -543,6 +543,54 @@ #define VGE_TXBLOCK_128PKTS 0x08 #define VGE_TXBLOCK_8PKTS 0x0C +/* MIB control/status register */ +#define VGE_MIBCSR_CLR 0x01 +#define VGE_MIBCSR_RINI 0x02 +#define VGE_MIBCSR_FLUSH 0x04 +#define VGE_MIBCSR_FREEZE 0x08 +#define VGE_MIBCSR_HI_80 0x00 +#define VGE_MIBCSR_HI_C0 0x10 +#define VGE_MIBCSR_BISTGO 0x40 +#define VGE_MIBCSR_BISTOK 0x80 + +/* MIB data index. */ +#define VGE_MIB_RX_FRAMES 0 +#define VGE_MIB_RX_GOOD_FRAMES 1 +#define VGE_MIB_TX_GOOD_FRAMES 2 +#define VGE_MIB_RX_FIFO_OVERRUNS 3 +#define VGE_MIB_RX_RUNTS 4 +#define VGE_MIB_RX_RUNTS_ERRS 5 +#define VGE_MIB_RX_PKTS_64 6 +#define VGE_MIB_TX_PKTS_64 7 +#define VGE_MIB_RX_PKTS_65_127 8 +#define VGE_MIB_TX_PKTS_65_127 9 +#define VGE_MIB_RX_PKTS_128_255 10 +#define VGE_MIB_TX_PKTS_128_255 11 +#define VGE_MIB_RX_PKTS_256_511 12 +#define VGE_MIB_TX_PKTS_256_511 13 +#define VGE_MIB_RX_PKTS_512_1023 14 +#define VGE_MIB_TX_PKTS_512_1023 15 +#define VGE_MIB_RX_PKTS_1024_1518 16 +#define VGE_MIB_TX_PKTS_1024_1518 17 +#define VGE_MIB_TX_COLLS 18 +#define VGE_MIB_RX_CRCERRS 19 +#define VGE_MIB_RX_JUMBOS 20 +#define VGE_MIB_TX_JUMBOS 21 +#define VGE_MIB_RX_PAUSE 22 +#define VGE_MIB_TX_PAUSE 23 +#define VGE_MIB_RX_ALIGNERRS 24 +#define VGE_MIB_RX_PKTS_1519_MAX 25 +#define VGE_MIB_RX_PKTS_1519_MAX_ERRS 26 +#define VGE_MIB_TX_SQEERRS 27 +#define VGE_MIB_RX_NOBUFS 28 +#define VGE_MIB_RX_SYMERRS 29 +#define VGE_MIB_RX_LENERRS 30 +#define VGE_MIB_TX_LATECOLLS 31 + +#define VGE_MIB_CNT (VGE_MIB_TX_LATECOLLS - VGE_MIB_RX_FRAMES + 1) +#define VGE_MIB_DATA_MASK 0x00FFFFFF +#define VGE_MIB_DATA_IDX(x) ((x) >> 24) + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:37:38 2009 (r200614) +++ head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:41:40 2009 (r200615) @@ -130,6 +130,42 @@ struct vge_ring_data { bus_addr_t vge_rx_ring_paddr; }; +struct vge_hw_stats { + uint32_t rx_frames; + uint32_t rx_good_frames; + uint32_t rx_fifo_oflows; + uint32_t rx_runts; + uint32_t rx_runts_errs; + uint32_t rx_pkts_64; + uint32_t rx_pkts_65_127; + uint32_t rx_pkts_128_255; + uint32_t rx_pkts_256_511; + uint32_t rx_pkts_512_1023; + uint32_t rx_pkts_1024_1518; + uint32_t rx_pkts_1519_max; + uint32_t rx_pkts_1519_max_errs; + uint32_t rx_jumbos; + uint32_t rx_crcerrs; + uint32_t rx_pause_frames; + uint32_t rx_alignerrs; + uint32_t rx_nobufs; + uint32_t rx_symerrs; + uint32_t rx_lenerrs; + + uint32_t tx_good_frames; + uint32_t tx_pkts_64; + uint32_t tx_pkts_65_127; + uint32_t tx_pkts_128_255; + uint32_t tx_pkts_256_511; + uint32_t tx_pkts_512_1023; + uint32_t tx_pkts_1024_1518; + uint32_t tx_jumbos; + uint32_t tx_colls; + uint32_t tx_pause; + uint32_t tx_sqeerrs; + uint32_t tx_latecolls; +}; + struct vge_softc { struct ifnet *vge_ifp; /* interface info */ device_t vge_dev; @@ -152,6 +188,7 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; + struct vge_hw_stats vge_stats; int suspended; /* 0 = normal 1 = suspended */ }; From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 19:49:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A12BE1065676; Wed, 16 Dec 2009 19:49:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9067E8FC1C; Wed, 16 Dec 2009 19:49:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGJnNYq009029; Wed, 16 Dec 2009 19:49:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJnNJ9009026; Wed, 16 Dec 2009 19:49:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161949.nBGJnNJ9009026@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 19:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200616 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:49:23 -0000 Author: yongari Date: Wed Dec 16 19:49:23 2009 New Revision: 200616 URL: http://svn.freebsd.org/changeset/base/200616 Log: Add new flag VGE_FLAG_SUSPENDED to mark suspended state and remove suspended member in softc. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:41:40 2009 (r200615) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 19:49:23 2009 (r200616) @@ -1728,15 +1728,11 @@ vge_intr(void *arg) uint32_t status; sc = arg; - - if (sc->suspended) { - return; - } - VGE_LOCK(sc); - ifp = sc->vge_ifp; - if (!(ifp->if_flags & IFF_UP)) { + ifp = sc->vge_ifp; + if ((sc->vge_flags & VGE_FLAG_SUSPENDED) != 0 || + (ifp->if_flags & IFF_UP) == 0) { VGE_UNLOCK(sc); return; } @@ -2430,7 +2426,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - sc->suspended = 1; + sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); @@ -2460,7 +2456,7 @@ vge_resume(device_t dev) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } - sc->suspended = 0; + sc->vge_flags &= ~VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:41:40 2009 (r200615) +++ head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:49:23 2009 (r200616) @@ -179,6 +179,7 @@ struct vge_softc { int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; @@ -189,8 +190,6 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; struct vge_hw_stats vge_stats; - - int suspended; /* 0 = normal 1 = suspended */ }; #define VGE_LOCK(_sc) mtx_lock(&(_sc)->vge_mtx) From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 20:03:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 802761065672; Wed, 16 Dec 2009 20:03:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7388FC12; Wed, 16 Dec 2009 20:03:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGK3hJF009424; Wed, 16 Dec 2009 20:03:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGK3hE9009422; Wed, 16 Dec 2009 20:03:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912162003.nBGK3hE9009422@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 20:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200617 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 20:03:43 -0000 Author: yongari Date: Wed Dec 16 20:03:43 2009 New Revision: 200617 URL: http://svn.freebsd.org/changeset/base/200617 Log: Add "Velocity" to probe message which will make it clearer which ethernet controller was recognized. VIA consistently calls "Velocity" family for gigabit ethernet controllers. For fast ethernet controllers they uses "Rhine" family(vr(4) controllers)) and vr(4) already shows "Rhine" in probe message. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:49:23 2009 (r200616) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 20:03:43 2009 (r200617) @@ -144,7 +144,7 @@ TUNABLE_INT("hw.vge.msi_disable", &msi_d */ static struct vge_type vge_devs[] = { { VIA_VENDORID, VIA_DEVICEID_61XX, - "VIA Networking Gigabit Ethernet" }, + "VIA Networking Velocity Gigabit Ethernet" }, { 0, 0, NULL } }; From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 20:43:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940C01065692; Wed, 16 Dec 2009 20:43:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 668F18FC18; Wed, 16 Dec 2009 20:43:01 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 08CF146B46; Wed, 16 Dec 2009 15:43:01 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BBB7E8A01B; Wed, 16 Dec 2009 15:42:59 -0500 (EST) From: John Baldwin To: Warner Losh Date: Wed, 16 Dec 2009 15:41:53 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> In-Reply-To: <200912161717.nBGHHeQZ005541@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <200912161541.53834.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 16 Dec 2009 15:42:59 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 20:43:01 -0000 On Wednesday 16 December 2009 12:17:40 pm Warner Losh wrote: > Author: imp > Date: Wed Dec 16 17:17:40 2009 > New Revision: 200606 > URL: http://svn.freebsd.org/changeset/base/200606 >=20 > Log: > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. > =20 > Note: Not sure this is the right way to do compat, but it makes the > headers consistent with the implementations. Please revert. I think this has already been reverted once before. Though= =20 this approach happens to work for the SYSV IPC case because it uses=20 SYSCALL_MODULE() to register the system calls at runtime (even when compile= d=20 statically into the kernel), it would not work for a COMPAT syscall that di= d=20 not use NOSTD. =46rom src/UPDATING: 20090624: The ABI of various structures related to the SYSV IPC API have been changed. As a result, the COMPAT_FREEBSD[456] and COMPAT_43 kernel options now all require COMPAT_FREEBSD7. Bump __FreeBSD_version to 800100. =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 21:33:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EBCE106566C; Wed, 16 Dec 2009 21:33:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C1FCD8FC0A; Wed, 16 Dec 2009 21:33:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBGLWqCW028024; Wed, 16 Dec 2009 14:32:52 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 16 Dec 2009 14:33:22 -0700 (MST) Message-Id: <20091216.143322.951491966188790000.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <200912161541.53834.jhb@freebsd.org> References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 21:33:27 -0000 In message: <200912161541.53834.jhb@freebsd.org> John Baldwin writes: : On Wednesday 16 December 2009 12:17:40 pm Warner Losh wrote: : > Author: imp : > Date: Wed Dec 16 17:17:40 2009 : > New Revision: 200606 : > URL: http://svn.freebsd.org/changeset/base/200606 : > : > Log: : > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. : > : > Note: Not sure this is the right way to do compat, but it makes the : > headers consistent with the implementations. : : Please revert. I think this has already been reverted once before. Though : this approach happens to work for the SYSV IPC case because it uses : SYSCALL_MODULE() to register the system calls at runtime (even when compiled : statically into the kernel), it would not work for a COMPAT syscall that did : not use NOSTD. : : From src/UPDATING: : : 20090624: : The ABI of various structures related to the SYSV IPC API have been : changed. As a result, the COMPAT_FREEBSD[456] and COMPAT_43 kernel : options now all require COMPAT_FREEBSD7. Bump __FreeBSD_version to : 800100. Yes. We need a better error than what we get here. I'll revert these generated files and come up with something better. Warner From owner-svn-src-head@FreeBSD.ORG Wed Dec 16 21:53:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65443106566C; Wed, 16 Dec 2009 21:53:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE4B8FC1B; Wed, 16 Dec 2009 21:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBGLrvdS011850; Wed, 16 Dec 2009 21:53:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGLrvLY011847; Wed, 16 Dec 2009 21:53:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200912162153.nBGLrvLY011847@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Dec 2009 21:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200619 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 21:53:57 -0000 Author: imp Date: Wed Dec 16 21:53:56 2009 New Revision: 200619 URL: http://svn.freebsd.org/changeset/base/200619 Log: Revert 200606. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 21:48:27 2009 (r200618) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Dec 16 21:53:56 2009 (r200619) @@ -692,8 +692,7 @@ int freebsd6_freebsd32_ftruncate(struct #endif /* COMPAT_FREEBSD6 */ -#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ - defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) +#ifdef COMPAT_FREEBSD7 struct freebsd7_freebsd32_semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -715,7 +714,7 @@ int freebsd7_freebsd32_semctl(struct thr int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); -#endif +#endif /* COMPAT_FREEBSD7 */ #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Dec 16 21:48:27 2009 (r200618) +++ head/sys/sys/sysproto.h Wed Dec 16 21:53:56 2009 (r200619) @@ -2242,8 +2242,13 @@ int freebsd4_sigreturn(struct thread *, #endif /* COMPAT_FREEBSD4 */ -#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ - defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) +#ifdef COMPAT_FREEBSD6 + + +#endif /* COMPAT_FREEBSD6 */ + + +#ifdef COMPAT_FREEBSD7 struct freebsd7___semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; @@ -2265,7 +2270,7 @@ int freebsd7___semctl(struct thread *, s int freebsd7_msgctl(struct thread *, struct freebsd7_msgctl_args *); int freebsd7_shmctl(struct thread *, struct freebsd7_shmctl_args *); -#endif +#endif /* COMPAT_FREEBSD7 */ #define SYS_AUE_syscall AUE_NULL #define SYS_AUE_exit AUE_EXIT From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 00:21:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90D541065672; Thu, 17 Dec 2009 00:21:12 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 808AB8FC14; Thu, 17 Dec 2009 00:21:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH0LClS015297; Thu, 17 Dec 2009 00:21:12 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH0LCWU015295; Thu, 17 Dec 2009 00:21:12 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200912170021.nBH0LCWU015295@svn.freebsd.org> From: Matt Jacob Date: Thu, 17 Dec 2009 00:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200620 - head/sys/dev/ips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 00:21:12 -0000 Author: mjacob Date: Thu Dec 17 00:21:12 2009 New Revision: 200620 URL: http://svn.freebsd.org/changeset/base/200620 Log: Fix argument order in a call to mtx_init. MFC after: 1 week Modified: head/sys/dev/ips/ips_pci.c Modified: head/sys/dev/ips/ips_pci.c ============================================================================== --- head/sys/dev/ips/ips_pci.c Wed Dec 16 21:53:56 2009 (r200619) +++ head/sys/dev/ips/ips_pci.c Thu Dec 17 00:21:12 2009 (r200620) @@ -154,7 +154,7 @@ static int ips_pci_attach(device_t dev) } sc->ips_ich.ich_func = ips_intrhook; sc->ips_ich.ich_arg = sc; - mtx_init(&sc->queue_mtx, "IPS bioqueue lock", MTX_DEF, 0); + mtx_init(&sc->queue_mtx, "IPS bioqueue lock", NULL, MTX_DEF); sema_init(&sc->cmd_sema, 0, "IPS Command Semaphore"); bioq_init(&sc->queue); if (config_intrhook_establish(&sc->ips_ich) != 0) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 00:22:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C41761065676; Thu, 17 Dec 2009 00:22:56 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3E808FC17; Thu, 17 Dec 2009 00:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH0MuKR015376; Thu, 17 Dec 2009 00:22:56 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH0Mu7m015374; Thu, 17 Dec 2009 00:22:56 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200912170022.nBH0Mu7m015374@svn.freebsd.org> From: Matt Jacob Date: Thu, 17 Dec 2009 00:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200621 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 00:22:56 -0000 Author: mjacob Date: Thu Dec 17 00:22:56 2009 New Revision: 200621 URL: http://svn.freebsd.org/changeset/base/200621 Log: Fix argument order in a call to mtx_init. MFC after: 1 week Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Dec 17 00:21:12 2009 (r200620) +++ head/sys/kern/uipc_syscalls.c Thu Dec 17 00:22:56 2009 (r200621) @@ -1886,7 +1886,7 @@ kern_sendfile(struct thread *td, struct if (uap->flags & SF_SYNC) { sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK); memset(sfs, 0, sizeof *sfs); - mtx_init(&sfs->mtx, "sendfile", MTX_DEF, 0); + mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 05:06:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCAE0106566B; Thu, 17 Dec 2009 05:06:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB61D8FC0C; Thu, 17 Dec 2009 05:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH56u5E021132; Thu, 17 Dec 2009 05:06:56 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH56ugi021131; Thu, 17 Dec 2009 05:06:56 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200912170506.nBH56ugi021131@svn.freebsd.org> From: Jamie Gritton Date: Thu, 17 Dec 2009 05:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200623 - head/lib/libjail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 05:06:56 -0000 Author: jamie Date: Thu Dec 17 05:06:56 2009 New Revision: 200623 URL: http://svn.freebsd.org/changeset/base/200623 Log: Add a null pointer check so "name" can be used as a key parameter in jailparam_get. PR: bin/141692 Submitted by: delphij MFC after: 3 days Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Thu Dec 17 02:06:07 2009 (r200622) +++ head/lib/libjail/jail.c Thu Dec 17 05:06:56 2009 (r200623) @@ -532,7 +532,7 @@ jailparam_get(struct jailparam *jp, unsi } jp_key = jp_lastjid ? jp_lastjid : jp_jid && jp_jid->jp_valuelen == sizeof(int) && - *(int *)jp_jid->jp_value ? jp_jid : jp_name; + jp_jid->jp_value && *(int *)jp_jid->jp_value ? jp_jid : jp_name; if (jp_key == NULL || jp_key->jp_value == NULL) { strlcpy(jail_errmsg, "no jail specified", JAIL_ERRMSGLEN); errno = ENOENT; From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 07:18:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DC3B106566C; Thu, 17 Dec 2009 07:18:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5238FC08; Thu, 17 Dec 2009 07:18:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH7I67p023876; Thu, 17 Dec 2009 07:18:06 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH7I6E1023874; Thu, 17 Dec 2009 07:18:06 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200912170718.nBH7I6E1023874@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 17 Dec 2009 07:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200624 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 07:18:06 -0000 Author: edwin Date: Thu Dec 17 07:18:06 2009 New Revision: 200624 URL: http://svn.freebsd.org/changeset/base/200624 Log: Add Australian, New Zealand and Ukraian calendars to the "all" target". MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.all Modified: head/usr.bin/calendar/calendars/calendar.all ============================================================================== --- head/usr.bin/calendar/calendars/calendar.all Thu Dec 17 05:06:56 2009 (r200623) +++ head/usr.bin/calendar/calendars/calendar.all Thu Dec 17 07:18:06 2009 (r200624) @@ -8,13 +8,16 @@ #define _calendar_all_ #include +#include #include #include #include #include #include -#include +#include #include +#include +#include #include #endif /* !_calendar_all_ */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 08:37:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36095106568D; Thu, 17 Dec 2009 08:37:03 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 258DD8FC08; Thu, 17 Dec 2009 08:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH8b3bd025891; Thu, 17 Dec 2009 08:37:03 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH8b3Fo025889; Thu, 17 Dec 2009 08:37:03 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200912170837.nBH8b3Fo025889@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Thu, 17 Dec 2009 08:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200626 - head/usr.bin/yacc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 08:37:03 -0000 Author: rse Date: Thu Dec 17 08:37:02 2009 New Revision: 200626 URL: http://svn.freebsd.org/changeset/base/200626 Log: remove external reference to not (or at least no longer) existing variable 'myname' Modified: head/usr.bin/yacc/defs.h Modified: head/usr.bin/yacc/defs.h ============================================================================== --- head/usr.bin/yacc/defs.h Thu Dec 17 07:36:40 2009 (r200625) +++ head/usr.bin/yacc/defs.h Thu Dec 17 08:37:02 2009 (r200626) @@ -220,7 +220,6 @@ extern char tflag; extern char vflag; extern const char *symbol_prefix; -extern char *myname; extern char *cptr; extern char *line; extern int lineno; From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 08:41:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBB3A1065679; Thu, 17 Dec 2009 08:41:06 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB76F8FC20; Thu, 17 Dec 2009 08:41:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH8f6tt025997; Thu, 17 Dec 2009 08:41:06 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH8f6Vt025995; Thu, 17 Dec 2009 08:41:06 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200912170841.nBH8f6Vt025995@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Thu, 17 Dec 2009 08:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200627 - head/usr.bin/calendar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 08:41:06 -0000 Author: rse Date: Thu Dec 17 08:41:06 2009 New Revision: 200627 URL: http://svn.freebsd.org/changeset/base/200627 Log: DEBUG is either defined or not defined for the 'calender' sources, so use #ifdef and not just #if -- both to be semantically correct and also to be aligned with the rest of the 'calendar' sources Modified: head/usr.bin/calendar/ostern.c Modified: head/usr.bin/calendar/ostern.c ============================================================================== --- head/usr.bin/calendar/ostern.c Thu Dec 17 08:37:02 2009 (r200626) +++ head/usr.bin/calendar/ostern.c Thu Dec 17 08:41:06 2009 (r200627) @@ -87,7 +87,7 @@ geteaster(char *s, int year) else return (0); -#if DEBUG +#ifdef DEBUG printf("%s %d %d\n", s, year, EASTERNAMELEN); #endif From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 08:42:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E2C31065672; Thu, 17 Dec 2009 08:42:45 +0000 (UTC) (envelope-from rse@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DD628FC13; Thu, 17 Dec 2009 08:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBH8gi3t026058; Thu, 17 Dec 2009 08:42:44 GMT (envelope-from rse@svn.freebsd.org) Received: (from rse@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBH8giIe026056; Thu, 17 Dec 2009 08:42:44 GMT (envelope-from rse@svn.freebsd.org) Message-Id: <200912170842.nBH8giIe026056@svn.freebsd.org> From: "Ralf S. Engelschall" Date: Thu, 17 Dec 2009 08:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200628 - head/usr.bin/calendar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 08:42:45 -0000 Author: rse Date: Thu Dec 17 08:42:44 2009 New Revision: 200628 URL: http://svn.freebsd.org/changeset/base/200628 Log: rewind(3) is already declared to return 'void', so no need for an explicit cast Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Thu Dec 17 08:41:06 2009 (r200627) +++ head/usr.bin/calendar/io.c Thu Dec 17 08:42:44 2009 (r200628) @@ -467,7 +467,7 @@ closecal(FILE *fp) if (!doall) return; - (void)rewind(fp); + rewind(fp); if (fstat(fileno(fp), &sbuf) || !sbuf.st_size) goto done; if (pipe(pdes) < 0) From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 09:24:33 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2910F106566C; Thu, 17 Dec 2009 09:24:33 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id C47848FC0A; Thu, 17 Dec 2009 09:24:32 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 02007A59088; Thu, 17 Dec 2009 17:24:31 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id lNOO5o6O+Ma7; Thu, 17 Dec 2009 17:24:19 +0800 (CST) Received: from delta.delphij.net (c-69-181-136-105.hsd1.ca.comcast.net [69.181.136.105]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 5C548A58F5D; Thu, 17 Dec 2009 17:24:13 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=tzTPKscCLKlorXtBMXdgX/renMBexgqnbPJ8gxPFiN6loIVvcPFogM7bDSoR4yznE OgdD0hr8ZhWwTek/vaEfw== Message-ID: <4B29F8B0.4030300@delphij.net> Date: Thu, 17 Dec 2009 01:24:00 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20091214 Thunderbird/3.0 ThunderBrowse/3.2.6.8 MIME-Version: 1.0 To: Jamie Gritton References: <200912170506.nBH56ugi021131@svn.freebsd.org> In-Reply-To: <200912170506.nBH56ugi021131@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r200623 - head/lib/libjail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 09:24:33 -0000 On 2009/12/16 21:06, Jamie Gritton wrote: > Author: jamie > Date: Thu Dec 17 05:06:56 2009 > New Revision: 200623 > URL: http://svn.freebsd.org/changeset/base/200623 > > Log: > Add a null pointer check so "name" can be used as a key parameter in > jailparam_get. > > PR: bin/141692 > Submitted by: delphij Thanks! For the record, the work was sponsored by iXsystems as it's done in my office hours. Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 11:42:37 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4768A1065672; Thu, 17 Dec 2009 11:42:37 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id DFE408FC14; Thu, 17 Dec 2009 11:42:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 10D289CB08A; Thu, 17 Dec 2009 12:40:28 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KDDG9l0Tvt2d; Thu, 17 Dec 2009 12:40:25 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CA5499CB0FA; Thu, 17 Dec 2009 12:40:25 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id nBHBePpt026890; Thu, 17 Dec 2009 12:40:25 +0100 (CET) (envelope-from rdivacky) Date: Thu, 17 Dec 2009 12:40:25 +0100 From: Roman Divacky To: "Ralf S. Engelschall" Message-ID: <20091217114025.GA26660@freebsd.org> References: <200912170837.nBH8b3Fo025889@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912170837.nBH8b3Fo025889@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, delphij@FreeBSD.org Subject: Re: svn commit: r200626 - head/usr.bin/yacc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 11:42:37 -0000 On Thu, Dec 17, 2009 at 08:37:03AM +0000, Ralf S. Engelschall wrote: > Author: rse > Date: Thu Dec 17 08:37:02 2009 > New Revision: 200626 > URL: http://svn.freebsd.org/changeset/base/200626 > > Log: > remove external reference to not (or at least no longer) existing variable 'myname' this is a contributed source that is in the process of being updated... I am not exactly sure what's the status of the update, Xin Li? roman From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 12:27:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6D7E106566C; Thu, 17 Dec 2009 12:27:54 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B64AC8FC12; Thu, 17 Dec 2009 12:27:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHCRsBn033443; Thu, 17 Dec 2009 12:27:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHCRsRv033442; Thu, 17 Dec 2009 12:27:54 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912171227.nBHCRsRv033442@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 12:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200629 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 12:27:54 -0000 Author: luigi Date: Thu Dec 17 12:27:54 2009 New Revision: 200629 URL: http://svn.freebsd.org/changeset/base/200629 Log: simplify the code that finds the next rule after reinjections MFC after: 1 week Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 08:42:44 2009 (r200628) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 12:27:54 2009 (r200629) @@ -1183,31 +1183,29 @@ do { \ mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); if (args->rule) { /* - * Packet has already been tagged. Look for the next rule - * to restart processing. Make sure that args->rule still - * exists and not changed. - * If fw_one_pass != 0 then just accept it. - * XXX should not happen here, but optimized out in - * the caller. + * Packet has already been tagged as a result of a previous + * match on rule args->rule aka args->rule_id (PIPE, QUEUE, + * REASS, NETGRAPH and similar, never a skipto). + * Validate the pointer and continue from args->rule->next + * if still present, otherwise use the default rule. + * XXX If fw_one_pass != 0 then just accept it, though + * the caller should never pass us such packets. */ if (V_fw_one_pass) { IPFW_RUNLOCK(chain); return (IP_FW_PASS); } - if (chain->id != args->chain_id) { + if (chain->id == args->chain_id) { /* pointer still valid */ + f = args->rule->next; + } else { /* must revalidate the pointer */ for (f = chain->rules; f != NULL; f = f->next) - if (f == args->rule && f->id == args->rule_id) + if (f == args->rule && f->id == args->rule_id) { + f = args->rule->next; break; - - if (f != NULL) - f = f->next_rule; - else - f = V_layer3_chain.default_rule; - } else - f = args->rule->next_rule; - - if (f == NULL) - f = lookup_next_rule(args->rule, 0); + } + } + if (f == NULL) /* in case of errors, use default; */ + f = chain->default_rule; } else { /* * Find the starting rule. It can be either the first From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 12:42:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A96F51065670; Thu, 17 Dec 2009 12:42:45 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 989658FC0C; Thu, 17 Dec 2009 12:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHCgjTn033804; Thu, 17 Dec 2009 12:42:45 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHCgjRF033801; Thu, 17 Dec 2009 12:42:45 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912171242.nBHCgjRF033801@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 17 Dec 2009 12:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200630 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 12:42:45 -0000 Author: stas Date: Thu Dec 17 12:42:45 2009 New Revision: 200630 URL: http://svn.freebsd.org/changeset/base/200630 Log: - Partially revert r200417. config.h brings several definitions, that appears to be actually used. Without config.h included cross-build of world failed (at least for ARM). Modified: head/usr.bin/make/arch.c head/usr.bin/make/make.c Modified: head/usr.bin/make/arch.c ============================================================================== --- head/usr.bin/make/arch.c Thu Dec 17 12:27:54 2009 (r200629) +++ head/usr.bin/make/arch.c Thu Dec 17 12:42:45 2009 (r200630) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #include "arch.h" #include "buf.h" +#include "config.h" #include "dir.h" #include "globals.h" #include "GNode.h" Modified: head/usr.bin/make/make.c ============================================================================== --- head/usr.bin/make/make.c Thu Dec 17 12:27:54 2009 (r200629) +++ head/usr.bin/make/make.c Thu Dec 17 12:42:45 2009 (r200630) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); */ #include "arch.h" +#include "config.h" #include "dir.h" #include "globals.h" #include "GNode.h" From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 13:14:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE69106566B; Thu, 17 Dec 2009 13:14:12 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBDDE8FC08; Thu, 17 Dec 2009 13:14:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHDEBiH034589; Thu, 17 Dec 2009 13:14:11 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHDEBQa034586; Thu, 17 Dec 2009 13:14:11 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912171314.nBHDEBQa034586@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 17 Dec 2009 13:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200631 - in head/sys/boot: i386/libi386 pc98/libpc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 13:14:12 -0000 Author: nyan Date: Thu Dec 17 13:14:11 2009 New Revision: 200631 URL: http://svn.freebsd.org/changeset/base/200631 Log: Fix debug messages of bd_io(). MFC after: 1 week Modified: head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/pc98/libpc98/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Thu Dec 17 12:42:45 2009 (r200630) +++ head/sys/boot/i386/libi386/biosdisk.c Thu Dec 17 13:14:11 2009 (r200631) @@ -1266,11 +1266,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 17 12:42:45 2009 (r200630) +++ head/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 17 13:14:11 2009 (r200631) @@ -906,11 +906,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 16:59:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE217106566C; Thu, 17 Dec 2009 16:59:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD7588FC2A; Thu, 17 Dec 2009 16:59:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHGxJRP041577; Thu, 17 Dec 2009 16:59:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHGxJQC041576; Thu, 17 Dec 2009 16:59:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912171659.nBHGxJQC041576@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 17 Dec 2009 16:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200632 - head/usr.bin/uniq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 16:59:20 -0000 Author: jh Date: Thu Dec 17 16:59:19 2009 New Revision: 200632 URL: http://svn.freebsd.org/changeset/base/200632 Log: The input line length limit mentioned on the manual page was removed by r176119. Approved by: trasz (mentor) Modified: head/usr.bin/uniq/uniq.1 Modified: head/usr.bin/uniq/uniq.1 ============================================================================== --- head/usr.bin/uniq/uniq.1 Thu Dec 17 13:14:11 2009 (r200631) +++ head/usr.bin/uniq/uniq.1 Thu Dec 17 16:59:19 2009 (r200632) @@ -35,7 +35,7 @@ .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 3, 2004 +.Dd December 17, 2009 .Dt UNIQ 1 .Os .Sh NAME @@ -153,7 +153,3 @@ A .Nm command appeared in .At v3 . -.Sh BUGS -Input lines are limited to -.Dv LINE_MAX -(2048) bytes in length. From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 17:03:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 547C6106568F; Thu, 17 Dec 2009 17:03:48 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4308FC22; Thu, 17 Dec 2009 17:03:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHH3m8j041895; Thu, 17 Dec 2009 17:03:48 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHH3mEn041893; Thu, 17 Dec 2009 17:03:48 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912171703.nBHH3mEn041893@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 17 Dec 2009 17:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200633 - head/usr.bin/uniq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:03:48 -0000 Author: jh Date: Thu Dec 17 17:03:47 2009 New Revision: 200633 URL: http://svn.freebsd.org/changeset/base/200633 Log: Sync getline() with comm(1): - Prevent overflowing of the buffer length variable in getline() by limiting its maximum value. - Exit if reallocf(3) fails in getline(). Failure was silently considered as end-of-file. Reviewed by: ghelmer Approved by: trasz (mentor) Modified: head/usr.bin/uniq/uniq.c Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Thu Dec 17 16:59:19 2009 (r200632) +++ head/usr.bin/uniq/uniq.c Thu Dec 17 17:03:47 2009 (r200633) @@ -52,6 +52,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -59,7 +60,8 @@ static const char rcsid[] = #include #include -#define MAXLINELEN (LINE_MAX + 1) +#define INITLINELEN (LINE_MAX + 1) +#define MAXLINELEN ((SIZE_MAX / sizeof(wchar_t)) / 2) int cflag, dflag, uflag; int numchars, numfields, repeats; @@ -137,8 +139,8 @@ main (int argc, char *argv[]) if (argc > 1) ofp = file(argv[1], "w"); - prevbuflen = MAXLINELEN; - thisbuflen = MAXLINELEN; + prevbuflen = INITLINELEN; + thisbuflen = INITLINELEN; prevline = malloc(prevbuflen * sizeof(*prevline)); thisline = malloc(thisbuflen * sizeof(*thisline)); if (prevline == NULL || thisline == NULL) @@ -198,16 +200,19 @@ getline(wchar_t *buf, size_t *buflen, FI bufpos = 0; while ((ch = getwc(fp)) != WEOF && ch != '\n') { - if (bufpos + 2 >= *buflen) { + if (bufpos + 1 >= *buflen) { *buflen = *buflen * 2; + if (*buflen > MAXLINELEN) + errx(1, + "Maximum line buffer length (%zu) exceeded", + MAXLINELEN); buf = reallocf(buf, *buflen * sizeof(*buf)); if (buf == NULL) - return (NULL); + err(1, "reallocf"); } buf[bufpos++] = ch; } - if (bufpos + 1 != *buflen) - buf[bufpos] = '\0'; + buf[bufpos] = '\0'; return (bufpos != 0 || ch == '\n' ? buf : NULL); } @@ -305,13 +310,13 @@ wcsicoll(wchar_t *s1, wchar_t *s2) new_l2_buflen = wcsicoll_l2_buflen; while (new_l1_buflen < l1) { if (new_l1_buflen == 0) - new_l1_buflen = MAXLINELEN; + new_l1_buflen = INITLINELEN; else new_l1_buflen *= 2; } while (new_l2_buflen < l2) { if (new_l2_buflen == 0) - new_l2_buflen = MAXLINELEN; + new_l2_buflen = INITLINELEN; else new_l2_buflen *= 2; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 17:27:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 075AB106566C; Thu, 17 Dec 2009 17:27:13 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E003C8FC19; Thu, 17 Dec 2009 17:27:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHHRCxK042530; Thu, 17 Dec 2009 17:27:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHRCnj042528; Thu, 17 Dec 2009 17:27:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912171727.nBHHRCnj042528@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 17:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200634 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:27:13 -0000 Author: luigi Date: Thu Dec 17 17:27:12 2009 New Revision: 200634 URL: http://svn.freebsd.org/changeset/base/200634 Log: simplify and document lookup_next_rule() Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 17:03:47 2009 (r200633) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 17:27:12 2009 (r200634) @@ -630,50 +630,27 @@ send_reject(struct ip_fw_args *args, int } /** - * Given an ip_fw *, lookup_next_rule will return a pointer - * to the next rule, which can be either the jump - * target (for skipto instructions) or the next one in the list (in - * all other cases including a missing jump target). - * The result is also written in the "next_rule" field of the rule. - * Backward jumps are not allowed, so we start the search from the - * rule following the current one. + * Return the pointer to the skipto target. + * + * IMPORTANT: this should only be called on SKIPTO rules, and the + * jump target is taken from the 'rulenum' argument, which may come + * from the rule itself (direct skipto) or not (tablearg) * * The function never returns NULL: if the requested rule is not * present, it returns the next rule in the chain. - * As a side effect, the rule pointer is also set so next time - * the jump will not require a scan of the list. + * This also happens in case of a bogus argument > 65535 */ - static struct ip_fw * -lookup_next_rule(struct ip_fw *me, u_int32_t tablearg) +lookup_next_rule(struct ip_fw *me, uint32_t rulenum) { - struct ip_fw *rule = NULL; - ipfw_insn *cmd; - u_int16_t rulenum; - - /* look for action, in case it is a skipto */ - cmd = ACTION_PTR(me); - if (cmd->opcode == O_LOG) - cmd += F_LEN(cmd); - if (cmd->opcode == O_ALTQ) - cmd += F_LEN(cmd); - if (cmd->opcode == O_TAG) - cmd += F_LEN(cmd); - if (cmd->opcode == O_SKIPTO ) { - if (tablearg != 0) { - rulenum = (u_int16_t)tablearg; - } else { - rulenum = cmd->arg1; - } - for (rule = me->next; rule ; rule = rule->next) { - if (rule->rulenum >= rulenum) { - break; - } - } + struct ip_fw *rule; + + for (rule = me->next; rule ; rule = rule->next) { + if (rule->rulenum >= rulenum) + break; } if (rule == NULL) /* failure or not a skipto */ - rule = me->next; - me->next_rule = rule; + rule = me->next ? me->next : me; return rule; } @@ -2013,13 +1990,15 @@ do { \ l = 0; /* exit inner loop */ break; } - /* handle skipto */ + /* skipto: */ if (cmd->arg1 == IP_FW_TABLEARG) { - f = lookup_next_rule(f, tablearg); - } else { - if (f->next_rule == NULL) - lookup_next_rule(f, 0); - f = f->next_rule; + f = lookup_next_rule(f, tablearg); + } else { /* direct skipto */ + /* update f->next_rule if not set */ + if (f->next_rule == NULL) + f->next_rule = + lookup_next_rule(f, cmd->arg1); + f = f->next_rule; } /* * Skip disabled rules, and @@ -2032,7 +2011,7 @@ do { \ if (f) { /* found a valid rule */ l = f->cmd_len; cmd = f->cmd; - } else { + } else { /* should not happen */ l = 0; /* exit inner loop */ } match = 1; From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 17:38:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B55711065679; Thu, 17 Dec 2009 17:38:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A49488FC17; Thu, 17 Dec 2009 17:38:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHHc6nA042997; Thu, 17 Dec 2009 17:38:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHc6nY042995; Thu, 17 Dec 2009 17:38:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171738.nBHHc6nY042995@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 17:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200635 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:38:06 -0000 Author: yongari Date: Thu Dec 17 17:38:06 2009 New Revision: 200635 URL: http://svn.freebsd.org/changeset/base/200635 Log: Remove unused VGE_ETHER_ALIGN definition. Modified: head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Thu Dec 17 17:27:12 2009 (r200634) +++ head/sys/dev/vge/if_vgevar.h Thu Dec 17 17:38:06 2009 (r200635) @@ -65,12 +65,6 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 -#ifdef VGE_FIXUP_RX -#define VGE_ETHER_ALIGN sizeof(uint32_t) -#else -#define VGE_ETHER_ALIGN 0 -#endif - struct vge_type { uint16_t vge_vid; uint16_t vge_did; From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 17:44:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF67910656A7; Thu, 17 Dec 2009 17:44:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE9308FC2A; Thu, 17 Dec 2009 17:44:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHHiYpg043300; Thu, 17 Dec 2009 17:44:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHiY3i043298; Thu, 17 Dec 2009 17:44:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912171744.nBHHiY3i043298@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 17:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200636 - head/sys/modules/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:44:34 -0000 Author: luigi Date: Thu Dec 17 17:44:34 2009 New Revision: 200636 URL: http://svn.freebsd.org/changeset/base/200636 Log: Now that ipfw is split into multiple files, we need to list them all in the Makefile for the module, otherwise it won't load due to missing symbols. The problem only affected head with ipfw built as a module. Reported by David Horn Modified: head/sys/modules/ipfw/Makefile Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Thu Dec 17 17:38:06 2009 (r200635) +++ head/sys/modules/ipfw/Makefile Thu Dec 17 17:44:34 2009 (r200636) @@ -6,6 +6,8 @@ KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c +SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_nat.c +SRCS+= ip_fw_sockopt.c ip_fw_table.c SRCS+= opt_inet6.h opt_ipsec.h CFLAGS+= -DIPFIREWALL From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 17:46:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D644D106568B; Thu, 17 Dec 2009 17:46:08 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5B128FC19; Thu, 17 Dec 2009 17:46:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHHk8Wu043394; Thu, 17 Dec 2009 17:46:08 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHHk8VM043392; Thu, 17 Dec 2009 17:46:08 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912171746.nBHHk8VM043392@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 17 Dec 2009 17:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200637 - head/sys/dev/ciss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 17:46:08 -0000 Author: gavin Date: Thu Dec 17 17:46:08 2009 New Revision: 200637 URL: http://svn.freebsd.org/changeset/base/200637 Log: Don't panic due to unlocking an unowned mutex if we fail during attach. PR: kern/139053 Reviewed by: scottl Approved by: ed (mentor) MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Thu Dec 17 17:44:34 2009 (r200636) +++ head/sys/dev/ciss/ciss.c Thu Dec 17 17:46:08 2009 (r200637) @@ -418,6 +418,7 @@ ciss_attach(device_t dev) sc = device_get_softc(dev); sc->ciss_dev = dev; + mtx_init(&sc->ciss_mtx, "cissmtx", NULL, MTX_DEF); /* * Do PCI-specific init. @@ -430,7 +431,6 @@ ciss_attach(device_t dev) */ ciss_initq_free(sc); ciss_initq_notify(sc); - mtx_init(&sc->ciss_mtx, "cissmtx", NULL, MTX_DEF); callout_init_mtx(&sc->ciss_periodic, &sc->ciss_mtx, 0); /* @@ -496,8 +496,11 @@ ciss_attach(device_t dev) error = 0; out: - if (error != 0) + if (error != 0) { + /* ciss_free() expects the mutex to be held */ + mtx_lock(&sc->ciss_mtx); ciss_free(sc); + } return(error); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 18:00:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E091A106568D; Thu, 17 Dec 2009 18:00:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE54A8FC0C; Thu, 17 Dec 2009 18:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHI0PjO043947; Thu, 17 Dec 2009 18:00:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHI0PZN043943; Thu, 17 Dec 2009 18:00:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171800.nBHI0PZN043943@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 18:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200638 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:00:26 -0000 Author: yongari Date: Thu Dec 17 18:00:25 2009 New Revision: 200638 URL: http://svn.freebsd.org/changeset/base/200638 Log: Implement interrupt moderation scheme supported by VT61xx controllers. TX/RX interrupt mitigation is controlled by VGE_TXSUPPTHR and VGE_RXSUPPTHR register. These registers suppress generation of interrupts until the programmed frames counter equals to the registers. VT61xx also supports interrupt hold off timer register. If this interrupt hold off timer is active all interrupts would be disabled until the timer reaches to 0. The timer value is reloaded whenever VGE_ISR register written. The timer resolution is about 20us. Previously vge(4) used single shot timer to reduce Tx completion interrupts. This required VGE_CRS1 register access in Tx start/completion handler to rearm new timeout value and it did not show satisfactory result(more than 50k interrupts under load). Rx interrupts was not moderated at all such that vge(4) used to generate too many interrupts which in turn made polling(4) better approach under high network load. This change activates all interrupt moderation mechanism and initial values were tuned to generate interrupt less than 8k per second. That number of interrupts wouldn't add additional packet latencies compared to polling(4). These interrupt parameters could be changed with sysctl. dev.vge.%d.int_holdoff dev.vge.%d.rx_coal_pkt dev.vge.%d.tx_coal_pkt Interface has be brought down and up again before change take effect. With interrupt moderation there is no more need to loop in interrupt handler. This loop always added one more register access. While I'm here remove dead code which tried to implement subset of interrupt moderation. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Thu Dec 17 17:46:08 2009 (r200637) +++ head/sys/dev/vge/if_vge.c Thu Dec 17 18:00:25 2009 (r200638) @@ -175,6 +175,7 @@ static int vge_ifmedia_upd(struct ifnet static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); +static void vge_intr_holdoff(struct vge_softc *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); @@ -1631,15 +1632,6 @@ vge_txeof(struct vge_softc *sc) sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; - else { - /* - * If not all descriptors have been released reaped yet, - * reload the timer so that we will eventually get another - * interrupt that will cause us to re-enter this routine. - * This is done in case the transmitter has gone idle. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - } } static void @@ -1746,30 +1738,21 @@ vge_intr(void *arg) /* Disable interrupts */ CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_GMSK); - - for (;;) { - - status = CSR_READ_4(sc, VGE_ISR); - /* If the card has gone away the read returns 0xffff. */ - if (status == 0xFFFFFFFF) - break; - - if (status) - CSR_WRITE_4(sc, VGE_ISR, status); - - if ((status & VGE_INTRS) == 0) - break; - + status = CSR_READ_4(sc, VGE_ISR); + CSR_WRITE_4(sc, VGE_ISR, status | VGE_ISR_HOLDOFF_RELOAD); + /* If the card has gone away the read returns 0xffff. */ + if (status == 0xFFFFFFFF || (status & VGE_INTRS) == 0) + goto done; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (status & (VGE_ISR_RXOK|VGE_ISR_RXOK_HIPRIO)) vge_rxeof(sc, VGE_RX_DESC_CNT); - if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, VGE_RX_DESC_CNT); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } - if (status & (VGE_ISR_TXOK0|VGE_ISR_TIMER0)) + if (status & (VGE_ISR_TXOK0|VGE_ISR_TXOK_HIPRIO)) vge_txeof(sc); if (status & (VGE_ISR_TXDMA_STALL|VGE_ISR_RXDMA_STALL)) { @@ -1780,13 +1763,14 @@ vge_intr(void *arg) if (status & VGE_ISR_LINKSTS) vge_link_statchg(sc); } +done: + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + /* Re-enable interrupts */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - /* Re-enable interrupts */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vge_start_locked(ifp); - + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + vge_start_locked(ifp); + } VGE_UNLOCK(sc); } @@ -1985,17 +1969,6 @@ vge_start_locked(struct ifnet *ifp) /* Issue a transmit command. */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_WAK0); /* - * Use the countdown timer for interrupt moderation. - * 'TX done' interrupts are disabled. Instead, we reset the - * countdown timer, which will begin counting until it hits - * the value in the SSTIMER register, and then trigger an - * interrupt. Each time we set the TIMER0_ENABLE bit, the - * the timer count is reloaded. Only when the transmitter - * is idle will the timer hit 0 and an interrupt fire. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - - /* * Set a timeout in case the chip goes out to lunch. */ sc->vge_timer = 5; @@ -2084,6 +2057,9 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_2(sc, VGE_RXDESCNUM, VGE_RX_DESC_CNT - 1); CSR_WRITE_2(sc, VGE_RXDESC_RESIDUECNT, VGE_RX_DESC_CNT); + /* Configure interrupt moderation. */ + vge_intr_holdoff(sc); + /* Enable and wake up the RX descriptor queue */ CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); @@ -2110,42 +2086,6 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS0, VGE_CR0_TX_ENABLE|VGE_CR0_RX_ENABLE|VGE_CR0_START); - /* - * Configure one-shot timer for microsecond - * resolution and load it for 500 usecs. - */ - CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); - CSR_WRITE_2(sc, VGE_SSTIMER, 400); - - /* - * Configure interrupt moderation for receive. Enable - * the holdoff counter and load it, and set the RX - * suppression count to the number of descriptors we - * want to allow before triggering an interrupt. - * The holdoff timer is in units of 20 usecs. - */ - -#ifdef notyet - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_TXINTSUP_DISABLE); - /* Select the interrupt holdoff timer page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); - CSR_WRITE_1(sc, VGE_INTHOLDOFF, 10); /* ~200 usecs */ - - /* Enable use of the holdoff timer. */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_SC_RELOAD); - - /* Select the RX suppression threshold page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); - CSR_WRITE_1(sc, VGE_RXSUPPTHR, 64); /* interrupt after 64 packets */ - - /* Restore the page select bits. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); -#endif - #ifdef DEVICE_POLLING /* * Disable interrupts if we are polling. @@ -2494,6 +2434,25 @@ vge_sysctl_node(struct vge_softc *sc) stats = &sc->vge_stats; ctx = device_get_sysctl_ctx(sc->vge_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "int_holdoff", + CTLFLAG_RW, &sc->vge_int_holdoff, 0, "interrupt holdoff"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_coal_pkt", + CTLFLAG_RW, &sc->vge_rx_coal_pkt, 0, "rx coalescing packet"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_coal_pkt", + CTLFLAG_RW, &sc->vge_tx_coal_pkt, 0, "tx coalescing packet"); + + /* Pull in device tunables. */ + sc->vge_int_holdoff = VGE_INT_HOLDOFF_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "int_holdoff", &sc->vge_int_holdoff); + sc->vge_rx_coal_pkt = VGE_RX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "rx_coal_pkt", &sc->vge_rx_coal_pkt); + sc->vge_tx_coal_pkt = VGE_TX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "tx_coal_pkt", &sc->vge_tx_coal_pkt); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "VGE statistics"); parent = SYSCTL_CHILDREN(tree); @@ -2699,3 +2658,51 @@ reset_idx: mib[VGE_MIB_RX_SYMERRS] + mib[VGE_MIB_RX_LENERRS]; } + +static void +vge_intr_holdoff(struct vge_softc *sc) +{ + uint8_t intctl; + + VGE_LOCK_ASSERT(sc); + + /* + * Set Tx interrupt supression threshold. + * It's possible to use single-shot timer in VGE_CRS1 register + * in Tx path such that driver can remove most of Tx completion + * interrupts. However this requires additional access to + * VGE_CRS1 register to reload the timer in addintion to + * activating Tx kick command. Another downside is we don't know + * what single-shot timer value should be used in advance so + * reclaiming transmitted mbufs could be delayed a lot which in + * turn slows down Tx operation. + */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_TXSUPPTHR); + CSR_WRITE_1(sc, VGE_TXSUPPTHR, sc->vge_tx_coal_pkt); + + /* Set Rx interrupt suppresion threshold. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); + CSR_WRITE_1(sc, VGE_RXSUPPTHR, sc->vge_rx_coal_pkt); + + intctl = CSR_READ_1(sc, VGE_INTCTL1); + intctl &= ~VGE_INTCTL_SC_RELOAD; + intctl |= VGE_INTCTL_HC_RELOAD; + if (sc->vge_tx_coal_pkt <= 0) + intctl |= VGE_INTCTL_TXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_TXINTSUP_DISABLE; + if (sc->vge_rx_coal_pkt <= 0) + intctl |= VGE_INTCTL_RXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_RXINTSUP_DISABLE; + CSR_WRITE_1(sc, VGE_INTCTL1, intctl); + CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_HOLDOFF); + if (sc->vge_int_holdoff > 0) { + /* Set interrupt holdoff timer. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); + CSR_WRITE_1(sc, VGE_INTHOLDOFF, + VGE_INT_HOLDOFF_USEC(sc->vge_int_holdoff)); + /* Enable holdoff timer. */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); + } +} Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Thu Dec 17 17:46:08 2009 (r200637) +++ head/sys/dev/vge/if_vgereg.h Thu Dec 17 18:00:25 2009 (r200638) @@ -300,8 +300,7 @@ #define VGE_INTRS (VGE_ISR_TXOK0|VGE_ISR_RXOK|VGE_ISR_STOPPED| \ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ - VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_TIMER0) + VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL) /* Interrupt mask register */ Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Thu Dec 17 17:46:08 2009 (r200637) +++ head/sys/dev/vge/if_vgevar.h Thu Dec 17 18:00:25 2009 (r200638) @@ -65,6 +65,20 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 +#define VGE_INT_HOLDOFF_TICK 20 +#define VGE_INT_HOLDOFF_USEC(x) ((x) / VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_MIN 0 +#define VGE_INT_HOLDOFF_MAX (255 * VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_DEFAULT 150 + +#define VGE_RX_COAL_PKT_MIN 1 +#define VGE_RX_COAL_PKT_MAX VGE_RX_DESC_CNT +#define VGE_RX_COAL_PKT_DEFAULT 64 + +#define VGE_TX_COAL_PKT_MIN 1 +#define VGE_TX_COAL_PKT_MAX VGE_TX_DESC_CNT +#define VGE_TX_COAL_PKT_DEFAULT 128 + struct vge_type { uint16_t vge_vid; uint16_t vge_did; @@ -177,6 +191,9 @@ struct vge_softc { #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; + int vge_int_holdoff; + int vge_rx_coal_pkt; + int vge_tx_coal_pkt; struct mtx vge_mtx; struct callout vge_watchdog; int vge_timer; From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 18:03:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8760C1065676; Thu, 17 Dec 2009 18:03:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76D978FC14; Thu, 17 Dec 2009 18:03:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHI35kY044060; Thu, 17 Dec 2009 18:03:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHI35Hc044058; Thu, 17 Dec 2009 18:03:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171803.nBHI35Hc044058@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 18:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200639 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:03:05 -0000 Author: yongari Date: Thu Dec 17 18:03:05 2009 New Revision: 200639 URL: http://svn.freebsd.org/changeset/base/200639 Log: Actually clear interrupts. Writing 0 has no effect. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Thu Dec 17 18:00:25 2009 (r200638) +++ head/sys/dev/vge/if_vge.c Thu Dec 17 18:03:05 2009 (r200639) @@ -2100,7 +2100,7 @@ vge_init_locked(struct vge_softc *sc) * Enable interrupts. */ CSR_WRITE_4(sc, VGE_IMR, VGE_INTRS); - CSR_WRITE_4(sc, VGE_ISR, 0); + CSR_WRITE_4(sc, VGE_ISR, 0xFFFFFFFF); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 18:37:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E3E61065694; Thu, 17 Dec 2009 18:37:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8A08FC13; Thu, 17 Dec 2009 18:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHIbBYp045313; Thu, 17 Dec 2009 18:37:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHIbBEd045311; Thu, 17 Dec 2009 18:37:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171837.nBHIbBEd045311@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 18:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200641 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 18:37:11 -0000 Author: yongari Date: Thu Dec 17 18:37:11 2009 New Revision: 200641 URL: http://svn.freebsd.org/changeset/base/200641 Log: Document newly added loader tunable and sysctl variables. o hw.vge.msi_disable o dev.vge.%d.int_holdoff o dev.vge.%d.rx_coal_pkt o dev.vge.%d.tx_coal_pkt Modified: head/share/man/man4/vge.4 Modified: head/share/man/man4/vge.4 ============================================================================== --- head/share/man/man4/vge.4 Thu Dec 17 18:17:46 2009 (r200640) +++ head/share/man/man4/vge.4 Thu Dec 17 18:37:11 2009 (r200641) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2007 +.Dd December 17, 2009 .Dt VGE 4 .Os .Sh NAME @@ -173,6 +173,38 @@ ZyXEL GN650-T 64-bit PCI Gigabit Etherne .It ZyXEL GN670-T 32-bit PCI Gigabit Ethernet NIC (ZX1702) .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vge.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.vge.%d.int_holdoff +Maximum number of time to delay interrupts. +The valid range is 0 to 5100 in units of 1us, the default is +150 (150us). +The resolution of of timer is about 20us so finer tuning than +20us wouldn't be available. +The interface should be brought down and up again before a change +takes effect. +.It Va dev.vge.%d.rx_coal_pkt +Maximum number of packets to fire Rx completion interrupt. +The valid range is 1 to 255, the default is 64. +.It Va dev.vge.%d.tx_coal_pkt +Maximum number of packets to fire Tx completion interrupt. +The valid range is 1 to 255, the default is 128. +.El .Sh DIAGNOSTICS .Bl -diag .It "vge%d: couldn't map memory" From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 19:35:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E12A5106566C; Thu, 17 Dec 2009 19:35:48 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id A4FA58FC17; Thu, 17 Dec 2009 19:35:48 +0000 (UTC) Received: by pzk15 with SMTP id 15so1622504pzk.3 for ; Thu, 17 Dec 2009 11:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sK9ULPM5b+qRDIwFoEPsDufhno/APO7EmNPTWLuLfas=; b=HwmChBc7K5MOALYhi8bSdPH/ei2USQG4tmYGWVKOKIebT3B4WozLFRqKkD1iCrE7Ul +O4HrFO9eeEraNUReZ88h+9ibeBEsg+BnQhQpOcKHtumOPUikVHELf5Xbtbx/YUwpJGZ E6PWb6GXbncSsgDgbruaQjEJk+cnmK7hrtjy8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=mn2V/HCNFnrB3mmaJxlYjid+Blw7hbF7iMqMEh3Ca8hXEZn6dX0oWOPQL7zu3jcrnH WHpzL+K96FMb9OvF8xU3wGKZgx171emiFzUwrb3Kc2SRgTj7BPCEscgOqxmQ39hDBecX 0Nuofi1sHlXZw6wA5mska4jAR5dtQgsY+cBVE= MIME-Version: 1.0 Received: by 10.115.66.29 with SMTP id t29mr1925225wak.187.1261077142196; Thu, 17 Dec 2009 11:12:22 -0800 (PST) In-Reply-To: <200912171242.nBHCgjRF033801@svn.freebsd.org> References: <200912171242.nBHCgjRF033801@svn.freebsd.org> Date: Thu, 17 Dec 2009 11:12:22 -0800 Message-ID: From: Xin LI To: Stanislav Sedov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200630 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:35:49 -0000 Hi, On Thu, Dec 17, 2009 at 4:42 AM, Stanislav Sedov wrote: > Author: stas > Date: Thu Dec 17 12:42:45 2009 > New Revision: 200630 > URL: http://svn.freebsd.org/changeset/base/200630 > > Log: > =C2=A0- Partially revert r200417. =C2=A0config.h brings several definitio= ns, > =C2=A0 =C2=A0that appears to be actually used. =C2=A0Without config.h inc= luded > =C2=A0 =C2=A0cross-build of world failed (at least for ARM). Sorry for the breakage, I was shock that this was not caught by ``make universe'', could you please send me a copy of the build log so I will be able to see why? Thanks in advance! --=20 Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 19:48:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED3E106566B; Thu, 17 Dec 2009 19:48:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEB728FC0A; Thu, 17 Dec 2009 19:48:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHJmstZ047913; Thu, 17 Dec 2009 19:48:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHJmsXC047911; Thu, 17 Dec 2009 19:48:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912171948.nBHJmsXC047911@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Dec 2009 19:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200644 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 19:48:55 -0000 Author: yongari Date: Thu Dec 17 19:48:54 2009 New Revision: 200644 URL: http://svn.freebsd.org/changeset/base/200644 Log: Remove unused member variable of softc. Modified: head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Thu Dec 17 18:56:52 2009 (r200643) +++ head/sys/dev/vge/if_vgevar.h Thu Dec 17 19:48:54 2009 (r200644) @@ -181,7 +181,6 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - uint8_t vge_type; int vge_if_flags; int vge_phyaddr; int vge_flags; From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 20:41:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9A7106568F; Thu, 17 Dec 2009 20:41:59 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFF348FC1E; Thu, 17 Dec 2009 20:41:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHKfxZJ049754; Thu, 17 Dec 2009 20:41:59 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHKfxaA049752; Thu, 17 Dec 2009 20:41:59 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200912172041.nBHKfxaA049752@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 17 Dec 2009 20:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200650 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 20:42:00 -0000 Author: edwin Date: Thu Dec 17 20:41:59 2009 New Revision: 200650 URL: http://svn.freebsd.org/changeset/base/200650 Log: Nationalise Easter -> Pasen MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.dutch Modified: head/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- head/usr.bin/calendar/calendars/calendar.dutch Thu Dec 17 20:41:40 2009 (r200649) +++ head/usr.bin/calendar/calendars/calendar.dutch Thu Dec 17 20:41:59 2009 (r200650) @@ -5,6 +5,7 @@ */ LANG=nl_NL.ISO8859-15 +Easter=Pasen /* * Feestdagen @@ -32,21 +33,21 @@ LANG=nl_NL.ISO8859-15 /* * Pasen gerelateerd */ -Easter-50 Carnaval -Easter-49 Carnaval -Easter-48 Carnaval -Easter-47 Carnaval (Vastenavond) -Easter-46 Aswoensdag -Easter-7 Palmzondag -Easter-3 Witte Donderdag -Easter-2 Goede vrijdag -Easter-1 Stille zaterdag -Easter Eerste paasdag -Easter+1 Tweede paasdag -Easter+39 Hemelvaartsdag -Easter+49 Eerste Pinksterdag -Easter+50 Tweede Pinksterdag -Easter+56 Trinitatis +Pasen-50 Carnaval +Pasen-49 Carnaval +Pasen-48 Carnaval +Pasen-47 Carnaval (Vastenavond) +Pasen-46 Aswoensdag +Pasen-7 Palmzondag +Pasen-3 Witte Donderdag +Pasen-2 Goede vrijdag +Pasen-1 Stille zaterdag +Pasen Eerste paasdag +Pasen+1 Tweede paasdag +Pasen+39 Hemelvaartsdag +Pasen+49 Eerste Pinksterdag +Pasen+50 Tweede Pinksterdag +Pasen+56 Trinitatis /* * Misc From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 21:17:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09138106566C; Thu, 17 Dec 2009 21:17:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED5798FC0A; Thu, 17 Dec 2009 21:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHLHDZE050861; Thu, 17 Dec 2009 21:17:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHLHDiY050859; Thu, 17 Dec 2009 21:17:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912172117.nBHLHDiY050859@svn.freebsd.org> From: Andrew Thompson Date: Thu, 17 Dec 2009 21:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200652 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 21:17:14 -0000 Author: thompsa Date: Thu Dec 17 21:17:13 2009 New Revision: 200652 URL: http://svn.freebsd.org/changeset/base/200652 Log: If the runcount is non-zero in eventhandler_deregister() then one or more threads are executing the eventhandler, sleep in this case to make it safe for module unload. If the runcount was up then an entry would have been marked EHE_DEAD_PRIORITY so use this as a trigger to do the wakeup in eventhandler_prune_list(). Reviewed by: jhb Modified: head/sys/kern/subr_eventhandler.c Modified: head/sys/kern/subr_eventhandler.c ============================================================================== --- head/sys/kern/subr_eventhandler.c Thu Dec 17 21:17:12 2009 (r200651) +++ head/sys/kern/subr_eventhandler.c Thu Dec 17 21:17:13 2009 (r200652) @@ -178,6 +178,8 @@ eventhandler_deregister(struct eventhand ep->ee_priority = EHE_DEAD_PRIORITY; } } + while (list->el_runcount > 0) + mtx_sleep(list, &list->el_lock, 0, "evhrm", 0); EHL_UNLOCK(list); } @@ -225,16 +227,17 @@ void eventhandler_prune_list(struct eventhandler_list *list) { struct eventhandler_entry *ep, *en; + int pruned = 0; CTR2(KTR_EVH, "%s: pruning list \"%s\"", __func__, list->el_name); EHL_LOCK_ASSERT(list, MA_OWNED); - ep = TAILQ_FIRST(&list->el_entries); - while (ep != NULL) { - en = TAILQ_NEXT(ep, ee_link); + TAILQ_FOREACH_SAFE(ep, &list->el_entries, ee_link, en) { if (ep->ee_priority == EHE_DEAD_PRIORITY) { TAILQ_REMOVE(&list->el_entries, ep, ee_link); free(ep, M_EVENTHANDLER); + pruned++; } - ep = en; } + if (pruned > 0) + wakeup(list); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 21:42:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C02E81065694; Thu, 17 Dec 2009 21:42:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEC0E8FC19; Thu, 17 Dec 2009 21:42:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHLgAQP051566; Thu, 17 Dec 2009 21:42:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHLgAkf051560; Thu, 17 Dec 2009 21:42:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912172142.nBHLgAkf051560@svn.freebsd.org> From: Andrew Thompson Date: Thu, 17 Dec 2009 21:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200653 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 21:42:10 -0000 Author: thompsa Date: Thu Dec 17 21:42:10 2009 New Revision: 200653 URL: http://svn.freebsd.org/changeset/base/200653 Log: Use the EVENTHANDLER system to hook into the usb device configuration and perform a function such as ejecting a 3G autoinstaller disk. The eventhandler system properly tracks threads and is safe to unload, remove the setting/clearing of a function pointer in the kernel by u3g(4) which included a tsleep for safety. Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_dynamic.h head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/serial/u3g.c Thu Dec 17 21:42:10 2009 (r200653) @@ -122,8 +122,13 @@ static void u3g_stop_read(struct ucom_so static void u3g_start_write(struct ucom_softc *ucom); static void u3g_stop_write(struct ucom_softc *ucom); + +static void u3g_test_autoinst(void *, struct usb_device *, + struct usb_attach_arg *); static int u3g_driver_loaded(struct module *mod, int what, void *arg); +static eventhandler_tag u3g_etag; + static const struct usb_config u3g_config[U3G_N_TRANSFER] = { [U3G_BULK_WR] = { @@ -360,58 +365,48 @@ u3g_sael_m460_init(struct usb_device *ud } } -static int -u3g_lookup_huawei(struct usb_attach_arg *uaa) -{ - /* Calling the lookup function will also set the driver info! */ - return (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)); -} - /* * The following function handles 3G modem devices (E220, Mobile, * etc.) with auto-install flash disks for Windows/MacOSX on the first * interface. After some command or some delay they change appearance * to a modem. */ -static usb_error_t -u3g_test_huawei_autoinst(struct usb_device *udev, +static void +u3g_test_autoinst(void *arg, struct usb_device *udev, struct usb_attach_arg *uaa) { struct usb_interface *iface; struct usb_interface_descriptor *id; uint32_t flags; - if (udev == NULL) { - return (USB_ERR_INVAL); - } + if (uaa->dev_state != UAA_DEV_READY) + return; + iface = usbd_get_iface(udev, 0); - if (iface == NULL) { - return (USB_ERR_INVAL); - } + if (iface == NULL) + return; id = iface->idesc; - if (id == NULL) { - return (USB_ERR_INVAL); - } - if (id->bInterfaceClass != UICLASS_MASS) { - return (USB_ERR_INVAL); - } - if (u3g_lookup_huawei(uaa)) { + if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + return; + if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)) { /* no device match */ - return (USB_ERR_INVAL); + return; } flags = USB_GET_DRIVER_INFO(uaa); if (flags & U3GFL_HUAWEI_INIT) { u3g_huawei_init(udev); } else if (flags & U3GFL_SCSI_EJECT) { - return (usb_test_autoinstall(udev, 0, 1)); + if (usb_test_autoinstall(udev, 0, 1) != 0) + return; } else if (flags & U3GFL_SIERRA_INIT) { u3g_sierra_init(udev); } else { /* no quirks */ - return (USB_ERR_INVAL); + return; } - return (0); /* success */ + uaa->dev_state = UAA_DEV_EJECTING; + return; /* success */ } static int @@ -420,10 +415,11 @@ u3g_driver_loaded(struct module *mod, in switch (what) { case MOD_LOAD: /* register our autoinstall handler */ - usb_test_huawei_autoinst_p = &u3g_test_huawei_autoinst; + u3g_etag = EVENTHANDLER_REGISTER(usb_dev_configured, + u3g_test_autoinst, NULL, EVENTHANDLER_PRI_ANY); break; case MOD_UNLOAD: - usb_test_huawei_unload(NULL); + EVENTHANDLER_DEREGISTER(usb_dev_configured, u3g_etag); break; default: return (EOPNOTSUPP); @@ -445,7 +441,7 @@ u3g_probe(device_t self) if (uaa->info.bInterfaceClass != UICLASS_VENDOR) { return (ENXIO); } - return (u3g_lookup_huawei(uaa)); + return (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)); } static int Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usb_device.c Thu Dec 17 21:42:10 2009 (r200653) @@ -1204,6 +1204,7 @@ usb_init_attach_arg(struct usb_device *u uaa->device = udev; uaa->usb_mode = udev->flags.usb_mode; uaa->port = udev->port_no; + uaa->dev_state = UAA_DEV_READY; uaa->info.idVendor = UGETW(udev->ddesc.idVendor); uaa->info.idProduct = UGETW(udev->ddesc.idProduct); @@ -1453,6 +1454,9 @@ usb_alloc_device(device_t parent_dev, st size_t scratch_size; usb_error_t err; uint8_t device_index; + uint8_t config_index; + uint8_t config_quirk; + uint8_t set_config_failed; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1732,96 +1736,91 @@ usb_alloc_device(device_t parent_dev, st /* fetch the vendor and product strings from the device */ usbd_set_device_strings(udev); - if (udev->flags.usb_mode == USB_MODE_HOST) { - uint8_t config_index; - uint8_t config_quirk; - uint8_t set_config_failed = 0; + if (udev->flags.usb_mode == USB_MODE_DEVICE) { + /* USB device mode setup is complete */ + err = 0; + goto config_done; + } - /* - * Most USB devices should attach to config index 0 by - * default - */ - if (usb_test_quirk(&uaa, UQ_CFG_INDEX_0)) { - config_index = 0; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_1)) { - config_index = 1; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_2)) { - config_index = 2; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_3)) { - config_index = 3; - config_quirk = 1; - } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_4)) { - config_index = 4; - config_quirk = 1; - } else { - config_index = 0; - config_quirk = 0; - } + /* + * Most USB devices should attach to config index 0 by + * default + */ + if (usb_test_quirk(&uaa, UQ_CFG_INDEX_0)) { + config_index = 0; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_1)) { + config_index = 1; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_2)) { + config_index = 2; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_3)) { + config_index = 3; + config_quirk = 1; + } else if (usb_test_quirk(&uaa, UQ_CFG_INDEX_4)) { + config_index = 4; + config_quirk = 1; + } else { + config_index = 0; + config_quirk = 0; + } + set_config_failed = 0; repeat_set_config: - DPRINTF("setting config %u\n", config_index); + DPRINTF("setting config %u\n", config_index); - /* get the USB device configured */ - err = usbd_set_config_index(udev, config_index); - if (err) { - if (udev->ddesc.bNumConfigurations != 0) { - if (!set_config_failed) { - set_config_failed = 1; - /* XXX try to re-enumerate the device */ - err = usbd_req_re_enumerate( - udev, NULL); - if (err == 0) - goto repeat_set_config; - } - DPRINTFN(0, "Failure selecting " - "configuration index %u: %s, port %u, " - "addr %u (ignored)\n", - config_index, usbd_errstr(err), udev->port_no, - udev->address); + /* get the USB device configured */ + err = usbd_set_config_index(udev, config_index); + if (err) { + if (udev->ddesc.bNumConfigurations != 0) { + if (!set_config_failed) { + set_config_failed = 1; + /* XXX try to re-enumerate the device */ + err = usbd_req_re_enumerate(udev, NULL); + if (err == 0) + goto repeat_set_config; } + DPRINTFN(0, "Failure selecting configuration index %u:" + "%s, port %u, addr %u (ignored)\n", + config_index, usbd_errstr(err), udev->port_no, + udev->address); + } + /* + * Some USB devices do not have any configurations. Ignore any + * set config failures! + */ + err = 0; + goto config_done; + } + if (!config_quirk && config_index + 1 < udev->ddesc.bNumConfigurations) { + if ((udev->cdesc->bNumInterface < 2) && + usbd_get_no_descriptors(udev->cdesc, UDESC_ENDPOINT) == 0) { + DPRINTFN(0, "Found no endpoints, trying next config\n"); + config_index++; + goto repeat_set_config; + } + if (config_index == 0) { /* - * Some USB devices do not have any - * configurations. Ignore any set config - * failures! + * Try to figure out if we have an + * auto-install disk there: */ - err = 0; - } else if (config_quirk) { - /* user quirk selects configuration index */ - } else if ((config_index + 1) < udev->ddesc.bNumConfigurations) { - - if ((udev->cdesc->bNumInterface < 2) && - (usbd_get_no_descriptors(udev->cdesc, - UDESC_ENDPOINT) == 0)) { - DPRINTFN(0, "Found no endpoints " - "(trying next config)\n"); + if (usb_test_autoinstall(udev, 0, 0) == 0) { + DPRINTFN(0, "Found possible auto-install " + "disk (trying next config)\n"); config_index++; goto repeat_set_config; } - if (config_index == 0) { - /* - * Try to figure out if we have an - * auto-install disk there: - */ - if (usb_test_autoinstall(udev, 0, 0) == 0) { - DPRINTFN(0, "Found possible auto-install " - "disk (trying next config)\n"); - config_index++; - goto repeat_set_config; - } - } - } else if (usb_test_huawei_autoinst_p(udev, &uaa) == 0) { - DPRINTFN(0, "Found Huawei auto-install disk\n"); - /* leave device unconfigured */ - usb_unconfigure(udev, 0); } - } else { - err = 0; /* set success */ + } + EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); + if (uaa.dev_state != UAA_DEV_READY) { + /* leave device unconfigured */ + usb_unconfigure(udev, 0); } +config_done: DPRINTF("new dev (addr %d), udev=%p, parent_hub=%p\n", udev->address, udev, udev->parent_hub); Modified: head/sys/dev/usb/usb_dynamic.c ============================================================================== --- head/sys/dev/usb/usb_dynamic.c Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usb_dynamic.c Thu Dec 17 21:42:10 2009 (r200653) @@ -57,7 +57,6 @@ static usb_handle_req_t usb_temp_get_des static usb_temp_setup_by_index_t usb_temp_setup_by_index_w; static usb_temp_unsetup_t usb_temp_unsetup_w; static usb_test_quirk_t usb_test_quirk_w; -static usb_test_huawei_autoinst_t usb_test_huawei_autoinst_w; static usb_quirk_ioctl_t usb_quirk_ioctl_w; /* global variables */ @@ -65,7 +64,6 @@ usb_handle_req_t *usb_temp_get_desc_p = usb_temp_setup_by_index_t *usb_temp_setup_by_index_p = &usb_temp_setup_by_index_w; usb_temp_unsetup_t *usb_temp_unsetup_p = &usb_temp_unsetup_w; usb_test_quirk_t *usb_test_quirk_p = &usb_test_quirk_w; -usb_test_huawei_autoinst_t *usb_test_huawei_autoinst_p = &usb_test_huawei_autoinst_w; usb_quirk_ioctl_t *usb_quirk_ioctl_p = &usb_quirk_ioctl_w; devclass_t usb_devclass_ptr = NULL; @@ -105,13 +103,6 @@ usb_temp_unsetup_w(struct usb_device *ud } } -static usb_error_t -usb_test_huawei_autoinst_w(struct usb_device *udev, - struct usb_attach_arg *uaa) -{ - return (USB_ERR_INVAL); -} - void usb_quirk_unload(void *arg) { @@ -156,17 +147,3 @@ usb_bus_unload(void *arg) pause("WAIT", hz); } - -void -usb_test_huawei_unload(void *arg) -{ - /* reset function pointers */ - - usb_test_huawei_autoinst_p = &usb_test_huawei_autoinst_w; - - /* wait for CPU to exit the loaded functions, if any */ - - /* XXX this is a tradeoff */ - - pause("WAIT", 16*hz); -} Modified: head/sys/dev/usb/usb_dynamic.h ============================================================================== --- head/sys/dev/usb/usb_dynamic.h Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usb_dynamic.h Thu Dec 17 21:42:10 2009 (r200653) @@ -37,8 +37,6 @@ struct usb_device_request; typedef usb_error_t (usb_temp_setup_by_index_t)(struct usb_device *udev, uint16_t index); -typedef usb_error_t (usb_test_huawei_autoinst_t)(struct usb_device *udev, - struct usb_attach_arg *uaa); typedef uint8_t (usb_test_quirk_t)(const struct usbd_lookup_info *info, uint16_t quirk); typedef int (usb_quirk_ioctl_t)(unsigned long cmd, caddr_t data, @@ -51,13 +49,11 @@ extern usb_handle_req_t *usb_temp_get_de extern usb_temp_setup_by_index_t *usb_temp_setup_by_index_p; extern usb_temp_unsetup_t *usb_temp_unsetup_p; extern usb_test_quirk_t *usb_test_quirk_p; -extern usb_test_huawei_autoinst_t *usb_test_huawei_autoinst_p; extern usb_quirk_ioctl_t *usb_quirk_ioctl_p; extern devclass_t usb_devclass_ptr; /* function prototypes */ -void usb_test_huawei_unload(void *); void usb_temp_unload(void *); void usb_quirk_unload(void *); void usb_bus_unload(void *); Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Thu Dec 17 21:17:13 2009 (r200652) +++ head/sys/dev/usb/usbdi.h Thu Dec 17 21:42:10 2009 (r200653) @@ -29,6 +29,7 @@ struct usb_fifo; struct usb_xfer; struct usb_device; +struct usb_attach_arg; struct usb_interface; struct usb_endpoint; struct usb_page_cache; @@ -98,6 +99,13 @@ typedef int (usb_fifo_ioctl_t)(struct us typedef void (usb_fifo_cmd_t)(struct usb_fifo *fifo); typedef void (usb_fifo_filter_t)(struct usb_fifo *fifo, struct usb_mbuf *m); + +/* USB events */ +#include +typedef void (*usb_dev_configured_t)(void *, struct usb_device *, + struct usb_attach_arg *); +EVENTHANDLER_DECLARE(usb_dev_configured, usb_dev_configured_t); + /* * The following macros are used used to convert milliseconds into * HZ. We use 1024 instead of 1000 milliseconds per second to save a @@ -338,6 +346,10 @@ struct usb_attach_arg { enum usb_hc_mode usb_mode; /* host or device mode */ uint8_t port; uint8_t use_generic; /* hint for generic drivers */ + uint8_t dev_state; +#define UAA_DEV_READY 0 +#define UAA_DEV_DISABLED 1 +#define UAA_DEV_EJECTING 2 }; /* From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 21:43:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D44381065670; Thu, 17 Dec 2009 21:43:32 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 7A32C8FC08; Thu, 17 Dec 2009 21:43:32 +0000 (UTC) Received: from orion.SpringDaemons.com (adsl-99-48-191-9.dsl.snfc21.sbcglobal.net [99.48.191.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 457268FC4E; Fri, 18 Dec 2009 00:43:30 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 40AF939C4E; Thu, 17 Dec 2009 13:43:26 -0800 (PST) Date: Thu, 17 Dec 2009 13:43:21 -0800 From: Stanislav Sedov To: Xin LI Message-Id: <20091217134321.dc65ba15.stas@FreeBSD.org> In-Reply-To: References: <200912171242.nBHCgjRF033801@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc" Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200630 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 21:43:32 -0000 --Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc Content-Type: text/plain; charset=KOI8-R Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 17 Dec 2009 11:12:22 -0800 Xin LI mentioned: > Hi, >=20 > On Thu, Dec 17, 2009 at 4:42 AM, Stanislav Sedov wrote: > > Author: stas > > Date: Thu Dec 17 12:42:45 2009 > > New Revision: 200630 > > URL: http://svn.freebsd.org/changeset/base/200630 > > > > Log: > > =9A- Partially revert r200417. =9Aconfig.h brings several definitions, > > =9A =9Athat appears to be actually used. =9AWithout config.h included > > =9A =9Across-build of world failed (at least for ARM). >=20 > Sorry for the breakage, I was shock that this was not caught by ``make > universe'', could you please send me a copy of the build log so I will > be able to see why? Sure, here is it: http://www.SpringDaemons.com/stas/broken_log.Z And this log is after my fix: http://www.SpringDaemons.com/stas/log1.z I'm not entirely sure why it fails, but it seem to have something to do with "LIBRARIES" and "RECHECK" definitions. Thanks! --=20 Stanislav Sedov ST4096-RIPE --Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJLKqX+AAoJEL8lojEJL9nwXS4P/jdn6bBYrQvE5DUQ9WS1IdVk A+KG/+GX4vhddc/HJcLO64yv+U1N+2hQszWW8ddzbpISJGDorvIoKlDgMhzi2MIK NAHimbQJTzo9q24TnY4gOdSvbqmwMmPvaJJBqtKWidt8pAJcMUfOHHRisaYMBd1n yjOjhILyKkOpHzlg/yWtioi2tkdNHzgP/7lCDMOGxSTeqBTQ2uN+5slQ3HCeWeda /6HrYFckbaVPtIPp0/6DI1khjMfBmnL9Q5cQEiPQNSJ8WmAQmeEnoTS+J5a7OJXE jr2G+d0OcwZpUuTBhxyFXMwvVqzOmynM4LZYkmP7KxidtplrB392zO6uebZ/ZwEC G8U908JCErFY5yuNgSFH6uXg6UH6Vy6p5shYNyQ+aXAxqCmnWn1VBfJWuASHoisw Ufhq6wuLyB0ldtb4tpBGYTQFcPTdQSmenC3WeTVS278PvkNFk0iTUbYcAUGyAu9G Y4sTI1gW6gsZtVbzw4rNbVcEtFiywEij3WDpXVCjaenMGl6bFPmnMpmnsPCOgYXu 26JlPmEefqFWFPchKvzIPFdfCeVsC2yvdcVk9vMZgImVhxCfmtK0kbv+KHn8wj08 qLNSV9fpTmJVR86hYQDPXCZ7ad17UxvTmJZS4wk+wQH74EfvbePNe2oc6IRHVjhE 1yOE6iRIqjbK1jq4eHui =SKTo -----END PGP SIGNATURE----- --Signature=_Thu__17_Dec_2009_13_43_21_-0800_i.d4sNVM.VxpXfQc-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 23:11:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB518106566B; Thu, 17 Dec 2009 23:11:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA9898FC14; Thu, 17 Dec 2009 23:11:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHNBG0h063426; Thu, 17 Dec 2009 23:11:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHNBGML063422; Thu, 17 Dec 2009 23:11:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912172311.nBHNBGML063422@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Dec 2009 23:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200654 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 23:11:16 -0000 Author: luigi Date: Thu Dec 17 23:11:16 2009 New Revision: 200654 URL: http://svn.freebsd.org/changeset/base/200654 Log: Add some experimental code to log traffic with tcpdump, similar to pflog(4). To use the feature, just put the 'log' options on rules you are interested in, e.g. ipfw add 5000 count log .... and run tcpdump -ni ipfw0 ... net.inet.ip.fw.verbose=0 enables logging to ipfw0, net.inet.ip.fw.verbose=1 sends logging to syslog as before. More features can be added, similar to pflog(), to store in the MAC header metadata such as rule numbers and actions. Manpage to come once features are settled. Modified: head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_log.c head/sys/netinet/ipfw/ip_fw_private.h Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 21:42:10 2009 (r200653) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 17 23:11:16 2009 (r200654) @@ -1651,8 +1651,7 @@ do { \ } case O_LOG: - if (V_fw_verbose) - ipfw_log(f, hlen, args, m, + ipfw_log(f, hlen, args, m, oif, offset, tablearg, ip); match = 1; break; @@ -2287,6 +2286,7 @@ ipfw_init(void) printf("limited to %d packets/entry by default\n", V_verbose_limit); + ipfw_log_bpf(1); /* init */ return (error); } @@ -2297,6 +2297,7 @@ static void ipfw_destroy(void) { + ipfw_log_bpf(0); /* uninit */ ipfw_dyn_detach(); printf("IP firewall unloaded\n"); } Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Thu Dec 17 21:42:10 2009 (r200653) +++ head/sys/netinet/ipfw/ip_fw_log.c Thu Dec 17 23:11:16 2009 (r200654) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include /* for ETHERTYPE_IP */ #include #include +#include /* for IFT_ETHER */ +#include /* for BPF */ #include #include @@ -88,6 +90,48 @@ __FBSDID("$FreeBSD$"); #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 #define SNP(buf) buf, sizeof(buf) +static struct ifnet *log_if; /* hook to attach to bpf */ + +/* we use this dummy function for all ifnet callbacks */ +static int +log_dummy(struct ifnet *ifp, u_long cmd, caddr_t addr) +{ + return EINVAL; +} + +void +ipfw_log_bpf(int onoff) +{ + struct ifnet *ifp; + + if (onoff) { + if (log_if) + return; + ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) + return; + if_initname(ifp, "ipfw", 0); + ifp->if_mtu = 65536; + ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_init = (void *)log_dummy; + ifp->if_ioctl = log_dummy; + ifp->if_start = (void *)log_dummy; + ifp->if_output = (void *)log_dummy; + ifp->if_addrlen = 6; + ifp->if_hdrlen = 14; + if_attach(ifp); + ifp->if_baudrate = IF_Mbps(10); + bpfattach(ifp, DLT_EN10MB, 14); + log_if = ifp; + } else { + if (log_if) { + ether_ifdetach(log_if); + if_free(log_if); + } + log_if = NULL; + } +} + /* * We enter here when we have a rule with O_LOG. * XXX this function alone takes about 2Kbytes of code! @@ -102,6 +146,36 @@ ipfw_log(struct ip_fw *f, u_int hlen, st int limit_reached = 0; char action2[40], proto[128], fragment[32]; + if (V_fw_verbose == 0) { + struct m_hdr mh; + + if (log_if == NULL || log_if->if_bpf == NULL) + return; + /* BPF treats the "mbuf" as read-only */ + mh.mh_next = m; + mh.mh_len = ETHER_HDR_LEN; + if (args->eh) { /* layer2, use orig hdr */ + mh.mh_data = (char *)args->eh; + } else { + /* add fake header. Later we will store + * more info in the header + */ + mh.mh_data = "DDDDDDSSSSSS\x08\x00"; + if (args->f_id.addr_type == 4) { + /* restore wire format */ + ip->ip_off = ntohs(ip->ip_off); + ip->ip_len = ntohs(ip->ip_len); + } + } + BPF_MTAP(log_if, (struct mbuf *)&mh); + if (args->eh == NULL && args->f_id.addr_type == 4) { + /* restore host format */ + ip->ip_off = htons(ip->ip_off); + ip->ip_len = htons(ip->ip_len); + } + return; + } + /* the old 'log' function */ fragment[0] = '\0'; proto[0] = '\0'; Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Thu Dec 17 21:42:10 2009 (r200653) +++ head/sys/netinet/ipfw/ip_fw_private.h Thu Dec 17 23:11:16 2009 (r200654) @@ -113,6 +113,7 @@ void ipfw_nat_destroy(void); /* In ip_fw_log.c */ struct ip; +void ipfw_log_bpf(int); void ipfw_log(struct ip_fw *f, u_int hlen, struct ip_fw_args *args, struct mbuf *m, struct ifnet *oif, u_short offset, uint32_t tablearg, struct ip *ip); From owner-svn-src-head@FreeBSD.ORG Thu Dec 17 23:42:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B83106568B; Thu, 17 Dec 2009 23:42:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48068FC1A; Thu, 17 Dec 2009 23:42:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBHNg9jw064229; Thu, 17 Dec 2009 23:42:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBHNg997064227; Thu, 17 Dec 2009 23:42:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912172342.nBHNg997064227@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Dec 2009 23:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200655 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 23:42:10 -0000 Author: mav Date: Thu Dec 17 23:42:09 2009 New Revision: 200655 URL: http://svn.freebsd.org/changeset/base/200655 Log: Serverworks OSB4 has no 0x4a (piomode) register, do not touch it. Also OSB4 has some problems with UDMA transfers, limit it to WDMA2. Modified: head/sys/dev/ata/chipsets/ata-serverworks.c Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Thu Dec 17 23:11:16 2009 (r200654) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Thu Dec 17 23:42:09 2009 (r200655) @@ -80,7 +80,7 @@ ata_serverworks_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); static struct ata_chip_id ids[] = - {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_UDMA2, "ROSB4" }, + {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_WDMA2, "ROSB4" }, { ATA_CSB5, 0x92, SWKS_100, 0, ATA_UDMA5, "CSB5" }, { ATA_CSB5, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB5" }, { ATA_CSB6, 0x00, SWKS_100, 0, ATA_UDMA5, "CSB6" }, @@ -388,10 +388,12 @@ ata_serverworks_setmode(device_t dev, in piomode = mode; } /* Set PIO mode and timings, calculated above. */ - pci_write_config(parent, 0x4a, + if (ctlr->chip->cfg1 != SWKS_33) { + pci_write_config(parent, 0x4a, (pci_read_config(parent, 0x4a, 2) & ~(0xf << (devno << 2))) | ((piomode - ATA_PIO0) << (devno<<2)),2); + } pci_write_config(parent, 0x40, (pci_read_config(parent, 0x40, 4) & ~(0xff << offset)) | From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 00:34:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA54B1065692; Fri, 18 Dec 2009 00:34:58 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6E658FC19; Fri, 18 Dec 2009 00:34:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBI0YwgU065777; Fri, 18 Dec 2009 00:34:58 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBI0YwfE065774; Fri, 18 Dec 2009 00:34:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912180034.nBI0YwfE065774@svn.freebsd.org> From: Andrew Thompson Date: Fri, 18 Dec 2009 00:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200657 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 00:34:59 -0000 Author: thompsa Date: Fri Dec 18 00:34:58 2009 New Revision: 200657 URL: http://svn.freebsd.org/changeset/base/200657 Log: Add a bunch of new 3G ids obtained from from various operating systems and Internet sources. Obtained from: Linux, NetBSD, OpenBSD, etc Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Dec 17 23:55:49 2009 (r200656) +++ head/sys/dev/usb/serial/u3g.c Fri Dec 18 00:34:58 2009 (r200657) @@ -178,33 +178,123 @@ MODULE_DEPEND(u3g, usb, 1, 1, 1); static const struct usb_device_id u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } - /* OEM: Huawei */ - U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), + U3G_DEV(ACERP, H10, 0), + U3G_DEV(AIRPLUS, MCD650, 0), + U3G_DEV(AIRPRIME, PC5220, 0), + U3G_DEV(ALINK, 3G, 0), + U3G_DEV(ALINK, 3GU, 0), + U3G_DEV(ALINK, DWM652U5, 0), + U3G_DEV(AMOI, H01, 0), + U3G_DEV(AMOI, H01A, 0), + U3G_DEV(AMOI, H02, 0), + U3G_DEV(ANYDATA, ADU_620UW, 0), + U3G_DEV(ANYDATA, ADU_500A, 0), + U3G_DEV(ANYDATA, ADU_E100X, 0), + U3G_DEV(AXESSTEL, DATAMODEM, 0), + U3G_DEV(CMOTECH, CDMA_MODEM1, 0), + U3G_DEV(DELL, U5500, 0), + U3G_DEV(DELL, U5505, 0), + U3G_DEV(DELL, U5510, 0), + U3G_DEV(DELL, U5520, 0), + U3G_DEV(DELL, U5520_2, 0), + U3G_DEV(DELL, U5520_3, 0), + U3G_DEV(DELL, U5700, 0), + U3G_DEV(DELL, U5700_2, 0), + U3G_DEV(DELL, U5700_3, 0), + U3G_DEV(DELL, U5700_4, 0), + U3G_DEV(DELL, U5720, 0), + U3G_DEV(DELL, U5720_2, 0), + U3G_DEV(DELL, U5730, 0), + U3G_DEV(DELL, U5730_2, 0), + U3G_DEV(DELL, U5730_3, 0), + U3G_DEV(DELL, U740, 0), + U3G_DEV(DLINK3, DWM652, 0), + U3G_DEV(HP, EV2200, 0), + U3G_DEV(HP, HS2300, 0), + U3G_DEV(HUAWEI, E220BIS, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1401, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1402, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1403, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1404, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1405, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1406, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1407, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1408, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1409, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E140F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1410, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1411, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1412, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1413, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1414, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1415, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1416, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1417, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1418, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1419, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141C, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E141F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1420, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1421, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1422, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1423, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1424, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1425, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1426, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1427, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1428, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1429, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142C, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E142F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1430, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1431, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1432, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1433, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1434, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1435, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1436, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1437, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1438, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1439, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143A, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143B, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143C, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143D, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143E, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E143F, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E14AC, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E180V, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E220, U3GFL_HUAWEI_INIT), - /* OEM: Option */ - U3G_DEV(OPTION, GT3G, 0), - U3G_DEV(OPTION, GT3GQUAD, 0), - U3G_DEV(OPTION, GT3GPLUS, 0), - U3G_DEV(OPTION, GTMAX36, 0), - U3G_DEV(OPTION, GTHSDPA, 0), - U3G_DEV(OPTION, GTMAXHSUPA, 0), - U3G_DEV(OPTION, GTMAXHSUPAE, 0), - U3G_DEV(OPTION, GTMAX380HSUPAE, 0), - U3G_DEV(OPTION, VODAFONEMC3G, 0), - /* OEM: Qualcomm, Inc. */ - U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), - U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), - /* OEM: Merlin */ + U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), + U3G_DEV(KYOCERA2, KPC680, 0), + U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(MERLIN, V620, 0), - /* OEM: Novatel */ - U3G_DEV(NOVATEL, CDMA_MODEM, 0), + U3G_DEV(NOVATEL, E725, 0), U3G_DEV(NOVATEL, ES620, 0), + U3G_DEV(NOVATEL, ES620_2, 0), + U3G_DEV(NOVATEL, EU730, 0), + U3G_DEV(NOVATEL, EU740, 0), + U3G_DEV(NOVATEL, EU870D, 0), + U3G_DEV(NOVATEL, MC760, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), + U3G_DEV(NOVATEL, U727_2, 0), U3G_DEV(NOVATEL, U740, 0), U3G_DEV(NOVATEL, U740_2, 0), + U3G_DEV(NOVATEL, U760, U3GFL_SCSI_EJECT), U3G_DEV(NOVATEL, U870, 0), U3G_DEV(NOVATEL, V620, 0), U3G_DEV(NOVATEL, V640, 0), @@ -212,41 +302,199 @@ static const struct usb_device_id u3g_de U3G_DEV(NOVATEL, V740, 0), U3G_DEV(NOVATEL, X950D, 0), U3G_DEV(NOVATEL, XU870, 0), - U3G_DEV(NOVATEL, ZEROCD, U3GFL_SCSI_EJECT), - U3G_DEV(NOVATEL, U760, U3GFL_SCSI_EJECT), - U3G_DEV(DELL, U740, 0), - /* OEM: Sierra Wireless: */ - U3G_DEV(SIERRA, AIRCARD580, 0), - U3G_DEV(SIERRA, AIRCARD595, 0), + U3G_DEV(OPTION, GT3G_1, 0), + U3G_DEV(OPTION, GT3G_2, 0), + U3G_DEV(OPTION, GT3G_3, 0), + U3G_DEV(OPTION, GT3G_4, 0), + U3G_DEV(OPTION, GT3G_5, 0), + U3G_DEV(OPTION, GT3G_6, 0), + U3G_DEV(OPTION, E6500, 0), + U3G_DEV(OPTION, E6501, 0), + U3G_DEV(OPTION, E6601, 0), + U3G_DEV(OPTION, E6721, 0), + U3G_DEV(OPTION, E6741, 0), + U3G_DEV(OPTION, E6761, 0), + U3G_DEV(OPTION, E6800, 0), + U3G_DEV(OPTION, E7021, 0), + U3G_DEV(OPTION, E7041, 0), + U3G_DEV(OPTION, E7061, 0), + U3G_DEV(OPTION, E7100, 0), + U3G_DEV(OPTION, GTM380, 0), + U3G_DEV(OPTION, GT3G, 0), + U3G_DEV(OPTION, GT3GPLUS, 0), + U3G_DEV(OPTION, GT3GQUAD, 0), + U3G_DEV(OPTION, GTHSDPA, 0), + U3G_DEV(OPTION, GTMAX36, 0), + U3G_DEV(OPTION, GTMAX380HSUPAE, 0), + U3G_DEV(OPTION, GTMAXHSUPA, 0), + U3G_DEV(OPTION, GTMAXHSUPAE, 0), + U3G_DEV(OPTION, VODAFONEMC3G, 0), + U3G_DEV(QISDA, H21_1, 0), + U3G_DEV(QISDA, H21_2, 0), + U3G_DEV(QISDA, H20_1, 0), + U3G_DEV(QISDA, H20_2, 0), + U3G_DEV(QUALCOMM2, AC8700, 0), + U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMMINC, E0002, 0), + U3G_DEV(QUALCOMMINC, E0003, 0), + U3G_DEV(QUALCOMMINC, E0004, 0), + U3G_DEV(QUALCOMMINC, E0005, 0), + U3G_DEV(QUALCOMMINC, E0006, 0), + U3G_DEV(QUALCOMMINC, E0007, 0), + U3G_DEV(QUALCOMMINC, E0008, 0), + U3G_DEV(QUALCOMMINC, E0009, 0), + U3G_DEV(QUALCOMMINC, E000A, 0), + U3G_DEV(QUALCOMMINC, E000B, 0), + U3G_DEV(QUALCOMMINC, E000C, 0), + U3G_DEV(QUALCOMMINC, E000D, 0), + U3G_DEV(QUALCOMMINC, E000E, 0), + U3G_DEV(QUALCOMMINC, E000F, 0), + U3G_DEV(QUALCOMMINC, E0010, 0), + U3G_DEV(QUALCOMMINC, E0011, 0), + U3G_DEV(QUALCOMMINC, E0012, 0), + U3G_DEV(QUALCOMMINC, E0013, 0), + U3G_DEV(QUALCOMMINC, E0014, 0), + U3G_DEV(QUALCOMMINC, MF628, 0), + U3G_DEV(QUALCOMMINC, E0016, 0), + U3G_DEV(QUALCOMMINC, E0017, 0), + U3G_DEV(QUALCOMMINC, E0018, 0), + U3G_DEV(QUALCOMMINC, E0019, 0), + U3G_DEV(QUALCOMMINC, E0020, 0), + U3G_DEV(QUALCOMMINC, E0021, 0), + U3G_DEV(QUALCOMMINC, E0022, 0), + U3G_DEV(QUALCOMMINC, E0023, 0), + U3G_DEV(QUALCOMMINC, E0024, 0), + U3G_DEV(QUALCOMMINC, E0025, 0), + U3G_DEV(QUALCOMMINC, E0026, 0), + U3G_DEV(QUALCOMMINC, E0027, 0), + U3G_DEV(QUALCOMMINC, E0028, 0), + U3G_DEV(QUALCOMMINC, E0029, 0), + U3G_DEV(QUALCOMMINC, E0030, 0), + U3G_DEV(QUALCOMMINC, MF626, 0), + U3G_DEV(QUALCOMMINC, E0032, 0), + U3G_DEV(QUALCOMMINC, E0033, 0), + U3G_DEV(QUALCOMMINC, E0037, 0), + U3G_DEV(QUALCOMMINC, E0039, 0), + U3G_DEV(QUALCOMMINC, E0042, 0), + U3G_DEV(QUALCOMMINC, E0043, 0), + U3G_DEV(QUALCOMMINC, E0048, 0), + U3G_DEV(QUALCOMMINC, E0049, 0), + U3G_DEV(QUALCOMMINC, E0051, 0), + U3G_DEV(QUALCOMMINC, E0052, 0), + U3G_DEV(QUALCOMMINC, E0054, 0), + U3G_DEV(QUALCOMMINC, E0055, 0), + U3G_DEV(QUALCOMMINC, E0057, 0), + U3G_DEV(QUALCOMMINC, E0058, 0), + U3G_DEV(QUALCOMMINC, E0059, 0), + U3G_DEV(QUALCOMMINC, E0060, 0), + U3G_DEV(QUALCOMMINC, E0061, 0), + U3G_DEV(QUALCOMMINC, E0062, 0), + U3G_DEV(QUALCOMMINC, E0063, 0), + U3G_DEV(QUALCOMMINC, E0064, 0), + U3G_DEV(QUALCOMMINC, E0066, 0), + U3G_DEV(QUALCOMMINC, E0069, 0), + U3G_DEV(QUALCOMMINC, E0070, 0), + U3G_DEV(QUALCOMMINC, E0073, 0), + U3G_DEV(QUALCOMMINC, E0076, 0), + U3G_DEV(QUALCOMMINC, E0078, 0), + U3G_DEV(QUALCOMMINC, E0082, 0), + U3G_DEV(QUALCOMMINC, E0086, 0), + U3G_DEV(QUALCOMMINC, E2002, 0), + U3G_DEV(QUALCOMMINC, E2003, 0), + U3G_DEV(QUALCOMMINC, AC8710, 0), + U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC8700, 0), + U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), + U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), + U3G_DEV(QUANTA, Q101, 0), + U3G_DEV(QUANTA, Q111, 0), + U3G_DEV(QUANTA, GLX, 0), + U3G_DEV(QUANTA, GKE, 0), + U3G_DEV(QUANTA, GLE, 0), + U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC597E, 0), - U3G_DEV(SIERRA, C597, 0), + U3G_DEV(SIERRA, AC875E, 0), + U3G_DEV(SIERRA, AC875U, 0), + U3G_DEV(SIERRA, AC875U_2, 0), U3G_DEV(SIERRA, AC880, 0), U3G_DEV(SIERRA, AC880E, 0), U3G_DEV(SIERRA, AC880U, 0), U3G_DEV(SIERRA, AC881, 0), U3G_DEV(SIERRA, AC881E, 0), U3G_DEV(SIERRA, AC881U, 0), + U3G_DEV(SIERRA, AC885E, 0), + U3G_DEV(SIERRA, AC885E_2, 0), U3G_DEV(SIERRA, AC885U, 0), + U3G_DEV(SIERRA, AIRCARD580, 0), + U3G_DEV(SIERRA, AIRCARD595, 0), + U3G_DEV(SIERRA, AIRCARD875, 0), + U3G_DEV(SIERRA, C22, 0), + U3G_DEV(SIERRA, C597, 0), + U3G_DEV(SIERRA, C888, 0), + U3G_DEV(SIERRA, E0029, 0), + U3G_DEV(SIERRA, E6892, 0), + U3G_DEV(SIERRA, E6893, 0), U3G_DEV(SIERRA, EM5625, 0), + U3G_DEV(SIERRA, EM5725, 0), U3G_DEV(SIERRA, MC5720, 0), U3G_DEV(SIERRA, MC5720_2, 0), U3G_DEV(SIERRA, MC5725, 0), - U3G_DEV(SIERRA, MINI5725, 0), - U3G_DEV(SIERRA, AIRCARD875, 0), + U3G_DEV(SIERRA, MC5727, 0), + U3G_DEV(SIERRA, MC5727_2, 0), + U3G_DEV(SIERRA, MC5728, 0), U3G_DEV(SIERRA, MC8755, 0), U3G_DEV(SIERRA, MC8755_2, 0), U3G_DEV(SIERRA, MC8755_3, 0), + U3G_DEV(SIERRA, MC8755_4, 0), U3G_DEV(SIERRA, MC8765, 0), - U3G_DEV(SIERRA, AC875U, 0), + U3G_DEV(SIERRA, MC8765_2, 0), + U3G_DEV(SIERRA, MC8765_3, 0), + U3G_DEV(SIERRA, MC8775, 0), U3G_DEV(SIERRA, MC8775_2, 0), U3G_DEV(SIERRA, MC8780, 0), + U3G_DEV(SIERRA, MC8780_2, 0), + U3G_DEV(SIERRA, MC8780_3, 0), U3G_DEV(SIERRA, MC8781, 0), - U3G_DEV(HP, HS2300, 0), - /* Sierra TruInstaller device ID */ - U3G_DEV(SIERRA, TRUINSTALL, U3GFL_SIERRA_INIT), - /* PRUEBA SILABS */ + U3G_DEV(SIERRA, MC8781_2, 0), + U3G_DEV(SIERRA, MC8781_3, 0), + U3G_DEV(SIERRA, MC8785, 0), + U3G_DEV(SIERRA, MC8785_2, 0), + U3G_DEV(SIERRA, MC8790, 0), + U3G_DEV(SIERRA, MC8791, 0), + U3G_DEV(SIERRA, MC8792, 0), + U3G_DEV(SIERRA, MINI5725, 0), + U3G_DEV(SIERRA, T11, 0), + U3G_DEV(SIERRA, T598, 0), U3G_DEV(SILABS, SAEL, U3GFL_SAEL_M460_INIT), + U3G_DEV(STELERA, C105, 0), + U3G_DEV(STELERA, E1003, 0), + U3G_DEV(STELERA, E1004, 0), + U3G_DEV(STELERA, E1005, 0), + U3G_DEV(STELERA, E1006, 0), + U3G_DEV(STELERA, E1007, 0), + U3G_DEV(STELERA, E1008, 0), + U3G_DEV(STELERA, E1009, 0), + U3G_DEV(STELERA, E100A, 0), + U3G_DEV(STELERA, E100B, 0), + U3G_DEV(STELERA, E100C, 0), + U3G_DEV(STELERA, E100D, 0), + U3G_DEV(STELERA, E100E, 0), + U3G_DEV(STELERA, E100F, 0), + U3G_DEV(STELERA, E1010, 0), + U3G_DEV(STELERA, E1011, 0), + U3G_DEV(STELERA, E1012, 0), + U3G_DEV(TCTMOBILE, X060S, 0), + U3G_DEV(TELIT, UC864E, 0), + U3G_DEV(TELIT, UC864G, 0), + U3G_DEV(TLAYTECH, TEU800, 0), + U3G_DEV(TOSHIBA, G450, 0), + U3G_DEV(TOSHIBA, HSDPA, 0), + U3G_DEV(YISO, C893, 0), + /* Autoinstallers */ + U3G_DEV(NOVATEL, ZEROCD, U3GFL_SCSI_EJECT), + U3G_DEV(SIERRA, TRUINSTALL, U3GFL_SIERRA_INIT), +#undef U3G_DEV }; static void Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Dec 17 23:55:49 2009 (r200656) +++ head/sys/dev/usb/usbdevs Fri Dec 18 00:34:58 2009 (r200657) @@ -554,6 +554,7 @@ vendor PLX 0x10b5 PLX vendor ASANTE 0x10bd Asante vendor SILABS 0x10c4 Silicon Labs vendor ACTIONS 0x10d6 Actions +vendor AIRPLUS 0x1011 Airplus vendor ANALOG 0x1110 Analog Devices vendor TENX 0x1130 Ten X Technology, Inc. vendor ISSC 0x1131 Integrated System Solution Corp. @@ -561,6 +562,7 @@ vendor JRC 0x1145 Japan Radio Company vendor SPHAIRON 0x114b Sphairon Access Systems GmbH vendor DELORME 0x1163 DeLorme vendor SERVERWORKS 0x1166 ServerWorks +vendor DLINK3 0x1186 Dlink vendor ACERCM 0x1189 Acer Communications & Multimedia vendor SIERRA 0x1199 Sierra Wireless vendor TOPFIELD 0x11db Topfield Co., Ltd @@ -609,6 +611,7 @@ vendor SPARKLAN 0x15a9 SparkLAN vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX Data Systems vendor INSIDEOUT 0x1608 Inside Out Networks +vendor AMOI 0x1614 Amoi Electronics vendor GOODWAY 0x1631 Good Way Technology vendor ENTREGA 0x1645 Entrega vendor ACTIONTEC 0x1668 Actiontec Electronics @@ -628,10 +631,15 @@ vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor TCTMOBILE 0x1bbb TCT Mobile +vendor TELIT 0x1bc7 Telit vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik +vendor QISDA 0x1da5 Qisda +vendor ALINK 0x1e0e Alink vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications +vendor TLAYTECH 0x20b9 Tlay Tech vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor TRIPPLITE 0x2478 Tripp-Lite @@ -739,6 +747,7 @@ product ACERP ACERSCAN_620U 0x2060 Acers product ACERP ACERSCAN_4300U 0x20b0 Benq 3300U/4300U product ACERP ACERSCAN_640BT 0x20be Acerscan 640BT product ACERP ACERSCAN_1240U 0x20c0 Acerscan 1240U +product ACERP H10 0x4068 AWL400 Wireless Adapter product ACERP ATAPI 0x6003 ATA/ATAPI Adapter product ACERP AWL300 0x9000 AWL300 Wireless Adapter product ACERP AWL400 0x9001 AWL400 Wireless Adapter @@ -815,6 +824,9 @@ product AIPTEK POCKETCAM3M 0x2011 Pocket product AIPTEK2 PENCAM_MEGA_1_3 0x504a PenCam Mega 1.3 product AIPTEK2 SUNPLUS_TECH 0x0c15 Sunplus Technology Inc. +/* AirPlis products */ +product AIRPLUS MCD650 0x3198 MCD650 modem + /* AirPrime products */ product AIRPRIME PC5220 0x0112 CDMA Wireless PC Card @@ -833,6 +845,11 @@ product ALCOR SM_KBD 0x9410 MicroConnec product ALCOR NEC_KBD_HUB 0x9472 NEC Kbd Hub product ALCOR AU6390 0x6390 AU6390 USB-IDE converter +/* Alink products */ +product ALINK DWM652U5 0xce16 DWM-652 +product ALINK 3G 0x9000 3G modem +product ALINK 3GU 0x9200 3G modem + /* Altec Lansing products */ product ALTEC ADA70 0x0070 ADA70 Speakers product ALTEC ASC495 0xff05 ASC495 Speakers @@ -840,6 +857,11 @@ product ALTEC ASC495 0xff05 ASC495 Spea /* Allied Telesyn International products */ product ALLIEDTELESYN ATUSB100 0xb100 AT-USB100 +/* Amoi products */ +product AMOI H01 0x0800 H01 3G modem +product AMOI H01A 0x7002 H01A 3G modem +product AMOI H02 0x0802 H02 3G modem + /* American Power Conversion products */ product APC UPS 0x0002 Uninterruptible Power Supply @@ -855,6 +877,7 @@ product ANCHOR EZUSB 0x2131 EZUSB product ANCHOR EZLINK 0x2720 EZLINK /* AnyData products */ +product ANYDATA ADU_620UW 0x6202 CDMA 2000 EV-DO USB Modem product ANYDATA ADU_E100X 0x6501 CDMA 2000 1xRTT/EV-DO USB Modem product ANYDATA ADU_500A 0x6502 CDMA 2000 EV-DO USB Modem @@ -1150,7 +1173,22 @@ product DELL BC02 0x8000 BC02 Bluetooth product DELL PRISM_GT_1 0x8102 PrismGT USB 2.0 WLAN product DELL TM350 0x8103 TrueMobile 350 Bluetooth USB Adapter product DELL PRISM_GT_2 0x8104 PrismGT USB 2.0 WLAN +product DELL U5700 0x8114 Dell 5700 3G +product DELL U5500 0x8115 Dell 5500 3G +product DELL U5505 0x8116 Dell 5505 3G +product DELL U5700_2 0x8117 Dell 5700 3G +product DELL U5510 0x8118 Dell 5510 3G +product DELL U5700_3 0x8128 Dell 5700 3G +product DELL U5700_4 0x8129 Dell 5700 3G +product DELL U5720 0x8133 Dell 5720 3G +product DELL U5720_2 0x8134 Dell 5720 3G product DELL U740 0x8135 Dell U740 CDMA +product DELL U5520 0x8136 Dell 5520 3G +product DELL U5520_2 0x8137 Dell 5520 3G +product DELL U5520_3 0x8138 Dell 5520 3G +product DELL U5730 0x8180 Dell 5730 3G +product DELL U5730_2 0x8181 Dell 5730 3G +product DELL U5730_3 0x8182 Dell 5730 3G /* Delorme Paublishing products */ product DELORME EARTHMATE 0x0100 Earthmate GPS @@ -1199,6 +1237,7 @@ product DLINK2 DWLG122C1 0x3c03 DWL-G122 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 product DLINK2 DWA110 0x3c07 DWA-110 +product DLINK3 DWM652 0x3e04 DWM-652 /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer @@ -1490,6 +1529,7 @@ product HP P1100 0x3102 Photosmart P110 product HP OJ4215 0x3d11 OfficeJet 4215 product HP HN210E 0x811c Ethernet HN210E product HP2 C500 0x6002 PhotoSmart C500 +product HP EV2200 0x1b1d ev2200 HSDPA (aka MC5720) product HP HS2300 0x1e1d hs2300 HSDPA (aka MC8775) /* HTC products */ @@ -1500,7 +1540,71 @@ product HTC SMARTPHONE 0x0a51 SmartPhon /* HUAWEI products */ product HUAWEI MOBILE 0x1001 Huawei Mobile product HUAWEI E220 0x1003 Huawei HSDPA modem +product HUAWEI E220BIS 0x1004 Huawei HSDPA modem +product HUAWEI E1401 0x1401 3G modem +product HUAWEI E1402 0x1402 3G modem +product HUAWEI E1403 0x1403 3G modem +product HUAWEI E1404 0x1404 3G modem +product HUAWEI E1405 0x1405 3G modem +product HUAWEI E1406 0x1406 3G modem +product HUAWEI E1407 0x1407 3G modem +product HUAWEI E1408 0x1408 3G modem +product HUAWEI E1409 0x1409 3G modem +product HUAWEI E140A 0x140a 3G modem +product HUAWEI E140B 0x140b 3G modem product HUAWEI E180V 0x140c Huawei Mobile E180V +product HUAWEI E140D 0x140d 3G modem +product HUAWEI E140E 0x140e 3G modem +product HUAWEI E140F 0x140f 3G modem +product HUAWEI E1410 0x1410 3G modem +product HUAWEI E1411 0x1411 3G modem +product HUAWEI E1412 0x1412 3G modem +product HUAWEI E1413 0x1413 3G modem +product HUAWEI E1414 0x1414 3G modem +product HUAWEI E1415 0x1415 3G modem +product HUAWEI E1416 0x1416 3G modem +product HUAWEI E1417 0x1417 3G modem +product HUAWEI E1418 0x1418 3G modem +product HUAWEI E1419 0x1419 3G modem +product HUAWEI E141A 0x141a 3G modem +product HUAWEI E141B 0x141b 3G modem +product HUAWEI E141C 0x141c 3G modem +product HUAWEI E141D 0x141d 3G modem +product HUAWEI E141E 0x141e 3G modem +product HUAWEI E141F 0x141f 3G modem +product HUAWEI E1420 0x1420 3G modem +product HUAWEI E1421 0x1421 3G modem +product HUAWEI E1422 0x1422 3G modem +product HUAWEI E1423 0x1423 3G modem +product HUAWEI E1424 0x1424 3G modem +product HUAWEI E1425 0x1425 3G modem +product HUAWEI E1426 0x1426 3G modem +product HUAWEI E1427 0x1427 3G modem +product HUAWEI E1428 0x1428 3G modem +product HUAWEI E1429 0x1429 3G modem +product HUAWEI E142A 0x142a 3G modem +product HUAWEI E142B 0x142b 3G modem +product HUAWEI E142C 0x142c 3G modem +product HUAWEI E142D 0x142d 3G modem +product HUAWEI E142E 0x142e 3G modem +product HUAWEI E142F 0x142f 3G modem +product HUAWEI E1430 0x1430 3G modem +product HUAWEI E1431 0x1431 3G modem +product HUAWEI E1432 0x1432 3G modem +product HUAWEI E1433 0x1433 3G modem +product HUAWEI E1434 0x1434 3G modem +product HUAWEI E1435 0x1435 3G modem +product HUAWEI E1436 0x1436 3G modem +product HUAWEI E1437 0x1437 3G modem +product HUAWEI E1438 0x1438 3G modem +product HUAWEI E1439 0x1439 3G modem +product HUAWEI E143A 0x143a 3G modem +product HUAWEI E143B 0x143b 3G modem +product HUAWEI E143C 0x143c 3G modem +product HUAWEI E143D 0x143d 3G modem +product HUAWEI E143E 0x143e 3G modem +product HUAWEI E143F 0x143f 3G modem +product HUAWEI E14AC 0x14ac 3G modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g @@ -1641,6 +1745,7 @@ product KYOCERA FINECAM_S5 0x0103 Fineca product KYOCERA FINECAM_L3 0x0105 Finecam L3 product KYOCERA AHK3001V 0x0203 AH-K3001V product KYOCERA2 CDMA_MSM_K 0x17da Qualcomm Kyocera CDMA Technologies MSM +product KYOCERA2 KPC680 0x180a Qualcomm Kyocera CDMA Technologies MSM /* LaCie products */ product LACIE HD 0xa601 Hard Disk @@ -1909,7 +2014,6 @@ product NOVATECH RT2573 0x9021 RT2573 /* Novatel Wireless products */ product NOVATEL V640 0x1100 Merlin V620 -product NOVATEL CDMA_MODEM 0x1110 Novatel Wireless Merlin CDMA product NOVATEL V620 0x1110 Merlin V620 product NOVATEL V740 0x1120 Merlin V740 product NOVATEL V720 0x1130 Merlin V720 @@ -1918,13 +2022,20 @@ product NOVATEL U740_2 0x1410 Merlin U7 product NOVATEL U870 0x1420 Merlin U870 product NOVATEL XU870 0x1430 Merlin XU870 product NOVATEL X950D 0x1450 Merlin X950D -product NOVATEL ES620 0x2100 ES620 CDMA +product NOVATEL ES620 0x2100 Expedite ES620 +product NOVATEL E725 0x2120 Expedite E725 +product NOVATEL ES620_2 0x2130 Expedite ES620 product NOVATEL U720 0x2110 Merlin U720 +product NOVATEL EU730 0x2400 Expedite EU730 +product NOVATEL EU740 0x2410 Expedite EU740 +product NOVATEL EU870D 0x2420 Expedite EU870D product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD +product NOVATEL U727_2 0x5100 Merlin U727 CDMA product NOVATEL U760 0x6000 Novatel U760 +product NOVATEL MC760 0x6002 Novatel MC760 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ @@ -1961,6 +2072,24 @@ product OPTION GTHSDPA 0x6971 GlobeTrot product OPTION GTMAXHSUPA 0x7001 GlobeTrotter HSUPA product OPTION GTMAXHSUPAE 0x6901 GlobeTrotter HSUPA PCIe product OPTION GTMAX380HSUPAE 0x7211 GlobeTrotter 380HSUPA PCIe +product OPTION GT3G_1 0x6050 3G modem +product OPTION GT3G_2 0x6100 3G modem +product OPTION GT3G_3 0x6150 3G modem +product OPTION GT3G_4 0x6200 3G modem +product OPTION GT3G_5 0x6250 3G modem +product OPTION GT3G_6 0x6350 3G modem +product OPTION E6500 0x6500 3G modem +product OPTION E6501 0x6501 3G modem +product OPTION E6601 0x6601 3G modem +product OPTION E6721 0x6721 3G modem +product OPTION E6741 0x6741 3G modem +product OPTION E6761 0x6761 3G modem +product OPTION E6800 0x6800 3G modem +product OPTION E7021 0x7021 3G modem +product OPTION E7041 0x7041 3G modem +product OPTION E7061 0x7061 3G modem +product OPTION E7100 0x7100 3G modem +product OPTION GTM380 0x7201 3G modem /* OQO */ product OQO WIFI01 0x0002 model 01 WiFi interface @@ -2081,13 +2210,96 @@ product QCOM RT2573 0x6196 RT2573 product QCOM RT2573_2 0x6229 RT2573 product QCOM RT2573_3 0x6238 RT2573 +/* Qisda products */ +product QISDA H21_1 0x4512 3G modem +product QISDA H21_2 0x4523 3G modem +product QISDA H20_1 0x4515 3G modem +product QISDA H20_2 0x4519 3G modem + /* Qualcomm products */ product QUALCOMM CDMA_MSM 0x6000 CDMA Technologies MSM phone product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem +product QUALCOMM2 AC8700 0x6000 AC8700 +product QUALCOMM2 MF330 0x6613 MF330 product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage +product QUALCOMMINC AC8710 0xfff1 3G modem +product QUALCOMMINC AC2726 0xfff5 3G modem product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem +product QUALCOMMINC E0002 0x0002 3G modem +product QUALCOMMINC E0003 0x0003 3G modem +product QUALCOMMINC E0004 0x0004 3G modem +product QUALCOMMINC E0005 0x0005 3G modem +product QUALCOMMINC E0006 0x0006 3G modem +product QUALCOMMINC E0007 0x0007 3G modem +product QUALCOMMINC E0008 0x0008 3G modem +product QUALCOMMINC E0009 0x0009 3G modem +product QUALCOMMINC E000A 0x000a 3G modem +product QUALCOMMINC E000B 0x000b 3G modem +product QUALCOMMINC E000C 0x000c 3G modem +product QUALCOMMINC E000D 0x000d 3G modem +product QUALCOMMINC E000E 0x000e 3G modem +product QUALCOMMINC E000F 0x000f 3G modem +product QUALCOMMINC E0010 0x0010 3G modem +product QUALCOMMINC E0011 0x0011 3G modem +product QUALCOMMINC E0012 0x0012 3G modem +product QUALCOMMINC E0013 0x0013 3G modem +product QUALCOMMINC E0014 0x0014 3G modem +product QUALCOMMINC MF628 0x0015 3G modem +product QUALCOMMINC E0016 0x0016 3G modem +product QUALCOMMINC E0017 0x0017 3G modem +product QUALCOMMINC E0018 0x0018 3G modem +product QUALCOMMINC E0019 0x0019 3G modem +product QUALCOMMINC E0020 0x0020 3G modem +product QUALCOMMINC E0021 0x0021 3G modem +product QUALCOMMINC E0022 0x0022 3G modem +product QUALCOMMINC E0023 0x0023 3G modem +product QUALCOMMINC E0024 0x0024 3G modem +product QUALCOMMINC E0025 0x0025 3G modem +product QUALCOMMINC E0026 0x0026 3G modem +product QUALCOMMINC E0027 0x0027 3G modem +product QUALCOMMINC E0028 0x0028 3G modem +product QUALCOMMINC E0029 0x0029 3G modem +product QUALCOMMINC E0030 0x0030 3G modem +product QUALCOMMINC MF626 0x0031 3G modem +product QUALCOMMINC E0032 0x0032 3G modem +product QUALCOMMINC E0033 0x0033 3G modem +product QUALCOMMINC E0037 0x0037 3G modem +product QUALCOMMINC E0039 0x0039 3G modem +product QUALCOMMINC E0042 0x0042 3G modem +product QUALCOMMINC E0043 0x0043 3G modem +product QUALCOMMINC E0048 0x0048 3G modem +product QUALCOMMINC E0049 0x0049 3G modem +product QUALCOMMINC E0051 0x0051 3G modem +product QUALCOMMINC E0052 0x0052 3G modem +product QUALCOMMINC E0054 0x0054 3G modem +product QUALCOMMINC E0055 0x0055 3G modem +product QUALCOMMINC E0057 0x0057 3G modem +product QUALCOMMINC E0058 0x0058 3G modem +product QUALCOMMINC E0059 0x0059 3G modem +product QUALCOMMINC E0060 0x0060 3G modem +product QUALCOMMINC E0061 0x0061 3G modem +product QUALCOMMINC E0062 0x0062 3G modem +product QUALCOMMINC E0063 0x0063 3G modem +product QUALCOMMINC E0064 0x0064 3G modem +product QUALCOMMINC E0066 0x0066 3G modem +product QUALCOMMINC E0069 0x0069 3G modem +product QUALCOMMINC E0070 0x0070 3G modem +product QUALCOMMINC E0073 0x0073 3G modem +product QUALCOMMINC E0076 0x0076 3G modem +product QUALCOMMINC E0078 0x0078 3G modem +product QUALCOMMINC E0082 0x0082 3G modem +product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC E2002 0x2002 3G modem +product QUALCOMMINC E2003 0x2003 3G modem + +/* Quanta products */ +product QUANTA Q101 0xea02 HSDPA modem +product QUANTA Q111 0xea03 HSDPA modem +product QUANTA GLX 0xea04 HSDPA modem +product QUANTA GKE 0xea05 HSDPA modem +product QUANTA GLE 0xea06 HSDPA modem /* Qtronix products */ product QTRONIX 980N 0x2011 Scorpion-980N keyboard @@ -2211,33 +2423,62 @@ product SIEMENS3 X65 0x0003 X65 product SIEMENS3 X75 0x0004 X75 /* Sierra Wireless products */ -product SIERRA AIRCARD580 0x0112 Sierra Wireless AirCard 580 +product SIERRA EM5625 0x0017 EM5625 +product SIERRA MC5720_2 0x0018 MC5720 +product SIERRA MC5725 0x0020 MC5725 product SIERRA AIRCARD595 0x0019 Sierra Wireless AirCard 595 -product SIERRA AC595U 0x0120 Sierra Wireless AirCard 595U product SIERRA AC597E 0x0021 Sierra Wireless AirCard 597E +product SIERRA EM5725 0x0022 EM5725 product SIERRA C597 0x0023 Sierra Wireless Compass 597 -product SIERRA AC875 0x6820 Sierra Wireless AirCard 875 -product SIERRA AC880 0x6850 Sierra Wireless AirCard 880 -product SIERRA AC881 0x6851 Sierra Wireless AirCard 881 -product SIERRA AC880E 0x6852 Sierra Wireless AirCard 880E -product SIERRA AC881E 0x6853 Sierra Wireless AirCard 881E -product SIERRA AC880U 0x6855 Sierra Wireless AirCard 880U -product SIERRA AC881U 0x6856 Sierra Wireless AirCard 881U -product SIERRA AC885U 0x6880 Sierra Wireless AirCard 885U -product SIERRA EM5625 0x0017 EM5625 +product SIERRA MC5727 0x0024 MC5727 +product SIERRA T598 0x0025 T598 +product SIERRA T11 0x0026 T11 +product SIERRA AC402 0x0027 AC402 +product SIERRA MC5728 0x0028 MC5728 +product SIERRA E0029 0x0029 E0029 +product SIERRA AIRCARD580 0x0112 Sierra Wireless AirCard 580 +product SIERRA AC595U 0x0120 Sierra Wireless AirCard 595U product SIERRA MC5720 0x0218 MC5720 Wireless Modem -product SIERRA MC5720_2 0x0018 MC5720 -product SIERRA MC5725 0x0020 MC5725 product SIERRA MINI5725 0x0220 Sierra Wireless miniPCI 5275 +product SIERRA MC5727_2 0x0224 MC5727 product SIERRA MC8755_2 0x6802 MC8755 product SIERRA MC8765 0x6803 MC8765 product SIERRA MC8755 0x6804 MC8755 +product SIERRA MC8765_2 0x6805 MC8765 +product SIERRA MC8755_4 0x6808 MC8755 +product SIERRA MC8765_3 0x6809 MC8765 product SIERRA AC875U 0x6812 AC875U HSDPA USB Modem product SIERRA MC8755_3 0x6813 MC8755 HSDPA product SIERRA MC8775_2 0x6815 MC8775 -product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA +product SIERRA MC8775 0x6816 MC8775 +product SIERRA AC875 0x6820 Sierra Wireless AirCard 875 +product SIERRA AC875U_2 0x6821 AC875U +product SIERRA AC875E 0x6822 AC875E product SIERRA MC8780 0x6832 MC8780 product SIERRA MC8781 0x6833 MC8781 +product SIERRA MC8780_2 0x6834 MC8780 +product SIERRA MC8781_2 0x6835 MC8781 +product SIERRA MC8780_3 0x6838 MC8780 +product SIERRA MC8781_3 0x6839 MC8781 +product SIERRA MC8785 0x683A MC8785 +product SIERRA MC8785_2 0x683B MC8785 +product SIERRA MC8790 0x683C MC8790 +product SIERRA MC8791 0x683D MC8791 +product SIERRA MC8792 0x683E MC8792 +product SIERRA AC880 0x6850 Sierra Wireless AirCard 880 +product SIERRA AC881 0x6851 Sierra Wireless AirCard 881 +product SIERRA AC880E 0x6852 Sierra Wireless AirCard 880E +product SIERRA AC881E 0x6853 Sierra Wireless AirCard 881E +product SIERRA AC880U 0x6855 Sierra Wireless AirCard 880U +product SIERRA AC881U 0x6856 Sierra Wireless AirCard 881U +product SIERRA AC885E 0x6859 AC885E +product SIERRA AC885E_2 0x685A AC885E +product SIERRA AC885U 0x6880 Sierra Wireless AirCard 885U +product SIERRA C888 0x6890 C888 +product SIERRA C22 0x6891 C22 +product SIERRA E6892 0x6892 E6892 +product SIERRA E6893 0x6893 E6893 +product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer /* Sigmatel products */ @@ -2352,6 +2593,22 @@ product SPHAIRON UB801R 0x0110 UB801R /* Stelera Wireless products */ product STELERA ZEROCD 0x1000 Zerocd Installer product STELERA C105 0x1002 Stelera/Bandrish C105 USB +product STELERA E1003 0x1003 3G modem +product STELERA E1004 0x1004 3G modem +product STELERA E1005 0x1005 3G modem +product STELERA E1006 0x1006 3G modem +product STELERA E1007 0x1007 3G modem +product STELERA E1008 0x1008 3G modem +product STELERA E1009 0x1009 3G modem +product STELERA E100A 0x100a 3G modem +product STELERA E100B 0x100b 3G modem +product STELERA E100C 0x100c 3G modem +product STELERA E100D 0x100d 3G modem +product STELERA E100E 0x100e 3G modem +product STELERA E100F 0x100f 3G modem +product STELERA E1010 0x1010 3G modem +product STELERA E1011 0x1011 3G modem +product STELERA E1012 0x1012 3G modem /* MpMan products */ product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go @@ -2408,6 +2665,9 @@ product TAPWAVE ZODIAC 0x0100 Zodiac /* Taugagreining products */ product TAUGA CAMERAMATE 0x0005 CameraMate (DPCM_USB) +/* TCTMobile products */ +product TCTMOBILE X060S 0x0000 X060S 3G modem + /* TDK products */ product TDK UPA9664 0x0115 USB-PDC Adapter UPA9664 product TDK UCA1464 0x0116 USB-cdmaOne Adapter UCA1464 @@ -2426,6 +2686,10 @@ product TEKRAM ZD1211_2 0x6630 ZD1211 /* Telex Communications products */ product TELEX MIC1 0x0001 Enhanced USB Microphone +/* Telit products */ +product TELIT UC864E 0x1003 UC864E 3G modem +product TELIT UC864G 0x1004 UC864G 3G modem + /* Ten X Technology, Inc. */ product TENX UAUDIO0 0xf211 USB audio headset @@ -2436,11 +2700,16 @@ product TI TUSB2046 0x2046 TUSB2046 hub /* Thrustmaster products */ product THRUST FUSION_PAD 0xa0a3 Fusion Digital Gamepad +/* TLayTech products */ +product TLAYTECH TEU800 0x1682 TEU800 3G modem + /* Topre Corporation products */ product TOPRE HHKB 0x0100 HHKB Professional /* Toshiba Corporation products */ product TOSHIBA POCKETPC_E740 0x0706 PocketPC e740 +product TOSHIBA G450 0x0d45 G450 modem +product TOSHIBA HSDPA 0x1302 G450 modem /* Trek Technology products */ product TREK THUMBDRIVE 0x1111 ThumbDrive From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 00:36:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 676DA106566B; Fri, 18 Dec 2009 00:36:30 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55C948FC16; Fri, 18 Dec 2009 00:36:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBI0aUZj065873; Fri, 18 Dec 2009 00:36:30 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBI0aUV9065871; Fri, 18 Dec 2009 00:36:30 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912180036.nBI0aUV9065871@svn.freebsd.org> From: Andrew Thompson Date: Fri, 18 Dec 2009 00:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200658 - head/sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 00:36:30 -0000 Author: thompsa Date: Fri Dec 18 00:36:30 2009 New Revision: 200658 URL: http://svn.freebsd.org/changeset/base/200658 Log: Keep list sorted. Modified: head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Dec 18 00:34:58 2009 (r200657) +++ head/sys/dev/usb/serial/u3g.c Fri Dec 18 00:36:30 2009 (r200658) @@ -187,8 +187,8 @@ static const struct usb_device_id u3g_de U3G_DEV(AMOI, H01, 0), U3G_DEV(AMOI, H01A, 0), U3G_DEV(AMOI, H02, 0), - U3G_DEV(ANYDATA, ADU_620UW, 0), U3G_DEV(ANYDATA, ADU_500A, 0), + U3G_DEV(ANYDATA, ADU_620UW, 0), U3G_DEV(ANYDATA, ADU_E100X, 0), U3G_DEV(AXESSTEL, DATAMODEM, 0), U3G_DEV(CMOTECH, CDMA_MODEM1, 0), @@ -211,7 +211,6 @@ static const struct usb_device_id u3g_de U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), - U3G_DEV(HUAWEI, E220BIS, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E1401, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E1402, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E1403, U3GFL_HUAWEI_INIT), @@ -277,9 +276,10 @@ static const struct usb_device_id u3g_de U3G_DEV(HUAWEI, E14AC, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E180V, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E220, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E220BIS, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), - U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), + U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(MERLIN, V620, 0), U3G_DEV(NOVATEL, E725, 0), U3G_DEV(NOVATEL, ES620, 0), @@ -302,12 +302,6 @@ static const struct usb_device_id u3g_de U3G_DEV(NOVATEL, V740, 0), U3G_DEV(NOVATEL, X950D, 0), U3G_DEV(NOVATEL, XU870, 0), - U3G_DEV(OPTION, GT3G_1, 0), - U3G_DEV(OPTION, GT3G_2, 0), - U3G_DEV(OPTION, GT3G_3, 0), - U3G_DEV(OPTION, GT3G_4, 0), - U3G_DEV(OPTION, GT3G_5, 0), - U3G_DEV(OPTION, GT3G_6, 0), U3G_DEV(OPTION, E6500, 0), U3G_DEV(OPTION, E6501, 0), U3G_DEV(OPTION, E6601, 0), @@ -319,22 +313,32 @@ static const struct usb_device_id u3g_de U3G_DEV(OPTION, E7041, 0), U3G_DEV(OPTION, E7061, 0), U3G_DEV(OPTION, E7100, 0), - U3G_DEV(OPTION, GTM380, 0), U3G_DEV(OPTION, GT3G, 0), U3G_DEV(OPTION, GT3GPLUS, 0), U3G_DEV(OPTION, GT3GQUAD, 0), + U3G_DEV(OPTION, GT3G_1, 0), + U3G_DEV(OPTION, GT3G_2, 0), + U3G_DEV(OPTION, GT3G_3, 0), + U3G_DEV(OPTION, GT3G_4, 0), + U3G_DEV(OPTION, GT3G_5, 0), + U3G_DEV(OPTION, GT3G_6, 0), U3G_DEV(OPTION, GTHSDPA, 0), + U3G_DEV(OPTION, GTM380, 0), U3G_DEV(OPTION, GTMAX36, 0), U3G_DEV(OPTION, GTMAX380HSUPAE, 0), U3G_DEV(OPTION, GTMAXHSUPA, 0), U3G_DEV(OPTION, GTMAXHSUPAE, 0), U3G_DEV(OPTION, VODAFONEMC3G, 0), - U3G_DEV(QISDA, H21_1, 0), - U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QISDA, H20_1, 0), U3G_DEV(QISDA, H20_2, 0), + U3G_DEV(QISDA, H21_1, 0), + U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QUALCOMM2, AC8700, 0), U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMMINC, AC2726, 0), + U3G_DEV(QUALCOMMINC, AC8700, 0), + U3G_DEV(QUALCOMMINC, AC8710, 0), + U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), U3G_DEV(QUALCOMMINC, E0002, 0), U3G_DEV(QUALCOMMINC, E0003, 0), U3G_DEV(QUALCOMMINC, E0004, 0), @@ -354,7 +358,6 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0012, 0), U3G_DEV(QUALCOMMINC, E0013, 0), U3G_DEV(QUALCOMMINC, E0014, 0), - U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, E0016, 0), U3G_DEV(QUALCOMMINC, E0017, 0), U3G_DEV(QUALCOMMINC, E0018, 0), @@ -370,7 +373,6 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0028, 0), U3G_DEV(QUALCOMMINC, E0029, 0), U3G_DEV(QUALCOMMINC, E0030, 0), - U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, E0032, 0), U3G_DEV(QUALCOMMINC, E0033, 0), U3G_DEV(QUALCOMMINC, E0037, 0), @@ -401,16 +403,14 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0086, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), - U3G_DEV(QUALCOMMINC, AC8710, 0), - U3G_DEV(QUALCOMMINC, AC2726, 0), - U3G_DEV(QUALCOMMINC, AC8700, 0), - U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), + U3G_DEV(QUALCOMMINC, MF626, 0), + U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), - U3G_DEV(QUANTA, Q101, 0), - U3G_DEV(QUANTA, Q111, 0), - U3G_DEV(QUANTA, GLX, 0), U3G_DEV(QUANTA, GKE, 0), U3G_DEV(QUANTA, GLE, 0), + U3G_DEV(QUANTA, GLX, 0), + U3G_DEV(QUANTA, Q101, 0), + U3G_DEV(QUANTA, Q111, 0), U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC597E, 0), From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 11:27:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32EB1106568B; Fri, 18 Dec 2009 11:27:36 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id DE9C88FC08; Fri, 18 Dec 2009 11:27:35 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id EEBA96D450; Fri, 18 Dec 2009 11:27:34 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id CC1BD84549; Fri, 18 Dec 2009 12:27:34 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> Date: Fri, 18 Dec 2009 12:27:34 +0100 In-Reply-To: <200912161541.53834.jhb@freebsd.org> (John Baldwin's message of "Wed, 16 Dec 2009 15:41:53 -0500") Message-ID: <868wd0cyjd.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 11:27:36 -0000 John Baldwin writes: > Warner Losh writes: > > Log: > > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. > >=20=20=20 > > Note: Not sure this is the right way to do compat, but it makes the > > headers consistent with the implementations. > Please revert. I think this has already been reverted once before. Yep, that was me... we concluded back then that this is a perfectly reasonable dependency; perhaps we should simply add the appropriate #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) without FREEBSD_COMPAT(n+1). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 12:10:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EF581065670; Fri, 18 Dec 2009 12:10:43 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8B9B8FC16; Fri, 18 Dec 2009 12:10:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBICAgDu090827; Fri, 18 Dec 2009 12:10:42 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBICAgjX090825; Fri, 18 Dec 2009 12:10:42 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912181210.nBICAgjX090825@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 18 Dec 2009 12:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200666 - head/sys/dev/ipmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 12:10:43 -0000 Author: ru Date: Fri Dec 18 12:10:42 2009 New Revision: 200666 URL: http://svn.freebsd.org/changeset/base/200666 Log: - Fixed incorrect watchdog timeout setting: MSB of a 2-byte value is obtained by dividing it by 256, not by 2550; also, one second is 10^9 nanoseconds, not 1800000000 nanoseconds. - Due to rounding error, setting watchdog to a really small timeout (<1 sec) was turning the watchdog off. It should set the watchdog to a small timeout instead. - Implemented error checking in ipmi_wd_event(), as required by watchdog(9). PR: kern/130512 Submitted by: Dmitrij Tejblum - Additionally, check that the timeout value is within the supported range, and if it's too large, act as required by watchdog(9). MFC after: 3 days Modified: head/sys/dev/ipmi/ipmi.c Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Fri Dec 18 12:09:44 2009 (r200665) +++ head/sys/dev/ipmi/ipmi.c Fri Dec 18 12:10:42 2009 (r200666) @@ -588,12 +588,15 @@ ipmi_polled_enqueue_request(struct ipmi_ * Watchdog event handler. */ -static void -ipmi_set_watchdog(struct ipmi_softc *sc, int sec) +static int +ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec) { struct ipmi_request *req; int error; + if (sec > 0xffff / 10) + return (EINVAL); + req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_SET_WDOG, 6, 0); @@ -604,7 +607,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, req->ir_request[2] = 0; req->ir_request[3] = 0; /* Timer use */ req->ir_request[4] = (sec * 10) & 0xff; - req->ir_request[5] = (sec * 10) / 2550; + req->ir_request[5] = (sec * 10) >> 8; } else { req->ir_request[0] = IPMI_SET_WD_TIMER_SMS_OS; req->ir_request[1] = 0; @@ -617,8 +620,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, error = ipmi_submit_driver_request(sc, req, 0); if (error) device_printf(sc->ipmi_dev, "Failed to set watchdog\n"); - - if (error == 0 && sec) { + else if (sec) { ipmi_free_request(req); req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), @@ -631,6 +633,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, } ipmi_free_request(req); + return (error); /* dump_watchdog(sc); */ @@ -641,14 +644,22 @@ ipmi_wd_event(void *arg, unsigned int cm { struct ipmi_softc *sc = arg; unsigned int timeout; + int e; cmd &= WD_INTERVAL; if (cmd > 0 && cmd <= 63) { - timeout = ((uint64_t)1 << cmd) / 1800000000; - ipmi_set_watchdog(sc, timeout); - *error = 0; + timeout = ((uint64_t)1 << cmd) / 1000000000; + if (timeout == 0) + timeout = 1; + e = ipmi_set_watchdog(sc, timeout); + if (e == 0) + *error = 0; + else + (void)ipmi_set_watchdog(sc, 0); } else { - ipmi_set_watchdog(sc, 0); + e = ipmi_set_watchdog(sc, 0); + if (e != 0 && cmd == 0) + *error = EOPNOTSUPP; } } From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 14:27:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969701065692; Fri, 18 Dec 2009 14:27:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 854E58FC20; Fri, 18 Dec 2009 14:27:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIERIOK094487; Fri, 18 Dec 2009 14:27:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIERI7j094485; Fri, 18 Dec 2009 14:27:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912181427.nBIERI7j094485@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Dec 2009 14:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200667 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 14:27:18 -0000 Author: kib Date: Fri Dec 18 14:27:18 2009 New Revision: 200667 URL: http://svn.freebsd.org/changeset/base/200667 Log: Signal 0 is used to check the permission for current process to signal target one. Since r184058, linux_do_tkill() calls tdsignal() instead of kill(), without checking for validity of supplied signal number. Prevent panic when supplied signal is 0 by finishing work after checks. Found and tested by: scf MFC after: 3 days Modified: head/sys/compat/linux/linux_signal.c Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Fri Dec 18 12:10:42 2009 (r200666) +++ head/sys/compat/linux/linux_signal.c Fri Dec 18 14:27:18 2009 (r200667) @@ -565,7 +565,7 @@ linux_do_tkill(struct thread *td, l_int AUDIT_ARG_PROCESS(p); error = p_cansignal(td, p, signum); - if (error) + if (error != 0 || signum == 0) goto out; error = ESRCH; From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 14:41:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53F941065672; Fri, 18 Dec 2009 14:41:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42EA68FC13; Fri, 18 Dec 2009 14:41:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIEfVDX094871; Fri, 18 Dec 2009 14:41:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIEfVZc094869; Fri, 18 Dec 2009 14:41:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912181441.nBIEfVZc094869@svn.freebsd.org> From: Alexander Motin Date: Fri, 18 Dec 2009 14:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200668 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 14:41:31 -0000 Author: mav Date: Fri Dec 18 14:41:30 2009 New Revision: 200668 URL: http://svn.freebsd.org/changeset/base/200668 Log: Remove duplicate devstat_start_transaction_bio() call. It is already called from geom_disk. Dulicate call causes wrong queue depth and busy accounting. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Fri Dec 18 14:27:18 2009 (r200667) +++ head/sys/cam/scsi/scsi_cd.c Fri Dec 18 14:41:30 2009 (r200668) @@ -1464,8 +1464,6 @@ cdstart(struct cam_periph *periph, union } else { bioq_remove(&softc->bio_queue, bp); - devstat_start_transaction_bio(softc->disk->d_devstat, bp); - scsi_read_write(&start_ccb->csio, /*retries*/cd_retry_count, /* cbfcnp */ cddone, From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 15:01:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 031AC106566B; Fri, 18 Dec 2009 15:01:47 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E62EE8FC17; Fri, 18 Dec 2009 15:01:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIF1kYd095488; Fri, 18 Dec 2009 15:01:46 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIF1kLC095486; Fri, 18 Dec 2009 15:01:46 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200912181501.nBIF1kLC095486@svn.freebsd.org> From: Joseph Koshy Date: Fri, 18 Dec 2009 15:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200669 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 15:01:47 -0000 Author: jkoshy Date: Fri Dec 18 15:01:46 2009 New Revision: 200669 URL: http://svn.freebsd.org/changeset/base/200669 Log: Recognize Intel CPUs with Family 0x6, Models 0x1E and 0x1F. Submitted by: Marc Unangst Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 18 14:41:30 2009 (r200668) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 18 15:01:46 2009 (r200669) @@ -131,6 +131,8 @@ pmc_intel_initialize(void) nclasses = 3; break; case 0x1A: + case 0x1E: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ + case 0x1F: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ cputype = PMC_CPU_INTEL_COREI7; nclasses = 3; break; From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 16:13:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3223106568F; Fri, 18 Dec 2009 16:13:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 918F38FC1F; Fri, 18 Dec 2009 16:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIGDLJB097496; Fri, 18 Dec 2009 16:13:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIGDLL0097491; Fri, 18 Dec 2009 16:13:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181613.nBIGDLL0097491@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 16:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200670 - in head/sys: amd64/conf conf i386/conf pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:13:21 -0000 Author: jhb Date: Fri Dec 18 16:13:21 2009 New Revision: 200670 URL: http://svn.freebsd.org/changeset/base/200670 Log: - Create a separate section in in the MI NOTES file for PCI wireless NIC drivers and move bwi(4) there from the PCI Ethernet NIC section. - Move ath(4) and ral(4) to the MI NOTES file. Reviewed by: rpaulo Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/i386/conf/NOTES head/sys/pc98/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/amd64/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -277,7 +277,6 @@ options DRM_DEBUG # Include debug print # iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking -# ral: Ralink Technology IEEE 802.11 wireless adapter # wpi: Intel 3945ABG Wireless LAN controller device ed @@ -289,16 +288,8 @@ device iwn device ipw device nfe device nve -device ral device wpi -device ath # Atheros pci/cardbus NIC's -device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -device ath_rate_sample # SampleRate tx rate control for ath -#device ath_rate_amrr # AMRR rate control for ath driver -#device ath_rate_onoe # Onoe rate control for ath driver - # #XXX this stores pointers in a 32bit field that is defined by the hardware #device pst Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -1862,6 +1862,7 @@ device xmphy # XaQti XMAC II # L1 PCI express gigabit ethernet controllers. # alc: Support for Atheros AR8131/AR8132 PCIe ethernet controllers. # ale: Support for Atheros AR8121/AR8113/AR8114 PCIe ethernet controllers. +# ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # bce: Broadcom NetXtreme II (BCM5706/BCM5708) PCI/PCIe Gigabit Ethernet # adapters. # bfe: Broadcom BCM4401 Ethernet adapter. @@ -1920,6 +1921,7 @@ device xmphy # XaQti XMAC II # pcn(4) driver is left out of the kernel. The le(4) driver does not # support the additional features like the MII bus and burst mode of # the PCnet-FAST and greater chipsets though. +# ral: Ralink Technology IEEE 802.11 wireless adapter # re: RealTek 8139C+/8169/816xS/811xS/8101E PCI/PCIe Ethernet adapter # rl: Support for PCI fast ethernet adapters based on the RealTek 8129/8139 # chipset. Note that the RealTek driver defaults to using programmed @@ -2039,7 +2041,6 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. -device bwi # Broadcom BCM430* BCM431* device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet @@ -2058,6 +2059,26 @@ device fpa # PCI WAN adapters. device lmc +# PCI IEEE 802.11 Wireless NICs +device ath # Atheros pci/cardbus NIC's +device ath_hal # pci/cardbus chip support +#device ath_ar5210 # AR5210 chips +#device ath_ar5211 # AR5211 chips +#device ath_ar5212 # AR5212 chips +#device ath_rf2413 +#device ath_rf2417 +#device ath_rf2425 +#device ath_rf5111 +#device ath_rf5112 +#device ath_rf5413 +#device ath_ar5416 # AR5416 chips +options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +#device ath_ar9160 # AR9160 chips +#device ath_ar9280 # AR9280 chips +device ath_rate_sample # SampleRate tx rate control for ath +device bwi # Broadcom BCM430* BCM431* +device ral # Ralink Technology RT2500 wireless NICs. + # Use "private" jumbo buffers allocated exclusively for the ti(4) driver. # This option is incompatible with the TI_JUMBO_HDRSPLIT option below. #options TI_PRIVATE_JUMBOS Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/i386/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -533,7 +533,6 @@ hint.mse.0.irq="5" # Network interfaces: # -# ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # ce: Cronyx Tau-PCI/32 sync single/dual port G.703/E1 serial adaptor # with 32 HDLC subchannels (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) @@ -555,29 +554,12 @@ hint.mse.0.irq="5" # iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking -# ral: Ralink Technology IEEE 802.11 wireless adapter # sbni: Granch SBNI12-xx ISA and PCI adapters # wl: Lucent Wavelan (ISA card only). # wpi: Intel 3945ABG Wireless LAN controller # Order for ISA/EISA devices is important here -device ath # Atheros pci/cardbus NIC's -device ath_hal # pci/cardbus chip support -#device ath_ar5210 # AR5210 chips -#device ath_ar5211 # AR5211 chips -#device ath_ar5212 # AR5212 chips -#device ath_rf2413 -#device ath_rf2417 -#device ath_rf2425 -#device ath_rf5111 -#device ath_rf5112 -#device ath_rf5413 -#device ath_ar5416 # AR5416 chips -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -#device ath_ar9160 # AR9160 chips -#device ath_ar9280 # AR9280 chips -device ath_rate_sample # SampleRate tx rate control for ath device ce device cp device cs @@ -612,7 +594,6 @@ hint.le.0.irq="10" hint.le.0.drq="0" device nfe # nVidia nForce MCP on-board Ethernet Networking device nve # nVidia nForce MCP on-board Ethernet Networking -device ral device sbni hint.sbni.0.at="isa" hint.sbni.0.port="0x210" Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Fri Dec 18 15:01:46 2009 (r200669) +++ head/sys/pc98/conf/NOTES Fri Dec 18 16:13:21 2009 (r200670) @@ -382,10 +382,8 @@ hint.mse.0.irq="13" # ie: AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210; # Intel EtherExpress # le: AMD Am7900 LANCE and Am79C9xx ILACC/PCnet Ethernet interface driver -# ral: Ralink Technology IEEE 802.11 wireless adapter # sbni: Granch SBNI12-xx ISA and PCI adapters # snc: National Semiconductor DP8393X SONIC Ethernet adapter driver -# ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # Order for ISA/EISA devices is important here @@ -407,7 +405,6 @@ hint.ie.2.maddr="0xd0000" hint.le.0.at="isa" hint.le.0.port="0x03d0" hint.le.0.irq="6" -device ral device sbni hint.sbni.0.at="isa" hint.sbni.0.port="0x210" @@ -419,23 +416,6 @@ hint.snc.0.port="0x888" hint.snc.0.irq="6" hint.snc.0.maddr="0xc0000" -device ath # Atheros pci/cardbus NIC's -device ath_hal # pci/cardbus chip support -#device ath_ar5210 # AR5210 chips -#device ath_ar5211 # AR5211 chips -#device ath_ar5212 # AR5212 chips -#device ath_rf2413 -#device ath_rf2417 -#device ath_rf2425 -#device ath_rf5111 -#device ath_rf5112 -#device ath_rf5413 -#device ath_ar5416 # AR5416 chips -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -#device ath_ar9160 # AR9160 chips -#device ath_ar9280 # AR9280 chips -device ath_rate_sample # SampleRate tx rate control for ath - # # SCSI host adapters: # From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 16:14:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A39106566C; Fri, 18 Dec 2009 16:14:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A40528FC19; Fri, 18 Dec 2009 16:14:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIGEVTX097559; Fri, 18 Dec 2009 16:14:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIGEVkL097557; Fri, 18 Dec 2009 16:14:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912181614.nBIGEVkL097557@svn.freebsd.org> From: John Baldwin Date: Fri, 18 Dec 2009 16:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200671 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:14:31 -0000 Author: jhb Date: Fri Dec 18 16:14:31 2009 New Revision: 200671 URL: http://svn.freebsd.org/changeset/base/200671 Log: - Add missing newlines to some error messages. - Add interrupt descriptions when using mulitple MSI-X interrupts. Reviewed by: jfv Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Dec 18 16:13:21 2009 (r200670) +++ head/sys/dev/e1000/if_igb.c Fri Dec 18 16:14:31 2009 (r200671) @@ -2121,9 +2121,10 @@ igb_allocate_msix(struct adapter *adapte igb_msix_tx, txr, &txr->tag); if (error) { txr->res = NULL; - device_printf(dev, "Failed to register TX handler"); + device_printf(dev, "Failed to register TX handler\n"); return (error); } + bus_describe_intr(dev, txr->res, txr->tag, "tx %d", i); txr->msix = vector; if (adapter->hw.mac.type == e1000_82575) txr->eims = E1000_EICR_TX_QUEUE0 << i; @@ -2159,9 +2160,10 @@ igb_allocate_msix(struct adapter *adapte igb_msix_rx, rxr, &rxr->tag); if (error) { rxr->res = NULL; - device_printf(dev, "Failed to register RX handler"); + device_printf(dev, "Failed to register RX handler\n"); return (error); } + bus_describe_intr(dev, rxr->res, rxr->tag, "rx %d", i); rxr->msix = vector; if (adapter->hw.mac.type == e1000_82575) rxr->eims = E1000_EICR_RX_QUEUE0 << i; @@ -2200,9 +2202,10 @@ igb_allocate_msix(struct adapter *adapte if ((error = bus_setup_intr(dev, adapter->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, igb_msix_link, adapter, &adapter->tag)) != 0) { - device_printf(dev, "Failed to register Link handler"); + device_printf(dev, "Failed to register Link handler\n"); return (error); } + bus_describe_intr(dev, adapter->res, adapter->tag, "link"); adapter->linkvec = vector; return (0); From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 16:35:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E9A1065679; Fri, 18 Dec 2009 16:35:28 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55E238FC2F; Fri, 18 Dec 2009 16:35:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIGZSUE098149; Fri, 18 Dec 2009 16:35:28 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIGZSOm098147; Fri, 18 Dec 2009 16:35:28 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912181635.nBIGZSOm098147@svn.freebsd.org> From: Hajimu UMEMOTO Date: Fri, 18 Dec 2009 16:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200672 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:35:28 -0000 Author: ume Date: Fri Dec 18 16:35:28 2009 New Revision: 200672 URL: http://svn.freebsd.org/changeset/base/200672 Log: Mention the unification of rc.firewall and rc.firewall6. Suggested by: David Horn Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Dec 18 16:14:31 2009 (r200671) +++ head/UPDATING Fri Dec 18 16:35:28 2009 (r200672) @@ -22,6 +22,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20091202: + The rc.firewall and rc.firewall6 were unified, and + rc.firewall6 and rc.d/ip6fw were removed. + According to the removal of rc.d/ip6fw, ipv6_firewall_* rc + variables are obsoleted. Instead, the following new rc + variables are added to rc.d/ipfw: + + firewall_client_net_ipv6, firewall_simple_iif_ipv6, + firewall_simple_inet_ipv6, firewall_simple_oif_ipv6, + firewall_simple_onet_ipv6, firewall_trusted_ipv6 + + The meanings correspond to the relevant IPv4 variables. + 20091113: The default terminal emulation for syscons(4) has been changed from cons25 to xterm on all platforms except pc98. This means From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 16:36:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B822E1065693; Fri, 18 Dec 2009 16:36:28 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 59B0D8FC13; Fri, 18 Dec 2009 16:36:28 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id EAB031CDE9; Fri, 18 Dec 2009 17:36:26 +0100 (CET) Date: Fri, 18 Dec 2009 17:36:26 +0100 From: Ed Schouten To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20091218163626.GF64905@hoeg.nl> References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Up32gbJlVxH+cNZn" Content-Disposition: inline In-Reply-To: <868wd0cyjd.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh , John Baldwin Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 16:36:28 -0000 --Up32gbJlVxH+cNZn Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello DES, First of all: happy birthday! * Dag-Erling Sm=F8rgrav wrote: > perhaps we should simply add the appropriate > #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) > without FREEBSD_COMPAT(n+1). Why not make COMPAT_FREEBSD numerical? | options COMPAT_FREEBSD=3D4 and let the code use: | #if COMPAT_FREEBSD <=3D 4 | ... | #endif --=20 Ed Schouten WWW: http://80386.nl/ --Up32gbJlVxH+cNZn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksrr4oACgkQ52SDGA2eCwWZXACfXEpYqe3SS/g6ME1PqJmDex6d VqoAnA9CyDHQa1vXQW0KmvRd1aqVwxF8 =ZRJw -----END PGP SIGNATURE----- --Up32gbJlVxH+cNZn-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 17:22:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE8A21065670; Fri, 18 Dec 2009 17:22:21 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE2B18FC0A; Fri, 18 Dec 2009 17:22:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIHMLJ9099393; Fri, 18 Dec 2009 17:22:21 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIHMLxK099391; Fri, 18 Dec 2009 17:22:21 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912181722.nBIHMLxK099391@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 18 Dec 2009 17:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200673 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 17:22:22 -0000 Author: ru Date: Fri Dec 18 17:22:21 2009 New Revision: 200673 URL: http://svn.freebsd.org/changeset/base/200673 Log: Added proper attribution. Requested by: luigi Modified: head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Fri Dec 18 16:35:28 2009 (r200672) +++ head/sys/netinet/ipfw/ip_fw_table.c Fri Dec 18 17:22:21 2009 (r200673) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 ......... + * Copyright (c) 2004 Ruslan Ermilov and Vsevolod Lobko. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 17:46:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F6F11065670; Fri, 18 Dec 2009 17:46:57 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0AC8FC0C; Fri, 18 Dec 2009 17:46:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIHkvde000817; Fri, 18 Dec 2009 17:46:57 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIHkvod000814; Fri, 18 Dec 2009 17:46:57 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <200912181746.nBIHkvod000814@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Fri, 18 Dec 2009 17:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200674 - in head: share/man/man4 sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 17:46:57 -0000 Author: dumbbell Date: Fri Dec 18 17:46:57 2009 New Revision: 200674 URL: http://svn.freebsd.org/changeset/base/200674 Log: Add new "hw.psm.tap_enabled" tunable and sysctl. This tunable allows one to enable (1) or disable (0) gestures like tap and tap-hold on Synaptics TouchPad when the Extended mode isn't enabled (ie. "hw.psm.synaptics_support" not set). By default, the value is -1 in order to keep the current behaviour of not enabling/disabling gestures explicitly. PR: kern/139272 Submitted by: David Horn Reviewed by: David Horn Modified: head/share/man/man4/psm.4 head/sys/dev/atkbdc/psm.c Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Fri Dec 18 17:22:21 2009 (r200673) +++ head/share/man/man4/psm.4 Fri Dec 18 17:46:57 2009 (r200674) @@ -359,6 +359,18 @@ at boot-time. This will enable .Nm to handle packets from guest devices (sticks) and extra buttons. +.Pp +Tap and drag gestures can be disabled by setting +.Va hw.psm.tap_enabled +to +.Em 0 +at boot-time. +Currently, this is only supported on Synaptics touchpads with Extended +support disabled. The behaviour may be changed after boot by setting +the sysctl with the same name and by restarting +.Xr moused 8 +using +.Pa /etc/rc.d/moused . .Sh IOCTLS There are a few .Xr ioctl 2 Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Fri Dec 18 17:22:21 2009 (r200673) +++ head/sys/dev/atkbdc/psm.c Fri Dec 18 17:46:57 2009 (r200674) @@ -343,6 +343,9 @@ static devclass_t psm_devclass; #define PSM_FLAGS_FINGERDOWN 0x0001 /* VersaPad finger down */ /* Tunables */ +static int tap_enabled = -1; +TUNABLE_INT("hw.psm.tap_enabled", &tap_enabled); + static int synaptics_support = 0; TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support); @@ -901,6 +904,36 @@ doopen(struct psm_softc *sc, int command } } + /* + * A user may want to disable tap and drag gestures on a Synaptics + * TouchPad when it operates in Relative Mode. + */ + if (sc->hw.model == MOUSE_MODEL_GENERIC) { + if (tap_enabled > 0) { + /* + * Enable tap & drag gestures. We use a Mode Byte + * and clear the DisGest bit (see §2.5 of Synaptics + * TouchPad Interfacing Guide). + */ + VLOG(2, (LOG_DEBUG, + "psm%d: enable tap and drag gestures\n", + sc->unit)); + mouse_ext_command(sc->kbdc, 0x00); + set_mouse_sampling_rate(sc->kbdc, 20); + } else if (tap_enabled == 0) { + /* + * Disable tap & drag gestures. We use a Mode Byte + * and set the DisGest bit (see §2.5 of Synaptics + * TouchPad Interfacing Guide). + */ + VLOG(2, (LOG_DEBUG, + "psm%d: disable tap and drag gestures\n", + sc->unit)); + mouse_ext_command(sc->kbdc, 0x04); + set_mouse_sampling_rate(sc->kbdc, 20); + } + } + /* enable the mouse device */ if (!enable_aux_dev(sc->kbdc)) { /* MOUSE ERROR: failed to enable the mouse because: @@ -2261,6 +2294,8 @@ static int pkterrthresh = 2; SYSCTL_INT(_debug_psm, OID_AUTO, pkterrthresh, CTLFLAG_RW, &pkterrthresh, 0, "Number of error packets allowed before reinitializing the mouse"); +SYSCTL_INT(_hw_psm, OID_AUTO, tap_enabled, CTLFLAG_RW, &tap_enabled, 0, + "Enable tap and drag gestures"); static int tap_threshold = PSM_TAP_THRESHOLD; SYSCTL_INT(_hw_psm, OID_AUTO, tap_threshold, CTLFLAG_RW, &tap_threshold, 0, "Button tap threshold"); From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 18:45:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8FFF106568F; Fri, 18 Dec 2009 18:45:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F1428FC0C; Fri, 18 Dec 2009 18:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIIja6Z004534; Fri, 18 Dec 2009 18:45:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIIjaRx004532; Fri, 18 Dec 2009 18:45:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912181845.nBIIjaRx004532@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Dec 2009 18:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200676 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 18:45:36 -0000 Author: yongari Date: Fri Dec 18 18:45:36 2009 New Revision: 200676 URL: http://svn.freebsd.org/changeset/base/200676 Log: Document more VIA Velocity family controllers to vge(4). Previously it mentioned only VT6122. While I'm here remove the mention of VT3119 which seems to be VIA's internal model name and VT3119 wouldn't be available to end users. Reviewed by: brueffer Modified: head/share/man/man4/vge.4 Modified: head/share/man/man4/vge.4 ============================================================================== --- head/share/man/man4/vge.4 Fri Dec 18 18:30:49 2009 (r200675) +++ head/share/man/man4/vge.4 Fri Dec 18 18:45:36 2009 (r200676) @@ -30,12 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 17, 2009 +.Dd December 18, 2009 .Dt VGE 4 .Os .Sh NAME .Nm vge -.Nd "VIA Networking Technologies VT6122 PCI Gigabit Ethernet adapter driver" +.Nd "VIA Networking Technologies Velocity Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -55,22 +55,23 @@ if_vge_load="YES" The .Nm driver provides support for various NICs and embedded Ethernet interfaces -based on the VIA Networking Technologies VT6122 Gigabit Ethernet -controller chips. +based on the VIA Technologies VT6120, VT6122, VT6130 and VT6132 Velocity +Family Gigabit Ethernet controller chips. .Pp -The VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed MAC with -an integrated 10/100/1000 copper PHY. +The VT6120/VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed +MAC with an integrated 10/100/1000 copper PHY. (Some older cards use an external PHY.) +The VT6130/VT6132 is the PCI express version of Velocity family. The MAC supports TCP/IP hardware checksums (IPv4 only), TCP large send, VLAN tag insertion and stripping, as well as VLAN filtering, a 64-entry CAM filter and a 64-entry VLAN filter, 64-bit multicast hash filter, 4 separate transmit DMA queues, flow control and jumbo frames up to 16K in size. -The VT6122 has a 16K receive FIFO and 48K transmit FIFO. +The Velocity family controllers have a 16K receive FIFO and 48K transmit FIFO. .Pp The .Nm -driver takes advantage of the VT6122's checksum offload and VLAN +driver takes advantage of the controller's checksum offload and VLAN tagging features, as well as the jumbo frame and CAM filter support. The CAM filter is used for multicast address filtering to provide 64 perfect multicast address filter support. @@ -162,7 +163,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports VIA Networking VT3119 and VT6122 based +driver supports VIA Networking VT6120, VT6122, VT6130 and VT6132 based Gigabit Ethernet adapters including: .Pp .Bl -bullet -compact From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 19:34:27 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AE30106568B; Fri, 18 Dec 2009 19:34:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF868FC12; Fri, 18 Dec 2009 19:34:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBIJSTxT095237; Fri, 18 Dec 2009 12:28:30 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 18 Dec 2009 12:28:57 -0700 (MST) Message-Id: <20091218.122857.59640143227132198.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <868wd0cyjd.fsf@ds4.des.no> References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 19:34:27 -0000 In message: <868wd0cyjd.fsf@ds4.des.no> Dag-Erling Sm=F8rgrav writes: : John Baldwin writes: : > Warner Losh writes: : > > Log: : > > Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. : > > = : > > Note: Not sure this is the right way to do compat, but it makes= the : > > headers consistent with the implementations. : > Please revert. I think this has already been reverted once before.= : = : Yep, that was me... we concluded back then that this is a perfectly : reasonable dependency; perhaps we should simply add the appropriate : #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) : without FREEBSD_COMPAT(n+1). I'll take care of that... Warner From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 20:11:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0015106566C; Fri, 18 Dec 2009 20:11:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF6B98FC08; Fri, 18 Dec 2009 20:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIKBTSY007155; Fri, 18 Dec 2009 20:11:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIKBTsA007153; Fri, 18 Dec 2009 20:11:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912182011.nBIKBTsA007153@svn.freebsd.org> From: Ed Schouten Date: Fri, 18 Dec 2009 20:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200685 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 20:11:30 -0000 Author: ed Date: Fri Dec 18 20:11:29 2009 New Revision: 200685 URL: http://svn.freebsd.org/changeset/base/200685 Log: Make the wchan names of pts(4) fit in top(1). Just like a similar change we made to the TTY code about half a year ago, make these strings look similar. Suggested by: Jille Timmermans Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Fri Dec 18 20:08:29 2009 (r200684) +++ head/sys/kern/tty_pts.c Fri Dec 18 20:11:29 2009 (r200685) @@ -733,8 +733,8 @@ pts_alloc(int fflags, struct thread *td, /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); - cv_init(&psc->pts_inwait, "pts inwait"); - cv_init(&psc->pts_outwait, "pts outwait"); + cv_init(&psc->pts_inwait, "ptsin"); + cv_init(&psc->pts_outwait, "ptsout"); psc->pts_unit = unit; psc->pts_uidinfo = uid; @@ -772,8 +772,8 @@ pts_alloc_external(int fflags, struct th /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); - cv_init(&psc->pts_inwait, "pts inwait"); - cv_init(&psc->pts_outwait, "pts outwait"); + cv_init(&psc->pts_inwait, "ptsin"); + cv_init(&psc->pts_outwait, "ptsout"); psc->pts_unit = -1; psc->pts_cdev = dev; From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 21:12:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8EBF106568D; Fri, 18 Dec 2009 21:12:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A3D8FC14; Fri, 18 Dec 2009 21:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBILCb2F008908; Fri, 18 Dec 2009 21:12:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBILCbt8008906; Fri, 18 Dec 2009 21:12:37 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912182112.nBILCbt8008906@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 18 Dec 2009 21:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200691 - head/sys/boot/uboot/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:12:37 -0000 Author: marcel Date: Fri Dec 18 21:12:37 2009 New Revision: 200691 URL: http://svn.freebsd.org/changeset/base/200691 Log: Fix ub_env_enum(): syscall() returns 0 when properly invoked. Modified: head/sys/boot/uboot/lib/glue.c Modified: head/sys/boot/uboot/lib/glue.c ============================================================================== --- head/sys/boot/uboot/lib/glue.c Fri Dec 18 21:02:32 2009 (r200690) +++ head/sys/boot/uboot/lib/glue.c Fri Dec 18 21:12:37 2009 (r200691) @@ -568,17 +568,16 @@ ub_env_enum(const char *last) const char *env, *str; int i; - env = NULL; - /* * It's OK to pass only the name piece as last (and not the whole * 'name=val' string), since the API_ENUM_ENV call uses envmatch() * internally, which handles such case */ - if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env)) + env = NULL; + if (syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env) != 0) return (NULL); - if (!env) + if (env == NULL) /* no more env. variables to enumerate */ return (NULL); From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 21:57:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFCFE106566C; Fri, 18 Dec 2009 21:57:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CED278FC15; Fri, 18 Dec 2009 21:57:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBILvpDU009961; Fri, 18 Dec 2009 21:57:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBILvpfm009959; Fri, 18 Dec 2009 21:57:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912182157.nBILvpfm009959@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Dec 2009 21:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200693 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 21:57:52 -0000 Author: yongari Date: Fri Dec 18 21:57:51 2009 New Revision: 200693 URL: http://svn.freebsd.org/changeset/base/200693 Log: Make sure to enable Next Page bit for IP1001. Otherwise the PHY fails to re-establishe 1000baseT link after downgrading to 10/100Mbps link. Modified: head/sys/dev/mii/ip1000phy.c Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Fri Dec 18 21:21:14 2009 (r200692) +++ head/sys/dev/mii/ip1000phy.c Fri Dec 18 21:57:51 2009 (r200693) @@ -398,8 +398,10 @@ ip1000phy_mii_phy_auto(struct mii_softc isc = (struct ip1000phy_softc *)sc; reg = 0; - if (isc->model == MII_MODEL_ICPLUS_IP1001) + if (isc->model == MII_MODEL_ICPLUS_IP1001) { reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg |= IP1000PHY_ANAR_NP; + } reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 22:14:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8223C1065672; Fri, 18 Dec 2009 22:14:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701788FC15; Fri, 18 Dec 2009 22:14:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBIMESkG010520; Fri, 18 Dec 2009 22:14:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBIMESsh010515; Fri, 18 Dec 2009 22:14:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912182214.nBIMESsh010515@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Dec 2009 22:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200696 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:14:28 -0000 Author: yongari Date: Fri Dec 18 22:14:28 2009 New Revision: 200696 URL: http://svn.freebsd.org/changeset/base/200696 Log: Add rudimentary WOL support. While I'm here remove enabling busmastering/memory address in resume path. Bus driver will handle that. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgereg.h head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Fri Dec 18 22:13:34 2009 (r200695) +++ head/sys/dev/vge/if_vge.c Fri Dec 18 22:14:28 2009 (r200696) @@ -157,6 +157,7 @@ static int vge_suspend(device_t); static void vge_cam_clear(struct vge_softc *); static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_clrwol(struct vge_softc *); static void vge_discard_rxbuf(struct vge_softc *, int); static int vge_dma_alloc(struct vge_softc *); static void vge_dma_free(struct vge_softc *); @@ -190,6 +191,7 @@ static int vge_rx_list_init(struct vge_s static int vge_rxeof(struct vge_softc *, int); static void vge_rxfilter(struct vge_softc *); static void vge_setvlan(struct vge_softc *); +static void vge_setwol(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stats_clear(struct vge_softc *); @@ -1012,6 +1014,10 @@ vge_attach(device_t dev) sc->vge_flags |= VGE_FLAG_PCIE; sc->vge_expcap = cap; } + if (pci_find_extcap(dev, PCIY_PMG, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PMCAP; + sc->vge_pmcap = cap; + } rid = 0; msic = pci_msi_count(dev); if (msi_disable == 0 && msic > 0) { @@ -1069,6 +1075,8 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + /* Clear WOL and take hardware from powerdown. */ + vge_clrwol(sc); vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) @@ -1098,6 +1106,8 @@ vge_attach(device_t dev) ifp->if_hwassist = VGE_CSUM_FEATURES; ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTAGGING; + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) + ifp->if_capabilities |= IFCAP_WOL; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2279,6 +2289,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_WOL_UCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -2365,7 +2384,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - + vge_setwol(sc); sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); @@ -2382,17 +2401,26 @@ vge_resume(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; + uint16_t pmstat; sc = device_get_softc(dev); - ifp = sc->vge_ifp; - - /* reenable busmastering */ - pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - - /* reinitialize interface if necessary */ VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, pmstat, 2); + } + } + vge_clrwol(sc); + /* Restart MII auto-polling. */ + vge_miipoll_start(sc); + ifp = sc->vge_ifp; + /* Reinitialize interface if necessary. */ + if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } @@ -2409,15 +2437,8 @@ vge_resume(device_t dev) static int vge_shutdown(device_t dev) { - struct vge_softc *sc; - - sc = device_get_softc(dev); - VGE_LOCK(sc); - vge_stop(sc); - VGE_UNLOCK(sc); - - return (0); + return (vge_suspend(dev)); } #define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ @@ -2706,3 +2727,154 @@ vge_intr_holdoff(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); } } + +static void +vge_setlinkspeed(struct vge_softc *sc) +{ + struct mii_data *mii; + int aneg, i; + + VGE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->vge_miibus); + mii_pollstat(mii); + aneg = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch IFM_SUBTYPE(mii->mii_media_active) { + case IFM_10_T: + case IFM_100_TX: + return; + case IFM_1000_T: + aneg++; + default: + break; + } + } + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_100T2CR, 0); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_ANAR, + ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_AUTOEN | BMCR_STARTNEG); + DELAY(1000); + if (aneg != 0) { + /* Poll link state until vge(4) get a 10/100 link. */ + for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { + mii_pollstat(mii); + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) + == (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + return; + default: + break; + } + } + VGE_UNLOCK(sc); + pause("vgelnk", hz); + VGE_LOCK(sc); + } + if (i == MII_ANEGTICKS_GIGE) + device_printf(sc->vge_dev, "establishing link failed, " + "WOL may not work!"); + } + /* + * No link, force MAC to have 100Mbps, full-duplex link. + * This is the last resort and may/may not work. + */ + mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; + mii->mii_media_active = IFM_ETHER | IFM_100_TX | IFM_FDX; +} + +static void +vge_setwol(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint16_t pmstat; + uint8_t val; + + VGE_LOCK_ASSERT(sc); + + if ((sc->vge_flags & VGE_FLAG_PMCAP) == 0) { + /* No PME capability, PHY power down. */ + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_PDOWN); + vge_miipoll_stop(sc); + return; + } + + ifp = sc->vge_ifp; + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + if ((ifp->if_capenable & IFCAP_WOL) != 0) { + vge_setlinkspeed(sc); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + val |= VGE_WOLCR1_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= VGE_WOLCR1_MAGIC; + CSR_WRITE_1(sc, VGE_WOLCR1S, val); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + val |= VGE_WOLCFG_SAM | VGE_WOLCFG_SAB; + CSR_WRITE_1(sc, VGE_WOLCFGS, val | VGE_WOLCFG_PMEOVR); + /* Disable MII auto-polling. */ + vge_miipoll_stop(sc); + } + CSR_SETBIT_1(sc, VGE_DIAGCTL, + VGE_DIAGCTL_MACFORCE | VGE_DIAGCTL_FDXFORCE); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Put hardware into sleep. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_DS0 | VGE_STICKHW_DS1; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->vge_dev, sc->vge_pmcap + + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, sc->vge_pmcap + PCIR_POWER_STATUS, + pmstat, 2); +} + +static void +vge_clrwol(struct vge_softc *sc) +{ + uint8_t val; + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Disable WOL and clear power state indicator. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~(VGE_STICKHW_DS0 | VGE_STICKHW_DS1); + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE); + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); +} Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Fri Dec 18 22:13:34 2009 (r200695) +++ head/sys/dev/vge/if_vgereg.h Fri Dec 18 22:14:28 2009 (r200696) @@ -590,6 +590,42 @@ #define VGE_MIB_DATA_MASK 0x00FFFFFF #define VGE_MIB_DATA_IDX(x) ((x) >> 24) +/* Sticky bit shadow register */ + +#define VGE_STICKHW_DS0 0x01 +#define VGE_STICKHW_DS1 0x02 +#define VGE_STICKHW_WOL_ENB 0x04 +#define VGE_STICKHW_WOL_STS 0x08 +#define VGE_STICKHW_SWPTAG 0x10 + +/* WOL pattern control */ +#define VGE_WOLCR0_PATTERN0 0x01 +#define VGE_WOLCR0_PATTERN1 0x02 +#define VGE_WOLCR0_PATTERN2 0x04 +#define VGE_WOLCR0_PATTERN3 0x08 +#define VGE_WOLCR0_PATTERN4 0x10 +#define VGE_WOLCR0_PATTERN5 0x20 +#define VGE_WOLCR0_PATTERN6 0x40 +#define VGE_WOLCR0_PATTERN7 0x80 +#define VGE_WOLCR0_PATTERN_ALL 0xFF + +/* WOL event control */ +#define VGE_WOLCR1_UCAST 0x01 +#define VGE_WOLCR1_MAGIC 0x02 +#define VGE_WOLCR1_LINKON 0x04 +#define VGE_WOLCR1_LINKOFF 0x08 + +/* Poweer management config */ +#define VGE_PWRCFG_LEGACY_WOLEN 0x01 +#define VGE_PWRCFG_WOL_PULSE 0x20 +#define VGE_PWRCFG_WOL_BUTTON 0x00 + +/* WOL config register */ +#define VGE_WOLCFG_PHYINT_ENB 0x01 +#define VGE_WOLCFG_SAB 0x10 +#define VGE_WOLCFG_SAM 0x20 +#define VGE_WOLCFG_PMEOVR 0x80 + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Fri Dec 18 22:13:34 2009 (r200695) +++ head/sys/dev/vge/if_vgevar.h Fri Dec 18 22:14:28 2009 (r200696) @@ -186,9 +186,11 @@ struct vge_softc { int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_PMCAP 0x0004 #define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; + int vge_pmcap; int vge_camidx; int vge_int_holdoff; int vge_rx_coal_pkt; From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 22:19:45 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57527106566B; Fri, 18 Dec 2009 22:19:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id F0FB88FC08; Fri, 18 Dec 2009 22:19:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBIM9oa3097158; Fri, 18 Dec 2009 15:09:50 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 18 Dec 2009 15:10:17 -0700 (MST) Message-Id: <20091218.151017.956847443318915404.imp@bsdimp.com> To: ed@80386.nl From: "M. Warner Losh" In-Reply-To: <20091218163626.GF64905@hoeg.nl> References: <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> <20091218163626.GF64905@hoeg.nl> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, des@des.no, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 22:19:45 -0000 In message: <20091218163626.GF64905@hoeg.nl> Ed Schouten writes: : Hello DES, : = : First of all: happy birthday! : = : * Dag-Erling Sm=F8rgrav wrote: : > perhaps we should simply add the appropriate : > #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) : > without FREEBSD_COMPAT(n+1). : = : Why not make COMPAT_FREEBSD numerical? : = : | options COMPAT_FREEBSD=3D4 : = : and let the code use: : = : | #if COMPAT_FREEBSD <=3D 4 : | ... : | #endif That would take some doing to the syscall generation code as well. The whole concept of the compat stuff isn't well thought out, since it seems backwards (and I think that you got your example wrong). Warner From owner-svn-src-head@FreeBSD.ORG Fri Dec 18 23:38:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A895A1065679 for ; Fri, 18 Dec 2009 23:38:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3757F8FC19 for ; Fri, 18 Dec 2009 23:38:32 +0000 (UTC) Received: (qmail 20166 invoked by uid 399); 18 Dec 2009 23:38:31 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 18 Dec 2009 23:38:31 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B2C127A.8060509@FreeBSD.org> Date: Fri, 18 Dec 2009 15:38:34 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200912161717.nBGHHeQZ005541@svn.freebsd.org> <200912161541.53834.jhb@freebsd.org> <868wd0cyjd.fsf@ds4.des.no> In-Reply-To: <868wd0cyjd.fsf@ds4.des.no> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh , John Baldwin Subject: Re: svn commit: r200606 - in head/sys: compat/freebsd32 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2009 23:38:32 -0000 Dag-Erling Smørgrav wrote: > John Baldwin writes: >> Warner Losh writes: >>> Log: >>> Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7. >>> >>> Note: Not sure this is the right way to do compat, but it makes the >>> headers consistent with the implementations. >> Please revert. I think this has already been reverted once before. > > Yep, that was me... we concluded back then that this is a perfectly > reasonable dependency; perhaps we should simply add the appropriate > #ifndef / #error constructs so you can't define FREEBSD_COMPAT(n) > without FREEBSD_COMPAT(n+1). Trying to look at this from the user perspective, it's kind of silly that if what I want is COMPAT5 I also need to add COMPAT. I don't know the issues in the code so I don't know what the solution should be on the back end, but on the front end what needs to work is that I specify the compat level I want in my kernel config, then the code does what's necessary to make that work. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 01:30:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B256C1065672; Sat, 19 Dec 2009 01:30:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A10AA8FC16; Sat, 19 Dec 2009 01:30:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJ1UjJM014532; Sat, 19 Dec 2009 01:30:45 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ1UjSa014530; Sat, 19 Dec 2009 01:30:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912190130.nBJ1UjSa014530@svn.freebsd.org> From: Doug Barton Date: Sat, 19 Dec 2009 01:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200700 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 01:30:45 -0000 Author: dougb Date: Sat Dec 19 01:30:45 2009 New Revision: 200700 URL: http://svn.freebsd.org/changeset/base/200700 Log: In the places where find is used that the user may see the results, first pipe it to sort so that order of processing will be deterministic and like things will be grouped together. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Fri Dec 18 22:24:19 2009 (r200699) +++ head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 01:30:45 2009 (r200700) @@ -974,7 +974,7 @@ fi # change to something else in a newer version. So we need to explicitly # test for this, and warn the user if what we find does not match. # -for COMPFILE in `find .` ; do +for COMPFILE in `find . | sort` ; do if [ -e "${DESTDIR}${COMPFILE#.}" ]; then INSTALLED_TYPE=`stat -f '%HT' ${DESTDIR}${COMPFILE#.}` else @@ -1021,7 +1021,7 @@ for COMPFILE in `find .` ; do fi done -for COMPFILE in `find . -type f`; do +for COMPFILE in `find . -type f | sort`; do # First, check to see if the file exists in DESTDIR. If not, the # diff_loop function knows how to handle it. @@ -1124,7 +1124,7 @@ echo '' TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null` if [ -n "${TEST_FOR_FILES}" ]; then echo "*** Files that remain for you to merge by hand:" - find "${TEMPROOT}" -type f -size +0 + find "${TEMPROOT}" -type f -size +0 | sort echo '' fi From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 01:32:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17D0A1065679; Sat, 19 Dec 2009 01:32:35 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0E6C8FC13; Sat, 19 Dec 2009 01:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJ1WYbj014600; Sat, 19 Dec 2009 01:32:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ1WYWU014598; Sat, 19 Dec 2009 01:32:34 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912190132.nBJ1WYWU014598@svn.freebsd.org> From: Doug Barton Date: Sat, 19 Dec 2009 01:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200701 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 01:32:35 -0000 Author: dougb Date: Sat Dec 19 01:32:34 2009 New Revision: 200701 URL: http://svn.freebsd.org/changeset/base/200701 Log: Fix an indentation issue, no functional changes Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 01:30:45 2009 (r200700) +++ head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 01:32:34 2009 (r200701) @@ -840,33 +840,33 @@ mm_install () { DONT_INSTALL=yes ;; /.cshrc | /.profile) - case "${AUTO_INSTALL}" in - '') - case "${LINK_EXPLAINED}" in + case "${AUTO_INSTALL}" in '') - echo " *** Historically BSD derived systems have had a" - echo " hard link from /.cshrc and /.profile to" - echo " their namesakes in /root. Please indicate" - echo " your preference below for bringing your" - echo " installed files up to date." + case "${LINK_EXPLAINED}" in + '') + echo " *** Historically BSD derived systems have had a" + echo " hard link from /.cshrc and /.profile to" + echo " their namesakes in /root. Please indicate" + echo " your preference below for bringing your" + echo " installed files up to date." + echo '' + LINK_EXPLAINED=yes + ;; + esac + + echo " Use 'd' to delete the temporary ${COMPFILE}" + echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" + echo '' + echo " Default is to leave the temporary file to deal with by hand" echo '' - LINK_EXPLAINED=yes + echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " + read HANDLE_LINK + ;; + *) # Part of AUTO_INSTALL + HANDLE_LINK=l ;; esac - echo " Use 'd' to delete the temporary ${COMPFILE}" - echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" - echo '' - echo " Default is to leave the temporary file to deal with by hand" - echo '' - echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " - read HANDLE_LINK - ;; - *) # Part of AUTO_INSTALL - HANDLE_LINK=l - ;; - esac - case "${HANDLE_LINK}" in [dD]*) rm "${COMPFILE}" From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 05:20:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E531065676; Sat, 19 Dec 2009 05:20:27 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B128FC18; Sat, 19 Dec 2009 05:20:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJ5KQs7020865; Sat, 19 Dec 2009 05:20:26 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ5KQiT020863; Sat, 19 Dec 2009 05:20:26 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912190520.nBJ5KQiT020863@svn.freebsd.org> From: Doug Barton Date: Sat, 19 Dec 2009 05:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200708 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 05:20:27 -0000 Author: dougb Date: Sat Dec 19 05:20:26 2009 New Revision: 200708 URL: http://svn.freebsd.org/changeset/base/200708 Log: Fix a problem with how mergemaster handles the hard links for /.cshrc and /.profile. The problem is that install(1) will unlink the old file before it installs the new one, which means that in the best case we have to compare the changes for the old file twice. So, change the logic to first test to see if the link exists, then install the file. Then if the link was there and we're using -i, just create the link in /root and be done with it. Otherwise display the message to the user and give them the option. Because we are now sorting things before doing the comparison we can know conclusively that the files in / should be the sources, and the files in /root will be the targets, so adjust the paths accordingly. While I'm here, split a too-long error message into two lines and just return at the end of handling these files instead of setting the variable that says "do nothing" and then returning at the end of the function anyway. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 05:05:14 2009 (r200707) +++ head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 19 05:20:26 2009 (r200708) @@ -840,8 +840,19 @@ mm_install () { DONT_INSTALL=yes ;; /.cshrc | /.profile) - case "${AUTO_INSTALL}" in - '') + local st_nlink + + # install will unlink the file before it installs the new one, + # so we have to restore/create the link afterwards. + # + st_nlink=0 # In case the file does not yet exist + eval $(stat -s ${DESTDIR}${COMPFILE#.} 2>/dev/null) + + do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" + + if [ -n "${AUTO_INSTALL}" -a $st_nlink -gt 1 ]; then + HANDLE_LINK=l + else case "${LINK_EXPLAINED}" in '') echo " *** Historically BSD derived systems have had a" @@ -855,17 +866,13 @@ mm_install () { esac echo " Use 'd' to delete the temporary ${COMPFILE}" - echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link" + echo " Use 'l' to delete the existing ${DESTDIR}/root/${COMPFILE##*/} and create the link" echo '' echo " Default is to leave the temporary file to deal with by hand" echo '' echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " read HANDLE_LINK - ;; - *) # Part of AUTO_INSTALL - HANDLE_LINK=l - ;; - esac + fi case "${HANDLE_LINK}" in [dD]*) @@ -875,19 +882,19 @@ mm_install () { ;; [lL]*) echo '' - rm -f "${DESTDIR}${COMPFILE#.}" - if ln "${DESTDIR}/root/${COMPFILE##*/}" "${DESTDIR}${COMPFILE#.}"; then + unlink ${DESTDIR}/root/${COMPFILE##*/} + if ln ${DESTDIR}${COMPFILE#.} ${DESTDIR}/root/${COMPFILE##*/}; then echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully" - rm "${COMPFILE}" else - echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand" + echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}" + echo " *** ${COMPFILE} will remain for your consideration" fi ;; *) echo " *** ${COMPFILE} will remain for your consideration" ;; esac - DONT_INSTALL=yes + return ;; esac From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 11:41:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51309106566B; Sat, 19 Dec 2009 11:41:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401138FC08; Sat, 19 Dec 2009 11:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBfrGV032078; Sat, 19 Dec 2009 11:41:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBfrlP032076; Sat, 19 Dec 2009 11:41:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912191141.nBJBfrlP032076@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 19 Dec 2009 11:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200723 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:41:53 -0000 Author: trasz Date: Sat Dec 19 11:41:52 2009 New Revision: 200723 URL: http://svn.freebsd.org/changeset/base/200723 Log: Interpret VAPPEND correctly in vaccess_acl_nfs4(9). Modified: head/sys/kern/subr_acl_nfs4.c Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Sat Dec 19 11:31:28 2009 (r200722) +++ head/sys/kern/subr_acl_nfs4.c Sat Dec 19 11:41:52 2009 (r200723) @@ -82,6 +82,13 @@ _access_mask_from_accmode(accmode_t accm access_mask |= accmode2mask[i].mask; } + /* + * VAPPEND is just a modifier for VWRITE; if the caller asked + * for 'VAPPEND | VWRITE', we want to check for ACL_APPEND_DATA only. + */ + if (access_mask & ACL_APPEND_DATA) + access_mask &= ~ACL_WRITE_DATA; + return (access_mask); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 11:43:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9A231065670; Sat, 19 Dec 2009 11:43:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C64738FC12; Sat, 19 Dec 2009 11:43:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBhdJJ032151; Sat, 19 Dec 2009 11:43:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBhdv4032147; Sat, 19 Dec 2009 11:43:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191143.nBJBhdv4032147@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200724 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:43:39 -0000 Author: delphij Date: Sat Dec 19 11:43:39 2009 New Revision: 200724 URL: http://svn.freebsd.org/changeset/base/200724 Log: Apply fix Solaris bug 6462803 zfs snapshot -r failed because filesystem was busy. Submitted by: mm Approved by: pjd MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sat Dec 19 11:41:52 2009 (r200723) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sat Dec 19 11:43:39 2009 (r200724) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Print intent log header and statistics. */ @@ -345,8 +343,10 @@ dump_intent_log(zilog_t *zilog) if (zh->zh_log.blk_birth == 0 || verbose < 2) return; - (void) printf("\n ZIL header: claim_txg %llu, seq %llu\n", - (u_longlong_t)zh->zh_claim_txg, (u_longlong_t)zh->zh_replay_seq); + (void) printf("\n ZIL header: claim_txg %llu, claim_seq %llu", + (u_longlong_t)zh->zh_claim_txg, (u_longlong_t)zh->zh_claim_seq); + (void) printf(" replay_seq %llu, flags 0x%llx\n", + (u_longlong_t)zh->zh_replay_seq, (u_longlong_t)zh->zh_flags); if (verbose >= 4) print_log_bp(&zh->zh_log, "\n\tfirst block: "); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Sat Dec 19 11:41:52 2009 (r200723) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Sat Dec 19 11:43:39 2009 (r200724) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -56,10 +56,16 @@ typedef struct zil_header { uint64_t zh_replay_seq; /* highest replayed sequence number */ blkptr_t zh_log; /* log chain */ uint64_t zh_claim_seq; /* highest claimed sequence number */ - uint64_t zh_pad[5]; + uint64_t zh_flags; /* header flags */ + uint64_t zh_pad[4]; } zil_header_t; /* + * zh_flags bit settings + */ +#define ZIL_REPLAY_NEEDED 0x1 /* replay needed - internal only */ + +/* * Log block trailer - structure at the end of the header and each log block * * The zit_bt contains a zbt_cksum which for the intent log is Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Dec 19 11:41:52 2009 (r200723) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Dec 19 11:43:39 2009 (r200724) @@ -502,6 +502,25 @@ zil_rollback_destroy(zilog_t *zilog, dmu tx, zh->zh_claim_txg); } +/* + * return true if the initial log block is not valid + */ +static boolean_t +zil_empty(zilog_t *zilog) +{ + const zil_header_t *zh = zilog->zl_header; + arc_buf_t *abuf = NULL; + + if (BP_IS_HOLE(&zh->zh_log)) + return (B_TRUE); + + if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) + return (B_TRUE); + + VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); + return (B_FALSE); +} + int zil_claim(char *osname, void *txarg) { @@ -522,6 +541,21 @@ zil_claim(char *osname, void *txarg) zh = zil_header_in_syncing_context(zilog); /* + * Record here whether the zil has any records to replay. + * If the header block pointer is null or the block points + * to the stubby then we know there are no valid log records. + * We use the header to store this state as the the zilog gets + * freed later in dmu_objset_close(). + * The flags (and the rest of the header fields) are cleared in + * zil_sync() as a result of a zil_destroy(), after replaying the log. + * + * Note, the intent log can be empty but still need the + * stubby to be claimed. + */ + if (!zil_empty(zilog)) + zh->zh_flags |= ZIL_REPLAY_NEEDED; + + /* * Claim all log blocks if we haven't already done so, and remember * the highest claimed sequence number. This ensures that if we can * read only part of the log now (e.g. due to a missing device), @@ -1345,25 +1379,6 @@ zil_free(zilog_t *zilog) } /* - * return true if the initial log block is not valid - */ -static boolean_t -zil_empty(zilog_t *zilog) -{ - const zil_header_t *zh = zilog->zl_header; - arc_buf_t *abuf = NULL; - - if (BP_IS_HOLE(&zh->zh_log)) - return (B_TRUE); - - if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) - return (B_TRUE); - - VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); - return (B_FALSE); -} - -/* * Open an intent log. */ zilog_t * @@ -1418,7 +1433,7 @@ zil_suspend(zilog_t *zilog) const zil_header_t *zh = zilog->zl_header; mutex_enter(&zilog->zl_lock); - if (zh->zh_claim_txg != 0) { /* unplayed log */ + if (zh->zh_flags & ZIL_REPLAY_NEEDED) { /* unplayed log */ mutex_exit(&zilog->zl_lock); return (EBUSY); } @@ -1645,7 +1660,7 @@ zil_replay(objset_t *os, void *arg, uint const zil_header_t *zh = zilog->zl_header; zil_replay_arg_t zr; - if (zil_empty(zilog)) { + if ((zh->zh_flags & ZIL_REPLAY_NEEDED) == 0) { zil_destroy(zilog, B_TRUE); return; } From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 11:47:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76EA010656A4; Sat, 19 Dec 2009 11:47:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63F878FC15; Sat, 19 Dec 2009 11:47:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBlM2D032323; Sat, 19 Dec 2009 11:47:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBlM9a032318; Sat, 19 Dec 2009 11:47:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191147.nBJBlM9a032318@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200726 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:47:22 -0000 Author: delphij Date: Sat Dec 19 11:47:22 2009 New Revision: 200726 URL: http://svn.freebsd.org/changeset/base/200726 Log: Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG (onnv revision 8986) Requested by: mm Submitted by: pjd Obtained from: OpenSolaris MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sat Dec 19 11:47:22 2009 (r200726) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -108,19 +106,51 @@ dmu_object_claim(objset_t *os, uint64_t int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) + int blocksize, dmu_object_type_t bonustype, int bonuslen) { dnode_t *dn; + dmu_tx_t *tx; + int nblkptr; int err; - if (object == DMU_META_DNODE_OBJECT && !dmu_tx_private_ok(tx)) + if (object == DMU_META_DNODE_OBJECT) return (EBADF); err = dnode_hold_impl(os->os, object, DNODE_MUST_BE_ALLOCATED, FTAG, &dn); if (err) return (err); + + if (dn->dn_type == ot && dn->dn_datablksz == blocksize && + dn->dn_bonustype == bonustype && dn->dn_bonuslen == bonuslen) { + /* nothing is changing, this is a noop */ + dnode_rele(dn, FTAG); + return (0); + } + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + dnode_rele(dn, FTAG); + return (err); + } + + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + + /* + * If we are losing blkptrs or changing the block size this must + * be a new file instance. We must clear out the previous file + * contents before we can change this type of metadata in the dnode. + */ + if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize) + dmu_free_long_range(os, object, 0, DMU_OBJECT_END); + dnode_reallocate(dn, ot, blocksize, bonustype, bonuslen, tx); + + dmu_tx_commit(tx); + dnode_rele(dn, FTAG); return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:47:22 2009 (r200726) @@ -829,11 +829,6 @@ restore_object(struct restorearg *ra, ob int err; dmu_tx_t *tx; - err = dmu_object_info(os, drro->drr_object, NULL); - - if (err != 0 && err != ENOENT) - return (EINVAL); - if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || drro->drr_bonustype >= DMU_OT_NUMTYPES || @@ -846,12 +841,15 @@ restore_object(struct restorearg *ra, ob return (EINVAL); } - tx = dmu_tx_create(os); + err = dmu_object_info(os, drro->drr_object, NULL); + + if (err != 0 && err != ENOENT) + return (EINVAL); if (err == ENOENT) { /* currently free, want to be allocated */ + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, DMU_NEW_OBJECT); - dmu_tx_hold_write(tx, DMU_NEW_OBJECT, 0, 1); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); @@ -860,28 +858,23 @@ restore_object(struct restorearg *ra, ob err = dmu_object_claim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); + dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - dmu_tx_hold_bonus(tx, drro->drr_object); - /* - * We may change blocksize and delete old content, - * so need to hold_write and hold_free. - */ - dmu_tx_hold_write(tx, drro->drr_object, 0, 1); - dmu_tx_hold_free(tx, drro->drr_object, 0, DMU_OBJECT_END); - err = dmu_tx_assign(tx, TXG_WAIT); - if (err) { - dmu_tx_abort(tx); - return (err); - } err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, - drro->drr_bonustype, drro->drr_bonuslen, tx); + drro->drr_bonustype, drro->drr_bonuslen); } - if (err) { - dmu_tx_commit(tx); + if (err) return (EINVAL); + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, drro->drr_object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + return (err); } dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Dec 19 11:47:22 2009 (r200726) @@ -415,8 +415,7 @@ void dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - int i, nblkptr; - dmu_buf_impl_t *db = NULL; + int nblkptr; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); ASSERT3U(blocksize, <=, SPA_MAXBLOCKSIZE); @@ -428,42 +427,25 @@ dnode_reallocate(dnode_t *dn, dmu_object ASSERT3U(bonustype, <, DMU_OT_NUMTYPES); ASSERT3U(bonuslen, <=, DN_MAX_BONUSLEN); - for (i = 0; i < TXG_SIZE; i++) - ASSERT(!list_link_active(&dn->dn_dirty_link[i])); - /* clean up any unreferenced dbufs */ dnode_evict_dbufs(dn); - ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL); - - /* - * XXX I should really have a generation number to tell if we - * need to do this... - */ - if (blocksize != dn->dn_datablksz || - dn->dn_bonustype != bonustype || dn->dn_bonuslen != bonuslen) { - /* free all old data */ - dnode_free_range(dn, 0, -1ULL, tx); - } - - nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); - /* change blocksize */ rw_enter(&dn->dn_struct_rwlock, RW_WRITER); - if (blocksize != dn->dn_datablksz && - (!BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || - list_head(&dn->dn_dbufs) != NULL)) { - db = dbuf_hold(dn, 0, FTAG); - dbuf_new_size(db, blocksize, tx); - } - dnode_setdblksz(dn, blocksize); dnode_setdirty(dn, tx); - dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; - dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + if (dn->dn_datablksz != blocksize) { + /* change blocksize */ + ASSERT(dn->dn_maxblkid == 0 && + (BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || + dnode_block_freed(dn, 0))); + dnode_setdblksz(dn, blocksize); + dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + } + if (dn->dn_bonuslen != bonuslen) + dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); if (dn->dn_nblkptr != nblkptr) dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr; rw_exit(&dn->dn_struct_rwlock); - if (db) - dbuf_rele(db, FTAG); /* change type */ dn->dn_type = ot; @@ -1187,11 +1169,6 @@ dnode_block_freed(dnode_t *dn, uint64_t if (dn->dn_free_txg) return (TRUE); - /* - * If dn_datablkshift is not set, then there's only a single - * block, in which case there will never be a free range so it - * won't matter. - */ range_tofind.fr_blkid = blkid; mutex_enter(&dn->dn_mtx); for (i = 0; i < TXG_SIZE; i++) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Dec 19 11:47:00 2009 (r200725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Dec 19 11:47:22 2009 (r200726) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -237,7 +237,7 @@ uint64_t dmu_object_alloc(objset_t *os, int dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx); int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx); + int blocksize, dmu_object_type_t bonustype, int bonuslen); /* * Free an object from this objset. From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 11:49:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB5C1065676; Sat, 19 Dec 2009 11:49:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FA408FC1C; Sat, 19 Dec 2009 11:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJBnKOX032413; Sat, 19 Dec 2009 11:49:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJBnKjg032411; Sat, 19 Dec 2009 11:49:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912191149.nBJBnKjg032411@svn.freebsd.org> From: Xin LI Date: Sat, 19 Dec 2009 11:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200727 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:49:21 -0000 Author: delphij Date: Sat Dec 19 11:49:20 2009 New Revision: 200727 URL: http://svn.freebsd.org/changeset/base/200727 Log: Apply fix for Solaris bug 6462803: zfs snapshot -r failed because filesystem was busy (onnv revision 8989) Submitted by: mm Approved by: pjd Obtained from: OpenSolaris MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:47:22 2009 (r200726) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Dec 19 11:49:20 2009 (r200727) @@ -828,6 +828,7 @@ restore_object(struct restorearg *ra, ob { int err; dmu_tx_t *tx; + void *data = NULL; if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || @@ -869,6 +870,12 @@ restore_object(struct restorearg *ra, ob if (err) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); @@ -880,18 +887,13 @@ restore_object(struct restorearg *ra, ob dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); dmu_object_set_compress(os, drro->drr_object, drro->drr_compress, tx); - if (drro->drr_bonuslen) { + if (data != NULL) { dmu_buf_t *db; - void *data; + VERIFY(0 == dmu_bonus_hold(os, drro->drr_object, FTAG, &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (data == NULL) { - dmu_tx_commit(tx); - return (ra->err); - } bcopy(data, db->db_data, drro->drr_bonuslen); if (ra->byteswap) { dmu_ot[drro->drr_bonustype].ot_byteswap(db->db_data, From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 11:53:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7C45106566C; Sat, 19 Dec 2009 11:53:03 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by mx1.freebsd.org (Postfix) with ESMTP id 26A648FC08; Sat, 19 Dec 2009 11:53:03 +0000 (UTC) Received: by gxk10 with SMTP id 10so3732795gxk.3 for ; Sat, 19 Dec 2009 03:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ouwbnfP4lb5AEzZP2yjHYerNMBspFj/AqIIzY8JzOPg=; b=b9CyB8x6gTG6xdC0XaLySq1xLTPpUls+fJtpXZpAuW0lVlVAyyNfByhttvQSiv8QXm HPmKePnenDEVjtvUUNlqNvJyXaIFmzX4Qg3qH8WUMt4msWIQZacmin5Iavpj7b3gXwwg tILiC4p6ToYGB3AJ9ZlY5iUNfTE7i9xCFDXs8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=LJXAAHoZp6LRWa4dvteykAyS5f1qGo5a/r4s2BuQA5wy48mNGBgWKDb7A1bdwp9yCb 8zraHeCffvMd7yk2DVqllEGoQxIRFFXCRv2yZHgZLWlbXO6+FRvy3TDO8CHceiOjKAdP z4rW2LcsK89/ldU3aahIK5R/MryqisDSAw/OQ= MIME-Version: 1.0 Received: by 10.150.6.17 with SMTP id 17mr8111341ybf.154.1261223581827; Sat, 19 Dec 2009 03:53:01 -0800 (PST) In-Reply-To: <200912191143.nBJBhdv4032147@svn.freebsd.org> References: <200912191143.nBJBhdv4032147@svn.freebsd.org> Date: Sat, 19 Dec 2009 03:53:01 -0800 Message-ID: From: Xin LI To: Xin LI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200724 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 11:53:04 -0000 On Sat, Dec 19, 2009 at 3:43 AM, Xin LI wrote: > Author: delphij > Date: Sat Dec 19 11:43:39 2009 > New Revision: 200724 > URL: http://svn.freebsd.org/changeset/base/200724 > > Log: > =C2=A0Apply fix Solaris bug 6462803 zfs snapshot -r failed because > =C2=A0filesystem was busy. > > =C2=A0Submitted by: mm > =C2=A0Approved by: =C2=A0pjd > =C2=A0MFC after: =C2=A0 =C2=A02 weeks Sorry, the commit log was wrong. It should read: Apply fix for Solaris bug 6764159: restore_object() makes a call that can block while having a tx open but not yet committed onnv revision 7996. Cheers, --=20 Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 16:36:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34FA1065670; Sat, 19 Dec 2009 16:36:57 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92BB98FC19; Sat, 19 Dec 2009 16:36:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJGavxn037993; Sat, 19 Dec 2009 16:36:57 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJGavcr037991; Sat, 19 Dec 2009 16:36:57 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <200912191636.nBJGavcr037991@svn.freebsd.org> From: Benedict Reuschling Date: Sat, 19 Dec 2009 16:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200731 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 16:36:57 -0000 Author: bcr (doc committer) Date: Sat Dec 19 16:36:57 2009 New Revision: 200731 URL: http://svn.freebsd.org/changeset/base/200731 Log: Reference the correct man page for firmware(9). PR: docs/140986 Submitted by: Glen Barber (glen dot j dot barber at gmail dot com) MFC after: 4 days Reviewed by: sam Approved by: sam, jkois (mentor) Modified: head/share/man/man4/mwlfw.4 Modified: head/share/man/man4/mwlfw.4 ============================================================================== --- head/share/man/man4/mwlfw.4 Sat Dec 19 13:39:07 2009 (r200730) +++ head/share/man/man4/mwlfw.4 Sat Dec 19 16:36:57 2009 (r200731) @@ -49,4 +49,4 @@ It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO .Xr mwl 4 , -.Xr firmware 8 +.Xr firmware 9 From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 18:42:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8051065670; Sat, 19 Dec 2009 18:42:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B65D8FC0A; Sat, 19 Dec 2009 18:42:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJIgDi6040511; Sat, 19 Dec 2009 18:42:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJIgDgP040506; Sat, 19 Dec 2009 18:42:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912191842.nBJIgDgP040506@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Dec 2009 18:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200732 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 18:42:13 -0000 Author: ed Date: Sat Dec 19 18:42:12 2009 New Revision: 200732 URL: http://svn.freebsd.org/changeset/base/200732 Log: Let access overriding to TTYs depend on the cdev_priv, not the vnode. Basically this commit changes two things, which improves access to TTYs in exceptional conditions. Basically the problem was that when you ran jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if you want to attach to screens quickly, use ssh(1), etc. The fixes: - Cache the cdev_priv of the controlling TTY in struct session. Change devfs_access() to compare against the cdev_priv instead of the vnode. This allows you to bypass UNIX permissions, even across different mounts of devfs. - Extend devfs_prison_check() to unconditionally expose the device node of the controlling TTY, even if normal prison nesting rules normally don't allow this. This actually allows you to interact with this device node. To be honest, I'm not really happy with this solution. We now have to store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp). In an ideal world, we should just get rid of the latter two and only use s_ttyp, but this makes certian pieces of code very impractical (e.g. devfs, kern_exit.c). Reported by: Many people Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/kern_exit.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/fs/devfs/devfs_vnops.c Sat Dec 19 18:42:12 2009 (r200732) @@ -436,14 +436,14 @@ devfs_access(struct vop_access_args *ap) error = vaccess(vp->v_type, de->de_mode, de->de_uid, de->de_gid, ap->a_accmode, ap->a_cred, NULL); - if (!error) - return (error); + if (error == 0) + return (0); if (error != EACCES) return (error); /* We do, however, allow access to the controlling terminal */ if (!(ap->a_td->td_proc->p_flag & P_CONTROLT)) return (error); - if (ap->a_td->td_proc->p_session->s_ttyvp == de->de_vnode) + if (ap->a_td->td_proc->p_session->s_ttydp == de->de_cdp) return (0); return (error); } @@ -474,6 +474,7 @@ devfs_close(struct vop_close_args *ap) VI_LOCK(vp); if (count_dev(dev) == 2 && (vp->v_iflag & VI_DOOMED) == 0) { td->td_proc->p_session->s_ttyvp = NULL; + td->td_proc->p_session->s_ttydp = NULL; oldvp = vp; } VI_UNLOCK(vp); @@ -675,6 +676,7 @@ devfs_ioctl_f(struct file *fp, u_long co VREF(vp); SESS_LOCK(td->td_proc->p_session); td->td_proc->p_session->s_ttyvp = vp; + td->td_proc->p_session->s_ttydp = cdev2priv(dev); SESS_UNLOCK(td->td_proc->p_session); sx_sunlock(&proctree_lock); @@ -708,10 +710,11 @@ devfs_kqfilter_f(struct file *fp, struct } static inline int -devfs_prison_check(struct devfs_dirent *de, struct ucred *tcr) +devfs_prison_check(struct devfs_dirent *de, struct thread *td) { struct cdev_priv *cdp; struct ucred *dcr; + int error; cdp = de->de_cdp; if (cdp == NULL) @@ -720,7 +723,15 @@ devfs_prison_check(struct devfs_dirent * if (dcr == NULL) return (0); - return (prison_check(tcr, dcr)); + error = prison_check(td->td_ucred, dcr); + if (error == 0) + return (0); + /* We do, however, allow access to the controlling terminal */ + if (!(td->td_proc->p_flag & P_CONTROLT)) + return (error); + if (td->td_proc->p_session->s_ttydp == cdp) + return (0); + return (error); } static int @@ -848,7 +859,7 @@ devfs_lookupx(struct vop_lookup_args *ap return (ENOENT); } - if (devfs_prison_check(de, td->td_ucred)) + if (devfs_prison_check(de, td)) return (ENOENT); if ((cnp->cn_nameiop == DELETE) && (flags & ISLASTCN)) { @@ -1126,7 +1137,7 @@ devfs_readdir(struct vop_readdir_args *a KASSERT(dd->de_cdp != (void *)0xdeadc0de, ("%s %d\n", __func__, __LINE__)); if (dd->de_flags & DE_WHITEOUT) continue; - if (devfs_prison_check(dd, ap->a_cred)) + if (devfs_prison_check(dd, uio->uio_td)) continue; if (dd->de_dirent->d_type == DT_DIR) de = dd->de_dir; Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/kern/kern_exit.c Sat Dec 19 18:42:12 2009 (r200732) @@ -316,6 +316,7 @@ exit1(struct thread *td, int rv) ttyvp = sp->s_ttyvp; tp = sp->s_ttyp; sp->s_ttyvp = NULL; + sp->s_ttydp = NULL; sp->s_leader = NULL; SESS_UNLOCK(sp); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/kern/kern_proc.c Sat Dec 19 18:42:12 2009 (r200732) @@ -358,6 +358,7 @@ enterpgrp(p, pgid, pgrp, sess) sess->s_sid = p->p_pid; refcount_init(&sess->s_count, 1); sess->s_ttyvp = NULL; + sess->s_ttydp = NULL; sess->s_ttyp = NULL; bcopy(p->p_session->s_login, sess->s_login, sizeof(sess->s_login)); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Dec 19 16:36:57 2009 (r200731) +++ head/sys/sys/proc.h Sat Dec 19 18:42:12 2009 (r200732) @@ -77,6 +77,7 @@ struct session { u_int s_count; /* Ref cnt; pgrps in session - atomic. */ struct proc *s_leader; /* (m + e) Session leader. */ struct vnode *s_ttyvp; /* (m) Vnode of controlling tty. */ + struct cdev_priv *s_ttydp; /* (m) Device of controlling tty. */ struct tty *s_ttyp; /* (e) Controlling tty. */ pid_t s_sid; /* (c) Session ID. */ /* (m) Setlogin() name: */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 18:55:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B1C106566B; Sat, 19 Dec 2009 18:55:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 1A07F8FC13; Sat, 19 Dec 2009 18:55:01 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nBJIsvbI095505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nBJIsviu084351; Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nBJIsvce084350; Sat, 19 Dec 2009 20:54:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Dec 2009 20:54:57 +0200 From: Kostik Belousov To: Ed Schouten Message-ID: <20091219185457.GH2170@deviant.kiev.zoral.com.ua> References: <200912191842.nBJIgDgP040506@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lQSB8Tqijvu1+4Ba" Content-Disposition: inline In-Reply-To: <200912191842.nBJIgDgP040506@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200732 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 18:55:02 -0000 --lQSB8Tqijvu1+4Ba Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 19, 2009 at 06:42:12PM +0000, Ed Schouten wrote: > Author: ed > Date: Sat Dec 19 18:42:12 2009 > New Revision: 200732 > URL: http://svn.freebsd.org/changeset/base/200732 >=20 > Log: > Let access overriding to TTYs depend on the cdev_priv, not the vnode. > =20 > Basically this commit changes two things, which improves access to TTYs > in exceptional conditions. Basically the problem was that when you ran > jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the > node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if > you want to attach to screens quickly, use ssh(1), etc. > =20 > The fixes: > =20 > - Cache the cdev_priv of the controlling TTY in struct session. Change > devfs_access() to compare against the cdev_priv instead of the vnode. > This allows you to bypass UNIX permissions, even across different > mounts of devfs. > =20 > - Extend devfs_prison_check() to unconditionally expose the device node > of the controlling TTY, even if normal prison nesting rules normally > don't allow this. This actually allows you to interact with this > device node. > =20 > To be honest, I'm not really happy with this solution. We now have to > store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp). > In an ideal world, we should just get rid of the latter two and only use > s_ttyp, but this makes certian pieces of code very impractical (e.g. > devfs, kern_exit.c). Note that struct devfs_dirent is available as vp->v_data, and devfs_dirent' de_cdp member contains pointer to cdev_priv. I think this would allow to remove s_ttydp. --lQSB8Tqijvu1+4Ba Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkstIYAACgkQC3+MBN1Mb4hR/QCgm8Ov8UdK/Tdm1mSUI0bbDiZD M/QAoLYyMcPUw4NMkDuXze8lMe2FKMQx =gT/U -----END PGP SIGNATURE----- --lQSB8Tqijvu1+4Ba-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 19:01:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7681065694; Sat, 19 Dec 2009 19:01:53 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 4018E8FC1B; Sat, 19 Dec 2009 19:01:53 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 343431CECF; Sat, 19 Dec 2009 20:01:52 +0100 (CET) Date: Sat, 19 Dec 2009 20:01:52 +0100 From: Ed Schouten To: Kostik Belousov Message-ID: <20091219190152.GJ64905@hoeg.nl> References: <200912191842.nBJIgDgP040506@svn.freebsd.org> <20091219185457.GH2170@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fZfO+AAAmBD6aS/A" Content-Disposition: inline In-Reply-To: <20091219185457.GH2170@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200732 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:01:53 -0000 --fZfO+AAAmBD6aS/A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Kostik Belousov wrote: > Note that struct devfs_dirent is available as vp->v_data, and > devfs_dirent' de_cdp member contains pointer to cdev_priv. I think this > would allow to remove s_ttydp. Well, there are lots of fields that could be derived. We could even remove s_ttyp and only use the vnode, because cdp_c.si_drv1 contains a pointer to the TTY. The reason why I didn't choose that approach, was because I'm a bit afraid we get these insanely long chains of pointer dereferences, of which I'm not entirely sure we do the locking properly. Even right now I'm not sure whether we pick up proctree_lock enough. s_ttydp isn't too strict about any form of locking, because its value is only used comparatively. --=20 Ed Schouten WWW: http://80386.nl/ --fZfO+AAAmBD6aS/A Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkstIyAACgkQ52SDGA2eCwW+2QCdFgQyWZZU9OZ0bF3NMst6saQ/ vHIAnA/8vvu5SVGTyg6ndImpHoCTDq4t =3nhx -----END PGP SIGNATURE----- --fZfO+AAAmBD6aS/A-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 20:42:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9701710656C0; Sat, 19 Dec 2009 20:42:56 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85D8C8FC0A; Sat, 19 Dec 2009 20:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJKgubS043227; Sat, 19 Dec 2009 20:42:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJKgu9i043225; Sat, 19 Dec 2009 20:42:56 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912192042.nBJKgu9i043225@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 Dec 2009 20:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200739 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 20:42:56 -0000 Author: marcel Date: Sat Dec 19 20:42:56 2009 New Revision: 200739 URL: http://svn.freebsd.org/changeset/base/200739 Log: Remove a warning in DELAY about large delays. In kern_shutdown.c we use excessive delays quite habitually. Modified: head/sys/powerpc/booke/clock.c Modified: head/sys/powerpc/booke/clock.c ============================================================================== --- head/sys/powerpc/booke/clock.c Sat Dec 19 19:35:53 2009 (r200738) +++ head/sys/powerpc/booke/clock.c Sat Dec 19 20:42:56 2009 (r200739) @@ -197,15 +197,8 @@ DELAY(int n) { u_quad_t start, end, now; -#define USECS_IN_SEC 1000000ULL - - if (n > USECS_IN_SEC) { - printf("WARNING: %s(%d) called from %p", __func__, n, - __builtin_return_address(0)); - } - start = mftb(); - end = start + (u_quad_t)ticks_per_sec / (USECS_IN_SEC / n); + end = start + (u_quad_t)ticks_per_sec / (1000000ULL / n); do { now = mftb(); } while (now < end || (now > start && end < start)); From owner-svn-src-head@FreeBSD.ORG Sat Dec 19 20:45:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E22B1065670; Sat, 19 Dec 2009 20:45:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D46E8FC0C; Sat, 19 Dec 2009 20:45:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJKjOGM043386; Sat, 19 Dec 2009 20:45:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJKjO53043384; Sat, 19 Dec 2009 20:45:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912192045.nBJKjO53043384@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 19 Dec 2009 20:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200740 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 20:45:24 -0000 Author: yongari Date: Sat Dec 19 20:45:23 2009 New Revision: 200740 URL: http://svn.freebsd.org/changeset/base/200740 Log: Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending timer for Tx queue is at 0x3E. Modified: head/sys/dev/vge/if_vgereg.h Modified: head/sys/dev/vge/if_vgereg.h ============================================================================== --- head/sys/dev/vge/if_vgereg.h Sat Dec 19 20:42:56 2009 (r200739) +++ head/sys/dev/vge/if_vgereg.h Sat Dec 19 20:45:23 2009 (r200740) @@ -89,8 +89,8 @@ #define VGE_RXQCSRC 0x36 /* RX queue ctl/status clear */ #define VGE_RXDESC_ADDR_LO 0x38 /* RX desc base addr (lo 32 bits) */ #define VGE_RXDESC_CONSIDX 0x3C /* Current RX descriptor index */ -#define VGE_RXQTIMER 0x3E /* RX queue timer pend register */ -#define VGE_TXQTIMER 0x3F /* TX queue timer pend register */ +#define VGE_TXQTIMER 0x3E /* TX queue timer pend register */ +#define VGE_RXQTIMER 0x3F /* RX queue timer pend register */ #define VGE_TXDESC_ADDR_LO0 0x40 /* TX desc0 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO1 0x44 /* TX desc1 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO2 0x48 /* TX desc2 base addr (lo 32 bits) */