From rodrigc at FreeBSD.org Mon Jun 1 00:40:40 2009 From: rodrigc at FreeBSD.org (Craig Rodrigues) Date: Mon Jun 1 00:40:51 2009 Subject: svn commit: r193191 - head/sbin/mount_nfs Message-ID: <200906010040.n510edH2059058@svn.freebsd.org> Author: rodrigc Date: Mon Jun 1 00:40:39 2009 New Revision: 193191 URL: http://svn.freebsd.org/changeset/base/193191 Log: Code for parsing nmount options in kernel was merged to stable/7 branch in r190315. So only resort to fallback_mount() could which passes struct nfs_args to kernel in kernel versions less than 702100. Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Sun May 31 22:33:53 2009 (r193190) +++ head/sbin/mount_nfs/mount_nfs.c Mon Jun 1 00:40:39 2009 (r193191) @@ -430,7 +430,7 @@ main(int argc, char *argv[]) * struct nfs_args to be passed in via nmount(). */ osversion = getosreldate(); - if (osversion >= 800048) { + if (osversion >= 702100) { if (nmount(iov, iovlen, mntflags)) err(1, "%s, %s", mntpath, errmsg); } else { From rodrigc at FreeBSD.org Mon Jun 1 01:02:31 2009 From: rodrigc at FreeBSD.org (Craig Rodrigues) Date: Mon Jun 1 01:02:37 2009 Subject: svn commit: r193192 - in head/sys: boot/common kern Message-ID: <200906010102.n5112UmB059561@svn.freebsd.org> Author: rodrigc Date: Mon Jun 1 01:02:30 2009 New Revision: 193192 URL: http://svn.freebsd.org/changeset/base/193192 Log: sys/boot/common.c ================= Extend the loader to parse the root file system mount options in /etc/fstab, and set a new loader variable vfs.root.mountfrom.options with these options. The root mount options must be a comma-delimited string, as specified in /etc/fstab. Only set the vfs.root.mountfrom.options variable if it has not been set in the environment. sys/kern/vfs_mount.c ==================== When mounting the root file system, pass the mount options specified in vfs.root.mountfrom.options, but filter out "rw" and "noro", since the initial mount of the root file system must be done as "ro". While we are here, try to add a few hints to the mountroot prompt to give users and idea what might of gone wrong during mounting of the root file system. Reviewed by: jhb (an earlier patch) Modified: head/sys/boot/common/boot.c head/sys/kern/vfs_mount.c Modified: head/sys/boot/common/boot.c ============================================================================== --- head/sys/boot/common/boot.c Mon Jun 1 00:40:39 2009 (r193191) +++ head/sys/boot/common/boot.c Mon Jun 1 01:02:30 2009 (r193192) @@ -287,7 +287,7 @@ getbootfile(int try) int getrootmount(char *rootdev) { - char lbuf[128], *cp, *ep, *dev, *fstyp; + char lbuf[128], *cp, *ep, *dev, *fstyp, *options; int fd, error; if (getenv("vfs.root.mountfrom") != NULL) @@ -331,11 +331,30 @@ getrootmount(char *rootdev) *cp = 0; fstyp = strdup(ep); - /* build the final result and save it */ + /* skip whitespace up to mount options */ + cp += 1; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of mount options and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + options = strdup(ep); + /* Build the : and save it in vfs.root.mountfrom */ sprintf(lbuf, "%s:%s", fstyp, dev); free(dev); free(fstyp); setenv("vfs.root.mountfrom", lbuf, 0); + + /* Don't override vfs.root.mountfrom.options if it is already set */ + if (getenv("vfs.root.mountfrom.options") == NULL) { + /* save mount options */ + setenv("vfs.root.mountfrom.options", options, 0); + } + free(options); error = 0; break; } Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Jun 1 00:40:39 2009 (r193191) +++ head/sys/kern/vfs_mount.c Mon Jun 1 01:02:30 2009 (r193192) @@ -77,7 +77,7 @@ static void set_rootvnode(void); static int vfs_domount(struct thread *td, const char *fstype, char *fspath, int fsflags, void *fsdata); static int vfs_mountroot_ask(void); -static int vfs_mountroot_try(const char *mountfrom); +static int vfs_mountroot_try(const char *mountfrom, const char *options); static void free_mntarg(struct mntarg *ma); static int usermount = 0; @@ -110,6 +110,10 @@ struct vnode *rootvnode; * of being mounted as root * path := disk device name or other data used by the filesystem * to locate its physical store + * + * The environment variable vfs.root.mountfrom options is a comma delimited + * set of string mount options. These mount options must be parseable + * by nmount() in the kernel. */ /* @@ -1637,9 +1641,11 @@ vfs_opterror(struct vfsoptlist *opts, co void vfs_mountroot(void) { - char *cp; + char *cp, *options; int error, i, asked = 0; + options = NULL; + root_mount_prepare(); mount_zone = uma_zcreate("Mountpoints", sizeof(struct mount), @@ -1656,12 +1662,14 @@ vfs_mountroot(void) asked = 1; } + options = getenv("vfs.root.mountfrom.options"); + /* * The root filesystem information is compiled in, and we are * booted with instructions to use it. */ if (ctrootdevname != NULL && (boothowto & RB_DFLTROOT)) { - if (!vfs_mountroot_try(ctrootdevname)) + if (!vfs_mountroot_try(ctrootdevname, options)) goto mounted; ctrootdevname = NULL; } @@ -1673,7 +1681,7 @@ vfs_mountroot(void) */ if (boothowto & RB_CDROM) { for (i = 0; cdrom_rootdevnames[i] != NULL; i++) { - if (!vfs_mountroot_try(cdrom_rootdevnames[i])) + if (!vfs_mountroot_try(cdrom_rootdevnames[i], options)) goto mounted; } } @@ -1685,7 +1693,7 @@ vfs_mountroot(void) */ cp = getenv("vfs.root.mountfrom"); if (cp != NULL) { - error = vfs_mountroot_try(cp); + error = vfs_mountroot_try(cp, options); freeenv(cp); if (!error) goto mounted; @@ -1694,16 +1702,16 @@ vfs_mountroot(void) /* * Try values that may have been computed by code during boot */ - if (!vfs_mountroot_try(rootdevnames[0])) + if (!vfs_mountroot_try(rootdevnames[0], options)) goto mounted; - if (!vfs_mountroot_try(rootdevnames[1])) + if (!vfs_mountroot_try(rootdevnames[1], options)) goto mounted; /* * If we (still) have a compiled-in default, try it. */ if (ctrootdevname != NULL) - if (!vfs_mountroot_try(ctrootdevname)) + if (!vfs_mountroot_try(ctrootdevname, options)) goto mounted; /* * Everything so far has failed, prompt on the console if we haven't @@ -1717,24 +1725,75 @@ vfs_mountroot(void) mounted: root_mount_done(); + freeenv(options); +} + +static struct mntarg * +parse_mountroot_options(struct mntarg *ma, const char *options) +{ + char *p; + char *name, *name_arg; + char *val, *val_arg; + char *opts; + + if (options == NULL || options[0] == '\0') + return (ma); + + p = opts = strdup(options, M_MOUNT); + if (opts == NULL) { + return (ma); + } + + while((name = strsep(&p, ",")) != NULL) { + if (name[0] == '\0') + break; + + val = strchr(name, '='); + if (val != NULL) { + *val = '\0'; + ++val; + } + if( strcmp(name, "rw") == 0 || + strcmp(name, "noro") == 0) { + /* + * The first time we mount the root file system, + * we need to mount 'ro', so We need to ignore + * 'rw' and 'noro' mount options. + */ + continue; + } + name_arg = strdup(name, M_MOUNT); + val_arg = NULL; + if (val != NULL) + val_arg = strdup(val, M_MOUNT); + + ma = mount_arg(ma, name_arg, val_arg, + (val_arg != NULL ? -1 : 0)); + } + free(opts, M_MOUNT); + return (ma); } /* * Mount (mountfrom) as the root filesystem. */ static int -vfs_mountroot_try(const char *mountfrom) +vfs_mountroot_try(const char *mountfrom, const char *options) { struct mount *mp; + struct mntarg *ma; char *vfsname, *path; time_t timebase; int error; char patt[32]; + char errmsg[255]; vfsname = NULL; path = NULL; mp = NULL; + ma = NULL; error = EINVAL; + bzero(errmsg, sizeof(errmsg)); if (mountfrom == NULL) return (error); /* don't complain */ @@ -1751,12 +1810,14 @@ vfs_mountroot_try(const char *mountfrom) if (path[0] == '\0') strcpy(path, ROOTNAME); - error = kernel_vmount( - MNT_RDONLY | MNT_ROOTFS, - "fstype", vfsname, - "fspath", "/", - "from", path, - NULL); + ma = mount_arg(ma, "fstype", vfsname, -1); + ma = mount_arg(ma, "fspath", "/", -1); + ma = mount_arg(ma, "from", path, -1); + ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg)); + ma = mount_arg(ma, "ro", NULL, 0); + ma = parse_mountroot_options(ma, options); + error = kernel_mount(ma, MNT_ROOTFS); + if (error == 0) { /* * We mount devfs prior to mounting the / FS, so the first @@ -1783,6 +1844,16 @@ vfs_mountroot_try(const char *mountfrom) devfs_fixup(curthread); } + + if (error != 0 ) { + printf("ROOT MOUNT ERROR: %s\n", errmsg); + printf("If you have invalid mount options, reboot, and "); + printf("first try the following from\n"); + printf("the loader prompt:\n\n"); + printf(" set vfs.root.mountfrom.options=rw\n\n"); + printf("and then remove invalid mount options from "); + printf("/etc/fstab.\n\n"); + } out: free(path, M_MOUNT); free(vfsname, M_MOUNT); @@ -1798,15 +1869,32 @@ static int vfs_mountroot_ask(void) { char name[128]; + char *mountfrom; + char *options; for(;;) { + printf("Loader variables:\n"); + printf("vfs.root.mountfrom="); + mountfrom = getenv("vfs.root.mountfrom"); + if (mountfrom != NULL) { + printf("%s", mountfrom); + } + printf("\n"); + printf("vfs.root.mountfrom.options="); + options = getenv("vfs.root.mountfrom.options"); + if (options != NULL) { + printf("%s", options); + } + printf("\n"); + freeenv(mountfrom); + freeenv(options); printf("\nManual root filesystem specification:\n"); printf(" : Mount using filesystem \n"); -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) - printf(" eg. ufs:da0s1a\n"); -#else - printf(" eg. ufs:/dev/da0a\n"); -#endif + printf(" eg. ufs:/dev/da0s1a\n"); + printf(" eg. cd9660:/dev/acd0\n"); + printf(" This is equivalent to: "); + printf("mount -t cd9660 /dev/acd0 /\n"); + printf("\n"); printf(" ? List valid disk boot devices\n"); printf(" Abort manual input\n"); printf("\nmountroot> "); @@ -1818,7 +1906,7 @@ vfs_mountroot_ask(void) g_dev_print(); continue; } - if (!vfs_mountroot_try(name)) + if (!vfs_mountroot_try(name, NULL)) return (0); } } From weongyo at FreeBSD.org Mon Jun 1 01:51:38 2009 From: weongyo at FreeBSD.org (Weongyo Jeong) Date: Mon Jun 1 01:51:50 2009 Subject: svn commit: r193194 - head/sys/dev/usb/wlan Message-ID: <200906010151.n511pbMb060570@svn.freebsd.org> Author: weongyo Date: Mon Jun 1 01:51:37 2009 New Revision: 193194 URL: http://svn.freebsd.org/changeset/base/193194 Log: ZyXEL G-202 has zd1211b chipset, not zd1211. Tested by: Samuel Boivie Modified: head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Mon Jun 1 01:42:56 2009 (r193193) +++ head/sys/dev/usb/wlan/if_zyd.c Mon Jun 1 01:51:37 2009 (r193194) @@ -232,7 +232,6 @@ static const struct usb_device_id zyd_de {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_AG225H, ZYD_ZD1211)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_ZYAIRG220, ZYD_ZD1211)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G200V2, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G202, ZYD_ZD1211)}, /* ZYD_ZD1211B */ {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_SMCWUSBG, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_ZD1211B, ZYD_ZD1211B)}, @@ -252,6 +251,7 @@ static const struct usb_device_id zyd_de {USB_VPI(USB_VENDOR_ZCOM, USB_PRODUCT_ZCOM_ZD1211B, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ZYDAS, USB_PRODUCT_ZYDAS_ZD1211B, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_M202, ZYD_ZD1211B)}, + {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G202, ZYD_ZD1211B)}, {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G220V2, ZYD_ZD1211B)}, }; From weongyo at FreeBSD.org Mon Jun 1 02:37:07 2009 From: weongyo at FreeBSD.org (Weongyo Jeong) Date: Mon Jun 1 02:37:13 2009 Subject: svn commit: r193195 - head/sys/modules/usb Message-ID: <200906010237.n512b6Qc061550@svn.freebsd.org> Author: weongyo Date: Mon Jun 1 02:37:06 2009 New Revision: 193195 URL: http://svn.freebsd.org/changeset/base/193195 Log: connect urtw(4) to the amd64/i386 build that it's not tested on the big endian machines yet. Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Jun 1 01:51:37 2009 (r193194) +++ head/sys/modules/usb/Makefile Mon Jun 1 02:37:06 2009 (r193195) @@ -27,7 +27,7 @@ SUBDIR = usb SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} -SUBDIR += rum uath upgt ural zyd +SUBDIR += rum uath upgt ural zyd ${_urtw} SUBDIR += uhid ukbd ums udbp ufm SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umodem umoscom uplcom uslcom uvisor uvscom @@ -35,9 +35,17 @@ SUBDIR += uether aue axe cdce cue kue ru SUBDIR += usfs umass urio SUBDIR += quirk template +.if ${MACHINE_ARCH} == "amd64" +_urtw= urtw +.endif + .if ${MACHINE_ARCH} == "arm" _at91dci= at91dci _atmegadci= atmegadci .endif +.if ${MACHINE_ARCH} == "i386" +_urtw= urtw +.endif + .include From dougb at FreeBSD.org Mon Jun 1 04:55:14 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 04:55:25 2009 Subject: svn commit: r193197 - head/etc/rc.d Message-ID: <200906010455.n514tDRb064417@svn.freebsd.org> Author: dougb Date: Mon Jun 1 04:55:13 2009 New Revision: 193197 URL: http://svn.freebsd.org/changeset/base/193197 Log: Substitute ypset for ypbind in REQUIRE lines. If you use ypset it has to happen right after ypbind, and before anything that uses NIS. The only change in rcorder accomplished by this patch is make that happen. PR: conf/117555 Submitted by: John Marshall Modified: head/etc/rc.d/amd head/etc/rc.d/keyserv head/etc/rc.d/nisdomain head/etc/rc.d/quota head/etc/rc.d/yppasswdd Modified: head/etc/rc.d/amd ============================================================================== --- head/etc/rc.d/amd Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/amd Mon Jun 1 04:55:13 2009 (r193197) @@ -4,7 +4,7 @@ # # PROVIDE: amd -# REQUIRE: rpcbind ypbind nfsclient cleanvar ldconfig +# REQUIRE: rpcbind ypset nfsclient cleanvar ldconfig # BEFORE: DAEMON # KEYWORD: nojail shutdown Modified: head/etc/rc.d/keyserv ============================================================================== --- head/etc/rc.d/keyserv Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/keyserv Mon Jun 1 04:55:13 2009 (r193197) @@ -6,7 +6,7 @@ # Start keyserv if we are running Secure RPC # PROVIDE: keyserv -# REQUIRE: ypbind +# REQUIRE: ypset # BEFORE: DAEMON # KEYWORD: shutdown Modified: head/etc/rc.d/nisdomain ============================================================================== --- head/etc/rc.d/nisdomain Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/nisdomain Mon Jun 1 04:55:13 2009 (r193197) @@ -28,7 +28,7 @@ # PROVIDE: nisdomain # REQUIRE: SERVERS rpcbind -# BEFORE: ypbind ypserv ypxfrd +# BEFORE: ypset ypbind ypserv ypxfrd . /etc/rc.subr Modified: head/etc/rc.d/quota ============================================================================== --- head/etc/rc.d/quota Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/quota Mon Jun 1 04:55:13 2009 (r193197) @@ -6,7 +6,7 @@ # Enable/Check the quotas (must be after ypbind if using NIS) # PROVIDE: quota -# REQUIRE: mountcritremote +# REQUIRE: mountcritremote ypset # BEFORE: DAEMON # KEYWORD: nojail Modified: head/etc/rc.d/yppasswdd ============================================================================== --- head/etc/rc.d/yppasswdd Mon Jun 1 04:44:43 2009 (r193196) +++ head/etc/rc.d/yppasswdd Mon Jun 1 04:55:13 2009 (r193197) @@ -4,7 +4,7 @@ # # PROVIDE: yppasswdd -# REQUIRE: ypserv ypbind +# REQUIRE: ypserv ypset # BEFORE: LOGIN # KEYWORD: shutdown From danfe at FreeBSD.org Mon Jun 1 05:06:41 2009 From: danfe at FreeBSD.org (Alexey Dokuchaev) Date: Mon Jun 1 05:06:47 2009 Subject: svn commit: r193184 - in head/sys/dev/syscons: . teken In-Reply-To: <200905311935.n4VJZfhl053022@svn.freebsd.org> References: <200905311935.n4VJZfhl053022@svn.freebsd.org> Message-ID: <20090601050625.GA98269@FreeBSD.org> On Sun, May 31, 2009 at 07:35:41PM +0000, Ed Schouten wrote: > Author: ed > Date: Sun May 31 19:35:41 2009 > New Revision: 193184 > URL: http://svn.freebsd.org/changeset/base/193184 > > Log: > Restore support for bell pitch/duration. > > Because we only support a single argument to tf_param, use 16 bits for > the pitch and 16 bits for the duration. While there, make the argument > unsigned. There isn't a single param call that needs a signed integer. > > Submitted by: danfe (modified) Thanks! ./danfe From dougb at FreeBSD.org Mon Jun 1 05:35:05 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 05:35:11 2009 Subject: svn commit: r193198 - head/etc/rc.d Message-ID: <200906010535.n515Z4qK065272@svn.freebsd.org> Author: dougb Date: Mon Jun 1 05:35:03 2009 New Revision: 193198 URL: http://svn.freebsd.org/changeset/base/193198 Log: Make the pf and ipfw firewalls start before netif, just like ipfilter already does. This eliminates a logical inconsistency, and a small window where the system is open after the network comes up. Modified: head/etc/rc.d/ip6fw head/etc/rc.d/ipfilter head/etc/rc.d/ipfs head/etc/rc.d/ipfw head/etc/rc.d/ipnat head/etc/rc.d/netif head/etc/rc.d/network_ipv6 head/etc/rc.d/pf head/etc/rc.d/pflog head/etc/rc.d/pfsync Modified: head/etc/rc.d/ip6fw ============================================================================== --- head/etc/rc.d/ip6fw Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ip6fw Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ip6fw # REQUIRE: routing -# BEFORE: network_ipv6 # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/ipfilter ============================================================================== --- head/etc/rc.d/ipfilter Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipfilter Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ipfilter # REQUIRE: FILESYSTEMS -# BEFORE: netif # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/ipfs ============================================================================== --- head/etc/rc.d/ipfs Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipfs Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ipfs # REQUIRE: ipnat -# BEFORE: netif # KEYWORD: nojail shutdown . /etc/rc.subr Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipfw Mon Jun 1 05:35:03 2009 (r193198) @@ -4,8 +4,7 @@ # # PROVIDE: ipfw -# REQUIRE: ppp -# BEFORE: NETWORKING +# REQUIRE: FILESYSTEMS # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/ipnat ============================================================================== --- head/etc/rc.d/ipnat Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/ipnat Mon Jun 1 05:35:03 2009 (r193198) @@ -5,7 +5,6 @@ # PROVIDE: ipnat # REQUIRE: ipfilter -# BEFORE: DAEMON netif # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/netif Mon Jun 1 05:35:03 2009 (r193198) @@ -26,7 +26,8 @@ # # PROVIDE: netif -# REQUIRE: atm1 cleanvar ipfilter FILESYSTEMS serial sppp sysctl +# REQUIRE: atm1 cleanvar FILESYSTEMS serial sppp sysctl +# REQUIRE: ipfilter ipfs pf ipfw # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/network_ipv6 ============================================================================== --- head/etc/rc.d/network_ipv6 Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/network_ipv6 Mon Jun 1 05:35:03 2009 (r193198) @@ -29,7 +29,7 @@ # # PROVIDE: network_ipv6 -# REQUIRE: routing +# REQUIRE: routing ip6fw # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/pf Mon Jun 1 05:35:03 2009 (r193198) @@ -4,7 +4,7 @@ # # PROVIDE: pf -# REQUIRE: FILESYSTEMS netif pflog pfsync +# REQUIRE: FILESYSTEMS pflog pfsync # BEFORE: routing # KEYWORD: nojail Modified: head/etc/rc.d/pflog ============================================================================== --- head/etc/rc.d/pflog Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/pflog Mon Jun 1 05:35:03 2009 (r193198) @@ -4,7 +4,7 @@ # # PROVIDE: pflog -# REQUIRE: FILESYSTEMS netif cleanvar +# REQUIRE: FILESYSTEMS cleanvar # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/pfsync ============================================================================== --- head/etc/rc.d/pfsync Mon Jun 1 04:55:13 2009 (r193197) +++ head/etc/rc.d/pfsync Mon Jun 1 05:35:03 2009 (r193198) @@ -4,7 +4,7 @@ # # PROVIDE: pfsync -# REQUIRE: FILESYSTEMS netif +# REQUIRE: FILESYSTEMS # KEYWORD: nojail . /etc/rc.subr From dougb at FreeBSD.org Mon Jun 1 05:37:14 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 05:37:19 2009 Subject: svn commit: r193199 - head/etc Message-ID: <200906010537.n515bDou065357@svn.freebsd.org> Author: dougb Date: Mon Jun 1 05:37:13 2009 New Revision: 193199 URL: http://svn.freebsd.org/changeset/base/193199 Log: Eliminate the warning that "Values of network_interfaces other than AUTO are deprecated.' There is no good reason to deprecate them, and setting this to different values can be useful for custom solutions and/or one-off configuration problems. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Jun 1 05:35:03 2009 (r193198) +++ head/etc/network.subr Mon Jun 1 05:37:13 2009 (r193199) @@ -726,10 +726,6 @@ list_net_interfaces() _tmplist="${_lo}${_tmplist}" ;; *) - if [ -z "$type" ]; then - warn "Values of network_interfaces other than" \ - "AUTO are deprecated" - fi _tmplist="${network_interfaces} ${cloned_interfaces}" ;; esac From alc at FreeBSD.org Mon Jun 1 06:12:09 2009 From: alc at FreeBSD.org (Alan Cox) Date: Mon Jun 1 06:12:21 2009 Subject: svn commit: r193201 - head/sys/kern Message-ID: <200906010612.n516C89j066174@svn.freebsd.org> Author: alc Date: Mon Jun 1 06:12:08 2009 New Revision: 193201 URL: http://svn.freebsd.org/changeset/base/193201 Log: Eliminate a comment describing code that was deleted over eight years ago. Move another comment to its proper place. Fix a typo in a third comment. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Jun 1 05:48:30 2009 (r193200) +++ head/sys/kern/vfs_bio.c Mon Jun 1 06:12:08 2009 (r193201) @@ -638,13 +638,6 @@ bufinit(void) hifreebuffers = 2 * lofreebuffers; numfreebuffers = nbuf; -/* - * Maximum number of async ops initiated per buf_daemon loop. This is - * somewhat of a hack at the moment, we really need to limit ourselves - * based on the number of bytes of I/O in-transit that were initiated - * from buf_daemon. - */ - bogus_page = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | VM_ALLOC_WIRED); } @@ -1202,7 +1195,7 @@ brelse(struct buf *bp) /* * Failed write, redirty. Must clear BIO_ERROR to prevent * pages from being scrapped. If the error is anything - * other than an I/O error (EIO), assume that retryingi + * other than an I/O error (EIO), assume that retrying * is futile. */ bp->b_ioflags &= ~BIO_ERROR; @@ -2403,15 +2396,9 @@ vfs_setdirty(struct buf *bp) /* * Degenerate case - empty buffer */ - if (bp->b_bufsize == 0) return; - /* - * We qualify the scan for modified pages on whether the - * object has been flushed yet. - */ - if ((bp->b_flags & B_VMIO) == 0) return; @@ -2428,6 +2415,11 @@ vfs_setdirty_locked_object(struct buf *b object = bp->b_bufobj->bo_object; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + + /* + * We qualify the scan for modified pages on whether the + * object has been flushed yet. + */ if (object->flags & (OBJ_MIGHTBEDIRTY|OBJ_CLEANING)) { vm_offset_t boffset; vm_offset_t eoffset; From bzeeb-lists at lists.zabbadoz.net Mon Jun 1 06:30:13 2009 From: bzeeb-lists at lists.zabbadoz.net (Bjoern A. Zeeb) Date: Mon Jun 1 06:30:19 2009 Subject: svn commit: r193198 - head/etc/rc.d In-Reply-To: <200906010535.n515Z4qK065272@svn.freebsd.org> References: <200906010535.n515Z4qK065272@svn.freebsd.org> Message-ID: <20090601062701.C12292@maildrop.int.zabbadoz.net> On Mon, 1 Jun 2009, Doug Barton wrote: > Author: dougb > Date: Mon Jun 1 05:35:03 2009 > New Revision: 193198 > URL: http://svn.freebsd.org/changeset/base/193198 > > Log: > Make the pf and ipfw firewalls start before netif, just like ipfilter > already does. This eliminates a logical inconsistency, and a small > window where the system is open after the network comes up. Unfortunetaly this is contrary to a lot of PRs and requests on mailing lists out there that actually want the netif/network_ipv6 to be run _before_ things come up. Espescially pf really needs this to avoid rules that needs to do per paket lookups of the interface address. Further ipfw has a default option being setaable at compile time and as TUNABLE to handle this window. -- Bjoern A. Zeeb The greatest risk is not taking one. From dougb at FreeBSD.org Mon Jun 1 06:31:05 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 06:31:16 2009 Subject: svn commit: r193202 - head/contrib/bind9/lib/isc/ia64/include/isc Message-ID: <200906010631.n516V4b9066643@svn.freebsd.org> Author: dougb Date: Mon Jun 1 06:31:04 2009 New Revision: 193202 URL: http://svn.freebsd.org/changeset/base/193202 Log: Local hack to get the build going again while ISC works on a more permanent solution for 9.6.1-release. "My suggestion is to remove the whole attribute construct. It only suppresses a warning when a function is unused. In this case the function is defined as inline, so it's not causing a warning when not used." Submitted by: marcel Modified: head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Modified: head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h ============================================================================== --- head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Jun 1 06:12:08 2009 (r193201) +++ head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Jun 1 06:31:04 2009 (r193202) @@ -32,9 +32,6 @@ */ static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif { isc_int32_t prev, swapped; @@ -58,9 +55,6 @@ __attribute__ ((unused)) */ static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif { __asm__ volatile( "st4.rel %0=%1" @@ -77,9 +71,6 @@ __attribute__ ((unused)) */ static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) -#ifdef __GNUC__ -__attribute__ ((unused)) -#endif { isc_int32_t ret; From max at love2party.net Mon Jun 1 06:32:41 2009 From: max at love2party.net (Max Laier) Date: Mon Jun 1 06:32:47 2009 Subject: svn commit: r193198 - head/etc/rc.d In-Reply-To: <200906010535.n515Z4qK065272@svn.freebsd.org> References: <200906010535.n515Z4qK065272@svn.freebsd.org> Message-ID: <200906010820.03864.max@love2party.net> On Monday 01 June 2009 07:35:03 Doug Barton wrote: > Author: dougb > Date: Mon Jun 1 05:35:03 2009 > New Revision: 193198 > URL: http://svn.freebsd.org/changeset/base/193198 > > Log: > Make the pf and ipfw firewalls start before netif, just like ipfilter > already does. This eliminates a logical inconsistency, and a small > window where the system is open after the network comes up. Can you please add a note about this in UPDATING? It might be a slight POLA violation for people who rely on the interfaces being configured to setup the firewall. For instance when one doesn't use dynamic address rules in pf i.e. "from/to ifX" instead of "from/to (ifX)". > Modified: > head/etc/rc.d/ip6fw > head/etc/rc.d/ipfilter > head/etc/rc.d/ipfs > head/etc/rc.d/ipfw > head/etc/rc.d/ipnat > head/etc/rc.d/netif > head/etc/rc.d/network_ipv6 > head/etc/rc.d/pf > head/etc/rc.d/pflog > head/etc/rc.d/pfsync -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From bzeeb-lists at lists.zabbadoz.net Mon Jun 1 06:40:07 2009 From: bzeeb-lists at lists.zabbadoz.net (Bjoern A. Zeeb) Date: Mon Jun 1 06:40:19 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <200906010537.n515bDou065357@svn.freebsd.org> References: <200906010537.n515bDou065357@svn.freebsd.org> Message-ID: <20090601063455.R12292@maildrop.int.zabbadoz.net> On Mon, 1 Jun 2009, Doug Barton wrote: > Author: dougb > Date: Mon Jun 1 05:37:13 2009 > New Revision: 193199 > URL: http://svn.freebsd.org/changeset/base/193199 > > Log: > Eliminate the warning that "Values of network_interfaces other than > AUTO are deprecated.' There is no good reason to deprecate them, and > setting this to different values can be useful for custom solutions > and/or one-off configuration problems. There used to be adisucssion about this last year. I think you would have wanted to talk to brooks before who had put this in: http://lists.freebsd.org/pipermail/cvs-all/2008-July/thread.html#263409 > Modified: > head/etc/network.subr > > Modified: head/etc/network.subr > ============================================================================== > --- head/etc/network.subr Mon Jun 1 05:35:03 2009 (r193198) > +++ head/etc/network.subr Mon Jun 1 05:37:13 2009 (r193199) > @@ -726,10 +726,6 @@ list_net_interfaces() > _tmplist="${_lo}${_tmplist}" > ;; > *) > - if [ -z "$type" ]; then > - warn "Values of network_interfaces other than" \ > - "AUTO are deprecated" > - fi > _tmplist="${network_interfaces} ${cloned_interfaces}" > ;; > esac > -- Bjoern A. Zeeb The greatest risk is not taking one. From hselasky at c2i.net Mon Jun 1 06:45:33 2009 From: hselasky at c2i.net (Hans Petter Selasky) Date: Mon Jun 1 06:45:39 2009 Subject: svn commit: r192925 - in head/sys/dev/usb: . input In-Reply-To: References: <200905271927.n4RJRUH8009289@svn.freebsd.org> Message-ID: <200906010749.37072.hselasky@c2i.net> On Monday 01 June 2009, Rui Paulo wrote: > http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649eaddf >2fed595 Hi Rui Paulo, Regarding the eject button, can you have a look at: /sys/dev/usb/input/ukbd.c And provide a patch that masks this key the way you want? Debugging: sysctl hw.usb.ukbd.debug=15 --HPS From jmallett at FreeBSD.org Mon Jun 1 06:49:10 2009 From: jmallett at FreeBSD.org (Juli Mallett) Date: Mon Jun 1 06:49:16 2009 Subject: svn commit: r193203 - head/usr.sbin/tcpdrop Message-ID: <200906010649.n516n9IE067053@svn.freebsd.org> Author: jmallett Date: Mon Jun 1 06:49:09 2009 New Revision: 193203 URL: http://svn.freebsd.org/changeset/base/193203 Log: o) Restructure tcpdrop(8) to provide a facility to try to drop all established connections. Including a flag to instead output a sequence of tcpdrop(8) invocations that would accomplish the same thing, which is convenient for scripting. o) Make tcpdrop complain if the addresses given to it are entirely in different address families, rather than failing silently. o) When cross-referencing httpd(8), do not explicitly specify the apache2 port, since the example in question is generic. Modified: head/usr.sbin/tcpdrop/tcpdrop.8 head/usr.sbin/tcpdrop/tcpdrop.c Modified: head/usr.sbin/tcpdrop/tcpdrop.8 ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.8 Mon Jun 1 06:31:04 2009 (r193202) +++ head/usr.sbin/tcpdrop/tcpdrop.8 Mon Jun 1 06:49:09 2009 (r193203) @@ -1,5 +1,6 @@ .\" $OpenBSD: tcpdrop.8,v 1.5 2004/05/24 13:57:31 jmc Exp $ .\" +.\" Copyright (c) 2009 Juli Mallett .\" Copyright (c) 2004 Markus Friedl .\" .\" Permission to use, copy, modify, and distribute this software for any @@ -16,35 +17,58 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2004 +.Dd March 24, 2009 .Dt TCPDROP 8 .Os .Sh NAME .Nm tcpdrop -.Nd drop a TCP connection +.Nd drop TCP connections .Sh SYNOPSIS .Nm tcpdrop -.Ar laddr -.Ar lport -.Ar faddr -.Ar fport +.Ar local-address +.Ar local-port +.Ar foreign-address +.Ar foreign-port +.Nm tcpdrop +.Op Fl l +.Fl a .Sh DESCRIPTION The .Nm -command drops the TCP connection specified by the local address -.Ar laddr , +command may be used to drop TCP connections from the command line. +.Pp +If +.Fl a +is specified then +.Nm +will attempt to drop all active connections. +The +.Fl l +flag may be given to list the tcpdrop invocation to drop all active +connections one at a time. +.Pp +If +.Fl a +is not specified then only the connection between the given local +address +.Ar local-address , port -.Ar lport +.Ar local-port , and the foreign address -.Ar faddr , +.Ar foreign-address , port -.Ar fport . -Addresses and ports can be specified by name or numeric value. +.Ar foreign-port , +will be dropped. +.Pp +Addresses and ports may be specified by name or numeric value. +Both IPv4 and IPv6 address formats are supported. +.Nm +in case of success or failure. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES If a connection to -.Xr httpd 8 Pq Pa ports/www/apache2 +.Xr httpd 8 is causing congestion on a network link, one can drop the TCP session in charge: .Bd -literal -offset indent @@ -57,8 +81,16 @@ The following command will drop the conn .Bd -literal -offset indent # tcpdrop 192.168.5.41 80 192.168.5.1 26747 .Ed +.Pp +The following command will drop all connections but those to or from +port 22, the port used by +.Xr sshd 8 : +.Bd -literal -offset indent +# tcpdrop -l -a | grep -vw 22 | sh +.Ed .Sh SEE ALSO .Xr netstat 1 , .Xr sockstat 1 .Sh AUTHORS .An Markus Friedl Aq markus@openbsd.org +.An Juli Mallett Aq jmallett@FreeBSD.org Modified: head/usr.sbin/tcpdrop/tcpdrop.c ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.c Mon Jun 1 06:31:04 2009 (r193202) +++ head/usr.sbin/tcpdrop/tcpdrop.c Mon Jun 1 06:49:09 2009 (r193203) @@ -1,6 +1,7 @@ /* $OpenBSD: tcpdrop.c,v 1.4 2004/05/22 23:55:22 deraadt Exp $ */ /*- + * Copyright (c) 2009 Juli Mallett * Copyright (c) 2004 Markus Friedl * * Permission to use, copy, modify, and distribute this software for any @@ -21,15 +22,41 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include + +#include +#define TCPSTATES +#include #include #include #include +#include #include #include #include +#include + +#define TCPDROP_FOREIGN 0 +#define TCPDROP_LOCAL 1 + +struct host_service { + char hs_host[NI_MAXHOST]; + char hs_service[NI_MAXSERV]; +}; + +static bool tcpdrop_list_commands = false; + +static struct xinpgen *getxpcblist(const char *); +static void sockinfo(const struct sockaddr *, struct host_service *); +static bool tcpdrop(const struct sockaddr *, const struct sockaddr *); +static bool tcpdropall(void); +static bool tcpdropbyname(const char *, const char *, const char *, + const char *); +static bool tcpdropconn(const struct in_conninfo *); +static void usage(void); /* * Drop a tcp connection. @@ -37,55 +64,259 @@ __FBSDID("$FreeBSD$"); int main(int argc, char *argv[]) { - struct addrinfo hints, *ail, *aif, *laddr, *faddr; - /* addrs[0] is a foreign socket, addrs[1] is a local one. */ - struct sockaddr_storage addrs[2]; - int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_DROP }; - int gaierr, rval = 0; - char fhbuf[NI_MAXHOST], fsbuf[NI_MAXSERV], lhbuf[NI_MAXHOST], - lsbuf[NI_MAXSERV]; + bool dropall; + int ch; + + dropall = false; + + while ((ch = getopt(argc, argv, "al")) != -1) { + switch (ch) { + case 'a': + dropall = true; + break; + case 'l': + tcpdrop_list_commands = true; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (dropall) { + if (argc != 0) + usage(); + if (!tcpdropall()) + exit(1); + exit(0); + } - if (argc != 5) { - fprintf(stderr, "usage: tcpdrop laddr lport faddr fport\n"); + if (argc != 4 || tcpdrop_list_commands) + usage(); + + if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3])) exit(1); + + exit(0); +} + +static struct xinpgen * +getxpcblist(const char *name) +{ + struct xinpgen *xinp; + size_t len; + int rv; + + len = 0; + rv = sysctlbyname(name, NULL, &len, NULL, 0); + if (rv == -1) + err(1, "sysctlbyname %s", name); + + if (len == 0) + errx(1, "%s is empty", name); + + xinp = malloc(len); + if (xinp == NULL) + errx(1, "malloc failed"); + + rv = sysctlbyname(name, xinp, &len, NULL, 0); + if (rv == -1) + err(1, "sysctlbyname %s", name); + + return (xinp); +} + +static void +sockinfo(const struct sockaddr *sa, struct host_service *hs) +{ + static const int flags = NI_NUMERICHOST | NI_NUMERICSERV; + int rv; + + rv = getnameinfo(sa, sa->sa_len, hs->hs_host, sizeof hs->hs_host, + hs->hs_service, sizeof hs->hs_service, flags); + if (rv == -1) + err(1, "getnameinfo"); +} + +static bool +tcpdrop(const struct sockaddr *lsa, const struct sockaddr *fsa) +{ + struct host_service local, foreign; + struct sockaddr_storage addrs[2]; + int rv; + + memcpy(&addrs[TCPDROP_FOREIGN], fsa, fsa->sa_len); + memcpy(&addrs[TCPDROP_LOCAL], lsa, lsa->sa_len); + + sockinfo(lsa, &local); + sockinfo(fsa, &foreign); + + if (tcpdrop_list_commands) { + printf("tcpdrop %s %s %s %s\n", local.hs_host, local.hs_service, + foreign.hs_host, foreign.hs_service); + return (true); + } + + rv = sysctlbyname("net.inet.tcp.drop", NULL, NULL, &addrs, + sizeof addrs); + if (rv == -1) { + warn("%s %s %s %s", local.hs_host, local.hs_service, + foreign.hs_host, foreign.hs_service); + return (false); + } + printf("%s %s %s %s: dropped\n", local.hs_host, local.hs_service, + foreign.hs_host, foreign.hs_service); + return (true); +} + +static bool +tcpdropall(void) +{ + struct xinpgen *head, *xinp; + struct xtcpcb *xpcb; + struct tcpcb *tp; + struct inpcb *inp; + bool ok; + + ok = true; + + head = getxpcblist("net.inet.tcp.pcblist"); + +#define XINP_NEXT(xinp) \ + ((struct xinpgen *)((uintptr_t)(xinp) + (xinp)->xig_len)) + + for (xinp = XINP_NEXT(head); xinp->xig_len > sizeof *xinp; + xinp = XINP_NEXT(xinp)) { + xpcb = (struct xtcpcb *)xinp; + tp = &xpcb->xt_tp; + inp = &xpcb->xt_inp; + + /* + * XXX + * Check protocol, support just v4 or v6, etc. + */ + + /* Ignore PCBs which were freed during copyout. */ + if (inp->inp_gencnt > head->xig_gen) + continue; + + /* Skip listening sockets. */ + if (tp->t_state == TCPS_LISTEN) + continue; + + if (!tcpdropconn(&inp->inp_inc)) + ok = false; } - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - if ((gaierr = getaddrinfo(argv[1], argv[2], &hints, &laddr)) != 0) - errx(1, "%s port %s: %s", argv[1], argv[2], - gai_strerror(gaierr)); - if ((gaierr = getaddrinfo(argv[3], argv[4], &hints, &faddr)) != 0) { - freeaddrinfo(laddr); - errx(1, "%s port %s: %s", argv[3], argv[4], - gai_strerror(gaierr)); + free(head); + + return (ok); +} + +static bool +tcpdropbyname(const char *lhost, const char *lport, const char *fhost, + const char *fport) +{ + static const struct addrinfo hints = { + /* + * Look for streams in all domains. + */ + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo *ail, *local, *aif, *foreign; + int error; + bool ok, infamily; + + error = getaddrinfo(lhost, lport, &hints, &local); + if (error != 0) + errx(1, "getaddrinfo: %s port %s: %s", lhost, lport, + gai_strerror(error)); + + error = getaddrinfo(fhost, fport, &hints, &foreign); + if (error != 0) { + freeaddrinfo(local); /* XXX gratuitous */ + errx(1, "getaddrinfo: %s port %s: %s", lhost, lport, + gai_strerror(error)); } - for (ail = laddr; ail; ail = ail->ai_next) { - for (aif = faddr; aif; aif = aif->ai_next) { + + ok = true; + infamily = false; + + /* + * Try every combination of local and foreign address pairs. + */ + for (ail = local; ail != NULL; ail = ail->ai_next) { + for (aif = foreign; aif != NULL; aif = aif->ai_next) { if (ail->ai_family != aif->ai_family) continue; - memcpy(&addrs[0], aif->ai_addr, aif->ai_addrlen); - memcpy(&addrs[1], ail->ai_addr, ail->ai_addrlen); - if (getnameinfo(aif->ai_addr, aif->ai_addrlen, - fhbuf, sizeof(fhbuf), - fsbuf, sizeof(fsbuf), - NI_NUMERICHOST | NI_NUMERICSERV) == -1) - err(1, "getnameinfo"); - if (getnameinfo(ail->ai_addr, ail->ai_addrlen, - lhbuf, sizeof(lhbuf), - lsbuf, sizeof(lsbuf), - NI_NUMERICHOST | NI_NUMERICSERV) == -1) - err(1, "getnameinfo"); - if (sysctl(mib, sizeof (mib) / sizeof (int), NULL, - NULL, &addrs, sizeof(addrs)) == -1) { - rval = 1; - warn("%s %s %s %s", lhbuf, lsbuf, fhbuf, fsbuf); - } else - printf("%s %s %s %s: dropped\n", - lhbuf, lsbuf, fhbuf, fsbuf); + infamily = true; + if (!tcpdrop(ail->ai_addr, aif->ai_addr)) + ok = false; } } - freeaddrinfo(laddr); - freeaddrinfo(faddr); - exit(rval); + + if (!infamily) { + warnx("%s %s %s %s: different address families", lhost, lport, + fhost, fport); + ok = false; + } + + freeaddrinfo(local); + freeaddrinfo(foreign); + + return (ok); +} + +static bool +tcpdropconn(const struct in_conninfo *inc) +{ + struct sockaddr *local, *foreign; + struct sockaddr_in6 sin6[2]; + struct sockaddr_in sin4[2]; + + if ((inc->inc_flags & INC_ISIPV6) != 0) { + memset(sin6, 0, sizeof sin6); + + sin6[TCPDROP_LOCAL].sin6_len = sizeof sin6[TCPDROP_LOCAL]; + sin6[TCPDROP_LOCAL].sin6_family = AF_INET6; + sin6[TCPDROP_LOCAL].sin6_port = inc->inc_lport; + memcpy(&sin6[TCPDROP_LOCAL].sin6_addr, &inc->inc6_laddr, + sizeof inc->inc6_laddr); + local = (struct sockaddr *)&sin6[TCPDROP_LOCAL]; + + sin6[TCPDROP_FOREIGN].sin6_len = sizeof sin6[TCPDROP_FOREIGN]; + sin6[TCPDROP_FOREIGN].sin6_family = AF_INET6; + sin6[TCPDROP_FOREIGN].sin6_port = inc->inc_fport; + memcpy(&sin6[TCPDROP_FOREIGN].sin6_addr, &inc->inc6_faddr, + sizeof inc->inc6_faddr); + foreign = (struct sockaddr *)&sin6[TCPDROP_FOREIGN]; + } else { + memset(&sin4[TCPDROP_LOCAL], 0, sizeof sin4[TCPDROP_LOCAL]); + + sin4[TCPDROP_LOCAL].sin_len = sizeof sin4[TCPDROP_LOCAL]; + sin4[TCPDROP_LOCAL].sin_family = AF_INET; + sin4[TCPDROP_LOCAL].sin_port = inc->inc_lport; + memcpy(&sin4[TCPDROP_LOCAL].sin_addr, &inc->inc_laddr, + sizeof inc->inc_laddr); + local = (struct sockaddr *)&sin4[TCPDROP_LOCAL]; + + sin4[TCPDROP_FOREIGN].sin_len = sizeof sin4[TCPDROP_FOREIGN]; + sin4[TCPDROP_FOREIGN].sin_family = AF_INET; + sin4[TCPDROP_FOREIGN].sin_port = inc->inc_fport; + memcpy(&sin4[TCPDROP_FOREIGN].sin_addr, &inc->inc_faddr, + sizeof inc->inc_faddr); + foreign = (struct sockaddr *)&sin4[TCPDROP_FOREIGN]; + } + + return (tcpdrop(local, foreign)); +} + +static void +usage(void) +{ + fprintf(stderr, +"usage: tcpdrop local-address local-port foreign-address foreign-port\n" +" tcpdrop [-l] -a\n"); + exit(1); } From jmallett at FreeBSD.org Mon Jun 1 06:52:03 2009 From: jmallett at FreeBSD.org (Juli Mallett) Date: Mon Jun 1 06:52:10 2009 Subject: svn commit: r193204 - head/share/man/man4 Message-ID: <200906010652.n516q3Ol067175@svn.freebsd.org> Author: jmallett Date: Mon Jun 1 06:52:03 2009 New Revision: 193204 URL: http://svn.freebsd.org/changeset/base/193204 Log: o) Remove some references to long-unsupported old-style config(8) directives. o) Borrow da(4) language about autoconfiguration for ch(4). Modified: head/share/man/man4/ch.4 head/share/man/man4/scsi.4 Modified: head/share/man/man4/ch.4 ============================================================================== --- head/share/man/man4/ch.4 Mon Jun 1 06:49:09 2009 (r193203) +++ head/share/man/man4/ch.4 Mon Jun 1 06:52:03 2009 (r193204) @@ -32,7 +32,6 @@ .Nd SCSI media-changer (juke box) driver .Sh SYNOPSIS .Cd device ch -.Cd device ch1 target 4 unit 0 .Sh DESCRIPTION The .Nm @@ -67,13 +66,12 @@ come on line as; refer to .Xr scsi 4 for details on kernel configuration. .Sh KERNEL CONFIGURATION -In configuring, if an optional -.Ar count -is given in the specification, that number of SCSI media changers -are configured; Most storage for them is allocated only when found -so a large number of configured devices is cheap. -(once the first -has included the driver). +It is only necessary to explicitly configure one +.Nm +device; data structures are dynamically allocated as media changes are found +on the +.Tn SCSI +bus. .Sh IOCTLS User mode programs communicate with the changer driver through a number of ioctls which are described below. Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Mon Jun 1 06:49:09 2009 (r193203) +++ head/share/man/man4/scsi.4 Mon Jun 1 06:52:03 2009 (r193204) @@ -150,7 +150,7 @@ will be reset to 100ms. .Pp All devices and the SCSI busses support boot time allocation so that an upper number of devices and controllers does not need to be configured; -.Cd "device da0" +.Cd "device da" will suffice for any number of disk drivers. .Pp The devices are either From delphij at FreeBSD.org Mon Jun 1 07:05:53 2009 From: delphij at FreeBSD.org (Xin LI) Date: Mon Jun 1 07:06:05 2009 Subject: svn commit: r193205 - in head/sys/dev/ata: . chipsets Message-ID: <200906010705.n5175q4K067513@svn.freebsd.org> Author: delphij Date: Mon Jun 1 07:05:52 2009 New Revision: 193205 URL: http://svn.freebsd.org/changeset/base/193205 Log: According to Intel documentation (307013), 3Gbps mode is supported on Desktop chipsets only for ICH7 series, so mark all ICH7M as ATA_SA150 instead of ATA_SA300. Modified: head/sys/dev/ata/ (props changed) head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Jun 1 06:52:03 2009 (r193204) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Jun 1 07:05:52 2009 (r193205) @@ -104,9 +104,9 @@ ata_intel_probe(device_t dev) { ATA_I82801GB_S1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GB_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, - { ATA_I82801GBM_S1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, - { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, - { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, + { ATA_I82801GBM_S1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, { ATA_I63XXESB2, 0, 0, 1, ATA_UDMA5, "63XXESB2" }, { ATA_I63XXESB2_S1, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, { ATA_I63XXESB2_S2, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, From trasz at FreeBSD.org Mon Jun 1 07:48:28 2009 From: trasz at FreeBSD.org (Edward Tomasz Napierala) Date: Mon Jun 1 07:48:40 2009 Subject: svn commit: r193206 - head/share/man/man9 Message-ID: <200906010748.n517mRlU068318@svn.freebsd.org> Author: trasz Date: Mon Jun 1 07:48:27 2009 New Revision: 193206 URL: http://svn.freebsd.org/changeset/base/193206 Log: Use the "flag" word consistently. Submitted by: Ben Kaduk Modified: head/share/man/man9/VOP_ACCESS.9 Modified: head/share/man/man9/VOP_ACCESS.9 ============================================================================== --- head/share/man/man9/VOP_ACCESS.9 Mon Jun 1 07:05:52 2009 (r193205) +++ head/share/man/man9/VOP_ACCESS.9 Mon Jun 1 07:48:27 2009 (r193206) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2009 +.Dd June 1, 2009 .Os .Dt VOP_ACCESS 9 .Sh NAME @@ -77,7 +77,7 @@ are .Dv VADMIN and .Dv VAPPEND . -To check for other bits, one has to use +To check for other flags, one has to use .Fn VOP_ACCESSX instead. .Sh LOCKS From lulf at FreeBSD.org Mon Jun 1 09:25:32 2009 From: lulf at FreeBSD.org (Ulf Lilleengen) Date: Mon Jun 1 09:25:39 2009 Subject: svn commit: r193213 - head/contrib/csup Message-ID: <200906010925.n519PWad071145@svn.freebsd.org> Author: lulf Date: Mon Jun 1 09:25:32 2009 New Revision: 193213 URL: http://svn.freebsd.org/changeset/base/193213 Log: - Add missing data argument to printf. Submitted by: Pawel Worach MFC after: 1 week Modified: head/contrib/csup/updater.c Modified: head/contrib/csup/updater.c ============================================================================== --- head/contrib/csup/updater.c Mon Jun 1 09:03:55 2009 (r193212) +++ head/contrib/csup/updater.c Mon Jun 1 09:25:32 2009 (r193213) @@ -1858,7 +1858,7 @@ updater_append_file(struct updater *up, goto bad; } if (nread == -1) { - xasprintf(&up->errmsg, "%s: Error reading: %s", + xasprintf(&up->errmsg, "%s: Error reading: %s", fup->destpath, strerror(errno)); return (UPDATER_ERR_MSG); } From pjd at FreeBSD.org Mon Jun 1 09:32:13 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Mon Jun 1 09:32:19 2009 Subject: svn commit: r193214 - head/lib/libc/sys Message-ID: <200906010932.n519WC19071344@svn.freebsd.org> Author: pjd Date: Mon Jun 1 09:32:12 2009 New Revision: 193214 URL: http://svn.freebsd.org/changeset/base/193214 Log: Document EINVAL for bind(2). Reviewed by: rwatson Obtained from: SuSv3 Modified: head/lib/libc/sys/bind.2 Modified: head/lib/libc/sys/bind.2 ============================================================================== --- head/lib/libc/sys/bind.2 Mon Jun 1 09:25:32 2009 (r193213) +++ head/lib/libc/sys/bind.2 Mon Jun 1 09:32:12 2009 (r193214) @@ -82,6 +82,9 @@ The .Fa s argument is not a valid descriptor. +.It Bq Er EINVAL +The socket is already bound to an address, and the protocol does not support +binding to a new address; or the socket has been shut down. .It Bq Er ENOTSOCK The .Fa s From rpaulo at freebsd.org Mon Jun 1 10:27:27 2009 From: rpaulo at freebsd.org (Rui Paulo) Date: Mon Jun 1 10:27:32 2009 Subject: svn commit: r192925 - in head/sys/dev/usb: . input In-Reply-To: <200906010749.37072.hselasky@c2i.net> References: <200905271927.n4RJRUH8009289@svn.freebsd.org> <200906010749.37072.hselasky@c2i.net> Message-ID: <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090601/e51797a5/PGP.pgp From pjd at FreeBSD.org Mon Jun 1 10:30:02 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Mon Jun 1 10:30:08 2009 Subject: svn commit: r193217 - in head/sys: conf netinet netinet6 sys Message-ID: <200906011030.n51AU0SW072735@svn.freebsd.org> Author: pjd Date: Mon Jun 1 10:30:00 2009 New Revision: 193217 URL: http://svn.freebsd.org/changeset/base/193217 Log: - Rename IP_NONLOCALOK IP socket option to IP_BINDANY, to be more consistent with OpenBSD (and BSD/OS originally). We can't easly do it SOL_SOCKET option as there is no more space for more SOL_SOCKET options, but this option also fits better as an IP socket option, it seems. - Implement this functionality also for IPv6 and RAW IP sockets. - Always compile it in (don't use additional kernel options). - Remove sysctl to turn this functionality on and off. - Introduce new privilege - PRIV_NETINET_BINDANY, which allows to use this functionality (currently only unjail root can use it). Discussed with: julian, adrian, jhb, rwatson, kmacy Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/netinet/in.h head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/raw_ip.c head/sys/netinet6/in6.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c head/sys/sys/priv.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/conf/NOTES Mon Jun 1 10:30:00 2009 (r193217) @@ -639,14 +639,6 @@ options ALTQ_PRIQ # Priority Queueing options ALTQ_NOPCC # Required if the TSC is unusable options ALTQ_DEBUG -# IP optional behaviour. -# IP_NONLOCALBIND disables the check that bind() usually makes that the -# address is one that is assigned to an interface on this machine. -# It allows transparent proxies to pretend to be other machines. -# How the packet GET to that machine is a problem solved elsewhere, -# smart routers, ipfw fwd, etc. -options IP_NONLOCALBIND # Allow impersonation for proxies. - # netgraph(4). Enable the base netgraph code with the NETGRAPH option. # Individual node types can be enabled with the corresponding option # listed below; however, this is not strictly necessary as netgraph Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/conf/options Mon Jun 1 10:30:00 2009 (r193217) @@ -400,7 +400,6 @@ IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h IPSEC opt_ipsec.h IPSEC_DEBUG opt_ipsec.h -IP_NONLOCALBIND opt_inet.h IPSEC_FILTERTUNNEL opt_ipsec.h IPSTEALTH IPX Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/in.h Mon Jun 1 10:30:00 2009 (r193217) @@ -441,8 +441,7 @@ __END_DECLS #define IP_FAITH 22 /* bool; accept FAITH'ed connections */ #define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ -#define IP_NONLOCALOK 24 /* bool: allow bind to spoof non-local addresses; - requires kernel compile option IP_NONLOCALBIND */ +#define IP_BINDANY 24 /* bool: allow bind to any address */ #define IP_FW_TABLE_ADD 40 /* add entry */ #define IP_FW_TABLE_DEL 41 /* delete entry */ Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/in_pcb.c Mon Jun 1 10:30:00 2009 (r193217) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_inet.h" #include "opt_ipsec.h" #include "opt_inet6.h" #include "opt_mac.h" @@ -357,14 +356,11 @@ in_pcbbind_setup(struct inpcb *inp, stru bzero(&sin->sin_zero, sizeof(sin->sin_zero)); /* * Is the address a local IP address? - * If INP_NONLOCALOK is set, then the socket may be bound + * If INP_BINDANY is set, then the socket may be bound * to any endpoint address, local or not. */ - if ( -#if defined(IP_NONLOCALBIND) - ((inp->inp_flags & INP_NONLOCALOK) == 0) && -#endif - (ifa_ifwithaddr((struct sockaddr *)sin) == 0)) + if ((inp->inp_flags & INP_BINDANY) == 0 && + ifa_ifwithaddr((struct sockaddr *)sin) == NULL) return (EADDRNOTAVAIL); } laddr = sin->sin_addr; Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/in_pcb.h Mon Jun 1 10:30:00 2009 (r193217) @@ -410,8 +410,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_FAITH 0x00000200 /* accept FAITH'ed connections */ #define INP_RECVTTL 0x00000400 /* receive incoming IP TTL */ #define INP_DONTFRAG 0x00000800 /* don't fragment packet */ -#define INP_NONLOCALOK 0x00001000 /* Allow bind to spoof any address */ - /* - requires options IP_NONLOCALBIND */ +#define INP_BINDANY 0x00001000 /* allow bind to any address */ #define INP_INHASHLIST 0x00002000 /* in_pcbinshash() has been called */ #define IN6P_IPV6_V6ONLY 0x00008000 /* restrict AF_INET6 socket for v6 */ #define IN6P_PKTINFO 0x00010000 /* receive IP6 dst and I/F */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/ip_output.c Mon Jun 1 10:30:00 2009 (r193217) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" -#include "opt_inet.h" #include "opt_ipsec.h" #include "opt_route.h" #include "opt_mac.h" @@ -103,12 +102,6 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, mbuf_ &mbuf_frag_size, 0, "Fragment outgoing mbufs to this size"); #endif -#if defined(IP_NONLOCALBIND) -static int ip_nonlocalok = 0; -SYSCTL_INT(_net_inet_ip, OID_AUTO, nonlocalok, - CTLFLAG_RW|CTLFLAG_SECURE, &ip_nonlocalok, 0, ""); -#endif - static void ip_mloopback (struct ifnet *, struct mbuf *, struct sockaddr_in *, int); @@ -931,14 +924,14 @@ ip_ctloutput(struct socket *so, struct s return (error); } -#if defined(IP_NONLOCALBIND) - case IP_NONLOCALOK: - if (! ip_nonlocalok) { - error = ENOPROTOOPT; - break; + case IP_BINDANY: + if (sopt->sopt_td != NULL) { + error = priv_check(sopt->sopt_td, + PRIV_NETINET_BINDANY); + if (error) + break; } /* FALLTHROUGH */ -#endif case IP_TOS: case IP_TTL: case IP_MINTTL: @@ -1010,11 +1003,9 @@ ip_ctloutput(struct socket *so, struct s case IP_DONTFRAG: OPTSET(INP_DONTFRAG); break; -#if defined(IP_NONLOCALBIND) - case IP_NONLOCALOK: - OPTSET(INP_NONLOCALOK); + case IP_BINDANY: + OPTSET(INP_BINDANY); break; -#endif } break; #undef OPTSET Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet/raw_ip.c Mon Jun 1 10:30:00 2009 (r193217) @@ -853,15 +853,16 @@ rip_bind(struct socket *so, struct socka if (error != 0) return (error); + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("rip_bind: inp == NULL")); + if (TAILQ_EMPTY(&V_ifnet) || (addr->sin_family != AF_INET && addr->sin_family != AF_IMPLINK) || (addr->sin_addr.s_addr && - ifa_ifwithaddr((struct sockaddr *)addr) == 0)) + (inp->inp_flags & INP_BINDANY) == 0 && + ifa_ifwithaddr((struct sockaddr *)addr) == NULL)) return (EADDRNOTAVAIL); - inp = sotoinpcb(so); - KASSERT(inp != NULL, ("rip_bind: inp == NULL")); - INP_INFO_WLOCK(&V_ripcbinfo); INP_WLOCK(inp); rip_delhash(inp); Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet6/in6.h Mon Jun 1 10:30:00 2009 (r193217) @@ -477,6 +477,8 @@ struct route_in6 { * the source address. */ +#define IPV6_BINDANY 64 /* bool: allow bind to any address */ + /* * The following option is private; do not use it from user applications. * It is deliberately defined to the same value as IP_MSFILTER. Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet6/in6_pcb.c Mon Jun 1 10:30:00 2009 (r193217) @@ -163,11 +163,13 @@ in6_pcbbind(register struct inpcb *inp, if (so->so_options & SO_REUSEADDR) reuseport = SO_REUSEADDR|SO_REUSEPORT; } else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - struct ifaddr *ia = NULL; + struct ifaddr *ia; sin6->sin6_port = 0; /* yech... */ - if ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == 0) + if ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == NULL && + (inp->inp_flags & INP_BINDANY) == 0) { return (EADDRNOTAVAIL); + } /* * XXX: bind to an anycast address might accidentally Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/netinet6/ip6_output.c Mon Jun 1 10:30:00 2009 (r193217) @@ -1405,6 +1405,14 @@ ip6_ctloutput(struct socket *so, struct case IPV6_RECVTCLASS: case IPV6_V6ONLY: case IPV6_AUTOFLOWLABEL: + case IPV6_BINDANY: + if (optname == IPV6_BINDANY && td != NULL) { + error = priv_check(td, + PRIV_NETINET_BINDANY); + if (error) + break; + } + if (optlen != sizeof(int)) { error = EINVAL; break; @@ -1558,6 +1566,9 @@ do { \ OPTSET(IN6P_AUTOFLOWLABEL); break; + case IPV6_BINDANY: + OPTSET(INP_BINDANY); + break; } break; @@ -1831,6 +1842,10 @@ do { \ case IPV6_AUTOFLOWLABEL: optval = OPTBIT(IN6P_AUTOFLOWLABEL); break; + + case IPV6_BINDANY: + optval = OPTBIT(INP_BINDANY); + break; } if (error) break; Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Mon Jun 1 10:04:37 2009 (r193216) +++ head/sys/sys/priv.h Mon Jun 1 10:30:00 2009 (r193217) @@ -374,6 +374,7 @@ #define PRIV_NETINET_IPSEC 503 /* Administer IPSEC. */ #define PRIV_NETINET_REUSEPORT 504 /* Allow [rapid] port/address reuse. */ #define PRIV_NETINET_SETHDROPTS 505 /* Set certain IPv4/6 header options. */ +#define PRIV_NETINET_BINDANY 506 /* Allow bind to any address. */ /* * IPX/SPX privileges. From pjd at FreeBSD.org Mon Jun 1 10:30:53 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Mon Jun 1 10:31:05 2009 Subject: svn commit: r193218 - head/share/man/man4 Message-ID: <200906011030.n51AUqiN072810@svn.freebsd.org> Author: pjd Date: Mon Jun 1 10:30:52 2009 New Revision: 193218 URL: http://svn.freebsd.org/changeset/base/193218 Log: Document IP_BINDANY IP socket option. Reviewed by: brueffer Modified: head/share/man/man4/ip.4 Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Mon Jun 1 10:30:00 2009 (r193217) +++ head/share/man/man4/ip.4 Mon Jun 1 10:30:52 2009 (r193218) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd March 9, 2009 +.Dd June 1, 2009 .Dt IP 4 .Os .Sh NAME @@ -243,6 +243,23 @@ socket level option, otherwise the .Dv IP_ONESBCAST option has no effect. .Pp If the +.Dv IP_BINDANY +option is enabled on a +.Dv SOCK_STREAM , +.Dv SOCK_DGRAM +or a +.Dv SOCK_RAW +socket, one can +.Xr bind 2 +to any address, even one not bound to any available network interface in the +system. +This functionality (in conjunction with special firewall rules) can be used for +implementing a transparent proxy. +The +.Dv PRIV_NETINET_BINDANY +privilege is needed to set this option. +.Pp +If the .Dv IP_RECVTTL option is enabled on a .Dv SOCK_DGRAM From rwatson at FreeBSD.org Mon Jun 1 10:41:39 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Mon Jun 1 10:41:46 2009 Subject: svn commit: r193219 - in head/sys: kern net netatalk netinet netinet6 netipsec netipx netnatm sys Message-ID: <200906011041.n51AfcUu073049@svn.freebsd.org> Author: rwatson Date: Mon Jun 1 10:41:38 2009 New Revision: 193219 URL: http://svn.freebsd.org/changeset/base/193219 Log: Reimplement the netisr framework in order to support parallel netisr threads: - Support up to one netisr thread per CPU, each processings its own workstream, or set of per-protocol queues. Threads may be bound to specific CPUs, or allowed to migrate, based on a global policy. In the future it would be desirable to support topology-centric policies, such as "one netisr per package". - Allow each protocol to advertise an ordering policy, which can currently be one of: NETISR_POLICY_SOURCE: packets must maintain ordering with respect to an implicit or explicit source (such as an interface or socket). NETISR_POLICY_FLOW: make use of mbuf flow identifiers to place work, as well as allowing protocols to provide a flow generation function for mbufs without flow identifers (m2flow). Falls back on NETISR_POLICY_SOURCE if now flow ID is available. NETISR_POLICY_CPU: allow protocols to inspect and assign a CPU for each packet handled by netisr (m2cpuid). - Provide utility functions for querying the number of workstreams being used, as well as a mapping function from workstream to CPU ID, which protocols may use in work placement decisions. - Add explicit interfaces to get and set per-protocol queue limits, and get and clear drop counters, which query data or apply changes across all workstreams. - Add a more extensible netisr registration interface, in which protocols declare 'struct netisr_handler' structures for each registered NETISR_ type. These include name, handler function, optional mbuf to flow ID function, optional mbuf to CPU ID function, queue limit, and ordering policy. Padding is present to allow these to be expanded in the future. If no queue limit is declared, then a default is used. - Queue limits are now per-workstream, and raised from the previous IFQ_MAXLEN default of 50 to 256. - All protocols are updated to use the new registration interface, and with the exception of netnatm, default queue limits. Most protocols register as NETISR_POLICY_SOURCE, except IPv4 and IPv6, which use NETISR_POLICY_FLOW, and will therefore take advantage of driver- generated flow IDs if present. - Formalize a non-packet based interface between interface polling and the netisr, rather than having polling pretend to be two protocols. Provide two explicit hooks in the netisr worker for start and end events for runs: netisr_poll() and netisr_pollmore(), as well as a function, netisr_sched_poll(), to allow the polling code to schedule netisr execution. DEVICE_POLLING still embeds single-netisr assumptions in its implementation, so for now if it is compiled into the kernel, a single and un-bound netisr thread is enforced regardless of tunable configuration. In the default configuration, the new netisr implementation maintains the same basic assumptions as the previous implementation: a single, un-bound worker thread processes all deferred work, and direct dispatch is enabled by default wherever possible. Performance measurement shows a marginal performance improvement over the old implementation due to the use of batched dequeue. An rmlock is used to synchronize use and registration/unregistration using the framework; currently, synchronized use is disabled (replicating current netisr policy) due to a measurable 3%-6% hit in ping-pong micro-benchmarking. It will be enabled once further rmlock optimization has taken place. However, in practice, netisrs are rarely registered or unregistered at runtime. A new man page for netisr will follow, but since one doesn't currently exist, it hasn't been updated. This change is not appropriate for MFC, although the polling shutdown handler should be merged to 7-STABLE. Bump __FreeBSD_version. Reviewed by: bz Modified: head/sys/kern/kern_poll.c head/sys/net/netisr.c head/sys/net/netisr.h head/sys/net/rtsock.c head/sys/netatalk/ddp_usrreq.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c head/sys/netinet6/vinet6.h head/sys/netipsec/ipsec_input.c head/sys/netipx/ipx_input.c head/sys/netnatm/natm_proto.c head/sys/sys/param.h head/sys/sys/pcpu.h Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Mon Jun 1 10:30:52 2009 (r193218) +++ head/sys/kern/kern_poll.c Mon Jun 1 10:41:38 2009 (r193219) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include /* needed by net/if.h */ #include @@ -48,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -static void netisr_poll(void); /* the two netisr handlers */ -static void netisr_pollmore(void); static int poll_switch(SYSCTL_HANDLER_ARGS); void hardclock_device_poll(void); /* hook from hardclock */ @@ -110,6 +109,10 @@ SYSCTL_NODE(_kern, OID_AUTO, polling, CT SYSCTL_UINT(_kern_polling, OID_AUTO, burst, CTLFLAG_RD, &poll_burst, 0, "Current polling burst size"); +static int netisr_poll_scheduled; +static int netisr_pollmore_scheduled; +static int poll_shutting_down; + static int poll_burst_max_sysctl(SYSCTL_HANDLER_ARGS) { uint32_t val = poll_burst_max; @@ -260,12 +263,19 @@ struct pollrec { static struct pollrec pr[POLL_LIST_LEN]; static void +poll_shutdown(void *arg, int howto) +{ + + poll_shutting_down = 1; +} + +static void init_device_poll(void) { mtx_init(&poll_mtx, "polling", NULL, MTX_DEF); - netisr_register(NETISR_POLL, (netisr_t *)netisr_poll, NULL, 0); - netisr_register(NETISR_POLLMORE, (netisr_t *)netisr_pollmore, NULL, 0); + EVENTHANDLER_REGISTER(shutdown_post_sync, poll_shutdown, NULL, + SHUTDOWN_PRI_LAST); } SYSINIT(device_poll, SI_SUB_CLOCKS, SI_ORDER_MIDDLE, init_device_poll, NULL); @@ -289,7 +299,7 @@ hardclock_device_poll(void) static struct timeval prev_t, t; int delta; - if (poll_handlers == 0) + if (poll_handlers == 0 || poll_shutting_down) return; microuptime(&t); @@ -314,7 +324,9 @@ hardclock_device_poll(void) if (phase != 0) suspect++; phase = 1; - schednetisrbits(1 << NETISR_POLL | 1 << NETISR_POLLMORE); + netisr_poll_scheduled = 1; + netisr_pollmore_scheduled = 1; + netisr_sched_poll(); phase = 2; } if (pending_polls++ > 0) @@ -365,9 +377,16 @@ netisr_pollmore() int kern_load; mtx_lock(&poll_mtx); + if (!netisr_pollmore_scheduled) { + mtx_unlock(&poll_mtx); + return; + } + netisr_pollmore_scheduled = 0; phase = 5; if (residual_burst > 0) { - schednetisrbits(1 << NETISR_POLL | 1 << NETISR_POLLMORE); + netisr_poll_scheduled = 1; + netisr_pollmore_scheduled = 1; + netisr_sched_poll(); mtx_unlock(&poll_mtx); /* will run immediately on return, followed by netisrs */ return; @@ -397,23 +416,29 @@ netisr_pollmore() poll_burst -= (poll_burst / 8); if (poll_burst < 1) poll_burst = 1; - schednetisrbits(1 << NETISR_POLL | 1 << NETISR_POLLMORE); + netisr_poll_scheduled = 1; + netisr_pollmore_scheduled = 1; + netisr_sched_poll(); phase = 6; } mtx_unlock(&poll_mtx); } /* - * netisr_poll is scheduled by schednetisr when appropriate, typically once - * per tick. + * netisr_poll is typically scheduled once per tick. */ -static void +void netisr_poll(void) { int i, cycles; enum poll_cmd arg = POLL_ONLY; mtx_lock(&poll_mtx); + if (!netisr_poll_scheduled) { + mtx_unlock(&poll_mtx); + return; + } + netisr_poll_scheduled = 0; phase = 3; if (residual_burst == 0) { /* first call in this tick */ microuptime(&poll_start_t); Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Jun 1 10:30:52 2009 (r193218) +++ head/sys/net/netisr.c Mon Jun 1 10:41:38 2009 (r193219) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2001,2002,2003 Jonathan Lemon - * Copyright (c) 1997, Stefan Esser + * Copyright (c) 2007-2009 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,230 +22,1103 @@ * 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$"); + +/* + * netisr is a packet dispatch service, allowing synchronous (directly + * dispatched) and asynchronous (deferred dispatch) processing of packets by + * registered protocol handlers. Callers pass a protocol identifier and + * packet to netisr, along with a direct dispatch hint, and work will either + * be immediately processed with the registered handler, or passed to a + * kernel software interrupt (SWI) thread for deferred dispatch. Callers + * will generally select one or the other based on: + * + * - Might directly dispatching a netisr handler lead to code reentrance or + * lock recursion, such as entering the socket code from the socket code. + * - Might directly dispatching a netisr handler lead to recursive + * processing, such as when decapsulating several wrapped layers of tunnel + * information (IPSEC within IPSEC within ...). * - * $FreeBSD$ + * Maintaining ordering for protocol streams is a critical design concern. + * Enforcing ordering limits the opportunity for concurrency, but maintains + * the strong ordering requirements found in some protocols, such as TCP. Of + * related concern is CPU affinity--it is desirable to process all data + * associated with a particular stream on the same CPU over time in order to + * avoid acquiring locks associated with the connection on different CPUs, + * keep connection data in one cache, and to generally encourage associated + * user threads to live on the same CPU as the stream. It's also desirable + * to avoid lock migration and contention where locks are associated with + * more than one flow. + * + * netisr supports several policy variations, represented by the + * NETISR_POLICY_* constants, allowing protocols to play a varying role in + * identifying flows, assigning work to CPUs, etc. These are described in + * detail in netisr.h. */ +#include "opt_ddb.h" #include "opt_device_polling.h" #include #include -#include -#include -#include #include #include +#include #include -#include +#include +#include #include -#include -#include +#include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include -#include +#ifdef DDB +#include +#endif #include -#include #include #include -volatile unsigned int netisr; /* scheduling bits for network */ +/*- + * Synchronize use and modification of the registered netisr data structures; + * acquire a read lock while modifying the set of registered protocols to + * prevent partially registered or unregistered protocols from being run. + * + * The following data structures and fields are protected by this lock: + * + * - The np array, including all fields of struct netisr_proto. + * - The nws array, including all fields of struct netisr_worker. + * - The nws_array array. + * + * Note: the NETISR_LOCKING define controls whether read locks are acquired + * in packet processing paths requiring netisr registration stability. This + * is disabled by default as it can lead to a measurable performance + * degradation even with rmlocks (3%-6% for loopback ping-pong traffic), and + * because netisr registration and unregistration is extremely rare at + * runtime. If it becomes more common, this decision should be revisited. + * + * XXXRW: rmlocks don't support assertions. + */ +static struct rmlock netisr_rmlock; +#define NETISR_LOCK_INIT() rm_init_flags(&netisr_rmlock, "netisr", \ + RM_NOWITNESS) +#define NETISR_LOCK_ASSERT() +#define NETISR_RLOCK(tracker) rm_rlock(&netisr_rmlock, (tracker)) +#define NETISR_RUNLOCK(tracker) rm_runlock(&netisr_rmlock, (tracker)) +#define NETISR_WLOCK() rm_wlock(&netisr_rmlock) +#define NETISR_WUNLOCK() rm_wunlock(&netisr_rmlock) +/* #define NETISR_LOCKING */ + +SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW, 0, "netisr"); + +/*- + * Three direct dispatch policies are supported: + * + * - Always defer: all work is scheduled for a netisr, regardless of context. + * (!direct) + * + * - Hybrid: if the executing context allows direct dispatch, and we're + * running on the CPU the work would be done on, then direct dispatch if it + * wouldn't violate ordering constraints on the workstream. + * (direct && !direct_force) + * + * - Always direct: if the executing context allows direct dispatch, always + * direct dispatch. (direct && direct_force) + * + * Notice that changing the global policy could lead to short periods of + * misordered processing, but this is considered acceptable as compared to + * the complexity of enforcing ordering during policy changes. + */ +static int netisr_direct_force = 1; /* Always direct dispatch. */ +TUNABLE_INT("net.isr.direct_force", &netisr_direct_force); +SYSCTL_INT(_net_isr, OID_AUTO, direct_force, CTLFLAG_RW, + &netisr_direct_force, 0, "Force direct dispatch"); + +static int netisr_direct = 1; /* Enable direct dispatch. */ +TUNABLE_INT("net.isr.direct", &netisr_direct); +SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RW, + &netisr_direct, 0, "Enable direct dispatch"); + +/* + * Allow the administrator to limit the number of threads (CPUs) to use for + * netisr. We don't check netisr_maxthreads before creating the thread for + * CPU 0, so in practice we ignore values <= 1. This must be set at boot. + * We will create at most one thread per CPU. + */ +static int netisr_maxthreads = 1; /* Max number of threads. */ +TUNABLE_INT("net.isr.maxthreads", &netisr_maxthreads); +SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RD, + &netisr_maxthreads, 0, + "Use at most this many CPUs for netisr processing"); + +static int netisr_bindthreads = 0; /* Bind threads to CPUs. */ +TUNABLE_INT("net.isr.bindthreads", &netisr_bindthreads); +SYSCTL_INT(_net_isr, OID_AUTO, bindthreads, CTLFLAG_RD, + &netisr_bindthreads, 0, "Bind netisr threads to CPUs."); + +/* + * Limit per-workstream queues to at most net.isr.maxqlimit, both for initial + * configuration and later modification using netisr_setqlimit(). + */ +#define NETISR_DEFAULT_MAXQLIMIT 10240 +static u_int netisr_maxqlimit = NETISR_DEFAULT_MAXQLIMIT; +TUNABLE_INT("net.isr.maxqlimit", &netisr_maxqlimit); +SYSCTL_INT(_net_isr, OID_AUTO, maxqlimit, CTLFLAG_RD, + &netisr_maxqlimit, 0, + "Maximum netisr per-protocol, per-CPU queue depth."); + +/* + * The default per-workstream queue limit for protocols that don't initialize + * the nh_qlimit field of their struct netisr_handler. If this is set above + * netisr_maxqlimit, we truncate it to the maximum during boot. + */ +#define NETISR_DEFAULT_DEFAULTQLIMIT 256 +static u_int netisr_defaultqlimit = NETISR_DEFAULT_DEFAULTQLIMIT; +TUNABLE_INT("net.isr.defaultqlimit", &netisr_defaultqlimit); +SYSCTL_INT(_net_isr, OID_AUTO, defaultqlimit, CTLFLAG_RD, + &netisr_defaultqlimit, 0, + "Default netisr per-protocol, per-CPU queue limit if not set by protocol"); + +/* + * Each protocol is described by a struct netisr_proto, which holds all + * global per-protocol information. This data structure is set up by + * netisr_register(), and derived from the public struct netisr_handler. + */ +struct netisr_proto { + const char *np_name; /* Character string protocol name. */ + netisr_handler_t *np_handler; /* Protocol handler. */ + netisr_m2flow_t *np_m2flow; /* Query flow for untagged packet. */ + netisr_m2cpuid_t *np_m2cpuid; /* Query CPU to process packet on. */ + u_int np_qlimit; /* Maximum per-CPU queue depth. */ + u_int np_policy; /* Work placement policy. */ +}; + +#define NETISR_MAXPROT 32 /* Compile-time limit. */ + +/* + * The np array describes all registered protocols, indexed by protocol + * number. + */ +static struct netisr_proto np[NETISR_MAXPROT]; + +/* + * Protocol-specific work for each workstream is described by struct + * netisr_work. Each work descriptor consists of an mbuf queue and + * statistics. + */ +struct netisr_work { + /* + * Packet queue, linked by m_nextpkt. + */ + struct mbuf *nw_head; + struct mbuf *nw_tail; + u_int nw_len; + u_int nw_qlimit; + u_int nw_watermark; + + /* + * Statistics -- written unlocked, but mostly from curcpu. + */ + u_int64_t nw_dispatched; /* Number of direct dispatches. */ + u_int64_t nw_hybrid_dispatched; /* "" hybrid dispatches. */ + u_int64_t nw_qdrops; /* "" drops. */ + u_int64_t nw_queued; /* "" enqueues. */ + u_int64_t nw_handled; /* "" handled in worker. */ +}; + +/* + * Workstreams hold a set of ordered work across each protocol, and are + * described by netisr_workstream. Each workstream is associated with a + * worker thread, which in turn is pinned to a CPU. Work associated with a + * workstream can be processd in other threads during direct dispatch; + * concurrent processing is prevented by the NWS_RUNNING flag, which + * indicates that a thread is already processing the work queue. + */ +struct netisr_workstream { + struct intr_event *nws_intr_event; /* Handler for stream. */ + void *nws_swi_cookie; /* swi(9) cookie for stream. */ + struct mtx nws_mtx; /* Synchronize work. */ + u_int nws_cpu; /* CPU pinning. */ + u_int nws_flags; /* Wakeup flags. */ + u_int nws_pendingbits; /* Scheduled protocols. */ + + /* + * Each protocol has per-workstream data. + */ + struct netisr_work nws_work[NETISR_MAXPROT]; +} __aligned(CACHE_LINE_SIZE); + +/* + * Per-CPU workstream data, indexed by CPU ID. + */ +static struct netisr_workstream nws[MAXCPU]; + +/* + * Map contiguous values between 0 and nws_count into CPU IDs appropriate for + * indexing the nws[] array. This allows constructions of the form + * nws[nws_array(arbitraryvalue % nws_count)]. + */ +static u_int nws_array[MAXCPU]; + +/* + * Number of registered workstreams. Will be at most the number of running + * CPUs once fully started. + */ +static u_int nws_count; +SYSCTL_INT(_net_isr, OID_AUTO, numthreads, CTLFLAG_RD, + &nws_count, 0, "Number of extant netisr threads."); + +/* + * Per-workstream flags. + */ +#define NWS_RUNNING 0x00000001 /* Currently running in a thread. */ +#define NWS_DISPATCHING 0x00000002 /* Currently being direct-dispatched. */ +#define NWS_SCHEDULED 0x00000004 /* Signal issued. */ + +/* + * Synchronization for each workstream: a mutex protects all mutable fields + * in each stream, including per-protocol state (mbuf queues). The SWI is + * woken up if asynchronous dispatch is required. + */ +#define NWS_LOCK(s) mtx_lock(&(s)->nws_mtx) +#define NWS_LOCK_ASSERT(s) mtx_assert(&(s)->nws_mtx, MA_OWNED) +#define NWS_UNLOCK(s) mtx_unlock(&(s)->nws_mtx) +#define NWS_SIGNAL(s) swi_sched((s)->nws_swi_cookie, 0) -struct netisr { - netisr_t *ni_handler; - struct ifqueue *ni_queue; - int ni_flags; -} netisrs[32]; +/* + * Utility routines for protocols that implement their own mapping of flows + * to CPUs. + */ +u_int +netisr_get_cpucount(void) +{ + + return (nws_count); +} -static void *net_ih; +u_int +netisr_get_cpuid(u_int cpunumber) +{ + + KASSERT(cpunumber < nws_count, ("%s: %u > %u", __func__, cpunumber, + nws_count)); + + return (nws_array[cpunumber]); +} + +/* + * The default implementation of -> CPU ID mapping. + * + * Non-static so that protocols can use it to map their own work to specific + * CPUs in a manner consistent to netisr for affinity purposes. + */ +u_int +netisr_default_flow2cpu(u_int flowid) +{ + return (nws_array[flowid % nws_count]); +} + +/* + * Register a new netisr handler, which requires initializing per-protocol + * fields for each workstream. All netisr work is briefly suspended while + * the protocol is installed. + */ void -legacy_setsoftnet(void) +netisr_register(const struct netisr_handler *nhp) { - swi_sched(net_ih, 0); + struct netisr_work *npwp; + const char *name; + u_int i, proto; + + proto = nhp->nh_proto; + name = nhp->nh_name; + + /* + * Test that the requested registration is valid. + */ + KASSERT(nhp->nh_name != NULL, + ("%s: nh_name NULL for %u", __func__, proto)); + KASSERT(nhp->nh_handler != NULL, + ("%s: nh_handler NULL for %s", __func__, name)); + KASSERT(nhp->nh_policy == NETISR_POLICY_SOURCE || + nhp->nh_policy == NETISR_POLICY_FLOW || + nhp->nh_policy == NETISR_POLICY_CPU, + ("%s: unsupported nh_policy %u for %s", __func__, + nhp->nh_policy, name)); + KASSERT(nhp->nh_policy == NETISR_POLICY_FLOW || + nhp->nh_m2flow == NULL, + ("%s: nh_policy != FLOW but m2flow defined for %s", __func__, + name)); + KASSERT(nhp->nh_policy == NETISR_POLICY_CPU || nhp->nh_m2cpuid == NULL, + ("%s: nh_policy != CPU but m2cpuid defined for %s", __func__, + name)); + KASSERT(nhp->nh_policy != NETISR_POLICY_CPU || nhp->nh_m2cpuid != NULL, + ("%s: nh_policy == CPU but m2cpuid not defined for %s", __func__, + name)); + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u, %s): protocol too big", __func__, proto, name)); + + /* + * Test that no existing registration exists for this protocol. + */ + NETISR_WLOCK(); + KASSERT(np[proto].np_name == NULL, + ("%s(%u, %s): name present", __func__, proto, name)); + KASSERT(np[proto].np_handler == NULL, + ("%s(%u, %s): handler present", __func__, proto, name)); + + np[proto].np_name = name; + np[proto].np_handler = nhp->nh_handler; + np[proto].np_m2flow = nhp->nh_m2flow; + np[proto].np_m2cpuid = nhp->nh_m2cpuid; + if (nhp->nh_qlimit == 0) + np[proto].np_qlimit = netisr_defaultqlimit; + else if (nhp->nh_qlimit > netisr_maxqlimit) { + printf("%s: %s requested queue limit %u capped to " + "net.isr.maxqlimit %u\n", __func__, name, nhp->nh_qlimit, + netisr_maxqlimit); + np[proto].np_qlimit = netisr_maxqlimit; + } else + np[proto].np_qlimit = nhp->nh_qlimit; + np[proto].np_policy = nhp->nh_policy; + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + bzero(npwp, sizeof(*npwp)); + npwp->nw_qlimit = np[proto].np_qlimit; + } + NETISR_WUNLOCK(); } +/* + * Clear drop counters across all workstreams for a protocol. + */ void -netisr_register(int num, netisr_t *handler, struct ifqueue *inq, int flags) +netisr_clearqdrops(const struct netisr_handler *nhp) { - - KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))), - ("bad isr %d", num)); - KASSERT(flags == 0, ("netisr_register: bad flags 0x%x\n", flags)); - netisrs[num].ni_handler = handler; - netisrs[num].ni_queue = inq; - netisrs[num].ni_flags = flags; + struct netisr_work *npwp; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_WLOCK(); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + npwp->nw_qdrops = 0; + } + NETISR_WUNLOCK(); } +/* + * Query the current drop counters across all workstreams for a protocol. + */ void -netisr_unregister(int num) +netisr_getqdrops(const struct netisr_handler *nhp, u_int64_t *qdropp) { - struct netisr *ni; - - KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))), - ("bad isr %d", num)); - ni = &netisrs[num]; - ni->ni_handler = NULL; - if (ni->ni_queue != NULL) - IF_DRAIN(ni->ni_queue); - ni->ni_queue = NULL; + struct netisr_work *npwp; + struct rm_priotracker tracker; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + *qdropp = 0; + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_RLOCK(&tracker); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + *qdropp += npwp->nw_qdrops; + } + NETISR_RUNLOCK(&tracker); } -struct isrstat { - int isrs_count; /* dispatch count */ - int isrs_directed; /* ...directly dispatched */ - int isrs_deferred; /* ...queued instead */ - int isrs_queued; /* intentionally queueued */ - int isrs_drop; /* dropped 'cuz no handler */ - int isrs_swi_count; /* swi_net handlers called */ -}; -static struct isrstat isrstat; +/* + * Query the current queue limit for per-workstream queues for a protocol. + */ +void +netisr_getqlimit(const struct netisr_handler *nhp, u_int *qlimitp) +{ + struct rm_priotracker tracker; +#ifdef INVARIANTS + const char *name; +#endif + u_int proto; -SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW, 0, "netisr counters"); + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); -static int netisr_direct = 1; -SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RW, - &netisr_direct, 0, "enable direct dispatch"); -TUNABLE_INT("net.isr.direct", &netisr_direct); + NETISR_RLOCK(&tracker); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + *qlimitp = np[proto].np_qlimit; + NETISR_RUNLOCK(&tracker); +} + +/* + * Update the queue limit across per-workstream queues for a protocol. We + * simply change the limits, and don't drain overflowed packets as they will + * (hopefully) take care of themselves shortly. + */ +int +netisr_setqlimit(const struct netisr_handler *nhp, u_int qlimit) +{ + struct netisr_work *npwp; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + if (qlimit > netisr_maxqlimit) + return (EINVAL); + + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_WLOCK(); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + np[proto].np_qlimit = qlimit; + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + npwp->nw_qlimit = qlimit; + } + NETISR_WUNLOCK(); + return (0); +} -SYSCTL_INT(_net_isr, OID_AUTO, count, CTLFLAG_RD, - &isrstat.isrs_count, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, directed, CTLFLAG_RD, - &isrstat.isrs_directed, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, deferred, CTLFLAG_RD, - &isrstat.isrs_deferred, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, queued, CTLFLAG_RD, - &isrstat.isrs_queued, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, drop, CTLFLAG_RD, - &isrstat.isrs_drop, 0, ""); -SYSCTL_INT(_net_isr, OID_AUTO, swi_count, CTLFLAG_RD, - &isrstat.isrs_swi_count, 0, ""); - -/* - * Process all packets currently present in a netisr queue. Used to - * drain an existing set of packets waiting for processing when we - * begin direct dispatch, to avoid processing packets out of order. +/* + * Drain all packets currently held in a particular protocol work queue. */ static void -netisr_processqueue(struct netisr *ni) +netisr_drain_proto(struct netisr_work *npwp) { struct mbuf *m; - for (;;) { - IF_DEQUEUE(ni->ni_queue, m); - if (m == NULL) - break; - VNET_ASSERT(m->m_pkthdr.rcvif != NULL); - CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); - ni->ni_handler(m); - CURVNET_RESTORE(); + /* + * We would assert the lock on the workstream but it's not passed in. + */ + while ((m = npwp->nw_head) != NULL) { + npwp->nw_head = m->m_nextpkt; + m->m_nextpkt = NULL; + if (npwp->nw_head == NULL) + npwp->nw_tail = NULL; + npwp->nw_len--; + m_freem(m); } + KASSERT(npwp->nw_tail == NULL, ("%s: tail", __func__)); + KASSERT(npwp->nw_len == 0, ("%s: len", __func__)); } /* - * Call the netisr directly instead of queueing the packet, if possible. + * Remove the registration of a network protocol, which requires clearing + * per-protocol fields across all workstreams, including freeing all mbufs in + * the queues at time of unregister. All work in netisr is briefly suspended + * while this takes place. */ void -netisr_dispatch(int num, struct mbuf *m) +netisr_unregister(const struct netisr_handler *nhp) { - struct netisr *ni; - - isrstat.isrs_count++; /* XXX redundant */ - KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))), - ("bad isr %d", num)); - ni = &netisrs[num]; - if (ni->ni_queue == NULL) { - isrstat.isrs_drop++; - m_freem(m); - return; + struct netisr_work *npwp; +#ifdef INVARIANTS + const char *name; +#endif + u_int i, proto; + + proto = nhp->nh_proto; +#ifdef INVARIANTS + name = nhp->nh_name; +#endif + KASSERT(proto < NETISR_MAXPROT, + ("%s(%u): protocol too big for %s", __func__, proto, name)); + + NETISR_WLOCK(); + KASSERT(np[proto].np_handler != NULL, + ("%s(%u): protocol not registered for %s", __func__, proto, + name)); + + np[proto].np_name = NULL; + np[proto].np_handler = NULL; + np[proto].np_m2flow = NULL; + np[proto].np_m2cpuid = NULL; + np[proto].np_qlimit = 0; + np[proto].np_policy = 0; + for (i = 0; i < MAXCPU; i++) { + npwp = &nws[i].nws_work[proto]; + netisr_drain_proto(npwp); + bzero(npwp, sizeof(*npwp)); } + NETISR_WUNLOCK(); +} + +/* + * Look up the workstream given a packet and source identifier. Do this by + * checking the protocol's policy, and optionally call out to the protocol + * for assistance if required. + */ +static struct mbuf * +netisr_select_cpuid(struct netisr_proto *npp, uintptr_t source, + struct mbuf *m, u_int *cpuidp) +{ + struct ifnet *ifp; + + NETISR_LOCK_ASSERT(); /* - * Directly dispatch handling of this packet, if permitted by global - * policy. Source ordering is maintained by virtue of callers - * consistently calling one of queued or direct dispatch. + * In the event we have only one worker, shortcut and deliver to it + * without further ado. */ - if (netisr_direct) { - isrstat.isrs_directed++; - ni->ni_handler(m); + if (nws_count == 1) { + *cpuidp = nws_array[0]; + return (m); + } + + /* + * What happens next depends on the policy selected by the protocol. + * If we want to support per-interface policies, we should do that + * here first. + */ + switch (npp->np_policy) { + case NETISR_POLICY_CPU: + return (npp->np_m2cpuid(m, source, cpuidp)); + + case NETISR_POLICY_FLOW: + if (!(m->m_flags & M_FLOWID) && npp->np_m2flow != NULL) { + m = npp->np_m2flow(m, source); + if (m == NULL) + return (NULL); + } + if (m->m_flags & M_FLOWID) { + *cpuidp = + netisr_default_flow2cpu(m->m_pkthdr.flowid); + return (m); + } + /* FALLTHROUGH */ + + case NETISR_POLICY_SOURCE: + ifp = m->m_pkthdr.rcvif; + if (ifp != NULL) + *cpuidp = nws_array[(ifp->if_index + source) % + nws_count]; + else + *cpuidp = nws_array[source % nws_count]; + return (m); + + default: + panic("%s: invalid policy %u for %s", __func__, + npp->np_policy, npp->np_name); + } +} + +/* + * Process packets associated with a workstream and protocol. For reasons of + * fairness, we process up to one complete netisr queue at a time, moving the + * queue to a stack-local queue for processing, but do not loop refreshing + * from the global queue. The caller is responsible for deciding whether to + * loop, and for setting the NWS_RUNNING flag. The passed workstream will be + * locked on entry and relocked before return, but will be released while + * processing. The number of packets processed is returned. + */ +static u_int +netisr_process_workstream_proto(struct netisr_workstream *nwsp, u_int proto) +{ + struct netisr_work local_npw, *npwp; + u_int handled; + struct mbuf *m; + + NETISR_LOCK_ASSERT(); + NWS_LOCK_ASSERT(nwsp); + + KASSERT(nwsp->nws_flags & NWS_RUNNING, + ("%s(%u): not running", __func__, proto)); + KASSERT(proto >= 0 && proto < NETISR_MAXPROT, + ("%s(%u): invalid proto\n", __func__, proto)); + + npwp = &nwsp->nws_work[proto]; + if (npwp->nw_len == 0) + return (0); + + /* + * Move the global work queue to a thread-local work queue. + * + * Notice that this means the effective maximum length of the queue + * is actually twice that of the maximum queue length specified in + * the protocol registration call. + */ + handled = npwp->nw_len; + local_npw = *npwp; + npwp->nw_head = NULL; + npwp->nw_tail = NULL; + npwp->nw_len = 0; + nwsp->nws_pendingbits &= ~(1 << proto); + NWS_UNLOCK(nwsp); + while ((m = local_npw.nw_head) != NULL) { + local_npw.nw_head = m->m_nextpkt; + m->m_nextpkt = NULL; + if (local_npw.nw_head == NULL) + local_npw.nw_tail = NULL; + local_npw.nw_len--; + VNET_ASSERT(m->m_pkthdr.rcvif != NULL); + CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); + np[proto].np_handler(m); + CURVNET_RESTORE(); + } + KASSERT(local_npw.nw_len == 0, + ("%s(%u): len %u", __func__, proto, local_npw.nw_len)); + NWS_LOCK(nwsp); + npwp->nw_handled += handled; + return (handled); +} + +/* + * SWI handler for netisr -- processes prackets in a set of workstreams that + * it owns, woken up by calls to NWS_SIGNAL(). If this workstream is already + * being direct dispatched, go back to sleep and wait for the dispatching + * thread to wake us up again. + */ +static void +swi_net(void *arg) +{ +#ifdef NETISR_LOCKING + struct rm_priotracker tracker; +#endif + struct netisr_workstream *nwsp; + u_int bits, prot; + + nwsp = arg; + +#ifdef DEVICE_POLLING + KASSERT(nws_count == 1, + ("%s: device_polling but nws_count != 1", __func__)); + netisr_poll(); +#endif +#ifdef NETISR_LOCKING + NETISR_RLOCK(&tracker); +#endif + NWS_LOCK(nwsp); + KASSERT(!(nwsp->nws_flags & NWS_RUNNING), ("swi_net: running")); + if (nwsp->nws_flags & NWS_DISPATCHING) + goto out; + nwsp->nws_flags |= NWS_RUNNING; + nwsp->nws_flags &= ~NWS_SCHEDULED; + while ((bits = nwsp->nws_pendingbits) != 0) { + while ((prot = ffs(bits)) != 0) { + prot--; + bits &= ~(1 << prot); + (void)netisr_process_workstream_proto(nwsp, prot); + } + } + nwsp->nws_flags &= ~NWS_RUNNING; +out: + NWS_UNLOCK(nwsp); +#ifdef NETISR_LOCKING + NETISR_RUNLOCK(&tracker); +#endif +#ifdef DEVICE_POLLING + netisr_pollmore(); +#endif +} + +static int +netisr_queue_workstream(struct netisr_workstream *nwsp, u_int proto, + struct netisr_work *npwp, struct mbuf *m, int *dosignalp) +{ + + NWS_LOCK_ASSERT(nwsp); + + *dosignalp = 0; + if (npwp->nw_len < npwp->nw_qlimit) { + m->m_nextpkt = NULL; + if (npwp->nw_head == NULL) { + npwp->nw_head = m; + npwp->nw_tail = m; + } else { + npwp->nw_tail->m_nextpkt = m; + npwp->nw_tail = m; + } + npwp->nw_len++; + if (npwp->nw_len > npwp->nw_watermark) + npwp->nw_watermark = npwp->nw_len; + nwsp->nws_pendingbits |= (1 << proto); + if (!(nwsp->nws_flags & + (NWS_RUNNING | NWS_DISPATCHING | NWS_SCHEDULED))) { + nwsp->nws_flags |= NWS_SCHEDULED; + *dosignalp = 1; /* Defer until unlocked. */ + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From rse at FreeBSD.org Mon Jun 1 10:50:18 2009 From: rse at FreeBSD.org (Ralf S. Engelschall) Date: Mon Jun 1 10:50:30 2009 Subject: svn commit: r193221 - head/bin/sh Message-ID: <200906011050.n51AoH4n076677@svn.freebsd.org> Author: rse Date: Mon Jun 1 10:50:17 2009 New Revision: 193221 URL: http://svn.freebsd.org/changeset/base/193221 Log: be more type correct and align local ckmalloc() with its underlying malloc(3) by using a "size_t" instead of an "int" argument Modified: head/bin/sh/alias.c head/bin/sh/memalloc.c head/bin/sh/memalloc.h head/bin/sh/mkinit.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/alias.c Mon Jun 1 10:50:17 2009 (r193221) @@ -97,7 +97,7 @@ setalias(char *name, char *val) ap->val = savestr(val); #else /* hack */ { - int len = strlen(val); + size_t len = strlen(val); ap->val = ckmalloc(len + 2); memcpy(ap->val, val, len); ap->val[len] = ' '; /* fluff */ Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/memalloc.c Mon Jun 1 10:50:17 2009 (r193221) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); */ pointer -ckmalloc(int nbytes) +ckmalloc(size_t nbytes) { pointer p; Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/memalloc.h Mon Jun 1 10:50:17 2009 (r193221) @@ -33,6 +33,8 @@ * $FreeBSD$ */ +#include + struct stackmark { struct stack_block *stackp; char *stacknxt; @@ -46,7 +48,7 @@ extern int stacknleft; extern int sstrnleft; extern int herefd; -pointer ckmalloc(int); +pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); void ckfree(pointer); char *savestr(char *); Modified: head/bin/sh/mkinit.c ============================================================================== --- head/bin/sh/mkinit.c Mon Jun 1 10:49:08 2009 (r193220) +++ head/bin/sh/mkinit.c Mon Jun 1 10:50:17 2009 (r193221) @@ -159,7 +159,7 @@ void addstr(char *, struct text *); void addchar(int, struct text *); void writetext(struct text *, FILE *); FILE *ckfopen(char *, char *); -void *ckmalloc(int); +void *ckmalloc(size_t); char *savestr(char *); void error(char *); @@ -464,7 +464,7 @@ ckfopen(char *file, char *mode) } void * -ckmalloc(int nbytes) +ckmalloc(size_t nbytes) { char *p; From rse at FreeBSD.org Mon Jun 1 11:02:11 2009 From: rse at FreeBSD.org (Ralf S. Engelschall) Date: Mon Jun 1 11:02:16 2009 Subject: svn commit: r193222 - head/bin/sh Message-ID: <200906011102.n51B2AFv076962@svn.freebsd.org> Author: rse Date: Mon Jun 1 11:02:09 2009 New Revision: 193222 URL: http://svn.freebsd.org/changeset/base/193222 Log: correctly test for __GNUC__ macro (non-GCC compilers do not have it defined at all) Modified: head/bin/sh/eval.c head/bin/sh/parser.c head/bin/sh/var.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Mon Jun 1 10:50:17 2009 (r193221) +++ head/bin/sh/eval.c Mon Jun 1 11:02:09 2009 (r193222) @@ -594,7 +594,7 @@ evalcommand(union node *cmd, int flags, char *lastarg; int realstatus; int do_clearcmdentry; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &argv; (void) &argc; Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Mon Jun 1 10:50:17 2009 (r193221) +++ head/bin/sh/parser.c Mon Jun 1 11:02:09 2009 (r193222) @@ -898,7 +898,7 @@ readtoken1(int firstc, char const *synta int oldstyle; char const *prevsyntax; /* syntax before arithmetic */ int synentry; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &out; (void) "ef; @@ -1323,7 +1323,7 @@ parsebackq: { struct jmploc *volatile savehandler; int savelen; int saveprompt; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &saveprompt; #endif Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Mon Jun 1 10:50:17 2009 (r193221) +++ head/bin/sh/var.c Mon Jun 1 11:02:09 2009 (r193222) @@ -195,7 +195,7 @@ setvarsafe(char *name, char *val, int fl struct jmploc jmploc; struct jmploc *volatile savehandler = handler; int err = 0; -#if __GNUC__ +#ifdef __GNUC__ /* Avoid longjmp clobbering */ (void) &err; #endif From rse at FreeBSD.org Mon Jun 1 11:11:47 2009 From: rse at FreeBSD.org (Ralf S. Engelschall) Date: Mon Jun 1 11:11:53 2009 Subject: svn commit: r193223 - head/bin/sh Message-ID: <200906011111.n51BBkZt077175@svn.freebsd.org> Author: rse Date: Mon Jun 1 11:11:46 2009 New Revision: 193223 URL: http://svn.freebsd.org/changeset/base/193223 Log: align coding style with style(9) to avoid misunderstandings Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Mon Jun 1 11:02:09 2009 (r193222) +++ head/bin/sh/exec.c Mon Jun 1 11:11:46 2009 (r193223) @@ -187,7 +187,8 @@ padvance(char **path, char *name) if (*path == NULL) return NULL; start = *path; - for (p = start ; *p && *p != ':' && *p != '%' ; p++); + for (p = start; *p && *p != ':' && *p != '%'; p++) + ; /* nothing */ len = p - start + strlen(name) + 2; /* "2" is for '/' and '\0' */ while (stackblocksize() < len) growstackblock(); From rse at FreeBSD.org Mon Jun 1 11:38:39 2009 From: rse at FreeBSD.org (Ralf S. Engelschall) Date: Mon Jun 1 11:38:45 2009 Subject: svn commit: r193225 - head/bin/sh Message-ID: <200906011138.n51BcduU077727@svn.freebsd.org> Author: rse Date: Mon Jun 1 11:38:38 2009 New Revision: 193225 URL: http://svn.freebsd.org/changeset/base/193225 Log: use explicit 'unsigned int' instead of just the implicit-style 'unsigned' to make linting tools (e.g. FlexeLint) happy, too Modified: head/bin/sh/mksyntax.c Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Mon Jun 1 11:15:54 2009 (r193224) +++ head/bin/sh/mksyntax.c Mon Jun 1 11:38:38 2009 (r193225) @@ -354,7 +354,7 @@ output_type_macros(void) char **pp; if (digit_contig) - macro[0] = "#define is_digit(c)\t((unsigned)((c) - '0') <= 9)"; + macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; for (pp = macro ; *pp ; pp++) fprintf(hfile, "%s\n", *pp); if (digit_contig) From mav at FreeBSD.org Mon Jun 1 13:13:48 2009 From: mav at FreeBSD.org (Alexander Motin) Date: Mon Jun 1 13:18:03 2009 Subject: svn commit: r193228 - head/sys/dev/sound/pci/hda Message-ID: <200906011313.n51DDl9f079872@svn.freebsd.org> Author: mav Date: Mon Jun 1 13:13:47 2009 New Revision: 193228 URL: http://svn.freebsd.org/changeset/base/193228 Log: Comment out old Realtek ALC883 quirk, that was disabling phantop power on mic inputs. I have no idea what for it was made that time, but now I have several reports that it should be removed to make microphones work. If this quirk is still required for some systems then they should be identified and specified explicitly. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Jun 1 12:29:27 2009 (r193227) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Jun 1 13:13:47 2009 (r193228) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090401_0132" +#define HDA_DRV_TEST_REV "20090601_0133" SND_DECLARE_FILE("$FreeBSD$"); @@ -4657,6 +4657,7 @@ hdac_vendor_patch_parse(struct hdac_devi } switch (id) { +#if 0 case HDA_CODEC_ALC883: /* * nid: 24/25 = External (jack) or Internal (fixed) Mic. @@ -4686,6 +4687,7 @@ hdac_vendor_patch_parse(struct hdac_devi * nid: 26 = Line-in, leave it alone. */ break; +#endif case HDA_CODEC_AD1983: /* * This codec has several possible usages, but none From jhb at FreeBSD.org Mon Jun 1 14:20:14 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 1 14:20:43 2009 Subject: svn commit: r193229 - head/sys/boot/i386/libi386 Message-ID: <200906011420.n51EKEMT081350@svn.freebsd.org> Author: jhb Date: Mon Jun 1 14:20:13 2009 New Revision: 193229 URL: http://svn.freebsd.org/changeset/base/193229 Log: Add a missing parameter when displaying GPT partitions with an unknown UUID. Submitted by: Pawel Worach pawel.worach | gmail MFC after: 1 week Modified: head/sys/boot/i386/libi386/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Mon Jun 1 13:13:47 2009 (r193228) +++ head/sys/boot/i386/libi386/biosdisk.c Mon Jun 1 14:20:13 2009 (r193229) @@ -387,6 +387,7 @@ bd_printgptpart(struct open_disk *od, st sprintf(line, "%s: FreeBSD swap%s\n", prefix, stats); else sprintf(line, "%s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x%s\n", + prefix, gp->gp_type.time_low, gp->gp_type.time_mid, gp->gp_type.time_hi_and_version, gp->gp_type.clock_seq_hi_and_reserved, gp->gp_type.clock_seq_low, From jhb at freebsd.org Mon Jun 1 14:26:21 2009 From: jhb at freebsd.org (John Baldwin) Date: Mon Jun 1 14:26:31 2009 Subject: svn commit: r193159 - head/sys/powerpc/powermac In-Reply-To: <200905311002.n4VA2K6c037776@svn.freebsd.org> References: <200905311002.n4VA2K6c037776@svn.freebsd.org> Message-ID: <200906010822.19951.jhb@freebsd.org> On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun May 31 10:02:20 2009 > New Revision: 193159 > URL: http://svn.freebsd.org/changeset/base/193159 > > Log: > Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to > determine whether the computer is plugged in to mains power. I wonder if it would be a good idea to introduce a platform-independent 'acline' sysctl? Something like 'hw.acline'? For now we could simply have these devices create it. We could do something fancier where AC adapter drivers register with a centralized thingie at some point and it exports a global setting that is true so long as at least one adapter is online. I'm not sure that level of complexity is warranted until we have platforms with multiple AC lines exposed to the OS though. -- John Baldwin From bms at incunabulum.net Mon Jun 1 14:34:18 2009 From: bms at incunabulum.net (Bruce Simpson) Date: Mon Jun 1 14:34:29 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <200906010537.n515bDou065357@svn.freebsd.org> References: <200906010537.n515bDou065357@svn.freebsd.org> Message-ID: <4A23E6E4.7020506@incunabulum.net> Doug Barton wrote: > Log: > Eliminate the warning that "Values of network_interfaces other than > AUTO are deprecated.' There is no good reason to deprecate them, and > setting this to different values can be useful for custom solutions > and/or one-off configuration problems. > Thanks, I wasn't sure what the alternative to this functionality was going to be, and was relying on this mechanism for a product. From rwatson at FreeBSD.org Mon Jun 1 15:03:59 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Mon Jun 1 15:04:10 2009 Subject: svn commit: r193230 - head/sys/net Message-ID: <200906011503.n51F3wp5082274@svn.freebsd.org> Author: rwatson Date: Mon Jun 1 15:03:58 2009 New Revision: 193230 URL: http://svn.freebsd.org/changeset/base/193230 Log: Garbage collect NETISR_POLL and NETISR_POLLMORE, which are no longer required for options DEVICE_POLLING. De-fragment the NETISR_ constant space and lower NETISR_MAXPROT from 32 to 16 -- when sizing queue arrays using this compile-time constant, significant amounts of memory are saved. Warn on the console when tunable values for netisr are automatically adjusted during boot due to exceeding limits, invalid values, or as a result of DEVICE_POLLING. Modified: head/sys/net/netisr.c head/sys/net/netisr.h Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Jun 1 14:20:13 2009 (r193229) +++ head/sys/net/netisr.c Mon Jun 1 15:03:58 2009 (r193230) @@ -201,7 +201,7 @@ struct netisr_proto { u_int np_policy; /* Work placement policy. */ }; -#define NETISR_MAXPROT 32 /* Compile-time limit. */ +#define NETISR_MAXPROT 16 /* Compile-time limit. */ /* * The np array describes all registered protocols, indexed by protocol @@ -1045,20 +1045,31 @@ netisr_init(void *arg) KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__)); NETISR_LOCK_INIT(); - if (netisr_maxthreads < 1) + if (netisr_maxthreads < 1) { + printf("netisr2: forcing maxthreads to 1\n"); netisr_maxthreads = 1; - if (netisr_maxthreads > MAXCPU) + } + if (netisr_maxthreads > MAXCPU) { + printf("netisr2: forcing maxthreads to %d\n", MAXCPU); netisr_maxthreads = MAXCPU; - if (netisr_defaultqlimit > netisr_maxqlimit) + } + if (netisr_defaultqlimit > netisr_maxqlimit) { + printf("netisr2: forcing defaultqlimit to %d\n", + netisr_maxqlimit); netisr_defaultqlimit = netisr_maxqlimit; + } #ifdef DEVICE_POLLING /* * The device polling code is not yet aware of how to deal with * multiple netisr threads, so for the time being compiling in device * polling disables parallel netisr workers. */ - netisr_maxthreads = 1; - netisr_bindthreads = 0; + if (netisr_maxthreads != 1 || netisr_bindthreads != 0) { + printf("netisr2: forcing maxthreads to 1 and bindthreads to " + "0 for device polling\n"); + netisr_maxthreads = 1; + netisr_bindthreads = 0; + } #endif netisr_start_swi(curcpu, pcpu_find(curcpu)); Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Mon Jun 1 14:20:13 2009 (r193229) +++ head/sys/net/netisr.h Mon Jun 1 15:03:58 2009 (r193230) @@ -39,19 +39,17 @@ * Historically, this was implemented by the BSD software ISR facility; it is * now implemented via a software ithread (SWI). */ -#define NETISR_POLL 0 /* polling callback, must be first */ -#define NETISR_IP 2 /* same as AF_INET */ -#define NETISR_IGMP 3 /* IGMPv3 output queue */ -#define NETISR_ROUTE 14 /* routing socket */ -#define NETISR_AARP 15 /* Appletalk ARP */ -#define NETISR_ATALK2 16 /* Appletalk phase 2 */ -#define NETISR_ATALK1 17 /* Appletalk phase 1 */ -#define NETISR_ARP 18 /* same as AF_LINK */ -#define NETISR_IPX 23 /* same as AF_IPX */ -#define NETISR_ETHER 24 /* ethernet input */ -#define NETISR_IPV6 27 -#define NETISR_NATM 28 -#define NETISR_POLLMORE 31 /* polling callback, must be last */ +#define NETISR_IP 1 +#define NETISR_IGMP 2 /* IGMPv3 output queue */ +#define NETISR_ROUTE 3 /* routing socket */ +#define NETISR_AARP 4 /* Appletalk ARP */ +#define NETISR_ATALK2 5 /* Appletalk phase 2 */ +#define NETISR_ATALK1 6 /* Appletalk phase 1 */ +#define NETISR_ARP 7 /* same as AF_LINK */ +#define NETISR_IPX 8 /* same as AF_IPX */ +#define NETISR_ETHER 9 /* ethernet input */ +#define NETISR_IPV6 10 +#define NETISR_NATM 11 /*- * Protocols express ordering constraints and affinity preferences by From tevans.uk at googlemail.com Mon Jun 1 15:13:23 2009 From: tevans.uk at googlemail.com (Tom Evans) Date: Mon Jun 1 15:13:29 2009 Subject: svn commit: r192800 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/common/acl cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/u... In-Reply-To: <20090526200925.GA41682@lor.one-eyed-alien.net> References: <200905260822.n4Q8M0Zv051280@svn.freebsd.org> <9bbcef730905260624x289af079ue8524e821c1dc891@mail.gmail.com> <20090526200925.GA41682@lor.one-eyed-alien.net> Message-ID: <1243867778.9871.78.camel@strangepork.london.mintel.ad> On Tue, 2009-05-26 at 15:09 -0500, Brooks Davis wrote: > On Tue, May 26, 2009 at 03:24:05PM +0200, Ivan Voras wrote: > > 2009/5/26 Robert Watson : > > > On Tue, 26 May 2009, Edward Tomasz Napierala wrote: > > > > > >> +/*- > > >> + * Copyright (c) 2008, 2009 Edward Tomasz Napiera??a > > >> + * 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. > > >> + * > > >> + * ALTHOUGH THIS SOFTWARE IS MADE OF WIN AND SCIENCE, IT IS PROVIDED BY > > >> THE > > > > > > Cute though this BSD license variation is, I'm pretty sure it's not on the > > > approved license list. ??Sticking to the standard license templates > > > potentially saves significant trouble later -- especially when people > > > > Hmm, I'm sure that there exists some SVN magic which would allow > > authors to enter something > > > > $BSDL2 Charlie Root 2008,2009$ > > > > and it expands to a perfect boilerplate on checkout :) > > Such a change would result in a repository filled without license blocks. > This might be appropriate in a corporate setting, but isn't worth > considering here since copies of the repo would lack correct > attributions. > > -- Brooks It could also be written as a pre-commit hook, rather than as a property expansion, which would assuage those concerns. Of course you then get a whole bunch of other concerns, like what is checked by the committer is not what is actually checked in. Cheers Tom From bms at FreeBSD.org Mon Jun 1 15:30:19 2009 From: bms at FreeBSD.org (Bruce M Simpson) Date: Mon Jun 1 15:30:26 2009 Subject: svn commit: r193231 - head/sys/netinet Message-ID: <200906011530.n51FUIJ9082844@svn.freebsd.org> Author: bms Date: Mon Jun 1 15:30:18 2009 New Revision: 193231 URL: http://svn.freebsd.org/changeset/base/193231 Log: Merge fixes from p4: * Tighten v1 query input processing. * Borrow changes from MLDv2 for how general queries are processed. * Do address field validation upfront before accepting input. * Do NOT switch protocol version if old querier present timer active. * Always clear IGMPv3 state in igmp_v3_cancel_link_timers(). * Update comments. Tested by: deeptech71 at gmail dot com Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Mon Jun 1 15:03:58 2009 (r193230) +++ head/sys/netinet/igmp.c Mon Jun 1 15:30:18 2009 (r193231) @@ -98,7 +98,8 @@ static void igmp_final_leave(struct in_m static int igmp_handle_state_change(struct in_multi *, struct igmp_ifinfo *); static int igmp_initial_join(struct in_multi *, struct igmp_ifinfo *); -static int igmp_input_v1_query(struct ifnet *, const struct ip *); +static int igmp_input_v1_query(struct ifnet *, const struct ip *, + const struct igmp *); static int igmp_input_v2_query(struct ifnet *, const struct ip *, const struct igmp *); static int igmp_input_v3_query(struct ifnet *, const struct ip *, @@ -702,7 +703,8 @@ igi_delete_locked(const struct ifnet *if * VIMAGE: The curvnet pointer is derived from the input ifp. */ static int -igmp_input_v1_query(struct ifnet *ifp, const struct ip *ip) +igmp_input_v1_query(struct ifnet *ifp, const struct ip *ip, + const struct igmp *igmp) { INIT_VNET_INET(ifp->if_vnet); struct ifmultiaddr *ifma; @@ -710,20 +712,18 @@ igmp_input_v1_query(struct ifnet *ifp, c struct in_multi *inm; /* - * IGMPv1 General Queries SHOULD always addressed to 224.0.0.1. + * IGMPv1 Host Mmembership Queries SHOULD always be addressed to + * 224.0.0.1. They are always treated as General Queries. * igmp_group is always ignored. Do not drop it as a userland * daemon may wish to see it. + * XXX SMPng: unlocked increments in igmpstat assumed atomic. */ - if (!in_allhosts(ip->ip_dst)) { + if (!in_allhosts(ip->ip_dst) || !in_nullhost(igmp->igmp_group)) { IGMPSTAT_INC(igps_rcv_badqueries); return (0); } - IGMPSTAT_INC(igps_rcv_gen_queries); - /* - * Switch to IGMPv1 host compatibility mode. - */ IN_MULTI_LOCK(); IGMP_LOCK(); @@ -736,6 +736,9 @@ igmp_input_v1_query(struct ifnet *ifp, c goto out_locked; } + /* + * Switch to IGMPv1 host compatibility mode. + */ igmp_set_version(igi, IGMP_VERSION_1); CTR2(KTR_IGMPV3, "process v1 query on ifp %p(%s)", ifp, ifp->if_xname); @@ -793,12 +796,29 @@ igmp_input_v2_query(struct ifnet *ifp, c struct ifmultiaddr *ifma; struct igmp_ifinfo *igi; struct in_multi *inm; + int is_general_query; uint16_t timer; + is_general_query = 0; + /* - * Perform lazy allocation of IGMP link info if required, - * and switch to IGMPv2 host compatibility mode. + * Validate address fields upfront. + * XXX SMPng: unlocked increments in igmpstat assumed atomic. */ + if (in_nullhost(igmp->igmp_group)) { + /* + * IGMPv2 General Query. + * If this was not sent to the all-hosts group, ignore it. + */ + if (!in_allhosts(ip->ip_dst)) + return (0); + IGMPSTAT_INC(igps_rcv_gen_queries); + is_general_query = 1; + } else { + /* IGMPv2 Group-Specific Query. */ + IGMPSTAT_INC(igps_rcv_group_queries); + } + IN_MULTI_LOCK(); IGMP_LOCK(); @@ -811,16 +831,37 @@ igmp_input_v2_query(struct ifnet *ifp, c goto out_locked; } + /* + * Ignore v2 query if in v1 Compatibility Mode. + */ + if (igi->igi_version == IGMP_VERSION_1) + goto out_locked; + igmp_set_version(igi, IGMP_VERSION_2); timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE; if (timer == 0) timer = 1; - if (!in_nullhost(igmp->igmp_group)) { + if (is_general_query) { /* - * IGMPv2 Group-Specific Query. - * If this is a group-specific IGMPv2 query, we need only + * For each reporting group joined on this + * interface, kick the report timer. + */ + CTR2(KTR_IGMPV3, "process v2 general query on ifp %p(%s)", + ifp, ifp->if_xname); + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) + continue; + inm = (struct in_multi *)ifma->ifma_protospec; + igmp_v2_update_group(inm, timer); + } + IF_ADDR_UNLOCK(ifp); + } else { + /* + * Group-specific IGMPv2 query, we need only * look up the single group to process it. */ inm = inm_lookup(ifp, igmp->igmp_group); @@ -829,32 +870,6 @@ igmp_input_v2_query(struct ifnet *ifp, c inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); igmp_v2_update_group(inm, timer); } - IGMPSTAT_INC(igps_rcv_group_queries); - } else { - /* - * IGMPv2 General Query. - * If this was not sent to the all-hosts group, ignore it. - */ - if (in_allhosts(ip->ip_dst)) { - /* - * For each reporting group joined on this - * interface, kick the report timer. - */ - CTR2(KTR_IGMPV3, - "process v2 general query on ifp %p(%s)", - ifp, ifp->if_xname); - - IF_ADDR_LOCK(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET || - ifma->ifma_protospec == NULL) - continue; - inm = (struct in_multi *)ifma->ifma_protospec; - igmp_v2_update_group(inm, timer); - } - IF_ADDR_UNLOCK(ifp); - } - IGMPSTAT_INC(igps_rcv_gen_queries); } out_locked: @@ -933,10 +948,13 @@ igmp_input_v3_query(struct ifnet *ifp, c INIT_VNET_INET(ifp->if_vnet); struct igmp_ifinfo *igi; struct in_multi *inm; + int is_general_query; uint32_t maxresp, nsrc, qqi; uint16_t timer; uint8_t qrv; + is_general_query = 0; + CTR2(KTR_IGMPV3, "process v3 query on ifp %p(%s)", ifp, ifp->if_xname); maxresp = igmpv3->igmp_code; /* in 1/10ths of a second */ @@ -947,7 +965,7 @@ igmp_input_v3_query(struct ifnet *ifp, c /* * Robustness must never be less than 2 for on-wire IGMPv3. - * FIXME: Check if ifp has IGIF_LOOPBACK set, as we make + * FUTURE: Check if ifp has IGIF_LOOPBACK set, as we will make * an exception for interfaces whose IGMPv3 state changes * are redirected to loopback (e.g. MANET). */ @@ -970,6 +988,33 @@ igmp_input_v3_query(struct ifnet *ifp, c nsrc = ntohs(igmpv3->igmp_numsrc); + /* + * Validate address fields and versions upfront before + * accepting v3 query. + * XXX SMPng: Unlocked access to igmpstat counters here. + */ + if (in_nullhost(igmpv3->igmp_group)) { + /* + * IGMPv3 General Query. + * + * General Queries SHOULD be directed to 224.0.0.1. + * A general query with a source list has undefined + * behaviour; discard it. + */ + IGMPSTAT_INC(igps_rcv_gen_queries); + if (!in_allhosts(ip->ip_dst) || nsrc > 0) { + IGMPSTAT_INC(igps_rcv_badqueries); + return (0); + } + is_general_query = 1; + } else { + /* Group or group-source specific query. */ + if (nsrc == 0) + IGMPSTAT_INC(igps_rcv_group_queries); + else + IGMPSTAT_INC(igps_rcv_gsr_queries); + } + IN_MULTI_LOCK(); IGMP_LOCK(); @@ -982,8 +1027,19 @@ igmp_input_v3_query(struct ifnet *ifp, c goto out_locked; } - igmp_set_version(igi, IGMP_VERSION_3); + /* + * Discard the v3 query if we're in Compatibility Mode. + * The RFC is not obviously worded that hosts need to stay in + * compatibility mode until the Old Version Querier Present + * timer expires. + */ + if (igi->igi_version != IGMP_VERSION_3) { + CTR3(KTR_IGMPV3, "ignore v3 query in v%d mode on ifp %p(%s)", + igi->igi_version, ifp, ifp->if_xname); + goto out_locked; + } + igmp_set_version(igi, IGMP_VERSION_3); igi->igi_rv = qrv; igi->igi_qi = qqi; igi->igi_qri = maxresp; @@ -991,41 +1047,23 @@ igmp_input_v3_query(struct ifnet *ifp, c CTR4(KTR_IGMPV3, "%s: qrv %d qi %d qri %d", __func__, qrv, qqi, maxresp); - if (in_nullhost(igmpv3->igmp_group)) { + if (is_general_query) { /* - * IGMPv3 General Query. * Schedule a current-state report on this ifp for * all groups, possibly containing source lists. - */ - IGMPSTAT_INC(igps_rcv_gen_queries); - - if (!in_allhosts(ip->ip_dst) || nsrc > 0) { - /* - * General Queries SHOULD be directed to 224.0.0.1. - * A general query with a source list has undefined - * behaviour; discard it. - */ - IGMPSTAT_INC(igps_rcv_badqueries); - goto out_locked; - } - - CTR2(KTR_IGMPV3, "process v3 general query on ifp %p(%s)", - ifp, ifp->if_xname); - - /* * If there is a pending General Query response * scheduled earlier than the selected delay, do * not schedule any other reports. * Otherwise, reset the interface timer. */ + CTR2(KTR_IGMPV3, "process v3 general query on ifp %p(%s)", + ifp, ifp->if_xname); if (igi->igi_v3_timer == 0 || igi->igi_v3_timer >= timer) { igi->igi_v3_timer = IGMP_RANDOM_DELAY(timer); V_interface_timers_running = 1; } } else { /* - * IGMPv3 Group-specific or Group-and-source-specific Query. - * * Group-source-specific queries are throttled on * a per-group basis to defeat denial-of-service attempts. * Queries for groups we are not a member of on this @@ -1035,7 +1073,6 @@ igmp_input_v3_query(struct ifnet *ifp, c if (inm == NULL) goto out_locked; if (nsrc > 0) { - IGMPSTAT_INC(igps_rcv_gsr_queries); if (!ratecheck(&inm->inm_lastgsrtv, &V_igmp_gsrdelay)) { CTR1(KTR_IGMPV3, "%s: GS query throttled.", @@ -1043,8 +1080,6 @@ igmp_input_v3_query(struct ifnet *ifp, c IGMPSTAT_INC(igps_drop_gsr_queries); goto out_locked; } - } else { - IGMPSTAT_INC(igps_rcv_group_queries); } CTR3(KTR_IGMPV3, "process v3 %s query on ifp %p(%s)", inet_ntoa(igmpv3->igmp_group), ifp, ifp->if_xname); @@ -1467,7 +1502,7 @@ igmp_input(struct mbuf *m, int off) IGMPSTAT_INC(igps_rcv_v1v2_queries); if (!V_igmp_v1enable) break; - if (igmp_input_v1_query(ifp, ip) != 0) { + if (igmp_input_v1_query(ifp, ip, igmp) != 0) { m_freem(m); return; } @@ -1909,6 +1944,7 @@ igmp_v3_suppress_group_record(struct in_ static void igmp_set_version(struct igmp_ifinfo *igi, const int version) { + int old_version_timer; IGMP_LOCK_ASSERT(); @@ -1916,7 +1952,6 @@ igmp_set_version(struct igmp_ifinfo *igi version, igi->igi_ifp, igi->igi_ifp->if_xname); if (version == IGMP_VERSION_1 || version == IGMP_VERSION_2) { - int old_version_timer; /* * Compute the "Older Version Querier Present" timer as per * Section 8.12. @@ -1949,6 +1984,11 @@ igmp_set_version(struct igmp_ifinfo *igi /* * Cancel pending IGMPv3 timers for the given link and all groups * joined on it; state-change, general-query, and group-query timers. + * + * Only ever called on a transition from v3 to Compatibility mode. Kill + * the timers stone dead (this may be expensive for large N groups), they + * will be restarted if Compatibility Mode deems that they must be due to + * query processing. */ static void igmp_v3_cancel_link_timers(struct igmp_ifinfo *igi) @@ -1965,21 +2005,21 @@ igmp_v3_cancel_link_timers(struct igmp_i IGMP_LOCK_ASSERT(); /* - * Fast-track this potentially expensive operation - * by checking all the global 'timer pending' flags. + * Stop the v3 General Query Response on this link stone dead. + * If fasttimo is woken up due to V_interface_timers_running, + * the flag will be cleared if there are no pending link timers. */ - if (!V_interface_timers_running && - !V_state_change_timers_running && - !V_current_state_timers_running) - return; - igi->igi_v3_timer = 0; + /* + * Now clear the current-state and state-change report timers + * for all memberships scoped to this link. + */ ifp = igi->igi_ifp; - IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET) + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) continue; inm = (struct in_multi *)ifma->ifma_protospec; switch (inm->inm_state) { @@ -1989,12 +2029,19 @@ igmp_v3_cancel_link_timers(struct igmp_i case IGMP_LAZY_MEMBER: case IGMP_SLEEPING_MEMBER: case IGMP_AWAKENING_MEMBER: + /* + * These states are either not relevant in v3 mode, + * or are unreported. Do nothing. + */ break; case IGMP_LEAVING_MEMBER: /* - * If we are leaving the group and switching - * IGMP version, we need to release the final - * reference held for issuing the INCLUDE {}. + * If we are leaving the group and switching to + * compatibility mode, we need to release the final + * reference held for issuing the INCLUDE {}, and + * transition to REPORTING to ensure the host leave + * message is sent upstream to the old querier -- + * transition to NOT would lose the leave and race. * * SMPNG: Must drop and re-acquire IF_ADDR_LOCK * around inm_release_locked(), as it is not @@ -2009,15 +2056,16 @@ igmp_v3_cancel_link_timers(struct igmp_i inm_clear_recorded(inm); /* FALLTHROUGH */ case IGMP_REPORTING_MEMBER: - inm->inm_sctimer = 0; - inm->inm_timer = 0; inm->inm_state = IGMP_REPORTING_MEMBER; - /* - * Free any pending IGMPv3 state-change records. - */ - _IF_DRAIN(&inm->inm_scq); break; } + /* + * Always clear state-change and group report timers. + * Free any pending IGMPv3 state-change records. + */ + inm->inm_sctimer = 0; + inm->inm_timer = 0; + _IF_DRAIN(&inm->inm_scq); } IF_ADDR_UNLOCK(ifp); } From bz at FreeBSD.org Mon Jun 1 15:49:43 2009 From: bz at FreeBSD.org (Bjoern A. Zeeb) Date: Mon Jun 1 15:49:50 2009 Subject: svn commit: r193232 - in head: . sys/net sys/netinet sys/netinet6 sys/nfsclient sys/sys usr.bin/netstat Message-ID: <200906011549.n51FngRA083299@svn.freebsd.org> Author: bz Date: Mon Jun 1 15:49:42 2009 New Revision: 193232 URL: http://svn.freebsd.org/changeset/base/193232 Log: Convert the two dimensional array to be malloced and introduce an accessor function to get the correct rnh pointer back. Update netstat to get the correct pointer using kvm_read() as well. This not only fixes the ABI problem depending on the kernel option but also permits the tunable to overwrite the kernel option at boot time up to MAXFIBS, enlarging the number of FIBs without having to recompile. So people could just use GENERIC now. Reviewed by: julian, rwatson, zec X-MFC: not possible Modified: head/UPDATING head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/net/vnet.h head/sys/netinet/in_rmx.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6_rtr.c head/sys/nfsclient/bootp_subr.c head/sys/sys/param.h head/usr.bin/netstat/route.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 15:30:18 2009 (r193231) +++ head/UPDATING Mon Jun 1 15:49:42 2009 (r193232) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090601: + The way we are storing and accessing `routeing table' entries + has changed. Programs reading the FIB, like netstat, need to + be re-compiled. + Bump __FreeBSD_version to 800097. + 20090530: Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no more valid. Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/if.c Mon Jun 1 15:49:42 2009 (r193232) @@ -1001,7 +1001,8 @@ if_detach_internal(struct ifnet *ifp, in */ for (i = 1; i <= AF_MAX; i++) { for (j = 0; j < rt_numfibs; j++) { - if ((rnh = V_rt_tables[j][i]) == NULL) + rnh = rt_tables_get_rnh(j, i); + if (rnh == NULL) continue; RADIX_NODE_HEAD_LOCK(rnh); (void) rnh->rnh_walktree(rnh, if_rtdel, ifp); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/route.c Mon Jun 1 15:49:42 2009 (r193232) @@ -91,15 +91,7 @@ TUNABLE_INT("net.add_addr_allfibs", &rt_ #ifdef VIMAGE_GLOBALS static struct rtstat rtstat; - -/* by default only the first 'row' of tables will be accessed. */ -/* - * XXXMRT When we fix netstat, and do this differnetly, - * we can allocate this dynamically. As long as we are keeping - * things backwards compaitble we need to allocate this - * statically. - */ -struct radix_node_head *rt_tables[RT_MAXFIBS][AF_MAX+1]; +struct radix_node_head *rt_tables; static int rttrash; /* routes not in table but not freed */ #endif @@ -158,6 +150,32 @@ sysctl_my_fibnum(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD, NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller"); +static __inline struct radix_node_head ** +rt_tables_get_rnh_ptr(int table, int fam) +{ + INIT_VNET_NET(curvnet); + struct radix_node_head **rnh; + + KASSERT(table >= 0 && table < rt_numfibs, ("%s: table out of bounds.", + __func__)); + KASSERT(fam >= 0 && fam < (AF_MAX+1), ("%s: fam out of bounds.", + __func__)); + + /* rnh is [fib=0][af=0]. */ + rnh = (struct radix_node_head **)V_rt_tables; + /* Get the offset to the requested table and fam. */ + rnh += table * (AF_MAX+1) + fam; + + return (rnh); +} + +struct radix_node_head * +rt_tables_get_rnh(int table, int fam) +{ + + return (*rt_tables_get_rnh_ptr(table, fam)); +} + static void route_init(void) { @@ -179,10 +197,14 @@ route_init(void) static int vnet_route_iattach(const void *unused __unused) { INIT_VNET_NET(curvnet); - int table; struct domain *dom; + struct radix_node_head **rnh; + int table; int fam; + V_rt_tables = malloc(rt_numfibs * (AF_MAX+1) * + sizeof(struct radix_node_head *), M_RTABLE, M_WAITOK|M_ZERO); + V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { @@ -198,8 +220,10 @@ static int vnet_route_iattach(const void * (only for AF_INET and AF_INET6 * which don't need it anyhow) */ - dom->dom_rtattach( - (void **)&V_rt_tables[table][fam], + rnh = rt_tables_get_rnh_ptr(table, fam); + if (rnh == NULL) + panic("%s: rnh NULL", __func__); + dom->dom_rtattach((void **)rnh, dom->dom_rtoffset); } else { break; @@ -300,7 +324,7 @@ rtalloc1_fib(struct sockaddr *dst, int r KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ fibnum = 0; - rnh = V_rt_tables[fibnum][dst->sa_family]; + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); newrt = NULL; /* * Look up the address in the table for that Address Family @@ -362,7 +386,7 @@ rtfree(struct rtentry *rt) struct radix_node_head *rnh; KASSERT(rt != NULL,("%s: NULL rt", __func__)); - rnh = V_rt_tables[rt->rt_fibnum][rt_key(rt)->sa_family]; + rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); KASSERT(rnh != NULL,("%s: NULL rnh", __func__)); RT_LOCK_ASSERT(rt); @@ -463,8 +487,13 @@ rtredirect_fib(struct sockaddr *dst, short *stat = NULL; struct rt_addrinfo info; struct ifaddr *ifa; - struct radix_node_head *rnh = - V_rt_tables[fibnum][dst->sa_family]; + struct radix_node_head *rnh; + + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rnh == NULL) { + error = EAFNOSUPPORT; + goto out; + } /* verify the gateway is directly reachable */ if ((ifa = ifa_ifwithnet(gateway)) == NULL) { @@ -774,7 +803,7 @@ rtexpunge(struct rtentry *rt) /* * Find the correct routing tree to use for this Address Family */ - rnh = V_rt_tables[rt->rt_fibnum][rt_key(rt)->sa_family]; + rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); RT_LOCK_ASSERT(rt); if (rnh == NULL) return (EAFNOSUPPORT); @@ -942,7 +971,7 @@ rtrequest1_fib(int req, struct rt_addrin /* * Find the correct routing tree to use for this Address Family */ - rnh = V_rt_tables[fibnum][dst->sa_family]; + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); if (rnh == NULL) return (EAFNOSUPPORT); needlock = ((flags & RTF_RNH_LOCKED) == 0); @@ -1134,9 +1163,9 @@ rt_setgate(struct rtentry *rt, struct so /* XXX dst may be overwritten, can we move this to below */ int dlen = SA_SIZE(dst), glen = SA_SIZE(gate); #ifdef INVARIANTS - INIT_VNET_NET(curvnet); - struct radix_node_head *rnh = - V_rt_tables[rt->rt_fibnum][dst->sa_family]; + struct radix_node_head *rnh; + + rnh = rt_tables_get_rnh(rt->rt_fibnum, dst->sa_family); #endif RT_LOCK_ASSERT(rt); @@ -1203,7 +1232,6 @@ rt_maskedcopy(struct sockaddr *src, stru static inline int rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) { - INIT_VNET_NET(curvnet); struct sockaddr *dst; struct sockaddr *netmask; struct rtentry *rt = NULL; @@ -1273,7 +1301,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int * Look up an rtentry that is in the routing tree and * contains the correct info. */ - if ((rnh = V_rt_tables[fibnum][dst->sa_family]) == NULL) + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rnh == NULL) /* this table doesn't exist but others might */ continue; RADIX_NODE_HEAD_LOCK(rnh); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/route.h Mon Jun 1 15:49:42 2009 (r193232) @@ -373,7 +373,8 @@ struct rt_addrinfo { } \ } while (0) -extern struct radix_node_head *rt_tables[][AF_MAX+1]; +extern struct radix_node_head *rt_tables; +struct radix_node_head *rt_tables_get_rnh(int, int); struct ifmultiaddr; Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/rtsock.c Mon Jun 1 15:49:42 2009 (r193232) @@ -460,7 +460,6 @@ static int route_output(struct mbuf *m, struct socket *so) { #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) - INIT_VNET_NET(so->so_vnet); struct rt_msghdr *rtm = NULL; struct rtentry *rt = NULL; struct radix_node_head *rnh; @@ -561,7 +560,8 @@ route_output(struct mbuf *m, struct sock case RTM_GET: case RTM_CHANGE: case RTM_LOCK: - rnh = V_rt_tables[so->so_fibnum][info.rti_info[RTAX_DST]->sa_family]; + rnh = rt_tables_get_rnh(so->so_fibnum, + info.rti_info[RTAX_DST]->sa_family); if (rnh == NULL) senderr(EAFNOSUPPORT); RADIX_NODE_HEAD_RLOCK(rnh); @@ -1418,10 +1418,9 @@ done: static int sysctl_rtsock(SYSCTL_HANDLER_ARGS) { - INIT_VNET_NET(curvnet); int *name = (int *)arg1; u_int namelen = arg2; - struct radix_node_head *rnh; + struct radix_node_head *rnh = NULL; /* silence compiler. */ int i, lim, error = EINVAL; u_char af; struct walkarg w; @@ -1469,7 +1468,8 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) * take care of routing entries */ for (error = 0; error == 0 && i <= lim; i++) - if ((rnh = V_rt_tables[req->td->td_proc->p_fibnum][i]) != NULL) { + rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i); + if (rnh != NULL) { RADIX_NODE_HEAD_LOCK(rnh); error = rnh->rnh_walktree(rnh, sysctl_dumpentry, &w); Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/net/vnet.h Mon Jun 1 15:49:42 2009 (r193232) @@ -45,7 +45,7 @@ struct vnet_net { struct knlist _ifklist; struct rtstat _rtstat; - struct radix_node_head *_rt_tables[RT_MAXFIBS][AF_MAX+1]; + struct radix_node_head *_rt_tables; int _rttrash; uma_zone_t _rtzone; Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet/in_rmx.c Mon Jun 1 15:49:42 2009 (r193232) @@ -251,14 +251,14 @@ static void in_rtqtimo(void *rock) { CURVNET_SET((struct vnet *) rock); - INIT_VNET_NET(curvnet); INIT_VNET_INET(curvnet); int fibnum; void *newrock; struct timeval atv; for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - if ((newrock = V_rt_tables[fibnum][AF_INET]) != NULL) + newrock = rt_tables_get_rnh(fibnum, AF_INET); + if (newrock != NULL) in_rtqtimo_one(newrock); } atv.tv_usec = 0; @@ -324,10 +324,9 @@ in_rtqdrain(void) VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INIT_VNET_NET(vnet_iter); for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = V_rt_tables[fibnum][AF_INET]; + rnh = rt_tables_get_rnh(fibnum, AF_INET); arg.found = arg.killed = 0; arg.rnh = rnh; arg.nextstop = 0; @@ -423,7 +422,6 @@ in_ifadownkill(struct radix_node *rn, vo int in_ifadown(struct ifaddr *ifa, int delete) { - INIT_VNET_NET(curvnet); struct in_ifadown_arg arg; struct radix_node_head *rnh; int fibnum; @@ -432,7 +430,7 @@ in_ifadown(struct ifaddr *ifa, int delet return 1; for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = V_rt_tables[fibnum][AF_INET]; + rnh = rt_tables_get_rnh(fibnum, AF_INET); arg.ifa = ifa; arg.del = delete; RADIX_NODE_HEAD_LOCK(rnh); Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet6/in6_ifattach.c Mon Jun 1 15:49:42 2009 (r193232) @@ -777,11 +777,11 @@ statinit: void in6_ifdetach(struct ifnet *ifp) { - INIT_VNET_NET(ifp->if_vnet); INIT_VNET_INET(ifp->if_vnet); INIT_VNET_INET6(ifp->if_vnet); struct in6_ifaddr *ia, *oia; struct ifaddr *ifa, *next; + struct radix_node_head *rnh; struct rtentry *rt; short rtflags; struct sockaddr_in6 sin6; @@ -874,15 +874,16 @@ in6_ifdetach(struct ifnet *ifp) /* XXX: should not fail */ return; /* XXX grab lock first to avoid LOR */ - if (V_rt_tables[0][AF_INET6] != NULL) { - RADIX_NODE_HEAD_LOCK(V_rt_tables[0][AF_INET6]); + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh != NULL) { + RADIX_NODE_HEAD_LOCK(rnh); rt = rtalloc1((struct sockaddr *)&sin6, 0, RTF_RNH_LOCKED); if (rt) { if (rt->rt_ifp == ifp) rtexpunge(rt); RTFREE_LOCKED(rt); } - RADIX_NODE_HEAD_UNLOCK(V_rt_tables[0][AF_INET6]); + RADIX_NODE_HEAD_UNLOCK(rnh); } } Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet6/in6_rmx.c Mon Jun 1 15:49:42 2009 (r193232) @@ -289,13 +289,17 @@ static void in6_rtqtimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); - INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; struct rtqk_arg arg; struct timeval atv; static time_t last_adjusted_timeout = 0; + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) { + CURVNET_RESTORE(); + return; + } arg.found = arg.killed = 0; arg.rnh = rnh; arg.nextstop = time_uptime + V_rtq_timeout6; @@ -377,12 +381,16 @@ static void in6_mtutimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); - INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; struct mtuex_arg arg; struct timeval atv; + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) { + CURVNET_RESTORE(); + return; + } arg.rnh = rnh; arg.nextstop = time_uptime + MTUTIMO_DEFAULT; RADIX_NODE_HEAD_LOCK(rnh); @@ -405,9 +413,12 @@ void in6_rtqdrain(void) { INIT_VNET_NET(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; struct rtqk_arg arg; + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) + panic("%s: rnh == NULL", __func__); arg.found = arg.killed = 0; arg.rnh = rnh; arg.nextstop = 0; @@ -429,9 +440,6 @@ in6_rtqdrain(void) int in6_inithead(void **head, int off) { -#ifdef INVARIANTS - INIT_VNET_NET(curvnet); -#endif INIT_VNET_INET6(curvnet); struct radix_node_head *rnh; @@ -447,7 +455,7 @@ in6_inithead(void **head, int off) V_rtq_timeout6 = RTQ_TIMEOUT; rnh = *head; - KASSERT(rnh == V_rt_tables[0][AF_INET6], ("rnh?")); + KASSERT(rnh == rt_tables_get_rnh(0, AF_INET6), ("rnh?")); rnh->rnh_addaddr = in6_addroute; rnh->rnh_matchaddr = in6_matroute; callout_init(&V_rtq_timer6, CALLOUT_MPSAFE); Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/netinet6/nd6_rtr.c Mon Jun 1 15:49:42 2009 (r193232) @@ -1549,7 +1549,6 @@ pfxlist_onlink_check() int nd6_prefix_onlink(struct nd_prefix *pr) { - INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); struct ifaddr *ifa; struct ifnet *ifp = pr->ndpr_ifp; @@ -1632,7 +1631,8 @@ nd6_prefix_onlink(struct nd_prefix *pr) ifa->ifa_addr, (struct sockaddr *)&mask6, rtflags, &rt); if (error == 0) { if (rt != NULL) /* this should be non NULL, though */ { - rnh = V_rt_tables[rt->rt_fibnum][AF_INET6]; + rnh = rt_tables_get_rnh(rt->rt_fibnum, AF_INET6); + /* XXX what if rhn == NULL? */ RADIX_NODE_HEAD_LOCK(rnh); RT_LOCK(rt); if (!rt_setgate(rt, rt_key(rt), (struct sockaddr *)&null_sdl)) { @@ -2058,8 +2058,7 @@ in6_init_address_ltimes(struct nd_prefix void rt6_flush(struct in6_addr *gateway, struct ifnet *ifp) { - INIT_VNET_NET(curvnet); - struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; + struct radix_node_head *rnh; int s = splnet(); /* We'll care only link-local addresses */ @@ -2068,6 +2067,10 @@ rt6_flush(struct in6_addr *gateway, stru return; } + rnh = rt_tables_get_rnh(0, AF_INET6); + if (rnh == NULL) + return; + RADIX_NODE_HEAD_LOCK(rnh); rnh->rnh_walktree(rnh, rt6_deleteroute, (void *)gateway); RADIX_NODE_HEAD_UNLOCK(rnh); Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/nfsclient/bootp_subr.c Mon Jun 1 15:49:42 2009 (r193232) @@ -361,11 +361,15 @@ void bootpboot_p_rtlist(void) { INIT_VNET_NET(curvnet); + struct radix_node_head *rnh; printf("Routing table:\n"); - RADIX_NODE_HEAD_RLOCK(V_rt_tables[0][AF_INET]); /* could sleep XXX */ - bootpboot_p_tree(V_rt_tables[0][AF_INET]->rnh_treetop); - RADIX_NODE_HEAD_RUNLOCK(V_rt_tables[0][AF_INET]); + rnh = rt_tables_get_rnh(0, AF_INET); + if (rnh == NULL) + return; + RADIX_NODE_HEAD_RLOCK(rnh); /* could sleep XXX */ + bootpboot_p_tree(rnh->rnh_treetop); + RADIX_NODE_HEAD_RUNLOCK(rnh); } void Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jun 1 15:30:18 2009 (r193231) +++ head/sys/sys/param.h Mon Jun 1 15:49:42 2009 (r193232) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800096 /* Master, propagated to newvers */ +#define __FreeBSD_version 800097 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Mon Jun 1 15:30:18 2009 (r193231) +++ head/usr.bin/netstat/route.c Mon Jun 1 15:49:42 2009 (r193232) @@ -122,12 +122,7 @@ int do_rtent = 0; struct rtentry rtentry; struct radix_node rnode; struct radix_mask rmask; -struct rtline { - struct radix_node_head *tables[AF_MAX+1]; /*xxx*/ -}; -struct rtline *rt_tables; - -struct radix_node_head *rt_tables_line[1][AF_MAX+1]; /*xxx*/ +struct radix_node_head **rt_tables; int NewTree = 0; @@ -155,7 +150,7 @@ static void domask(char *, in_addr_t, u_ void routepr(u_long rtree) { - struct radix_node_head *rnh, head; + struct radix_node_head **rnhp, *rnh, head; size_t intsize; int i; int numfibs; @@ -165,7 +160,8 @@ routepr(u_long rtree) fibnum = 0; if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) numfibs = 1; - rt_tables = calloc(numfibs, sizeof(struct rtline)); + rt_tables = calloc(numfibs * (AF_MAX+1), + sizeof(struct radix_node_head *)); if (rt_tables == NULL) err(EX_OSERR, "memory allocation failed"); /* @@ -186,8 +182,8 @@ routepr(u_long rtree) return; } - if (kread((u_long)(rtree), (char *)(rt_tables), - (numfibs * sizeof(struct rtline))) != 0) + if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs * + (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0) return; for (i = 0; i <= AF_MAX; i++) { int tmpfib; @@ -195,8 +191,15 @@ routepr(u_long rtree) tmpfib = 0; else tmpfib = fibnum; - if ((rnh = rt_tables[tmpfib].tables[i]) == 0) + rnhp = (struct radix_node_head **)*rt_tables; + /* Calculate the in-kernel address. */ + rnhp += tmpfib * (AF_MAX+1) + i; + /* Read the in kernel rhn pointer. */ + if (kget(rnhp, rnh) != 0) + continue; + if (rnh == NULL) continue; + /* Read the rnh data. */ if (kget(rnh, head) != 0) continue; if (i == AF_UNSPEC) { From hselasky at c2i.net Mon Jun 1 15:50:10 2009 From: hselasky at c2i.net (Hans Petter Selasky) Date: Mon Jun 1 15:50:30 2009 Subject: svn commit: r192925 - in head/sys/dev/usb: . input In-Reply-To: <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> References: <200905271927.n4RJRUH8009289@svn.freebsd.org> <200906010749.37072.hselasky@c2i.net> <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> Message-ID: <200906011754.14349.hselasky@c2i.net> On Monday 01 June 2009, Rui Paulo wrote: > Hi, > > On 1 Jun 2009, at 06:49, Hans Petter Selasky wrote: > > On Monday 01 June 2009, Rui Paulo wrote: > >> http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649ea > >>ddf 2fed595 > > > > Hi Rui Paulo, > > > > Regarding the eject button, can you have a look at: > > > > /sys/dev/usb/input/ukbd.c > > > > And provide a patch that masks this key the way you want? > > I'm not sure what you mean. I'm proposing to remove the key handling > code from the kernel. See the attached patch. Your patch looks OK. Make sure you test it before committing. --HPS From bz at FreeBSD.org Mon Jun 1 15:55:08 2009 From: bz at FreeBSD.org (Bjoern A. Zeeb) Date: Mon Jun 1 15:55:21 2009 Subject: svn commit: r193232 - in head: . sys/net sys/netinet sys/netinet6 sys/nfsclient sys/sys usr.bin/netstat In-Reply-To: <200906011549.n51FngRA083299@svn.freebsd.org> References: <200906011549.n51FngRA083299@svn.freebsd.org> Message-ID: <20090601155120.D12292@maildrop.int.zabbadoz.net> On Mon, 1 Jun 2009, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Jun 1 15:49:42 2009 > New Revision: 193232 > URL: http://svn.freebsd.org/changeset/base/193232 > > Log: > Convert the two dimensional array to be malloced and introduce > an accessor function to get the correct rnh pointer back. > > Update netstat to get the correct pointer using kvm_read() > as well. > > This not only fixes the ABI problem depending on the kernel > option but also permits the tunable to overwrite the kernel > option at boot time up to MAXFIBS, enlarging the number of > FIBs without having to recompile. So people could just use > GENERIC now. > > Reviewed by: julian, rwatson, zec > X-MFC: not possible The solution is not ideal but will help FreeBSD 8.x. Julian has suggested a cleaner way but I considered that to be to late and intrusive for 8.x; this way we will have enough time for 9.x to convert this io per AF/domain handler routines. Note: I will garbage collect a lot of opt_route.h dependencies by the end of the week as that option no longer has to be visible to most of the tree. PS: I cannot spell 'routing' correctly usually so whoever touches UPDATING next please fix the spelling;-) -- Bjoern A. Zeeb The greatest risk is not taking one. From rwatson at FreeBSD.org Mon Jun 1 16:00:37 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Mon Jun 1 16:00:44 2009 Subject: svn commit: r193233 - head Message-ID: <200906011600.n51G0aN9083598@svn.freebsd.org> Author: rwatson Date: Mon Jun 1 16:00:36 2009 New Revision: 193233 URL: http://svn.freebsd.org/changeset/base/193233 Log: Update UPDATING for NETISR2 merge, fix a typo in another UPDATING entry. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 15:49:42 2009 (r193232) +++ head/UPDATING Mon Jun 1 16:00:36 2009 (r193233) @@ -23,11 +23,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. ln -s aj /etc/malloc.conf.) 20090601: - The way we are storing and accessing `routeing table' entries + The way we are storing and accessing `routing table' entries has changed. Programs reading the FIB, like netstat, need to be re-compiled. Bump __FreeBSD_version to 800097. +20090601: + A new netisr implementation has been added for FreeBSD 8. Network + file system modules, such as igmp, ipdivert, and others, should be + rebuilt. + Bump __FreeBSD_version to 800096. + 20090530: Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no more valid. From nwhitehorn at freebsd.org Mon Jun 1 16:01:09 2009 From: nwhitehorn at freebsd.org (Nathan Whitehorn) Date: Mon Jun 1 16:01:21 2009 Subject: svn commit: r193159 - head/sys/powerpc/powermac In-Reply-To: <200906010822.19951.jhb@freebsd.org> References: <200905311002.n4VA2K6c037776@svn.freebsd.org> <200906010822.19951.jhb@freebsd.org> Message-ID: <4A23FB40.1050405@freebsd.org> John Baldwin wrote: > On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Sun May 31 10:02:20 2009 >> New Revision: 193159 >> URL: http://svn.freebsd.org/changeset/base/193159 >> >> Log: >> Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to >> determine whether the computer is plugged in to mains power. >> > > I wonder if it would be a good idea to introduce a > platform-independent 'acline' sysctl? Something like 'hw.acline'? For now > we could simply have these devices create it. We could do something fancier > where AC adapter drivers register with a centralized thingie at some point > and it exports a global setting that is true so long as at least one adapter > is online. I'm not sure that level of complexity is warranted until we have > platforms with multiple AC lines exposed to the OS though. > That would be nice, and easy to implement, though the existing one should be kept for a while for compatibility. In the longer term, pmu(4) also provides an ACPI-alike interface to battery status under dev.pmu.*, which it would likewise be good to report in a platform-independent way. -Nathan From rwatson at FreeBSD.org Mon Jun 1 16:13:07 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Mon Jun 1 16:13:18 2009 Subject: svn commit: r193234 - in head/sys: kern sys Message-ID: <200906011613.n51GD6kZ083855@svn.freebsd.org> Author: rwatson Date: Mon Jun 1 16:13:06 2009 New Revision: 193234 URL: http://svn.freebsd.org/changeset/base/193234 Log: Add 'sy_flags', a currently unused per-syscall entry flags field that will see future use in 9-CURRENT and 8-STABLE for features such as the capability-mode enable flag and pay-as-you-audit. Discussed with: jhb, sson Modified: head/sys/kern/makesyscalls.sh head/sys/sys/sysent.h Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Jun 1 16:00:36 2009 (r193233) +++ head/sys/kern/makesyscalls.sh Mon Jun 1 16:13:06 2009 (r193234) @@ -318,6 +318,13 @@ s/\$//g auditev = $2; } + # + # The currently-empty flags field. + # + { + flags = "0"; + } + $3 == "STD" || $3 == "NODEF" || $3 == "NOARGS" || $3 == "NOPROTO" \ || $3 == "NOIMPL" || $3 == "NOSTD" { parseline() @@ -369,14 +376,14 @@ s/\$//g printf("\t{ %s, (sy_call_t *)", argssize) > sysent column = 8 + 2 + length(argssize) + 15 if ($3 == "NOIMPL") { - printf("%s },", "nosys, AUE_NULL, NULL, 0, 0") > sysent - column = column + length("nosys") + 3 + printf("%s },", "nosys, AUE_NULL, NULL, 0, 0, 0") > sysent + column = column + length("nosys") + length("AUE_NULL") + 3 } else if ($3 == "NOSTD") { - printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0") > sysent - column = column + length("lkmressys") + 3 + printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0, 0") > sysent + column = column + length("lkmressys") + length("AUE_NULL") + 3 } else { - printf("%s, %s, NULL, 0, 0 },", funcname, auditev) > sysent - column = column + length(funcname) + length(auditev) + 3 + printf("%s, %s, NULL, 0, 0, %s },", funcname, auditev, flags) > sysent + column = column + length(funcname) + length(auditev) + length(flags) + 3 } align_sysent_comment(column) printf("/* %d = %s */\n", syscall, funcalias) > sysent @@ -426,10 +433,10 @@ s/\$//g argalias) > sysarg printf("%s\t%s%s(struct thread *, struct %s *);\n", rettype, prefix, funcname, argalias) > outdcl - printf("\t{ %s(%s,%s), %s, NULL, 0, 0 },", - wrap, argssize, funcname, auditev) > sysent + printf("\t{ %s(%s,%s), %s, NULL, 0, 0, %s },", + wrap, argssize, funcname, auditev, flags) > sysent align_sysent_comment(8 + 9 + \ - length(argssize) + 1 + length(funcname) + length(auditev) + 4) + length(argssize) + 1 + length(funcname) + length(auditev) + length(flags) + 4) printf("/* %d = old %s */\n", syscall, funcalias) > sysent printf("\t\"%s.%s\",\t\t/* %d = old %s */\n", wrap, funcalias, syscall, funcalias) > sysnames @@ -448,10 +455,10 @@ s/\$//g ncompat++ parseline() printf("%s\to%s();\n", rettype, funcname) > syscompatdcl - printf("\t{ compat(%s,%s), %s, NULL, 0, 0 },", - argssize, funcname, auditev) > sysent + printf("\t{ compat(%s,%s), %s, NULL, 0, 0, %s },", + argssize, funcname, auditev, flags) > sysent align_sysent_comment(8 + 9 + \ - length(argssize) + 1 + length(funcname) + length(auditev) + 4) + length(argssize) + 1 + length(funcname) + length(auditev) + length(flags) + 4) printf("/* %d = old %s */\n", syscall, funcalias) > sysent printf("\t\"old.%s\",\t\t/* %d = old %s */\n", funcalias, syscall, funcalias) > sysnames @@ -462,7 +469,7 @@ s/\$//g next } $3 == "OBSOL" { - printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },") > sysent + printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },") > sysent align_sysent_comment(34) printf("/* %d = obsolete %s */\n", syscall, comment) > sysent printf("\t\"obs_%s\",\t\t\t/* %d = obsolete %s */\n", @@ -473,7 +480,7 @@ s/\$//g next } $3 == "UNIMPL" { - printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },\t\t\t/* %d = %s */\n", + printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },\t\t\t/* %d = %s */\n", syscall, comment) > sysent printf("\t\"#%d\",\t\t\t/* %d = %s */\n", syscall, syscall, comment) > sysnames Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Mon Jun 1 16:00:36 2009 (r193233) +++ head/sys/sys/sysent.h Mon Jun 1 16:13:06 2009 (r193234) @@ -60,6 +60,7 @@ struct sysent { /* system call table * /* optional argument conversion function. */ u_int32_t sy_entry; /* DTrace entry ID for systrace. */ u_int32_t sy_return; /* DTrace return ID for systrace. */ + u_int32_t sy_flags; /* General flags for system calls. */ }; struct image_params; From rwatson at FreeBSD.org Mon Jun 1 16:14:39 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Mon Jun 1 16:14:55 2009 Subject: svn commit: r193235 - in head/sys: amd64/linux32 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern Message-ID: <200906011614.n51GEc9J083917@svn.freebsd.org> Author: rwatson Date: Mon Jun 1 16:14:38 2009 New Revision: 193235 URL: http://svn.freebsd.org/changeset/base/193235 Log: Regenerate generated syscall files following changes to struct sysent in r193234. Modified: head/sys/amd64/linux32/linux32_sysent.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/svr4/svr4_sysent.c head/sys/i386/ibcs2/ibcs2_sysent.c head/sys/i386/linux/linux_sysent.c head/sys/kern/init_sysent.c Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Mon Jun 1 16:13:06 2009 (r193234) +++ head/sys/amd64/linux32/linux32_sysent.c Mon Jun 1 16:14:38 2009 (r193235) @@ -19,321 +19,321 @@ /* The casts are bogus but will do for now. */ struct sysent linux_sysent[] = { #define nosys linux_nosys - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 0 = setup */ - { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0 }, /* 1 = exit */ - { 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0 }, /* 2 = linux_fork */ - { AS(read_args), (sy_call_t *)read, AUE_NULL, NULL, 0, 0 }, /* 3 = read */ - { AS(write_args), (sy_call_t *)write, AUE_NULL, NULL, 0, 0 }, /* 4 = write */ - { AS(linux_open_args), (sy_call_t *)linux_open, AUE_OPEN_RWTC, NULL, 0, 0 }, /* 5 = linux_open */ - { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0 }, /* 6 = close */ - { AS(linux_waitpid_args), (sy_call_t *)linux_waitpid, AUE_WAIT4, NULL, 0, 0 }, /* 7 = linux_waitpid */ - { AS(linux_creat_args), (sy_call_t *)linux_creat, AUE_CREAT, NULL, 0, 0 }, /* 8 = linux_creat */ - { AS(linux_link_args), (sy_call_t *)linux_link, AUE_LINK, NULL, 0, 0 }, /* 9 = linux_link */ - { AS(linux_unlink_args), (sy_call_t *)linux_unlink, AUE_UNLINK, NULL, 0, 0 }, /* 10 = linux_unlink */ - { AS(linux_execve_args), (sy_call_t *)linux_execve, AUE_EXECVE, NULL, 0, 0 }, /* 11 = linux_execve */ - { AS(linux_chdir_args), (sy_call_t *)linux_chdir, AUE_CHDIR, NULL, 0, 0 }, /* 12 = linux_chdir */ - { AS(linux_time_args), (sy_call_t *)linux_time, AUE_NULL, NULL, 0, 0 }, /* 13 = linux_time */ - { AS(linux_mknod_args), (sy_call_t *)linux_mknod, AUE_MKNOD, NULL, 0, 0 }, /* 14 = linux_mknod */ - { AS(linux_chmod_args), (sy_call_t *)linux_chmod, AUE_CHMOD, NULL, 0, 0 }, /* 15 = linux_chmod */ - { AS(linux_lchown16_args), (sy_call_t *)linux_lchown16, AUE_LCHOWN, NULL, 0, 0 }, /* 16 = linux_lchown16 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 17 = break */ - { AS(linux_stat_args), (sy_call_t *)linux_stat, AUE_STAT, NULL, 0, 0 }, /* 18 = linux_stat */ - { AS(linux_lseek_args), (sy_call_t *)linux_lseek, AUE_LSEEK, NULL, 0, 0 }, /* 19 = linux_lseek */ - { 0, (sy_call_t *)linux_getpid, AUE_GETPID, NULL, 0, 0 }, /* 20 = linux_getpid */ - { AS(linux_mount_args), (sy_call_t *)linux_mount, AUE_MOUNT, NULL, 0, 0 }, /* 21 = linux_mount */ - { AS(linux_oldumount_args), (sy_call_t *)linux_oldumount, AUE_UMOUNT, NULL, 0, 0 }, /* 22 = linux_oldumount */ - { AS(linux_setuid16_args), (sy_call_t *)linux_setuid16, AUE_SETUID, NULL, 0, 0 }, /* 23 = linux_setuid16 */ - { 0, (sy_call_t *)linux_getuid16, AUE_GETUID, NULL, 0, 0 }, /* 24 = linux_getuid16 */ - { 0, (sy_call_t *)linux_stime, AUE_SETTIMEOFDAY, NULL, 0, 0 }, /* 25 = linux_stime */ - { AS(linux_ptrace_args), (sy_call_t *)linux_ptrace, AUE_PTRACE, NULL, 0, 0 }, /* 26 = linux_ptrace */ - { AS(linux_alarm_args), (sy_call_t *)linux_alarm, AUE_NULL, NULL, 0, 0 }, /* 27 = linux_alarm */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 28 = fstat */ - { 0, (sy_call_t *)linux_pause, AUE_NULL, NULL, 0, 0 }, /* 29 = linux_pause */ - { AS(linux_utime_args), (sy_call_t *)linux_utime, AUE_UTIME, NULL, 0, 0 }, /* 30 = linux_utime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 31 = stty */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 32 = gtty */ - { AS(linux_access_args), (sy_call_t *)linux_access, AUE_ACCESS, NULL, 0, 0 }, /* 33 = linux_access */ - { AS(linux_nice_args), (sy_call_t *)linux_nice, AUE_NICE, NULL, 0, 0 }, /* 34 = linux_nice */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 35 = ftime */ - { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0 }, /* 36 = sync */ - { AS(linux_kill_args), (sy_call_t *)linux_kill, AUE_KILL, NULL, 0, 0 }, /* 37 = linux_kill */ - { AS(linux_rename_args), (sy_call_t *)linux_rename, AUE_RENAME, NULL, 0, 0 }, /* 38 = linux_rename */ - { AS(linux_mkdir_args), (sy_call_t *)linux_mkdir, AUE_MKDIR, NULL, 0, 0 }, /* 39 = linux_mkdir */ - { AS(linux_rmdir_args), (sy_call_t *)linux_rmdir, AUE_RMDIR, NULL, 0, 0 }, /* 40 = linux_rmdir */ - { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0 }, /* 41 = dup */ - { AS(linux_pipe_args), (sy_call_t *)linux_pipe, AUE_PIPE, NULL, 0, 0 }, /* 42 = linux_pipe */ - { AS(linux_times_args), (sy_call_t *)linux_times, AUE_NULL, NULL, 0, 0 }, /* 43 = linux_times */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 44 = prof */ - { AS(linux_brk_args), (sy_call_t *)linux_brk, AUE_NULL, NULL, 0, 0 }, /* 45 = linux_brk */ - { AS(linux_setgid16_args), (sy_call_t *)linux_setgid16, AUE_SETGID, NULL, 0, 0 }, /* 46 = linux_setgid16 */ - { 0, (sy_call_t *)linux_getgid16, AUE_GETGID, NULL, 0, 0 }, /* 47 = linux_getgid16 */ - { AS(linux_signal_args), (sy_call_t *)linux_signal, AUE_NULL, NULL, 0, 0 }, /* 48 = linux_signal */ - { 0, (sy_call_t *)linux_geteuid16, AUE_GETEUID, NULL, 0, 0 }, /* 49 = linux_geteuid16 */ - { 0, (sy_call_t *)linux_getegid16, AUE_GETEGID, NULL, 0, 0 }, /* 50 = linux_getegid16 */ - { AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0 }, /* 51 = acct */ - { AS(linux_umount_args), (sy_call_t *)linux_umount, AUE_UMOUNT, NULL, 0, 0 }, /* 52 = linux_umount */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 53 = lock */ - { AS(linux_ioctl_args), (sy_call_t *)linux_ioctl, AUE_IOCTL, NULL, 0, 0 }, /* 54 = linux_ioctl */ - { AS(linux_fcntl_args), (sy_call_t *)linux_fcntl, AUE_FCNTL, NULL, 0, 0 }, /* 55 = linux_fcntl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 56 = mpx */ - { AS(setpgid_args), (sy_call_t *)setpgid, AUE_SETPGRP, NULL, 0, 0 }, /* 57 = setpgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 58 = ulimit */ - { 0, (sy_call_t *)linux_olduname, AUE_NULL, NULL, 0, 0 }, /* 59 = linux_olduname */ - { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0 }, /* 60 = umask */ - { AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0 }, /* 61 = chroot */ - { AS(linux_ustat_args), (sy_call_t *)linux_ustat, AUE_NULL, NULL, 0, 0 }, /* 62 = linux_ustat */ - { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0 }, /* 63 = dup2 */ - { 0, (sy_call_t *)linux_getppid, AUE_GETPPID, NULL, 0, 0 }, /* 64 = linux_getppid */ - { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0 }, /* 65 = getpgrp */ - { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0 }, /* 66 = setsid */ - { AS(linux_sigaction_args), (sy_call_t *)linux_sigaction, AUE_NULL, NULL, 0, 0 }, /* 67 = linux_sigaction */ - { 0, (sy_call_t *)linux_sgetmask, AUE_NULL, NULL, 0, 0 }, /* 68 = linux_sgetmask */ - { AS(linux_ssetmask_args), (sy_call_t *)linux_ssetmask, AUE_NULL, NULL, 0, 0 }, /* 69 = linux_ssetmask */ - { AS(linux_setreuid16_args), (sy_call_t *)linux_setreuid16, AUE_SETREUID, NULL, 0, 0 }, /* 70 = linux_setreuid16 */ - { AS(linux_setregid16_args), (sy_call_t *)linux_setregid16, AUE_SETREGID, NULL, 0, 0 }, /* 71 = linux_setregid16 */ - { AS(linux_sigsuspend_args), (sy_call_t *)linux_sigsuspend, AUE_NULL, NULL, 0, 0 }, /* 72 = linux_sigsuspend */ - { AS(linux_sigpending_args), (sy_call_t *)linux_sigpending, AUE_NULL, NULL, 0, 0 }, /* 73 = linux_sigpending */ - { AS(linux_sethostname_args), (sy_call_t *)linux_sethostname, AUE_SYSCTL, NULL, 0, 0 }, /* 74 = linux_sethostname */ - { AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit, AUE_SETRLIMIT, NULL, 0, 0 }, /* 75 = linux_setrlimit */ - { AS(linux_old_getrlimit_args), (sy_call_t *)linux_old_getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 76 = linux_old_getrlimit */ - { AS(linux_getrusage_args), (sy_call_t *)linux_getrusage, AUE_GETRUSAGE, NULL, 0, 0 }, /* 77 = linux_getrusage */ - { AS(linux_gettimeofday_args), (sy_call_t *)linux_gettimeofday, AUE_NULL, NULL, 0, 0 }, /* 78 = linux_gettimeofday */ - { AS(linux_settimeofday_args), (sy_call_t *)linux_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0 }, /* 79 = linux_settimeofday */ - { AS(linux_getgroups16_args), (sy_call_t *)linux_getgroups16, AUE_GETGROUPS, NULL, 0, 0 }, /* 80 = linux_getgroups16 */ - { AS(linux_setgroups16_args), (sy_call_t *)linux_setgroups16, AUE_SETGROUPS, NULL, 0, 0 }, /* 81 = linux_setgroups16 */ - { AS(linux_old_select_args), (sy_call_t *)linux_old_select, AUE_SELECT, NULL, 0, 0 }, /* 82 = linux_old_select */ - { AS(linux_symlink_args), (sy_call_t *)linux_symlink, AUE_SYMLINK, NULL, 0, 0 }, /* 83 = linux_symlink */ - { AS(linux_lstat_args), (sy_call_t *)linux_lstat, AUE_LSTAT, NULL, 0, 0 }, /* 84 = linux_lstat */ - { AS(linux_readlink_args), (sy_call_t *)linux_readlink, AUE_READLINK, NULL, 0, 0 }, /* 85 = linux_readlink */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 86 = linux_uselib */ - { AS(swapon_args), (sy_call_t *)swapon, AUE_SWAPON, NULL, 0, 0 }, /* 87 = swapon */ - { AS(linux_reboot_args), (sy_call_t *)linux_reboot, AUE_REBOOT, NULL, 0, 0 }, /* 88 = linux_reboot */ - { AS(linux_readdir_args), (sy_call_t *)linux_readdir, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 89 = linux_readdir */ - { AS(linux_mmap_args), (sy_call_t *)linux_mmap, AUE_MMAP, NULL, 0, 0 }, /* 90 = linux_mmap */ - { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0 }, /* 91 = munmap */ - { AS(linux_truncate_args), (sy_call_t *)linux_truncate, AUE_TRUNCATE, NULL, 0, 0 }, /* 92 = linux_truncate */ - { AS(linux_ftruncate_args), (sy_call_t *)linux_ftruncate, AUE_FTRUNCATE, NULL, 0, 0 }, /* 93 = linux_ftruncate */ - { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0 }, /* 94 = fchmod */ - { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0 }, /* 95 = fchown */ - { AS(linux_getpriority_args), (sy_call_t *)linux_getpriority, AUE_GETPRIORITY, NULL, 0, 0 }, /* 96 = linux_getpriority */ - { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0 }, /* 97 = setpriority */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 98 = profil */ - { AS(linux_statfs_args), (sy_call_t *)linux_statfs, AUE_STATFS, NULL, 0, 0 }, /* 99 = linux_statfs */ - { AS(linux_fstatfs_args), (sy_call_t *)linux_fstatfs, AUE_FSTATFS, NULL, 0, 0 }, /* 100 = linux_fstatfs */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 101 = ioperm */ - { AS(linux_socketcall_args), (sy_call_t *)linux_socketcall, AUE_NULL, NULL, 0, 0 }, /* 102 = linux_socketcall */ - { AS(linux_syslog_args), (sy_call_t *)linux_syslog, AUE_NULL, NULL, 0, 0 }, /* 103 = linux_syslog */ - { AS(linux_setitimer_args), (sy_call_t *)linux_setitimer, AUE_SETITIMER, NULL, 0, 0 }, /* 104 = linux_setitimer */ - { AS(linux_getitimer_args), (sy_call_t *)linux_getitimer, AUE_GETITIMER, NULL, 0, 0 }, /* 105 = linux_getitimer */ - { AS(linux_newstat_args), (sy_call_t *)linux_newstat, AUE_STAT, NULL, 0, 0 }, /* 106 = linux_newstat */ - { AS(linux_newlstat_args), (sy_call_t *)linux_newlstat, AUE_LSTAT, NULL, 0, 0 }, /* 107 = linux_newlstat */ - { AS(linux_newfstat_args), (sy_call_t *)linux_newfstat, AUE_FSTAT, NULL, 0, 0 }, /* 108 = linux_newfstat */ - { 0, (sy_call_t *)linux_uname, AUE_NULL, NULL, 0, 0 }, /* 109 = linux_uname */ - { AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0 }, /* 110 = linux_iopl */ - { 0, (sy_call_t *)linux_vhangup, AUE_NULL, NULL, 0, 0 }, /* 111 = linux_vhangup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 112 = idle */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 113 = vm86old */ - { AS(linux_wait4_args), (sy_call_t *)linux_wait4, AUE_WAIT4, NULL, 0, 0 }, /* 114 = linux_wait4 */ - { 0, (sy_call_t *)linux_swapoff, AUE_SWAPOFF, NULL, 0, 0 }, /* 115 = linux_swapoff */ - { AS(linux_sysinfo_args), (sy_call_t *)linux_sysinfo, AUE_NULL, NULL, 0, 0 }, /* 116 = linux_sysinfo */ - { AS(linux_ipc_args), (sy_call_t *)linux_ipc, AUE_NULL, NULL, 0, 0 }, /* 117 = linux_ipc */ - { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0 }, /* 118 = fsync */ - { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn, AUE_SIGRETURN, NULL, 0, 0 }, /* 119 = linux_sigreturn */ - { AS(linux_clone_args), (sy_call_t *)linux_clone, AUE_RFORK, NULL, 0, 0 }, /* 120 = linux_clone */ - { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0 }, /* 121 = linux_setdomainname */ - { AS(linux_newuname_args), (sy_call_t *)linux_newuname, AUE_NULL, NULL, 0, 0 }, /* 122 = linux_newuname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 123 = modify_ldt */ - { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0 }, /* 124 = linux_adjtimex */ - { AS(linux_mprotect_args), (sy_call_t *)linux_mprotect, AUE_MPROTECT, NULL, 0, 0 }, /* 125 = linux_mprotect */ - { AS(linux_sigprocmask_args), (sy_call_t *)linux_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0 }, /* 126 = linux_sigprocmask */ - { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0 }, /* 127 = linux_create_module */ - { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0 }, /* 128 = linux_init_module */ - { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0 }, /* 129 = linux_delete_module */ - { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0 }, /* 130 = linux_get_kernel_syms */ - { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0 }, /* 131 = linux_quotactl */ - { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0 }, /* 132 = getpgid */ - { AS(fchdir_args), (sy_call_t *)fchdir, AUE_FCHDIR, NULL, 0, 0 }, /* 133 = fchdir */ - { 0, (sy_call_t *)linux_bdflush, AUE_BDFLUSH, NULL, 0, 0 }, /* 134 = linux_bdflush */ - { AS(linux_sysfs_args), (sy_call_t *)linux_sysfs, AUE_NULL, NULL, 0, 0 }, /* 135 = linux_sysfs */ - { AS(linux_personality_args), (sy_call_t *)linux_personality, AUE_PERSONALITY, NULL, 0, 0 }, /* 136 = linux_personality */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 137 = afs_syscall */ - { AS(linux_setfsuid16_args), (sy_call_t *)linux_setfsuid16, AUE_SETFSUID, NULL, 0, 0 }, /* 138 = linux_setfsuid16 */ - { AS(linux_setfsgid16_args), (sy_call_t *)linux_setfsgid16, AUE_SETFSGID, NULL, 0, 0 }, /* 139 = linux_setfsgid16 */ - { AS(linux_llseek_args), (sy_call_t *)linux_llseek, AUE_LSEEK, NULL, 0, 0 }, /* 140 = linux_llseek */ - { AS(linux_getdents_args), (sy_call_t *)linux_getdents, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 141 = linux_getdents */ - { AS(linux_select_args), (sy_call_t *)linux_select, AUE_SELECT, NULL, 0, 0 }, /* 142 = linux_select */ - { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0 }, /* 143 = flock */ - { AS(linux_msync_args), (sy_call_t *)linux_msync, AUE_MSYNC, NULL, 0, 0 }, /* 144 = linux_msync */ - { AS(linux_readv_args), (sy_call_t *)linux_readv, AUE_READV, NULL, 0, 0 }, /* 145 = linux_readv */ - { AS(linux_writev_args), (sy_call_t *)linux_writev, AUE_WRITEV, NULL, 0, 0 }, /* 146 = linux_writev */ - { AS(linux_getsid_args), (sy_call_t *)linux_getsid, AUE_GETSID, NULL, 0, 0 }, /* 147 = linux_getsid */ - { AS(linux_fdatasync_args), (sy_call_t *)linux_fdatasync, AUE_NULL, NULL, 0, 0 }, /* 148 = linux_fdatasync */ - { AS(linux_sysctl_args), (sy_call_t *)linux_sysctl, AUE_SYSCTL, NULL, 0, 0 }, /* 149 = linux_sysctl */ - { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0 }, /* 150 = mlock */ - { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0 }, /* 151 = munlock */ - { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0 }, /* 152 = mlockall */ - { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0 }, /* 153 = munlockall */ - { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0 }, /* 154 = sched_setparam */ - { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0 }, /* 155 = sched_getparam */ - { AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0 }, /* 156 = linux_sched_setscheduler */ - { AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0 }, /* 157 = linux_sched_getscheduler */ - { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0 }, /* 158 = sched_yield */ - { AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0 }, /* 159 = linux_sched_get_priority_max */ - { AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0 }, /* 160 = linux_sched_get_priority_min */ - { AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0 }, /* 161 = linux_sched_rr_get_interval */ - { AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 162 = linux_nanosleep */ - { AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0 }, /* 163 = linux_mremap */ - { AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0 }, /* 164 = linux_setresuid16 */ - { AS(linux_getresuid16_args), (sy_call_t *)linux_getresuid16, AUE_GETRESUID, NULL, 0, 0 }, /* 165 = linux_getresuid16 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 166 = vm86 */ - { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0 }, /* 167 = linux_query_module */ - { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0 }, /* 168 = poll */ - { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0 }, /* 169 = linux_nfsservctl */ - { AS(linux_setresgid16_args), (sy_call_t *)linux_setresgid16, AUE_SETRESGID, NULL, 0, 0 }, /* 170 = linux_setresgid16 */ - { AS(linux_getresgid16_args), (sy_call_t *)linux_getresgid16, AUE_GETRESGID, NULL, 0, 0 }, /* 171 = linux_getresgid16 */ - { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0 }, /* 172 = linux_prctl */ - { AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn, AUE_NULL, NULL, 0, 0 }, /* 173 = linux_rt_sigreturn */ - { AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction, AUE_NULL, NULL, 0, 0 }, /* 174 = linux_rt_sigaction */ - { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0 }, /* 175 = linux_rt_sigprocmask */ - { AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0 }, /* 176 = linux_rt_sigpending */ - { AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0 }, /* 177 = linux_rt_sigtimedwait */ - { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0 }, /* 178 = linux_rt_sigqueueinfo */ - { AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0 }, /* 179 = linux_rt_sigsuspend */ - { AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0 }, /* 180 = linux_pread */ - { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0 }, /* 181 = linux_pwrite */ - { AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0 }, /* 182 = linux_chown16 */ - { AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0 }, /* 183 = linux_getcwd */ - { 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0 }, /* 184 = linux_capget */ - { 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0 }, /* 185 = linux_capset */ - { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0 }, /* 186 = linux_sigaltstack */ - { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0 }, /* 187 = linux_sendfile */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 188 = getpmsg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 189 = putpmsg */ - { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0 }, /* 190 = linux_vfork */ - { AS(linux_getrlimit_args), (sy_call_t *)linux_getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 191 = linux_getrlimit */ - { AS(linux_mmap2_args), (sy_call_t *)linux_mmap2, AUE_MMAP, NULL, 0, 0 }, /* 192 = linux_mmap2 */ - { AS(linux_truncate64_args), (sy_call_t *)linux_truncate64, AUE_TRUNCATE, NULL, 0, 0 }, /* 193 = linux_truncate64 */ - { AS(linux_ftruncate64_args), (sy_call_t *)linux_ftruncate64, AUE_FTRUNCATE, NULL, 0, 0 }, /* 194 = linux_ftruncate64 */ - { AS(linux_stat64_args), (sy_call_t *)linux_stat64, AUE_STAT, NULL, 0, 0 }, /* 195 = linux_stat64 */ - { AS(linux_lstat64_args), (sy_call_t *)linux_lstat64, AUE_LSTAT, NULL, 0, 0 }, /* 196 = linux_lstat64 */ - { AS(linux_fstat64_args), (sy_call_t *)linux_fstat64, AUE_FSTAT, NULL, 0, 0 }, /* 197 = linux_fstat64 */ - { AS(linux_lchown_args), (sy_call_t *)linux_lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 198 = linux_lchown */ - { 0, (sy_call_t *)linux_getuid, AUE_GETUID, NULL, 0, 0 }, /* 199 = linux_getuid */ - { 0, (sy_call_t *)linux_getgid, AUE_GETGID, NULL, 0, 0 }, /* 200 = linux_getgid */ - { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0 }, /* 201 = geteuid */ - { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0 }, /* 202 = getegid */ - { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0 }, /* 203 = setreuid */ - { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0 }, /* 204 = setregid */ - { AS(linux_getgroups_args), (sy_call_t *)linux_getgroups, AUE_GETGROUPS, NULL, 0, 0 }, /* 205 = linux_getgroups */ - { AS(linux_setgroups_args), (sy_call_t *)linux_setgroups, AUE_SETGROUPS, NULL, 0, 0 }, /* 206 = linux_setgroups */ - { AS(fchown_args), (sy_call_t *)fchown, AUE_NULL, NULL, 0, 0 }, /* 207 = fchown */ - { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0 }, /* 208 = setresuid */ - { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0 }, /* 209 = getresuid */ - { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0 }, /* 210 = setresgid */ - { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0 }, /* 211 = getresgid */ - { AS(linux_chown_args), (sy_call_t *)linux_chown, AUE_CHOWN, NULL, 0, 0 }, /* 212 = linux_chown */ - { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0 }, /* 213 = setuid */ - { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0 }, /* 214 = setgid */ - { AS(linux_setfsuid_args), (sy_call_t *)linux_setfsuid, AUE_SETFSUID, NULL, 0, 0 }, /* 215 = linux_setfsuid */ - { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid, AUE_SETFSGID, NULL, 0, 0 }, /* 216 = linux_setfsgid */ - { AS(linux_pivot_root_args), (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0 }, /* 217 = linux_pivot_root */ - { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0 }, /* 218 = linux_mincore */ - { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0 }, /* 219 = madvise */ - { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 220 = linux_getdents64 */ - { AS(linux_fcntl64_args), (sy_call_t *)linux_fcntl64, AUE_FCNTL, NULL, 0, 0 }, /* 221 = linux_fcntl64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 222 = */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 223 = */ - { 0, (sy_call_t *)linux_gettid, AUE_NULL, NULL, 0, 0 }, /* 224 = linux_gettid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 225 = linux_readahead */ - { 0, (sy_call_t *)linux_setxattr, AUE_NULL, NULL, 0, 0 }, /* 226 = linux_setxattr */ - { 0, (sy_call_t *)linux_lsetxattr, AUE_NULL, NULL, 0, 0 }, /* 227 = linux_lsetxattr */ - { 0, (sy_call_t *)linux_fsetxattr, AUE_NULL, NULL, 0, 0 }, /* 228 = linux_fsetxattr */ - { 0, (sy_call_t *)linux_getxattr, AUE_NULL, NULL, 0, 0 }, /* 229 = linux_getxattr */ - { 0, (sy_call_t *)linux_lgetxattr, AUE_NULL, NULL, 0, 0 }, /* 230 = linux_lgetxattr */ - { 0, (sy_call_t *)linux_fgetxattr, AUE_NULL, NULL, 0, 0 }, /* 231 = linux_fgetxattr */ - { 0, (sy_call_t *)linux_listxattr, AUE_NULL, NULL, 0, 0 }, /* 232 = linux_listxattr */ - { 0, (sy_call_t *)linux_llistxattr, AUE_NULL, NULL, 0, 0 }, /* 233 = linux_llistxattr */ - { 0, (sy_call_t *)linux_flistxattr, AUE_NULL, NULL, 0, 0 }, /* 234 = linux_flistxattr */ - { 0, (sy_call_t *)linux_removexattr, AUE_NULL, NULL, 0, 0 }, /* 235 = linux_removexattr */ - { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0 }, /* 236 = linux_lremovexattr */ - { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0 }, /* 237 = linux_fremovexattr */ - { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0 }, /* 238 = linux_tkill */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 239 = linux_sendfile64 */ - { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0 }, /* 240 = linux_sys_futex */ - { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0 }, /* 241 = linux_sched_setaffinity */ - { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0 }, /* 242 = linux_sched_getaffinity */ - { AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 }, /* 243 = linux_set_thread_area */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 244 = linux_get_thread_area */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 248 = inux_io_submit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0 }, /* 250 = linux_fadvise64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 251 = */ - { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0 }, /* 252 = linux_exit_group */ - { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0 }, /* 253 = linux_lookup_dcookie */ - { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0 }, /* 254 = linux_epoll_create */ - { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0 }, /* 255 = linux_epoll_ctl */ - { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0 }, /* 256 = linux_epoll_wait */ - { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0 }, /* 257 = linux_remap_file_pages */ - { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0 }, /* 258 = linux_set_tid_address */ - { 0, (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0 }, /* 259 = linux_timer_create */ - { 0, (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0 }, /* 260 = linux_timer_settime */ - { 0, (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0 }, /* 261 = linux_timer_gettime */ - { 0, (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0 }, /* 262 = linux_timer_getoverrun */ - { 0, (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0 }, /* 263 = linux_timer_delete */ - { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0 }, /* 264 = linux_clock_settime */ - { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 265 = linux_clock_gettime */ - { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0 }, /* 266 = linux_clock_getres */ - { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 267 = linux_clock_nanosleep */ - { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0 }, /* 268 = linux_statfs64 */ - { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0 }, /* 269 = linux_fstatfs64 */ - { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0 }, /* 270 = linux_tgkill */ - { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0 }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0 }, /* 272 = linux_fadvise64_64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 273 = */ - { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0 }, /* 274 = linux_mbind */ - { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0 }, /* 275 = linux_get_mempolicy */ - { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0 }, /* 276 = linux_set_mempolicy */ - { 0, (sy_call_t *)linux_mq_open, AUE_NULL, NULL, 0, 0 }, /* 277 = linux_mq_open */ - { 0, (sy_call_t *)linux_mq_unlink, AUE_NULL, NULL, 0, 0 }, /* 278 = linux_mq_unlink */ - { 0, (sy_call_t *)linux_mq_timedsend, AUE_NULL, NULL, 0, 0 }, /* 279 = linux_mq_timedsend */ - { 0, (sy_call_t *)linux_mq_timedreceive, AUE_NULL, NULL, 0, 0 }, /* 280 = linux_mq_timedreceive */ - { 0, (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0 }, /* 281 = linux_mq_notify */ - { 0, (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0 }, /* 282 = linux_mq_getsetattr */ - { 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0 }, /* 283 = linux_kexec_load */ - { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0 }, /* 284 = linux_waitid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 285 = */ - { 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0 }, /* 286 = linux_add_key */ - { 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0 }, /* 287 = linux_request_key */ - { 0, (sy_call_t *)linux_keyctl, AUE_NULL, NULL, 0, 0 }, /* 288 = linux_keyctl */ - { 0, (sy_call_t *)linux_ioprio_set, AUE_NULL, NULL, 0, 0 }, /* 289 = linux_ioprio_set */ - { 0, (sy_call_t *)linux_ioprio_get, AUE_NULL, NULL, 0, 0 }, /* 290 = linux_ioprio_get */ - { 0, (sy_call_t *)linux_inotify_init, AUE_NULL, NULL, 0, 0 }, /* 291 = linux_inotify_init */ - { 0, (sy_call_t *)linux_inotify_add_watch, AUE_NULL, NULL, 0, 0 }, /* 292 = linux_inotify_add_watch */ - { 0, (sy_call_t *)linux_inotify_rm_watch, AUE_NULL, NULL, 0, 0 }, /* 293 = linux_inotify_rm_watch */ - { 0, (sy_call_t *)linux_migrate_pages, AUE_NULL, NULL, 0, 0 }, /* 294 = linux_migrate_pages */ - { AS(linux_openat_args), (sy_call_t *)linux_openat, AUE_OPEN_RWTC, NULL, 0, 0 }, /* 295 = linux_openat */ - { AS(linux_mkdirat_args), (sy_call_t *)linux_mkdirat, AUE_MKDIRAT, NULL, 0, 0 }, /* 296 = linux_mkdirat */ - { AS(linux_mknodat_args), (sy_call_t *)linux_mknodat, AUE_MKNODAT, NULL, 0, 0 }, /* 297 = linux_mknodat */ - { AS(linux_fchownat_args), (sy_call_t *)linux_fchownat, AUE_FCHOWNAT, NULL, 0, 0 }, /* 298 = linux_fchownat */ - { AS(linux_futimesat_args), (sy_call_t *)linux_futimesat, AUE_FUTIMESAT, NULL, 0, 0 }, /* 299 = linux_futimesat */ - { AS(linux_fstatat64_args), (sy_call_t *)linux_fstatat64, AUE_FSTATAT, NULL, 0, 0 }, /* 300 = linux_fstatat64 */ - { AS(linux_unlinkat_args), (sy_call_t *)linux_unlinkat, AUE_UNLINKAT, NULL, 0, 0 }, /* 301 = linux_unlinkat */ - { AS(linux_renameat_args), (sy_call_t *)linux_renameat, AUE_RENAMEAT, NULL, 0, 0 }, /* 302 = linux_renameat */ - { AS(linux_linkat_args), (sy_call_t *)linux_linkat, AUE_LINKAT, NULL, 0, 0 }, /* 303 = linux_linkat */ - { AS(linux_symlinkat_args), (sy_call_t *)linux_symlinkat, AUE_SYMLINKAT, NULL, 0, 0 }, /* 304 = linux_symlinkat */ - { AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0 }, /* 305 = linux_readlinkat */ - { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0 }, /* 306 = linux_fchmodat */ - { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0 }, /* 307 = linux_faccessat */ - { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0 }, /* 308 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0 }, /* 309 = linux_ppoll */ - { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0 }, /* 310 = linux_unshare */ - { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0 }, /* 311 = linux_set_robust_list */ - { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0 }, /* 312 = linux_get_robust_list */ - { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0 }, /* 313 = linux_splice */ - { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0 }, /* 314 = linux_sync_file_range */ - { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0 }, /* 315 = linux_tee */ - { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0 }, /* 316 = linux_vmsplice */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 0 = setup */ + { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0, 0 }, /* 1 = exit */ + { 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0 }, /* 2 = linux_fork */ + { AS(read_args), (sy_call_t *)read, AUE_NULL, NULL, 0, 0, 0 }, /* 3 = read */ + { AS(write_args), (sy_call_t *)write, AUE_NULL, NULL, 0, 0, 0 }, /* 4 = write */ + { AS(linux_open_args), (sy_call_t *)linux_open, AUE_OPEN_RWTC, NULL, 0, 0, 0 }, /* 5 = linux_open */ + { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0, 0 }, /* 6 = close */ + { AS(linux_waitpid_args), (sy_call_t *)linux_waitpid, AUE_WAIT4, NULL, 0, 0, 0 }, /* 7 = linux_waitpid */ + { AS(linux_creat_args), (sy_call_t *)linux_creat, AUE_CREAT, NULL, 0, 0, 0 }, /* 8 = linux_creat */ + { AS(linux_link_args), (sy_call_t *)linux_link, AUE_LINK, NULL, 0, 0, 0 }, /* 9 = linux_link */ + { AS(linux_unlink_args), (sy_call_t *)linux_unlink, AUE_UNLINK, NULL, 0, 0, 0 }, /* 10 = linux_unlink */ + { AS(linux_execve_args), (sy_call_t *)linux_execve, AUE_EXECVE, NULL, 0, 0, 0 }, /* 11 = linux_execve */ + { AS(linux_chdir_args), (sy_call_t *)linux_chdir, AUE_CHDIR, NULL, 0, 0, 0 }, /* 12 = linux_chdir */ + { AS(linux_time_args), (sy_call_t *)linux_time, AUE_NULL, NULL, 0, 0, 0 }, /* 13 = linux_time */ + { AS(linux_mknod_args), (sy_call_t *)linux_mknod, AUE_MKNOD, NULL, 0, 0, 0 }, /* 14 = linux_mknod */ + { AS(linux_chmod_args), (sy_call_t *)linux_chmod, AUE_CHMOD, NULL, 0, 0, 0 }, /* 15 = linux_chmod */ + { AS(linux_lchown16_args), (sy_call_t *)linux_lchown16, AUE_LCHOWN, NULL, 0, 0, 0 }, /* 16 = linux_lchown16 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 17 = break */ + { AS(linux_stat_args), (sy_call_t *)linux_stat, AUE_STAT, NULL, 0, 0, 0 }, /* 18 = linux_stat */ + { AS(linux_lseek_args), (sy_call_t *)linux_lseek, AUE_LSEEK, NULL, 0, 0, 0 }, /* 19 = linux_lseek */ + { 0, (sy_call_t *)linux_getpid, AUE_GETPID, NULL, 0, 0, 0 }, /* 20 = linux_getpid */ + { AS(linux_mount_args), (sy_call_t *)linux_mount, AUE_MOUNT, NULL, 0, 0, 0 }, /* 21 = linux_mount */ + { AS(linux_oldumount_args), (sy_call_t *)linux_oldumount, AUE_UMOUNT, NULL, 0, 0, 0 }, /* 22 = linux_oldumount */ + { AS(linux_setuid16_args), (sy_call_t *)linux_setuid16, AUE_SETUID, NULL, 0, 0, 0 }, /* 23 = linux_setuid16 */ + { 0, (sy_call_t *)linux_getuid16, AUE_GETUID, NULL, 0, 0, 0 }, /* 24 = linux_getuid16 */ + { 0, (sy_call_t *)linux_stime, AUE_SETTIMEOFDAY, NULL, 0, 0, 0 }, /* 25 = linux_stime */ + { AS(linux_ptrace_args), (sy_call_t *)linux_ptrace, AUE_PTRACE, NULL, 0, 0, 0 }, /* 26 = linux_ptrace */ + { AS(linux_alarm_args), (sy_call_t *)linux_alarm, AUE_NULL, NULL, 0, 0, 0 }, /* 27 = linux_alarm */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 28 = fstat */ + { 0, (sy_call_t *)linux_pause, AUE_NULL, NULL, 0, 0, 0 }, /* 29 = linux_pause */ + { AS(linux_utime_args), (sy_call_t *)linux_utime, AUE_UTIME, NULL, 0, 0, 0 }, /* 30 = linux_utime */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 31 = stty */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 32 = gtty */ + { AS(linux_access_args), (sy_call_t *)linux_access, AUE_ACCESS, NULL, 0, 0, 0 }, /* 33 = linux_access */ + { AS(linux_nice_args), (sy_call_t *)linux_nice, AUE_NICE, NULL, 0, 0, 0 }, /* 34 = linux_nice */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 35 = ftime */ + { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0, 0 }, /* 36 = sync */ + { AS(linux_kill_args), (sy_call_t *)linux_kill, AUE_KILL, NULL, 0, 0, 0 }, /* 37 = linux_kill */ + { AS(linux_rename_args), (sy_call_t *)linux_rename, AUE_RENAME, NULL, 0, 0, 0 }, /* 38 = linux_rename */ + { AS(linux_mkdir_args), (sy_call_t *)linux_mkdir, AUE_MKDIR, NULL, 0, 0, 0 }, /* 39 = linux_mkdir */ + { AS(linux_rmdir_args), (sy_call_t *)linux_rmdir, AUE_RMDIR, NULL, 0, 0, 0 }, /* 40 = linux_rmdir */ + { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0, 0 }, /* 41 = dup */ + { AS(linux_pipe_args), (sy_call_t *)linux_pipe, AUE_PIPE, NULL, 0, 0, 0 }, /* 42 = linux_pipe */ + { AS(linux_times_args), (sy_call_t *)linux_times, AUE_NULL, NULL, 0, 0, 0 }, /* 43 = linux_times */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 44 = prof */ + { AS(linux_brk_args), (sy_call_t *)linux_brk, AUE_NULL, NULL, 0, 0, 0 }, /* 45 = linux_brk */ + { AS(linux_setgid16_args), (sy_call_t *)linux_setgid16, AUE_SETGID, NULL, 0, 0, 0 }, /* 46 = linux_setgid16 */ + { 0, (sy_call_t *)linux_getgid16, AUE_GETGID, NULL, 0, 0, 0 }, /* 47 = linux_getgid16 */ + { AS(linux_signal_args), (sy_call_t *)linux_signal, AUE_NULL, NULL, 0, 0, 0 }, /* 48 = linux_signal */ + { 0, (sy_call_t *)linux_geteuid16, AUE_GETEUID, NULL, 0, 0, 0 }, /* 49 = linux_geteuid16 */ + { 0, (sy_call_t *)linux_getegid16, AUE_GETEGID, NULL, 0, 0, 0 }, /* 50 = linux_getegid16 */ + { AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0, 0 }, /* 51 = acct */ + { AS(linux_umount_args), (sy_call_t *)linux_umount, AUE_UMOUNT, NULL, 0, 0, 0 }, /* 52 = linux_umount */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 53 = lock */ + { AS(linux_ioctl_args), (sy_call_t *)linux_ioctl, AUE_IOCTL, NULL, 0, 0, 0 }, /* 54 = linux_ioctl */ + { AS(linux_fcntl_args), (sy_call_t *)linux_fcntl, AUE_FCNTL, NULL, 0, 0, 0 }, /* 55 = linux_fcntl */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 56 = mpx */ + { AS(setpgid_args), (sy_call_t *)setpgid, AUE_SETPGRP, NULL, 0, 0, 0 }, /* 57 = setpgid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 58 = ulimit */ + { 0, (sy_call_t *)linux_olduname, AUE_NULL, NULL, 0, 0, 0 }, /* 59 = linux_olduname */ + { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0, 0 }, /* 60 = umask */ + { AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0, 0 }, /* 61 = chroot */ + { AS(linux_ustat_args), (sy_call_t *)linux_ustat, AUE_NULL, NULL, 0, 0, 0 }, /* 62 = linux_ustat */ + { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0, 0 }, /* 63 = dup2 */ + { 0, (sy_call_t *)linux_getppid, AUE_GETPPID, NULL, 0, 0, 0 }, /* 64 = linux_getppid */ + { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0, 0 }, /* 65 = getpgrp */ + { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0, 0 }, /* 66 = setsid */ + { AS(linux_sigaction_args), (sy_call_t *)linux_sigaction, AUE_NULL, NULL, 0, 0, 0 }, /* 67 = linux_sigaction */ + { 0, (sy_call_t *)linux_sgetmask, AUE_NULL, NULL, 0, 0, 0 }, /* 68 = linux_sgetmask */ + { AS(linux_ssetmask_args), (sy_call_t *)linux_ssetmask, AUE_NULL, NULL, 0, 0, 0 }, /* 69 = linux_ssetmask */ + { AS(linux_setreuid16_args), (sy_call_t *)linux_setreuid16, AUE_SETREUID, NULL, 0, 0, 0 }, /* 70 = linux_setreuid16 */ + { AS(linux_setregid16_args), (sy_call_t *)linux_setregid16, AUE_SETREGID, NULL, 0, 0, 0 }, /* 71 = linux_setregid16 */ + { AS(linux_sigsuspend_args), (sy_call_t *)linux_sigsuspend, AUE_NULL, NULL, 0, 0, 0 }, /* 72 = linux_sigsuspend */ + { AS(linux_sigpending_args), (sy_call_t *)linux_sigpending, AUE_NULL, NULL, 0, 0, 0 }, /* 73 = linux_sigpending */ + { AS(linux_sethostname_args), (sy_call_t *)linux_sethostname, AUE_SYSCTL, NULL, 0, 0, 0 }, /* 74 = linux_sethostname */ + { AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit, AUE_SETRLIMIT, NULL, 0, 0, 0 }, /* 75 = linux_setrlimit */ + { AS(linux_old_getrlimit_args), (sy_call_t *)linux_old_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0 }, /* 76 = linux_old_getrlimit */ + { AS(linux_getrusage_args), (sy_call_t *)linux_getrusage, AUE_GETRUSAGE, NULL, 0, 0, 0 }, /* 77 = linux_getrusage */ + { AS(linux_gettimeofday_args), (sy_call_t *)linux_gettimeofday, AUE_NULL, NULL, 0, 0, 0 }, /* 78 = linux_gettimeofday */ + { AS(linux_settimeofday_args), (sy_call_t *)linux_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0, 0 }, /* 79 = linux_settimeofday */ + { AS(linux_getgroups16_args), (sy_call_t *)linux_getgroups16, AUE_GETGROUPS, NULL, 0, 0, 0 }, /* 80 = linux_getgroups16 */ + { AS(linux_setgroups16_args), (sy_call_t *)linux_setgroups16, AUE_SETGROUPS, NULL, 0, 0, 0 }, /* 81 = linux_setgroups16 */ + { AS(linux_old_select_args), (sy_call_t *)linux_old_select, AUE_SELECT, NULL, 0, 0, 0 }, /* 82 = linux_old_select */ + { AS(linux_symlink_args), (sy_call_t *)linux_symlink, AUE_SYMLINK, NULL, 0, 0, 0 }, /* 83 = linux_symlink */ + { AS(linux_lstat_args), (sy_call_t *)linux_lstat, AUE_LSTAT, NULL, 0, 0, 0 }, /* 84 = linux_lstat */ + { AS(linux_readlink_args), (sy_call_t *)linux_readlink, AUE_READLINK, NULL, 0, 0, 0 }, /* 85 = linux_readlink */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 86 = linux_uselib */ + { AS(swapon_args), (sy_call_t *)swapon, AUE_SWAPON, NULL, 0, 0, 0 }, /* 87 = swapon */ + { AS(linux_reboot_args), (sy_call_t *)linux_reboot, AUE_REBOOT, NULL, 0, 0, 0 }, /* 88 = linux_reboot */ + { AS(linux_readdir_args), (sy_call_t *)linux_readdir, AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 89 = linux_readdir */ + { AS(linux_mmap_args), (sy_call_t *)linux_mmap, AUE_MMAP, NULL, 0, 0, 0 }, /* 90 = linux_mmap */ + { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0, 0 }, /* 91 = munmap */ + { AS(linux_truncate_args), (sy_call_t *)linux_truncate, AUE_TRUNCATE, NULL, 0, 0, 0 }, /* 92 = linux_truncate */ + { AS(linux_ftruncate_args), (sy_call_t *)linux_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0 }, /* 93 = linux_ftruncate */ + { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0, 0 }, /* 94 = fchmod */ + { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0, 0 }, /* 95 = fchown */ + { AS(linux_getpriority_args), (sy_call_t *)linux_getpriority, AUE_GETPRIORITY, NULL, 0, 0, 0 }, /* 96 = linux_getpriority */ + { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0, 0 }, /* 97 = setpriority */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 98 = profil */ + { AS(linux_statfs_args), (sy_call_t *)linux_statfs, AUE_STATFS, NULL, 0, 0, 0 }, /* 99 = linux_statfs */ + { AS(linux_fstatfs_args), (sy_call_t *)linux_fstatfs, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 100 = linux_fstatfs */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 101 = ioperm */ + { AS(linux_socketcall_args), (sy_call_t *)linux_socketcall, AUE_NULL, NULL, 0, 0, 0 }, /* 102 = linux_socketcall */ + { AS(linux_syslog_args), (sy_call_t *)linux_syslog, AUE_NULL, NULL, 0, 0, 0 }, /* 103 = linux_syslog */ + { AS(linux_setitimer_args), (sy_call_t *)linux_setitimer, AUE_SETITIMER, NULL, 0, 0, 0 }, /* 104 = linux_setitimer */ + { AS(linux_getitimer_args), (sy_call_t *)linux_getitimer, AUE_GETITIMER, NULL, 0, 0, 0 }, /* 105 = linux_getitimer */ + { AS(linux_newstat_args), (sy_call_t *)linux_newstat, AUE_STAT, NULL, 0, 0, 0 }, /* 106 = linux_newstat */ + { AS(linux_newlstat_args), (sy_call_t *)linux_newlstat, AUE_LSTAT, NULL, 0, 0, 0 }, /* 107 = linux_newlstat */ + { AS(linux_newfstat_args), (sy_call_t *)linux_newfstat, AUE_FSTAT, NULL, 0, 0, 0 }, /* 108 = linux_newfstat */ + { 0, (sy_call_t *)linux_uname, AUE_NULL, NULL, 0, 0, 0 }, /* 109 = linux_uname */ + { AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0, 0 }, /* 110 = linux_iopl */ + { 0, (sy_call_t *)linux_vhangup, AUE_NULL, NULL, 0, 0, 0 }, /* 111 = linux_vhangup */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 112 = idle */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 113 = vm86old */ + { AS(linux_wait4_args), (sy_call_t *)linux_wait4, AUE_WAIT4, NULL, 0, 0, 0 }, /* 114 = linux_wait4 */ + { 0, (sy_call_t *)linux_swapoff, AUE_SWAPOFF, NULL, 0, 0, 0 }, /* 115 = linux_swapoff */ + { AS(linux_sysinfo_args), (sy_call_t *)linux_sysinfo, AUE_NULL, NULL, 0, 0, 0 }, /* 116 = linux_sysinfo */ + { AS(linux_ipc_args), (sy_call_t *)linux_ipc, AUE_NULL, NULL, 0, 0, 0 }, /* 117 = linux_ipc */ + { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0, 0 }, /* 118 = fsync */ + { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn, AUE_SIGRETURN, NULL, 0, 0, 0 }, /* 119 = linux_sigreturn */ + { AS(linux_clone_args), (sy_call_t *)linux_clone, AUE_RFORK, NULL, 0, 0, 0 }, /* 120 = linux_clone */ + { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0, 0 }, /* 121 = linux_setdomainname */ + { AS(linux_newuname_args), (sy_call_t *)linux_newuname, AUE_NULL, NULL, 0, 0, 0 }, /* 122 = linux_newuname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 123 = modify_ldt */ + { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0, 0 }, /* 124 = linux_adjtimex */ + { AS(linux_mprotect_args), (sy_call_t *)linux_mprotect, AUE_MPROTECT, NULL, 0, 0, 0 }, /* 125 = linux_mprotect */ + { AS(linux_sigprocmask_args), (sy_call_t *)linux_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0 }, /* 126 = linux_sigprocmask */ + { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0, 0 }, /* 127 = linux_create_module */ + { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0, 0 }, /* 128 = linux_init_module */ + { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0, 0 }, /* 129 = linux_delete_module */ + { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0, 0 }, /* 130 = linux_get_kernel_syms */ + { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0, 0 }, /* 131 = linux_quotactl */ + { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0, 0 }, /* 132 = getpgid */ + { AS(fchdir_args), (sy_call_t *)fchdir, AUE_FCHDIR, NULL, 0, 0, 0 }, /* 133 = fchdir */ + { 0, (sy_call_t *)linux_bdflush, AUE_BDFLUSH, NULL, 0, 0, 0 }, /* 134 = linux_bdflush */ + { AS(linux_sysfs_args), (sy_call_t *)linux_sysfs, AUE_NULL, NULL, 0, 0, 0 }, /* 135 = linux_sysfs */ + { AS(linux_personality_args), (sy_call_t *)linux_personality, AUE_PERSONALITY, NULL, 0, 0, 0 }, /* 136 = linux_personality */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 137 = afs_syscall */ + { AS(linux_setfsuid16_args), (sy_call_t *)linux_setfsuid16, AUE_SETFSUID, NULL, 0, 0, 0 }, /* 138 = linux_setfsuid16 */ + { AS(linux_setfsgid16_args), (sy_call_t *)linux_setfsgid16, AUE_SETFSGID, NULL, 0, 0, 0 }, /* 139 = linux_setfsgid16 */ + { AS(linux_llseek_args), (sy_call_t *)linux_llseek, AUE_LSEEK, NULL, 0, 0, 0 }, /* 140 = linux_llseek */ + { AS(linux_getdents_args), (sy_call_t *)linux_getdents, AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 141 = linux_getdents */ + { AS(linux_select_args), (sy_call_t *)linux_select, AUE_SELECT, NULL, 0, 0, 0 }, /* 142 = linux_select */ + { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0, 0 }, /* 143 = flock */ + { AS(linux_msync_args), (sy_call_t *)linux_msync, AUE_MSYNC, NULL, 0, 0, 0 }, /* 144 = linux_msync */ + { AS(linux_readv_args), (sy_call_t *)linux_readv, AUE_READV, NULL, 0, 0, 0 }, /* 145 = linux_readv */ + { AS(linux_writev_args), (sy_call_t *)linux_writev, AUE_WRITEV, NULL, 0, 0, 0 }, /* 146 = linux_writev */ + { AS(linux_getsid_args), (sy_call_t *)linux_getsid, AUE_GETSID, NULL, 0, 0, 0 }, /* 147 = linux_getsid */ + { AS(linux_fdatasync_args), (sy_call_t *)linux_fdatasync, AUE_NULL, NULL, 0, 0, 0 }, /* 148 = linux_fdatasync */ + { AS(linux_sysctl_args), (sy_call_t *)linux_sysctl, AUE_SYSCTL, NULL, 0, 0, 0 }, /* 149 = linux_sysctl */ + { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0, 0 }, /* 150 = mlock */ + { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0, 0 }, /* 151 = munlock */ + { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0, 0 }, /* 152 = mlockall */ + { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0 }, /* 153 = munlockall */ + { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0 }, /* 154 = sched_setparam */ + { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0 }, /* 155 = sched_getparam */ + { AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0 }, /* 156 = linux_sched_setscheduler */ + { AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0 }, /* 157 = linux_sched_getscheduler */ + { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0, 0 }, /* 158 = sched_yield */ + { AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0, 0 }, /* 159 = linux_sched_get_priority_max */ + { AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0, 0 }, /* 160 = linux_sched_get_priority_min */ + { AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0 }, /* 161 = linux_sched_rr_get_interval */ + { AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0, 0 }, /* 162 = linux_nanosleep */ + { AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0, 0 }, /* 163 = linux_mremap */ + { AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0, 0 }, /* 164 = linux_setresuid16 */ + { AS(linux_getresuid16_args), (sy_call_t *)linux_getresuid16, AUE_GETRESUID, NULL, 0, 0, 0 }, /* 165 = linux_getresuid16 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 166 = vm86 */ + { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0, 0 }, /* 167 = linux_query_module */ + { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0, 0 }, /* 168 = poll */ + { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0, 0 }, /* 169 = linux_nfsservctl */ + { AS(linux_setresgid16_args), (sy_call_t *)linux_setresgid16, AUE_SETRESGID, NULL, 0, 0, 0 }, /* 170 = linux_setresgid16 */ + { AS(linux_getresgid16_args), (sy_call_t *)linux_getresgid16, AUE_GETRESGID, NULL, 0, 0, 0 }, /* 171 = linux_getresgid16 */ + { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0, 0 }, /* 172 = linux_prctl */ + { AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn, AUE_NULL, NULL, 0, 0, 0 }, /* 173 = linux_rt_sigreturn */ + { AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction, AUE_NULL, NULL, 0, 0, 0 }, /* 174 = linux_rt_sigaction */ + { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0 }, /* 175 = linux_rt_sigprocmask */ + { AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0 }, /* 176 = linux_rt_sigpending */ + { AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0 }, /* 177 = linux_rt_sigtimedwait */ + { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0 }, /* 178 = linux_rt_sigqueueinfo */ + { AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0 }, /* 179 = linux_rt_sigsuspend */ + { AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0 }, /* 180 = linux_pread */ + { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0 }, /* 181 = linux_pwrite */ + { AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0, 0 }, /* 182 = linux_chown16 */ + { AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0, 0 }, /* 183 = linux_getcwd */ + { 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0 }, /* 184 = linux_capget */ + { 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0 }, /* 185 = linux_capset */ + { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0 }, /* 186 = linux_sigaltstack */ + { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0 }, /* 187 = linux_sendfile */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 188 = getpmsg */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 189 = putpmsg */ + { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0, 0 }, /* 190 = linux_vfork */ + { AS(linux_getrlimit_args), (sy_call_t *)linux_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0 }, /* 191 = linux_getrlimit */ + { AS(linux_mmap2_args), (sy_call_t *)linux_mmap2, AUE_MMAP, NULL, 0, 0, 0 }, /* 192 = linux_mmap2 */ + { AS(linux_truncate64_args), (sy_call_t *)linux_truncate64, AUE_TRUNCATE, NULL, 0, 0, 0 }, /* 193 = linux_truncate64 */ + { AS(linux_ftruncate64_args), (sy_call_t *)linux_ftruncate64, AUE_FTRUNCATE, NULL, 0, 0, 0 }, /* 194 = linux_ftruncate64 */ + { AS(linux_stat64_args), (sy_call_t *)linux_stat64, AUE_STAT, NULL, 0, 0, 0 }, /* 195 = linux_stat64 */ + { AS(linux_lstat64_args), (sy_call_t *)linux_lstat64, AUE_LSTAT, NULL, 0, 0, 0 }, /* 196 = linux_lstat64 */ + { AS(linux_fstat64_args), (sy_call_t *)linux_fstat64, AUE_FSTAT, NULL, 0, 0, 0 }, /* 197 = linux_fstat64 */ + { AS(linux_lchown_args), (sy_call_t *)linux_lchown, AUE_LCHOWN, NULL, 0, 0, 0 }, /* 198 = linux_lchown */ + { 0, (sy_call_t *)linux_getuid, AUE_GETUID, NULL, 0, 0, 0 }, /* 199 = linux_getuid */ + { 0, (sy_call_t *)linux_getgid, AUE_GETGID, NULL, 0, 0, 0 }, /* 200 = linux_getgid */ + { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0, 0 }, /* 201 = geteuid */ + { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0, 0 }, /* 202 = getegid */ + { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0, 0 }, /* 203 = setreuid */ + { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0, 0 }, /* 204 = setregid */ + { AS(linux_getgroups_args), (sy_call_t *)linux_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0 }, /* 205 = linux_getgroups */ + { AS(linux_setgroups_args), (sy_call_t *)linux_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0 }, /* 206 = linux_setgroups */ + { AS(fchown_args), (sy_call_t *)fchown, AUE_NULL, NULL, 0, 0, 0 }, /* 207 = fchown */ + { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0, 0 }, /* 208 = setresuid */ + { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0, 0 }, /* 209 = getresuid */ + { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0, 0 }, /* 210 = setresgid */ + { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0, 0 }, /* 211 = getresgid */ + { AS(linux_chown_args), (sy_call_t *)linux_chown, AUE_CHOWN, NULL, 0, 0, 0 }, /* 212 = linux_chown */ + { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0, 0 }, /* 213 = setuid */ + { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0, 0 }, /* 214 = setgid */ + { AS(linux_setfsuid_args), (sy_call_t *)linux_setfsuid, AUE_SETFSUID, NULL, 0, 0, 0 }, /* 215 = linux_setfsuid */ + { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid, AUE_SETFSGID, NULL, 0, 0, 0 }, /* 216 = linux_setfsgid */ + { AS(linux_pivot_root_args), (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0, 0 }, /* 217 = linux_pivot_root */ + { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0, 0 }, /* 218 = linux_mincore */ + { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0, 0 }, /* 219 = madvise */ + { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 220 = linux_getdents64 */ + { AS(linux_fcntl64_args), (sy_call_t *)linux_fcntl64, AUE_FCNTL, NULL, 0, 0, 0 }, /* 221 = linux_fcntl64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 222 = */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 223 = */ + { 0, (sy_call_t *)linux_gettid, AUE_NULL, NULL, 0, 0, 0 }, /* 224 = linux_gettid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 225 = linux_readahead */ + { 0, (sy_call_t *)linux_setxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 226 = linux_setxattr */ + { 0, (sy_call_t *)linux_lsetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 227 = linux_lsetxattr */ + { 0, (sy_call_t *)linux_fsetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 228 = linux_fsetxattr */ + { 0, (sy_call_t *)linux_getxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 229 = linux_getxattr */ + { 0, (sy_call_t *)linux_lgetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 230 = linux_lgetxattr */ + { 0, (sy_call_t *)linux_fgetxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 231 = linux_fgetxattr */ + { 0, (sy_call_t *)linux_listxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 232 = linux_listxattr */ + { 0, (sy_call_t *)linux_llistxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 233 = linux_llistxattr */ + { 0, (sy_call_t *)linux_flistxattr, AUE_NULL, NULL, 0, 0, 0 }, /* 234 = linux_flistxattr */ + { 0, (sy_call_t *)linux_removexattr, AUE_NULL, NULL, 0, 0, 0 }, /* 235 = linux_removexattr */ + { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0, 0 }, /* 236 = linux_lremovexattr */ + { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0, 0 }, /* 237 = linux_fremovexattr */ + { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0, 0 }, /* 238 = linux_tkill */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 239 = linux_sendfile64 */ + { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0, 0 }, /* 240 = linux_sys_futex */ + { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0 }, /* 241 = linux_sched_setaffinity */ + { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0 }, /* 242 = linux_sched_getaffinity */ + { AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0, 0 }, /* 243 = linux_set_thread_area */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 244 = linux_get_thread_area */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 245 = linux_io_setup */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 246 = linux_io_destroy */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 247 = linux_io_getevents */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = inux_io_submit */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 249 = linux_io_cancel */ + { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 251 = */ + { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0 }, /* 252 = linux_exit_group */ + { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0 }, /* 253 = linux_lookup_dcookie */ + { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0 }, /* 254 = linux_epoll_create */ + { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0 }, /* 255 = linux_epoll_ctl */ + { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0 }, /* 256 = linux_epoll_wait */ + { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0 }, /* 257 = linux_remap_file_pages */ + { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0 }, /* 258 = linux_set_tid_address */ + { 0, (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0 }, /* 259 = linux_timer_create */ + { 0, (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0 }, /* 260 = linux_timer_settime */ + { 0, (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0 }, /* 261 = linux_timer_gettime */ + { 0, (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0 }, /* 262 = linux_timer_getoverrun */ + { 0, (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0 }, /* 263 = linux_timer_delete */ + { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0 }, /* 264 = linux_clock_settime */ + { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0, 0 }, /* 265 = linux_clock_gettime */ + { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0 }, /* 266 = linux_clock_getres */ + { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0 }, /* 267 = linux_clock_nanosleep */ + { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0, 0 }, /* 268 = linux_statfs64 */ + { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 269 = linux_fstatfs64 */ + { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0 }, /* 270 = linux_tgkill */ + { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0 }, /* 271 = linux_utimes */ + { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 273 = */ + { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0 }, /* 274 = linux_mbind */ + { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 275 = linux_get_mempolicy */ + { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 276 = linux_set_mempolicy */ + { 0, (sy_call_t *)linux_mq_open, AUE_NULL, NULL, 0, 0, 0 }, /* 277 = linux_mq_open */ + { 0, (sy_call_t *)linux_mq_unlink, AUE_NULL, NULL, 0, 0, 0 }, /* 278 = linux_mq_unlink */ + { 0, (sy_call_t *)linux_mq_timedsend, AUE_NULL, NULL, 0, 0, 0 }, /* 279 = linux_mq_timedsend */ + { 0, (sy_call_t *)linux_mq_timedreceive, AUE_NULL, NULL, 0, 0, 0 }, /* 280 = linux_mq_timedreceive */ + { 0, (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0 }, /* 281 = linux_mq_notify */ + { 0, (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0 }, /* 282 = linux_mq_getsetattr */ + { 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0 }, /* 283 = linux_kexec_load */ + { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0, 0 }, /* 284 = linux_waitid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 285 = */ + { 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0 }, /* 286 = linux_add_key */ + { 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0 }, /* 287 = linux_request_key */ + { 0, (sy_call_t *)linux_keyctl, AUE_NULL, NULL, 0, 0, 0 }, /* 288 = linux_keyctl */ + { 0, (sy_call_t *)linux_ioprio_set, AUE_NULL, NULL, 0, 0, 0 }, /* 289 = linux_ioprio_set */ + { 0, (sy_call_t *)linux_ioprio_get, AUE_NULL, NULL, 0, 0, 0 }, /* 290 = linux_ioprio_get */ + { 0, (sy_call_t *)linux_inotify_init, AUE_NULL, NULL, 0, 0, 0 }, /* 291 = linux_inotify_init */ + { 0, (sy_call_t *)linux_inotify_add_watch, AUE_NULL, NULL, 0, 0, 0 }, /* 292 = linux_inotify_add_watch */ + { 0, (sy_call_t *)linux_inotify_rm_watch, AUE_NULL, NULL, 0, 0, 0 }, /* 293 = linux_inotify_rm_watch */ + { 0, (sy_call_t *)linux_migrate_pages, AUE_NULL, NULL, 0, 0, 0 }, /* 294 = linux_migrate_pages */ + { AS(linux_openat_args), (sy_call_t *)linux_openat, AUE_OPEN_RWTC, NULL, 0, 0, 0 }, /* 295 = linux_openat */ + { AS(linux_mkdirat_args), (sy_call_t *)linux_mkdirat, AUE_MKDIRAT, NULL, 0, 0, 0 }, /* 296 = linux_mkdirat */ + { AS(linux_mknodat_args), (sy_call_t *)linux_mknodat, AUE_MKNODAT, NULL, 0, 0, 0 }, /* 297 = linux_mknodat */ + { AS(linux_fchownat_args), (sy_call_t *)linux_fchownat, AUE_FCHOWNAT, NULL, 0, 0, 0 }, /* 298 = linux_fchownat */ + { AS(linux_futimesat_args), (sy_call_t *)linux_futimesat, AUE_FUTIMESAT, NULL, 0, 0, 0 }, /* 299 = linux_futimesat */ + { AS(linux_fstatat64_args), (sy_call_t *)linux_fstatat64, AUE_FSTATAT, NULL, 0, 0, 0 }, /* 300 = linux_fstatat64 */ + { AS(linux_unlinkat_args), (sy_call_t *)linux_unlinkat, AUE_UNLINKAT, NULL, 0, 0, 0 }, /* 301 = linux_unlinkat */ + { AS(linux_renameat_args), (sy_call_t *)linux_renameat, AUE_RENAMEAT, NULL, 0, 0, 0 }, /* 302 = linux_renameat */ + { AS(linux_linkat_args), (sy_call_t *)linux_linkat, AUE_LINKAT, NULL, 0, 0, 0 }, /* 303 = linux_linkat */ + { AS(linux_symlinkat_args), (sy_call_t *)linux_symlinkat, AUE_SYMLINKAT, NULL, 0, 0, 0 }, /* 304 = linux_symlinkat */ + { AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0 }, /* 305 = linux_readlinkat */ + { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0 }, /* 306 = linux_fchmodat */ + { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0 }, /* 307 = linux_faccessat */ + { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0, 0 }, /* 308 = linux_pselect6 */ + { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0 }, /* 309 = linux_ppoll */ + { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0 }, /* 310 = linux_unshare */ + { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0 }, /* 311 = linux_set_robust_list */ + { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0 }, /* 312 = linux_get_robust_list */ + { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0 }, /* 313 = linux_splice */ + { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0 }, /* 314 = linux_sync_file_range */ + { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0 }, /* 315 = linux_tee */ + { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0 }, /* 316 = linux_vmsplice */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Jun 1 16:13:06 2009 (r193234) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Jun 1 16:14:38 2009 (r193235) @@ -38,513 +38,513 @@ /* The casts are bogus but will do for now. */ struct sysent freebsd32_sysent[] = { - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 0 = syscall */ - { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0 }, /* 1 = exit */ - { 0, (sy_call_t *)fork, AUE_FORK, NULL, 0, 0 }, /* 2 = fork */ - { AS(read_args), (sy_call_t *)read, AUE_READ, NULL, 0, 0 }, /* 3 = read */ - { AS(write_args), (sy_call_t *)write, AUE_WRITE, NULL, 0, 0 }, /* 4 = write */ - { AS(open_args), (sy_call_t *)open, AUE_OPEN_RWTC, NULL, 0, 0 }, /* 5 = open */ - { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0 }, /* 6 = close */ - { AS(freebsd32_wait4_args), (sy_call_t *)freebsd32_wait4, AUE_WAIT4, NULL, 0, 0 }, /* 7 = freebsd32_wait4 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 8 = obsolete old creat */ - { AS(link_args), (sy_call_t *)link, AUE_LINK, NULL, 0, 0 }, /* 9 = link */ - { AS(unlink_args), (sy_call_t *)unlink, AUE_UNLINK, NULL, 0, 0 }, /* 10 = unlink */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 11 = obsolete execv */ - { AS(chdir_args), (sy_call_t *)chdir, AUE_CHDIR, NULL, 0, 0 }, /* 12 = chdir */ - { AS(fchdir_args), (sy_call_t *)fchdir, AUE_FCHDIR, NULL, 0, 0 }, /* 13 = fchdir */ - { AS(mknod_args), (sy_call_t *)mknod, AUE_MKNOD, NULL, 0, 0 }, /* 14 = mknod */ - { AS(chmod_args), (sy_call_t *)chmod, AUE_CHMOD, NULL, 0, 0 }, /* 15 = chmod */ - { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0 }, /* 16 = chown */ - { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0 }, /* 17 = break */ - { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0 }, /* 18 = old freebsd32_getfsstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 19 = obsolete olseek */ - { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0 }, /* 20 = getpid */ - { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0 }, /* 21 = mount */ - { AS(unmount_args), (sy_call_t *)unmount, AUE_UMOUNT, NULL, 0, 0 }, /* 22 = unmount */ - { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0 }, /* 23 = setuid */ - { 0, (sy_call_t *)getuid, AUE_GETUID, NULL, 0, 0 }, /* 24 = getuid */ - { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0 }, /* 25 = geteuid */ - { AS(ptrace_args), (sy_call_t *)ptrace, AUE_PTRACE, NULL, 0, 0 }, /* 26 = ptrace */ - { AS(freebsd32_recvmsg_args), (sy_call_t *)freebsd32_recvmsg, AUE_RECVMSG, NULL, 0, 0 }, /* 27 = freebsd32_recvmsg */ - { AS(freebsd32_sendmsg_args), (sy_call_t *)freebsd32_sendmsg, AUE_SENDMSG, NULL, 0, 0 }, /* 28 = freebsd32_sendmsg */ - { AS(freebsd32_recvfrom_args), (sy_call_t *)freebsd32_recvfrom, AUE_RECVFROM, NULL, 0, 0 }, /* 29 = freebsd32_recvfrom */ - { AS(accept_args), (sy_call_t *)accept, AUE_ACCEPT, NULL, 0, 0 }, /* 30 = accept */ - { AS(getpeername_args), (sy_call_t *)getpeername, AUE_GETPEERNAME, NULL, 0, 0 }, /* 31 = getpeername */ - { AS(getsockname_args), (sy_call_t *)getsockname, AUE_GETSOCKNAME, NULL, 0, 0 }, /* 32 = getsockname */ - { AS(access_args), (sy_call_t *)access, AUE_ACCESS, NULL, 0, 0 }, /* 33 = access */ - { AS(chflags_args), (sy_call_t *)chflags, AUE_CHFLAGS, NULL, 0, 0 }, /* 34 = chflags */ - { AS(fchflags_args), (sy_call_t *)fchflags, AUE_FCHFLAGS, NULL, 0, 0 }, /* 35 = fchflags */ - { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0 }, /* 36 = sync */ - { AS(kill_args), (sy_call_t *)kill, AUE_KILL, NULL, 0, 0 }, /* 37 = kill */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 38 = ostat */ - { 0, (sy_call_t *)getppid, AUE_GETPPID, NULL, 0, 0 }, /* 39 = getppid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 40 = olstat */ - { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0 }, /* 41 = dup */ - { 0, (sy_call_t *)pipe, AUE_PIPE, NULL, 0, 0 }, /* 42 = pipe */ - { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0 }, /* 43 = getegid */ - { AS(profil_args), (sy_call_t *)profil, AUE_PROFILE, NULL, 0, 0 }, /* 44 = profil */ - { AS(ktrace_args), (sy_call_t *)ktrace, AUE_KTRACE, NULL, 0, 0 }, /* 45 = ktrace */ - { compat(AS(ofreebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 46 = old freebsd32_sigaction */ - { 0, (sy_call_t *)getgid, AUE_GETGID, NULL, 0, 0 }, /* 47 = getgid */ - { compat(AS(ofreebsd32_sigprocmask_args),freebsd32_sigprocmask), AUE_SIGPROCMASK, NULL, 0, 0 }, /* 48 = old freebsd32_sigprocmask */ - { AS(getlogin_args), (sy_call_t *)getlogin, AUE_GETLOGIN, NULL, 0, 0 }, /* 49 = getlogin */ - { AS(setlogin_args), (sy_call_t *)setlogin, AUE_SETLOGIN, NULL, 0, 0 }, /* 50 = setlogin */ - { AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0 }, /* 51 = acct */ - { compat(0,freebsd32_sigpending), AUE_SIGPENDING, NULL, 0, 0 }, /* 52 = old freebsd32_sigpending */ - { AS(freebsd32_sigaltstack_args), (sy_call_t *)freebsd32_sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0 }, /* 53 = freebsd32_sigaltstack */ - { AS(freebsd32_ioctl_args), (sy_call_t *)freebsd32_ioctl, AUE_NULL, NULL, 0, 0 }, /* 54 = freebsd32_ioctl */ - { AS(reboot_args), (sy_call_t *)reboot, AUE_REBOOT, NULL, 0, 0 }, /* 55 = reboot */ - { AS(revoke_args), (sy_call_t *)revoke, AUE_REVOKE, NULL, 0, 0 }, /* 56 = revoke */ - { AS(symlink_args), (sy_call_t *)symlink, AUE_SYMLINK, NULL, 0, 0 }, /* 57 = symlink */ - { AS(readlink_args), (sy_call_t *)readlink, AUE_READLINK, NULL, 0, 0 }, /* 58 = readlink */ - { AS(freebsd32_execve_args), (sy_call_t *)freebsd32_execve, AUE_EXECVE, NULL, 0, 0 }, /* 59 = freebsd32_execve */ - { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0 }, /* 60 = umask */ - { AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0 }, /* 61 = chroot */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 62 = obsolete ofstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 63 = obsolete ogetkerninfo */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 64 = obsolete ogetpagesize */ - { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0 }, /* 65 = msync */ - { 0, (sy_call_t *)vfork, AUE_VFORK, NULL, 0, 0 }, /* 66 = vfork */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 67 = obsolete vread */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 68 = obsolete vwrite */ - { AS(sbrk_args), (sy_call_t *)sbrk, AUE_SBRK, NULL, 0, 0 }, /* 69 = sbrk */ - { AS(sstk_args), (sy_call_t *)sstk, AUE_SSTK, NULL, 0, 0 }, /* 70 = sstk */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 71 = obsolete ommap */ - { AS(ovadvise_args), (sy_call_t *)ovadvise, AUE_O_VADVISE, NULL, 0, 0 }, /* 72 = vadvise */ - { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0 }, /* 73 = munmap */ - { AS(mprotect_args), (sy_call_t *)mprotect, AUE_MPROTECT, NULL, 0, 0 }, /* 74 = mprotect */ - { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0 }, /* 75 = madvise */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 76 = obsolete vhangup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 77 = obsolete vlimit */ - { AS(mincore_args), (sy_call_t *)mincore, AUE_MINCORE, NULL, 0, 0 }, /* 78 = mincore */ - { AS(getgroups_args), (sy_call_t *)getgroups, AUE_GETGROUPS, NULL, 0, 0 }, /* 79 = getgroups */ - { AS(setgroups_args), (sy_call_t *)setgroups, AUE_SETGROUPS, NULL, 0, 0 }, /* 80 = setgroups */ - { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0 }, /* 81 = getpgrp */ - { AS(setpgid_args), (sy_call_t *)setpgid, AUE_SETPGRP, NULL, 0, 0 }, /* 82 = setpgid */ - { AS(freebsd32_setitimer_args), (sy_call_t *)freebsd32_setitimer, AUE_SETITIMER, NULL, 0, 0 }, /* 83 = freebsd32_setitimer */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 84 = obsolete owait */ - { AS(swapon_args), (sy_call_t *)swapon, AUE_SWAPON, NULL, 0, 0 }, /* 85 = swapon */ - { AS(freebsd32_getitimer_args), (sy_call_t *)freebsd32_getitimer, AUE_GETITIMER, NULL, 0, 0 }, /* 86 = freebsd32_getitimer */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 87 = obsolete ogethostname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 88 = obsolete osethostname */ - { 0, (sy_call_t *)getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0 }, /* 89 = getdtablesize */ - { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0 }, /* 90 = dup2 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 91 = getdopt */ - { AS(fcntl_args), (sy_call_t *)fcntl, AUE_FCNTL, NULL, 0, 0 }, /* 92 = fcntl */ - { AS(freebsd32_select_args), (sy_call_t *)freebsd32_select, AUE_SELECT, NULL, 0, 0 }, /* 93 = freebsd32_select */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 94 = setdopt */ - { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0 }, /* 95 = fsync */ - { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0 }, /* 96 = setpriority */ - { AS(socket_args), (sy_call_t *)socket, AUE_SOCKET, NULL, 0, 0 }, /* 97 = socket */ - { AS(connect_args), (sy_call_t *)connect, AUE_CONNECT, NULL, 0, 0 }, /* 98 = connect */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 99 = obsolete oaccept */ - { AS(getpriority_args), (sy_call_t *)getpriority, AUE_GETPRIORITY, NULL, 0, 0 }, /* 100 = getpriority */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 101 = obsolete osend */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 102 = obsolete orecv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 103 = obsolete osigreturn */ - { AS(bind_args), (sy_call_t *)bind, AUE_BIND, NULL, 0, 0 }, /* 104 = bind */ - { AS(setsockopt_args), (sy_call_t *)setsockopt, AUE_SETSOCKOPT, NULL, 0, 0 }, /* 105 = setsockopt */ - { AS(listen_args), (sy_call_t *)listen, AUE_LISTEN, NULL, 0, 0 }, /* 106 = listen */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 107 = obsolete vtimes */ - { compat(AS(ofreebsd32_sigvec_args),freebsd32_sigvec), AUE_O_SIGVEC, NULL, 0, 0 }, /* 108 = old freebsd32_sigvec */ - { compat(AS(ofreebsd32_sigblock_args),freebsd32_sigblock), AUE_O_SIGBLOCK, NULL, 0, 0 }, /* 109 = old freebsd32_sigblock */ - { compat(AS(ofreebsd32_sigsetmask_args),freebsd32_sigsetmask), AUE_O_SIGSETMASK, NULL, 0, 0 }, /* 110 = old freebsd32_sigsetmask */ - { compat(AS(ofreebsd32_sigsuspend_args),freebsd32_sigsuspend), AUE_SIGSUSPEND, NULL, 0, 0 }, /* 111 = old freebsd32_sigsuspend */ - { compat(AS(ofreebsd32_sigstack_args),freebsd32_sigstack), AUE_O_SIGSTACK, NULL, 0, 0 }, /* 112 = old freebsd32_sigstack */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 113 = obsolete orecvmsg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 114 = obsolete osendmsg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 115 = obsolete vtrace */ - { AS(freebsd32_gettimeofday_args), (sy_call_t *)freebsd32_gettimeofday, AUE_GETTIMEOFDAY, NULL, 0, 0 }, /* 116 = freebsd32_gettimeofday */ - { AS(freebsd32_getrusage_args), (sy_call_t *)freebsd32_getrusage, AUE_GETRUSAGE, NULL, 0, 0 }, /* 117 = freebsd32_getrusage */ - { AS(getsockopt_args), (sy_call_t *)getsockopt, AUE_GETSOCKOPT, NULL, 0, 0 }, /* 118 = getsockopt */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 119 = resuba */ - { AS(freebsd32_readv_args), (sy_call_t *)freebsd32_readv, AUE_READV, NULL, 0, 0 }, /* 120 = freebsd32_readv */ - { AS(freebsd32_writev_args), (sy_call_t *)freebsd32_writev, AUE_WRITEV, NULL, 0, 0 }, /* 121 = freebsd32_writev */ - { AS(freebsd32_settimeofday_args), (sy_call_t *)freebsd32_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0 }, /* 122 = freebsd32_settimeofday */ - { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0 }, /* 123 = fchown */ - { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0 }, /* 124 = fchmod */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 125 = obsolete orecvfrom */ - { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0 }, /* 126 = setreuid */ - { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0 }, /* 127 = setregid */ - { AS(rename_args), (sy_call_t *)rename, AUE_RENAME, NULL, 0, 0 }, /* 128 = rename */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 129 = obsolete otruncate */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 130 = obsolete ftruncate */ - { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0 }, /* 131 = flock */ - { AS(mkfifo_args), (sy_call_t *)mkfifo, AUE_MKFIFO, NULL, 0, 0 }, /* 132 = mkfifo */ - { AS(sendto_args), (sy_call_t *)sendto, AUE_SENDTO, NULL, 0, 0 }, /* 133 = sendto */ - { AS(shutdown_args), (sy_call_t *)shutdown, AUE_SHUTDOWN, NULL, 0, 0 }, /* 134 = shutdown */ - { AS(socketpair_args), (sy_call_t *)socketpair, AUE_SOCKETPAIR, NULL, 0, 0 }, /* 135 = socketpair */ - { AS(mkdir_args), (sy_call_t *)mkdir, AUE_MKDIR, NULL, 0, 0 }, /* 136 = mkdir */ - { AS(rmdir_args), (sy_call_t *)rmdir, AUE_RMDIR, NULL, 0, 0 }, /* 137 = rmdir */ - { AS(freebsd32_utimes_args), (sy_call_t *)freebsd32_utimes, AUE_UTIMES, NULL, 0, 0 }, /* 138 = freebsd32_utimes */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 139 = obsolete 4.2 sigreturn */ - { AS(freebsd32_adjtime_args), (sy_call_t *)freebsd32_adjtime, AUE_ADJTIME, NULL, 0, 0 }, /* 140 = freebsd32_adjtime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 141 = obsolete ogetpeername */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 142 = obsolete ogethostid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 143 = obsolete sethostid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 144 = obsolete getrlimit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 145 = obsolete setrlimit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 146 = obsolete killpg */ - { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0 }, /* 147 = setsid */ - { AS(quotactl_args), (sy_call_t *)quotactl, AUE_QUOTACTL, NULL, 0, 0 }, /* 148 = quotactl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 149 = obsolete oquota */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 150 = obsolete ogetsockname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 151 = sem_lock */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 152 = sem_wakeup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 153 = asyncdaemon */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 154 = nlm_syscall */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 155 = nfssvc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 156 = obsolete ogetdirentries */ - { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0 }, /* 157 = old freebsd32_statfs */ - { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0 }, /* 158 = old freebsd32_fstatfs */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 159 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 160 = lgetfh */ - { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0 }, /* 161 = getfh */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 162 = obsolete getdomainname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 163 = obsolete setdomainname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 164 = obsolete uname */ - { AS(freebsd32_sysarch_args), (sy_call_t *)freebsd32_sysarch, AUE_SYSARCH, NULL, 0, 0 }, /* 165 = freebsd32_sysarch */ - { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0 }, /* 166 = rtprio */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 167 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 168 = nosys */ - { AS(freebsd32_semsys_args), (sy_call_t *)freebsd32_semsys, AUE_SEMSYS, NULL, 0, 0 }, /* 169 = freebsd32_semsys */ - { AS(freebsd32_msgsys_args), (sy_call_t *)freebsd32_msgsys, AUE_MSGSYS, NULL, 0, 0 }, /* 170 = freebsd32_msgsys */ - { AS(freebsd32_shmsys_args), (sy_call_t *)freebsd32_shmsys, AUE_SHMSYS, NULL, 0, 0 }, /* 171 = freebsd32_shmsys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 172 = nosys */ - { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0 }, /* 173 = old freebsd32_pread */ - { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0 }, /* 174 = old freebsd32_pwrite */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 175 = nosys */ - { AS(ntp_adjtime_args), (sy_call_t *)ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0 }, /* 176 = ntp_adjtime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 177 = sfork */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 178 = getdescriptor */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 179 = setdescriptor */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 180 = nosys */ - { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0 }, /* 181 = setgid */ - { AS(setegid_args), (sy_call_t *)setegid, AUE_SETEGID, NULL, 0, 0 }, /* 182 = setegid */ - { AS(seteuid_args), (sy_call_t *)seteuid, AUE_SETEUID, NULL, 0, 0 }, /* 183 = seteuid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 184 = lfs_bmapv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 185 = lfs_markv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 186 = lfs_segclean */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 187 = lfs_segwait */ - { AS(freebsd32_stat_args), (sy_call_t *)freebsd32_stat, AUE_STAT, NULL, 0, 0 }, /* 188 = freebsd32_stat */ - { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0 }, /* 189 = freebsd32_fstat */ - { AS(freebsd32_lstat_args), (sy_call_t *)freebsd32_lstat, AUE_LSTAT, NULL, 0, 0 }, /* 190 = freebsd32_lstat */ - { AS(pathconf_args), (sy_call_t *)pathconf, AUE_PATHCONF, NULL, 0, 0 }, /* 191 = pathconf */ - { AS(fpathconf_args), (sy_call_t *)fpathconf, AUE_FPATHCONF, NULL, 0, 0 }, /* 192 = fpathconf */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 193 = nosys */ - { AS(__getrlimit_args), (sy_call_t *)getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 194 = getrlimit */ - { AS(__setrlimit_args), (sy_call_t *)setrlimit, AUE_SETRLIMIT, NULL, 0, 0 }, /* 195 = setrlimit */ - { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 196 = freebsd32_getdirentries */ - { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0 }, /* 197 = old freebsd32_mmap */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 198 = __syscall */ - { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0 }, /* 199 = old freebsd32_lseek */ - { compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0 }, /* 200 = old freebsd32_truncate */ - { compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0 }, /* 201 = old freebsd32_ftruncate */ - { AS(freebsd32_sysctl_args), (sy_call_t *)freebsd32_sysctl, AUE_SYSCTL, NULL, 0, 0 }, /* 202 = freebsd32_sysctl */ - { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0 }, /* 203 = mlock */ - { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0 }, /* 204 = munlock */ - { AS(undelete_args), (sy_call_t *)undelete, AUE_UNDELETE, NULL, 0, 0 }, /* 205 = undelete */ - { AS(freebsd32_futimes_args), (sy_call_t *)freebsd32_futimes, AUE_FUTIMES, NULL, 0, 0 }, /* 206 = freebsd32_futimes */ - { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0 }, /* 207 = getpgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 208 = newreboot */ - { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0 }, /* 209 = poll */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 210 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 211 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 212 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 213 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 214 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 215 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 216 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 217 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 218 = lkmnosys */ - { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 219 = lkmnosys */ - { AS(freebsd32_semctl_args), (sy_call_t *)freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 220 = freebsd32_semctl */ - { AS(semget_args), (sy_call_t *)semget, AUE_SEMGET, NULL, 0, 0 }, /* 221 = semget */ - { AS(semop_args), (sy_call_t *)semop, AUE_SEMOP, NULL, 0, 0 }, /* 222 = semop */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 223 = semconfig */ - { AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0 }, /* 224 = freebsd32_msgctl */ - { AS(msgget_args), (sy_call_t *)msgget, AUE_MSGGET, NULL, 0, 0 }, /* 225 = msgget */ - { AS(freebsd32_msgsnd_args), (sy_call_t *)freebsd32_msgsnd, AUE_MSGSND, NULL, 0, 0 }, /* 226 = freebsd32_msgsnd */ - { AS(freebsd32_msgrcv_args), (sy_call_t *)freebsd32_msgrcv, AUE_MSGRCV, NULL, 0, 0 }, /* 227 = freebsd32_msgrcv */ - { AS(shmat_args), (sy_call_t *)shmat, AUE_SHMAT, NULL, 0, 0 }, /* 228 = shmat */ - { AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0 }, /* 229 = freebsd32_shmctl */ - { AS(shmdt_args), (sy_call_t *)shmdt, AUE_SHMDT, NULL, 0, 0 }, /* 230 = shmdt */ - { AS(shmget_args), (sy_call_t *)shmget, AUE_SHMGET, NULL, 0, 0 }, /* 231 = shmget */ - { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 232 = freebsd32_clock_gettime */ - { AS(freebsd32_clock_settime_args), (sy_call_t *)freebsd32_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0 }, /* 233 = freebsd32_clock_settime */ - { AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0 }, /* 234 = freebsd32_clock_getres */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 235 = timer_create */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 236 = timer_delete */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 237 = timer_settime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 238 = timer_gettime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 239 = timer_getoverrun */ - { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0 }, /* 240 = freebsd32_nanosleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 241 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 242 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 243 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 244 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 245 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 246 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 247 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 248 = ntp_gettime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 249 = nosys */ - { AS(minherit_args), (sy_call_t *)minherit, AUE_MINHERIT, NULL, 0, 0 }, /* 250 = minherit */ - { AS(rfork_args), (sy_call_t *)rfork, AUE_RFORK, NULL, 0, 0 }, /* 251 = rfork */ - { AS(openbsd_poll_args), (sy_call_t *)openbsd_poll, AUE_POLL, NULL, 0, 0 }, /* 252 = openbsd_poll */ - { 0, (sy_call_t *)issetugid, AUE_ISSETUGID, NULL, 0, 0 }, /* 253 = issetugid */ - { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 254 = lchown */ - { AS(freebsd32_aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 255 = freebsd32_aio_read */ - { AS(freebsd32_aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 256 = freebsd32_aio_write */ - { AS(freebsd32_lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 257 = freebsd32_lio_listio */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 258 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 259 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 260 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 261 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 262 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 263 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 264 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 265 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 266 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 267 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 268 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 269 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 270 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 271 = nosys */ - { AS(getdents_args), (sy_call_t *)getdents, AUE_O_GETDENTS, NULL, 0, 0 }, /* 272 = getdents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 273 = nosys */ - { AS(lchmod_args), (sy_call_t *)lchmod, AUE_LCHMOD, NULL, 0, 0 }, /* 274 = lchmod */ - { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 275 = netbsd_lchown */ - { AS(freebsd32_lutimes_args), (sy_call_t *)freebsd32_lutimes, AUE_LUTIMES, NULL, 0, 0 }, /* 276 = freebsd32_lutimes */ - { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0 }, /* 277 = netbsd_msync */ - { AS(nstat_args), (sy_call_t *)nstat, AUE_STAT, NULL, 0, 0 }, /* 278 = nstat */ - { AS(nfstat_args), (sy_call_t *)nfstat, AUE_FSTAT, NULL, 0, 0 }, /* 279 = nfstat */ - { AS(nlstat_args), (sy_call_t *)nlstat, AUE_LSTAT, NULL, 0, 0 }, /* 280 = nlstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 281 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 282 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 283 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 284 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 285 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 286 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 287 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 288 = nosys */ - { AS(freebsd32_preadv_args), (sy_call_t *)freebsd32_preadv, AUE_PREADV, NULL, 0, 0 }, /* 289 = freebsd32_preadv */ - { AS(freebsd32_pwritev_args), (sy_call_t *)freebsd32_pwritev, AUE_PWRITEV, NULL, 0, 0 }, /* 290 = freebsd32_pwritev */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 291 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 292 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 293 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 294 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 295 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 296 = nosys */ - { compat4(AS(freebsd4_freebsd32_fhstatfs_args),freebsd32_fhstatfs), AUE_FHSTATFS, NULL, 0, 0 }, /* 297 = old freebsd32_fhstatfs */ - { AS(fhopen_args), (sy_call_t *)fhopen, AUE_FHOPEN, NULL, 0, 0 }, /* 298 = fhopen */ - { AS(fhstat_args), (sy_call_t *)fhstat, AUE_FHSTAT, NULL, 0, 0 }, /* 299 = fhstat */ - { AS(modnext_args), (sy_call_t *)modnext, AUE_NULL, NULL, 0, 0 }, /* 300 = modnext */ - { AS(freebsd32_modstat_args), (sy_call_t *)freebsd32_modstat, AUE_NULL, NULL, 0, 0 }, /* 301 = freebsd32_modstat */ - { AS(modfnext_args), (sy_call_t *)modfnext, AUE_NULL, NULL, 0, 0 }, /* 302 = modfnext */ - { AS(modfind_args), (sy_call_t *)modfind, AUE_NULL, NULL, 0, 0 }, /* 303 = modfind */ - { AS(kldload_args), (sy_call_t *)kldload, AUE_MODLOAD, NULL, 0, 0 }, /* 304 = kldload */ - { AS(kldunload_args), (sy_call_t *)kldunload, AUE_MODUNLOAD, NULL, 0, 0 }, /* 305 = kldunload */ - { AS(kldfind_args), (sy_call_t *)kldfind, AUE_NULL, NULL, 0, 0 }, /* 306 = kldfind */ - { AS(kldnext_args), (sy_call_t *)kldnext, AUE_NULL, NULL, 0, 0 }, /* 307 = kldnext */ - { AS(kldstat_args), (sy_call_t *)kldstat, AUE_NULL, NULL, 0, 0 }, /* 308 = kldstat */ - { AS(kldfirstmod_args), (sy_call_t *)kldfirstmod, AUE_NULL, NULL, 0, 0 }, /* 309 = kldfirstmod */ - { AS(getsid_args), (sy_call_t *)getsid, AUE_GETSID, NULL, 0, 0 }, /* 310 = getsid */ - { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0 }, /* 311 = setresuid */ - { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0 }, /* 312 = setresgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 313 = obsolete signanosleep */ - { AS(freebsd32_aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 314 = freebsd32_aio_return */ - { AS(freebsd32_aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 315 = freebsd32_aio_suspend */ - { AS(freebsd32_aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 316 = freebsd32_aio_cancel */ - { AS(freebsd32_aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 317 = freebsd32_aio_error */ - { AS(freebsd32_oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 318 = freebsd32_oaio_read */ - { AS(freebsd32_oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 319 = freebsd32_oaio_write */ - { AS(freebsd32_olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 320 = freebsd32_olio_listio */ - { 0, (sy_call_t *)yield, AUE_NULL, NULL, 0, 0 }, /* 321 = yield */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 322 = obsolete thr_sleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 323 = obsolete thr_wakeup */ - { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0 }, /* 324 = mlockall */ - { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0 }, /* 325 = munlockall */ - { AS(__getcwd_args), (sy_call_t *)__getcwd, AUE_GETCWD, NULL, 0, 0 }, /* 326 = __getcwd */ - { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_NULL, NULL, 0, 0 }, /* 327 = sched_setparam */ - { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_NULL, NULL, 0, 0 }, /* 328 = sched_getparam */ - { AS(sched_setscheduler_args), (sy_call_t *)sched_setscheduler, AUE_NULL, NULL, 0, 0 }, /* 329 = sched_setscheduler */ - { AS(sched_getscheduler_args), (sy_call_t *)sched_getscheduler, AUE_NULL, NULL, 0, 0 }, /* 330 = sched_getscheduler */ - { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0 }, /* 331 = sched_yield */ - { AS(sched_get_priority_max_args), (sy_call_t *)sched_get_priority_max, AUE_NULL, NULL, 0, 0 }, /* 332 = sched_get_priority_max */ - { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0 }, /* 333 = sched_get_priority_min */ - { AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval, AUE_NULL, NULL, 0, 0 }, /* 334 = sched_rr_get_interval */ - { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0 }, /* 335 = utrace */ - { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0 }, /* 336 = old freebsd32_sendfile */ - { AS(kldsym_args), (sy_call_t *)kldsym, AUE_NULL, NULL, 0, 0 }, /* 337 = kldsym */ - { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0 }, /* 338 = freebsd32_jail */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 339 = pioctl */ - { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0 }, /* 340 = sigprocmask */ - { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0 }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0 }, /* 342 = old freebsd32_sigaction */ - { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0 }, /* 343 = sigpending */ - { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0 }, /* 344 = old freebsd32_sigreturn */ - { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0 }, /* 345 = freebsd32_sigtimedwait */ - { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0 }, /* 346 = freebsd32_sigwaitinfo */ - { AS(__acl_get_file_args), (sy_call_t *)__acl_get_file, AUE_NULL, NULL, 0, 0 }, /* 347 = __acl_get_file */ - { AS(__acl_set_file_args), (sy_call_t *)__acl_set_file, AUE_NULL, NULL, 0, 0 }, /* 348 = __acl_set_file */ - { AS(__acl_get_fd_args), (sy_call_t *)__acl_get_fd, AUE_NULL, NULL, 0, 0 }, /* 349 = __acl_get_fd */ - { AS(__acl_set_fd_args), (sy_call_t *)__acl_set_fd, AUE_NULL, NULL, 0, 0 }, /* 350 = __acl_set_fd */ - { AS(__acl_delete_file_args), (sy_call_t *)__acl_delete_file, AUE_NULL, NULL, 0, 0 }, /* 351 = __acl_delete_file */ - { AS(__acl_delete_fd_args), (sy_call_t *)__acl_delete_fd, AUE_NULL, NULL, 0, 0 }, /* 352 = __acl_delete_fd */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From imp at FreeBSD.org Mon Jun 1 16:22:02 2009 From: imp at FreeBSD.org (Warner Losh) Date: Mon Jun 1 16:22:17 2009 Subject: svn commit: r193236 - head/sys/dev/bwi Message-ID: <200906011622.n51GM1O4084183@svn.freebsd.org> Author: imp Date: Mon Jun 1 16:22:01 2009 New Revision: 193236 URL: http://svn.freebsd.org/changeset/base/193236 Log: Add a comment about what may be happening when we get certain messages. No change to actual code. Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:14:38 2009 (r193235) +++ head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:22:01 2009 (r193236) @@ -1628,6 +1628,23 @@ bwi_intr(void *xsc) /* Disable all interrupts */ bwi_disable_intrs(sc, BWI_ALL_INTRS); + /* + * http://bcm-specs.sipsolutions.net/Interrupts + * Says for this bit (0x800): + * "Fatal Error + * + * We got this one while testing things when by accident the + * template ram wasn't set to big endian when it should have + * been after writing the initial values. It keeps on being + * triggered, the only way to stop it seems to shut down the + * chip." + * + * Suggesting that we should never get it and if we do we're not + * feeding TX packets into the MAC correctly if we do... Apparently, + * it is valid only on mac version 5 and higher, but I couldn't + * find a reference for that... Since I see them from time to time + * on my card, this suggests an error in the tx path still... + */ if (intr_status & BWI_INTR_PHY_TXERR) { if (mac->mac_flags & BWI_MAC_F_PHYE_RESET) { if_printf(ifp, "%s: intr PHY TX error\n", __func__); From imp at FreeBSD.org Mon Jun 1 16:27:14 2009 From: imp at FreeBSD.org (Warner Losh) Date: Mon Jun 1 16:27:21 2009 Subject: svn commit: r193237 - head/sys/dev/bwi Message-ID: <200906011627.n51GRDD4084321@svn.freebsd.org> Author: imp Date: Mon Jun 1 16:27:13 2009 New Revision: 193237 URL: http://svn.freebsd.org/changeset/base/193237 Log: Make sure that we drain the LED blinking callout on detach. Submitted by: Paul B. Mahol Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:22:01 2009 (r193236) +++ head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:27:13 2009 (r193237) @@ -579,6 +579,7 @@ bwi_detach(struct bwi_softc *sc) int i; bwi_stop(sc, 1); + callout_drain(&sc->sc_led_blink_ch); callout_drain(&sc->sc_calib_ch); ieee80211_ifdetach(ic); From imp at FreeBSD.org Mon Jun 1 16:29:04 2009 From: imp at FreeBSD.org (Warner Losh) Date: Mon Jun 1 16:31:03 2009 Subject: svn commit: r193238 - head/sys/dev/bwi Message-ID: <200906011629.n51GT4ck084392@svn.freebsd.org> Author: imp Date: Mon Jun 1 16:29:03 2009 New Revision: 193238 URL: http://svn.freebsd.org/changeset/base/193238 Log: Move the unlock to after the ifdef (maybe the right fix is to remove the ifdef) since it calls bwi_start_locked, which expects to the lock to be held... Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:27:13 2009 (r193237) +++ head/sys/dev/bwi/if_bwi.c Mon Jun 1 16:29:03 2009 (r193238) @@ -4069,8 +4069,8 @@ bwi_restart(void *xsc, int pending) if_printf(ifp, "%s begin, help!\n", __func__); BWI_LOCK(sc); bwi_init_statechg(xsc, 0); - BWI_UNLOCK(sc); #if 0 bwi_start_locked(ifp); #endif + BWI_UNLOCK(sc); } From sam at FreeBSD.org Mon Jun 1 16:36:30 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Mon Jun 1 16:36:37 2009 Subject: svn commit: r193239 - head/sys/net80211 Message-ID: <200906011636.n51GaSAA084599@svn.freebsd.org> Author: sam Date: Mon Jun 1 16:36:28 2009 New Revision: 193239 URL: http://svn.freebsd.org/changeset/base/193239 Log: pad data structures to enable integration of future features w/o abi breakage Modified: head/sys/net80211/ieee80211_ht.h head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_scan.h head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_ht.h Mon Jun 1 16:36:28 2009 (r193239) @@ -58,6 +58,7 @@ struct ieee80211_tx_ampdu { int txa_nextrequest;/* soonest to make next request */ struct callout txa_timer; void *txa_private; /* driver-private storage */ + uint64_t txa_pad[4]; }; /* return non-zero if AMPDU tx for the TID is running */ @@ -141,6 +142,7 @@ struct ieee80211_rx_ampdu { int rxa_age; /* age of oldest frame in window */ int rxa_nframes; /* frames since ADDBA */ struct mbuf *rxa_m[IEEE80211_AGGR_BAWMAX]; + uint64_t rxa_pad[4]; }; void ieee80211_ht_attach(struct ieee80211com *); Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_ioctl.h Mon Jun 1 16:36:28 2009 (r193239) @@ -64,6 +64,7 @@ struct ieee80211_nodestats { uint32_t ns_tx_data; /* tx data frames */ uint32_t ns_tx_mgmt; /* tx management frames */ + uint32_t ns_tx_ctrl; /* tx control frames */ uint32_t ns_tx_ucast; /* tx unicast frames */ uint32_t ns_tx_mcast; /* tx multi/broadcast frames */ uint64_t ns_tx_bytes; /* tx data count (bytes) */ @@ -83,6 +84,7 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ + uint32_t ns_spare[8]; }; /* @@ -101,7 +103,7 @@ struct ieee80211_stats { uint32_t is_rx_wepfail; /* rx wep processing failed */ uint32_t is_rx_decap; /* rx decapsulation failed */ uint32_t is_rx_mgtdiscard; /* rx discard mgt frames */ - uint32_t is_rx_ctl; /* rx discard ctrl frames */ + uint32_t is_rx_ctl; /* rx ctrl frames */ uint32_t is_rx_beacon; /* rx beacon frames */ uint32_t is_rx_rstoobig; /* rx rate set truncated */ uint32_t is_rx_elem_missing; /* rx required element missing*/ @@ -218,7 +220,10 @@ struct ieee80211_stats { uint32_t is_beacon_miss; /* beacon miss notification */ uint32_t is_rx_badstate; /* rx discard state != RUN */ uint32_t is_ff_flush; /* ff's flush'd from stageq */ - uint32_t is_spare[11]; + uint32_t is_tx_ctl; /* tx ctrl frames */ + uint32_t is_ampdu_rexmt; /* A-MPDU frames rexmt ok */ + uint32_t is_ampdu_rexmt_fail; /* A-MPDU frames rexmt fail */ + uint32_t is_spare[16]; }; /* Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_node.h Mon Jun 1 16:36:28 2009 (r193239) @@ -81,6 +81,7 @@ struct ieee80211_ies { uint8_t *htcap_ie; /* captured HTCAP ie */ uint8_t *htinfo_ie; /* captured HTINFO ie */ uint8_t *tdma_ie; /* captured TDMA ie */ + uint8_t *spare[4]; /* NB: these must be the last members of this structure */ uint8_t *data; /* frame data > 802.11 header */ int len; /* data size in bytes */ @@ -192,6 +193,7 @@ struct ieee80211_node { struct ieee80211vap *ni_wdsvap; /* associated WDS vap */ /* XXX move to vap? */ struct ifqueue ni_wdsq; /* wds pending queue */ + uint64_t ni_spare[4]; }; MALLOC_DECLARE(M_80211_NODE); MALLOC_DECLARE(M_80211_NODE_IE); Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_proto.h Mon Jun 1 16:36:28 2009 (r193239) @@ -305,6 +305,7 @@ struct ieee80211_beacon_offsets { uint16_t bo_appie_len; /* AppIE length in bytes */ uint16_t bo_csa_trailer_len;; uint8_t *bo_csa; /* start of CSA element */ + uint8_t *bo_spare[4]; }; struct mbuf *ieee80211_beacon_alloc(struct ieee80211_node *, struct ieee80211_beacon_offsets *); Modified: head/sys/net80211/ieee80211_scan.h ============================================================================== --- head/sys/net80211/ieee80211_scan.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_scan.h Mon Jun 1 16:36:28 2009 (r193239) @@ -211,6 +211,7 @@ struct ieee80211_scanparams { uint8_t *htinfo; uint8_t *ath; uint8_t *tdma; + uint8_t *spare[4]; }; /* @@ -281,6 +282,10 @@ struct ieee80211_scanner { /* iterate over entries in the scan cache */ void (*scan_iterate)(struct ieee80211_scan_state *, ieee80211_scan_iter_func *, void *); + void (*scan_spare0)(void); + void (*scan_spare1)(void); + void (*scan_spare2)(void); + void (*scan_spare4)(void); }; void ieee80211_scanner_register(enum ieee80211_opmode, const struct ieee80211_scanner *); Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Jun 1 16:29:03 2009 (r193238) +++ head/sys/net80211/ieee80211_var.h Mon Jun 1 16:36:28 2009 (r193239) @@ -307,6 +307,7 @@ struct ieee80211com { int batimeout, int baseqctl); void (*ic_ampdu_rx_stop)(struct ieee80211_node *, struct ieee80211_rx_ampdu *); + uint64_t ic_spare[8]; }; struct ieee80211_aclator; @@ -456,6 +457,7 @@ struct ieee80211vap { /* 802.3 output method for raw frame xmit */ int (*iv_output)(struct ifnet *, struct mbuf *, struct sockaddr *, struct route *); + uint64_t iv_spare[8]; }; MALLOC_DECLARE(M_80211_VAP); From imp at bsdimp.com Mon Jun 1 16:46:57 2009 From: imp at bsdimp.com (M. Warner Losh) Date: Mon Jun 1 16:47:10 2009 Subject: svn commit: r193223 - head/bin/sh In-Reply-To: <200906011111.n51BBkZt077175@svn.freebsd.org> References: <200906011111.n51BBkZt077175@svn.freebsd.org> Message-ID: <20090601.104358.-345495454.imp@bsdimp.com> In message: <200906011111.n51BBkZt077175@svn.freebsd.org> "Ralf S. Engelschall" writes: : Author: rse : Date: Mon Jun 1 11:11:46 2009 : New Revision: 193223 : URL: http://svn.freebsd.org/changeset/base/193223 : : Log: : align coding style with style(9) to avoid misunderstandings : : Modified: : head/bin/sh/exec.c : : Modified: head/bin/sh/exec.c : ============================================================================== : --- head/bin/sh/exec.c Mon Jun 1 11:02:09 2009 (r193222) : +++ head/bin/sh/exec.c Mon Jun 1 11:11:46 2009 (r193223) : @@ -187,7 +187,8 @@ padvance(char **path, char *name) : if (*path == NULL) : return NULL; : start = *path; : - for (p = start ; *p && *p != ':' && *p != '%' ; p++); : + for (p = start; *p && *p != ':' && *p != '%'; p++) : + ; /* nothing */ C already has a way of saying this: for (p = start; *p && *p != ':' && *p != '%'; p++) contionue; Warner From imp at bsdimp.com Mon Jun 1 16:49:11 2009 From: imp at bsdimp.com (M. Warner Losh) Date: Mon Jun 1 16:49:23 2009 Subject: svn commit: r193159 - head/sys/powerpc/powermac In-Reply-To: <200906010822.19951.jhb@freebsd.org> References: <200905311002.n4VA2K6c037776@svn.freebsd.org> <200906010822.19951.jhb@freebsd.org> Message-ID: <20090601.104601.1021575663.imp@bsdimp.com> In message: <200906010822.19951.jhb@freebsd.org> John Baldwin writes: : On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: : > Author: nwhitehorn : > Date: Sun May 31 10:02:20 2009 : > New Revision: 193159 : > URL: http://svn.freebsd.org/changeset/base/193159 : > : > Log: : > Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to : > determine whether the computer is plugged in to mains power. : : I wonder if it would be a good idea to introduce a : platform-independent 'acline' sysctl? Something like 'hw.acline'? For now : we could simply have these devices create it. We could do something fancier : where AC adapter drivers register with a centralized thingie at some point : and it exports a global setting that is true so long as at least one adapter : is online. I'm not sure that level of complexity is warranted until we have : platforms with multiple AC lines exposed to the OS though. We'll likely need some additional interface to the power system as well. acline is likely to be just the first one... Warner From avg at freebsd.org Mon Jun 1 17:11:05 2009 From: avg at freebsd.org (Andriy Gapon) Date: Mon Jun 1 17:11:14 2009 Subject: svn commit: r193223 - head/bin/sh In-Reply-To: <20090601.104358.-345495454.imp@bsdimp.com> References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> Message-ID: <4A24070A.8020508@freebsd.org> on 01/06/2009 19:43 M. Warner Losh said the following: > In message: <200906011111.n51BBkZt077175@svn.freebsd.org> > "Ralf S. Engelschall" writes: > : + for (p = start; *p && *p != ':' && *p != '%'; p++) > : + ; /* nothing */ > > C already has a way of saying this: > > for (p = start; *p && *p != ':' && *p != '%'; p++) > contionue; But style(9) is holy, must never been changed or deviated from. Sorry about that :-) P.S. the typo doesn't deserve any mentioning but just in case :-) -- Andriy Gapon From dougb at FreeBSD.org Mon Jun 1 17:19:03 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 17:19:15 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <20090601063455.R12292@maildrop.int.zabbadoz.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <20090601063455.R12292@maildrop.int.zabbadoz.net> Message-ID: <4A240D79.1080905@FreeBSD.org> Bjoern A. Zeeb wrote: > On Mon, 1 Jun 2009, Doug Barton wrote: > >> Author: dougb >> Date: Mon Jun 1 05:37:13 2009 >> New Revision: 193199 >> URL: http://svn.freebsd.org/changeset/base/193199 >> >> Log: >> Eliminate the warning that "Values of network_interfaces other than >> AUTO are deprecated.' There is no good reason to deprecate them, and >> setting this to different values can be useful for custom solutions >> and/or one-off configuration problems. > > There used to be adisucssion about this last year. > > I think you would have wanted to talk to brooks before who had put > this in: > > http://lists.freebsd.org/pipermail/cvs-all/2008-July/thread.html#263409 The discussion has come up several times on the -rc list from various users who like the functionality and didn't want to see it go away. I'm aware of the argument brooks has put forth in the past that it adds "needless complexity" however I actually use the existing feature, as do other users. FWIW, I also sent an "I am going to remove this if I don't hear an objection" message to the -rc list, although given the impending freeze I didn't wait as long as I usually would have. Leaving the code "as is" costs us nothing in the common case since the default is AUTO and the code to generate the list of interfaces is super-trivial. Removing the existing feature however would be problematic for at least a vocal subset of our user base. hth, Doug From jhb at freebsd.org Mon Jun 1 17:25:30 2009 From: jhb at freebsd.org (John Baldwin) Date: Mon Jun 1 17:25:41 2009 Subject: svn commit: r193159 - head/sys/powerpc/powermac In-Reply-To: <4A23FB40.1050405@freebsd.org> References: <200905311002.n4VA2K6c037776@svn.freebsd.org> <200906010822.19951.jhb@freebsd.org> <4A23FB40.1050405@freebsd.org> Message-ID: <200906011323.15189.jhb@freebsd.org> On Monday 01 June 2009 12:01:04 pm Nathan Whitehorn wrote: > John Baldwin wrote: > > On Sunday 31 May 2009 6:02:20 am Nathan Whitehorn wrote: > > > >> Author: nwhitehorn > >> Date: Sun May 31 10:02:20 2009 > >> New Revision: 193159 > >> URL: http://svn.freebsd.org/changeset/base/193159 > >> > >> Log: > >> Provide an analogous sysctl to hw.acpi.acline (dev.pmu.0.acline) to > >> determine whether the computer is plugged in to mains power. > >> > > > > I wonder if it would be a good idea to introduce a > > platform-independent 'acline' sysctl? Something like 'hw.acline'? For now > > we could simply have these devices create it. We could do something fancier > > where AC adapter drivers register with a centralized thingie at some point > > and it exports a global setting that is true so long as at least one adapter > > is online. I'm not sure that level of complexity is warranted until we have > > platforms with multiple AC lines exposed to the OS though. > > > That would be nice, and easy to implement, though the existing one > should be kept for a while for compatibility. In the longer term, pmu(4) > also provides an ACPI-alike interface to battery status under dev.pmu.*, > which it would likewise be good to report in a platform-independent way. Yes, the existing names would have to stay around for a while for compatability. -- John Baldwin From dougb at FreeBSD.org Mon Jun 1 17:38:47 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 17:38:59 2009 Subject: svn commit: r193198 - head/etc/rc.d In-Reply-To: <20090601062701.C12292@maildrop.int.zabbadoz.net> References: <200906010535.n515Z4qK065272@svn.freebsd.org> <20090601062701.C12292@maildrop.int.zabbadoz.net> Message-ID: <4A241221.6090707@FreeBSD.org> Bjoern A. Zeeb wrote: > On Mon, 1 Jun 2009, Doug Barton wrote: > >> Author: dougb Date: Mon Jun 1 05:35:03 2009 New Revision: 193198 >> URL: http://svn.freebsd.org/changeset/base/193198 >> >> Log: Make the pf and ipfw firewalls start before netif, just like >> ipfilter already does. This eliminates a logical inconsistency, >> and a small window where the system is open after the network >> comes up. > > Unfortunetaly this is contrary to a lot of PRs and requests on > mailing lists out there that actually want the netif/network_ipv6 > to be run _before_ things come up. Can you provide links to some of those PRs? I'd love to learn more about this issue. > Espescially pf really needs this to avoid rules that needs to do > per paket lookups of the interface address. Not sure what you mean here. > Further ipfw has a default option being setaable at compile time > and as TUNABLE to handle this window. And what happens if someone sets the default to accept? You could argue that they are knowingly opening a window of vulnerability but I would argue that the right thing to do is to have the firewall rules loaded before the network comes up regardless of the default. That way you avoid both the potential window of vulnerability AND the window of time between the network being loaded and the firewall allowing access to the box. To give a little more history, this patch was discussed and reviewed a while back and someone told me that they would incorporate it into some overall work they were doing to improve the way that rc.d handles networking, so I stopped paying attention to it. Last night a user pointed out to me that another patch that this same person said they would handle never got in, so I reviewed other outstanding work and found that this one had not been done either. Obviously if this change breaks something it will have to be reverted. However from the security standpoint (primary concern) it would seem to be the right thing to do, and the previous rcorder was not logically consistent in any case. Max Laier wrote: > Can you please add a note about this in UPDATING? Yes. I was on the fence about this anyways, so now you've pushed me over. :) > It might be a slight POLA violation for people who rely on the > interfaces being configured to setup the firewall. For instance > when one doesn't use dynamic address rules in pf i.e. "from/to ifX" > instead of "from/to (ifX)". I don't understand what you've written here. It seems to me that if the interfaces are always the same then the firewall rules will be fine, but if they are using dynamic rules it doesn't matter if it starts before or after the network is up. Doug From julian at elischer.org Mon Jun 1 17:42:06 2009 From: julian at elischer.org (Julian Elischer) Date: Mon Jun 1 17:42:17 2009 Subject: svn commit: r193232 - in head: . sys/net sys/netinet sys/netinet6 sys/nfsclient sys/sys usr.bin/netstat In-Reply-To: <20090601155120.D12292@maildrop.int.zabbadoz.net> References: <200906011549.n51FngRA083299@svn.freebsd.org> <20090601155120.D12292@maildrop.int.zabbadoz.net> Message-ID: <4A2412EC.6020009@elischer.org> Bjoern A. Zeeb wrote: > On Mon, 1 Jun 2009, Bjoern A. Zeeb wrote: > >> Author: bz >> Date: Mon Jun 1 15:49:42 2009 >> New Revision: 193232 >> URL: http://svn.freebsd.org/changeset/base/193232 >> >> Log: >> Convert the two dimensional array to be malloced and introduce >> an accessor function to get the correct rnh pointer back. >> >> Update netstat to get the correct pointer using kvm_read() >> as well. >> >> This not only fixes the ABI problem depending on the kernel >> option but also permits the tunable to overwrite the kernel >> option at boot time up to MAXFIBS, enlarging the number of >> FIBs without having to recompile. So people could just use >> GENERIC now. >> >> Reviewed by: julian, rwatson, zec >> X-MFC: not possible > > The solution is not ideal but will help FreeBSD 8.x. The previous code was needed for 7.0 and 6.0 compatibility. 8 can break that ABI so this is an excellent step in the right direction. we could look at making multiple fibs not need any compile option but always be enabled and control it purely through NUMFIB -> 1 > > Julian has suggested a cleaner way but I considered that to be to > late and intrusive for 8.x; this way we will have enough time for > 9.x to convert this to per AF/domain handler routines. > > > Note: I will garbage collect a lot of opt_route.h dependencies by the > end of the week as that option no longer has to be visible to most of > the tree. > > > PS: I cannot spell 'routing' correctly usually so whoever touches > UPDATING next please fix the spelling;-) > From bzeeb-lists at lists.zabbadoz.net Mon Jun 1 17:50:08 2009 From: bzeeb-lists at lists.zabbadoz.net (Bjoern A. Zeeb) Date: Mon Jun 1 17:50:20 2009 Subject: svn commit: r193198 - head/etc/rc.d In-Reply-To: <4A241221.6090707@FreeBSD.org> References: <200906010535.n515Z4qK065272@svn.freebsd.org> <20090601062701.C12292@maildrop.int.zabbadoz.net> <4A241221.6090707@FreeBSD.org> Message-ID: <20090601174604.J12292@maildrop.int.zabbadoz.net> On Mon, 1 Jun 2009, Doug Barton wrote: > Bjoern A. Zeeb wrote: >> On Mon, 1 Jun 2009, Doug Barton wrote: >> >>> Author: dougb Date: Mon Jun 1 05:35:03 2009 New Revision: 193198 >>> URL: http://svn.freebsd.org/changeset/base/193198 >>> >>> Log: Make the pf and ipfw firewalls start before netif, just like >>> ipfilter already does. This eliminates a logical inconsistency, >>> and a small window where the system is open after the network >>> comes up. >> >> Unfortunetaly this is contrary to a lot of PRs and requests on >> mailing lists out there that actually want the netif/network_ipv6 >> to be run _before_ things come up. > > Can you provide links to some of those PRs? I'd love to learn more > about this issue. PR 130381 has one report and I had added another link to a freebsd-rc post at one point. -- Bjoern A. Zeeb The greatest risk is not taking one. From des at des.no Mon Jun 1 17:52:26 2009 From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Mon Jun 1 17:52:37 2009 Subject: svn commit: r193223 - head/bin/sh In-Reply-To: <20090601.104358.-345495454.imp@bsdimp.com> (M. Warner Losh's message of "Mon, 01 Jun 2009 10:43:58 -0600 (MDT)") References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> Message-ID: <86vdnfq1t3.fsf@ds4.des.no> "M. Warner Losh" writes: > : @@ -187,7 +187,8 @@ padvance(char **path, char *name) > : if (*path == NULL) > : return NULL; > : start = *path; > : - for (p = start ; *p && *p != ':' && *p != '%' ; p++); > : + for (p = start; *p && *p != ':' && *p != '%'; p++) > : + ; /* nothing */ > > C already has a way of saying this: > > for (p = start; *p && *p != ':' && *p != '%'; p++) > contionue; It's a matter of taste. There is plenty of precedent for /* nothing */ ; and some for ; /* nothing */ (for varying spellings of "nothing") in the tree. DES -- Dag-Erling Sm?rgrav - des@des.no From julian at elischer.org Mon Jun 1 18:06:59 2009 From: julian at elischer.org (Julian Elischer) Date: Mon Jun 1 18:07:09 2009 Subject: svn commit: r193223 - head/bin/sh In-Reply-To: <86vdnfq1t3.fsf@ds4.des.no> References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> <86vdnfq1t3.fsf@ds4.des.no> Message-ID: <4A2418C1.5020406@elischer.org> Dag-Erling Sm?rgrav wrote: > "M. Warner Losh" writes: >> : @@ -187,7 +187,8 @@ padvance(char **path, char *name) >> : if (*path == NULL) >> : return NULL; >> : start = *path; >> : - for (p = start ; *p && *p != ':' && *p != '%' ; p++); >> : + for (p = start; *p && *p != ':' && *p != '%'; p++) >> : + ; /* nothing */ >> >> C already has a way of saying this: >> >> for (p = start; *p && *p != ':' && *p != '%'; p++) >> contionue; > > It's a matter of taste. There is plenty of precedent for > > /* nothing */ ; > > and some for > > ; /* nothing */ > > (for varying spellings of "nothing") in the tree. > > DES and just for bikeshed's sake, In non BSD code I prefer for (p = start; *p && *p != ':' && *p != '%'; p++) { /* Nothing */ } for (p = start; *p && *p != ':' && *p != '%'; p++) { /* Nothing extra */ } From sam at FreeBSD.org Mon Jun 1 18:07:03 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Mon Jun 1 18:07:29 2009 Subject: svn commit: r193240 - in head/sys: conf contrib/dev/mwl dev/mwl modules modules/mwl modules/mwlfw Message-ID: <200906011807.n51I71jV086754@svn.freebsd.org> Author: sam Date: Mon Jun 1 18:07:01 2009 New Revision: 193240 URL: http://svn.freebsd.org/changeset/base/193240 Log: driver for Marvell 88W8363 Wireless LAN controller Added: head/sys/contrib/dev/mwl/ head/sys/contrib/dev/mwl/LICENSE head/sys/contrib/dev/mwl/Makefile (contents, props changed) head/sys/contrib/dev/mwl/mw88W8363.fw.uu head/sys/contrib/dev/mwl/mwlboot.fw.uu head/sys/dev/mwl/ head/sys/dev/mwl/if_mwl.c (contents, props changed) head/sys/dev/mwl/if_mwl_pci.c (contents, props changed) head/sys/dev/mwl/if_mwlioctl.h (contents, props changed) head/sys/dev/mwl/if_mwlvar.h (contents, props changed) head/sys/dev/mwl/mwldiag.h (contents, props changed) head/sys/dev/mwl/mwlhal.c (contents, props changed) head/sys/dev/mwl/mwlhal.h (contents, props changed) head/sys/dev/mwl/mwlreg.h (contents, props changed) head/sys/modules/mwl/ head/sys/modules/mwl/Makefile (contents, props changed) head/sys/modules/mwlfw/ head/sys/modules/mwlfw/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 1 16:36:28 2009 (r193239) +++ head/sys/conf/files Mon Jun 1 18:07:01 2009 (r193240) @@ -1162,6 +1162,33 @@ dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt dev/msk/if_msk.c optional msk +dev/mwl/if_mwl.c optional mwl +dev/mwl/if_mwl_pci.c optional mwl pci +dev/mwl/mwlhal.c optional mwl +mwlfw.c optional mwlfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk mw88W8363.fw:mw88W8363fw mwlboot.fw:mwlboot -mmwl -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "mwlfw.c" +mw88W8363.fwo optional mwlfw \ + dependency "mw88W8363.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \ + no-implicit-rule \ + clean "mw88W8363.fwo" +mw88W8363.fw optional mwlfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu" \ + no-obj no-implicit-rule \ + clean "mw88W8363.fw" +mwlboot.fwo optional mwlfw \ + dependency "mwlboot.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \ + no-implicit-rule \ + clean "mwlboot.fwo" +mwlboot.fw optional mwlfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \ + no-obj no-implicit-rule \ + clean "mwlboot.fw" dev/mxge/if_mxge.c optional mxge pci dev/mxge/mxge_lro.c optional mxge pci dev/mxge/mxge_eth_z8e.c optional mxge pci Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jun 1 16:36:28 2009 (r193239) +++ head/sys/conf/options Mon Jun 1 18:07:01 2009 (r193240) @@ -777,6 +777,14 @@ MALO_DEBUG opt_malo.h MALO_TXBUF opt_malo.h MALO_RXBUF opt_malo.h +# options for the Marvell wireless driver +MWL_DEBUG opt_mwl.h +MWL_TXBUF opt_mwl.h +MWL_RXBUF opt_mwl.h +MWL_DIAGAPI opt_mwl.h +MWL_AGGR_SIZE opt_mwl.h +MWL_TX_NODROP opt_mwl.h + # dcons options DCONS_BUF_SIZE opt_dcons.h DCONS_POLL_HZ opt_dcons.h Added: head/sys/contrib/dev/mwl/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/mwl/LICENSE Mon Jun 1 18:07:01 2009 (r193240) @@ -0,0 +1,43 @@ +FIRMWARE LICENSE TERMS + + +Copyright (c) Marvell International Ltd. + +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the +following disclaimer in the documentation and/or other materials +provided with the distribution. + +* Neither the name of Marvell International Ltd. nor the names of its +suppliers may be used to endorse or promote products derived from this +software without specific prior written permission. + +* No reverse engineering, decompilation, or disassembly of this software +is permitted. + +Limited patent license. Marvell International Ltd. grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and sell +("Utilize") this software, but solely to the extent that any such patent +is necessary to Utilize the software alone, or in combination with an +operating system licensed under an approved Open Source license as +listed by the Open Source Initiative at http://opensource.org/licenses. +The patent license shall not apply to any other combinations which +include this software. No hardware per se is licensed hereunder. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 +COPYRIGHT OWNER 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 LIPOSSIBILITY OF SUCH DAMAGE. + + Added: head/sys/contrib/dev/mwl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/mwl/Makefile Mon Jun 1 18:07:01 2009 (r193240) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +FILES= mw88W8363.fw.uu mwlboot.fw.uu + +mw88W8363.fw.uu: mv88W8363fw.h LICENSE + (cat mv88W8363fw.h; \ + echo 'int main(void) { \ + write(1, fmimage, sizeof(fmimage)); return 0; \ + }') | ${CC} -o build -x c - + (sed 's/^/# /' LICENSE; ./build | uuencode mw88W8363.fw) > ${.TARGET} + +mwlboot.fw.uu: mvbootfw.h LICENSE + (cat mvbootfw.h; \ + echo 'int main(void) { \ + write(1, hlpimage, sizeof(hlpimage)); return 0; \ + }') | ${CC} -o build -x c - + (sed 's/^/# /' LICENSE; ./build | uuencode mwlboot.fw) > ${.TARGET} + +clean: + rm -f build build.c ${FILES} + +.include Added: head/sys/contrib/dev/mwl/mw88W8363.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/mwl/mw88W8363.fw.uu Mon Jun 1 18:07:01 2009 (r193240) @@ -0,0 +1,2179 @@ +# FIRMWARE LICENSE TERMS +# +# +# Copyright (c) Marvell International Ltd. +# +# All rights reserved. +# +# Redistribution. Redistribution and use in binary form, without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions must reproduce the above copyright notice and the +# following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# * Neither the name of Marvell International Ltd. nor the names of its +# suppliers may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# * No reverse engineering, decompilation, or disassembly of this software +# is permitted. +# +# Limited patent license. Marvell International Ltd. grants a world-wide, +# royalty-free, non-exclusive license under patents it now or hereafter +# owns or controls to make, have made, use, import, offer to sell and sell +# ("Utilize") this software, but solely to the extent that any such patent +# is necessary to Utilize the software alone, or in combination with an +# operating system licensed under an approved Open Source license as +# listed by the Open Source Initiative at http://opensource.org/licenses. +# The patent license shall not apply to any other combinations which +# include this software. No hardware per se is licensed hereunder. +# +# DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 +# COPYRIGHT OWNER 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 LIPOSSIBILITY OF SUCH DAMAGE. +# +# +begin 644 mw88W8363.fw +M`0```````````@``!$>Z"!CPG^48\)_E&/"?Y1CPG^48\)_E&/"?Y1CPG^48 +M\)_E8#4!`#PU`0!`-0$`1#4!`$@U`0!,-0$`4#4!`%PU`0#$@(_B`P"8Z`@` +M@.`($('@`;!`X@$`4.$3```*<`"PZ`4`5.'Z__\*`0`4XPM`A!`!`!7C"U"% +M$`(`%>,)4(40`U#%XQ!@5N*,$+0HC!"E*/O__XJ&;K#A#`"T*`P`I2@$<)1$ +M!'"%1.G__^H(()CE##"8Y0@@@N`(,(/@`+!"*0H_/__BH5> +ML.%!`*0H!'"$1/#__^H`0P$`/$,!`#Q#`0!D0P$`@+0/(``#@+P`27!'`"`` +M!/=*`""1:``I!-`%*0/1]4@`:`#@]$@!,9%@<$<0M1/P._L,(`;P"_SM3&!A +M$"`&\`;\(&%,(`;P`OP0,`;P__L``@`.`0<)#P`&``\A<>!P`"`0O8"U"?"Q +M^P`@@+WXM=]-_R$E,2`U*!P2\*/]+AQ`-@$D-',*(%,A2%4I''(Q,!SA,!+P +M[OX(('"#!R"P@P8@\(,H'&`P""$!@`HA08`,(8&`#B'!@!`A`8$2(4&!%"&! +M@3&)@"`@(H%#0""!0S&!Z8PO'!`W(4,10X%#Z82N-\]K`0```/P!`````@`` +MP))E(RD<`"8B,08@_G,2\,/^`B$H'"`PN7.$@0XA#_R'Y +M,9!#B$-@,"P<,#0HAJ-X8'@&(1L"&$.(0SA#8".80X`AB$,#"F!PHW!P-2YP +M;G``(`PA@"6L2X(`(#/6&'-X,GC_)QL"&D-3"%L``B*30P0BDT,*')(&^3>[ +M0](-&D,R')X`3D;`AI#!B/;0Q-`&"(30Q\<8".?0Z]#=W`["K-P +M,WGW>`$P&P(?0S\)/P$"-SL*]W`S<00HR=.12`$F(#`!B`0G,4,Y0PL<_R'Y +M,8M#>#,#@`-YQG@;`AY#-@DV`0$VQG`S"@-Q@X@!)C-#.T.+0V@S@X`#>L9Y +M&P(>0S8)-@$"-L9Q,PH#<@.)`28S0SM#BT,#@0-[QGH;`AY#-@DV`08VQG(S +M"@-S@XE;"%L`NT.+0R@S@X$#><%XQGD;`AE#`WIN3QL"'D.)&0-[QGH;`AY# +MB1D/(UD:`WS&>PD'&P(>0S,)&P$)#QE#"PK!$IX +M@"4;`AI#JD-*X +M0V`C&$-H8R@<-3`%'!/PD_FP0P0AB$,((8A#N$,@(A!#*1P2\)[]_R"@<>!Q +M`B``(34]*A@P,@$P$"B16$>2P0S&6@/(A(%$4,98!I+(#O9 +M:O\B$@*10]EB,8L3*0?1&TEE(L`Y2F+%(HIB)R'!80`@P>=T)0#`PDT`P"T! +M````I0"`@J@"E+^H`@8`J`"`S!,"P-`3`L#4$P+`W!,"P-@3`L!T!```X!," +MP$#H`(#___\/-CX``"`@`(`44`+`_P$``#8(```(@`"0*)``D,"B`("`M1/P +M6?@3\%OX`""`O>1)@+6(:`$PB&#B2$%J`2%!8A/P5O@!(("]_[4)G@8H`=(2 +M*0+3F"`$L/"]VTV"`*Q8`"P!T)<@]N?73P0!8#_D&:Q0(6"O6`*P!!P&+!&8$)V61IQ&`M.8(`NP\+VZ2:8`&#F)60`I`="7 +M(/7G`"("(021!9*P3P(<`Y`X:;-)`)"4(&!#1!@"D@B:(!QA1@&5PM0$H +M!])Z380`%#4H61+PT/\`("A1L+T(M0$H"])T28``%#$(6&E&`"(2\,K_`"@! +MT0"8"+T`(/SG@[4!*`K2;$F``!0Q"%@!J0`B$O#!_P`H`-&,O0$@_.<`M0,< +M`2B)L!/2!*D%J`"0`9%A29@``ZH"DA0Q"%@(J0>J!JL2\+#_`"@"T0>8";`` +MO0`@^^=P1X"U@"`2\*S_@+V`M0`@$O"G_X"]<$=P1W!'@+6`(!+PG_^`O8"U +M$O";_X"]@+4%*`C2'"-,2EA#8#*`&`H<`"&RL.CN`0```.P)`````@``'G.Y +M#A+PEO^`O8"U!2@&TAPC1DE80V`Q0!@2\)/_@+V`M04H"-(<(T!)6$-@,4`8 +M`"')0Q+PCO^`O8"U!2@&TAPC.DE80V`Q0!@2\(O_@+V`M08H!M(U24`![#%` +M&``A$O"(_X"]@+4&*`;2+TI``>PR@!@`(A+PA?^`O1RU%!P&*`[2`"+20P"2 +M*$I``>PR@!@B'`&K$O!]_P`H`=$!F!R]`"#\YX"U!B@%TA])0`'L,4`8$O!V +M_X"]@+4&*`;2&DI``>PR@!@"(A+P6_^`O0"UA[`&*!'2`ZD`D1-)`JI``>PQ +M0!@!D@6J!JD$JQ+P8?\`*`+1!9@'L`"]`"#[YQ"U!!P$*`S2'"`,26!#0!@! +M(@`A$O`._PA*`""A`!`Z4%`0O00```0`D`"0G!<`!'L'``"\!``$+`$`!%@9 +M``2`M00H!](<(W5)6$-`&``AR4,2\/_^@+V`M00H#-)P2P$A@@`0.YE0'"-M +M25A#0!@`(25A#0!@2\-K^@+V`M<%H`AP`:))H$O`"_X"]\+4" +M*`'3F"#PO55-A``K60`K`="7(/"]+"-03D-#<#:;&4Y/*U$&`<@WN%'P&8%@ +MPF``(4%@2TD982E92&&"X3Q3`0```.@+`````@``ZIL'LP`@\+W^M0L<$1P" +M*!;21$P"`<@T%1EJ:(0``"I!3@[1`2("D@"3`9$P60`A`FE#:1+PT/X`*`'1 +M`2!H8/Z]-1P*'!D<,%D2\,W^*%D2\-+^].>PM0(H!M(R380`*%D2\-'^`"`H +M4;"]@+4"*`32+4F```A8$O"^_H"]@+4"*`32*$F```A8$O#%_H"]$+4$'!+P +MR/X@8!"]`","X`%P`3`!,Y-"^M-P1_BU($@`:`5H`"T@T!Y/`"0!(*!`*$`7 +MT!M)H``8,0A8A@"Y60`I#]`(:(IH*1P2\'7^`B@(T;A9PV@`*P30*AP!(0!H +M$O"B_@$T$BS@VPM,(#P#S`@\@4(+T`A)"#$(7!+PG/X`*`30(&@!,``&``X@ +M8``@^+T``%@9``0D```$FPL```````2<%P`$@+4+\.7__R$#(`_P9OWK200@ +M"&`&\(C]!/!<^X"]YTAPM8`P!&D`:^5-`"9I:Z%"!M'D28Q"`]!IBP$Q:8,! +MX&Z#;&.J:P$#$@,2"PD+D4(>T0$#'-"IBP$Q"00)#*F#"BD,V=5*0#(1:5)I +M$4,&T:Z#*&2H;`$PJ&3_]\'_:(L**`39;H/L8VAL`3!H9'"]KH.H8_/G<$`M0`H!=`!'``@__=`_@`@@+T!(("]PT@'(0%B'R)"8H%B +MPF*A>`!V`0```.0-`````@``\V/9PP%C0F.!8\)CODDD(`A@2&"(8,A@O$D! +M(`AP<$=P1X"U2W@*>!L"&D,!(]L#&D,*,MX&P(:0P7P +M_?R`O8"U2W@*>!L"&D,!(]L#&D,*`"*`'0 +M`R@%T04@#/!1^@0!L"&D,!(]L#&D,*@$K`M$!,``&``X!,A(&$@X'*O'3`20`(P$H=4I] +M3038`2@(T8A^`2@%T%1R*&L`*`#0*V,PO5-R*&L`*/K19B`H8S"]L+4,'!4< +M`2$(\.OZ`"@`T;"]1($%@;"]^+4/'`0<`"AQT"`=`)`2\`7\T")I27I#5A@` +M*!/0!"!<23!W"&H!,`AB`2@+T5Y(6TD`BT`Y#R@!T0P@`N`3*`'1!2!(8S4< +M'C4@'!+PYOLI'#DQ$?#X_P"8$O#?^RDBEY&P(80VMYP`?` +M#QL"&4-)"$D`"$,H<0,*:W'C>J%Z`B(;`AE#B0?)#Y!#20#]0"E3`0```.`/ +M`````@``!XMG?@%#*7$+"FMQXWJ@>B`B&P(80X`&P`^10T`!"$,H<0,*:W'C +M>J%Z0"(;`AE#20;)#XD!D$,(0RAQ`PH@'`@P:W$2\*#[:7BK>(`&P`\;`AE# +M("*10P#@3N!``0A#:'`#"JMP8'M!(0PB2%4@>ZAQXWJ@>G&,&P(80P`'@`^` +M`)%#"$-PA``'@`\!)0$H`M$;2AL"&$,`!X`/ +M`=$`(0#@`2$X'`OP3?P52`"+#R@:T1E(`GH"*@'0`RH4T0-[%DF0.0`K!M&* +M>P(J`=`#*@K117(#X(M[`2L%T4)R0'J(A-`"((X(1"!=%0`$`90'@(<`$@,+T! +M,E,`[%QC'/+1`"`PO?BU!1S?2E`U*'FC3X2%`0```-P1`````@``>9#`SFEY +M_R<6'!0<<#00-ODW`"DDT6E&__?<_P"K&'C722!P2W@*>!L"&D,"(YI#4@A2 +M``0CFD,*P`K`]&Z0X`&@`X&X`4C`R@`TP,6E&__>4_P"K&'A@?PM:E/!"8`(F`ED0#)&0QX2W@; +M`AQ#XP<5U+1#(PH,<$MP`R@&T4QXBW@;`AQ#K$,@-`3@3'B+>!L"'$.L0TQP +M(PJ+<`3@8P<"U`,H\M'JYP$R!"K9T_"]$+5+>`IX!'@;`AI#0WB2!](/&P(< +M0P(CG$-2`")#`G`3"D-PBWA*>$1X&P(:0X-XT@:2#QL"'$,8(YQ#T@`B0T)P +M$PJ#<(MX27@;`AE#20:)#V`CFD-)`1%#07`+"GY*@W"2:/\R83+3>8`B`2L! +MT1%#`."10T%P"PJ#1L"&$/`!S#4#_!4^B@<0###>H!Z`28;`AA#P`8`*`K:94F( +M:#(X"&!C2$`P!F!#\=N$`0```-@3`````@``C7A^1L"&$,P0Z!Q`PHH'"(PXW$2\+/YH7H`(P"1*1P0,8I[S'L!'"`<$/!! +M^OB]\+5.3K^P,1P@,0$@(9`^D8AYRWD;`AA#P`<$U$Q)"&A`(A!#"&`(\!S[ +M!!P(\"O[/ID%'(AYRWD;`AA#P`<)U"!X8W@;`AA#0`1`#!PH`=#_]YK_(7AC +M>#E*%AQ@-CV6%AP;`AE#H#8\EA8<2`0X2T`,$#:80EO06]P7'%`W.Y<7'"(W +M,#+_(Q`SF$(YDCJ78]!CW/\G`3<=*`'1`?!M^W3<&2@!T0'P0OM8W`,H`=$! +M\`'X!"@!T0'P0O@4*`'0`O#K^6!Y`2@!T0'PM?D"*`'1`?#+^0,H`=`!\`3Z +M`"$@'`@P"/`*^`8<(!RZ(0XP$?#'^P`N`=$!\,[YO""`7;@C%$D@UA#0!BP,(!X,1P.,>!S<(D@="`<(#`1\/W[`?#6^=+C#^$``.!+ +M`0#\)0#`4$T`P$A-`,`44`+``*8`@`P@`(`"`@``2,,!`+'C9N`:*`'1`?!4 +M^QLH`=$!\'O['"BFT2!Z8WH;`AA#`2@!T`+P,?F@>N-Z&P(80P#@$N`!*`'1 +M`?`4^0,H`=$!\`CY!2CMT?=)`2"):/\Q83&(<0`@`?`+^;A"<=`BW!XH`=%$ +M-U_<`0```-05`````@``E("@`P'P!OD@*`'1`?!5^%`H`-!WYP$@P`,(0R!P +M`PIC<``@H''@<2`<)AP(,!+PL?CF20`H8GELT`$@D$`*>!!#"'"WX_\C"S.8 +M0F/0`S.80G'0`3.80MS1`"`,\(OYVTD`(`A@VTD(:$`B$$,(8*CG_R,D,YA" +MAL"&$,` +M*`'0`O`5^F-Z +M&P(80P`HCV8&P(90X![$/`Y_[A)`2`( +M<3J8$O!'^#N9`"<)>@"1LGOV>Y#BU^,VX_\C*3.80@'1`?"8_R/AL"&$,!*)+1XWJ@>B$<&P(80P(&$@ZA +M2`PQ`G`"X-C@4^'CX`$P$?``^RKG_R,J,YA"`=$!\&#_FDN80MW18WH@>I!) +M&P*):!A##B#_,6$QB'(6YP+BA.*03Y)+4#>80@'1`?#Q^''OIA"F]$!(,`#"$,@<`,*8W`!X(SCP.,`(*!QX'$@'`@P$?"X_VU) +M#"+(<0+P9/AN2P<[F$(!T0'P$?DOW&I+%SN80I/0`C.80@'1`?"/^69+"#N8 +M0@#05N9>24`Y"&H!,!V0(!P(,!'PE?\8J]AV(!P,,!'PC_\8JYAV(!P0,!'P +MB?\8JQAW(!P`)A0P`.`AX":0`3`ED`'P8?CGXU)+!#N80@'1`?`S^@$SF$(! +MT0'P'_H",YA"SM%&24`Y"&H!X&#AU.,!,``F)QP(-Q^0`?!8^,WC1$L',\`: +M%"@$T@.C&Q@;6EL`GT0-Y@``90@Z`D`"R0[0#G0/I@BE#[-ZH7I@?1L"&4,.\.+X8'T<(UA#@1F@>N-ZQ#$;`AA#$?`%^R!Z8WH; +M`AA#0`<@U2%]8'T3X!10`L#$)@#``*4`@`"C`(#&30#`)#,`P+E(`L`!`@`` +M*1$``'!$`0`.\+[X8'T<(UA#@1G;DPP&`0```,P9`````@``IW$J!ZZ4D;`AA#"'`@>NA)8WH.'*(Q&P(80Y8V`"@XD5S1 +M)QP((!^0*#<"(!#P$_@*X#B8$?"H_C%H"@)1&A'P5_HX8`0_!#X?F`$X'Y!# +M'._1V$@!)P%H.4,!8`OP6/F`(1\@#O#9_M`A&R`.\-7^8"$G(`[PT?Y0(2@@ +M#O#-_B@A*R`.\,G^/IF(>H9)8WH.'`\<&P(80YHWGC8`*!'1,1PX'`WP\O\X'!'PZ?T! +M`@\:,!P1\.3].1P1\)7Y(1P,,6[E.1P`)S@<$?#O^3$<.!P1\.OY#?#-_UOE +M=$H0:`$A"02?"8S/`0```,@;`````@``4YFB7@A#$&`!(`[PE/AQ24AI,"*0 +M0TAA;4D@.4AJ!"*00TAB"_#N^69)`"_9[ +M`1PP'#L<#_!#_L#D74D!(`AQ.I@1\*/].Y\`(SEZ`)&R>_9[`1PP'`_P,OY8 +M2B`Z$&H!(0D$B$,08E1)!#$(:`0B$$,(8``@#O!4^%%)%#$(:#`B$$,(8`OP +MN?FA>N-Z/9@;`AE#@'L0\&7\C^1)2$%H20A)`$%@B>3^]Z'^!AQ@>?\C73-$ +M3UA#P!DP,!HB(1P(,1'P3_CC>*)X8'D;`AI#_R-=,UA#P!E0,!HZ(1PB,1'P +M0/A@>?\A)C$X2D%#B1@W2H``$5`(\&SX,!SQXS5(`&@`*!70+DD(:@$P`"8G +M'`@W'Y`*X*WB.!P1\#?]`1PP!@$B``X(\'_X`38?F(9"\M,@'`@P$?`I_8`' +M`=4!(`#@`"`D20DBB6B2`8D8B&/_]Y+X$.<@'`@P$?`7_3R9P.,720]J`3<` +M)@7@,`8`#B%Z"/#"^`$VOD+WT_SF('IC>AL"&$,!*(?1(!P+,`<<$?#\_,(' +M$4DFU0`@\',(<`])6B`(8`])9"`(8"'@E^(D,P#`4$T`P%3Q`0`@J`"`P*(` +M@$"F`(#H(P+`Z#X"P.@8`L!T)0#`%%`"P'\L`,!`10$`1$4!`$`'`M4]*@'' +M`0```,0=`````@``2F%\+@$@\',(<#@<$?#*_$`%P`X!*`S1`""P!!X&P(80XA#$'`#"E-P5N!@)P(H%=$!(+!S.9H$(5-X$'@;`AA#B$,0<`,* +M4W`YFI-X4'@;`AA#N$-0<`,*DW`]X#F:!"%3>!!X&P(80PA#$'`#"B`<##!3 +M<#>0$?"1_,`&/IF`#PAP-Y@1\(K\P`:`#P$H#-$YFI-X4'@;`AA#N$-0<`,* +MDW`"(+!S`"`.X`,H$=$YFI-X4'@;`AA#N$,@,%!P`PJ3<`,@L',!(.Q)B'0$ +MX`KB8>`^F0(@"'"@>CJ9$?!T^+![/)D()-X&P(80T`& +M@`\+\![].I@1\$O\.YF$1@EZ`",`D;)[\'MA1@_PVORP>__WXOG620$@B'%( +M:@`H`-`BY+!["O#.^![DT4@$8R`<"#`1\"W\STD!*!S1X&@1\#WX(!P,,!'P +M(_R`!P?5.9H0>%-X&P(80P(C&$,&X#F:$'A3>!L"&$,"(YA#.9H#"A!P4W`, +MY``HTM$('!'P"/PA'`PQ$?`:^,CD(!P*,`OP=O_#Y/[W+?T=D+5(Q&(@'`@P +M$?#U^[-/&#\!*''1/)C`>P`H%]"O2-PP$?#I^P$<`B`-\+?]JTCL,!'PX?L! +M'`(@#?#%_:=(Y#`1\-G[`1P"(`WPP_VB2,!J__<#H9R@`0```,`?`````@`` +MOHG"DPCYH$C`:C:0##`1\,O[GDD4.361`2AKT3D<`"`0\-C_-I@4,!'POON7 +M2<`'+#E+>`EXP`\;`AE#20A)``%#DD@/'"PX!W`["D-P-I@<,!'PJ?L`!@`. +M^0<3U!ZI__?&^(E)!"(L.4MX"'@;`AA#D$,"(YA#"'`#"DMP'.!SX3_A!.(8 +MJQAV.9H$(8]#$7A3>'U(&P(90TH'T@\L.)(`.D,"(YI#`.#/X(D'R0])`!%# +M`7`+"D-P=$C_(BPX0W@!>/DR&P(90Y%#&*L:?I(&T@T10P%P"PI#<`-YP7@/ +M(AL"&4,10\%P"PH#<369#B"`?F0@! +M-)#`&3.0%#`1\$?['YE;2HD`+#J/&'MX.7C`!QL"&4-)"$D`P`\(0SAP`PI[ +M<#*0,9`SF!PP$?`P^P`&,9D`#LD'"]0>J?_W3/@X>'MX!"$;`AA#B$,"(8A# +M$N`8JQAV,I@$(0A#.'`#"GMP.9H"(8A#$7A3>!L"&4.)!\D/20`(0SAP`PK_ +M(?DQ>W`8JXA#&7Z)!LD-"$,X<`,*>W`V2328R6I`&#"0&#`1\/;Z`"@-T3"8 +M(#`1\/#Z^7@[>0`'&P(90PD)"0$`#PA#!N#X>#MY&P(80P`)``$",/AP`PH[ +M<368$?#9^OEX.WD;`AE#"0=VFW*-`0```+PA`````@``ME8S3@D/0!@UF1#P +MY?X?F0$Q'D@?D<=J.!P0,!'PQOH?F8A"`-ERYS68$?"_^C69`3@0\-'^`2`- +M\+;]__?%^#$<`2`0\,C^L'O_]U/X&>`.20`H%M`"*!31(!S^]]W_"DG(:@PP +M$?"A^@$H`M$Y'``@`>`Y'`$@$/"N_C$<`"`0\*K^'9C^]\?[A>0D,P#`?$T` +MP"!Z8WH;`AA#`"@6T?E.!B(A'`HQ,&@0\&O],&@!:""1"ASU28IB@(@@JQB` +M()C(8F%Y\DK_(%!4Q.0!*`;1(AP*,@$A8'D.\,KXN^0"*//1(!P*,`8<"_#6 +M_3`<"_`&_K#D`2"00`IX@D,*<`AX"_#P_<'@8'G_(R8SX4Y80X`9&APA'`@Q +M$/`S_6-X('@!(1L"&$/)`PA#('`#"F-P`""@<>!Q/)C)",-Y@'G_(AL"&$,( +M0SR9`PJ(<!Q(!PF'`@P$?`1^@$H)-$\F`$GPWF`>3R9&P(80SA#B'$# +M"KY(RW$`:`OP\?I@>0@H!]+_(28QMTI!0XD8"/!S_0/@LTD(7`WPO/ZU20AH +M""(00PA@!"!*X``&#=5@>0@H!=(`(@`A!_`O_6!Y`>"H20A<#?"]_CS@#?#+ +M_@</`0```+@C`````@``0KZ-\P!H`"@0T0`O#M!@>0@H!=(`(@`A +M!_`8_6!Y`>"<20A<#?"F_@$O)-$\F0`@B''(<9U)"2*):)(!B1B(8_[W+/U@ +M>0@H`](`(@`A!_#]_`KP1?N620AH!"(00PA@D$D(:`@BD$,(8``@#?!K_`$@ +M$?#U^8](PWJ!>AL"&4/)",D``C$0(YE#@7(+"L-R#"(Q'`'P/OHA'(=."#$& +M(C`<$/!Q_&-X('@!(1L"&$/)`PA#('`#"F-P`""@<>!Q/)A)",-Y@'D;`AA# +M"$,\F0,*B'%R2,MQ`&@`*`K0,'AS>!L"&$,`*`318'G`&0%X`3$!<+`<$?!; +M^7-X,7AF>1L"&4,!X/+BH>("'#`<"/!%_`XB`?#]^:![_R@'T5M(!B(!:"`< +M#C`0\"[\$>!73@8B(1P.,3!H$/`F_#!H`6@@D0H<4DF*8H"((*L8@""8R&([ +MF0$G2'J@=0,*XW4["B=S(!P<,&-S!_`N^@KPD?P@P,* +M('5C=4U(&#$0\"C]/IG+>8AY&P(80SA#B'$#"LMQ`?"H^2`<)#`OD"Z0$?`! +M^0<<(!P@,!'P_/@B'"@R.1P'\!/Z+I@1\/3X/4D`)TAT(!P\,"V0%^"Y``@9 +M*#`KD"R1$?#F^#=*+)E04"N8$?#@^"J0+9@1\-SX*IE``0@8+)D#'DUE`0`` +M`+0E`````@``6T93@S%*`3=04"^8$?#2^+A"XM@@'#@P!QP1\,OX`0[-[&P(80Q_@S!,"P`"E`(!<+`#`Z#X"P.@8`L!T)0#``*,` +M@%A0`L`44`+`)*@`@)!-`,`82P+``1D$`R0S`,"(5`#`F%0`P!!#<',#"K-S +MF-Z\D_R2!L"&D,!*O%)&-`"*@O0!"INT`@J`-!3YPAX`BAITZ=R.PKC +MCN9&P(80P`&``[(<0KPY_E!YZ)ZXWH;`AI#ND(1T3N92'H!*.+9 +M/IG+>8AY&P(80Q`C&$.(<0,*RW';20`@"'`IYSZ?UTG[>;IY&P(:0Q`CFD.Z +M<1,*^W$`)P]P.YD)>@(I`=$'<`#@`7"@>N-Z.YD;`AA#``8`#@ARS$D)BQ0I +M#M`3*0S0`R@*T1^I`2`-\./_&*L8?P,H`M`[F0(@"'(ZF!'P`?@[F0EZ`)&R +M>_9[`1PP'#L<#_"0^+I)`2`)>`[P"/CGY@#@`N``>`(HD=(!,*!R`PKCF-Z&P*K3PB>`0```+`G`````@``KZ[M +M/AA#`2B*T:!ZXWH;`AA#"O"_^<;FJ$D`((EH_S%A,8AQ`2`%X*1)`""):/\Q +M83&(<F-Z&P(80P$H$-&@>N-Z&P(80P`&``X-\"O\.I@0\*__LWL" +M'``@\7L*\(+\('IC>AL"&$,"*`G1.I@0\*#_`AP@'+=[\7L0,`#P"/\ZF!#P +MEO\[F0`C"7H`D;)[]GL!'#`<#_`E^('F(!P(,,`A!AP0\!_Z`2$P'`;PF/X@ +M'$0P"_`[^P`F!B!P0P$92C$P'`WPP_T!-A`N]=MVX``A(!P(,`;P0_X&'"`< +MNB$.,!#P`/H`+FG0NR"`73$<6#&@!!X&P(80T`'P`\@ +M=#F:DWA0>!L"&$-`!H`/8'0]F,![@`?`#Z!T/9C`>\`'P`_@=`+P+?DA'"`Q +M2'!?2`!H"'$,(B`<%#!=20/@;")=22`<"#`0\!KZ,N`EF!#P*O_`!HYAP8'O8 +M<*![&''A?%@=`"D%T`,Q67`A'!0QXGP&X.%[`*L#,5EPXGLA'!`Q$/"M^0`F +M!>`P!@`.:48(\.?[`3:^0O?3%>,@>F-Z/9D;`AA#B',^Y"!Z8WHA'!L"&$,` +M*`318'D*,0CP]?LRY`$H\-%@>0HQ"/``_"OD_??+_P<<)AP0-B`<"#`0\)/^ +M`081L"&D,['/[W%?L!*!'0`28/X`$H$-%C?")\ +M(7H;`AI#8WH@'!L"&4,*,/[W%?H`*.W0!?#J^0C@`B@&T2`<"C`&\%W]!B@` +MT0$F`"$@'`HP!O#S_"$<+#$0\"[Z`"X`T0OE@>$@>O=)"':"X_5(0&H`*`/0 +M(1PH'/[WL?D@>F-Z`2;V!QL"&$,`*`K0(!P,,!#P_/WC>J%Z&P(90S%#"&#K +MY.-Z(1R@>@PQ&P(80S!#`&@0\`'ZX.3B2$!J`"@#T"$<*!S^]XOYH'OC>QL" +M&$-E0?''`0```*@K`````@``G%]1W@`H$M`!*"[0`B@)T2`<"#`0\-3]`1P@ +M'#H<$#`#\$#^(1PH'/[W&?FMXR![8WL;`AA#0"CTV"`<"#`0\+_]!QP`)@G@ +ML``!&3AH$#$0\,SY!#V-[&P(80[!"W=GNYR`<"#`0\*?]!AP@ +M'!`P$/"B_3!@T>>]2$!J`"@#T"$<*!S^]T'Y"O!:^"!Z8WH;`AA#`"@2T"%[ +MH'KC>AL"&$,-\&G\H'KC>AL"&$.$*#[1L$D@>XEHT#$(<3C@H'KC>A^I&P(8 +M0PWP3OT>X*A(0&H`*`/0(1PH'/[W%OD*\"3X('IC>AL"&$,`*`?0(7N@>N-Z +M&P(80PWP,OP8X*!ZXWH?J1L"&$,-\([]&*L8?R!S#>"82`$G!W!]()=)P`#( +M8R!Z""@#T)%)3W$/\/S[P>,@'`@P$/`__9%/`"ALT2$B(1P,,1>H$/`B^!>8 +M`"'`!\`/%I`3J`+``L`7F!VJ`C(`!T$/`"DDDFW1%Z@&\"OZ`"@$T7Y)B&H! +M,(ABB>`8JQA]&ZDCD0`H;]%X:``H!]%\2``A0G@`*@+1@'@`*`+0!2!X21'A +M<4C`>@`H<=$$\%#^`"@%T03PB_]L20$@R')GX`$A(Y@&\,W[:$FP,4AA!QQ> +MT&M(0'P`*`+1`2`%\,3X`"`%\,'X`"$!(`7P2/@`(A>I%IAY`H3_`0```*0M +M`````@``A:>/K@3PWOXDF1#P\?@8JUA]84F`"!606'V`!X`/`R@"T1@@">#K +MX@(H`=$0(`3@`2@!T0@@`.`$(!BK"?%-)B'%-2$!Y`"@$T`4@#_!Q^P7@ +MP.)1204@%9H/\-;Z,!P0\*_\`2@.T!68!B@$T0$@NB'(50/@GN``(;H@P55X +M>P`A"?#%_@`AO2#!51BKV'P`*`_1/$A!8P\A!2``X!?A#/!A_C\A!2`,\&C^ +M/$E!($AA(.`8J]A\.DXP7`$P#/!8_@$0`H!-`&(`_P6?H%X`?BR$D& +M(!6:#_"^^3`<$/"7^P$H#=`5F`8H`]$!(`#@A^``X``@NB'(57A[`2$)\*[] +M`"&](,%5&*O8?``H#]&Y2(%C#R$&(`SP3/T`X.G@/R$&(`SP4?VT24$@B&$@ +MX!BKV'RR3C!<`3`,\$']`1P&(`SP-_T8J]A\,%P!,`SP0OT!'`8@#/`X_1BK +MV'RG23!<@`!"&%)HBF&C24`80&J(8YM.`"`7J0D8"7PR&`$P!BA1P`H!=`ZB1BKV7P`(`OP'OF72(!K`"@%T)5*@#*0:4`A"$,$X))*@#*0:4`A +MB$.082.8@'L`*`'0`2`P=`$GBTEX`X`Q=W2(8/WWV?XCF`-\P7L;`AE#2![" +M%Q(-$A@2$Q(#@!H`!``,"@IB``%(8G=(AW$/X7I)`2"(2/SA&*M8?1E]@@C8?,L`61A82\D8B'%< +M23@<#_#G^#`<$/#`^@$H!=`8JQE]$IA`>PGPW_P2F`$AL#!!".X07BB1@)>@$I`M`!,`@H\]L(*"S1 +M!"\!V``O-=$8J]A\.DXP7`$P#/!0_`$<.!P,\$;\&*O8?#!<`3`,\%'\`1PX +M'`SP1_P8J]A\+DDP7(``0!A`:"*:41@(8-A\*4DP7(``0!A`:B*:41@(8@S@ +M!"$X'`SP)/P/(3@<#/`K_"%*(ID@((D8"&`!+P'0`B\(T1BKV'P$*`32&DHB +MF0`@B1@(8B.8@'L`*`?0&*L8?0Y*`2'#`!@8@!C!<1BK&'T*2@$APP`8&(`8 +M`7(BF0U("!@`:@`H(M`*2H`R4&D!(0D$B$,:X&3A@E`"P#1H`L!P1`$```P` +M@"0S`,!44`+`_V<``$"B`("`I@"`'"<`P$"K`(!`I`"`*',"P%!A`2#E2B*9 +M0`.)&`AC_?>S_0G@0`\!*`;1%ZD6F`3PIOTDF0_P`OXDF!#PZ?G_*$_1(1RR +M=^7Z`0```)@S`````@``^[PH'B@<_?>,_2SA`BA?T0@B(1P,,1VH#_#&_!Z8 +MU$H&!C8.@`H +M$]$&X`$N!-&[26@Y2'L`*`O1'Y@.\/__,!P$\"K\`"X$T;5)`2!H.`! +M+F/1L4D!(&@Y2'->X*]*`"!(,M!1K4@?F1`X05P`*531'YD!)T=44.`\X0$H +M$-$*(B$<##$=J`_P9/P=F!Z9P`?`#Q"K"08)#IJ/!/`H_3S@`R@+T0@B(1P, +M,1ZH#_!1_!^8``8`#@3P&_TNX`0H+-$A(B$<##$7J`_P0_P7F``'0`\BT1>H +M!?!8_@`H`-$KY!BK&'T;K@`H+-%X:``H1M&+2$%X`"E"T8!X`"@_T89/:#_X +M>@`H.M$$\(7Z`"@%T03PP/L!(/AR,>!UX`$A,!P&\`+X?4E(,4AA`"@GT$![ +M"?!?^@"(P06)#@,I']/`!V+4'.`8JQA]`2@MT3AK`"@5T7)(@7H`*1'1P'H` +M*`[1;D]H/WA[`"@)T0$@!/!3^@`H!=$!(`3PC?L!('AS/N`!(3`PGP+?H`B,$%B0X#*2W3P`PGP`?H`B,$%B0X#*0'3P`<$ +MU"$<*!S]]V/\!N`A'"@<_?<9_"&8`"@"T$1)!"#(8C^P\+T@>F-Z&P(80P$H +M8]&@>N-Z&P(80PGPL?A_%[`AP` +M(#L<"?!G_?_W\_@@>CR9R',L26@Y"'+/X"!Z+DD>*&C0'MP1*%W0$-P`*#_0 +M#B@VT`\H/-`0*#'18'H.*"[2="-80T`8*2$)`87@$RA2T!4H4M`:*%30'2@@ +MT2<@@`%-X",H%=`)W!\H7-`@*&/0(2@+T"(H$M$82$#@)"@+T"4H8M#_*`K1 +M%4@XX!<@P`$UX!)(,#`RX!!(T#`OX'3@8'H"*''27"-80T$80#%4X&!Z`BAI +MTLPC6$-!&/@Q3."`H@"`C#,`P#1H`L`H@,H3](P(UA#0!CA23'@#N#A2`'@X$A$,`D8*^!@>@(H0-(D(UA#0!C: +M29`Q(>!@>@(H-](8(UA#0!C623`Y&.!@>@,H+M(4(UA#0!C22=PQ#^#_YV!Z +M`R@DTD`!0!A9(4D!!N!@>@,H'-*C8G,>`0```)`W`````@``%JQ(TUPC6$-` +M&,I)01@`*170H")/X`$G`2$@'`@P!?"R_@8<(]"A>PP@`"D-T'**X7N"0X@' +M``\00W""`.!LX.![`"@$T0`G`N!QB@A#<()PB@`'@`\!*`#1`.``(+9)R'/] +M]R_[<'LY'`GPG/@A'"@<_?<5^_WF`2$@'`@P!?""_@`H2=!`>[@CK$E80T`8 +M`1QH,2`<'B(.,"C@J$@!:$MX"'@;`AA#('(#"F-R"GA+>!L"&D,@'`PP&.!@ +M>2%Z.50JX&=Y)GIC>B`<&P(>0PHP#_"!_P(<,1PX'`?P-Q""(A'"@<`O"K_Y?F +M^+5\3.%L`3'A9``H;=']]RSZ"O">_N!Z`"4`*!/0('M!'"%S`2@.V?WW9?@& +M'"5S`2$`(.5R!?"+^P4@`?!N^3`<_?==^&M,8'L`*!30)ARP>T$![X`5@24@!:``I"=$!(`3P +M&O@`*`710TD&(`AP]V(`X`5@`?!2^3A*U70W2I!]01R1=00H&=D`(#U+`"&, +M`!Q99"P"V0$P``8`#@$Q""GUVP`DH0`!-`@L75#ZVP(H`MD!(-!U`.#5=95U +M)TH0?4$<$74!*!G9`"0#X`4L$-`&+`[0*TF@``I8`"H(T2`@`H`=`+\#O[^+T``.@(```("@``U`P``"0S`,!(PP$`T"8`P!`W`L#01P$` +M``P`@$!0`L!P1`$`1%`"P+10`L"44`+`*',"P/BU!?#H_PGP:_H7(4D"2D@/ +M\.SX24]*30`F`2(Y'``@_/>F_P0<^-#@!`+5`"#_]]7^H``M21(`_",^0`H +M!-`92D%H46``(0%@@+T`(@$<%4B`M4!H`_">^8"]$DB`M4!H`_"@^8"]$+4/ +M3&!H`"@'VP/PF/E@:`/PF?D`(,!#8&`0O8"U`2```_WWS_B`O8"U#O!+_H"] +M2,,!`/__``#L$P+`&3P``/`E`,!#0B!0/\CR3/<2EE###*.&#$<_S&! +M,=E*CF(2>-E,_R"3`!H90#K5:P$P36+23=PU71E`/>UKTFNJ&A($$@P`)8)" +M`M,(8LUB$."`&@ACR4@W'/\WS#`8&+$W"F+/8D`XP&M(8XAJ@!B(8\UC,!S_ +M,,5)H3#(8\-*0#+0:(D-B$/08,!+3#,8:#TA"0((0QA@T&A`!/S4_/='_C<< +M_S?!-P"0O8!6X!0A04.-&?\U0`&$&0$U(!P/\`;]`"A-VF%Y`"`(*0'1`2!@ +M<:Q)"7@$*0#1`3!A>0#PYO\!D``H!-$!\"GX`?!FF'RR`0```(0]`````@`` +M/*4J0RCX-^`T(0&8#O"$_P&8-#`!D"A@(!P/\./\0`!`""$<#_#T^"`<%#`/ +M\-K\FDF;2@EXB0")&$`YR&-C>R![&P(80VA@`9CH8"`<"#`/\,C\J&``("AA +MN(@!*`73%"-80X`9!#7`,,5CN(@!,+B`N(@(**73`)C\]^G]N(@`*`[0`2`" +MD(-)`""(8(9)@TH(8(%(`'B``(`80#C`:SA@`IC^O7Q(_R,`>,DS>DE80PPQ +M0!C_,'I)!3#(8WE*0#+0:(D-B$/08'9*3#(0:#TA"0((0Q!@<$=R24`QR&A` +M!/S4<$=L2'"U`'C_(\DS:4E80PPQ01@+'/\SP3,8'$`X'&A":@`EE$(%V:(: +M`F)":D%B@F(3X$%B8$R"8B1X7$X::,PVI`"D&4`\Y&NB0@;9$AL"8T)KA&N" +M8T1C`.#%8O\Q5TBA,<%C5DI`,M!HD0V(0]!@4TQ,-"!H/2$)`@A#(�:$`$ +M_-1029B("FB`&`A@<+WXM1<<'AP-'`0!L"&$,!!XH/`-$! +M)00M!MB)#P(I$]$`!@`/""@/T0`N`="X-C9H(!P@,$-X`'@Z'!L"&$,!!PD/ +M(!P*\/GY,QPZ'"D<(!P+\$_Y^+VPM35,`"4@>``H!]`-\)+^(7@!*0'1,4D( +M8"5P,4P@>``H!]`.\!?Y(7@%*WC``0```(`_`````@``R$V4_@$I`=$M20A@ +M)7"PO?"U#QP4'`0PA[`&D`_PY/LH204!L"&4,)!XD/<=`` +M+&_0NR$)72%*$7`(*6G2`:-;7%L`GT0#965E/64]/28<0#8PBX$'7-7`!(`. +M(1P#\&3Z`"A5T`:8#_"Y^T-X`'@QBQL"&$/*!`@X``22#@`,203+#P"2P>`` +M`#`F`,"\4P#`/%``P(@/`,!D#P#``.@`@!@T`,"$#P#`I3X`P*P^`,"D/@#` +MJ#X`P+!-`,`=)@#`@7D_!C\.S@&MXH"`;`AE#%#D`D0-;G"`"62D<(#$H'`WPK_\"(/-)`"X(<`W0(!R@,(&) +M`3$)!`D,@8$#T8`TH&H!,*!B![#PO2``$B&P(80Q`X +M`00K'`&2(APH,PD,*!P`EPWPF?P"(-1)'N``+LS0`"C*T2$<`_"#^0`HQ=`& +MF`_P]/IR6`9>`0```'Q!`````@``+1K)^4-X`'@`(AL"&$,(.``$``R`-`"2 +MXWHI'"0Q`AP('PWP@?[$20(@"'"MY_BU#AP$'!<<_/<*_`4<__?/_@`L!-`Z +M'#$<(!S_]^/^*!S\]P+\^+WXM04"P<+#0;`AE#"0>)#P(I +MLTH%T8!YP`<"U2$<$!P!X"$<$!T.\,?^KD@!>``I!M"M2QEH`2(10QE@`"$! +M<"`<#_"C^@$P0W@&>&`G&P(>0[Y#!G`S"D-PI$B`>P,H"=$@'`_PDOJ^0S$< +M(#%!<`L*@W`(X`(H!M$@'`_PAOJ^0T9P,PJ#<"@<'#`$'`_P??H!(0D#B$,A +M'`[PC?[XO9-)2&!P1Y)(0&AP1_"UF[``(`B0C4B-21`P&I`",!F0"C@6D`0X +M0#$8D160`",$DQPP$#$4D"`X$Y`7D0$B`R"$2?SWT_L$'(-(`(L4*`O1&)E( +M>0(H!]&`2E!H0`0#U%!HT0$(0U!@(!P$\.?[`"@"T`#P=/WAYR`<`/"@_AJ8 +M8!Y$#H;`AA#P`?5U1.8@WM`>QL"&$.`!L[5<$D!(`AW;TD$(PMP`"`' +MD/_WJO\`*!S0!/"?_0`H9-#_]T'\`"@4T1F8#_`0^AB9`"0)>B,<`)$3F8I[ +MS7L!'"@<#?"=^A.8@'O\]Z3_6$A$8`B8`2@>T5Q(`6E`:8%"`=`RO9E:`0`` +M`'A#`````@``V?)W1`#P+?T`\"K]__=K_0>8`"@%T`>8!ID%F@2;__>P_?_W +M9OW_]WW\`2@"T?_W0/T6X``@$^#_]W3\`"AQT/_W-_W_]T_]0DD!(@AX4$`( +M(!X&P(80P`'@`\"*`;1$9@/\";Y!QR`><`'4=4@'/_W5/X1F`_P'/F! +M>,-X&P(90PH'D@]#T0D&"0\%*3_1%YD'',E[B0<9U.I)"6@`*0/0.1P@,0`@ +M!N`!'!(Q`"`*\"O^.1P@,07P`?L!D!&8#_#3(;L>`0```'1%`````@``P`JI +M-/?X`9D!<`L*0W`'X`%X0W@;`AE###DL,`;P@/T"(-I)('`(:$EH.AP@,@,$ +M&PX0<%-P`P(;#I-P``[0<`@$``X1<5!Q"`(`#I!Q"`[0<9?A$Y@/\,WX`2AF +MT2$<+#$0D`AX_R$;`AA#^3&(0P"K&7F)!LD-"$-`"$``!"&( +M0PZ9`PH(<$MP"/"`^@Z9&"*+>$EX@`<;`AE#D4/`#@A##ID#"DAPBW`/F`_P +MA_@!*`31`*L8>0$H"-`#X`"K&'D$*`/0`*L8>?\P&'$!-S\&/PX$+\#3#Y@/ +M\'#X`2@*T9U)_R((>TM[^3(;`AA#D$,(,`G@P."82?\B"'M+>_DR&P(80Y!# +M*#`(0`M`9$3T1&8#_!-^`8P`"$$\"#_!1P*T1280W@` +M>!L"&$-!!\D/@`?`#P"1"N!H>P3PN_\!!@D.`)%H>P3PR/\`!@`.`)G`!\D' +M20\-D8$/#)%[2;@`01@+D0AX2W@!(1L"&$,(0P(AB$,,F0A#_R'Y,8A#`9F) +M!LD-"$,$(8A##9D(0PN9`PH(<$MP"/#S^0N9&"*+>$EX@`<;`AE#D4/`#@A# +M"YD#"DAPBW`!F0`I!]`F8H6>`0```'!'`````@``-.(7B0&9("D$T`&9_S$) +M!@D.`9$!-S\&/PX$+\+374K_(5-[$'OY,1L"&$.(0Q!S`PI3U1)&P(80XA""]E03Q:8#O#0__E[.WP;`AE#"0<)#T`:`N`6 +MF`[PQ?\!,"!P(!P<,`<<#O"^_P$A"0.(0SD<#O#.^T1)"&@!(A!#"&`0F`[P +ML/\!>#L=&7)!>%ER"9D$*6_2.D\X>#!W>'AP=VG@`"T2T;@=`"$$\'/^!1P, +MT0`A,B`!52$<"B`@,8AR`PK+WH; +M`AA#P`<*U'MX.'A@(1L"&$.(0P`A"$,X<`,*>W`P'`[P`O\!(A!#,1P.\!/[ +M`"UL.Y/1`0```&Q)`````@``\_L5U`C1$9@.\/C^!C`!(03PR_T%'!K0+HEH +MB@`'@`\!*"#1.'I[>AL"&$/!!QK5P`6`#@!L"&$-` +M!@G5.'A[>"H<&P(80P$'"0\@'/_WV?O%28AL`3"(9`>8`"@%T`>8!ID%F@2; +M__=T^@F9!Y0%E@25!I$#F`$P``0`#`.0$IB`B`.9B$(`V>GD^_?*_P0<__>/ +M^B`<^_?)_PB8`"@`T)#D!Y@`*`70!Y@&F06:!)O_]T_Z__<%^H3DK$D(>/\P +M``8`#@AP`-!9Y``DJ$D`(`QW!/#'_QOD?+4#(/OWVO^D2`+PAOVB32AB`O"K +M_BACH$@@,`+P??UH8@+PH_YH8YQ(8#`"\'7]J&*:2$`P`O!P_>AB`R#\]Q7X +M?2')``4B`9(`(@"1EDD#().C^_>B_@`H`=`!('R]!_#:_XQ.`"0X-BAJ`O"? +M_:$``305+'!0]]L%X&AJ`O"6_:$`<%`!-"4L]]L`)*``,%@"\.S]`30E+/C; +M`"#>YQ"U?4P@:@+P8?XA:XA"!]%@:@+P6_YA:XA"`=$!(!"]`"`0O71(@+4` +M:@+P3_Z`O8"U`R#[]Z'^@+V`M0`H!=`!'`,@^_=U_P`@@+T/>.QV`0```&A+ +M`````@``!Q.K:0$@@+WXM08<;4@/'`!X-#<-'``D`"@3T`PB,1QI2`'P7_X! +M\'[^9T@`(08P!/"]_``H!=``B0GPL/P`*`#0`20A'#@<`/#*^`0<`"A>20?1 +MB&@!,(A@4TE(;`$P2&0/X%I*`"`08(A@64D(8#0A(!P.\%[X-#0J'#$<(!P! +M\##^(!SXO?BU!1S[]^G^!AP`)``G1DF@`#@Q"%@!(8D'!2+2`T$8D4(/V`$< +M(#&*>LMZ&P(:0ZI"!]$R(A=4""**AL" +M&$,%*`'0!B@6T2!X_B@!T/\H$=$@'#`P@G@!,A(&$@Z"<`(J"-D((HIR$PK+ +M/_X"]L+4$'``H$TT, +MT2P@$DI(0X`8@&H`*`70!2D#T`8I`=!->.N;`0```&1-`````@``'NMU&2AH +M#N`-2`!H`O"$_``H"M$H:`+P?_P`*`71`BP#T0A(`&@"\'?\L+V`M0+PK/R` +MO7!'<$?@4P#`*',"P-Q3`,#H4P#`H"%+`%D8`"!)"`#@`3"!0OS8<$=!!DD/ +M@+4%T`$<`R#[]T'^`""`O0$@@+UP1_"US$J%L!%H`Y$0:5=I`"3*2\I-`"$! +MKLE-,54I50$T""SXT^O@.`8#F0`."$,-(0D"`"4(0P!H`"AIT,%)"$`)!T08 +M(!PD,`20#O"@_`8&-@XP!S?4(!P@,,-Z@'H;`AA#!2@*T`8H"-`L(;-*04.) +M&(EJ`"D$T'$'`M6R2H$`55@`+1+0!2@!T`8H&]%H>[@CK4E80T$8#1P,-2@< +M#O!V_`$P*1P.\(CX#.`@'0[P;OP&,``A!/!!^P`H`]!!>R`MR"%4_X"PC +MU0`FZWJH>@`A&P)T[H>*`0```&!/`````@``Z@/+I!A#`:H15*IZZWH!J!L" +M&D,1&"`<`_#._>MZJ'H!J1L"&$,(7``H$=#_]P[_`38(+N+3"^!P!PG4`"`R +M(0A5"B"H<@,*ZW(@'/_W\/X`(`29#?#N_PG@`"`R(0A5"B"H<@,*ZW(@'/_W +MX?XX'4]*QP40:?\-N$(`T!#G3$I7851(`'@`*"70^_?N_`4<""1)3@`G`:@` +M&1`XP'L!*`O1A2```4Q)8$-`&(4A"0%`&@\A`_#.^0C@,!D0.,%[`2D#T<=S +M8!X#\$/[`3SBT2@<^_?/_`6P\+WXM00?-Y&P(80\`' +M]M4`+`K1N'K[>AL"&$.!!L`&P`_)#P@8`-`!)"M-*'A!'"EP"B@0V:AH`1PI +M.2((ABKN>,M2,A"0$>(@&2`"(`D1%)`2`.H_OW_/H`*`/1!DG(8`AA +MC+T!(/SG@+4!(/OW+_N`O0``4$T`P`0T`,`<)@#``*8`@$SQ`0!`I`"`261L +M90````!940``\+7M2`0A`6'L2>U/06%+(4D!"QS_.X%A.3O#80(A`6(`(0$B +M$@-'8H%BPF+C2TLFY$UV`0%CS``]4>098V";&0$Q`2GWV^!,R0!\4,D92V#9 +M208C0#&+8=Q+I`W+80QBVTP!(DQB"B2,8M5,$@,0-,QB2F,`)-).#&,`(M5- +M$#:,8]0`-5&D&6-@`21D`AL9`3()*O7;T$S2`+10DAE38`4B0F/-2@,C&P*" +M8\-CS$OD#`M@`B-+8,%+P4T0.XM@`"/+8`QA2V$`(<9,$#W+`.Q06QE:8`,C +M&P+2&`$Q`2GUV[E+R0!K4$D92F"R2@,A@#K19KQ)L$N6:O1<`0```%A3```` +M`@``8/#2J1%G@#O4(EIG`2)2`YIG:2+:9ZU,`2,`(F`T&P-"8(-@!&#"8+-+ +M`"#"`*-0$AE18-0Q`3!H*/?;KTK``")0HDI@,H`806"M2``B`F"K24`QS6$" +M(XMAJ4K##$`Z4V)/80(D#&$38DYB"B0,8I-BEDE@,4%C:2$!8Q-AH4D`((A@ +MGDEC(,`Y"&*=2<`'0#D(88AA2&$(8/"]-N?_M0P<'AQ+>`EXA;`;`AE#`9'A +M>"-Y`"4;`AE#2086U0`N%-"[(8E=D$H''!%P(AP@,@.2!#(@-P@I!))ST@&C +M6UQ;`)]$!@-O;T-O0T,`(`FP\+TP'$`P`I``BX`'8M4#F()*P7B-"0%X$7!! +M>%%P@'B0"-Y&P(80T`'`R#[]U'[`I@`E`"+ +M!)E`!,,/`9@D.`($$@PX'`SP:OT%'`,@^_=O^P`M!=$@>&-X&P(80P@X=>#[ +M]X7Z!"4_X*!YQ0?M#_[W1OTP'%`P`"T#T8%Z`2D_T0+@P7H!*3O1,AP`(2@< +M`O`9^``H+=`#(/OW&OL!FCD<*#H@'`>;#/!L_@4<`R#[]S[[`"T3T>!X(WD; +M`AA#`.!)X$`'!=0@>&-X&P(80Q0X/.`@>&-X&P(80PPX-N#[]T;Z*0>)#P70 +M_R%(2@$QT6(#X&/@J0<`U0(E^_=!1=Y-`0```%15`````@``>0@,V3WZ*N"! +M>@(I`M#`>@(H)M$Q'"@<`?"__P4<4=`#(/OWV?H'FBL<`)(!FCD<,#H@'`SP +ME?L%'`,@^_?[^@`M`=!K'`G1('AC>``E&P(80Q`X('`#"F-P`.`0)2@<1^<` +M+2[0`"@LT0.8*$K!>(T)`7@1<$%X47"`>)!P_O?"_#$<*!P!\$__`"@:T.!X +M(WD;`AA#0`<#(/OWG?H`E(`V\WH!F`29)#@"!!(,.!P,\+C\!1P#(/OWO?H` +M+0#04N=+YRC@``!D$0+`<&\!P#P-`L``E@"`@((`@/B``<`4!````"``@$!! +M`(!(9`'`*`@````P`(`,EP'`0`T`@````H#`HP"`P*0`@!TF`,!\-@#```P` +M@`$@ZN;PM96P`*L`(1ER)"/W25A#1!C@:0`%P`V@86%IP``/&'YH`2`.\-#Y +M\4D(:`$P"&"P>/-X[TD;`AA#B$($T.Y)2&D!,$AA?N``(+!P\'`P'"`P!Y`Q +MC`$@0`,@.0B1@4)QV`B8`"ANT`>8!9##>(!X&P(80P$'B0\!*1K1``8`#PHH +M`]$%F`3P8OA)#P(I"M$`!@`/ +M""@&T7-[,'NZBQ(D`0```%!7`````@``C>"R9!L"&$,H=`,*:W0H?&M\&P(8 +M0T`'0`\$D,%(P'N`!A+4!9@!(1(P`_#,_@.0*!P(,`WP\/\"J@"2!)H'F0.; +M__9")H!\!GXL'D'\#SYL4D(7`#@D^#H<3%YR0<# +MU`(H`=$8(.AQ\'EHBAWL7TH'!0P$Y`4D0WPL?\`"A29``((0Q.9#?#`^W%]*!P5 +M,!&0$I$-\*/_``H2F0`""$,1F0WPLOLQ?2@<%C`/D!"1#?"5_P`*$)D``@A# +M#YD-\*3[L7XH'!@P#9`.D0WPA_\`"@Z9``((0PV9#?"6^W%^*!P9,`N0#)$- +M\'G_``H,F0`""$,+F0WPB/LQ?B@<&C`)D`J1#?!K_P`*"ID``@A#"9D-\'K[ +M*!P$\,[X,'ET20:0<4@@.,-Z@'H;`AA#@`8$U0680'P*>)!""-!N2`!H`"@( +MT`68P'H)>(A"`]$P'`B9!_#;^`$F-@,`(:!I]00!(SIH&P4:0"-I`3N#0@K1 +MX&@``2A#.&#C:3`0FC1`""X[A[&P(80[!Q$)@P<0,*Y?3`<%#`.D`^1#?"R_@`*#YD``@A##ID-\,'Z>7TP'!4P#)`-D0WPI/X` +M"@V9``((0PR9#?"S^CE],!P6,`J0"Y$-\);^``H+F0`""$,*F0WPI?JY?C`< +M&#`(D`F1#?"(_AC@^>#D$`+`##0`P.^^```P9`'`+C,`P`"@`("P30#`L"8` +MP$GQ`0!T)0#`%%`"P"P-`L``"@F9``((0PB9#?!]^GE^,!P9,`:0!Y$-\&#^ +M``H'F0`""$,&F0WP;_HY?C`<&C`$D`61#?!2_@`*!9D``@A#!)D-\&'Z,!P# +M\+7_\$XP:`$P,&#O3K!Z\WH;`AA#@`8-U0&8[$E`?`EXB$('T.M(`&@`*`/1 +M.!P"F0;PQO^P>O-Z&P(80X`&1M7A3AX@,6@-\-CY`2D\T0.8(#!">P$<##%7 +M&/%H`"D*T0HP#?`6_D`&!=1X>`4H*='X>2PH)M'L[<#Z`0```$A;`````@`` +MOA$.A-=(`'@`*"31UDD)($AC`B$`(`GPU?\/(0`@"?#<_P(A`2`)\,W_#R$! +M(`GPU/\"(0,@"?#%_P\A`R`)\,S_R4D6($`Q"&!(8,A@`2``X``@L&`P:`$P +M,&`!(A(#`"&@:=<$`28K:#8%,T`F:0$^AD(*T>!H``$X0RA@Y6D0'*A#X&%E +M:0`@"N"F:`$P-@$^0RY@YFD(-0@V]@3V#.9A`"L#T2-I`3&+0MO2`2`1L/"] +M`"(!)Z%I_P5I"0.I0^%A96D` +M(0K@IF@!,38!/D,N8.9I"#4(-O8$]@SF80`KV-$C:0$RDT+:TM/GF$M34-+G +M\+5!:8)I`2?4``D9/P,`(_X$`24,:"T%+$`%:0$]E4(*T<)H$@$R0PI@PFDY +M')%#P6%!:0`B"N"%:`$R+0$U0PU@Q6D(->T$[0S%80@Q`"P#T01I`3.<0MO2 +M\+WXM8!.`"0`)Z``A1FH:@`H`M`!\!/]KV(!-!`L]-,W<'>$^+WPM<%I`"8) +M!$,D4/!84%I`"(,X(-H`23D!QL!(T,+8,-I`3((,]L$VPS#80@QQ&D# +M:B4%'P4_#2T-O4+2T0$E+0/J5/,=`0```$1=`````@``I^G0]"Q`*T"<0LS0 +M@F$P'/"]\+6OL`"K`"$9=P`B!)(D(D)#5$@2&"Z23$I`.A,<0#-@,H`P*Y`L +MDBV3`"0`(`B0`"$*E`"K&7<%D`.0+I@.D/_WGO\`*`+1!)@OL/"]#IB`:0Z9 +MP`!):0@816@!(`V5#?`__D%)"&@!,`A@#9T_2:AXZW@;`AA#B$)CT0`@J'#H +M<`V?`2`@-SJ(0`,@.@R2@D)7V`R:`"I4T`R:/AP0!``,*I`X@/AX.WD!(1L" +M&$/`!S@<##`#\(/[`Y#P>#-Y&P(80T$&6-4#F2E*L#')>A%P!"D&T``P9`'`D$T`P$GQ`0!T)0#`_#,`P$"F`(``,`"` +ME!("P.00`L`,-`#`[[X``!TF`,#<4P#`[$D!(`AP#IB`:`SPJ_X#\)G]!!Q( +MT+!X\W@;`AA#``8`#P@H"=%K>RA[&P(80R!T`PI`!T`/8W0*D`28`3`$D/!X +M,WD;`AA#0`9DU0$@")`@'`@P&Y`-\!_\!ZH`D@J:.1P#F__W7_H`*''0`B@7 +MT1N8#?`WPXN<`0```$!?`````@``4P%N21'\("(Y'`#P1_P!X(;@$N`@("!Q +M`PIC<8`@('""(*!P`"`@=&!T(!P#\&G]Q4F(;@$PB&9TX,1*4(P!F8A")=$0 +M>`*9`3"(0B#1`ID&F(D`B1B(8@*9$7`"F2J820")&$B`\'@S>1L"&$-`!UC4 +MMT@`>``H#M!K>RA[&P(80P,*('1C=$$'20\#F@7@!I@!\(S[0^`#F@`A,!P# +M\/O[`"#-X-S@`_`4_00<-]`)F*9)@`!`&"F0A6H)F"\<0`!`&$"((#<^'"B$ +MN'C[>!L"&$,!!XD/`BD,T0`&`."WX``/""@&T6M[*'L;`AA#('0#"F-T('QC +M?!L"&$-`!T`/"I`@'`@P*)`-\(W[!ZH`D@J:.1P#F__WS?D`*`+0__0;PU/R$20AAY8'#K>ZA[&P(80Z!Q>W@X>!L"&$,@<0,*8W&`("!P`2"@<`KP:?O@<&AZ +M('>I?2`<%#`FD">1#?!,^P`*)YD``@A#)ID,\%O_:7T@'!4P))`ED0WP/OL` +M"B69``((0R29#/!-_RE](!P6,"*0(Y$-\##[``HCF0`""$,BF0SP/_^I?B`< +M&#`@D"&1#?`B^P`*(9D``@A#()D,\#'_:7X@'!DP'I`?D0WP%/M\`J@;`0`` +M`#QA`````@``6]Z?E``*'YD``@A#'ID,\"/_*7X@'!HP')`=D0WP!OL`"AV9 +M``((0QR9#/`5_R`<`_!I_"F8@&H!\+OZ*9@`(8%B"9@!,`*9"9"(0@#8+>![>#AX&P(80R!Q`PIC<0[@>W@X>!L"&$,@<0,*(!P(,&-Q#?#8^CD< +M#)H`\`[[*'D+D"V8PWJ`>AL"&$.`!@35,4EP?`EXB$((T"](`&@`*`C0+$GP +M>@EXB$(#T2@<#)D&\%#\#IC_]RW]!9@!*&C0+)C`>\`&*]0#F``H!]$!(3`< +M##`#\'[Y`Y``*!O0`YBP,$!Z`"@6T+!X\W@;`AA#``8`#P0H`]`,*`'0""@/ +MT6M[*'L;`AA#`PH@=&-T00=)#P.:`>`#F@`A,!P#\+OZ#TB`:/\P83"!>0`I +M&]`*20EH`"D"T0N9R0<2U0$A$>```!TF`,`@-`#`E!("P"0;PIOOU20AAY8'#K +M>ZA[&P(80Z!Q@"`@<`$@H'`*\$+ZX'!K>"AX&P(80Z!T`PKC=&AZ('>I?2`< +M%#`8D!F1#?`>^@`*&9D``@A#&)D,\"W^:7V#&M6U`0```#AC`````@``KS8A +M*2`<%3`6D!>1#?`0^@`*%YD``@A#%ID,\!_^*7T@'!8P%)`5D0WP`OH`"A69 +M``((0Q29#/`1_JE^(!P8,!*0$Y$-\/3Y``H3F0`""$,2F0SP`_YI?B`<&3`0 +MD!&1#?#F^0`*$9D``@A#$)D,\/7]*7X@'!HP!1P/D0WPV/D`"@^9``((0RD< +M#/#G_0#P*OH+\&#\!1P(F``H!]`@'`@P#?#%^2`B.1P`\/OY`"T"T2`<`_`I +M^RN8L4F`:`AAPN3XM:](!!S`-`4<@#4!(@(@K4GZ]RS[!ASXT'`'2M6G2(`P +M`&D`#"AC`"<2X*=(`'@`*`K0ID@!(4%A@6(`(<%B_R&B2(DQ0#`!8`0@__<3 +M^0$WZ6HH:PH%`P4;#1(-FD+DT0$B$@,10!!`@4+>T)-)Z&H(8I=)"&C`&0A@ +M`"\)T``@`_#A^I-(`"&32@%@4&@!,%!@DDB23SAAD4E`.4AHP`4'U8U*$&D! +M,!!ACDA(8(Y(.&'P!SG5@4E`,0AK``SH8`,@__=*_'U*J6@188!*$6@)&!%@ +M`"@"T``@`_"T^H`@?T_`0SAA=4FH:$`Q"6L)#`H%`P4;#1(-FD($T?H,$4`0 +M0(%"`]$!(0(@^O>D^G1)0#E(:``'"-5O2A!I`3`080@@P$-(8'!(.&&P!SG5 +M8TB`,(!I``Q@80`G!.`,\UI``0```#1E`````@``ML[_60CP4_K_]P[Z`3R_7TAR0`" +M(@&2`"(`D1=)!"`4H_KW@_@`*`#1C+T!(/SG@+4$(/KWN?B`O8"U`"@%T`$< +M`B"TI64@`0```#!G`````@``0B9!Y/KWC?D`(("]`2"`O?BU"TX`)``GH`"% +M&:AJ`"@"T`#PS/^O8@$T$"STTS=P=X3XO4U!0R!2>```]V,``)02`L"PM0T< +M`0,(&($-04`(`4`800I!0(@"0!B!"$%`R`%`&`$+2$`-\,KZ7R')!0WP_/H$ +M'"@<#?#"^B$<#?#U^@WPC?JPO0LP`I_-$Z22`Q"'((>7!'-T@( +M(0&`@B$!<3A(`(C`!C=)`=4"(`#@`R`(<'!'-$HPM11X`1PS2^("!*F0$10QI*$8$93`,A(#0A<0$&`@02#@D. +M`BL$T`,K!-$``@`.('$B<2%Q('D0O1"U`AP,'/_W7_^D`0`J"=$_(/_W:O^` +M!H`.($,!!@D./R`(X$`@__=@_X`&@`X@0P$&"0Y`(/_W3?\0O0#H`(``P0"` +M?2P`P`"C`(``(`"`Y!,"P`($``#XM>Q)`"#(8!@Q"'#J3@`E`"1(2_@$U`302+._3^+UPM=].`"4`).``,%@`*`/0 +M*!SY]XW_`34!-!(L]--PO?BUV$@%:`$DUD\!)C`?\@!0/5!"$"(/GW<__@!`?5.&A`(2AA`B#Y]VO_JT@P82`&!=4X:`$A +M*&$"(/GW8?^G2*A/`&@`*!/0X``#U0?P(/^E2#!A(`$+U:1)`"`):``I`=&B +M2(!J``8`#@3P'O@W82`$`]40(0,@^?="_YA(`&@`*`+1(`$`U3=AX`>93PK5 +M>&L$(0$P>&-H:`A#:&!`(0,@^?'1+)#.(`!I0A4I`,I)I%#,:4(-* +M0#+2:10S&E"`2D`R$FH4,QI02!PH<`0I`=D`("AP("$#(/GW^/X$X"$@>$G` +M`H`Y"&)@!PG5:&@0(0A#:&"X:@$PN&($(,!#,&$@!PK5:&@@(0A#:&#X:A`A +M`3#X8@(@^??9_N`&$=5H:$`A"$-H8#AK!"$!,#AC9$B`.`%@`/#%_?[WF?L0 +M(,!#,&&@!A'5:&B`(0A#:&!X:@0A`3!X8EI(@#@!8`#PL?W^]X7[("#`0S!A +MH`0$U?\A`3$"(/GWJOYH:``H`]`!(,`#^O=<^#U)"#$(:`$BD@(00PA@^+W_ +M(#E)`3#(8`(@<$=<3CVX`0```"1M`````@``:"\C=("U`O!%_C5*"#(0:/\A +M`3$(0Q!@@+TQ2`!H`B!P1W!'_K4N2$`FQF!`3WAJ!?#,_P*I/2`)\$O]`:D[ +M(`GP1_T`JQAZ&GJ`(0A`?R&10RM,"$-V/"$<(#'+>8EY``8;`AE#`!:)!@#5 +M!3!`0@`&5B')0P`6B$("W"`<>C!>X`$<5C$$*0+8(!Q^,%?@`1Q1,00I`M@@ +M'((P4.`!'$PQ!"D"V"`&()20AH,$,(8`(@_KUP1P9)@"`(.!@HV"*8,M@`2$!(/GW>OT`(!"]L+4%'`$@^?>+_2!) +M'T@@,=R0$@^?=^_0`@L+V`M?GW7OZ`O1!)``%`&'!' +M@+7Y]Y'^@+T0M00<`2#Y]U[]"4D@`4`8@6@`*0G1P6@`*0;1!4H@,M%HB� +M8,%@@F`!(/GW6/T0O5P4`L!PM0`@BTH`)($``3`**%10^M.(38=)*#V&3B@< +M4#D-810P/#[P8"AAZ6`&(2@=+&`+\';^+6)L808A*!P8,&YB"_!N_G"]@+7_ +M]]K_`2$"(/GW!OUW20$@5#D(<``@@+W.Y_BU%AP$(@4<#!R!'&A&"_"H_@HA +M`)C_][[[,&!M28``"%@@8``H%=`$,`0B*1P+\!K^`"@*T0?@(&`$,`0B*1P+ +M\!'^`"@!T0(@^+T@:`!I`"CQT00@^.=\M08<`"``D%Q(#!Q4.`!X`"@!T0,@ +M?+T"(/GWW/P!JFE&(!S_]\#_!"@$T`(@^???_`4@[^=035!)4#TH:3PYB$(D +MT`0P!B(A'`OP7OXI:0`B#F``F``H"M$`D0AI*&'%8,I@"F$!F$1*@``14`G@ +M`6$I:0EI*6'-8`%IR&``:0"0`F$"(/GWL_P`(,/G`B#Y]Z[\!R"^YWRU!1P` +M(`"0-D@,'%0X`'@`*`'1`R!\O0(@^?>0_`&J:48@'/_W=/\$'`(H!-`"(/GW +MDOP@'.[G`)@I3@!H4#XH8`"8,FDF3=!@,&$!:0`I!=%`5K<[`0```!QQ```` +M`@``XMPZ><-H`"L"T0&;FP`$X`&;FP#L6(1"`='I4`/@PV@`*P#0&6$!:0`I +M`=##:,M@`F'&8`(@^?=H_`$@Q.?XM0(@^?=5_!-/`":U`!?@(&C_]^?^(&C_ +M]^C^(&D`*`+1`"%Y40/@`"'!8"!I>%$)25`Y"&G$8.%@"&D@80QA?%D`+.31 +M`38*+M_3`B#Y]SW\^+T``/`4`L!PM04<`2$Z,`+PJ_D$'"70Z4B`(H-[07L; +M`AE#D4-!.MX&P(80P`H%M`!*`'0`B@1T2@=!1P,\+KZ``<`)@`H +M`=I9(`95*!P,\+'Z0`>`#P'04#1FP&8&P(: +M0PXC6$,`&5LP,1RNX"$.MX&P(80P#@>N``!@`.B'(I>VM[&P(90P`I<=`!*"C1$"(Q'"`<7#`+\/G\ +M.!P,\`KZ@`$+U0@B(!QL,`.9"_#N_`@B(!QT,`29"_#H_#@<#/#Y^4`&4]4% +MF`SP]/F<(0A1!II3>1!Y&P(80Z`T((!&X`(H1-$0(C$<(!Q<,%'@(!Q0,`$A +M07+K>*EX&P(90PD&"0[!<@*1")@,\-3Y`R@!V0`@`>"`!X`/!YD(<2I[:WL; +M`AI#`"HBT`*9`2DJT1`B,1P@''PP"_"I_#@<#/"Z^8`!"]4((B`QL"&$,-*`/1`2&`-.%R`N``((`TX'(`(`NP\+TPM0`I#-"+($!<`"@! +MT0@C`N`!*`31$",`(-P>-DH'X``@,+T+&'`S&WL5&`$PZW"@0O?3`2`PO3"U +M`"D!T0`@,+U8(E):4@0!U`@D`.`0)`XC6$-`&``BXQXG307@@1A0,"#8<9`@&'*@ +M(%AR`""8<@20`Y5IBR`<$#``&T`8$#``"0`!`)`0(B`<`:D+\)[[KHH!/@S@ +M`)@G'"08$"(@'`&I"_"3^R$<##$X'`OPN/P!/O#2*!PL8S^0`M`M`H'!`P<+T`('"]L+4$'`#PS/C@B@`H%=`!.``$``S@ +M@B&+B$(`TB"#)6DH'`PP#/!B^"!A`2#H<:AQ`"T"T"@<$#"PO0`@L+T!'!`Y +M$+4*:%U+6TR:0@/0('@!,"!P">!B:)%"!M.B:)%"`]@*'!`R@D(!T``@$+T( +M'!"]<+7_]^/_!!P(T"`<"#`,\#3X!1P`\(OX`"@!T`$@<+V@>0`H!='GSB*`3#H@@`@H'$P'/GW0_D`('"]L+7_]['_!!P(T"`< +M"#`,\`+X!1P`\%GX`"@!T`$@L+V@>0`H!=$N20PQ"&@!,`A@].?@>?\P``8` +M#N!Q"M$A'`PQ*&D+\/W[+&'HB@$PZ((`(*!Q`""PO1"U__>%_P0<$-`@'`@P +M"_#6_P#P+O@`*`C1^?%Y`"D!T`$QX7'Y]__X$+T0M00<`/`>^``H`=`` +M(!"]((L0O1"U!!P`\!3X`"@!T``@$+W@BA"]$#B">1%#@7%P1Q`X@GF*0X)Q +M<$<0.(!Y"$!P1P5)2FB00@+3B6B(0@'9`2!P1P`@<$<``!@5`L`2-%9X@+4! +M8`$@"?`&^("][TCP20A@<$?XM>Y.@"0@-C<=`"7K2"@P!&`!(`CP]?\]8`$@ +M"/#Q_S5@`2`(\.W__R!!,`$TA$+LT^-(16#_]]__^+WXM0`DA2```=])8$-% +M&(4A"0$H'`OP(/I8(-Q)8$-!&`$@P`(H&$$B4@$!80`AJA@1_#`0````QY`````@`` +M/#WF5%(`B5J)!LL-G$:!`'$82W@*>`$P&P(:0_\C^3.:0V-&&D,*$]X2AP;`A]#&",?0T]P.PJ+<$MX#W@`!AL"'T,"(Y]#?PA_``0CGT,/<#L* +M2W!3>!=X`C$;`A]#@".?0Q=P.PI3<`J(`2/;`YI#``X"*`J`QM-QB`\B$@*1 +M0YL)R1AQ@/&(D4,#(I("B1CQ@"@<"_#>_@0A`7`+"D-P*!P+\-?^`C!#>`9X +M#"$;`AY#CD,$-@9P,PI#<"@<"_#)_O`BED,Q'(`Q@7`+"L-P*!P+\+_^CTD, +M,`8B"6@+\*7Y`30D!B0.""P`TD;G^+V)2@`H&M&`2X`[&&M9:\D%P`7`#``B_S#H +M<")S(6@('"`PPWJ`>AL"&$,'*`;9#"@$TEU)"&@!,`A@$.`D,0`@"_!D^B%H +M"2`@,8AR`PK+$-$&$$@0`$F&#![`"@=T#@<__>K_P$G_P(`(3%SX!F!8@%I#APD-C`<"_`3 +M_D`(0``Q'`OP)/H`(``A(A@!,``&TAD`#@8H$7+WTR@<^/`$"E`(`!+-S1]DL: +M8QH](06@!(E('$4-!8.U) +M`2`(8,'GZ4I`.M%H`"@'T0$@P`6!0]%@$&A`"$``!^`!*`;1P`:!0]%@$&@" +M(8A#$&!P1X4C&P'?25A#0!A!(4D!0!C`>``H`=`!('!'`"!P1_>UA+`-'/CW +M>?[52@`A$6`&F84C&P'32EE#CAA!(4D!=!@A>P`I#-$!)R=S!ID`D?CW:?X` +MF0@I!M'\.?81`0````1]`````@``T2V&F0`@P$,'L/"]^/=@_OCG@R```3`8 +M`Y`'<@`@`"$#Q@/&`2')`A`^=Q@"EWA@.&`!(&!S$#%Q&``@"''X8;AAX'!@ +M<2@<##`+\`O]('$`F"D`IX +M``<;`AI#$@D2`0`/$$,(<`,*2W!H?@:9A2,;`:A*64.*&"$AB0&`!X`/41@# +M*`'1&"`(X`(H`=$/(`3@`2@!T0@@`.`$(`AS`9@`(0'PJ/L`*`+00'L#F4AR +M.!T$'`OPR/P@,$-X`7@$(AL"&4,10P%P"PI#<`*9`""(8CD<)#$*(`OPS/@@ +M'`OPL_P&,`8B`9D*\)K_[7T@'`OPJOPA,$-X`7CP(AL"&4.10RH'$@X10P%P +M"PI#<`"8;.?XM7Q-`"88/2P<*#P@:``I(-$!)S\'.$,@8`$@"/``_2!HN$,@ +M8`$@"/#Z_/\@"3`H8`$@"/#T_"@?!F`!(`CP[_QL2"`X!F`!(`CPZ?QI2,`X +M(.`!)W\'.$,@8`$@"/#?_"!HN$,@8`$@"/#9_/\@"C`H8`$@"/#3_%Y('#@& +M8`$@"/#-_%M((#@&8`$@"/#'_%A(0#`&8EQ)06(!(`CPO_SXO0`@<$=P1W!' +M<$W$8"WH"'"`RG4(DT4-[3'JC0B#1@WN,>J-"'-'#>\QZHT(8T0-\ +M#'NC0A310WQ)>XM"$-&3>%%X&P(90Y)+"08@,_,8G'@)#Z%"!-$9>P`I`=`' +M(37@`"&%(QL!ATQ+0QP9`2/;`N,8'GJU0B+11GM?>KY"'M&&>Y]ZOD(:T<9[ +MWWJ^0A;1!GP?>[Y"$M%&?%M[GD(.T9-X5G@;`AY#,P9!)G8!I!FF>!L/LT(" +MT2-[`"L$T0$Q"08)#@@IS-,(*1[0A2,;`5E#;$X!).0"B1D,&0`CHV+3>))X +M020;`AI#$@ED`0L9VH(`(H,8C1@@,QMY`3(2!BT9$@X(*JMS]-/PO?.UA;`, +M'/CW@OL!D(4@``%@0UE)`I0%G4$8`"0$-0.1*!P+\$/Z`!F`>0.9`2+2`@D9 +MB1@)>HA"-]$!-"0&)`[?Z6'L`0```/B"`````@``5OU=Z@8L[=-!(`.90`$/ +M&#A[`"@KT'UY`YP`)B@!`!D`>P`H&=$H`009`2`@P\+T!-6@&0`YX<0$@`YG``@@8`6@`*0'1!&`!X$%H +M3&!$8/AX`3#X<'A[`2@%T0*`%X#R(;`AE#$4`R`1%#`7`+"D-P(&D'<"%I`"!(<"%IB'#(<"%I$#$* +M\+[](&D$,`OPI/D#,`%X0W@((AL"&4.10PG@X*H`@+R``0`("```2!4"P#!" +M```!<`L*0W`A:20Q"R`*\*#](6D/'!PW.!P+\(3Y`2%)`PA#.1P*\)3](6D! +M(APQ$@,00PKPC?T@:2@P0W@!>!L"&4-)"$D``7`+"D-P_R/Y,YE#"!PB:2@P +M*#(0<`,*4W`@:2DP`.`.X$-X`7@8(AL"&4,10P%P"PI#<*EY(&D%\-?]`"@! +MT0`@^+VH>?!)@``*6K)"!=%`&`(P`H@!,@*`!>`.4JAY`"*``$`80H"H>>A+ +M@@`;8+T'`0```/2$`````@``3P6#FE(84H@;:)I""MGF2A!P`2#E2H`"T&*J +M>0`@D@!1&$B``2#B2:!B2&@!,$A@`2#1Y_&UB+`(F$$A20%`&`>0P(H(F@`F +M`Y`('"`X%1@L:``@!I`%D`B8!9E`&$$A20%`&(![`9``(`20`9C`!VG5`Y@& +MF4`8`04)#0*1`"QAT"!H!#`+\/7X0WX`?@*9&P(80P`)"!H!(0D#0!C!%PD- +M"1@)$PD#0!H`!``,0"A)V"!H`"<$,`OPW/A#?@!^`ID;`AA#``F(0CW1`"(B +MS^R!H`"(P,,)PZ&D!,.AA`>`)X"8<9&@`+P/0`"`X8'A@ +M`>``+*K1!)@&F0$P``8`#@20`9@!,4`(`9`)!@D.!)@&D0@H`-)VYP69`3$) +M!@D.!9$'*0#89.>!(0B:"0%1&``@"'$'F(^0:0$IB%(QL!>DE80T$8!9$`(0`D`)0! +MD4$@!9E``0\8.'L`*`71!ICX]W?Y`"`3L/"]`2`%F<`""1@0]0QC`0```/"& +M`````@``N^T])Q&1#F@`+@G0,&@$,`OP,OA#?@!^&P(80P$)!)$`(0*1!9F# +M(``!"!@0D!*8!R$``0A##Y`A(`69@`$)&!*8+",.D5Y)6$-!&`V174D,D6GA +M,&@$'`0A__=C^``H"]%221*8"'`!(%%)@`+(8E5)2&@!,$A@D^`0F`!Z`2AR +MT0`E(!T+D`N8"O#U_T`9@'D%F0$BT@))&8D8"7J(0@?00DG_(`AP04E0",AB +M`2$!D0$U+08M#@8MY=,!F0`I;]$!("!P`"!@<"$<)#$/F`KPZ/MP:``H)]`` +M:`4`$Q&P(80XA"N'D'TBM) +M@``4,4`8`6@!,0%@">`G28``%#$*6`0J`=D!(@"2`"(*4`Z9"'L"F8A"#M!P +M:``H"]``F@`J"-$#F`290!H`(4`8``4`#4`H!M,-F0$@B&$!(0&1#ID(<`N8 +M"O")_P#@UN"!>,-X&P(90PH'D@\"*@;1"08)#P@I`M&`><`'(=4`(#(A"%4A +M'`H@(#&(<@,*RW(@'/[W+_^VX,3@?!@"P,`F`,!P1`$```P`@$@5`L`H9`'` +MO(`!`"AS`L!,30#`)!4"P"4<(#4I>FMZ&P(90PJ1R`&L`0```.R(`````@``?/0_>LAB +MY4F(:`$PB&"0X`J9`2(10RER"PIKBAZ&P(80Y!#8#`H +M<@,*:W(@'#`P!Y#`>``H']`$*!/2N'F_28``"%@`*`W00'L$\"#X(1PL,0KP +M]OH!>",<(#,93^`'@`2!X:%(QL!DDI80X`8(2*2`0`A@!@!<'!' +M<$>%(QL!6D.,2S"UTQ@!(M("FA@$>!5ZK$(>T41X57JL0AK1A'B5>JQ"%M'$ +M>-5ZK$(2T01Y%7NL0@[10'E2>Y!""M%!($`!&!B">(I"!-$`>P`H`=`!(#"] +M`"`PO1"U!!P`((`L*=-A!`/5!R#_]_/]`2`A!@/5`"#_]^W]`2#A!0/5`2#_ +M]^?]`2"A!0/5`B"TW?OL`0```.B*`````@``B!R!Q__WX?T!(&$%`]4#(/_W +MV_T!("$%`]4$(/_WU?T!(.$$`-4!(*$$`-4!(!"]^+4,'!4<]_=4_P8/\QP7`A:`@<(###>H!Z +M&P(80P Author: bz Date: Mon Jun 1 18:07:38 2009 New Revision: 193241 URL: http://svn.freebsd.org/changeset/base/193241 Log: Decrement __FreeBSD_version again to 96 as we are runing out of digits and want to be conservative - so not more than one version bump per day. Discussed with: jhb, kensmith Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 18:07:01 2009 (r193240) +++ head/UPDATING Mon Jun 1 18:07:38 2009 (r193241) @@ -26,7 +26,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. The way we are storing and accessing `routing table' entries has changed. Programs reading the FIB, like netstat, need to be re-compiled. - Bump __FreeBSD_version to 800097. 20090601: A new netisr implementation has been added for FreeBSD 8. Network Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jun 1 18:07:01 2009 (r193240) +++ head/sys/sys/param.h Mon Jun 1 18:07:38 2009 (r193241) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ +#define __FreeBSD_version 800096 /* Master, propagated to newvers */ #ifndef LOCORE #include From kensmith at cse.Buffalo.EDU Mon Jun 1 18:15:47 2009 From: kensmith at cse.Buffalo.EDU (Ken Smith) Date: Mon Jun 1 18:16:13 2009 Subject: svn commit: r193241 - in head: . sys/sys In-Reply-To: <200906011807.n51I7ccW086812@svn.freebsd.org> References: <200906011807.n51I7ccW086812@svn.freebsd.org> Message-ID: <1243880140.25229.23.camel@bauer.cse.buffalo.edu> On Mon, 2009-06-01 at 18:07 +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Jun 1 18:07:38 2009 > New Revision: 193241 > URL: http://svn.freebsd.org/changeset/base/193241 > > Log: > Decrement __FreeBSD_version again to 96 as we are runing out of digits > and want to be conservative - so not more than one version bump per day. > > Discussed with: jhb, kensmith > > Modified: > head/UPDATING > head/sys/sys/param.h > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Mon Jun 1 18:07:01 2009 (r193240) > +++ head/UPDATING Mon Jun 1 18:07:38 2009 (r193241) > @@ -26,7 +26,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. > The way we are storing and accessing `routing table' entries > has changed. Programs reading the FIB, like netstat, need to > be re-compiled. > - Bump __FreeBSD_version to 800097. > > 20090601: > A new netisr implementation has been added for FreeBSD 8. Network > > Modified: head/sys/sys/param.h > ============================================================================== > --- head/sys/sys/param.h Mon Jun 1 18:07:01 2009 (r193240) > +++ head/sys/sys/param.h Mon Jun 1 18:07:38 2009 (r193241) > @@ -57,7 +57,7 @@ > * is created, otherwise 1. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ > +#define __FreeBSD_version 800096 /* Master, propagated to newvers */ > > #ifndef LOCORE > #include It was noted we're close to running out of numbers we can use before we hit code freeze and the branch for the release. Since we're entering code slush at the end of today in theory all changes that would warrant a bump in __FreeBSD_version are supposed to be done. But it wouldn't surprise me if we have one or two or so things that come along between now and when we hit code freeze and the branch. So we need to be a bit conservative with this. Please be sure to coordinate anything that might require a bump in __FreeBSD_version with re@ from now on. If it turns out things do come along that require bumps we'll need to "batch them up" having one bump represent several changes. Thanks. -- Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: This is a digitally signed message part Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090601/e5c8a78a/attachment-0001.pgp From imp at bsdimp.com Mon Jun 1 18:23:43 2009 From: imp at bsdimp.com (M. Warner Losh) Date: Mon Jun 1 18:23:54 2009 Subject: svn commit: r193223 - head/bin/sh In-Reply-To: <86vdnfq1t3.fsf@ds4.des.no> References: <200906011111.n51BBkZt077175@svn.freebsd.org> <20090601.104358.-345495454.imp@bsdimp.com> <86vdnfq1t3.fsf@ds4.des.no> Message-ID: <20090601.122054.1585999559.imp@bsdimp.com> In message: <86vdnfq1t3.fsf@ds4.des.no> Dag-Erling_Sm?rgrav writes: : "M. Warner Losh" writes: : > : @@ -187,7 +187,8 @@ padvance(char **path, char *name) : > : if (*path == NULL) : > : return NULL; : > : start = *path; : > : - for (p = start ; *p && *p != ':' && *p != '%' ; p++); : > : + for (p = start; *p && *p != ':' && *p != '%'; p++) : > : + ; /* nothing */ : > : > C already has a way of saying this: : > : > for (p = start; *p && *p != ':' && *p != '%'; p++) : > continue; : : It's a matter of taste. There is plenty of precedent for : : /* nothing */ ; : : and some for : : ; /* nothing */ : : (for varying spellings of "nothing") in the tree. True. I had some experience with early static analysis tools preferred the continue form because for them it was clear that you indented to do nothing. I suppose that the state of the art has progressed since then (this was like mid 1990's). Warner From sam at FreeBSD.org Mon Jun 1 18:27:17 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Mon Jun 1 18:27:31 2009 Subject: svn commit: r193242 - in head/tools/tools: . mwl mwl/mwldebug mwl/mwlstats Message-ID: <200906011827.n51IRGZl087328@svn.freebsd.org> Author: sam Date: Mon Jun 1 18:27:16 2009 New Revision: 193242 URL: http://svn.freebsd.org/changeset/base/193242 Log: tools for mwl driver Added: head/tools/tools/mwl/ head/tools/tools/mwl/Makefile (contents, props changed) head/tools/tools/mwl/mwldebug/ head/tools/tools/mwl/mwldebug/Makefile (contents, props changed) head/tools/tools/mwl/mwldebug/mwldebug.c (contents, props changed) head/tools/tools/mwl/mwlstats/ head/tools/tools/mwl/mwlstats/Makefile (contents, props changed) head/tools/tools/mwl/mwlstats/main.c (contents, props changed) head/tools/tools/mwl/mwlstats/mwlstats.c (contents, props changed) head/tools/tools/mwl/mwlstats/mwlstats.h (contents, props changed) head/tools/tools/mwl/mwlstats/statfoo.c (contents, props changed) head/tools/tools/mwl/mwlstats/statfoo.h (contents, props changed) Modified: head/tools/tools/README Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Mon Jun 1 18:07:38 2009 (r193241) +++ head/tools/tools/README Mon Jun 1 18:27:16 2009 (r193242) @@ -46,6 +46,7 @@ mctest A multicast test program mfc Merge a directory from HEAD to a branch where it does not already exist and other MFC related script(s). mid Create a Message-ID database for mailing lists. +mwl Tools specific to the Marvell 88W8363 support ncpus Count the number of processors npe Tools specific to the Intel IXP4XXX NPE device nxge A diagnostic tool for the nxge(4) driver Added: head/tools/tools/mwl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/Makefile Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= mwlstats mwldebug + +.include Added: head/tools/tools/mwl/mwldebug/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwldebug/Makefile Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= mwldebug +BINDIR= /usr/local/bin +NO_MAN= + +.include Added: head/tools/tools/mwl/mwldebug/mwldebug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwldebug/mwldebug.c Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,212 @@ +/*- + * Copyright (c) 2007 Sam Leffler, Errno Consulting + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +/* + * mwldebug [-i interface] flags + * (default interface is mwl0). + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define N(a) (sizeof(a)/sizeof(a[0])) + +const char *progname; + +enum { + MWL_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ + MWL_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ + MWL_DEBUG_RECV = 0x00000004, /* basic recv operation */ + MWL_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ + MWL_DEBUG_RESET = 0x00000010, /* reset processing */ + MWL_DEBUG_BEACON = 0x00000020, /* beacon handling */ + MWL_DEBUG_INTR = 0x00000040, /* ISR */ + MWL_DEBUG_TX_PROC = 0x00000080, /* tx ISR proc */ + MWL_DEBUG_RX_PROC = 0x00000100, /* rx ISR proc */ + MWL_DEBUG_KEYCACHE = 0x00000200, /* key cache management */ + MWL_DEBUG_STATE = 0x00000400, /* 802.11 state transitions */ + MWL_DEBUG_NODE = 0x00000800, /* node management */ + MWL_DEBUG_RECV_ALL = 0x00001000, /* trace all frames (beacons) */ + MWL_DEBUG_TSO = 0x00002000, /* TSO processing */ + MWL_DEBUG_AMPDU = 0x00004000, /* BA stream handling */ + MWL_DEBUG_ANY = 0xffffffff +}; + +static struct { + const char *name; + u_int bit; +} flags[] = { + { "xmit", MWL_DEBUG_XMIT }, + { "xmit_desc", MWL_DEBUG_XMIT_DESC }, + { "recv", MWL_DEBUG_RECV }, + { "recv_desc", MWL_DEBUG_RECV_DESC }, + { "reset", MWL_DEBUG_RESET }, + { "beacon", MWL_DEBUG_BEACON }, + { "intr", MWL_DEBUG_INTR }, + { "xmit_proc", MWL_DEBUG_TX_PROC }, + { "recv_proc", MWL_DEBUG_RX_PROC }, + { "keycache", MWL_DEBUG_KEYCACHE }, + { "state", MWL_DEBUG_STATE }, + { "node", MWL_DEBUG_NODE }, + { "recv_all", MWL_DEBUG_RECV_ALL }, + { "tso", MWL_DEBUG_TSO }, + { "ampdu", MWL_DEBUG_AMPDU }, + /* XXX these are a hack; there should be a separate sysctl knob */ + { "hal", 0x02000000 }, /* cmd-completion processing */ + { "hal2", 0x01000000 }, /* cmd submission processing */ + { "halhang", 0x04000000 }, /* disable fw hang stuff */ +}; + +static u_int +getflag(const char *name, int len) +{ + int i; + + for (i = 0; i < N(flags); i++) + if (strncasecmp(flags[i].name, name, len) == 0) + return flags[i].bit; + return 0; +} + +#if 0 +static const char * +getflagname(u_int flag) +{ + int i; + + for (i = 0; i < N(flags); i++) + if (flags[i].bit == flag) + return flags[i].name; + return "???"; +} +#endif + +static void +usage(void) +{ + int i; + + fprintf(stderr, "usage: %s [-i device] [flags]\n", progname); + fprintf(stderr, "where flags are:\n"); + for (i = 0; i < N(flags); i++) + printf("%s\n", flags[i].name); + exit(-1); +} + +int +main(int argc, char *argv[]) +{ + const char *ifname = "mwl0"; + const char *cp, *tp; + const char *sep; + int c, op, i; + u_int32_t debug, ndebug; + size_t debuglen; + char oid[256]; + + progname = argv[0]; + if (argc > 1) { + if (strcmp(argv[1], "-i") == 0) { + if (argc < 2) + errx(1, "missing interface name for -i option"); + ifname = argv[2]; + if (strncmp(ifname, "mv", 2) != 0) + errx(2, "huh, this is for mv devices?"); + argc -= 2, argv += 2; + } else if (strcmp(argv[1], "-?") == 0) + usage(); + } + + snprintf(oid, sizeof(oid), "dev.mwl.%s.debug", ifname+3); + debuglen = sizeof(debug); + if (sysctlbyname(oid, &debug, &debuglen, NULL, 0) < 0) + err(1, "sysctl-get(%s)", oid); + ndebug = debug; + for (; argc > 1; argc--, argv++) { + cp = argv[1]; + do { + u_int bit; + + if (*cp == '-') { + cp++; + op = -1; + } else if (*cp == '+') { + cp++; + op = 1; + } else + op = 0; + for (tp = cp; *tp != '\0' && *tp != '+' && *tp != '-';) + tp++; + bit = getflag(cp, tp-cp); + if (op < 0) + ndebug &= ~bit; + else if (op > 0) + ndebug |= bit; + else { + if (bit == 0) { + c = *cp; + if (isdigit(c)) + bit = strtoul(cp, NULL, 0); + else + errx(1, "unknown flag %.*s", + (int)(tp-cp), cp); + } + ndebug = bit; + } + } while (*(cp = tp) != '\0'); + } + if (debug != ndebug) { + printf("%s: 0x%x => ", oid, debug); + if (sysctlbyname(oid, NULL, NULL, &ndebug, sizeof(ndebug)) < 0) + err(1, "sysctl-set(%s)", oid); + printf("0x%x", ndebug); + debug = ndebug; + } else + printf("%s: 0x%x", oid, debug); + sep = "<"; + for (i = 0; i < N(flags); i++) + if (debug & flags[i].bit) { + printf("%s%s", sep, flags[i].name); + sep = ","; + } + printf("%s\n", *sep != '<' ? ">" : ""); + return 0; +} Added: head/tools/tools/mwl/mwlstats/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/Makefile Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +PROG= mwlstats +BINDIR= /usr/local/bin +NO_MAN= + +SRCS= main.c statfoo.c mwlstats.c + +.include + +CFLAGS+= -I. Added: head/tools/tools/mwl/mwlstats/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/main.c Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 2006 Sam Leffler, Errno Consulting + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +/* + * Simple Marvell-specific tool to inspect and monitor network traffic + * statistics. + * + * mwlstats [-i interface] [-l] [-o fmtstring] [interval] + * + * (default interface is mv0). If interval is specified a rolling output + * a la netstat -i is displayed every interval seconds. The format of + * the rolling display can be controlled a la ps. The -l option will + * print a list of all possible statistics for use with the -o option. + */ + +#include +#include +#include +#include +#include + +#include "mwlstats.h" + +#define S_DEFAULT \ + "input,output,txtry,txretry,txmretry,txdoneput,rxfcs,rxcrypt,rxicv,rssi,rate" + +static int signalled; + +static void +catchalarm(int signo __unused) +{ + signalled = 1; +} + +int +main(int argc, char *argv[]) +{ + struct mwlstatfoo *wf; + int c; + + wf = mwlstats_new("mwl0", S_DEFAULT); + while ((c = getopt(argc, argv, "i:lo:")) != -1) { + switch (c) { + case 'i': + wf->setifname(wf, optarg); + break; + case 'l': + wf->print_fields(wf, stdout); + return 0; + case 'o': + wf->setfmt(wf, optarg); + break; + default: + errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [interval]\n", argv[0]); + /*NOTREACHED*/ + } + } + argc -= optind; + argv += optind; + + if (argc > 0) { + u_long interval = strtoul(argv[0], NULL, 0); + int line, omask; + + if (interval < 1) + interval = 1; + signal(SIGALRM, catchalarm); + signalled = 0; + alarm(interval); + banner: + wf->print_header(wf, stdout); + line = 0; + loop: + if (line != 0) { + wf->collect_cur(wf); + wf->print_current(wf, stdout); + wf->update_tot(wf); + } else { + wf->collect_tot(wf); + wf->print_total(wf, stdout); + } + fflush(stdout); + omask = sigblock(sigmask(SIGALRM)); + if (!signalled) + sigpause(0); + sigsetmask(omask); + signalled = 0; + alarm(interval); + line++; + if (line == 21) /* XXX tty line count */ + goto banner; + else + goto loop; + /*NOTREACHED*/ + } else { + wf->collect_tot(wf); + wf->print_verbose(wf, stdout); + } + return 0; +} Added: head/tools/tools/mwl/mwlstats/mwlstats.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/mwlstats.c Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,578 @@ +/*- + * Copyright (c) 2007 Sam Leffler, Errno Consulting + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +/* + * mwl statistics class. + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../../sys/net80211/ieee80211_ioctl.h" +#include "../../sys/net80211/ieee80211_radiotap.h" + +/* + * Get Hardware Statistics. + */ +struct mwl_hal_hwstats { + uint32_t TxRetrySuccesses; + uint32_t TxMultipleRetrySuccesses; + uint32_t TxFailures; + uint32_t RTSSuccesses; + uint32_t RTSFailures; + uint32_t AckFailures; + uint32_t RxDuplicateFrames; + uint32_t FCSErrorCount; + uint32_t TxWatchDogTimeouts; + uint32_t RxOverflows; + uint32_t RxFragErrors; + uint32_t RxMemErrors; + uint32_t PointerErrors; + uint32_t TxUnderflows; + uint32_t TxDone; + uint32_t TxDoneBufTryPut; + uint32_t TxDoneBufPut; + uint32_t Wait4TxBuf; + uint32_t TxAttempts; + uint32_t TxSuccesses; + uint32_t TxFragments; + uint32_t TxMulticasts; + uint32_t RxNonCtlPkts; + uint32_t RxMulticasts; + uint32_t RxUndecryptableFrames; + uint32_t RxICVErrors; + uint32_t RxExcludedFrames; +}; +#include "../../../../sys/dev/mwl/if_mwlioctl.h" + +#include "mwlstats.h" + +#define AFTER(prev) ((prev)+1) + +static const struct fmt mwlstats[] = { +#define S_INPUT 0 + { 8, "input", "input", "total frames received" }, +#define S_RX_MCAST AFTER(S_INPUT) + { 7, "rxmcast", "rxmcast", "rx multicast frames" }, +#define S_RX_NONCTL AFTER(S_RX_MCAST) + { 8, "rxnonctl", "rxnonctl" "rx non control frames" }, +#define S_RX_MGT AFTER(S_RX_NONCTL) + { 5, "rxmgt", "rxmgt", "rx management frames" }, +#define S_RX_CTL AFTER(S_RX_MGT) + { 5, "rxctl", "rxctl", "rx control frames" }, +#define S_OUTPUT AFTER(S_RX_CTL) + { 8, "output", "output", "total frames transmit" }, +#define S_TX_MCAST AFTER(S_OUTPUT) + { 7, "txmcast", "txmcast", "tx multicast frames" }, +#define S_TX_MGMT AFTER(S_TX_MCAST) + { 5, "txmgt", "txmgt", "tx management frames" }, +#define S_TX_RETRY AFTER(S_TX_MGMT) + { 7, "txretry", "txretry", "tx success with 1 retry" }, +#define S_TX_MRETRY AFTER(S_TX_RETRY) + { 8, "txmretry", "txmretry", "tx success with >1 retry" }, +#define S_TX_RTSGOOD AFTER(S_TX_MRETRY) + { 7, "rtsgood", "rtsgood", "RTS tx success" }, +#define S_TX_RTSBAD AFTER(S_TX_RTSGOOD) + { 6, "rtsbad", "rtsbad", "RTS tx failed" }, +#define S_TX_NOACK AFTER(S_TX_RTSBAD) + { 5, "noack", "noack", "tx failed because no ACK was received" }, +#define S_RX_DUPLICATE AFTER(S_TX_NOACK) + { 5, "rxdup", "rxdup", "rx discarded by f/w as dup" }, +#define S_RX_FCS AFTER(S_RX_DUPLICATE) + { 5, "rxfcs", "rxfcs", "rx discarded by f/w for bad FCS" }, +#define S_TX_WATCHDOG AFTER(S_RX_FCS) + { 7, "txwatch", "txwatch", "MAC tx hang (f/w recovery)" }, +#define S_RX_OVERFLOW AFTER(S_TX_WATCHDOG) + { 6, "rxover", "rxover", "no f/w buffer for rx" }, +#define S_RX_FRAGERROR AFTER(S_RX_OVERFLOW) + { 6, "rxfrag", "rxfrag", "rx failed in f/w due to defrag" }, +#define S_RX_MEMERROR AFTER(S_RX_FRAGERROR) + { 5, "rxmem", "rxmem", "rx failed in f/w 'cuz out of of memory" }, +#define S_PTRERROR AFTER(S_RX_MEMERROR) + { 6, "badptr", "badptr", "MAC internal pointer problem" }, +#define S_TX_UNDERFLOW AFTER(S_PTRERROR) + { 7, "txunder", "txunder", "tx failed in f/w 'cuz of underflow" }, +#define S_TX_DONE AFTER(S_TX_UNDERFLOW) + { 6, "txdone", "txdone", "MAC tx ops completed" }, +#define S_TX_DONEBUFPUT AFTER(S_TX_DONE) + { 9, "txdoneput", "txdoneput", "tx buffers returned by f/w to host" }, +#define S_TX_WAIT4BUF AFTER(S_TX_DONEBUFPUT) + { 6, "txwait", "txwait", "no f/w buffers available when supplied a tx descriptor" }, +#define S_TX_ATTEMPTS AFTER(S_TX_WAIT4BUF) + { 5, "txtry", "txtry", "tx descriptors processed by f/w" }, +#define S_TX_SUCCESS AFTER(S_TX_ATTEMPTS) + { 4, "txok", "txok", "tx attempts successful" }, +#define S_TX_FRAGS AFTER(S_TX_SUCCESS) + { 6, "txfrag", "txfrag", "tx attempts with fragmentation" }, +#define S_RX_UNDECRYPT AFTER(S_TX_FRAGS) + { 7, "rxcrypt", "rxcrypt", "rx failed in f/w 'cuz decrypt failed" }, +#define S_RX_ICVERROR AFTER(S_RX_UNDECRYPT) + { 5, "rxicv", "rxicv", "rx failed in f/w 'cuz ICV check" }, +#define S_RX_EXCLUDE AFTER(S_RX_ICVERROR) + { 8, "rxfilter", "rxfilter", "rx frames filtered in f/w" }, +#define S_TX_LINEAR AFTER(S_RX_EXCLUDE) + { 5, "txlinear", "txlinear", "tx linearized to cluster" }, +#define S_TX_DISCARD AFTER(S_TX_LINEAR) + { 5, "txdisc", "txdisc", "tx frames discarded prior to association" }, +#define S_TX_QSTOP AFTER(S_TX_DISCARD) + { 5, "qstop", "qstop", "tx stopped 'cuz no xmit buffer" }, +#define S_TX_ENCAP AFTER(S_TX_QSTOP) + { 5, "txencode", "txencode", "tx encapsulation failed" }, +#define S_TX_NOMBUF AFTER(S_TX_ENCAP) + { 5, "txnombuf", "txnombuf", "tx failed 'cuz mbuf allocation failed" }, +#define S_TX_SHORTPRE AFTER(S_TX_NOMBUF) + { 5, "shpre", "shpre", "tx frames with short preamble" }, +#define S_TX_NOHEADROOM AFTER(S_TX_SHORTPRE) + { 5, "nohead", "nohead", "tx frames discarded for lack of headroom" }, +#define S_TX_BADFRAMETYPE AFTER(S_TX_NOHEADROOM) + { 5, "badtxtype", "badtxtype", "tx frames discarded for invalid/unknown 802.11 frame type" }, +#define S_RX_CRYPTO_ERR AFTER(S_TX_BADFRAMETYPE) + { 5, "crypt", "crypt", "rx failed 'cuz decryption" }, +#define S_RX_NOMBUF AFTER(S_RX_CRYPTO_ERR) + { 5, "rxnombuf", "rxnombuf", "rx setup failed 'cuz no mbuf" }, +#define S_RX_TKIPMIC AFTER(S_RX_NOMBUF) + { 5, "rxtkipmic", "rxtkipmic", "rx failed 'cuz TKIP MIC error" }, +#define S_RX_NODMABUF AFTER(S_RX_TKIPMIC) + { 5, "rxnodmabuf", "rxnodmabuf", "rx failed 'cuz no DMA buffer available" }, +#define S_RX_DMABUFMISSING AFTER(S_RX_NODMABUF) + { 5, "rxdmabufmissing", "rxdmabufmissing", "rx descriptor with no DMA buffer attached" }, +#define S_TX_NODATA AFTER(S_RX_DMABUFMISSING) + { 5, "txnodata", "txnodata", "tx discarded empty frame" }, +#define S_TX_BUSDMA AFTER(S_TX_NODATA) + { 5, "txbusdma", "txbusdma", "tx failed for dma resources" }, +#define S_RX_BUSDMA AFTER(S_TX_BUSDMA) + { 5, "rxbusdma", "rxbusdma", "rx setup failed for dma resources" }, +#define S_AMPDU_NOSTREAM AFTER(S_RX_BUSDMA) + { 5, "ampdu_nostream","ampdu_nostream","ADDBA request failed 'cuz all BA streams in use" }, +#define S_AMPDU_REJECT AFTER(S_AMPDU_NOSTREAM) + { 5, "ampdu_reject","ampdu_reject","ADDBA request failed 'cuz station already has one BA stream" }, +#define S_ADDBA_NOSTREAM AFTER(S_AMPDU_REJECT) + { 5, "addba_nostream","addba_nostream","ADDBA response processed but no BA stream present" }, +#define S_TX_TSO AFTER(S_ADDBA_NOSTREAM) + { 8, "txtso", "tso", "tx frames using TSO" }, +#define S_TSO_BADETH AFTER(S_TX_TSO) + { 5, "tsoeth", "tsoeth", "TSO failed 'cuz ether header type not IPv4" }, +#define S_TSO_NOHDR AFTER(S_TSO_BADETH) + { 5, "tsonohdr", "tsonohdr", "TSO failed 'cuz header not in first mbuf" }, +#define S_TSO_BADSPLIT AFTER(S_TSO_NOHDR) + { 5, "tsobadsplit", "tsobadsplit", "TSO failed 'cuz payload split failed" }, +#define S_BAWATCHDOG AFTER(S_TSO_BADSPLIT) + { 5, "bawatchdog", "bawatchdog", "BA watchdog interrupts" }, +#define S_BAWATCHDOG_NOTFOUND AFTER(S_BAWATCHDOG) + { 5, "bawatchdog_notfound", "bawatchdog_notfound", + "BA watchdog for unknown stream" }, +#define S_BAWATCHDOG_EMPTY AFTER(S_BAWATCHDOG_NOTFOUND) + { 5, "bawatchdog_empty", "bawatchdog_empty", + "BA watchdog on all streams but none found" }, +#define S_BAWATCHDOG_FAILED AFTER(S_BAWATCHDOG_EMPTY) + { 5, "bawatchdog_failed", "bawatchdog_failed", + "BA watchdog processing failed to get bitmap from f/w" }, +#define S_RADARDETECT AFTER(S_BAWATCHDOG_FAILED) + { 5, "radardetect", "radardetect", "radar detect interrupts" }, +#define S_RATE AFTER(S_RADARDETECT) + { 4, "rate", "rate", "rate of last transmit" }, +#define S_TX_RSSI AFTER(S_RATE) + { 4, "arssi", "arssi", "rssi of last ack" }, +#define S_RX_RSSI AFTER(S_TX_RSSI) + { 4, "rssi", "rssi", "avg recv rssi" }, +#define S_RX_NOISE AFTER(S_RX_RSSI) + { 5, "noise", "noise", "rx noise floor" }, +#define S_TX_SIGNAL AFTER(S_RX_NOISE) + { 4, "asignal", "asig", "signal of last ack (dBm)" }, +#define S_RX_SIGNAL AFTER(S_TX_SIGNAL) + { 4, "signal", "sig", "avg recv signal (dBm)" }, +#define S_ANT_TX0 AFTER(S_RX_SIGNAL) + { 8, "tx0", "ant0(tx)", "frames tx on antenna 0" }, +#define S_ANT_TX1 (S_RX_SIGNAL+2) + { 8, "tx1", "ant1(tx)", "frames tx on antenna 1" }, +#define S_ANT_TX2 (S_RX_SIGNAL+3) + { 8, "tx2", "ant2(tx)", "frames tx on antenna 2" }, +#define S_ANT_TX3 (S_RX_SIGNAL+4) + { 8, "tx3", "ant3(tx)", "frames tx on antenna 3" }, +#define S_ANT_RX0 AFTER(S_ANT_TX3) + { 8, "rx0", "ant0(rx)", "frames rx on antenna 0" }, +#define S_ANT_RX1 (S_ANT_TX3+2) + { 8, "rx1", "ant1(rx)", "frames rx on antenna 1" }, +#define S_ANT_RX2 (S_ANT_TX3+3) + { 8, "rx2", "ant2(rx)", "frames rx on antenna 2" }, +#define S_ANT_RX3 (S_ANT_TX3+4) + { 8, "rx3", "ant3(rx)", "frames rx on antenna 3" }, +}; +/* NB: this intentionally avoids per-antenna stats */ +#define S_LAST (S_RX_SIGNAL+1) + +struct mwlstatfoo_p { + struct mwlstatfoo base; + int s; + struct ifreq ifr; + struct mwl_stats cur; + struct mwl_stats total; +}; + +static void +mwl_setifname(struct mwlstatfoo *wf0, const char *ifname) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) wf0; + + strncpy(wf->ifr.ifr_name, ifname, sizeof (wf->ifr.ifr_name)); +} + +static void +mwl_collect(struct mwlstatfoo_p *wf, struct mwl_stats *stats) +{ + wf->ifr.ifr_data = (caddr_t) stats; + if (ioctl(wf->s, SIOCGMVSTATS, &wf->ifr) < 0) + err(1, wf->ifr.ifr_name); +} + +static void +mwl_collect_cur(struct statfoo *sf) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + + mwl_collect(wf, &wf->cur); +} + +static void +mwl_collect_tot(struct statfoo *sf) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + + mwl_collect(wf, &wf->total); +} + +static void +mwl_update_tot(struct statfoo *sf) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + + wf->total = wf->cur; +} + +static void +setrate(char b[], size_t bs, uint8_t rate) +{ + if (rate & IEEE80211_RATE_MCS) + snprintf(b, bs, "MCS%u", rate & IEEE80211_RATE_VAL); + else if (rate & 1) + snprintf(b, bs, "%u.5M", rate / 2); + else + snprintf(b, bs, "%uM", rate / 2); +} + +static int +mwl_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; +#define STAT(x) \ + snprintf(b, bs, "%u", wf->cur.mst_##x - wf->total.mst_##x); return 1 +#define HWSTAT(x) \ + snprintf(b, bs, "%u", wf->cur.hw_stats.x - wf->total.hw_stats.x); return 1 +#define RXANT(x) \ + snprintf(b, bs, "%u", wf->cur.mst_ant_rx[x] - wf->total.mst_ant_rx[x]); return 1 +#define TXANT(x) \ + snprintf(b, bs, "%u", wf->cur.mst_ant_tx[x] - wf->total.mst_ant_tx[x]); return 1 + + switch (s) { + case S_INPUT: + snprintf(b, bs, "%lu", (u_long)( + (wf->cur.mst_rx_packets - wf->total.mst_rx_packets))); + return 1; + case S_OUTPUT: + snprintf(b, bs, "%lu", (u_long)( + wf->cur.mst_tx_packets - wf->total.mst_tx_packets)); + return 1; + case S_RATE: + setrate(b, bs, wf->cur.mst_tx_rate); + return 1; + case S_TX_RETRY: HWSTAT(TxRetrySuccesses); + case S_TX_MRETRY: HWSTAT(TxMultipleRetrySuccesses); + case S_TX_RTSGOOD: HWSTAT(RTSSuccesses); + case S_TX_RTSBAD: HWSTAT(RTSFailures); + case S_TX_NOACK: HWSTAT(AckFailures); + case S_RX_DUPLICATE: HWSTAT(RxDuplicateFrames); + case S_RX_FCS: HWSTAT(FCSErrorCount); + case S_TX_WATCHDOG: HWSTAT(TxWatchDogTimeouts); + case S_RX_OVERFLOW: HWSTAT(RxOverflows); + case S_RX_FRAGERROR: HWSTAT(RxFragErrors); + case S_RX_MEMERROR: HWSTAT(RxMemErrors); + case S_PTRERROR: HWSTAT(PointerErrors); + case S_TX_UNDERFLOW: HWSTAT(TxUnderflows); + case S_TX_DONE: HWSTAT(TxDone); + case S_TX_DONEBUFPUT: HWSTAT(TxDoneBufPut); + case S_TX_WAIT4BUF: HWSTAT(Wait4TxBuf); + case S_TX_ATTEMPTS: HWSTAT(TxAttempts); + case S_TX_SUCCESS: HWSTAT(TxSuccesses); + case S_TX_FRAGS: HWSTAT(TxFragments); + case S_TX_MCAST: HWSTAT(TxMulticasts); + case S_RX_NONCTL: HWSTAT(RxNonCtlPkts); + case S_RX_MCAST: HWSTAT(RxMulticasts); + case S_RX_UNDECRYPT: HWSTAT(RxUndecryptableFrames); + case S_RX_ICVERROR: HWSTAT(RxICVErrors); + case S_RX_EXCLUDE: HWSTAT(RxExcludedFrames); + case S_TX_MGMT: STAT(tx_mgmt); + case S_TX_DISCARD: STAT(tx_discard); + case S_TX_QSTOP: STAT(tx_qstop); + case S_TX_ENCAP: STAT(tx_encap); + case S_TX_NOMBUF: STAT(tx_nombuf); + case S_TX_LINEAR: STAT(tx_linear); + case S_TX_NODATA: STAT(tx_nodata); + case S_TX_BUSDMA: STAT(tx_busdma); + case S_TX_SHORTPRE: STAT(tx_shortpre); + case S_TX_NOHEADROOM: STAT(tx_noheadroom); + case S_TX_BADFRAMETYPE: STAT(tx_badframetype); + case S_RX_CRYPTO_ERR: STAT(rx_crypto); + case S_RX_TKIPMIC: STAT(rx_tkipmic); + case S_RX_NODMABUF: STAT(rx_nodmabuf); + case S_RX_DMABUFMISSING:STAT(rx_dmabufmissing); + case S_RX_NOMBUF: STAT(rx_nombuf); + case S_RX_BUSDMA: STAT(rx_busdma); + case S_AMPDU_NOSTREAM: STAT(ampdu_nostream); + case S_AMPDU_REJECT: STAT(ampdu_reject); + case S_ADDBA_NOSTREAM: STAT(addba_nostream); + case S_TX_TSO: STAT(tx_tso); + case S_TSO_BADETH: STAT(tso_badeth); + case S_TSO_NOHDR: STAT(tso_nohdr); + case S_TSO_BADSPLIT: STAT(tso_badsplit); + case S_BAWATCHDOG: STAT(bawatchdog); + case S_BAWATCHDOG_NOTFOUND:STAT(bawatchdog_notfound); + case S_BAWATCHDOG_EMPTY: STAT(bawatchdog_empty); + case S_BAWATCHDOG_FAILED:STAT(bawatchdog_failed); + case S_RADARDETECT: STAT(radardetect); + case S_RX_RSSI: + snprintf(b, bs, "%d", wf->cur.mst_rx_rssi); + return 1; + case S_ANT_TX0: TXANT(0); + case S_ANT_TX1: TXANT(1); + case S_ANT_TX2: TXANT(2); + case S_ANT_TX3: TXANT(3); + case S_ANT_RX0: RXANT(0); + case S_ANT_RX1: RXANT(1); + case S_ANT_RX2: RXANT(2); + case S_ANT_RX3: RXANT(3); + case S_RX_NOISE: + snprintf(b, bs, "%d", wf->cur.mst_rx_noise); + return 1; + case S_RX_SIGNAL: + snprintf(b, bs, "%d", + wf->cur.mst_rx_rssi + wf->cur.mst_rx_noise); + return 1; + } + b[0] = '\0'; + return 0; +#undef RXANT +#undef TXANT +#undef HWSTAT +#undef STAT +} + +static int +mwl_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; +#define STAT(x) \ + snprintf(b, bs, "%u", wf->total.mst_##x); return 1 +#define HWSTAT(x) \ + snprintf(b, bs, "%u", wf->total.hw_stats.x); return 1 +#define TXANT(x) \ + snprintf(b, bs, "%u", wf->total.mst_ant_tx[x]); return 1 +#define RXANT(x) \ + snprintf(b, bs, "%u", wf->total.mst_ant_rx[x]); return 1 + + switch (s) { + case S_INPUT: + snprintf(b, bs, "%lu", (u_long)wf->total.mst_rx_packets); + return 1; + case S_OUTPUT: + snprintf(b, bs, "%lu", (u_long) wf->total.mst_tx_packets); + return 1; + case S_RATE: + setrate(b, bs, wf->total.mst_tx_rate); + return 1; + case S_TX_RETRY: HWSTAT(TxRetrySuccesses); + case S_TX_MRETRY: HWSTAT(TxMultipleRetrySuccesses); + case S_TX_RTSGOOD: HWSTAT(RTSSuccesses); + case S_TX_RTSBAD: HWSTAT(RTSFailures); + case S_TX_NOACK: HWSTAT(AckFailures); + case S_RX_DUPLICATE: HWSTAT(RxDuplicateFrames); + case S_RX_FCS: HWSTAT(FCSErrorCount); + case S_TX_WATCHDOG: HWSTAT(TxWatchDogTimeouts); + case S_RX_OVERFLOW: HWSTAT(RxOverflows); + case S_RX_FRAGERROR: HWSTAT(RxFragErrors); + case S_RX_MEMERROR: HWSTAT(RxMemErrors); + case S_PTRERROR: HWSTAT(PointerErrors); + case S_TX_UNDERFLOW: HWSTAT(TxUnderflows); + case S_TX_DONE: HWSTAT(TxDone); + case S_TX_DONEBUFPUT: HWSTAT(TxDoneBufPut); + case S_TX_WAIT4BUF: HWSTAT(Wait4TxBuf); + case S_TX_ATTEMPTS: HWSTAT(TxAttempts); + case S_TX_SUCCESS: HWSTAT(TxSuccesses); + case S_TX_FRAGS: HWSTAT(TxFragments); + case S_TX_MCAST: HWSTAT(TxMulticasts); + case S_RX_NONCTL: HWSTAT(RxNonCtlPkts); + case S_RX_MCAST: HWSTAT(RxMulticasts); + case S_RX_UNDECRYPT: HWSTAT(RxUndecryptableFrames); + case S_RX_ICVERROR: HWSTAT(RxICVErrors); + case S_RX_EXCLUDE: HWSTAT(RxExcludedFrames); + case S_TX_MGMT: STAT(tx_mgmt); + case S_TX_DISCARD: STAT(tx_discard); + case S_TX_QSTOP: STAT(tx_qstop); + case S_TX_ENCAP: STAT(tx_encap); + case S_TX_NOMBUF: STAT(tx_nombuf); + case S_TX_LINEAR: STAT(tx_linear); + case S_TX_NODATA: STAT(tx_nodata); + case S_TX_BUSDMA: STAT(tx_busdma); + case S_TX_SHORTPRE: STAT(tx_shortpre); + case S_TX_NOHEADROOM: STAT(tx_noheadroom); + case S_TX_BADFRAMETYPE: STAT(tx_badframetype); + case S_RX_CRYPTO_ERR: STAT(rx_crypto); + case S_RX_TKIPMIC: STAT(rx_tkipmic); + case S_RX_NODMABUF: STAT(rx_nodmabuf); + case S_RX_DMABUFMISSING:STAT(rx_dmabufmissing); + case S_RX_NOMBUF: STAT(rx_nombuf); + case S_RX_BUSDMA: STAT(rx_busdma); + case S_AMPDU_NOSTREAM: STAT(ampdu_nostream); + case S_AMPDU_REJECT: STAT(ampdu_reject); + case S_ADDBA_NOSTREAM: STAT(addba_nostream); + case S_TX_TSO: STAT(tx_tso); + case S_TSO_BADETH: STAT(tso_badeth); + case S_TSO_NOHDR: STAT(tso_nohdr); + case S_TSO_BADSPLIT: STAT(tso_badsplit); + case S_BAWATCHDOG: STAT(bawatchdog); + case S_BAWATCHDOG_NOTFOUND:STAT(bawatchdog_notfound); + case S_BAWATCHDOG_EMPTY: STAT(bawatchdog_empty); + case S_BAWATCHDOG_FAILED:STAT(bawatchdog_failed); + case S_RADARDETECT: STAT(radardetect); + case S_RX_RSSI: + snprintf(b, bs, "%d", wf->total.mst_rx_rssi); + return 1; + case S_ANT_TX0: TXANT(0); + case S_ANT_TX1: TXANT(1); + case S_ANT_TX2: TXANT(2); + case S_ANT_TX3: TXANT(3); + case S_ANT_RX0: RXANT(0); + case S_ANT_RX1: RXANT(1); + case S_ANT_RX2: RXANT(2); + case S_ANT_RX3: RXANT(3); + case S_RX_NOISE: + snprintf(b, bs, "%d", wf->total.mst_rx_noise); + return 1; + case S_RX_SIGNAL: + snprintf(b, bs, "%d", + wf->total.mst_rx_rssi + wf->total.mst_rx_noise); + return 1; + } + b[0] = '\0'; + return 0; +#undef RXANT +#undef TXANT +#undef HWSTAT +#undef STAT +} + +static void +mwl_print_verbose(struct statfoo *sf, FILE *fd) +{ + struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; + const struct fmt *f; + char s[32]; + const char *indent; + int i, width; + + width = 0; + for (i = 0; i < S_LAST; i++) { + f = &sf->stats[i]; + if (f->width > width) + width = f->width; + } + for (i = 0; i < S_LAST; i++) { + f = &sf->stats[i]; + if (mwl_get_totstat(sf, i, s, sizeof(s)) && strcmp(s, "0")) { + indent = ""; + fprintf(fd, "%s%-*s %s\n", indent, width, s, f->desc); + } + } + fprintf(fd, "Antenna profile:\n"); + for (i = 0; i < 4; i++) + if (wf->total.mst_ant_rx[i] || wf->total.mst_ant_tx[i]) + fprintf(fd, "[%u] tx %8u rx %8u\n", i, + wf->total.mst_ant_tx[i], + wf->total.mst_ant_rx[i]); +} + +STATFOO_DEFINE_BOUNCE(mwlstatfoo) + +struct mwlstatfoo * +mwlstats_new(const char *ifname, const char *fmtstring) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + struct mwlstatfoo_p *wf; + + wf = calloc(1, sizeof(struct mwlstatfoo_p)); + if (wf != NULL) { + statfoo_init(&wf->base.base, "mwlstats", mwlstats, N(mwlstats)); + /* override base methods */ + wf->base.base.collect_cur = mwl_collect_cur; + wf->base.base.collect_tot = mwl_collect_tot; + wf->base.base.get_curstat = mwl_get_curstat; + wf->base.base.get_totstat = mwl_get_totstat; + wf->base.base.update_tot = mwl_update_tot; + wf->base.base.print_verbose = mwl_print_verbose; + + /* setup bounce functions for public methods */ + STATFOO_BOUNCE(wf, mwlstatfoo); + + /* setup our public methods */ + wf->base.setifname = mwl_setifname; +#if 0 + wf->base.setstamac = wlan_setstamac; +#endif + wf->s = socket(AF_INET, SOCK_DGRAM, 0); + if (wf->s < 0) + err(1, "socket"); + + mwl_setifname(&wf->base, ifname); + wf->base.setfmt(&wf->base, fmtstring); + } + return &wf->base; +#undef N +} Added: head/tools/tools/mwl/mwlstats/mwlstats.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/mwl/mwlstats/mwlstats.h Mon Jun 1 18:27:16 2009 (r193242) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2007 Sam Leffler, Errno Consulting + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From rwatson at FreeBSD.org Mon Jun 1 18:38:36 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Mon Jun 1 18:38:44 2009 Subject: svn commit: r193243 - head/sys/net Message-ID: <200906011838.n51Ica2i087615@svn.freebsd.org> Author: rwatson Date: Mon Jun 1 18:38:36 2009 New Revision: 193243 URL: http://svn.freebsd.org/changeset/base/193243 Log: Revert a recent netisr2 change: when billing packets to the current CPU, don't lock the workstream, as its mutexes may not have been initialized if there are fewer workstreams than CPUs. Run into by: hps, ps Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Jun 1 18:27:16 2009 (r193242) +++ head/sys/net/netisr.c Mon Jun 1 18:38:36 2009 (r193243) @@ -893,10 +893,8 @@ netisr_dispatch_src(u_int proto, uintptr if (netisr_direct_force) { nwsp = &nws[curcpu]; npwp = &nwsp->nws_work[proto]; - NWS_LOCK(nwsp); npwp->nw_dispatched++; npwp->nw_handled++; - NWS_UNLOCK(nwsp); np[proto].np_handler(m); error = 0; goto out_unlock; From bz at FreeBSD.org Mon Jun 1 18:40:08 2009 From: bz at FreeBSD.org (Bjoern A. Zeeb) Date: Mon Jun 1 18:40:20 2009 Subject: svn commit: r193241 - in head: . sys/sys In-Reply-To: <1243880140.25229.23.camel@bauer.cse.buffalo.edu> References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> Message-ID: <20090601182802.N12292@maildrop.int.zabbadoz.net> On Mon, 1 Jun 2009, Ken Smith wrote: > On Mon, 2009-06-01 at 18:07 +0000, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Mon Jun 1 18:07:38 2009 >> New Revision: 193241 >> URL: http://svn.freebsd.org/changeset/base/193241 >> >> Log: >> Decrement __FreeBSD_version again to 96 as we are runing out of digits >> and want to be conservative - so not more than one version bump per day. >> >> Discussed with: jhb, kensmith > > It was noted we're close to running out of numbers we can use before we > hit code freeze and the branch for the release. Since we're entering > code slush at the end of today in theory all changes that would warrant > a bump in __FreeBSD_version are supposed to be done. But it wouldn't > surprise me if we have one or two or so things that come along between > now and when we hit code freeze and the branch. So we need to be a bit > conservative with this. Please be sure to coordinate anything that > might require a bump in __FreeBSD_version with re@ from now on. If it > turns out things do come along that require bumps we'll need to "batch > them up" having one bump represent several changes. Talking about "padding of structures", as this will be one of those changes most likely, I had suggested previously in private email: Can't we start collecting all those somewhere, perhaps on the wiki, and do one big padding day, one commit for all and everything? This would have several advantages: 1) no ABI breakage in HEAD as v-structs would possibly change in size 2) actual documentation of A|KB|PI relevant structures which would be good to have them written down finally after I heard people talking about this for multiple releases now. 3) a list of things we might need to work on in the future to reduce the problem and also a list for the time 9.x would come;-) just my 0.01$ /bz -- Bjoern A. Zeeb The greatest risk is not taking one. From delphij at FreeBSD.org Mon Jun 1 18:42:18 2009 From: delphij at FreeBSD.org (Xin LI) Date: Mon Jun 1 18:42:30 2009 Subject: svn commit: r193244 - head/sys/dev/aic7xxx/aicasm Message-ID: <200906011842.n51IgHpW087717@svn.freebsd.org> Author: delphij Date: Mon Jun 1 18:42:16 2009 New Revision: 193244 URL: http://svn.freebsd.org/changeset/base/193244 Log: Code cleanups to make this WARNS=6 clean. PR: bin/96128 Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c head/sys/dev/aic7xxx/aicasm/aicasm_gram.y head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm.c Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm.c Mon Jun 1 18:42:16 2009 (r193244) @@ -79,8 +79,8 @@ static void output_code(void); static void output_listing(char *ifilename); static void dump_scope(scope_t *scope); static void emit_patch(scope_t *scope, int patch); -static int check_patch(patch_t **start_patch, int start_instr, - int *skip_addr, int *func_vals); +static int check_patch(patch_t **start_patch, unsigned int start_instr, + unsigned int *skip_addr, int *func_vals); struct path_list search_path; int includes_search_curdir; @@ -116,8 +116,6 @@ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { - extern char *optarg; - extern int optind; int ch; int retval; char *inputfilename; @@ -530,7 +528,7 @@ output_listing(char *ifilename) int *func_values; int instrcount; int instrptr; - int line; + unsigned int line; int func_count; int skip_addr; @@ -649,8 +647,8 @@ output_listing(char *ifilename) } static int -check_patch(patch_t **start_patch, int start_instr, - int *skip_addr, int *func_vals) +check_patch(patch_t **start_patch, unsigned int start_instr, + unsigned int *skip_addr, int *func_vals) { patch_t *cur_patch; Modified: head/sys/dev/aic7xxx/aicasm/aicasm_gram.y ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_gram.y Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_gram.y Mon Jun 1 18:42:16 2009 (r193244) @@ -88,7 +88,7 @@ static int in_critical_section; static u_int enum_increment; static u_int enum_next_value; -static void process_field(int field_type, symbol_t *sym, int mask); +static void process_field(unsigned int field_type, symbol_t *sym, int mask); static void initialize_symbol(symbol_t *symbol); static void add_macro_arg(const char *argtext, int position); static void add_macro_body(const char *bodytext); @@ -107,6 +107,9 @@ static void add_conditional(symbol_t *sy static void add_version(const char *verstring); static int is_download_const(expression_t *immed); +extern int yylex (void); +extern int yyparse (void); + #define SRAM_SYMNAME "SRAM_BASE" #define SCB_SYMNAME "SCB_BASE" %} @@ -867,7 +870,7 @@ reg_symbol: stop("register offset must be a constant", EX_DATAERR); /* NOTREACHED */ } - if (($3->info.cinfo->value + 1) > $1->info.rinfo->size) { + if (($3->info.cinfo->value + 1) > (unsigned)$1->info.rinfo->size) { stop("Accessing offset beyond range of register", EX_DATAERR); /* NOTREACHED */ @@ -878,7 +881,7 @@ reg_symbol: | T_SYMBOL '[' T_NUMBER ']' { process_register(&$1); - if (($3 + 1) > $1->info.rinfo->size) { + if (($3 + 1) > (unsigned)$1->info.rinfo->size) { stop("Accessing offset beyond range of register", EX_DATAERR); /* NOTREACHED */ @@ -1379,7 +1382,7 @@ code: %% static void -process_field(int field_type, symbol_t *sym, int value) +process_field(unsigned int field_type, symbol_t *sym, int value) { /* * Add the current register to its @@ -1531,10 +1534,9 @@ initialize_symbol(symbol_t *symbol) } static void -add_macro_arg(const char *argtext, int argnum) +add_macro_arg(const char *argtext, int argnum __unused) { struct macro_arg *marg; - int i; int retval; @@ -1553,7 +1555,7 @@ add_macro_arg(const char *argtext, int a retval = snprintf(regex_pattern, sizeof(regex_pattern), "[^-/A-Za-z0-9_](%s)([^-/A-Za-z0-9_]|$)", argtext); - if (retval >= sizeof(regex_pattern)) { + if (retval >= (int)sizeof(regex_pattern)) { stop("Regex text buffer too small for arg", EX_SOFTWARE); /* NOTREACHED */ @@ -1911,24 +1913,24 @@ add_conditional(symbol_t *symbol) static void add_version(const char *verstring) { - const char prefix[] = " * "; + const char verprefix[] = " * "; int newlen; int oldlen; - newlen = strlen(verstring) + strlen(prefix); + newlen = strlen(verstring) + strlen(verprefix); oldlen = 0; if (versions != NULL) oldlen = strlen(versions); versions = realloc(versions, newlen + oldlen + 2); if (versions == NULL) stop("Can't allocate version string", EX_SOFTWARE); - strcpy(&versions[oldlen], prefix); - strcpy(&versions[oldlen + strlen(prefix)], verstring); + strcpy(&versions[oldlen], verprefix); + strcpy(&versions[oldlen + strlen(verprefix)], verstring); versions[newlen + oldlen] = '\n'; versions[newlen + oldlen + 1] = '\0'; } -void +static void yyerror(const char *string) { stop(string, EX_DATAERR); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y Mon Jun 1 18:42:16 2009 (r193244) @@ -66,6 +66,9 @@ static symbol_t *macro_symbol; static void add_macro_arg(const char *argtext, int position); +extern int mmlex(void); +extern int mmparse(void); + %} %union { @@ -157,7 +160,7 @@ add_macro_arg(const char *argtext, int a } } -void +static void mmerror(const char *string) { stop(string, EX_DATAERR); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Mon Jun 1 18:42:16 2009 (r193244) @@ -65,7 +65,9 @@ static char string_buf[MAX_STR_CONST]; static char *string_buf_ptr; static int parren_count; -static char buf[255]; +static char msgbuf[255]; + +extern int mmlex(void); %} WORD [A-Za-z_][-A-Za-z_0-9]* @@ -143,9 +145,9 @@ MCARG [^(), \t]+ return T_SYMBOL; } . { - snprintf(buf, sizeof(buf), "Invalid character " + snprintf(msgbuf, sizeof(msgbuf), "Invalid character " "'%c'", mmtext[0]); - stop(buf, EX_DATAERR); + stop(msgbuf, EX_DATAERR); } %% @@ -153,4 +155,5 @@ int mmwrap() { stop("EOF encountered in macro call", EX_DATAERR); + return (1); } Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 18:42:16 2009 (r193244) @@ -67,7 +67,13 @@ static char string_buf[MAX_STR_CONST]; static char *string_buf_ptr; static int parren_count; static int quote_count; -static char buf[255]; +static char msgbuf[255]; + +extern int yylex(void); +extern int mmlex(void); +extern int mmparse(void); +extern void mm_switch_to_buffer(YY_BUFFER_STATE); +extern void mm_delete_buffer(YY_BUFFER_STATE); %} PATH ([/]*[-A-Za-z0-9_.])+ @@ -315,10 +321,10 @@ else { return T_ELSE; } return ')'; } . { - snprintf(buf, sizeof(buf), "Invalid character " + snprintf(msgbuf, sizeof(msgbuf), "Invalid character " "'%c' in macro argument list", yytext[0]); - stop(buf, EX_DATAERR); + stop(msgbuf, EX_DATAERR); } {SPACE} ; \( { @@ -375,7 +381,7 @@ else { return T_ELSE; } char c; yptr = yytext; - while (c = *yptr++) { + while ((c = *yptr++)) { /* * Strip carriage returns. */ @@ -430,9 +436,9 @@ else { return T_ELSE; } } } . { - snprintf(buf, sizeof(buf), "Invalid character " + snprintf(msgbuf, sizeof(msgbuf), "Invalid character " "'%c'", yytext[0]); - stop(buf, EX_DATAERR); + stop(msgbuf, EX_DATAERR); } %% Modified: head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_symbol.c Mon Jun 1 18:42:16 2009 (r193244) @@ -49,6 +49,7 @@ #else #include #endif +#include #include #include #include @@ -62,8 +63,8 @@ static DB *symtable; -symbol_t * -symbol_create(char *name) +static symbol_t * +symbol_create(const char *name) { symbol_t *new_symbol; @@ -163,14 +164,14 @@ symtable_close() * if a lookup fails. */ symbol_t * -symtable_get(char *name) +symtable_get(const char *name) { symbol_t *stored_ptr; DBT key; DBT data; int retval; - key.data = (void *)name; + key.data = strdup(name); key.size = strlen(name); if ((retval = symtable->get(symtable, &key, &data, /*flags*/0)) != 0) { @@ -190,6 +191,7 @@ symtable_get(char *name) perror("Symtable put failed"); exit(EX_SOFTWARE); } + free(key.data); return (new_symbol); } else { perror("Unexpected return value from db get routine"); @@ -198,6 +200,7 @@ symtable_get(char *name) } } memcpy(&stored_ptr, data.data, sizeof(stored_ptr)); + free(key.data); return (stored_ptr); } @@ -321,7 +324,7 @@ symlist_merge(symlist_t *symlist_dest, s SLIST_INIT(symlist_src2); } -void +static void aic_print_file_prologue(FILE *ofile) { @@ -337,16 +340,16 @@ aic_print_file_prologue(FILE *ofile) versions); } -void -aic_print_include(FILE *dfile, char *include_file) +static void +aic_print_include(FILE *dfile, char *header_file) { if (dfile == NULL) return; - fprintf(dfile, "\n#include \"%s\"\n\n", include_file); + fprintf(dfile, "\n#include \"%s\"\n\n", header_file); } -void +static void aic_print_reg_dump_types(FILE *ofile) { if (ofile == NULL) @@ -586,10 +589,9 @@ symtable_dump(FILE *ofile, FILE *dfile) /* Output generated #defines. */ while (SLIST_FIRST(®isters) != NULL) { - symbol_node_t *curnode; u_int value; - char *tab_str; - char *tab_str2; + const char *tab_str; + const char *tab_str2; curnode = SLIST_FIRST(®isters); SLIST_REMOVE_HEAD(®isters, links); @@ -636,7 +638,6 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "\n\n"); while (SLIST_FIRST(&constants) != NULL) { - symbol_node_t *curnode; curnode = SLIST_FIRST(&constants); SLIST_REMOVE_HEAD(&constants, links); @@ -650,7 +651,6 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n"); for (i = 0; SLIST_FIRST(&download_constants) != NULL; i++) { - symbol_node_t *curnode; curnode = SLIST_FIRST(&download_constants); SLIST_REMOVE_HEAD(&download_constants, links); @@ -664,7 +664,6 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "\n\n/* Exported Labels */\n"); while (SLIST_FIRST(&exported_labels) != NULL) { - symbol_node_t *curnode; curnode = SLIST_FIRST(&exported_labels); SLIST_REMOVE_HEAD(&exported_labels, links); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h Mon Jun 1 18:38:36 2009 (r193243) +++ head/sys/dev/aic7xxx/aicasm/aicasm_symbol.h Mon Jun 1 18:42:16 2009 (r193244) @@ -190,7 +190,7 @@ void symtable_open(void); void symtable_close(void); symbol_t * - symtable_get(char *name); + symtable_get(const char *name); symbol_node_t * symlist_search(symlist_t *symlist, char *symname); From delphij at FreeBSD.org Mon Jun 1 18:43:34 2009 From: delphij at FreeBSD.org (Xin LI) Date: Mon Jun 1 18:43:40 2009 Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm Message-ID: <200906011843.n51IhXt4087781@svn.freebsd.org> Author: delphij Date: Mon Jun 1 18:43:33 2009 New Revision: 193245 URL: http://svn.freebsd.org/changeset/base/193245 Log: Mark as WARNS=6. Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll +WARNS?= 6 # Correct path for kernel builds # Don't rely on the kernel's .depend file From dougb at FreeBSD.org Mon Jun 1 18:48:43 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 18:48:54 2009 Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm In-Reply-To: <200906011843.n51IhXt4087781@svn.freebsd.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> Message-ID: <4A242282.4030404@FreeBSD.org> Xin LI wrote: > Author: delphij > Date: Mon Jun 1 18:43:33 2009 > New Revision: 193245 > URL: http://svn.freebsd.org/changeset/base/193245 > > Log: > Mark as WARNS=6. > > Modified: > head/sys/dev/aic7xxx/aicasm/Makefile > > Modified: head/sys/dev/aic7xxx/aicasm/Makefile > ============================================================================== > --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) > +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) > @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > DPADD= ${LIBL} > LDADD= -ll > +WARNS?= 6 > > # Correct path for kernel builds > # Don't rely on the kernel's .depend file > Is there more coming? cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c aicasm_scan.c cc1: warnings being treated as errors /usr/local/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l: In function 'expand_macro': /usr/local/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:528: warning: 'match.rm_eo' may be used uninitialized in this function /usr/local/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:528: warning: 'match.rm_so' may be used uninitialized in this function *** Error code 1 Stop in /usr/local/obj/usr/local/src/sys/LAP. *** Error code 1 -- This .signature sanitized for your protection From joel at FreeBSD.org Mon Jun 1 18:58:48 2009 From: joel at FreeBSD.org (Joel Dahl) Date: Mon Jun 1 18:59:00 2009 Subject: svn commit: r193246 - head/share/man/man4 Message-ID: <200906011858.n51Iwlvr088146@svn.freebsd.org> Author: joel (doc committer) Date: Mon Jun 1 18:58:46 2009 New Revision: 193246 URL: http://svn.freebsd.org/changeset/base/193246 Log: - Remove obsolete and confusing comment about renaming "sound" to "snd". We will look at renaming stuff for 9.0, but it's far from certain that we will do it this way. - Sort sysctl's alphabetically. I'll add a bunch of new sysctl's once ariff's next mega-patch goes in, and having everything sorted makes my job easier. Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Mon Jun 1 18:43:33 2009 (r193245) +++ head/share/man/man4/pcm.4 Mon Jun 1 18:58:46 2009 (r193246) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2007 +.Dd June 1, 2009 .Dt SOUND 4 .Os .Sh NAME @@ -51,16 +51,6 @@ hint.pcm.0.drq="1" hint.pcm.0.flags="0x0" .Ed .Sh DESCRIPTION -.Bf -emphasis -Note: There exists some ambiguity in the naming at the moment -.Pq Nm sound , pcm , snd . -It will be resolved soon by renaming -.Cd "device sound" -to -.Cd "device snd" , -and doing associated changes. -.Ef -.Pp The .Nm driver provides support for @@ -170,14 +160,34 @@ tunables are global settings and .Va dev.pcm.* are device specific. .Bl -tag -width ".Va hw.snd.report_soft_formats" -offset indent -.It Va hw.snd.latency_profile -Define sets of buffering latency conversion tables for the -.Va hw.snd.latency -tunable. -A value of 0 will use a low and aggressive latency profile which can result -in possible underruns if the application cannot keep up with a rapid irq -rate, especially during high workload. -The default value is 1, which is considered a moderate/safe latency profile. +.It Va hw.snd.compat_linux_mmap +Enable to allow PROT_EXEC page mappings. +All Linux applications using sound and +.Xr mmap 2 +require this. +.It Va hw.snd.default_auto +Enable to automatically assign default sound unit to the most recent +attached device. +.It Va hw.snd.default_unit +Default sound card for systems with multiple sound cards. +When using +.Xr devfs 5 , +the default device for +.Pa /dev/dsp . +Equivalent to a symlink from +.Pa /dev/dsp +to +.Pa /dev/dsp Ns Va ${hw.snd.default_unit} . +.It Va hw.snd.feeder_rate_max +Maximum allowable sample rate. +.It Va hw.snd.feeder_rate_min +Minimum allowable sample rate. +.It Va hw.snd.feeder_rate_round +Sample rate rounding threshold, to avoid large prime division at the +cost of accuracy. +All requested sample rates will be rounded to the nearest threshold value. +Possible values range between 0 (disabled) and 500. +Default is 25. .It Va hw.snd.latency Configure the buffering latency. Only affects applications that do not explicitly request @@ -186,26 +196,31 @@ This tunable provides finer granularity .Va hw.snd.latency_profile tunable. Possible values range between 0 (lowest latency) and 10 (highest latency). +.It Va hw.snd.latency_profile +Define sets of buffering latency conversion tables for the +.Va hw.snd.latency +tunable. +A value of 0 will use a low and aggressive latency profile which can result +in possible underruns if the application cannot keep up with a rapid irq +rate, especially during high workload. +The default value is 1, which is considered a moderate/safe latency profile. +.It Va hw.snd.maxautovchans +Global +.Tn VCHAN +setting that only affects devices with at least one playback or recording channel available. +The sound system will dynamically create up this many +.Tn VCHANs . +Set to +.Dq 0 +if no +.Tn VCHANS +are desired. +Maximum value is 256. .It Va hw.snd.report_soft_formats Controls the internal format conversion if it is available transparently to the application software. When disabled or not available, the application will only be able to select formats the device natively supports. -.It Va hw.snd.compat_linux_mmap -Enable to allow PROT_EXEC page mappings. -All Linux applications using sound and -.Xr mmap 2 -require this. -.It Va hw.snd.feeder_rate_round -Sample rate rounding threshold, to avoid large prime division at the -cost of accuracy. -All requested sample rates will be rounded to the nearest threshold value. -Possible values range between 0 (disabled) and 500. -Default is 25. -.It Va hw.snd.feeder_rate_max -Maximum allowable sample rate. -.It Va hw.snd.feeder_rate_min -Minimum allowable sample rate. .It Va hw.snd.verbose Level of verbosity for the .Pa /dev/sndstat @@ -228,31 +243,6 @@ File names and versions of the currently .It 4 Various messages intended for debugging. .El -.It Va hw.snd.maxautovchans -Global -.Tn VCHAN -setting that only affects devices with at least one playback or recording channel available. -The sound system will dynamically create up this many -.Tn VCHANs . -Set to -.Dq 0 -if no -.Tn VCHANS -are desired. -Maximum value is 256. -.It Va hw.snd.default_unit -Default sound card for systems with multiple sound cards. -When using -.Xr devfs 5 , -the default device for -.Pa /dev/dsp . -Equivalent to a symlink from -.Pa /dev/dsp -to -.Pa /dev/dsp Ns Va ${hw.snd.default_unit} . -.It Va hw.snd.default_auto -Enable to automatically assign default sound unit to the most recent -attached device. .It Va dev.pcm.%d.[play|rec].vchans The current number of .Tn VCHANs @@ -264,18 +254,18 @@ Setting this value to will disable .Tn VCHANs for this device. -.It Va dev.pcm.%d.[play|rec].vchanrate -Sample rate speed for -.Tn VCHAN -mixing. -All playback paths will be converted to this sample rate before the mixing -process begins. .It Va dev.pcm.%d.[play|rec].vchanformat Format for .Tn VCHAN mixing. All playback paths will be converted to this format before the mixing process begins. +.It Va dev.pcm.%d.[play|rec].vchanrate +Sample rate speed for +.Tn VCHAN +mixing. +All playback paths will be converted to this sample rate before the mixing +process begins. .It Va dev.pcm.%d.polling Experimental polling mode support where the driver operates by querying the device state on each tick using a From rdivacky at FreeBSD.org Mon Jun 1 19:04:02 2009 From: rdivacky at FreeBSD.org (Roman Divacky) Date: Mon Jun 1 19:04:08 2009 Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm In-Reply-To: <20090601184937.GA24177@freebsd.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> Message-ID: <20090601185532.GA24838@freebsd.org> On Mon, Jun 01, 2009 at 08:49:37PM +0200, Roman Divacky wrote: > On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: > > Xin LI wrote: > > > Author: delphij > > > Date: Mon Jun 1 18:43:33 2009 > > > New Revision: 193245 > > > URL: http://svn.freebsd.org/changeset/base/193245 > > > > > > Log: > > > Mark as WARNS=6. > > > > > > Modified: > > > head/sys/dev/aic7xxx/aicasm/Makefile > > > > > > Modified: head/sys/dev/aic7xxx/aicasm/Makefile > > > ============================================================================== > > > --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) > > > +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) > > > @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > > > CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > > > DPADD= ${LIBL} > > > LDADD= -ll > > > +WARNS?= 6 > > > > > > # Correct path for kernel builds > > > # Don't rely on the kernel's .depend file > > > > > > > Is there more coming? > > > > cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. > > -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 > ^^^^^^^^^^ > > how did you get this? this should be used for userland compilation, > kernel is done with -std=c99, can you show me how you got this? ok.. when you cd /usr/src make you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am trying to fix this. if anyone has any idea please mail me.. roman From delphij at FreeBSD.org Mon Jun 1 19:06:09 2009 From: delphij at FreeBSD.org (Xin LI) Date: Mon Jun 1 19:06:20 2009 Subject: svn commit: r193247 - head/sys/dev/aic7xxx/aicasm Message-ID: <200906011906.n51J68CY088367@svn.freebsd.org> Author: delphij Date: Mon Jun 1 19:06:08 2009 New Revision: 193247 URL: http://svn.freebsd.org/changeset/base/193247 Log: Revert the WARNS change for now, need some time to fix the real problem. Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:58:46 2009 (r193246) +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 19:06:08 2009 (r193247) @@ -15,7 +15,6 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll -WARNS?= 6 # Correct path for kernel builds # Don't rely on the kernel's .depend file From rdivacky at FreeBSD.org Mon Jun 1 19:09:02 2009 From: rdivacky at FreeBSD.org (Roman Divacky) Date: Mon Jun 1 19:09:09 2009 Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm In-Reply-To: <4A242282.4030404@FreeBSD.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> Message-ID: <20090601184937.GA24177@freebsd.org> On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: > Xin LI wrote: > > Author: delphij > > Date: Mon Jun 1 18:43:33 2009 > > New Revision: 193245 > > URL: http://svn.freebsd.org/changeset/base/193245 > > > > Log: > > Mark as WARNS=6. > > > > Modified: > > head/sys/dev/aic7xxx/aicasm/Makefile > > > > Modified: head/sys/dev/aic7xxx/aicasm/Makefile > > ============================================================================== > > --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) > > +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) > > @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > > CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > > DPADD= ${LIBL} > > LDADD= -ll > > +WARNS?= 6 > > > > # Correct path for kernel builds > > # Don't rely on the kernel's .depend file > > > > Is there more coming? > > cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. > -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 ^^^^^^^^^^ how did you get this? this should be used for userland compilation, kernel is done with -std=c99, can you show me how you got this? thnx roman -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 196 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090601/d59159d7/attachment.pgp From delphij at delphij.net Mon Jun 1 19:10:57 2009 From: delphij at delphij.net (Xin LI) Date: Mon Jun 1 19:11:18 2009 Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm In-Reply-To: <20090601185532.GA24838@freebsd.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> <20090601185532.GA24838@freebsd.org> Message-ID: <4A242771.3090605@delphij.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roman Divacky wrote: > On Mon, Jun 01, 2009 at 08:49:37PM +0200, Roman Divacky wrote: >> On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: >>> Xin LI wrote: >>>> Author: delphij >>>> Date: Mon Jun 1 18:43:33 2009 >>>> New Revision: 193245 >>>> URL: http://svn.freebsd.org/changeset/base/193245 >>>> >>>> Log: >>>> Mark as WARNS=6. >>>> >>>> Modified: >>>> head/sys/dev/aic7xxx/aicasm/Makefile >>>> >>>> Modified: head/sys/dev/aic7xxx/aicasm/Makefile >>>> ============================================================================== >>>> --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) >>>> +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) >>>> @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR >>>> CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} >>>> DPADD= ${LIBL} >>>> LDADD= -ll >>>> +WARNS?= 6 >>>> >>>> # Correct path for kernel builds >>>> # Don't rely on the kernel's .depend file >>>> >>> Is there more coming? >>> >>> cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. >>> -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 >> ^^^^^^^^^^ >> >> how did you get this? this should be used for userland compilation, >> kernel is done with -std=c99, can you show me how you got this? > > ok.. when you > > cd /usr/src > make > > you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am > trying to fix this. if anyone has any idea please mail me.. This is strange... Let me take a look at this, I have reverted the WARNS?=6 change for now. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkokJ3EACgkQi+vbBBjt66AnHACfXXyxcoKUsfCORzcOv4Nz8X3D IJoAn2dXFSLAq/HzO+S0XXuFbFFTJuhJ =3Uqo -----END PGP SIGNATURE----- From gallatin at FreeBSD.org Mon Jun 1 19:16:59 2009 From: gallatin at FreeBSD.org (Andrew Gallatin) Date: Mon Jun 1 19:17:18 2009 Subject: svn commit: r193250 - head/sys/dev/mxge Message-ID: <200906011916.n51JGvB3088714@svn.freebsd.org> Author: gallatin Date: Mon Jun 1 19:16:57 2009 New Revision: 193250 URL: http://svn.freebsd.org/changeset/base/193250 Log: Set an rx jumbo cluster to the correct size before using bus_dmamap_load_mbuf_sg() on it. This prevents data corruption when the mxge MTU is between 4076 and 8172 on machines with 4KB pages and MXGE_VIRT_JUMBOS is in use (which it isn't, in -current or -stable) Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Jun 1 19:16:31 2009 (r193249) +++ head/sys/dev/mxge/if_mxge.c Mon Jun 1 19:16:57 2009 (r193250) @@ -2351,7 +2351,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m->m_len = rx->cl_size; + m->m_len = rx->mlen; err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3432,6 +3432,8 @@ mxge_slice_open(struct mxge_slice_state } ss->rx_big.nbufs = nbufs; ss->rx_big.cl_size = cl_size; + ss->rx_big.mlen = ss->sc->ifp->if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i <= ss->rx_big.mask; i += ss->rx_big.nbufs) { map = ss->rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Mon Jun 1 19:16:31 2009 (r193249) +++ head/sys/dev/mxge/if_mxge_var.h Mon Jun 1 19:16:57 2009 (r193250) @@ -120,6 +120,7 @@ typedef struct int cl_size; int alloc_fail; int mask; /* number of rx slots -1 */ + int mlen; } mxge_rx_ring_t; typedef struct From rdivacky at FreeBSD.ORG Mon Jun 1 20:17:21 2009 From: rdivacky at FreeBSD.ORG (Roman Divacky) Date: Mon Jun 1 20:17:34 2009 Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm In-Reply-To: <4A242771.3090605@delphij.net> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> <20090601185532.GA24838@freebsd.org> <4A242771.3090605@delphij.net> Message-ID: <20090601201621.GA35383@freebsd.org> On Mon, Jun 01, 2009 at 12:09:37PM -0700, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Roman Divacky wrote: > > On Mon, Jun 01, 2009 at 08:49:37PM +0200, Roman Divacky wrote: > >> On Mon, Jun 01, 2009 at 11:48:34AM -0700, Doug Barton wrote: > >>> Xin LI wrote: > >>>> Author: delphij > >>>> Date: Mon Jun 1 18:43:33 2009 > >>>> New Revision: 193245 > >>>> URL: http://svn.freebsd.org/changeset/base/193245 > >>>> > >>>> Log: > >>>> Mark as WARNS=6. > >>>> > >>>> Modified: > >>>> head/sys/dev/aic7xxx/aicasm/Makefile > >>>> > >>>> Modified: head/sys/dev/aic7xxx/aicasm/Makefile > >>>> ============================================================================== > >>>> --- head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:42:16 2009 (r193244) > >>>> +++ head/sys/dev/aic7xxx/aicasm/Makefile Mon Jun 1 18:43:33 2009 (r193245) > >>>> @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR > >>>> CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} > >>>> DPADD= ${LIBL} > >>>> LDADD= -ll > >>>> +WARNS?= 6 > >>>> > >>>> # Correct path for kernel builds > >>>> # Don't rely on the kernel's .depend file > >>>> > >>> Is there more coming? > >>> > >>> cc -O2 -pipe -ggdb -nostdinc -I/usr/include -I. > >>> -I/usr/local/src/sys/dev/aic7xxx/aicasm -ggdb -std=gnu99 > >> ^^^^^^^^^^ > >> > >> how did you get this? this should be used for userland compilation, > >> kernel is done with -std=c99, can you show me how you got this? > > > > ok.. when you > > > > cd /usr/src > > make > > > > you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am > > trying to fix this. if anyone has any idea please mail me.. > > This is strange... Let me take a look at this, I have reverted the > WARNS?=6 change for now. oh.. sorry. this has nothing to do with this commit. I just noticed it in doug's reply.. From rwatson at FreeBSD.org Mon Jun 1 20:26:52 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Mon Jun 1 20:27:04 2009 Subject: svn commit: r193255 - in head/sys: kern sys Message-ID: <200906012026.n51KQp6x090577@svn.freebsd.org> Author: rwatson Date: Mon Jun 1 20:26:51 2009 New Revision: 193255 URL: http://svn.freebsd.org/changeset/base/193255 Log: Add a flags field to struct ucred, and export that via kinfo_proc, consuming one of its spare fields. The cr_flags field is currently unused, but will be used for features, including capability mode and pay-as-you-go audit. Discussed with: jhb, sson Modified: head/sys/kern/kern_proc.c head/sys/sys/ucred.h head/sys/sys/user.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Jun 1 20:21:13 2009 (r193254) +++ head/sys/kern/kern_proc.c Mon Jun 1 20:26:51 2009 (r193255) @@ -736,6 +736,7 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_ngroups * sizeof(gid_t)); kp->ki_rgid = cred->cr_rgid; kp->ki_svgid = cred->cr_svgid; + kp->ki_cr_flags = cred->cr_flags; /* If jailed(cred), emulate the old P_JAILED flag. */ if (jailed(cred)) { kp->ki_flag |= P_JAILED; Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Mon Jun 1 20:21:13 2009 (r193254) +++ head/sys/sys/ucred.h Mon Jun 1 20:26:51 2009 (r193255) @@ -56,6 +56,7 @@ struct ucred { struct uidinfo *cr_ruidinfo; /* per ruid resource consumption */ struct prison *cr_prison; /* jail(2) */ struct vimage *cr_vimage; /* vimage */ + u_int cr_flags; /* credential flags */ void *cr_pspare[2]; /* general use 2 */ #define cr_endcopy cr_label struct label *cr_label; /* MAC label */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Mon Jun 1 20:21:13 2009 (r193254) +++ head/sys/sys/user.h Mon Jun 1 20:26:51 2009 (r193255) @@ -83,7 +83,7 @@ * it in two places: function fill_kinfo_proc in sys/kern/kern_proc.c and * function kvm_proclist in lib/libkvm/kvm_proc.c . */ -#define KI_NSPARE_INT 10 +#define KI_NSPARE_INT 9 #define KI_NSPARE_LONG 12 #define KI_NSPARE_PTR 7 @@ -190,6 +190,7 @@ struct kinfo_proc { */ char ki_sparestrings[68]; /* spare string space */ int ki_spareints[KI_NSPARE_INT]; /* spare room for growth */ + u_int ki_cr_flags; /* Credential flags */ int ki_jid; /* Process jail ID */ int ki_numthreads; /* XXXKSE number of threads in total */ lwpid_t ki_tid; /* XXXKSE thread id */ From jhb at FreeBSD.org Mon Jun 1 20:27:15 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 1 20:27:27 2009 Subject: svn commit: r193256 - head/sys/dev/pci Message-ID: <200906012027.n51KREdb090624@svn.freebsd.org> Author: jhb Date: Mon Jun 1 20:27:14 2009 New Revision: 193256 URL: http://svn.freebsd.org/changeset/base/193256 Log: Adjust some comments. Modified: head/sys/dev/pci/pcivar.h Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Mon Jun 1 20:26:51 2009 (r193255) +++ head/sys/dev/pci/pcivar.h Mon Jun 1 20:27:14 2009 (r193256) @@ -159,10 +159,10 @@ typedef struct pcicfg { uint8_t slot; /* config space slot address */ uint8_t func; /* config space function number */ - struct pcicfg_pp pp; /* pci power management */ - struct pcicfg_vpd vpd; /* pci vital product data */ - struct pcicfg_msi msi; /* pci msi */ - struct pcicfg_msix msix; /* pci msi-x */ + struct pcicfg_pp pp; /* Power management */ + struct pcicfg_vpd vpd; /* Vital product data */ + struct pcicfg_msi msi; /* PCI MSI */ + struct pcicfg_msix msix; /* PCI MSI-X */ struct pcicfg_ht ht; /* HyperTransport */ } pcicfgregs; From jhb at FreeBSD.org Mon Jun 1 20:30:01 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 1 20:30:12 2009 Subject: svn commit: r193257 - head/sys/dev/pci Message-ID: <200906012030.n51KU01x090713@svn.freebsd.org> Author: jhb Date: Mon Jun 1 20:30:00 2009 New Revision: 193257 URL: http://svn.freebsd.org/changeset/base/193257 Log: Add an internal pci_printf() routine similar to device_printf() except that it prefixes the output with 'pci:::: '. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Jun 1 20:27:14 2009 (r193256) +++ head/sys/dev/pci/pci.c Mon Jun 1 20:30:00 2009 (r193257) @@ -76,6 +76,7 @@ static const char *pci_maptype(uint64_t static int pci_mapsize(uint64_t testval); static int pci_maprange(uint64_t mapreg); static void pci_fixancient(pcicfgregs *cfg); +static int pci_printf(pcicfgregs *cfg, const char *fmt, ...); static int pci_porten(device_t dev); static int pci_memen(device_t dev); @@ -313,6 +314,20 @@ pci_find_device(uint16_t vendor, uint16_ return (NULL); } +static int +pci_printf(pcicfgregs *cfg, const char *fmt, ...) +{ + va_list ap; + int retval; + + retval = printf("pci%d:%d:%d:%d: ", cfg->domain, cfg->bus, cfg->slot, + cfg->func); + va_start(ap, fmt); + retval += vprintf(fmt, ap); + va_end(ap); + return (retval); +} + /* return base address of memory or port map */ static pci_addr_t @@ -2049,10 +2064,8 @@ pci_set_powerstate_method(device_t dev, } if (bootverbose) - printf( - "pci%d:%d:%d:%d: Transition from D%d to D%d\n", - dinfo->cfg.domain, dinfo->cfg.bus, dinfo->cfg.slot, - dinfo->cfg.func, oldstate, state); + pci_printf(cfg, "Transition from D%d to D%d\n", oldstate, + state); PCI_WRITE_CONFIG(dev, child, cfg->pp.pp_status, status, 2); if (delay) @@ -2815,9 +2828,7 @@ pci_driver_added(device_t dev, driver_t dinfo = device_get_ivars(child); pci_print_verbose(dinfo); if (bootverbose) - printf("pci%d:%d:%d:%d: reprobing on driver added\n", - dinfo->cfg.domain, dinfo->cfg.bus, dinfo->cfg.slot, - dinfo->cfg.func); + pci_printf(&dinfo->cfg, "reprobing on driver added\n"); pci_cfg_restore(child, dinfo); if (device_probe_and_attach(child) != 0) pci_cfg_save(child, dinfo, 1); From rmacklem at FreeBSD.org Mon Jun 1 20:34:01 2009 From: rmacklem at FreeBSD.org (Rick Macklem) Date: Mon Jun 1 20:34:07 2009 Subject: svn commit: r193258 - head/usr.bin/nfsstat Message-ID: <200906012034.n51KY00Z090919@svn.freebsd.org> Author: rmacklem Date: Mon Jun 1 20:34:00 2009 New Revision: 193258 URL: http://svn.freebsd.org/changeset/base/193258 Log: Change the "-4" option flag to "-e" since it does not refer to IPv4 and to make it consistent with the flag used by nfsd and mountd. Approved by: kib (mentor) Modified: head/usr.bin/nfsstat/nfsstat.1 head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.1 ============================================================================== --- head/usr.bin/nfsstat/nfsstat.1 Mon Jun 1 20:30:00 2009 (r193257) +++ head/usr.bin/nfsstat/nfsstat.1 Mon Jun 1 20:34:00 2009 (r193258) @@ -42,7 +42,7 @@ statistics .Sh SYNOPSIS .Nm -.Op Fl cszW4 +.Op Fl ceszW .Op Fl M Ar core .Op Fl N Ar system .Op Fl w Ar wait @@ -83,7 +83,7 @@ second intervals. .It Fl z Reset statistics after displaying them. (Not currently supported by the experimental nfs subsystem.) -.It Fl 4 +.It Fl e Gather statistics from the experimental nfs subsystem that includes support for NFSv4 instead of the regular nfs subsystem. .El Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Mon Jun 1 20:30:00 2009 (r193257) +++ head/usr.bin/nfsstat/nfsstat.c Mon Jun 1 20:34:00 2009 (r193258) @@ -113,7 +113,7 @@ main(int argc, char **argv) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "csWM:N:w:z4")) != -1) + while ((ch = getopt(argc, argv, "cesWM:N:w:z")) != -1) switch(ch) { case 'M': memf = optarg; @@ -140,7 +140,7 @@ main(int argc, char **argv) case 'z': zflag = 1; break; - case '4': + case 'e': run_v4 = 1; break; case '?': @@ -505,7 +505,7 @@ void usage(void) { (void)fprintf(stderr, - "usage: nfsstat [-cszW] [-M core] [-N system] [-w interval]\n"); + "usage: nfsstat [-ceszW] [-M core] [-N system] [-w interval]\n"); exit(1); } From jhb at FreeBSD.org Mon Jun 1 20:35:40 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 1 20:35:54 2009 Subject: svn commit: r193260 - in head: share/man/man9 sys/conf sys/kern sys/sys Message-ID: <200906012035.n51KZdgc091039@svn.freebsd.org> Author: jhb Date: Mon Jun 1 20:35:39 2009 New Revision: 193260 URL: http://svn.freebsd.org/changeset/base/193260 Log: Add a simple API to manage scatter/gather lists of phyiscal addresses. Each list describes a logical memory object that is backed by one or more physical address ranges. To minimize locking, the sglist objects themselves are immutable once they are shared. These objects may be used in the future to facilitate I/O requests using physically-addressed buffers. For the immediate future I plan to use them to implement a new type of VM object and pager. Reviewed by: jeff, scottl MFC after: 1 month Added: head/share/man/man9/sglist.9 (contents, props changed) head/sys/kern/subr_sglist.c (contents, props changed) head/sys/sys/sglist.h (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/conf/files Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Jun 1 20:35:09 2009 (r193259) +++ head/share/man/man9/Makefile Mon Jun 1 20:35:39 2009 (r193260) @@ -218,6 +218,7 @@ MAN= accept_filter.9 \ selrecord.9 \ sema.9 \ sf_buf.9 \ + sglist.9 \ signal.9 \ sleep.9 \ sleepqueue.9 \ @@ -1022,6 +1023,24 @@ MLINKS+=sf_buf.9 sf_buf_alloc.9 \ sf_buf.9 sf_buf_free.9 \ sf_buf.9 sf_buf_kva.9 \ sf_buf.9 sf_buf_page.9 +MLINKS+=sglist.9 sglist_alloc.9 \ + sglist.9 sglist_append.9 \ + sglist.9 sglist_append_mbuf.9 \ + sglist.9 sglist_append_phys.9 \ + sglist.9 sglist_append_uio.9 \ + sglist.9 sglist_append_user.9 \ + sglist.9 sglist_build.9 \ + sglist.9 sglist_clone.9 \ + sglist.9 sglist_consume_uio.9 \ + sglist.9 sglist_count.9 \ + sglist.9 sglist_free.9 \ + sglist.9 sglist_hold.9 \ + sglist.9 sglist_init.9 \ + sglist.9 sglist_join.9 \ + sglist.9 sglist_length.9 \ + sglist.9 sglist_reset.9 \ + sglist.9 sglist_slice.9 \ + sglist.9 sglist_split.9 MLINKS+=signal.9 cursig.9 \ signal.9 execsigs.9 \ signal.9 issignal.9 \ Added: head/share/man/man9/sglist.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/sglist.9 Mon Jun 1 20:35:39 2009 (r193260) @@ -0,0 +1,503 @@ +.\" +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd May 15, 2009 +.Dt SGLIST 9 +.Os +.Sh NAME +.Nm sglist , +.Nm sglist_alloc , +.Nm sglist_append , +.Nm sglist_append_mbuf , +.Nm sglist_append_phys , +.Nm sglist_append_uio , +.Nm sglist_append_user , +.Nm sglist_build , +.Nm sglist_clone , +.Nm sglist_consume_uio , +.Nm sglist_count , +.Nm sglist_free , +.Nm sglist_hold , +.Nm sglist_init , +.Nm sglist_join , +.Nm sglist_length , +.Nm sglist_reset , +.Nm sglist_slice , +.Nm sglist_split +.Nd manage a scatter/gather list of physical memory addresses +.Sh SYNOPSIS +.In sys/types.h +.In sys/sglist.h +.Ft struct sglist * +.Fn sglist_alloc "int nsegs" "int mflags" +.Ft int +.Fn sglist_append "struct sglist *sg" "void *buf" "size_t len" +.Ft int +.Fn sglist_append_mbuf "struct sglist *sg" "struct mbuf *m" +.Ft int +.Fn sglist_append_phys "struct sglist *sg" "vm_paddr_t paddr" "size_t len" +.Ft int +.Fn sglist_append_uio "struct sglist *sg" "struct uio *uio" +.Ft int +.Fn sglist_append_user "struct sglist *sg" "void *buf" "size_t len" "struct thread *td" +.Ft struct sglist * +.Fn sglist_build "void *buf" "size_t len" "int mflags" +.Ft struct sglist * +.Fn sglist_clone "struct sglist *sg" "int mflags" +.Ft int +.Fn sglist_consume_uio "struct sglist *sg" "struct uio *uio" "int resid" +.Ft int +.Fn sglist_count "void *buf" "size_t len" +.Ft void +.Fn sglist_free "struct sglist *sg" +.Ft struct sglist * +.Fn sglist_hold "struct sglist *sg" +.Ft void +.Fn sglist_init "struct sglist *sg" "int maxsegs" "struct sglist_seg *segs" +.Ft int +.Fn sglist_join "struct sglist *first" "struct sglist *second" +.Ft size_t +.Fn sglist_length "struct sglist *sg" +.Ft void +.Fn sglist_reset "struct sglist *sg" +.Ft int +.Fn sglist_slice "struct sglist *original" "struct sglist **slice" "size_t offset" "size_t length" "int mflags" +.Ft int +.Fn sglist_split "struct sglist *original" "struct sglist **head" "size_t length" "int mflags" +.Sh DESCRIPTION +The +.Nm +API manages physical address ranges. +Each list contains one or more elements. +Each element contains a starting physical address and a length. +Scatter/gather lists are read-only while they are shared. +If one wishes to alter an existing scatter/gather list and does not hold the +sole reference to the list, +then one should create a new list instead of modifying the existing list. +.Pp +Each scatter/gather list object contains a reference count. +New lists are created with a single reference. +New references are obtained by calling +.Nm sglist_hold +and are released by calling +.Nm sglist_free . +.Ss Allocating and Initializing Lists +Each +.Nm +object consists of a header structure and a variable-length array of +scatter/gather list elements. +The +.Nm sglist_alloc +function allocates a new list that contains a header and +.Fa nsegs +scatter/gather list elements. +The +.Fa mflags +argument can be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +.Pp +The +.Nm sglist_count +function returns the number of scatter/gather list elements needed to describe +the physical address ranges mapped by a single kernel virtual address range. +The kernel virtual address range starts at +.Fa buf +and is +.Fa len +bytes long. +.Pp +The +.Nm sglist_build +function allocates a new scatter/gather list object that describes the physical +address ranges mapped by a single kernel virtual address range. +The kernel virtual address range starts at +.Fa buf +and is +.Fa len +bytes long. +The +.Fa mflags +argument can be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +.Pp +The +.Nm sglist_clone +function returns a copy of an exising scatter/gather list object +.Fa sg . +The +.Fa mflags +argument can be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +This can be used to obtain a private copy of a scatter/gather list before +modifying it. +.Pp +The +.Nm sglist_init +function initializes a scatter/gather list header. +The header is pointed to by +.Fa sg +and is initialized to manage an array of +.Fa maxsegs +scatter/gather list elements pointed to by +.Fa segs . +This can be used to initialize a scatter/gather list header whose storage +is not provided by +.Nm sglist_alloc . +In that case, the caller should not call +.Nm sglist_free +to release its own reference and is responsible for ensuring all other +references to the list are dropped before it releases the storage for +.Fa sg +and +.Fa segs . +.Ss Constructing Scatter/Gather Lists +The +.Nm +API provides several routines for building a scatter/gather list to describe +one or more objects. +Specifically, the +.Nm sglist_append +family of routines can be used to append the physical address ranges described +by an object to the end of a scatter/gather list. +All of these routines return 0 on success or an error on failure. +.Pp +The +.Nm sglist_append +function appends the physical address ranges described by a single kernel +virtual address range to the scatter/gather list +.Fa sg . +The kernel virtual address range starts at +.Fa buf +and is +.Fa len +bytes long. +.Pp +The +.Nm sglist_append_mbuf +function appends the physical address ranges described by an entire mbuf +chain +.Fa m +to the scatter/gather list +.Fa sg . +.Pp +The +.Nm sglist_append_phys +function appends a single physical address range to the scatter/gather list +.Fa sg . +The physical address range starts at +.Fa paddr +and is +.Fa len +bytes long. +.Pp +The +.Nm sglist_append_uio +function appends the physical address ranges described by a +.Xr uio 9 +object to the scatter/gather list +.Fa sg . +Note that it is the caller's responsibility to ensure that the pages backing +the I/O request are wired for the lifetime of +.Fa sg . +Note also that this routine does not modify +.Fa uio . +.Pp +The +.Nm sglist_append_user +function appends the physical address ranges described by a single user +virtual address range to the scatter/gather list +.Fa sg . +The user virtual address range is relative to the address space of the thread +.Fa td . +It starts at +.Fa buf +and is +.Fa len +bytes long. +Note that it is the caller's responsibility to ensure that the pages backing +the user buffer are wired for the lifetime of +.Fa sg . +.Pp +The +.Nm sglist_consume_uio +function is a variation of +.Nm sglist_append_uio . +As with +.Nm sglist_append_uio , +it appends the physical address ranges described by +.Fa uio +to the scatter/gather list +.Fa sg . +Unlike +.Nm sglist_append_uio , +however, +.Nm sglist_consume_uio +modifies the I/O request to indicate that the appended address ranges have +been processed similar to calling +.Xr uiomove 9 . +This routine will only append ranges that describe up to +.Fa resid +total bytes in length. +If the available segments in the scatter/gather list are exhausted before +.Fa resid +bytes are processed, +then the +.Fa uio +structure will be updated to reflect the actual number of bytes processed, +and +.Nm sglist_consume_io +will return zero to indicate success. +In effect, this function will perform partial reads or writes. +The caller can compare the +.Fa uio_resid +member of +.Fa uio +before and after calling +.Nm sglist_consume_uio +to determine the actual number of bytes processed. +.Ss Manipulating Scatter/Gather Lists +The +.Nm sglist_join +function appends physical address ranges from the scatter/gather list +.Fa second +onto +.Fa first +and then resets +.Fa second +to an empty list. +It returns zero on success or an error on failure. +.Pp +The +.Nm sglist_split +function splits an existing scatter/gather list into two lists. +The first +.Fa length +bytes described by the list +.Fa original +are moved to a new list +.Fa *head . +If +.Fa original +describes a total address range that is smaller than +.Fa length +bytes, +then all of the address ranges will be moved to the new list at +.Fa *head +and +.Fa original +will be an empty list. +The caller may supply an existing scatter/gather list in +.Fa *head . +If so, the list must be empty. +Otherwise, the caller may set +.Fa *head +to +.Dv NULL +in which case a new scatter/gather list will be allocated. +In that case, +.Fa mflags +may be set to either +.Dv M_NOWAIT +or +.Dv M_WAITOK . +Note that since the +.Fa original +list is modified by this call, it must be a private list with no other +references. +The +.Nm sglist_split +function returns zero on success or an error on failure. +.Pp +The +.Nm sglist_slice +function generates a new scatter/gather list from a sub-range of an existing +scatter/gather list +.Fa original . +The sub-range to extract is specified by the +.Fa offset +and +.Fa length +parameters. +The new scatter/gather list is stored in +.Fa *slice . +As with +.Fa head +for +.Nm sglist_join , +the caller may either provide an empty scatter/gather list, +or it may set +.Fa *slice +to +.Dv NULL +in which case +.Nm sglist_slice +will allocate a new list subject to +.Fa mflags . +Unlike +.Nm sglist_split , +.Nm sglist_slice +does not modify +.Fa original +and does not require it to be a private list. +The +.Nm sglist_split +function returns zero on success or an error on failure. +.Ss Miscellaneous Routines +The +.Nm sglist_reset +function clears the scatter/gather list +.Fa sg +so that it no longer maps any address ranges. +This can allow reuse of a single scatter/gather list object for multiple +requests. +.Pp +The +.Nm sglist_length +function returns the total length of the physical address ranges described +by the scatter/gather list +.Fa sg . +.Sh RETURN VALUES +The +.Nm sglist_alloc , +.Nm sglist_build , +and +.Nm sglist_clone +functions return a new scatter/gather list on success or +.Dv NULL +on failure. +.Pp +The +.Nm sglist_append +family of functions and the +.Nm sglist_consume_uio , +.Nm sglist_join , +.Nm sglist_slice , +and +.Nm sglist_split +functions return zero on success or an error on failure. +.Pp +The +.Nm sglist_count +function returns a count of scatter/gather list elements. +.Pp +The +.Nm sglist_length +function returns a count of address space described by a scatter/gather list +in bytes. +.Sh ERRORS +The +.Nm sglist_append +functions return the following errors on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The scatter/gather list has zero segments. +.It Bq Er EFBIG +There are not enough available segments in the scatter/gather list to append +the specified physical address ranges. +.El +.Pp +The +.Nm sglist_consume_uio +function returns the following error on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The scatter/gather list has zero segments. +.El +.Pp +The +.Nm sglist_join +function returns the following error on failure: +.Bl -tag -width Er +.It Bq Er EFBIG +There are not enough available segments in the scatter/gather list +.Fa first +to append the physical address ranges from +.Fa second . +.El +The +.Nm sglist_slice +function returns the following errors on failure: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa original +scatter/gather list does not describe enough address space to cover the +requested sub-range. +.It Bq Er EINVAL +The caller-supplied scatter/gather list in +.Fa *slice +is not empty. +.It Bq Er ENOMEM +An attempt to allocate a new scatter/gather list with +.Dv M_NOWAIT +set in +.Fa mflags +failed. +.It Bq Er EFBIG +There are not enough available segments in the caller-supplied scatter/gather +list in +.Fa *slice +to describe the requested physical address ranges. +.El +The +.Nm sglist_split +function returns the following errors on failure: +.Bl -tag -width Er +.It Bq Er EDOOFUS +The +.Fa original +scatter/gather list has more than one reference. +.It Bq Er EINVAL +The caller-supplied scatter/gather list in +.Fa *head +is not empty. +.It Bq Er ENOMEM +An attempt to allocate a new scatter/gather list with +.Dv M_NOWAIT +set in +.Fa mflags +failed. +.It Bq Er EFBIG +There are not enough available segments in the caller-supplied scatter/gather +list in +.Fa *head +to describe the requested physical address ranges. +.El +.Sh SEE ALSO +.Xr malloc 9 , +.Xr mbuf 9 , +.Xr uio 9 +.Sh HISTORY +This API was first introduced in +.Fx 8.0 . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 1 20:35:09 2009 (r193259) +++ head/sys/conf/files Mon Jun 1 20:35:39 2009 (r193260) @@ -1994,6 +1994,7 @@ kern/subr_rman.c standard kern/subr_rtc.c standard kern/subr_sbuf.c standard kern/subr_scanf.c standard +kern/subr_sglist.c standard kern/subr_sleepqueue.c standard kern/subr_smp.c standard kern/subr_stack.c optional ddb | stack | ktr Added: head/sys/kern/subr_sglist.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_sglist.c Mon Jun 1 20:35:39 2009 (r193260) @@ -0,0 +1,656 @@ +/*- + * Copyright (c) 2008 Yahoo!, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 +#include + +#include +#include +#include + +#include + +static MALLOC_DEFINE(M_SGLIST, "sglist", "scatter/gather lists"); + +/* + * Append a single (paddr, len) to a sglist. sg is the list and ss is + * the current segment in the list. If we run out of segments then + * EFBIG will be returned. + */ +static __inline int +_sglist_append_range(struct sglist *sg, struct sglist_seg **ssp, + vm_paddr_t paddr, size_t len) +{ + struct sglist_seg *ss; + + ss = *ssp; + if (ss->ss_paddr + ss->ss_len == paddr) + ss->ss_len += len; + else { + if (sg->sg_nseg == sg->sg_maxseg) { + sg->sg_nseg = 0; + return (EFBIG); + } + ss++; + ss->ss_paddr = paddr; + ss->ss_len = len; + sg->sg_nseg++; + *ssp = ss; + } + return (0); +} + +/* + * Worker routine to append a virtual address range (either kernel or + * user) to a scatter/gather list. + */ +static __inline int +_sglist_append_buf(struct sglist *sg, void *buf, size_t len, pmap_t pmap, + size_t *donep) +{ + struct sglist_seg *ss; + vm_offset_t vaddr, offset; + vm_paddr_t paddr; + size_t seglen; + int error; + + if (donep) + *donep = 0; + if (len == 0) + return (0); + + /* Do the first page. It may have an offset. */ + vaddr = (vm_offset_t)buf; + offset = vaddr & PAGE_MASK; + if (pmap != NULL) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); + seglen = MIN(len, PAGE_SIZE - offset); + if (sg->sg_nseg == 0) { + ss = sg->sg_segs; + ss->ss_paddr = paddr; + ss->ss_len = seglen; + sg->sg_nseg = 1; + error = 0; + } else { + ss = &sg->sg_segs[sg->sg_nseg - 1]; + error = _sglist_append_range(sg, &ss, paddr, seglen); + } + + while (error == 0 && len > seglen) { + vaddr += seglen; + len -= seglen; + if (donep) + *donep += seglen; + seglen = MIN(len, PAGE_SIZE); + if (pmap != NULL) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); + error = _sglist_append_range(sg, &ss, paddr, seglen); + } + + return (error); +} + +/* + * Determine the number of scatter/gather list elements needed to + * describe a kernel virtual address range. + */ +int +sglist_count(void *buf, size_t len) +{ + vm_offset_t vaddr, vendaddr; + vm_paddr_t lastaddr, paddr; + int nsegs; + + if (len == 0) + return (0); + + vaddr = trunc_page((vm_offset_t)buf); + vendaddr = (vm_offset_t)buf + len; + nsegs = 1; + lastaddr = pmap_kextract(vaddr); + vaddr += PAGE_SIZE; + while (vaddr < vendaddr) { + paddr = pmap_kextract(vaddr); + if (lastaddr + PAGE_SIZE != paddr) + nsegs++; + lastaddr = paddr; + vaddr += PAGE_SIZE; + } + return (nsegs); +} + +/* + * Allocate a scatter/gather list along with 'nsegs' segments. The + * 'mflags' parameters are the same as passed to malloc(9). The caller + * should use sglist_free() to free this list. + */ +struct sglist * +sglist_alloc(int nsegs, int mflags) +{ + struct sglist *sg; + + sg = malloc(sizeof(struct sglist) + nsegs * sizeof(struct sglist_seg), + M_SGLIST, mflags); + if (sg == NULL) + return (NULL); + sglist_init(sg, nsegs, (struct sglist_seg *)(sg + 1)); + return (sg); +} + +/* + * Free a scatter/gather list allocated via sglist_allc(). + */ +void +sglist_free(struct sglist *sg) +{ + + if (refcount_release(&sg->sg_refs)) + free(sg, M_SGLIST); +} + +/* + * Append the segments to describe a single kernel virtual address + * range to a scatter/gather list. If there are insufficient + * segments, then this fails with EFBIG. + */ +int +sglist_append(struct sglist *sg, void *buf, size_t len) +{ + + if (sg->sg_maxseg == 0) + return (EINVAL); + return (_sglist_append_buf(sg, buf, len, NULL, NULL)); +} + +/* + * Append a single physical address range to a scatter/gather list. + * If there are insufficient segments, then this fails with EFBIG. + */ +int +sglist_append_phys(struct sglist *sg, vm_paddr_t paddr, size_t len) +{ + struct sglist_seg *ss; + + if (sg->sg_maxseg == 0) + return (EINVAL); + if (len == 0) + return (0); + + if (sg->sg_nseg == 0) { + sg->sg_segs[0].ss_paddr = paddr; + sg->sg_segs[0].ss_len = len; + sg->sg_nseg = 1; + return (0); + } + ss = &sg->sg_segs[sg->sg_nseg - 1]; + return (_sglist_append_range(sg, &ss, paddr, len)); +} + +/* + * Append the segments that describe a single mbuf chain to a + * scatter/gather list. If there are insufficient segments, then this + * fails with EFBIG. + */ +int +sglist_append_mbuf(struct sglist *sg, struct mbuf *m0) +{ + struct mbuf *m; + int error; + + if (sg->sg_maxseg == 0) + return (EINVAL); + + error = 0; + for (m = m0; m != NULL; m = m->m_next) { + if (m->m_len > 0) { + error = sglist_append(sg, m->m_data, m->m_len); + if (error) + return (error); + } + } + return (0); +} + +/* + * Append the segments that describe a single user address range to a + * scatter/gather list. If there are insufficient segments, then this + * fails with EFBIG. + */ +int +sglist_append_user(struct sglist *sg, void *buf, size_t len, struct thread *td) +{ + + if (sg->sg_maxseg == 0) + return (EINVAL); + return (_sglist_append_buf(sg, buf, len, + vmspace_pmap(td->td_proc->p_vmspace), NULL)); +} + +/* + * Append the segments that describe a single uio to a scatter/gather + * list. If there are insufficient segments, then this fails with + * EFBIG. + */ +int +sglist_append_uio(struct sglist *sg, struct uio *uio) +{ + struct iovec *iov; + size_t resid, minlen; + pmap_t pmap; + int error, i; + + if (sg->sg_maxseg == 0) + return (EINVAL); + + resid = uio->uio_resid; + iov = uio->uio_iov; + + if (uio->uio_segflg == UIO_USERSPACE) { + KASSERT(uio->uio_td != NULL, + ("sglist_append_uio: USERSPACE but no thread")); + pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); + } else + pmap = NULL; + + error = 0; + for (i = 0; i < uio->uio_iovcnt && resid != 0; i++) { + /* + * Now at the first iovec to load. Load each iovec + * until we have exhausted the residual count. + */ + minlen = MIN(resid, iov[i].iov_len); + if (minlen > 0) { + error = _sglist_append_buf(sg, iov[i].iov_base, minlen, + pmap, NULL); + if (error) + return (error); + resid -= minlen; + } + } + return (0); +} + +/* + * Append the segments that describe at most 'resid' bytes from a + * single uio to a scatter/gather list. If there are insufficient + * segments, then only the amount that fits is appended. + */ +int +sglist_consume_uio(struct sglist *sg, struct uio *uio, int resid) +{ + struct iovec *iov; + size_t done; + pmap_t pmap; + int error, len; + + if (sg->sg_maxseg == 0) + return (EINVAL); + + if (uio->uio_segflg == UIO_USERSPACE) { + KASSERT(uio->uio_td != NULL, + ("sglist_consume_uio: USERSPACE but no thread")); + pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); + } else + pmap = NULL; + + error = 0; + while (resid > 0 && uio->uio_resid) { + iov = uio->uio_iov; + len = iov->iov_len; + if (len == 0) { + uio->uio_iov++; + uio->uio_iovcnt--; + continue; + } + if (len > resid) + len = resid; + + /* + * Try to append this iovec. If we run out of room, + * then break out of the loop. + */ + error = _sglist_append_buf(sg, iov->iov_base, len, pmap, &done); + iov->iov_base = (char *)iov->iov_base + done; + iov->iov_len -= done; + uio->uio_resid -= done; + uio->uio_offset += done; + resid -= done; + if (error) + break; + } + return (0); +} + +/* + * Allocate and populate a scatter/gather list to describe a single + * kernel virtual address range. + */ +struct sglist * +sglist_build(void *buf, size_t len, int mflags) +{ + struct sglist *sg; + int nsegs; + + if (len == 0) + return (NULL); + + nsegs = sglist_count(buf, len); + sg = sglist_alloc(nsegs, mflags); + if (sg == NULL) + return (NULL); + if (sglist_append(sg, buf, len) != 0) { + sglist_free(sg); + return (NULL); + } + return (sg); +} + +/* + * Clone a new copy of a scatter/gather list. + */ +struct sglist * +sglist_clone(struct sglist *sg, int mflags) +{ + struct sglist *new; + + if (sg == NULL) + return (NULL); + new = sglist_alloc(sg->sg_maxseg, mflags); + if (new == NULL) + return (NULL); + bcopy(sg->sg_segs, new->sg_segs, sizeof(struct sglist_seg) * + sg->sg_nseg); + return (new); +} + +/* + * Calculate the total length of the segments described in a + * scatter/gather list. + */ +size_t +sglist_length(struct sglist *sg) +{ + size_t space; + int i; + + space = 0; + for (i = 0; i < sg->sg_nseg; i++) + space += sg->sg_segs[i].ss_len; + return (space); +} + +/* + * Split a scatter/gather list into two lists. The scatter/gather + * entries for the first 'length' bytes of the 'original' list are + * stored in the '*head' list and are removed from 'original'. + * + * If '*head' is NULL, then a new list will be allocated using + * 'mflags'. If M_NOWAIT is specified and the allocation fails, + * ENOMEM will be returned. + * + * If '*head' is not NULL, it should point to an empty sglist. If it + * does not have enough room for the remaining space, then EFBIG will + * be returned. If '*head' is not empty, then EINVAL will be + * returned. + * + * If 'original' is shared (refcount > 1), then EDOOFUS will be + * returned. + */ +int +sglist_split(struct sglist *original, struct sglist **head, size_t length, + int mflags) +{ + struct sglist *sg; + size_t space, split; + int count, i; + + if (original->sg_refs > 1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From dchagin at FreeBSD.org Mon Jun 1 20:42:28 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Mon Jun 1 20:42:40 2009 Subject: svn commit: r193262 - head/sys/compat/linux Message-ID: <200906012042.n51KgSc5091261@svn.freebsd.org> Author: dchagin Date: Mon Jun 1 20:42:27 2009 New Revision: 193262 URL: http://svn.freebsd.org/changeset/base/193262 Log: Split linux_accept() syscall onto linux_accept_common() which should be used by linuxulator and linux_accept() itself. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:41:33 2009 (r193261) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:42:27 2009 (r193262) @@ -763,14 +763,9 @@ linux_listen(struct thread *td, struct l return (listen(td, &bsd_args)); } -struct linux_accept_args { - int s; - l_uintptr_t addr; - l_uintptr_t namelen; -}; - static int -linux_accept(struct thread *td, struct linux_accept_args *args) +linux_accept_common(struct thread *td, int s, l_uintptr_t addr, + l_uintptr_t namelen) { struct accept_args /* { int s; @@ -779,19 +774,19 @@ linux_accept(struct thread *td, struct l } */ bsd_args; int error, fd; - bsd_args.s = args->s; + bsd_args.s = s; /* XXX: */ - bsd_args.name = (struct sockaddr * __restrict)PTRIN(args->addr); - bsd_args.anamelen = PTRIN(args->namelen);/* XXX */ + bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr); + bsd_args.anamelen = PTRIN(namelen);/* XXX */ error = accept(td, &bsd_args); bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.name); if (error) { - if (error == EFAULT && args->namelen != sizeof(struct sockaddr_in)) + if (error == EFAULT && namelen != sizeof(struct sockaddr_in)) return (EINVAL); return (error); } - if (args->addr) { - error = linux_sa_put(PTRIN(args->addr)); + if (addr) { + error = linux_sa_put(PTRIN(addr)); if (error) { (void)kern_close(td, td->td_retval[0]); return (error); @@ -809,6 +804,20 @@ linux_accept(struct thread *td, struct l return (0); } +struct linux_accept_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; +}; + +static int +linux_accept(struct thread *td, struct linux_accept_args *args) +{ + + return (linux_accept_common(td, args->s, args->addr, + args->namelen)); +} + struct linux_getsockname_args { int s; l_uintptr_t addr; From dchagin at FreeBSD.org Mon Jun 1 20:44:59 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Mon Jun 1 20:45:11 2009 Subject: svn commit: r193263 - head/sys/compat/linux Message-ID: <200906012044.n51Kiwxd091373@svn.freebsd.org> Author: dchagin Date: Mon Jun 1 20:44:58 2009 New Revision: 193263 URL: http://svn.freebsd.org/changeset/base/193263 Log: Implement a variation of the accept_common() which takes a flags argument. Do not preserve td_retval before kern_fcntl(F_SETFL) as it does not changed. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:42:27 2009 (r193262) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:44:58 2009 (r193263) @@ -772,7 +772,10 @@ linux_accept_common(struct thread *td, i struct sockaddr * __restrict name; socklen_t * __restrict anamelen; } */ bsd_args; - int error, fd; + int error; + + if (flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) + return (EINVAL); bsd_args.s = s; /* XXX: */ @@ -785,23 +788,27 @@ linux_accept_common(struct thread *td, i return (EINVAL); return (error); } - if (addr) { - error = linux_sa_put(PTRIN(addr)); - if (error) { - (void)kern_close(td, td->td_retval[0]); - return (error); - } - } /* * linux appears not to copy flags from the parent socket to the - * accepted one, so we must clear the flags in the new descriptor. - * Ignore any errors, because we already have an open fd. + * accepted one, so we must clear the flags in the new descriptor + * and apply the requested flags. */ - fd = td->td_retval[0]; - (void)kern_fcntl(td, fd, F_SETFL, 0); - td->td_retval[0] = fd; - return (0); + error = kern_fcntl(td, td->td_retval[0], F_SETFL, 0); + if (error) + goto out; + error = linux_set_socket_flags(td, td->td_retval[0], flags); + if (error) + goto out; + if (addr) + error = linux_sa_put(PTRIN(addr)); + +out: + if (error) { + (void)kern_close(td, td->td_retval[0]); + td->td_retval[0] = 0; + } + return (error); } struct linux_accept_args { From dchagin at FreeBSD.org Mon Jun 1 20:48:40 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Mon Jun 1 20:48:51 2009 Subject: svn commit: r193264 - in head/sys: amd64/linux32 compat/linux i386/linux Message-ID: <200906012048.n51KmeAi091488@svn.freebsd.org> Author: dchagin Date: Mon Jun 1 20:48:39 2009 New Revision: 193264 URL: http://svn.freebsd.org/changeset/base/193264 Log: Implement accept4 syscall. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/amd64/linux32/linux.h head/sys/compat/linux/linux_socket.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/amd64/linux32/linux.h Mon Jun 1 20:48:39 2009 (r193264) @@ -669,6 +669,7 @@ union l_semun { #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 +#define LINUX_ACCEPT4 18 #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:48:39 2009 (r193264) @@ -825,6 +825,21 @@ linux_accept(struct thread *td, struct l args->namelen)); } +struct linux_accept4_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; + int flags; +}; + +static int +linux_accept4(struct thread *td, struct linux_accept4_args *args) +{ + + return (linux_accept_common(td, args->s, args->addr, + args->namelen, args->flags)); +} + struct linux_getsockname_args { int s; l_uintptr_t addr; @@ -1528,7 +1543,8 @@ static const unsigned char lxs_args[] = LINUX_AL(4) /* recv */, LINUX_AL(6) /* sendto */, LINUX_AL(6) /* recvfrom */, LINUX_AL(2) /* shutdown */, LINUX_AL(5) /* setsockopt */, LINUX_AL(5) /* getsockopt */, - LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */ + LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */, + LINUX_AL(4) /* accept4 */ }; #define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1 @@ -1582,6 +1598,8 @@ linux_socketcall(struct thread *td, stru return (linux_sendmsg(td, arg)); case LINUX_RECVMSG: return (linux_recvmsg(td, arg)); + case LINUX_ACCEPT4: + return (linux_accept4(td, arg)); } uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what); Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Mon Jun 1 20:44:58 2009 (r193263) +++ head/sys/i386/linux/linux.h Mon Jun 1 20:48:39 2009 (r193264) @@ -645,6 +645,7 @@ union l_semun { #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 +#define LINUX_ACCEPT4 18 #define LINUX_SOL_SOCKET 1 #define LINUX_SOL_IP 0 From dchagin at FreeBSD.org Mon Jun 1 20:54:42 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Mon Jun 1 20:54:48 2009 Subject: svn commit: r193265 - head/sys/compat/linux Message-ID: <200906012054.n51KsfPt091635@svn.freebsd.org> Author: dchagin Date: Mon Jun 1 20:54:41 2009 New Revision: 193265 URL: http://svn.freebsd.org/changeset/base/193265 Log: Add forgotten in previous commit flags argument. Approved by: kib (mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Jun 1 20:48:39 2009 (r193264) +++ head/sys/compat/linux/linux_socket.c Mon Jun 1 20:54:41 2009 (r193265) @@ -765,7 +765,7 @@ linux_listen(struct thread *td, struct l static int linux_accept_common(struct thread *td, int s, l_uintptr_t addr, - l_uintptr_t namelen) + l_uintptr_t namelen, int flags) { struct accept_args /* { int s; @@ -822,7 +822,7 @@ linux_accept(struct thread *td, struct l { return (linux_accept_common(td, args->s, args->addr, - args->namelen)); + args->namelen, 0)); } struct linux_accept4_args { From zec at FreeBSD.org Mon Jun 1 20:59:41 2009 From: zec at FreeBSD.org (Marko Zec) Date: Mon Jun 1 20:59:52 2009 Subject: svn commit: r193266 - head/sys/netinet6 Message-ID: <200906012059.n51Kxe1l091789@svn.freebsd.org> Author: zec Date: Mon Jun 1 20:59:40 2009 New Revision: 193266 URL: http://svn.freebsd.org/changeset/base/193266 Log: Remove an #undef MIN that slipped under the radar and led me to hastily introduce an #define MIN() a few lines below in r191816. Approved by: julian (mentor) Discussed with: bz Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 1 20:54:41 2009 (r193265) +++ head/sys/netinet6/nd6.c Mon Jun 1 20:59:40 2009 (r193266) @@ -281,7 +281,6 @@ nd6_setmtu0(struct ifnet *ifp, struct nd if (ndi->maxmtu > V_in6_maxmtu) in6_setmaxmtu(); /* check all interfaces just in case */ -#undef MIN } void @@ -489,14 +488,6 @@ nd6_llinfo_timer(void *arg) if ((ifp = ((ln->lle_tbl != NULL) ? ln->lle_tbl->llt_ifp : NULL)) == NULL) panic("ln ifp == NULL"); -/* - * XXX XXX XXX XXX XXX - * - * Why the ^%(@)*&%^) is this #define MIN() needed for CURVNET_SET()?!? - * And #define MIN() is in sys/param.h already, which is #included first - * here?!? - */ -#define MIN(a,b) (((a)<(b))?(a):(b)) CURVNET_SET(ifp->if_vnet); INIT_VNET_INET6(curvnet); From delphij at delphij.net Mon Jun 1 21:02:02 2009 From: delphij at delphij.net (Xin LI) Date: Mon Jun 1 21:02:15 2009 Subject: svn commit: r193245 - head/sys/dev/aic7xxx/aicasm In-Reply-To: <20090601201621.GA35383@freebsd.org> References: <200906011843.n51IhXt4087781@svn.freebsd.org> <4A242282.4030404@FreeBSD.org> <20090601184937.GA24177@freebsd.org> <20090601185532.GA24838@freebsd.org> <4A242771.3090605@delphij.net> <20090601201621.GA35383@freebsd.org> Message-ID: <4A24417C.9060509@delphij.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roman Divacky wrote: [...] >>> you build the kernel with -std=gnu99 instead of -std=c99. which is a bug. I am >>> trying to fix this. if anyone has any idea please mail me.. >> This is strange... Let me take a look at this, I have reverted the >> WARNS?=6 change for now. > > oh.. sorry. this has nothing to do with this commit. I just noticed it in > doug's reply.. The commit itself has a problem :) I'll correct it before marking this back to WARNS=6. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkokQXsACgkQi+vbBBjt66DrKACdH90YE8KyOq+lmN8adEBP50Yz ZyEAoLVQvb95bpC2jQCF3YXpJh/roNkm =w4NO -----END PGP SIGNATURE----- From delphij at FreeBSD.org Mon Jun 1 21:07:55 2009 From: delphij at FreeBSD.org (Xin LI) Date: Mon Jun 1 21:08:34 2009 Subject: svn commit: r193268 - head/sys/dev/aic7xxx/aicasm Message-ID: <200906012107.n51L7slY092073@svn.freebsd.org> Author: delphij Date: Mon Jun 1 21:07:54 2009 New Revision: 193268 URL: http://svn.freebsd.org/changeset/base/193268 Log: Initialize the match structure. This is unnecessary but gcc insists to complain about it when we raise the WARNS level. Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 21:02:40 2009 (r193267) +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Mon Jun 1 21:07:54 2009 (r193268) @@ -516,6 +516,7 @@ expand_macro(struct symbol *macro_symbol const char *body_head; const char *body_pos; const char *next_match; + regmatch_t match = { .rm_so = 0, .rm_eo = 0 }; /* * Due to the nature of unput, we must work @@ -525,8 +526,6 @@ expand_macro(struct symbol *macro_symbol body_head = macro_symbol->info.macroinfo->body; body_pos = body_head + strlen(body_head); while (body_pos > body_head) { - regmatch_t match; - next_match = body_head; match_marg = NULL; next_substitution(macro_symbol, body_pos, &next_match, From zec at FreeBSD.org Mon Jun 1 21:10:24 2009 From: zec at FreeBSD.org (Marko Zec) Date: Mon Jun 1 21:10:31 2009 Subject: svn commit: r193270 - head/sys/dev/cxgb/ulp/tom Message-ID: <200906012110.n51LANuj092212@svn.freebsd.org> Author: zec Date: Mon Jun 1 21:10:23 2009 New Revision: 193270 URL: http://svn.freebsd.org/changeset/base/193270 Log: Update VNET base pointer setting macro to use a correct source of vnet context. Approved by: julian (mentor) Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Jun 1 21:10:19 2009 (r193269) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Jun 1 21:10:23 2009 (r193270) @@ -1219,7 +1219,7 @@ install_offload_ops(struct socket *so) static __inline int select_rcv_wscale(int space, struct vnet *vnet) { - INIT_VNET_INET(so->so_vnet); + INIT_VNET_INET(vnet); int wscale = 0; if (space > MAX_RCV_WND) From jhb at FreeBSD.org Mon Jun 1 21:17:04 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 1 21:17:18 2009 Subject: svn commit: r193272 - in head/sys: dev/cxgb/ulp/iw_cxgb kern netgraph netgraph/bluetooth/socket netinet netsmb nfsclient nfsserver rpc sys Message-ID: <200906012117.n51LH3F8092452@svn.freebsd.org> Author: jhb Date: Mon Jun 1 21:17:03 2009 New Revision: 193272 URL: http://svn.freebsd.org/changeset/base/193272 Log: Rework socket upcalls to close some races with setup/teardown of upcalls. - Each socket upcall is now invoked with the appropriate socket buffer locked. It is not permissible to call soisconnected() with this lock held; however, so socket upcalls now return an integer value. The two possible values are SU_OK and SU_ISCONNECTED. If an upcall returns SU_ISCONNECTED, then the soisconnected() will be invoked on the socket after the socket buffer lock is dropped. - A new API is provided for setting and clearing socket upcalls. The API consists of soupcall_set() and soupcall_clear(). - To simplify locking, each socket buffer now has a separate upcall. - When a socket upcall returns SU_ISCONNECTED, the upcall is cleared from the receive socket buffer automatically. Note that a SO_SND upcall should never return SU_ISCONNECTED. - All this means that accept filters should now return SU_ISCONNECTED instead of calling soisconnected() directly. They also no longer need to explicitly clear the upcall on the new socket. - The HTTP accept filter still uses soupcall_set() to manage its internal state machine, but other accept filters no longer have any explicit knowlege of socket upcall internals aside from their return value. - The various RPC client upcalls currently drop the socket buffer lock while invoking soreceive() as a temporary band-aid. The plan for the future is to add a new flag to allow soreceive() to be called with the socket buffer locked. - The AIO callback for socket I/O is now also invoked with the socket buffer locked. Previously sowakeup() would drop the socket buffer lock only to call aio_swake() which immediately re-acquired the socket buffer lock for the duration of the function call. Discussed with: rwatson, rmacklem Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/kern/vfs_aio.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/ng_ksocket.c head/sys/netinet/accf_data.c head/sys/netinet/accf_dns.c head/sys/netinet/accf_http.c head/sys/netsmb/smb_trantcp.c head/sys/nfsclient/nfs_socket.c head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_srvsock.c head/sys/nfsserver/nfs_syscalls.c head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c head/sys/rpc/svc_dg.c head/sys/rpc/svc_vc.c head/sys/sys/sockbuf.h head/sys/sys/socketvar.h Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Mon Jun 1 21:17:03 2009 (r193272) @@ -141,7 +141,7 @@ SYSCTL_UINT(_hw_cxgb, OID_AUTO, cong_fla static void ep_timeout(void *arg); static void connect_reply_upcall(struct iwch_ep *ep, int status); -static void iwch_so_upcall(struct socket *so, void *arg, int waitflag); +static int iwch_so_upcall(struct socket *so, void *arg, int waitflag); /* * Cruft to offload socket upcalls onto thread. @@ -335,9 +335,7 @@ close_socket(struct iwch_ep_common *epc) { CTR4(KTR_IW_CXGB, "%s ep %p so %p state %s", __FUNCTION__, epc, epc->so, states[epc->state]); SOCK_LOCK(epc->so); - epc->so->so_upcall = NULL; - epc->so->so_upcallarg = NULL; - epc->so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(epc->so, SO_RCV); SOCK_UNLOCK(epc->so); soshutdown(epc->so, SHUT_WR|SHUT_RD); epc->so = NULL; @@ -1108,7 +1106,7 @@ terminate(struct t3cdev *tdev, struct mb { struct toepcb *toep = (struct toepcb *)ctx; struct socket *so = toeptoso(toep); - struct iwch_ep *ep = so->so_upcallarg; + struct iwch_ep *ep = so->so_rcv.sb_upcallarg; CTR2(KTR_IW_CXGB, "%s ep %p", __FUNCTION__, ep); m_adj(m, sizeof(struct cpl_rdma_terminate)); @@ -1129,7 +1127,7 @@ ec_status(struct t3cdev *tdev, struct mb struct iwch_qp_attributes attrs; int release = 0; - ep = so->so_upcallarg; + ep = so->so_rcv.sb_upcallarg; CTR5(KTR_IW_CXGB, "%s ep %p so %p state %s ec_status %d", __FUNCTION__, ep, ep->com.so, states[ep->com.state], rep->status); if (!so || !ep) { panic("bogosity ep %p state %d, so %p state %x\n", ep, ep ? ep->com.state : -1, so, so ? so->so_state : -1); @@ -1309,10 +1307,10 @@ static int init_sock(struct iwch_ep_comm struct sockopt sopt; int on=1; - epc->so->so_upcall = iwch_so_upcall; - epc->so->so_upcallarg = epc; - epc->so->so_rcv.sb_flags |= SB_UPCALL; + SOCK_LOCK(epc->so); + soupcall_set(epc->so, SO_RCV, iwch_so_upcall, epc); epc->so->so_state |= SS_NBIO; + SOCK_UNLOCK(epc->so); sopt.sopt_dir = SOPT_SET; sopt.sopt_level = SOL_SOCKET; sopt.sopt_name = SO_NO_DDP; @@ -1611,10 +1609,8 @@ dequeue_socket(struct socket *head, stru so->so_qstate &= ~SQ_COMP; so->so_head = NULL; soref(so); - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, iwch_so_upcall, child_ep); so->so_state |= SS_NBIO; - so->so_upcall = iwch_so_upcall; - so->so_upcallarg = child_ep; PANIC_IF(!(so->so_state & SS_ISCONNECTED)); PANIC_IF(so->so_error); SOCK_UNLOCK(so); @@ -1661,7 +1657,7 @@ process_newconn(struct iwch_ep *parent_e process_mpa_request(child_ep); } -static void +static int iwch_so_upcall(struct socket *so, void *arg, int waitflag) { struct iwch_ep *ep = arg; @@ -1674,6 +1670,7 @@ iwch_so_upcall(struct socket *so, void * taskqueue_enqueue(iw_cxgb_taskq, &iw_cxgb_task); } mtx_unlock(&req_lock); + return (SU_OK); } static void Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/kern/uipc_sockbuf.c Mon Jun 1 21:17:03 2009 (r193272) @@ -175,6 +175,7 @@ sbunlock(struct sockbuf *sb) void sowakeup(struct socket *so, struct sockbuf *sb) { + int ret; SOCKBUF_LOCK_ASSERT(sb); @@ -186,13 +187,22 @@ sowakeup(struct socket *so, struct sockb wakeup(&sb->sb_cc); } KNOTE_LOCKED(&sb->sb_sel.si_note, 0); + if (sb->sb_upcall != NULL) { + ret = sb->sb_upcall(so, sb->sb_upcallarg, M_DONTWAIT); + if (ret == SU_ISCONNECTED) { + KASSERT(sb == &so->so_rcv, + ("SO_SND upcall returned SU_ISCONNECTED")); + soupcall_clear(so, SO_RCV); + } + } else + ret = SU_OK; + if (sb->sb_flags & SB_AIO) + aio_swake(so, sb); SOCKBUF_UNLOCK(sb); + if (ret == SU_ISCONNECTED) + soisconnected(so); if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL) pgsigio(&so->so_sigio, SIGIO, 0); - if (sb->sb_flags & SB_UPCALL) - (*so->so_upcall)(so, so->so_upcallarg, M_DONTWAIT); - if (sb->sb_flags & SB_AIO) - aio_swake(so, sb); mtx_assert(SOCKBUF_MTX(sb), MA_NOTOWNED); } Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/kern/uipc_socket.c Mon Jun 1 21:17:03 2009 (r193272) @@ -3054,8 +3054,10 @@ soisconnecting(struct socket *so) void soisconnected(struct socket *so) { - struct socket *head; + struct socket *head; + int ret; +restart: ACCEPT_LOCK(); SOCK_LOCK(so); so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); @@ -3075,13 +3077,17 @@ soisconnected(struct socket *so) wakeup_one(&head->so_timeo); } else { ACCEPT_UNLOCK(); - so->so_upcall = - head->so_accf->so_accept_filter->accf_callback; - so->so_upcallarg = head->so_accf->so_accept_filter_arg; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, + head->so_accf->so_accept_filter->accf_callback, + head->so_accf->so_accept_filter_arg); so->so_options &= ~SO_ACCEPTFILTER; + ret = head->so_accf->so_accept_filter->accf_callback(so, + head->so_accf->so_accept_filter_arg, M_DONTWAIT); + if (ret == SU_ISCONNECTED) + soupcall_clear(so, SO_RCV); SOCK_UNLOCK(so); - so->so_upcall(so, so->so_upcallarg, M_DONTWAIT); + if (ret == SU_ISCONNECTED) + goto restart; } return; } @@ -3146,6 +3152,57 @@ sodupsockaddr(const struct sockaddr *sa, } /* + * Register per-socket buffer upcalls. + */ +void +soupcall_set(struct socket *so, int which, + int (*func)(struct socket *, void *, int), void *arg) +{ + struct sockbuf *sb; + + switch (which) { + case SO_RCV: + sb = &so->so_rcv; + break; + case SO_SND: + sb = &so->so_snd; + break; + default: + panic("soupcall_set: bad which"); + } + SOCKBUF_LOCK_ASSERT(sb); +#if 0 + /* XXX: accf_http actually wants to do this on purpose. */ + KASSERT(sb->sb_upcall == NULL, ("soupcall_set: overwriting upcall")); +#endif + sb->sb_upcall = func; + sb->sb_upcallarg = arg; + sb->sb_flags |= SB_UPCALL; +} + +void +soupcall_clear(struct socket *so, int which) +{ + struct sockbuf *sb; + + switch (which) { + case SO_RCV: + sb = &so->so_rcv; + break; + case SO_SND: + sb = &so->so_snd; + break; + default: + panic("soupcall_clear: bad which"); + } + SOCKBUF_LOCK_ASSERT(sb); + KASSERT(sb->sb_upcall != NULL, ("soupcall_clear: no upcall to clear")); + sb->sb_upcall = NULL; + sb->sb_upcallarg = NULL; + sb->sb_flags &= ~SB_UPCALL; +} + +/* * Create an external-format (``xsocket'') structure using the information in * the kernel-format socket structure pointed to by so. This is done to * reduce the spew of irrelevant information over this interface, to isolate Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/kern/vfs_aio.c Mon Jun 1 21:17:03 2009 (r193272) @@ -1313,12 +1313,12 @@ aio_swake_cb(struct socket *so, struct s struct aiocblist *cb, *cbn; int opcode; + SOCKBUF_LOCK_ASSERT(sb); if (sb == &so->so_snd) opcode = LIO_WRITE; else opcode = LIO_READ; - SOCKBUF_LOCK(sb); sb->sb_flags &= ~SB_AIO; mtx_lock(&aio_job_mtx); TAILQ_FOREACH_SAFE(cb, &so->so_aiojobq, list, cbn) { @@ -1336,7 +1336,6 @@ aio_swake_cb(struct socket *so, struct s } } mtx_unlock(&aio_job_mtx); - SOCKBUF_UNLOCK(sb); } static int Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 1 21:17:03 2009 (r193272) @@ -93,7 +93,7 @@ MALLOC_DEFINE(M_NETGRAPH_BTSOCKET_RFCOMM #define ALOT 0x7fff /* Local prototypes */ -static void ng_btsocket_rfcomm_upcall +static int ng_btsocket_rfcomm_upcall (struct socket *so, void *arg, int waitflag); static void ng_btsocket_rfcomm_sessions_task (void *ctx, int pending); @@ -1007,7 +1007,7 @@ ng_btsocket_rfcomm_sockaddr(struct socke * Upcall function for L2CAP sockets. Enqueue RFCOMM task. */ -static void +static int ng_btsocket_rfcomm_upcall(struct socket *so, void *arg, int waitflag) { int error; @@ -1018,6 +1018,7 @@ ng_btsocket_rfcomm_upcall(struct socket if ((error = ng_btsocket_rfcomm_task_wakeup()) != 0) NG_BTSOCKET_RFCOMM_ALERT( "%s: Could not enqueue RFCOMM task, error=%d\n", __func__, error); + return (SU_OK); } /* ng_btsocket_rfcomm_upcall */ /* @@ -1047,13 +1048,11 @@ ng_btsocket_rfcomm_sessions_task(void *c panic("%s: DLC list is not empty\n", __func__); /* Close L2CAP socket */ - s->l2so->so_upcallarg = NULL; - s->l2so->so_upcall = NULL; SOCKBUF_LOCK(&s->l2so->so_rcv); - s->l2so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_RCV); SOCKBUF_UNLOCK(&s->l2so->so_rcv); SOCKBUF_LOCK(&s->l2so->so_snd); - s->l2so->so_snd.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_SND); SOCKBUF_UNLOCK(&s->l2so->so_snd); soclose(s->l2so); @@ -1286,13 +1285,11 @@ ng_btsocket_rfcomm_session_create(ng_bts LIST_INIT(&s->dlcs); /* Prepare L2CAP socket */ - l2so->so_upcallarg = NULL; - l2so->so_upcall = ng_btsocket_rfcomm_upcall; SOCKBUF_LOCK(&l2so->so_rcv); - l2so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(l2so, SO_RCV, ng_btsocket_rfcomm_upcall, NULL); SOCKBUF_UNLOCK(&l2so->so_rcv); SOCKBUF_LOCK(&l2so->so_snd); - l2so->so_snd.sb_flags |= SB_UPCALL; + soupcall_set(l2so, SO_SND, ng_btsocket_rfcomm_upcall, NULL); SOCKBUF_UNLOCK(&l2so->so_snd); l2so->so_state |= SS_NBIO; s->l2so = l2so; @@ -1370,13 +1367,11 @@ bad: mtx_unlock(&s->session_mtx); /* Return L2CAP socket back to its original state */ - l2so->so_upcallarg = NULL; - l2so->so_upcall = NULL; SOCKBUF_LOCK(&l2so->so_rcv); - l2so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_RCV); SOCKBUF_UNLOCK(&l2so->so_rcv); SOCKBUF_LOCK(&l2so->so_snd); - l2so->so_snd.sb_flags &= ~SB_UPCALL; + soupcall_clear(s->l2so, SO_SND); SOCKBUF_UNLOCK(&l2so->so_snd); l2so->so_state &= ~SS_NBIO; Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netgraph/ng_ksocket.c Mon Jun 1 21:17:03 2009 (r193272) @@ -158,7 +158,7 @@ static const struct ng_ksocket_alias ng_ /* Helper functions */ static int ng_ksocket_check_accept(priv_p); static void ng_ksocket_finish_accept(priv_p); -static void ng_ksocket_incoming(struct socket *so, void *arg, int waitflag); +static int ng_ksocket_incoming(struct socket *so, void *arg, int waitflag); static int ng_ksocket_parse(const struct ng_ksocket_alias *aliases, const char *s, int family); static void ng_ksocket_incoming2(node_p node, hook_p hook, @@ -616,13 +616,11 @@ ng_ksocket_connect(hook_p hook) struct socket *const so = priv->so; /* Add our hook for incoming data and other events */ - priv->so->so_upcallarg = (caddr_t)node; - priv->so->so_upcall = ng_ksocket_incoming; SOCKBUF_LOCK(&priv->so->so_rcv); - priv->so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(priv->so, SO_RCV, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&priv->so->so_rcv); SOCKBUF_LOCK(&priv->so->so_snd); - priv->so->so_snd.sb_flags |= SB_UPCALL; + soupcall_set(priv->so, SO_SND, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&priv->so->so_snd); SOCK_LOCK(priv->so); priv->so->so_state |= SS_NBIO; @@ -941,12 +939,11 @@ ng_ksocket_shutdown(node_p node) /* Close our socket (if any) */ if (priv->so != NULL) { SOCKBUF_LOCK(&priv->so->so_rcv); - priv->so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(priv->so, SO_RCV); SOCKBUF_UNLOCK(&priv->so->so_rcv); SOCKBUF_LOCK(&priv->so->so_snd); - priv->so->so_snd.sb_flags &= ~SB_UPCALL; + soupcall_clear(priv->so, SO_SND); SOCKBUF_UNLOCK(&priv->so->so_snd); - priv->so->so_upcall = NULL; soclose(priv->so); priv->so = NULL; } @@ -1000,7 +997,7 @@ ng_ksocket_disconnect(hook_p hook) * To decouple stack, we use queue version of ng_send_fn(). */ -static void +static int ng_ksocket_incoming(struct socket *so, void *arg, int waitflag) { const node_p node = arg; @@ -1017,6 +1014,7 @@ ng_ksocket_incoming(struct socket *so, v ng_send_fn1(node, NULL, &ng_ksocket_incoming2, so, 0, wait)) { atomic_store_rel_int(&priv->fn_sent, 0); } + return (SU_OK); } @@ -1258,13 +1256,11 @@ ng_ksocket_finish_accept(priv_p priv) */ LIST_INSERT_HEAD(&priv->embryos, priv2, siblings); - so->so_upcallarg = (caddr_t)node; - so->so_upcall = ng_ksocket_incoming; SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&so->so_rcv); SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, ng_ksocket_incoming, node); SOCKBUF_UNLOCK(&so->so_snd); /* Fill in the response data and send it or return it to the caller */ Modified: head/sys/netinet/accf_data.c ============================================================================== --- head/sys/netinet/accf_data.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netinet/accf_data.c Mon Jun 1 21:17:03 2009 (r193272) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); /* accept filter that holds a socket until data arrives */ -static void sohasdata(struct socket *so, void *arg, int waitflag); +static int sohasdata(struct socket *so, void *arg, int waitflag); static struct accept_filter accf_data_filter = { "dataready", @@ -55,15 +55,12 @@ static moduledata_t accf_data_mod = { DECLARE_MODULE(accf_data, accf_data_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -static void +static int sohasdata(struct socket *so, void *arg, int waitflag) { if (!soreadable(so)) - return; + return (SU_OK); - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } Modified: head/sys/netinet/accf_dns.c ============================================================================== --- head/sys/netinet/accf_dns.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netinet/accf_dns.c Mon Jun 1 21:17:03 2009 (r193272) @@ -37,7 +37,7 @@ #include /* check for full DNS request */ -static void sohasdns(struct socket *so, void *arg, int waitflag); +static int sohasdns(struct socket *so, void *arg, int waitflag); struct packet { struct mbuf *m; /* Current mbuf. */ @@ -69,7 +69,7 @@ static moduledata_t accf_dns_mod = { DECLARE_MODULE(accf_dns, accf_dns_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -static void +static int sohasdns(struct socket *so, void *arg, int waitflag) { struct sockbuf *sb = &so->so_rcv; @@ -80,13 +80,10 @@ sohasdns(struct socket *so, void *arg, i /* Check to see if we have a request. */ if (skippacket(sb) == DNS_WAIT) - return; + return (SU_OK); ready: - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } #define GET8(p, val) do { \ Modified: head/sys/netinet/accf_http.c ============================================================================== --- head/sys/netinet/accf_http.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netinet/accf_http.c Mon Jun 1 21:17:03 2009 (r193272) @@ -39,11 +39,11 @@ __FBSDID("$FreeBSD$"); #include /* check for GET/HEAD */ -static void sohashttpget(struct socket *so, void *arg, int waitflag); +static int sohashttpget(struct socket *so, void *arg, int waitflag); /* check for HTTP/1.0 or HTTP/1.1 */ -static void soparsehttpvers(struct socket *so, void *arg, int waitflag); +static int soparsehttpvers(struct socket *so, void *arg, int waitflag); /* check for end of HTTP/1.x request */ -static void soishttpconnected(struct socket *so, void *arg, int waitflag); +static int soishttpconnected(struct socket *so, void *arg, int waitflag); /* strcmp on an mbuf chain */ static int mbufstrcmp(struct mbuf *m, struct mbuf *npkt, int offset, char *cmp); /* strncmp on an mbuf chain */ @@ -158,7 +158,7 @@ mbufstrncmp(struct mbuf *m, struct mbuf slen = sizeof(str) - 1; \ } while(0) -static void +static int sohashttpget(struct socket *so, void *arg, int waitflag) { @@ -170,7 +170,7 @@ sohashttpget(struct socket *so, void *ar m = so->so_rcv.sb_mb; cc = so->so_rcv.sb_cc - 1; if (cc < 1) - return; + return (SU_OK); switch (*mtod(m, char *)) { case 'G': STRSETUP(cmp, cmplen, "ET "); @@ -184,7 +184,7 @@ sohashttpget(struct socket *so, void *ar if (cc < cmplen) { if (mbufstrncmp(m, m->m_nextpkt, 1, cc, cmp) == 1) { DPRINT("short cc (%d) but mbufstrncmp ok", cc); - return; + return (SU_OK); } else { DPRINT("short cc (%d) mbufstrncmp failed", cc); goto fallout; @@ -193,23 +193,19 @@ sohashttpget(struct socket *so, void *ar if (mbufstrcmp(m, m->m_nextpkt, 1, cmp) == 1) { DPRINT("mbufstrcmp ok"); if (parse_http_version == 0) - soishttpconnected(so, arg, waitflag); + return (soishttpconnected(so, arg, waitflag)); else - soparsehttpvers(so, arg, waitflag); - return; + return (soparsehttpvers(so, arg, waitflag)); } DPRINT("mbufstrcmp bad"); } fallout: DPRINT("fallout"); - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } -static void +static int soparsehttpvers(struct socket *so, void *arg, int waitflag) { struct mbuf *m, *n; @@ -261,10 +257,9 @@ soparsehttpvers(struct socket *so, void } else if ( mbufstrcmp(m, n, i, "HTTP/1.0") || mbufstrcmp(m, n, i, "HTTP/1.1")) { - DPRINT("ok"); - soishttpconnected(so, - arg, waitflag); - return; + DPRINT("ok"); + return (soishttpconnected(so, + arg, waitflag)); } else { DPRINT("bad"); goto fallout; @@ -279,22 +274,18 @@ readmore: * if we hit here we haven't hit something * we don't understand or a newline, so try again */ - so->so_upcall = soparsehttpvers; - so->so_rcv.sb_flags |= SB_UPCALL; - return; + soupcall_set(so, SO_RCV, soparsehttpvers, arg); + return (SU_OK); fallout: DPRINT("fallout"); - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } #define NCHRS 3 -static void +static int soishttpconnected(struct socket *so, void *arg, int waitflag) { char a, b, c; @@ -350,13 +341,9 @@ soishttpconnected(struct socket *so, voi } readmore: - so->so_upcall = soishttpconnected; - so->so_rcv.sb_flags |= SB_UPCALL; - return; + soupcall_set(so, SO_RCV, soishttpconnected, arg); + return (SU_OK); gotit: - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; + return (SU_ISCONNECTED); } Modified: head/sys/netsmb/smb_trantcp.c ============================================================================== --- head/sys/netsmb/smb_trantcp.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/netsmb/smb_trantcp.c Mon Jun 1 21:17:03 2009 (r193272) @@ -100,14 +100,15 @@ nb_intr(struct nbpcb *nbp, struct proc * return 0; } -static void +static int nb_upcall(struct socket *so, void *arg, int waitflag) { struct nbpcb *nbp = arg; if (arg == NULL || nbp->nbp_selectid == NULL) - return; + return (SU_OK); wakeup(nbp->nbp_selectid); + return (SU_OK); } static int @@ -152,10 +153,8 @@ nb_connect_in(struct nbpcb *nbp, struct if (error) return error; nbp->nbp_tso = so; - so->so_upcallarg = (caddr_t)nbp; - so->so_upcall = nb_upcall; SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, nb_upcall, nbp); SOCKBUF_UNLOCK(&so->so_rcv); so->so_rcv.sb_timeo = (5 * hz); so->so_snd.sb_timeo = (5 * hz); Modified: head/sys/nfsclient/nfs_socket.c ============================================================================== --- head/sys/nfsclient/nfs_socket.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsclient/nfs_socket.c Mon Jun 1 21:17:03 2009 (r193272) @@ -122,8 +122,8 @@ static int nfs_realign(struct mbuf **pm, static int nfs_reply(struct nfsreq *); static void nfs_softterm(struct nfsreq *rep); static int nfs_reconnect(struct nfsreq *rep); -static void nfs_clnt_tcp_soupcall(struct socket *so, void *arg, int waitflag); -static void nfs_clnt_udp_soupcall(struct socket *so, void *arg, int waitflag); +static int nfs_clnt_tcp_soupcall(struct socket *so, void *arg, int waitflag); +static int nfs_clnt_udp_soupcall(struct socket *so, void *arg, int waitflag); extern struct mtx nfs_reqq_mtx; @@ -457,12 +457,10 @@ nfs_connect(struct nfsmount *nmp, struct goto bad; SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_flags |= SB_NOINTR; - so->so_upcallarg = (caddr_t)nmp; if (so->so_type == SOCK_STREAM) - so->so_upcall = nfs_clnt_tcp_soupcall; - else - so->so_upcall = nfs_clnt_udp_soupcall; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, nfs_clnt_tcp_soupcall, nmp); + else + soupcall_set(so, SO_RCV, nfs_clnt_udp_soupcall, nmp); SOCKBUF_UNLOCK(&so->so_rcv); SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_flags |= SB_NOINTR; @@ -600,9 +598,7 @@ nfs_disconnect(struct nfsmount *nmp) nmp->nm_so = NULL; mtx_unlock(&nmp->nm_mtx); SOCKBUF_LOCK(&so->so_rcv); - so->so_upcallarg = NULL; - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(so, SO_RCV); SOCKBUF_UNLOCK(&so->so_rcv); soshutdown(so, SHUT_WR); soclose(so); @@ -811,7 +807,7 @@ tryagain: * XXX TO DO * Make nfs_realign() non-blocking. Also make nfsm_dissect() nonblocking. */ -static void +static int nfs_clnt_match_xid(struct socket *so, struct nfsmount *nmp, struct mbuf *mrep) @@ -928,11 +924,10 @@ nfstcp_readable(struct socket *so, int b { int retval; - SOCKBUF_LOCK(&so->so_rcv); + SOCKBUF_LOCK_ASSERT(&so->so_rcv); retval = (so->so_rcv.sb_cc >= (bytes) || (so->so_rcv.sb_state & SBS_CANTRCVMORE) || so->so_error); - SOCKBUF_UNLOCK(&so->so_rcv); return (retval); } @@ -969,7 +964,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, mtx_lock(&nmp->nm_mtx); if (nmp->nm_nfstcpstate.flags & NFS_TCP_FORCE_RECONNECT) { mtx_unlock(&nmp->nm_mtx); - return; + return (SU_OK); } else mtx_unlock(&nmp->nm_mtx); auio.uio_td = curthread; @@ -983,8 +978,9 @@ nfs_clnt_tcp_soupcall(struct socket *so, mtx_unlock(&nmp->nm_mtx); if (!nfstcp_marker_readable(so)) { /* Marker is not readable */ - return; + return (SU_OK); } + SOCKBUF_UNLOCK(&so->so_rcv); auio.uio_resid = sizeof(u_int32_t); auio.uio_iov = NULL; auio.uio_iovcnt = 0; @@ -992,6 +988,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, rcvflg = (MSG_DONTWAIT | MSG_SOCALLBCK); error = soreceive(so, (struct sockaddr **)0, &auio, &mp, (struct mbuf **)0, &rcvflg); + SOCKBUF_LOCK(&so->so_rcv); /* * We've already tested that the socket is readable. 2 cases * here, we either read 0 bytes (client closed connection), @@ -1052,8 +1049,9 @@ nfs_clnt_tcp_soupcall(struct socket *so, mtx_unlock(&nmp->nm_mtx); if (!nfstcp_readable(so, nmp->nm_nfstcpstate.rpcresid)) { /* All data not readable */ - return; + return (SU_OK); } + SOCKBUF_UNLOCK(&so->so_rcv); auio.uio_resid = nmp->nm_nfstcpstate.rpcresid; auio.uio_iov = NULL; auio.uio_iovcnt = 0; @@ -1061,6 +1059,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, rcvflg = (MSG_DONTWAIT | MSG_SOCALLBCK); error = soreceive(so, (struct sockaddr **)0, &auio, &mp, (struct mbuf **)0, &rcvflg); + SOCKBUF_LOCK(&so->so_rcv); if (error || auio.uio_resid > 0) { if (error && error != ECONNRESET) { log(LOG_ERR, @@ -1083,6 +1082,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, mark_reconnect: nfs_mark_for_reconnect(nmp); + return (SU_OK); } static void @@ -1094,6 +1094,7 @@ nfs_clnt_udp_soupcall(struct socket *so, struct mbuf *control = NULL; int error, rcvflag; + SOCKBUF_UNLOCK(&so->so_rcv); auio.uio_resid = 1000000; auio.uio_td = curthread; rcvflag = MSG_DONTWAIT; @@ -1106,6 +1107,8 @@ nfs_clnt_udp_soupcall(struct socket *so, if (mp) nfs_clnt_match_xid(so, nmp, mp); } while (mp && !error); + SOCKBUF_LOCK(&so->so_rcv); + return (SU_OK); } /* Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsserver/nfs.h Mon Jun 1 21:17:03 2009 (r193272) @@ -367,7 +367,7 @@ void nfsrv_timer(void *); int nfsrv_getcache(struct nfsrv_descript *, struct mbuf **); void nfsrv_updatecache(struct nfsrv_descript *, int, struct mbuf *); void nfsrv_cleancache(void); -void nfsrv_rcv(struct socket *so, void *arg, int waitflag); +int nfsrv_rcv(struct socket *so, void *arg, int waitflag); void nfsrv_slpderef(struct nfssvc_sock *slp); void nfsrv_wakenfsd(struct nfssvc_sock *slp); int nfsrv_writegather(struct nfsrv_descript **, struct nfssvc_sock *, Modified: head/sys/nfsserver/nfs_srvsock.c ============================================================================== --- head/sys/nfsserver/nfs_srvsock.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsserver/nfs_srvsock.c Mon Jun 1 21:17:03 2009 (r193272) @@ -406,7 +406,7 @@ nfsmout: * Essentially do as much as possible non-blocking, else punt and it will * be called with M_WAIT from an nfsd. */ -void +int nfsrv_rcv(struct socket *so, void *arg, int waitflag) { struct nfssvc_sock *slp = (struct nfssvc_sock *)arg; @@ -420,7 +420,7 @@ nfsrv_rcv(struct socket *so, void *arg, /* XXXRW: Unlocked read. */ if ((slp->ns_flag & SLP_VALID) == 0) - return; + return (SU_OK); /* * We can't do this in the context of a socket callback Modified: head/sys/nfsserver/nfs_syscalls.c ============================================================================== --- head/sys/nfsserver/nfs_syscalls.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/nfsserver/nfs_syscalls.c Mon Jun 1 21:17:03 2009 (r193272) @@ -263,11 +263,11 @@ nfssvc_addsock(struct file *fp, struct s slp->ns_nam = mynam; fhold(fp); slp->ns_fp = fp; + NFSD_UNLOCK(); SOCKBUF_LOCK(&so->so_rcv); - so->so_upcallarg = (caddr_t)slp; - so->so_upcall = nfsrv_rcv; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, nfsrv_rcv, slp); SOCKBUF_UNLOCK(&so->so_rcv); + NFSD_LOCK(); slp->ns_flag = (SLP_VALID | SLP_NEEDQ); nfsrv_wakenfsd(slp); NFSD_UNLOCK(); @@ -585,9 +585,7 @@ nfsrv_zapsock(struct nfssvc_sock *slp) slp->ns_fp = NULL; so = slp->ns_so; SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_flags &= ~SB_UPCALL; - so->so_upcall = NULL; - so->so_upcallarg = NULL; + soupcall_clear(so, SO_RCV); SOCKBUF_UNLOCK(&so->so_rcv); soshutdown(so, SHUT_RDWR); closef(fp, NULL); Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/rpc/clnt_dg.c Mon Jun 1 21:17:03 2009 (r193272) @@ -79,7 +79,7 @@ static void clnt_dg_abort(CLIENT *); static bool_t clnt_dg_control(CLIENT *, u_int, void *); static void clnt_dg_close(CLIENT *); static void clnt_dg_destroy(CLIENT *); -static void clnt_dg_soupcall(struct socket *so, void *arg, int waitflag); +static int clnt_dg_soupcall(struct socket *so, void *arg, int waitflag); static struct clnt_ops clnt_dg_ops = { .cl_call = clnt_dg_call, @@ -112,7 +112,7 @@ TAILQ_HEAD(cu_request_list, cu_request); #define MCALL_MSG_SIZE 24 /* - * This structure is pointed to by the socket's so_upcallarg + * This structure is pointed to by the socket buffer's sb_upcallarg * member. It is separate from the client private data to facilitate * multiple clients sharing the same socket. The cs_lock mutex is used * to protect all fields of this structure, the socket's receive @@ -183,6 +183,7 @@ clnt_dg_create( CLIENT *cl = NULL; /* client handle */ struct cu_data *cu = NULL; /* private data */ struct cu_socket *cs = NULL; + struct sockbuf *sb; struct timeval now; struct rpc_msg call_msg; struct __rpc_sockinfo si; @@ -260,15 +261,16 @@ clnt_dg_create( cu->cu_socket = so; soreserve(so, 256*1024, 256*1024); + sb = &so->so_rcv; SOCKBUF_LOCK(&so->so_rcv); recheck_socket: - if (so->so_upcall) { - if (so->so_upcall != clnt_dg_soupcall) { + if (sb->sb_upcall) { + if (sb->sb_upcall != clnt_dg_soupcall) { SOCKBUF_UNLOCK(&so->so_rcv); printf("clnt_dg_create(): socket already has an incompatible upcall\n"); goto err2; } - cs = (struct cu_socket *) so->so_upcallarg; + cs = (struct cu_socket *) sb->sb_upcallarg; mtx_lock(&cs->cs_lock); cs->cs_refs++; mtx_unlock(&cs->cs_lock); @@ -277,10 +279,10 @@ recheck_socket: * We are the first on this socket - allocate the * structure and install it in the socket. */ - SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); + SOCKBUF_UNLOCK(&so->so_rcv); cs = mem_alloc(sizeof(*cs)); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); - if (so->so_upcall) { + SOCKBUF_LOCK(&so->so_rcv); + if (sb->sb_upcall) { /* * We have lost a race with some other client. */ @@ -290,9 +292,7 @@ recheck_socket: mtx_init(&cs->cs_lock, "cs->cs_lock", NULL, MTX_DEF); cs->cs_refs = 1; TAILQ_INIT(&cs->cs_pending); - so->so_upcallarg = cs; - so->so_upcall = clnt_dg_soupcall; - so->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(so, SO_RCV, clnt_dg_soupcall, cs); } SOCKBUF_UNLOCK(&so->so_rcv); @@ -322,7 +322,7 @@ clnt_dg_call( struct timeval utimeout) /* seconds to wait before giving up */ { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct rpc_timers *rt; AUTH *auth; struct rpc_err *errp; @@ -343,6 +343,7 @@ clnt_dg_call( struct cu_request *cr; int error; + cs = cu->cu_socket->so_rcv.sb_upcallarg; cr = malloc(sizeof(struct cu_request), M_RPC, M_WAITOK); mtx_lock(&cs->cs_lock); @@ -797,9 +798,10 @@ static bool_t clnt_dg_control(CLIENT *cl, u_int request, void *info) { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct sockaddr *addr; + cs = cu->cu_socket->so_rcv.sb_upcallarg; mtx_lock(&cs->cs_lock); switch (request) { @@ -929,9 +931,10 @@ static void clnt_dg_close(CLIENT *cl) { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct cu_request *cr; + cs = cu->cu_socket->so_rcv.sb_upcallarg; mtx_lock(&cs->cs_lock); if (cu->cu_closed) { @@ -974,10 +977,11 @@ static void clnt_dg_destroy(CLIENT *cl) { struct cu_data *cu = (struct cu_data *)cl->cl_private; - struct cu_socket *cs = (struct cu_socket *) cu->cu_socket->so_upcallarg; + struct cu_socket *cs; struct socket *so = NULL; bool_t lastsocketref; + cs = cu->cu_socket->so_rcv.sb_upcallarg; clnt_dg_close(cl); mtx_lock(&cs->cs_lock); @@ -986,9 +990,7 @@ clnt_dg_destroy(CLIENT *cl) if (cs->cs_refs == 0) { mtx_destroy(&cs->cs_lock); SOCKBUF_LOCK(&cu->cu_socket->so_rcv); - cu->cu_socket->so_upcallarg = NULL; - cu->cu_socket->so_upcall = NULL; - cu->cu_socket->so_rcv.sb_flags &= ~SB_UPCALL; + soupcall_clear(cu->cu_socket, SO_RCV); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); mem_free(cs, sizeof(*cs)); lastsocketref = TRUE; @@ -1023,7 +1025,7 @@ time_not_ok(struct timeval *t) t->tv_usec < -1 || t->tv_usec > 1000000); } -void +int clnt_dg_soupcall(struct socket *so, void *arg, int waitflag) { struct cu_socket *cs = (struct cu_socket *) arg; @@ -1037,12 +1039,14 @@ clnt_dg_soupcall(struct socket *so, void uio.uio_resid = 1000000000; uio.uio_td = curthread; do { + SOCKBUF_UNLOCK(&so->so_rcv); m = NULL; control = NULL; rcvflag = MSG_DONTWAIT; error = soreceive(so, NULL, &uio, &m, &control, &rcvflag); if (control) m_freem(control); + SOCKBUF_LOCK(&so->so_rcv); if (error == EWOULDBLOCK) break; @@ -1107,5 +1111,6 @@ clnt_dg_soupcall(struct socket *so, void if (!foundreq) m_freem(m); } while (m); + return (SU_OK); } Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Mon Jun 1 21:13:38 2009 (r193271) +++ head/sys/rpc/clnt_vc.c Mon Jun 1 21:17:03 2009 (r193272) @@ -91,7 +91,7 @@ static bool_t clnt_vc_control(CLIENT *, static void clnt_vc_close(CLIENT *); static void clnt_vc_destroy(CLIENT *); static bool_t time_not_ok(struct timeval *); -static void clnt_vc_soupcall(struct socket *so, void *arg, int waitflag); +static int clnt_vc_soupcall(struct socket *so, void *arg, int waitflag); static struct clnt_ops clnt_vc_ops = { .cl_call = clnt_vc_call, @@ -286,9 +286,7 @@ clnt_vc_create( soreserve(ct->ct_socket, sendsz, recvsz); SOCKBUF_LOCK(&ct->ct_socket->so_rcv); - ct->ct_socket->so_upcallarg = ct; - ct->ct_socket->so_upcall = clnt_vc_soupcall; - ct->ct_socket->so_rcv.sb_flags |= SB_UPCALL; + soupcall_set(ct->ct_socket, SO_RCV, clnt_vc_soupcall, ct); SOCKBUF_UNLOCK(&ct->ct_socket->so_rcv); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From jilles at FreeBSD.org Mon Jun 1 21:26:53 2009 From: jilles at FreeBSD.org (Jilles Tjoelker) Date: Mon Jun 1 21:27:10 2009 Subject: svn commit: r193273 - head/usr.sbin/pkg_install/info Message-ID: <200906012126.n51LQqNw092706@svn.freebsd.org> Author: jilles Date: Mon Jun 1 21:26:52 2009 New Revision: 193273 URL: http://svn.freebsd.org/changeset/base/193273 Log: Fix segfault when giving invalid long option to pkg_info. PR: bin/133473 Submitted by: Rafal Grodzinski Approved by: ed (mentor) MFC after: 1 week Modified: head/usr.sbin/pkg_install/info/main.c Modified: head/usr.sbin/pkg_install/info/main.c ============================================================================== --- head/usr.sbin/pkg_install/info/main.c Mon Jun 1 21:17:03 2009 (r193272) +++ head/usr.sbin/pkg_install/info/main.c Mon Jun 1 21:26:52 2009 (r193273) @@ -58,6 +58,7 @@ static struct option longopts[] = { { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'P' }, { "which", required_argument, NULL, 'W' }, + { NULL, 0, NULL, 0 } }; int From zec at FreeBSD.org Mon Jun 1 21:29:55 2009 From: zec at FreeBSD.org (Marko Zec) Date: Mon Jun 1 21:30:01 2009 Subject: svn commit: r193274 - in head/sys: contrib/pf/net netinet6 Message-ID: <200906012129.n51LTsN7092816@svn.freebsd.org> Author: zec Date: Mon Jun 1 21:29:54 2009 New Revision: 193274 URL: http://svn.freebsd.org/changeset/base/193274 Log: V_loif is not an array but a pure pointer, so treat it as such. Reviewed by: bz Approved by: julian (mentor) Modified: head/sys/contrib/pf/net/pf_ioctl.c head/sys/netinet6/ip6_input.c Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Mon Jun 1 21:26:52 2009 (r193273) +++ head/sys/contrib/pf/net/pf_ioctl.c Mon Jun 1 21:29:54 2009 (r193274) @@ -3717,7 +3717,7 @@ pf_check6_in(void *arg, struct mbuf **m, * order to support scoped addresses. In order to support stateful * filtering we have change this to lo0 as it is the case in IPv4. */ - chk = pf_test6(PF_IN, (*m)->m_flags & M_LOOP ? &V_loif[0] : ifp, m, + chk = pf_test6(PF_IN, (*m)->m_flags & M_LOOP ? V_loif : ifp, m, NULL, inp); if (chk && *m) { m_freem(*m); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Jun 1 21:26:52 2009 (r193273) +++ head/sys/netinet6/ip6_input.c Mon Jun 1 21:29:54 2009 (r193274) @@ -380,7 +380,7 @@ ip6_input(struct mbuf *m) #define M2MMAX (sizeof(V_ip6stat.ip6s_m2m)/sizeof(V_ip6stat.ip6s_m2m[0])) if (m->m_next) { if (m->m_flags & M_LOOP) { - V_ip6stat.ip6s_m2m[V_loif[0].if_index]++; /* XXX */ + V_ip6stat.ip6s_m2m[V_loif->if_index]++; } else if (m->m_pkthdr.rcvif->if_index < M2MMAX) V_ip6stat.ip6s_m2m[m->m_pkthdr.rcvif->if_index]++; else From jhb at FreeBSD.org Mon Jun 1 21:32:53 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 1 21:33:00 2009 Subject: svn commit: r193275 - in head/sys: kern sys vm Message-ID: <200906012132.n51LWq2U092924@svn.freebsd.org> Author: jhb Date: Mon Jun 1 21:32:52 2009 New Revision: 193275 URL: http://svn.freebsd.org/changeset/base/193275 Log: Add an extension to the character device interface that allows character device drivers to use arbitrary VM objects to satisfy individual mmap() requests. - A new d_mmap_single(cdev, &foff, objsize, &object, prot) callback is added to cdevsw. This function is called for each mmap() request. If it returns ENODEV, then the mmap() request will fall back to using the device's device pager object and d_mmap(). Otherwise, the method can return a VM object to satisfy this entire mmap() request via *object. It can also modify the starting offset into this object via *foff. This allows device drivers to use the file offset as a cookie to identify specific VM objects. - vm_mmap_vnode() has been changed to call vm_mmap_cdev() directly when mapping V_CHR vnodes. This avoids duplicating all the cdev mmap handling code and simplifies some of vm_mmap_vnode(). - D_VERSION has been bumped to D_VERSION_02. Older device drivers using D_VERSION_01 are still supported. MFC after: 1 month Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h head/sys/vm/vm_mmap.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Mon Jun 1 21:29:54 2009 (r193274) +++ head/sys/kern/kern_conf.c Mon Jun 1 21:32:52 2009 (r193275) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static MALLOC_DEFINE(M_DEVT, "cdev", "cdev storage"); @@ -275,6 +276,7 @@ dead_strategy(struct bio *bp) #define dead_dump (dumper_t *)enxio #define dead_kqfilter (d_kqfilter_t *)enxio +#define dead_mmap_single (d_mmap_single_t *)enodev static struct cdevsw dead_cdevsw = { .d_version = D_VERSION, @@ -289,7 +291,8 @@ static struct cdevsw dead_cdevsw = { .d_strategy = dead_strategy, .d_name = "dead", .d_dump = dead_dump, - .d_kqfilter = dead_kqfilter + .d_kqfilter = dead_kqfilter, + .d_mmap_single = dead_mmap_single }; /* Default methods if driver does not specify method */ @@ -301,6 +304,7 @@ static struct cdevsw dead_cdevsw = { #define no_ioctl (d_ioctl_t *)enodev #define no_mmap (d_mmap_t *)enodev #define no_kqfilter (d_kqfilter_t *)enodev +#define no_mmap_single (d_mmap_single_t *)enodev static void no_strategy(struct bio *bp) @@ -480,6 +484,23 @@ giant_mmap(struct cdev *dev, vm_offset_t return (retval); } +static int +giant_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, + vm_object_t *object, int nprot) +{ + struct cdevsw *dsw; + int retval; + + dsw = dev_refthread(dev); + if (dsw == NULL) + return (ENXIO); + mtx_lock(&Giant); + retval = dsw->d_gianttrick->d_mmap_single(dev, offset, size, object, + nprot); + mtx_unlock(&Giant); + dev_relthread(dev); + return (retval); +} static void notify(struct cdev *dev, const char *ev) @@ -569,7 +590,8 @@ prep_cdevsw(struct cdevsw *devsw) return; } - if (devsw->d_version != D_VERSION_01) { + if (devsw->d_version != D_VERSION_01 && + devsw->d_version != D_VERSION_02) { printf( "WARNING: Device driver \"%s\" has wrong version %s\n", devsw->d_name == NULL ? "???" : devsw->d_name, @@ -585,6 +607,8 @@ prep_cdevsw(struct cdevsw *devsw) devsw->d_dump = dead_dump; devsw->d_kqfilter = dead_kqfilter; } + if (devsw->d_version == D_VERSION_01) + devsw->d_mmap_single = NULL; if (devsw->d_flags & D_NEEDGIANT) { if (devsw->d_gianttrick == NULL) { @@ -613,6 +637,7 @@ prep_cdevsw(struct cdevsw *devsw) FIXUP(d_mmap, no_mmap, giant_mmap); FIXUP(d_strategy, no_strategy, giant_strategy); FIXUP(d_kqfilter, no_kqfilter, giant_kqfilter); + FIXUP(d_mmap_single, no_mmap_single, giant_mmap_single); if (devsw->d_dump == NULL) devsw->d_dump = no_dump; Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Mon Jun 1 21:29:54 2009 (r193274) +++ head/sys/sys/conf.h Mon Jun 1 21:32:52 2009 (r193275) @@ -103,6 +103,7 @@ struct thread; struct uio; struct knote; struct clonedevs; +struct vm_object; struct vnode; /* @@ -136,6 +137,8 @@ typedef int d_poll_t(struct cdev *dev, i typedef int d_kqfilter_t(struct cdev *dev, struct knote *kn); typedef int d_mmap_t(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot); +typedef int d_mmap_single_t(struct cdev *cdev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot); typedef void d_purge_t(struct cdev *dev); typedef int d_spare2_t(struct cdev *dev); @@ -175,7 +178,8 @@ typedef int dumper_t( */ #define D_VERSION_00 0x20011966 #define D_VERSION_01 0x17032005 /* Add d_uid,gid,mode & kind */ -#define D_VERSION D_VERSION_01 +#define D_VERSION_02 0x28042009 /* Add d_mmap_single */ +#define D_VERSION D_VERSION_02 /* * Flags used for internal housekeeping @@ -201,7 +205,7 @@ struct cdevsw { dumper_t *d_dump; d_kqfilter_t *d_kqfilter; d_purge_t *d_purge; - d_spare2_t *d_spare2; + d_mmap_single_t *d_mmap_single; uid_t d_uid; gid_t d_gid; mode_t d_mode; Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jun 1 21:29:54 2009 (r193274) +++ head/sys/vm/vm_mmap.c Mon Jun 1 21:32:52 2009 (r193275) @@ -117,9 +117,9 @@ vmmapentry_rsrc_init(dummy) } static int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct vnode *, vm_ooffset_t, vm_object_t *); + int *, struct vnode *, vm_ooffset_t *, vm_object_t *); static int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, - int *, struct cdev *, vm_ooffset_t, vm_object_t *); + int *, struct cdev *, vm_ooffset_t *, vm_object_t *); static int vm_mmap_shm(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, int *, struct shmfd *, vm_ooffset_t, vm_object_t *); @@ -1142,15 +1142,14 @@ munlock(td, uap) int vm_mmap_vnode(struct thread *td, vm_size_t objsize, vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, - struct vnode *vp, vm_ooffset_t foff, vm_object_t *objp) + struct vnode *vp, vm_ooffset_t *foffp, vm_object_t *objp) { struct vattr va; - void *handle; vm_object_t obj; + vm_offset_t foff; struct mount *mp; - struct cdevsw *dsw; struct ucred *cred; - int error, flags, type; + int error, flags; int vfslocked; mp = vp->v_mount; @@ -1160,6 +1159,7 @@ vm_mmap_vnode(struct thread *td, vm_size VFS_UNLOCK_GIANT(vfslocked); return (error); } + foff = *foffp; flags = *flagsp; obj = vp->v_object; if (vp->v_type == VREG) { @@ -1175,41 +1175,12 @@ vm_mmap_vnode(struct thread *td, vm_size vp = (struct vnode*)obj->handle; vget(vp, LK_SHARED, td); } - type = OBJT_VNODE; - handle = vp; } else if (vp->v_type == VCHR) { - type = OBJT_DEVICE; - handle = vp->v_rdev; - - dsw = dev_refthread(handle); - if (dsw == NULL) { - error = ENXIO; - goto done; - } - if (dsw->d_flags & D_MMAP_ANON) { - dev_relthread(handle); - *maxprotp = VM_PROT_ALL; - *flagsp |= MAP_ANON; - error = 0; - goto done; - } - dev_relthread(handle); - /* - * cdevs does not provide private mappings of any kind. - */ - if ((*maxprotp & VM_PROT_WRITE) == 0 && - (prot & PROT_WRITE) != 0) { - error = EACCES; - goto done; - } - if (flags & (MAP_PRIVATE|MAP_COPY)) { - error = EINVAL; - goto done; - } - /* - * Force device mappings to be shared. - */ - flags |= MAP_SHARED; + error = vm_mmap_cdev(td, objsize, prot, maxprotp, flagsp, + vp->v_rdev, foffp, objp); + if (error == 0) + goto mark_atime; + goto done; } else { error = EINVAL; goto done; @@ -1235,18 +1206,18 @@ vm_mmap_vnode(struct thread *td, vm_size * we do not need to sync it. * Adjust object size to be the size of actual file. */ - if (vp->v_type == VREG) { - objsize = round_page(va.va_size); - if (va.va_nlink == 0) - flags |= MAP_NOSYNC; - } - obj = vm_pager_allocate(type, handle, objsize, prot, foff); + objsize = round_page(va.va_size); + if (va.va_nlink == 0) + flags |= MAP_NOSYNC; + obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff); if (obj == NULL) { - error = (type == OBJT_DEVICE ? EINVAL : ENOMEM); + error = ENOMEM; goto done; } *objp = obj; *flagsp = flags; + +mark_atime: vfs_mark_atime(vp, cred); done: @@ -1266,11 +1237,11 @@ done: int vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, - struct cdev *cdev, vm_ooffset_t foff, vm_object_t *objp) + struct cdev *cdev, vm_ooffset_t *foff, vm_object_t *objp) { vm_object_t obj; struct cdevsw *dsw; - int flags; + int error, flags; flags = *flagsp; @@ -1283,25 +1254,43 @@ vm_mmap_cdev(struct thread *td, vm_size_ *flagsp |= MAP_ANON; return (0); } - dev_relthread(cdev); /* - * cdevs does not provide private mappings of any kind. + * cdevs do not provide private mappings of any kind. */ if ((*maxprotp & VM_PROT_WRITE) == 0 && - (prot & PROT_WRITE) != 0) + (prot & PROT_WRITE) != 0) { + dev_relthread(cdev); return (EACCES); - if (flags & (MAP_PRIVATE|MAP_COPY)) + } + if (flags & (MAP_PRIVATE|MAP_COPY)) { + dev_relthread(cdev); return (EINVAL); + } /* * Force device mappings to be shared. */ flags |= MAP_SHARED; #ifdef MAC_XXX - error = mac_check_cdev_mmap(td->td_ucred, cdev, prot); - if (error != 0) + error = mac_cdev_check_mmap(td->td_ucred, cdev, prot); + if (error != 0) { + dev_relthread(cdev); return (error); + } #endif - obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, foff); + /* + * First, try d_mmap_single(). If that is not implemented + * (returns ENODEV), fall back to using the device pager. + * Note that d_mmap_single() must return a reference to the + * object (it needs to bump the reference count of the object + * it returns somehow). + * + * XXX assumes VM_PROT_* == PROT_* + */ + error = dsw->d_mmap_single(cdev, foff, objsize, objp, (int)prot); + dev_relthread(cdev); + if (error != ENODEV) + return (error); + obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff); if (obj == NULL) return (EINVAL); *objp = obj; @@ -1396,11 +1385,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, switch (handle_type) { case OBJT_DEVICE: error = vm_mmap_cdev(td, size, prot, &maxprot, &flags, - handle, foff, &object); + handle, &foff, &object); break; case OBJT_VNODE: error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, - handle, foff, &object); + handle, &foff, &object); break; case OBJT_SWAP: error = vm_mmap_shm(td, size, prot, &maxprot, &flags, From jhb at freebsd.org Mon Jun 1 21:36:02 2009 From: jhb at freebsd.org (John Baldwin) Date: Mon Jun 1 21:36:08 2009 Subject: svn commit: r193272 - in head/sys: dev/cxgb/ulp/iw_cxgb kern netgraph netgraph/bluetooth/socket netinet netsmb nfsclient nfsserver rpc sys In-Reply-To: <200906012117.n51LH3F8092452@svn.freebsd.org> References: <200906012117.n51LH3F8092452@svn.freebsd.org> Message-ID: <200906011734.06721.jhb@freebsd.org> On Monday 01 June 2009 5:17:03 pm John Baldwin wrote: > Author: jhb > Date: Mon Jun 1 21:17:03 2009 > New Revision: 193272 > URL: http://svn.freebsd.org/changeset/base/193272 > > Log: > Rework socket upcalls to close some races with setup/teardown of upcalls. > - The various RPC client upcalls currently drop the socket buffer lock > while invoking soreceive() as a temporary band-aid. The plan for > the future is to add a new flag to allow soreceive() to be called with > the socket buffer locked. Hopefully once this last bit is done, the various panics people have seen with the new NFS code in 8 will be fixed as they all seem to be due to races between socket upcall teardown and socket upcall invocations. -- John Baldwin From mav at FreeBSD.org Mon Jun 1 21:42:27 2009 From: mav at FreeBSD.org (Alexander Motin) Date: Mon Jun 1 21:42:39 2009 Subject: svn commit: r193277 - in head/sys/dev/ata: . chipsets Message-ID: <200906012142.n51LgQrU093221@svn.freebsd.org> Author: mav Date: Mon Jun 1 21:42:26 2009 New Revision: 193277 URL: http://svn.freebsd.org/changeset/base/193277 Log: MFp4. Log supported AHCI controller capabilities. Modified: head/sys/dev/ata/ata-all.h head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Mon Jun 1 21:38:44 2009 (r193276) +++ head/sys/dev/ata/ata-all.h Mon Jun 1 21:42:26 2009 (r193277) @@ -149,11 +149,26 @@ /* SATA AHCI v1.0 register defines */ #define ATA_AHCI_CAP 0x00 #define ATA_AHCI_CAP_NPMASK 0x0000001f +#define ATA_AHCI_CAP_SXS 0x00000020 +#define ATA_AHCI_CAP_EMS 0x00000040 +#define ATA_AHCI_CAP_CCCS 0x00000080 +#define ATA_AHCI_CAP_NCS 0x00001F00 +#define ATA_AHCI_CAP_NCS_SHIFT 8 #define ATA_AHCI_CAP_PSC 0x00002000 #define ATA_AHCI_CAP_SSC 0x00004000 +#define ATA_AHCI_CAP_PMD 0x00008000 +#define ATA_AHCI_CAP_FBSS 0x00010000 #define ATA_AHCI_CAP_SPM 0x00020000 -#define ATA_AHCI_CAP_CLO 0x01000000 +#define ATA_AHCI_CAP_SAM 0x00080000 +#define ATA_AHCI_CAP_ISS 0x00F00000 +#define ATA_AHCI_CAP_ISS_SHIFT 20 +#define ATA_AHCI_CAP_SCLO 0x01000000 +#define ATA_AHCI_CAP_SAL 0x02000000 #define ATA_AHCI_CAP_SALP 0x04000000 +#define ATA_AHCI_CAP_SSS 0x08000000 +#define ATA_AHCI_CAP_SMPS 0x10000000 +#define ATA_AHCI_CAP_SSNTF 0x20000000 +#define ATA_AHCI_CAP_SNCQ 0x40000000 #define ATA_AHCI_CAP_64BIT 0x80000000 #define ATA_AHCI_GHC 0x04 Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Mon Jun 1 21:38:44 2009 (r193276) +++ head/sys/dev/ata/chipsets/ata-ahci.c Mon Jun 1 21:42:26 2009 (r193277) @@ -101,8 +101,8 @@ int ata_ahci_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - int error; - u_int32_t version; + int error, speed; + u_int32_t caps, version; /* if we have a memory BAR(5) we are likely on an AHCI part */ ctlr->r_type2 = SYS_RES_MEMORY; @@ -142,16 +142,45 @@ ata_ahci_chipinit(device_t dev) ctlr->suspend = ata_ahci_suspend; ctlr->resume = ata_ahci_ctlr_reset; - /* announce we support the HW */ - version = ATA_INL(ctlr->r_res2, ATA_AHCI_VS); - device_printf(dev, - "AHCI Version %x%x.%x%x controller with %d ports PM %s\n", - (version >> 24) & 0xff, (version >> 16) & 0xff, - (version >> 8) & 0xff, version & 0xff, - (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_NPMASK) + 1, - (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) ? - "supported" : "not supported"); - return 0; + /* announce we support the HW */ + version = ATA_INL(ctlr->r_res2, ATA_AHCI_VS); + caps = ATA_INL(ctlr->r_res2, ATA_AHCI_CAP); + speed = (caps & ATA_AHCI_CAP_ISS) >> ATA_AHCI_CAP_ISS_SHIFT; + device_printf(dev, + "AHCI v%x.%02x controller with %d %sGbps ports, PM %s\n", + ((version >> 20) & 0xf0) + ((version >> 16) & 0x0f), + ((version >> 4) & 0xf0) + (version & 0x0f), + (caps & ATA_AHCI_CAP_NPMASK) + 1, + ((speed == 1) ? "1.5":((speed == 2) ? "3": + ((speed == 3) ? "6":"?"))), + (caps & ATA_AHCI_CAP_SPM) ? + "supported" : "not supported"); + if (bootverbose) { + device_printf(dev, "Caps:%s%s%s%s%s%s%s%s %sGbps", + (caps & ATA_AHCI_CAP_64BIT) ? " 64bit":"", + (caps & ATA_AHCI_CAP_SNCQ) ? " NCQ":"", + (caps & ATA_AHCI_CAP_SSNTF) ? " SNTF":"", + (caps & ATA_AHCI_CAP_SMPS) ? " MPS":"", + (caps & ATA_AHCI_CAP_SSS) ? " SS":"", + (caps & ATA_AHCI_CAP_SALP) ? " ALP":"", + (caps & ATA_AHCI_CAP_SAL) ? " AL":"", + (caps & ATA_AHCI_CAP_SCLO) ? " CLO":"", + ((speed == 1) ? "1.5":((speed == 2) ? "3": + ((speed == 3) ? "6":"?")))); + printf("%s%s%s%s%s%s %dcmd%s%s%s %dports\n", + (caps & ATA_AHCI_CAP_SAM) ? " AM":"", + (caps & ATA_AHCI_CAP_SPM) ? " PM":"", + (caps & ATA_AHCI_CAP_FBSS) ? " FBS":"", + (caps & ATA_AHCI_CAP_PMD) ? " PMD":"", + (caps & ATA_AHCI_CAP_SSC) ? " SSC":"", + (caps & ATA_AHCI_CAP_PSC) ? " PSC":"", + ((caps & ATA_AHCI_CAP_NCS) >> ATA_AHCI_CAP_NCS_SHIFT) + 1, + (caps & ATA_AHCI_CAP_CCCS) ? " CCC":"", + (caps & ATA_AHCI_CAP_EMS) ? " EM":"", + (caps & ATA_AHCI_CAP_SXS) ? " eSATA":"", + (caps & ATA_AHCI_CAP_NPMASK) + 1); + } + return 0; } int @@ -625,7 +654,7 @@ ata_ahci_clo(device_t dev) int timeout; /* issue Command List Override if supported */ - if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_CLO) { + if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SCLO) { cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); cmd |= ATA_AHCI_P_CMD_CLO; ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, cmd); From jhb at FreeBSD.org Mon Jun 1 21:54:23 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 1 21:54:29 2009 Subject: svn commit: r193278 - head/sys/dev/ksyms Message-ID: <200906012154.n51LsMA7093527@svn.freebsd.org> Author: jhb Date: Mon Jun 1 21:54:22 2009 New Revision: 193278 URL: http://svn.freebsd.org/changeset/base/193278 Log: Remove another d_thread_t use that crept in. Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Mon Jun 1 21:42:26 2009 (r193277) +++ head/sys/dev/ksyms/ksyms.c Mon Jun 1 21:54:22 2009 (r193278) @@ -552,7 +552,7 @@ ksyms_read(struct cdev *dev, struct uio /* ARGSUSED */ static int ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag __unused, - d_thread_t *td __unused) + struct thread *td __unused) { int error = 0; struct ksyms_softc *sc; From gabor at FreeBSD.org Mon Jun 1 21:55:00 2009 From: gabor at FreeBSD.org (Gabor Kovesdan) Date: Mon Jun 1 21:55:06 2009 Subject: svn commit: r193279 - in head/usr.bin/ee: . nls/hu_HU.ISO8859-2 Message-ID: <200906012154.n51Lsx4M093571@svn.freebsd.org> Author: gabor (doc,ports committer) Date: Mon Jun 1 21:54:59 2009 New Revision: 193279 URL: http://svn.freebsd.org/changeset/base/193279 Log: - Add Hungarian catalog Added: head/usr.bin/ee/nls/hu_HU.ISO8859-2/ head/usr.bin/ee/nls/hu_HU.ISO8859-2/ee.msg (contents, props changed) Modified: head/usr.bin/ee/Makefile Modified: head/usr.bin/ee/Makefile ============================================================================== --- head/usr.bin/ee/Makefile Mon Jun 1 21:54:22 2009 (r193278) +++ head/usr.bin/ee/Makefile Mon Jun 1 21:54:59 2009 (r193279) @@ -14,7 +14,7 @@ LDADD= -lncurses WARNS?= 2 NLS= en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \ - uk_UA.KOI8-U ru_RU.KOI8-R + uk_UA.KOI8-U ru_RU.KOI8-R hu_HU.ISO8859-2 NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15 NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \ Added: head/usr.bin/ee/nls/hu_HU.ISO8859-2/ee.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ee/nls/hu_HU.ISO8859-2/ee.msg Mon Jun 1 21:54:59 2009 (r193279) @@ -0,0 +1,185 @@ +$ This file contains the messages for ee ("easy editor"). See the file +$ ee.i18n.guide for more information +$ +$ For ee patchlevel 3 +$ +$ $FreeBSD$ +$ +$ +$set 1 +$quote " +1 "üzemmód menü" +2 "tabulátorok szóközzé " +3 "kis- és nagybetû érzékeny keresés " +4 "margók megfigyelésre " +5 "automatikus bekezdésformázás " +6 "nyolcbites karakterek " +7 "info ablak " +8 "jobb margó " +9 "kilépés a menübõl " +10 "változtatások mentése" +11 "nincs mentés" +12 "fájl menü" +13 "fájl olvasása" +14 "fájl írása" +15 "fájl mentése" +16 "a szerkesztõ tartalmának nyomtatása" +17 "keresés menü" +18 "keresés erre" +19 "keresés" +20 "helyesírás menü" +21 "'spell' használata" +22 "'ispell' használata" +23 "egyéb menü" +24 "bekezdés formázása" +25 "shell parancs" +26 "helyesírás-ellenõrzés" +27 "fõmenü" +28 "kilépés a szerkesztõbõl" +29 "súgó" +30 "fájlmûveletek" +31 "képernyõ újrarajzolása" +32 "beállítások" +33 "keresés" +34 "egyéb" +35 "Vezérlõbillentyûk: " +36 "^a ascii kód ^i tabulátor ^r jobb " +37 "^b szöveg alja ^j újsor ^t szöveg teteje " +38 "^c parancs ^k karakter törlése ^u fel " +39 "^d le ^l balra ^v szótörlés vissza " +40 "^e keresés prompt ^m újsor ^w szó törlése " +41 "^f karaktertörlés vissza ^n következõ oldal ^x keresés " +42 "^g sor eleje ^o sor vége ^y sor törlése " +43 "^h visszatörlés ^p elõzõ oldal ^z sortörlés vissza " +44 "^[ (escape) menü " +45 " " +46 "Parancsok: " +47 "help : ez az info file : fájlnév megjelenítése " +48 "read : fájl olvasása char : karakter ascii kódja " +49 "write : fájl írása case : k/n betû érzékeny keresés" +50 "exit : kilépés és mentés nocase : nem betûérzékeny keresés " +51 "quit : kilépés mentés nélkül !cmd : \"cmd\" shell parancs " +52 "line : #. sor megjelenítése 0-9 : \"#\" sorra ugrás " +53 "expand : tabok kifejtése noexpand: ne fejtse ki a tabokat " +54 " " +55 " ee [+#] [-i] [-e] [-h] [fájl(ok) " +56 "+# :ugrás sorra # -i :info ablak ki -e :tabkifejtés ki -h :kiemelés ki" +57 "^[ (escape) menü ^e keresés prompt ^y sor törlése ^u fel ^p elõzõ old " +58 "^a ascii kód ^x keresés ^z sortörl vissza ^d le ^n köv old " +59 "^b szöve alja ^g sor eleje ^w szó törlése ^l bal " +60 "^t szöveg teteje ^o sor vége ^v szótörl vissza ^r jobb " +61 "^c parancs ^k karalter törl ^f kartörl vissza " +62 "help : súgó |file : fájlnév megjelenítése |line : sor # kiírása " +63 "read : fájl olvasása |char : ascii kód |0-9 : # sorra ugrás " +64 "write: fájl írása |case : k/n érzékeny keresés |exit : kilép és ment " +65 "!cmd : shell parancs |nocase: nem érzékeny keresés |quit : kilép, nem ment" +66 "expand: tabkifejtés |noexpand: ne legyen tabkifejtés " +67 " nyomja le az Escape billentyût (^[) a menü eléréséhez" +68 "nincs fájl" +69 "ascii kód: " +70 "a puffer tartalmának küldése -> \"%s\" " +71 "parancs: " +72 "a mentendõ fájl neve: " +73 "az olvasandó fájl neve: " +74 "karakter = %d" +75 "ismeretlen parancs: \"%s\"" +76 "a megadott parancs nem egyéni" +77 "sor %d " +78 "hossz = %d" +79 "az aktuális fájl \"%s\" " +80 "használat: %s [-i] [-e] [-h] [+sor_száma] [fájl(ok)]\n" +81 " -i info ablak kikapcsolása\n" +82 " -e ne konvertálja a tabokat szóközzé\n" +83 " -h ne használjon kiemelést\n" +84 "\"%s\" egy könyvtár" +85 "új fájl: \"%s\"" +86 "\"%s\" nem nyitható meg" +87 "\"%s\" fájl, %d sor" +88 "\"%s\" fájl olvasása befejezõdött" +89 "\"%s\" fájl olvasása" +90 ", csak olvasható" +91 "\"%s\" fájl, %d sor" +92 "adja meg a fájlnevet: " +93 "nem adott meg fájlnevet: a fájl nem lett elmentve" +94 "változások történtek, biztos benne? (i/n [n]) " +95 "i" +96 "a fájl már létezik, felülírjam? (i/n) [n] " +97 "\"%s\" fájl nem hozható létre" +98 "\"%s\" fájl írása" +99 "\"%s\" %d sor, %d karakter" +100 " ...keresés" +101 "\"%s\" karakterlánc nem található" +102 "keresés erre: " +103 "%s nem hajtható végre\n" +104 "nyomjon entert a folytatáshoz" +105 "nyomja le az Esc billentyût a visszalépéshez" +106 "a menü túl nagy az ablakhoz" +107 "nyomjon le egy billentyût a folytatáshoz" +108 "shell parancs: " +109 "...bekezdés formázása..." +110 " Author: dougb Date: Mon Jun 1 21:58:59 2009 New Revision: 193280 URL: http://svn.freebsd.org/changeset/base/193280 Log: Add support for the build options that are currently in the port: WITH_BIND_IDN WITH_BIND_LARGE_FILE WITH_BIND_SIGCHASE WITH_BIND_XML Added: head/tools/build/options/WITH_BIND_IDN (contents, props changed) head/tools/build/options/WITH_BIND_LARGE_FILE (contents, props changed) head/tools/build/options/WITH_BIND_SIGCHASE (contents, props changed) head/tools/build/options/WITH_BIND_XML (contents, props changed) Replaced: head/tools/build/options/WITH_BIND_LIBS (contents, props changed) Modified: head/lib/bind/config.mk head/share/mk/bsd.own.mk head/usr.bin/dig/Makefile head/usr.sbin/named/Makefile Modified: head/lib/bind/config.mk ============================================================================== --- head/lib/bind/config.mk Mon Jun 1 21:54:59 2009 (r193279) +++ head/lib/bind/config.mk Mon Jun 1 21:58:59 2009 (r193280) @@ -70,6 +70,19 @@ ISC_ATOMIC_ARCH= x86_32 ISC_ATOMIC_ARCH= ${MACHINE_ARCH} .endif +# Optional features +.if ${MK_BIND_LARGE_FILE} == "yes" +CFLAGS+= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +.endif +.if ${MK_BIND_SIGCHASE} == "yes" +CFLAGS+= -DDIG_SIGCHASE +.endif +.if ${MK_BIND_XML} == "yes" +CFLAGS+= -DHAVE_LIBXML2 +CFLAGS+= -I/usr/local/include -I/usr/local/include/libxml2 +CFLAGS+= -L/usr/local/lib -lxml2 -lz -liconv -lm +.endif + # Link against BIND libraries .if ${MK_BIND_LIBS} == "no" LIBBIND9= ${LIB_BIND_REL}/bind9/libbind9.a Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Jun 1 21:54:59 2009 (r193279) +++ head/share/mk/bsd.own.mk Mon Jun 1 21:58:59 2009 (r193280) @@ -402,7 +402,11 @@ MK_${var}:= yes # MK_* options which default to "no". # .for var in \ + BIND_IDN \ + BIND_LARGE_FILE \ BIND_LIBS \ + BIND_SIGCHASE \ + BIND_XML \ GNU_CPIO \ HESIOD \ IDEA Added: head/tools/build/options/WITH_BIND_IDN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_IDN Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable IDN support for dig, host, and nslookup. +This requires ports/dns/idnkit to be installed in /usr/local. Added: head/tools/build/options/WITH_BIND_LARGE_FILE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_LARGE_FILE Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to enable 64-bit file support. Added: head/tools/build/options/WITH_BIND_LIBS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_LIBS Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to install BIND libraries and include files. Added: head/tools/build/options/WITH_BIND_SIGCHASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_SIGCHASE Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to enable DNSSEC validation support for dig, host, and nslookup. Added: head/tools/build/options/WITH_BIND_XML ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BIND_XML Mon Jun 1 21:58:59 2009 (r193280) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable the http statistics interface for named. +This requires ports/textproc/libxml2 to be installed in /usr/local. Modified: head/usr.bin/dig/Makefile ============================================================================== --- head/usr.bin/dig/Makefile Mon Jun 1 21:54:59 2009 (r193279) +++ head/usr.bin/dig/Makefile Mon Jun 1 21:58:59 2009 (r193280) @@ -15,6 +15,11 @@ SRCS+= dig.c dighost.c CFLAGS+= -I${SRCDIR}/include CFLAGS+= -I${BIND_DIR}/lib/isc/${ISC_ATOMIC_ARCH}/include +.if ${MK_BIND_IDN} == "yes" +CFLAGS+= -DWITH_IDN -I/usr/local/include +CFLAGS+= -L/usr/local/lib -lidnkit -R/usr/local/lib -liconv +.endif + DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD} LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD} Modified: head/usr.sbin/named/Makefile ============================================================================== --- head/usr.sbin/named/Makefile Mon Jun 1 21:54:59 2009 (r193279) +++ head/usr.sbin/named/Makefile Mon Jun 1 21:58:59 2009 (r193280) @@ -9,7 +9,25 @@ SRCDIR= ${BIND_DIR}/bin/named PROG= named -CONFIGARGS='--prefix=/usr' '--without-libxml2' '--without-idn' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--disable-ipv6' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' +CONFIGARGS='--prefix=/usr' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--disable-ipv6' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' + +# Optional features +.if ${MK_BIND_LARGE_FILE} == "yes" +CONFIGARGS+='--enable-largefile' +.endif +.if ${MK_BIND_SIGCHASE} == "yes" +CONFIGARGS+='STD_CDEFINES=-DDIG_SIGCHASE=1' +.endif +.if ${MK_BIND_IDN} == "yes" +CONFIGARGS+='--with-idn=/usr/local' +.else +CONFIGARGS+='--without-idn' +.endif +.if ${MK_BIND_XML} == "yes" +CONFIGARGS+='--with-libxml2=/usr/local' +.else +CONFIGARGS+='--without-libxml2' +.endif .PATH: ${SRCDIR}/unix SRCS+= os.c From rpaulo at freebsd.org Mon Jun 1 22:01:50 2009 From: rpaulo at freebsd.org (Rui Paulo) Date: Mon Jun 1 22:01:56 2009 Subject: svn commit: r192925 - in head/sys/dev/usb: . input In-Reply-To: <200906011754.14349.hselasky@c2i.net> References: <200905271927.n4RJRUH8009289@svn.freebsd.org> <200906010749.37072.hselasky@c2i.net> <5C52056B-8E4A-4C15-8451-2A5576A8FC9F@freebsd.org> <200906011754.14349.hselasky@c2i.net> Message-ID: On 1 Jun 2009, at 16:54, Hans Petter Selasky wrote: > On Monday 01 June 2009, Rui Paulo wrote: >> Hi, >> >> On 1 Jun 2009, at 06:49, Hans Petter Selasky wrote: >>> On Monday 01 June 2009, Rui Paulo wrote: >>>> http://wiki.freebsd.org/AppleMacbook#head-7eab3730c3bf3d04bdfb0d1d3649ea >>>> ddf 2fed595 >>> >>> Hi Rui Paulo, >>> >>> Regarding the eject button, can you have a look at: >>> >>> /sys/dev/usb/input/ukbd.c >>> >>> And provide a patch that masks this key the way you want? >> >> I'm not sure what you mean. I'm proposing to remove the key handling >> code from the kernel. See the attached patch. > > Your patch looks OK. Make sure you test it before committing. I can't test it right now for various reasons. If anyone can test it, I would be glad. Regards, -- Rui Paulo -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090601/91888f74/PGP.pgp From dougb at FreeBSD.org Mon Jun 1 22:14:46 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 22:14:53 2009 Subject: svn commit: r193283 - head/share/man/man5 Message-ID: <200906012214.n51MEk75094369@svn.freebsd.org> Author: dougb Date: Mon Jun 1 22:14:45 2009 New Revision: 193283 URL: http://svn.freebsd.org/changeset/base/193283 Log: Commit the updates to this file for the new BIND options Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Jun 1 22:09:42 2009 (r193282) +++ head/share/man/man5/src.conf.5 Mon Jun 1 22:14:45 2009 (r193283) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd April 5, 2009 +.Dd June 1, 2009 .Dt SRC.CONF 5 .Os .Sh NAME @@ -150,8 +150,15 @@ and .\" from FreeBSD: head/tools/build/options/WITHOUT_BIND_ETC 156932 2006-03-21 07:50:50Z ru Set to avoid installing the default files to .Pa /var/named/etc/namedb . +.It Va WITH_BIND_IDN +.\" from FreeBSD: head/tools/build/options/WITH_BIND_IDN 193280 2009-06-01 21:58:59Z dougb +Set to enable IDN support for dig, host, and nslookup. +This requires ports/dns/idnkit to be installed in /usr/local. +.It Va WITH_BIND_LARGE_FILE +.\" from FreeBSD: head/tools/build/options/WITH_BIND_LARGE_FILE 193280 2009-06-01 21:58:59Z dougb +Set to enable 64-bit file support. .It Va WITH_BIND_LIBS -.\" from FreeBSD: head/tools/build/options/WITH_BIND_LIBS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITH_BIND_LIBS 193280 2009-06-01 21:58:59Z dougb Set to install BIND libraries and include files. .It Va WITHOUT_BIND_LIBS_LWRES .\" from FreeBSD: head/tools/build/options/WITHOUT_BIND_LIBS_LWRES 156932 2006-03-21 07:50:50Z ru @@ -182,6 +189,9 @@ Set to avoid building or installing .Xr rndc 8 , and .Xr rndc-confgen 8 . +.It Va WITH_BIND_SIGCHASE +.\" from FreeBSD: head/tools/build/options/WITH_BIND_SIGCHASE 193280 2009-06-01 21:58:59Z dougb +Set to enable DNSSEC validation support for dig, host, and nslookup. .It Va WITHOUT_BIND_UTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_BIND_UTILS 156932 2006-03-21 07:50:50Z ru Set to avoid building or installing the BIND userland utilities, @@ -190,6 +200,10 @@ Set to avoid building or installing the .Xr nslookup 1 , and .Xr nsupdate 8 . +.It Va WITH_BIND_XML +.\" from FreeBSD: head/tools/build/options/WITH_BIND_XML 193280 2009-06-01 21:58:59Z dougb +Set to enable the http statistics interface for named. +This requires ports/textproc/libxml2 to be installed in /usr/local. .It Va WITHOUT_BLUETOOTH .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. From dougb at FreeBSD.org Mon Jun 1 22:48:01 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Mon Jun 1 22:48:12 2009 Subject: svn commit: r193285 - head Message-ID: <200906012248.n51Mm0ED095111@svn.freebsd.org> Author: dougb Date: Mon Jun 1 22:47:59 2009 New Revision: 193285 URL: http://svn.freebsd.org/changeset/base/193285 Log: Add a note about the change to rcorder for pf and ipfw. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 1 22:34:09 2009 (r193284) +++ head/UPDATING Mon Jun 1 22:47:59 2009 (r193285) @@ -33,6 +33,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. rebuilt. Bump __FreeBSD_version to 800096. +20090531: + For those who use ipfw and especially pf, those two firewalls + are now started BEFORE the network is initialized (i.e., before + rc.d/netif). Please review your rules to make sure that your + interfaces will be properly described. + 20090530: Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no more valid. From sam at FreeBSD.org Tue Jun 2 00:04:11 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 00:04:17 2009 Subject: svn commit: r193287 - head/sys/net80211 Message-ID: <200906020004.n5204AYY096634@svn.freebsd.org> Author: sam Date: Tue Jun 2 00:04:10 2009 New Revision: 193287 URL: http://svn.freebsd.org/changeset/base/193287 Log: count packets Modified: head/sys/net80211/ieee80211_monitor.c Modified: head/sys/net80211/ieee80211_monitor.c ============================================================================== --- head/sys/net80211/ieee80211_monitor.c Mon Jun 1 23:53:15 2009 (r193286) +++ head/sys/net80211/ieee80211_monitor.c Tue Jun 2 00:04:10 2009 (r193287) @@ -127,6 +127,9 @@ static int monitor_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) { struct ieee80211vap *vap = ni->ni_vap; + struct ifnet *ifp = vap->iv_ifp; + + ifp->if_ipackets++; if (ieee80211_radiotap_active_vap(vap)) ieee80211_radiotap_rx(vap, m); From sam at FreeBSD.org Tue Jun 2 00:06:40 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 00:06:52 2009 Subject: svn commit: r193288 - head/sys/net80211 Message-ID: <200906020006.n5206d51096716@svn.freebsd.org> Author: sam Date: Tue Jun 2 00:06:39 2009 New Revision: 193288 URL: http://svn.freebsd.org/changeset/base/193288 Log: don't dispatch frames to vap's not running Modified: head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Tue Jun 2 00:04:10 2009 (r193287) +++ head/sys/net80211/ieee80211_input.c Tue Jun 2 00:06:39 2009 (r193288) @@ -65,6 +65,9 @@ ieee80211_input_all(struct ieee80211com struct ieee80211_node *ni; struct mbuf *mcopy; + /* NB: could check for IFF_UP but this is cheaper */ + if (vap->iv_state == IEEE80211_S_INIT) + continue; /* * WDS vap's only receive directed traffic from the * station at the ``far end''. That traffic should From yongari at FreeBSD.org Tue Jun 2 00:21:31 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Tue Jun 2 00:21:37 2009 Subject: svn commit: r193289 - head/sys/dev/mii Message-ID: <200906020021.n520LVHR097034@svn.freebsd.org> Author: yongari Date: Tue Jun 2 00:21:30 2009 New Revision: 193289 URL: http://svn.freebsd.org/changeset/base/193289 Log: Don't assume page register value is 0 and restore previous page register after issuing 'powerup'. Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Tue Jun 2 00:06:39 2009 (r193288) +++ head/sys/dev/mii/e1000phy.c Tue Jun 2 00:21:30 2009 (r193289) @@ -239,11 +239,13 @@ e1000phy_reset(struct mii_softc *sc) PHY_WRITE(sc, E1000_SCR, reg); if (esc->mii_model == MII_MODEL_MARVELL_E1116) { + page = PHY_READ(sc, E1000_EADR); + /* Select page 2, MAC specific control register. */ PHY_WRITE(sc, E1000_EADR, 2); reg = PHY_READ(sc, E1000_SCR); reg |= E1000_SCR_RGMII_POWER_UP; PHY_WRITE(sc, E1000_SCR, reg); - PHY_WRITE(sc, E1000_EADR, 0); + PHY_WRITE(sc, E1000_EADR, page); } } From yongari at FreeBSD.org Tue Jun 2 00:30:31 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Tue Jun 2 00:30:44 2009 Subject: svn commit: r193291 - head/sys/dev/mii Message-ID: <200906020030.n520UV0K097289@svn.freebsd.org> Author: yongari Date: Tue Jun 2 00:30:30 2009 New Revision: 193291 URL: http://svn.freebsd.org/changeset/base/193291 Log: Program LED registers for 88E1116/88E1149 PHYs. These PHYs are found on Marvell Yukon Ultra, Marvell Yukon Extreme controllers. While I'm here explicitly issue 'powerup' command for 88E1149 PHY. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: head/sys/dev/mii/e1000phy.c head/sys/dev/mii/e1000phyreg.h Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Tue Jun 2 00:21:47 2009 (r193290) +++ head/sys/dev/mii/e1000phy.c Tue Jun 2 00:30:30 2009 (r193291) @@ -238,7 +238,8 @@ e1000phy_reset(struct mii_softc *sc) } PHY_WRITE(sc, E1000_SCR, reg); - if (esc->mii_model == MII_MODEL_MARVELL_E1116) { + if (esc->mii_model == MII_MODEL_MARVELL_E1116 || + esc->mii_model == MII_MODEL_MARVELL_E1149) { page = PHY_READ(sc, E1000_EADR); /* Select page 2, MAC specific control register. */ PHY_WRITE(sc, E1000_EADR, 2); @@ -252,9 +253,22 @@ e1000phy_reset(struct mii_softc *sc) switch (MII_MODEL(esc->mii_model)) { case MII_MODEL_MARVELL_E3082: case MII_MODEL_MARVELL_E1112: - case MII_MODEL_MARVELL_E1116: case MII_MODEL_MARVELL_E1118: + break; + case MII_MODEL_MARVELL_E1116: case MII_MODEL_MARVELL_E1149: + page = PHY_READ(sc, E1000_EADR); + /* Select page 3, LED control register. */ + PHY_WRITE(sc, E1000_EADR, 3); + PHY_WRITE(sc, E1000_SCR, + E1000_SCR_LED_LOS(1) | /* Link/Act */ + E1000_SCR_LED_INIT(8) | /* 10Mbps */ + E1000_SCR_LED_STAT1(7) | /* 100Mbps */ + E1000_SCR_LED_STAT0(7)); /* 1000Mbps */ + /* Set blink rate. */ + PHY_WRITE(sc, E1000_IER, E1000_PULSE_DUR(E1000_PULSE_170MS) | + E1000_BLINK_RATE(E1000_BLINK_84MS)); + PHY_WRITE(sc, E1000_EADR, page); break; case MII_MODEL_MARVELL_E3016: /* LED2 -> ACT, LED1 -> LINK, LED0 -> SPEED. */ Modified: head/sys/dev/mii/e1000phyreg.h ============================================================================== --- head/sys/dev/mii/e1000phyreg.h Tue Jun 2 00:21:47 2009 (r193290) +++ head/sys/dev/mii/e1000phyreg.h Tue Jun 2 00:30:30 2009 (r193291) @@ -256,9 +256,19 @@ /* 88E1116 page 0 */ #define E1000_SCR_POWER_DOWN 0x0004 -/* 88E1116 page 2 */ +/* 88E1116, 88E1149 page 2 */ #define E1000_SCR_RGMII_POWER_UP 0x0008 +/* 88E1116, 88E1149 page 3 */ +#define E1000_SCR_LED_STAT0_MASK 0x000F +#define E1000_SCR_LED_STAT1_MASK 0x00F0 +#define E1000_SCR_LED_INIT_MASK 0x0F00 +#define E1000_SCR_LED_LOS_MASK 0xF000 +#define E1000_SCR_LED_STAT0(x) ((x) & E1000_SCR_LED_STAT0_MASK) +#define E1000_SCR_LED_STAT1(x) ((x) & E1000_SCR_LED_STAT1_MASK) +#define E1000_SCR_LED_INIT(x) ((x) & E1000_SCR_LED_INIT_MASK) +#define E1000_SCR_LED_LOS(x) ((x) & E1000_SCR_LED_LOS_MASK) + #define E1000_SSR 0x11 /* special status register */ #define E1000_SSR_JABBER 0x0001 #define E1000_SSR_REV_POLARITY 0x0002 @@ -286,6 +296,26 @@ #define E1000_IER_SPEED_CHANGED 0x4000 #define E1000_IER_AUTO_NEG_ERR 0x8000 +/* 88E1116, 88E1149 page 3, LED timer control. */ +#define E1000_PULSE_MASK 0x7000 +#define E1000_PULSE_NO_STR 0 /* no pulse stretching */ +#define E1000_PULSE_21MS 1 /* 21 ms to 42 ms */ +#define E1000_PULSE_42MS 2 /* 42 ms to 84 ms */ +#define E1000_PULSE_84MS 3 /* 84 ms to 170 ms */ +#define E1000_PULSE_170MS 4 /* 170 ms to 340 ms */ +#define E1000_PULSE_340MS 5 /* 340 ms to 670 ms */ +#define E1000_PULSE_670MS 6 /* 670 ms to 1300 ms */ +#define E1000_PULSE_1300MS 7 /* 1300 ms to 2700 ms */ +#define E1000_PULSE_DUR(x) ((x) & E1000_PULSE_MASK) + +#define E1000_BLINK_MASK 0x0700 +#define E1000_BLINK_42MS 0 /* 42 ms */ +#define E1000_BLINK_84MS 1 /* 84 ms */ +#define E1000_BLINK_170MS 2 /* 170 ms */ +#define E1000_BLINK_340MS 3 /* 340 ms */ +#define E1000_BLINK_670MS 4 /* 670 ms */ +#define E1000_BLINK_RATE(x) ((x) & E1000_BLINK_MASK) + #define E1000_ISR 0x13 /* interrupt status reg */ #define E1000_ISR_JABBER 0x0001 #define E1000_ISR_POLARITY_CHANGE 0x0002 From sam at FreeBSD.org Tue Jun 2 00:33:29 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 00:33:41 2009 Subject: svn commit: r193292 - head/sys/net80211 Message-ID: <200906020033.n520XSbb097397@svn.freebsd.org> Author: sam Date: Tue Jun 2 00:33:28 2009 New Revision: 193292 URL: http://svn.freebsd.org/changeset/base/193292 Log: Fix monitor mode vaps to work as intended: o track # bpf taps on monitor mode vaps instead of # monitor mode vaps o spam monitor mode taps on tx/rx o fix ieee80211_radiotap_rx_all to dispatch frames only if the vap is up o while here print radiotap (and superg) state in show com Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_radiotap.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211.c Tue Jun 2 00:33:28 2009 (r193292) @@ -513,8 +513,6 @@ ieee80211_vap_attach(struct ieee80211vap IEEE80211_LOCK(ic); TAILQ_INSERT_TAIL(&ic->ic_vaps, vap, iv_next); - if (vap->iv_opmode == IEEE80211_M_MONITOR) - ic->ic_monvaps++; ieee80211_syncflag_locked(ic, IEEE80211_F_WME); #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP); @@ -575,8 +573,6 @@ ieee80211_vap_detach(struct ieee80211vap IEEE80211_LOCK(ic); KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running")); TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); - if (vap->iv_opmode == IEEE80211_M_MONITOR) - ic->ic_monvaps--; ieee80211_syncflag_locked(ic, IEEE80211_F_WME); #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP); Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_ddb.c Tue Jun 2 00:33:28 2009 (r193292) @@ -584,6 +584,11 @@ _db_show_com(const struct ieee80211com * db_printf(" lastnonht %d", ic->ic_lastnonht); db_printf("\n"); + db_printf("\tsuperg %p\n", ic->ic_superg); + + db_printf("\tmontaps %d th %p txchan %p rh %p rxchan %p\n", + ic->ic_montaps, ic->ic_th, ic->ic_txchan, ic->ic_rh, ic->ic_rxchan); + if (showprocs) { DB_PRINTSYM("\t", "ic_vap_create", ic->ic_vap_create); DB_PRINTSYM("\t", "ic_vap_delete", ic->ic_vap_delete); Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 00:33:28 2009 (r193292) @@ -706,11 +706,16 @@ bpf_track(void *arg, struct ifnet *ifp, * vap. This flag is used by drivers to prepare radiotap * state only when needed. */ - if (attach) + if (attach) { ieee80211_syncflag_ext(vap, IEEE80211_FEXT_BPF); + if (vap->iv_opmode == IEEE80211_M_MONITOR) + atomic_add_int(&vap->iv_ic->ic_montaps, 1); /* NB: if_softc is NULL on vap detach */ - else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) + } else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) { ieee80211_syncflag_ext(vap, -IEEE80211_FEXT_BPF); + if (vap->iv_opmode == IEEE80211_M_MONITOR) + atomic_subtract_int(&vap->iv_ic->ic_montaps, 1); + } } } Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_hostap.c Tue Jun 2 00:33:28 2009 (r193292) @@ -302,6 +302,9 @@ hostap_deliver_data(struct ieee80211vap struct ether_header *eh = mtod(m, struct ether_header *); struct ifnet *ifp = vap->iv_ifp; + /* clear driver/net80211 flags before passing up */ + m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); + KASSERT(vap->iv_opmode == IEEE80211_M_HOSTAP, ("gack, opmode %d", vap->iv_opmode)); /* @@ -316,9 +319,6 @@ hostap_deliver_data(struct ieee80211vap } else IEEE80211_NODE_STAT(ni, rx_ucast); - /* clear driver/net80211 flags before passing up */ - m->m_flags &= ~M_80211_RX; - /* perform as a bridge within the AP */ if ((vap->iv_flags & IEEE80211_F_NOBRIDGE) == 0) { struct mbuf *mcopy = NULL; Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_input.c Tue Jun 2 00:33:28 2009 (r193292) @@ -60,6 +60,8 @@ ieee80211_input_all(struct ieee80211com struct ieee80211vap *vap; int type = -1; + m->m_flags |= M_BCAST; /* NB: mark for bpf tap'ing */ + /* XXX locking */ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { struct ieee80211_node *ni; @@ -199,6 +201,9 @@ ieee80211_deliver_data(struct ieee80211v struct ether_header *eh = mtod(m, struct ether_header *); struct ifnet *ifp = vap->iv_ifp; + /* clear driver/net80211 flags before passing up */ + m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); + /* NB: see hostap_deliver_data, this path doesn't handle hostap */ KASSERT(vap->iv_opmode != IEEE80211_M_HOSTAP, ("gack, hostap")); /* @@ -214,9 +219,6 @@ ieee80211_deliver_data(struct ieee80211v IEEE80211_NODE_STAT(ni, rx_ucast); m->m_pkthdr.rcvif = ifp; - /* clear driver/net80211 flags before passing up */ - m->m_flags &= ~M_80211_RX; - if (ni->ni_vlan != 0) { /* attach vlan tag */ m->m_pkthdr.ether_vtag = ni->ni_vlan; Modified: head/sys/net80211/ieee80211_radiotap.c ============================================================================== --- head/sys/net80211/ieee80211_radiotap.c Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_radiotap.c Tue Jun 2 00:33:28 2009 (r193292) @@ -168,6 +168,7 @@ ieee80211_radiotap_chan_change(struct ie } } +#if 0 static void dispatch_radiotap(struct ieee80211vap *vap0, struct mbuf *m, struct ieee80211_radiotap_header *rh) @@ -175,17 +176,46 @@ dispatch_radiotap(struct ieee80211vap *v struct ieee80211com *ic = vap0->iv_ic; int len = le16toh(rh->it_len); - if (ieee80211_radiotap_active_vap(vap0)) + if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) bpf_mtap2(vap0->iv_rawbpf, rh, len, m); - if (ic->ic_monvaps) { + /* + * Spam monitor mode vaps with unicast frames. Multicast + * frames are handled by passing through ieee80211_input_all + * which distributes copies to the monitor mode vaps to be + * processed above. + */ + if (ic->ic_montaps != 0 && (m->m_flags & M_BCAST) == 0) { struct ieee80211vap *vap; TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - if (vap->iv_opmode == IEEE80211_M_MONITOR && - vap != vap0 && ieee80211_radiotap_active_vap(vap)) + if (vap != vap0 && + vap->iv_opmode == IEEE80211_M_MONITOR && + (vap->iv_flags_ext & IEEE80211_FEXT_BPF) && + vap->iv_state != IEEE80211_S_INIT) bpf_mtap2(vap->iv_rawbpf, rh, len, m); } } } +#endif + +/* + * Distribute radiotap data (+packet) to all monitor mode + * vaps with an active tap other than vap0. + */ +static void +spam_vaps(struct ieee80211vap *vap0, struct mbuf *m, + struct ieee80211_radiotap_header *rh, int len) +{ + struct ieee80211com *ic = vap0->iv_ic; + struct ieee80211vap *vap; + + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + if (vap != vap0 && + vap->iv_opmode == IEEE80211_M_MONITOR && + (vap->iv_flags_ext & IEEE80211_FEXT_BPF) && + vap->iv_state != IEEE80211_S_INIT) + bpf_mtap2(vap->iv_rawbpf, rh, len, m); + } +} /* * Dispatch radiotap data for transmitted packet. @@ -193,8 +223,20 @@ dispatch_radiotap(struct ieee80211vap *v void ieee80211_radiotap_tx(struct ieee80211vap *vap0, struct mbuf *m) { - KASSERT(vap0->iv_ic->ic_th != NULL, ("no tx radiotap header")); - dispatch_radiotap(vap0, m, vap0->iv_ic->ic_th); + struct ieee80211com *ic = vap0->iv_ic; + struct ieee80211_radiotap_header *th = ic->ic_th; + int len; + + KASSERT(th != NULL, ("no tx radiotap header")); + len = le16toh(th->it_len); + + if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) + bpf_mtap2(vap0->iv_rawbpf, th, len, m); + /* + * Spam monitor mode vaps. + */ + if (ic->ic_montaps != 0) + spam_vaps(vap0, m, th, len); } /* @@ -203,8 +245,22 @@ ieee80211_radiotap_tx(struct ieee80211va void ieee80211_radiotap_rx(struct ieee80211vap *vap0, struct mbuf *m) { - KASSERT(vap0->iv_ic->ic_rh != NULL, ("no rx radiotap header")); - dispatch_radiotap(vap0, m, vap0->iv_ic->ic_rh); + struct ieee80211com *ic = vap0->iv_ic; + struct ieee80211_radiotap_header *rh = ic->ic_rh; + int len; + + KASSERT(rh != NULL, ("no rx radiotap header")); + len = le16toh(rh->it_len); + + if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) + bpf_mtap2(vap0->iv_rawbpf, rh, len, m); + /* + * Spam monitor mode vaps with unicast frames. Multicast + * frames are handled by passing through ieee80211_input_all + * which distributes copies to the monitor mode vaps. + */ + if (ic->ic_montaps != 0 && (m->m_flags & M_BCAST) == 0) + spam_vaps(vap0, m, rh, len); } /* @@ -221,7 +277,8 @@ ieee80211_radiotap_rx_all(struct ieee802 /* XXX locking? */ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - if (ieee80211_radiotap_active_vap(vap)) + if (ieee80211_radiotap_active_vap(vap) && + vap->iv_state != IEEE80211_S_INIT) bpf_mtap2(vap->iv_rawbpf, rh, len, m); } } Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Jun 2 00:30:30 2009 (r193291) +++ head/sys/net80211/ieee80211_var.h Tue Jun 2 00:33:28 2009 (r193292) @@ -215,7 +215,7 @@ struct ieee80211com { void *ic_txchan; /* channel state in ic_th */ struct ieee80211_radiotap_header *ic_rh;/* rx radiotap headers */ void *ic_rxchan; /* channel state in ic_rh */ - int ic_monvaps; /* # monitor mode vaps */ + int ic_montaps; /* active monitor mode taps */ /* virtual ap create/delete */ struct ieee80211vap* (*ic_vap_create)(struct ieee80211com *, @@ -669,7 +669,8 @@ ieee80211_radiotap_active(const struct i static __inline int ieee80211_radiotap_active_vap(const struct ieee80211vap *vap) { - return (vap->iv_flags_ext & IEEE80211_FEXT_BPF) != 0; + return (vap->iv_flags_ext & IEEE80211_FEXT_BPF) || + vap->iv_ic->ic_montaps != 0; } /* From yongari at FreeBSD.org Tue Jun 2 04:00:18 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Tue Jun 2 04:00:30 2009 Subject: svn commit: r193293 - head/sys/dev/msk Message-ID: <200906020400.n5240He4001722@svn.freebsd.org> Author: yongari Date: Tue Jun 2 04:00:17 2009 New Revision: 193293 URL: http://svn.freebsd.org/changeset/base/193293 Log: Add preliminary Yukon Extreme support and register definitions. Yukon Extreme uses new descriptor format for TSO and has Tx frame parser which greatly reduces CPU cycles spent in computing TCP/UDP payload offset calculation in Tx checksum offloading path. The new descriptor format also removed TCP/UDP payload computation for TSO which in turn results in better TSO performance. It seems Yukon Extreme has a lot of new (unknown) features but only basic offloading is supported at this time. So far there are two known issues. o Sometimes Rx overrun errors happen when pulling data over gigabit link. Running over 100Mbps seem to ok. o Ethernet hardware address shows all-zeroed value on 88E8070. Assigning ethernet address with ifconfig is necessary to make it work. Support for Yukon Extreme is not perfect but it would be better than having a non-working device. Special thanks to jbh who fixed several bugs of initial patch. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 00:33:28 2009 (r193292) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 04:00:17 2009 (r193293) @@ -226,7 +226,7 @@ static struct msk_product { static const char *model_name[] = { "Yukon XL", "Yukon EC Ultra", - "Yukon Unknown", + "Yukon EX", "Yukon EC", "Yukon FE", "Yukon FE+" @@ -1116,16 +1116,19 @@ msk_phy_power(struct msk_softc *sc, int val = pci_read_config(sc->msk_dev, PCI_OUR_REG_1, 4); val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_XL: + if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { /* Deassert Low Power for 1st PHY. */ val |= PCI_Y2_PHY1_COMA; if (sc->msk_num_port > 1) val |= PCI_Y2_PHY2_COMA; } - break; + } + /* Release PHY from PowerDown/COMA mode. */ + pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); + switch (sc->msk_hw_id) { case CHIP_ID_YUKON_EC_U: + case CHIP_ID_YUKON_EX: case CHIP_ID_YUKON_FE_P: CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); @@ -1136,14 +1139,22 @@ msk_phy_power(struct msk_softc *sc, int PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ pci_write_config(sc->msk_dev, PCI_OUR_REG_4, our, 4); - /* Set to default value. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_5, 0, 4); + our = pci_read_config(sc->msk_dev, PCI_OUR_REG_5, 4); + our &= PCI_CTL_TIM_VMAIN_AV_MSK; + pci_write_config(sc->msk_dev, PCI_OUR_REG_5, our, 4); + pci_write_config(sc->msk_dev, PCI_CFG_REG_1, 0, 4); + /* + * Disable status race, workaround for + * Yukon EC Ultra & Yukon EX. + */ + val = CSR_READ_4(sc, B2_GP_IO); + val |= GLB_GPIO_STAT_RACE_DIS; + CSR_WRITE_4(sc, B2_GP_IO, val); + CSR_READ_4(sc, B2_GP_IO); break; default: break; } - /* Release PHY from PowerDown/COMA mode. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); for (i = 0; i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, MR_ADDR(i, GMAC_LINK_CTRL), GMLC_RST_SET); @@ -1194,10 +1205,18 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); /* Disable ASF. */ - if (sc->msk_hw_id < CHIP_ID_YUKON_XL) { - CSR_WRITE_4(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); - } + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { + status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); + /* Clear AHB bridge & microcontroller reset. */ + status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | + Y2_ASF_HCU_CCSR_CPU_RST_MODE); + /* Clear ASF microcontroller state. */ + status &= ~ Y2_ASF_HCU_CCSR_UC_STATE_MSK; + CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); + } else + CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); + CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); + /* * Since we disabled ASF, S/W reset is required for Power Management. */ @@ -1249,6 +1268,10 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF); + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), + GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | + GMC_BYP_RETR_ON); } CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); @@ -1651,6 +1674,10 @@ mskc_attach(device_t dev) sc->msk_clock = 125; /* 125 Mhz */ sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_JUMBO_NOCSUM; break; + case CHIP_ID_YUKON_EX: + sc->msk_clock = 125; /* 125 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2; + break; case CHIP_ID_YUKON_FE: sc->msk_clock = 100; /* 100 Mhz */ sc->msk_pflags |= MSK_FLAG_FASTETHER; @@ -3542,6 +3569,48 @@ done: } static void +msk_set_tx_stfwd(struct msk_if_softc *sc_if) +{ + struct msk_softc *sc; + struct ifnet *ifp; + + ifp = sc_if->msk_ifp; + sc = sc_if->msk_softc; + switch (sc->msk_hw_id) { + case CHIP_ID_YUKON_EX: + if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) + goto yukon_ex_workaround; + if (ifp->if_mtu > ETHERMTU) + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_ENA | TX_STFW_ENA); + else + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_DIS | TX_STFW_ENA); + break; + default: +yukon_ex_workaround: + if (ifp->if_mtu > ETHERMTU) { + /* Set Tx GMAC FIFO Almost Empty Threshold. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), + MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); + /* Disable Store & Forward mode for Tx. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_ENA | TX_STFW_DIS); + } else { + /* Enable Store & Forward mode for Tx. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_DIS | TX_STFW_ENA); + } + break; + } +} + +static void msk_init(void *xsc) { struct msk_if_softc *sc_if = xsc; @@ -3590,6 +3659,10 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), + GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | + GMC_BYP_RETR_ON); /* * Initialize GMAC first such that speed/duplex/flow-control @@ -3642,7 +3715,8 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_CLR); reg = GMF_OPER_ON | GMF_RX_F_FL_ON; - if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P) + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P || + sc->msk_hw_id == CHIP_ID_YUKON_EX) reg |= GMF_RX_OVER_ON; CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), reg); @@ -3678,20 +3752,8 @@ msk_init_locked(struct msk_if_softc *sc_ MSK_ECU_LLPP); CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR), MSK_ECU_ULPP); - if (ifp->if_mtu > ETHERMTU) { - /* - * Set Tx GMAC FIFO Almost Empty Threshold. - */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), - MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); - /* Disable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_DIS); - } else { - /* Enable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); - } + /* Configure store-and-forward for Tx. */ + msk_set_tx_stfwd(sc_if); } if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 00:33:28 2009 (r193292) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:00:17 2009 (r193293) @@ -225,6 +225,8 @@ #define PCI_OUR_REG_3 0x80 /* 32 bit Our Register 3 */ #define PCI_OUR_REG_4 0x84 /* 32 bit Our Register 4 */ #define PCI_OUR_REG_5 0x88 /* 32 bit Our Register 5 */ +#define PCI_CFG_REG_0 0x90 /* 32 bit Config Register 0 */ +#define PCI_CFG_REG_1 0x94 /* 32 bit Config Register 1 */ /* PCI Express Capability */ #define PEX_CAP_ID 0xe0 /* 8 bit PEX Capability ID */ @@ -325,6 +327,56 @@ #define PCI_CLK_GATE_PEX_UNIT_ENA BIT_1 /* Enable Gate PEX Unit Clock */ #define PCI_CLK_GATE_ROOT_COR_ENA BIT_0 /* Enable Gate Root Core Clock */ +/* PCI_OUR_REG_5 32 bit Our Register 5 (Yukon-ECU only) */ + /* Bit 31..27: for A3 & later */ +#define PCI_CTL_DIV_CORE_CLK_ENA BIT_31 /* Divide Core Clock Enable */ +#define PCI_CTL_SRESET_VMAIN_AV BIT_30 /* Soft Reset for Vmain_av De-Glitch */ +#define PCI_CTL_BYPASS_VMAIN_AV BIT_29 /* Bypass En. for Vmain_av De-Glitch */ +#define PCI_CTL_TIM_VMAIN_AV1 BIT_28 /* Bit 28..27: Timer Vmain_av Mask */ +#define PCI_CTL_TIM_VMAIN_AV0 BIT_27 /* Bit 28..27: Timer Vmain_av Mask */ +#define PCI_CTL_TIM_VMAIN_AV_MSK (BIT_28 | BIT_27) + /* Bit 26..16: Release Clock on Event */ +#define PCI_REL_PCIE_RST_DE_ASS BIT_26 /* PCIe Reset De-Asserted */ +#define PCI_REL_GPHY_REC_PACKET BIT_25 /* GPHY Received Packet */ +#define PCI_REL_INT_FIFO_N_EMPTY BIT_24 /* Internal FIFO Not Empty */ +#define PCI_REL_MAIN_PWR_AVAIL BIT_23 /* Main Power Available */ +#define PCI_REL_CLKRUN_REQ_REL BIT_22 /* CLKRUN Request Release */ +#define PCI_REL_PCIE_RESET_ASS BIT_21 /* PCIe Reset Asserted */ +#define PCI_REL_PME_ASSERTED BIT_20 /* PME Asserted */ +#define PCI_REL_PCIE_EXIT_L1_ST BIT_19 /* PCIe Exit L1 State */ +#define PCI_REL_LOADER_NOT_FIN BIT_18 /* EPROM Loader Not Finished */ +#define PCI_REL_PCIE_RX_EX_IDLE BIT_17 /* PCIe Rx Exit Electrical Idle State */ +#define PCI_REL_GPHY_LINK_UP BIT_16 /* GPHY Link Up */ + /* Bit 10.. 0: Mask for Gate Clock */ +#define PCI_GAT_PCIE_RST_ASSERTED BIT_10 /* PCIe Reset Asserted */ +#define PCI_GAT_GPHY_N_REC_PACKET BIT_9 /* GPHY Not Received Packet */ +#define PCI_GAT_INT_FIFO_EMPTY BIT_8 /* Internal FIFO Empty */ +#define PCI_GAT_MAIN_PWR_N_AVAIL BIT_7 /* Main Power Not Available */ +#define PCI_GAT_CLKRUN_REQ_REL BIT_6 /* CLKRUN Not Requested */ +#define PCI_GAT_PCIE_RESET_ASS BIT_5 /* PCIe Reset Asserted */ +#define PCI_GAT_PME_DE_ASSERTED BIT_4 /* PME De-Asserted */ +#define PCI_GAT_PCIE_ENTER_L1_ST BIT_3 /* PCIe Enter L1 State */ +#define PCI_GAT_LOADER_FINISHED BIT_2 /* EPROM Loader Finished */ +#define PCI_GAT_PCIE_RX_EL_IDLE BIT_1 /* PCIe Rx Electrical Idle State */ +#define PCI_GAT_GPHY_LINK_DOWN BIT_0 /* GPHY Link Down */ + +/* PCI_CFG_REG_1 32 bit Config Register 1 */ +#define PCI_CF1_DIS_REL_EVT_RST BIT_24 /* Dis. Rel. Event during PCIE reset */ + /* Bit 23..21: Release Clock on Event */ +#define PCI_CF1_REL_LDR_NOT_FIN BIT_23 /* EEPROM Loader Not Finished */ +#define PCI_CF1_REL_VMAIN_AVLBL BIT_22 /* Vmain available */ +#define PCI_CF1_REL_PCIE_RESET BIT_21 /* PCI-E reset */ + /* Bit 20..18: Gate Clock on Event */ +#define PCI_CF1_GAT_LDR_NOT_FIN BIT_20 /* EEPROM Loader Finished */ +#define PCI_CF1_GAT_PCIE_RX_IDLE BIT_19 /* PCI-E Rx Electrical idle */ +#define PCI_CF1_GAT_PCIE_RESET BIT_18 /* PCI-E Reset */ +#define PCI_CF1_PRST_PHY_CLKREQ BIT_17 /* Enable PCI-E rst & PM2PHY gen. CLKREQ */ +#define PCI_CF1_PCIE_RST_CLKREQ BIT_16 /* Enable PCI-E rst generate CLKREQ */ + +#define PCI_CF1_ENA_CFG_LDR_DONE BIT_8 /* Enable core level Config loader done */ +#define PCI_CF1_ENA_TXBMU_RD_IDLE BIT_1 /* Enable TX BMU Read IDLE for ASPM */ +#define PCI_CF1_ENA_TXBMU_WR_IDLE BIT_0 /* Enable TX BMU Write IDLE for ASPM */ + /* PEX_DEV_CTRL 16 bit PEX Device Control (Yukon-2) */ #define PEX_DC_MAX_RRS_MSK (7<<12) /* Bit 14..12: Max. Read Request Size */ #define PEX_DC_EN_NO_SNOOP BIT_11 /* Enable No Snoop */ @@ -621,6 +673,7 @@ #define B28_Y2_SMB_CSD_REG 0x0e44 /* 32 bit ASF SMB Control/Status/Data */ #define B28_Y2_ASF_IRQ_V_BASE 0x0e60 /* 32 bit ASF IRQ Vector Base */ #define B28_Y2_ASF_STAT_CMD 0x0e68 /* 32 bit ASF Status and Command Reg */ +#define B28_Y2_ASF_HCU_CCSR 0x0e68 /* 32 bit ASF HCU CCSR (Yukon EX) */ #define B28_Y2_ASF_HOST_COM 0x0e6c /* 32 bit ASF Host Communication Reg */ #define B28_Y2_DATA_REG_1 0x0e70 /* 32 bit ASF/Host Data Register 1 */ #define B28_Y2_DATA_REG_2 0x0e74 /* 32 bit ASF/Host Data Register 2 */ @@ -830,6 +883,7 @@ #define CHIP_ID_YUKON_LP 0xb2 /* Chip ID for YUKON-LP */ #define CHIP_ID_YUKON_XL 0xb3 /* Chip ID for YUKON-2 XL */ #define CHIP_ID_YUKON_EC_U 0xb4 /* Chip ID for YUKON-2 EC Ultra */ +#define CHIP_ID_YUKON_EX 0xb5 /* Chip ID for YUKON-2 Extreme */ #define CHIP_ID_YUKON_EC 0xb6 /* Chip ID for YUKON-2 EC */ #define CHIP_ID_YUKON_FE 0xb7 /* Chip ID for YUKON-2 FE */ #define CHIP_ID_YUKON_FE_P 0xb8 /* Chip ID for YUKON-2 FE+ */ @@ -848,6 +902,9 @@ #define CHIP_REV_YU_FE_P_A0 0 /* Chip Rev. for Yukon-2 FE+ A0 */ +#define CHIP_REV_YU_EX_A0 1 /* Chip Rev. for Yukon-2 EX A0 */ +#define CHIP_REV_YU_EX_B0 2 /* Chip Rev. for Yukon-2 EX B0 */ + /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ #define Y2_STATUS_LNK2_INAC BIT_7 /* Status Link 2 inactiv (0 = activ) */ #define Y2_CLK_GAT_LNK2_DIS BIT_6 /* Disable clock gating Link 2 */ @@ -912,6 +969,18 @@ #define TST_CFG_WRITE_ON BIT_1 /* Enable Config Reg WR */ #define TST_CFG_WRITE_OFF BIT_0 /* Disable Config Reg WR */ +/* B2_GP_IO */ +#define GLB_GPIO_CLK_DEB_ENA BIT_31 /* Clock Debug Enable */ +#define GLB_GPIO_CLK_DBG_MSK 0x3c000000 /* Clock Debug */ + +#define GLB_GPIO_INT_RST_D3_DIS BIT_15 /* Disable Internal Reset After D3 to D0 */ +#define GLB_GPIO_LED_PAD_SPEED_UP BIT_14 /* LED PAD Speed Up */ +#define GLB_GPIO_STAT_RACE_DIS BIT_13 /* Status Race Disable */ +#define GLB_GPIO_TEST_SEL_MSK 0x00001800 /* Testmode Select */ +#define GLB_GPIO_TEST_SEL_BASE BIT_11 +#define GLB_GPIO_RAND_ENA BIT_10 /* Random Enable */ +#define GLB_GPIO_RAND_BIT_1 BIT_9 /* Random Bit 1 */ + /* B2_I2C_CTRL 32 bit I2C HW Control Register */ #define I2C_FLAG BIT_31 /* Start read/write if WR */ #define I2C_ADDR (0x7fff<<16) /* Bit 30..16: Addr to be RD/WR */ @@ -1033,13 +1102,16 @@ /* Bit 10..0: same as for Rx */ /* Q_F 32 bit Flag Register */ -#define F_ALM_FULL BIT_27 /* Rx FIFO: almost full */ -#define F_EMPTY BIT_27 /* Tx FIFO: empty flag */ -#define F_FIFO_EOF BIT_26 /* Tag (EOF Flag) bit in FIFO */ -#define F_WM_REACHED BIT_25 /* Watermark reached */ -#define F_M_RX_RAM_DIS BIT_24 /* MAC Rx RAM Read Port disable */ -#define F_FIFO_LEVEL (0x1f<<16) /* Bit 23..16: # of Qwords in FIFO */ -#define F_WATER_MARK 0x0007ff /* Bit 10.. 0: Watermark */ +#define F_TX_CHK_AUTO_OFF BIT_31 /* Tx checksum auto-calc Off(Yukon EX)*/ +#define F_TX_CHK_AUTO_ON BIT_30 /* Tx checksum auto-calc On(Yukon EX)*/ +#define F_ALM_FULL BIT_28 /* Rx FIFO: almost full */ +#define F_EMPTY BIT_27 /* Tx FIFO: empty flag */ +#define F_FIFO_EOF BIT_26 /* Tag (EOF Flag) bit in FIFO */ +#define F_WM_REACHED BIT_25 /* Watermark reached */ +#define F_M_RX_RAM_DIS BIT_24 /* MAC Rx RAM Read Port disable */ +#define F_FIFO_LEVEL (0x1f<<16) + /* Bit 23..16: # of Qwords in FIFO */ +#define F_WATER_MARK 0x0007ff/* Bit 10.. 0: Watermark */ /* Queue Prefetch Unit Offsets, use Y2_PREF_Q_ADDR() to address (Yukon-2 only)*/ /* PREF_UNIT_CTRL_REG 32 bit Prefetch Control register */ @@ -1927,6 +1999,28 @@ #define Y2_ASF_UC_STATE (3<<2) /* ASF uC State */ #define Y2_ASF_CLK_HALT 0 /* ASF system clock stopped */ +/* B28_Y2_ASF_HCU_CCSR 32bit CPU Control and Status Register (Yukon EX) */ +#define Y2_ASF_HCU_CCSR_SMBALERT_MONITOR BIT_27 /* SMBALERT pin monitor */ +#define Y2_ASF_HCU_CCSR_CPU_SLEEP BIT_26 /* CPU sleep status */ +#define Y2_ASF_HCU_CCSR_CS_TO BIT_25 /* Clock Stretching Timeout */ +#define Y2_ASF_HCU_CCSR_WDOG BIT_24 /* Watchdog Reset */ +#define Y2_ASF_HCU_CCSR_CLR_IRQ_HOST BIT_17 /* Clear IRQ_HOST */ +#define Y2_ASF_HCU_CCSR_SET_IRQ_HCU BIT_16 /* Set IRQ_HCU */ +#define Y2_ASF_HCU_CCSR_AHB_RST BIT_9 /* Reset AHB bridge */ +#define Y2_ASF_HCU_CCSR_CPU_RST_MODE BIT_8 /* CPU Reset Mode */ +#define Y2_ASF_HCU_CCSR_SET_SYNC_CPU BIT_5 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE1 BIT_4 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE0 BIT_3 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_MSK (BIT_4 | BIT_3) /* CPU Clock Divide */ +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_BASE BIT_3 +#define Y2_ASF_HCU_CCSR_OS_PRSNT BIT_2 /* ASF OS Present */ + /* Microcontroller State */ +#define Y2_ASF_HCU_CCSR_UC_STATE_MSK 3 +#define Y2_ASF_HCU_CCSR_UC_STATE_BASE BIT_0 +#define Y2_ASF_HCU_CCSR_ASF_RESET 0 +#define Y2_ASF_HCU_CCSR_ASF_HALTED BIT_1 +#define Y2_ASF_HCU_CCSR_ASF_RUNNING BIT_0 + /* B28_Y2_ASF_HOST_COM 32 bit ASF Host Communication Reg */ /* This register is used by the ASF firmware */ #define Y2_ASF_CLR_ASFI BIT_1 /* Clear host IRQ */ @@ -1940,6 +2034,14 @@ #define SC_STAT_RST_SET BIT_0 /* Set Status Unit Reset */ /* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ +#define GMC_SEC_RST BIT_15 /* MAC SEC RST */ +#define GMC_SEC_RST_OFF BIT_14 /* MAC SEC RST Off */ +#define GMC_BYP_MACSECRX_ON BIT_13 /* Bypass MAC SEC RX */ +#define GMC_BYP_MACSECRX_OFF BIT_12 /* Bypass MAC SEC RX Off */ +#define GMC_BYP_MACSECTX_ON BIT_11 /* Bypass MAC SEC TX */ +#define GMC_BYP_MACSECTX_OFF BIT_10 /* Bypass MAC SEC TX Off */ +#define GMC_BYP_RETR_ON BIT_9 /* Bypass MAC retransmit FIFO On */ +#define GMC_BYP_RETR_OFF BIT_8 /* Bypass MAC retransmit FIFO Off */ #define GMC_H_BURST_ON BIT_7 /* Half Duplex Burst Mode On */ #define GMC_H_BURST_OFF BIT_6 /* Half Duplex Burst Mode Off */ #define GMC_F_LOOPB_ON BIT_5 /* FIFO Loopback On */ From yongari at FreeBSD.org Tue Jun 2 04:35:45 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Tue Jun 2 04:35:51 2009 Subject: svn commit: r193294 - head/sys/dev/msk Message-ID: <200906020435.n524ZiNk002470@svn.freebsd.org> Author: yongari Date: Tue Jun 2 04:35:44 2009 New Revision: 193294 URL: http://svn.freebsd.org/changeset/base/193294 Log: Add frame parser capability of Yukon FE+ and Yukon Extreme. With this feature hardware automatically computes TCP/UDP payload offset. Introduce MSK_FLAG_AUTOTX_CSUM to mark the capability. Yukon Extreme B0 revision is known to have a silicon for the feature so disable it. Yukon Extreme B0 still can do Tx checksum offloading but CPU have to compute TCP/UDP payload offset. To enable traditional checksum offloading, disable automatic Tx checksum calculation capability. Yukon Extreme A0 revision could not use store-and-forward mode for jumbo frames(silicon bug) so disable Tx checksum offloading for jumbo frames. I believe controllers that have MSK_FLAG_AUTOTX_CSUM capability or new descriptor format do not have Tx checksum offload bug so disable checksum offloading workaround for for short frames. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 04:00:17 2009 (r193293) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 04:35:44 2009 (r193294) @@ -1676,7 +1676,21 @@ mskc_attach(device_t dev) break; case CHIP_ID_YUKON_EX: sc->msk_clock = 125; /* 125 Mhz */ - sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2; + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; + /* + * Yukon Extreme seems to have silicon bug for + * automatic Tx checksum calculation capability. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_B0) + sc->msk_pflags &= ~MSK_FLAG_AUTOTX_CSUM; + /* + * Yukon Extreme A0 could not use store-and-forward + * for jumbo frames, so disable Tx checksum + * offloading for jumbo frames. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) + sc->msk_pflags |= MSK_FLAG_JUMBO_NOCSUM; break; case CHIP_ID_YUKON_FE: sc->msk_clock = 100; /* 100 Mhz */ @@ -1684,7 +1698,8 @@ mskc_attach(device_t dev) break; case CHIP_ID_YUKON_FE_P: sc->msk_clock = 50; /* 50 Mhz */ - sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2; + sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; if (sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { /* * XXX @@ -2477,8 +2492,10 @@ msk_encap(struct msk_if_softc *sc_if, st tcp_offset = offset = 0; m = *m_head; - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && - (m->m_pkthdr.csum_flags & (MSK_CSUM_FEATURES | CSUM_TSO)) != 0) { + if (((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) || + ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (m->m_pkthdr.csum_flags & CSUM_TSO) != 0)) { /* * Since mbuf has no protocol specific structure information * in it we have to inspect protocol information here to @@ -2537,9 +2554,12 @@ msk_encap(struct msk_if_softc *sc_if, st * resort to S/W checksum routine when we encounter short * TCP frames. * Short UDP packets appear to be handled correctly by - * Yukon II. + * Yukon II. Also I assume this bug does not happen on + * controllers that use newer descriptor format or + * automatic Tx checksum calaulcation. */ - if (m->m_pkthdr.len < MSK_MIN_FRAMELEN && + if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + (m->m_pkthdr.len < MSK_MIN_FRAMELEN) && (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) { m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { @@ -2640,7 +2660,7 @@ msk_encap(struct msk_if_softc *sc_if, st } /* Check if we have to handle checksum offload. */ if (tso == 0 && (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) { - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) + if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) != 0) control |= CALSUM; else { tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; @@ -3784,10 +3804,23 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_OPER_INIT); CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_FIFO_OP_ON); CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_WM), MSK_BMU_TX_WM); - if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U && - sc->msk_hw_rev == CHIP_REV_YU_EC_U_A0) { - /* Fix for Yukon-EC Ultra: set BMU FIFO level */ - CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_AL), MSK_ECU_TXFF_LEV); + switch (sc->msk_hw_id) { + case CHIP_ID_YUKON_EC_U: + if (sc->msk_hw_rev == CHIP_REV_YU_EC_U_A0) { + /* Fix for Yukon-EC Ultra: set BMU FIFO level */ + CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_AL), + MSK_ECU_TXFF_LEV); + } + break; + case CHIP_ID_YUKON_EX: + /* + * Yukon Extreme seems to have silicon bug for + * automatic Tx checksum calculation capability. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_B0) + CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_F), + F_TX_CHK_AUTO_OFF); + break; } /* Setup Rx Queue Bus Memory Interface. */ Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:00:17 2009 (r193293) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:35:44 2009 (r193294) @@ -2502,8 +2502,9 @@ struct msk_if_softc { #define MSK_FLAG_JUMBO_NOCSUM 0x0010 #define MSK_FLAG_RAMBUF 0x0020 #define MSK_FLAG_DESCV2 0x0040 -#define MSK_FLAG_NOHWVLAN 0x0080 -#define MSK_FLAG_NORXCHK 0x0100 +#define MSK_FLAG_AUTOTX_CSUM 0x0080 +#define MSK_FLAG_NOHWVLAN 0x0100 +#define MSK_FLAG_NORXCHK 0x0200 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From jkoshy at FreeBSD.org Tue Jun 2 04:45:57 2009 From: jkoshy at FreeBSD.org (Joseph Koshy) Date: Tue Jun 2 04:46:08 2009 Subject: svn commit: r193296 - head/usr.sbin/pmcstat Message-ID: <200906020445.n524juhw002771@svn.freebsd.org> Author: jkoshy Date: Tue Jun 2 04:45:56 2009 New Revision: 193296 URL: http://svn.freebsd.org/changeset/base/193296 Log: Catch up with the times: "mozilla" -> "firefox". Modified: head/usr.sbin/pmcstat/pmcstat.8 Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Tue Jun 2 04:44:38 2009 (r193295) +++ head/usr.sbin/pmcstat/pmcstat.8 Tue Jun 2 04:45:56 2009 (r193296) @@ -312,10 +312,10 @@ use: .Dl "pmcstat -O sample.stat -n 32768 -S k7-retired-instructions" .Pp To execute -.Nm mozilla +.Nm firefox and measure the number of data cache misses suffered by it and its children every 12 seconds on an AMD Athlon, use: -.Dl "pmcstat -d -w 12 -p k7-dc-misses mozilla" +.Dl "pmcstat -d -w 12 -p k7-dc-misses firefox" .Pp To measure instructions retired for all processes named .Dq emacs From yongari at FreeBSD.org Tue Jun 2 04:59:30 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Tue Jun 2 04:59:37 2009 Subject: svn commit: r193298 - head/sys/dev/msk Message-ID: <200906020459.n524xTE5003101@svn.freebsd.org> Author: yongari Date: Tue Jun 2 04:59:29 2009 New Revision: 193298 URL: http://svn.freebsd.org/changeset/base/193298 Log: Add Rx checksum offloading support for Yukon FE+ and Yukon Extreme. These controllers use newer descriptor format and the new descriptor format uses status LE to indicate the status of checksum. Rx checksummed value used in previous controllers were very cryptic and I failed to understand how to use them. In addition most controllers in previous generations had Rx checksum offloading bug. While I'm here introduce a MSK_FLAG_NORX_CSUM flag to bypass checking Rx checksum offloading as Yukon FE+ A0 has status LE bug. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 04:47:28 2009 (r193297) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 04:59:29 2009 (r193298) @@ -258,8 +258,8 @@ static void msk_intr_hwerr(struct msk_so #ifndef __NO_STRICT_ALIGNMENT static __inline void msk_fixup_rx(struct mbuf *); #endif -static void msk_rxeof(struct msk_if_softc *, uint32_t, int); -static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, int); +static void msk_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); +static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_txeof(struct msk_if_softc *, int); static int msk_encap(struct msk_if_softc *, struct mbuf **); static void msk_tx_task(void *, int); @@ -267,6 +267,7 @@ static void msk_start(struct ifnet *); static int msk_ioctl(struct ifnet *, u_long, caddr_t); static void msk_set_prefetch(struct msk_softc *, int, bus_addr_t, uint32_t); static void msk_set_rambuffer(struct msk_if_softc *); +static void msk_set_tx_stfwd(struct msk_if_softc *); static void msk_init(void *); static void msk_init_locked(struct msk_if_softc *); static void msk_stop(struct msk_if_softc *); @@ -991,12 +992,17 @@ msk_ioctl(struct ifnet *ifp, u_long comm else ifp->if_hwassist &= ~MSK_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; msk_setvlan(sc_if, ifp); } - + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (IFCAP_VLAN_HWCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; if ((mask & IFCAP_TSO4) != 0 && (IFCAP_TSO4 & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_TSO4; @@ -1492,6 +1498,13 @@ msk_attach(device_t dev) * make Rx checksum offload work on Yukon II hardware. */ ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4; + /* + * Enable Rx checksum offloading if controller support new + * descriptor format. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) + ifp->if_capabilities |= IFCAP_RXCSUM; ifp->if_hwassist = MSK_CSUM_FEATURES | CSUM_TSO; ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = msk_ioctl; @@ -1535,6 +1548,13 @@ msk_attach(device_t dev) * for VLAN interface. */ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; + /* + * Enable Rx checksum offloading for VLAN taggedd frames + * if controller support new descriptor format. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) + ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } ifp->if_capenable = ifp->if_capabilities; @@ -1711,7 +1731,8 @@ mskc_attach(device_t dev) * Just pass received frames to upper stack with * minimal test and let upper stack handle them. */ - sc->msk_pflags |= MSK_FLAG_NOHWVLAN | MSK_FLAG_NORXCHK; + sc->msk_pflags |= MSK_FLAG_NOHWVLAN | + MSK_FLAG_NORXCHK | MSK_FLAG_NORX_CSUM; } break; case CHIP_ID_YUKON_XL: @@ -2942,7 +2963,8 @@ msk_fixup_rx(struct mbuf *m) #endif static void -msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) +msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, + int len) { struct mbuf *m; struct ifnet *ifp; @@ -2994,6 +3016,18 @@ msk_rxeof(struct msk_if_softc *sc_if, ui msk_fixup_rx(m); #endif ifp->if_ipackets++; + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && + (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3010,7 +3044,8 @@ msk_rxeof(struct msk_if_softc *sc_if, ui } static void -msk_jumbo_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) +msk_jumbo_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, + int len) { struct mbuf *m; struct ifnet *ifp; @@ -3051,6 +3086,18 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ msk_fixup_rx(m); #endif ifp->if_ipackets++; + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && + (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3379,9 +3426,9 @@ msk_handle_events(struct msk_softc *sc) case OP_RXSTAT: if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) - msk_jumbo_rxeof(sc_if, status, len); + msk_jumbo_rxeof(sc_if, status, control, len); else - msk_rxeof(sc_if, status, len); + msk_rxeof(sc_if, status, control, len); rxprog++; /* * Because there is no way to sync single Rx LE Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:47:28 2009 (r193297) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:59:29 2009 (r193298) @@ -2255,8 +2255,19 @@ struct msk_stat_desc { #define OP_PUTIDX 0x70000000 #define STLE_OP_MASK 0xff000000 +#define STLE_CSS_MASK 0x00ff0000 #define STLE_LEN_MASK 0x0000ffff +/* CSS defined in status LE(valid for descriptor V2 format). */ +#define CSS_TCPUDP_CSUM_OK 0x00800000 +#define CSS_UDP 0x00400000 +#define CSS_TCP 0x00200000 +#define CSS_IPFRAG 0x00100000 +#define CSS_IPV6 0x00080000 +#define CSS_IPV4_CSUM_OK 0x00040000 +#define CSS_IPV4 0x00020000 +#define CSS_PORT 0x00010000 + /* Descriptor Bit Definition */ /* TxCtrl Transmit Buffer Control Field */ /* RxCtrl Receive Buffer Control Field */ @@ -2505,6 +2516,7 @@ struct msk_if_softc { #define MSK_FLAG_AUTOTX_CSUM 0x0080 #define MSK_FLAG_NOHWVLAN 0x0100 #define MSK_FLAG_NORXCHK 0x0200 +#define MSK_FLAG_NORX_CSUM 0x0400 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From yongari at FreeBSD.org Tue Jun 2 05:08:58 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Tue Jun 2 05:09:09 2009 Subject: svn commit: r193299 - head/sys/dev/msk Message-ID: <200906020508.n5258vOe003326@svn.freebsd.org> Author: yongari Date: Tue Jun 2 05:08:57 2009 New Revision: 193299 URL: http://svn.freebsd.org/changeset/base/193299 Log: Add Yukon Extreme device ids, 88E8071 and 88E8072. While I'm here correct description of 88E8070. 88E8070 is Yukon Extreme and have gigabit PHY. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Jun 2 04:59:29 2009 (r193298) +++ head/sys/dev/msk/if_msk.c Tue Jun 2 05:08:57 2009 (r193299) @@ -203,8 +203,6 @@ static struct msk_product { "Marvell Yukon 88E8040T Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8048, "Marvell Yukon 88E8048 Fast Ethernet" }, - { VENDORID_MARVELL, DEVICEID_MRVL_8070, - "Marvell Yukon 88E8070 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4361, "Marvell Yukon 88E8050 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4360, @@ -215,8 +213,14 @@ static struct msk_product { "Marvell Yukon 88E8055 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4364, "Marvell Yukon 88E8056 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4365, + "Marvell Yukon 88E8070 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436A, "Marvell Yukon 88E8058 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436B, + "Marvell Yukon 88E8071 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436C, + "Marvell Yukon 88E8072 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560T, Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Tue Jun 2 04:59:29 2009 (r193298) +++ head/sys/dev/msk/if_mskreg.h Tue Jun 2 05:08:57 2009 (r193299) @@ -139,8 +139,10 @@ #define DEVICEID_MRVL_4362 0x4362 #define DEVICEID_MRVL_4363 0x4363 #define DEVICEID_MRVL_4364 0x4364 -#define DEVICEID_MRVL_8070 0x4365 +#define DEVICEID_MRVL_4365 0x4365 #define DEVICEID_MRVL_436A 0x436A +#define DEVICEID_MRVL_436B 0x436B +#define DEVICEID_MRVL_436C 0x436C /* * D-Link gigabit ethernet device ID From yongari at FreeBSD.org Tue Jun 2 05:13:03 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Tue Jun 2 05:13:10 2009 Subject: svn commit: r193300 - head/share/man/man4 Message-ID: <200906020513.n525D2Oe003472@svn.freebsd.org> Author: yongari Date: Tue Jun 2 05:13:02 2009 New Revision: 193300 URL: http://svn.freebsd.org/changeset/base/193300 Log: Add 88E8071, 88E8072 to the supported hardware list. While I'm here correct description of 88E8070. It's Yukon Extreme and have gigabit PHY. Modified: head/share/man/man4/msk.4 Modified: head/share/man/man4/msk.4 ============================================================================== --- head/share/man/man4/msk.4 Tue Jun 2 05:08:57 2009 (r193299) +++ head/share/man/man4/msk.4 Tue Jun 2 05:13:02 2009 (r193300) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2009 +.Dd June 2, 2009 .Dt MSK 4 .Os .Sh NAME @@ -202,7 +202,11 @@ Marvell Yukon 88E8056 Gigabit Ethernet .It Marvell Yukon 88E8058 Gigabit Ethernet .It -Marvell Yukon 88E8070 Fast Ethernet +Marvell Yukon 88E8070 Gigabit Ethernet +.It +Marvell Yukon 88E8071 Gigabit Ethernet +.It +Marvell Yukon 88E8072 Gigabit Ethernet .It SysKonnect SK-9Sxx Gigabit Ethernet .It From jeff at FreeBSD.org Tue Jun 2 06:55:33 2009 From: jeff at FreeBSD.org (Jeff Roberson) Date: Tue Jun 2 06:55:45 2009 Subject: svn commit: r193301 - head/sys/kern Message-ID: <200906020655.n526tWQH005450@svn.freebsd.org> Author: jeff Date: Tue Jun 2 06:55:32 2009 New Revision: 193301 URL: http://svn.freebsd.org/changeset/base/193301 Log: - Use an acquire barrier to increment f_count in fget_unlocked and remove the volatile cast. Describe the reason in detail in a comment. Discussed with: bde, jhb Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Jun 2 05:13:02 2009 (r193300) +++ head/sys/kern/kern_descrip.c Tue Jun 2 06:55:32 2009 (r193301) @@ -2075,9 +2075,13 @@ fget_unlocked(struct filedesc *fdp, int count = fp->f_count; if (count == 0) continue; - if (atomic_cmpset_int(&fp->f_count, count, count + 1) != 1) + /* + * Use an acquire barrier to prevent caching of fd_ofiles + * so it is refreshed for verification. + */ + if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) != 1) continue; - if (fp == ((struct file *volatile*)fdp->fd_ofiles)[fd]) + if (fp == fdp->fd_ofiles[fd]) break; fdrop(fp, curthread); } From brian at FreeBSD.org Tue Jun 2 07:35:52 2009 From: brian at FreeBSD.org (Brian Somers) Date: Tue Jun 2 07:35:59 2009 Subject: svn commit: r193302 - head/etc/periodic/daily Message-ID: <200906020735.n527Zppv006238@svn.freebsd.org> Author: brian Date: Tue Jun 2 07:35:51 2009 New Revision: 193302 URL: http://svn.freebsd.org/changeset/base/193302 Log: Rather than using both -prune (which requires directory-first tree traversal) and -delete (which implies depth-first traversal), avoid using -delete in favour of -execdir. This has a side-effect of not removing directories that contain files, even if we delete all of those files, but IMHO that's a better option than specifying all possible local filesystem types in this script. PR: 122811 MFC after: 3 weeks Modified: head/etc/periodic/daily/100.clean-disks Modified: head/etc/periodic/daily/100.clean-disks ============================================================================== --- head/etc/periodic/daily/100.clean-disks Tue Jun 2 06:55:32 2009 (r193301) +++ head/etc/periodic/daily/100.clean-disks Tue Jun 2 07:35:51 2009 (r193302) @@ -29,7 +29,7 @@ case "$daily_clean_disks_enable" in echo "" echo "Cleaning disks:" set -f noglob - args="$args -name "`echo "$daily_clean_disks_files" | + args="-name "`echo "$daily_clean_disks_files" | sed -e 's/^[ ]*//' \ -e 's/[ ]*$//' \ -e 's/[ ][ ]*/ -o -name /g'` @@ -41,9 +41,9 @@ case "$daily_clean_disks_enable" in print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ - \( $args \) -atime +$daily_clean_disks_days -delete $print | - tee /dev/stderr | wc -l) + rc=$(find / \( ! -fstype local -o -fstype rdonly \) -prune -o \ + \( $args \) -atime +$daily_clean_disks_days \ + -execdir rm -df {} \; $print | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob From brian at Awfulhak.org Tue Jun 2 07:50:09 2009 From: brian at Awfulhak.org (Brian Somers) Date: Tue Jun 2 07:50:20 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <4A23E6E4.7020506@incunabulum.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> Message-ID: <20090602002149.1d7822b2@dev.lan.Awfulhak.org> On Mon, 01 Jun 2009 15:34:12 +0100 Bruce Simpson wrote: > Doug Barton wrote: > > Log: > > Eliminate the warning that "Values of network_interfaces other than > > AUTO are deprecated.' There is no good reason to deprecate them, and > > setting this to different values can be useful for custom solutions > > and/or one-off configuration problems. > > > > Thanks, I wasn't sure what the alternative to this functionality was > going to be, and was relying on this mechanism for a product. +1 - I rely on it to handle renamed interfaces properly (ifconfig -l gives different answers before and after the rename(s)). -- Brian Somers Don't _EVER_ lose your sense of humour ! From alc at FreeBSD.org Tue Jun 2 08:02:28 2009 From: alc at FreeBSD.org (Alan Cox) Date: Tue Jun 2 08:02:35 2009 Subject: svn commit: r193303 - in head/sys: kern vm Message-ID: <200906020802.n5282RM0006794@svn.freebsd.org> Author: alc Date: Tue Jun 2 08:02:27 2009 New Revision: 193303 URL: http://svn.freebsd.org/changeset/base/193303 Log: Correct a boundary case error in the management of a page's dirty bits by shm_dotruncate() and vnode_pager_setsize(). Specifically, if the length of a shared memory object or a file is truncated such that the length modulo the page size is between 1 and 511, then all of the page's dirty bits were cleared. Now, a dirty bit is cleared only if the corresponding block is truncated in its entirety. Modified: head/sys/kern/uipc_shm.c head/sys/vm/vnode_pager.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Tue Jun 2 07:35:51 2009 (r193302) +++ head/sys/kern/uipc_shm.c Tue Jun 2 08:02:27 2009 (r193303) @@ -274,7 +274,7 @@ shm_dotruncate(struct shmfd *shmfd, off_ /* * If the last page is partially mapped, then zero out * the garbage at the end of the page. See comments - * in vnode_page_setsize() for more details. + * in vnode_pager_setsize() for more details. * * XXXJHB: This handles in memory pages, but what about * a page swapped out to disk? @@ -286,10 +286,23 @@ shm_dotruncate(struct shmfd *shmfd, off_ int size = PAGE_SIZE - base; pmap_zero_page_area(m, base, size); + + /* + * Update the valid bits to reflect the blocks that + * have been zeroed. Some of these valid bits may + * have already been set. + */ + vm_page_set_valid(m, base, size); + + /* + * Round "base" to the next block boundary so that the + * dirty bit for a partially zeroed block is not + * cleared. + */ + base = roundup2(base, DEV_BSIZE); + vm_page_lock_queues(); - vm_page_set_validclean(m, base, size); - if (m->dirty != 0) - m->dirty = VM_PAGE_BITS_ALL; + vm_page_clear_dirty(m, base, PAGE_SIZE - base); vm_page_unlock_queues(); } else if ((length & PAGE_MASK) && __predict_false(object->cache != NULL)) { Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Jun 2 07:35:51 2009 (r193302) +++ head/sys/vm/vnode_pager.c Tue Jun 2 08:02:27 2009 (r193303) @@ -403,22 +403,28 @@ vnode_pager_setsize(vp, nsize) pmap_zero_page_area(m, base, size); /* - * Clear out partial-page dirty bits. This - * has the side effect of setting the valid - * bits, but that is ok. There are a bunch - * of places in the VM system where we expected - * m->dirty == VM_PAGE_BITS_ALL. The file EOF - * case is one of them. If the page is still - * partially dirty, make it fully dirty. + * Update the valid bits to reflect the blocks that + * have been zeroed. Some of these valid bits may + * have already been set. + */ + vm_page_set_valid(m, base, size); + + /* + * Round "base" to the next block boundary so that the + * dirty bit for a partially zeroed block is not + * cleared. + */ + base = roundup2(base, DEV_BSIZE); + + /* + * Clear out partial-page dirty bits. * * note that we do not clear out the valid * bits. This would prevent bogus_page * replacement from working properly. */ vm_page_lock_queues(); - vm_page_set_validclean(m, base, size); - if (m->dirty != 0) - m->dirty = VM_PAGE_BITS_ALL; + vm_page_clear_dirty(m, base, PAGE_SIZE - base); vm_page_unlock_queues(); } else if ((nsize & PAGE_MASK) && __predict_false(object->cache != NULL)) { From rwatson at FreeBSD.org Tue Jun 2 09:58:18 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Tue Jun 2 09:58:30 2009 Subject: svn commit: r193305 - head/sys/dev/puc Message-ID: <200906020958.n529wImV009198@svn.freebsd.org> Author: rwatson Date: Tue Jun 2 09:58:17 2009 New Revision: 193305 URL: http://svn.freebsd.org/changeset/base/193305 Log: Add support for the four PUC serial interfaces found on IBM SurePOS 300 series POS terminals. MFC after: 3 days Submitted by: Marc Balmer Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Tue Jun 2 09:25:56 2009 (r193304) +++ head/sys/dev/puc/pucdata.c Tue Jun 2 09:58:17 2009 (r193305) @@ -234,6 +234,17 @@ const struct puc_cfg puc_pci_devices[] = }, /* + * IBM SurePOS 300 Series (481033H) serial ports + * Details can be found on the IBM RSS websites + */ + + { 0x1014, 0x0297, 0xffff, 0, + "IBM SurePOS 300 Series (481033H) serial ports", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0 + }, + + /* * SIIG Boards. * * SIIG provides documentation for their boards at: From jhb at FreeBSD.org Tue Jun 2 12:35:05 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Tue Jun 2 12:35:17 2009 Subject: svn commit: r193306 - head/sys/dev/pci Message-ID: <200906021235.n52CZ4BF015807@svn.freebsd.org> Author: jhb Date: Tue Jun 2 12:35:04 2009 New Revision: 193306 URL: http://svn.freebsd.org/changeset/base/193306 Log: Include for va_*(). I'm not sure how this compiled on amd64 without this. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Jun 2 09:58:17 2009 (r193305) +++ head/sys/dev/pci/pci.c Tue Jun 2 12:35:04 2009 (r193306) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(__i386__) || defined(__amd64__) #include From attilio at FreeBSD.org Tue Jun 2 13:03:36 2009 From: attilio at FreeBSD.org (Attilio Rao) Date: Tue Jun 2 13:03:48 2009 Subject: svn commit: r193307 - in head/sys: kern sys ufs/ffs Message-ID: <200906021303.n52D3ZwD016385@svn.freebsd.org> Author: attilio Date: Tue Jun 2 13:03:35 2009 New Revision: 193307 URL: http://svn.freebsd.org/changeset/base/193307 Log: Handle lock recursion differenty by always checking against LO_RECURSABLE instead the lock own flag itself. Tested by: pho Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/kern/kern_lock.c Tue Jun 2 13:03:35 2009 (r193307) @@ -51,8 +51,7 @@ __FBSDID("$FreeBSD$"); #include #endif -CTASSERT(((LK_CANRECURSE | LK_NOSHARE) & LO_CLASSFLAGS) == - (LK_CANRECURSE | LK_NOSHARE)); +CTASSERT((LK_NOSHARE & LO_CLASSFLAGS) == LK_NOSHARE); #define SQ_EXCLUSIVE_QUEUE 0 #define SQ_SHARED_QUEUE 1 @@ -316,7 +315,9 @@ lockinit(struct lock *lk, int pri, const MPASS((flags & ~LK_INIT_MASK) == 0); - iflags = LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE; + iflags = LO_SLEEPABLE | LO_UPGRADABLE; + if (flags & LK_CANRECURSE) + iflags |= LO_RECURSABLE; if ((flags & LK_NODUP) == 0) iflags |= LO_DUPOK; if (flags & LK_NOPROFILE) @@ -325,7 +326,7 @@ lockinit(struct lock *lk, int pri, const iflags |= LO_WITNESS; if (flags & LK_QUIET) iflags |= LO_QUIET; - iflags |= flags & (LK_CANRECURSE | LK_NOSHARE); + iflags |= flags & LK_NOSHARE; lk->lk_lock = LK_UNLOCKED; lk->lk_recurse = 0; @@ -530,7 +531,7 @@ __lockmgr_args(struct lock *lk, u_int fl */ if (lockmgr_xlocked(lk)) { if ((flags & LK_CANRECURSE) == 0 && - (lk->lock_object.lo_flags & LK_CANRECURSE) == 0) { + (lk->lock_object.lo_flags & LO_RECURSABLE) == 0) { /* * If the lock is expected to not panic just Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/kern/kern_rwlock.c Tue Jun 2 13:03:35 2009 (r193307) @@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include -CTASSERT((RW_RECURSE & LO_CLASSFLAGS) == RW_RECURSE); - #if defined(SMP) && !defined(NO_ADAPTIVE_RWLOCKS) #define ADAPTIVE_RWLOCKS #endif @@ -177,16 +175,17 @@ rw_init_flags(struct rwlock *rw, const c MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | RW_RECURSE)) == 0); - flags = LO_UPGRADABLE | LO_RECURSABLE; + flags = LO_UPGRADABLE; if (opts & RW_DUPOK) flags |= LO_DUPOK; if (opts & RW_NOPROFILE) flags |= LO_NOPROFILE; if (!(opts & RW_NOWITNESS)) flags |= LO_WITNESS; + if (opts & RW_RECURSE) + flags |= LO_RECURSABLE; if (opts & RW_QUIET) flags |= LO_QUIET; - flags |= opts & RW_RECURSE; rw->rw_lock = RW_UNLOCKED; rw->rw_recurse = 0; @@ -249,7 +248,8 @@ _rw_try_wlock(struct rwlock *rw, const c KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_try_wlock() of destroyed rwlock @ %s:%d", file, line)); - if (rw_wlocked(rw) && (rw->lock_object.lo_flags & RW_RECURSE) != 0) { + if (rw_wlocked(rw) && + (rw->lock_object.lo_flags & LO_RECURSABLE) != 0) { rw->rw_recurse++; rval = 1; } else @@ -646,7 +646,7 @@ _rw_wlock_hard(struct rwlock *rw, uintpt #endif if (rw_wlocked(rw)) { - KASSERT(rw->lock_object.lo_flags & RW_RECURSE, + KASSERT(rw->lock_object.lo_flags & LO_RECURSABLE, ("%s: recursing but non-recursive rw %s @ %s:%d\n", __func__, rw->lock_object.lo_name, file, line)); rw->rw_recurse++; Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/kern/kern_sx.c Tue Jun 2 13:03:35 2009 (r193307) @@ -66,8 +66,7 @@ __FBSDID("$FreeBSD$"); #define ADAPTIVE_SX #endif -CTASSERT(((SX_NOADAPTIVE | SX_RECURSE) & LO_CLASSFLAGS) == - (SX_NOADAPTIVE | SX_RECURSE)); +CTASSERT((SX_NOADAPTIVE & LO_CLASSFLAGS) == SX_NOADAPTIVE); /* Handy macros for sleep queues. */ #define SQ_EXCLUSIVE_QUEUE 0 @@ -207,17 +206,19 @@ sx_init_flags(struct sx *sx, const char MPASS((opts & ~(SX_QUIET | SX_RECURSE | SX_NOWITNESS | SX_DUPOK | SX_NOPROFILE | SX_NOADAPTIVE)) == 0); - flags = LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE; + flags = LO_SLEEPABLE | LO_UPGRADABLE; if (opts & SX_DUPOK) flags |= LO_DUPOK; if (opts & SX_NOPROFILE) flags |= LO_NOPROFILE; if (!(opts & SX_NOWITNESS)) flags |= LO_WITNESS; + if (opts & SX_RECURSE) + flags |= LO_RECURSABLE; if (opts & SX_QUIET) flags |= LO_QUIET; - flags |= opts & (SX_NOADAPTIVE | SX_RECURSE); + flags |= opts & SX_NOADAPTIVE; sx->sx_lock = SX_LOCK_UNLOCKED; sx->sx_recurse = 0; lock_init(&sx->lock_object, &lock_class_sx, description, NULL, flags); @@ -305,7 +306,8 @@ _sx_try_xlock(struct sx *sx, const char KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_try_xlock() of destroyed sx @ %s:%d", file, line)); - if (sx_xlocked(sx) && (sx->lock_object.lo_flags & SX_RECURSE) != 0) { + if (sx_xlocked(sx) && + (sx->lock_object.lo_flags & LO_RECURSABLE) != 0) { sx->sx_recurse++; atomic_set_ptr(&sx->sx_lock, SX_LOCK_RECURSED); rval = 1; @@ -479,7 +481,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t /* If we already hold an exclusive lock, then recurse. */ if (sx_xlocked(sx)) { - KASSERT((sx->lock_object.lo_flags & SX_RECURSE) != 0, + KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0, ("_sx_xlock_hard: recursed on non-recursive sx %s @ %s:%d\n", sx->lock_object.lo_name, file, line)); sx->sx_recurse++; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/sys/vnode.h Tue Jun 2 13:03:35 2009 (r193307) @@ -419,7 +419,7 @@ extern struct vattr va_null; /* predefi #define VI_MTX(vp) (&(vp)->v_interlock) #define VN_LOCK_AREC(vp) \ - ((vp)->v_vnlock->lock_object.lo_flags |= LK_CANRECURSE) + ((vp)->v_vnlock->lock_object.lo_flags |= LO_RECURSABLE) #define VN_LOCK_ASHARE(vp) \ ((vp)->v_vnlock->lock_object.lo_flags &= ~LK_NOSHARE) Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Jun 2 12:35:04 2009 (r193306) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Jun 2 13:03:35 2009 (r193307) @@ -556,8 +556,8 @@ MTX_SYSINIT(softdep_lock, &lk, "Softdep #define ACQUIRE_LOCK(lk) mtx_lock(lk) #define FREE_LOCK(lk) mtx_unlock(lk) -#define BUF_AREC(bp) ((bp)->b_lock.lock_object.lo_flags |= LK_CANRECURSE) -#define BUF_NOREC(bp) ((bp)->b_lock.lock_object.lo_flags &= ~LK_CANRECURSE) +#define BUF_AREC(bp) ((bp)->b_lock.lock_object.lo_flags |= LO_RECURSABLE) +#define BUF_NOREC(bp) ((bp)->b_lock.lock_object.lo_flags &= ~LO_RECURSABLE) /* * Worklist queue management. From ed at FreeBSD.org Tue Jun 2 13:44:37 2009 From: ed at FreeBSD.org (Ed Schouten) Date: Tue Jun 2 13:44:49 2009 Subject: svn commit: r193308 - in head: . usr.bin usr.bin/window Message-ID: <200906021344.n52Dia3s017267@svn.freebsd.org> Author: ed Date: Tue Jun 2 13:44:36 2009 New Revision: 193308 URL: http://svn.freebsd.org/changeset/base/193308 Log: Remove window(1) from the base system. Some time ago Tom Rhodes sent me an email that he was willing to perform various cleanups to the window(1) source code. After some discussion, we both decided the best thing to do, was to move window(1) to the ports tree. The application isn't used a lot nowadays, mainly because it has been superseeded by screen, tmux, etc. A couple of hours ago Tom committed window(1) to ports (misc/window), so I'm removing it from the tree. I don't think people will really miss it, but I'm describing the change in UPDATING anyway. Discussed with: trhodes, pav, kib Approved by: re Deleted: head/usr.bin/window/ Modified: head/ObsoleteFiles.inc head/UPDATING head/usr.bin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jun 2 13:03:35 2009 (r193307) +++ head/ObsoleteFiles.inc Tue Jun 2 13:44:36 2009 (r193308) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090602: removal of window(1) +OLD_FILES+=usr/bin/window +OLD_FILES+=usr/share/man/man1/window.1.gz # 20090530: removal of early.sh OLD_FILES+=etc/rc.d/early.sh # 20090527: renaming of S{LIST,TAILQ}_REMOVE_NEXT() to _REMOVE_AFTER() Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Jun 2 13:03:35 2009 (r193307) +++ head/UPDATING Tue Jun 2 13:44:36 2009 (r193308) @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090602: + window(1) has been removed from the base system. It can now be + installed from ports. The port is called misc/window. + 20090601: The way we are storing and accessing `routing table' entries has changed. Programs reading the FIB, like netstat, need to Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Jun 2 13:03:35 2009 (r193307) +++ head/usr.bin/Makefile Tue Jun 2 13:44:36 2009 (r193308) @@ -222,7 +222,6 @@ SUBDIR= alias \ which \ who \ whois \ - window \ write \ xargs \ xinstall \ From gallatin at cs.duke.edu Tue Jun 2 14:26:03 2009 From: gallatin at cs.duke.edu (Andrew Gallatin) Date: Tue Jun 2 14:26:14 2009 Subject: svn commit: r193275 - in head/sys: kern sys vm In-Reply-To: <200906012132.n51LWq2U092924@svn.freebsd.org> References: <200906012132.n51LWq2U092924@svn.freebsd.org> Message-ID: <4A253627.4090505@cs.duke.edu> John Baldwin wrote: > Author: jhb > Date: Mon Jun 1 21:32:52 2009 > New Revision: 193275 > URL: http://svn.freebsd.org/changeset/base/193275 > > Log: > Add an extension to the character device interface that allows character > device drivers to use arbitrary VM objects to satisfy individual mmap() > requests. Is there an example usage of this? Was this one of the things that Nvidia asked for? Thanks, Drew From jhb at freebsd.org Tue Jun 2 15:11:49 2009 From: jhb at freebsd.org (John Baldwin) Date: Tue Jun 2 15:11:54 2009 Subject: svn commit: r193275 - in head/sys: kern sys vm In-Reply-To: <4A253627.4090505@cs.duke.edu> References: <200906012132.n51LWq2U092924@svn.freebsd.org> <4A253627.4090505@cs.duke.edu> Message-ID: <200906021110.40347.jhb@freebsd.org> On Tuesday 02 June 2009 10:24:39 am Andrew Gallatin wrote: > John Baldwin wrote: > > Author: jhb > > Date: Mon Jun 1 21:32:52 2009 > > New Revision: 193275 > > URL: http://svn.freebsd.org/changeset/base/193275 > > > > Log: > > Add an extension to the character device interface that allows character > > device drivers to use arbitrary VM objects to satisfy individual mmap() > > requests. > > Is there an example usage of this? Was this one of the things that > Nvidia asked for? Yes, this is for Nvidia. I have a bizarr-o test device in //depot/user/jhb/pat/modules/patdev/patdev.c. It exports a single anonymous memory object for mappings that use an offset at page 0 and a OBJT_SG (new type of VM object) object that maps the local APIC for mappings that use an offset at page 1. It's d_mmap_single() routine looks like this: static int pat_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, vm_object_t *object, int nprot) { struct patdev_softc *sc; int error; sc = dev->si_drv1; error = 0; sx_xlock(&sc->lock); switch (*offset) { case 0: /* * The first mmap() attempt with an offset of 0 creates * a new memory object with the requested size. Subsequent * mmap()'s map the same object. */ if (sc->mem == NULL) { /* * Note that this does not wire any backing * pages. I could do that later before a DMA * was started by wiring pages (even just * using the userland mapping to do that) * while the DMA was in-progress and unwiring * them later. */ sc->mem = vm_pager_allocate(OBJT_DEFAULT, NULL, size, VM_PROT_DEFAULT, 0); VM_OBJECT_LOCK(sc->mem); vm_object_clear_flag(sc->mem, OBJ_ONEMAPPING); vm_object_set_flag(sc->mem, OBJ_NOSPLIT); vm_object_set_cache_mode(sc->mem, VM_CACHE_WRITE_COMBINING); VM_OBJECT_UNLOCK(sc->mem); } vm_object_reference(sc->mem); *object = sc->mem; break; case PAGE_SIZE: /* Map the local APIC. */ vm_object_reference(sc->sgobj); *object = sc->sgobj; *offset = 0; break; default: /* Use ENODEV to fallback to d_mmap(). */ error = EINVAL; break; } sx_xunlock(&sc->lock); return (error); } The 'sgobj' object is created when the module is loaded: static int pat_attach(struct patdev_softc *sc) { vm_offset_t va; int rv; bzero(sc, sizeof(*sc)); sx_init(&sc->lock, "patdev"); sc->cdev = make_dev(&pat_devsw, 0, UID_ROOT, GID_WHEEL, 0640, "pat"); sc->cdev->si_drv1 = sc; /* Create a scatter/gather list that maps the local APIC. */ sc->sg = sglist_alloc(1, M_WAITOK); sglist_append_phys(sc->sg, lapic_paddr, LAPIC_LEN); /* Create a VM object that is backed by the scatter/gather list. */ sc->sgobj = vm_pager_allocate(OBJT_SG, sc->sg, LAPIC_LEN, VM_PROT_READ, 0); VM_OBJECT_LOCK(sc->sgobj); vm_object_set_cache_mode(sc->sgobj, VM_CACHE_UNCACHEABLE); VM_OBJECT_UNLOCK(sc->sgobj); ... } -- John Baldwin From brooks at FreeBSD.org Tue Jun 2 15:27:12 2009 From: brooks at FreeBSD.org (Brooks Davis) Date: Tue Jun 2 15:27:18 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <20090602002149.1d7822b2@dev.lan.Awfulhak.org> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602002149.1d7822b2@dev.lan.Awfulhak.org> Message-ID: <20090602152718.GA14685@lor.one-eyed-alien.net> On Tue, Jun 02, 2009 at 12:21:49AM -0700, Brian Somers wrote: > On Mon, 01 Jun 2009 15:34:12 +0100 Bruce Simpson wrote: > > Doug Barton wrote: > > > Log: > > > Eliminate the warning that "Values of network_interfaces other than > > > AUTO are deprecated.' There is no good reason to deprecate them, and > > > setting this to different values can be useful for custom solutions > > > and/or one-off configuration problems. > > > > > > > Thanks, I wasn't sure what the alternative to this functionality was > > going to be, and was relying on this mechanism for a product. > > +1 - I rely on it to handle renamed interfaces properly (ifconfig -l > gives different answers before and after the rename(s)). That's a supported configuration with network_interfaces=AUTO. I use it on the server I'm writing this from. For instance you can do something like: ifconfig_fxp0_name="iatel" ifconfig_iatel="up" ipv4_addrs_iatel="#.#.#.#/26" ifconfig_em0_name="priv" ifconfig_priv="inet 192.168.1.100 netmask 255.255.255.0" The use of ipv4_addrs_iatel is mostly just testing the feature. -- Brooks -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090602/277dae01/attachment.pgp From brooks at FreeBSD.org Tue Jun 2 15:27:30 2009 From: brooks at FreeBSD.org (Brooks Davis) Date: Tue Jun 2 15:27:43 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <4A23E6E4.7020506@incunabulum.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> Message-ID: <20090602152741.GB14685@lor.one-eyed-alien.net> On Mon, Jun 01, 2009 at 03:34:12PM +0100, Bruce Simpson wrote: > Doug Barton wrote: >> Log: >> Eliminate the warning that "Values of network_interfaces other than >> AUTO are deprecated.' There is no good reason to deprecate them, and >> setting this to different values can be useful for custom solutions >> and/or one-off configuration problems. >> > > Thanks, I wasn't sure what the alternative to this functionality was going > to be, and was relying on this mechanism for a product. Could you please say what you are actually doing? -- Brooks -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090602/c1c070fc/attachment.pgp From bms at incunabulum.net Tue Jun 2 15:34:12 2009 From: bms at incunabulum.net (Bruce Simpson) Date: Tue Jun 2 15:34:19 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <20090602152741.GB14685@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> Message-ID: <4A25466F.40504@incunabulum.net> Brooks Davis wrote: > On Mon, Jun 01, 2009 at 03:34:12PM +0100, Bruce Simpson wrote: > >> Doug Barton wrote: >> >>> Log: >>> Eliminate the warning that "Values of network_interfaces other than >>> AUTO are deprecated.' There is no good reason to deprecate them, and >>> setting this to different values can be useful for custom solutions >>> and/or one-off configuration problems. >>> >>> >> Thanks, I wasn't sure what the alternative to this functionality was going >> to be, and was relying on this mechanism for a product. >> > > Could you please say what you are actually doing? > On boot time I instantiate a tap0 instance from cloned_interfaces=".." in /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address on the tap instance from the internal Ethernet port, as there is no other way of uniquely identifying the client for an automated bootstrap. This happens from within a flash image. From brooks at FreeBSD.org Tue Jun 2 15:37:09 2009 From: brooks at FreeBSD.org (Brooks Davis) Date: Tue Jun 2 15:37:20 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <4A25466F.40504@incunabulum.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> <4A25466F.40504@incunabulum.net> Message-ID: <20090602153719.GD14685@lor.one-eyed-alien.net> On Tue, Jun 02, 2009 at 04:34:07PM +0100, Bruce Simpson wrote: > Brooks Davis wrote: >> On Mon, Jun 01, 2009 at 03:34:12PM +0100, Bruce Simpson wrote: >> >>> Doug Barton wrote: >>> >>>> Log: >>>> Eliminate the warning that "Values of network_interfaces other than >>>> AUTO are deprecated.' There is no good reason to deprecate them, and >>>> setting this to different values can be useful for custom solutions >>>> and/or one-off configuration problems. >>>> >>> Thanks, I wasn't sure what the alternative to this functionality was >>> going to be, and was relying on this mechanism for a product. >>> >> >> Could you please say what you are actually doing? >> > > On boot time I instantiate a tap0 instance from cloned_interfaces=".." in > /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address on > the tap instance from the internal Ethernet port, as there is no other way > of uniquely identifying the client for an automated bootstrap. > > This happens from within a flash image. I see nothing related to network_interfaces here... -- Brooks -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090602/6a340a37/attachment.pgp From bms at incunabulum.net Tue Jun 2 15:45:35 2009 From: bms at incunabulum.net (Bruce Simpson) Date: Tue Jun 2 15:45:52 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <20090602153719.GD14685@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> <4A25466F.40504@incunabulum.net> <20090602153719.GD14685@lor.one-eyed-alien.net> Message-ID: <4A25491B.4030406@incunabulum.net> Brooks Davis wrote: > ... >> On boot time I instantiate a tap0 instance from cloned_interfaces=".." in >> /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address on >> the tap instance from the internal Ethernet port, as there is no other way >> of uniquely identifying the client for an automated bootstrap. >> >> This happens from within a flash image. >> > > I see nothing related to network_interfaces here... > I did explicitly name them there, so there would be no automated DHCP setup of any interfaces, even if hot-plugged. Perhaps I am thinking of cloned_interfaces=""... From rwatson at FreeBSD.org Tue Jun 2 15:59:47 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Tue Jun 2 15:59:59 2009 Subject: svn commit: r193309 - head/sys/kern Message-ID: <200906021559.n52FxklU020018@svn.freebsd.org> Author: rwatson Date: Tue Jun 2 15:59:46 2009 New Revision: 193309 URL: http://svn.freebsd.org/changeset/base/193309 Log: Remove unneeded include. MFC after: 3 days Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Jun 2 13:44:36 2009 (r193308) +++ head/sys/kern/uipc_mbuf.c Tue Jun 2 15:59:46 2009 (r193309) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - int max_linkhdr; int max_protohdr; int max_hdr; From imp at FreeBSD.org Tue Jun 2 16:48:11 2009 From: imp at FreeBSD.org (Warner Losh) Date: Tue Jun 2 16:48:18 2009 Subject: svn commit: r193310 - head/sys/dev/bwi Message-ID: <200906021648.n52GmAhp021052@svn.freebsd.org> Author: imp Date: Tue Jun 2 16:48:10 2009 New Revision: 193310 URL: http://svn.freebsd.org/changeset/base/193310 Log: In bwi_newstate, only zero the bssid when we stop a STA. And only when we've not stopped the card. It hangs the system when we touch the CSR after bwistop. This fixes the hanging on kldunload. Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Tue Jun 2 15:59:46 2009 (r193309) +++ head/sys/dev/bwi/if_bwi.c Tue Jun 2 16:48:10 2009 (r193310) @@ -1771,10 +1771,12 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ieee80211com *ic= vap->iv_ic; + struct ifnet *ifp = ic->ic_ifp; + enum ieee80211_state ostate = vap->iv_state; struct bwi_softc *sc = ifp->if_softc; struct bwi_mac *mac; - struct ieee80211_node *ni; + struct ieee80211_node *ni = vap->iv_bss; int error; BWI_LOCK(sc); @@ -1790,11 +1792,25 @@ bwi_newstate(struct ieee80211vap *vap, e if (error != 0) goto back; + /* + * Clear the BSSID when we stop a STA + */ + if (vap->iv_opmode == IEEE80211_M_STA) { + if (ostate == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + /* + * Clear out the BSSID. If we reassociate to + * the same AP, this will reinialize things + * correctly... + */ + if (ic->ic_opmode == IEEE80211_M_STA && + !(sc->sc_flags & BWI_F_STOP)) + bwi_set_bssid(sc, bwi_zero_addr); + } + } + if (vap->iv_opmode == IEEE80211_M_MONITOR) { /* Nothing to do */ } else if (nstate == IEEE80211_S_RUN) { - ni = vap->iv_bss; - bwi_set_bssid(sc, vap->iv_bss->ni_bssid); KASSERT(sc->sc_cur_regwin->rw_type == BWI_REGWIN_T_MAC, @@ -1814,8 +1830,6 @@ bwi_newstate(struct ieee80211vap *vap, e } callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); - } else { - bwi_set_bssid(sc, bwi_zero_addr); } back: BWI_UNLOCK(sc); From brooks at FreeBSD.org Tue Jun 2 16:50:10 2009 From: brooks at FreeBSD.org (Brooks Davis) Date: Tue Jun 2 16:50:23 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <4A25491B.4030406@incunabulum.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A23E6E4.7020506@incunabulum.net> <20090602152741.GB14685@lor.one-eyed-alien.net> <4A25466F.40504@incunabulum.net> <20090602153719.GD14685@lor.one-eyed-alien.net> <4A25491B.4030406@incunabulum.net> Message-ID: <20090602165021.GB15552@lor.one-eyed-alien.net> On Tue, Jun 02, 2009 at 04:45:31PM +0100, Bruce Simpson wrote: > Brooks Davis wrote: >> ... >>> On boot time I instantiate a tap0 instance from cloned_interfaces=".." in >>> /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address >>> on the tap instance from the internal Ethernet port, as there is no other >>> way of uniquely identifying the client for an automated bootstrap. >>> >>> This happens from within a flash image. >>> >> >> I see nothing related to network_interfaces here... >> > > I did explicitly name them there, so there would be no automated DHCP setup > of any interfaces, even if hot-plugged. Perhaps I am thinking of > cloned_interfaces=""... cloned_interfaces is different and will definiterly remain since you've got to create them some how. They get created early and thus end up on the list. Also, there's no need to worry about hot plugged interfaces getting margically configured to do dhcp. For the system to do something with an interface they following must be true: - It makes it in to the list of interfaces some how - It actually exists or is create early in the process via cloned_interfaces, gif_interfaces, etc - The ifconfig_ variable is set (I think i can be "", but "up" is alwasy a good choice if you just want a stub. - The ifconfig_ variable must not contain the NOAUTO keyword. If all of those things are true, the interface will be configured at startup or on insert. Otherwise, it won't be. -- Brooks -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090602/edbc6ba3/attachment.pgp From gallatin at FreeBSD.org Tue Jun 2 16:52:34 2009 From: gallatin at FreeBSD.org (Andrew Gallatin) Date: Tue Jun 2 16:52:45 2009 Subject: svn commit: r193311 - head/sys/dev/mxge Message-ID: <200906021652.n52GqYnj021164@svn.freebsd.org> Author: gallatin Date: Tue Jun 2 16:52:33 2009 New Revision: 193311 URL: http://svn.freebsd.org/changeset/base/193311 Log: Buf-ring fixes for mxge - always maintain byte/mcast/drop stats via drbr - move #define of IFNET_BUF_RING so that its picked up by all files in the driver - conditionalize IFNET_BUF_RING on the FreeBSD_version bump just after it appeared in the tree. Sponsored by: Myricom Inc. Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Tue Jun 2 16:48:10 2009 (r193310) +++ head/sys/dev/mxge/if_mxge.c Tue Jun 2 16:52:33 2009 (r193311) @@ -30,8 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#define IFNET_BUF_RING - #include #include #include @@ -68,9 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef IFNET_BUF_RING -#include -#endif #include #include #include @@ -90,6 +85,9 @@ __FBSDID("$FreeBSD$"); #include /*#define MXGE_FAKE_IFP*/ #include +#ifdef IFNET_BUF_RING +#include +#endif /* tunable params */ static int mxge_nvidia_ecrc_enable = 1; @@ -2200,6 +2198,7 @@ mxge_transmit_locked(struct mxge_slice_s BPF_MTAP(ifp, m); /* give it to the nic */ mxge_encap(ss, m); + drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags); } else if ((err = drbr_enqueue(ifp, tx->br, m)) != 0) { return (err); } @@ -2656,11 +2655,6 @@ mxge_tx_done(struct mxge_slice_state *ss /* mbuf and DMA map only attached to the first segment per-mbuf */ if (m != NULL) { -#ifdef IFNET_BUF_RING - ss->obytes += m->m_pkthdr.len; - if (m->m_flags & M_MCAST) - ss->omcasts++; -#endif ss->opackets++; tx->info[idx].m = NULL; map = tx->info[idx].map; @@ -3787,11 +3781,6 @@ mxge_update_stats(mxge_softc_t *sc) struct mxge_slice_state *ss; u_long ipackets = 0; u_long opackets = 0; -#ifdef IFNET_BUF_RING - u_long obytes = 0; - u_long omcasts = 0; - u_long odrops = 0; -#endif u_long oerrors = 0; int slice; @@ -3799,20 +3788,10 @@ mxge_update_stats(mxge_softc_t *sc) ss = &sc->ss[slice]; ipackets += ss->ipackets; opackets += ss->opackets; -#ifdef IFNET_BUF_RING - obytes += ss->obytes; - omcasts += ss->omcasts; - odrops += ss->tx.br->br_drops; -#endif oerrors += ss->oerrors; } sc->ifp->if_ipackets = ipackets; sc->ifp->if_opackets = opackets; -#ifdef IFNET_BUF_RING - sc->ifp->if_obytes = obytes; - sc->ifp->if_omcasts = omcasts; - sc->ifp->if_snd.ifq_drops = odrops; -#endif sc->ifp->if_oerrors = oerrors; } Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Tue Jun 2 16:48:10 2009 (r193310) +++ head/sys/dev/mxge/if_mxge_var.h Tue Jun 2 16:52:33 2009 (r193311) @@ -46,6 +46,10 @@ $FreeBSD$ #define MXGE_VIRT_JUMBOS 0 #endif +#if (__FreeBSD_version > 800082) +#define IFNET_BUF_RING 1 +#endif + #ifndef VLAN_CAPABILITIES #define VLAN_CAPABILITIES(ifp) #define mxge_vlans_active(sc) (sc)->ifp->if_nvlans @@ -192,8 +196,6 @@ struct mxge_slice_state { volatile uint32_t *irq_claim; u_long ipackets; u_long opackets; - u_long obytes; - u_long omcasts; u_long oerrors; int if_drv_flags; struct lro_head lro_active; From sam at FreeBSD.org Tue Jun 2 16:57:28 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 16:57:41 2009 Subject: svn commit: r193312 - head/sys/net80211 Message-ID: <200906021657.n52GvRp5021311@svn.freebsd.org> Author: sam Date: Tue Jun 2 16:57:27 2009 New Revision: 193312 URL: http://svn.freebsd.org/changeset/base/193312 Log: Remove hack used to deal with ifnet teardown now that if_detach and the bridge do a better job. o move ether_ifdetach to the top of ieee80211_detach o do not clear if_softc at the top of ieee80211_detach; we no longer need this because we are safeguarded against calls coming back through if_ioctl o simplify the bpf tracker now that we don't null if_softc This also fixes an issue where having a bpf consumer active when a vap is destroyed would cause a crash because bpf referenced free'd memory. Reviewed by: imp Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 16:52:33 2009 (r193311) +++ head/sys/net80211/ieee80211.c Tue Jun 2 16:57:27 2009 (r193312) @@ -544,24 +544,10 @@ ieee80211_vap_detach(struct ieee80211vap __func__, ieee80211_opmode_name[vap->iv_opmode], ic->ic_ifp->if_xname); - IEEE80211_LOCK(ic); - /* block traffic from above */ - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - /* - * Evil hack. Clear the backpointer from the ifnet to the - * vap so any requests from above will return an error or - * be ignored. In particular this short-circuits requests - * by the bridge to turn off promiscuous mode as a result - * of calling ether_ifdetach. - */ - ifp->if_softc = NULL; - /* - * Stop the vap before detaching the ifnet. Ideally we'd - * do this in the other order so the ifnet is inaccessible - * while we cleanup internal state but that is hard. - */ - ieee80211_stop_locked(vap); - IEEE80211_UNLOCK(ic); + /* NB: bpfdetach is called by ether_ifdetach and claims all taps */ + ether_ifdetach(ifp); + + ieee80211_stop(vap); /* * Flush any deferred vap tasks. @@ -587,10 +573,6 @@ ieee80211_vap_detach(struct ieee80211vap ieee80211_syncifflag_locked(ic, IFF_ALLMULTI); IEEE80211_UNLOCK(ic); - /* XXX can't hold com lock */ - /* NB: bpfdetach is called by ether_ifdetach and claims all taps */ - ether_ifdetach(ifp); - ifmedia_removeall(&vap->iv_media); ieee80211_radiotap_vdetach(vap); Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 16:52:33 2009 (r193311) +++ head/sys/net80211/ieee80211_freebsd.c Tue Jun 2 16:57:27 2009 (r193312) @@ -710,8 +710,7 @@ bpf_track(void *arg, struct ifnet *ifp, ieee80211_syncflag_ext(vap, IEEE80211_FEXT_BPF); if (vap->iv_opmode == IEEE80211_M_MONITOR) atomic_add_int(&vap->iv_ic->ic_montaps, 1); - /* NB: if_softc is NULL on vap detach */ - } else if (vap != NULL && !bpf_peers_present(vap->iv_rawbpf)) { + } else if (!bpf_peers_present(vap->iv_rawbpf)) { ieee80211_syncflag_ext(vap, -IEEE80211_FEXT_BPF); if (vap->iv_opmode == IEEE80211_M_MONITOR) atomic_subtract_int(&vap->iv_ic->ic_montaps, 1); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 16:52:33 2009 (r193311) +++ head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 16:57:27 2009 (r193312) @@ -3202,29 +3202,14 @@ ieee80211_ioctl_updatemulti(struct ieee8 int ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ieee80211vap *vap; - struct ieee80211com *ic; + struct ieee80211vap *vap = ifp->if_softc; + struct ieee80211com *ic = vap->iv_ic; int error = 0; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ - vap = ifp->if_softc; - if (vap == NULL) { - /* - * During detach we clear the backpointer in the softc - * so any ioctl request through the ifnet that arrives - * before teardown is ignored/rejected. In particular - * this hack handles destroying a vap used by an app - * like wpa_supplicant that will respond to the vap - * being forced into INIT state by immediately trying - * to force it back up. We can yank this hack if/when - * we can destroy the ifnet before cleaning up vap state. - */ - return ENXIO; - } switch (cmd) { case SIOCSIFFLAGS: - ic = vap->iv_ic; IEEE80211_LOCK(ic); ieee80211_syncifflag_locked(ic, IFF_PROMISC); ieee80211_syncifflag_locked(ic, IFF_ALLMULTI); @@ -3250,7 +3235,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon break; case SIOCADDMULTI: case SIOCDELMULTI: - ieee80211_ioctl_updatemulti(vap->iv_ic); + ieee80211_ioctl_updatemulti(ic); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: From thompsa at FreeBSD.org Tue Jun 2 17:27:52 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Tue Jun 2 17:27:59 2009 Subject: svn commit: r193313 - head/lib/libusb Message-ID: <200906021727.n52HRpwa022008@svn.freebsd.org> Author: thompsa Date: Tue Jun 2 17:27:51 2009 New Revision: 193313 URL: http://svn.freebsd.org/changeset/base/193313 Log: Add libusb20_tr_get_length to get the transfer length. Submitted by: Hans Petter Selasky Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Tue Jun 2 16:57:27 2009 (r193312) +++ head/lib/libusb/libusb.3 Tue Jun 2 17:27:51 2009 (r193313) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2009 +.Dd May 28, 2009 .Dt LIBUSB 3 .Os .Sh NAME @@ -78,6 +78,8 @@ USB access library (libusb -lusb) .Fn libusb20_tr_set_callback "struct libusb20_transfer *xfer" "libusb20_tr_callback_t *cb" .Ft void .Fn libusb20_tr_set_flags "struct libusb20_transfer *xfer" "uint8_t flags" +.Ft uint32_t +.Fn libusb20_tr_get_length "struct libusb20_transfer *xfer" "uint16_t fr_index" .Ft void .Fn libusb20_tr_set_length "struct libusb20_transfer *xfer" "uint32_t length" "uint16_t fr_index" .Ft void @@ -183,6 +185,10 @@ USB access library (libusb -lusb) .Ft int .Fn libusb20_be_remove_dev_quirk "struct libusb20_backend *pbe" "struct libusb20_quirk *pq" .Ft struct libusb20_backend * +.Fn libusb20_be_alloc_default "void" +.Ft struct libusb20_backend * +.Fn libusb20_be_alloc_freebsd "void" +.Ft struct libusb20_backend * .Fn libusb20_be_alloc_linux "void" .Ft struct libusb20_device * .Fn libusb20_be_device_foreach "struct libusb20_backend *pbe" "struct libusb20_device *pdev" @@ -227,7 +233,7 @@ Non-zero return values indicate a LIBUSB .Pp . .Fn libusb20_tr_open -will allocate kernel resources like +will allocate kernel buffer resources according to .Fa max_buf_size and .Fa max_frame_count @@ -235,6 +241,18 @@ associated with an USB .Fa pxfer and bind the transfer to the specified .Fa ep_no . +.Fa max_buf_size +is the minimum buffer size which the data transport layer has to support. +If +.Fa max_buf_size +is zero, the +.Nm +library will use wMaxPacketSize to compute the buffer size. +This can be useful for isochronous transfers. +The actual buffer size can be greater than +.Fa max_buf_size +and is returned by +.Fn libusb20_tr_get_max_total_length . . This function returns zero upon success. . @@ -367,8 +385,14 @@ Will do a clear-stall before starting th . .Pp . +.Fn libusb20_tr_get_length +returns the length of the given USB frame by index. +After an USB transfer is complete the USB frame length will get updated to the actual transferred length. +. +.Pp +. .Fn libusb20_tr_set_length -sets the length of a given USB transfer and frame index. +sets the length of the given USB frame by index. . .Pp . @@ -750,7 +774,7 @@ function will wait until a pending USB t the given USB device. . A timeout value can be specified which is passed on to the -.Xr 2 poll +.Xr poll 2 function. . .Sh USB BACKEND OPERATIONS @@ -829,6 +853,10 @@ returned. If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is returned. . +.Pp +. +.Fn libusb20_be_alloc_default +.Fn libusb20_be_alloc_freebsd .Fn libusb20_be_alloc_linux These functions are used to allocate a specific USB backend or the operating system default USB backend. Allocating a backend is a way to Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Tue Jun 2 16:57:27 2009 (r193312) +++ head/lib/libusb/libusb20.c Tue Jun 2 17:27:51 2009 (r193313) @@ -319,6 +319,12 @@ libusb20_tr_set_flags(struct libusb20_tr return; } +uint32_t +libusb20_tr_get_length(struct libusb20_transfer *xfer, uint16_t frIndex) +{ + return (xfer->pLength[frIndex]); +} + void libusb20_tr_set_length(struct libusb20_transfer *xfer, uint32_t length, uint16_t frIndex) { Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Tue Jun 2 16:57:27 2009 (r193312) +++ head/lib/libusb/libusb20.h Tue Jun 2 17:27:51 2009 (r193313) @@ -216,6 +216,7 @@ void libusb20_tr_drain(struct libusb20_t void libusb20_tr_set_buffer(struct libusb20_transfer *xfer, void *buffer, uint16_t fr_index); void libusb20_tr_set_callback(struct libusb20_transfer *xfer, libusb20_tr_callback_t *cb); void libusb20_tr_set_flags(struct libusb20_transfer *xfer, uint8_t flags); +uint32_t libusb20_tr_get_length(struct libusb20_transfer *xfer, uint16_t fr_index); void libusb20_tr_set_length(struct libusb20_transfer *xfer, uint32_t length, uint16_t fr_index); void libusb20_tr_set_priv_sc0(struct libusb20_transfer *xfer, void *sc0); void libusb20_tr_set_priv_sc1(struct libusb20_transfer *xfer, void *sc1); From delphij at FreeBSD.org Tue Jun 2 17:27:55 2009 From: delphij at FreeBSD.org (Xin LI) Date: Tue Jun 2 17:28:09 2009 Subject: svn commit: r193314 - head/sys/dev/aic7xxx/aicasm Message-ID: <200906021727.n52HRtsc022048@svn.freebsd.org> Author: delphij Date: Tue Jun 2 17:27:54 2009 New Revision: 193314 URL: http://svn.freebsd.org/changeset/base/193314 Log: Re-enable WARNS=6 after my universe test. Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Tue Jun 2 17:27:51 2009 (r193313) +++ head/sys/dev/aic7xxx/aicasm/Makefile Tue Jun 2 17:27:54 2009 (r193314) @@ -15,6 +15,7 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSR CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} DPADD= ${LIBL} LDADD= -ll +WARNS?= 6 # Correct path for kernel builds # Don't rely on the kernel's .depend file From thompsa at FreeBSD.org Tue Jun 2 17:29:16 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Tue Jun 2 17:29:27 2009 Subject: svn commit: r193315 - head/sys/dev/usb/input Message-ID: <200906021729.n52HTFsX022117@svn.freebsd.org> Author: thompsa Date: Tue Jun 2 17:29:15 2009 New Revision: 193315 URL: http://svn.freebsd.org/changeset/base/193315 Log: Staticize ukbd_detach and fix indentation. Submitted by: Sylvestre Gallon Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Tue Jun 2 17:27:54 2009 (r193314) +++ head/sys/dev/usb/input/ukbd.c Tue Jun 2 17:29:15 2009 (r193315) @@ -822,7 +822,7 @@ detach: return (ENXIO); /* error */ } -int +static int ukbd_detach(device_t dev) { struct ukbd_softc *sc = device_get_softc(dev); @@ -1569,7 +1569,7 @@ static int ukbd_driver_load(module_t mod, int what, void *arg) { switch (what) { - case MOD_LOAD: + case MOD_LOAD: kbd_add_driver(&ukbd_kbd_driver); break; case MOD_UNLOAD: From thompsa at FreeBSD.org Tue Jun 2 17:30:19 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Tue Jun 2 17:30:31 2009 Subject: svn commit: r193316 - head/sys/dev/usb Message-ID: <200906021730.n52HUIMQ022202@svn.freebsd.org> Author: thompsa Date: Tue Jun 2 17:30:18 2009 New Revision: 193316 URL: http://svn.freebsd.org/changeset/base/193316 Log: Fix multithread issue where the is_uref variable was not set and cleared properly in the CDEV private data. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Tue Jun 2 17:29:15 2009 (r193315) +++ head/sys/dev/usb/usb_dev.c Tue Jun 2 17:30:18 2009 (r193316) @@ -169,21 +169,23 @@ usb2_ref_device(struct usb_cdev_privdata cpd->bus = devclass_get_softc(usb2_devclass_ptr, cpd->bus_index); if (cpd->bus == NULL) { DPRINTFN(2, "no bus at %u\n", cpd->bus_index); + need_uref = 0; goto error; } cpd->udev = cpd->bus->devices[cpd->dev_index]; if (cpd->udev == NULL) { DPRINTFN(2, "no device at %u\n", cpd->dev_index); + need_uref = 0; goto error; } if (cpd->udev->refcount == USB_DEV_REF_MAX) { DPRINTFN(2, "no dev ref\n"); + need_uref = 0; goto error; } if (need_uref) { DPRINTFN(2, "ref udev - needed\n"); cpd->udev->refcount++; - cpd->is_uref = 1; mtx_unlock(&usb2_ref_lock); @@ -194,6 +196,11 @@ usb2_ref_device(struct usb_cdev_privdata sx_xlock(cpd->udev->default_sx + 1); mtx_lock(&usb2_ref_lock); + + /* + * Set "is_uref" after grabbing the default SX lock + */ + cpd->is_uref = 1; } /* check if we are doing an open */ @@ -258,18 +265,18 @@ usb2_ref_device(struct usb_cdev_privdata } mtx_unlock(&usb2_ref_lock); - if (cpd->is_uref) { + if (need_uref) { mtx_lock(&Giant); /* XXX */ } return (0); error: - if (cpd->is_uref) { + if (need_uref) { + cpd->is_uref = 0; sx_unlock(cpd->udev->default_sx + 1); if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); } - cpd->is_uref = 0; } mtx_unlock(&usb2_ref_lock); DPRINTFN(2, "fail\n"); @@ -289,10 +296,14 @@ error: static usb_error_t usb2_usb_ref_device(struct usb_cdev_privdata *cpd) { + uint8_t is_uref; + + is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); + /* * Check if we already got an USB reference on this location: */ - if (cpd->is_uref) + if (is_uref) return (0); /* success */ /* @@ -313,7 +324,12 @@ usb2_usb_ref_device(struct usb_cdev_priv void usb2_unref_device(struct usb_cdev_privdata *cpd) { - if (cpd->is_uref) { + uint8_t is_uref; + + is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); + + if (is_uref) { + cpd->is_uref = 0; mtx_unlock(&Giant); /* XXX */ sx_unlock(cpd->udev->default_sx + 1); } @@ -330,11 +346,10 @@ usb2_unref_device(struct usb_cdev_privda } cpd->is_write = 0; } - if (cpd->is_uref) { + if (is_uref) { if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); } - cpd->is_uref = 0; } mtx_unlock(&usb2_ref_lock); } From thompsa at FreeBSD.org Tue Jun 2 17:31:17 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Tue Jun 2 17:31:29 2009 Subject: svn commit: r193317 - head/sys/dev/usb Message-ID: <200906021731.n52HVGEe022275@svn.freebsd.org> Author: thompsa Date: Tue Jun 2 17:31:16 2009 New Revision: 193317 URL: http://svn.freebsd.org/changeset/base/193317 Log: Fix compile after the removal of bsd_udev. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_compat_linux.h Modified: head/sys/dev/usb/usb_compat_linux.h ============================================================================== --- head/sys/dev/usb/usb_compat_linux.h Tue Jun 2 17:30:18 2009 (r193316) +++ head/sys/dev/usb/usb_compat_linux.h Tue Jun 2 17:31:16 2009 (r193317) @@ -339,6 +339,6 @@ void usb_linux_register(void *arg); void usb_linux_deregister(void *arg); #define interface_to_usbdev(intf) (intf)->linux_udev -#define interface_to_bsddev(intf) (intf)->linux_udev->bsd_udev +#define interface_to_bsddev(intf) (intf)->linux_udev #endif /* _USB_COMPAT_LINUX_H */ From thompsa at FreeBSD.org Tue Jun 2 17:32:00 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Tue Jun 2 17:32:11 2009 Subject: svn commit: r193318 - head/sys/dev/usb Message-ID: <200906021731.n52HVx9K022334@svn.freebsd.org> Author: thompsa Date: Tue Jun 2 17:31:59 2009 New Revision: 193318 URL: http://svn.freebsd.org/changeset/base/193318 Log: Reorgansise the logic for tranversing the pipe list. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Tue Jun 2 17:31:16 2009 (r193317) +++ head/sys/dev/usb/usb_request.c Tue Jun 2 17:31:59 2009 (r193318) @@ -109,11 +109,11 @@ usb2_do_clear_stall_callback(struct usb_ pipe_end = udev->pipes + udev->pipes_max; pipe_first = udev->pipes; to = udev->pipes_max; - if (pipe == NULL) { - pipe = pipe_first; - } + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: + if (pipe == NULL) + goto tr_setup; /* device was unconfigured */ if (pipe->edesc && pipe->is_stalled) { pipe->toggle_next = 0; @@ -126,9 +126,10 @@ usb2_do_clear_stall_callback(struct usb_ case USB_ST_SETUP: tr_setup: - if (pipe == pipe_end) { - pipe = pipe_first; - } + if (to == 0) + break; /* no pipes - nothing to do */ + if ((pipe < pipe_first) || (pipe >= pipe_end)) + pipe = pipe_first; /* pipe wrapped around */ if (pipe->edesc && pipe->is_stalled) { @@ -156,9 +157,8 @@ tr_setup: break; } pipe++; - if (--to) - goto tr_setup; - break; + to--; + goto tr_setup; default: if (xfer->error == USB_ERR_CANCELLED) { From lulf at FreeBSD.org Tue Jun 2 17:57:26 2009 From: lulf at FreeBSD.org (Ulf Lilleengen) Date: Tue Jun 2 17:58:00 2009 Subject: svn commit: r193325 - head/sbin/fsck_ffs Message-ID: <200906021757.n52HvPa8023319@svn.freebsd.org> Author: lulf Date: Tue Jun 2 17:57:24 2009 New Revision: 193325 URL: http://svn.freebsd.org/changeset/base/193325 Log: - Use volatile for signal variables. Suggested by: Jaakko Heinonen Modified: head/sbin/fsck_ffs/fsck.h Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Tue Jun 2 17:54:45 2009 (r193324) +++ head/sbin/fsck_ffs/fsck.h Tue Jun 2 17:57:24 2009 (r193325) @@ -297,8 +297,8 @@ int lfmode; /* lost & found directory ufs2_daddr_t n_blks; /* number of blocks in use */ ino_t n_files; /* number of files in use */ -sig_atomic_t got_siginfo; /* received a SIGINFO */ -sig_atomic_t got_sigalarm; /* received a SIGALRM */ +volatile sig_atomic_t got_siginfo; /* received a SIGINFO */ +volatile sig_atomic_t got_sigalarm; /* received a SIGALRM */ #define clearinode(dp) \ if (sblock.fs_magic == FS_UFS1_MAGIC) { \ From rwatson at FreeBSD.org Tue Jun 2 18:26:19 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Tue Jun 2 18:26:26 2009 Subject: svn commit: r193332 - in head/sys: kern netatalk netinet rpc security/mac Message-ID: <200906021826.n52IQHrh024410@svn.freebsd.org> Author: rwatson Date: Tue Jun 2 18:26:17 2009 New Revision: 193332 URL: http://svn.freebsd.org/changeset/base/193332 Log: Add internal 'mac_policy_count' counter to the MAC Framework, which is a count of the number of registered policies. Rather than unconditionally locking sockets before passing them into MAC, lock them in the MAC entry points only if mac_policy_count is non-zero. This avoids locking overhead for a number of socket system calls when no policies are registered, eliminating measurable overhead for the MAC Framework for the socket subsystem when there are no active policies. Possibly socket locks should be acquired by policies if they are required for socket labels, which would further avoid locking overhead when there are policies but they don't require labeling of sockets, or possibly don't even implement socket controls. Obtained from: TrustedBSD Project Modified: head/sys/kern/kern_prot.c head/sys/kern/sys_socket.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/netatalk/ddp_input.c head/sys/netinet/ip_divert.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/rpc/svc_vc.c head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_internal.h head/sys/security/mac/mac_socket.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/kern_prot.c Tue Jun 2 18:26:17 2009 (r193332) @@ -1690,9 +1690,7 @@ cr_canseesocket(struct ucred *cred, stru if (error) return (ENOENT); #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_visible(cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/sys_socket.c Tue Jun 2 18:26:17 2009 (r193332) @@ -78,9 +78,7 @@ soo_read(struct file *fp, struct uio *ui int error; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_receive(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif @@ -99,9 +97,7 @@ soo_write(struct file *fp, struct uio *u int error; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif @@ -222,9 +218,7 @@ soo_poll(struct file *fp, int events, st #ifdef MAC int error; - SOCK_LOCK(so); error = mac_socket_check_poll(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif @@ -243,9 +237,7 @@ soo_stat(struct file *fp, struct stat *u bzero((caddr_t)ub, sizeof (*ub)); ub->st_mode = S_IFSOCK; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_stat(active_cred, so); - SOCK_UNLOCK(so); if (error) return (error); #endif Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/uipc_socket.c Tue Jun 2 18:26:17 2009 (r193332) @@ -444,9 +444,7 @@ sonewconn(struct socket *head, int conns so->so_proto = head->so_proto; so->so_cred = crhold(head->so_cred); #ifdef MAC - SOCK_LOCK(head); mac_socket_newconn(head, so); - SOCK_UNLOCK(head); #endif knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv), NULL, NULL, NULL); Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/uipc_syscalls.c Tue Jun 2 18:26:17 2009 (r193332) @@ -221,16 +221,10 @@ kern_bind(td, fd, sa) ktrsockaddr(sa); #endif #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_bind(td->td_ucred, so, sa); - SOCK_UNLOCK(so); - if (error) - goto done; -#endif - error = sobind(so, sa, td); -#ifdef MAC -done: + if (error == 0) #endif + error = sobind(so, sa, td); fdrop(fp, td); return (error); } @@ -252,17 +246,14 @@ listen(td, uap) if (error == 0) { so = fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_listen(td->td_ucred, so); - SOCK_UNLOCK(so); - if (error) - goto done; + if (error == 0) { #endif - CURVNET_SET(so->so_vnet); - error = solisten(so, uap->backlog, td); - CURVNET_RESTORE(); + CURVNET_SET(so->so_vnet); + error = solisten(so, uap->backlog, td); + CURVNET_RESTORE(); #ifdef MAC -done: + } #endif fdrop(fp, td); } @@ -354,9 +345,7 @@ kern_accept(struct thread *td, int s, st goto done; } #ifdef MAC - SOCK_LOCK(head); error = mac_socket_check_accept(td->td_ucred, head); - SOCK_UNLOCK(head); if (error != 0) goto done; #endif @@ -549,9 +538,7 @@ kern_connect(td, fd, sa) ktrsockaddr(sa); #endif #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_connect(td->td_ucred, so, sa); - SOCK_UNLOCK(so); if (error) goto bad; #endif @@ -603,7 +590,6 @@ kern_socketpair(struct thread *td, int d if (error) return (error); #endif - error = socreate(domain, &so1, type, protocol, td->td_ucred, td); if (error) return (error); @@ -752,13 +738,13 @@ kern_sendit(td, s, mp, flags, control, s so = (struct socket *)fp->f_data; #ifdef MAC - SOCK_LOCK(so); - if (mp->msg_name != NULL) + if (mp->msg_name != NULL) { error = mac_socket_check_connect(td->td_ucred, so, mp->msg_name); - if (error == 0) - error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); + if (error) + goto bad; + } + error = mac_socket_check_send(td->td_ucred, so); if (error) goto bad; #endif @@ -951,9 +937,7 @@ kern_recvit(td, s, mp, fromseg, controlp so = fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_receive(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) { fdrop(fp, td); return (error); @@ -1887,9 +1871,7 @@ kern_sendfile(struct thread *td, struct } #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) goto out; #endif @@ -2417,9 +2399,7 @@ sctp_generic_sendmsg (td, uap) so = (struct socket *)fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) goto sctp_bad; #endif /* MAC */ @@ -2521,9 +2501,7 @@ sctp_generic_sendmsg_iov(td, uap) so = (struct socket *)fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_send(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) goto sctp_bad; #endif /* MAC */ @@ -2618,9 +2596,7 @@ sctp_generic_recvmsg(td, uap) so = fp->f_data; #ifdef MAC - SOCK_LOCK(so); error = mac_socket_check_receive(td->td_ucred, so); - SOCK_UNLOCK(so); if (error) { goto out; return (error); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/kern/uipc_usrreq.c Tue Jun 2 18:26:17 2009 (r193332) @@ -1246,10 +1246,8 @@ unp_connect(struct socket *so, struct so UNP_PCB_UNLOCK(unp2); UNP_PCB_UNLOCK(unp); #ifdef MAC - SOCK_LOCK(so); mac_socketpeer_set_from_socket(so, so3); mac_socketpeer_set_from_socket(so3, so); - SOCK_UNLOCK(so); #endif so2 = so3; Modified: head/sys/netatalk/ddp_input.c ============================================================================== --- head/sys/netatalk/ddp_input.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netatalk/ddp_input.c Tue Jun 2 18:26:17 2009 (r193332) @@ -410,12 +410,8 @@ ddp_input(struct mbuf *m, struct ifnet * goto out; #ifdef MAC - SOCK_LOCK(ddp->ddp_socket); - if (mac_socket_check_deliver(ddp->ddp_socket, m) != 0) { - SOCK_UNLOCK(ddp->ddp_socket); + if (mac_socket_check_deliver(ddp->ddp_socket, m) != 0) goto out; - } - SOCK_UNLOCK(ddp->ddp_socket); #endif /* Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netinet/ip_divert.c Tue Jun 2 18:26:17 2009 (r193332) @@ -467,9 +467,7 @@ div_output(struct socket *so, struct mbu m->m_pkthdr.rcvif = ifa->ifa_ifp; } #ifdef MAC - SOCK_LOCK(so); mac_socket_create_mbuf(so, m); - SOCK_UNLOCK(so); #endif /* Send packet to input processing via netisr */ netisr_queue_src(NETISR_IP, (uintptr_t)so, m); Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netinet/tcp_input.c Tue Jun 2 18:26:17 2009 (r193332) @@ -1562,9 +1562,7 @@ tcp_do_segment(struct mbuf *m, struct tc TCPSTAT_INC(tcps_connects); soisconnected(so); #ifdef MAC - SOCK_LOCK(so); mac_socketpeer_set_from_mbuf(m, so); - SOCK_UNLOCK(so); #endif /* Do window scaling on this connection? */ if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/netinet/tcp_syncache.c Tue Jun 2 18:26:17 2009 (r193332) @@ -635,9 +635,7 @@ syncache_socket(struct syncache *sc, str goto abort2; } #ifdef MAC - SOCK_LOCK(so); mac_socketpeer_set_from_mbuf(m, so); - SOCK_UNLOCK(so); #endif inp = sotoinpcb(so); Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/rpc/svc_vc.c Tue Jun 2 18:26:17 2009 (r193332) @@ -271,9 +271,7 @@ svc_vc_accept(struct socket *head, struc goto done; } #ifdef MAC - SOCK_LOCK(head); error = mac_socket_check_accept(td->td_ucred, head); - SOCK_UNLOCK(head); if (error != 0) goto done; #endif Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/security/mac/mac_framework.c Tue Jun 2 18:26:17 2009 (r193332) @@ -179,6 +179,7 @@ static struct sx mac_policy_sx; /* Slee struct mac_policy_list_head mac_policy_list; struct mac_policy_list_head mac_static_policy_list; +u_int mac_policy_count; /* Registered policy count. */ static void mac_policy_xlock(void); static void mac_policy_xlock_assert(void); @@ -351,17 +352,22 @@ mac_policy_getlabeled(struct mac_policy_ * requiring labels across all policies. */ static void -mac_policy_updateflags(void) +mac_policy_update(void) { struct mac_policy_conf *mpc; mac_policy_xlock_assert(); mac_labeled = 0; - LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) + mac_policy_count = 0; + LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) { mac_labeled |= mac_policy_getlabeled(mpc); - LIST_FOREACH(mpc, &mac_policy_list, mpc_list) + mac_policy_count++; + } + LIST_FOREACH(mpc, &mac_policy_list, mpc_list) { mac_labeled |= mac_policy_getlabeled(mpc); + mac_policy_count++; + } } static int @@ -434,7 +440,7 @@ mac_policy_register(struct mac_policy_co */ if (mpc->mpc_ops->mpo_init != NULL) (*(mpc->mpc_ops->mpo_init))(mpc); - mac_policy_updateflags(); + mac_policy_update(); SDT_PROBE(mac, kernel, policy, register, mpc, 0, 0, 0, 0); printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname, @@ -480,7 +486,7 @@ mac_policy_unregister(struct mac_policy_ LIST_REMOVE(mpc, mpc_list); mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED; - mac_policy_updateflags(); + mac_policy_update(); mac_policy_xunlock(); SDT_PROBE(mac, kernel, policy, unregister, mpc, 0, 0, 0, 0); Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/security/mac/mac_internal.h Tue Jun 2 18:26:17 2009 (r193332) @@ -189,6 +189,7 @@ struct label { */ extern struct mac_policy_list_head mac_policy_list; extern struct mac_policy_list_head mac_static_policy_list; +extern u_int mac_policy_count; extern uint64_t mac_labeled; extern struct mtx mac_ifnet_mtx; Modified: head/sys/security/mac/mac_socket.c ============================================================================== --- head/sys/security/mac/mac_socket.c Tue Jun 2 18:07:17 2009 (r193331) +++ head/sys/security/mac/mac_socket.c Tue Jun 2 18:26:17 2009 (r193332) @@ -234,10 +234,13 @@ void mac_socket_newconn(struct socket *oldso, struct socket *newso) { - SOCK_LOCK_ASSERT(oldso); + if (mac_policy_count == 0) + return; + SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socket_newconn, oldso, oldso->so_label, newso, newso->so_label); + SOCK_UNLOCK(oldso); } static void @@ -256,25 +259,30 @@ mac_socketpeer_set_from_mbuf(struct mbuf { struct label *label; - SOCK_LOCK_ASSERT(so); - label = mac_mbuf_to_label(m); + SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_mbuf, m, label, so, so->so_peerlabel); + SOCK_UNLOCK(so); } void mac_socketpeer_set_from_socket(struct socket *oldso, struct socket *newso) { + + if (mac_policy_count == 0) + return; /* - * XXXRW: only hold the socket lock on one at a time, as one socket - * is the original, and one is the new. However, it's called in both - * directions, so we can't assert the lock here currently. + * XXXRW: We want to hold locks on both sockets, but can't currently + * due to lock order -- opt to lock the socket where we're accessing + * so_label as it's more likely to change. */ + SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_socket, oldso, oldso->so_label, newso, newso->so_peerlabel); + SOCK_UNLOCK(oldso); } void @@ -282,12 +290,15 @@ mac_socket_create_mbuf(struct socket *so { struct label *label; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return; label = mac_mbuf_to_label(m); + SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socket_create_mbuf, so, so->so_label, m, label); + SOCK_UNLOCK(so); } MAC_CHECK_PROBE_DEFINE2(socket_check_accept, "struct ucred *", @@ -298,11 +309,14 @@ mac_socket_check_accept(struct ucred *cr { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_accept, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_accept, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -316,11 +330,14 @@ mac_socket_check_bind(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_bind, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_bind, error, cred, so, sa); + SOCK_UNLOCK(so); return (error); } @@ -334,11 +351,14 @@ mac_socket_check_connect(struct ucred *c { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_connect, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_connect, error, cred, so, sa); + SOCK_UNLOCK(so); return (error); } @@ -368,13 +388,16 @@ mac_socket_check_deliver(struct socket * struct label *label; int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); label = mac_mbuf_to_label(m); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_deliver, so, so->so_label, m, label); MAC_CHECK_PROBE2(socket_check_deliver, error, so, m); + SOCK_UNLOCK(so); return (error); } @@ -387,11 +410,14 @@ mac_socket_check_listen(struct ucred *cr { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_listen, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_listen, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -404,10 +430,13 @@ mac_socket_check_poll(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_poll, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_poll, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -420,11 +449,14 @@ mac_socket_check_receive(struct ucred *c { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_receive, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_receive, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -455,10 +487,13 @@ mac_socket_check_send(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_send, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_send, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -471,10 +506,13 @@ mac_socket_check_stat(struct ucred *cred { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_stat, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_stat, error, cred, so); + SOCK_UNLOCK(so); return (error); } @@ -487,11 +525,14 @@ mac_socket_check_visible(struct ucred *c { int error; - SOCK_LOCK_ASSERT(so); + if (mac_policy_count == 0) + return (0); + SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_visible, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_visible, error, cred, so); + SOCK_UNLOCK(so); return (error); } From pjd at FreeBSD.org Tue Jun 2 18:30:11 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Tue Jun 2 18:30:22 2009 Subject: svn commit: r193333 - head/sbin/mksnap_ffs Message-ID: <200906021830.n52IU9Aa024533@svn.freebsd.org> Author: pjd Date: Tue Jun 2 18:30:09 2009 New Revision: 193333 URL: http://svn.freebsd.org/changeset/base/193333 Log: Initialize iov and iovlen before use. Reported by: Lucius Windschuh Modified: head/sbin/mksnap_ffs/mksnap_ffs.c Modified: head/sbin/mksnap_ffs/mksnap_ffs.c ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.c Tue Jun 2 18:26:17 2009 (r193332) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Tue Jun 2 18:30:09 2009 (r193333) @@ -112,6 +112,8 @@ main(int argc, char **argv) if ((grp = getgrnam("operator")) == NULL) errx(1, "Cannot retrieve operator gid"); + iov = NULL; + iovlen = 0; build_iovec(&iov, &iovlen, "fstype", "ffs", 4); build_iovec(&iov, &iovlen, "from", snapname, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", stfsbuf.f_mntonname, (size_t)-1); From rwatson at FreeBSD.org Tue Jun 2 18:31:09 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Tue Jun 2 18:31:16 2009 Subject: svn commit: r193334 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf Message-ID: <200906021831.n52IV8YZ024597@svn.freebsd.org> Author: rwatson Date: Tue Jun 2 18:31:08 2009 New Revision: 193334 URL: http://svn.freebsd.org/changeset/base/193334 Log: Remove MAC kernel config files and add "options MAC" to GENERIC, with the goal of shipping 8.0 with MAC support in the default kernel. No policies will be compiled in or enabled by default, but it will now be possible to load them at boot or runtime without a kernel recompile. While the framework is not believed to impose measurable overhead when no policies are loaded (a result of optimization over the past few months in HEAD), we'll continue to benchmark and optimize as the release approaches. Please keep an eye out for performance or functionality regressions that could be a result of this change. Approved by: re (kensmith) Obtained from: TrustedBSD Project Deleted: head/sys/amd64/conf/MAC head/sys/i386/conf/MAC head/sys/ia64/conf/MAC head/sys/pc98/conf/MAC head/sys/powerpc/conf/MAC head/sys/sparc64/conf/MAC head/sys/sun4v/conf/MAC Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/amd64/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -70,6 +70,7 @@ options KBD_INSTALL_CDEV # install a CD options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/i386/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -71,6 +71,7 @@ options KBD_INSTALL_CDEV # install a CD options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework #options KDTRACE_HOOKS # Kernel DTrace hooks # Debugging for use in -current Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/ia64/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -40,6 +40,7 @@ options INVARIANTS # Enable calls of ex options INVARIANT_SUPPORT # required by INVARIANTS options KDB # Enable kernel debugger support options KTRACE # ktrace(1) syscall trace support +options MAC # TrustedBSD MAC Framework options MD_ROOT # MD usable as root device options MSDOSFS # MSDOS Filesystem options NFSCLIENT # Network Filesystem Client Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/pc98/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -73,6 +73,7 @@ options _KPOSIX_PRIORITY_SCHEDULING # P options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/powerpc/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -64,6 +64,7 @@ options SYSVSEM #SYSV-style semaphore options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB #Enable the kernel debugger Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/sparc64/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -65,6 +65,7 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Tue Jun 2 18:30:09 2009 (r193333) +++ head/sys/sun4v/conf/GENERIC Tue Jun 2 18:31:08 2009 (r193334) @@ -66,6 +66,7 @@ options AHC_REG_PRETTY_PRINT # Print re options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing +options MAC # TrustedBSD MAC Framework # Debugging for use in -current options KDB # Enable kernel debugger support. From sam at FreeBSD.org Tue Jun 2 18:53:22 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 18:53:41 2009 Subject: svn commit: r193336 - head/sys/net Message-ID: <200906021853.n52IrMsU025146@svn.freebsd.org> Author: sam Date: Tue Jun 2 18:53:21 2009 New Revision: 193336 URL: http://svn.freebsd.org/changeset/base/193336 Log: move ifq_detach from if_detach to if_free; this permits callers to reference if_snd in the period between detach+free which helps simplify detach code Reviewed by: jhb, rwatson Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jun 2 18:53:21 2009 (r193335) +++ head/sys/net/if.c Tue Jun 2 18:53:21 2009 (r193336) @@ -574,6 +574,7 @@ if_free_internal(struct ifnet *ifp) knlist_destroy(&ifp->if_klist); IF_AFDATA_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp); + ifq_detach(&ifp->if_snd); free(ifp, M_IFNET); } @@ -1025,9 +1026,6 @@ if_detach_internal(struct ifnet *ifp, in } ifp->if_afdata_initialized = 0; IF_AFDATA_UNLOCK(ifp); - - if (!vmove) - ifq_detach(&ifp->if_snd); } #ifdef VIMAGE From sam at FreeBSD.org Tue Jun 2 18:55:28 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 18:55:39 2009 Subject: svn commit: r193337 - head/sys/net80211 Message-ID: <200906021855.n52ItRMw025236@svn.freebsd.org> Author: sam Date: Tue Jun 2 18:55:27 2009 New Revision: 193337 URL: http://svn.freebsd.org/changeset/base/193337 Log: move if_detach to the top of ieee80211_ifdetach to close various races Reviewed by: jhb Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 18:53:21 2009 (r193336) +++ head/sys/net80211/ieee80211.c Tue Jun 2 18:55:27 2009 (r193337) @@ -313,6 +313,8 @@ ieee80211_ifdetach(struct ieee80211com * struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap; + if_detach(ifp); + while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) ieee80211_vap_destroy(vap); ieee80211_waitfor_parent(ic); @@ -329,11 +331,10 @@ ieee80211_ifdetach(struct ieee80211com * ieee80211_crypto_detach(ic); ieee80211_power_detach(ic); ieee80211_node_detach(ic); - ifmedia_removeall(&ic->ic_media); + ifmedia_removeall(&ic->ic_media); taskqueue_free(ic->ic_tq); IEEE80211_LOCK_DESTROY(ic); - if_detach(ifp); } /* From jhb at freebsd.org Tue Jun 2 19:11:10 2009 From: jhb at freebsd.org (John Baldwin) Date: Tue Jun 2 19:11:22 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <20090602165021.GB15552@lor.one-eyed-alien.net> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A25491B.4030406@incunabulum.net> <20090602165021.GB15552@lor.one-eyed-alien.net> Message-ID: <200906021511.03955.jhb@freebsd.org> On Tuesday 02 June 2009 12:50:21 pm Brooks Davis wrote: > On Tue, Jun 02, 2009 at 04:45:31PM +0100, Bruce Simpson wrote: > > Brooks Davis wrote: > >> ... > >>> On boot time I instantiate a tap0 instance from cloned_interfaces=".." in > >>> /etc/rc.conf, and then use ifconfig_tap0="..." to clone the MAC address > >>> on the tap instance from the internal Ethernet port, as there is no other > >>> way of uniquely identifying the client for an automated bootstrap. > >>> > >>> This happens from within a flash image. > >>> > >> > >> I see nothing related to network_interfaces here... > >> > > > > I did explicitly name them there, so there would be no automated DHCP setup > > of any interfaces, even if hot-plugged. Perhaps I am thinking of > > cloned_interfaces=""... > > cloned_interfaces is different and will definiterly remain since you've > got to create them some how. They get created early and thus end up on > the list. Also, there's no need to worry about hot plugged interfaces > getting margically configured to do dhcp. For the system to do > something with an interface they following must be true: > > - It makes it in to the list of interfaces some how > - It actually exists or is create early in the process via > cloned_interfaces, gif_interfaces, etc > - The ifconfig_ variable is set (I think i can be "", but "up" is > alwasy a good choice if you just want a stub. > - The ifconfig_ variable must not contain the NOAUTO keyword. > > If all of those things are true, the interface will be configured at > startup or on insert. Otherwise, it won't be. I think more specifically, if you don't set 'ifconfig_' to "DHCP", then when you plug a device in, nothing happens. DHCP is opt-in, not opt-out. The only reason one would want to limit network_interfaces is if you wanted to have an ifconfig_foo0 line in /etc/rc.conf but not have foo0 configured automatically. But you can already accomplish that via either the 'NOAUTO' keyword or just not having a bogus ifconfig_foo0 line. Given that, there really isn't a good reason to customize network_interfaces anymore. Unless someone has a real usage case that NOAUTO, etc. doesn't cover, I think this commit should be reverted. -- John Baldwin From dougb at FreeBSD.org Tue Jun 2 19:22:32 2009 From: dougb at FreeBSD.org (Doug Barton) Date: Tue Jun 2 19:22:39 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <200906021511.03955.jhb@freebsd.org> References: <200906010537.n515bDou065357@svn.freebsd.org> <4A25491B.4030406@incunabulum.net> <20090602165021.GB15552@lor.one-eyed-alien.net> <200906021511.03955.jhb@freebsd.org> Message-ID: <4A257BEF.2010205@FreeBSD.org> John Baldwin wrote: > I think more specifically, if you don't set 'ifconfig_' to "DHCP", then > when you plug a device in, nothing happens. That's actually not correct, as devd will try to dhcp an interface as soon as it comes up. > DHCP is opt-in, not > opt-out. The only reason one would want to limit network_interfaces is if > you wanted to have an ifconfig_foo0 line in /etc/rc.conf but not have foo0 > configured automatically. I've already said several times that I want to run through my own list of interfaces, configure the first one that comes up, and then stop. There is no support for that currently. Others have also chimed in with things that they do with the existing feature as well. > Unless someone has a real usage case that NOAUTO, etc. doesn't cover, I think > this commit should be reverted. I think that the burden of proof rests on those that want to eliminate existing functionality. Doug From thompsa at FreeBSD.org Tue Jun 2 19:28:28 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Tue Jun 2 19:28:35 2009 Subject: svn commit: r193338 - head/sys/dev/usb Message-ID: <200906021928.n52JSQwh025859@svn.freebsd.org> Author: thompsa Date: Tue Jun 2 19:28:26 2009 New Revision: 193338 URL: http://svn.freebsd.org/changeset/base/193338 Log: Place the fifo and ref counting variables on the stack to prevent races. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_dev.h Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Tue Jun 2 18:55:27 2009 (r193337) +++ head/sys/dev/usb/usb_dev.c Tue Jun 2 19:28:26 2009 (r193338) @@ -88,9 +88,9 @@ static struct usb_pipe *usb2_dev_get_pip static void usb2_loc_fill(struct usb_fs_privdata *, struct usb_cdev_privdata *); static void usb2_close(void *); -static usb_error_t usb2_ref_device(struct usb_cdev_privdata *, int); -static usb_error_t usb2_usb_ref_device(struct usb_cdev_privdata *); -static void usb2_unref_device(struct usb_cdev_privdata *); +static usb_error_t usb2_ref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *, int); +static usb_error_t usb2_usb_ref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *); +static void usb2_unref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *); static d_open_t usb2_open; static d_ioctl_t usb2_ioctl; @@ -158,29 +158,30 @@ usb2_loc_fill(struct usb_fs_privdata* pd * Else: Failure. *------------------------------------------------------------------------*/ usb_error_t -usb2_ref_device(struct usb_cdev_privdata* cpd, int need_uref) +usb2_ref_device(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd, int need_uref) { struct usb_fifo **ppf; struct usb_fifo *f; - DPRINTFN(2, "usb2_ref_device, cpd=%p need uref=%d\n", cpd, need_uref); + DPRINTFN(2, "cpd=%p need uref=%d\n", cpd, need_uref); + + /* clear all refs */ + memset(crd, 0, sizeof(*crd)); mtx_lock(&usb2_ref_lock); cpd->bus = devclass_get_softc(usb2_devclass_ptr, cpd->bus_index); if (cpd->bus == NULL) { DPRINTFN(2, "no bus at %u\n", cpd->bus_index); - need_uref = 0; goto error; } cpd->udev = cpd->bus->devices[cpd->dev_index]; if (cpd->udev == NULL) { DPRINTFN(2, "no device at %u\n", cpd->dev_index); - need_uref = 0; goto error; } if (cpd->udev->refcount == USB_DEV_REF_MAX) { DPRINTFN(2, "no dev ref\n"); - need_uref = 0; goto error; } if (need_uref) { @@ -200,79 +201,64 @@ usb2_ref_device(struct usb_cdev_privdata /* * Set "is_uref" after grabbing the default SX lock */ - cpd->is_uref = 1; + crd->is_uref = 1; } /* check if we are doing an open */ if (cpd->fflags == 0) { - /* set defaults */ - cpd->txfifo = NULL; - cpd->rxfifo = NULL; - cpd->is_write = 0; - cpd->is_read = 0; - cpd->is_usbfs = 0; + /* use zero defaults */ } else { - /* initialise "is_usbfs" flag */ - cpd->is_usbfs = 0; - /* check for write */ if (cpd->fflags & FWRITE) { ppf = cpd->udev->fifo; f = ppf[cpd->fifo_index + USB_FIFO_TX]; - cpd->txfifo = f; - cpd->is_write = 1; /* ref */ + crd->txfifo = f; + crd->is_write = 1; /* ref */ if (f == NULL || f->refcount == USB_FIFO_REF_MAX) goto error; if (f->curr_cpd != cpd) goto error; /* check if USB-FS is active */ if (f->fs_ep_max != 0) { - cpd->is_usbfs = 1; + crd->is_usbfs = 1; } - } else { - cpd->txfifo = NULL; - cpd->is_write = 0; /* no ref */ } /* check for read */ if (cpd->fflags & FREAD) { ppf = cpd->udev->fifo; f = ppf[cpd->fifo_index + USB_FIFO_RX]; - cpd->rxfifo = f; - cpd->is_read = 1; /* ref */ + crd->rxfifo = f; + crd->is_read = 1; /* ref */ if (f == NULL || f->refcount == USB_FIFO_REF_MAX) goto error; if (f->curr_cpd != cpd) goto error; /* check if USB-FS is active */ if (f->fs_ep_max != 0) { - cpd->is_usbfs = 1; + crd->is_usbfs = 1; } - } else { - cpd->rxfifo = NULL; - cpd->is_read = 0; /* no ref */ } } /* when everything is OK we increment the refcounts */ - if (cpd->is_write) { + if (crd->is_write) { DPRINTFN(2, "ref write\n"); - cpd->txfifo->refcount++; + crd->txfifo->refcount++; } - if (cpd->is_read) { + if (crd->is_read) { DPRINTFN(2, "ref read\n"); - cpd->rxfifo->refcount++; + crd->rxfifo->refcount++; } mtx_unlock(&usb2_ref_lock); - if (need_uref) { + if (crd->is_uref) { mtx_lock(&Giant); /* XXX */ } return (0); error: - if (need_uref) { - cpd->is_uref = 0; + if (crd->is_uref) { sx_unlock(cpd->udev->default_sx + 1); if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); @@ -294,25 +280,22 @@ error: * Else: Failure. *------------------------------------------------------------------------*/ static usb_error_t -usb2_usb_ref_device(struct usb_cdev_privdata *cpd) +usb2_usb_ref_device(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd) { - uint8_t is_uref; - - is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); - /* * Check if we already got an USB reference on this location: */ - if (is_uref) + if (crd->is_uref) return (0); /* success */ /* * To avoid deadlock at detach we need to drop the FIFO ref * and re-acquire a new ref! */ - usb2_unref_device(cpd); + usb2_unref_device(cpd, crd); - return (usb2_ref_device(cpd, 1 /* need uref */)); + return (usb2_ref_device(cpd, crd, 1 /* need uref */)); } /*------------------------------------------------------------------------* @@ -322,34 +305,34 @@ usb2_usb_ref_device(struct usb_cdev_priv * given USB device. *------------------------------------------------------------------------*/ void -usb2_unref_device(struct usb_cdev_privdata *cpd) +usb2_unref_device(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd) { - uint8_t is_uref; - is_uref = cpd->is_uref && sx_xlocked(cpd->udev->default_sx + 1); + DPRINTFN(2, "cpd=%p is_uref=%d\n", cpd, crd->is_uref); - if (is_uref) { - cpd->is_uref = 0; + if (crd->is_uref) { mtx_unlock(&Giant); /* XXX */ sx_unlock(cpd->udev->default_sx + 1); } mtx_lock(&usb2_ref_lock); - if (cpd->is_read) { - if (--(cpd->rxfifo->refcount) == 0) { - usb2_cv_signal(&cpd->rxfifo->cv_drain); + if (crd->is_read) { + if (--(crd->rxfifo->refcount) == 0) { + usb2_cv_signal(&crd->rxfifo->cv_drain); } - cpd->is_read = 0; + crd->is_read = 0; } - if (cpd->is_write) { - if (--(cpd->txfifo->refcount) == 0) { - usb2_cv_signal(&cpd->txfifo->cv_drain); + if (crd->is_write) { + if (--(crd->txfifo->refcount) == 0) { + usb2_cv_signal(&crd->txfifo->cv_drain); } - cpd->is_write = 0; + crd->is_write = 0; } - if (is_uref) { + if (crd->is_uref) { if (--(cpd->udev->refcount) == 0) { usb2_cv_signal(cpd->udev->default_cv + 1); } + crd->is_uref = 0; } mtx_unlock(&usb2_ref_lock); } @@ -372,7 +355,8 @@ usb2_fifo_alloc(void) * usb2_fifo_create *------------------------------------------------------------------------*/ static int -usb2_fifo_create(struct usb_cdev_privdata *cpd) +usb2_fifo_create(struct usb_cdev_privdata *cpd, + struct usb_cdev_refdata *crd) { struct usb_device *udev = cpd->udev; struct usb_fifo *f; @@ -396,13 +380,13 @@ usb2_fifo_create(struct usb_cdev_privdat f = udev->fifo[cpd->fifo_index + USB_FIFO_TX]; if (f == NULL) return (EINVAL); - cpd->txfifo = f; + crd->txfifo = f; } if (is_rx) { f = udev->fifo[cpd->fifo_index + USB_FIFO_RX]; if (f == NULL) return (EINVAL); - cpd->rxfifo = f; + crd->rxfifo = f; } return (0); } @@ -531,10 +515,10 @@ usb2_fifo_create(struct usb_cdev_privdat mtx_unlock(&usb2_ref_lock); } if (is_tx) { - cpd->txfifo = udev->fifo[n + USB_FIFO_TX]; + crd->txfifo = udev->fifo[n + USB_FIFO_TX]; } if (is_rx) { - cpd->rxfifo = udev->fifo[n + USB_FIFO_RX]; + crd->rxfifo = udev->fifo[n + USB_FIFO_RX]; } /* fill out fifo index */ DPRINTFN(5, "fifo index = %d\n", n); @@ -821,6 +805,7 @@ static int usb2_open(struct cdev *dev, int fflags, int devtype, struct thread *td) { struct usb_fs_privdata* pd = (struct usb_fs_privdata*)dev->si_drv1; + struct usb_cdev_refdata refs; struct usb_cdev_privdata *cpd; int err, ep; @@ -837,7 +822,7 @@ usb2_open(struct cdev *dev, int fflags, ep = cpd->ep_addr = pd->ep_addr; usb2_loc_fill(pd, cpd); - err = usb2_ref_device(cpd, 1); + err = usb2_ref_device(cpd, &refs, 1); if (err) { DPRINTFN(2, "cannot ref device\n"); free(cpd, M_USBDEV); @@ -846,36 +831,36 @@ usb2_open(struct cdev *dev, int fflags, cpd->fflags = fflags; /* access mode for open lifetime */ /* create FIFOs, if any */ - err = usb2_fifo_create(cpd); + err = usb2_fifo_create(cpd, &refs); /* check for error */ if (err) { DPRINTFN(2, "cannot create fifo\n"); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return (err); } if (fflags & FREAD) { - err = usb2_fifo_open(cpd, cpd->rxfifo, fflags); + err = usb2_fifo_open(cpd, refs.rxfifo, fflags); if (err) { DPRINTFN(2, "read open failed\n"); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return (err); } } if (fflags & FWRITE) { - err = usb2_fifo_open(cpd, cpd->txfifo, fflags); + err = usb2_fifo_open(cpd, refs.txfifo, fflags); if (err) { DPRINTFN(2, "write open failed\n"); if (fflags & FREAD) { - usb2_fifo_close(cpd->rxfifo, fflags); + usb2_fifo_close(refs.rxfifo, fflags); } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return (err); } } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); devfs_set_cdevpriv(cpd, usb2_close); return (0); @@ -887,24 +872,25 @@ usb2_open(struct cdev *dev, int fflags, static void usb2_close(void *arg) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata *cpd = arg; int err; DPRINTFN(2, "cpd=%p\n", cpd); - err = usb2_ref_device(cpd, 1); + err = usb2_ref_device(cpd, &refs, 1); if (err) { free(cpd, M_USBDEV); return; } if (cpd->fflags & FREAD) { - usb2_fifo_close(cpd->rxfifo, cpd->fflags); + usb2_fifo_close(refs.rxfifo, cpd->fflags); } if (cpd->fflags & FWRITE) { - usb2_fifo_close(cpd->txfifo, cpd->fflags); + usb2_fifo_close(refs.txfifo, cpd->fflags); } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); free(cpd, M_USBDEV); return; } @@ -1003,6 +989,7 @@ usb2_ioctl_f_sub(struct usb_fifo *f, u_l static int usb2_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread* td) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; int fflags; @@ -1015,11 +1002,11 @@ usb2_ioctl(struct cdev *dev, u_long cmd, return (err); /* - * Performance optimistaion: We try to check for IOCTL's that + * Performance optimisation: We try to check for IOCTL's that * don't need the USB reference first. Then we grab the USB * reference if we need it! */ - err = usb2_ref_device(cpd, 0 /* no uref */ ); + err = usb2_ref_device(cpd, &refs, 0 /* no uref */ ); if (err) { return (ENXIO); } @@ -1029,11 +1016,11 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = ENOIOCTL; /* set default value */ if (fflags & FWRITE) { - f = cpd->txfifo; + f = refs.txfifo; err = usb2_ioctl_f_sub(f, cmd, addr, td); } if (fflags & FREAD) { - f = cpd->rxfifo; + f = refs.rxfifo; err = usb2_ioctl_f_sub(f, cmd, addr, td); } KASSERT(f != NULL, ("fifo not found")); @@ -1041,7 +1028,7 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = (f->methods->f_ioctl) (f, cmd, addr, fflags); DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err); if (err == ENOIOCTL) { - if (usb2_usb_ref_device(cpd)) { + if (usb2_usb_ref_device(cpd, &refs)) { err = ENXIO; goto done; } @@ -1053,7 +1040,7 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = ENOTTY; } done: - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (err); } @@ -1061,13 +1048,14 @@ done: static int usb2_poll(struct cdev* dev, int events, struct thread* td) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; int fflags, revents; if (devfs_get_cdevpriv((void **)&cpd) != 0 || - usb2_ref_device(cpd, 0) != 0) + usb2_ref_device(cpd, &refs, 0) != 0) return (events & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); @@ -1078,11 +1066,11 @@ usb2_poll(struct cdev* dev, int events, if ((events & (POLLOUT | POLLWRNORM)) && (fflags & FWRITE)) { - f = cpd->txfifo; + f = refs.txfifo; mtx_lock(f->priv_mtx); - if (!cpd->is_usbfs) { + if (!refs.is_usbfs) { if (f->flag_iserror) { /* we got an error */ m = (void *)1; @@ -1117,11 +1105,11 @@ usb2_poll(struct cdev* dev, int events, if ((events & (POLLIN | POLLRDNORM)) && (fflags & FREAD)) { - f = cpd->rxfifo; + f = refs.rxfifo; mtx_lock(f->priv_mtx); - if (!cpd->is_usbfs) { + if (!refs.is_usbfs) { if (f->flag_iserror) { /* we have and error */ m = (void *)1; @@ -1150,7 +1138,7 @@ usb2_poll(struct cdev* dev, int events, f->flag_isselect = 1; selrecord(td, &f->selinfo); - if (!cpd->is_usbfs) { + if (!refs.is_usbfs) { /* start reading data */ (f->methods->f_start_read) (f); } @@ -1158,13 +1146,14 @@ usb2_poll(struct cdev* dev, int events, mtx_unlock(f->priv_mtx); } - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (revents); } static int usb2_read(struct cdev *dev, struct uio *uio, int ioflag) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; @@ -1178,15 +1167,16 @@ usb2_read(struct cdev *dev, struct uio * if (err != 0) return (err); - err = usb2_ref_device(cpd, 0 /* no uref */ ); + err = usb2_ref_device(cpd, &refs, 0 /* no uref */ ); if (err) { return (ENXIO); } fflags = cpd->fflags; - f = cpd->rxfifo; + f = refs.rxfifo; if (f == NULL) { /* should not happen */ + usb2_unref_device(cpd, &refs); return (EPERM); } @@ -1200,7 +1190,7 @@ usb2_read(struct cdev *dev, struct uio * goto done; } /* check if USB-FS interface is active */ - if (cpd->is_usbfs) { + if (refs.is_usbfs) { /* * The queue is used for events that should be * retrieved using the "USB_FS_COMPLETE" ioctl. @@ -1278,7 +1268,7 @@ usb2_read(struct cdev *dev, struct uio * done: mtx_unlock(f->priv_mtx); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (err); } @@ -1286,6 +1276,7 @@ done: static int usb2_write(struct cdev *dev, struct uio *uio, int ioflag) { + struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; @@ -1301,16 +1292,16 @@ usb2_write(struct cdev *dev, struct uio if (err != 0) return (err); - err = usb2_ref_device(cpd, 0 /* no uref */ ); + err = usb2_ref_device(cpd, &refs, 0 /* no uref */ ); if (err) { return (ENXIO); } fflags = cpd->fflags; - f = cpd->txfifo; + f = refs.txfifo; if (f == NULL) { /* should not happen */ - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (EPERM); } resid = uio->uio_resid; @@ -1323,7 +1314,7 @@ usb2_write(struct cdev *dev, struct uio goto done; } /* check if USB-FS interface is active */ - if (cpd->is_usbfs) { + if (refs.is_usbfs) { /* * The queue is used for events that should be * retrieved using the "USB_FS_COMPLETE" ioctl. @@ -1391,7 +1382,7 @@ usb2_write(struct cdev *dev, struct uio done: mtx_unlock(f->priv_mtx); - usb2_unref_device(cpd); + usb2_unref_device(cpd, &refs); return (err); } Modified: head/sys/dev/usb/usb_dev.h ============================================================================== --- head/sys/dev/usb/usb_dev.h Tue Jun 2 18:55:27 2009 (r193337) +++ head/sys/dev/usb/usb_dev.h Tue Jun 2 19:28:26 2009 (r193338) @@ -88,13 +88,19 @@ struct usb_cdev_privdata { struct usb_bus *bus; struct usb_device *udev; struct usb_interface *iface; - struct usb_fifo *rxfifo; - struct usb_fifo *txfifo; int bus_index; /* bus index */ int dev_index; /* device index */ int ep_addr; /* endpoint address */ int fflags; uint8_t fifo_index; /* FIFO index */ +}; + +/* + * Private per-device and per-thread reference information + */ +struct usb_cdev_refdata { + struct usb_fifo *rxfifo; + struct usb_fifo *txfifo; uint8_t is_read; /* location has read access */ uint8_t is_write; /* location has write access */ uint8_t is_uref; /* USB refcount decr. needed */ From jhb at freebsd.org Tue Jun 2 19:45:46 2009 From: jhb at freebsd.org (John Baldwin) Date: Tue Jun 2 19:46:04 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <4A257BEF.2010205@FreeBSD.org> References: <200906010537.n515bDou065357@svn.freebsd.org> <200906021511.03955.jhb@freebsd.org> <4A257BEF.2010205@FreeBSD.org> Message-ID: <200906021545.22204.jhb@freebsd.org> On Tuesday 02 June 2009 3:22:23 pm Doug Barton wrote: > John Baldwin wrote: > > I think more specifically, if you don't set 'ifconfig_' to "DHCP", then > > when you plug a device in, nothing happens. > > That's actually not correct, as devd will try to dhcp an interface as > soon as it comes up. That is completely wrong. Checking the actual code would probably be helpful here. From /etc/devd.conf: # # Try to start dhclient on Ethernet like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automaticly exits # when the link goes down. # notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "ethernet"; action "/etc/rc.d/dhclient start $subsystem"; }; Note the comment. From /etc/rc.d/dhclient: ifn="$2" load_rc_config $name load_rc_config network if ! dhcpif $ifn; then return 1 fi run_rc_command "$1" From /etc/network.subr: # dhcpif if # Returns 0 if the interface is a DHCP interface and 1 otherwise. dhcpif() { _tmpargs=`_ifconfig_getargs $1` for _arg in $_tmpargs; do case $_arg in [Dd][Hh][Cc][Pp]) return 0 ;; [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) return 0 ;; [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) return 0 ;; esac done return 1 } Clearly if you do not have 'DHCP' set in your ifconfig_ variable, dhcpif will be false, and /etc/rc.d/dhclient will be a nop. > > DHCP is opt-in, not > > opt-out. The only reason one would want to limit network_interfaces is if > > you wanted to have an ifconfig_foo0 line in /etc/rc.conf but not have foo0 > > configured automatically. > > I've already said several times that I want to run through my own list > of interfaces, configure the first one that comes up, and then stop. > There is no support for that currently. Others have also chimed in > with things that they do with the existing feature as well. This is an interesting problem, though I think network_interfaces is a rather odd way of going about it. Do you boot to single user and edit rc.conf all the time? I don't see how else you are using network_interfaces to implement this. I think a better solution to that problem would be to assign interfaces priority (if_priority_="N" perhaps). Also, note that the /etc/rc.d/defaultroute script does only hold up the boot until at least one interface gets a default route. For the common wireless vs. wired case that works well, and even OS X will configure both wired and wireless interfaces if both work, it simply uses the priority to determine whose default route "wins". -- John Baldwin From sam at FreeBSD.org Tue Jun 2 20:00:45 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 20:00:57 2009 Subject: svn commit: r193340 - head/sys/net80211 Message-ID: <200906022000.n52K0i4E026585@svn.freebsd.org> Author: sam Date: Tue Jun 2 20:00:43 2009 New Revision: 193340 URL: http://svn.freebsd.org/changeset/base/193340 Log: partially fix mode setting; this no longer returns an error but still needs to handle the case where the vap is up+running Noticed by: "Paul B. Mahol" Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Jun 2 20:00:32 2009 (r193339) +++ head/sys/net80211/ieee80211.c Tue Jun 2 20:00:43 2009 (r193340) @@ -1186,7 +1186,7 @@ ieee80211_media_change(struct ifnet *ifp return EINVAL; if (vap->iv_des_mode != newmode) { vap->iv_des_mode = newmode; - return ENETRESET; + /* XXX kick state machine if up+running */ } return 0; } From sam at FreeBSD.org Tue Jun 2 20:32:14 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 20:32:21 2009 Subject: svn commit: r193342 - head/sys/dev/if_ndis Message-ID: <200906022032.n52KWDk0027353@svn.freebsd.org> Author: sam Date: Tue Jun 2 20:32:13 2009 New Revision: 193342 URL: http://svn.freebsd.org/changeset/base/193342 Log: fix setting of ni_txrate Submitted by: "Paul B. Mahol" 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 Tue Jun 2 20:02:58 2009 (r193341) +++ head/sys/dev/if_ndis/if_ndis.c Tue Jun 2 20:32:13 2009 (r193342) @@ -2727,31 +2727,7 @@ ndis_getstate_80211(sc) if (rval) device_printf (sc->ndis_dev, "get link speed failed: %d\n", rval); - - if (isset(ic->ic_modecaps, IEEE80211_MODE_11B)) { - ni->ni_rates = ic->ic_sup_rates[IEEE80211_MODE_11B]; - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - if ((ni->ni_rates.rs_rates[i] & - IEEE80211_RATE_VAL) == arg / 5000) - break; - } - } - - if (i == ni->ni_rates.rs_nrates && - isset(ic->ic_modecaps, IEEE80211_MODE_11G)) { - ni->ni_rates = ic->ic_sup_rates[IEEE80211_MODE_11G]; - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - if ((ni->ni_rates.rs_rates[i] & - IEEE80211_RATE_VAL) == arg / 5000) - break; - } - } - - if (i == ni->ni_rates.rs_nrates) - device_printf(sc->ndis_dev, "no matching rate for: %d\n", - arg / 5000); - else - ni->ni_txrate = i; + ni->ni_txrate = arg / 5000; if (ic->ic_caps & IEEE80211_C_PMGT) { len = sizeof(arg); From sam at FreeBSD.org Tue Jun 2 20:48:13 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 20:48:24 2009 Subject: svn commit: r193347 - head/sys/net80211 Message-ID: <200906022048.n52KmCbC027923@svn.freebsd.org> Author: sam Date: Tue Jun 2 20:48:12 2009 New Revision: 193347 URL: http://svn.freebsd.org/changeset/base/193347 Log: fix typo Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 20:47:10 2009 (r193346) +++ head/sys/net80211/ieee80211_ioctl.c Tue Jun 2 20:48:12 2009 (r193347) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #define IS_UP_AUTO(_vap) \ - (IFNET_IS_UP_RUNNING(vap->iv_ifp) && \ + (IFNET_IS_UP_RUNNING((_vap)->iv_ifp) && \ (_vap)->iv_roaming == IEEE80211_ROAMING_AUTO) static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; From sam at FreeBSD.org Tue Jun 2 20:52:00 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 20:52:14 2009 Subject: svn commit: r193348 - head/sys/net80211 Message-ID: <200906022051.n52Kpxcd028051@svn.freebsd.org> Author: sam Date: Tue Jun 2 20:51:59 2009 New Revision: 193348 URL: http://svn.freebsd.org/changeset/base/193348 Log: remove another vestige of the null if_softc on detach hack Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue Jun 2 20:48:12 2009 (r193347) +++ head/sys/net80211/ieee80211_proto.c Tue Jun 2 20:51:59 2009 (r193348) @@ -1220,22 +1220,12 @@ ieee80211_init(void *arg) { struct ieee80211vap *vap = arg; - /* - * This routine is publicly accessible through the vap's - * if_init method so guard against calls during detach. - * ieee80211_vap_detach null's the backpointer before - * tearing down state to signal any callback should be - * rejected/ignored. - */ - if (vap != NULL) { - IEEE80211_DPRINTF(vap, - IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, - "%s\n", __func__); - - IEEE80211_LOCK(vap->iv_ic); - ieee80211_start_locked(vap); - IEEE80211_UNLOCK(vap->iv_ic); - } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, + "%s\n", __func__); + + IEEE80211_LOCK(vap->iv_ic); + ieee80211_start_locked(vap); + IEEE80211_UNLOCK(vap->iv_ic); } /* From sam at FreeBSD.org Tue Jun 2 21:11:27 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 21:11:38 2009 Subject: svn commit: r193349 - head/sys/dev/ath Message-ID: <200906022111.n52LBQF7028503@svn.freebsd.org> Author: sam Date: Tue Jun 2 21:11:26 2009 New Revision: 193349 URL: http://svn.freebsd.org/changeset/base/193349 Log: restart tdma beacons after vap destroy Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 20:51:59 2009 (r193348) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:11:26 2009 (r193349) @@ -1153,8 +1153,14 @@ ath_vap_delete(struct ieee80211vap *vap) if (ath_startrecv(sc) != 0) if_printf(ifp, "%s: unable to restart recv logic\n", __func__); - if (sc->sc_beacons) - ath_beacon_config(sc, NULL); + if (sc->sc_beacons) { /* restart beacons */ +#ifdef IEEE80211_SUPPORT_TDMA + if (sc->sc_tdma) + ath_tdma_config(sc, NULL); + else +#endif + ath_beacon_config(sc, NULL); + } ath_hal_intrset(ah, sc->sc_imask); } } @@ -1652,13 +1658,13 @@ ath_reset(struct ifnet *ifp) * might change as a result. */ ath_chan_change(sc, ic->ic_curchan); - if (sc->sc_beacons) { + if (sc->sc_beacons) { /* restart beacons */ #ifdef IEEE80211_SUPPORT_TDMA if (sc->sc_tdma) ath_tdma_config(sc, NULL); else #endif - ath_beacon_config(sc, NULL); /* restart beacons */ + ath_beacon_config(sc, NULL); } ath_hal_intrset(ah, sc->sc_imask); From sam at FreeBSD.org Tue Jun 2 21:12:09 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 21:12:28 2009 Subject: svn commit: r193350 - head/sys/dev/ath Message-ID: <200906022112.n52LC7HN028553@svn.freebsd.org> Author: sam Date: Tue Jun 2 21:12:07 2009 New Revision: 193350 URL: http://svn.freebsd.org/changeset/base/193350 Log: fix comment Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 21:11:26 2009 (r193349) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:12:07 2009 (r193350) @@ -4132,7 +4132,7 @@ ath_txq_update(struct ath_softc *sc, int /* * AIFS is zero so there's no pre-transmit wait. The * burst time defines the slot duration and is configured - * via sysctl. The QCU is setup to not do post-xmit + * through net80211. The QCU is setup to not do post-xmit * back off, lockout all lower-priority QCU's, and fire * off the DMA beacon alert timer which is setup based * on the slot configuration. From sam at FreeBSD.org Tue Jun 2 21:13:58 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 21:14:05 2009 Subject: svn commit: r193351 - head/sys/dev/ath Message-ID: <200906022113.n52LDv1L028627@svn.freebsd.org> Author: sam Date: Tue Jun 2 21:13:57 2009 New Revision: 193351 URL: http://svn.freebsd.org/changeset/base/193351 Log: count frag tx failures as an ifnet error Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 21:12:07 2009 (r193350) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:13:57 2009 (r193351) @@ -1820,6 +1820,7 @@ ath_start(struct ifnet *ifp) DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); sc->sc_stats.ast_tx_nofrag++; + ifp->if_oerrors++; ath_freetx(m); goto bad; } From sam at FreeBSD.org Tue Jun 2 21:17:57 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Tue Jun 2 21:18:09 2009 Subject: svn commit: r193352 - head/sys/dev/ath Message-ID: <200906022117.n52LHuq1028741@svn.freebsd.org> Author: sam Date: Tue Jun 2 21:17:56 2009 New Revision: 193352 URL: http://svn.freebsd.org/changeset/base/193352 Log: improve raw xmit failure handling Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 2 21:13:57 2009 (r193351) +++ head/sys/dev/ath/if_ath.c Tue Jun 2 21:17:56 2009 (r193352) @@ -1710,7 +1710,6 @@ _ath_getbuf_locked(struct ath_softc *sc) DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %s\n", __func__, STAILQ_FIRST(&sc->sc_txbuf) == NULL ? "out of xmit buffers" : "xmit buffer busy"); - sc->sc_stats.ast_tx_nobuf++; } return bf; } @@ -6832,55 +6831,60 @@ ath_raw_xmit(struct ieee80211_node *ni, struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; struct ath_buf *bf; + int error; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: discard frame, %s", __func__, (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ? "!running" : "invalid"); - sc->sc_stats.ast_tx_raw_fail++; - ieee80211_free_node(ni); m_freem(m); - return ENETDOWN; + error = ENETDOWN; + goto bad; } /* * Grab a TX buffer and associated resources. */ bf = ath_getbuf(sc); if (bf == NULL) { - /* NB: ath_getbuf handles stat+msg */ - ieee80211_free_node(ni); + sc->sc_stats.ast_tx_nobuf++; m_freem(m); - return ENOBUFS; + error = ENOBUFS; + goto bad; } - ifp->if_opackets++; - sc->sc_stats.ast_tx_raw++; - if (params == NULL) { /* * Legacy path; interpret frame contents to decide * precisely how to send the frame. */ - if (ath_tx_start(sc, ni, bf, m)) - goto bad; + if (ath_tx_start(sc, ni, bf, m)) { + error = EIO; /* XXX */ + goto bad2; + } } else { /* * Caller supplied explicit parameters to use in * sending the frame. */ - if (ath_tx_raw_start(sc, ni, bf, m, params)) - goto bad; + if (ath_tx_raw_start(sc, ni, bf, m, params)) { + error = EIO; /* XXX */ + goto bad2; + } } sc->sc_wd_timer = 5; + ifp->if_opackets++; + sc->sc_stats.ast_tx_raw++; return 0; -bad: - ifp->if_oerrors++; +bad2: ATH_TXBUF_LOCK(sc); STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); +bad: + ifp->if_oerrors++; + sc->sc_stats.ast_tx_raw_fail++; ieee80211_free_node(ni); - return EIO; /* XXX */ + return error; } /* From rmacklem at FreeBSD.org Tue Jun 2 22:15:49 2009 From: rmacklem at FreeBSD.org (Rick Macklem) Date: Tue Jun 2 22:15:56 2009 Subject: svn commit: r193354 - in head/etc: defaults rc.d Message-ID: <200906022215.n52MFl5l029910@svn.freebsd.org> Author: rmacklem Date: Tue Jun 2 22:15:47 2009 New Revision: 193354 URL: http://svn.freebsd.org/changeset/base/193354 Log: Add support for the experimental nfs subsystem to the scripts in /etc/rc.d. They use the following new rc variables: nfsv4_server_enable - set to "YES" to run the experimental server nfsuserd_enable - set to "YES" to run nfsuserd for NFSv4 client and server nfsuserd_flags - command line flags for nfsuserd nfscbd_enable - set to "YES" to run the experimental nfs client's NFSv4 callback daemon nfscbd_flags - command line flags for nfscbd Reviewed by: dougb Approved by: kib (mentor) Added: head/etc/rc.d/nfscbd (contents, props changed) head/etc/rc.d/nfsuserd (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/mountd head/etc/rc.d/nfsd Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/defaults/rc.conf Tue Jun 2 22:15:47 2009 (r193354) @@ -315,6 +315,11 @@ rpcbind_flags="" # Flags to rpcbind (if rpc_ypupdated_enable="NO" # Run if NIS master and SecureRPC (or NO). keyserv_enable="NO" # Run the SecureRPC keyserver (or NO). keyserv_flags="" # Flags to keyserv (if enabled). +nfsv4_server_enable="NO" # Enable support for NFSv4 +nfscbd_enable="NO" # NFSv4 client side callback daemon +nfscbd_flags="" # Flags for nfscbd +nfsuserd_enable="NO" # NFSv4 user/group name mapping daemon +nfsuserd_flags="" # Flags for nfsuserd ### Network Time Services options: ### timed_enable="NO" # Run the time daemon (or NO). Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/rc.d/Makefile Tue Jun 2 22:15:47 2009 (r193354) @@ -23,8 +23,8 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ named natd netif netoptions \ - network_ipv6 newsyslog nfsclient nfsd \ - nfsserver nisdomain nsswitch ntpd ntpdate \ + network_ipv6 newsyslog nfsclient nfscbd nfsd \ + nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \ othermta \ pf pflog pfsync \ powerd power_profile ppp pppoed pwcheck \ Modified: head/etc/rc.d/mountd ============================================================================== --- head/etc/rc.d/mountd Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/rc.d/mountd Tue Jun 2 22:15:47 2009 (r193354) @@ -37,6 +37,13 @@ mountd_precmd() fi fi + # If nfsv4_server_enable is yes, force use of the experimental + # server + # + if checkyesno nfsv4_server_enable; then + rc_flags="-e ${rc_flags}" + fi + if checkyesno zfs_enable; then rc_flags="${rc_flags} /etc/exports /etc/zfs/exports" fi Added: head/etc/rc.d/nfscbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/nfscbd Tue Jun 2 22:15:47 2009 (r193354) @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: nfscbd +# REQUIRE: NETWORKING nfsuserd +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="nfscbd" +rcvar=`set_rcvar` +command="/usr/sbin/${name}" +sig_stop="USR1" + +load_rc_config $name + +run_rc_command "$1" Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Tue Jun 2 21:40:57 2009 (r193353) +++ head/etc/rc.d/nfsd Tue Jun 2 22:15:47 2009 (r193354) @@ -4,7 +4,7 @@ # # PROVIDE: nfsd -# REQUIRE: mountd hostname gssd +# REQUIRE: mountd hostname gssd nfsuserd # KEYWORD: nojail shutdown . /etc/rc.subr @@ -14,14 +14,33 @@ rcvar=`set_rcvar nfs_server` command="/usr/sbin/${name}" load_rc_config $name -command_args="${nfs_server_flags}" start_precmd="nfsd_precmd" sig_stop="USR1" nfsd_precmd() { - if ! sysctl vfs.nfsrv >/dev/null 2>&1; then - force_depend nfsserver || return 1 + if checkyesno nfsv4_server_enable; then + # If nfsv4_server_enable is yes, force use + # of the experimental server + # + rc_flags="-e ${nfs_server_flags}" + + if ! checkyesno nfsuserd_enable && \ + ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 + then + force_depend nfsuserd || return 1 + fi + else + rc_flags="${nfs_server_flags}" + + if ! sysctl vfs.nfsrv >/dev/null 2>&1; then + force_depend nfsserver || return 1 + fi + + if checkyesno nfs_reserved_port_only; then + echo 'NFS on reserved port only=YES' + sysctl vfs.nfsrv.nfs_privport=1 > /dev/null + fi fi if ! checkyesno rpcbind_enable && \ @@ -35,11 +54,6 @@ nfsd_precmd() then force_depend mountd || return 1 fi - - if checkyesno nfs_reserved_port_only; then - echo 'NFS on reserved port only=YES' - sysctl vfs.nfsrv.nfs_privport=1 > /dev/null - fi return 0 } Added: head/etc/rc.d/nfsuserd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/nfsuserd Tue Jun 2 22:15:47 2009 (r193354) @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: nfsuserd +# REQUIRE: NETWORKING +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="nfsuserd" +rcvar=`set_rcvar` +command="/usr/sbin/${name}" +sig_stop="USR1" + +load_rc_config $name + +run_rc_command "$1" From rwatson at FreeBSD.org Tue Jun 2 22:22:11 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Tue Jun 2 22:22:30 2009 Subject: svn commit: r193355 - head/sys/security/mac Message-ID: <200906022222.n52MM96x030079@svn.freebsd.org> Author: rwatson Date: Tue Jun 2 22:22:09 2009 New Revision: 193355 URL: http://svn.freebsd.org/changeset/base/193355 Log: Mark MAC Framework sx and rm locks as NOWITNESS to suppress warnings that might arise from WITNESS not understanding its locking protocol, which should be deadlock-free. Currently these warnings generally don't occur, but as object locking is pushed into policies for some object types, they would otherwise occur more often. Obtained from: TrustedBSD Project Modified: head/sys/security/mac/mac_framework.c Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Tue Jun 2 22:15:47 2009 (r193354) +++ head/sys/security/mac/mac_framework.c Tue Jun 2 22:22:09 2009 (r193355) @@ -290,8 +290,8 @@ mac_init(void) mac_labelzone_init(); #ifndef MAC_STATIC - rm_init(&mac_policy_rm, "mac_policy_rm"); - sx_init(&mac_policy_sx, "mac_policy_sx"); + rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS); + sx_init_flags(&mac_policy_sx, "mac_policy_sx", SX_NOWITNESS); #endif } From weongyo at FreeBSD.org Wed Jun 3 04:10:23 2009 From: weongyo at FreeBSD.org (Weongyo Jeong) Date: Wed Jun 3 04:10:29 2009 Subject: svn commit: r193366 - head/sys/net80211 Message-ID: <200906030410.n534AMBa037840@svn.freebsd.org> Author: weongyo Date: Wed Jun 3 04:10:22 2009 New Revision: 193366 URL: http://svn.freebsd.org/changeset/base/193366 Log: calls callout_drain(9) to un-schedule a scan timer to prevent a page fault in softclock. Submitted by: sam Reviewed by: jhb, sam (original version), thompsa Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Wed Jun 3 03:42:00 2009 (r193365) +++ head/sys/net80211/ieee80211_scan.c Wed Jun 3 04:10:22 2009 (r193366) @@ -131,6 +131,7 @@ ieee80211_scan_detach(struct ieee80211co scan_signal(ss); IEEE80211_UNLOCK(ic); ieee80211_draintask(ic, &SCAN_PRIVATE(ss)->ss_scan_task); + callout_drain(&SCAN_PRIVATE(ss)->ss_scan_timer); KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scan still running")); if (ss->ss_ops != NULL) { From ed at FreeBSD.org Wed Jun 3 08:16:36 2009 From: ed at FreeBSD.org (Ed Schouten) Date: Wed Jun 3 08:16:47 2009 Subject: svn commit: r193368 - head/lib/msun/src Message-ID: <200906030816.n538GZ6T043054@svn.freebsd.org> Author: ed Date: Wed Jun 3 08:16:34 2009 New Revision: 193368 URL: http://svn.freebsd.org/changeset/base/193368 Log: Use ISO C99 style inline semantics in msun. Because we use ISO C99 nowadays, we can just get rid of enforcing GNU89-style inlining. Modified: head/lib/msun/src/e_rem_pio2.c head/lib/msun/src/e_rem_pio2f.c head/lib/msun/src/k_cosf.c head/lib/msun/src/k_sinf.c head/lib/msun/src/k_tanf.c head/lib/msun/src/math_private.h Modified: head/lib/msun/src/e_rem_pio2.c ============================================================================== --- head/lib/msun/src/e_rem_pio2.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/e_rem_pio2.c Wed Jun 3 08:16:34 2009 (r193368) @@ -48,10 +48,10 @@ pio2_2t = 2.02226624879595063154e-21, / pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ -#ifdef INLINE_REM_PIO2 -extern __gnu89_inline +#ifndef INLINE_REM_PIO2 +extern #endif -int +__inline int __ieee754_rem_pio2(double x, double *y) { double z,w,t,r,fn; Modified: head/lib/msun/src/e_rem_pio2f.c ============================================================================== --- head/lib/msun/src/e_rem_pio2f.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/e_rem_pio2f.c Wed Jun 3 08:16:34 2009 (r193368) @@ -40,10 +40,10 @@ invpio2 = 6.36619772367581382433e-01, / pio2_1 = 1.57079631090164184570e+00, /* 0x3FF921FB, 0x50000000 */ pio2_1t = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */ -#ifdef INLINE_REM_PIO2F -extern __gnu89_inline +#ifndef INLINE_REM_PIO2F +extern #endif -int +__inline int __ieee754_rem_pio2f(float x, double *y) { double w,r,fn; Modified: head/lib/msun/src/k_cosf.c ============================================================================== --- head/lib/msun/src/k_cosf.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/k_cosf.c Wed Jun 3 08:16:34 2009 (r193368) @@ -30,10 +30,10 @@ C1 = 0x155553e1053a42.0p-57, /* 0.041 C2 = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */ C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ -#ifdef INLINE_KERNEL_COSDF -extern __gnu89_inline +#ifndef INLINE_KERNEL_COSDF +extern #endif -float +__inline float __kernel_cosdf(double x) { double r, w, z; Modified: head/lib/msun/src/k_sinf.c ============================================================================== --- head/lib/msun/src/k_sinf.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/k_sinf.c Wed Jun 3 08:16:34 2009 (r193368) @@ -29,10 +29,10 @@ S2 = 0x111110896efbb2.0p-59, /* 0.0083 S3 = -0x1a00f9e2cae774.0p-65, /* -0.000198393348360966317347 */ S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ -#ifdef INLINE_KERNEL_SINDF -extern __gnu89_inline +#ifndef INLINE_KERNEL_SINDF +extern #endif -float +__inline float __kernel_sindf(double x) { double r, s, w, z; Modified: head/lib/msun/src/k_tanf.c ============================================================================== --- head/lib/msun/src/k_tanf.c Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/k_tanf.c Wed Jun 3 08:16:34 2009 (r193368) @@ -32,10 +32,10 @@ T[] = { 0x1362b9bf971bcd.0p-59, /* 0.00946564784943673166728 */ }; -#ifdef INLINE_KERNEL_TANDF -extern __gnu89_inline +#ifndef INLINE_KERNEL_TANDF +extern #endif -float +__inline float __kernel_tandf(double x, int iy) { double z,r,w,s,t,u; Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Wed Jun 3 08:05:53 2009 (r193367) +++ head/lib/msun/src/math_private.h Wed Jun 3 08:16:34 2009 (r193368) @@ -345,15 +345,30 @@ irint(double x) int __kernel_rem_pio2(double*,double*,int,int,int); /* double precision kernel functions */ +#ifdef INLINE_REM_PIO2 +__inline +#endif int __ieee754_rem_pio2(double,double*); double __kernel_sin(double,double,int); double __kernel_cos(double,double); double __kernel_tan(double,double,int); /* float precision kernel functions */ +#ifdef INLINE_REM_PIO2F +__inline +#endif int __ieee754_rem_pio2f(float,double*); +#ifdef INLINE_KERNEL_SINDF +__inline +#endif float __kernel_sindf(double); +#ifdef INLINE_KERNEL_COSDF +__inline +#endif float __kernel_cosdf(double); +#ifdef INLINE_KERNEL_TANDF +__inline +#endif float __kernel_tandf(double,int); /* long double precision kernel functions */ From pjd at FreeBSD.org Wed Jun 3 08:36:27 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Wed Jun 3 08:36:38 2009 Subject: svn commit: r193332 - in head/sys: kern netatalk netinet rpc security/mac In-Reply-To: <200906021826.n52IQHrh024410@svn.freebsd.org> References: <200906021826.n52IQHrh024410@svn.freebsd.org> Message-ID: <20090603083622.GA3824@garage.freebsd.pl> On Tue, Jun 02, 2009 at 06:26:17PM +0000, Robert Watson wrote: > Author: rwatson > Date: Tue Jun 2 18:26:17 2009 > New Revision: 193332 > URL: http://svn.freebsd.org/changeset/base/193332 > > Log: > Add internal 'mac_policy_count' counter to the MAC Framework, which is a > count of the number of registered policies. > > Rather than unconditionally locking sockets before passing them into MAC, > lock them in the MAC entry points only if mac_policy_count is non-zero. > > This avoids locking overhead for a number of socket system calls when no > policies are registered, eliminating measurable overhead for the MAC > Framework for the socket subsystem when there are no active policies. > > Possibly socket locks should be acquired by policies if they are required > for socket labels, which would further avoid locking overhead when there > are policies but they don't require labeling of sockets, or possibly > don't even implement socket controls. This may introduce further overhead if there are few policies that implement socket controls. Then you will have cost of npolicies * lock/unlock. Maybe we could check if there is at least one policy implementing particular socket control and if yes lock the socket in the framework only once? This won't be ideal (there might be socket control that doesn't need to lock the socket), but is good enough for my taste:) -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090603/f69f6139/attachment.pgp From rwatson at FreeBSD.org Wed Jun 3 08:49:45 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Wed Jun 3 08:49:51 2009 Subject: svn commit: r193371 - head/sys/security/mac_biba Message-ID: <200906030849.n538ni6v043820@svn.freebsd.org> Author: rwatson Date: Wed Jun 3 08:49:44 2009 New Revision: 193371 URL: http://svn.freebsd.org/changeset/base/193371 Log: By default, label all network interfaces as biba/equal on attach. This makes it easier for first-time users to configure and work with biba as remote acess is still allowed. Effectively, this means that, by default, only local security properties, not distributed ones, are enforced. Obtained from: TrustedBSD Project Modified: head/sys/security/mac_biba/mac_biba.c Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Wed Jun 3 08:21:11 2009 (r193370) +++ head/sys/security/mac_biba/mac_biba.c Wed Jun 3 08:49:44 2009 (r193371) @@ -125,7 +125,7 @@ SYSCTL_INT(_security_mac_biba, OID_AUTO, 0, "Label pty devices as biba/equal on create"); TUNABLE_INT("security.mac.biba.ptys_equal", &ptys_equal); -static int interfaces_equal; +static int interfaces_equal = 1; SYSCTL_INT(_security_mac_biba, OID_AUTO, interfaces_equal, CTLFLAG_RW, &interfaces_equal, 0, "Label network interfaces as biba/equal on create"); TUNABLE_INT("security.mac.biba.interfaces_equal", &interfaces_equal); From pjd at FreeBSD.org Wed Jun 3 09:23:32 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Wed Jun 3 09:23:44 2009 Subject: svn commit: r193372 - head/sbin/fsck_ffs Message-ID: <200906030923.n539NVnW044573@svn.freebsd.org> Author: pjd Date: Wed Jun 3 09:23:31 2009 New Revision: 193372 URL: http://svn.freebsd.org/changeset/base/193372 Log: Correct comment. Modified: head/sbin/fsck_ffs/gjournal.c Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Wed Jun 3 08:49:44 2009 (r193371) +++ head/sbin/fsck_ffs/gjournal.c Wed Jun 3 09:23:31 2009 (r193372) @@ -672,7 +672,7 @@ gjournal_check(const char *filesys) devnam = filesys; getdisk(); - /* Are there any unreferenced inodes in this cylinder group? */ + /* Are there any unreferenced inodes in this file system? */ if (fs->fs_unrefs == 0) { //printf("No unreferenced inodes.\n"); closedisk(); From pjd at FreeBSD.org Wed Jun 3 09:24:59 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Wed Jun 3 09:25:10 2009 Subject: svn commit: r193373 - head/tools/regression/fstest Message-ID: <200906030924.n539Owgw044636@svn.freebsd.org> Author: pjd Date: Wed Jun 3 09:24:58 2009 New Revision: 193373 URL: http://svn.freebsd.org/changeset/base/193373 Log: lchflags(2) takes int, not u_long like chflags(2) and fchflags(2). Strange, isn't it? Pointed out by: bde Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c ============================================================================== --- head/tools/regression/fstest/fstest.c Wed Jun 3 09:23:31 2009 (r193372) +++ head/tools/regression/fstest/fstest.c Wed Jun 3 09:24:58 2009 (r193373) @@ -499,7 +499,7 @@ call_syscall(struct syscall_desc *scall, #endif #ifdef HAS_LCHFLAGS case ACTION_LCHFLAGS: - rval = lchflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1))); + rval = lchflags(STR(0), (int)str2flags(chflags_flags, STR(1))); break; #endif case ACTION_TRUNCATE: From pjd at FreeBSD.org Wed Jun 3 09:29:00 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Wed Jun 3 09:29:16 2009 Subject: svn commit: r193374 - in head/share/examples/kld: dyn_sysctl syscall/module Message-ID: <200906030928.n539Sw6J044748@svn.freebsd.org> Author: pjd Date: Wed Jun 3 09:28:58 2009 New Revision: 193374 URL: http://svn.freebsd.org/changeset/base/193374 Log: Where if not in examples we should follow style(9)? Modified: head/share/examples/kld/dyn_sysctl/dyn_sysctl.c head/share/examples/kld/syscall/module/syscall.c Modified: head/share/examples/kld/dyn_sysctl/dyn_sysctl.c ============================================================================== --- head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Wed Jun 3 09:24:58 2009 (r193373) +++ head/share/examples/kld/dyn_sysctl/dyn_sysctl.c Wed Jun 3 09:28:58 2009 (r193374) @@ -42,7 +42,7 @@ static struct sysctl_oid *a_root, *a_roo static struct sysctl_ctx_list clist, clist1, clist2; static int -sysctl_dyn_sysctl_test (SYSCTL_HANDLER_ARGS) +sysctl_dyn_sysctl_test(SYSCTL_HANDLER_ARGS) { char *buf = "let's produce some text..."; @@ -53,7 +53,7 @@ sysctl_dyn_sysctl_test (SYSCTL_HANDLER_A * The function called at load/unload. */ static int -load (module_t mod, int cmd, void *arg) +load(module_t mod, int cmd, void *arg) { int error; @@ -78,37 +78,37 @@ load (module_t mod, int cmd, void *arg) SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */), OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); - if(a_root == NULL) { + if (a_root == NULL) { printf("SYSCTL_ADD_NODE failed!\n"); return (EINVAL); } SYSCTL_ADD_LONG(&clist, SYSCTL_CHILDREN(a_root), - OID_AUTO, "long_a", CTLFLAG_RW, &a, "just to try"); + OID_AUTO, "long_a", CTLFLAG_RW, &a, "just to try"); SYSCTL_ADD_INT(&clist, SYSCTL_CHILDREN(a_root), - OID_AUTO, "int_b", CTLFLAG_RW, &b, 0, "just to try 1"); - a_root1=SYSCTL_ADD_NODE(&clist, SYSCTL_CHILDREN(a_root), - OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); + OID_AUTO, "int_b", CTLFLAG_RW, &b, 0, "just to try 1"); + a_root1 = SYSCTL_ADD_NODE(&clist, SYSCTL_CHILDREN(a_root), + OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); SYSCTL_ADD_STRING(&clist, SYSCTL_CHILDREN(a_root1), - OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "just to try 2"); + OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "just to try 2"); printf("1. (%p) / dyn_sysctl\n", &clist); /* Add a subtree under already existing category */ a_root1 = SYSCTL_ADD_NODE(&clist, SYSCTL_STATIC_CHILDREN(_kern), - OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); - if(a_root1 == NULL) { + OID_AUTO, "dyn_sysctl", CTLFLAG_RW, 0, "dyn_sysctl root node"); + if (a_root1 == NULL) { printf("SYSCTL_ADD_NODE failed!\n"); return (EINVAL); } SYSCTL_ADD_PROC(&clist, SYSCTL_CHILDREN(a_root1), - OID_AUTO, "procedure", CTLFLAG_RD, 0, 0, - sysctl_dyn_sysctl_test, "A", "I can be here, too"); + OID_AUTO, "procedure", CTLFLAG_RD, 0, 0, + sysctl_dyn_sysctl_test, "A", "I can be here, too"); printf(" (%p) /kern dyn_sysctl\n", &clist); /* Overlap second tree with the first. */ b_root = SYSCTL_ADD_NODE(&clist1, SYSCTL_CHILDREN(a_root), - OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); + OID_AUTO, "nextlevel", CTLFLAG_RD, 0, "one level down"); SYSCTL_ADD_STRING(&clist1, SYSCTL_CHILDREN(b_root), - OID_AUTO, "string_c1", CTLFLAG_RD, c, 0, "just to try 2"); + OID_AUTO, "string_c1", CTLFLAG_RD, c, 0, "just to try 2"); printf("2. (%p) / dyn_sysctl (overlapping #1)\n", &clist1); /* @@ -117,19 +117,19 @@ load (module_t mod, int cmd, void *arg) * WARNING: this is an example of WRONG use of dynamic sysctls. */ b_root=SYSCTL_ADD_NODE(&clist2, SYSCTL_CHILDREN(a_root1), - OID_AUTO, "bad", CTLFLAG_RW, 0, "dependent node"); + OID_AUTO, "bad", CTLFLAG_RW, 0, "dependent node"); SYSCTL_ADD_STRING(&clist2, SYSCTL_CHILDREN(b_root), - OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "shouldn't panic"); + OID_AUTO, "string_c", CTLFLAG_RD, c, 0, "shouldn't panic"); printf("3. (%p) /kern/dyn_sysctl bad (WRONG!)\n", &clist2); break; case MOD_UNLOAD : printf("1. Try to free ctx1 (%p): ", &clist); - if(sysctl_ctx_free(&clist)) + if (sysctl_ctx_free(&clist) != 0) printf("failed: expected. Need to remove ctx3 first.\n"); else printf("HELP! sysctl_ctx_free(%p) succeeded. EXPECT PANIC!!!\n", &clist); printf("2. Try to free ctx3 (%p): ", &clist2); - if(sysctl_ctx_free(&clist2)) { + if (sysctl_ctx_free(&clist2) != 0) { printf("sysctl_ctx_free(%p) failed!\n", &clist2); /* Remove subtree forcefully... */ sysctl_remove_oid(b_root, 1, 1); @@ -137,7 +137,7 @@ load (module_t mod, int cmd, void *arg) } else printf("Ok\n"); printf("3. Try to free ctx1 (%p) again: ", &clist); - if(sysctl_ctx_free(&clist)) { + if (sysctl_ctx_free(&clist) != 0) { printf("sysctl_ctx_free(%p) failed!\n", &clist); /* Remove subtree forcefully... */ sysctl_remove_oid(a_root1, 1, 1); @@ -145,7 +145,7 @@ load (module_t mod, int cmd, void *arg) } else printf("Ok\n"); printf("4. Try to free ctx2 (%p): ", &clist1); - if(sysctl_ctx_free(&clist1)) { + if (sysctl_ctx_free(&clist1) != 0) { printf("sysctl_ctx_free(%p) failed!\n", &clist1); /* Remove subtree forcefully... */ sysctl_remove_oid(a_root, 1, 1); @@ -156,10 +156,10 @@ load (module_t mod, int cmd, void *arg) error = EOPNOTSUPP; break; } - return error; + return (error); } -static moduledata_t mod_data= { +static moduledata_t mod_data = { "dyn_sysctl", load, 0 Modified: head/share/examples/kld/syscall/module/syscall.c ============================================================================== --- head/share/examples/kld/syscall/module/syscall.c Wed Jun 3 09:24:58 2009 (r193373) +++ head/share/examples/kld/syscall/module/syscall.c Wed Jun 3 09:28:58 2009 (r193374) @@ -26,7 +26,6 @@ * $FreeBSD$ */ -#include #include #include #include @@ -38,18 +37,17 @@ /* * The function for implementing the syscall. */ - static int -hello (struct thread *td, void *arg) +hello(struct thread *td, void *arg) { - printf ("hello kernel\n"); - return 0; + + printf("hello kernel\n"); + return (0); } /* * The `sysent' for the new syscall */ - static struct sysent hello_sysent = { 0, /* sy_narg */ hello /* sy_call */ @@ -58,30 +56,28 @@ static struct sysent hello_sysent = { /* * The offset in sysent where the syscall is allocated. */ - static int offset = NO_SYSCALL; /* * The function called at load/unload. */ - static int -load (struct module *module, int cmd, void *arg) +load(struct module *module, int cmd, void *arg) { int error = 0; switch (cmd) { case MOD_LOAD : - printf ("syscall loaded at %d\n", offset); + printf("syscall loaded at %d\n", offset); break; case MOD_UNLOAD : - printf ("syscall unloaded from %d\n", offset); + printf("syscall unloaded from %d\n", offset); break; default : error = EOPNOTSUPP; break; } - return error; + return (error); } SYSCALL_MODULE(syscall, &offset, &hello_sysent, load, NULL); From des at des.no Wed Jun 3 09:31:12 2009 From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Wed Jun 3 09:31:19 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <200906021511.03955.jhb@freebsd.org> (John Baldwin's message of "Tue, 2 Jun 2009 15:11:03 -0400") References: <200906010537.n515bDou065357@svn.freebsd.org> <4A25491B.4030406@incunabulum.net> <20090602165021.GB15552@lor.one-eyed-alien.net> <200906021511.03955.jhb@freebsd.org> Message-ID: <86iqjdek9t.fsf@ds4.des.no> John Baldwin writes: > [...] Given that, there really isn't a good reason to customize > network_interfaces anymore. Listing e.g. bge0 in network_interfaces will (indirectly) cause if_bge to be loaded if it wasn't already. If network_interfaces is left blank, only interfaces that already have a driver attached to them will be configured. That being said, setting network_interfaces manually introduces the risk of setting it incorrectly (e.g. forgetting lo0). DES -- Dag-Erling Sm?rgrav - des@des.no From snb at FreeBSD.org Wed Jun 3 09:44:23 2009 From: snb at FreeBSD.org (Sean Nicholas Barkas) Date: Wed Jun 3 09:44:29 2009 Subject: svn commit: r193375 - head/sys/ufs/ufs Message-ID: <200906030944.n539iM2K045164@svn.freebsd.org> Author: snb Date: Wed Jun 3 09:44:22 2009 New Revision: 193375 URL: http://svn.freebsd.org/changeset/base/193375 Log: Add vm_lowmem event handler for dirhash. This will cause dirhashes to be deleted when the system is low on memory. This ought to allow an increase to vfs.ufs.dirhash_maxmem on machines that have lots of memory, without degrading performance by having too much memory reserved for dirhash when other things need it. The default value for dirhash_maxmem is being kept at 2MB for now, though. This work was mostly done during the 2008 Google Summer of Code. Approved by: dwmalone (mentor), re MFC after: 3 months Modified: head/sys/ufs/ufs/dirhash.h head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/dirhash.h ============================================================================== --- head/sys/ufs/ufs/dirhash.h Wed Jun 3 09:28:58 2009 (r193374) +++ head/sys/ufs/ufs/dirhash.h Wed Jun 3 09:44:22 2009 (r193375) @@ -105,6 +105,8 @@ struct dirhash { int dh_onlist; /* true if on the ufsdirhash_list chain */ + time_t dh_lastused; /* time the dirhash was last read or written*/ + /* Protected by ufsdirhash_mtx. */ TAILQ_ENTRY(dirhash) dh_list; /* chain of all dirhashes */ }; Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Wed Jun 3 09:28:58 2009 (r193374) +++ head/sys/ufs/ufs/ufs_dirhash.c Wed Jun 3 09:44:22 2009 (r193375) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -81,6 +83,13 @@ SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_m static int ufs_dirhashcheck = 0; SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_docheck, CTLFLAG_RW, &ufs_dirhashcheck, 0, "enable extra sanity tests"); +static int ufs_dirhashlowmemcount = 0; +SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_lowmemcount, CTLFLAG_RD, + &ufs_dirhashlowmemcount, 0, "number of times low memory hook called"); +static int ufs_dirhashreclaimage = 5; +SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_reclaimage, CTLFLAG_RW, + &ufs_dirhashreclaimage, 0, + "max time in seconds of hash inactivity before deletion in low VM events"); static int ufsdirhash_hash(struct dirhash *dh, char *name, int namelen); @@ -90,6 +99,7 @@ static int ufsdirhash_findslot(struct di doff_t offset); static doff_t ufsdirhash_getprev(struct direct *dp, doff_t offset); static int ufsdirhash_recycle(int wanted); +static void ufsdirhash_lowmem(void); static void ufsdirhash_free_locked(struct inode *ip); static uma_zone_t ufsdirhash_zone; @@ -393,6 +403,7 @@ ufsdirhash_build(struct inode *ip) dh->dh_seqopt = 0; dh->dh_seqoff = 0; dh->dh_score = DH_SCOREINIT; + dh->dh_lastused = time_second; /* * Use non-blocking mallocs so that we will revert to a linear @@ -569,6 +580,9 @@ ufsdirhash_lookup(struct inode *ip, char /* Update the score. */ if (dh->dh_score < DH_SCOREMAX) dh->dh_score++; + + /* Update last used time. */ + dh->dh_lastused = time_second; DIRHASHLIST_UNLOCK(); vp = ip->i_vnode; @@ -811,6 +825,9 @@ ufsdirhash_add(struct inode *ip, struct dh->dh_hused++; DH_ENTRY(dh, slot) = offset; + /* Update last used time. */ + dh->dh_lastused = time_second; + /* Update the per-block summary info. */ ufsdirhash_adjfree(dh, offset, -DIRSIZ(0, dirp)); ufsdirhash_release(dh); @@ -1150,6 +1167,46 @@ ufsdirhash_getprev(struct direct *dirp, } /* + * Delete the given dirhash and reclaim its memory. Assumes that + * ufsdirhash_list is locked, and leaves it locked. Also assumes + * that dh is locked. Returns the amount of memory freed. + */ +static int +ufsdirhash_destroy(struct dirhash *dh) +{ + doff_t **hash; + u_int8_t *blkfree; + int i, mem, narrays; + + KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list")); + + /* Remove it from the list and detach its memory. */ + TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); + dh->dh_onlist = 0; + hash = dh->dh_hash; + dh->dh_hash = NULL; + blkfree = dh->dh_blkfree; + dh->dh_blkfree = NULL; + narrays = dh->dh_narrays; + mem = dh->dh_memreq; + dh->dh_memreq = 0; + + /* Unlock everything, free the detached memory. */ + ufsdirhash_release(dh); + DIRHASHLIST_UNLOCK(); + for (i = 0; i < narrays; i++) + DIRHASH_BLKFREE(hash[i]); + free(hash, M_DIRHASH); + free(blkfree, M_DIRHASH); + + /* Account for the returned memory. */ + DIRHASHLIST_LOCK(); + ufs_dirhashmem -= mem; + + return (mem); +} + +/* * Try to free up `wanted' bytes by stealing memory from existing * dirhashes. Returns zero with list locked if successful. */ @@ -1157,9 +1214,6 @@ static int ufsdirhash_recycle(int wanted) { struct dirhash *dh; - doff_t **hash; - u_int8_t *blkfree; - int i, mem, narrays; DIRHASHLIST_LOCK(); dh = TAILQ_FIRST(&ufsdirhash_list); @@ -1177,36 +1231,59 @@ ufsdirhash_recycle(int wanted) dh = TAILQ_NEXT(dh, dh_list); continue; } - KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list")); - /* Remove it from the list and detach its memory. */ - TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); - dh->dh_onlist = 0; - hash = dh->dh_hash; - dh->dh_hash = NULL; - blkfree = dh->dh_blkfree; - dh->dh_blkfree = NULL; - narrays = dh->dh_narrays; - mem = dh->dh_memreq; - dh->dh_memreq = 0; + ufsdirhash_destroy(dh); - /* Unlock everything, free the detached memory. */ - ufsdirhash_release(dh); - DIRHASHLIST_UNLOCK(); - for (i = 0; i < narrays; i++) - DIRHASH_BLKFREE(hash[i]); - free(hash, M_DIRHASH); - free(blkfree, M_DIRHASH); - - /* Account for the returned memory, and repeat if necessary. */ - DIRHASHLIST_LOCK(); - ufs_dirhashmem -= mem; + /* Repeat if necessary. */ dh = TAILQ_FIRST(&ufsdirhash_list); } /* Success; return with list locked. */ return (0); } +/* + * Callback that frees some dirhashes when the system is low on virtual memory. + */ +static void +ufsdirhash_lowmem() +{ + struct dirhash *dh; + int memfreed = 0; + /* XXX: this 10% may need to be adjusted */ + int memwanted = ufs_dirhashmem / 10; + + ufs_dirhashlowmemcount++; + + DIRHASHLIST_LOCK(); + /* + * Delete dirhashes not used for more than ufs_dirhashreclaimage + * seconds. If we can't get a lock on the dirhash, it will be skipped. + */ + for (dh = TAILQ_FIRST(&ufsdirhash_list); dh != NULL; dh = + TAILQ_NEXT(dh, dh_list)) { + if (!sx_try_xlock(&dh->dh_lock)) + continue; + if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) + memfreed += ufsdirhash_destroy(dh); + /* Unlock if we didn't delete the dirhash */ + else + ufsdirhash_release(dh); + } + + /* + * If not enough memory was freed, keep deleting hashes from the head + * of the dirhash list. The ones closest to the head should be the + * oldest. + */ + for (dh = TAILQ_FIRST(&ufsdirhash_list); memfreed < memwanted && + dh !=NULL; dh = TAILQ_NEXT(dh, dh_list)) { + if (!sx_try_xlock(&dh->dh_lock)) + continue; + memfreed += ufsdirhash_destroy(dh); + } + DIRHASHLIST_UNLOCK(); +} + void ufsdirhash_init() @@ -1215,6 +1292,10 @@ ufsdirhash_init() NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&ufsdirhash_mtx, "dirhash list", NULL, MTX_DEF); TAILQ_INIT(&ufsdirhash_list); + + /* Register a callback function to handle low memory signals */ + EVENTHANDLER_REGISTER(vm_lowmem, ufsdirhash_lowmem, NULL, + EVENTHANDLER_PRI_FIRST); } void From rwatson at FreeBSD.org Wed Jun 3 10:46:40 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Wed Jun 3 10:46:47 2009 Subject: svn commit: r193332 - in head/sys: kern netatalk netinet rpc security/mac In-Reply-To: <20090603083622.GA3824@garage.freebsd.pl> References: <200906021826.n52IQHrh024410@svn.freebsd.org> <20090603083622.GA3824@garage.freebsd.pl> Message-ID: On Wed, 3 Jun 2009, Pawel Jakub Dawidek wrote: >> Add internal 'mac_policy_count' counter to the MAC Framework, which is a >> count of the number of registered policies. >> >> Rather than unconditionally locking sockets before passing them into MAC, >> lock them in the MAC entry points only if mac_policy_count is non-zero. >> >> This avoids locking overhead for a number of socket system calls when no >> policies are registered, eliminating measurable overhead for the MAC >> Framework for the socket subsystem when there are no active policies. >> >> Possibly socket locks should be acquired by policies if they are required >> for socket labels, which would further avoid locking overhead when there >> are policies but they don't require labeling of sockets, or possibly >> don't even implement socket controls. > > This may introduce further overhead if there are few policies that implement > socket controls. Then you will have cost of npolicies * lock/unlock. Maybe > we could check if there is at least one policy implementing particular > socket control and if yes lock the socket in the framework only once? This > won't be ideal (there might be socket control that doesn't need to lock the > socket), but is good enough for my taste:) Yes, I've been giving this some thought also. I reviewed the set of policies that implement MAC checks on sockets, and found that they basically fall into a few categories: - mac_biba, mac_lomac, mac_mls - ubiquitously labeled policies that will require proper locking of the socket to safely access label data for access control decisions. - mac_test, which uses integer labels on all objects, which doesn't require locking, but doesn't hurt for having it. - mac_portacl, mac_ifoff, mac_partition - no labeling of sockets, but they do access socket fields for enforcement, and those fields don't require locks because they are static (protocol type, credential, etc). - mac_stub - no label use because it's a no-op policy. In general, my feeling is that our users will prefer policies that don't use labels on sockets given the above list, and we should optimize for that case for the time being. Likewise, users who are running with multiple policies that label sockets will likely be using (mac_biba + mac_mls) in which case they've already accepted a significant overhead to label all sockets, packets, etc, and will be less likely to notice it. So at least for now, I'll keep moving in this direction and we can revisit it if desired. My main goal for now is to make sure that options MAC is really zero-overhead, and I have a few more changes in the pipeline for the next few days to clear up a couple of anomolies I've found in testing so far. Robert N M Watson Computer Laboratory University of Cambridge From jhb at freebsd.org Wed Jun 3 12:17:20 2009 From: jhb at freebsd.org (John Baldwin) Date: Wed Jun 3 12:17:28 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <86iqjdek9t.fsf@ds4.des.no> References: <200906010537.n515bDou065357@svn.freebsd.org> <200906021511.03955.jhb@freebsd.org> <86iqjdek9t.fsf@ds4.des.no> Message-ID: <200906030757.37937.jhb@freebsd.org> On Wednesday 03 June 2009 5:31:10 am Dag-Erling Sm?rgrav wrote: > John Baldwin writes: > > [...] Given that, there really isn't a good reason to customize > > network_interfaces anymore. > > Listing e.g. bge0 in network_interfaces will (indirectly) cause if_bge > to be loaded if it wasn't already. If network_interfaces is left blank, > only interfaces that already have a driver attached to them will be > configured. That is a good argument. Someone noted it on -stable as well as something they use. Also, I wonder if ipv6_network_interfaces should actually default to whatever the value of 'network_interfaces' is so that if someone does use a customized 'network_interfaces' line it affects IPv6 configuration as well. (Maybe have it default to an empty value and have an empty value get replaced with 'network_interfaces'?). -- John Baldwin From stas at FreeBSD.org Wed Jun 3 13:25:51 2009 From: stas at FreeBSD.org (Stanislav Sedov) Date: Wed Jun 3 13:26:08 2009 Subject: svn commit: r193377 - head/sys/gnu/fs/ext2fs Message-ID: <200906031325.n53DPo2W055626@svn.freebsd.org> Author: stas Date: Wed Jun 3 13:25:50 2009 New Revision: 193377 URL: http://svn.freebsd.org/changeset/base/193377 Log: - Sync our copies of ext2fs Linux headers to current Linux versions. Minimize differencies between our ext2fs headers and relevant Linux versions by using EXT2_SB macro to access the superblock fields. Most of the differencies in access to these fields are now hidden inside this macro. - Rename the s_db_per_group field of ext2fs_sb_info to s_gdb_count to reflect the similar change in Linux headers. New name also seem to be more appropriate for this field. - Use proper types for s_first_inode and s_inode_size in-core superblock fields. Now they reflec types used in the on-disk superblock version. - Add support for older filesystem revisions that doesn't have proper s_first_ino and s_inode_size fields in the on-disk superblock. In these cases predefined values for these fields are used. - Add simple sanity checks for s_first_inode and s_inode_size correctness. Reviewed by: bde (previous version) MFC after: 2 weeks Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h head/sys/gnu/fs/ext2fs/ext2_fs_sb.h head/sys/gnu/fs/ext2fs/ext2_lookup.c head/sys/gnu/fs/ext2fs/ext2_vfsops.c head/sys/gnu/fs/ext2fs/ext2_vnops.c Modified: head/sys/gnu/fs/ext2fs/ext2_fs.h ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_fs.h Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_fs.h Wed Jun 3 13:25:50 2009 (r193377) @@ -52,6 +52,8 @@ #define umode_t mode_t #define loff_t off_t +#define cpu_to_le32(x) htole32(x) + /* * The second extended filesystem constants/structures */ @@ -87,12 +89,10 @@ #endif /* - * Special inodes numbers + * Special inode numbers */ #define EXT2_BAD_INO 1 /* Bad blocks inode */ #define EXT2_ROOT_INO 2 /* Root inode */ -#define EXT2_ACL_IDX_INO 3 /* ACL inode */ -#define EXT2_ACL_DATA_INO 4 /* ACL inode */ #define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ #define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ @@ -104,17 +104,29 @@ */ #define EXT2_SUPER_MAGIC 0xEF53 +#ifdef __KERNEL__ +#include +static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) +{ + return sb->s_fs_info; +} +#elif defined(_KERNEL) /* - * Maximal count of links to a file + * FreeBSD passes the pointer to the in-core struct with relevant + * fields to EXT2_SB macro when accessing superblock fields. */ -#define EXT2_LINK_MAX 32000 +#define EXT2_SB(sb) (sb) +#else +/* Assume that user mode programs are passing in an ext2fs superblock, not + * a kernel struct super_block. This will allow us to call the feature-test + * macros from user land. */ +#define EXT2_SB(sb) (sb) +#endif /* - * Note: under FreeBSD, the "user" versions of the following macros are - * used (and must be used) in most cases, because ((s)->u.ext2_sb.s_es is - * not accessible. This depends on __KERNEL__ not being defined for - * kernel builds under FreeBSD. + * Maximal count of links to a file */ +#define EXT2_LINK_MAX 32000 /* * Macro-instructions used to manage several block sizes @@ -122,23 +134,22 @@ #define EXT2_MIN_BLOCK_SIZE 1024 #define EXT2_MAX_BLOCK_SIZE 4096 #define EXT2_MIN_BLOCK_LOG_SIZE 10 -#if defined(__KERNEL__) || (defined(__FreeBSD__) && defined(_KERNEL)) +#if defined(__KERNEL__) || defined(_KERNEL) # define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize) #else # define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) #endif -#define EXT2_ACLE_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_acl_entry)) #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32)) -#ifdef __KERNEL__ +#if defined(__KERNEL__) || defined(_KERNEL) # define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) #else # define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) #endif -#ifdef notyet -#ifdef __KERNEL__ -#define EXT2_ADDR_PER_BLOCK_BITS(s) ((s)->u.ext2_sb.s_addr_per_block_bits) -#define EXT2_INODE_SIZE(s) ((s)->u.ext2_sb.s_inode_size) -#define EXT2_FIRST_INO(s) ((s)->u.ext2_sb.s_first_ino) +#if defined(__KERNEL__) || defined(_KERNEL) +#define EXT2_ADDR_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_addr_per_block_bits) +#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->s_inode_size) +#define EXT2_FIRST_INO(s) (EXT2_SB(s)->s_first_ino) +#define EXT2_INODES_PER_BLOCK(s) ((s)->s_inodes_per_block) #else #define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ EXT2_GOOD_OLD_INODE_SIZE : \ @@ -147,12 +158,6 @@ EXT2_GOOD_OLD_FIRST_INO : \ (s)->s_first_ino) #endif -#else /* !notyet */ -#define EXT2_INODES_PER_BLOCK(s) ((s)->s_inodes_per_block) -/* Should be sizeof(struct ext2_inode): */ -#define EXT2_INODE_SIZE(s) ((s)->s_inode_size) -#define EXT2_FIRST_INO(s) ((s)->s_first_inode) -#endif /* notyet */ /* * Macro-instructions used to manage fragments @@ -160,15 +165,11 @@ #define EXT2_MIN_FRAG_SIZE 1024 #define EXT2_MAX_FRAG_SIZE 4096 #define EXT2_MIN_FRAG_LOG_SIZE 10 -#ifdef __KERNEL__ -# define EXT2_FRAG_SIZE(s) ((s)->u.ext2_sb.s_frag_size) -# define EXT2_FRAGS_PER_BLOCK(s) ((s)->u.ext2_sb.s_frags_per_block) +#if defined(__KERNEL__) || defined(_KERNEL) +# define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->s_frag_size) +# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->s_frags_per_block) #else -# if defined(_KERNEL) && defined(__FreeBSD__) -# define EXT2_FRAG_SIZE(s) ((s)->s_frag_size) -# else # define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) -# endif # define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) #endif @@ -212,11 +213,11 @@ struct ext2_group_desc /* * Macro-instructions used to manage group descriptors */ -#ifdef __KERNEL__ -# define EXT2_BLOCKS_PER_GROUP(s) ((s)->u.ext2_sb.s_blocks_per_group) -# define EXT2_DESC_PER_BLOCK(s) ((s)->u.ext2_sb.s_desc_per_block) -# define EXT2_INODES_PER_GROUP(s) ((s)->u.ext2_sb.s_inodes_per_group) -# define EXT2_DESC_PER_BLOCK_BITS(s) ((s)->u.ext2_sb.s_desc_per_block_bits) +#if defined(__KERNEL__) || defined(_KERNEL) +# define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) +# define EXT2_DESC_PER_BLOCK(s) (EXT2_SB(s)->s_desc_per_block) +# define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) +# define EXT2_DESC_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_desc_per_block_bits) #else # define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group) # define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) @@ -366,7 +367,7 @@ struct ext2_inode { #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt #define set_opt(o, opt) o |= EXT2_MOUNT_##opt -#define test_opt(sb, opt) ((sb)->u.ext2_sb.s_mount_opt & \ +#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ EXT2_MOUNT_##opt) /* * Maximal mount counts between two filesystem checks @@ -444,15 +445,6 @@ struct ext2_super_block { __u32 s_reserved[204]; /* Padding to the end of the block */ }; -#ifdef __KERNEL__ -#define EXT2_SB(sb) (&((sb)->u.ext2_sb)) -#else -/* Assume that user mode programs are passing in an ext2fs superblock, not - * a kernel struct super_block. This will allow us to call the feature-test - * macros from user land. */ -#define EXT2_SB(sb) (sb) -#endif - /* * Codes for operating systems */ @@ -478,11 +470,11 @@ struct ext2_super_block { */ #define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_compat & (mask) ) + ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) #define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_ro_compat & (mask) ) + ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_incompat & (mask) ) + ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 Modified: head/sys/gnu/fs/ext2fs/ext2_fs_sb.h ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_fs_sb.h Wed Jun 3 13:25:50 2009 (r193377) @@ -60,11 +60,9 @@ struct ext2_sb_info { unsigned long s_blocks_per_group;/* Number of blocks in a group */ unsigned long s_inodes_per_group;/* Number of inodes in a group */ unsigned long s_itb_per_group; /* Number of inode table blocks per group */ - unsigned long s_db_per_group; /* Number of descriptor blocks per group */ + unsigned long s_gdb_count; /* Number of group descriptor blocks */ unsigned long s_desc_per_block; /* Number of group descriptors per block */ unsigned long s_groups_count; /* Number of groups in the fs */ - unsigned long s_first_inode; /* First inode on fs */ - unsigned int s_inode_size; /* Size for inode with extra data */ struct buffer_head * s_sbh; /* Buffer containing the super block */ struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; @@ -74,10 +72,13 @@ struct ext2_sb_info { struct buffer_head * s_inode_bitmap[EXT2_MAX_GROUP_LOADED]; unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED]; struct buffer_head * s_block_bitmap[EXT2_MAX_GROUP_LOADED]; - int s_rename_lock; unsigned long s_mount_opt; - unsigned short s_resuid; - unsigned short s_resgid; +#ifdef notyet + uid_t s_resuid; + gid_t s_resgid; +#endif + unsigned short s_inode_size; + unsigned int s_first_ino; unsigned short s_mount_state; /* stuff that FFS keeps in its super block or that linux Modified: head/sys/gnu/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_lookup.c Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_lookup.c Wed Jun 3 13:25:50 2009 (r193377) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -771,7 +772,7 @@ ext2_direnter(ip, dvp, cnp) dp = VTOI(dvp); newdir.inode = ip->i_number; newdir.name_len = cnp->cn_namelen; - if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es, + if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2_FEATURE_INCOMPAT_FILETYPE)) newdir.file_type = DTTOFT(IFTODT(ip->i_mode)); else @@ -949,7 +950,7 @@ ext2_dirrewrite(dp, ip, cnp) &bp)) != 0) return (error); ep->inode = ip->i_number; - if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es, + if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2_FEATURE_INCOMPAT_FILETYPE)) ep->file_type = DTTOFT(IFTODT(ip->i_mode)); else Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 13:25:50 2009 (r193377) @@ -78,8 +78,8 @@ #include #include -#include #include +#include static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); static int ext2_mountfs(struct vnode *, struct mount *); @@ -412,7 +412,7 @@ static int compute_sb_data(devvp, es, fs V(s_fsbtodb) fs->s_qbmask = fs->s_blocksize - 1; V(s_qbmask) - fs->s_blocksize_bits = EXT2_BLOCK_SIZE_BITS(es); + fs->s_blocksize_bits = es->s_log_block_size + 10; V(s_blocksize_bits) fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; V(s_frag_size) @@ -425,10 +425,23 @@ static int compute_sb_data(devvp, es, fs V(s_frags_per_group) fs->s_inodes_per_group = es->s_inodes_per_group; V(s_inodes_per_group) - fs->s_inode_size = es->s_inode_size; - V(s_inode_size) - fs->s_first_inode = es->s_first_ino; - V(s_first_inode); + if (es->s_rev_level == EXT2_GOOD_OLD_REV) { + fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; + fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; + } else { + fs->s_first_ino = es->s_first_ino; + fs->s_inode_size = es->s_inode_size; + + /* + * Simple sanity check for superblock inode size value. + */ + if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE || + fs->s_inode_size > fs->s_blocksize || + (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) { + printf("EXT2-fs: invalid inode size %d\n", fs->s_inode_size); + return (EIO); + } + } fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); V(s_inodes_per_block) fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; @@ -443,8 +456,8 @@ static int compute_sb_data(devvp, es, fs V(s_groups_count) db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) / EXT2_DESC_PER_BLOCK(fs); - fs->s_db_per_group = db_count; - V(s_db_per_group) + fs->s_gdb_count = db_count; + V(s_gdb_count) fs->s_group_desc = bsd_malloc(db_count * sizeof (struct buf *), M_EXT2MNT, M_WAITOK); @@ -761,7 +774,7 @@ ext2_unmount(mp, mntflags) } /* release buffers containing group descriptors */ - for(i = 0; i < fs->s_db_per_group; i++) + for(i = 0; i < fs->s_gdb_count; i++) ULCK_BUF(fs->s_group_desc[i]) bsd_free(fs->s_group_desc, M_EXT2MNT); @@ -839,7 +852,7 @@ ext2_statfs(mp, sbp) nsb = fs->s_groups_count; overhead = es->s_first_data_block + /* Superblocks and block group descriptors: */ - nsb * (1 + fs->s_db_per_group) + + nsb * (1 + fs->s_gdb_count) + /* Inode bitmap, block bitmap, and inode table: */ fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); Modified: head/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vnops.c Wed Jun 3 13:19:12 2009 (r193376) +++ head/sys/gnu/fs/ext2fs/ext2_vnops.c Wed Jun 3 13:25:50 2009 (r193377) @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -1185,7 +1186,7 @@ ext2_mkdir(ap) goto bad; /* Initialize directory with "." and ".." from static template. */ - if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es, + if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2_FEATURE_INCOMPAT_FILETYPE)) dtp = &mastertemplate; else From brooks at freebsd.org Wed Jun 3 14:09:08 2009 From: brooks at freebsd.org (Brooks Davis) Date: Wed Jun 3 14:09:14 2009 Subject: svn commit: r193199 - head/etc In-Reply-To: <200906030757.37937.jhb@freebsd.org> References: <200906010537.n515bDou065357@svn.freebsd.org> <200906021511.03955.jhb@freebsd.org> <86iqjdek9t.fsf@ds4.des.no> <200906030757.37937.jhb@freebsd.org> Message-ID: <20090603140918.GB28486@lor.one-eyed-alien.net> On Wed, Jun 03, 2009 at 07:57:37AM -0400, John Baldwin wrote: > On Wednesday 03 June 2009 5:31:10 am Dag-Erling Sm??rgrav wrote: > > John Baldwin writes: > > > [...] Given that, there really isn't a good reason to customize > > > network_interfaces anymore. > > > > Listing e.g. bge0 in network_interfaces will (indirectly) cause if_bge > > to be loaded if it wasn't already. If network_interfaces is left blank, > > only interfaces that already have a driver attached to them will be > > configured. Ugh, I thought I'd killed that off. I'm solidly in the camp of people who think the autoloading is a mistake. If you're going to hardcode a list of module you want to load, /boot/loader.conf is the place, not this indirect hack that bites people on the ass because it works for real interfaces, but not all sorts of other types due to the impossibilty of generalizing support. For extra fun, making a typo on your ifconfig command line can lead to loading a random module. > That is a good argument. Someone noted it on -stable as well as something > they use. Also, I wonder if ipv6_network_interfaces should actually default > to whatever the value of 'network_interfaces' is so that if someone does use > a customized 'network_interfaces' line it affects IPv6 configuration as well. > (Maybe have it default to an empty value and have an empty value get replaced > with 'network_interfaces'?). That's probably a good solution for ipv6_network_interfaces. -- Brooks -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090603/1b9979a7/attachment.pgp From stas at FreeBSD.org Wed Jun 3 14:18:38 2009 From: stas at FreeBSD.org (Stanislav Sedov) Date: Wed Jun 3 14:18:44 2009 Subject: svn commit: r193382 - head/sys/gnu/fs/ext2fs Message-ID: <200906031418.n53EIbS9057027@svn.freebsd.org> Author: stas Date: Wed Jun 3 14:18:37 2009 New Revision: 193382 URL: http://svn.freebsd.org/changeset/base/193382 Log: - Style(9) improvements. - Convert all K&R definitions to ANSI equialents. - Retire bsd_malloc and bsd_free macros and use malloc/free directly. - Drop some unused debugging calls. This commit brings no functional changes. Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 13:29:37 2009 (r193381) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Wed Jun 3 14:18:37 2009 (r193382) @@ -81,10 +81,10 @@ #include #include -static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); -static int ext2_mountfs(struct vnode *, struct mount *); -static int ext2_reload(struct mount *mp, struct thread *td); -static int ext2_sbupdate(struct ext2mount *, int); +static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); +static int ext2_mountfs(struct vnode *, struct mount *); +static int ext2_reload(struct mount *mp, struct thread *td); +static int ext2_sbupdate(struct ext2mount *, int); static vfs_unmount_t ext2_unmount; static vfs_root_t ext2_root; @@ -109,9 +109,6 @@ static struct vfsops ext2fs_vfsops = { VFS_SET(ext2fs_vfsops, ext2fs, 0); -#define bsd_malloc malloc -#define bsd_free free - static int ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev, int ronly); static int compute_sb_data(struct vnode * devvp, @@ -127,18 +124,17 @@ static const char *ext2_opts[] = { "from * mount system call */ static int -ext2_mount(mp) - struct mount *mp; +ext2_mount(struct mount *mp) { struct vfsoptlist *opts; struct vnode *devvp; struct thread *td; struct ext2mount *ump = 0; struct ext2_sb_info *fs; + struct nameidata nd, *ndp = &nd; + accmode_t accmode; char *path, *fspec; int error, flags, len; - accmode_t accmode; - struct nameidata nd, *ndp = &nd; td = curthread; opts = mp->mnt_optnew; @@ -196,6 +192,7 @@ ext2_mount(mp) if (fs->s_rd_only && !vfs_flagopt(opts, "ro", NULL, 0)) { if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev, 0)) return (EPERM); + /* * If upgrade to read-write by non-root, then verify * that user has necessary permissions on the device. @@ -221,13 +218,12 @@ ext2_mount(mp) if ((fs->s_es->s_state & EXT2_VALID_FS) == 0 || (fs->s_es->s_state & EXT2_ERROR_FS)) { if (mp->mnt_flag & MNT_FORCE) { - printf( -"WARNING: %s was not properly dismounted\n", - fs->fs_fsmnt); + printf("WARNING: %s was not properly " + "dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); + printf("WARNING: R/W mount of %s " + "denied. Filesystem is not clean" + " - run fsck\n", fs->fs_fsmnt); return (EPERM); } } @@ -243,6 +239,7 @@ ext2_mount(mp) return (error); } } + /* * Not an update, or updating the name: look up the name * and verify that it refers to a sensible disk device. @@ -292,6 +289,7 @@ ext2_mount(mp) } ump = VFSTOEXT2(mp); fs = ump->um_e2fs; + /* * Note that this strncpy() is ok because of a check at the start * of ext2_mount(). @@ -303,63 +301,55 @@ ext2_mount(mp) } /* - * checks that the data in the descriptor blocks make sense - * this is taken from ext2/super.c + * Checks that the data in the descriptor blocks make sense + * this is taken from ext2/super.c. */ -static int ext2_check_descriptors (struct ext2_sb_info * sb) +static int +ext2_check_descriptors(struct ext2_sb_info *sb) { - int i; - int desc_block = 0; - unsigned long block = sb->s_es->s_first_data_block; - struct ext2_group_desc * gdp = NULL; - - /* ext2_debug ("Checking group descriptors"); */ + struct ext2_group_desc *gdp = NULL; + unsigned long block = sb->s_es->s_first_data_block; + int desc_block = 0; + int i; - for (i = 0; i < sb->s_groups_count; i++) - { + for (i = 0; i < sb->s_groups_count; i++) { /* examine next descriptor block */ - if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) - gdp = (struct ext2_group_desc *) - sb->s_group_desc[desc_block++]->b_data; - if (gdp->bg_block_bitmap < block || - gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) - { - printf ("ext2_check_descriptors: " - "Block bitmap for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->bg_block_bitmap); - return 0; - } - if (gdp->bg_inode_bitmap < block || - gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) - { - printf ("ext2_check_descriptors: " - "Inode bitmap for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->bg_inode_bitmap); - return 0; - } - if (gdp->bg_inode_table < block || - gdp->bg_inode_table + sb->s_itb_per_group >= - block + EXT2_BLOCKS_PER_GROUP(sb)) - { - printf ("ext2_check_descriptors: " - "Inode table for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->bg_inode_table); - return 0; - } - block += EXT2_BLOCKS_PER_GROUP(sb); - gdp++; - } - return 1; + if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) + gdp = (struct ext2_group_desc *) + sb->s_group_desc[desc_block++]->b_data; + if (gdp->bg_block_bitmap < block || + gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { + printf ("ext2_check_descriptors: " + "Block bitmap for group %d" + " not in group (block %lu)!\n", + i, (unsigned long) gdp->bg_block_bitmap); + return (0); + } + if (gdp->bg_inode_bitmap < block || + gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { + printf ("ext2_check_descriptors: " + "Inode bitmap for group %d" + " not in group (block %lu)!\n", + i, (unsigned long) gdp->bg_inode_bitmap); + return (0); + } + if (gdp->bg_inode_table < block || + gdp->bg_inode_table + sb->s_itb_per_group >= + block + EXT2_BLOCKS_PER_GROUP(sb)) { + printf ("ext2_check_descriptors: " + "Inode table for group %d" + " not in group (block %lu)!\n", + i, (unsigned long) gdp->bg_inode_table); + return (0); + } + block += EXT2_BLOCKS_PER_GROUP(sb); + gdp++; + } + return (1); } static int -ext2_check_sb_compat(es, dev, ronly) - struct ext2_super_block *es; - struct cdev *dev; - int ronly; +ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev, int ronly) { if (es->s_magic != EXT2_SUPER_MAGIC) { @@ -369,16 +359,14 @@ ext2_check_sb_compat(es, dev, ronly) } if (es->s_rev_level > EXT2_GOOD_OLD_REV) { if (es->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP) { - printf( -"WARNING: mount of %s denied due to unsupported optional features\n", - devtoname(dev)); + printf("WARNING: mount of %s denied due to unsupported " + "optional features\n", devtoname(dev)); return (1); } if (!ronly && (es->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP)) { - printf( -"WARNING: R/W mount of %s denied due to unsupported optional features\n", - devtoname(dev)); + printf("WARNING: R/W mount of %s denied due to " + "unsupported optional features\n", devtoname(dev)); return (1); } } @@ -386,124 +374,101 @@ ext2_check_sb_compat(es, dev, ronly) } /* - * this computes the fields of the ext2_sb_info structure from the - * data in the ext2_super_block structure read in + * This computes the fields of the ext2_sb_info structure from the + * data in the ext2_super_block structure read in. */ -static int compute_sb_data(devvp, es, fs) - struct vnode * devvp; - struct ext2_super_block * es; - struct ext2_sb_info * fs; +static int +compute_sb_data(struct vnode *devvp, struct ext2_super_block *es, + struct ext2_sb_info *fs) { - int db_count, error; - int i, j; - int logic_sb_block = 1; /* XXX for now */ - -#if 1 -#define V(v) -#else -#define V(v) printf(#v"= %lu\n", (unsigned long)fs->v); -#endif + int db_count, error; + int i, j; + int logic_sb_block = 1; /* XXX for now */ + + fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; + fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size; + fs->s_fsbtodb = es->s_log_block_size + 1; + fs->s_qbmask = fs->s_blocksize - 1; + fs->s_blocksize_bits = es->s_log_block_size + 10; + fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; + if (fs->s_frag_size) + fs->s_frags_per_block = fs->s_blocksize / fs->s_frag_size; + fs->s_blocks_per_group = es->s_blocks_per_group; + fs->s_frags_per_group = es->s_frags_per_group; + fs->s_inodes_per_group = es->s_inodes_per_group; + if (es->s_rev_level == EXT2_GOOD_OLD_REV) { + fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; + fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; + } else { + fs->s_first_ino = es->s_first_ino; + fs->s_inode_size = es->s_inode_size; - fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; - V(s_blocksize) - fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size; - V(s_bshift) - fs->s_fsbtodb = es->s_log_block_size + 1; - V(s_fsbtodb) - fs->s_qbmask = fs->s_blocksize - 1; - V(s_qbmask) - fs->s_blocksize_bits = es->s_log_block_size + 10; - V(s_blocksize_bits) - fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size; - V(s_frag_size) - if (fs->s_frag_size) - fs->s_frags_per_block = fs->s_blocksize / fs->s_frag_size; - V(s_frags_per_block) - fs->s_blocks_per_group = es->s_blocks_per_group; - V(s_blocks_per_group) - fs->s_frags_per_group = es->s_frags_per_group; - V(s_frags_per_group) - fs->s_inodes_per_group = es->s_inodes_per_group; - V(s_inodes_per_group) - if (es->s_rev_level == EXT2_GOOD_OLD_REV) { - fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; - fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; - } else { - fs->s_first_ino = es->s_first_ino; - fs->s_inode_size = es->s_inode_size; - - /* - * Simple sanity check for superblock inode size value. - */ - if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE || - fs->s_inode_size > fs->s_blocksize || - (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) { - printf("EXT2-fs: invalid inode size %d\n", fs->s_inode_size); - return (EIO); + /* + * Simple sanity check for superblock inode size value. + */ + if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE || + fs->s_inode_size > fs->s_blocksize || + (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) { + printf("EXT2-fs: invalid inode size %d\n", + fs->s_inode_size); + return (EIO); + } } - } - fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); - V(s_inodes_per_block) - fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; - V(s_itb_per_group) - fs->s_desc_per_block = fs->s_blocksize / sizeof (struct ext2_group_desc); - V(s_desc_per_block) - /* s_resuid / s_resgid ? */ - fs->s_groups_count = (es->s_blocks_count - - es->s_first_data_block + - EXT2_BLOCKS_PER_GROUP(fs) - 1) / - EXT2_BLOCKS_PER_GROUP(fs); - V(s_groups_count) - db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) / - EXT2_DESC_PER_BLOCK(fs); - fs->s_gdb_count = db_count; - V(s_gdb_count) + fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs); + fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block; + fs->s_desc_per_block = fs->s_blocksize / sizeof (struct ext2_group_desc); + /* s_resuid / s_resgid ? */ + fs->s_groups_count = (es->s_blocks_count - es->s_first_data_block + + EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); + db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) / + EXT2_DESC_PER_BLOCK(fs); + fs->s_gdb_count = db_count; + fs->s_group_desc = malloc(db_count * sizeof (struct buf *), + M_EXT2MNT, M_WAITOK); - fs->s_group_desc = bsd_malloc(db_count * sizeof (struct buf *), - M_EXT2MNT, M_WAITOK); + /* + * Adjust logic_sb_block. + * Godmar thinks: if the blocksize is greater than 1024, then + * the superblock is logically part of block zero. + */ + if(fs->s_blocksize > SBSIZE) + logic_sb_block = 0; - /* adjust logic_sb_block */ - if(fs->s_blocksize > SBSIZE) - /* Godmar thinks: if the blocksize is greater than 1024, then - the superblock is logically part of block zero. - */ - logic_sb_block = 0; - - for (i = 0; i < db_count; i++) { - error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), - fs->s_blocksize, NOCRED, &fs->s_group_desc[i]); - if(error) { - for (j = 0; j < i; j++) - brelse(fs->s_group_desc[j]); - bsd_free(fs->s_group_desc, M_EXT2MNT); - printf("EXT2-fs: unable to read group descriptors (%d)\n", error); - return EIO; - } - LCK_BUF(fs->s_group_desc[i]) - } - if(!ext2_check_descriptors(fs)) { - for (j = 0; j < db_count; j++) - ULCK_BUF(fs->s_group_desc[j]) - bsd_free(fs->s_group_desc, M_EXT2MNT); - printf("EXT2-fs: (ext2_check_descriptors failure) " - "unable to read group descriptors\n"); - return EIO; - } - - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) { - fs->s_inode_bitmap_number[i] = 0; - fs->s_inode_bitmap[i] = NULL; - fs->s_block_bitmap_number[i] = 0; - fs->s_block_bitmap[i] = NULL; - } - fs->s_loaded_inode_bitmaps = 0; - fs->s_loaded_block_bitmaps = 0; - if (es->s_rev_level == EXT2_GOOD_OLD_REV || (es->s_feature_ro_compat & - EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0) - fs->fs_maxfilesize = 0x7fffffff; - else - fs->fs_maxfilesize = 0x7fffffffffffffff; - return 0; + for (i = 0; i < db_count; i++) { + error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), + fs->s_blocksize, NOCRED, &fs->s_group_desc[i]); + if(error) { + for (j = 0; j < i; j++) + brelse(fs->s_group_desc[j]); + free(fs->s_group_desc, M_EXT2MNT); + printf("EXT2-fs: unable to read group descriptors" + " (%d)\n", error); + return (EIO); + } + LCK_BUF(fs->s_group_desc[i]) + } + if(!ext2_check_descriptors(fs)) { + for (j = 0; j < db_count; j++) + ULCK_BUF(fs->s_group_desc[j]) + free(fs->s_group_desc, M_EXT2MNT); + printf("EXT2-fs: (ext2_check_descriptors failure) " + "unable to read group descriptors\n"); + return (EIO); + } + for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) { + fs->s_inode_bitmap_number[i] = 0; + fs->s_inode_bitmap[i] = NULL; + fs->s_block_bitmap_number[i] = 0; + fs->s_block_bitmap[i] = NULL; + } + fs->s_loaded_inode_bitmaps = 0; + fs->s_loaded_block_bitmaps = 0; + if (es->s_rev_level == EXT2_GOOD_OLD_REV || + (es->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0) + fs->fs_maxfilesize = 0x7fffffff; + else + fs->fs_maxfilesize = 0x7fffffffffffffff; + return (0); } /* @@ -525,7 +490,7 @@ ext2_reload(struct mount *mp, struct thr struct vnode *vp, *mvp, *devvp; struct inode *ip; struct buf *bp; - struct ext2_super_block * es; + struct ext2_super_block *es; struct ext2_sb_info *fs; int error; @@ -556,7 +521,7 @@ ext2_reload(struct mount *mp, struct thr if((error = compute_sb_data(devvp, es, fs)) != 0) { brelse(bp); - return error; + return (error); } #ifdef UNKLAR if (fs->fs_sbsize < SBSIZE) @@ -582,12 +547,12 @@ loop: } if (vinvalbuf(vp, 0, 0, 0)) panic("ext2_reload: dirty2"); + /* * Step 5: re-read inode data for all active vnodes. */ ip = VTOI(vp); - error = - bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int)fs->s_blocksize, NOCRED, &bp); if (error) { VOP_UNLOCK(vp, 0); @@ -607,17 +572,15 @@ loop: } /* - * Common code for mount and mountroot + * Common code for mount and mountroot. */ static int -ext2_mountfs(devvp, mp) - struct vnode *devvp; - struct mount *mp; +ext2_mountfs(struct vnode *devvp, struct mount *mp) { struct ext2mount *ump; struct buf *bp; struct ext2_sb_info *fs; - struct ext2_super_block * es; + struct ext2_super_block *es; struct cdev *dev = devvp->v_rdev; struct g_consumer *cp; struct bufobj *bo; @@ -666,28 +629,31 @@ ext2_mountfs(devvp, mp) if ((es->s_state & EXT2_VALID_FS) == 0 || (es->s_state & EXT2_ERROR_FS)) { if (ronly || (mp->mnt_flag & MNT_FORCE)) { - printf( -"WARNING: Filesystem was not properly dismounted\n"); + printf("WARNING: Filesystem was not properly " + "dismounted\n"); } else { - printf( -"WARNING: R/W mount denied. Filesystem is not clean - run fsck\n"); + printf("WARNING: R/W mount denied. Filesystem " + "is not clean - run fsck\n"); error = EPERM; goto out; } } - ump = bsd_malloc(sizeof *ump, M_EXT2MNT, M_WAITOK); + ump = malloc(sizeof *ump, M_EXT2MNT, M_WAITOK); bzero((caddr_t)ump, sizeof *ump); - /* I don't know whether this is the right strategy. Note that - we dynamically allocate both an ext2_sb_info and an ext2_super_block - while Linux keeps the super block in a locked buffer + + /* + * I don't know whether this is the right strategy. Note that + * we dynamically allocate both an ext2_sb_info and an ext2_super_block + * while Linux keeps the super block in a locked buffer. */ - ump->um_e2fs = bsd_malloc(sizeof(struct ext2_sb_info), + ump->um_e2fs = malloc(sizeof(struct ext2_sb_info), M_EXT2MNT, M_WAITOK); - ump->um_e2fs->s_es = bsd_malloc(sizeof(struct ext2_super_block), + ump->um_e2fs->s_es = malloc(sizeof(struct ext2_super_block), M_EXT2MNT, M_WAITOK); bcopy(es, ump->um_e2fs->s_es, (u_int)sizeof(struct ext2_super_block)); if ((error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs))) goto out; + /* * We don't free the group descriptors allocated by compute_sb_data() * until ext2_unmount(). This is OK since the mount will succeed. @@ -696,8 +662,10 @@ ext2_mountfs(devvp, mp) bp = NULL; fs = ump->um_e2fs; fs->s_rd_only = ronly; /* ronly is set according to mnt_flags */ - /* if the fs is not mounted read-only, make sure the super block is - always written back on a sync() + + /* + * If the fs is not mounted read-only, make sure the super block is + * always written back on a sync(). */ fs->s_wasvalid = fs->s_es->s_state & EXT2_VALID_FS ? 1 : 0; if (ronly == 0) { @@ -716,9 +684,11 @@ ext2_mountfs(devvp, mp) ump->um_devvp = devvp; ump->um_bo = &devvp->v_bufobj; ump->um_cp = cp; - /* setting those two parameters allowed us to use - ufs_bmap w/o changse ! - */ + + /* + * Setting those two parameters allowed us to use + * ufs_bmap w/o changse! + */ ump->um_nindir = EXT2_ADDR_PER_BLOCK(fs); ump->um_bptrtodb = fs->s_es->s_log_block_size + 1; ump->um_seqinc = EXT2_FRAGS_PER_BLOCK(fs); @@ -736,21 +706,19 @@ out: PICKUP_GIANT(); } if (ump) { - bsd_free(ump->um_e2fs->s_es, M_EXT2MNT); - bsd_free(ump->um_e2fs, M_EXT2MNT); - bsd_free(ump, M_EXT2MNT); + free(ump->um_e2fs->s_es, M_EXT2MNT); + free(ump->um_e2fs, M_EXT2MNT); + free(ump, M_EXT2MNT); mp->mnt_data = NULL; } return (error); } /* - * unmount system call + * Unmount system call. */ static int -ext2_unmount(mp, mntflags) - struct mount *mp; - int mntflags; +ext2_unmount(struct mount *mp, int mntflags) { struct ext2mount *ump; struct ext2_sb_info *fs; @@ -776,16 +744,15 @@ ext2_unmount(mp, mntflags) /* release buffers containing group descriptors */ for(i = 0; i < fs->s_gdb_count; i++) ULCK_BUF(fs->s_group_desc[i]) - bsd_free(fs->s_group_desc, M_EXT2MNT); + free(fs->s_group_desc, M_EXT2MNT); /* release cached inode/block bitmaps */ - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->s_inode_bitmap[i]) - ULCK_BUF(fs->s_inode_bitmap[i]) - - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->s_block_bitmap[i]) - ULCK_BUF(fs->s_block_bitmap[i]) + for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) + if (fs->s_inode_bitmap[i]) + ULCK_BUF(fs->s_inode_bitmap[i]) + for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) + if (fs->s_block_bitmap[i]) + ULCK_BUF(fs->s_block_bitmap[i]) DROP_GIANT(); g_topology_lock(); @@ -793,9 +760,9 @@ ext2_unmount(mp, mntflags) g_topology_unlock(); PICKUP_GIANT(); vrele(ump->um_devvp); - bsd_free(fs->s_es, M_EXT2MNT); - bsd_free(fs, M_EXT2MNT); - bsd_free(ump, M_EXT2MNT); + free(fs->s_es, M_EXT2MNT); + free(fs, M_EXT2MNT); + free(ump, M_EXT2MNT); mp->mnt_data = NULL; MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; @@ -807,10 +774,7 @@ ext2_unmount(mp, mntflags) * Flush out all the files in a filesystem. */ static int -ext2_flushfiles(mp, flags, td) - struct mount *mp; - int flags; - struct thread *td; +ext2_flushfiles(struct mount *mp, int flags, struct thread *td) { int error; @@ -820,17 +784,15 @@ ext2_flushfiles(mp, flags, td) /* * Get file system statistics. - * taken from ext2/super.c ext2_statfs + * taken from ext2/super.c ext2_statfs. */ static int -ext2_statfs(mp, sbp) - struct mount *mp; - struct statfs *sbp; +ext2_statfs(struct mount *mp, struct statfs *sbp) { - unsigned long overhead; struct ext2mount *ump; struct ext2_sb_info *fs; struct ext2_super_block *es; + unsigned long overhead; int i, nsb; ump = VFSTOEXT2(mp); @@ -851,10 +813,10 @@ ext2_statfs(mp, sbp) } else nsb = fs->s_groups_count; overhead = es->s_first_data_block + - /* Superblocks and block group descriptors: */ - nsb * (1 + fs->s_gdb_count) + - /* Inode bitmap, block bitmap, and inode table: */ - fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); + /* Superblocks and block group descriptors: */ + nsb * (1 + fs->s_gdb_count) + + /* Inode bitmap, block bitmap, and inode table: */ + fs->s_groups_count * (1 + 1 + fs->s_itb_per_group); sbp->f_bsize = EXT2_FRAG_SIZE(fs); sbp->f_iosize = EXT2_BLOCK_SIZE(fs); @@ -874,9 +836,7 @@ ext2_statfs(mp, sbp) * Note: we are always called with the filesystem marked `MPBUSY'. */ static int -ext2_sync(mp, waitfor) - struct mount *mp; - int waitfor; +ext2_sync(struct mount *mp, int waitfor) { struct vnode *mvp, *vp; struct thread *td; @@ -891,6 +851,7 @@ ext2_sync(mp, waitfor) printf("fs = %s\n", fs->fs_fsmnt); panic("ext2_sync: rofs mod"); } + /* * Write back each (modified) inode. */ @@ -928,6 +889,7 @@ loop: MNT_ILOCK(mp); } MNT_IUNLOCK(mp); + /* * Force stale file system control information to be flushed. */ @@ -937,6 +899,7 @@ loop: allerror = error; VOP_UNLOCK(ump->um_devvp, 0); } + /* * Write back modified superblock. */ @@ -956,11 +919,7 @@ loop: * done by the calling routine. */ static int -ext2_vget(mp, ino, flags, vpp) - struct mount *mp; - ino_t ino; - int flags; - struct vnode **vpp; +ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) { struct ext2_sb_info *fs; struct inode *ip; @@ -968,9 +927,9 @@ ext2_vget(mp, ino, flags, vpp) struct buf *bp; struct vnode *vp; struct cdev *dev; + struct thread *td; int i, error; int used_blocks; - struct thread *td; td = curthread; error = vfs_hash_get(mp, ino, flags, td, vpp, NULL, NULL); @@ -1012,9 +971,6 @@ ext2_vget(mp, ino, flags, vpp) return (error); /* Read in the disk contents for the inode, copy into the inode. */ -#if 0 -printf("ext2_vget(%d) dbn= %lu ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); -#endif if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), (int)fs->s_blocksize, NOCRED, &bp)) != 0) { /* @@ -1036,10 +992,12 @@ printf("ext2_vget(%d) dbn= %lu ", ino, f ip->i_next_alloc_goal = 0; ip->i_prealloc_count = 0; ip->i_prealloc_block = 0; - /* now we want to make sure that block pointers for unused - blocks are zeroed out - ext2_balloc depends on this - although for regular files and directories only - */ + + /* + * Now we want to make sure that block pointers for unused + * blocks are zeroed out - ext2_balloc depends on this + * although for regular files and directories only + */ if(S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode)) { used_blocks = (ip->i_size+fs->s_blocksize-1) / fs->s_blocksize; for(i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) @@ -1059,10 +1017,12 @@ printf("ext2_vget(%d) dbn= %lu ", ino, f *vpp = NULL; return (error); } + /* * Finish inode initialization now that aliasing has been resolved. */ ip->i_devvp = ump->um_devvp; + /* * Set up a generation number for this inode if it does not * already have one. This should only happen on old filesystems. @@ -1087,10 +1047,7 @@ printf("ext2_vget(%d) dbn= %lu ", ino, f * those rights via. exflagsp and credanonp */ static int -ext2_fhtovp(mp, fhp, vpp) - struct mount *mp; - struct fid *fhp; - struct vnode **vpp; +ext2_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) { struct inode *ip; struct ufid *ufhp; @@ -1125,17 +1082,13 @@ ext2_fhtovp(mp, fhp, vpp) * Write a superblock and associated information back to disk. */ static int -ext2_sbupdate(mp, waitfor) - struct ext2mount *mp; - int waitfor; +ext2_sbupdate(struct ext2mount *mp, int waitfor) { struct ext2_sb_info *fs = mp->um_e2fs; struct ext2_super_block *es = fs->s_es; struct buf *bp; int error = 0; -/* -printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no"); -*/ + bp = getblk(mp->um_devvp, SBLOCK, SBSIZE, 0, 0, 0); bcopy((caddr_t)es, bp->b_data, (u_int)sizeof(struct ext2_super_block)); if (waitfor == MNT_WAIT) @@ -1146,9 +1099,8 @@ printf("\nupdating superblock, waitfor=% /* * The buffers for group descriptors, inode bitmaps and block bitmaps * are not busy at this point and are (hopefully) written by the - * usual sync mechanism. No need to write them here - */ - + * usual sync mechanism. No need to write them here. + */ return (error); } @@ -1156,10 +1108,7 @@ printf("\nupdating superblock, waitfor=% * Return the root of a filesystem. */ static int -ext2_root(mp, flags, vpp) - struct mount *mp; - int flags; - struct vnode **vpp; +ext2_root(struct mount *mp, int flags, struct vnode **vpp) { struct vnode *nvp; int error; From raj at FreeBSD.org Wed Jun 3 16:28:29 2009 From: raj at FreeBSD.org (Rafal Jaworowski) Date: Wed Jun 3 16:28:37 2009 Subject: svn commit: r193387 - head/sys/boot/uboot/lib Message-ID: <200906031628.n53GSTWV059888@svn.freebsd.org> Author: raj Date: Wed Jun 3 16:28:29 2009 New Revision: 193387 URL: http://svn.freebsd.org/changeset/base/193387 Log: Make GPT style partitiong endian-safe in U-Boot support library. Submitted by: Piotr Ziecik Obtained from: Semihalf Modified: head/sys/boot/uboot/lib/disk.c Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Wed Jun 3 16:11:27 2009 (r193386) +++ head/sys/boot/uboot/lib/disk.c Wed Jun 3 16:28:29 2009 (r193387) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -122,6 +123,15 @@ struct devsw uboot_storage = { stor_print }; +static void +uuid_letoh(uuid_t *uuid) +{ + + uuid->time_low = le32toh(uuid->time_low); + uuid->time_mid = le16toh(uuid->time_mid); + uuid->time_hi_and_version = le16toh(uuid->time_hi_and_version); +} + static int stor_init(void) { @@ -251,7 +261,7 @@ stor_open_gpt(struct open_dev *od, struc } /* Check the slice table magic. */ - if (*((uint16_t *)(buf + DOSMAGICOFFSET)) != DOSMAGIC) { + if (le16toh(*((uint16_t *)(buf + DOSMAGICOFFSET))) != DOSMAGIC) { err = ENXIO; goto out; } @@ -286,9 +296,10 @@ stor_open_gpt(struct open_dev *od, struc /* Check GPT header */ if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || - hdr->hdr_lba_self != 1 || hdr->hdr_revision < 0x00010000 || - hdr->hdr_entsz < sizeof(*ent) || - od->od_bsize % hdr->hdr_entsz != 0) { + le64toh(hdr->hdr_lba_self) != 1 || + le32toh(hdr->hdr_revision) < 0x00010000 || + le32toh(hdr->hdr_entsz) < sizeof(*ent) || + od->od_bsize % le32toh(hdr->hdr_entsz) != 0) { debugf("Invalid GPT header!\n"); err = EINVAL; goto out; @@ -296,9 +307,9 @@ stor_open_gpt(struct open_dev *od, struc /* Count number of valid partitions */ part = 0; - eps = od->od_bsize / hdr->hdr_entsz; - slba = hdr->hdr_lba_table; - elba = slba + hdr->hdr_entries / eps; + eps = od->od_bsize / le32toh(hdr->hdr_entsz); + slba = le64toh(hdr->hdr_lba_table); + elba = slba + le32toh(hdr->hdr_entries) / eps; for (lba = slba; lba < elba; lba++) { err = stor_readdev(dev, lba, 1, buf); @@ -312,8 +323,9 @@ stor_open_gpt(struct open_dev *od, struc for (i = 0; i < eps; i++) { if (uuid_is_nil(&ent[i].ent_type, NULL) || - ent[i].ent_lba_start == 0 || - ent[i].ent_lba_end < ent[i].ent_lba_start) + le64toh(ent[i].ent_lba_start) == 0 || + le64toh(ent[i].ent_lba_end) < + le64toh(ent[i].ent_lba_start)) continue; part += 1; @@ -343,8 +355,9 @@ stor_open_gpt(struct open_dev *od, struc for (i = 0; i < eps; i++) { if (uuid_is_nil(&ent[i].ent_type, NULL) || - ent[i].ent_lba_start == 0 || - ent[i].ent_lba_end < ent[i].ent_lba_start) + le64toh(ent[i].ent_lba_start) == 0 || + le64toh(ent[i].ent_lba_end) < + le64toh(ent[i].ent_lba_start)) continue; od->od_partitions[part].gp_index = (lba - slba) @@ -352,9 +365,11 @@ stor_open_gpt(struct open_dev *od, struc od->od_partitions[part].gp_type = ent[i].ent_type; od->od_partitions[part].gp_start = - ent[i].ent_lba_start; + le64toh(ent[i].ent_lba_start); od->od_partitions[part].gp_end = - ent[i].ent_lba_end; + le64toh(ent[i].ent_lba_end); + + uuid_letoh(&od->od_partitions[part].gp_type); part += 1; } } From brde at optusnet.com.au Wed Jun 3 17:06:58 2009 From: brde at optusnet.com.au (Bruce Evans) Date: Wed Jun 3 17:07:14 2009 Subject: svn commit: r193377 - head/sys/gnu/fs/ext2fs In-Reply-To: <200906031325.n53DPo2W055626@svn.freebsd.org> References: <200906031325.n53DPo2W055626@svn.freebsd.org> Message-ID: <20090604030639.U1181@besplex.bde.org> On Wed, 3 Jun 2009, Stanislav Sedov wrote: > Log: > - Sync our copies of ext2fs Linux headers to current Linux versions. > Minimize differencies between our ext2fs headers and relevant Linux > versions by using EXT2_SB macro to access the superblock fields. Most > of the differencies in access to these fields are now hidden inside > this macro. > - Rename the s_db_per_group field of ext2fs_sb_info to s_gdb_count > to reflect the similar change in Linux headers. New name also seem > to be more appropriate for this field. > - Use proper types for s_first_inode and s_inode_size in-core superblock > fields. Now they reflec types used in the on-disk superblock version. > - Add support for older filesystem revisions that doesn't have proper > s_first_ino and s_inode_size fields in the on-disk superblock. In these > cases predefined values for these fields are used. > - Add simple sanity checks for s_first_inode and s_inode_size correctness. > > Reviewed by: bde (previous version) > MFC after: 2 weeks Thanks. Bruce From jkoshy at FreeBSD.org Wed Jun 3 17:19:13 2009 From: jkoshy at FreeBSD.org (Joseph Koshy) Date: Wed Jun 3 17:19:25 2009 Subject: svn commit: r193388 - head/sys/sys Message-ID: <200906031719.n53HJCm1061026@svn.freebsd.org> Author: jkoshy Date: Wed Jun 3 17:19:12 2009 New Revision: 193388 URL: http://svn.freebsd.org/changeset/base/193388 Log: Trim an obsolete comment. Noticed by: lifengkai Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Wed Jun 3 16:28:29 2009 (r193387) +++ head/sys/sys/pmc.h Wed Jun 3 17:19:12 2009 (r193388) @@ -709,11 +709,6 @@ struct pmc { * array. The size of this structure is thus PMC architecture * dependent. * - * TODO: Only process-private counting mode PMCs may be attached to a - * process different from the allocator process (since we do not have - * the infrastructure to make sense of an interrupted PC value from a - * 'target' process (yet)). - * */ struct pmc_targetstate { From sam at FreeBSD.org Wed Jun 3 17:25:20 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Wed Jun 3 17:25:27 2009 Subject: svn commit: r193389 - head/sys/dev/ath Message-ID: <200906031725.n53HPKUa061196@svn.freebsd.org> Author: sam Date: Wed Jun 3 17:25:19 2009 New Revision: 193389 URL: http://svn.freebsd.org/changeset/base/193389 Log: treat IEEE80211_S_CSA as a "running state"; this fixes ap mode 11h channel switch announcements Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Jun 3 17:19:12 2009 (r193388) +++ head/sys/dev/ath/if_ath.c Wed Jun 3 17:25:19 2009 (r193389) @@ -2802,7 +2802,7 @@ ath_beacon_proc(void *arg, int pending) slot = ((tsftu % ic->ic_lintval) * ATH_BCBUF) / ic->ic_lintval; vap = sc->sc_bslot[(slot+1) % ATH_BCBUF]; bfaddr = 0; - if (vap != NULL && vap->iv_state == IEEE80211_S_RUN) { + if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { bf = ath_beacon_generate(sc, vap); if (bf != NULL) bfaddr = bf->bf_daddr; @@ -2812,7 +2812,7 @@ ath_beacon_proc(void *arg, int pending) for (slot = 0; slot < ATH_BCBUF; slot++) { vap = sc->sc_bslot[slot]; - if (vap != NULL && vap->iv_state == IEEE80211_S_RUN) { + if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { bf = ath_beacon_generate(sc, vap); if (bf != NULL) { *bflink = bf->bf_daddr; @@ -2878,7 +2878,7 @@ ath_beacon_generate(struct ath_softc *sc struct mbuf *m; int nmcastq, error; - KASSERT(vap->iv_state == IEEE80211_S_RUN, + KASSERT(vap->iv_state >= IEEE80211_S_RUN, ("not running, state %d", vap->iv_state)); KASSERT(avp->av_bcbuf != NULL, ("no beacon buffer")); @@ -5506,7 +5506,7 @@ ath_isanyrunningvaps(struct ieee80211vap IEEE80211_LOCK_ASSERT(ic); TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - if (vap != this && vap->iv_state == IEEE80211_S_RUN) + if (vap != this && vap->iv_state >= IEEE80211_S_RUN) return 1; } return 0; From stas at FreeBSD.org Wed Jun 3 17:30:11 2009 From: stas at FreeBSD.org (Stanislav Sedov) Date: Wed Jun 3 17:30:17 2009 Subject: svn commit: r193390 - head/sys/gnu/fs/ext2fs Message-ID: <200906031730.n53HUAdK061316@svn.freebsd.org> Author: stas Date: Wed Jun 3 17:30:10 2009 New Revision: 193390 URL: http://svn.freebsd.org/changeset/base/193390 Log: - Remove unused sparc64-bitops.h file. Our ext2fs code doesn't use sparc64-specific bitops implemetations and relies on generic ones. Furthermore, bitops implementations present in sparc64-bitops.h are written in C similarly to generic bitops. Deleted: head/sys/gnu/fs/ext2fs/sparc64-bitops.h From jkim at FreeBSD.org Wed Jun 3 17:43:25 2009 From: jkim at FreeBSD.org (Jung-uk Kim) Date: Wed Jun 3 17:43:42 2009 Subject: svn commit: r193306 - head/sys/dev/pci In-Reply-To: <200906021235.n52CZ4BF015807@svn.freebsd.org> References: <200906021235.n52CZ4BF015807@svn.freebsd.org> Message-ID: <200906031343.13661.jkim@FreeBSD.org> On Tuesday 02 June 2009 08:35 am, John Baldwin wrote: > Author: jhb > Date: Tue Jun 2 12:35:04 2009 > New Revision: 193306 > URL: http://svn.freebsd.org/changeset/base/193306 > > Log: > Include for va_*(). I'm not sure how this > compiled on amd64 without this. I am working on importing ACPICA 20090521 and bitten by this because the project tree was copied before this change. :-( Basically, what's happening was: #ifdef __HAVE_ACPI ... #include ... #include ... #include ... #ifdef _KERNEL ... #include Jung-uk Kim From rwatson at FreeBSD.org Wed Jun 3 18:46:30 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Wed Jun 3 18:46:36 2009 Subject: svn commit: r193391 - in head/sys: netinet security/mac security/mac_biba security/mac_lomac security/mac_mls security/mac_stub security/mac_test Message-ID: <200906031846.n53IkS42062877@svn.freebsd.org> Author: rwatson Date: Wed Jun 3 18:46:28 2009 New Revision: 193391 URL: http://svn.freebsd.org/changeset/base/193391 Log: Continue work to optimize performance of "options MAC" when no MAC policy modules are loaded by avoiding mbuf label lookups when policies aren't loaded, pushing further socket locking into MAC policy modules, and avoiding locking MAC ifnet locks when no policies are loaded: - Check mac_policies_count before looking for mbuf MAC label m_tags in MAC Framework entry points. We will still pay label lookup costs if MAC policies are present but don't require labels (typically a single mbuf header field read, but perhaps further indirection if IPSEC or other m_tag consumers are in use). - Further push socket locking for socket-related access control checks and events into MAC policies from the MAC Framework, so that sockets are only locked if a policy specifically requires a lock to protect a label. This resolves lock order issues during sonewconn() and also in local domain socket cross-connect where multiple socket locks could not be held at once for the purposes of propagatig MAC labels across multiple sockets. Eliminate mac_policy_count check in some entry points where it no longer avoids locking. - Add mac_policy_count checking in some entry points relating to network interfaces that otherwise lock a global MAC ifnet lock used to protect ifnet labels. Obtained from: TrustedBSD Project Modified: head/sys/netinet/in_pcb.c head/sys/security/mac/mac_atalk.c head/sys/security/mac/mac_inet.c head/sys/security/mac/mac_inet6.c head/sys/security/mac/mac_net.c head/sys/security/mac/mac_socket.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_mls/mac_mls.c head/sys/security/mac_stub/mac_stub.c head/sys/security/mac_test/mac_test.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/netinet/in_pcb.c Wed Jun 3 18:46:28 2009 (r193391) @@ -212,9 +212,7 @@ in_pcballoc(struct socket *so, struct in error = mac_inpcb_init(inp, M_NOWAIT); if (error != 0) goto out; - SOCK_LOCK(so); mac_inpcb_create(so, inp); - SOCK_UNLOCK(so); #endif #ifdef IPSEC error = ipsec_init_policy(so, &inp->inp_sp); Modified: head/sys/security/mac/mac_atalk.c ============================================================================== --- head/sys/security/mac/mac_atalk.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_atalk.c Wed Jun 3 18:46:28 2009 (r193391) @@ -61,6 +61,9 @@ mac_netatalk_aarp_send(struct ifnet *ifp { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); Modified: head/sys/security/mac/mac_inet.c ============================================================================== --- head/sys/security/mac/mac_inet.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_inet.c Wed Jun 3 18:46:28 2009 (r193391) @@ -193,6 +193,9 @@ mac_ipq_reassemble(struct ipq *q, struct { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ipq_reassemble, q, q->ipq_label, m, @@ -204,6 +207,9 @@ mac_netinet_fragment(struct mbuf *m, str { struct label *mlabel, *fraglabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); fraglabel = mac_mbuf_to_label(frag); @@ -216,6 +222,9 @@ mac_ipq_create(struct mbuf *m, struct ip { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ipq_create, m, label, q, q->ipq_label); @@ -227,6 +236,10 @@ mac_inpcb_create_mbuf(struct inpcb *inp, struct label *mlabel; INP_LOCK_ASSERT(inp); + + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(inpcb_create_mbuf, inp, inp->inp_label, m, @@ -239,6 +252,9 @@ mac_ipq_match(struct mbuf *m, struct ipq struct label *label; int result; + if (mac_policy_count == 0) + return (1); + label = mac_mbuf_to_label(m); result = 1; @@ -252,6 +268,9 @@ mac_netinet_arp_send(struct ifnet *ifp, { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); @@ -265,6 +284,9 @@ mac_netinet_icmp_reply(struct mbuf *mrec { struct label *mrecvlabel, *msendlabel; + if (mac_policy_count == 0) + return; + mrecvlabel = mac_mbuf_to_label(mrecv); msendlabel = mac_mbuf_to_label(msend); @@ -277,6 +299,9 @@ mac_netinet_icmp_replyinplace(struct mbu { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet_icmp_replyinplace, m, label); @@ -287,6 +312,9 @@ mac_netinet_igmp_send(struct ifnet *ifp, { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); @@ -300,6 +328,9 @@ mac_netinet_tcp_reply(struct mbuf *m) { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet_tcp_reply, m, label); @@ -310,6 +341,9 @@ mac_ipq_update(struct mbuf *m, struct ip { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ipq_update, m, label, q, q->ipq_label); @@ -326,6 +360,9 @@ mac_inpcb_check_deliver(struct inpcb *in M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return (0); + label = mac_mbuf_to_label(m); MAC_POLICY_CHECK_NOSLEEP(inpcb_check_deliver, inp, inp->inp_label, m, @@ -371,6 +408,9 @@ mac_netinet_firewall_reply(struct mbuf * M_ASSERTPKTHDR(mrecv); M_ASSERTPKTHDR(msend); + if (mac_policy_count == 0) + return; + mrecvlabel = mac_mbuf_to_label(mrecv); msendlabel = mac_mbuf_to_label(msend); @@ -385,6 +425,9 @@ mac_netinet_firewall_send(struct mbuf *m M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet_firewall_send, m, label); @@ -455,6 +498,9 @@ mac_syncache_create_mbuf(struct label *s M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(syncache_create_mbuf, sc_label, m, Modified: head/sys/security/mac/mac_inet6.c ============================================================================== --- head/sys/security/mac/mac_inet6.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_inet6.c Wed Jun 3 18:46:28 2009 (r193391) @@ -118,6 +118,9 @@ mac_ip6q_reassemble(struct ip6q *q6, str { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ip6q_reassemble, q6, q6->ip6q_label, m, @@ -129,6 +132,9 @@ mac_ip6q_create(struct mbuf *m, struct i { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ip6q_create, m, label, q6, @@ -141,6 +147,9 @@ mac_ip6q_match(struct mbuf *m, struct ip struct label *label; int result; + if (mac_policy_count == 0) + return (1); + label = mac_mbuf_to_label(m); result = 1; @@ -155,6 +164,9 @@ mac_ip6q_update(struct mbuf *m, struct i { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(ip6q_update, m, label, q6, @@ -166,6 +178,9 @@ mac_netinet6_nd6_send(struct ifnet *ifp, { struct label *mlabel; + if (mac_policy_count == 0) + return; + mlabel = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(netinet6_nd6_send, ifp, ifp->if_label, m, Modified: head/sys/security/mac/mac_net.c ============================================================================== --- head/sys/security/mac/mac_net.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_net.c Wed Jun 3 18:46:28 2009 (r193391) @@ -296,6 +296,9 @@ void mac_ifnet_create(struct ifnet *ifp) { + if (mac_policy_count == 0) + return; + MAC_IFNET_LOCK(ifp); MAC_POLICY_PERFORM_NOSLEEP(ifnet_create, ifp, ifp->if_label); MAC_IFNET_UNLOCK(ifp); @@ -315,6 +318,9 @@ mac_bpfdesc_create_mbuf(struct bpf_d *d, BPFD_LOCK_ASSERT(d); + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_POLICY_PERFORM_NOSLEEP(bpfdesc_create_mbuf, d, d->bd_label, m, @@ -326,6 +332,9 @@ mac_ifnet_create_mbuf(struct ifnet *ifp, { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); @@ -344,6 +353,9 @@ mac_bpfdesc_check_receive(struct bpf_d * BPFD_LOCK_ASSERT(d); + if (mac_policy_count == 0) + return (0); + MAC_IFNET_LOCK(ifp); MAC_POLICY_CHECK_NOSLEEP(bpfdesc_check_receive, d, d->bd_label, ifp, ifp->if_label); @@ -364,6 +376,9 @@ mac_ifnet_check_transmit(struct ifnet *i M_ASSERTPKTHDR(m); + if (mac_policy_count == 0) + return (0); + label = mac_mbuf_to_label(m); MAC_IFNET_LOCK(ifp); Modified: head/sys/security/mac/mac_socket.c ============================================================================== --- head/sys/security/mac/mac_socket.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac/mac_socket.c Wed Jun 3 18:46:28 2009 (r193391) @@ -88,6 +88,16 @@ __FBSDID("$FreeBSD$"); * remote socket for UNIX domain sockets rather than keeping a local copy on * this endpoint, but be cached and updated based on packets received for * TCP/IP. + * + * Unlike with many other object types, the lock protecting MAC labels on + * sockets (the socket lock) is not frequently held at the points in code + * where socket-related checks are called. The MAC Framework acquires the + * lock over some entry points in order to enforce atomicity (such as label + * copies) but in other cases the policy modules will have to acquire the + * lock themselves if they use labels. This approach (a) avoids lock + * acquisitions when policies don't require labels and (b) solves a number of + * potential lock order issues when multiple sockets are used in the same + * entry point. */ struct label * @@ -234,13 +244,8 @@ void mac_socket_newconn(struct socket *oldso, struct socket *newso) { - if (mac_policy_count == 0) - return; - - SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socket_newconn, oldso, oldso->so_label, newso, newso->so_label); - SOCK_UNLOCK(oldso); } static void @@ -259,12 +264,13 @@ mac_socketpeer_set_from_mbuf(struct mbuf { struct label *label; + if (mac_policy_count == 0) + return; + label = mac_mbuf_to_label(m); - SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_mbuf, m, label, so, so->so_peerlabel); - SOCK_UNLOCK(so); } void @@ -274,15 +280,8 @@ mac_socketpeer_set_from_socket(struct so if (mac_policy_count == 0) return; - /* - * XXXRW: We want to hold locks on both sockets, but can't currently - * due to lock order -- opt to lock the socket where we're accessing - * so_label as it's more likely to change. - */ - SOCK_LOCK(oldso); MAC_POLICY_PERFORM_NOSLEEP(socketpeer_set_from_socket, oldso, oldso->so_label, newso, newso->so_peerlabel); - SOCK_UNLOCK(oldso); } void @@ -295,10 +294,8 @@ mac_socket_create_mbuf(struct socket *so label = mac_mbuf_to_label(m); - SOCK_LOCK(so); MAC_POLICY_PERFORM_NOSLEEP(socket_create_mbuf, so, so->so_label, m, label); - SOCK_UNLOCK(so); } MAC_CHECK_PROBE_DEFINE2(socket_check_accept, "struct ucred *", @@ -309,14 +306,9 @@ mac_socket_check_accept(struct ucred *cr { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_accept, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_accept, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -330,14 +322,9 @@ mac_socket_check_bind(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_bind, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_bind, error, cred, so, sa); - SOCK_UNLOCK(so); return (error); } @@ -351,14 +338,9 @@ mac_socket_check_connect(struct ucred *c { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_connect, cred, so, so->so_label, sa); MAC_CHECK_PROBE3(socket_check_connect, error, cred, so, sa); - SOCK_UNLOCK(so); return (error); } @@ -393,11 +375,9 @@ mac_socket_check_deliver(struct socket * label = mac_mbuf_to_label(m); - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_deliver, so, so->so_label, m, label); MAC_CHECK_PROBE2(socket_check_deliver, error, so, m); - SOCK_UNLOCK(so); return (error); } @@ -410,14 +390,9 @@ mac_socket_check_listen(struct ucred *cr { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_listen, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_listen, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -430,13 +405,8 @@ mac_socket_check_poll(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_poll, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_poll, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -449,14 +419,9 @@ mac_socket_check_receive(struct ucred *c { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_receive, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_receive, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -487,13 +452,8 @@ mac_socket_check_send(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_send, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_send, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -506,13 +466,8 @@ mac_socket_check_stat(struct ucred *cred { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_stat, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_stat, error, cred, so); - SOCK_UNLOCK(so); return (error); } @@ -525,14 +480,9 @@ mac_socket_check_visible(struct ucred *c { int error; - if (mac_policy_count == 0) - return (0); - - SOCK_LOCK(so); MAC_POLICY_CHECK_NOSLEEP(socket_check_visible, cred, so, so->so_label); MAC_CHECK_PROBE2(socket_check_visible, error, cred, so); - SOCK_UNLOCK(so); return (error); } Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_biba/mac_biba.c Wed Jun 3 18:46:28 2009 (r193391) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007-2008 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson * Copyright (c) 2001-2005 McAfee, Inc. * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. @@ -1177,7 +1177,9 @@ biba_inpcb_create(struct socket *so, str source = SLOT(solabel); dest = SLOT(inplabel); + SOCK_LOCK(so); biba_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void @@ -1198,6 +1200,8 @@ biba_inpcb_sosetlabel(struct socket *so, { struct mac_biba *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(solabel); dest = SLOT(inplabel); @@ -1918,6 +1922,7 @@ biba_socket_check_deliver(struct socket struct mbuf *m, struct label *mlabel) { struct mac_biba *p, *s; + int error; if (!biba_enabled) return (0); @@ -1925,7 +1930,10 @@ biba_socket_check_deliver(struct socket p = SLOT(mlabel); s = SLOT(solabel); - return (biba_equal_effective(p, s) ? 0 : EACCES); + SOCK_LOCK(so); + error = biba_equal_effective(p, s) ? 0 : EACCES; + SOCK_UNLOCK(so); + return (error); } static int @@ -1935,6 +1943,8 @@ biba_socket_check_relabel(struct ucred * struct mac_biba *subj, *obj, *new; int error; + SOCK_LOCK_ASSERT(so); + new = SLOT(newlabel); subj = SLOT(cred->cr_label); obj = SLOT(solabel); @@ -1991,8 +2001,12 @@ biba_socket_check_visible(struct ucred * subj = SLOT(cred->cr_label); obj = SLOT(solabel); - if (!biba_dominate_effective(obj, subj)) + SOCK_LOCK(so); + if (!biba_dominate_effective(obj, subj)) { + SOCK_UNLOCK(so); return (ENOENT); + } + SOCK_UNLOCK(so); return (0); } @@ -2018,19 +2032,26 @@ biba_socket_create_mbuf(struct socket *s source = SLOT(solabel); dest = SLOT(mlabel); + SOCK_LOCK(so); biba_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void biba_socket_newconn(struct socket *oldso, struct label *oldsolabel, struct socket *newso, struct label *newsolabel) { - struct mac_biba *source, *dest; + struct mac_biba source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsolabel); - biba_copy_effective(source, dest); + SOCK_LOCK(newso); + biba_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void @@ -2039,6 +2060,8 @@ biba_socket_relabel(struct ucred *cred, { struct mac_biba *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(newlabel); dest = SLOT(solabel); @@ -2054,7 +2077,9 @@ biba_socketpeer_set_from_mbuf(struct mbu source = SLOT(mlabel); dest = SLOT(sopeerlabel); + SOCK_LOCK(so); biba_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void @@ -2062,12 +2087,16 @@ biba_socketpeer_set_from_socket(struct s struct label *oldsolabel, struct socket *newso, struct label *newsopeerlabel) { - struct mac_biba *source, *dest; + struct mac_biba source, *dest; - source = SLOT(oldsolabel); + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); dest = SLOT(newsopeerlabel); - biba_copy_effective(source, dest); + SOCK_LOCK(newso); + biba_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_lomac/mac_lomac.c Wed Jun 3 18:46:28 2009 (r193391) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007-2008 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson * Copyright (c) 2001-2005 Networks Associates Technology, Inc. * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. @@ -1315,6 +1315,8 @@ lomac_inpcb_sosetlabel(struct socket *so { struct mac_lomac *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(solabel); dest = SLOT(inplabel); @@ -1930,6 +1932,7 @@ lomac_socket_check_deliver(struct socket struct mbuf *m, struct label *mlabel) { struct mac_lomac *p, *s; + int error; if (!lomac_enabled) return (0); @@ -1937,7 +1940,10 @@ lomac_socket_check_deliver(struct socket p = SLOT(mlabel); s = SLOT(solabel); - return (lomac_equal_single(p, s) ? 0 : EACCES); + SOCK_LOCK(so); + error = lomac_equal_single(p, s) ? 0 : EACCES; + SOCK_UNLOCK(so); + return (error); } static int @@ -1947,6 +1953,8 @@ lomac_socket_check_relabel(struct ucred struct mac_lomac *subj, *obj, *new; int error; + SOCK_LOCK_ASSERT(so); + new = SLOT(newlabel); subj = SLOT(cred->cr_label); obj = SLOT(solabel); @@ -2003,8 +2011,12 @@ lomac_socket_check_visible(struct ucred subj = SLOT(cred->cr_label); obj = SLOT(solabel); - if (!lomac_dominate_single(obj, subj)) + SOCK_LOCK(so); + if (!lomac_dominate_single(obj, subj)) { + SOCK_UNLOCK(so); return (ENOENT); + } + SOCK_UNLOCK(so); return (0); } @@ -2030,19 +2042,26 @@ lomac_socket_create_mbuf(struct socket * source = SLOT(solabel); dest = SLOT(mlabel); + SOCK_LOCK(so); lomac_copy_single(source, dest); + SOCK_UNLOCK(so); } static void lomac_socket_newconn(struct socket *oldso, struct label *oldsolabel, struct socket *newso, struct label *newsolabel) { - struct mac_lomac *source, *dest; + struct mac_lomac source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsolabel); - lomac_copy_single(source, dest); + SOCK_LOCK(newso); + lomac_copy_single(&source, dest); + SOCK_UNLOCK(newso); } static void @@ -2051,6 +2070,8 @@ lomac_socket_relabel(struct ucred *cred, { struct mac_lomac *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(newlabel); dest = SLOT(solabel); @@ -2066,7 +2087,9 @@ lomac_socketpeer_set_from_mbuf(struct mb source = SLOT(mlabel); dest = SLOT(sopeerlabel); + SOCK_LOCK(so); lomac_copy_single(source, dest); + SOCK_UNLOCK(so); } static void @@ -2074,12 +2097,17 @@ lomac_socketpeer_set_from_socket(struct struct label *oldsolabel, struct socket *newso, struct label *newsopeerlabel) { - struct mac_lomac *source, *dest; + struct mac_lomac source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsopeerlabel); - lomac_copy_single(source, dest); + SOCK_LOCK(newso); + lomac_copy_single(&source, dest); + SOCK_UNLOCK(newso); } static void Modified: head/sys/security/mac_mls/mac_mls.c ============================================================================== --- head/sys/security/mac_mls/mac_mls.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_mls/mac_mls.c Wed Jun 3 18:46:28 2009 (r193391) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007-2008 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson * Copyright (c) 2001-2005 McAfee, Inc. * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. @@ -1116,6 +1116,8 @@ mls_inpcb_sosetlabel(struct socket *so, { struct mac_mls *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(solabel); dest = SLOT(inplabel); @@ -1623,6 +1625,7 @@ mls_socket_check_deliver(struct socket * struct mbuf *m, struct label *mlabel) { struct mac_mls *p, *s; + int error; if (!mls_enabled) return (0); @@ -1630,7 +1633,11 @@ mls_socket_check_deliver(struct socket * p = SLOT(mlabel); s = SLOT(solabel); - return (mls_equal_effective(p, s) ? 0 : EACCES); + SOCK_LOCK(so); + error = mls_equal_effective(p, s) ? 0 : EACCES; + SOCK_UNLOCK(so); + + return (error); } static int @@ -1640,6 +1647,8 @@ mls_socket_check_relabel(struct ucred *c struct mac_mls *subj, *obj, *new; int error; + SOCK_LOCK_ASSERT(so); + new = SLOT(newlabel); subj = SLOT(cred->cr_label); obj = SLOT(solabel); @@ -1696,8 +1705,12 @@ mls_socket_check_visible(struct ucred *c subj = SLOT(cred->cr_label); obj = SLOT(solabel); - if (!mls_dominate_effective(subj, obj)) + SOCK_LOCK(so); + if (!mls_dominate_effective(subj, obj)) { + SOCK_UNLOCK(so); return (ENOENT); + } + SOCK_UNLOCK(so); return (0); } @@ -1723,19 +1736,26 @@ mls_socket_create_mbuf(struct socket *so source = SLOT(solabel); dest = SLOT(mlabel); + SOCK_LOCK(so); mls_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void mls_socket_newconn(struct socket *oldso, struct label *oldsolabel, struct socket *newso, struct label *newsolabel) { - struct mac_mls *source, *dest; + struct mac_mls source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsolabel); - mls_copy_effective(source, dest); + SOCK_LOCK(newso); + mls_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void @@ -1744,6 +1764,8 @@ mls_socket_relabel(struct ucred *cred, s { struct mac_mls *source, *dest; + SOCK_LOCK_ASSERT(so); + source = SLOT(newlabel); dest = SLOT(solabel); @@ -1759,7 +1781,9 @@ mls_socketpeer_set_from_mbuf(struct mbuf source = SLOT(mlabel); dest = SLOT(sopeerlabel); + SOCK_LOCK(so); mls_copy_effective(source, dest); + SOCK_UNLOCK(so); } static void @@ -1767,12 +1791,17 @@ mls_socketpeer_set_from_socket(struct so struct label *oldsolabel, struct socket *newso, struct label *newsopeerlabel) { - struct mac_mls *source, *dest; + struct mac_mls source, *dest; + + SOCK_LOCK(oldso); + source = *SLOT(oldsolabel); + SOCK_UNLOCK(oldso); - source = SLOT(oldsolabel); dest = SLOT(newsopeerlabel); - mls_copy_effective(source, dest); + SOCK_LOCK(newso); + mls_copy_effective(&source, dest); + SOCK_UNLOCK(newso); } static void Modified: head/sys/security/mac_stub/mac_stub.c ============================================================================== --- head/sys/security/mac_stub/mac_stub.c Wed Jun 3 17:30:10 2009 (r193390) +++ head/sys/security/mac_stub/mac_stub.c Wed Jun 3 18:46:28 2009 (r193391) @@ -413,6 +413,8 @@ stub_inpcb_sosetlabel(struct socket *so, struct inpcb *inp, struct label *inplabel) { + SOCK_LOCK_ASSERT(so); + } static void @@ -809,6 +811,11 @@ stub_socket_check_accept(struct ucred *c struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -817,6 +824,11 @@ stub_socket_check_bind(struct ucred *cre struct label *solabel, struct sockaddr *sa) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -825,6 +837,11 @@ stub_socket_check_connect(struct ucred * struct label *solabel, struct sockaddr *sa) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -840,6 +857,11 @@ stub_socket_check_deliver(struct socket struct mbuf *m, struct label *mlabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -848,6 +870,11 @@ stub_socket_check_listen(struct ucred *c struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -856,6 +883,11 @@ stub_socket_check_poll(struct ucred *cre struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -864,6 +896,11 @@ stub_socket_check_receive(struct ucred * struct label *solabel) { +#if 0 + SOCK_LOCK(so); + SOCK_UNLOCK(so); +#endif + return (0); } @@ -872,6 +909,8 @@ stub_socket_check_relabel(struct ucred * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From marius at FreeBSD.org Wed Jun 3 19:31:27 2009 From: marius at FreeBSD.org (Marius Strobl) Date: Wed Jun 3 19:31:34 2009 Subject: svn commit: r193392 - head/sys/sun4v/include Message-ID: <200906031931.n53JVQhG063871@svn.freebsd.org> Author: marius Date: Wed Jun 3 19:31:26 2009 New Revision: 193392 URL: http://svn.freebsd.org/changeset/base/193392 Log: Adjust the padding of struct pcpu to r193219. Submitted by: Eygene Ryabinkin Modified: head/sys/sun4v/include/pcpu.h Modified: head/sys/sun4v/include/pcpu.h ============================================================================== --- head/sys/sun4v/include/pcpu.h Wed Jun 3 18:46:28 2009 (r193391) +++ head/sys/sun4v/include/pcpu.h Wed Jun 3 19:31:26 2009 (r193392) @@ -39,9 +39,9 @@ struct pmap; #ifdef KTR -#define PCPU_MD_FIELDS_PAD (4 - (PCPU_NAME_LEN + 7) / 8) +#define PCPU_MD_FIELDS_PAD (3 - (PCPU_NAME_LEN + 7) / 8) #else -#define PCPU_MD_FIELDS_PAD 4 +#define PCPU_MD_FIELDS_PAD 3 #endif /* From rwatson at FreeBSD.org Wed Jun 3 19:41:13 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Wed Jun 3 19:41:25 2009 Subject: svn commit: r193393 - head/sys/security/mac Message-ID: <200906031941.n53JfDS1064282@svn.freebsd.org> Author: rwatson Date: Wed Jun 3 19:41:12 2009 New Revision: 193393 URL: http://svn.freebsd.org/changeset/base/193393 Log: Add one further check with mac_policy_count to an mbuf copying case (limited to netatalk) to avoid MAC label lookup on both mbufs if no policies are registered. Obtained from: TrustedBSD Project Modified: head/sys/security/mac/mac_net.c Modified: head/sys/security/mac/mac_net.c ============================================================================== --- head/sys/security/mac/mac_net.c Wed Jun 3 19:31:26 2009 (r193392) +++ head/sys/security/mac/mac_net.c Wed Jun 3 19:41:12 2009 (r193393) @@ -258,6 +258,9 @@ mac_mbuf_copy(struct mbuf *m_from, struc { struct label *src_label, *dest_label; + if (mac_policy_count == 0) + return; + src_label = mac_mbuf_to_label(m_from); dest_label = mac_mbuf_to_label(m_to); From jhb at FreeBSD.org Wed Jun 3 20:25:14 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Wed Jun 3 20:25:25 2009 Subject: svn commit: r193396 - head/sys/dev/iir Message-ID: <200906032025.n53KPE5L065491@svn.freebsd.org> Author: jhb Date: Wed Jun 3 20:25:13 2009 New Revision: 193396 URL: http://svn.freebsd.org/changeset/base/193396 Log: Remove unused VM includes. Modified: head/sys/dev/iir/iir.c head/sys/dev/iir/iir_ctrl.c Modified: head/sys/dev/iir/iir.c ============================================================================== --- head/sys/dev/iir/iir.c Wed Jun 3 20:24:28 2009 (r193395) +++ head/sys/dev/iir/iir.c Wed Jun 3 20:25:13 2009 (r193396) @@ -67,9 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include MALLOC_DEFINE(M_GDTBUF, "iirbuf", "iir driver buffer"); Modified: head/sys/dev/iir/iir_ctrl.c ============================================================================== --- head/sys/dev/iir/iir_ctrl.c Wed Jun 3 20:24:28 2009 (r193395) +++ head/sys/dev/iir/iir_ctrl.c Wed Jun 3 20:25:13 2009 (r193396) @@ -52,10 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #include From pjd at FreeBSD.org Wed Jun 3 21:06:58 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Wed Jun 3 21:07:13 2009 Subject: svn commit: r193375 - head/sys/ufs/ufs In-Reply-To: <200906030944.n539iM2K045164@svn.freebsd.org> References: <200906030944.n539iM2K045164@svn.freebsd.org> Message-ID: <20090603210652.GD3821@garage.freebsd.pl> On Wed, Jun 03, 2009 at 09:44:22AM +0000, Sean Nicholas Barkas wrote: > Author: snb > Date: Wed Jun 3 09:44:22 2009 > New Revision: 193375 > URL: http://svn.freebsd.org/changeset/base/193375 > > Log: > Add vm_lowmem event handler for dirhash. This will cause dirhashes to be > deleted when the system is low on memory. This ought to allow an increase to > vfs.ufs.dirhash_maxmem on machines that have lots of memory, without > degrading performance by having too much memory reserved for dirhash when > other things need it. The default value for dirhash_maxmem is being kept at > 2MB for now, though. > > This work was mostly done during the 2008 Google Summer of Code. > > Approved by: dwmalone (mentor), re > MFC after: 3 months [...] > +static int > +ufsdirhash_destroy(struct dirhash *dh) > +{ [...] > + /* Remove it from the list and detach its memory. */ > + TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); [...] > +static void > +ufsdirhash_lowmem() > +{ [...] > + /* > + * Delete dirhashes not used for more than ufs_dirhashreclaimage > + * seconds. If we can't get a lock on the dirhash, it will be skipped. > + */ > + for (dh = TAILQ_FIRST(&ufsdirhash_list); dh != NULL; dh = > + TAILQ_NEXT(dh, dh_list)) { > + if (!sx_try_xlock(&dh->dh_lock)) > + continue; > + if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) > + memfreed += ufsdirhash_destroy(dh); > + /* Unlock if we didn't delete the dirhash */ > + else > + ufsdirhash_release(dh); > + } > + > + /* > + * If not enough memory was freed, keep deleting hashes from the head > + * of the dirhash list. The ones closest to the head should be the > + * oldest. > + */ > + for (dh = TAILQ_FIRST(&ufsdirhash_list); memfreed < memwanted && > + dh !=NULL; dh = TAILQ_NEXT(dh, dh_list)) { > + if (!sx_try_xlock(&dh->dh_lock)) > + continue; > + memfreed += ufsdirhash_destroy(dh); > + } > + DIRHASHLIST_UNLOCK(); > +} I don't see how that works. If you remove dh from the tailq in ufsdirhash_destroy(), you can't do 'dh = TAILQ_NEXT(dh, dh_list)' at the end of the loop. You should use TAILQ_FOREACH_SAFE(3). In the second case you also need to move this extra check into the loop, probably. In addition you drop DIRHASHLIST lock in ufsdirhash_destroy() during the loop. Can't the tailq be modified from elsewhere? Or even from parallel call to ufsdirhash_lowmem() (I don't think we serialize those)? -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090603/76ad5ef7/attachment.pgp From rmacklem at FreeBSD.org Wed Jun 3 21:50:27 2009 From: rmacklem at FreeBSD.org (Rick Macklem) Date: Wed Jun 3 21:50:33 2009 Subject: svn commit: r193407 - head/usr.sbin/nfsd Message-ID: <200906032150.n53LoQ50068067@svn.freebsd.org> Author: rmacklem Date: Wed Jun 3 21:50:26 2009 New Revision: 193407 URL: http://svn.freebsd.org/changeset/base/193407 Log: Re-format the nfsv4.4 man page so that all sentences start on a new line. Approved by: kib (mentor) Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Wed Jun 3 21:47:13 2009 (r193406) +++ head/usr.sbin/nfsd/nfsv4.4 Wed Jun 3 21:50:26 2009 (r193407) @@ -38,14 +38,16 @@ The experimental nfs client and server p specification; see .%T "Network File System (NFS) Version 4 Protocol \\*(tNRFC\\*(sP 3530" . The protocol is somewhat similar to NFS Version 3, but differs in significant -ways. It uses a single Compound RPC that concatenates operations to-gether. +ways. +It uses a single Compound RPC that concatenates operations to-gether. Each of these operations are similar to the RPCs of NFS Version 3. The operations in the compound are performed in order, until one of them fails (returns an error) and then the RPC terminates at that point. .Pp It has integrated locking support, which implies that the server is no longer -stateless. As such, the +stateless. +As such, the .Tn NFSv4 server remains in recovery mode for a Grace period (always greater than the lease duration the server uses) after a reboot. @@ -53,7 +55,8 @@ During this Grace period, clients may re open/lock state changing operations. To provide for correct recovery semantics, a small file described by .Xr stablerestart 5 -is used by the server during the recovery phase. If this file is missing, +is used by the server during the recovery phase. +If this file is missing, the server will not start. If this file is lost, it should be recovered from backups, since creating an empty @@ -91,7 +94,8 @@ The allows a limited subset of operations to be performed on non-exported subtrees of the local file system, so that traversal of the tree to the exported subtrees is possible. -As such, the ``'' can be in a non-exported file system. However, +As such, the ``'' can be in a non-exported file system. +However, the entire tree that is rooted at that point must be in local file systems that are of types that can be NFS exported. Since the @@ -106,7 +110,8 @@ multiple server file systems, although n this. .Pp .Nm -uses names for users and groups instead of numbers. On the wire, they +uses names for users and groups instead of numbers. +On the wire, they take the form: .sp .Bd -literal -offset indent -compact @@ -114,10 +119,12 @@ take the form: .Ed .sp where ``'' is not the same as the DNS domain used -for host name lookups, but is usually set to the same string. Most systems set this ``'' +for host name lookups, but is usually set to the same string. +Most systems set this ``'' to the domain name part of the machine's .Xr hostname 1 -by default. However, this can normally be overridden by a command line +by default. +However, this can normally be overridden by a command line option or configuration file for the daemon used to do the name<->number mapping. On FreeBSD, the mapping daemon is called @@ -200,8 +207,10 @@ variables that you can change, which mig .Bl -tag -width Ds .It Cm vfs.newnfs.issue_delegations when set non-zero, allows the server to issue Open Delegations to -clients. These delegations permit the client to manipulate the file -locally on the client. Unfortunately, at this time, client use of +clients. +These delegations permit the client to manipulate the file +locally on the client. +Unfortunately, at this time, client use of delegations is limited, so performance gains may not be observed. This can only be enabled when the file systems being exported to .Nm @@ -304,6 +313,7 @@ NFS V4 stable restart file .Xr nfsuserd 8 .Sh BUGS At this time, there is no recall of delegations for local file system -operations. As such, delegations should only be enabled for file systems +operations. +As such, delegations should only be enabled for file systems that are being used soley as NFS export volumes and are not being accessed via local system calls nor services such as Samba. From ache at nagual.pp.ru Wed Jun 3 23:01:15 2009 From: ache at nagual.pp.ru (Andrey Chernov) Date: Wed Jun 3 23:01:43 2009 Subject: svn commit: r192486 - head/usr.bin/perror In-Reply-To: <200905202219.n4KMJMT9045802@svn.freebsd.org> References: <200905202219.n4KMJMT9045802@svn.freebsd.org> Message-ID: <20090603224408.GA84437@nagual.pp.ru> In the light of localized strerror() messages more interesting utility will be just duing backwards, i.e. to find error number and English explaination using given localized diagnostic. IMHO this functionality can be insterted into perror(1) additionally. -- http://ache.pp.ru/ From sam at FreeBSD.org Wed Jun 3 23:30:26 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Wed Jun 3 23:30:32 2009 Subject: svn commit: r193413 - head/sys/net80211 Message-ID: <200906032330.n53NUQFb070418@svn.freebsd.org> Author: sam Date: Wed Jun 3 23:30:25 2009 New Revision: 193413 URL: http://svn.freebsd.org/changeset/base/193413 Log: After a channel switch mark associated stations so they will immediately be probed as inactive; this more quickly weeds out stations that don't follow to the new channel. Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:28:22 2009 (r193412) +++ head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:30:25 2009 (r193413) @@ -114,6 +114,19 @@ sta_disassoc(void *arg, struct ieee80211 } } +static void +sta_csa(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni->ni_associd != 0) + if (ni->ni_inact > vap->iv_inact_init) { + ni->ni_inact = vap->iv_inact_init; + IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, + "%s: inact %u", __func__, ni->ni_inact); + } +} + /* * IEEE80211_M_HOSTAP vap state machine handler. */ @@ -249,6 +262,11 @@ hostap_newstate(struct ieee80211vap *vap /* fall thru... */ case IEEE80211_S_CSA: /* + * Shorten inactivity timer of associated stations + * to weed out sta's that don't follow a CSA. + */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_csa, vap); + /* * Update bss node channel to reflect where * we landed after CSA. */ From sam at FreeBSD.org Wed Jun 3 23:33:10 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Wed Jun 3 23:33:17 2009 Subject: svn commit: r193414 - head/sys/net80211 Message-ID: <200906032333.n53NX9C8070512@svn.freebsd.org> Author: sam Date: Wed Jun 3 23:33:09 2009 New Revision: 193414 URL: http://svn.freebsd.org/changeset/base/193414 Log: When a channel switch is done to a channel with different operating characteristics force the stations to re-associate so protocol state is re-initialized. Note that for 11h/DFS this is irrelevant as channel changes are never cross-band. Reviewed by: ctlaw Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:30:25 2009 (r193413) +++ head/sys/net80211/ieee80211_hostap.c Wed Jun 3 23:33:09 2009 (r193414) @@ -127,6 +127,28 @@ sta_csa(void *arg, struct ieee80211_node } } +static void +sta_drop(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni->ni_associd != 0) + ieee80211_node_leave(ni); +} + +/* + * Does a channel change require associated stations to re-associate + * so protocol state is correct. This is used when doing CSA across + * bands or similar (e.g. HT -> legacy). + */ +static int +isbandchange(struct ieee80211com *ic) +{ + return ((ic->ic_bsschan->ic_flags ^ ic->ic_csa_newchan->ic_flags) & + (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HALF | + IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HT)) != 0; +} + /* * IEEE80211_M_HOSTAP vap state machine handler. */ @@ -307,6 +329,18 @@ hostap_newstate(struct ieee80211vap *vap } ieee80211_node_authorize(vap->iv_bss); break; + case IEEE80211_S_CSA: + if (ostate == IEEE80211_S_RUN && isbandchange(ic)) { + /* + * On a ``band change'' silently drop associated + * stations as they must re-associate before they + * can pass traffic (as otherwise protocol state + * such as capabilities and the negotiated rate + * set may/will be wrong). + */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_drop, vap); + } + break; default: break; } From weongyo at FreeBSD.org Thu Jun 4 01:55:14 2009 From: weongyo at FreeBSD.org (Weongyo Jeong) Date: Thu Jun 4 01:55:25 2009 Subject: svn commit: r193419 - head/sys/dev/usb/wlan Message-ID: <200906040155.n541tDQg073391@svn.freebsd.org> Author: weongyo Date: Thu Jun 4 01:55:13 2009 New Revision: 193419 URL: http://svn.freebsd.org/changeset/base/193419 Log: cleanups the device match list. Modified: head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 01:45:40 2009 (r193418) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 01:55:13 2009 (r193419) @@ -204,55 +204,59 @@ static const struct zyd_phy_pair zyd_def #define ZYD_ZD1211 0 #define ZYD_ZD1211B 1 +#define ZYD_ZD1211_DEV(v,p) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211) } +#define ZYD_ZD1211B_DEV(v,p) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211B) } static const struct usb_device_id zyd_devs[] = { - /* ZYD_ZD1211 */ - {USB_VPI(USB_VENDOR_3COM2, USB_PRODUCT_3COM2_3CRUSB10075, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_WL54, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_WL159G, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_CYBERTAN, USB_PRODUCT_CYBERTAN_TG54USB, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_DRAYTEK, USB_PRODUCT_DRAYTEK_VIGOR550, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54GD, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54GZL, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX3, USB_PRODUCT_PLANEX3_GWUS54GZ, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_PLANEX3, USB_PRODUCT_PLANEX3_GWUS54MINI, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SAGEM, USB_PRODUCT_SAGEM_XG760A, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SENAO, USB_PRODUCT_SENAO_NUB8301, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_SWEEX, USB_PRODUCT_SWEEX_ZD1211, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TEKRAM, USB_PRODUCT_TEKRAM_QUICKWLAN, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TEKRAM, USB_PRODUCT_TEKRAM_ZD1211_1, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TEKRAM, USB_PRODUCT_TEKRAM_ZD1211_2, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_TWINMOS, USB_PRODUCT_TWINMOS_G240, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_ALL0298V2, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB_A, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_UR055G, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZCOM, USB_PRODUCT_ZCOM_ZD1211, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYDAS, USB_PRODUCT_ZYDAS_ZD1211, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_AG225H, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_ZYAIRG220, ZYD_ZD1211)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G200V2, ZYD_ZD1211)}, - /* ZYD_ZD1211B */ - {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_SMCWUSBG, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_A9T_WIFI, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D7050_V4000, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSBF54G, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_FIBERLINE, USB_PRODUCT_FIBERLINE_WL430U, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_KG54L, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_SNU5600, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GW_US54GXS, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_SAGEM, USB_PRODUCT_SAGEM_XG76NA, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UBC1, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_USR, USB_PRODUCT_USR_USR5423, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_VTECH, USB_PRODUCT_VTECH_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZCOM, USB_PRODUCT_ZCOM_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYDAS, USB_PRODUCT_ZYDAS_ZD1211B, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_M202, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G202, ZYD_ZD1211B)}, - {USB_VPI(USB_VENDOR_ZYXEL, USB_PRODUCT_ZYXEL_G220V2, ZYD_ZD1211B)}, + /* ZYD_ZD1211 */ + ZYD_ZD1211_DEV(3COM2, 3CRUSB10075), + ZYD_ZD1211_DEV(ABOCOM, WL54), + ZYD_ZD1211_DEV(ASUS, WL159G), + ZYD_ZD1211_DEV(CYBERTAN, TG54USB), + ZYD_ZD1211_DEV(DRAYTEK, VIGOR550), + ZYD_ZD1211_DEV(PLANEX2, GWUS54GD), + ZYD_ZD1211_DEV(PLANEX2, GWUS54GZL), + ZYD_ZD1211_DEV(PLANEX3, GWUS54GZ), + ZYD_ZD1211_DEV(PLANEX3, GWUS54MINI), + ZYD_ZD1211_DEV(SAGEM, XG760A), + ZYD_ZD1211_DEV(SENAO, NUB8301), + ZYD_ZD1211_DEV(SITECOMEU, WL113), + ZYD_ZD1211_DEV(SWEEX, ZD1211), + ZYD_ZD1211_DEV(TEKRAM, QUICKWLAN), + ZYD_ZD1211_DEV(TEKRAM, ZD1211_1), + ZYD_ZD1211_DEV(TEKRAM, ZD1211_2), + ZYD_ZD1211_DEV(TWINMOS, G240), + ZYD_ZD1211_DEV(UMEDIA, ALL0298V2), + ZYD_ZD1211_DEV(UMEDIA, TEW429UB_A), + ZYD_ZD1211_DEV(UMEDIA, TEW429UB), + ZYD_ZD1211_DEV(WISTRONNEWEB, UR055G), + ZYD_ZD1211_DEV(ZCOM, ZD1211), + ZYD_ZD1211_DEV(ZYDAS, ZD1211), + ZYD_ZD1211_DEV(ZYXEL, AG225H), + ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), + ZYD_ZD1211_DEV(ZYXEL, G200V2), + /* ZYD_ZD1211B */ + ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), + ZYD_ZD1211B_DEV(ACCTON, ZD1211B), + ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), + ZYD_ZD1211B_DEV(BELKIN, F5D7050_V4000), + ZYD_ZD1211B_DEV(BELKIN, ZD1211B), + ZYD_ZD1211B_DEV(CISCOLINKSYS, WUSBF54G), + ZYD_ZD1211B_DEV(FIBERLINE, WL430U), + ZYD_ZD1211B_DEV(MELCO, KG54L), + ZYD_ZD1211B_DEV(PHILIPS, SNU5600), + ZYD_ZD1211B_DEV(PLANEX2, GW_US54GXS), + ZYD_ZD1211B_DEV(SAGEM, XG76NA), + ZYD_ZD1211B_DEV(SITECOMEU, ZD1211B), + ZYD_ZD1211B_DEV(UMEDIA, TEW429UBC1), + ZYD_ZD1211B_DEV(USR, USR5423), + ZYD_ZD1211B_DEV(VTECH, ZD1211B), + ZYD_ZD1211B_DEV(ZCOM, ZD1211B), + ZYD_ZD1211B_DEV(ZYDAS, ZD1211B), + ZYD_ZD1211B_DEV(ZYXEL, M202), + ZYD_ZD1211B_DEV(ZYXEL, G202), + ZYD_ZD1211B_DEV(ZYXEL, G220V2) }; static const struct usb_config zyd_config[ZYD_N_TRANSFER] = { From weongyo at FreeBSD.org Thu Jun 4 02:49:51 2009 From: weongyo at FreeBSD.org (Weongyo Jeong) Date: Thu Jun 4 02:50:04 2009 Subject: svn commit: r193420 - head/sys/dev/usb/wlan Message-ID: <200906040249.n542noRp074779@svn.freebsd.org> Author: weongyo Date: Thu Jun 4 02:49:50 2009 New Revision: 193420 URL: http://svn.freebsd.org/changeset/base/193420 Log: reimplements RF logic for GCT chipset (as known as UW2453) to support ICIDU NI-707503 which is donated by Nick Hibma (great thanks!). Though it has a MAXIM RF (0x8) there's some success reports with using GCT RF (0x9) codes and it worked well for ICIDU NI-707503 too. So codes for MAXIM and GCT RFs are integrated. Before this commit, if I rememeber correctly, MAXIM RF is never tested that it seems it's a first report working with FreeBSD. Modified: head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 01:55:13 2009 (r193419) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Jun 4 02:49:50 2009 (r193420) @@ -190,9 +190,10 @@ static int zyd_al2210_set_channel(struct static int zyd_gct_init(struct zyd_rf *); static int zyd_gct_switch_radio(struct zyd_rf *, int); static int zyd_gct_set_channel(struct zyd_rf *, uint8_t); -static int zyd_maxim_init(struct zyd_rf *); -static int zyd_maxim_switch_radio(struct zyd_rf *, int); -static int zyd_maxim_set_channel(struct zyd_rf *, uint8_t); +static int zyd_gct_mode(struct zyd_rf *); +static int zyd_gct_set_channel_synth(struct zyd_rf *, int, int); +static int zyd_gct_write(struct zyd_rf *, uint16_t); +static int zyd_gct_txgain(struct zyd_rf *, uint8_t); static int zyd_maxim2_init(struct zyd_rf *); static int zyd_maxim2_switch_radio(struct zyd_rf *, int); static int zyd_maxim2_set_channel(struct zyd_rf *, uint8_t); @@ -1421,11 +1422,14 @@ fail: static int zyd_gct_init(struct zyd_rf *rf) { +#define ZYD_GCT_INTR_REG 0x85c1 #define N(a) (sizeof(a) / sizeof((a)[0])) struct zyd_softc *sc = rf->rf_sc; static const struct zyd_phy_pair phyini[] = ZYD_GCT_PHY; static const uint32_t rfini[] = ZYD_GCT_RF; - int i, error; + static const uint16_t vco[11][7] = ZYD_GCT_VCO; + int i, idx = -1, error; + uint16_t data; /* init RF-dependent PHY registers */ for (i = 0; i < N(phyini); i++) @@ -1436,122 +1440,153 @@ zyd_gct_init(struct zyd_rf *rf) if ((error = zyd_rfwrite(sc, rfini[i])) != 0) return (error); } + + error = zyd_gct_mode(rf); + if (error != 0) + return (error); + + for (i = 0; i < N(vco) - 1; i++) { + error = zyd_gct_set_channel_synth(rf, 1, 0); + if (error != 0) + goto fail; + error = zyd_gct_write(rf, vco[i][0]); + if (error != 0) + goto fail; + zyd_write16_m(sc, ZYD_GCT_INTR_REG, 0xf); + zyd_read16_m(sc, ZYD_GCT_INTR_REG, &data); + if ((data & 0xf) == 0) { + idx = i; + break; + } + } + if (idx == -1) { + error = zyd_gct_set_channel_synth(rf, 1, 1); + if (error != 0) + goto fail; + error = zyd_gct_write(rf, 0x6662); + if (error != 0) + goto fail; + } + + rf->idx = idx; + zyd_write16_m(sc, ZYD_CR203, 0x6); fail: return (error); #undef N +#undef ZYD_GCT_INTR_REG } static int -zyd_gct_switch_radio(struct zyd_rf *rf, int on) +zyd_gct_mode(struct zyd_rf *rf) { - /* vendor driver does nothing for this RF chip */ +#define N(a) (sizeof(a) / sizeof((a)[0])) + struct zyd_softc *sc = rf->rf_sc; + static const uint32_t mode[] = { + 0x25f98, 0x25f9a, 0x25f94, 0x27fd4 + }; + int i, error; - return (0); + for (i = 0; i < N(mode); i++) { + if ((error = zyd_rfwrite(sc, mode[i])) != 0) + break; + } + return (error); +#undef N } static int -zyd_gct_set_channel(struct zyd_rf *rf, uint8_t chan) +zyd_gct_set_channel_synth(struct zyd_rf *rf, int chan, int acal) { - int error; + int error, idx = chan - 1; struct zyd_softc *sc = rf->rf_sc; - static const uint32_t rfprog[] = ZYD_GCT_CHANTABLE; + static uint32_t acal_synth[] = ZYD_GCT_CHANNEL_ACAL; + static uint32_t std_synth[] = ZYD_GCT_CHANNEL_STD; + static uint32_t div_synth[] = ZYD_GCT_CHANNEL_DIV; - error = zyd_rfwrite(sc, 0x1c0000); - if (error != 0) - goto fail; - error = zyd_rfwrite(sc, rfprog[chan - 1]); + error = zyd_rfwrite(sc, + (acal == 1) ? acal_synth[idx] : std_synth[idx]); if (error != 0) - goto fail; - error = zyd_rfwrite(sc, 0x1c0008); -fail: - return (error); + return (error); + return zyd_rfwrite(sc, div_synth[idx]); } -/* - * Maxim RF methods. - */ static int -zyd_maxim_init(struct zyd_rf *rf) +zyd_gct_write(struct zyd_rf *rf, uint16_t value) { -#define N(a) (sizeof(a) / sizeof((a)[0])) struct zyd_softc *sc = rf->rf_sc; - static const struct zyd_phy_pair phyini[] = ZYD_MAXIM_PHY; - static const uint32_t rfini[] = ZYD_MAXIM_RF; - uint16_t tmp; - int i, error; - /* init RF-dependent PHY registers */ - for (i = 0; i < N(phyini); i++) - zyd_write16_m(sc, phyini[i].reg, phyini[i].val); - - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp & ~(1 << 4)); - - /* init maxim radio */ - for (i = 0; i < N(rfini); i++) { - if ((error = zyd_rfwrite(sc, rfini[i])) != 0) - return (error); - } - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp | (1 << 4)); -fail: - return (error); -#undef N + return zyd_rfwrite(sc, 0x300000 | 0x40000 | value); } static int -zyd_maxim_switch_radio(struct zyd_rf *rf, int on) +zyd_gct_switch_radio(struct zyd_rf *rf, int on) { +#define N(a) (sizeof(a) / sizeof((a)[0])) + int error; + struct zyd_softc *sc = rf->rf_sc; - /* vendor driver does nothing for this RF chip */ - return (0); + error = zyd_rfwrite(sc, on ? 0x25f94 : 0x25f90); + if (error != 0) + return (error); + + zyd_write16_m(sc, ZYD_CR11, on ? 0x00 : 0x04); + zyd_write16_m(sc, ZYD_CR251, + on ? ((sc->sc_macrev == ZYD_ZD1211B) ? 0x7f : 0x3f) : 0x2f); +fail: + return (error); } static int -zyd_maxim_set_channel(struct zyd_rf *rf, uint8_t chan) +zyd_gct_set_channel(struct zyd_rf *rf, uint8_t chan) { #define N(a) (sizeof(a) / sizeof((a)[0])) + int error, i; struct zyd_softc *sc = rf->rf_sc; - static const struct zyd_phy_pair phyini[] = ZYD_MAXIM_PHY; - static const uint32_t rfini[] = ZYD_MAXIM_RF; - static const struct { - uint32_t r1, r2; - } rfprog[] = ZYD_MAXIM_CHANTABLE; - uint16_t tmp; - int i, error; - - /* - * Do the same as we do when initializing it, except for the channel - * values coming from the two channel tables. - */ - - /* init RF-dependent PHY registers */ - for (i = 0; i < N(phyini); i++) - zyd_write16_m(sc, phyini[i].reg, phyini[i].val); - - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp & ~(1 << 4)); + static const struct zyd_phy_pair cmd[] = { + { ZYD_CR80, 0x30 }, { ZYD_CR81, 0x30 }, { ZYD_CR79, 0x58 }, + { ZYD_CR12, 0xf0 }, { ZYD_CR77, 0x1b }, { ZYD_CR78, 0x58 }, + }; + static const uint16_t vco[11][7] = ZYD_GCT_VCO; - /* first two values taken from the chantables */ - error = zyd_rfwrite(sc, rfprog[chan - 1].r1); + error = zyd_gct_set_channel_synth(rf, chan, 0); if (error != 0) goto fail; - error = zyd_rfwrite(sc, rfprog[chan - 1].r2); + error = zyd_gct_write(rf, (rf->idx == -1) ? 0x6662 : + vco[rf->idx][((chan - 1) / 2)]); if (error != 0) goto fail; - - /* init maxim radio - skipping the two first values */ - for (i = 2; i < N(rfini); i++) { - if ((error = zyd_rfwrite(sc, rfini[i])) != 0) - return (error); - } - zyd_read16_m(sc, ZYD_CR203, &tmp); - zyd_write16_m(sc, ZYD_CR203, tmp | (1 << 4)); + error = zyd_gct_mode(rf); + if (error != 0) + return (error); + for (i = 0; i < N(cmd); i++) + zyd_write16_m(sc, cmd[i].reg, cmd[i].val); + error = zyd_gct_txgain(rf, chan); + if (error != 0) + return (error); + zyd_write16_m(sc, ZYD_CR203, 0x6); fail: return (error); #undef N } +static int +zyd_gct_txgain(struct zyd_rf *rf, uint8_t chan) +{ +#define N(a) (sizeof(a) / sizeof((a)[0])) + struct zyd_softc *sc = rf->rf_sc; + static uint32_t txgain[] = ZYD_GCT_TXGAIN; + uint8_t idx = sc->sc_pwrint[chan - 1]; + + if (idx >= N(txgain)) { + device_printf(sc->sc_dev, "could not set TX gain (%d %#x)\n", + chan, idx); + return 0; + } + + return zyd_rfwrite(sc, 0x700000 | txgain[idx]); +#undef N +} + /* * Maxim2 RF methods. */ @@ -1643,6 +1678,7 @@ zyd_rf_attach(struct zyd_softc *sc, uint struct zyd_rf *rf = &sc->sc_rf; rf->rf_sc = sc; + rf->update_pwr = 1; switch (type) { case ZYD_RF_RFMD: @@ -1676,17 +1712,13 @@ zyd_rf_attach(struct zyd_softc *sc, uint rf->set_channel = zyd_al2210_set_channel; rf->width = 24; /* 24-bit RF values */ break; + case ZYD_RF_MAXIM_NEW: case ZYD_RF_GCT: rf->init = zyd_gct_init; rf->switch_radio = zyd_gct_switch_radio; rf->set_channel = zyd_gct_set_channel; - rf->width = 21; /* 21-bit RF values */ - break; - case ZYD_RF_MAXIM_NEW: - rf->init = zyd_maxim_init; - rf->switch_radio = zyd_maxim_switch_radio; - rf->set_channel = zyd_maxim_set_channel; - rf->width = 18; /* 18-bit RF values */ + rf->width = 24; /* 24-bit RF values */ + rf->update_pwr = 0; break; case ZYD_RF_MAXIM_NEW2: rf->init = zyd_maxim2_init; @@ -2066,16 +2098,21 @@ zyd_set_chan(struct zyd_softc *sc, struc if (error != 0) goto fail; - /* update Tx power */ - zyd_write16_m(sc, ZYD_CR31, sc->sc_pwrint[chan - 1]); + if (rf->update_pwr) { + /* update Tx power */ + zyd_write16_m(sc, ZYD_CR31, sc->sc_pwrint[chan - 1]); - if (sc->sc_macrev == ZYD_ZD1211B) { - zyd_write16_m(sc, ZYD_CR67, sc->sc_ofdm36_cal[chan - 1]); - zyd_write16_m(sc, ZYD_CR66, sc->sc_ofdm48_cal[chan - 1]); - zyd_write16_m(sc, ZYD_CR65, sc->sc_ofdm54_cal[chan - 1]); - zyd_write16_m(sc, ZYD_CR68, sc->sc_pwrcal[chan - 1]); - zyd_write16_m(sc, ZYD_CR69, 0x28); - zyd_write16_m(sc, ZYD_CR69, 0x2a); + if (sc->sc_macrev == ZYD_ZD1211B) { + zyd_write16_m(sc, ZYD_CR67, + sc->sc_ofdm36_cal[chan - 1]); + zyd_write16_m(sc, ZYD_CR66, + sc->sc_ofdm48_cal[chan - 1]); + zyd_write16_m(sc, ZYD_CR65, + sc->sc_ofdm54_cal[chan - 1]); + zyd_write16_m(sc, ZYD_CR68, sc->sc_pwrcal[chan - 1]); + zyd_write16_m(sc, ZYD_CR69, 0x28); + zyd_write16_m(sc, ZYD_CR69, 0x2a); + } } if (sc->sc_cckgain) { /* set CCK baseband gain from EEPROM */ Modified: head/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_zydreg.h Thu Jun 4 01:55:13 2009 (r193419) +++ head/sys/dev/usb/wlan/if_zydreg.h Thu Jun 4 02:49:50 2009 (r193420) @@ -840,82 +840,75 @@ #define ZYD_GCT_PHY \ { \ - { ZYD_CR47, 0x1e }, { ZYD_CR15, 0xdc }, { ZYD_CR113, 0xc0 }, \ - { ZYD_CR20, 0x0c }, { ZYD_CR17, 0x65 }, { ZYD_CR34, 0x04 }, \ - { ZYD_CR35, 0x35 }, { ZYD_CR24, 0x20 }, { ZYD_CR9, 0xe0 }, \ - { ZYD_CR127, 0x02 }, { ZYD_CR10, 0x91 }, { ZYD_CR23, 0x7f }, \ - { ZYD_CR27, 0x10 }, { ZYD_CR28, 0x7a }, { ZYD_CR79, 0xb5 }, \ - { ZYD_CR64, 0x80 }, { ZYD_CR33, 0x28 }, { ZYD_CR38, 0x30 } \ + { ZYD_CR10, 0x89 }, { ZYD_CR15, 0x20 }, { ZYD_CR17, 0x28 }, \ + { ZYD_CR23, 0x38 }, { ZYD_CR24, 0x20 }, { ZYD_CR26, 0x93 }, \ + { ZYD_CR27, 0x15 }, { ZYD_CR28, 0x3e }, { ZYD_CR29, 0x00 }, \ + { ZYD_CR33, 0x28 }, { ZYD_CR34, 0x30 }, { ZYD_CR35, 0x43 }, \ + { ZYD_CR41, 0x24 }, { ZYD_CR44, 0x32 }, { ZYD_CR46, 0x92 }, \ + { ZYD_CR47, 0x1e }, { ZYD_CR48, 0x04 }, { ZYD_CR49, 0xfa }, \ + { ZYD_CR79, 0x58 }, { ZYD_CR80, 0x30 }, { ZYD_CR81, 0x30 }, \ + { ZYD_CR87, 0x0a }, { ZYD_CR89, 0x04 }, { ZYD_CR91, 0x00 }, \ + { ZYD_CR92, 0x0a }, { ZYD_CR98, 0x8d }, { ZYD_CR99, 0x28 }, \ + { ZYD_CR100, 0x02 }, { ZYD_CR101, 0x09 }, { ZYD_CR102, 0x27 }, \ + { ZYD_CR106, 0x1c }, { ZYD_CR107, 0x1c }, { ZYD_CR109, 0x13 }, \ + { ZYD_CR110, 0x1f }, { ZYD_CR111, 0x13 }, { ZYD_CR112, 0x1f }, \ + { ZYD_CR113, 0x27 }, { ZYD_CR114, 0x23 }, { ZYD_CR115, 0x24 }, \ + { ZYD_CR116, 0x24 }, { ZYD_CR117, 0xfa }, { ZYD_CR118, 0xf0 }, \ + { ZYD_CR119, 0x1a }, { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x1f }, \ + { ZYD_CR122, 0xf0 }, { ZYD_CR123, 0x57 }, { ZYD_CR125, 0xad }, \ + { ZYD_CR126, 0x6c }, { ZYD_CR127, 0x03 }, { ZYD_CR128, 0x14 }, \ + { ZYD_CR129, 0x12 }, { ZYD_CR130, 0x10 }, { ZYD_CR137, 0x50 }, \ + { ZYD_CR138, 0xa8 }, { ZYD_CR144, 0xac }, { ZYD_CR146, 0x20 }, \ + { ZYD_CR252, 0xff }, { ZYD_CR253, 0xff } \ } #define ZYD_GCT_RF \ { \ - 0x1f0000, 0x1f0000, 0x1f0200, 0x1f0600, 0x1f8600, 0x1f8600, \ - 0x002050, 0x1f8000, 0x1f8200, 0x1f8600, 0x1c0000, 0x10c458, \ - 0x088e92, 0x187b82, 0x0401b4, 0x140816, 0x0c7000, 0x1c0000, \ - 0x02ccae, 0x128023, 0x0a0000, 0x1a0000, 0x06e380, 0x16cb94, \ - 0x0e1740, 0x014980, 0x116240, 0x090000, 0x192304, 0x05112f, \ - 0x0d54a8, 0x0f8000, 0x1c0008, 0x1c0000, 0x1a0000, 0x1c0008, \ - 0x150000, 0x0c7000, 0x150800, 0x150000 \ + 0x40002b, 0x519e4f, 0x6f81ad, 0x73fffe, 0x25f9c, 0x100047, \ + 0x200999, 0x307602, 0x346063, \ } -#define ZYD_GCT_CHANTABLE \ +#define ZYD_GCT_VCO \ { \ - 0x1a0000, 0x1a8000, 0x1a4000, 0x1ac000, 0x1a2000, 0x1aa000, \ - 0x1a6000, 0x1ae000, 0x1a1000, 0x1a9000, 0x1a5000, 0x1ad000, \ - 0x1a3000, 0x1ab000 \ + { 0x664d, 0x604d, 0x6675, 0x6475, 0x6655, 0x6455, 0x6665 }, \ + { 0x666d, 0x606d, 0x664d, 0x644d, 0x6675, 0x6475, 0x6655 }, \ + { 0x665d, 0x605d, 0x666d, 0x646d, 0x664d, 0x644d, 0x6675 }, \ + { 0x667d, 0x607d, 0x665d, 0x645d, 0x666d, 0x646d, 0x664d }, \ + { 0x6643, 0x6043, 0x667d, 0x647d, 0x665d, 0x645d, 0x666d }, \ + { 0x6663, 0x6063, 0x6643, 0x6443, 0x667d, 0x647d, 0x665d }, \ + { 0x6653, 0x6053, 0x6663, 0x6463, 0x6643, 0x6443, 0x667d }, \ + { 0x6673, 0x6073, 0x6653, 0x6453, 0x6663, 0x6463, 0x6643 }, \ + { 0x664b, 0x604b, 0x6673, 0x6473, 0x6653, 0x6453, 0x6663 }, \ + { 0x666b, 0x606b, 0x664b, 0x644b, 0x6673, 0x6473, 0x6653 }, \ + { 0x665b, 0x605b, 0x666b, 0x646b, 0x664b, 0x644b, 0x6673 } \ } -#define ZYD_MAXIM_PHY \ +#define ZYD_GCT_TXGAIN \ { \ - { ZYD_CR23, 0x40 }, { ZYD_CR15, 0x20 }, { ZYD_CR28, 0x3e }, \ - { ZYD_CR29, 0x00 }, { ZYD_CR26, 0x11 }, { ZYD_CR44, 0x33 }, \ - { ZYD_CR106, 0x2a }, { ZYD_CR107, 0x1a }, { ZYD_CR109, 0x2b }, \ - { ZYD_CR110, 0x2b }, { ZYD_CR111, 0x2b }, { ZYD_CR112, 0x2b }, \ - { ZYD_CR10, 0x89 }, { ZYD_CR17, 0x20 }, { ZYD_CR26, 0x93 }, \ - { ZYD_CR34, 0x30 }, { ZYD_CR35, 0x40 }, { ZYD_CR41, 0x24 }, \ - { ZYD_CR44, 0x32 }, { ZYD_CR46, 0x90 }, { ZYD_CR89, 0x18 }, \ - { ZYD_CR92, 0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 }, \ - { ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x09 }, \ - { ZYD_CR110, 0x13 }, { ZYD_CR111, 0x13 }, { ZYD_CR112, 0x13 }, \ - { ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 }, \ - { ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0xfa }, \ - { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x77 }, { ZYD_CR122, 0xfe }, \ - { ZYD_CR10, 0x89 }, { ZYD_CR17, 0x20 }, { ZYD_CR26, 0x93 }, \ - { ZYD_CR34, 0x30 }, { ZYD_CR35, 0x40 }, { ZYD_CR41, 0x24 }, \ - { ZYD_CR44, 0x32 }, { ZYD_CR46, 0x90 }, { ZYD_CR89, 0x18 }, \ - { ZYD_CR92, 0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 }, \ - { ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x13 }, \ - { ZYD_CR110, 0x27 }, { ZYD_CR111, 0x27 }, { ZYD_CR112, 0x13 }, \ - { ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 }, \ - { ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0x00 }, \ - { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x06 }, { ZYD_CR122, 0xfe }, \ - { ZYD_CR150, 0x0d } \ + 0x0e313, 0x0fb13, 0x0e093, 0x0f893, 0x0ea93, 0x1f093, 0x1f493, \ + 0x1f693, 0x1f393, 0x1f35b, 0x1e6db, 0x1ff3f, 0x1ffff, 0x361d7, \ + 0x37fbf, 0x3ff8b, 0x3ff33, 0x3fb3f, 0x3ffff \ } -#define ZYD_MAXIM_RF \ +#define ZYD_GCT_CHANNEL_ACAL \ { \ - 0x00ccd4, 0x030a03, 0x000400, 0x000ca1, 0x010072, 0x018645, \ - 0x004006, 0x0000a7, 0x008258, 0x003fc9, 0x00040a, 0x00000b, \ - 0x00026c \ + 0x106847, 0x106847, 0x106867, 0x106867, 0x106867, 0x106867, \ + 0x106857, 0x106857, 0x106857, 0x106857, 0x106877, 0x106877, \ + 0x106877, 0x10684f \ } -#define ZYD_MAXIM_CHANTABLE \ -{ \ - { 0x0ccd4, 0x30a03 }, \ - { 0x22224, 0x00a13 }, \ - { 0x37774, 0x10a13 }, \ - { 0x0ccd4, 0x30a13 }, \ - { 0x22224, 0x00a23 }, \ - { 0x37774, 0x10a23 }, \ - { 0x0ccd4, 0x30a23 }, \ - { 0x22224, 0x00a33 }, \ - { 0x37774, 0x10a33 }, \ - { 0x0ccd4, 0x30a33 }, \ - { 0x22224, 0x00a43 }, \ - { 0x37774, 0x10a43 }, \ - { 0x0ccd4, 0x30a43 }, \ - { 0x199a4, 0x20a53 } \ +#define ZYD_GCT_CHANNEL_STD \ +{ \ + 0x100047, 0x100047, 0x100067, 0x100067, 0x100067, 0x100067, \ + 0x100057, 0x100057, 0x100057, 0x100057, 0x100077, 0x100077, \ + 0x100077, 0x10004f \ +} + +#define ZYD_GCT_CHANNEL_DIV \ +{ \ + 0x200999, 0x20099b, 0x200998, 0x20099a, 0x200999, 0x20099b, \ + 0x200998, 0x20099a, 0x200999, 0x20099b, 0x200998, 0x20099a, \ + 0x200999, 0x200ccc \ } #define ZYD_MAXIM2_PHY \ @@ -1226,6 +1219,8 @@ struct zyd_rf { /* RF attributes */ struct zyd_softc *rf_sc; /* back-pointer */ int width; + int idx; /* for GIT RF */ + int update_pwr; }; struct zyd_rq { From weongyo at FreeBSD.org Thu Jun 4 03:59:21 2009 From: weongyo at FreeBSD.org (Weongyo Jeong) Date: Thu Jun 4 03:59:33 2009 Subject: svn commit: r193422 - head/sys/modules/usb/zyd Message-ID: <200906040359.n543xLwb076425@svn.freebsd.org> Author: weongyo Date: Thu Jun 4 03:59:20 2009 New Revision: 193422 URL: http://svn.freebsd.org/changeset/base/193422 Log: add two prerequisites; if_zydreg.h and if_zydfw for dependency check. Modified: head/sys/modules/usb/zyd/Makefile Modified: head/sys/modules/usb/zyd/Makefile ============================================================================== --- head/sys/modules/usb/zyd/Makefile Thu Jun 4 03:18:59 2009 (r193421) +++ head/sys/modules/usb/zyd/Makefile Thu Jun 4 03:59:20 2009 (r193422) @@ -31,6 +31,6 @@ S= ${.CURDIR}/../../.. KMOD= if_zyd SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - if_zyd.c + if_zyd.c if_zydreg.h if_zydfw.h .include From dfr at FreeBSD.org Thu Jun 4 08:13:52 2009 From: dfr at FreeBSD.org (Doug Rabson) Date: Thu Jun 4 08:14:26 2009 Subject: svn commit: r193432 - head/sys/nlm Message-ID: <200906040813.n548DpVT081876@svn.freebsd.org> Author: dfr Date: Thu Jun 4 08:13:51 2009 New Revision: 193432 URL: http://svn.freebsd.org/changeset/base/193432 Log: Don't panic in nlm_record_lock if we get ENOENT from lf_advlockasync. This is likely to be because the file was just removed and in our context this is harmless. Modified: head/sys/nlm/nlm_advlock.c Modified: head/sys/nlm/nlm_advlock.c ============================================================================== --- head/sys/nlm/nlm_advlock.c Thu Jun 4 06:57:50 2009 (r193431) +++ head/sys/nlm/nlm_advlock.c Thu Jun 4 08:13:51 2009 (r193432) @@ -716,8 +716,8 @@ nlm_record_lock(struct vnode *vp, int op newfl.l_sysid = NLM_SYSID_CLIENT | sysid; error = lf_advlockasync(&a, &vp->v_lockf, size); - KASSERT(error == 0, ("Failed to register NFS lock locally - error=%d", - error)); + KASSERT(error == 0 || errno == ENOENT, + ("Failed to register NFS lock locally - error=%d", error)); } static int From rwatson at FreeBSD.org Thu Jun 4 10:30:19 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Thu Jun 4 10:30:25 2009 Subject: svn commit: r193433 - head/sys/fs/devfs Message-ID: <200906041030.n54AUIh4084623@svn.freebsd.org> Author: rwatson Date: Thu Jun 4 10:30:18 2009 New Revision: 193433 URL: http://svn.freebsd.org/changeset/base/193433 Log: Re-add opt_mac.h include, which is required in order for MNT_MULTILABEL to be set properly on devfs. Otherwise, it isn't possible to set labels on /dev nodes. Reported by: Sergio Rodriguez MFC after: 3 days Modified: head/sys/fs/devfs/devfs_vfsops.c Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Thu Jun 4 08:13:51 2009 (r193432) +++ head/sys/fs/devfs/devfs_vfsops.c Thu Jun 4 10:30:18 2009 (r193433) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include "opt_mac.h" /* To set MNT_MULTILABEL. */ + #include #include #include From ed at FreeBSD.org Thu Jun 4 11:22:54 2009 From: ed at FreeBSD.org (Ed Schouten) Date: Thu Jun 4 11:23:06 2009 Subject: svn commit: r193434 - head/sys/nlm Message-ID: <200906041122.n54BMrIP089508@svn.freebsd.org> Author: ed Date: Thu Jun 4 11:22:53 2009 New Revision: 193434 URL: http://svn.freebsd.org/changeset/base/193434 Log: Correct typo; errno => error. Modified: head/sys/nlm/nlm_advlock.c Modified: head/sys/nlm/nlm_advlock.c ============================================================================== --- head/sys/nlm/nlm_advlock.c Thu Jun 4 10:30:18 2009 (r193433) +++ head/sys/nlm/nlm_advlock.c Thu Jun 4 11:22:53 2009 (r193434) @@ -716,7 +716,7 @@ nlm_record_lock(struct vnode *vp, int op newfl.l_sysid = NLM_SYSID_CLIENT | sysid; error = lf_advlockasync(&a, &vp->v_lockf, size); - KASSERT(error == 0 || errno == ENOENT, + KASSERT(error == 0 || error == ENOENT, ("Failed to register NFS lock locally - error=%d", error)); } From adrian at freebsd.org Thu Jun 4 11:37:27 2009 From: adrian at freebsd.org (Adrian Chadd) Date: Thu Jun 4 11:37:33 2009 Subject: svn commit: r193432 - head/sys/nlm In-Reply-To: <200906040813.n548DpVT081876@svn.freebsd.org> References: <200906040813.n548DpVT081876@svn.freebsd.org> Message-ID: This broke the build. errno? adrian 2009/6/4 Doug Rabson : > Author: dfr > Date: Thu Jun ?4 08:13:51 2009 > New Revision: 193432 > URL: http://svn.freebsd.org/changeset/base/193432 > > Log: > ?Don't panic in nlm_record_lock if we get ENOENT from lf_advlockasync. This > ?is likely to be because the file was just removed and in our context this is > ?harmless. > > Modified: > ?head/sys/nlm/nlm_advlock.c > > Modified: head/sys/nlm/nlm_advlock.c > ============================================================================== > --- head/sys/nlm/nlm_advlock.c ?Thu Jun ?4 06:57:50 2009 ? ? ? ?(r193431) > +++ head/sys/nlm/nlm_advlock.c ?Thu Jun ?4 08:13:51 2009 ? ? ? ?(r193432) > @@ -716,8 +716,8 @@ nlm_record_lock(struct vnode *vp, int op > ? ? ? ?newfl.l_sysid = NLM_SYSID_CLIENT | sysid; > > ? ? ? ?error = lf_advlockasync(&a, &vp->v_lockf, size); > - ? ? ? KASSERT(error == 0, ("Failed to register NFS lock locally - error=%d", > - ? ? ? ? ? ? ? error)); > + ? ? ? KASSERT(error == 0 || errno == ENOENT, > + ? ? ? ? ? ("Failed to register NFS lock locally - error=%d", error)); > ?} > > ?static int > From dfr at rabson.org Thu Jun 4 12:03:37 2009 From: dfr at rabson.org (Doug Rabson) Date: Thu Jun 4 12:03:45 2009 Subject: svn commit: r193434 - head/sys/nlm In-Reply-To: <200906041122.n54BMrIP089508@svn.freebsd.org> References: <200906041122.n54BMrIP089508@svn.freebsd.org> Message-ID: <7bed97456290a8e2454188cadae2ff36@mail.rabson.org> On Thu, 4 Jun 2009 11:22:53 +0000 (UTC), Ed Schouten wrote: > Author: ed > Date: Thu Jun 4 11:22:53 2009 > New Revision: 193434 > URL: http://svn.freebsd.org/changeset/base/193434 > > Log: > Correct typo; errno => error. Thanks Ed. Now where did I leave that pointy hat :( From luigi at FreeBSD.org Thu Jun 4 12:27:58 2009 From: luigi at FreeBSD.org (Luigi Rizzo) Date: Thu Jun 4 12:28:10 2009 Subject: svn commit: r193435 - head/sys/netinet Message-ID: <200906041227.n54CRv4p091600@svn.freebsd.org> Author: luigi Date: Thu Jun 4 12:27:57 2009 New Revision: 193435 URL: http://svn.freebsd.org/changeset/base/193435 Log: fix a bug introduced in rev.190865 related to the signedness of the credit of a pipe. On passing, also use explicit signed/unsigned types for two other fields. Noticed by Oleg Bulyzhin and Maxim Ignatenko long ago, i forgot to commit the fix. Does not affect RELENG_7. Modified: head/sys/netinet/ip_dummynet.h Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Thu Jun 4 11:22:53 2009 (r193434) +++ head/sys/netinet/ip_dummynet.h Thu Jun 4 12:27:57 2009 (r193435) @@ -214,8 +214,8 @@ struct dn_flow_queue { * With large bandwidth and large delays, extra_bits (and also numbytes) * can become very large, so better play safe and use 64 bit */ - dn_key numbytes ; /* credit for transmission (dynamic queues) */ - dn_key extra_bits; /* extra bits simulating unavailable channel */ + uint64_t numbytes ; /* credit for transmission (dynamic queues) */ + int64_t extra_bits; /* extra bits simulating unavailable channel */ u_int64_t tot_pkts ; /* statistics counters */ u_int64_t tot_bytes ; @@ -338,7 +338,7 @@ struct dn_pipe { /* a pipe */ int sum; /* sum of weights of all active sessions */ /* Same as in dn_flow_queue, numbytes can become large */ - dn_key numbytes; /* bits I can transmit (more or less). */ + int64_t numbytes; /* bits I can transmit (more or less). */ dn_key sched_time ; /* time pipe was scheduled in ready_heap */ From rmacklem at FreeBSD.org Thu Jun 4 14:13:07 2009 From: rmacklem at FreeBSD.org (Rick Macklem) Date: Thu Jun 4 14:13:14 2009 Subject: svn commit: r193436 - head/sys/rpc Message-ID: <200906041413.n54ED66W094084@svn.freebsd.org> Author: rmacklem Date: Thu Jun 4 14:13:06 2009 New Revision: 193436 URL: http://svn.freebsd.org/changeset/base/193436 Log: Fix two races in the server side krpc w.r.t upcalls: Add a flag so that soupcall_clear() is only called once to cancel an upcall. Move the test for xprt_registered in the upcall down to after the mtx_lock() of the pool mutex, to catch the case where it is unregistered while the upcall is waiting for the mutex. Also, move the mtx_destroy() of the pool mutex to after SVC_RELEASE(), so that it isn't destroyed before the upcalls are disabled. Reviewed by: dfr, jhb Tested by: pho Approved by: kib (mentor) Modified: head/sys/rpc/svc.c head/sys/rpc/svc.h head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Thu Jun 4 12:27:57 2009 (r193435) +++ head/sys/rpc/svc.c Thu Jun 4 14:13:06 2009 (r193436) @@ -175,12 +175,12 @@ svcpool_destroy(SVCPOOL *pool) mtx_lock(&pool->sp_lock); } - mtx_destroy(&pool->sp_lock); - TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { SVC_RELEASE(xprt); } + mtx_destroy(&pool->sp_lock); + if (pool->sp_rcache) replay_freecache(pool->sp_rcache); @@ -353,15 +353,16 @@ xprt_active(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + mtx_lock(&pool->sp_lock); + if (!xprt->xp_registered) { /* * Race with xprt_unregister - we lose. */ + mtx_unlock(&pool->sp_lock); return; } - mtx_lock(&pool->sp_lock); - if (!xprt->xp_active) { TAILQ_INSERT_TAIL(&pool->sp_active, xprt, xp_alink); xprt->xp_active = TRUE; Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Thu Jun 4 12:27:57 2009 (r193435) +++ head/sys/rpc/svc.h Thu Jun 4 14:13:06 2009 (r193436) @@ -166,6 +166,7 @@ typedef struct __rpc_svcxprt { int xp_idletimeout; /* idle time before closing */ time_t xp_lastactive; /* time of last RPC */ u_int64_t xp_sockref; /* set by nfsv4 to identify socket */ + int xp_upcallset; /* socket upcall is set up */ #else int xp_fd; u_short xp_port; /* associated port number */ Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Thu Jun 4 12:27:57 2009 (r193435) +++ head/sys/rpc/svc_vc.c Thu Jun 4 14:13:06 2009 (r193436) @@ -160,6 +160,7 @@ svc_vc_create(SVCPOOL *pool, struct sock solisten(so, SOMAXCONN, curthread); SOCKBUF_LOCK(&so->so_rcv); + xprt->xp_upcallset = 1; soupcall_set(so, SO_RCV, svc_vc_soupcall, xprt); SOCKBUF_UNLOCK(&so->so_rcv); @@ -234,6 +235,7 @@ svc_vc_create_conn(SVCPOOL *pool, struct xprt_register(xprt); SOCKBUF_LOCK(&so->so_rcv); + xprt->xp_upcallset = 1; soupcall_set(so, SO_RCV, svc_vc_soupcall, xprt); SOCKBUF_UNLOCK(&so->so_rcv); @@ -352,7 +354,10 @@ svc_vc_rendezvous_recv(SVCXPRT *xprt, st if (error) { SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); - soupcall_clear(xprt->xp_socket, SO_RCV); + if (xprt->xp_upcallset) { + xprt->xp_upcallset = 0; + soupcall_clear(xprt->xp_socket, SO_RCV); + } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); xprt_inactive(xprt); sx_xunlock(&xprt->xp_lock); @@ -397,7 +402,10 @@ static void svc_vc_destroy_common(SVCXPRT *xprt) { SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); - soupcall_clear(xprt->xp_socket, SO_RCV); + if (xprt->xp_upcallset) { + xprt->xp_upcallset = 0; + soupcall_clear(xprt->xp_socket, SO_RCV); + } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); sx_destroy(&xprt->xp_lock); @@ -632,7 +640,10 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms if (error) { SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); - soupcall_clear(xprt->xp_socket, SO_RCV); + if (xprt->xp_upcallset) { + xprt->xp_upcallset = 0; + soupcall_clear(xprt->xp_socket, SO_RCV); + } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); xprt_inactive(xprt); cd->strm_stat = XPRT_DIED; From rmacklem at FreeBSD.org Thu Jun 4 14:49:28 2009 From: rmacklem at FreeBSD.org (Rick Macklem) Date: Thu Jun 4 14:49:35 2009 Subject: svn commit: r193437 - head/sys/rpc Message-ID: <200906041449.n54EnRNj094949@svn.freebsd.org> Author: rmacklem Date: Thu Jun 4 14:49:27 2009 New Revision: 193437 URL: http://svn.freebsd.org/changeset/base/193437 Log: Fix upcall races in the client side krpc. For the client side upcall, holding SOCKBUF_LOCK() isn't sufficient to guarantee that there is no upcall in progress, since SOCKBUF_LOCK() is released/re-acquired in the upcall. An upcall reference counter was added to the upcall structure that is incremented at the beginning of the upcall and decremented at the end of the upcall. As such, a reference count == 0 when holding the SOCKBUF_LOCK() guarantees there is no upcall in progress. Add a function that is called just after soupcall_clear(), which waits until the reference count == 0. Also, move the mtx_destroy() down to after soupcall_clear(), so that the mutex is not destroyed before upcalls are done. Reviewed by: dfr, jhb Tested by: pho Approved by: kib (mentor) Modified: head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Thu Jun 4 14:13:06 2009 (r193436) +++ head/sys/rpc/clnt_dg.c Thu Jun 4 14:49:27 2009 (r193437) @@ -123,8 +123,11 @@ struct cu_socket { struct mtx cs_lock; int cs_refs; /* Count of clients */ struct cu_request_list cs_pending; /* Requests awaiting replies */ + int cs_upcallrefs; /* Refcnt of upcalls in prog.*/ }; +static void clnt_dg_upcallsdone(struct socket *, struct cu_socket *); + /* * Private data kept per client handle */ @@ -291,6 +294,7 @@ recheck_socket: } mtx_init(&cs->cs_lock, "cs->cs_lock", NULL, MTX_DEF); cs->cs_refs = 1; + cs->cs_upcallrefs = 0; TAILQ_INIT(&cs->cs_pending); soupcall_set(so, SO_RCV, clnt_dg_soupcall, cs); } @@ -988,10 +992,12 @@ clnt_dg_destroy(CLIENT *cl) cs->cs_refs--; if (cs->cs_refs == 0) { - mtx_destroy(&cs->cs_lock); + mtx_unlock(&cs->cs_lock); SOCKBUF_LOCK(&cu->cu_socket->so_rcv); soupcall_clear(cu->cu_socket, SO_RCV); + clnt_dg_upcallsdone(cu->cu_socket, cs); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); + mtx_destroy(&cs->cs_lock); mem_free(cs, sizeof(*cs)); lastsocketref = TRUE; } else { @@ -1036,6 +1042,7 @@ clnt_dg_soupcall(struct socket *so, void int error, rcvflag, foundreq; uint32_t xid; + cs->cs_upcallrefs++; uio.uio_resid = 1000000000; uio.uio_td = curthread; do { @@ -1111,6 +1118,24 @@ clnt_dg_soupcall(struct socket *so, void if (!foundreq) m_freem(m); } while (m); + cs->cs_upcallrefs--; + if (cs->cs_upcallrefs < 0) + panic("rpcdg upcall refcnt"); + if (cs->cs_upcallrefs == 0) + wakeup(&cs->cs_upcallrefs); return (SU_OK); } +/* + * Wait for all upcalls in progress to complete. + */ +static void +clnt_dg_upcallsdone(struct socket *so, struct cu_socket *cs) +{ + + SOCKBUF_LOCK_ASSERT(&so->so_rcv); + + while (cs->cs_upcallrefs > 0) + (void) msleep(&cs->cs_upcallrefs, SOCKBUF_MTX(&so->so_rcv), 0, + "rpcdgup", 0); +} Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Thu Jun 4 14:13:06 2009 (r193436) +++ head/sys/rpc/clnt_vc.c Thu Jun 4 14:49:27 2009 (r193437) @@ -137,8 +137,11 @@ struct ct_data { size_t ct_record_resid; /* how much left of reply to read */ bool_t ct_record_eor; /* true if reading last fragment */ struct ct_request_list ct_pending; + int ct_upcallrefs; /* Ref cnt of upcalls in prog. */ }; +static void clnt_vc_upcallsdone(struct ct_data *); + static const char clnt_vc_errstr[] = "%s : %s"; static const char clnt_vc_str[] = "clnt_vc_create"; static const char clnt_read_vc_str[] = "read_vc"; @@ -184,6 +187,7 @@ clnt_vc_create( ct->ct_threads = 0; ct->ct_closing = FALSE; ct->ct_closed = FALSE; + ct->ct_upcallrefs = 0; if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) { error = soconnect(so, raddr, curthread); @@ -753,6 +757,7 @@ clnt_vc_close(CLIENT *cl) SOCKBUF_LOCK(&ct->ct_socket->so_rcv); soupcall_clear(ct->ct_socket, SO_RCV); + clnt_vc_upcallsdone(ct); SOCKBUF_UNLOCK(&ct->ct_socket->so_rcv); /* @@ -825,6 +830,7 @@ clnt_vc_soupcall(struct socket *so, void uint32_t xid, header; bool_t do_read; + ct->ct_upcallrefs++; uio.uio_td = curthread; do { /* @@ -845,7 +851,7 @@ clnt_vc_soupcall(struct socket *so, void do_read = TRUE; if (!do_read) - return (SU_OK); + break; SOCKBUF_UNLOCK(&so->so_rcv); uio.uio_resid = sizeof(uint32_t); @@ -898,7 +904,7 @@ clnt_vc_soupcall(struct socket *so, void do_read = TRUE; if (!do_read) - return (SU_OK); + break; /* * We have the record mark. Read as much as @@ -979,5 +985,24 @@ clnt_vc_soupcall(struct socket *so, void } } } while (m); + ct->ct_upcallrefs--; + if (ct->ct_upcallrefs < 0) + panic("rpcvc upcall refcnt"); + if (ct->ct_upcallrefs == 0) + wakeup(&ct->ct_upcallrefs); return (SU_OK); } + +/* + * Wait for all upcalls in progress to complete. + */ +static void +clnt_vc_upcallsdone(struct ct_data *ct) +{ + + SOCKBUF_LOCK_ASSERT(&ct->ct_socket->so_rcv); + + while (ct->ct_upcallrefs > 0) + (void) msleep(&ct->ct_upcallrefs, + SOCKBUF_MTX(&ct->ct_socket->so_rcv), 0, "rpcvcup", 0); +} From das at FreeBSD.ORG Thu Jun 4 15:44:17 2009 From: das at FreeBSD.ORG (David Schultz) Date: Thu Jun 4 15:44:28 2009 Subject: svn commit: r193241 - in head: . sys/sys In-Reply-To: <1243880140.25229.23.camel@bauer.cse.buffalo.edu> References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> Message-ID: <20090604151959.GA26524@zim.MIT.EDU> On Mon, Jun 01, 2009, Ken Smith wrote: > It was noted we're close to running out of numbers we can use before we > hit code freeze and the branch for the release. Since we're entering > code slush at the end of today in theory all changes that would warrant > a bump in __FreeBSD_version are supposed to be done. But it wouldn't > surprise me if we have one or two or so things that come along between > now and when we hit code freeze and the branch. So we need to be a bit > conservative with this. Please be sure to coordinate anything that > might require a bump in __FreeBSD_version with re@ from now on. If it > turns out things do come along that require bumps we'll need to "batch > them up" having one bump represent several changes. To avoid this sort of problem in the future, how about adding a digit to __FreeBSD_version in 9-CURRENT? Admittedly, a lot of the bumps in 8.X were probably unnecessary, but it's good that people are being cautious and documenting their incompatible changes. Better yet, we could automate the process somewhat and use something like the major version of FreeBSD concatenated with the SVN revision in lieu of __FreeBSD_version. From sam at FreeBSD.org Thu Jun 4 15:57:39 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Thu Jun 4 15:57:51 2009 Subject: svn commit: r193439 - head/sys/net80211 Message-ID: <200906041557.n54FvcHD096531@svn.freebsd.org> Author: sam Date: Thu Jun 4 15:57:38 2009 New Revision: 193439 URL: http://svn.freebsd.org/changeset/base/193439 Log: o station mode channel switch support o IEEE80211_IOC_CHANSWITCH fixups: - restrict to hostap vaps - return EOPNOTSUPP instead of EINVAL when applied to !hostap vap or to a vap w/o 11h enabled - interpret count of 0 to mean cancel the current CSA Reviewed by: rpaulo, avatar Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_scan.h head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211.h Thu Jun 4 15:57:38 2009 (r193439) @@ -686,7 +686,7 @@ enum { IEEE80211_ELEMID_TPCREQ = 34, IEEE80211_ELEMID_TPCREP = 35, IEEE80211_ELEMID_SUPPCHAN = 36, - IEEE80211_ELEMID_CHANSWITCHANN = 37, + IEEE80211_ELEMID_CSA = 37, IEEE80211_ELEMID_MEASREQ = 38, IEEE80211_ELEMID_MEASREP = 39, IEEE80211_ELEMID_QUIET = 40, @@ -736,6 +736,14 @@ struct ieee80211_csa_ie { uint8_t csa_count; /* Channel Switch Count */ } __packed; +/* + * Note the min acceptable CSA count is used to guard against + * malicious CSA injection in station mode. Defining this value + * as other than 0 violates the 11h spec. + */ +#define IEEE80211_CSA_COUNT_MIN 2 +#define IEEE80211_CSA_COUNT_MAX 255 + /* rate set entries are in .5 Mb/s units, and potentially marked as basic */ #define IEEE80211_RATE_BASIC 0x80 #define IEEE80211_RATE_VAL 0x7f Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_input.c Thu Jun 4 15:57:38 2009 (r193439) @@ -475,6 +475,7 @@ ieee80211_parse_beacon(struct ieee80211_ * [tlv] ssid * [tlv] supported rates * [tlv] country information + * [tlv] channel switch announcement (CSA) * [tlv] parameter set (FH/DS) * [tlv] erp information * [tlv] extended supported rates @@ -508,6 +509,9 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_COUNTRY: scan->country = frm; break; + case IEEE80211_ELEMID_CSA: + scan->csa = frm; + break; case IEEE80211_ELEMID_FHPARMS: if (ic->ic_phytype == IEEE80211_T_FH) { scan->fhdwell = LE_READ_2(&frm[2]); @@ -642,6 +646,14 @@ ieee80211_parse_beacon(struct ieee80211_ IEEE80211_VERIFY_LENGTH(scan->country[1], 3 * sizeof(uint8_t), scan->country = NULL); } + if (scan->csa != NULL) { + /* + * Validate Channel Switch Announcement; this must + * be the correct length or we toss the frame. + */ + IEEE80211_VERIFY_LENGTH(scan->csa[1], 3 * sizeof(uint8_t), + scan->status |= IEEE80211_BPARSE_CSA_INVALID); + } /* * Process HT ie's. This is complicated by our * accepting both the standard ie's and the pre-draft Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_ioctl.c Thu Jun 4 15:57:38 2009 (r193439) @@ -2304,8 +2304,10 @@ ieee80211_ioctl_chanswitch(struct ieee80 error = copyin(ireq->i_data, &csr, sizeof(csr)); if (error != 0) return error; - if ((vap->iv_flags & IEEE80211_F_DOTH) == 0) - return EINVAL; + /* XXX adhoc mode not supported */ + if (vap->iv_opmode != IEEE80211_M_HOSTAP || + (vap->iv_flags & IEEE80211_F_DOTH) == 0) + return EOPNOTSUPP; c = ieee80211_find_channel(ic, csr.csa_chan.ic_freq, csr.csa_chan.ic_flags); if (c == NULL) @@ -2313,6 +2315,8 @@ ieee80211_ioctl_chanswitch(struct ieee80 IEEE80211_LOCK(ic); if ((ic->ic_flags & IEEE80211_F_CSAPENDING) == 0) ieee80211_csa_startswitch(ic, c, csr.csa_mode, csr.csa_count); + else if (csr.csa_count == 0) + ieee80211_csa_cancelswitch(ic); else error = EBUSY; IEEE80211_UNLOCK(ic); Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_output.c Thu Jun 4 15:57:38 2009 (r193439) @@ -1468,7 +1468,7 @@ ieee80211_add_csa(uint8_t *frm, struct i struct ieee80211com *ic = vap->iv_ic; struct ieee80211_csa_ie *csa = (struct ieee80211_csa_ie *) frm; - csa->csa_ie = IEEE80211_ELEMID_CHANSWITCHANN; + csa->csa_ie = IEEE80211_ELEMID_CSA; csa->csa_len = 3; csa->csa_mode = 1; /* XXX force quiet on channel */ csa->csa_newchan = ieee80211_chan2ieee(ic, ic->ic_csa_newchan); Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_proto.c Thu Jun 4 15:57:38 2009 (r193439) @@ -1374,7 +1374,7 @@ beacon_miss(void *arg, int npending) * handlers duplicating these checks. */ if (vap->iv_opmode == IEEE80211_M_STA && - vap->iv_state == IEEE80211_S_RUN && + vap->iv_state >= IEEE80211_S_RUN && vap->iv_bmiss != NULL) vap->iv_bmiss(vap); } @@ -1451,8 +1451,8 @@ ieee80211_csa_startswitch(struct ieee802 IEEE80211_LOCK_ASSERT(ic); ic->ic_csa_newchan = c; + ic->ic_csa_mode = mode; ic->ic_csa_count = count; - /* XXX record mode? */ ic->ic_flags |= IEEE80211_F_CSAPENDING; TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -1465,6 +1465,19 @@ ieee80211_csa_startswitch(struct ieee802 ieee80211_notify_csa(ic, c, mode, count); } +static void +csa_completeswitch(struct ieee80211com *ic) +{ + struct ieee80211vap *vap; + + ic->ic_csa_newchan = NULL; + ic->ic_flags &= ~IEEE80211_F_CSAPENDING; + + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap->iv_state == IEEE80211_S_CSA) + ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0); +} + /* * Complete an 802.11h channel switch started by ieee80211_csa_startswitch. * We clear state and move all vap's in CSA state to RUN state @@ -1473,19 +1486,25 @@ ieee80211_csa_startswitch(struct ieee802 void ieee80211_csa_completeswitch(struct ieee80211com *ic) { - struct ieee80211vap *vap; - IEEE80211_LOCK_ASSERT(ic); KASSERT(ic->ic_flags & IEEE80211_F_CSAPENDING, ("csa not pending")); ieee80211_setcurchan(ic, ic->ic_csa_newchan); - ic->ic_csa_newchan = NULL; - ic->ic_flags &= ~IEEE80211_F_CSAPENDING; + csa_completeswitch(ic); +} - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) - if (vap->iv_state == IEEE80211_S_CSA) - ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0); +/* + * Cancel an 802.11h channel switch started by ieee80211_csa_startswitch. + * We clear state and move all vap's in CSA state to RUN state + * so they can again transmit. + */ +void +ieee80211_csa_cancelswitch(struct ieee80211com *ic) +{ + IEEE80211_LOCK_ASSERT(ic); + + csa_completeswitch(ic); } /* Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_proto.h Thu Jun 4 15:57:38 2009 (r193439) @@ -340,6 +340,7 @@ int ieee80211_beacon_update(struct ieee8 void ieee80211_csa_startswitch(struct ieee80211com *, struct ieee80211_channel *, int mode, int count); void ieee80211_csa_completeswitch(struct ieee80211com *); +void ieee80211_csa_cancelswitch(struct ieee80211com *); void ieee80211_cac_completeswitch(struct ieee80211vap *); /* Modified: head/sys/net80211/ieee80211_scan.h ============================================================================== --- head/sys/net80211/ieee80211_scan.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_scan.h Thu Jun 4 15:57:38 2009 (r193439) @@ -176,6 +176,7 @@ enum { IEEE80211_BPARSE_CHAN_INVALID = 0x10, /* invalid FH/DSPARMS chan */ IEEE80211_BPARSE_OFFCHAN = 0x20, /* DSPARMS chan != curchan */ IEEE80211_BPARSE_BINTVAL_INVALID= 0x40, /* invalid beacon interval */ + IEEE80211_BPARSE_CSA_INVALID = 0x80, /* invalid CSA ie */ }; /* @@ -211,7 +212,8 @@ struct ieee80211_scanparams { uint8_t *htinfo; uint8_t *ath; uint8_t *tdma; - uint8_t *spare[4]; + uint8_t *csa; + uint8_t *spare[3]; }; /* Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_sta.c Thu Jun 4 15:57:38 2009 (r193439) @@ -106,15 +106,28 @@ sta_vattach(struct ieee80211vap *vap) static void sta_beacon_miss(struct ieee80211vap *vap) { - KASSERT((vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning")); - KASSERT(vap->iv_state == IEEE80211_S_RUN, - ("wrong state %d", vap->iv_state)); - - IEEE80211_DPRINTF(vap, - IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, - "beacon miss, mode %u state %s\n", - vap->iv_opmode, ieee80211_state_name[vap->iv_state]); + struct ieee80211com *ic = vap->iv_ic; + KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning")); + KASSERT(vap->iv_state >= IEEE80211_S_RUN, + ("wrong state %s", ieee80211_state_name[vap->iv_state])); + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, + "beacon miss, mode %s state %s\n", + ieee80211_opmode_name[vap->iv_opmode], + ieee80211_state_name[vap->iv_state]); + + if (vap->iv_state == IEEE80211_S_CSA) { + /* + * A Channel Switch is pending; assume we missed the + * beacon that would've completed the process and just + * force the switch. If we made a mistake we'll not + * find the AP on the new channel and fall back to a + * normal scan. + */ + ieee80211_csa_completeswitch(ic); + return; + } if (++vap->iv_bmiss_count < vap->iv_bmiss_max) { /* * Send a directed probe req before falling back to a @@ -359,6 +372,7 @@ sta_newstate(struct ieee80211vap *vap, e } switch (ostate) { case IEEE80211_S_RUN: + case IEEE80211_S_CSA: break; case IEEE80211_S_AUTH: /* when join is done in fw */ case IEEE80211_S_ASSOC: @@ -412,6 +426,10 @@ sta_newstate(struct ieee80211vap *vap, e if (ic->ic_newassoc != NULL) ic->ic_newassoc(vap->iv_bss, ostate != IEEE80211_S_RUN); break; + case IEEE80211_S_CSA: + if (ostate != IEEE80211_S_RUN) + goto invalid; + break; case IEEE80211_S_SLEEP: ieee80211_sta_pwrsave(vap, 0); break; @@ -1080,6 +1098,112 @@ ieee80211_parse_wmeparams(struct ieee802 } /* + * Process 11h Channel Switch Announcement (CSA) ie. If this + * is the first CSA then initiate the switch. Otherwise we + * track state and trigger completion and/or cancel of the switch. + * XXX should be public for IBSS use + */ +static void +ieee80211_parse_csaparams(struct ieee80211vap *vap, uint8_t *frm, + const struct ieee80211_frame *wh) +{ + struct ieee80211com *ic = vap->iv_ic; + const struct ieee80211_csa_ie *csa = + (const struct ieee80211_csa_ie *) frm; + + KASSERT(vap->iv_state >= IEEE80211_S_RUN, + ("state %s", ieee80211_state_name[vap->iv_state])); + + if (csa->csa_mode > 1) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_DOTH, + wh, "CSA", "invalid mode %u", csa->csa_mode); + return; + } + IEEE80211_LOCK(ic); + if ((ic->ic_flags & IEEE80211_F_CSAPENDING) == 0) { + /* + * Convert the channel number to a channel reference. We + * try first to preserve turbo attribute of the current + * channel then fallback. Note this will not work if the + * CSA specifies a channel that requires a band switch (e.g. + * 11a => 11g). This is intentional as 11h is defined only + * for 5GHz/11a and because the switch does not involve a + * reassociation, protocol state (capabilities, negotated + * rates, etc) may/will be wrong. + */ + struct ieee80211_channel *c = + ieee80211_find_channel_byieee(ic, csa->csa_newchan, + (ic->ic_bsschan->ic_flags & IEEE80211_CHAN_ALLTURBO)); + if (c == NULL) { + c = ieee80211_find_channel_byieee(ic, + csa->csa_newchan, + (ic->ic_bsschan->ic_flags & IEEE80211_CHAN_ALL)); + if (c == NULL) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_DOTH, + wh, "CSA", "invalid channel %u", + csa->csa_newchan); + goto done; + } + } +#if IEEE80211_CSA_COUNT_MIN > 0 + if (csa->csa_count < IEEE80211_CSA_COUNT_MIN) { + /* + * Require at least IEEE80211_CSA_COUNT_MIN count to + * reduce the risk of being redirected by a fabricated + * CSA. If a valid CSA is dropped we'll still get a + * beacon miss when the AP leaves the channel so we'll + * eventually follow to the new channel. + * + * NOTE: this violates the 11h spec that states that + * count may be any value and if 0 then a switch + * should happen asap. + */ + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_DOTH, + wh, "CSA", "count %u too small, must be >= %u", + csa->csa_count, IEEE80211_CSA_COUNT_MIN); + goto done; + } +#endif + ieee80211_csa_startswitch(ic, c, csa->csa_mode, csa->csa_count); + } else { + /* + * Validate this ie against the initial CSA. We require + * mode and channel not change and the count must be + * monotonically decreasing. This may be pointless and + * canceling the switch as a result may be too paranoid but + * in the worst case if we drop out of CSA because of this + * and the AP does move then we'll just end up taking a + * beacon miss and scan to find the AP. + * + * XXX may want <= on count as we also process ProbeResp + * frames and those may come in w/ the same count as the + * previous beacon; but doing so leaves us open to a stuck + * count until we add a dead-man timer + */ + if (!(csa->csa_count < ic->ic_csa_count && + csa->csa_mode == ic->ic_csa_mode && + csa->csa_newchan == ieee80211_chan2ieee(ic, ic->ic_csa_newchan))) { + IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_DOTH, wh, + "CSA ie mismatch, initial ie <%d,%d,%d>, " + "this ie <%d,%d,%d>", ic->ic_csa_mode, + ic->ic_csa_newchan, ic->ic_csa_count, + csa->csa_mode, csa->csa_newchan, csa->csa_count); + ieee80211_csa_cancelswitch(ic); + } else { + if (csa->csa_count <= 1) + ieee80211_csa_completeswitch(ic); + else + ic->ic_csa_count = csa->csa_count; + } + } +done: + IEEE80211_UNLOCK(ic); +} + +/* * Return non-zero if a background scan may be continued: * o bg scan is active * o no channel switch is pending @@ -1245,6 +1369,20 @@ sta_recv_mgmt(struct ieee80211_node *ni, ni->ni_dtim_count = tim->tim_count; ni->ni_dtim_period = tim->tim_period; } + if (scan.csa != NULL && + (vap->iv_flags & IEEE80211_F_DOTH)) + ieee80211_parse_csaparams(vap, scan.csa, wh); + else if (ic->ic_flags & IEEE80211_F_CSAPENDING) { + /* + * No CSA ie or 11h disabled, but a channel + * switch is pending; drop out so we aren't + * stuck in CSA state. If the AP really is + * moving we'll get a beacon miss and scan. + */ + IEEE80211_LOCK(ic); + ieee80211_csa_cancelswitch(ic); + IEEE80211_UNLOCK(ic); + } /* * If scanning, pass the info to the scan module. * Otherwise, check if it's the right time to do Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Thu Jun 4 15:10:29 2009 (r193438) +++ head/sys/net80211/ieee80211_var.h Thu Jun 4 15:57:38 2009 (r193439) @@ -181,7 +181,8 @@ struct ieee80211com { /* 802.11h/DFS state */ struct ieee80211_channel *ic_csa_newchan;/* channel for doing CSA */ - int ic_csa_count; /* count for doing CSA */ + short ic_csa_mode; /* mode for doing CSA */ + short ic_csa_count; /* count for doing CSA */ struct ieee80211_dfs_state ic_dfs; /* DFS state */ struct ieee80211_scan_state *ic_scan; /* scan state */ From julian at elischer.org Thu Jun 4 15:58:19 2009 From: julian at elischer.org (Julian Elischer) Date: Thu Jun 4 15:58:30 2009 Subject: svn commit: r193434 - head/sys/nlm In-Reply-To: <7bed97456290a8e2454188cadae2ff36@mail.rabson.org> References: <200906041122.n54BMrIP089508@svn.freebsd.org> <7bed97456290a8e2454188cadae2ff36@mail.rabson.org> Message-ID: <4A27EF19.6050606@elischer.org> Doug Rabson wrote: > On Thu, 4 Jun 2009 11:22:53 +0000 (UTC), Ed Schouten > wrote: >> Author: ed >> Date: Thu Jun 4 11:22:53 2009 >> New Revision: 193434 >> URL: http://svn.freebsd.org/changeset/base/193434 >> >> Log: >> Correct typo; errno => error. > > Thanks Ed. Now where did I leave that pointy hat :( look up From ps at FreeBSD.org Thu Jun 4 16:18:09 2009 From: ps at FreeBSD.org (Paul Saab) Date: Thu Jun 4 16:18:20 2009 Subject: svn commit: r193440 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys Message-ID: <200906041618.n54GI851097005@svn.freebsd.org> Author: ps Date: Thu Jun 4 16:18:07 2009 New Revision: 193440 URL: http://svn.freebsd.org/changeset/base/193440 Log: Support shared vnode locks for write operations when the offset is provided on filesystems that support it. This really improves mysql + innodb performance on ZFS. Reviewed by: jhb, kmacy, jeffr Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/kern/vfs_vnops.c head/sys/sys/mount.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 4 15:57:38 2009 (r193439) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 4 16:18:07 2009 (r193440) @@ -573,6 +573,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_flag |= MNT_LOCAL; vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; + vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; if (error = dsl_prop_get_integer(osname, "readonly", &readonly, NULL)) goto out; Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 4 15:57:38 2009 (r193439) +++ head/sys/kern/vfs_vnops.c Thu Jun 4 16:18:07 2009 (r193440) @@ -367,7 +367,7 @@ vn_rdwr(rw, vp, base, len, offset, segfl struct iovec aiov; struct mount *mp; struct ucred *cred; - int error; + int error, lock_flags; VFS_ASSERT_GIANT(vp->v_mount); @@ -378,7 +378,13 @@ vn_rdwr(rw, vp, base, len, offset, segfl (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if (mp != NULL && + (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) { + lock_flags = LK_SHARED; + } else { + lock_flags = LK_EXCLUSIVE; + } + vn_lock(vp, lock_flags | LK_RETRY); } else vn_lock(vp, LK_SHARED | LK_RETRY); @@ -564,7 +570,7 @@ vn_write(fp, uio, active_cred, flags, td { struct vnode *vp; struct mount *mp; - int error, ioflag; + int error, ioflag, lock_flags; int vfslocked; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", @@ -587,7 +593,16 @@ vn_write(fp, uio, active_cred, flags, td if (vp->v_type != VCHR && (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + + if (vp->v_mount != NULL && + (vp->v_mount->mnt_kern_flag & MNTK_SHARED_WRITES) && + (flags & FOF_OFFSET) != 0) { + lock_flags = LK_SHARED; + } else { + lock_flags = LK_EXCLUSIVE; + } + + vn_lock(vp, lock_flags | LK_RETRY); if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; ioflag |= sequential_heuristic(uio, fp); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu Jun 4 15:57:38 2009 (r193439) +++ head/sys/sys/mount.h Thu Jun 4 16:18:07 2009 (r193440) @@ -326,6 +326,7 @@ void __mnt_vnode_markerfree(str #define MNTK_DRAINING 0x00000010 /* lock draining is happening */ #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ +#define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ From imp at bsdimp.com Thu Jun 4 16:19:54 2009 From: imp at bsdimp.com (M. Warner Losh) Date: Thu Jun 4 16:20:06 2009 Subject: svn commit: r193241 - in head: . sys/sys In-Reply-To: <20090604151959.GA26524@zim.MIT.EDU> References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> <20090604151959.GA26524@zim.MIT.EDU> Message-ID: <20090604.101755.1493773383.imp@bsdimp.com> In message: <20090604151959.GA26524@zim.MIT.EDU> David Schultz writes: : On Mon, Jun 01, 2009, Ken Smith wrote: : > It was noted we're close to running out of numbers we can use before we : > hit code freeze and the branch for the release. Since we're entering : > code slush at the end of today in theory all changes that would warrant : > a bump in __FreeBSD_version are supposed to be done. But it wouldn't : > surprise me if we have one or two or so things that come along between : > now and when we hit code freeze and the branch. So we need to be a bit : > conservative with this. Please be sure to coordinate anything that : > might require a bump in __FreeBSD_version with re@ from now on. If it : > turns out things do come along that require bumps we'll need to "batch : > them up" having one bump represent several changes. : : To avoid this sort of problem in the future, how about adding a : digit to __FreeBSD_version in 9-CURRENT? Admittedly, a lot of the : bumps in 8.X were probably unnecessary, but it's good that people : are being cautious and documenting their incompatible changes. We can avoid this problem by not being so bump-happy. Adding an extra digit was painful when we did it before. A number of subtle things broke (like the output of file). Part of the problem here is that we want to ship FreeBSD 8.0 as '800100' which is just historical convention: * scheme is: Rxx * 'R' is 0 if release branch or x.0-CURRENT before RELENG_*_0 * is created, otherwise 1. We could easily up that to '5' for the release so we have 499 entries. There aren't so many things that depend on this convention in the tree (I couldn't find any in a quick, informal survey). * scheme is: Rxx * 'R' is less than 5 if release branch or x.0-CURRENT * before RELENG_*_0 is created, otherwise 5 or greater. I think is the only change we really need to make. : Better yet, we could automate the process somewhat and use : something like the major version of FreeBSD concatenated with the : SVN revision in lieu of __FreeBSD_version. I think this would be worse. First, external trackers would have difficulty updating this. Second, __FreeBSD_version is used to indicate kernel ABI points (at least recently, this is lame and should be reverted for the RELENG branch, but I digress). Third, ports use it to determine where we are and build things differently. I think this would complicate their lives and make documenting the points more difficult. This is one of those things that I don't think should be totally automated. Warner From das at FreeBSD.ORG Thu Jun 4 16:28:30 2009 From: das at FreeBSD.ORG (David Schultz) Date: Thu Jun 4 16:28:42 2009 Subject: svn commit: r193241 - in head: . sys/sys In-Reply-To: <20090604.101755.1493773383.imp@bsdimp.com> References: <200906011807.n51I7ccW086812@svn.freebsd.org> <1243880140.25229.23.camel@bauer.cse.buffalo.edu> <20090604151959.GA26524@zim.MIT.EDU> <20090604.101755.1493773383.imp@bsdimp.com> Message-ID: <20090604163057.GA27090@zim.MIT.EDU> On Thu, Jun 04, 2009, M. Warner Losh wrote: > In message: <20090604151959.GA26524@zim.MIT.EDU> > David Schultz writes: > : On Mon, Jun 01, 2009, Ken Smith wrote: > : > It was noted we're close to running out of numbers we can use before we > : > hit code freeze and the branch for the release. Since we're entering > : > code slush at the end of today in theory all changes that would warrant > : > a bump in __FreeBSD_version are supposed to be done. But it wouldn't > : > surprise me if we have one or two or so things that come along between > : > now and when we hit code freeze and the branch. So we need to be a bit > : > conservative with this. Please be sure to coordinate anything that > : > might require a bump in __FreeBSD_version with re@ from now on. If it > : > turns out things do come along that require bumps we'll need to "batch > : > them up" having one bump represent several changes. > : > : To avoid this sort of problem in the future, how about adding a > : digit to __FreeBSD_version in 9-CURRENT? Admittedly, a lot of the > : bumps in 8.X were probably unnecessary, but it's good that people > : are being cautious and documenting their incompatible changes. > > We can avoid this problem by not being so bump-happy. > > Adding an extra digit was painful when we did it before. A number of > subtle things broke (like the output of file). > > Part of the problem here is that we want to ship FreeBSD 8.0 as > '800100' which is just historical convention: > > * scheme is: Rxx > * 'R' is 0 if release branch or x.0-CURRENT before RELENG_*_0 > * is created, otherwise 1. > > We could easily up that to '5' for the release so we have 499 > entries. There aren't so many things that depend on this convention in > the tree (I couldn't find any in a quick, informal survey). Sounds good. We might want to use 7 or 8 instead of 5 to account for the fact that changes requiring a bump are more frequent in CURRENT than in STABLE. From kostikbel at gmail.com Thu Jun 4 16:31:03 2009 From: kostikbel at gmail.com (Kostik Belousov) Date: Thu Jun 4 16:31:09 2009 Subject: svn commit: r193440 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys In-Reply-To: <200906041618.n54GI851097005@svn.freebsd.org> References: <200906041618.n54GI851097005@svn.freebsd.org> Message-ID: <20090604163056.GW1927@deviant.kiev.zoral.com.ua> On Thu, Jun 04, 2009 at 04:18:08PM +0000, Paul Saab wrote: > Author: ps > Date: Thu Jun 4 16:18:07 2009 > New Revision: 193440 > URL: http://svn.freebsd.org/changeset/base/193440 > > Log: > Support shared vnode locks for write operations when the offset is > provided on filesystems that support it. This really improves mysql > + innodb performance on ZFS. > > Reviewed by: jhb, kmacy, jeffr > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > head/sys/kern/vfs_vnops.c > head/sys/sys/mount.h > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 4 15:57:38 2009 (r193439) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 4 16:18:07 2009 (r193440) > @@ -573,6 +573,7 @@ zfs_domount(vfs_t *vfsp, char *osname) > vfsp->mnt_flag |= MNT_LOCAL; > vfsp->mnt_kern_flag |= MNTK_MPSAFE; > vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; > + vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; > > if (error = dsl_prop_get_integer(osname, "readonly", &readonly, NULL)) > goto out; > > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Thu Jun 4 15:57:38 2009 (r193439) > +++ head/sys/kern/vfs_vnops.c Thu Jun 4 16:18:07 2009 (r193440) > @@ -367,7 +367,7 @@ vn_rdwr(rw, vp, base, len, offset, segfl > struct iovec aiov; > struct mount *mp; > struct ucred *cred; > - int error; > + int error, lock_flags; > > VFS_ASSERT_GIANT(vp->v_mount); > > @@ -378,7 +378,13 @@ vn_rdwr(rw, vp, base, len, offset, segfl > (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) > != 0) > return (error); > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > + if (mp != NULL && > + (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) { > + lock_flags = LK_SHARED; > + } else { > + lock_flags = LK_EXCLUSIVE; > + } > + vn_lock(vp, lock_flags | LK_RETRY); > } else > vn_lock(vp, LK_SHARED | LK_RETRY); > > @@ -564,7 +570,7 @@ vn_write(fp, uio, active_cred, flags, td > { > struct vnode *vp; > struct mount *mp; > - int error, ioflag; > + int error, ioflag, lock_flags; > int vfslocked; > > KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", > @@ -587,7 +593,16 @@ vn_write(fp, uio, active_cred, flags, td > if (vp->v_type != VCHR && > (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) > goto unlock; > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > + > + if (vp->v_mount != NULL && > + (vp->v_mount->mnt_kern_flag & MNTK_SHARED_WRITES) && > + (flags & FOF_OFFSET) != 0) { > + lock_flags = LK_SHARED; > + } else { > + lock_flags = LK_EXCLUSIVE; > + } > + > + vn_lock(vp, lock_flags | LK_RETRY); > if ((flags & FOF_OFFSET) == 0) > uio->uio_offset = fp->f_offset; > ioflag |= sequential_heuristic(uio, fp); Why do you check for vnode v_mount flags in vn_write, while performing the check on the vop_getwritemount(vp) result for vn_rdwr ? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090604/390b494a/attachment.pgp From ps at FreeBSD.org Thu Jun 4 16:50:05 2009 From: ps at FreeBSD.org (Paul Saab) Date: Thu Jun 4 16:50:50 2009 Subject: svn commit: r193442 - head/sys/kern Message-ID: <200906041650.n54Go34d097782@svn.freebsd.org> Author: ps Date: Thu Jun 4 16:50:03 2009 New Revision: 193442 URL: http://svn.freebsd.org/changeset/base/193442 Log: When checking for shared writes, use the struct mount returned from vn_start_write. Reviewed by: jhb Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 4 16:20:19 2009 (r193441) +++ head/sys/kern/vfs_vnops.c Thu Jun 4 16:50:03 2009 (r193442) @@ -594,8 +594,7 @@ vn_write(fp, uio, active_cred, flags, td (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - if (vp->v_mount != NULL && - (vp->v_mount->mnt_kern_flag & MNTK_SHARED_WRITES) && + if (mp != NULL && (mp->mnt_kern_flag & MNTK_SHARED_WRITES) && (flags & FOF_OFFSET) != 0) { lock_flags = LK_SHARED; } else { From sam at FreeBSD.org Thu Jun 4 18:22:22 2009 From: sam at FreeBSD.org (Sam Leffler) Date: Thu Jun 4 18:22:34 2009 Subject: svn commit: r193447 - head/sbin/ifconfig Message-ID: <200906041822.n54IML6o000211@svn.freebsd.org> Author: sam Date: Thu Jun 4 18:22:21 2009 New Revision: 193447 URL: http://svn.freebsd.org/changeset/base/193447 Log: track rename of CSA ie Submitted by: wxs Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Thu Jun 4 18:03:13 2009 (r193446) +++ head/sbin/ifconfig/ifieee80211.c Thu Jun 4 18:22:21 2009 (r193447) @@ -2888,7 +2888,7 @@ iename(int elemid) case IEEE80211_ELEMID_TPCREQ: return " TPCREQ"; case IEEE80211_ELEMID_TPCREP: return " TPCREP"; case IEEE80211_ELEMID_SUPPCHAN: return " SUPPCHAN"; - case IEEE80211_ELEMID_CHANSWITCHANN:return " CSA"; + case IEEE80211_ELEMID_CSA: return " CSA"; case IEEE80211_ELEMID_MEASREQ: return " MEASREQ"; case IEEE80211_ELEMID_MEASREP: return " MEASREP"; case IEEE80211_ELEMID_QUIET: return " QUIET"; From pjd at FreeBSD.org Thu Jun 4 19:07:15 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Thu Jun 4 19:07:22 2009 Subject: svn commit: r193433 - head/sys/fs/devfs In-Reply-To: <200906041030.n54AUIh4084623@svn.freebsd.org> References: <200906041030.n54AUIh4084623@svn.freebsd.org> Message-ID: <20090604190709.GA1705@garage.freebsd.pl> On Thu, Jun 04, 2009 at 10:30:18AM +0000, Robert Watson wrote: > Author: rwatson > Date: Thu Jun 4 10:30:18 2009 > New Revision: 193433 > URL: http://svn.freebsd.org/changeset/base/193433 > > Log: > Re-add opt_mac.h include, which is required in order for MNT_MULTILABEL > to be set properly on devfs. Otherwise, it isn't possible to set labels > on /dev nodes. > > Reported by: Sergio Rodriguez > MFC after: 3 days I'm afraid that's not the only case: http://people.freebsd.org/~pjd/patches/opt_mac.patch -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090604/0678b0cd/attachment.pgp From pjd at FreeBSD.org Thu Jun 4 19:09:17 2009 From: pjd at FreeBSD.org (Pawel Jakub Dawidek) Date: Thu Jun 4 19:09:23 2009 Subject: svn commit: r193433 - head/sys/fs/devfs In-Reply-To: <20090604190709.GA1705@garage.freebsd.pl> References: <200906041030.n54AUIh4084623@svn.freebsd.org> <20090604190709.GA1705@garage.freebsd.pl> Message-ID: <20090604190912.GB1705@garage.freebsd.pl> On Thu, Jun 04, 2009 at 09:07:09PM +0200, Pawel Jakub Dawidek wrote: > On Thu, Jun 04, 2009 at 10:30:18AM +0000, Robert Watson wrote: > > Author: rwatson > > Date: Thu Jun 4 10:30:18 2009 > > New Revision: 193433 > > URL: http://svn.freebsd.org/changeset/base/193433 > > > > Log: > > Re-add opt_mac.h include, which is required in order for MNT_MULTILABEL > > to be set properly on devfs. Otherwise, it isn't possible to set labels > > on /dev nodes. > > > > Reported by: Sergio Rodriguez > > MFC after: 3 days > > I'm afraid that's not the only case: > > http://people.freebsd.org/~pjd/patches/opt_mac.patch I forgot to mention that even a compile test wasn't made and for dev/cxgb/ulp/tom/cxgb_cpl_io.c including opt_mac.h will trigger this: #ifdef MAC #error "no MAC support" #endif -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090604/ebf58dfd/attachment.pgp From edwin at FreeBSD.org Thu Jun 4 21:48:05 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Thu Jun 4 21:48:11 2009 Subject: svn commit: r193462 - head/usr.bin/calendar/calendars Message-ID: <200906042148.n54Lm4UM005166@svn.freebsd.org> Author: edwin Date: Thu Jun 4 21:48:04 2009 New Revision: 193462 URL: http://svn.freebsd.org/changeset/base/193462 Log: [patch] calendar.music: Chuck Berry was born in St. Louis, Missouri, not California The /usr/bin/calendar program reports that Chuck Berry was born in San Jose California but he was not born in California. Chuck Berry was born in St. Louis, Missouri in 1926 on October 18. http://www.chuckberry.com/about/bio.htm http://www.khaldea.com/charts/chuckberry.shtml http://en.wikipedia.org/wiki/Chuck_Berry PR: conf/128215 Submitted by: comet--berkeley (aka Pablo Picasso) MFC after: 2 days Modified: head/usr.bin/calendar/calendars/calendar.music Modified: head/usr.bin/calendar/calendars/calendar.music ============================================================================== --- head/usr.bin/calendar/calendars/calendar.music Thu Jun 4 21:45:16 2009 (r193461) +++ head/usr.bin/calendar/calendars/calendar.music Thu Jun 4 21:48:04 2009 (r193462) @@ -182,7 +182,7 @@ 10/16 Bob Weir (Grateful Dead) is born in San Francisco, 1947 10/17 "Hair" opens at New York's Public Theater, 1967 10/17 Frederic Chopin dies in Paris, France, 1849 -10/18 Chuck Berry is born in San Jose, California, 1926 +10/18 Chuck Berry is born in St. Louis, Missouri, 1926 10/20 Three members of Lynyrd Skynyrd die in a plane crash, 1977 10/21 Jesus Christ Super Star debuted on Broadway, 1971 10/22 Franz Liszt born, 1811 From edwin at FreeBSD.org Thu Jun 4 21:55:09 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Thu Jun 4 21:56:53 2009 Subject: svn commit: r193464 - head/games/fortune/datfiles Message-ID: <200906042155.n54Lt7Mv005389@svn.freebsd.org> Author: edwin Date: Thu Jun 4 21:55:07 2009 New Revision: 193464 URL: http://svn.freebsd.org/changeset/base/193464 Log: [patch] fortune(6): file not Y2.01K compliant Update the time in the fortune to make the joke a little bit more realistic again: Bump year from 2009 to 2039. PR: conf/129860 Submitted by: Alan Amesbury MFC after: 2 days Modified: head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Thu Jun 4 21:48:17 2009 (r193463) +++ head/games/fortune/datfiles/fortunes-o.real Thu Jun 4 21:55:07 2009 (r193464) @@ -4242,7 +4242,7 @@ Apple owners do it with mice! APPOINTMENT BOOK: The reference of last resort when trying to duck undesired invitations ("Gee, the soonest I can pencil you in is - December, 2009"), or when trying to figure out what the hell + December, 2039"), or when trying to figure out what the hell it was you did during the past year. % Approximately 80% of our air pollution stems from hydrocarbons From thompsa at FreeBSD.org Thu Jun 4 21:59:28 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Thu Jun 4 21:59:40 2009 Subject: svn commit: r193465 - head/sys/dev/sound/usb Message-ID: <200906042159.n54LxS2Q005513@svn.freebsd.org> Author: thompsa Date: Thu Jun 4 21:59:28 2009 New Revision: 193465 URL: http://svn.freebsd.org/changeset/base/193465 Log: revert r162516. We only support 1 or 2 channels per stream which reflects mono and stereo. Submitted by: Hans Petter Selasky Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Jun 4 21:55:07 2009 (r193464) +++ head/sys/dev/sound/usb/uaudio.c Thu Jun 4 21:59:28 2009 (r193465) @@ -97,7 +97,7 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) -#define UAUDIO_MAX_CHAN(x) (((x) < 2) ? (x) : 2) /* XXX fixme later */ +#define UAUDIO_MAX_CHAN(x) (x) struct uaudio_mixer_node { int32_t minval; @@ -940,6 +940,8 @@ uaudio_chan_fill_info_sub(struct uaudio_ bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); bBitResolution = asf1d->bBitResolution; + DPRINTFN(9, "bChannels=%u\n", bChannels); + if (asf1d->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); From thompsa at FreeBSD.org Thu Jun 4 22:00:50 2009 From: thompsa at FreeBSD.org (Andrew Thompson) Date: Thu Jun 4 22:01:01 2009 Subject: svn commit: r193466 - head/sys/dev/usb/input Message-ID: <200906042200.n54M0nTl005606@svn.freebsd.org> Author: thompsa Date: Thu Jun 4 22:00:48 2009 New Revision: 193466 URL: http://svn.freebsd.org/changeset/base/193466 Log: Remove duplicate variable setting. Spotted by: Sylvestre Gallon Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Thu Jun 4 21:59:28 2009 (r193465) +++ head/sys/dev/usb/input/ukbd.c Thu Jun 4 22:00:48 2009 (r193466) @@ -706,7 +706,6 @@ ukbd_attach(device_t dev) sc->sc_iface_index = uaa->info.bIfaceIndex; sc->sc_iface_no = uaa->info.bIfaceNum; sc->sc_mode = K_XLATE; - sc->sc_iface = uaa->iface; usb2_callout_init_mtx(&sc->sc_callout, &Giant, 0); From edwin at FreeBSD.org Thu Jun 4 22:01:53 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Thu Jun 4 22:01:59 2009 Subject: svn commit: r193467 - head/games/fortune/datfiles Message-ID: <200906042201.n54M1onU005674@svn.freebsd.org> Author: edwin Date: Thu Jun 4 22:01:50 2009 New Revision: 193467 URL: http://svn.freebsd.org/changeset/base/193467 Log: [patch] fortune(6): George Bernard Shaw quote fix From the original PR: s/milestones/millstones/ and less important.. s/man/Man/ Not every source I've seen capitalizes 'Man', but it seems right. Uncapitalized 'man' would usually be preceded by an 'a'. But I haven't seen any reference cite the orignal source yet, so I can't say for sure. http://quotationsbook.com/quote/31568/ PR: conf/131469 Submitted by: John Hein MFC after: 2 days Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Thu Jun 4 22:00:48 2009 (r193466) +++ head/games/fortune/datfiles/fortunes Thu Jun 4 22:01:50 2009 (r193467) @@ -48262,9 +48262,9 @@ beat their head on the keyboard. After -- Harry Skelton % The seven deadly sins ... Food, clothing, firing, rent, taxes, -respectability and children. Nothing can lift those seven milestones -from man's neck but money; and the spirit cannot soar until the -milestones are lifted. +respectability and children. Nothing can lift those seven millstones +from Man's neck but money; and the spirit cannot soar until the +millstones are lifted. -- George Bernard Shaw % The seven eyes of Ningauble the Wizard floated back to his hood as he From benno at FreeBSD.org Thu Jun 4 23:31:06 2009 From: benno at FreeBSD.org (Benno Rice) Date: Thu Jun 4 23:31:18 2009 Subject: svn commit: r193473 - head/sbin/kldload Message-ID: <200906042331.n54NV5DH007853@svn.freebsd.org> Author: benno Date: Thu Jun 4 23:31:05 2009 New Revision: 193473 URL: http://svn.freebsd.org/changeset/base/193473 Log: style(9) pass prior to further changes. Sponsored by: Redacted Consulting Modified: head/sbin/kldload/kldload.c Modified: head/sbin/kldload/kldload.c ============================================================================== --- head/sbin/kldload/kldload.c Thu Jun 4 22:41:36 2009 (r193472) +++ head/sbin/kldload/kldload.c Thu Jun 4 23:31:05 2009 (r193473) @@ -27,55 +27,60 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include #include -#include -#include + +static void usage(void); static void usage(void) { - fprintf(stderr, "usage: kldload [-v] file ...\n"); - exit(1); + fprintf(stderr, "usage: kldload [-v] file ...\n"); + exit(1); } int main(int argc, char** argv) { - int c; - int errors; - int fileid; - int verbose; - - errors = 0; - verbose = 0; - - while ((c = getopt(argc, argv, "v")) != -1) - switch (c) { - case 'v': - verbose = 1; - break; - default: - usage(); + int c; + int errors; + int fileid; + int verbose; + + errors = 0; + verbose = 0; + + while ((c = getopt(argc, argv, "v")) != -1) { + switch (c) { + case 'v': + verbose = 1; + break; + default: + usage(); + } } - argc -= optind; - argv += optind; + argc -= optind; + argv += optind; - if (argc == 0) - usage(); + if (argc == 0) + usage(); - while (argc-- != 0) { - fileid = kldload(argv[0]); - if (fileid < 0) { - warn("can't load %s", argv[0]); - errors++; - } else - if (verbose) - printf("Loaded %s, id=%d\n", argv[0], fileid); - argv++; - } + while (argc-- != 0) { + fileid = kldload(argv[0]); + if (fileid < 0) { + warn("can't load %s", argv[0]); + errors++; + } else { + if (verbose) { + printf("Loaded %s, id=%d\n", argv[0], fileid); + } + } + argv++; + } - return errors ? 1 : 0; + return (errors ? 1 : 0); } From benno at FreeBSD.org Thu Jun 4 23:43:09 2009 From: benno at FreeBSD.org (Benno Rice) Date: Thu Jun 4 23:43:20 2009 Subject: svn commit: r193475 - head/sbin/kldload Message-ID: <200906042343.n54Nh8c5008164@svn.freebsd.org> Author: benno Date: Thu Jun 4 23:43:08 2009 New Revision: 193475 URL: http://svn.freebsd.org/changeset/base/193475 Log: Perform some checking on the requested list of modules to warn people if they try to load modules by filename out of the current directory where the module in question may be further up the module path or not in the module path at all. Also add some text to the man page to help explain what's going on. Sponsored by: Redacted Consulting Modified: head/sbin/kldload/kldload.8 head/sbin/kldload/kldload.c Modified: head/sbin/kldload/kldload.8 ============================================================================== --- head/sbin/kldload/kldload.8 Thu Jun 4 23:31:41 2009 (r193474) +++ head/sbin/kldload/kldload.8 Thu Jun 4 23:43:08 2009 (r193475) @@ -50,10 +50,22 @@ using .Nm . It does not hurt to specify it though. .Pp +If a bare filename is requested it will only be loaded if it is found within +the module path as defined by the sysctl +.Va kern.module_path . +To load a module from the current directory it must be specified as a full or +relative path. +The +.Nm +utility will warn if a module is requested as a bare filename and is present +in the current directory. +.Pp The following option is available: .Bl -tag -width indent .It Fl v Be more verbose. +.It Fl q +Silence any extraneous warnings. .El .Sh FILES .Bl -tag -width /boot/kernel -compact @@ -64,6 +76,26 @@ Modules must have an extension of .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +To load by module name: +.Bd -literal -offset indent +\*[Gt] kldload foo +.Ed +.Pp +To load by file name within the module path: +.Bd -literal -offset indent +\*[Gt] kldload foo.ko +.Ed +.Pp +To load by relative path: +.Bd -literal -offset indent +\*[Gt] kldload ./foo.ko +.Ed +.Pp +To load by full path: +.Bd -literal -offset indent +\*[Gt] kldload /boot/kernel/foo.ko +.Ed .Sh AUTOMATICALLY LOADING MODULES Some modules (pf, ipfw, ipf, etc.) may be automatically loaded at boot time when the corresponding Modified: head/sbin/kldload/kldload.c ============================================================================== --- head/sbin/kldload/kldload.c Thu Jun 4 23:31:41 2009 (r193474) +++ head/sbin/kldload/kldload.c Thu Jun 4 23:43:08 2009 (r193475) @@ -27,15 +27,105 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include +#include #include #include #include +#include #include +#define PATHCTL "kern.module_path" + +static int path_check(const char *, int); static void usage(void); +/* + * Check to see if the requested module is specified as a filename with no + * path. If so and if a file by the same name exists in the module path, + * warn the user that the module in the path will be used in preference. + */ +static int +path_check(const char *kldname, int quiet) +{ + int mib[5], found; + size_t miblen, pathlen; + char kldpath[MAXPATHLEN]; + char *path, *tmppath, *element; + struct stat sb; + dev_t dev; + ino_t ino; + + if (strchr(kldname, '/') != NULL) { + return (0); + } + if (strstr(kldname, ".ko") == NULL) { + return (0); + } + if (stat(kldname, &sb) != 0) { + return (0); + } + + found = 0; + dev = sb.st_dev; + ino = sb.st_ino; + + miblen = sizeof(mib) / sizeof(mib[0]); + if (sysctlnametomib(PATHCTL, mib, &miblen) != 0) { + err(1, "sysctlnametomib(%s)", PATHCTL); + } + if (sysctl(mib, miblen, NULL, &pathlen, NULL, 0) == -1) { + err(1, "getting path: sysctl(%s) - size only", PATHCTL); + } + path = malloc(pathlen + 1); + if (path == NULL) { + err(1, "allocating %lu bytes for the path", + (unsigned long)pathlen + 1); + } + if (sysctl(mib, miblen, path, &pathlen, NULL, 0) == -1) { + err(1, "getting path: sysctl(%s)", PATHCTL); + } + tmppath = path; + + while ((element = strsep(&tmppath, ";")) != NULL) { + strlcpy(kldpath, element, MAXPATHLEN); + if (kldpath[strlen(kldpath) - 1] != '/') { + strlcat(kldpath, "/", MAXPATHLEN); + } + strlcat(kldpath, kldname, MAXPATHLEN); + + if (stat(kldpath, &sb) == -1) { + continue; + } + + found = 1; + + if (sb.st_dev != dev || sb.st_ino != ino) { + if (!quiet) { + warnx("%s will be loaded from %s, not the " + "current directory", kldname, element); + } + break; + } else if (sb.st_dev == dev && sb.st_ino == ino) { + break; + } + } + + free(path); + + if (!found) { + if (!quiet) { + warnx("%s is not in the module path", kldname); + } + return (-1); + } + + return (0); +} + static void usage(void) { @@ -50,14 +140,21 @@ main(int argc, char** argv) int errors; int fileid; int verbose; + int quiet; errors = 0; verbose = 0; - - while ((c = getopt(argc, argv, "v")) != -1) { + quiet = 0; + + while ((c = getopt(argc, argv, "qv")) != -1) { switch (c) { + case 'q': + quiet = 1; + verbose = 0; + break; case 'v': verbose = 1; + quiet = 0; break; default: usage(); @@ -70,14 +167,18 @@ main(int argc, char** argv) usage(); while (argc-- != 0) { - fileid = kldload(argv[0]); - if (fileid < 0) { - warn("can't load %s", argv[0]); - errors++; - } else { - if (verbose) { - printf("Loaded %s, id=%d\n", argv[0], fileid); + if (path_check(argv[0], quiet) == 0) { + fileid = kldload(argv[0]); + if (fileid < 0) { + warn("can't load %s", argv[0]); + errors++; + } else { + if (verbose) + printf("Loaded %s, id=%d\n", argv[0], + fileid); } + } else { + errors++; } argv++; } From benno at FreeBSD.org Fri Jun 5 03:06:25 2009 From: benno at FreeBSD.org (Benno Rice) Date: Fri Jun 5 03:06:37 2009 Subject: svn commit: r193480 - head/sbin/kldload Message-ID: <200906050306.n5536OUZ012590@svn.freebsd.org> Author: benno Date: Fri Jun 5 03:06:24 2009 New Revision: 193480 URL: http://svn.freebsd.org/changeset/base/193480 Log: Bump document date. Pointed out by: trhodes Modified: head/sbin/kldload/kldload.8 Modified: head/sbin/kldload/kldload.8 ============================================================================== --- head/sbin/kldload/kldload.8 Fri Jun 5 01:18:12 2009 (r193479) +++ head/sbin/kldload/kldload.8 Fri Jun 5 03:06:24 2009 (r193480) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 13, 2006 +.Dd June 5, 2009 .Dt KLDLOAD 8 .Os .Sh NAME From stas at FreeBSD.org Fri Jun 5 06:23:34 2009 From: stas at FreeBSD.org (Stanislav Sedov) Date: Fri Jun 5 06:23:40 2009 Subject: svn commit: r193475 - head/sbin/kldload In-Reply-To: <200906042343.n54Nh8c5008164@svn.freebsd.org> References: <200906042343.n54Nh8c5008164@svn.freebsd.org> Message-ID: <20090605102431.4769115f.stas@FreeBSD.org> On Thu, 4 Jun 2009 23:43:08 +0000 (UTC) Benno Rice mentioned: > + if (path == NULL) { > + err(1, "allocating %lu bytes for the path", > + (unsigned long)pathlen + 1); ^^^^^^^^^^^^^^^^^^^^^^ Why convert pathlen to unsigned long here? The pathlen variable is of size_t type which is already unsigned and we have the special 'z' prefix in printf(3) to print those. -- Stanislav Sedov ST4096-RIPE -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 801 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090605/e89c9888/attachment.pgp From edwin at FreeBSD.org Fri Jun 5 07:57:14 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Fri Jun 5 07:57:20 2009 Subject: svn commit: r193486 - head/games/fortune/datfiles Message-ID: <200906050757.n557vBpJ018340@svn.freebsd.org> Author: edwin Date: Fri Jun 5 07:57:10 2009 New Revision: 193486 URL: http://svn.freebsd.org/changeset/base/193486 Log: Misc fixed to fortunes PR: conf/112024 Submitted by: Niclas Zeising MFC after: 2 days Modified: head/games/fortune/datfiles/fortunes head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Fri Jun 5 06:09:55 2009 (r193485) +++ head/games/fortune/datfiles/fortunes Fri Jun 5 07:57:10 2009 (r193486) @@ -674,8 +674,9 @@ Liza Minnelli. % ... with liberty and justice for all who can afford it. % - 12 + 144 + 20 + 3(4) 2 - ---------------------- + 5(11) = 9 + 0 + 1/2 + 12 + 144 + 20 + 3*4 2 + ---------------------- + 5 * 11 = 9 + 0 7 A dozen, a gross and a score, @@ -758,7 +759,7 @@ his honeymoon a chastened man. He'd bec A farm in the country side had several turkeys, it was known as the house of seven gobbles. % - A father gave his teen-age daughter an untrained pedigreed pup for + A father gave his teenage daughter an untrained pedigreed pup for her birthday. An hour later, when wandered through the house, he found her looking at a puddle in the center of the kitchen. "My pup," she murmured sadly, "runneth over." @@ -2547,7 +2548,7 @@ library and I'm half way through the sec should find what I'm looking for by mid May. I hope I can remember what it was by the time I find it. I had this idea for a new horror film, "VMS Manuals from Hell" or maybe -"The Paper Chase : IBM vs. DEC". It's based on Hitchcock's "The Birds", except +"The Paper Chase: IBM vs. DEC". It's based on Hitchcock's "The Birds", except that it's centered around a programmer who is attacked by a swarm of binder pages with an index number and the single line "This page intentionally left blank." @@ -2941,7 +2942,7 @@ Esther and hustle them off to prison. They can't prove who they are because they've left their passports in their hotel room. For three weeks they're tortured day and night to get them to name their contacts in the liberation -movement.. Finally they're hauled in front of a military court, +movement. Finally they're hauled in front of a military court, charged with espionage, and sentenced to death. The next morning they're lined up in front of the wall where they'll be shot. The sergeant in charge of the firing squad asks them @@ -2998,7 +2999,7 @@ a girl should not do before twenty." "Your mother is right," said the executive, "I don't like a large audience, either." % - NEW YORK-- Kraft Foods, Inc. announced today that its board of + NEW YORK -- Kraft Foods, Inc. announced today that its board of directors unanimously rejected the $11 billion takeover bid by Philip Morris and Co. A Kraft spokesman stated in a press conference that the offer was rejected because the $90-per-share bid did not reflect the @@ -4083,7 +4084,7 @@ right! Can I have a dollar?" % The master programmer moves from program to program without fear. No change in management can harm him. He will not be fired, even if the project -is canceled. Why is this? He is filled with the Tao. +is canceled. Why is this? He is filled with the Tao. -- Geoffrey James, "The Tao of Programming" % The Minnesota Board of Education voted to consider requiring all @@ -4248,7 +4249,7 @@ With a lot of these folks you'd have to make sure that they are Earthlings. Then there's the police. In Portland, when some guy goes bananas, the cops rope off a sixteen block area around him and call a shrink from the medical school who stands atop a patrol car -with a megaphone and shouts, "OK! THIS! ALL! STARTED! WHEN! YOU! WERE! +with a megaphone and shouts, "OK! THIS! ALL! STARTED! WHEN! YOU! WERE! THREE! YEARS! OLD! ON! ACCOUNT! OF! YOUR MOTHER! RIGHT? SO! LET'S! TALK! ABOUT! IT!" Down here they don't waste that kind of time. The LAPD has SWAT teams composed of guys who make Darth Vader look like Mr. Peepers. @@ -4383,7 +4384,7 @@ against a wall, and this was inscribed o warlord Wu. The warlord asked the programmer: "Which is easier to design: an accounting package or an operating system?" "An operating system," replied the programmer. - The warlord uttered an exclamation of disbelief. "Surely an + The warlord uttered an exclamation of disbelief. "Surely an accounting package is trivial next to the complexity of an operating system," he said. "Not so," said the programmer, "when designing an accounting package, @@ -4393,7 +4394,7 @@ tax laws. By contrast, an operating sys appearances. When designing an operating system, the programmer seeks the simplest harmony between machine and ideas. This is why an operating system is easier to design." - The warlord of Wu nodded and smiled. "That is all good and well," + The warlord of Wu nodded and smiled. "That is all good and well," he said, "but which is easier to debug?" The programmer made no reply. -- Geoffrey James, "The Tao of Programming" @@ -4834,7 +4835,7 @@ invariably he can't speak English, and i sure, little lady, it's eleven-thirty. Wanna get high? Don't bother thinking that instant lust will turn into the real thing. It may, but then you may also wake up one morning to find you're the Queen of -Rumania. +Romania. -- Cynthia Hemiel, "Sex Tips for Girls" % "When you wake up in the morning, Pooh," said Piglet at last, @@ -5276,9 +5277,9 @@ marked "450 volts", react as you would n For those who have had too much of Esalen, Topanga, and Kairos. Tired of being genuine all the time? Would you like to learn how to be a little phony again? Have you disclosed so much that you're -beginning to avoid people? Have you touched so many people that -they're all beginning to feel the same? Like to be a little dependent? -Are perfect orgasms beginning to bore you? Would you like, for once, +beginning to avoid people? Have you touched so many people that +they're all beginning to feel the same? Like to be a little dependent? +Are perfect orgasms beginning to bore you? Would you like, for once, not to express a feeling? Or better yet, not be in touch with it at all? Come to us. We promise to relieve you of the burden of your great potential. @@ -6578,7 +6579,7 @@ A critic is a bundle of biases held loos -- Whitney Balliett % A "critic" is a man who creates nothing and thereby feels -qualified to judge the work of creative men. There is logic +qualified to judge the work of creative men. There is logic in this; he is unbiased -- he hates all creative people equally. % A cynic is a person searching for an honest man, with a stolen lantern. @@ -7270,7 +7271,7 @@ A little inaccuracy sometimes saves tons % A little kid went up to Santa and asked him, "Santa, you know when I'm bad right?" And Santa says, "Yes, I do." The little kid then asks, "And you -know when I'm sleeping?" To which Santa replies, "Every minute." So the +know when I'm sleeping?" To which Santa replies, "Every minute." So the little kid then says, "Well, if you know when I'm bad and when I'm good, then how come you don't know what I want for Christmas?" % Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Fri Jun 5 06:09:55 2009 (r193485) +++ head/games/fortune/datfiles/fortunes-o.real Fri Jun 5 07:57:10 2009 (r193486) @@ -1636,7 +1636,7 @@ Jerry Falwell, would get upset about see claim," he jeered, "that my client came at you with a broken bottle in his hand. But is it not true, that you had something in YOUR hand?" - "Yes," he admitted, "his wife. Very charming, of course, but + "Yes," he admitted, "his wife. Very charming, of course, but not much good in a fight." % The devout Jew was beside himself because his son had been dating From brde at optusnet.com.au Fri Jun 5 08:52:12 2009 From: brde at optusnet.com.au (Bruce Evans) Date: Fri Jun 5 08:52:23 2009 Subject: svn commit: r193475 - head/sbin/kldload In-Reply-To: <20090605102431.4769115f.stas@FreeBSD.org> References: <200906042343.n54Nh8c5008164@svn.freebsd.org> <20090605102431.4769115f.stas@FreeBSD.org> Message-ID: <20090605182104.S15688@delplex.bde.org> On Fri, 5 Jun 2009, Stanislav Sedov wrote: > On Thu, 4 Jun 2009 23:43:08 +0000 (UTC) > Benno Rice mentioned: >> [... not quoted] The broken pathname lookup and broken path separator should be in the BUGS section (also in kld syscall manpages). The namespace for the `file' parameter of kldload(2) is completely undocumented in kldload.2. It seems to be the same as the usual namespace for files, except for large complications and undocumentations from having the pathname search and the file extension magic in the kernel. >> + if (path == NULL) { >> + err(1, "allocating %lu bytes for the path", >> + (unsigned long)pathlen + 1); > ^^^^^^^^^^^^^^^^^^^^^^ > Why convert pathlen to unsigned long here? The pathlen variable is > of size_t type which is already unsigned and we have the special 'z' prefix > in printf(3) to print those. Well, %z might be wrong since only the pathlen variable is of type size_t. The expression `pathlen + 1' has type: __binarypromoteof(__typeof(pathlen), int)), so if size_t is smaller than int then the promotions are non-null and give a type larger than size_t, and %z is wrong. To use %z, the expression should be written as (size_t)(pathlen + 1). OTOH, the committed version has no type mismatch, since __binarypromoteof(unsigned long, int)) = unsigned long, and all versions should have no problems with overflow in the addition or in the cast since pathlen should be small (even if unsigned long is smaller than size_t, pathlen should be < ULONG_MAX - 1 so that everything fits). Bruce From brian at FreeBSD.org Fri Jun 5 09:08:55 2009 From: brian at FreeBSD.org (Brian Somers) Date: Fri Jun 5 09:09:01 2009 Subject: svn commit: r193488 - head/usr.bin/tail Message-ID: <200906050908.n5598stI019822@svn.freebsd.org> Author: brian Date: Fri Jun 5 09:08:53 2009 New Revision: 193488 URL: http://svn.freebsd.org/changeset/base/193488 Log: Change the behaviour of -F slightly; it now persists (forever) in trying to open files rather than giving up when it encounters an error. ENOENT errors are not reported. As a result, files that are moved away then recreated are not at risk of being 'lost' to tail. Files that are recreated and temporarily have unreadable permissions will be shown when they are fixed. This behaviour is consistent with the GNU version of tail but without the verbiage that goes with the GNU version. This change also fixes error messages accompanying -f and -F. They no longer report problems with (null)! MFC after: 3 weeks Modified: head/usr.bin/tail/extern.h head/usr.bin/tail/forward.c head/usr.bin/tail/misc.c head/usr.bin/tail/read.c head/usr.bin/tail/reverse.c head/usr.bin/tail/tail.1 head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/extern.h ============================================================================== --- head/usr.bin/tail/extern.h Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/extern.h Fri Jun 5 09:08:53 2009 (r193488) @@ -61,16 +61,15 @@ typedef struct file_info file_info_t; enum STYLE { NOTSET = 0, FBYTES, FLINES, RBYTES, RLINES, REVERSE }; void follow(file_info_t *, enum STYLE, off_t); -void forward(FILE *, enum STYLE, off_t, struct stat *); -void reverse(FILE *, enum STYLE, off_t, struct stat *); +void forward(FILE *, const char *, enum STYLE, off_t, struct stat *); +void reverse(FILE *, const char *, enum STYLE, off_t, struct stat *); -int bytes(FILE *, off_t); -int lines(FILE *, off_t); +int bytes(FILE *, const char *, off_t); +int lines(FILE *, const char *, off_t); -void ierr(void); +void ierr(const char *); void oerr(void); int mapprint(struct mapinfo *, off_t, off_t); int maparound(struct mapinfo *, off_t); extern int Fflag, fflag, qflag, rflag, rval, no_files; -extern const char *fname; Modified: head/usr.bin/tail/forward.c ============================================================================== --- head/usr.bin/tail/forward.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/forward.c Fri Jun 5 09:08:53 2009 (r193488) @@ -61,8 +61,8 @@ static const char sccsid[] = "@(#)forwar #include "extern.h" -static void rlines(FILE *, off_t, struct stat *); -static void show(file_info_t *); +static void rlines(FILE *, const char *fn, off_t, struct stat *); +static int show(file_info_t *); static void set_events(file_info_t *files); /* defines for inner loop actions */ @@ -99,7 +99,7 @@ static const file_info_t *last; * NOREG cyclically read lines into a wrap-around array of buffers */ void -forward(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { int ch; @@ -111,13 +111,13 @@ forward(FILE *fp, enum STYLE style, off_ if (sbp->st_size < off) off = sbp->st_size; if (fseeko(fp, off, SEEK_SET) == -1) { - ierr(); + ierr(fn); return; } } else while (off--) if ((ch = getc(fp)) == EOF) { if (ferror(fp)) { - ierr(); + ierr(fn); return; } break; @@ -129,7 +129,7 @@ forward(FILE *fp, enum STYLE style, off_ for (;;) { if ((ch = getc(fp)) == EOF) { if (ferror(fp)) { - ierr(); + ierr(fn); return; } break; @@ -142,36 +142,36 @@ forward(FILE *fp, enum STYLE style, off_ if (S_ISREG(sbp->st_mode)) { if (sbp->st_size >= off && fseeko(fp, -off, SEEK_END) == -1) { - ierr(); + ierr(fn); return; } } else if (off == 0) { while (getc(fp) != EOF); if (ferror(fp)) { - ierr(); + ierr(fn); return; } } else - if (bytes(fp, off)) + if (bytes(fp, fn, off)) return; break; case RLINES: if (S_ISREG(sbp->st_mode)) if (!off) { if (fseeko(fp, (off_t)0, SEEK_END) == -1) { - ierr(); + ierr(fn); return; } } else - rlines(fp, off, sbp); + rlines(fp, fn, off, sbp); else if (off == 0) { while (getc(fp) != EOF); if (ferror(fp)) { - ierr(); + ierr(fn); return; } } else - if (lines(fp, off)) + if (lines(fp, fn, off)) return; break; default: @@ -182,7 +182,7 @@ forward(FILE *fp, enum STYLE style, off_ if (putchar(ch) == EOF) oerr(); if (ferror(fp)) { - ierr(); + ierr(fn); return; } (void)fflush(stdout); @@ -192,10 +192,7 @@ forward(FILE *fp, enum STYLE style, off_ * rlines -- display the last offset lines of the file. */ static void -rlines(fp, off, sbp) - FILE *fp; - off_t off; - struct stat *sbp; +rlines(FILE *fp, const char *fn, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size; @@ -214,7 +211,7 @@ rlines(fp, off, sbp) curoff = size - 2; while (curoff >= 0) { if (curoff < map.mapoff && maparound(&map, curoff) != 0) { - ierr(); + ierr(fn); return; } for (i = curoff - map.mapoff; i >= 0; i--) @@ -227,41 +224,44 @@ rlines(fp, off, sbp) } curoff++; if (mapprint(&map, curoff, size - curoff) != 0) { - ierr(); + ierr(fn); exit(1); } /* Set the file pointer to reflect the length displayed. */ if (fseeko(fp, sbp->st_size, SEEK_SET) == -1) { - ierr(); + ierr(fn); return; } if (map.start != NULL && munmap(map.start, map.maplen)) { - ierr(); + ierr(fn); return; } } -static void +static int show(file_info_t *file) { - int ch; + int ch; - while ((ch = getc(file->fp)) != EOF) { - if (last != file && no_files > 1) { - if (!qflag) - (void)printf("\n==> %s <==\n", file->file_name); - last = file; - } - if (putchar(ch) == EOF) - oerr(); - } - (void)fflush(stdout); - if (ferror(file->fp)) { - file->fp = NULL; - ierr(); - } else - clearerr(file->fp); + while ((ch = getc(file->fp)) != EOF) { + if (last != file && no_files > 1) { + if (!qflag) + (void)printf("\n==> %s <==\n", file->file_name); + last = file; + } + if (putchar(ch) == EOF) + oerr(); + } + (void)fflush(stdout); + if (ferror(file->fp)) { + fclose(file->fp); + file->fp = NULL; + ierr(file->file_name); + return 0; + } + clearerr(file->fp); + return 1; } static void @@ -309,7 +309,7 @@ set_events(file_info_t *files) void follow(file_info_t *files, enum STYLE style, off_t off) { - int active, i, n = -1; + int active, ev_change, i, n = -1; struct stat sb2; file_info_t *file; struct timespec ts; @@ -325,12 +325,12 @@ follow(file_info_t *files, enum STYLE st n++; if (no_files > 1 && !qflag) (void)printf("\n==> %s <==\n", file->file_name); - forward(file->fp, style, off, &file->st); + forward(file->fp, file->file_name, style, off, &file->st); if (Fflag && fileno(file->fp) != STDIN_FILENO) - n++; + n++; } } - if (! active) + if (!Fflag && !active) return; last = --file; @@ -344,28 +344,56 @@ follow(file_info_t *files, enum STYLE st set_events(files); for (;;) { - for (i = 0, file = files; i < no_files; i++, file++) { - if (! file->fp) - continue; - if (Fflag && file->fp && fileno(file->fp) != STDIN_FILENO) { - if (stat(file->file_name, &sb2) == 0 && - (sb2.st_ino != file->st.st_ino || - sb2.st_dev != file->st.st_dev || - sb2.st_nlink == 0)) { - show(file); - file->fp = freopen(file->file_name, "r", file->fp); - if (file->fp == NULL) { - ierr(); - continue; - } else { - memcpy(&file->st, &sb2, sizeof(struct stat)); - set_events(files); + ev_change = 0; + if (Fflag) { + for (i = 0, file = files; i < no_files; i++, file++) { + if (!file->fp) { + file->fp = fopen(file->file_name, "r"); + if (file->fp != NULL && + fstat(fileno(file->fp), &file->st) + == -1) { + fclose(file->fp); + file->fp = NULL; } + if (file->fp != NULL) + ev_change++; + continue; + } + if (fileno(file->fp) == STDIN_FILENO) + continue; + if (stat(file->file_name, &sb2) == -1) { + if (errno != ENOENT) + ierr(file->file_name); + show(file); + fclose(file->fp); + file->fp = NULL; + ev_change++; + continue; + } + + if (sb2.st_ino != file->st.st_ino || + sb2.st_dev != file->st.st_dev || + sb2.st_nlink == 0) { + show(file); + file->fp = freopen(file->file_name, "r", + file->fp); + if (file->fp != NULL) + memcpy(&file->st, &sb2, + sizeof(struct stat)); + else if (errno != ENOENT) + ierr(file->file_name); + ev_change++; } } - show(file); } + for (i = 0, file = files; i < no_files; i++, file++) + if (file->fp && !show(file)) + ev_change++; + + if (ev_change) + set_events(files); + switch (action) { case USE_KQUEUE: ts.tv_sec = 1; @@ -381,9 +409,9 @@ follow(file_info_t *files, enum STYLE st /* timeout */ break; } else if (ev->filter == EVFILT_READ && ev->data < 0) { - /* file shrank, reposition to end */ + /* file shrank, reposition to end */ if (lseek(ev->ident, (off_t)0, SEEK_END) == -1) { - ierr(); + ierr(file->file_name); continue; } } Modified: head/usr.bin/tail/misc.c ============================================================================== --- head/usr.bin/tail/misc.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/misc.c Fri Jun 5 09:08:53 2009 (r193488) @@ -56,7 +56,7 @@ static const char sccsid[] = "@(#)misc.c #include "extern.h" void -ierr() +ierr(const char *fname) { warn("%s", fname); rval = 1; Modified: head/usr.bin/tail/read.c ============================================================================== --- head/usr.bin/tail/read.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/read.c Fri Jun 5 09:08:53 2009 (r193488) @@ -66,7 +66,7 @@ static const char sccsid[] = "@(#)read.c * the end. */ int -bytes(FILE *fp, off_t off) +bytes(FILE *fp, const char *fn, off_t off) { int ch, len, tlen; char *ep, *p, *t; @@ -84,7 +84,7 @@ bytes(FILE *fp, off_t off) } } if (ferror(fp)) { - ierr(); + ierr(fn); free(sp); return 1; } @@ -136,7 +136,7 @@ bytes(FILE *fp, off_t off) * the end. */ int -lines(FILE *fp, off_t off) +lines(FILE *fp, const char *fn, off_t off) { struct { int blen; @@ -178,7 +178,7 @@ lines(FILE *fp, off_t off) } } if (ferror(fp)) { - ierr(); + ierr(fn); rc = 1; goto done; } Modified: head/usr.bin/tail/reverse.c ============================================================================== --- head/usr.bin/tail/reverse.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/reverse.c Fri Jun 5 09:08:53 2009 (r193488) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -static void r_buf(FILE *); -static void r_reg(FILE *, enum STYLE, off_t, struct stat *); +static void r_buf(FILE *, const char *); +static void r_reg(FILE *, const char *, enum STYLE, off_t, struct stat *); /* * reverse -- display input in reverse order by line. @@ -80,25 +80,25 @@ static void r_reg(FILE *, enum STYLE, of * NOREG cyclically read input into a linked list of buffers */ void -reverse(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +reverse(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { if (style != REVERSE && off == 0) return; if (S_ISREG(sbp->st_mode)) - r_reg(fp, style, off, sbp); + r_reg(fp, fn, style, off, sbp); else switch(style) { case FBYTES: case RBYTES: - bytes(fp, off); + bytes(fp, fn, off); break; case FLINES: case RLINES: - lines(fp, off); + lines(fp, fn, off); break; case REVERSE: - r_buf(fp); + r_buf(fp, fn); break; default: break; @@ -109,7 +109,7 @@ reverse(FILE *fp, enum STYLE style, off_ * r_reg -- display a regular file in reverse order by line. */ static void -r_reg(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) +r_reg(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size, lineend; @@ -132,7 +132,7 @@ r_reg(FILE *fp, enum STYLE style, off_t if (curoff < map.mapoff || curoff >= map.mapoff + (off_t)map.maplen) { if (maparound(&map, curoff) != 0) { - ierr(); + ierr(fn); return; } } @@ -149,7 +149,7 @@ r_reg(FILE *fp, enum STYLE style, off_t /* Print the line and update offsets. */ if (mapprint(&map, curoff + 1, lineend - curoff - 1) != 0) { - ierr(); + ierr(fn); return; } lineend = curoff + 1; @@ -165,11 +165,11 @@ r_reg(FILE *fp, enum STYLE style, off_t } } if (curoff < 0 && mapprint(&map, 0, lineend) != 0) { - ierr(); + ierr(fn); return; } if (map.start != NULL && munmap(map.start, map.maplen)) - ierr(); + ierr(fn); } typedef struct bf { @@ -190,7 +190,7 @@ typedef struct bf { * user warned). */ static void -r_buf(FILE *fp) +r_buf(FILE *fp, const char *fn) { BF *mark, *tl, *tr; int ch, len, llen; @@ -227,7 +227,7 @@ r_buf(FILE *fp) *p++ = ch; if (ferror(fp)) { - ierr(); + ierr(fn); return; } Modified: head/usr.bin/tail/tail.1 ============================================================================== --- head/usr.bin/tail/tail.1 Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/tail.1 Fri Jun 5 09:08:53 2009 (r193488) @@ -35,7 +35,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 29, 2006 +.Dd June 05, 2009 .Dt TAIL 1 .Os .Sh NAME @@ -106,9 +106,16 @@ will also check to see if the file being The file is closed and reopened when .Nm detects that the filename being read from has a new inode number. +.Pp +If the file being followed does not (yet) exist or if it is removed, tail +will keep looking and will display the file from the beginning if and when +it is created. +.Pp The .Fl F -option is ignored if reading from standard input rather than a file. +option is the same as the +.Fl f +option if reading from standard input rather than a file. .It Fl n Ar number The location is .Ar number Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Fri Jun 5 08:37:11 2009 (r193487) +++ head/usr.bin/tail/tail.c Fri Jun 5 09:08:53 2009 (r193488) @@ -61,7 +61,6 @@ static const char sccsid[] = "@(#)tail.c #include "extern.h" int Fflag, fflag, qflag, rflag, rval, no_files; -const char *fname; file_info_t *files; @@ -72,6 +71,7 @@ int main(int argc, char *argv[]) { struct stat sb; + const char *fn; FILE *fp; off_t off; enum STYLE style; @@ -175,20 +175,23 @@ main(int argc, char *argv[]) } if (*argv && fflag) { - files = (struct file_info *) malloc(no_files * sizeof(struct file_info)); - if (! files) + files = (struct file_info *) malloc(no_files * + sizeof(struct file_info)); + if (!files) err(1, "Couldn't malloc space for file descriptors."); - for (file = files; (fname = *argv++); file++) { - file->file_name = malloc(strlen(fname)+1); + for (file = files; (fn = *argv++); file++) { + file->file_name = strdup(fn); if (! file->file_name) errx(1, "Couldn't malloc space for file name."); - strncpy(file->file_name, fname, strlen(fname)+1); if ((file->fp = fopen(file->file_name, "r")) == NULL || fstat(fileno(file->fp), &file->st)) { - file->fp = NULL; - ierr(); - continue; + if (file->fp != NULL) { + fclose(file->fp); + file->fp = NULL; + } + if (!Fflag || errno != ENOENT) + ierr(file->file_name); } } follow(files, style, off); @@ -197,29 +200,29 @@ main(int argc, char *argv[]) } free(files); } else if (*argv) { - for (first = 1; (fname = *argv++);) { - if ((fp = fopen(fname, "r")) == NULL || + for (first = 1; (fn = *argv++);) { + if ((fp = fopen(fn, "r")) == NULL || fstat(fileno(fp), &sb)) { - ierr(); + ierr(fn); continue; } if (argc > 1 && !qflag) { (void)printf("%s==> %s <==\n", - first ? "" : "\n", fname); + first ? "" : "\n", fn); first = 0; (void)fflush(stdout); } if (rflag) - reverse(fp, style, off, &sb); + reverse(fp, fn, style, off, &sb); else - forward(fp, style, off, &sb); + forward(fp, fn, style, off, &sb); } } else { - fname = "stdin"; + fn = "stdin"; if (fstat(fileno(stdin), &sb)) { - ierr(); + ierr(fn); exit(1); } @@ -234,9 +237,9 @@ main(int argc, char *argv[]) } if (rflag) - reverse(stdin, style, off, &sb); + reverse(stdin, fn, style, off, &sb); else - forward(stdin, style, off, &sb); + forward(stdin, fn, style, off, &sb); } exit(rval); } From raj at FreeBSD.org Fri Jun 5 09:09:47 2009 From: raj at FreeBSD.org (Rafal Jaworowski) Date: Fri Jun 5 09:09:58 2009 Subject: svn commit: r193489 - head/sys/powerpc/booke Message-ID: <200906050909.n5599kOe019892@svn.freebsd.org> Author: raj Date: Fri Jun 5 09:09:46 2009 New Revision: 193489 URL: http://svn.freebsd.org/changeset/base/193489 Log: Fill PTEs covering kernel code and data. Without this fix pte_vatopa() was not able to retrieve physical address of data structures inside kernel, for example EFAULT was reported while acessing /dev/kmem ('netstat -nr'). Submitted by: Piotr Ziecik Obtained from: Semihalf Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Jun 5 09:08:53 2009 (r193488) +++ head/sys/powerpc/booke/pmap.c Fri Jun 5 09:09:46 2009 (r193489) @@ -966,8 +966,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset u_int s, e, sz; u_int phys_avail_count; vm_size_t physsz, hwphyssz, kstack0_sz; - vm_offset_t kernel_pdir, kstack0; + vm_offset_t kernel_pdir, kstack0, va; vm_paddr_t kstack0_phys; + pte_t *pte; debugf("mmu_booke_bootstrap: entered\n"); @@ -1216,6 +1217,19 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Initialize each CPU's tidbusy entry 0 with kernel_pmap */ tidbusy[i][0] = kernel_pmap; } + + /* + * Fill in PTEs covering kernel code and data. They are not required + * for address translation, as this area is covered by static TLB1 + * entries, but for pte_vatopa() to work correctly with kernel area + * addresses. + */ + for (va = KERNBASE; va < data_end; va += PAGE_SIZE) { + pte = &(kernel_pmap->pm_pdir[PDIR_IDX(va)][PTBL_IDX(va)]); + pte->rpn = kernload + (va - KERNBASE); + pte->flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | + PTE_VALID; + } /* Mark kernel_pmap active on all CPUs */ kernel_pmap->pm_active = ~0; From brian at FreeBSD.org Fri Jun 5 09:16:52 2009 From: brian at FreeBSD.org (Brian Somers) Date: Fri Jun 5 09:16:59 2009 Subject: svn commit: r193490 - head/sys/kern Message-ID: <200906050916.n559Gqr8020095@svn.freebsd.org> Author: brian Date: Fri Jun 5 09:16:52 2009 New Revision: 193490 URL: http://svn.freebsd.org/changeset/base/193490 Log: If we're passed garbage in malloc_init(), panic() rather than expecting a KASSERT to handle it. People are likely to turn off INVARIANTS RSN and loading an old module can cause garbage-in here. I saw the issue with an older nvidia driver (x11/nvidia-driver) loading into a new kernel - a crash wasn't seen 'till sysctl_kern_malloc_stats(). I was lucky that mtp->ks_shortdesc was NULL and not something horrible. While I'm here, KASSERT that malloc_uninit() isn't passed something that's not in kmemstatistics. MFC after: 3 weeks Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Jun 5 09:09:46 2009 (r193489) +++ head/sys/kern/kern_malloc.c Fri Jun 5 09:16:52 2009 (r193490) @@ -675,8 +675,8 @@ malloc_init(void *data) KASSERT(cnt.v_page_count != 0, ("malloc_register before vm_init")); mtp = data; - KASSERT(mtp->ks_magic == M_MAGIC, - ("malloc_init: bad malloc type magic")); + if (mtp->ks_magic != M_MAGIC) + panic("malloc_init: bad malloc type magic"); mtip = uma_zalloc(mt_zone, M_WAITOK | M_ZERO); mtp->ks_handle = mtip; @@ -709,9 +709,13 @@ malloc_uninit(void *data) if (mtp != kmemstatistics) { for (temp = kmemstatistics; temp != NULL; temp = temp->ks_next) { - if (temp->ks_next == mtp) + if (temp->ks_next == mtp) { temp->ks_next = mtp->ks_next; + break; + } } + KASSERT(temp, + ("malloc_uninit: type '%s' not found", mtp->ks_shortdesc)); } else kmemstatistics = mtp->ks_next; kmemcount--; From raj at FreeBSD.org Fri Jun 5 09:46:01 2009 From: raj at FreeBSD.org (Rafal Jaworowski) Date: Fri Jun 5 09:46:12 2009 Subject: svn commit: r193492 - head/sys/powerpc/booke Message-ID: <200906050946.n559k0xD020724@svn.freebsd.org> Author: raj Date: Fri Jun 5 09:46:00 2009 New Revision: 193492 URL: http://svn.freebsd.org/changeset/base/193492 Log: Discover and handle the number of E500 CPUs in run time. Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Fri Jun 5 09:21:03 2009 (r193491) +++ head/sys/powerpc/booke/platform_bare.c Fri Jun 5 09:46:00 2009 (r193492) @@ -56,7 +56,7 @@ extern uint8_t __boot_page[]; /* Boot p extern uint32_t kernload; /* Kernel physical load address */ #endif -static int cpu; +static int cpu, maxcpu; static int bare_probe(platform_t); static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz, @@ -91,6 +91,13 @@ PLATFORM_DEF(bare_platform); static int bare_probe(platform_t plat) { + uint32_t ver; + + ver = SVR_VER(mfspr(SPR_SVR)); + if (ver == SVR_MPC8572E || ver == SVR_MPC8572) + maxcpu = 2; + else + maxcpu = 1; return (BUS_PROBE_GENERIC); } @@ -161,7 +168,7 @@ static int bare_smp_next_cpu(platform_t plat, struct cpuref *cpuref) { - if (cpu >= MAXCPU) + if (cpu >= maxcpu) return (ENOENT); cpuref->cr_cpuid = cpu++; From luigi at FreeBSD.org Fri Jun 5 12:49:55 2009 From: luigi at FreeBSD.org (Luigi Rizzo) Date: Fri Jun 5 12:50:02 2009 Subject: svn commit: r193497 - head/sys/netinet Message-ID: <200906051249.n55CnsYk025900@svn.freebsd.org> Author: luigi Date: Fri Jun 5 12:49:54 2009 New Revision: 193497 URL: http://svn.freebsd.org/changeset/base/193497 Log: Small changes (no actual code changes) in preparation of moving ipfw-related stuff to its own directory, and cleaning headers and dependencies: In this commit: + remove one use of a typedef; + document dn_rule_delete(); + replace one usage of the DUMMYNET_LOADED macro with its value; No MFC planned until the cleanup is complete. Modified: head/sys/netinet/ip_dummynet.c Modified: head/sys/netinet/ip_dummynet.c ============================================================================== --- head/sys/netinet/ip_dummynet.c Fri Jun 5 12:35:56 2009 (r193496) +++ head/sys/netinet/ip_dummynet.c Fri Jun 5 12:49:54 2009 (r193497) @@ -242,7 +242,7 @@ static void dummynet(void *); static void dummynet_flush(void); static void dummynet_send(struct mbuf *); void dummynet_drain(void); -static ip_dn_io_t dummynet_io; +static int dummynet_io(struct mbuf **, int , struct ip_fw_args *); static void dn_rule_delete(void *); /* @@ -1638,9 +1638,11 @@ dn_rule_delete_fs(struct dn_flow_set *fs pkt->rule = ip_fw_default_rule ; } } + /* - * when a firewall rule is deleted, scan all queues and remove the flow-id - * from packets matching this rule. + * When a firewall rule is deleted, scan all queues and remove the pointer + * to the rule from matching packets, making them point to the default rule. + * The pointer is used to reinject packets in case one_pass = 0. */ void dn_rule_delete(void *r) @@ -2337,7 +2339,7 @@ dummynet_modevent(module_t mod, int type switch (type) { case MOD_LOAD: - if (DUMMYNET_LOADED) { + if (ip_dn_io_ptr) { printf("DUMMYNET already loaded\n"); return EEXIST ; } From edwin at FreeBSD.org Fri Jun 5 13:05:14 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Fri Jun 5 13:05:26 2009 Subject: svn commit: r193498 - head/share/timedef Message-ID: <200906051305.n55D5Eu8026282@svn.freebsd.org> Author: edwin Date: Fri Jun 5 13:05:14 2009 New Revision: 193498 URL: http://svn.freebsd.org/changeset/base/193498 Log: [patch] Portuguese timedef In Portuguese, the names of the days of the week are not capitalized. Also there is always a dash before "feira" in the names of the days. For example: "segunda-feira" and not "segunda feira" (which has a completely different meaning). x_fmt is not correct either. The date separator should not be a dot but a slash. Example: 31/12/2005 if far more used in Portugal than 31.12.2005. References: - a Portuguese online dictionary http://priberam.pt/dlpo/dlpo.aspx - http://answers.com/days_of_the_week (there are translations to various languages, including Portuguese, at the bottom of the page) - http://en.wikipedia.org/wiki/Week-day_names (there are translations to various languages, including Portuguese, at the bottom of the page) - a Portuguese style guide http://www.publico.clix.pt/nos/livro_estilo/16d-palavras.html ("datas" section) PR: conf/58595 Submitted by: Chris Stenton MFC after: 1 week Modified: head/share/timedef/pt_PT.ISO8859-1.src head/share/timedef/pt_PT.UTF-8.src Modified: head/share/timedef/pt_PT.ISO8859-1.src ============================================================================== --- head/share/timedef/pt_PT.ISO8859-1.src Fri Jun 5 12:49:54 2009 (r193497) +++ head/share/timedef/pt_PT.ISO8859-1.src Fri Jun 5 13:05:14 2009 (r193498) @@ -36,23 +36,23 @@ Dezembro # # Short weekday names # -Dom -Seg -Ter -Qua -Qui -Sex -Sáb +dom +seg +ter +qua +qui +sex +sáb # # Long weekday names # -Domingo -Segunda Feira -Terça Feira -Quarta Feira -Quinta Feira -Sexta Feira -Sábado +domingo +segunda-feira +terça-feira +quarta-feira +quinta-feira +sexta-feira +sábado # # X_fmt # @@ -60,7 +60,7 @@ Sábado # # x_fmt # -%d.%m.%Y +%d/%m/%Y # # c_fmt # Modified: head/share/timedef/pt_PT.UTF-8.src ============================================================================== --- head/share/timedef/pt_PT.UTF-8.src Fri Jun 5 12:49:54 2009 (r193497) +++ head/share/timedef/pt_PT.UTF-8.src Fri Jun 5 13:05:14 2009 (r193498) @@ -36,23 +36,23 @@ Dezembro # # Short weekday names # -Dom -Seg -Ter -Qua -Qui -Sex -Sáb +dom +seg +ter +qua +qui +sex +sáb # # Long weekday names # -Domingo -Segunda Feira -Terça Feira -Quarta Feira -Quinta Feira -Sexta Feira -Sábado +domingo +segunda-feira +terça-feira +quarta-feira +quinta-feira +sexta-feira +sábado # # X_fmt # @@ -60,7 +60,7 @@ Sábado # # x_fmt # -%d.%m.%Y +%d/%m/%Y # # c_fmt # From luigi at FreeBSD.org Fri Jun 5 13:11:35 2009 From: luigi at FreeBSD.org (Luigi Rizzo) Date: Fri Jun 5 13:11:46 2009 Subject: svn commit: r193500 - head/sbin/ipfw Message-ID: <200906051311.n55DBYAR026495@svn.freebsd.org> Author: luigi Date: Fri Jun 5 13:11:34 2009 New Revision: 193500 URL: http://svn.freebsd.org/changeset/base/193500 Log: remove a printf that was only useful for debugging. MFC after: 3 days Modified: head/sbin/ipfw/dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Fri Jun 5 13:07:36 2009 (r193499) +++ head/sbin/ipfw/dummynet.c Fri Jun 5 13:11:34 2009 (r193500) @@ -314,8 +314,6 @@ ipfw_list_pipes(void *data, uint nbytes, print_extra_delay_parms(p, prefix); print_flowset_parms(&(p->fs), prefix); - if (co.verbose) - printf(" V %20llu\n", align_uint64(&p->V) >> MY_M); q = (struct dn_flow_queue *)(p+1); list_queues(&(p->fs), q); From jilles at stack.nl Fri Jun 5 13:25:36 2009 From: jilles at stack.nl (Jilles Tjoelker) Date: Fri Jun 5 13:25:46 2009 Subject: svn commit: r193475 - head/sbin/kldload In-Reply-To: <20090605182104.S15688@delplex.bde.org> References: <200906042343.n54Nh8c5008164@svn.freebsd.org> <20090605102431.4769115f.stas@FreeBSD.org> <20090605182104.S15688@delplex.bde.org> Message-ID: <20090605132519.GA4091@stack.nl> On Fri, Jun 05, 2009 at 06:52:07PM +1000, Bruce Evans wrote: > Well, %z might be wrong since only the pathlen variable is of type size_t. > The expression `pathlen + 1' has type: > __binarypromoteof(__typeof(pathlen), int)), > so if size_t is smaller than int then the promotions are non-null and give > a type larger than size_t, and %z is wrong. To use %z, the expression > should be written as (size_t)(pathlen + 1). The promotion is not a problem because it would happen anyway, as it is an unprototyped parameter. printf and the like know this. -- Jilles Tjoelker From luigi at FreeBSD.org Fri Jun 5 13:44:31 2009 From: luigi at FreeBSD.org (Luigi Rizzo) Date: Fri Jun 5 13:44:38 2009 Subject: svn commit: r193502 - in head/sys: net netinet Message-ID: <200906051344.n55DiUdT027226@svn.freebsd.org> Author: luigi Date: Fri Jun 5 13:44:30 2009 New Revision: 193502 URL: http://svn.freebsd.org/changeset/base/193502 Log: More cleanup in preparation of ipfw relocation (no actual code change): + move ipfw and dummynet hooks declarations to raw_ip.c (definitions in ip_var.h) same as for most other global variables. This removes some dependencies from ip_input.c; + remove the IPFW_LOADED macro, just test ip_fw_chk_ptr directly; + remove the DUMMYNET_LOADED macro, just test ip_dn_io_ptr directly; + move ip_dn_ruledel_ptr to ip_fw2.c which is the only file using it; To be merged together with rev 193497 MFC after: 5 days Modified: head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/netinet/ip_dummynet.h head/sys/netinet/ip_fw.h head/sys/netinet/ip_fw2.c head/sys/netinet/ip_fw_pfil.c head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h head/sys/netinet/raw_ip.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/net/if_bridge.c Fri Jun 5 13:44:30 2009 (r193502) @@ -3039,7 +3039,7 @@ bridge_pfil(struct mbuf **mp, struct ifn goto bad; } - if (IPFW_LOADED && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { + if (ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { INIT_VNET_INET(curvnet); error = -1; @@ -3058,7 +3058,7 @@ bridge_pfil(struct mbuf **mp, struct ifn if (*mp == NULL) return (error); - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* put the Ethernet header back on */ M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT); Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/net/if_ethersubr.c Fri Jun 5 13:44:30 2009 (r193502) @@ -432,7 +432,7 @@ ether_output_frame(struct ifnet *ifp, st INIT_VNET_NET(ifp->if_vnet); struct ip_fw *rule = ip_dn_claim_rule(m); - if (IPFW_LOADED && V_ether_ipfw != 0) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0) { if (ether_ipfw_chk(&m, ifp, &rule, 0) == 0) { if (m) { m_freem(m); @@ -520,7 +520,7 @@ ether_ipfw_chk(struct mbuf **m0, struct if (i == IP_FW_PASS) /* a PASS rule. */ return 1; - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* * Pass the pkt to dummynet, which consumes it. * If shared, make a copy and keep the original. @@ -766,7 +766,7 @@ ether_demux(struct ifnet *ifp, struct mb * Allow dummynet and/or ipfw to claim the frame. * Do not do this for PROMISC frames in case we are re-entered. */ - if (IPFW_LOADED && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { struct ip_fw *rule = ip_dn_claim_rule(m); if (ether_ipfw_chk(&m, NULL, &rule, 0) == 0) { Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_dummynet.h Fri Jun 5 13:44:30 2009 (r193502) @@ -373,13 +373,6 @@ struct dn_pipe_max { SLIST_HEAD(dn_pipe_head, dn_pipe); #ifdef _KERNEL -typedef int ip_dn_ctl_t(struct sockopt *); /* raw_ip.c */ -typedef void ip_dn_ruledel_t(void *); /* ip_fw.c */ -typedef int ip_dn_io_t(struct mbuf **m, int dir, struct ip_fw_args *fwa); -extern ip_dn_ctl_t *ip_dn_ctl_ptr; -extern ip_dn_ruledel_t *ip_dn_ruledel_ptr; -extern ip_dn_io_t *ip_dn_io_ptr; -#define DUMMYNET_LOADED (ip_dn_io_ptr != NULL) /* * Return the IPFW rule associated with the dummynet tag; if any. Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_fw.h Fri Jun 5 13:44:30 2009 (r193502) @@ -636,9 +636,6 @@ void ipfw_destroy(void); void ipfw_nat_destroy(void); #endif -typedef int ip_fw_ctl_t(struct sockopt *); -extern ip_fw_ctl_t *ip_fw_ctl_ptr; - #ifdef VIMAGE_GLOBALS extern int fw_one_pass; extern int fw_enable; @@ -647,11 +644,6 @@ extern int fw6_enable; #endif #endif -/* For kernel ipfw_ether and ipfw_bridge. */ -typedef int ip_fw_chk_t(struct ip_fw_args *args); -extern ip_fw_chk_t *ip_fw_chk_ptr; -#define IPFW_LOADED (ip_fw_chk_ptr != NULL) - struct ip_fw_chain { struct ip_fw *rules; /* list of rules */ struct ip_fw *reap; /* list of rules to reap */ Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_fw2.c Fri Jun 5 13:44:30 2009 (r193502) @@ -3603,6 +3603,12 @@ remove_rule(struct ip_fw_chain *chain, s return n; } +/* + * Hook for cleaning up dummynet when an ipfw rule is deleted. + * Set/cleared when dummynet module is loaded/unloaded. + */ +void (*ip_dn_ruledel_ptr)(void *) = NULL; + /** * Reclaim storage associated with a list of rules. This is * typically the list created using remove_rule. @@ -3614,7 +3620,7 @@ reap_rules(struct ip_fw *head) while ((rule = head) != NULL) { head = head->next; - if (DUMMYNET_LOADED) + if (ip_dn_ruledel_ptr) ip_dn_ruledel_ptr(rule); free(rule, M_IPFW); } Modified: head/sys/netinet/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ip_fw_pfil.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_fw_pfil.c Fri Jun 5 13:44:30 2009 (r193502) @@ -77,9 +77,6 @@ int fw6_enable = 1; int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); -/* Dummynet hooks. */ -ip_dn_ruledel_t *ip_dn_ruledel_ptr = NULL; - /* Divert hooks. */ ip_divert_packet_t *ip_divert_ptr = NULL; @@ -167,7 +164,7 @@ again: break; /* not reached */ case IP_FW_DUMMYNET: - if (!DUMMYNET_LOADED) + if (ip_dn_io_ptr == NULL) goto drop; if (mtod(*m0, struct ip *)->ip_v == 4) ip_dn_io_ptr(m0, DN_TO_IP_IN, &args); @@ -302,7 +299,7 @@ again: break; /* not reached */ case IP_FW_DUMMYNET: - if (!DUMMYNET_LOADED) + if (ip_dn_io_ptr == NULL) break; if (mtod(*m0, struct ip *)->ip_v == 4) ip_dn_io_ptr(m0, DN_TO_IP_OUT, &args); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_input.c Fri Jun 5 13:44:30 2009 (r193502) @@ -85,10 +85,6 @@ __FBSDID("$FreeBSD$"); #include -/* XXX: Temporary until ipfw_ether and ipfw_bridge are converted. */ -#include -#include - #include #ifdef CTASSERT @@ -217,12 +213,6 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet CTLFLAG_RDTUN, ip_output_flowtable_size, 2048, "number of entries in the per-cpu output flow caches"); -/* - * ipfw_ether and ipfw_bridge hooks. - * XXX: Temporary until those are converted to pfil_hooks as well. - */ -ip_fw_chk_t *ip_fw_chk_ptr = NULL; -ip_dn_io_t *ip_dn_io_ptr = NULL; #ifdef VIMAGE_GLOBALS int fw_one_pass; #endif Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/ip_var.h Fri Jun 5 13:44:30 2009 (r193502) @@ -173,7 +173,8 @@ extern int ipstealth; /* stealth forwar extern int rsvp_on; extern struct socket *ip_rsvpd; /* reservation protocol daemon */ extern struct socket *ip_mrouter; /* multicast routing daemon */ -#endif +#endif /* VIMAGE_GLOBALS */ + extern u_char ip_protox[]; extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); @@ -223,6 +224,13 @@ extern struct pfil_head inet_pfil_hook; void in_delayed_cksum(struct mbuf *m); +/* ipfw and dummynet hooks. Most are declared in raw_ip.c */ +struct ip_fw_args; +extern int (*ip_fw_chk_ptr)(struct ip_fw_args *args); +extern int (*ip_fw_ctl_ptr)(struct sockopt *); +extern int (*ip_dn_ctl_ptr)(struct sockopt *); +extern int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa); +extern void (*ip_dn_ruledel_ptr)(void *); /* in ip_fw2.c */ #endif /* _KERNEL */ #endif /* !_NETINET_IP_VAR_H_ */ Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Fri Jun 5 13:32:10 2009 (r193501) +++ head/sys/netinet/raw_ip.c Fri Jun 5 13:44:30 2009 (r193502) @@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #ifdef IPSEC @@ -85,9 +83,15 @@ struct inpcbhead ripcb; struct inpcbinfo ripcbinfo; #endif -/* control hooks for ipfw and dummynet */ -ip_fw_ctl_t *ip_fw_ctl_ptr = NULL; -ip_dn_ctl_t *ip_dn_ctl_ptr = NULL; +/* + * Control and data hooks for ipfw and dummynet. + * The data hooks are not used here but it is convenient + * to keep them all in one place. + */ +int (*ip_fw_ctl_ptr)(struct sockopt *) = NULL; +int (*ip_dn_ctl_ptr)(struct sockopt *) = NULL; +int (*ip_fw_chk_ptr)(struct ip_fw_args *args) = NULL; +int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL; /* * Hooks for multicast routing. They all default to NULL, so leave them not From rwatson at FreeBSD.org Fri Jun 5 13:55:35 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Fri Jun 5 13:55:59 2009 Subject: svn commit: r193504 - head/sys/net80211 Message-ID: <200906051355.n55DtYWP027563@svn.freebsd.org> Author: rwatson Date: Fri Jun 5 13:55:33 2009 New Revision: 193504 URL: http://svn.freebsd.org/changeset/base/193504 Log: Fix spelling of MAC check for 8.x version of MAC Framework, not noticed due to a lack of an opt_mac.h include, which I won't add for now as options MAC will soon move to opt_global.h. Spotted by: pjd Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Jun 5 13:50:19 2009 (r193503) +++ head/sys/net80211/ieee80211_output.c Fri Jun 5 13:55:33 2009 (r193504) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #define ETHER_HEADER_COPY(dst, src) \ memcpy(dst, src, sizeof(struct ether_header)) @@ -354,7 +356,7 @@ ieee80211_output(struct ifnet *ifp, stru if (dst->sa_family != AF_IEEE80211) return vap->iv_output(ifp, m, dst, ro); #ifdef MAC - error = mac_check_ifnet_transmit(ifp, m); + error = mac_ifnet_check_transmit(ifp, m); if (error) senderr(error); #endif From jhb at FreeBSD.org Fri Jun 5 14:07:01 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Fri Jun 5 14:07:12 2009 Subject: svn commit: r193506 - head/sys/sys Message-ID: <200906051407.n55E70EA027867@svn.freebsd.org> Author: jhb Date: Fri Jun 5 14:07:00 2009 New Revision: 193506 URL: http://svn.freebsd.org/changeset/base/193506 Log: Trim old remnants of per-CPU KTR buffers. Submitted by: Eygene Ryabinkin Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Jun 5 14:04:36 2009 (r193505) +++ head/sys/sys/pcpu.h Fri Jun 5 14:07:00 2009 (r193506) @@ -76,10 +76,6 @@ struct pcpu { cpumask_t pc_other_cpus; /* Mask of all other cpus */ SLIST_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; -#ifdef KTR_PERCPU - int pc_ktr_idx; /* Index into trace table */ - char *pc_ktr_buf; -#endif #ifdef KTR char pc_name[PCPU_NAME_LEN]; /* String name for KTR. */ #endif From gavin at FreeBSD.org Fri Jun 5 14:08:30 2009 From: gavin at FreeBSD.org (Gavin Atkinson) Date: Fri Jun 5 14:08:37 2009 Subject: svn commit: r193498 - head/share/timedef In-Reply-To: <200906051305.n55D5Eu8026282@svn.freebsd.org> References: <200906051305.n55D5Eu8026282@svn.freebsd.org> Message-ID: <1244209084.48730.10.camel@buffy.york.ac.uk> On Fri, 2009-06-05 at 13:05 +0000, Edwin Groothuis wrote: > Author: edwin > Date: Fri Jun 5 13:05:14 2009 > New Revision: 193498 > URL: http://svn.freebsd.org/changeset/base/193498 > > Log: > [patch] Portuguese timedef > > In Portuguese, the names of the days of the week are not capitalized. > Also there is always a dash before "feira" in the names of the days. > For example: "segunda-feira" and not "segunda feira" (which has a > completely different meaning). > > x_fmt is not correct either. The date separator should not be a dot > but a slash. Example: 31/12/2005 if far more used in Portugal than > 31.12.2005. > > References: > - a Portuguese online dictionary http://priberam.pt/dlpo/dlpo.aspx > - http://answers.com/days_of_the_week (there are translations to > various languages, including Portuguese, at the bottom of the > page) > - http://en.wikipedia.org/wiki/Week-day_names (there are translations > to various languages, including Portuguese, at the bottom of the > page) > - a Portuguese style guide > http://www.publico.clix.pt/nos/livro_estilo/16d-palavras.html > ("datas" section) > > PR: conf/58595 > Submitted by: Chris Stenton > MFC after: 1 week Actually, PR: conf/95754 Submitted by: Miguel Saturnino It's great to see somebody touching the locale PRs, there are quite a few of them [1] and most of them have supplied patches that seem "obviously" correct. Thanks! [1] http://people.freebsd.org/~linimon/studies/prs/prs_for_tag_locale.html Gavin From rwatson at FreeBSD.org Fri Jun 5 14:15:02 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Fri Jun 5 14:15:08 2009 Subject: svn commit: r193507 - head/sys/fs/nfs Message-ID: <200906051415.n55EF072028116@svn.freebsd.org> Author: rwatson Date: Fri Jun 5 14:15:00 2009 New Revision: 193507 URL: http://svn.freebsd.org/changeset/base/193507 Log: Don't check MAC in the NFS server ACL set path, right now we aren't enforcing MAC for NFS clients. Modified: head/sys/fs/nfs/nfs_commonacl.c Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Fri Jun 5 14:07:00 2009 (r193506) +++ head/sys/fs/nfs/nfs_commonacl.c Fri Jun 5 14:15:00 2009 (r193507) @@ -703,10 +703,6 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, if (aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) return (NFSERR_ATTRNOTSUPP); error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); -#ifdef MAC - if (!error) - error = mac_check_vnode_setacl(cred, vp, ACL_TYPE_NFS4, aclp); -#endif if (!error) error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); return (error); From rwatson at FreeBSD.org Fri Jun 5 14:23:25 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Fri Jun 5 14:23:32 2009 Subject: svn commit: r193508 - head/sys/kern Message-ID: <200906051423.n55ENOqx028334@svn.freebsd.org> Author: rwatson Date: Fri Jun 5 14:23:24 2009 New Revision: 193508 URL: http://svn.freebsd.org/changeset/base/193508 Log: Add mac_framework.h include missed when MAC code was (presumably) copied from another file. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Jun 5 14:15:00 2009 (r193507) +++ head/sys/kern/vfs_default.c Fri Jun 5 14:23:24 2009 (r193508) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include From rwatson at FreeBSD.org Fri Jun 5 14:29:50 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Fri Jun 5 14:29:56 2009 Subject: svn commit: r193509 - head/sys/rpc Message-ID: <200906051429.n55ETnZ0028473@svn.freebsd.org> Author: rwatson Date: Fri Jun 5 14:29:49 2009 New Revision: 193509 URL: http://svn.freebsd.org/changeset/base/193509 Log: Correct MAC compile problems resulting from the new RPC code copying and pasting code from the general socket code without also bringing along required opt_mac.h includes. Modified: head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Fri Jun 5 14:23:24 2009 (r193508) +++ head/sys/rpc/svc_vc.c Fri Jun 5 14:29:49 2009 (r193509) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include +#include + static bool_t svc_vc_rendezvous_recv(SVCXPRT *, struct rpc_msg *, struct sockaddr **, struct mbuf **); static enum xprt_stat svc_vc_rendezvous_stat(SVCXPRT *); @@ -273,7 +276,7 @@ svc_vc_accept(struct socket *head, struc goto done; } #ifdef MAC - error = mac_socket_check_accept(td->td_ucred, head); + error = mac_socket_check_accept(curthread->td_ucred, head); if (error != 0) goto done; #endif From rwatson at FreeBSD.org Fri Jun 5 14:31:04 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Fri Jun 5 14:31:16 2009 Subject: svn commit: r193510 - head/sys/netinet Message-ID: <200906051431.n55EV3uE028547@svn.freebsd.org> Author: rwatson Date: Fri Jun 5 14:31:03 2009 New Revision: 193510 URL: http://svn.freebsd.org/changeset/base/193510 Log: Unifdef MAC label pointer in syncache entries -- in general, ifdef'd structure contents are a bad idea in the kernel for binary compatibility reasons, and this is a single pointer that is now included in compiles by default anyway due to options MAC being in GENERIC. Modified: head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Fri Jun 5 14:29:49 2009 (r193509) +++ head/sys/netinet/tcp_syncache.h Fri Jun 5 14:31:03 2009 (r193510) @@ -74,9 +74,7 @@ struct syncache { struct toe_usrreqs *sc_tu; /* TOE operations */ void *sc_toepcb; /* TOE protocol block */ #endif -#ifdef MAC struct label *sc_label; /* MAC label reference */ -#endif struct ucred *sc_cred; /* cred cache for jail checks */ }; From rwatson at FreeBSD.org Fri Jun 5 14:55:27 2009 From: rwatson at FreeBSD.org (Robert Watson) Date: Fri Jun 5 14:55:43 2009 Subject: svn commit: r193511 - in head/sys: compat/linux compat/svr4 conf contrib/pf/net fs/devfs fs/nfsserver fs/unionfs i386/i386 i386/ibcs2 kern net netatalk netinet netinet6 nfsserver security/audit ufs... Message-ID: <200906051455.n55EtMBc029090@svn.freebsd.org> Author: rwatson Date: Fri Jun 5 14:55:22 2009 New Revision: 193511 URL: http://svn.freebsd.org/changeset/base/193511 Log: Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd Modified: head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_getcwd.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_stats.c head/sys/compat/svr4/svr4_fcntl.c head/sys/compat/svr4/svr4_misc.c head/sys/conf/options head/sys/contrib/pf/net/pf.c head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_vfsops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/unionfs/union_subr.c head/sys/i386/i386/sys_machdep.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/init_main.c head/sys/kern/kern_acct.c head/sys/kern/kern_alq.c head/sys/kern/kern_environment.c head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_jail.c head/sys/kern/kern_ktrace.c head/sys/kern/kern_linker.c head/sys/kern/kern_mbuf.c head/sys/kern/kern_priv.c head/sys/kern/kern_prot.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_sysctl.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c head/sys/kern/subr_trap.c head/sys/kern/sys_pipe.c head/sys/kern/sys_socket.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_mbuf2.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_shm.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_acl.c head/sys/kern/vfs_extattr.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/net/bpf.c head/sys/net/if.c head/sys/net/if_atmsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_gif.c head/sys/net/if_iso88025subr.c head/sys/net/if_loop.c head/sys/net/if_stf.c head/sys/net/if_tun.c head/sys/netatalk/aarp.c head/sys/netatalk/ddp_input.c head/sys/netatalk/ddp_output.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_fw2.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/frag6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/nd6.c head/sys/netinet6/udp6_usrreq.c head/sys/nfsserver/nfs_srvkrpc.c head/sys/nfsserver/nfs_srvsock.c head/sys/security/audit/audit_syscalls.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_vnops.c head/sys/vm/swap_pager.c head/sys/vm/vm_mmap.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_file.c Fri Jun 5 14:55:22 2009 (r193511) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/linux/linux_getcwd.c ============================================================================== --- head/sys/compat/linux/linux_getcwd.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_getcwd.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_misc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/linux/linux_stats.c Fri Jun 5 14:55:22 2009 (r193511) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include #include Modified: head/sys/compat/svr4/svr4_fcntl.c ============================================================================== --- head/sys/compat/svr4/svr4_fcntl.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/svr4/svr4_fcntl.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/compat/svr4/svr4_misc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/conf/options Fri Jun 5 14:55:22 2009 (r193511) @@ -112,7 +112,7 @@ KSTACK_PAGES KTRACE KTRACE_REQUEST_POOL opt_ktrace.h LIBICONV -MAC +MAC opt_global.h MAC_BIBA opt_dontuse.h MAC_BSDEXTENDED opt_dontuse.h MAC_IFOFF opt_dontuse.h Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/contrib/pf/net/pf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #endif #ifdef __FreeBSD__ -#include "opt_mac.h" #include "opt_bpf.h" #include "opt_pf.h" Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/devfs/devfs_devs.c Fri Jun 5 14:55:22 2009 (r193511) @@ -28,8 +28,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/devfs/devfs_vfsops.c Fri Jun 5 14:55:22 2009 (r193511) @@ -34,8 +34,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" /* To set MNT_MULTILABEL. */ - #include #include #include Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/devfs/devfs_vnops.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,8 +40,6 @@ * mkdir: want it ? */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + NFSDLOCKMUTEX; /* Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/fs/unionfs/union_subr.c Fri Jun 5 14:55:22 2009 (r193511) @@ -52,9 +52,7 @@ #include #include -#ifdef MAC -#include -#endif +#include #include Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/i386/i386/sys_machdep.c Fri Jun 5 14:55:22 2009 (r193511) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" -#include "opt_mac.h" #include #include Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/i386/ibcs2/ibcs2_misc.c Fri Jun 5 14:55:22 2009 (r193511) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); * IBCS2 system calls that are implemented differently in BSD are * handled here. */ -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/init_main.c Fri Jun 5 14:55:22 2009 (r193511) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_init_path.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_acct.c Fri Jun 5 14:55:22 2009 (r193511) @@ -70,8 +70,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_alq.c Fri Jun 5 14:55:22 2009 (r193511) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_environment.c Fri Jun 5 14:55:22 2009 (r193511) @@ -37,8 +37,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_exec.c Fri Jun 5 14:55:22 2009 (r193511) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include "opt_vm.h" #include Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_exit.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_fork.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_jail.c Fri Jun 5 14:55:22 2009 (r193511) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_ktrace.c Fri Jun 5 14:55:22 2009 (r193511) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_linker.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_hwpmc_hooks.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_mbuf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -28,7 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_param.h" #include Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_priv.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ */ #include "opt_kdtrace.h" -#include "opt_mac.h" #include __FBSDID("$FreeBSD$"); Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_prot.c Fri Jun 5 14:55:22 2009 (r193511) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_shutdown.c Fri Jun 5 14:55:22 2009 (r193511) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kdb.h" -#include "opt_mac.h" #include "opt_panic.h" #include "opt_show_busybufs.h" #include "opt_sched.h" Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/kern_sysctl.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/link_elf.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_gdb.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/link_elf_obj.c Fri Jun 5 14:55:22 2009 (r193511) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/subr_trap.c Fri Jun 5 14:55:22 2009 (r193511) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" -#include "opt_mac.h" #ifdef __i386__ #include "opt_npx.h" #endif Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sys_pipe.c Fri Jun 5 14:55:22 2009 (r193511) @@ -91,8 +91,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sys_socket.c Fri Jun 5 14:55:22 2009 (r193511) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include #include #include Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sysv_msg.c Fri Jun 5 14:55:22 2009 (r193511) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sysvipc.h" -#include "opt_mac.h" #include #include Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Fri Jun 5 14:31:03 2009 (r193510) +++ head/sys/kern/sysv_sem.c Fri Jun 5 14:55:22 2009 (r193511) @@ -40,7 +40,6 @@ __FBSDID(