From owner-p4-projects@FreeBSD.ORG Sat Feb 24 17:12:49 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D980A16A404; Sat, 24 Feb 2007 17:12:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B713B16A401 for ; Sat, 24 Feb 2007 17:12:48 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id A511313C441 for ; Sat, 24 Feb 2007 17:12:48 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1OHCmnk078356 for ; Sat, 24 Feb 2007 17:12:48 GMT (envelope-from netchild@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1OHCkYM078351 for perforce@freebsd.org; Sat, 24 Feb 2007 17:12:46 GMT (envelope-from netchild@freebsd.org) Date: Sat, 24 Feb 2007 17:12:46 GMT Message-Id: <200702241712.l1OHCkYM078351@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to netchild@freebsd.org using -f From: Alexander Leidinger To: Perforce Change Reviews Cc: Subject: PERFORCE change 114984 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: Sat, 24 Feb 2007 17:12:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=114984 Change 114984 by netchild@netchild_magellan on 2007/02/24 17:12:15 IFC Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#21 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#42 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#39 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#60 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_uid16.c#4 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_util.c#3 integrate .. //depot/projects/linuxolator/src/sys/conf/files#20 integrate .. //depot/projects/linuxolator/src/sys/dev/exca/exca.c#4 integrate .. //depot/projects/linuxolator/src/sys/dev/fdc/fdc.c#4 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.h#8 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_pci.c#12 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_sbus.c#7 integrate .. //depot/projects/linuxolator/src/sys/dev/mpt/mpt.h#6 integrate .. //depot/projects/linuxolator/src/sys/dev/mpt/mpt_pci.c#8 integrate .. //depot/projects/linuxolator/src/sys/geom/geom_dev.c#2 integrate .. //depot/projects/linuxolator/src/sys/geom/geom_io.c#4 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/imgact_linux.c#3 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#17 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#33 integrate .. //depot/projects/linuxolator/src/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c#2 integrate .. //depot/projects/linuxolator/src/sys/ia64/isa/isa.c#2 integrate .. //depot/projects/linuxolator/src/sys/modules/ip_mroute_mod/Makefile#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/ip_mroute.c#8 integrate .. //depot/projects/linuxolator/src/sys/netinet6/in6.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet6/in6_proto.c#4 integrate .. //depot/projects/linuxolator/src/sys/netinet6/ip6_input.c#3 integrate .. //depot/projects/linuxolator/src/sys/netinet6/ip6_mroute.c#3 integrate .. //depot/projects/linuxolator/src/sys/netinet6/ip6_mroute.h#3 integrate .. //depot/projects/linuxolator/src/sys/netinet6/ip6_var.h#2 integrate .. //depot/projects/linuxolator/src/sys/netinet6/raw_ip6.c#2 integrate .. //depot/projects/linuxolator/src/sys/pci/if_sis.c#5 integrate .. //depot/projects/linuxolator/src/sys/pci/if_sisreg.h#3 integrate Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#21 (text+ko) ==== @@ -27,7 +27,7 @@ * (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: src/sys/amd64/linux32/linux.h,v 1.12 2007/02/15 00:54:40 jkim Exp $ + * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.13 2007/02/24 16:49:24 netchild Exp $ */ #ifndef _AMD64_LINUX_LINUX_H_ ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#42 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.33 2007/02/15 01:20:43 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.34 2007/02/24 16:49:24 netchild Exp $"); #include #include ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#39 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.17 2007/02/23 22:39:26 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.18 2007/02/24 16:49:24 netchild Exp $"); #include "opt_compat.h" ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#60 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.207 2007/02/23 22:39:26 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.208 2007/02/24 16:49:24 netchild Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_uid16.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_uid16.c,v 1.20 2006/11/06 13:41:49 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_uid16.c,v 1.21 2007/02/24 16:49:24 netchild Exp $"); #include "opt_compat.h" ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_util.c#3 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_util.c,v 1.31 2006/08/15 12:54:29 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_util.c,v 1.32 2007/02/24 16:49:24 netchild Exp $"); #include "opt_compat.h" ==== //depot/projects/linuxolator/src/sys/conf/files#20 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1177 2007/02/15 01:28:22 rwatson Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1178 2007/02/24 11:38:47 bms Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1760,7 +1760,7 @@ netinet/ip_input.c optional inet netinet/ip_ipsec.c optional ipsec netinet/ip_ipsec.c optional fast_ipsec -netinet/ip_mroute.c optional mrouting +netinet/ip_mroute.c optional mrouting inet | mrouting inet6 netinet/ip_options.c optional inet netinet/ip_output.c optional inet netinet/raw_ip.c optional inet @@ -1815,7 +1815,7 @@ netinet6/ip6_forward.c optional inet6 netinet6/ip6_id.c optional inet6 netinet6/ip6_input.c optional inet6 -netinet6/ip6_mroute.c optional inet6 +netinet6/ip6_mroute.c optional mrouting inet6 netinet6/ip6_output.c optional inet6 netinet6/ipcomp_core.c optional ipsec netinet6/ipcomp_input.c optional ipsec ==== //depot/projects/linuxolator/src/sys/dev/exca/exca.c#4 (text+ko) ==== @@ -53,7 +53,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/exca/exca.c,v 1.26 2007/02/15 07:22:27 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/exca/exca.c,v 1.27 2007/02/24 15:56:06 imp Exp $"); #include #include @@ -766,7 +766,7 @@ void exca_insert(struct exca_softc *exca) { - if (exca->pccarddev != NULL) { + if (device_is_attached(exca->pccarddev)) { if (CARD_ATTACH_CARD(exca->pccarddev) != 0) device_printf(exca->dev, "PC Card card activation failed\n"); ==== //depot/projects/linuxolator/src/sys/dev/fdc/fdc.c#4 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.315 2007/02/23 12:18:40 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.316 2007/02/23 23:06:10 jhb Exp $"); #include "opt_fdc.h" @@ -790,7 +790,7 @@ if (fdc->flags & FDC_NEEDS_RESET) { fdc->flags &= ~FDC_NEEDS_RESET; fdc_reset(fdc); - msleep(fdc, NULL, PRIBIO, "fdcrst", hz); + tsleep(fdc, PRIBIO, "fdcrst", hz); /* Discard results */ for (i = 0; i < 4; i++) fdc_sense_int(fdc, &st0, &cyl); @@ -855,7 +855,7 @@ retry_line = __LINE__; if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0)) return (1); - msleep(fdc, NULL, PRIBIO, "fdrecal", hz); + tsleep(fdc, PRIBIO, "fdrecal", hz); retry_line = __LINE__; if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) return (1); /* XXX */ @@ -867,7 +867,7 @@ retry_line = __LINE__; if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, 1, 0)) return (1); - msleep(fdc, NULL, PRIBIO, "fdseek", hz); + tsleep(fdc, PRIBIO, "fdseek", hz); retry_line = __LINE__; if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) return (1); /* XXX */ @@ -956,7 +956,7 @@ retry_line = __LINE__; if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0)) return (1); - msleep(fdc, NULL, PRIBIO, "fdrecal", hz); + tsleep(fdc, PRIBIO, "fdrecal", hz); retry_line = __LINE__; if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) return (1); /* XXX */ @@ -967,7 +967,7 @@ fd->track = 0; /* let the heads settle */ if (settle) - msleep(fdc->fd, NULL, PRIBIO, "fdhdstl", settle); + tsleep(fdc->fd, PRIBIO, "fdhdstl", settle); } /* @@ -983,7 +983,7 @@ retry_line = __LINE__; if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, descyl, 0)) return (1); - msleep(fdc, NULL, PRIBIO, "fdseek", hz); + tsleep(fdc, PRIBIO, "fdseek", hz); retry_line = __LINE__; if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) return (1); /* XXX */ @@ -994,7 +994,7 @@ } /* let the heads settle */ if (settle) - msleep(fdc->fd, NULL, PRIBIO, "fdhdstl", settle); + tsleep(fdc->fd, PRIBIO, "fdhdstl", settle); } fd->track = cylinder; @@ -1080,7 +1080,7 @@ } /* Wait for interrupt */ - i = msleep(fdc, NULL, PRIBIO, "fddata", hz); + i = tsleep(fdc, PRIBIO, "fddata", hz); /* PIO if the read looks good */ if (i == 0 && (fdc->flags & FDC_NODMA) && (bp->bio_cmd & BIO_READ)) @@ -1279,7 +1279,7 @@ fd_enqueue(fd, bp); do { - msleep(bp, NULL, PRIBIO, "fdwait", hz); + tsleep(bp, PRIBIO, "fdwait", hz); } while (!(bp->bio_flags & BIO_DONE)); error = bp->bio_error; ==== //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.h#8 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.99 2007/02/15 17:21:30 luigi Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.100 2007/02/23 23:13:46 mjacob Exp $ */ /*- * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions * @@ -492,6 +492,12 @@ bus_dma_tag_create(a, b, c, d, e, f, g, h, i, j, k, \ busdma_lock_mutex, &Giant, z) #endif +#if __FreeBSD_version < 700031 +#define isp_setup_intr(d, i, f, U, if, ifa, hp) \ + bus_setup_intr(d, i, f, if, ifa, hp) +#else +#define isp_setup_intr bus_setup_intr +#endif /* Should be BUS_SPACE_MAXSIZE, but MAXPHYS is larger than BUS_SPACE_MAXSIZE */ #define ISP_NSEGS ((MAXPHYS / PAGE_SIZE) + 1) ==== //depot/projects/linuxolator/src/sys/dev/isp/isp_pci.c#12 (text+ko) ==== @@ -30,7 +30,7 @@ * FreeBSD Version. */ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.136 2007/02/23 12:18:44 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.137 2007/02/23 23:13:46 mjacob Exp $"); #include #include @@ -1170,7 +1170,8 @@ locksetup++; #endif - if (bus_setup_intr(dev, irq, ISP_IFLAGS, NULL, isp_pci_intr, isp, &pcs->ih)) { + if (isp_setup_intr(dev, irq, ISP_IFLAGS, NULL, isp_pci_intr, isp, + &pcs->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; } ==== //depot/projects/linuxolator/src/sys/dev/isp/isp_sbus.c#7 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.28 2007/02/23 12:18:44 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.29 2007/02/23 23:13:46 mjacob Exp $"); #include #include @@ -311,7 +311,7 @@ goto bad; } - if (bus_setup_intr(dev, sbs->sbus_ires, ISP_IFLAGS, + if (isp_setup_intr(dev, sbs->sbus_ires, ISP_IFLAGS, NULL, isp_sbus_intr, isp, &sbs->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; ==== //depot/projects/linuxolator/src/sys/dev/mpt/mpt.h#6 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpt.h,v 1.37 2007/01/05 22:49:05 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpt.h,v 1.38 2007/02/23 23:13:46 mjacob Exp $ */ /*- * Generic defines for LSI '909 FC adapters. * FreeBSD Version. @@ -258,6 +258,13 @@ }; void mpt_map_rquest(void *, bus_dma_segment_t *, int, int); +/* **************************** NewBUS interrupt Crock ************************/ +#if __FreeBSD_version < 700031 +#define mpt_setup_intr(d, i, f, U, if, ifa, hp) \ + bus_setup_intr(d, i, f, if, ifa, hp) +#else +#define mpt_setup_intr bus_setup_intr +#endif /**************************** Kernel Thread Support ***************************/ #if __FreeBSD_version > 500005 ==== //depot/projects/linuxolator/src/sys/dev/mpt/mpt_pci.c#8 (text+ko) ==== @@ -99,7 +99,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.48 2007/02/23 12:18:46 piso Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.49 2007/02/23 23:13:46 mjacob Exp $"); #include #include @@ -563,7 +563,7 @@ mpt_disable_ints(mpt); /* Register the interrupt handler */ - if (bus_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, NULL, mpt_pci_intr, + if (mpt_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, NULL, mpt_pci_intr, mpt, &mpt->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; ==== //depot/projects/linuxolator/src/sys/geom/geom_dev.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.90 2006/06/18 22:01:15 simon Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.91 2007/02/23 23:06:10 jhb Exp $"); #include #include @@ -416,7 +416,7 @@ /* Wait for the cows to come home */ while (cp->nstart != cp->nend) - msleep(&dev, NULL, PRIBIO, "gdevorphan", hz / 10); + tsleep(&dev, PRIBIO, "gdevorphan", hz / 10); if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) g_access(cp, -cp->acr, -cp->acw, -cp->ace); ==== //depot/projects/linuxolator/src/sys/geom/geom_io.c#4 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/geom/geom_io.c,v 1.72 2007/01/28 23:36:07 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/geom_io.c,v 1.73 2007/02/23 23:06:10 jhb Exp $"); #include #include @@ -492,7 +492,7 @@ g_bioq_unlock(&g_bio_run_down); if (pace > 0) { CTR1(KTR_GEOM, "g_down pacing self (pace %d)", pace); - msleep(&error, NULL, PRIBIO, "g_down", hz/10); + tsleep(&error, PRIBIO, "g_down", hz/10); pace--; } error = g_io_check(bp); ==== //depot/projects/linuxolator/src/sys/i386/linux/imgact_linux.c#3 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/linux/imgact_linux.c,v 1.54 2005/04/01 20:00:10 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/linux/imgact_linux.c,v 1.55 2007/02/24 16:49:24 netchild Exp $"); #include #include ==== //depot/projects/linuxolator/src/sys/i386/linux/linux.h#17 (text+ko) ==== @@ -25,7 +25,7 @@ * (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: src/sys/i386/linux/linux.h,v 1.74 2007/02/15 00:54:40 jkim Exp $ + * $FreeBSD: src/sys/i386/linux/linux.h,v 1.75 2007/02/24 16:49:24 netchild Exp $ */ #ifndef _I386_LINUX_LINUX_H_ ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#33 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.71 2007/02/23 22:39:26 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.72 2007/02/24 16:49:25 netchild Exp $"); #include #include ==== //depot/projects/linuxolator/src/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c#2 (text+ko) ==== @@ -39,7 +39,7 @@ *---------------------------------------------------------------------------*/ #include -__FBSDID("$FreeBSD: src/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.17 2005/01/06 22:18:19 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.18 2007/02/24 02:28:07 piso Exp $"); #include "opt_i4b.h" @@ -540,7 +540,7 @@ goto fail; } - error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, avma1pp_intr, sc, &ih); + error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, NULL, avma1pp_intr, sc, &ih); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq); ==== //depot/projects/linuxolator/src/sys/ia64/isa/isa.c#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/ia64/isa/isa.c,v 1.3 2004/03/17 21:45:55 jmg Exp $ + * $FreeBSD: src/sys/ia64/isa/isa.c,v 1.4 2007/02/24 16:56:22 piso Exp $ */ /* @@ -155,10 +155,11 @@ */ int isa_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t filter, void (*ihand)(void *), void *arg, + void **cookiep) { return (BUS_SETUP_INTR(device_get_parent(bus), child, r, flags, - ihand, arg, cookiep)); + filter, ihand, arg, cookiep)); } int ==== //depot/projects/linuxolator/src/sys/modules/ip_mroute_mod/Makefile#3 (text+ko) ==== @@ -1,13 +1,26 @@ -# $FreeBSD: src/sys/modules/ip_mroute_mod/Makefile,v 1.14 2007/02/09 01:42:43 bms Exp $ +# $FreeBSD: src/sys/modules/ip_mroute_mod/Makefile,v 1.15 2007/02/24 11:38:47 bms Exp $ -.PATH: ${.CURDIR}/../../netinet +.PATH: ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 KMOD= ip_mroute -SRCS= ip_mroute.c opt_mac.h opt_mrouting.h + +SRCS= ip_mroute.c +SRCS+= opt_inet.h opt_mac.h opt_mrouting.h +SRCS+= opt_inet6.h + +.if !defined(MK_INET6_SUPPORT) || ${MK_INET6_SUPPORT} != "no" +SRCS+= ip6_mroute.c +.endif .if !defined(KERNBUILDDIR) +opt_inet.h: + echo "#define INET 1" > ${.TARGET} opt_mrouting.h: - echo "#define MROUTING 1" > ${.TARGET} + echo "#define MROUTING 1" > ${.TARGET} +.if !defined(MK_INET6_SUPPORT) || ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} +.endif .endif .include ==== //depot/projects/linuxolator/src/sys/netinet/ip_mroute.c#8 (text+ko) ==== @@ -52,9 +52,11 @@ * and PIM-SMv2 and PIM-DM support, advanced API support, * bandwidth metering and signaling * - * $FreeBSD: src/sys/netinet/ip_mroute.c,v 1.129 2007/02/10 23:15:28 bms Exp $ + * $FreeBSD: src/sys/netinet/ip_mroute.c,v 1.130 2007/02/24 11:38:46 bms Exp $ */ +#include "opt_inet.h" +#include "opt_inet6.h" #include "opt_mac.h" #include "opt_mrouting.h" @@ -92,6 +94,12 @@ #include #include #include +#ifdef INET6 +#include +#include +#include +#include +#endif #include #include @@ -217,6 +225,19 @@ .pr_usrreqs = &rip_usrreqs }; static const struct encaptab *pim_encap_cookie; + +#ifdef INET6 +/* ip6_mroute.c glue */ +extern struct in6_protosw in6_pim_protosw; +static const struct encaptab *pim6_encap_cookie; + +extern int X_ip6_mrouter_set(struct socket *, struct sockopt *); +extern int X_ip6_mrouter_get(struct socket *, struct sockopt *); +extern int X_ip6_mrouter_done(void); +extern int X_ip6_mforward(struct ip6_hdr *, struct ifnet *, struct mbuf *); +extern int X_mrt6_ioctl(int, caddr_t); +#endif + static int pim_encapcheck(const struct mbuf *, int, int, void *); /* @@ -2737,7 +2758,7 @@ } /* - * pim_encapcheck() is called by the encap4_input() path at runtime to + * pim_encapcheck() is called by the encap[46]_input() path at runtime to * determine if a packet is for PIM; allowing PIM to be dynamically loaded * into the kernel. */ @@ -2995,6 +3016,10 @@ return; } +/* + * XXX: This is common code for dealing with initialization for both + * the IPv4 and IPv6 multicast forwarding paths. It could do with cleanup. + */ static int ip_mroute_modevent(module_t mod, int type, void *unused) { @@ -3006,6 +3031,7 @@ ip_mrouter_reset(); TUNABLE_ULONG_FETCH("net.inet.pim.squelch_wholepkt", &pim_squelch_wholepkt); + pim_encap_cookie = encap_attach_func(AF_INET, IPPROTO_PIM, pim_encapcheck, &in_pim_protosw, NULL); if (pim_encap_cookie == NULL) { @@ -3015,13 +3041,40 @@ mtx_destroy(&mrouter_mtx); return (EINVAL); } + +#ifdef INET6 + pim6_encap_cookie = encap_attach_func(AF_INET6, IPPROTO_PIM, + pim_encapcheck, (struct protosw *)&in6_pim_protosw, NULL); + if (pim6_encap_cookie == NULL) { + printf("ip_mroute: unable to attach pim6 encap\n"); + if (pim_encap_cookie) { + encap_detach(pim_encap_cookie); + pim_encap_cookie = NULL; + } + VIF_LOCK_DESTROY(); + MFC_LOCK_DESTROY(); + mtx_destroy(&mrouter_mtx); + return (EINVAL); + } +#endif + ip_mcast_src = X_ip_mcast_src; ip_mforward = X_ip_mforward; ip_mrouter_done = X_ip_mrouter_done; ip_mrouter_get = X_ip_mrouter_get; ip_mrouter_set = X_ip_mrouter_set; + +#ifdef INET6 + ip6_mforward = X_ip6_mforward; + ip6_mrouter_done = X_ip6_mrouter_done; + ip6_mrouter_get = X_ip6_mrouter_get; + ip6_mrouter_set = X_ip6_mrouter_set; + mrt6_ioctl = X_mrt6_ioctl; +#endif + ip_rsvp_force_done = X_ip_rsvp_force_done; ip_rsvp_vif = X_ip_rsvp_vif; + legal_vif_num = X_legal_vif_num; mrt_ioctl = X_mrt_ioctl; rsvp_input_p = X_rsvp_input; @@ -3036,29 +3089,49 @@ * just loaded and then unloaded w/o starting up a user * process we still need to cleanup. */ - if (ip_mrouter) + if (ip_mrouter +#ifdef INET6 + || ip6_mrouter +#endif + ) return EINVAL; +#ifdef INET6 + if (pim6_encap_cookie) { + encap_detach(pim6_encap_cookie); + pim6_encap_cookie = NULL; + } + X_ip6_mrouter_done(); + ip6_mforward = NULL; + ip6_mrouter_done = NULL; + ip6_mrouter_get = NULL; + ip6_mrouter_set = NULL; + mrt6_ioctl = NULL; +#endif + if (pim_encap_cookie) { encap_detach(pim_encap_cookie); pim_encap_cookie = NULL; } - X_ip_mrouter_done(); ip_mcast_src = NULL; ip_mforward = NULL; ip_mrouter_done = NULL; ip_mrouter_get = NULL; ip_mrouter_set = NULL; + ip_rsvp_force_done = NULL; ip_rsvp_vif = NULL; + legal_vif_num = NULL; mrt_ioctl = NULL; rsvp_input_p = NULL; + VIF_LOCK_DESTROY(); MFC_LOCK_DESTROY(); mtx_destroy(&mrouter_mtx); break; + default: return EOPNOTSUPP; } ==== //depot/projects/linuxolator/src/sys/netinet6/in6.c#6 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/in6.c,v 1.67 2006/12/16 14:15:31 bz Exp $ */ +/* $FreeBSD: src/sys/netinet6/in6.c,v 1.68 2007/02/24 11:38:47 bms Exp $ */ /* $KAME: in6.c,v 1.259 2002/01/21 11:37:50 keiichi Exp $ */ /*- @@ -334,7 +334,7 @@ switch (cmd) { case SIOCGETSGCNT_IN6: case SIOCGETMIFCNT_IN6: - return (mrt6_ioctl(cmd, data)); + return (mrt6_ioctl ? mrt6_ioctl(cmd, data) : EOPNOTSUPP); } switch(cmd) { ==== //depot/projects/linuxolator/src/sys/netinet6/in6_proto.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/in6_proto.c,v 1.40 2006/11/03 15:23:15 rrs Exp $ */ +/* $FreeBSD: src/sys/netinet6/in6_proto.c,v 1.41 2007/02/24 11:38:47 bms Exp $ */ /* $KAME: in6_proto.c,v 1.91 2001/05/27 13:28:35 itojun Exp $ */ /*- @@ -335,7 +335,7 @@ .pr_domain = &inet6domain, .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, - .pr_input = pim6_input, + .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs ==== //depot/projects/linuxolator/src/sys/netinet6/ip6_input.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/ip6_input.c,v 1.89 2006/12/12 12:17:57 bz Exp $ */ +/* $FreeBSD: src/sys/netinet6/ip6_input.c,v 1.90 2007/02/24 11:38:47 bms Exp $ */ /* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */ /*- @@ -696,7 +696,8 @@ * ip6_mforward() returns a non-zero value, the packet * must be discarded, else it may be accepted below. */ - if (ip6_mrouter && ip6_mforward(ip6, m->m_pkthdr.rcvif, m)) { + if (ip6_mrouter && ip6_mforward && + ip6_mforward(ip6, m->m_pkthdr.rcvif, m)) { ip6stat.ip6s_cantforward++; m_freem(m); return; ==== //depot/projects/linuxolator/src/sys/netinet6/ip6_mroute.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/ip6_mroute.c,v 1.39 2006/12/12 12:17:57 bz Exp $ */ +/* $FreeBSD: src/sys/netinet6/ip6_mroute.c,v 1.40 2007/02/24 11:38:47 bms Exp $ */ /* $KAME: ip6_mroute.c,v 1.58 2001/12/18 02:36:31 itojun Exp $ */ /*- @@ -96,6 +96,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,7 @@ #include #include #include +#include #include #include @@ -130,6 +132,18 @@ static int register_send __P((struct ip6_hdr *, struct mif6 *, struct mbuf *)); +extern struct domain inet6domain; +struct ip6protosw in6_pim_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_PIM, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, + .pr_input = pim6_input, + .pr_output = rip6_output, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreqs = &rip6_usrreqs +}; + /* * Globals. All but ip6_mrouter, ip6_mrtproto and mrt6stat could be static, * except for netstat or debugging purposes. @@ -137,14 +151,32 @@ struct socket *ip6_mrouter = NULL; int ip6_mrouter_ver = 0; int ip6_mrtproto = IPPROTO_PIM; /* for netstat only */ + +SYSCTL_DECL(_net_inet6); +SYSCTL_DECL(_net_inet6_ip6); +SYSCTL_NODE(_net_inet6, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); + struct mrt6stat mrt6stat; +SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RW, + &mrt6stat, mrt6stat, + "Multicast Routing Statistics (struct mrt6stat, netinet6/ip6_mroute.h)"); #define NO_RTE_FOUND 0x1 #define RTE_FOUND 0x2 struct mf6c *mf6ctable[MF6CTBLSIZ]; +SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mf6ctable, CTLFLAG_RD, + &mf6ctable, sizeof(mf6ctable), "S,*mf6ctable[MF6CTBLSIZ]", + "Multicast Forwarding Table (struct *mf6ctable[MF6CTBLSIZ], " + "netinet6/ip6_mroute.h)"); + u_char n6expire[MF6CTBLSIZ]; + static struct mif6 mif6table[MAXMIFS]; +SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mif6table, CTLFLAG_RD, + &mif6table, sizeof(mif6table), "S,vif[MAXMIFS]", + "Multicast Interfaces (struct mif[MAXMIFS], netinet6/ip6_mroute.h)"); + #ifdef MRT6DEBUG u_int mrt6debug = 0; /* debug level */ #define DEBUG_MFC 0x02 @@ -187,6 +219,10 @@ static mifi_t reg_mif_num = (mifi_t)-1; static struct pim6stat pim6stat; +SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RD, + &pim6stat, pim6stat, + "PIM Statistics (struct pim6stat, netinet6/pim_var.h)"); + static int pim6; /* @@ -261,13 +297,17 @@ static struct callout expire_upcalls_ch; +int X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m); +int X_ip6_mrouter_done(void); +int X_ip6_mrouter_set(struct socket *so, struct sockopt *sopt); +int X_ip6_mrouter_get(struct socket *so, struct sockopt *sopt); +int X_mrt6_ioctl(int cmd, caddr_t data); + /* * Handle MRT setsockopt commands to modify the multicast routing tables. */ int -ip6_mrouter_set(so, sopt) - struct socket *so; - struct sockopt *sopt; +X_ip6_mrouter_set(struct socket *so, struct sockopt *sopt) { int error = 0; int optval; @@ -290,7 +330,7 @@ error = ip6_mrouter_init(so, optval, sopt->sopt_name); break; case MRT6_DONE: - error = ip6_mrouter_done(); + error = X_ip6_mrouter_done(); break; case MRT6_ADD_MIF: error = sooptcopyin(sopt, &mifc, sizeof(mifc), sizeof(mifc)); @@ -335,9 +375,7 @@ * Handle MRT getsockopt commands */ int -ip6_mrouter_get(so, sopt) - struct socket *so; - struct sockopt *sopt; +X_ip6_mrouter_get(struct socket *so, struct sockopt *sopt) { int error = 0; @@ -356,9 +394,7 @@ * Handle ioctl commands to obtain information from the cache */ int -mrt6_ioctl(cmd, data) - int cmd; - caddr_t data; +X_mrt6_ioctl(int cmd, caddr_t data) { switch (cmd) { case SIOCGETSGCNT_IN6: @@ -478,7 +514,7 @@ * Disable multicast routing */ int -ip6_mrouter_done() +X_ip6_mrouter_done(void) { mifi_t mifi; int i; @@ -993,10 +1029,7 @@ */ int -ip6_mforward(ip6, ifp, m) - struct ip6_hdr *ip6; - struct ifnet *ifp; - struct mbuf *m; +X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) { struct mf6c *rt; struct mif6 *mifp; ==== //depot/projects/linuxolator/src/sys/netinet6/ip6_mroute.h#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/ip6_mroute.h,v 1.9 2006/09/29 16:16:41 bms Exp $ */ +/* $FreeBSD: src/sys/netinet6/ip6_mroute.h,v 1.10 2007/02/24 11:38:47 bms Exp $ */ /* $KAME: ip6_mroute.h,v 1.19 2001/06/14 06:12:55 suz Exp $ */ /*- @@ -268,10 +268,10 @@ #define MAX_UPQ6 4 /* max. no of pkts in upcall Q */ -int ip6_mrouter_set __P((struct socket *so, struct sockopt *sopt)); -int ip6_mrouter_get __P((struct socket *so, struct sockopt *sopt)); -int ip6_mrouter_done __P((void)); -int mrt6_ioctl __P((int, caddr_t)); +extern int (*ip6_mrouter_set)(struct socket *so, struct sockopt *sopt); +extern int (*ip6_mrouter_get)(struct socket *so, struct sockopt *sopt); +extern int (*ip6_mrouter_done)(void); +extern int (*mrt6_ioctl)(int, caddr_t); #endif /* _KERNEL */ #endif /* !_NETINET6_IP6_MROUTE_H_ */ ==== //depot/projects/linuxolator/src/sys/netinet6/ip6_var.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/ip6_var.h,v 1.36 2005/10/21 15:45:13 suz Exp $ */ +/* $FreeBSD: src/sys/netinet6/ip6_var.h,v 1.37 2007/02/24 11:38:47 bms Exp $ */ /* $KAME: ip6_var.h,v 1.62 2001/05/03 14:51:48 itojun Exp $ */ /*- @@ -353,7 +353,9 @@ struct ip6aux *ip6_findaux __P((struct mbuf *)); void ip6_delaux __P((struct mbuf *)); -int ip6_mforward __P((struct ip6_hdr *, struct ifnet *, struct mbuf *)); +extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, + struct mbuf *); + int ip6_process_hopopts __P((struct mbuf *, u_int8_t *, int, u_int32_t *, u_int32_t *)); void ip6_savecontrol __P((struct inpcb *, struct mbuf *, struct mbuf **)); ==== //depot/projects/linuxolator/src/sys/netinet6/raw_ip6.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.64 2006/07/21 17:11:14 rwatson Exp $ + * $FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.65 2007/02/24 11:38:47 bms Exp $ */ /*- @@ -122,6 +122,18 @@ struct rip6stat rip6stat; /* + * Hooks for multicast forwarding. + */ + +struct socket *ip6_mrouter; + +int (*ip6_mrouter_set)(struct socket *, struct sockopt *); +int (*ip6_mrouter_get)(struct socket *, struct sockopt *); +int (*ip6_mrouter_done)(void); +int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *); +int (*mrt6_ioctl)(int, caddr_t); + +/* * Setup generic address and protocol structures * for raw_input routine, then pass them along with * mbuf chain. @@ -507,7 +519,8 @@ case MRT6_ADD_MFC: case MRT6_DEL_MFC: case MRT6_PIM: - error = ip6_mrouter_get(so, sopt); + error = ip6_mrouter_get ? ip6_mrouter_get(so, sopt) : + EOPNOTSUPP; break; case IPV6_CHECKSUM: error = ip6_raw_ctloutput(so, sopt); @@ -527,7 +540,8 @@ case MRT6_ADD_MFC: case MRT6_DEL_MFC: case MRT6_PIM: - error = ip6_mrouter_set(so, sopt); + error = ip6_mrouter_set ? ip6_mrouter_set(so, sopt) : + EOPNOTSUPP; break; >>> TRUNCATED FOR MAIL (1000 lines) <<<