From owner-p4-projects@FreeBSD.ORG Thu Aug 21 15:53:04 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 09629106566C; Thu, 21 Aug 2008 15:53:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB16106564A for ; Thu, 21 Aug 2008 15:53:03 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A9BE78FC0A for ; Thu, 21 Aug 2008 15:53:03 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7LFr3di050745 for ; Thu, 21 Aug 2008 15:53:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7LFr3ED050742 for perforce@freebsd.org; Thu, 21 Aug 2008 15:53:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 21 Aug 2008 15:53:03 GMT Message-Id: <200808211553.m7LFr3ED050742@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 148007 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 15:53:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=148007 Change 148007 by rwatson@rwatson_freebsd_capabilities on 2008/08/21 15:52:38 Integrate trustedbsd_capabilities. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/crypto/openssh/readconf.c#3 integrate .. //depot/projects/trustedbsd/capabilities/src/etc/rc.d/kernel_symlink#2 integrate .. //depot/projects/trustedbsd/capabilities/src/release/amd64/boot_crunch.conf#3 integrate .. //depot/projects/trustedbsd/capabilities/src/release/i386/boot_crunch.conf#3 integrate .. //depot/projects/trustedbsd/capabilities/src/release/ia64/boot_crunch.conf#3 integrate .. //depot/projects/trustedbsd/capabilities/src/release/pc98/boot_crunch.conf#3 integrate .. //depot/projects/trustedbsd/capabilities/src/release/powerpc/boot_crunch.conf#3 integrate .. //depot/projects/trustedbsd/capabilities/src/release/sparc64/boot_crunch.conf#3 integrate .. //depot/projects/trustedbsd/capabilities/src/release/sun4v/boot_crunch.conf#3 integrate .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/Makefile#5 integrate .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_aiboost.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_asus.4#2 integrate .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_fujitsu.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_ibm.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_panasonic.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_sony.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_toshiba.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/io.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/linux.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/Makefile#4 integrate .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/acpi_aiboost.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/acpi_asus.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/acpi_fujitsu.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/acpi_ibm.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/acpi_panasonic.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/acpi_sony.4#3 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/acpi_toshiba.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/io.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/linux.4#3 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/ndis.4#2 delete .. //depot/projects/trustedbsd/capabilities/src/share/man/man4/ndis.4#1 branch .. //depot/projects/trustedbsd/capabilities/src/sys/dev/bfe/if_bfe.c#5 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/dev/bfe/if_bfereg.h#4 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/dev/pci/pci_pci.c#4 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/dev/pci/pcireg.h#2 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/dev/usb/ubsa.c#4 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/dev/xen/netfront/netfront.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/i386/i386/vm_machdep.c#4 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/i386/pci/pci_cfgreg.c#3 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/i386/xen/pmap.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_acct.c#3 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_synch.c#4 integrate .. //depot/projects/trustedbsd/capabilities/src/sys/sys/kernel.h#3 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/cpio/cpio.c#3 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/fetch/fetch.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/lockf/lockf.1#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/lockf/lockf.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/tar/read.c#3 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/tar/test/main.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/tar/test/test.h#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/tar/test/test_patterns.c#3 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/tar/test/test_patterns_2.tgz.err.uu#2 delete .. //depot/projects/trustedbsd/capabilities/src/usr.bin/tar/test/test_patterns_2.tgz.out.uu#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.bin/tar/test/test_patterns_3.tgz.uu#1 branch .. //depot/projects/trustedbsd/capabilities/src/usr.bin/w/pr_time.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.sbin/pstat/pstat.8#3 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.sbin/sysinstall/install.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.sbin/sysinstall/media.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.sbin/sysinstall/options.c#2 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.sbin/sysinstall/sysinstall.h#3 integrate .. //depot/projects/trustedbsd/capabilities/src/usr.sbin/sysinstall/tape.c#2 integrate Differences ... ==== //depot/projects/trustedbsd/capabilities/src/crypto/openssh/readconf.c#3 (text+ko) ==== @@ -13,11 +13,12 @@ */ #include "includes.h" -__RCSID("$FreeBSD: src/crypto/openssh/readconf.c,v 1.29 2008/08/01 02:48:36 des Exp $"); +__RCSID("$FreeBSD: src/crypto/openssh/readconf.c,v 1.30 2008/08/20 10:40:07 des Exp $"); #include #include #include +#include #include @@ -245,7 +246,19 @@ Forward *fwd; #ifndef NO_IPPORT_RESERVED_CONCEPT extern uid_t original_real_uid; - if (newfwd->listen_port < IPPORT_RESERVED && original_real_uid != 0) + int ipport_reserved; +#ifdef __FreeBSD__ + size_t len_ipport_reserved = sizeof(ipport_reserved); + + if (sysctlbyname("net.inet.ip.portrange.reservedhigh", + &ipport_reserved, &len_ipport_reserved, NULL, 0) != 0) + ipport_reserved = IPPORT_RESERVED; + else + ipport_reserved++; +#else + ipport_reserved = IPPORT_RESERVED; +#endif + if (newfwd->listen_port < ipport_reserved && original_real_uid != 0) fatal("Privileged ports can only be forwarded by root."); #endif if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) ==== //depot/projects/trustedbsd/capabilities/src/etc/rc.d/kernel_symlink#2 (text+ko) ==== @@ -1,20 +1,20 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/kernel_symlink,v 1.1 2008/08/19 14:23:31 obrien Exp $ +# $FreeBSD: src/etc/rc.d/kernel_symlink,v 1.2 2008/08/21 00:04:19 rpaulo Exp $ # -# PROVIDE: kernel +# PROVIDE: kernel_symlink # REQUIRE: mountcritremote # KEYWORD: nojail . /etc/rc.subr -name="kernel" +name="kernel_symlink" rcvar=`set_rcvar` -start_cmd="kernel_start" +start_cmd="kernel_symlink_start" stop_cmd=":" -kernel_start() +kernel_symlink_start() { bootdir=$(dirname $(sysctl -n kern.bootfile)) if [ "$bootdir" != /boot/kernel ] ; then ==== //depot/projects/trustedbsd/capabilities/src/release/amd64/boot_crunch.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/amd64/boot_crunch.conf,v 1.63 2008/04/22 18:20:03 thompsa Exp $ +# $FreeBSD: src/release/amd64/boot_crunch.conf,v 1.64 2008/08/20 13:35:39 kensmith Exp $ buildopts -DRELEASE_CRUNCH -Dlint @@ -11,9 +11,6 @@ ln sh -sh ln test [ -srcdirs /usr/src/gnu/usr.bin -progs cpio - srcdirs /usr/src/sbin progs camcontrol progs dhclient @@ -29,6 +26,7 @@ ln fsck_ffs fsck_ufs srcdirs /usr/src/usr.bin +progs cpio progs find progs minigzip progs sed @@ -44,4 +42,4 @@ libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml +libs -lbsdxml -larchive -lbz2 ==== //depot/projects/trustedbsd/capabilities/src/release/i386/boot_crunch.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/i386/boot_crunch.conf,v 1.63 2008/04/22 18:20:04 thompsa Exp $ +# $FreeBSD: src/release/i386/boot_crunch.conf,v 1.64 2008/08/20 13:35:39 kensmith Exp $ buildopts -DRELEASE_CRUNCH -Dlint @@ -11,9 +11,6 @@ ln sh -sh ln test [ -srcdirs /usr/src/gnu/usr.bin -progs cpio - srcdirs /usr/src/sbin progs camcontrol progs dhclient @@ -29,6 +26,7 @@ ln fsck_ffs fsck_ufs srcdirs /usr/src/usr.bin +progs cpio progs find progs minigzip progs sed @@ -44,4 +42,4 @@ libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -ldevinfo -libs -lbsdxml +libs -lbsdxml -larchive -lbz2 ==== //depot/projects/trustedbsd/capabilities/src/release/ia64/boot_crunch.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/ia64/boot_crunch.conf,v 1.14 2008/06/05 15:32:05 marcel Exp $ +# $FreeBSD: src/release/ia64/boot_crunch.conf,v 1.15 2008/08/20 13:35:39 kensmith Exp $ buildopts -DRELEASE_CRUNCH -Dlint @@ -11,9 +11,6 @@ ln sh -sh ln test [ -srcdirs /usr/src/gnu/usr.bin -progs cpio - srcdirs /usr/src/sbin progs camcontrol progs dhclient @@ -33,6 +30,7 @@ ln geom gpart srcdirs /usr/src/usr.bin +progs cpio progs find progs minigzip progs sed @@ -48,4 +46,4 @@ libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -ldevinfo -libs -lgeom -lbsdxml +libs -lgeom -lbsdxml -larchive -lbz2 ==== //depot/projects/trustedbsd/capabilities/src/release/pc98/boot_crunch.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/pc98/boot_crunch.conf,v 1.64 2008/04/22 18:20:04 thompsa Exp $ +# $FreeBSD: src/release/pc98/boot_crunch.conf,v 1.65 2008/08/20 13:35:39 kensmith Exp $ buildopts -DRELEASE_CRUNCH -Dlint @@ -11,9 +11,6 @@ ln sh -sh ln test [ -srcdirs /usr/src/gnu/usr.bin -progs cpio - srcdirs /usr/src/sbin progs camcontrol progs dhclient @@ -29,6 +26,7 @@ ln fsck_ffs fsck_ufs srcdirs /usr/src/usr.bin +progs cpio progs find progs minigzip progs sed @@ -43,3 +41,4 @@ libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml +libs -larchive -lbz2 ==== //depot/projects/trustedbsd/capabilities/src/release/powerpc/boot_crunch.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/powerpc/boot_crunch.conf,v 1.6 2008/04/22 18:20:05 thompsa Exp $ +# $FreeBSD: src/release/powerpc/boot_crunch.conf,v 1.7 2008/08/20 13:35:39 kensmith Exp $ buildopts -DRELEASE_CRUNCH -Dlint @@ -11,9 +11,6 @@ ln sh -sh ln test [ -srcdirs /usr/src/gnu/usr.bin -progs cpio - srcdirs /usr/src/sbin progs camcontrol progs dhclient @@ -31,6 +28,7 @@ ln fsck_ffs fsck_ufs srcdirs /usr/src/usr.bin +progs cpio progs find progs minigzip progs sed @@ -46,4 +44,4 @@ libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lkiconv -lsbuf -lufs -libs -lbsdxml +libs -lbsdxml -larchive -lbz2 ==== //depot/projects/trustedbsd/capabilities/src/release/sparc64/boot_crunch.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/sparc64/boot_crunch.conf,v 1.10 2008/04/22 18:20:05 thompsa Exp $ +# $FreeBSD: src/release/sparc64/boot_crunch.conf,v 1.11 2008/08/20 13:35:39 kensmith Exp $ buildopts -DRELEASE_CRUNCH -Dlint @@ -11,9 +11,6 @@ ln sh -sh ln test [ -srcdirs /usr/src/gnu/usr.bin -progs cpio - srcdirs /usr/src/sbin progs camcontrol progs dhclient @@ -29,6 +26,7 @@ ln fsck_ffs fsck_ufs srcdirs /usr/src/usr.bin +progs cpio progs find progs minigzip progs sed @@ -44,3 +42,4 @@ libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml +libs -larchive -lbz2 ==== //depot/projects/trustedbsd/capabilities/src/release/sun4v/boot_crunch.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/sun4v/boot_crunch.conf,v 1.3 2008/04/22 18:20:05 thompsa Exp $ +# $FreeBSD: src/release/sun4v/boot_crunch.conf,v 1.4 2008/08/20 13:35:39 kensmith Exp $ buildopts -DRELEASE_CRUNCH -Dlint @@ -11,9 +11,6 @@ ln sh -sh ln test [ -srcdirs /usr/src/gnu/usr.bin -progs cpio - srcdirs /usr/src/sbin progs camcontrol progs dhclient @@ -29,6 +26,7 @@ ln fsck_ffs fsck_ufs srcdirs /usr/src/usr.bin +progs cpio progs find progs minigzip progs sed @@ -44,3 +42,4 @@ libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml +libs -larchive -lbz2 ==== //depot/projects/trustedbsd/capabilities/src/share/man/man4/Makefile#5 (text+ko) ==== @@ -1,11 +1,17 @@ # @(#)Makefile 8.1 (Berkeley) 6/18/93 -# $FreeBSD: src/share/man/man4/Makefile,v 1.426 2008/08/20 08:31:58 ed Exp $ +# $FreeBSD: src/share/man/man4/Makefile,v 1.429 2008/08/21 00:40:55 rpaulo Exp $ MAN= aac.4 \ acpi.4 \ + ${_acpi_aiboost.4} \ ${_acpi_asus.4} \ ${_acpi_dock.4} \ + ${_acpi_fujitsu.4} \ + ${_acpi_ibm.4} \ + ${_acpi_panasonic.4} \ + ${_acpi_sony.4} \ acpi_thermal.4 \ + ${_acpi_toshiba.4} \ acpi_video.4 \ adv.4 \ adw.4 \ @@ -128,6 +134,7 @@ inet6.4 \ intpm.4 \ intro.4 \ + ${_io.4} \ ip.4 \ ip6.4 \ ipfirewall.4 \ @@ -143,7 +150,7 @@ ixgb.4 \ jme.4 \ joy.4 \ - k8temp.4 \ + ${_k8temp.4} \ kbdmux.4 \ keyboard.4 \ kld.4 \ @@ -153,6 +160,7 @@ le.4 \ led.4 \ lge.4 \ + ${_linux.4} \ lmc.4 \ lo.4 \ lp.4 \ @@ -192,6 +200,7 @@ natmip.4 \ ncr.4 \ ncv.4 \ + ${_ndis.4} \ netgraph.4 \ netintro.4 \ ${_nfe.4} \ @@ -493,6 +502,7 @@ MLINKS+=mn.4 if_mn.4 MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 +MLINKS+=${_ndis.4} ${_if_ndis.4} MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} @@ -551,8 +561,14 @@ MLINKS+=xl.4 if_xl.4 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +_acpi_aiboost.4=acpi_aiboost.4 _acpi_asus.4= acpi_asus.4 _acpi_dock.4= acpi_dock.4 +_acpi_fujitsu.4=acpi_fujitsu.4 +_acpi_ibm.4= acpi_ibm.4 +_acpi_panasonic.4=acpi_panasonic.4 +_acpi_sony.4= acpi_sony.4 +_acpi_toshiba.4=acpi_toshiba.4 _amdsmb.4= amdsmb.4 _asmc.4= asmc.4 _coretemp.4= coretemp.4 @@ -561,11 +577,16 @@ _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 _ichwd.4= ichwd.4 +_if_ndis.4= if_ndis.4 _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 +_io.4= io.4 +_linux.4= linux.4 +_ndis.4= ndis.4 +_k8temp.4= k8temp.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _nve.4= nve.4 ==== //depot/projects/trustedbsd/capabilities/src/share/man/man4/acpi_asus.4#2 (text+ko) ==== ==== //depot/projects/trustedbsd/capabilities/src/share/man/man4/man4.i386/Makefile#4 (text+ko) ==== @@ -1,13 +1,6 @@ -# $FreeBSD: src/share/man/man4/man4.i386/Makefile,v 1.189 2008/08/09 14:54:19 philip Exp $ +# $FreeBSD: src/share/man/man4/man4.i386/Makefile,v 1.190 2008/08/21 00:40:55 rpaulo Exp $ -MAN= acpi_aiboost.4 \ - acpi_asus.4 \ - acpi_fujitsu.4 \ - acpi_ibm.4 \ - acpi_panasonic.4 \ - acpi_sony.4 \ - acpi_toshiba.4 \ - aic.4 \ +MAN= aic.4 \ alpm.4 \ amdpm.4 \ apm.4 \ @@ -25,12 +18,9 @@ glxsb.4 \ ichwd.4 \ ie.4 \ - io.4 \ - linux.4 \ longrun.4 \ mcd.4 \ mse.4 \ - ndis.4 \ npx.4 \ padlock.4 \ pae.4 \ @@ -52,7 +42,6 @@ wl.4 MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4 -MLINKS+=ndis.4 if_ndis.4 MLINKS+=pae.4 PAE.4 MANSUBDIR=/i386 ==== //depot/projects/trustedbsd/capabilities/src/sys/dev/bfe/if_bfe.c#5 (text+ko) ==== @@ -26,45 +26,36 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/bfe/if_bfe.c,v 1.50 2008/08/11 01:49:46 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bfe/if_bfe.c,v 1.51 2008/08/21 04:21:53 yongari Exp $"); #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 -#include -#include -#include - #include #include -#include "miidevs.h" #include #include +#include + #include MODULE_DEPEND(bfe, pci, 1, 1, 1); @@ -91,6 +82,7 @@ static int bfe_resume (device_t); static void bfe_release_resources (struct bfe_softc *); static void bfe_intr (void *); +static int bfe_encap (struct bfe_softc *, struct mbuf **); static void bfe_start (struct ifnet *); static void bfe_start_locked (struct ifnet *); static int bfe_ioctl (struct ifnet *, u_long, caddr_t); @@ -104,7 +96,9 @@ static void bfe_rxeof (struct bfe_softc *); static void bfe_set_rx_mode (struct bfe_softc *); static int bfe_list_rx_init (struct bfe_softc *); -static int bfe_list_newbuf (struct bfe_softc *, int, struct mbuf*); +static void bfe_list_tx_init (struct bfe_softc *); +static void bfe_discard_buf (struct bfe_softc *, int); +static int bfe_list_newbuf (struct bfe_softc *, int); static void bfe_rx_ring_free (struct bfe_softc *); static void bfe_pci_setup (struct bfe_softc *, u_int32_t); @@ -127,8 +121,8 @@ static void bfe_chip_halt (struct bfe_softc *); static void bfe_core_reset (struct bfe_softc *); static void bfe_core_disable (struct bfe_softc *); -static int bfe_dma_alloc (device_t); -static void bfe_dma_map_desc (void *, bus_dma_segment_t *, int, int); +static int bfe_dma_alloc (struct bfe_softc *); +static void bfe_dma_free (struct bfe_softc *sc); static void bfe_dma_map (void *, bus_dma_segment_t *, int, int); static void bfe_cam_write (struct bfe_softc *, u_char *, int); @@ -186,137 +180,252 @@ return (ENXIO); } +struct bfe_dmamap_arg { + bus_addr_t bfe_busaddr; +}; + static int -bfe_dma_alloc(device_t dev) +bfe_dma_alloc(struct bfe_softc *sc) { - struct bfe_softc *sc; + struct bfe_dmamap_arg ctx; + struct bfe_rx_data *rd; + struct bfe_tx_data *td; int error, i; - sc = device_get_softc(dev); - /* * parent tag. Apparently the chip cannot handle any DMA address * greater than 1GB. */ - error = bus_dma_tag_create(NULL, /* parent */ - 4096, 0, /* alignment, boundary */ - 0x3FFFFFFF, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, /* maxsize */ - BUS_SPACE_UNRESTRICTED, /* num of segments */ - BUS_SPACE_MAXSIZE_32BIT, /* max segment size */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->bfe_parent_tag); + error = bus_dma_tag_create(bus_get_dma_tag(sc->bfe_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BFE_DMA_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->bfe_parent_tag); + if (error != 0) { + device_printf(sc->bfe_dev, "cannot create parent DMA tag.\n"); + goto fail; + } - /* tag for TX ring */ - error = bus_dma_tag_create(sc->bfe_parent_tag, - 4096, 0, - BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, - NULL, NULL, - BFE_TX_LIST_SIZE, - 1, - BUS_SPACE_MAXSIZE_32BIT, - 0, - NULL, NULL, - &sc->bfe_tx_tag); + /* Create tag for Tx ring. */ + error = bus_dma_tag_create(sc->bfe_parent_tag, /* parent */ + BFE_TX_RING_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BFE_TX_LIST_SIZE, /* maxsize */ + 1, /* nsegments */ + BFE_TX_LIST_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->bfe_tx_tag); + if (error != 0) { + device_printf(sc->bfe_dev, "cannot create Tx ring DMA tag.\n"); + goto fail; + } - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Create tag for Rx ring. */ + error = bus_dma_tag_create(sc->bfe_parent_tag, /* parent */ + BFE_RX_RING_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BFE_RX_LIST_SIZE, /* maxsize */ + 1, /* nsegments */ + BFE_RX_LIST_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->bfe_rx_tag); + if (error != 0) { + device_printf(sc->bfe_dev, "cannot create Rx ring DMA tag.\n"); + goto fail; } - /* tag for RX ring */ - error = bus_dma_tag_create(sc->bfe_parent_tag, - 4096, 0, - BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, - NULL, NULL, - BFE_RX_LIST_SIZE, - 1, - BUS_SPACE_MAXSIZE_32BIT, - 0, - NULL, NULL, - &sc->bfe_rx_tag); + /* Create tag for Tx buffers. */ + error = bus_dma_tag_create(sc->bfe_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * BFE_MAXTXSEGS, /* maxsize */ + BFE_MAXTXSEGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->bfe_txmbuf_tag); + if (error != 0) { + device_printf(sc->bfe_dev, + "cannot create Tx buffer DMA tag.\n"); + goto fail; + } - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Create tag for Rx buffers. */ + error = bus_dma_tag_create(sc->bfe_parent_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->bfe_rxmbuf_tag); + if (error != 0) { + device_printf(sc->bfe_dev, + "cannot create Rx buffer DMA tag.\n"); + goto fail; } - /* tag for mbufs */ - error = bus_dma_tag_create(sc->bfe_parent_tag, - ETHER_ALIGN, 0, - BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, - NULL, NULL, - MCLBYTES, - 1, - BUS_SPACE_MAXSIZE_32BIT, - BUS_DMA_ALLOCNOW, - NULL, NULL, - &sc->bfe_tag); + /* Allocate DMA'able memory and load DMA map. */ + error = bus_dmamem_alloc(sc->bfe_tx_tag, (void *)&sc->bfe_tx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->bfe_tx_map); + if (error != 0) { + device_printf(sc->bfe_dev, + "cannot allocate DMA'able memory for Tx ring.\n"); + goto fail; + } + ctx.bfe_busaddr = 0; + error = bus_dmamap_load(sc->bfe_tx_tag, sc->bfe_tx_map, + sc->bfe_tx_list, BFE_TX_LIST_SIZE, bfe_dma_map, &ctx, + BUS_DMA_NOWAIT); + if (error != 0 || ctx.bfe_busaddr == 0) { + device_printf(sc->bfe_dev, + "cannot load DMA'able memory for Tx ring.\n"); + goto fail; + } + sc->bfe_tx_dma = BFE_ADDR_LO(ctx.bfe_busaddr); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + error = bus_dmamem_alloc(sc->bfe_rx_tag, (void *)&sc->bfe_rx_list, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->bfe_rx_map); + if (error != 0) { + device_printf(sc->bfe_dev, + "cannot allocate DMA'able memory for Rx ring.\n"); + goto fail; + } + ctx.bfe_busaddr = 0; + error = bus_dmamap_load(sc->bfe_rx_tag, sc->bfe_rx_map, + sc->bfe_rx_list, BFE_RX_LIST_SIZE, bfe_dma_map, &ctx, + BUS_DMA_NOWAIT); + if (error != 0 || ctx.bfe_busaddr == 0) { + device_printf(sc->bfe_dev, + "cannot load DMA'able memory for Rx ring.\n"); + goto fail; } + sc->bfe_rx_dma = BFE_ADDR_LO(ctx.bfe_busaddr); - /* pre allocate dmamaps for RX list */ - for (i = 0; i < BFE_RX_LIST_CNT; i++) { - error = bus_dmamap_create(sc->bfe_tag, 0, - &sc->bfe_rx_ring[i].bfe_map); - if (error) { - device_printf(dev, "cannot create DMA map for RX\n"); - return (ENOMEM); + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < BFE_TX_LIST_CNT; i++) { + td = &sc->bfe_tx_ring[i]; + td->bfe_mbuf = NULL; + td->bfe_map = NULL; + error = bus_dmamap_create(sc->bfe_txmbuf_tag, 0, &td->bfe_map); + if (error != 0) { + device_printf(sc->bfe_dev, + "cannot create DMA map for Tx.\n"); + goto fail; } } - /* pre allocate dmamaps for TX list */ - for (i = 0; i < BFE_TX_LIST_CNT; i++) { - error = bus_dmamap_create(sc->bfe_tag, 0, - &sc->bfe_tx_ring[i].bfe_map); - if (error) { - device_printf(dev, "cannot create DMA map for TX\n"); - return (ENOMEM); + /* Create spare DMA map for Rx buffers. */ + error = bus_dmamap_create(sc->bfe_rxmbuf_tag, 0, &sc->bfe_rx_sparemap); + if (error != 0) { + device_printf(sc->bfe_dev, "cannot create spare DMA map for Rx.\n"); + goto fail; + } + /* Create DMA maps for Rx buffers. */ + for (i = 0; i < BFE_RX_LIST_CNT; i++) { + rd = &sc->bfe_rx_ring[i]; + rd->bfe_mbuf = NULL; + rd->bfe_map = NULL; + rd->bfe_ctrl = 0; + error = bus_dmamap_create(sc->bfe_rxmbuf_tag, 0, &rd->bfe_map); + if (error != 0) { + device_printf(sc->bfe_dev, + "cannot create DMA map for Rx.\n"); + goto fail; } } - /* Alloc dma for rx ring */ - error = bus_dmamem_alloc(sc->bfe_rx_tag, (void *)&sc->bfe_rx_list, - BUS_DMA_NOWAIT, &sc->bfe_rx_map); +fail: + return (error); +} - if (error) - return (ENOMEM); +static void +bfe_dma_free(struct bfe_softc *sc) +{ + struct bfe_tx_data *td; + struct bfe_rx_data *rd; + int i; - bzero(sc->bfe_rx_list, BFE_RX_LIST_SIZE); - error = bus_dmamap_load(sc->bfe_rx_tag, sc->bfe_rx_map, - sc->bfe_rx_list, sizeof(struct bfe_desc), - bfe_dma_map, &sc->bfe_rx_dma, BUS_DMA_NOWAIT); + /* Tx ring. */ + if (sc->bfe_tx_tag != NULL) { + if (sc->bfe_tx_map != NULL) + bus_dmamap_unload(sc->bfe_tx_tag, sc->bfe_tx_map); + if (sc->bfe_tx_map != NULL && sc->bfe_tx_list != NULL) + bus_dmamem_free(sc->bfe_tx_tag, sc->bfe_tx_list, + sc->bfe_tx_map); + sc->bfe_tx_map = NULL; + sc->bfe_tx_list = NULL; + bus_dma_tag_destroy(sc->bfe_tx_tag); + sc->bfe_tx_tag = NULL; + } - if (error) - return (ENOMEM); + /* Rx ring. */ + if (sc->bfe_rx_tag != NULL) { + if (sc->bfe_rx_map != NULL) + bus_dmamap_unload(sc->bfe_rx_tag, sc->bfe_rx_map); + if (sc->bfe_rx_map != NULL && sc->bfe_rx_list != NULL) + bus_dmamem_free(sc->bfe_rx_tag, sc->bfe_rx_list, + sc->bfe_rx_map); + sc->bfe_rx_map = NULL; + sc->bfe_rx_list = NULL; + bus_dma_tag_destroy(sc->bfe_rx_tag); + sc->bfe_rx_tag = NULL; + } - bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREWRITE); + /* Tx buffers. */ + if (sc->bfe_txmbuf_tag != NULL) { + for (i = 0; i < BFE_TX_LIST_CNT; i++) { + td = &sc->bfe_tx_ring[i]; + if (td->bfe_map != NULL) { + bus_dmamap_destroy(sc->bfe_txmbuf_tag, + td->bfe_map); + td->bfe_map = NULL; + } + } + bus_dma_tag_destroy(sc->bfe_txmbuf_tag); + sc->bfe_txmbuf_tag = NULL; + } - error = bus_dmamem_alloc(sc->bfe_tx_tag, (void *)&sc->bfe_tx_list, - BUS_DMA_NOWAIT, &sc->bfe_tx_map); - if (error) - return (ENOMEM); + /* Rx buffers. */ + if (sc->bfe_rxmbuf_tag != NULL) { + for (i = 0; i < BFE_RX_LIST_CNT; i++) { + rd = &sc->bfe_rx_ring[i]; + if (rd->bfe_map != NULL) { + bus_dmamap_destroy(sc->bfe_rxmbuf_tag, + rd->bfe_map); + rd->bfe_map = NULL; + } + } + if (sc->bfe_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->bfe_rxmbuf_tag, + sc->bfe_rx_sparemap); + sc->bfe_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->bfe_rxmbuf_tag); + sc->bfe_rxmbuf_tag = NULL; + } - - error = bus_dmamap_load(sc->bfe_tx_tag, sc->bfe_tx_map, - sc->bfe_tx_list, sizeof(struct bfe_desc), - bfe_dma_map, &sc->bfe_tx_dma, BUS_DMA_NOWAIT); - if (error) - return (ENOMEM); - - bzero(sc->bfe_tx_list, BFE_TX_LIST_SIZE); - bus_dmamap_sync(sc->bfe_tx_tag, sc->bfe_tx_map, BUS_DMASYNC_PREWRITE); - - return (0); + if (sc->bfe_parent_tag != NULL) { + bus_dma_tag_destroy(sc->bfe_parent_tag); + sc->bfe_parent_tag = NULL; + } } static int @@ -338,7 +447,7 @@ */ pci_enable_busmaster(dev); - rid = BFE_PCI_MEMLO; + rid = PCIR_BAR(0); sc->bfe_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->bfe_res == NULL) { @@ -347,10 +456,6 @@ goto fail; } - sc->bfe_btag = rman_get_bustag(sc->bfe_res); - sc->bfe_bhandle = rman_get_bushandle(sc->bfe_res); - sc->bfe_vhandle = (vm_offset_t)rman_get_virtual(sc->bfe_res); - /* Allocate interrupt */ rid = 0; @@ -362,7 +467,7 @@ goto fail; } - if (bfe_dma_alloc(dev)) { + if (bfe_dma_alloc(sc) != 0) { device_printf(dev, "failed to allocate DMA resources\n"); error = ENXIO; goto fail; @@ -420,8 +525,8 @@ goto fail; } fail: - if (error) - bfe_release_resources(sc); + if (error != 0) + bfe_detach(dev); return (error); } @@ -433,8 +538,6 @@ sc = device_get_softc(dev); - KASSERT(mtx_initialized(&sc->bfe_mtx), ("bfe mutex not initialized")); - ifp = sc->bfe_ifp; if (device_is_attached(dev)) { @@ -446,13 +549,16 @@ ether_ifdetach(ifp); } + BFE_LOCK(sc); >>> TRUNCATED FOR MAIL (1000 lines) <<<