From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 00:06:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52F3C106566C; Thu, 19 Feb 2009 00:06:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4167C8FC1A; Thu, 19 Feb 2009 00:06:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J062ps078717; Thu, 19 Feb 2009 00:06:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J062Qg078716; Thu, 19 Feb 2009 00:06:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902190006.n1J062Qg078716@svn.freebsd.org> From: Robert Watson Date: Thu, 19 Feb 2009 00:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188768 - head/sys/dev/cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 00:06:02 -0000 Author: rwatson Date: Thu Feb 19 00:06:01 2009 New Revision: 188768 URL: http://svn.freebsd.org/changeset/base/188768 Log: if_cx is currently disconnected from the build due to a dependence on the old TTY implementation; however, take a cut at stripping its optional Giant-protected code paths enabled using debug.cx.mpsafenet, which will no longer work once IFF_NEEDSGIANT is removed. Modified: head/sys/dev/cx/if_cx.c Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Wed Feb 18 22:44:55 2009 (r188767) +++ head/sys/dev/cx/if_cx.c Thu Feb 19 00:06:01 2009 (r188768) @@ -83,24 +83,9 @@ __FBSDID("$FreeBSD$"); #define CX_LOCK_NAME "cxX" -static int cx_mpsafenet = 1; -TUNABLE_INT("debug.cx.mpsafenet", &cx_mpsafenet); -SYSCTL_NODE(_debug, OID_AUTO, cx, CTLFLAG_RD, 0, "Cronyx Sigma Adapters"); -SYSCTL_INT(_debug_cx, OID_AUTO, mpsafenet, CTLFLAG_RD, &cx_mpsafenet, 0, - "Enable/disable MPSAFE network support for Cronyx Sigma Adapters"); - -#define CX_LOCK(_bd) do { \ - if (cx_mpsafenet) \ - mtx_lock (&(_bd)->cx_mtx); \ - } while (0) -#define CX_UNLOCK(_bd) do { \ - if (cx_mpsafenet) \ - mtx_unlock (&(_bd)->cx_mtx); \ - } while (0) -#define CX_LOCK_ASSERT(_bd) do { \ - if (cx_mpsafenet) \ - mtx_assert (&(_bd)->cx_mtx, MA_OWNED); \ - } while (0) +#define CX_LOCK(_bd) mtx_lock (&(_bd)->cx_mtx) +#define CX_UNLOCK(_bd) mtx_unlock (&(_bd)->cx_mtx) +#define CX_LOCK_ASSERT(_bd) mtx_assert (&(_bd)->cx_mtx, MA_OWNED) typedef struct _async_q { int beg; @@ -239,7 +224,7 @@ static struct cdevsw cx_cdevsw = { .d_close = cx_close, .d_ioctl = cx_ioctl, .d_name = "cx", - .d_flags = D_TTY | D_NEEDGIANT, + .d_flags = D_TTY, }; static int MY_SOFT_INTR; @@ -776,10 +761,10 @@ static int cx_attach (device_t dev) return ENXIO; } b->sys = bd; - callout_init (&led_timo[b->num], cx_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&led_timo[b->num], CALLOUT_MPSAFE); s = splhigh (); if (bus_setup_intr (dev, bd->irq_res, - INTR_TYPE_NET|(cx_mpsafenet?INTR_MPSAFE:0), + INTR_TYPE_NET|INTR_MPSAFE, NULL, cx_intr, bd, &bd->intrhand)) { printf ("cx%d: Can't setup irq %ld\n", unit, irq); bd->board = 0; @@ -849,8 +834,7 @@ static int cx_attach (device_t dev) d->hi_queue.ifq_maxlen = IFQ_MAXLEN; mtx_init (&d->lo_queue.ifq_mtx, "cx_queue_lo", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "cx_queue_hi", NULL, MTX_DEF); - callout_init (&d->timeout_handle, - cx_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&d->timeout_handle, CALLOUT_MPSAFE); #else /*NETGRAPH*/ d->ifp = if_alloc(IFT_PPP); if (d->ifp == NULL) { @@ -865,8 +849,6 @@ static int cx_attach (device_t dev) if_initname (d->ifp, "cx", b->num * NCHAN + c->num); d->ifp->if_mtu = PP_MTU; d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; - if (!cx_mpsafenet) - d->ifp->if_flags |= IFF_NEEDSGIANT; d->ifp->if_ioctl = cx_sioctl; d->ifp->if_start = cx_ifstart; d->ifp->if_watchdog = cx_ifwatchdog; @@ -901,8 +883,7 @@ static int cx_attach (device_t dev) ttycreate(d->tty, TS_CALLOUT, "x%r%r", b->num, c->num); d->devt = make_dev (&cx_cdevsw, b->num*NCHAN + c->num + 64, UID_ROOT, GID_WHEEL, 0600, "cx%d", b->num*NCHAN + c->num); d->devt->si_drv1 = d; - callout_init (&d->dcd_timeout_handle, - cx_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&d->dcd_timeout_handle, CALLOUT_MPSAFE); } splx (s); @@ -2538,9 +2519,6 @@ static int cx_modevent (module_t mod, in { static int load_count = 0; - if (cx_mpsafenet) - cx_cdevsw.d_flags &= ~D_NEEDGIANT; - switch (type) { case MOD_LOAD: #ifdef NETGRAPH @@ -2549,11 +2527,11 @@ static int cx_modevent (module_t mod, in #endif ++load_count; - callout_init (&timeout_handle, cx_mpsafenet?CALLOUT_MPSAFE:0); + callout_init (&timeout_handle, CALLOUT_MPSAFE); callout_reset (&timeout_handle, hz*5, cx_timeout, 0); /* Software interrupt. */ swi_add(&tty_intr_event, "cx", cx_softintr, NULL, SWI_TTY, - (cx_mpsafenet?INTR_MPSAFE:0), &cx_fast_ih); + INTR_MPSAFE, &cx_fast_ih); break; case MOD_UNLOAD: if (load_count == 1) {