From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 01:13:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE4B1106566C; Sun, 30 Oct 2011 01:13:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A231E8FC12; Sun, 30 Oct 2011 01:13:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U1DlVe041234; Sun, 30 Oct 2011 01:13:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U1DlFX041217; Sun, 30 Oct 2011 01:13:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110300113.p9U1DlFX041217@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 01:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226921 - in stable/8/sys/dev: cm ep fatm malo mwl sn ti vx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 01:13:48 -0000 Author: marius Date: Sun Oct 30 01:13:47 2011 New Revision: 226921 URL: http://svn.freebsd.org/changeset/base/226921 Log: MFC: r199559 - Add a private timer to drive the transmit watchdog instead of using if_watchdog and if_timer. - Fix some issues in detach for sn(4), ste(4), and ti(4). Primarily this means calling ether_ifdetach() before anything else. Modified: stable/8/sys/dev/cm/smc90cx6.c stable/8/sys/dev/cm/smc90cx6var.h stable/8/sys/dev/ep/if_ep.c stable/8/sys/dev/ep/if_epvar.h stable/8/sys/dev/fatm/if_fatm.c stable/8/sys/dev/fatm/if_fatmvar.h stable/8/sys/dev/malo/if_malo.c stable/8/sys/dev/malo/if_malo.h stable/8/sys/dev/mwl/if_mwl.c stable/8/sys/dev/mwl/if_mwlvar.h stable/8/sys/dev/sn/if_sn.c stable/8/sys/dev/sn/if_snvar.h stable/8/sys/dev/ti/if_ti.c stable/8/sys/dev/ti/if_tireg.h stable/8/sys/dev/vx/if_vx.c stable/8/sys/dev/vx/if_vxvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/cm/smc90cx6.c ============================================================================== --- stable/8/sys/dev/cm/smc90cx6.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/cm/smc90cx6.c Sun Oct 30 01:13:47 2011 (r226921) @@ -124,7 +124,7 @@ static void cm_reset_locked(struct cm_so void cm_start(struct ifnet *); void cm_start_locked(struct ifnet *); int cm_ioctl(struct ifnet *, unsigned long, caddr_t); -void cm_watchdog(struct ifnet *); +void cm_watchdog(void *); void cm_srint_locked(void *vsc); static void cm_tint_locked(struct cm_softc *, int); void cm_reconwatch_locked(void *); @@ -194,11 +194,9 @@ cm_attach(dev) ifp->if_output = arc_output; ifp->if_start = cm_start; ifp->if_ioctl = cm_ioctl; - ifp->if_watchdog = cm_watchdog; ifp->if_init = cm_init; /* XXX IFQ_SET_READY(&ifp->if_snd); */ ifp->if_snd.ifq_maxlen = ifqmaxlen; - ifp->if_timer = 0; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; arc_ifattach(ifp, linkaddress); @@ -210,6 +208,7 @@ cm_attach(dev) #endif callout_init_mtx(&sc->sc_recon_ch, &sc->sc_mtx, 0); + callout_init_mtx(&sc->sc_watchdog_timer, &sc->sc_mtx, 0); if_printf(ifp, "link addr 0x%02x (%d)\n", linkaddress, linkaddress); return 0; @@ -315,6 +314,7 @@ cm_reset_locked(sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->sc_watchdog_timer, hz, cm_watchdog, sc); cm_start_locked(ifp); } @@ -332,7 +332,8 @@ cm_stop_locked(sc) GETREG(CMRESET); /* Stop watchdog timer */ - sc->sc_ifp->if_timer = 0; + callout_stop(&sc->sc_watchdog_timer); + sc->sc_timer = 0; } void @@ -464,7 +465,7 @@ cm_start_locked(ifp) PUTREG(CMCMD, CM_TX(buffer)); PUTREG(CMSTAT, sc->sc_intmask); - ifp->if_timer = ARCTIMEOUT; + sc->sc_timer = ARCTIMEOUT; } m_freem(m); @@ -627,7 +628,7 @@ cm_tint_locked(sc, isr) if (isr & CM_TMA || sc->sc_broadcast[buffer]) ifp->if_opackets++; #ifdef CMRETRANSMIT - else if (ifp->if_flags & IFF_LINK2 && ifp->if_timer > 0 + else if (ifp->if_flags & IFF_LINK2 && sc->sc_timer > 0 && --sc->sc_retransmits[buffer] > 0) { /* retransmit same buffer */ PUTREG(CMCMD, CM_TX(buffer)); @@ -657,7 +658,7 @@ cm_tint_locked(sc, isr) */ PUTREG(CMCMD, CM_TX(buffer)); /* init watchdog timer */ - ifp->if_timer = ARCTIMEOUT; + sc->sc_timer = ARCTIMEOUT; #if defined(CM_DEBUG) && (CM_DEBUG > 1) if_printf(ifp, @@ -669,7 +670,7 @@ cm_tint_locked(sc, isr) sc->sc_intmask &= ~CM_TA; PUTREG(CMSTAT, sc->sc_intmask); /* ... and watchdog timer */ - ifp->if_timer = 0; + sc->sc_timer = 0; #ifdef CM_DEBUG if_printf(ifp, "tint: no more buffers to send, status 0x%02x\n", @@ -920,12 +921,13 @@ cm_ioctl(ifp, command, data) * retransmission is implemented). */ void -cm_watchdog(ifp) - struct ifnet *ifp; +cm_watchdog(void *arg) { - struct cm_softc *sc = ifp->if_softc; + struct cm_softc *sc; - CM_LOCK(sc); + sc = arg; + callout_reset(&sc->sc_watchdog_timer, hz, cm_watchdog, sc); + if (sc->sc_timer == 0 || --sc->sc_timer > 0) + return; PUTREG(CMCMD, CM_TXDIS); - CM_UNLOCK(sc); } Modified: stable/8/sys/dev/cm/smc90cx6var.h ============================================================================== --- stable/8/sys/dev/cm/smc90cx6var.h Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/cm/smc90cx6var.h Sun Oct 30 01:13:47 2011 (r226921) @@ -77,6 +77,8 @@ struct cm_softc { u_long sc_reconcount_excessive; /* for the above */ #define ARC_EXCESSIVE_RECONS 20 #define ARC_EXCESSIVE_RECONS_REWARN 400 + struct callout sc_watchdog_timer; + int sc_timer; u_char sc_intmask; u_char sc_rx_act; /* 2..3 */ u_char sc_tx_act; /* 0..1 */ Modified: stable/8/sys/dev/ep/if_ep.c ============================================================================== --- stable/8/sys/dev/ep/if_ep.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/ep/if_ep.c Sun Oct 30 01:13:47 2011 (r226921) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -91,10 +92,12 @@ static int ep_media2if_media[] = static void epinit(void *); static int epioctl(struct ifnet *, u_long, caddr_t); static void epstart(struct ifnet *); -static void epwatchdog(struct ifnet *); +static void ep_intr_locked(struct ep_softc *); static void epstart_locked(struct ifnet *); static void epinit_locked(struct ep_softc *); +static void eptick(void *); +static void epwatchdog(struct ep_softc *); /* if_media functions */ static int ep_ifmedia_upd(struct ifnet *); @@ -302,12 +305,12 @@ ep_attach(struct ep_softc *sc) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = epstart; ifp->if_ioctl = epioctl; - ifp->if_watchdog = epwatchdog; ifp->if_init = epinit; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); + callout_init_mtx(&sc->watchdog_timer, &sc->sc_mtx, 0); if (!sc->epb.mii_trans) { ifmedia_init(&sc->ifmedia, 0, ep_ifmedia_upd, ep_ifmedia_sts); @@ -361,6 +364,7 @@ ep_detach(device_t dev) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; EP_UNLOCK(sc); ether_ifdetach(ifp); + callout_drain(&sc->watchdog_timer); ep_free(dev); if_free(ifp); @@ -457,6 +461,7 @@ epinit_locked(struct ep_softc *sc) GO_WINDOW(sc, 1); epstart_locked(ifp); + callout_reset(&sc->watchdog_timer, hz, eptick, sc); } static void @@ -556,7 +561,7 @@ startagain: BPF_MTAP(ifp, m0); - ifp->if_timer = 2; + sc->tx_timer = 2; ifp->if_opackets++; m_freem(m0); @@ -583,20 +588,26 @@ void ep_intr(void *arg) { struct ep_softc *sc; - int status; - struct ifnet *ifp; sc = (struct ep_softc *) arg; EP_LOCK(sc); + ep_intr_locked(sc); + EP_UNLOCK(sc); +} + +static void +ep_intr_locked(struct ep_softc *sc) +{ + int status; + struct ifnet *ifp; + /* XXX 4.x splbio'd here to reduce interruptability */ /* * quick fix: Try to detect an interrupt when the card goes away. */ - if (sc->gone || CSR_READ_2(sc, EP_STATUS) == 0xffff) { - EP_UNLOCK(sc); + if (sc->gone || CSR_READ_2(sc, EP_STATUS) == 0xffff) return; - } ifp = sc->ifp; CSR_WRITE_2(sc, EP_COMMAND, SET_INTR_MASK); /* disable all Ints */ @@ -612,14 +623,14 @@ rescan: epread(sc); if (status & S_TX_AVAIL) { /* we need ACK */ - ifp->if_timer = 0; + sc->tx_timer = 0; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; GO_WINDOW(sc, 1); CSR_READ_2(sc, EP_W1_FREE_TX); epstart_locked(ifp); } if (status & S_CARD_FAILURE) { - ifp->if_timer = 0; + sc->tx_timer = 0; #ifdef EP_LOCAL_STATS device_printf(sc->dev, "\n\tStatus: %x\n", status); GO_WINDOW(sc, 4); @@ -642,11 +653,10 @@ rescan: #endif epinit_locked(sc); - EP_UNLOCK(sc); return; } if (status & S_TX_COMPLETE) { - ifp->if_timer = 0; + sc->tx_timer = 0; /* * We need ACK. We do it at the end. * @@ -701,7 +711,6 @@ rescan: /* re-enable Ints */ CSR_WRITE_2(sc, EP_COMMAND, SET_INTR_MASK | S_5_INTS); - EP_UNLOCK(sc); } static void @@ -934,7 +943,6 @@ epioctl(struct ifnet *ifp, u_long cmd, c EP_LOCK(sc); if (((ifp->if_flags & IFF_UP) == 0) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; epstop(sc); } else /* reinitialize card on any parameter change */ @@ -967,15 +975,27 @@ epioctl(struct ifnet *ifp, u_long cmd, c } static void -epwatchdog(struct ifnet *ifp) +eptick(void *arg) { - struct ep_softc *sc = ifp->if_softc; + struct ep_softc *sc; + + sc = arg; + if (sc->tx_timer != 0 && --sc->tx_timer == 0) + epwatchdog(sc); + callout_reset(&sc->watchdog_timer, hz, eptick, sc); +} + +static void +epwatchdog(struct ep_softc *sc) +{ + struct ifnet *ifp; + ifp = sc->ifp; if (sc->gone) return; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - epstart(ifp); - ep_intr(ifp->if_softc); + epstart_locked(ifp); + ep_intr_locked(sc); } static void @@ -998,4 +1018,7 @@ epstop(struct ep_softc *sc) CSR_WRITE_2(sc, EP_COMMAND, SET_RD_0_MASK); CSR_WRITE_2(sc, EP_COMMAND, SET_INTR_MASK); CSR_WRITE_2(sc, EP_COMMAND, SET_RX_FILTER); + + sc->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + callout_stop(&sc->watchdog_timer); } Modified: stable/8/sys/dev/ep/if_epvar.h ============================================================================== --- stable/8/sys/dev/ep/if_epvar.h Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/ep/if_epvar.h Sun Oct 30 01:13:47 2011 (r226921) @@ -45,6 +45,9 @@ struct ep_softc { bus_space_tag_t bst; void *ep_intrhand; + struct callout watchdog_timer; + int tx_timer; + u_short ep_connectors; /* Connectors on this card. */ u_char ep_connector; /* Configured connector. */ Modified: stable/8/sys/dev/fatm/if_fatm.c ============================================================================== --- stable/8/sys/dev/fatm/if_fatm.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/fatm/if_fatm.c Sun Oct 30 01:13:47 2011 (r226921) @@ -391,16 +391,14 @@ fatm_check_heartbeat(struct fatm_softc * * Ensure that the heart is still beating. */ static void -fatm_watchdog(struct ifnet *ifp) +fatm_watchdog(void *arg) { - struct fatm_softc *sc = ifp->if_softc; + struct fatm_softc *sc; - FATM_LOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - fatm_check_heartbeat(sc); - ifp->if_timer = 5; - } - FATM_UNLOCK(sc); + sc = arg; + FATM_CHECKLOCK(sc); + fatm_check_heartbeat(sc); + callout_reset(&sc->watchdog_timer, hz * 5, fatm_watchdog, sc); } /* @@ -474,7 +472,7 @@ fatm_stop(struct fatm_softc *sc) (void)fatm_reset(sc); /* stop watchdog */ - sc->ifp->if_timer = 0; + callout_stop(&sc->watchdog_timer); if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { sc->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -1341,7 +1339,7 @@ fatm_init_locked(struct fatm_softc *sc) /* * Start the watchdog timer */ - sc->ifp->if_timer = 5; + callout_reset(&sc->watchdog_timer, hz * 5, fatm_watchdog, sc); /* start SUNI */ utopia_start(&sc->utopia); @@ -2543,6 +2541,7 @@ fatm_detach(device_t dev) FATM_UNLOCK(sc); atm_ifdetach(sc->ifp); /* XXX race */ } + callout_drain(&sc->watchdog_timer); if (sc->ih != NULL) bus_teardown_intr(dev, sc->irqres, sc->ih); @@ -2784,6 +2783,7 @@ fatm_attach(device_t dev) cv_init(&sc->cv_regs, "fatm_regs"); sysctl_ctx_init(&sc->sysctl_ctx); + callout_init_mtx(&sc->watchdog_timer, &sc->mtx, 0); /* * Make the sysctl tree @@ -2824,7 +2824,6 @@ fatm_attach(device_t dev) ifp->if_flags = IFF_SIMPLEX; ifp->if_ioctl = fatm_ioctl; ifp->if_start = fatm_start; - ifp->if_watchdog = fatm_watchdog; ifp->if_init = fatm_init; ifp->if_linkmib = &IFP2IFATM(sc->ifp)->mib; ifp->if_linkmiblen = sizeof(IFP2IFATM(sc->ifp)->mib); Modified: stable/8/sys/dev/fatm/if_fatmvar.h ============================================================================== --- stable/8/sys/dev/fatm/if_fatmvar.h Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/fatm/if_fatmvar.h Sun Oct 30 01:13:47 2011 (r226921) @@ -188,6 +188,7 @@ struct fatm_softc { struct ifnet *ifp; /* common part */ struct mtx mtx; /* lock this structure */ struct ifmedia media; /* media */ + struct callout watchdog_timer; int init_state; /* initialisation step */ int memid; /* resource id for card memory */ Modified: stable/8/sys/dev/malo/if_malo.c ============================================================================== --- stable/8/sys/dev/malo/if_malo.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/malo/if_malo.c Sun Oct 30 01:13:47 2011 (r226921) @@ -135,7 +135,7 @@ static int malo_setup_hwdma(struct malo_ static void malo_txq_init(struct malo_softc *, struct malo_txq *, int); static void malo_tx_cleanupq(struct malo_softc *, struct malo_txq *); static void malo_start(struct ifnet *); -static void malo_watchdog(struct ifnet *); +static void malo_watchdog(void *); static int malo_ioctl(struct ifnet *, u_long, caddr_t); static void malo_updateslot(struct ifnet *); static int malo_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -191,6 +191,7 @@ malo_attach(uint16_t devid, struct malo_ ic = ifp->if_l2com; MALO_LOCK_INIT(sc); + callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0); /* set these up early for if_printf use */ if_initname(ifp, device_get_name(sc->malo_dev), @@ -272,7 +273,6 @@ malo_attach(uint16_t devid, struct malo_ ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = malo_start; - ifp->if_watchdog = malo_watchdog; ifp->if_ioctl = malo_ioctl; ifp->if_init = malo_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); @@ -1076,7 +1076,7 @@ malo_tx_proc(void *arg, int npending) if (nreaped != 0) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_timer = 0; + sc->malo_timer = 0; malo_start(ifp); } } @@ -1260,7 +1260,7 @@ malo_tx_start(struct malo_softc *sc, str MALO_TXDESC_SYNC(txq, ds, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ifp->if_opackets++; - ifp->if_timer = 5; + sc->malo_timer = 5; MALO_TXQ_UNLOCK(txq); return 0; #undef IEEE80211_DIR_DSTODS @@ -1339,10 +1339,17 @@ malo_start(struct ifnet *ifp) } static void -malo_watchdog(struct ifnet *ifp) +malo_watchdog(void *arg) { - struct malo_softc *sc = ifp->if_softc; + struct malo_softc *sc; + struct ifnet *ifp; + + sc = arg; + callout_reset(&sc->malo_watchdog_timer, hz, malo_watchdog, sc); + if (sc->malo_timer == 0 || --sc->malo_timer > 0) + return; + ifp = sc->malo_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && !sc->malo_invalid) { if_printf(ifp, "watchdog timeout\n"); @@ -1536,6 +1543,7 @@ malo_init_locked(struct malo_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; malo_hal_intrset(mh, sc->malo_imask); + callout_reset(&sc->malo_watchdog_timer, hz, malo_watchdog, sc); } static void @@ -1699,7 +1707,8 @@ malo_stop_locked(struct ifnet *ifp, int * is gone (invalid). */ ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - ifp->if_timer = 0; + callout_stop(&sc->malo_watchdog_timer); + sc->malo_timer = 0; /* diable interrupt. */ malo_hal_intrset(mh, 0); /* turn off the radio. */ @@ -2241,6 +2250,7 @@ malo_detach(struct malo_softc *sc) * Other than that, it's straightforward... */ ieee80211_ifdetach(ic); + callout_drain(&sc->malo_watchdog_timer); malo_dma_cleanup(sc); malo_tx_cleanup(sc); malo_hal_detach(sc->malo_mh); Modified: stable/8/sys/dev/malo/if_malo.h ============================================================================== --- stable/8/sys/dev/malo/if_malo.h Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/malo/if_malo.h Sun Oct 30 01:13:47 2011 (r226921) @@ -550,6 +550,8 @@ struct malo_softc { struct malo_txq malo_txq[MALO_NUM_TX_QUEUES]; struct task malo_txtask; /* tx int processing */ + struct callout malo_watchdog_timer; + int malo_timer; struct malo_tx_radiotap_header malo_tx_th; struct malo_rx_radiotap_header malo_rx_th; Modified: stable/8/sys/dev/mwl/if_mwl.c ============================================================================== --- stable/8/sys/dev/mwl/if_mwl.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/mwl/if_mwl.c Sun Oct 30 01:13:47 2011 (r226921) @@ -98,7 +98,7 @@ static void mwl_start(struct ifnet *); static int mwl_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static int mwl_media_change(struct ifnet *); -static void mwl_watchdog(struct ifnet *); +static void mwl_watchdog(void *); static int mwl_ioctl(struct ifnet *, u_long, caddr_t); static void mwl_radar_proc(void *, int); static void mwl_chanswitch_proc(void *, int); @@ -360,6 +360,7 @@ mwl_attach(uint16_t devid, struct mwl_so goto bad1; callout_init(&sc->sc_timer, CALLOUT_MPSAFE); + callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); sc->sc_tq = taskqueue_create("mwl_taskq", M_NOWAIT, taskqueue_thread_enqueue, &sc->sc_tq); @@ -401,7 +402,6 @@ mwl_attach(uint16_t devid, struct mwl_so ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = mwl_start; - ifp->if_watchdog = mwl_watchdog; ifp->if_ioctl = mwl_ioctl; ifp->if_init = mwl_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); @@ -558,6 +558,7 @@ mwl_detach(struct mwl_softc *sc) * Other than that, it's straightforward... */ ieee80211_ifdetach(ic); + callout_drain(&sc->sc_watchdog); mwl_dma_cleanup(sc); mwl_tx_cleanup(sc); mwl_hal_detach(sc->sc_mh); @@ -1214,6 +1215,7 @@ mwl_init_locked(struct mwl_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; mwl_hal_intrset(mh, sc->sc_imask); + callout_reset(&sc->sc_watchdog, hz, mwl_watchdog, sc); return 0; } @@ -1251,7 +1253,8 @@ mwl_stop_locked(struct ifnet *ifp, int d * Shutdown the hardware and driver. */ ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - ifp->if_timer = 0; + callout_stop(&sc->sc_watchdog); + sc->sc_tx_timer = 0; mwl_draintxq(sc); } } @@ -3405,7 +3408,7 @@ mwl_tx_start(struct mwl_softc *sc, struc MWL_TXDESC_SYNC(txq, ds, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ifp->if_opackets++; - ifp->if_timer = 5; + sc->sc_tx_timer = 5; MWL_TXQ_UNLOCK(txq); return 0; @@ -3552,7 +3555,7 @@ mwl_tx_proc(void *arg, int npending) if (nreaped != 0) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_timer = 0; + sc->sc_tx_timer = 0; if (!IFQ_IS_EMPTY(&ifp->if_snd)) { /* NB: kick fw; the tx thread may have been preempted */ mwl_hal_txstart(sc->sc_mh, 0); @@ -3618,7 +3621,7 @@ mwl_draintxq(struct mwl_softc *sc) for (i = 0; i < MWL_NUM_TX_QUEUES; i++) mwl_tx_draintxq(sc, &sc->sc_txq[i]); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_timer = 0; + sc->sc_tx_timer = 0; } #ifdef MWL_DIAGAPI @@ -4764,10 +4767,17 @@ mwl_txq_dump(struct mwl_txq *txq) #endif static void -mwl_watchdog(struct ifnet *ifp) +mwl_watchdog(void *arg) { - struct mwl_softc *sc = ifp->if_softc; + struct mwl_softc *sc; + struct ifnet *ifp; + + sc = arg; + callout_reset(&sc->sc_watchdog, hz, mwl_watchdog, sc); + if (sc->sc_tx_timer == 0 || --sc->sc_tx_timer > 0) + return; + ifp = sc->sc_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && !sc->sc_invalid) { if (mwl_hal_setkeepalive(sc->sc_mh)) if_printf(ifp, "transmit timeout (firmware hung?)\n"); Modified: stable/8/sys/dev/mwl/if_mwlvar.h ============================================================================== --- stable/8/sys/dev/mwl/if_mwlvar.h Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/mwl/if_mwlvar.h Sun Oct 30 01:13:47 2011 (r226921) @@ -255,6 +255,8 @@ struct mwl_softc { bus_space_tag_t sc_io1t; struct mtx sc_mtx; /* master lock (recursive) */ struct taskqueue *sc_tq; /* private task queue */ + struct callout sc_watchdog; + int sc_tx_timer; unsigned int sc_invalid : 1, /* disable hardware accesses */ sc_recvsetup:1, /* recv setup */ sc_csapending:1,/* 11h channel switch pending */ Modified: stable/8/sys/dev/sn/if_sn.c ============================================================================== --- stable/8/sys/dev/sn/if_sn.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/sn/if_sn.c Sun Oct 30 01:13:47 2011 (r226921) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -121,6 +122,7 @@ static int snioctl(struct ifnet * ifp, u static void snresume(struct ifnet *); +static void snintr_locked(struct sn_softc *); static void sninit_locked(void *); static void snstart_locked(struct ifnet *); @@ -128,7 +130,7 @@ static void sninit(void *); static void snread(struct ifnet *); static void snstart(struct ifnet *); static void snstop(struct sn_softc *); -static void snwatchdog(struct ifnet *); +static void snwatchdog(void *); static void sn_setmcast(struct sn_softc *); static int sn_getmcf(struct ifnet *ifp, u_char *mcf); @@ -170,6 +172,7 @@ sn_attach(device_t dev) } SN_LOCK_INIT(sc); + callout_init_mtx(&sc->watchdog, &sc->sc_mtx, 0); snstop(sc); sc->pages_wanted = -1; @@ -202,13 +205,11 @@ sn_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = snstart; ifp->if_ioctl = snioctl; - ifp->if_watchdog = snwatchdog; ifp->if_init = sninit; ifp->if_baudrate = 10000000; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); - ifp->if_timer = 0; ether_ifattach(ifp, eaddr); @@ -233,9 +234,11 @@ sn_detach(device_t dev) struct sn_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->ifp; - snstop(sc); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); + SN_LOCK(sc); + snstop(sc); + SN_UNLOCK(sc); + callout_drain(&sc->watchdog); sn_deactivate(dev); if_free(ifp); SN_LOCK_DESTROY(sc); @@ -342,6 +345,7 @@ sninit_locked(void *xsc) */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->watchdog, hz, snwatchdog, sc); /* * Attempt to push out any waiting packets. @@ -463,7 +467,7 @@ startagain: CSR_WRITE_1(sc, INTR_MASK_REG_B, mask); sc->intr_mask = mask; - ifp->if_timer = 1; + sc->timer = 1; ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->pages_wanted = numPages; return; @@ -548,7 +552,7 @@ startagain: CSR_WRITE_2(sc, MMU_CMD_REG_W, MMUCR_ENQUEUE); ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_timer = 1; + sc->timer = 1; BPF_MTAP(ifp, top); @@ -657,7 +661,7 @@ snresume(struct ifnet *ifp) packet_no = CSR_READ_1(sc, ALLOC_RESULT_REG_B); if (packet_no & ARR_FAILED) { if_printf(ifp, "Memory allocation failed. Weird.\n"); - ifp->if_timer = 1; + sc->timer = 1; goto try_start; } /* @@ -755,24 +759,32 @@ try_start: * Now pass control to snstart() to queue any additional packets */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - snstart(ifp); + snstart_locked(ifp); /* * We've sent something, so we're active. Set a watchdog in case the * TX_EMPTY interrupt is lost. */ ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_timer = 1; + sc->timer = 1; return; } - void sn_intr(void *arg) { - int status, interrupts; struct sn_softc *sc = (struct sn_softc *) arg; + + SN_LOCK(sc); + snintr_locked(sc); + SN_UNLOCK(sc); +} + +static void +snintr_locked(struct sn_softc *sc) +{ + int status, interrupts; struct ifnet *ifp = sc->ifp; /* @@ -783,12 +795,10 @@ sn_intr(void *arg) uint16_t tx_status; uint16_t card_stats; - SN_LOCK(sc); - /* * Clear the watchdog. */ - ifp->if_timer = 0; + sc->timer = 0; SMC_SELECT_BANK(sc, 2); @@ -981,7 +991,6 @@ out: mask |= CSR_READ_1(sc, INTR_MASK_REG_B); CSR_WRITE_1(sc, INTR_MASK_REG_B, mask); sc->intr_mask = mask; - SN_UNLOCK(sc); } static void @@ -1136,7 +1145,6 @@ snioctl(struct ifnet *ifp, u_long cmd, c SN_LOCK(sc); if ((ifp->if_flags & IFF_UP) == 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; snstop(sc); } else { /* reinitialize card on any parameter change */ @@ -1161,9 +1169,16 @@ snioctl(struct ifnet *ifp, u_long cmd, c } static void -snwatchdog(struct ifnet *ifp) +snwatchdog(void *arg) { - sn_intr(ifp->if_softc); + struct sn_softc *sc; + + sc = arg; + SN_ASSERT_LOCKED(sc); + callout_reset(&sc->watchdog, hz, snwatchdog, sc); + if (sc->timer == 0 || --sc->timer > 0) + return; + snintr_locked(sc); } @@ -1193,7 +1208,9 @@ snstop(struct sn_softc *sc) /* * Cancel watchdog. */ - ifp->if_timer = 0; + sc->timer = 0; + callout_stop(&sc->watchdog); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); } Modified: stable/8/sys/dev/sn/if_snvar.h ============================================================================== --- stable/8/sys/dev/sn/if_snvar.h Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/sn/if_snvar.h Sun Oct 30 01:13:47 2011 (r226921) @@ -35,6 +35,8 @@ struct sn_softc { bus_space_tag_t bst; bus_space_handle_t bsh; struct mtx sc_mtx; + struct callout watchdog; + int timer; int pages_wanted; /* Size of outstanding MMU ALLOC */ int intr_mask; /* Most recently set interrupt mask */ device_t dev; Modified: stable/8/sys/dev/ti/if_ti.c ============================================================================== --- stable/8/sys/dev/ti/if_ti.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/ti/if_ti.c Sun Oct 30 01:13:47 2011 (r226921) @@ -194,7 +194,7 @@ static void ti_init(void *); static void ti_init_locked(void *); static void ti_init2(struct ti_softc *); static void ti_stop(struct ti_softc *); -static void ti_watchdog(struct ifnet *); +static void ti_watchdog(void *); static int ti_shutdown(device_t); static int ti_ifmedia_upd(struct ifnet *); static void ti_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -2286,6 +2286,7 @@ ti_attach(dev) mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&sc->ti_watchdog, &sc->ti_mtx, 0); ifmedia_init(&sc->ifmedia, IFM_IMASK, ti_ifmedia_upd, ti_ifmedia_sts); ifp = sc->ti_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -2488,7 +2489,6 @@ ti_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ti_ioctl; ifp->if_start = ti_start; - ifp->if_watchdog = ti_watchdog; ifp->if_init = ti_init; ifp->if_baudrate = 1000000000; ifp->if_snd.ifq_maxlen = TI_TX_RING_CNT - 1; @@ -2566,24 +2566,22 @@ ti_detach(dev) { struct ti_softc *sc; struct ifnet *ifp; - int attached; sc = device_get_softc(dev); if (sc->dev) destroy_dev(sc->dev); KASSERT(mtx_initialized(&sc->ti_mtx), ("ti mutex not initialized")); - attached = device_is_attached(dev); - TI_LOCK(sc); ifp = sc->ti_ifp; - if (attached) - ti_stop(sc); - TI_UNLOCK(sc); - if (attached) + if (device_is_attached(dev)) { ether_ifdetach(ifp); + TI_LOCK(sc); + ti_stop(sc); + TI_UNLOCK(sc); + } /* These should only be active if attach succeeded */ - if (attached) - bus_generic_detach(dev); + callout_drain(&sc->ti_watchdog); + bus_generic_detach(dev); ti_free_dmamaps(sc); ifmedia_removeall(&sc->ifmedia); @@ -2867,7 +2865,7 @@ ti_txeof(sc) } sc->ti_tx_saved_considx = idx; - ifp->if_timer = sc->ti_txcnt > 0 ? 5 : 0; + sc->ti_timer = sc->ti_txcnt > 0 ? 5 : 0; } static void @@ -3122,7 +3120,7 @@ ti_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->ti_timer = 5; } } @@ -3226,6 +3224,7 @@ static void ti_init2(sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->ti_watchdog, hz, ti_watchdog, sc); /* * Make sure to set media properly. We have to do this @@ -3787,30 +3786,31 @@ ti_ioctl2(struct cdev *dev, u_long cmd, } static void -ti_watchdog(ifp) - struct ifnet *ifp; +ti_watchdog(void *arg) { struct ti_softc *sc; + struct ifnet *ifp; - sc = ifp->if_softc; - TI_LOCK(sc); + sc = arg; + TI_LOCK_ASSERT(sc); + callout_reset(&sc->ti_watchdog, hz, ti_watchdog, sc); + if (sc->ti_timer == 0 || --sc->ti_timer > 0) + return; /* * When we're debugging, the chip is often stopped for long periods * of time, and that would normally cause the watchdog timer to fire. * Since that impedes debugging, we don't want to do that. */ - if (sc->ti_flags & TI_FLAG_DEBUGING) { - TI_UNLOCK(sc); + if (sc->ti_flags & TI_FLAG_DEBUGING) return; - } + ifp = sc->ti_ifp; if_printf(ifp, "watchdog timeout -- resetting\n"); ti_stop(sc); ti_init_locked(sc); ifp->if_oerrors++; - TI_UNLOCK(sc); } /* @@ -3860,6 +3860,7 @@ ti_stop(sc) sc->ti_tx_saved_considx = TI_TXCONS_UNSET; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + callout_stop(&sc->ti_watchdog); } /* Modified: stable/8/sys/dev/ti/if_tireg.h ============================================================================== --- stable/8/sys/dev/ti/if_tireg.h Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/ti/if_tireg.h Sun Oct 30 01:13:47 2011 (r226921) @@ -1038,6 +1038,8 @@ struct ti_softc { int ti_if_flags; int ti_txcnt; struct mtx ti_mtx; + struct callout ti_watchdog; + int ti_timer; ti_flag_vals ti_flags; struct cdev *dev; }; Modified: stable/8/sys/dev/vx/if_vx.c ============================================================================== --- stable/8/sys/dev/vx/if_vx.c Sun Oct 30 00:57:56 2011 (r226920) +++ stable/8/sys/dev/vx/if_vx.c Sun Oct 30 01:13:47 2011 (r226921) @@ -129,7 +129,7 @@ static void vx_init_locked(struct vx_sof static int vx_ioctl(struct ifnet *, u_long, caddr_t); static void vx_start(struct ifnet *); static void vx_start_locked(struct ifnet *); -static void vx_watchdog(struct ifnet *); +static void vx_watchdog(void *); static void vx_reset(struct vx_softc *); static void vx_read(struct vx_softc *); static struct mbuf *vx_get(struct vx_softc *, u_int); @@ -157,6 +157,7 @@ vx_attach(device_t dev) mtx_init(&sc->vx_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->vx_callout, &sc->vx_mtx, 0); + callout_init_mtx(&sc->vx_watchdog, &sc->vx_mtx, 0); GO_WINDOW(0); CSR_WRITE_2(sc, VX_COMMAND, GLOBAL_RESET); VX_BUSY_WAIT; @@ -193,7 +194,6 @@ vx_attach(device_t dev) ifp->if_start = vx_start; ifp->if_ioctl = vx_ioctl; ifp->if_init = vx_init; - ifp->if_watchdog = vx_watchdog; ifp->if_softc = sc; ether_ifattach(ifp, eaddr); @@ -269,6 +269,7 @@ vx_init_locked(struct vx_softc *sc) /* Interface is now `running', with no output active. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->vx_watchdog, hz, vx_watchdog, sc); /* Attempt to start output, if any. */ vx_start_locked(ifp); @@ -474,7 +475,7 @@ startagain: /* not enough room in FIFO - make sure */ if (CSR_READ_2(sc, VX_W1_FREE_TX) < len + pad + 4) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_timer = 1; + sc->vx_timer = 1; return; } } @@ -513,7 +514,7 @@ startagain: CSR_WRITE_1(sc, VX_W1_TX_PIO_WR_1, 0); /* Padding */ ++ifp->if_opackets; - ifp->if_timer = 1; + sc->vx_timer = 1; readcheck: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 01:13:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1E51106567C; Sun, 30 Oct 2011 01:13:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 646148FC1A; Sun, 30 Oct 2011 01:13:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U1Do8Q041282; Sun, 30 Oct 2011 01:13:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U1Do5p041267; Sun, 30 Oct 2011 01:13:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110300113.p9U1Do5p041267@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 01:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226922 - in stable/7/sys/dev: cm ep fatm malo sn ti vx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 01:13:50 -0000 Author: marius Date: Sun Oct 30 01:13:49 2011 New Revision: 226922 URL: http://svn.freebsd.org/changeset/base/226922 Log: MFC: r199559 - Add a private timer to drive the transmit watchdog instead of using if_watchdog and if_timer. - Fix some issues in detach for sn(4), ste(4), and ti(4). Primarily this means calling ether_ifdetach() before anything else. Modified: stable/7/sys/dev/cm/smc90cx6.c stable/7/sys/dev/cm/smc90cx6var.h stable/7/sys/dev/ep/if_ep.c stable/7/sys/dev/ep/if_epvar.h stable/7/sys/dev/fatm/if_fatm.c stable/7/sys/dev/fatm/if_fatmvar.h stable/7/sys/dev/malo/if_malo.c stable/7/sys/dev/malo/if_malo.h stable/7/sys/dev/sn/if_sn.c stable/7/sys/dev/sn/if_snvar.h stable/7/sys/dev/ti/if_ti.c stable/7/sys/dev/ti/if_tireg.h stable/7/sys/dev/vx/if_vx.c stable/7/sys/dev/vx/if_vxvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cm/smc90cx6.c ============================================================================== --- stable/7/sys/dev/cm/smc90cx6.c Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/cm/smc90cx6.c Sun Oct 30 01:13:49 2011 (r226922) @@ -124,7 +124,7 @@ static void cm_reset_locked(struct cm_so void cm_start(struct ifnet *); void cm_start_locked(struct ifnet *); int cm_ioctl(struct ifnet *, unsigned long, caddr_t); -void cm_watchdog(struct ifnet *); +void cm_watchdog(void *); void cm_srint_locked(void *vsc); static void cm_tint_locked(struct cm_softc *, int); void cm_reconwatch_locked(void *); @@ -194,11 +194,9 @@ cm_attach(dev) ifp->if_output = arc_output; ifp->if_start = cm_start; ifp->if_ioctl = cm_ioctl; - ifp->if_watchdog = cm_watchdog; ifp->if_init = cm_init; /* XXX IFQ_SET_READY(&ifp->if_snd); */ ifp->if_snd.ifq_maxlen = ifqmaxlen; - ifp->if_timer = 0; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; arc_ifattach(ifp, linkaddress); @@ -210,6 +208,7 @@ cm_attach(dev) #endif callout_init_mtx(&sc->sc_recon_ch, &sc->sc_mtx, 0); + callout_init_mtx(&sc->sc_watchdog_timer, &sc->sc_mtx, 0); if_printf(ifp, "link addr 0x%02x (%d)\n", linkaddress, linkaddress); return 0; @@ -315,6 +314,7 @@ cm_reset_locked(sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->sc_watchdog_timer, hz, cm_watchdog, sc); cm_start_locked(ifp); } @@ -332,7 +332,8 @@ cm_stop_locked(sc) GETREG(CMRESET); /* Stop watchdog timer */ - sc->sc_ifp->if_timer = 0; + callout_stop(&sc->sc_watchdog_timer); + sc->sc_timer = 0; } void @@ -464,7 +465,7 @@ cm_start_locked(ifp) PUTREG(CMCMD, CM_TX(buffer)); PUTREG(CMSTAT, sc->sc_intmask); - ifp->if_timer = ARCTIMEOUT; + sc->sc_timer = ARCTIMEOUT; } m_freem(m); @@ -627,7 +628,7 @@ cm_tint_locked(sc, isr) if (isr & CM_TMA || sc->sc_broadcast[buffer]) ifp->if_opackets++; #ifdef CMRETRANSMIT - else if (ifp->if_flags & IFF_LINK2 && ifp->if_timer > 0 + else if (ifp->if_flags & IFF_LINK2 && sc->sc_timer > 0 && --sc->sc_retransmits[buffer] > 0) { /* retransmit same buffer */ PUTREG(CMCMD, CM_TX(buffer)); @@ -657,7 +658,7 @@ cm_tint_locked(sc, isr) */ PUTREG(CMCMD, CM_TX(buffer)); /* init watchdog timer */ - ifp->if_timer = ARCTIMEOUT; + sc->sc_timer = ARCTIMEOUT; #if defined(CM_DEBUG) && (CM_DEBUG > 1) if_printf(ifp, @@ -669,7 +670,7 @@ cm_tint_locked(sc, isr) sc->sc_intmask &= ~CM_TA; PUTREG(CMSTAT, sc->sc_intmask); /* ... and watchdog timer */ - ifp->if_timer = 0; + sc->sc_timer = 0; #ifdef CM_DEBUG if_printf(ifp, "tint: no more buffers to send, status 0x%02x\n", @@ -920,12 +921,13 @@ cm_ioctl(ifp, command, data) * retransmission is implemented). */ void -cm_watchdog(ifp) - struct ifnet *ifp; +cm_watchdog(void *arg) { - struct cm_softc *sc = ifp->if_softc; + struct cm_softc *sc; - CM_LOCK(sc); + sc = arg; + callout_reset(&sc->sc_watchdog_timer, hz, cm_watchdog, sc); + if (sc->sc_timer == 0 || --sc->sc_timer > 0) + return; PUTREG(CMCMD, CM_TXDIS); - CM_UNLOCK(sc); } Modified: stable/7/sys/dev/cm/smc90cx6var.h ============================================================================== --- stable/7/sys/dev/cm/smc90cx6var.h Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/cm/smc90cx6var.h Sun Oct 30 01:13:49 2011 (r226922) @@ -77,6 +77,8 @@ struct cm_softc { u_long sc_reconcount_excessive; /* for the above */ #define ARC_EXCESSIVE_RECONS 20 #define ARC_EXCESSIVE_RECONS_REWARN 400 + struct callout sc_watchdog_timer; + int sc_timer; u_char sc_intmask; u_char sc_rx_act; /* 2..3 */ u_char sc_tx_act; /* 0..1 */ Modified: stable/7/sys/dev/ep/if_ep.c ============================================================================== --- stable/7/sys/dev/ep/if_ep.c Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/ep/if_ep.c Sun Oct 30 01:13:49 2011 (r226922) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -91,10 +92,12 @@ static int ep_media2if_media[] = static void epinit(void *); static int epioctl(struct ifnet *, u_long, caddr_t); static void epstart(struct ifnet *); -static void epwatchdog(struct ifnet *); +static void ep_intr_locked(struct ep_softc *); static void epstart_locked(struct ifnet *); static void epinit_locked(struct ep_softc *); +static void eptick(void *); +static void epwatchdog(struct ep_softc *); /* if_media functions */ static int ep_ifmedia_upd(struct ifnet *); @@ -302,12 +305,12 @@ ep_attach(struct ep_softc *sc) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = epstart; ifp->if_ioctl = epioctl; - ifp->if_watchdog = epwatchdog; ifp->if_init = epinit; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); + callout_init_mtx(&sc->watchdog_timer, &sc->sc_mtx, 0); if (!sc->epb.mii_trans) { ifmedia_init(&sc->ifmedia, 0, ep_ifmedia_upd, ep_ifmedia_sts); @@ -361,6 +364,7 @@ ep_detach(device_t dev) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; EP_UNLOCK(sc); ether_ifdetach(ifp); + callout_drain(&sc->watchdog_timer); ep_free(dev); if_free(ifp); @@ -455,6 +459,7 @@ epinit_locked(struct ep_softc *sc) GO_WINDOW(sc, 1); epstart_locked(ifp); + callout_reset(&sc->watchdog_timer, hz, eptick, sc); } static void @@ -550,7 +555,7 @@ startagain: BPF_MTAP(ifp, m0); - ifp->if_timer = 2; + sc->tx_timer = 2; ifp->if_opackets++; m_freem(m0); @@ -577,20 +582,26 @@ void ep_intr(void *arg) { struct ep_softc *sc; - int status; - struct ifnet *ifp; sc = (struct ep_softc *) arg; EP_LOCK(sc); + ep_intr_locked(sc); + EP_UNLOCK(sc); +} + +static void +ep_intr_locked(struct ep_softc *sc) +{ + int status; + struct ifnet *ifp; + /* XXX 4.x splbio'd here to reduce interruptability */ /* * quick fix: Try to detect an interrupt when the card goes away. */ - if (sc->gone || CSR_READ_2(sc, EP_STATUS) == 0xffff) { - EP_UNLOCK(sc); + if (sc->gone || CSR_READ_2(sc, EP_STATUS) == 0xffff) return; - } ifp = sc->ifp; CSR_WRITE_2(sc, EP_COMMAND, SET_INTR_MASK); /* disable all Ints */ @@ -606,14 +617,14 @@ rescan: epread(sc); if (status & S_TX_AVAIL) { /* we need ACK */ - ifp->if_timer = 0; + sc->tx_timer = 0; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; GO_WINDOW(sc, 1); CSR_READ_2(sc, EP_W1_FREE_TX); epstart_locked(ifp); } if (status & S_CARD_FAILURE) { - ifp->if_timer = 0; + sc->tx_timer = 0; #ifdef EP_LOCAL_STATS device_printf(sc->dev, "\n\tStatus: %x\n", status); GO_WINDOW(sc, 4); @@ -636,11 +647,10 @@ rescan: #endif epinit_locked(sc); - EP_UNLOCK(sc); return; } if (status & S_TX_COMPLETE) { - ifp->if_timer = 0; + sc->tx_timer = 0; /* * We need ACK. We do it at the end. * @@ -695,7 +705,6 @@ rescan: /* re-enable Ints */ CSR_WRITE_2(sc, EP_COMMAND, SET_INTR_MASK | S_5_INTS); - EP_UNLOCK(sc); } static void @@ -911,7 +920,6 @@ epioctl(struct ifnet *ifp, u_long cmd, c EP_LOCK(sc); if (((ifp->if_flags & IFF_UP) == 0) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; epstop(sc); } else /* reinitialize card on any parameter change */ @@ -944,15 +952,27 @@ epioctl(struct ifnet *ifp, u_long cmd, c } static void -epwatchdog(struct ifnet *ifp) +eptick(void *arg) { - struct ep_softc *sc = ifp->if_softc; + struct ep_softc *sc; + + sc = arg; + if (sc->tx_timer != 0 && --sc->tx_timer == 0) + epwatchdog(sc); + callout_reset(&sc->watchdog_timer, hz, eptick, sc); +} + +static void +epwatchdog(struct ep_softc *sc) +{ + struct ifnet *ifp; + ifp = sc->ifp; if (sc->gone) return; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - epstart(ifp); - ep_intr(ifp->if_softc); + epstart_locked(ifp); + ep_intr_locked(sc); } static void @@ -975,4 +995,7 @@ epstop(struct ep_softc *sc) CSR_WRITE_2(sc, EP_COMMAND, SET_RD_0_MASK); CSR_WRITE_2(sc, EP_COMMAND, SET_INTR_MASK); CSR_WRITE_2(sc, EP_COMMAND, SET_RX_FILTER); + + sc->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + callout_stop(&sc->watchdog_timer); } Modified: stable/7/sys/dev/ep/if_epvar.h ============================================================================== --- stable/7/sys/dev/ep/if_epvar.h Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/ep/if_epvar.h Sun Oct 30 01:13:49 2011 (r226922) @@ -45,6 +45,9 @@ struct ep_softc { bus_space_tag_t bst; void *ep_intrhand; + struct callout watchdog_timer; + int tx_timer; + u_short ep_connectors; /* Connectors on this card. */ u_char ep_connector; /* Configured connector. */ Modified: stable/7/sys/dev/fatm/if_fatm.c ============================================================================== --- stable/7/sys/dev/fatm/if_fatm.c Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/fatm/if_fatm.c Sun Oct 30 01:13:49 2011 (r226922) @@ -391,16 +391,14 @@ fatm_check_heartbeat(struct fatm_softc * * Ensure that the heart is still beating. */ static void -fatm_watchdog(struct ifnet *ifp) +fatm_watchdog(void *arg) { - struct fatm_softc *sc = ifp->if_softc; + struct fatm_softc *sc; - FATM_LOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - fatm_check_heartbeat(sc); - ifp->if_timer = 5; - } - FATM_UNLOCK(sc); + sc = arg; + FATM_CHECKLOCK(sc); + fatm_check_heartbeat(sc); + callout_reset(&sc->watchdog_timer, hz * 5, fatm_watchdog, sc); } /* @@ -474,7 +472,7 @@ fatm_stop(struct fatm_softc *sc) (void)fatm_reset(sc); /* stop watchdog */ - sc->ifp->if_timer = 0; + callout_stop(&sc->watchdog_timer); if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { sc->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -1341,7 +1339,7 @@ fatm_init_locked(struct fatm_softc *sc) /* * Start the watchdog timer */ - sc->ifp->if_timer = 5; + callout_reset(&sc->watchdog_timer, hz * 5, fatm_watchdog, sc); /* start SUNI */ utopia_start(&sc->utopia); @@ -2553,6 +2551,7 @@ fatm_detach(device_t dev) FATM_UNLOCK(sc); atm_ifdetach(sc->ifp); /* XXX race */ } + callout_drain(&sc->watchdog_timer); if (sc->ih != NULL) bus_teardown_intr(dev, sc->irqres, sc->ih); @@ -2794,6 +2793,7 @@ fatm_attach(device_t dev) cv_init(&sc->cv_regs, "fatm_regs"); sysctl_ctx_init(&sc->sysctl_ctx); + callout_init_mtx(&sc->watchdog_timer, &sc->mtx, 0); /* * Make the sysctl tree @@ -2834,7 +2834,6 @@ fatm_attach(device_t dev) ifp->if_flags = IFF_SIMPLEX; ifp->if_ioctl = fatm_ioctl; ifp->if_start = fatm_start; - ifp->if_watchdog = fatm_watchdog; ifp->if_init = fatm_init; ifp->if_linkmib = &IFP2IFATM(sc->ifp)->mib; ifp->if_linkmiblen = sizeof(IFP2IFATM(sc->ifp)->mib); Modified: stable/7/sys/dev/fatm/if_fatmvar.h ============================================================================== --- stable/7/sys/dev/fatm/if_fatmvar.h Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/fatm/if_fatmvar.h Sun Oct 30 01:13:49 2011 (r226922) @@ -188,6 +188,7 @@ struct fatm_softc { struct ifnet *ifp; /* common part */ struct mtx mtx; /* lock this structure */ struct ifmedia media; /* media */ + struct callout watchdog_timer; int init_state; /* initialisation step */ int memid; /* resource id for card memory */ Modified: stable/7/sys/dev/malo/if_malo.c ============================================================================== --- stable/7/sys/dev/malo/if_malo.c Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/malo/if_malo.c Sun Oct 30 01:13:49 2011 (r226922) @@ -128,7 +128,7 @@ static int malo_setup_hwdma(struct malo_ static void malo_txq_init(struct malo_softc *, struct malo_txq *, int); static void malo_tx_cleanupq(struct malo_softc *, struct malo_txq *); static void malo_start(struct ifnet *); -static void malo_watchdog(struct ifnet *); +static void malo_watchdog(void *); static int malo_ioctl(struct ifnet *, u_long, caddr_t); static void malo_updateslot(struct ifnet *); static int malo_newstate(struct ieee80211com *, enum ieee80211_state, int); @@ -191,6 +191,7 @@ malo_attach(uint16_t devid, struct malo_ } MALO_LOCK_INIT(sc); + callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0); /* set these up early for if_printf use */ if_initname(ifp, device_get_name(sc->malo_dev), @@ -240,7 +241,6 @@ malo_attach(uint16_t devid, struct malo_ ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = malo_start; - ifp->if_watchdog = malo_watchdog; ifp->if_ioctl = malo_ioctl; ifp->if_init = malo_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); @@ -993,7 +993,7 @@ malo_tx_proc(void *arg, int npending) if (nreaped != 0) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_timer = 0; + sc->malo_timer = 0; malo_start(ifp); } } @@ -1177,7 +1177,7 @@ malo_tx_start(struct malo_softc *sc, str MALO_TXDESC_SYNC(txq, ds, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ifp->if_opackets++; - ifp->if_timer = 5; + sc->malo_timer = 5; MALO_TXQ_UNLOCK(txq); return 0; #undef IEEE80211_DIR_DSTODS @@ -1364,10 +1364,17 @@ malo_start(struct ifnet *ifp) } static void -malo_watchdog(struct ifnet *ifp) +malo_watchdog(void *arg) { - struct malo_softc *sc = ifp->if_softc; + struct malo_softc *sc; + struct ifnet *ifp; + + sc = arg; + callout_reset(&sc->malo_watchdog_timer, hz, malo_watchdog, sc); + if (sc->malo_timer == 0 || --sc->malo_timer > 0) + return; + ifp = sc->malo_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && !sc->malo_invalid) { if_printf(ifp, "watchdog timeout\n"); @@ -1614,6 +1621,7 @@ malo_init(void *arg) IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); malo_hal_intrset(mh, sc->malo_imask); + callout_reset(&sc->malo_watchdog_timer, hz, malo_watchdog, sc); /* * The hardware should be ready to go now so it's safe to kick @@ -1793,7 +1801,8 @@ malo_stop_locked(struct ifnet *ifp, int */ ieee80211_new_state(ic, IEEE80211_S_INIT, -1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - ifp->if_timer = 0; + callout_stop(&sc->malo_watchdog_timer); + sc->malo_timer = 0; if (sc->malo_fw_loaded == 1) { /* diable interrupt. */ malo_hal_intrset(mh, 0); @@ -2428,6 +2437,7 @@ malo_detach(struct malo_softc *sc) * Other than that, it's straightforward... */ ieee80211_ifdetach(&sc->malo_ic); + callout_drain(&sc->malo_watchdog_timer); malo_dma_cleanup(sc); malo_tx_cleanup(sc); malo_hal_detach(sc->malo_mh); Modified: stable/7/sys/dev/malo/if_malo.h ============================================================================== --- stable/7/sys/dev/malo/if_malo.h Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/malo/if_malo.h Sun Oct 30 01:13:49 2011 (r226922) @@ -545,6 +545,8 @@ struct malo_softc { struct malo_txq malo_txq[MALO_NUM_TX_QUEUES]; struct task malo_txtask; /* tx int processing */ + struct callout malo_watchdog_timer; + int malo_timer; int (*malo_newstate)(struct ieee80211com *, enum ieee80211_state, int); Modified: stable/7/sys/dev/sn/if_sn.c ============================================================================== --- stable/7/sys/dev/sn/if_sn.c Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/sn/if_sn.c Sun Oct 30 01:13:49 2011 (r226922) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -121,6 +122,7 @@ static int snioctl(struct ifnet * ifp, u static void snresume(struct ifnet *); +static void snintr_locked(struct sn_softc *); static void sninit_locked(void *); static void snstart_locked(struct ifnet *); @@ -128,7 +130,7 @@ static void sninit(void *); static void snread(struct ifnet *); static void snstart(struct ifnet *); static void snstop(struct sn_softc *); -static void snwatchdog(struct ifnet *); +static void snwatchdog(void *); static void sn_setmcast(struct sn_softc *); static int sn_getmcf(struct ifnet *ifp, u_char *mcf); @@ -170,6 +172,7 @@ sn_attach(device_t dev) } SN_LOCK_INIT(sc); + callout_init_mtx(&sc->watchdog, &sc->sc_mtx, 0); snstop(sc); sc->pages_wanted = -1; @@ -202,13 +205,11 @@ sn_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = snstart; ifp->if_ioctl = snioctl; - ifp->if_watchdog = snwatchdog; ifp->if_init = sninit; ifp->if_baudrate = 10000000; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); - ifp->if_timer = 0; ether_ifattach(ifp, eaddr); @@ -233,9 +234,11 @@ sn_detach(device_t dev) struct sn_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->ifp; - snstop(sc); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); + SN_LOCK(sc); + snstop(sc); + SN_UNLOCK(sc); + callout_drain(&sc->watchdog); sn_deactivate(dev); if_free(ifp); SN_LOCK_DESTROY(sc); @@ -342,6 +345,7 @@ sninit_locked(void *xsc) */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->watchdog, hz, snwatchdog, sc); /* * Attempt to push out any waiting packets. @@ -463,7 +467,7 @@ startagain: CSR_WRITE_1(sc, INTR_MASK_REG_B, mask); sc->intr_mask = mask; - ifp->if_timer = 1; + sc->timer = 1; ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->pages_wanted = numPages; return; @@ -548,7 +552,7 @@ startagain: CSR_WRITE_2(sc, MMU_CMD_REG_W, MMUCR_ENQUEUE); ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_timer = 1; + sc->timer = 1; BPF_MTAP(ifp, top); @@ -657,7 +661,7 @@ snresume(struct ifnet *ifp) packet_no = CSR_READ_1(sc, ALLOC_RESULT_REG_B); if (packet_no & ARR_FAILED) { if_printf(ifp, "Memory allocation failed. Weird.\n"); - ifp->if_timer = 1; + sc->timer = 1; goto try_start; } /* @@ -755,24 +759,32 @@ try_start: * Now pass control to snstart() to queue any additional packets */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - snstart(ifp); + snstart_locked(ifp); /* * We've sent something, so we're active. Set a watchdog in case the * TX_EMPTY interrupt is lost. */ ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_timer = 1; + sc->timer = 1; return; } - void sn_intr(void *arg) { - int status, interrupts; struct sn_softc *sc = (struct sn_softc *) arg; + + SN_LOCK(sc); + snintr_locked(sc); + SN_UNLOCK(sc); +} + +static void +snintr_locked(struct sn_softc *sc) +{ + int status, interrupts; struct ifnet *ifp = sc->ifp; /* @@ -783,12 +795,10 @@ sn_intr(void *arg) uint16_t tx_status; uint16_t card_stats; - SN_LOCK(sc); - /* * Clear the watchdog. */ - ifp->if_timer = 0; + sc->timer = 0; SMC_SELECT_BANK(sc, 2); @@ -981,7 +991,6 @@ out: mask |= CSR_READ_1(sc, INTR_MASK_REG_B); CSR_WRITE_1(sc, INTR_MASK_REG_B, mask); sc->intr_mask = mask; - SN_UNLOCK(sc); } static void @@ -1136,7 +1145,6 @@ snioctl(struct ifnet *ifp, u_long cmd, c SN_LOCK(sc); if ((ifp->if_flags & IFF_UP) == 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; snstop(sc); } else { /* reinitialize card on any parameter change */ @@ -1161,9 +1169,16 @@ snioctl(struct ifnet *ifp, u_long cmd, c } static void -snwatchdog(struct ifnet *ifp) +snwatchdog(void *arg) { - sn_intr(ifp->if_softc); + struct sn_softc *sc; + + sc = arg; + SN_ASSERT_LOCKED(sc); + callout_reset(&sc->watchdog, hz, snwatchdog, sc); + if (sc->timer == 0 || --sc->timer > 0) + return; + snintr_locked(sc); } @@ -1193,7 +1208,9 @@ snstop(struct sn_softc *sc) /* * Cancel watchdog. */ - ifp->if_timer = 0; + sc->timer = 0; + callout_stop(&sc->watchdog); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); } Modified: stable/7/sys/dev/sn/if_snvar.h ============================================================================== --- stable/7/sys/dev/sn/if_snvar.h Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/sn/if_snvar.h Sun Oct 30 01:13:49 2011 (r226922) @@ -35,6 +35,8 @@ struct sn_softc { bus_space_tag_t bst; bus_space_handle_t bsh; struct mtx sc_mtx; + struct callout watchdog; + int timer; int pages_wanted; /* Size of outstanding MMU ALLOC */ int intr_mask; /* Most recently set interrupt mask */ device_t dev; Modified: stable/7/sys/dev/ti/if_ti.c ============================================================================== --- stable/7/sys/dev/ti/if_ti.c Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/ti/if_ti.c Sun Oct 30 01:13:49 2011 (r226922) @@ -194,7 +194,7 @@ static void ti_init(void *); static void ti_init_locked(void *); static void ti_init2(struct ti_softc *); static void ti_stop(struct ti_softc *); -static void ti_watchdog(struct ifnet *); +static void ti_watchdog(void *); static int ti_shutdown(device_t); static int ti_ifmedia_upd(struct ifnet *); static void ti_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -2295,6 +2295,7 @@ ti_attach(dev) mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&sc->ti_watchdog, &sc->ti_mtx, 0); ifmedia_init(&sc->ifmedia, IFM_IMASK, ti_ifmedia_upd, ti_ifmedia_sts); ifp = sc->ti_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -2496,7 +2497,6 @@ ti_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ti_ioctl; ifp->if_start = ti_start; - ifp->if_watchdog = ti_watchdog; ifp->if_init = ti_init; ifp->if_baudrate = 1000000000; ifp->if_mtu = ETHERMTU; @@ -2575,24 +2575,22 @@ ti_detach(dev) { struct ti_softc *sc; struct ifnet *ifp; - int attached; sc = device_get_softc(dev); if (sc->dev) destroy_dev(sc->dev); KASSERT(mtx_initialized(&sc->ti_mtx), ("ti mutex not initialized")); - attached = device_is_attached(dev); - TI_LOCK(sc); ifp = sc->ti_ifp; - if (attached) - ti_stop(sc); - TI_UNLOCK(sc); - if (attached) + if (device_is_attached(dev)) { ether_ifdetach(ifp); + TI_LOCK(sc); + ti_stop(sc); + TI_UNLOCK(sc); + } /* These should only be active if attach succeeded */ - if (attached) - bus_generic_detach(dev); + callout_drain(&sc->ti_watchdog); + bus_generic_detach(dev); ti_free_dmamaps(sc); ifmedia_removeall(&sc->ifmedia); @@ -2876,7 +2874,7 @@ ti_txeof(sc) } sc->ti_tx_saved_considx = idx; - ifp->if_timer = sc->ti_txcnt > 0 ? 5 : 0; + sc->ti_timer = sc->ti_txcnt > 0 ? 5 : 0; } static void @@ -3131,7 +3129,7 @@ ti_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->ti_timer = 5; } } @@ -3235,6 +3233,7 @@ static void ti_init2(sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->ti_watchdog, hz, ti_watchdog, sc); /* * Make sure to set media properly. We have to do this @@ -3796,30 +3795,31 @@ ti_ioctl2(struct cdev *dev, u_long cmd, } static void -ti_watchdog(ifp) - struct ifnet *ifp; +ti_watchdog(void *arg) { struct ti_softc *sc; + struct ifnet *ifp; - sc = ifp->if_softc; - TI_LOCK(sc); + sc = arg; + TI_LOCK_ASSERT(sc); + callout_reset(&sc->ti_watchdog, hz, ti_watchdog, sc); + if (sc->ti_timer == 0 || --sc->ti_timer > 0) + return; /* * When we're debugging, the chip is often stopped for long periods * of time, and that would normally cause the watchdog timer to fire. * Since that impedes debugging, we don't want to do that. */ - if (sc->ti_flags & TI_FLAG_DEBUGING) { - TI_UNLOCK(sc); + if (sc->ti_flags & TI_FLAG_DEBUGING) return; - } + ifp = sc->ti_ifp; if_printf(ifp, "watchdog timeout -- resetting\n"); ti_stop(sc); ti_init_locked(sc); ifp->if_oerrors++; - TI_UNLOCK(sc); } /* @@ -3869,6 +3869,7 @@ ti_stop(sc) sc->ti_tx_saved_considx = TI_TXCONS_UNSET; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + callout_stop(&sc->ti_watchdog); } /* Modified: stable/7/sys/dev/ti/if_tireg.h ============================================================================== --- stable/7/sys/dev/ti/if_tireg.h Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/ti/if_tireg.h Sun Oct 30 01:13:49 2011 (r226922) @@ -1038,6 +1038,8 @@ struct ti_softc { int ti_if_flags; int ti_txcnt; struct mtx ti_mtx; + struct callout ti_watchdog; + int ti_timer; ti_flag_vals ti_flags; struct cdev *dev; }; Modified: stable/7/sys/dev/vx/if_vx.c ============================================================================== --- stable/7/sys/dev/vx/if_vx.c Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/vx/if_vx.c Sun Oct 30 01:13:49 2011 (r226922) @@ -129,7 +129,7 @@ static void vx_init_locked(struct vx_sof static int vx_ioctl(struct ifnet *, u_long, caddr_t); static void vx_start(struct ifnet *); static void vx_start_locked(struct ifnet *); -static void vx_watchdog(struct ifnet *); +static void vx_watchdog(void *); static void vx_reset(struct vx_softc *); static void vx_read(struct vx_softc *); static struct mbuf *vx_get(struct vx_softc *, u_int); @@ -157,6 +157,7 @@ vx_attach(device_t dev) mtx_init(&sc->vx_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->vx_callout, &sc->vx_mtx, 0); + callout_init_mtx(&sc->vx_watchdog, &sc->vx_mtx, 0); GO_WINDOW(0); CSR_WRITE_2(sc, VX_COMMAND, GLOBAL_RESET); VX_BUSY_WAIT; @@ -193,7 +194,6 @@ vx_attach(device_t dev) ifp->if_start = vx_start; ifp->if_ioctl = vx_ioctl; ifp->if_init = vx_init; - ifp->if_watchdog = vx_watchdog; ifp->if_softc = sc; ether_ifattach(ifp, eaddr); @@ -269,6 +269,7 @@ vx_init_locked(struct vx_softc *sc) /* Interface is now `running', with no output active. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->vx_watchdog, hz, vx_watchdog, sc); /* Attempt to start output, if any. */ vx_start_locked(ifp); @@ -474,7 +475,7 @@ startagain: /* not enough room in FIFO - make sure */ if (CSR_READ_2(sc, VX_W1_FREE_TX) < len + pad + 4) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_timer = 1; + sc->vx_timer = 1; return; } } @@ -513,7 +514,7 @@ startagain: CSR_WRITE_1(sc, VX_W1_TX_PIO_WR_1, 0); /* Padding */ ++ifp->if_opackets; - ifp->if_timer = 1; + sc->vx_timer = 1; readcheck: if ((CSR_READ_2(sc, VX_W1_RX_STATUS) & ERR_INCOMPLETE) == 0) { @@ -661,18 +662,18 @@ vx_intr(void *voidsc) if (status & S_RX_COMPLETE) vx_read(sc); if (status & S_TX_AVAIL) { - ifp->if_timer = 0; + sc->vx_timer = 0; sc->vx_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; vx_start_locked(sc->vx_ifp); } if (status & S_CARD_FAILURE) { if_printf(ifp, "adapter failure (%x)\n", status); - ifp->if_timer = 0; + sc->vx_timer = 0; vx_reset(sc); break; } if (status & S_TX_COMPLETE) { - ifp->if_timer = 0; + sc->vx_timer = 0; vx_txstat(sc); vx_start_locked(ifp); } @@ -970,26 +971,32 @@ vx_reset(struct vx_softc *sc) } static void -vx_watchdog(struct ifnet *ifp) +vx_watchdog(void *arg) { - struct vx_softc *sc = ifp->if_softc; + struct vx_softc *sc; + struct ifnet *ifp; - VX_LOCK(sc); + sc = arg; + VX_LOCK_ASSERT(sc); + callout_reset(&sc->vx_watchdog, hz, vx_watchdog, sc); + if (sc->vx_timer == 0 || --sc->vx_timer > 0) + return; + + ifp = sc->vx_ifp; if (ifp->if_flags & IFF_DEBUG) if_printf(ifp, "device timeout\n"); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; vx_start_locked(ifp); vx_intr(sc); - VX_UNLOCK(sc); } void vx_stop(struct vx_softc *sc) { - struct ifnet *ifp = sc->vx_ifp; VX_LOCK_ASSERT(sc); - ifp->if_timer = 0; + sc->vx_timer = 0; + callout_stop(&sc->vx_watchdog); CSR_WRITE_2(sc, VX_COMMAND, RX_DISABLE); CSR_WRITE_2(sc, VX_COMMAND, RX_DISCARD_TOP_PACK); Modified: stable/7/sys/dev/vx/if_vxvar.h ============================================================================== --- stable/7/sys/dev/vx/if_vxvar.h Sun Oct 30 01:13:47 2011 (r226921) +++ stable/7/sys/dev/vx/if_vxvar.h Sun Oct 30 01:13:49 2011 (r226922) @@ -51,8 +51,10 @@ struct vx_softc { int vx_tx_succ_ok; /* # packets sent in sequence */ /* w/o underrun */ struct callout vx_callout; /* Callout for timeouts */ + struct callout vx_watchdog; struct mtx vx_mtx; int vx_buffill_pending; + int vx_timer; }; #define CSR_WRITE_4(sc, reg, val) \ From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 01:24:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E959D1065670; Sun, 30 Oct 2011 01:24:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D72AE8FC08; Sun, 30 Oct 2011 01:24:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U1OrcM041690; Sun, 30 Oct 2011 01:24:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U1OrQW041679; Sun, 30 Oct 2011 01:24:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110300124.p9U1OrQW041679@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 01:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226923 - in stable/8/sys/dev: lge nve pcn tl wb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 01:24:54 -0000 Author: marius Date: Sun Oct 30 01:24:53 2011 New Revision: 226923 URL: http://svn.freebsd.org/changeset/base/226923 Log: MFC: r199560 - Hook into the existing stat timer to drive the transmit watchdog instead of using if_watchdog and if_timer. - Reorder detach to call ether_ifdetach() before anything else in tl(4) and wb(4). Modified: stable/8/sys/dev/lge/if_lge.c stable/8/sys/dev/lge/if_lgereg.h stable/8/sys/dev/nve/if_nve.c stable/8/sys/dev/nve/if_nvereg.h stable/8/sys/dev/pcn/if_pcn.c stable/8/sys/dev/pcn/if_pcnreg.h stable/8/sys/dev/tl/if_tl.c stable/8/sys/dev/tl/if_tlreg.h stable/8/sys/dev/wb/if_wb.c stable/8/sys/dev/wb/if_wbreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/lge/if_lge.c ============================================================================== --- stable/8/sys/dev/lge/if_lge.c Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/lge/if_lge.c Sun Oct 30 01:24:53 2011 (r226923) @@ -137,7 +137,7 @@ static int lge_ioctl(struct ifnet *, u_l static void lge_init(void *); static void lge_init_locked(struct lge_softc *); static void lge_stop(struct lge_softc *); -static void lge_watchdog(struct ifnet *); +static void lge_watchdog(struct lge_softc *); static int lge_shutdown(device_t); static int lge_ifmedia_upd(struct ifnet *); static void lge_ifmedia_upd_locked(struct ifnet *); @@ -544,7 +544,6 @@ lge_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = lge_ioctl; ifp->if_start = lge_start; - ifp->if_watchdog = lge_watchdog; ifp->if_init = lge_init; ifp->if_snd.ifq_maxlen = LGE_TX_LIST_CNT - 1; ifp->if_capabilities = IFCAP_RXCSUM; @@ -1000,7 +999,7 @@ lge_txeof(sc) ifp = sc->lge_ifp; /* Clear the timeout timer. */ - ifp->if_timer = 0; + sc->lge_timer = 0; /* * Go through our tx list and free mbufs for those @@ -1021,7 +1020,7 @@ lge_txeof(sc) txdone--; LGE_INC(idx, LGE_TX_LIST_CNT); - ifp->if_timer = 0; + sc->lge_timer = 0; } sc->lge_cdata.lge_tx_cons = idx; @@ -1064,6 +1063,8 @@ lge_tick(xsc) } } + if (sc->lge_timer != 0 && --sc->lge_timer == 0) + lge_watchdog(sc); callout_reset(&sc->lge_stat_callout, hz, lge_tick, sc); return; @@ -1236,7 +1237,7 @@ lge_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->lge_timer = 5; return; } @@ -1503,14 +1504,14 @@ lge_ioctl(ifp, command, data) } static void -lge_watchdog(ifp) - struct ifnet *ifp; -{ +lge_watchdog(sc) struct lge_softc *sc; +{ + struct ifnet *ifp; - sc = ifp->if_softc; + LGE_LOCK_ASSERT(sc); + ifp = sc->lge_ifp; - LGE_LOCK(sc); ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); @@ -1521,9 +1522,6 @@ lge_watchdog(ifp) if (ifp->if_snd.ifq_head != NULL) lge_start_locked(ifp); - LGE_UNLOCK(sc); - - return; } /* @@ -1539,7 +1537,7 @@ lge_stop(sc) LGE_LOCK_ASSERT(sc); ifp = sc->lge_ifp; - ifp->if_timer = 0; + sc->lge_timer = 0; callout_stop(&sc->lge_stat_callout); CSR_WRITE_4(sc, LGE_IMR, LGE_IMR_INTR_ENB); Modified: stable/8/sys/dev/lge/if_lgereg.h ============================================================================== --- stable/8/sys/dev/lge/if_lgereg.h Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/lge/if_lgereg.h Sun Oct 30 01:24:53 2011 (r226923) @@ -534,6 +534,7 @@ struct lge_softc { u_int8_t lge_link; u_int8_t lge_pcs; int lge_if_flags; + int lge_timer; struct lge_list_data *lge_ldata; struct lge_ring_data lge_cdata; struct callout lge_stat_callout; Modified: stable/8/sys/dev/nve/if_nve.c ============================================================================== --- stable/8/sys/dev/nve/if_nve.c Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/nve/if_nve.c Sun Oct 30 01:24:53 2011 (r226923) @@ -140,7 +140,7 @@ static int nve_ioctl(struct ifnet * static void nve_intr(void *); static void nve_tick(void *); static void nve_setmulti(struct nve_softc *); -static void nve_watchdog(struct ifnet *); +static void nve_watchdog(struct nve_softc *); static void nve_update_stats(struct nve_softc *); static int nve_ifmedia_upd(struct ifnet *); @@ -532,8 +532,6 @@ nve_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = nve_ioctl; ifp->if_start = nve_ifstart; - ifp->if_watchdog = nve_watchdog; - ifp->if_timer = 0; ifp->if_init = nve_init; ifp->if_mtu = ETHERMTU; ifp->if_baudrate = IF_Mbps(100); @@ -710,7 +708,7 @@ nve_stop(struct nve_softc *sc) DEBUGOUT(NVE_DEBUG_RUNNING, "nve: nve_stop - entry\n"); ifp = sc->ifp; - ifp->if_timer = 0; + sc->tx_timer = 0; /* Cancel tick timer */ callout_stop(&sc->stat_callout); @@ -984,7 +982,7 @@ nve_ifstart_locked(struct ifnet *ifp) return; } /* Set watchdog timer. */ - ifp->if_timer = 8; + sc->tx_timer = 8; /* Copy packet to BPF tap */ BPF_MTAP(ifp, m0); @@ -1096,7 +1094,7 @@ nve_intr(void *arg) /* If no pending packets we don't need a timeout */ if (sc->pending_txs == 0) - sc->ifp->if_timer = 0; + sc->tx_timer = 0; NVE_UNLOCK(sc); DEBUGOUT(NVE_DEBUG_INTERRUPT, "nve: nve_intr - exit\n"); @@ -1233,6 +1231,9 @@ nve_tick(void *xsc) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) nve_ifstart_locked(ifp); } + + if (sc->tx_timer > 0 && --sc->tx_timer == 0) + nve_watchdog(sc); callout_reset(&sc->stat_callout, hz, nve_tick, sc); return; @@ -1304,12 +1305,13 @@ nve_miibus_writereg(device_t dev, int ph /* Watchdog timer to prevent PHY lockups */ static void -nve_watchdog(struct ifnet *ifp) +nve_watchdog(struct nve_softc *sc) { - struct nve_softc *sc = ifp->if_softc; + struct ifnet *ifp; int pending_txs_start; - NVE_LOCK(sc); + NVE_LOCK_ASSERT(sc); + ifp = sc->ifp; /* * The nvidia driver blob defers tx completion notifications. @@ -1325,24 +1327,18 @@ nve_watchdog(struct ifnet *ifp) sc->hwapi->pfnDisableInterrupts(sc->hwapi->pADCX); sc->hwapi->pfnHandleInterrupt(sc->hwapi->pADCX); sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX); - if (sc->pending_txs < pending_txs_start) { - NVE_UNLOCK(sc); + if (sc->pending_txs < pending_txs_start) return; - } device_printf(sc->dev, "device timeout (%d)\n", sc->pending_txs); sc->tx_errors++; nve_stop(sc); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nve_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) nve_ifstart_locked(ifp); - NVE_UNLOCK(sc); - - return; } /* --- Start of NVOSAPI interface --- */ Modified: stable/8/sys/dev/nve/if_nvereg.h ============================================================================== --- stable/8/sys/dev/nve/if_nvereg.h Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/nve/if_nvereg.h Sun Oct 30 01:24:53 2011 (r226923) @@ -138,6 +138,7 @@ struct nve_softc { device_t miibus; device_t dev; struct callout stat_callout; + int tx_timer; void *sc_ih; bus_space_tag_t sc_st; Modified: stable/8/sys/dev/pcn/if_pcn.c ============================================================================== --- stable/8/sys/dev/pcn/if_pcn.c Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/pcn/if_pcn.c Sun Oct 30 01:24:53 2011 (r226923) @@ -143,7 +143,7 @@ static int pcn_ioctl(struct ifnet *, u_l static void pcn_init(void *); static void pcn_init_locked(struct pcn_softc *); static void pcn_stop(struct pcn_softc *); -static void pcn_watchdog(struct ifnet *); +static void pcn_watchdog(struct pcn_softc *); static int pcn_shutdown(device_t); static int pcn_ifmedia_upd(struct ifnet *); static void pcn_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -630,7 +630,6 @@ pcn_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = pcn_ioctl; ifp->if_start = pcn_start; - ifp->if_watchdog = pcn_watchdog; ifp->if_init = pcn_init; ifp->if_snd.ifq_maxlen = PCN_TX_LIST_CNT - 1; @@ -951,7 +950,7 @@ pcn_txeof(sc) sc->pcn_cdata.pcn_tx_cons = idx; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - ifp->if_timer = (sc->pcn_cdata.pcn_tx_cnt == 0) ? 0 : 5; + sc->pcn_timer = (sc->pcn_cdata.pcn_tx_cnt == 0) ? 0 : 5; return; } @@ -983,6 +982,8 @@ pcn_tick(xsc) pcn_start_locked(ifp); } + if (sc->pcn_timer > 0 && --sc->pcn_timer == 0) + pcn_watchdog(sc); callout_reset(&sc->pcn_stat_callout, hz, pcn_tick, sc); return; @@ -1150,7 +1151,7 @@ pcn_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->pcn_timer = 5; return; } @@ -1432,14 +1433,12 @@ pcn_ioctl(ifp, command, data) } static void -pcn_watchdog(ifp) - struct ifnet *ifp; +pcn_watchdog(struct pcn_softc *sc) { - struct pcn_softc *sc; - - sc = ifp->if_softc; + struct ifnet *ifp; - PCN_LOCK(sc); + PCN_LOCK_ASSERT(sc); + ifp = sc->pcn_ifp; ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); @@ -1450,10 +1449,6 @@ pcn_watchdog(ifp) if (ifp->if_snd.ifq_head != NULL) pcn_start_locked(ifp); - - PCN_UNLOCK(sc); - - return; } /* @@ -1468,7 +1463,7 @@ pcn_stop(struct pcn_softc *sc) PCN_LOCK_ASSERT(sc); ifp = sc->pcn_ifp; - ifp->if_timer = 0; + sc->pcn_timer = 0; callout_stop(&sc->pcn_stat_callout); Modified: stable/8/sys/dev/pcn/if_pcnreg.h ============================================================================== --- stable/8/sys/dev/pcn/if_pcnreg.h Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/pcn/if_pcnreg.h Sun Oct 30 01:24:53 2011 (r226923) @@ -465,6 +465,7 @@ struct pcn_softc { struct pcn_ring_data pcn_cdata; struct callout pcn_stat_callout; struct mtx pcn_mtx; + int pcn_timer; }; #define PCN_LOCK(_sc) mtx_lock(&(_sc)->pcn_mtx) Modified: stable/8/sys/dev/tl/if_tl.c ============================================================================== --- stable/8/sys/dev/tl/if_tl.c Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/tl/if_tl.c Sun Oct 30 01:24:53 2011 (r226923) @@ -281,7 +281,7 @@ static int tl_ioctl(struct ifnet *, u_lo static void tl_init(void *); static void tl_init_locked(struct tl_softc *); static void tl_stop(struct tl_softc *); -static void tl_watchdog(struct ifnet *); +static void tl_watchdog(struct tl_softc *); static int tl_shutdown(device_t); static int tl_ifmedia_upd(struct ifnet *); static void tl_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -1261,7 +1261,6 @@ tl_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = tl_ioctl; ifp->if_start = tl_start; - ifp->if_watchdog = tl_watchdog; ifp->if_init = tl_init; ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = TL_TX_LIST_CNT - 1; @@ -1354,11 +1353,11 @@ tl_detach(dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { + ether_ifdetach(ifp); TL_LOCK(sc); tl_stop(sc); TL_UNLOCK(sc); callout_drain(&sc->tl_stat_callout); - ether_ifdetach(ifp); } if (sc->tl_miibus) device_delete_child(dev, sc->tl_miibus); @@ -1652,7 +1651,7 @@ tl_intvec_txeoc(xsc, type) ifp = sc->tl_ifp; /* Clear the timeout timer. */ - ifp->if_timer = 0; + sc->tl_timer = 0; if (sc->tl_cdata.tl_tx_head == NULL) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1838,6 +1837,9 @@ tl_stats_update(xsc) } } + if (sc->tl_timer > 0 && --sc->tl_timer == 0) + tl_watchdog(sc); + callout_reset(&sc->tl_stat_callout, hz, tl_stats_update, sc); if (!sc->tl_bitrate) { @@ -2046,7 +2048,7 @@ tl_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->tl_timer = 5; return; } @@ -2271,21 +2273,20 @@ tl_ioctl(ifp, command, data) } static void -tl_watchdog(ifp) - struct ifnet *ifp; -{ +tl_watchdog(sc) struct tl_softc *sc; +{ + struct ifnet *ifp; - sc = ifp->if_softc; + TL_LOCK_ASSERT(sc); + ifp = sc->tl_ifp; if_printf(ifp, "device timeout\n"); - TL_LOCK(sc); ifp->if_oerrors++; tl_softreset(sc, 1); tl_init_locked(sc); - TL_UNLOCK(sc); return; } Modified: stable/8/sys/dev/tl/if_tlreg.h ============================================================================== --- stable/8/sys/dev/tl/if_tlreg.h Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/tl/if_tlreg.h Sun Oct 30 01:24:53 2011 (r226923) @@ -126,6 +126,7 @@ struct tl_softc { int tl_if_flags; struct callout tl_stat_callout; struct mtx tl_mtx; + int tl_timer; }; #define TL_LOCK(_sc) mtx_lock(&(_sc)->tl_mtx) Modified: stable/8/sys/dev/wb/if_wb.c ============================================================================== --- stable/8/sys/dev/wb/if_wb.c Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/wb/if_wb.c Sun Oct 30 01:24:53 2011 (r226923) @@ -158,7 +158,7 @@ static int wb_ioctl(struct ifnet *, u_lo static void wb_init(void *); static void wb_init_locked(struct wb_softc *); static void wb_stop(struct wb_softc *); -static void wb_watchdog(struct ifnet *); +static void wb_watchdog(struct wb_softc *); static int wb_shutdown(device_t); static int wb_ifmedia_upd(struct ifnet *); static void wb_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -840,7 +840,6 @@ wb_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = wb_ioctl; ifp->if_start = wb_start; - ifp->if_watchdog = wb_watchdog; ifp->if_init = wb_init; ifp->if_snd.ifq_maxlen = WB_TX_LIST_CNT - 1; @@ -899,11 +898,11 @@ wb_detach(dev) * This should only be done if attach succeeded. */ if (device_is_attached(dev)) { + ether_ifdetach(ifp); WB_LOCK(sc); wb_stop(sc); WB_UNLOCK(sc); callout_drain(&sc->wb_stat_callout); - ether_ifdetach(ifp); } if (sc->wb_miibus) device_delete_child(dev, sc->wb_miibus); @@ -1149,7 +1148,7 @@ wb_txeof(sc) ifp = sc->wb_ifp; /* Clear the timeout timer. */ - ifp->if_timer = 0; + sc->wb_timer = 0; if (sc->wb_cdata.wb_tx_head == NULL) return; @@ -1204,7 +1203,7 @@ wb_txeoc(sc) ifp = sc->wb_ifp; - ifp->if_timer = 0; + sc->wb_timer = 0; if (sc->wb_cdata.wb_tx_head == NULL) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1212,7 +1211,7 @@ wb_txeoc(sc) } else { if (WB_TXOWN(sc->wb_cdata.wb_tx_head) == WB_UNSENT) { WB_TXOWN(sc->wb_cdata.wb_tx_head) = WB_TXSTAT_OWN; - ifp->if_timer = 5; + sc->wb_timer = 5; CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF); } } @@ -1321,6 +1320,8 @@ wb_tick(xsc) mii_tick(mii); + if (sc->wb_timer > 0 && --sc->wb_timer == 0) + wb_watchdog(sc); callout_reset(&sc->wb_stat_callout, hz, wb_tick, sc); return; @@ -1521,7 +1522,7 @@ wb_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->wb_timer = 5; return; } @@ -1740,14 +1741,13 @@ wb_ioctl(ifp, command, data) } static void -wb_watchdog(ifp) - struct ifnet *ifp; -{ +wb_watchdog(sc) struct wb_softc *sc; +{ + struct ifnet *ifp; - sc = ifp->if_softc; - - WB_LOCK(sc); + WB_LOCK_ASSERT(sc); + ifp = sc->wb_ifp; ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); #ifdef foo @@ -1760,7 +1760,6 @@ wb_watchdog(ifp) if (ifp->if_snd.ifq_head != NULL) wb_start_locked(ifp); - WB_UNLOCK(sc); return; } @@ -1778,7 +1777,7 @@ wb_stop(sc) WB_LOCK_ASSERT(sc); ifp = sc->wb_ifp; - ifp->if_timer = 0; + sc->wb_timer = 0; callout_stop(&sc->wb_stat_callout); Modified: stable/8/sys/dev/wb/if_wbreg.h ============================================================================== --- stable/8/sys/dev/wb/if_wbreg.h Sun Oct 30 01:13:49 2011 (r226922) +++ stable/8/sys/dev/wb/if_wbreg.h Sun Oct 30 01:24:53 2011 (r226923) @@ -374,6 +374,7 @@ struct wb_softc { u_int8_t wb_type; u_int16_t wb_txthresh; int wb_cachesize; + int wb_timer; caddr_t wb_ldata_ptr; struct wb_list_data *wb_ldata; struct wb_chain_data wb_cdata; From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 01:24:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26D7C106566B; Sun, 30 Oct 2011 01:24:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 146408FC0C; Sun, 30 Oct 2011 01:24:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U1OvIE041736; Sun, 30 Oct 2011 01:24:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U1OuQN041725; Sun, 30 Oct 2011 01:24:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110300124.p9U1OuQN041725@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 01:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226924 - in stable/7/sys: dev/lge dev/nve dev/pcn pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 01:24:57 -0000 Author: marius Date: Sun Oct 30 01:24:56 2011 New Revision: 226924 URL: http://svn.freebsd.org/changeset/base/226924 Log: MFC: r199560 - Hook into the existing stat timer to drive the transmit watchdog instead of using if_watchdog and if_timer. - Reorder detach to call ether_ifdetach() before anything else in tl(4) and wb(4). Modified: stable/7/sys/dev/lge/if_lge.c stable/7/sys/dev/lge/if_lgereg.h stable/7/sys/dev/nve/if_nve.c stable/7/sys/dev/nve/if_nvereg.h stable/7/sys/dev/pcn/if_pcn.c stable/7/sys/dev/pcn/if_pcnreg.h stable/7/sys/pci/if_tl.c stable/7/sys/pci/if_tlreg.h stable/7/sys/pci/if_wb.c stable/7/sys/pci/if_wbreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/lge/if_lge.c ============================================================================== --- stable/7/sys/dev/lge/if_lge.c Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/dev/lge/if_lge.c Sun Oct 30 01:24:56 2011 (r226924) @@ -137,7 +137,7 @@ static int lge_ioctl(struct ifnet *, u_l static void lge_init(void *); static void lge_init_locked(struct lge_softc *); static void lge_stop(struct lge_softc *); -static void lge_watchdog(struct ifnet *); +static void lge_watchdog(struct lge_softc *); static int lge_shutdown(device_t); static int lge_ifmedia_upd(struct ifnet *); static void lge_ifmedia_upd_locked(struct ifnet *); @@ -544,7 +544,6 @@ lge_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = lge_ioctl; ifp->if_start = lge_start; - ifp->if_watchdog = lge_watchdog; ifp->if_init = lge_init; ifp->if_snd.ifq_maxlen = LGE_TX_LIST_CNT - 1; ifp->if_capabilities = IFCAP_RXCSUM; @@ -1000,7 +999,7 @@ lge_txeof(sc) ifp = sc->lge_ifp; /* Clear the timeout timer. */ - ifp->if_timer = 0; + sc->lge_timer = 0; /* * Go through our tx list and free mbufs for those @@ -1021,7 +1020,7 @@ lge_txeof(sc) txdone--; LGE_INC(idx, LGE_TX_LIST_CNT); - ifp->if_timer = 0; + sc->lge_timer = 0; } sc->lge_cdata.lge_tx_cons = idx; @@ -1064,6 +1063,8 @@ lge_tick(xsc) } } + if (sc->lge_timer != 0 && --sc->lge_timer == 0) + lge_watchdog(sc); callout_reset(&sc->lge_stat_callout, hz, lge_tick, sc); return; @@ -1236,7 +1237,7 @@ lge_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->lge_timer = 5; return; } @@ -1506,14 +1507,14 @@ lge_ioctl(ifp, command, data) } static void -lge_watchdog(ifp) - struct ifnet *ifp; -{ +lge_watchdog(sc) struct lge_softc *sc; +{ + struct ifnet *ifp; - sc = ifp->if_softc; + LGE_LOCK_ASSERT(sc); + ifp = sc->lge_ifp; - LGE_LOCK(sc); ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); @@ -1524,9 +1525,6 @@ lge_watchdog(ifp) if (ifp->if_snd.ifq_head != NULL) lge_start_locked(ifp); - LGE_UNLOCK(sc); - - return; } /* @@ -1542,7 +1540,7 @@ lge_stop(sc) LGE_LOCK_ASSERT(sc); ifp = sc->lge_ifp; - ifp->if_timer = 0; + sc->lge_timer = 0; callout_stop(&sc->lge_stat_callout); CSR_WRITE_4(sc, LGE_IMR, LGE_IMR_INTR_ENB); Modified: stable/7/sys/dev/lge/if_lgereg.h ============================================================================== --- stable/7/sys/dev/lge/if_lgereg.h Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/dev/lge/if_lgereg.h Sun Oct 30 01:24:56 2011 (r226924) @@ -534,6 +534,7 @@ struct lge_softc { u_int8_t lge_link; u_int8_t lge_pcs; int lge_if_flags; + int lge_timer; struct lge_list_data *lge_ldata; struct lge_ring_data lge_cdata; struct callout lge_stat_callout; Modified: stable/7/sys/dev/nve/if_nve.c ============================================================================== --- stable/7/sys/dev/nve/if_nve.c Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/dev/nve/if_nve.c Sun Oct 30 01:24:56 2011 (r226924) @@ -140,7 +140,7 @@ static int nve_ioctl(struct ifnet * static void nve_intr(void *); static void nve_tick(void *); static void nve_setmulti(struct nve_softc *); -static void nve_watchdog(struct ifnet *); +static void nve_watchdog(struct nve_softc *); static void nve_update_stats(struct nve_softc *); static int nve_ifmedia_upd(struct ifnet *); @@ -533,8 +533,6 @@ nve_attach(device_t dev) ifp->if_ioctl = nve_ioctl; ifp->if_output = ether_output; ifp->if_start = nve_ifstart; - ifp->if_watchdog = nve_watchdog; - ifp->if_timer = 0; ifp->if_init = nve_init; ifp->if_mtu = ETHERMTU; ifp->if_baudrate = IF_Mbps(100); @@ -711,7 +709,7 @@ nve_stop(struct nve_softc *sc) DEBUGOUT(NVE_DEBUG_RUNNING, "nve: nve_stop - entry\n"); ifp = sc->ifp; - ifp->if_timer = 0; + sc->tx_timer = 0; /* Cancel tick timer */ callout_stop(&sc->stat_callout); @@ -985,7 +983,7 @@ nve_ifstart_locked(struct ifnet *ifp) return; } /* Set watchdog timer. */ - ifp->if_timer = 8; + sc->tx_timer = 8; /* Copy packet to BPF tap */ BPF_MTAP(ifp, m0); @@ -1097,7 +1095,7 @@ nve_intr(void *arg) /* If no pending packets we don't need a timeout */ if (sc->pending_txs == 0) - sc->ifp->if_timer = 0; + sc->tx_timer = 0; NVE_UNLOCK(sc); DEBUGOUT(NVE_DEBUG_INTERRUPT, "nve: nve_intr - exit\n"); @@ -1234,6 +1232,9 @@ nve_tick(void *xsc) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) nve_ifstart_locked(ifp); } + + if (sc->tx_timer > 0 && --sc->tx_timer == 0) + nve_watchdog(sc); callout_reset(&sc->stat_callout, hz, nve_tick, sc); return; @@ -1305,12 +1306,13 @@ nve_miibus_writereg(device_t dev, int ph /* Watchdog timer to prevent PHY lockups */ static void -nve_watchdog(struct ifnet *ifp) +nve_watchdog(struct nve_softc *sc) { - struct nve_softc *sc = ifp->if_softc; + struct ifnet *ifp; int pending_txs_start; - NVE_LOCK(sc); + NVE_LOCK_ASSERT(sc); + ifp = sc->ifp; /* * The nvidia driver blob defers tx completion notifications. @@ -1326,24 +1328,18 @@ nve_watchdog(struct ifnet *ifp) sc->hwapi->pfnDisableInterrupts(sc->hwapi->pADCX); sc->hwapi->pfnHandleInterrupt(sc->hwapi->pADCX); sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX); - if (sc->pending_txs < pending_txs_start) { - NVE_UNLOCK(sc); + if (sc->pending_txs < pending_txs_start) return; - } device_printf(sc->dev, "device timeout (%d)\n", sc->pending_txs); sc->tx_errors++; nve_stop(sc); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nve_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) nve_ifstart_locked(ifp); - NVE_UNLOCK(sc); - - return; } /* --- Start of NVOSAPI interface --- */ Modified: stable/7/sys/dev/nve/if_nvereg.h ============================================================================== --- stable/7/sys/dev/nve/if_nvereg.h Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/dev/nve/if_nvereg.h Sun Oct 30 01:24:56 2011 (r226924) @@ -138,6 +138,7 @@ struct nve_softc { device_t miibus; device_t dev; struct callout stat_callout; + int tx_timer; void *sc_ih; bus_space_tag_t sc_st; Modified: stable/7/sys/dev/pcn/if_pcn.c ============================================================================== --- stable/7/sys/dev/pcn/if_pcn.c Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/dev/pcn/if_pcn.c Sun Oct 30 01:24:56 2011 (r226924) @@ -143,7 +143,7 @@ static int pcn_ioctl(struct ifnet *, u_l static void pcn_init(void *); static void pcn_init_locked(struct pcn_softc *); static void pcn_stop(struct pcn_softc *); -static void pcn_watchdog(struct ifnet *); +static void pcn_watchdog(struct pcn_softc *); static void pcn_shutdown(device_t); static int pcn_ifmedia_upd(struct ifnet *); static void pcn_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -630,7 +630,6 @@ pcn_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = pcn_ioctl; ifp->if_start = pcn_start; - ifp->if_watchdog = pcn_watchdog; ifp->if_init = pcn_init; ifp->if_snd.ifq_maxlen = PCN_TX_LIST_CNT - 1; @@ -951,7 +950,7 @@ pcn_txeof(sc) sc->pcn_cdata.pcn_tx_cons = idx; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - ifp->if_timer = (sc->pcn_cdata.pcn_tx_cnt == 0) ? 0 : 5; + sc->pcn_timer = (sc->pcn_cdata.pcn_tx_cnt == 0) ? 0 : 5; return; } @@ -983,6 +982,8 @@ pcn_tick(xsc) pcn_start_locked(ifp); } + if (sc->pcn_timer > 0 && --sc->pcn_timer == 0) + pcn_watchdog(sc); callout_reset(&sc->pcn_stat_callout, hz, pcn_tick, sc); return; @@ -1150,7 +1151,7 @@ pcn_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->pcn_timer = 5; return; } @@ -1432,14 +1433,12 @@ pcn_ioctl(ifp, command, data) } static void -pcn_watchdog(ifp) - struct ifnet *ifp; +pcn_watchdog(struct pcn_softc *sc) { - struct pcn_softc *sc; - - sc = ifp->if_softc; + struct ifnet *ifp; - PCN_LOCK(sc); + PCN_LOCK_ASSERT(sc); + ifp = sc->pcn_ifp; ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); @@ -1450,10 +1449,6 @@ pcn_watchdog(ifp) if (ifp->if_snd.ifq_head != NULL) pcn_start_locked(ifp); - - PCN_UNLOCK(sc); - - return; } /* @@ -1469,7 +1464,7 @@ pcn_stop(sc) PCN_LOCK_ASSERT(sc); ifp = sc->pcn_ifp; - ifp->if_timer = 0; + sc->pcn_timer = 0; callout_stop(&sc->pcn_stat_callout); Modified: stable/7/sys/dev/pcn/if_pcnreg.h ============================================================================== --- stable/7/sys/dev/pcn/if_pcnreg.h Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/dev/pcn/if_pcnreg.h Sun Oct 30 01:24:56 2011 (r226924) @@ -465,6 +465,7 @@ struct pcn_softc { struct pcn_ring_data pcn_cdata; struct callout pcn_stat_callout; struct mtx pcn_mtx; + int pcn_timer; }; #define PCN_LOCK(_sc) mtx_lock(&(_sc)->pcn_mtx) Modified: stable/7/sys/pci/if_tl.c ============================================================================== --- stable/7/sys/pci/if_tl.c Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/pci/if_tl.c Sun Oct 30 01:24:56 2011 (r226924) @@ -281,7 +281,7 @@ static int tl_ioctl(struct ifnet *, u_lo static void tl_init(void *); static void tl_init_locked(struct tl_softc *); static void tl_stop(struct tl_softc *); -static void tl_watchdog(struct ifnet *); +static void tl_watchdog(struct tl_softc *); static int tl_shutdown(device_t); static int tl_ifmedia_upd(struct ifnet *); static void tl_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -1261,7 +1261,6 @@ tl_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = tl_ioctl; ifp->if_start = tl_start; - ifp->if_watchdog = tl_watchdog; ifp->if_init = tl_init; ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_maxlen = TL_TX_LIST_CNT - 1; @@ -1354,11 +1353,11 @@ tl_detach(dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { + ether_ifdetach(ifp); TL_LOCK(sc); tl_stop(sc); TL_UNLOCK(sc); callout_drain(&sc->tl_stat_callout); - ether_ifdetach(ifp); } if (sc->tl_miibus) device_delete_child(dev, sc->tl_miibus); @@ -1652,7 +1651,7 @@ tl_intvec_txeoc(xsc, type) ifp = sc->tl_ifp; /* Clear the timeout timer. */ - ifp->if_timer = 0; + sc->tl_timer = 0; if (sc->tl_cdata.tl_tx_head == NULL) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1838,6 +1837,9 @@ tl_stats_update(xsc) } } + if (sc->tl_timer > 0 && --sc->tl_timer == 0) + tl_watchdog(sc); + callout_reset(&sc->tl_stat_callout, hz, tl_stats_update, sc); if (!sc->tl_bitrate) { @@ -2046,7 +2048,7 @@ tl_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->tl_timer = 5; return; } @@ -2271,21 +2273,20 @@ tl_ioctl(ifp, command, data) } static void -tl_watchdog(ifp) - struct ifnet *ifp; -{ +tl_watchdog(sc) struct tl_softc *sc; +{ + struct ifnet *ifp; - sc = ifp->if_softc; + TL_LOCK_ASSERT(sc); + ifp = sc->tl_ifp; if_printf(ifp, "device timeout\n"); - TL_LOCK(sc); ifp->if_oerrors++; tl_softreset(sc, 1); tl_init_locked(sc); - TL_UNLOCK(sc); return; } Modified: stable/7/sys/pci/if_tlreg.h ============================================================================== --- stable/7/sys/pci/if_tlreg.h Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/pci/if_tlreg.h Sun Oct 30 01:24:56 2011 (r226924) @@ -126,6 +126,7 @@ struct tl_softc { int tl_if_flags; struct callout tl_stat_callout; struct mtx tl_mtx; + int tl_timer; }; #define TL_LOCK(_sc) mtx_lock(&(_sc)->tl_mtx) Modified: stable/7/sys/pci/if_wb.c ============================================================================== --- stable/7/sys/pci/if_wb.c Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/pci/if_wb.c Sun Oct 30 01:24:56 2011 (r226924) @@ -158,7 +158,7 @@ static int wb_ioctl(struct ifnet *, u_lo static void wb_init(void *); static void wb_init_locked(struct wb_softc *); static void wb_stop(struct wb_softc *); -static void wb_watchdog(struct ifnet *); +static void wb_watchdog(struct wb_softc *); static void wb_shutdown(device_t); static int wb_ifmedia_upd(struct ifnet *); static void wb_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -840,7 +840,6 @@ wb_attach(dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = wb_ioctl; ifp->if_start = wb_start; - ifp->if_watchdog = wb_watchdog; ifp->if_init = wb_init; ifp->if_snd.ifq_maxlen = WB_TX_LIST_CNT - 1; @@ -899,11 +898,11 @@ wb_detach(dev) * This should only be done if attach succeeded. */ if (device_is_attached(dev)) { + ether_ifdetach(ifp); WB_LOCK(sc); wb_stop(sc); WB_UNLOCK(sc); callout_drain(&sc->wb_stat_callout); - ether_ifdetach(ifp); } if (sc->wb_miibus) device_delete_child(dev, sc->wb_miibus); @@ -1149,7 +1148,7 @@ wb_txeof(sc) ifp = sc->wb_ifp; /* Clear the timeout timer. */ - ifp->if_timer = 0; + sc->wb_timer = 0; if (sc->wb_cdata.wb_tx_head == NULL) return; @@ -1204,7 +1203,7 @@ wb_txeoc(sc) ifp = sc->wb_ifp; - ifp->if_timer = 0; + sc->wb_timer = 0; if (sc->wb_cdata.wb_tx_head == NULL) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1212,7 +1211,7 @@ wb_txeoc(sc) } else { if (WB_TXOWN(sc->wb_cdata.wb_tx_head) == WB_UNSENT) { WB_TXOWN(sc->wb_cdata.wb_tx_head) = WB_TXSTAT_OWN; - ifp->if_timer = 5; + sc->wb_timer = 5; CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF); } } @@ -1321,6 +1320,8 @@ wb_tick(xsc) mii_tick(mii); + if (sc->wb_timer > 0 && --sc->wb_timer == 0) + wb_watchdog(sc); callout_reset(&sc->wb_stat_callout, hz, wb_tick, sc); return; @@ -1521,7 +1522,7 @@ wb_start_locked(ifp) /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->wb_timer = 5; return; } @@ -1740,14 +1741,13 @@ wb_ioctl(ifp, command, data) } static void -wb_watchdog(ifp) - struct ifnet *ifp; -{ +wb_watchdog(sc) struct wb_softc *sc; +{ + struct ifnet *ifp; - sc = ifp->if_softc; - - WB_LOCK(sc); + WB_LOCK_ASSERT(sc); + ifp = sc->wb_ifp; ifp->if_oerrors++; if_printf(ifp, "watchdog timeout\n"); #ifdef foo @@ -1760,7 +1760,6 @@ wb_watchdog(ifp) if (ifp->if_snd.ifq_head != NULL) wb_start_locked(ifp); - WB_UNLOCK(sc); return; } @@ -1778,7 +1777,7 @@ wb_stop(sc) WB_LOCK_ASSERT(sc); ifp = sc->wb_ifp; - ifp->if_timer = 0; + sc->wb_timer = 0; callout_stop(&sc->wb_stat_callout); Modified: stable/7/sys/pci/if_wbreg.h ============================================================================== --- stable/7/sys/pci/if_wbreg.h Sun Oct 30 01:24:53 2011 (r226923) +++ stable/7/sys/pci/if_wbreg.h Sun Oct 30 01:24:56 2011 (r226924) @@ -374,6 +374,7 @@ struct wb_softc { u_int8_t wb_type; u_int16_t wb_txthresh; int wb_cachesize; + int wb_timer; caddr_t wb_ldata_ptr; struct wb_list_data *wb_ldata; struct wb_chain_data wb_cdata; From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 02:19:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94D011065670; Sun, 30 Oct 2011 02:19:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ACBD8FC13; Sun, 30 Oct 2011 02:19:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U2Jd1W043472; Sun, 30 Oct 2011 02:19:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U2Jd2q043468; Sun, 30 Oct 2011 02:19:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201110300219.p9U2Jd2q043468@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 30 Oct 2011 02:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226925 - in head/sys: amd64/amd64 i386/i386 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 02:19:39 -0000 Author: marcel Date: Sun Oct 30 02:19:39 2011 New Revision: 226925 URL: http://svn.freebsd.org/changeset/base/226925 Log: Revert rev. 226893: subr_syscall.c is being included from C files and on amd64 with FREEBSD32 enabled, this means that systrace_probe_func gets defined twice. Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c head/sys/kern/subr_syscall.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Oct 30 01:24:56 2011 (r226924) +++ head/sys/amd64/amd64/trap.c Sun Oct 30 02:19:39 2011 (r226925) @@ -104,6 +104,13 @@ dtrace_trap_func_t dtrace_trap_func; dtrace_doubletrap_func_t dtrace_doubletrap_func; /* + * This is a hook which is initialised by the systrace module + * when it is loaded. This keeps the DTrace syscall provider + * implementation opaque. + */ +systrace_probe_func_t systrace_probe_func; + +/* * These hooks are necessary for the pid, usdt and fasttrap providers. */ dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sun Oct 30 01:24:56 2011 (r226924) +++ head/sys/i386/i386/trap.c Sun Oct 30 02:19:39 2011 (r226925) @@ -113,6 +113,13 @@ dtrace_trap_func_t dtrace_trap_func; dtrace_doubletrap_func_t dtrace_doubletrap_func; /* + * This is a hook which is initialised by the systrace module + * when it is loaded. This keeps the DTrace syscall provider + * implementation opaque. + */ +systrace_probe_func_t systrace_probe_func; + +/* * These hooks are necessary for the pid, usdt and fasttrap providers. */ dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sun Oct 30 01:24:56 2011 (r226924) +++ head/sys/kern/subr_syscall.c Sun Oct 30 02:19:39 2011 (r226925) @@ -52,15 +52,6 @@ __FBSDID("$FreeBSD$"); #endif #include -#ifdef KDTRACE_HOOKS -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; -#endif - static inline int syscallenter(struct thread *td, struct syscall_args *sa) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 02:36:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5AAA106564A; Sun, 30 Oct 2011 02:36:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B45478FC14; Sun, 30 Oct 2011 02:36:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U2anVR044046; Sun, 30 Oct 2011 02:36:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U2anfA044044; Sun, 30 Oct 2011 02:36:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201110300236.p9U2anfA044044@svn.freebsd.org> From: Rick Macklem Date: Sun, 30 Oct 2011 02:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226926 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 02:36:50 -0000 Author: rmacklem Date: Sun Oct 30 02:36:49 2011 New Revision: 226926 URL: http://svn.freebsd.org/changeset/base/226926 Log: MFC: r225537 Modify vfs_register() to use a hash calculation on vfc_name to set vfc_typenum, so that vfc_typenum doesn't change when file systems are loaded in different orders. This keeps NFS file handles from changing, for file systems that use vfc_typenum in their fsid. This change is controlled via a loader.conf variable called vfs.typenumhash, since vfc_typenum will change once when this is enabled. It defaults to 1 for 9.0, but will default to 0 when MFC'd to stable/8. Modified: stable/8/sys/kern/vfs_init.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/vfs_init.c ============================================================================== --- stable/8/sys/kern/vfs_init.c Sun Oct 30 02:19:39 2011 (r226925) +++ stable/8/sys/kern/vfs_init.c Sun Oct 30 02:36:49 2011 (r226926) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -65,6 +66,18 @@ int maxvfsconf = VFS_GENERIC + 1; struct vfsconfhead vfsconf = TAILQ_HEAD_INITIALIZER(vfsconf); /* + * Loader.conf variable vfs.typenumhash enables setting vfc_typenum using a hash + * calculation on vfc_name, so that it doesn't change when file systems are + * loaded in a different order. This will avoid the NFS server file handles from + * changing for file systems that use vfc_typenum in their fsid. + */ +static int vfs_typenumhash = 0; +TUNABLE_INT("vfs.typenumhash", &vfs_typenumhash); +SYSCTL_INT(_vfs, OID_AUTO, typenumhash, CTLFLAG_RDTUN, &vfs_typenumhash, 0, + "Set vfc_typenum using a hash calculation on vfc_name, so that it does not" + "change when file systems are loaded in a different order."); + +/* * A Zen vnode attribute structure. * * Initialized when the first filesystem registers by vfs_register(). @@ -138,6 +151,9 @@ vfs_register(struct vfsconf *vfc) struct sysctl_oid *oidp; struct vfsops *vfsops; static int once; + struct vfsconf *tvfc; + uint32_t hashval; + int secondpass; if (!once) { vattr_null(&va_null); @@ -152,7 +168,34 @@ vfs_register(struct vfsconf *vfc) if (vfs_byname(vfc->vfc_name) != NULL) return EEXIST; - vfc->vfc_typenum = maxvfsconf++; + if (vfs_typenumhash != 0) { + /* + * Calculate a hash on vfc_name to use for vfc_typenum. Unless + * all of 1<->255 are assigned, it is limited to 8bits since + * that is what ZFS uses from vfc_typenum and is also the + * preferred range for vfs_getnewfsid(). + */ + hashval = fnv_32_str(vfc->vfc_name, FNV1_32_INIT); + hashval &= 0xff; + secondpass = 0; + do { + /* Look for and fix any collision. */ + TAILQ_FOREACH(tvfc, &vfsconf, vfc_list) { + if (hashval == tvfc->vfc_typenum) { + if (hashval == 255 && secondpass == 0) { + hashval = 1; + secondpass = 1; + } else + hashval++; + break; + } + } + } while (tvfc != NULL); + vfc->vfc_typenum = hashval; + if (vfc->vfc_typenum >= maxvfsconf) + maxvfsconf = vfc->vfc_typenum + 1; + } else + vfc->vfc_typenum = maxvfsconf++; TAILQ_INSERT_TAIL(&vfsconf, vfc, vfc_list); /* From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 04:04:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 222141065670; Sun, 30 Oct 2011 04:04:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECA108FC0A; Sun, 30 Oct 2011 04:04:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U44evt047075; Sun, 30 Oct 2011 04:04:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U44efm047073; Sun, 30 Oct 2011 04:04:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110300404.p9U44efm047073@svn.freebsd.org> From: Doug Barton Date: Sun, 30 Oct 2011 04:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226927 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 04:04:41 -0000 Author: dougb Date: Sun Oct 30 04:04:40 2011 New Revision: 226927 URL: http://svn.freebsd.org/changeset/base/226927 Log: Add birth date for Ken Thompson Add birth and death dates for Steve Jobs Update birth and add death date for Dennis Ritchie PR: bin/162157 Submitted by: Niclas Zeising Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Sun Oct 30 02:36:49 2011 (r226926) +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Oct 30 04:04:40 2011 (r226927) @@ -42,6 +42,7 @@ 01/30 Franklin Delano Roosevelt born in Hyde Park, New York, 1882 01/31 Jackie Robinson born, 1919 02/03 Gertrude Stein born, 1874 +02/04 Ken Thompson, creator of unix, born, 1943 02/05 Alex Harvey (SAHB) is born in Glasgow, Scotland, 1935 02/06 King George VI of UK dies; his daughter becomes Elizabeth II, 1952 02/07 Sinclair Lewis born, 1885 @@ -68,6 +69,7 @@ 02/22 Pierre Jules Cesar Janssen born, 1838, found hydrogen in the sun 02/23 W.E.B. DuBois born, 1868 02/24 Winslow Homer born, 1836 +02/24 Steve Jobs born, 1955 02/25 George Harrison born in Liverpool, England, 1943 02/25 Renoir born, 1841 02/26 Dominique Francois Jean Arago born, 1786; @@ -212,7 +214,7 @@ 09/08 Richard ``the Lionheart'', king of England born in Oxford, 1157 09/08 Peter Sellers born in Southsea, England, 1925 09/09 Chinese Communist Party Chairman Mao Tse-Tung dies at age 82, 1976 -09/09 Dennis Ritchie born, 1941 +09/09 Dennis MacAlistair Ritchie, creater of C, born, 1941 09/12 Jesse Owens born, 1913 09/13 Walter Reed born, 1851 09/15 Agatha Christie born in Torquay, England, 1890 @@ -239,6 +241,8 @@ 10/02 Mohandas K. Gandhi born at Porbandar, Kathiawad, India, 1869 10/04 John V. Atanasoff born, 1903 10/05 Ray Kroc (founder of McDonald's) born, 1902 +10/05 Steve Jobs died at the age of 56, 2011 +10/12 Dennis MacAlistair Ritchie died at the age of 70, 2011 10/13 Lenny Bruce is born in New York City, 1925 10/13 Virgil (Publius Vergilius Maro) born near Mantua, Italy, 70 BC 10/14 Dwight David Eisenhower, 34th President of the United States, born in From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 05:06:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93137106566C; Sun, 30 Oct 2011 05:06:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 827368FC12; Sun, 30 Oct 2011 05:06:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U56E2q049049; Sun, 30 Oct 2011 05:06:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U56E3l049042; Sun, 30 Oct 2011 05:06:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201110300506.p9U56E3l049042@svn.freebsd.org> From: Alan Cox Date: Sun, 30 Oct 2011 05:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226928 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 05:06:14 -0000 Author: alc Date: Sun Oct 30 05:06:14 2011 New Revision: 226928 URL: http://svn.freebsd.org/changeset/base/226928 Log: Eliminate vm_phys_bootstrap_alloc(). It was a failed attempt at eliminating duplicated code in the various pmap implementations. Micro-optimize vm_phys_free_pages(). Introduce vm_phys_free_contig(). It is fast routine for freeing an arbitrary number of physically contiguous pages. In particular, it doesn't require the number of pages to be a power of two. Use "u_long" instead of "unsigned long". Bruce Evans (bde@) has convinced me that the "boundary" parameters to kmem_alloc_contig(), vm_phys_alloc_contig(), and vm_reserv_reclaim_contig() should be of type "vm_paddr_t" and not "u_long". Make this change. Modified: head/sys/vm/vm_contig.c head/sys/vm/vm_extern.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/vm/vm_reserv.c head/sys/vm/vm_reserv.h Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Sun Oct 30 04:04:40 2011 (r226927) +++ head/sys/vm/vm_contig.c Sun Oct 30 05:06:14 2011 (r226928) @@ -335,7 +335,8 @@ contigmapping(vm_map_t map, vm_size_t si vm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, - vm_paddr_t high, u_long alignment, u_long boundary, vm_memattr_t memattr) + vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) { vm_offset_t ret; vm_page_t pages; Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Sun Oct 30 04:04:40 2011 (r226927) +++ head/sys/vm/vm_extern.h Sun Oct 30 05:06:14 2011 (r226928) @@ -44,7 +44,7 @@ vm_offset_t kmem_alloc(vm_map_t, vm_size vm_offset_t kmem_alloc_attr(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); vm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, - vm_paddr_t low, vm_paddr_t high, u_long alignment, u_long boundary, + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); vm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t); vm_offset_t kmem_alloc_nofault_space(vm_map_t, vm_size_t, int); Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sun Oct 30 04:04:40 2011 (r226927) +++ head/sys/vm/vm_phys.c Sun Oct 30 05:06:14 2011 (r226928) @@ -490,26 +490,6 @@ vm_phys_alloc_freelist_pages(int flind, } /* - * Allocate physical memory from phys_avail[]. - */ -vm_paddr_t -vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment) -{ - vm_paddr_t pa; - int i; - - size = round_page(size); - for (i = 0; phys_avail[i + 1] != 0; i += 2) { - if (phys_avail[i + 1] - phys_avail[i] < size) - continue; - pa = phys_avail[i]; - phys_avail[i] += size; - return (pa); - } - panic("vm_phys_bootstrap_alloc"); -} - -/* * Find the vm_page corresponding to the given physical address. */ vm_page_t @@ -554,7 +534,7 @@ vm_phys_free_pages(vm_page_t m, int orde { struct vm_freelist *fl; struct vm_phys_seg *seg; - vm_paddr_t pa, pa_buddy; + vm_paddr_t pa; vm_page_t m_buddy; KASSERT(m->order == VM_NFREEORDER, @@ -566,25 +546,26 @@ vm_phys_free_pages(vm_page_t m, int orde KASSERT(order < VM_NFREEORDER, ("vm_phys_free_pages: order %d is out of range", order)); mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - pa = VM_PAGE_TO_PHYS(m); seg = &vm_phys_segs[m->segind]; - while (order < VM_NFREEORDER - 1) { - pa_buddy = pa ^ (1 << (PAGE_SHIFT + order)); - if (pa_buddy < seg->start || - pa_buddy >= seg->end) - break; - m_buddy = &seg->first_page[atop(pa_buddy - seg->start)]; - if (m_buddy->order != order) - break; - fl = (*seg->free_queues)[m_buddy->pool]; - TAILQ_REMOVE(&fl[m_buddy->order].pl, m_buddy, pageq); - fl[m_buddy->order].lcnt--; - m_buddy->order = VM_NFREEORDER; - if (m_buddy->pool != m->pool) - vm_phys_set_pool(m->pool, m_buddy, order); - order++; - pa &= ~((1 << (PAGE_SHIFT + order)) - 1); - m = &seg->first_page[atop(pa - seg->start)]; + if (order < VM_NFREEORDER - 1) { + pa = VM_PAGE_TO_PHYS(m); + do { + pa ^= ((vm_paddr_t)1 << (PAGE_SHIFT + order)); + if (pa < seg->start || pa >= seg->end) + break; + m_buddy = &seg->first_page[atop(pa - seg->start)]; + if (m_buddy->order != order) + break; + fl = (*seg->free_queues)[m_buddy->pool]; + TAILQ_REMOVE(&fl[order].pl, m_buddy, pageq); + fl[order].lcnt--; + m_buddy->order = VM_NFREEORDER; + if (m_buddy->pool != m->pool) + vm_phys_set_pool(m->pool, m_buddy, order); + order++; + pa &= ~(((vm_paddr_t)1 << (PAGE_SHIFT + order)) - 1); + m = &seg->first_page[atop(pa - seg->start)]; + } while (order < VM_NFREEORDER - 1); } m->order = order; fl = (*seg->free_queues)[m->pool]; @@ -593,6 +574,47 @@ vm_phys_free_pages(vm_page_t m, int orde } /* + * Free a contiguous, arbitrarily sized set of physical pages. + * + * The free page queues must be locked. + */ +void +vm_phys_free_contig(vm_page_t m, u_long npages) +{ + u_int n; + int order; + + /* + * Avoid unnecessary coalescing by freeing the pages in the largest + * possible power-of-two-sized subsets. + */ + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + for (;; npages -= n) { + /* + * Unsigned "min" is used here so that "order" is assigned + * "VM_NFREEORDER - 1" when "m"'s physical address is zero + * or the low-order bits of its physical address are zero + * because the size of a physical address exceeds the size of + * a long. + */ + order = min(ffsl(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1, + VM_NFREEORDER - 1); + n = 1 << order; + if (npages < n) + break; + vm_phys_free_pages(m, order); + m += n; + } + /* The residual "npages" is less than "1 << (VM_NFREEORDER - 1)". */ + for (; npages > 0; npages -= n) { + order = flsl(npages) - 1; + n = 1 << order; + vm_phys_free_pages(m, order); + m += n; + } +} + +/* * Set the pool for a contiguous, power of two-sized set of physical pages. */ void @@ -728,14 +750,15 @@ vm_phys_zero_pages_idle(void) * "alignment" and "boundary" must be a power of two. */ vm_page_t -vm_phys_alloc_contig(unsigned long npages, vm_paddr_t low, vm_paddr_t high, - unsigned long alignment, unsigned long boundary) +vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, + u_long alignment, vm_paddr_t boundary) { struct vm_freelist *fl; struct vm_phys_seg *seg; struct vnode *vp; vm_paddr_t pa, pa_last, size; vm_page_t deferred_vdrop_list, m, m_ret; + u_long npages_end; int domain, flind, i, oind, order, pind; #if VM_NDOMAIN > 1 @@ -848,13 +871,10 @@ done: deferred_vdrop_list = m; } } - for (; i < roundup2(npages, 1 << imin(oind, order)); i++) { - m = &m_ret[i]; - KASSERT(m->order == VM_NFREEORDER, - ("vm_phys_alloc_contig: page %p has unexpected order %d", - m, m->order)); - vm_phys_free_pages(m, 0); - } + /* Return excess pages to the free lists. */ + npages_end = roundup2(npages, 1 << imin(oind, order)); + if (npages < npages_end) + vm_phys_free_contig(&m_ret[npages], npages_end - npages); mtx_unlock(&vm_page_queue_free_mtx); while (deferred_vdrop_list != NULL) { vdrop((struct vnode *)deferred_vdrop_list->pageq.tqe_prev); Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Sun Oct 30 04:04:40 2011 (r226927) +++ head/sys/vm/vm_phys.h Sun Oct 30 05:06:14 2011 (r226928) @@ -50,12 +50,11 @@ struct mem_affinity { extern struct mem_affinity *mem_affinity; void vm_phys_add_page(vm_paddr_t pa); -vm_page_t vm_phys_alloc_contig(unsigned long npages, - vm_paddr_t low, vm_paddr_t high, - unsigned long alignment, unsigned long boundary); +vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, + u_long alignment, vm_paddr_t boundary); vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order); vm_page_t vm_phys_alloc_pages(int pool, int order); -vm_paddr_t vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment); +void vm_phys_free_contig(vm_page_t m, u_long npages); void vm_phys_free_pages(vm_page_t m, int order); void vm_phys_init(void); void vm_phys_set_pool(int pool, vm_page_t m, int order); Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sun Oct 30 04:04:40 2011 (r226927) +++ head/sys/vm/vm_reserv.c Sun Oct 30 05:06:14 2011 (r226928) @@ -628,7 +628,7 @@ vm_reserv_reclaim_inactive(void) */ boolean_t vm_reserv_reclaim_contig(vm_paddr_t size, vm_paddr_t low, vm_paddr_t high, - unsigned long alignment, unsigned long boundary) + u_long alignment, vm_paddr_t boundary) { vm_paddr_t pa, pa_length; vm_reserv_t rv; Modified: head/sys/vm/vm_reserv.h ============================================================================== --- head/sys/vm/vm_reserv.h Sun Oct 30 04:04:40 2011 (r226927) +++ head/sys/vm/vm_reserv.h Sun Oct 30 05:06:14 2011 (r226928) @@ -49,8 +49,7 @@ void vm_reserv_init(void); int vm_reserv_level_iffullpop(vm_page_t m); boolean_t vm_reserv_reactivate_page(vm_page_t m); boolean_t vm_reserv_reclaim_contig(vm_paddr_t size, vm_paddr_t low, - vm_paddr_t high, unsigned long alignment, - unsigned long boundary); + vm_paddr_t high, u_long alignment, vm_paddr_t boundary); boolean_t vm_reserv_reclaim_inactive(void); void vm_reserv_rename(vm_page_t m, vm_object_t new_object, vm_object_t old_object, vm_pindex_t old_object_offset); From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 08:35:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C85221065670; Sun, 30 Oct 2011 08:35:19 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B75528FC0C; Sun, 30 Oct 2011 08:35:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U8ZJ0F056498; Sun, 30 Oct 2011 08:35:19 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U8ZJWF056496; Sun, 30 Oct 2011 08:35:19 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201110300835.p9U8ZJWF056496@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 30 Oct 2011 08:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226929 - stable/9/contrib/tzcode/stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 08:35:19 -0000 Author: trociny Date: Sun Oct 30 08:35:19 2011 New Revision: 226929 URL: http://svn.freebsd.org/changeset/base/226929 Log: MFC r226828: Fix a memory leak in tzload(). PR: bin/161425 Reviewed by: kib Approved by: re (kib) Modified: stable/9/contrib/tzcode/stdtime/localtime.c Directory Properties: stable/9/contrib/tzcode/ (props changed) stable/9/contrib/tzcode/stdtime/ (props changed) stable/9/contrib/tzcode/zic/ (props changed) Modified: stable/9/contrib/tzcode/stdtime/localtime.c ============================================================================== --- stable/9/contrib/tzcode/stdtime/localtime.c Sun Oct 30 05:06:14 2011 (r226928) +++ stable/9/contrib/tzcode/stdtime/localtime.c Sun Oct 30 08:35:19 2011 (r226929) @@ -450,6 +450,7 @@ register const int doextend; _close(fid); return -1; } + free(fullname); } u = malloc(sizeof(*u)); if (u == NULL) From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 12:23:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDEE0106566C; Sun, 30 Oct 2011 12:23:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD4CC8FC0A; Sun, 30 Oct 2011 12:23:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UCN0j6068007; Sun, 30 Oct 2011 12:23:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UCN045068005; Sun, 30 Oct 2011 12:23:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110301223.p9UCN045068005@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 12:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226934 - stable/9/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 12:23:00 -0000 Author: marius Date: Sun Oct 30 12:23:00 2011 New Revision: 226934 URL: http://svn.freebsd.org/changeset/base/226934 Log: MFC: r226522 Allow to dump on Solaris swap partitions. PR: 161764 Submitted by: Peter Jeremy Approved by: re (kib) Modified: stable/9/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/9/sys/geom/part/g_part_vtoc8.c Sun Oct 30 12:11:12 2011 (r226933) +++ stable/9/sys/geom/part/g_part_vtoc8.c Sun Oct 30 12:23:00 2011 (r226934) @@ -274,7 +274,8 @@ g_part_vtoc8_dumpto(struct g_part_table */ table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); - return ((tag == 0 || tag == VTOC_TAG_FREEBSD_SWAP) ? 1 : 0); + return ((tag == 0 || tag == VTOC_TAG_FREEBSD_SWAP || + tag == VTOC_TAG_SWAP) ? 1 : 0); } static int From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 12:23:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7AA11065675; Sun, 30 Oct 2011 12:23:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A72DD8FC12; Sun, 30 Oct 2011 12:23:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UCN4We068051; Sun, 30 Oct 2011 12:23:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UCN4hZ068049; Sun, 30 Oct 2011 12:23:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110301223.p9UCN4hZ068049@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 12:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226935 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 12:23:04 -0000 Author: marius Date: Sun Oct 30 12:23:04 2011 New Revision: 226935 URL: http://svn.freebsd.org/changeset/base/226935 Log: MFC: r226522 Allow to dump on Solaris swap partitions. PR: 161764 Submitted by: Peter Jeremy Modified: stable/8/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/8/sys/geom/part/g_part_vtoc8.c Sun Oct 30 12:23:00 2011 (r226934) +++ stable/8/sys/geom/part/g_part_vtoc8.c Sun Oct 30 12:23:04 2011 (r226935) @@ -271,7 +271,8 @@ g_part_vtoc8_dumpto(struct g_part_table */ table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); - return ((tag == 0 || tag == VTOC_TAG_FREEBSD_SWAP) ? 1 : 0); + return ((tag == 0 || tag == VTOC_TAG_FREEBSD_SWAP || + tag == VTOC_TAG_SWAP) ? 1 : 0); } static int From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 12:23:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84E281065772; Sun, 30 Oct 2011 12:23:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44548FC13; Sun, 30 Oct 2011 12:23:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UCN69P068086; Sun, 30 Oct 2011 12:23:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UCN68m068084; Sun, 30 Oct 2011 12:23:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110301223.p9UCN68m068084@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 12:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226936 - stable/7/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 12:23:07 -0000 Author: marius Date: Sun Oct 30 12:23:06 2011 New Revision: 226936 URL: http://svn.freebsd.org/changeset/base/226936 Log: MFC: r226522 Allow to dump on Solaris swap partitions. PR: 161764 Submitted by: Peter Jeremy Modified: stable/7/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/7/sys/geom/part/g_part_vtoc8.c Sun Oct 30 12:23:04 2011 (r226935) +++ stable/7/sys/geom/part/g_part_vtoc8.c Sun Oct 30 12:23:06 2011 (r226936) @@ -272,7 +272,8 @@ g_part_vtoc8_dumpto(struct g_part_table */ table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); - return ((tag == 0 || tag == VTOC_TAG_FREEBSD_SWAP) ? 1 : 0); + return ((tag == 0 || tag == VTOC_TAG_FREEBSD_SWAP || + tag == VTOC_TAG_SWAP) ? 1 : 0); } static int From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 12:33:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DECB106566B; Sun, 30 Oct 2011 12:33:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E20E8FC18; Sun, 30 Oct 2011 12:33:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UCXJwo068474; Sun, 30 Oct 2011 12:33:19 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UCXJun068472; Sun, 30 Oct 2011 12:33:19 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201110301233.p9UCXJun068472@svn.freebsd.org> From: Christian Brueffer Date: Sun, 30 Oct 2011 12:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226937 - head/libexec/rshd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 12:33:20 -0000 Author: brueffer Date: Sun Oct 30 12:33:19 2011 New Revision: 226937 URL: http://svn.freebsd.org/changeset/base/226937 Log: Fix a misplaced parenthesis. PR: 162164 Submitted by: Henning Petersen MFC after: 1 week Modified: head/libexec/rshd/rshd.c Modified: head/libexec/rshd/rshd.c ============================================================================== --- head/libexec/rshd/rshd.c Sun Oct 30 12:23:06 2011 (r226936) +++ head/libexec/rshd/rshd.c Sun Oct 30 12:33:19 2011 (r226937) @@ -317,7 +317,7 @@ doit(struct sockaddr *fromp) } if ((pam_err = pam_set_item(pamh, PAM_RUSER, ruser)) != PAM_SUCCESS || - (pam_err = pam_set_item(pamh, PAM_RHOST, rhost) != PAM_SUCCESS)) { + (pam_err = pam_set_item(pamh, PAM_RHOST, rhost)) != PAM_SUCCESS) { syslog(LOG_ERR|LOG_AUTH, "pam_set_item(): %s", pam_strerror(pamh, pam_err)); rshd_errx(1, "Login incorrect."); From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 14:55:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A24E0106564A; Sun, 30 Oct 2011 14:55:13 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87D188FC13; Sun, 30 Oct 2011 14:55:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UEt0G9072949; Sun, 30 Oct 2011 14:55:00 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UEt0gA072947; Sun, 30 Oct 2011 14:55:00 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201110301455.p9UEt0gA072947@svn.freebsd.org> From: Kevin Lo Date: Sun, 30 Oct 2011 14:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226938 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 14:55:13 -0000 Author: kevlo Date: Sun Oct 30 14:55:00 2011 New Revision: 226938 URL: http://svn.freebsd.org/changeset/base/226938 Log: Add missing PF_UNLOCK in pf_test Reviewed by: bz Modified: head/sys/contrib/pf/net/pf.c Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Sun Oct 30 12:33:19 2011 (r226937) +++ head/sys/contrib/pf/net/pf.c Sun Oct 30 14:55:00 2011 (r226938) @@ -7176,11 +7176,15 @@ pf_test6(int dir, struct ifnet *ifp, str } #ifdef __FreeBSD__ - if (pd.pf_mtag->flags & PF_TAG_GENERATED) + if (pd.pf_mtag->flags & PF_TAG_GENERATED) { + PF_UNLOCK(); #else if (m->m_pkthdr.pf.flags & PF_TAG_GENERATED) #endif return (PF_PASS); +#ifdef __FreeBSD__ + } +#endif /* We do IP header normalization and packet reassembly here */ if (pf_normalize_ip6(m0, dir, kif, &reason, &pd) != PF_PASS) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 15:21:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 821D2106564A; Sun, 30 Oct 2011 15:21:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71C818FC18; Sun, 30 Oct 2011 15:21:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UFLRoT073785; Sun, 30 Oct 2011 15:21:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UFLR1u073782; Sun, 30 Oct 2011 15:21:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201110301521.p9UFLR1u073782@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 30 Oct 2011 15:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226939 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 15:21:27 -0000 Author: trasz Date: Sun Oct 30 15:21:27 2011 New Revision: 226939 URL: http://svn.freebsd.org/changeset/base/226939 Log: For processes with no controlling terminal, display "-" in the TTY column instead of "?". Submitted by: arundel Modified: head/bin/ps/print.c head/bin/ps/ps.1 Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Sun Oct 30 14:55:00 2011 (r226938) +++ head/bin/ps/print.c Sun Oct 30 15:21:27 2011 (r226939) @@ -362,7 +362,7 @@ tdev(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV) - str = strdup("??"); + str = strdup("-"); else asprintf(&str, "%#jx", (uintmax_t)dev); @@ -379,7 +379,7 @@ tname(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - str = strdup("?? "); + str = strdup("- "); else { if (strncmp(ttname, "tty", 3) == 0 || strncmp(ttname, "cua", 3) == 0) @@ -403,7 +403,7 @@ longtname(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - ttname = "??"; + ttname = "-"; return (strdup(ttname)); } Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Sun Oct 30 14:55:00 2011 (r226938) +++ head/bin/ps/ps.1 Sun Oct 30 15:21:27 2011 (r226939) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2011 +.Dd October 30, 2011 .Dt PS 1 .Os .Sh NAME @@ -437,6 +437,10 @@ This is followed by a .Ql - if the process can no longer reach that controlling terminal (i.e., it has been revoked). +A +.Ql - +without a preceding two letter abbreviation or pseudo-terminal device number +indicates a process which never had a controlling terminal. The full pathname of the controlling terminal is available via the .Cm tty keyword. From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 16:29:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4187E106564A; Sun, 30 Oct 2011 16:29:05 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4C08FC12; Sun, 30 Oct 2011 16:29:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UGT5uv075885; Sun, 30 Oct 2011 16:29:05 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UGT5NG075878; Sun, 30 Oct 2011 16:29:05 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201110301629.p9UGT5NG075878@svn.freebsd.org> From: Robert Millan Date: Sun, 30 Oct 2011 16:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226940 - in head/cddl: lib/libzfs sbin/zfs sbin/zpool usr.bin/zinject usr.bin/ztest usr.sbin/zdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 16:29:05 -0000 Author: rmh Date: Sun Oct 30 16:29:04 2011 New Revision: 226940 URL: http://svn.freebsd.org/changeset/base/226940 Log: Fix a few gratuitous library dependencies. Some of the ZFS utilities are linked with libraries they don't use: - zinject doesn't use libavl - ztest doesn't use libz - zdb uses neither libavl nor libz - zfs uses neither libbsdxml nor libm, nor libsbuf - zpool uses neither libbsdxml nor libm, nor libsbuf In addition, libzfs needs libm because it uses pow(), however it isn't linked with -lm. This went unnoticed because all its users had -lm before. Reviewed by: pjd, mm Approved by: kib (mentor) MFC after: 1 week Modified: head/cddl/lib/libzfs/Makefile head/cddl/sbin/zfs/Makefile head/cddl/sbin/zpool/Makefile head/cddl/usr.bin/zinject/Makefile head/cddl/usr.bin/ztest/Makefile head/cddl/usr.sbin/zdb/Makefile Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Sun Oct 30 15:21:27 2011 (r226939) +++ head/cddl/lib/libzfs/Makefile Sun Oct 30 16:29:04 2011 (r226940) @@ -6,8 +6,8 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs -DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} -LDADD= -lmd -lpthread -lumem -lutil +DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} +LDADD= -lmd -lpthread -lumem -lutil -lm SRCS= deviceid.c \ fsshare.c \ Modified: head/cddl/sbin/zfs/Makefile ============================================================================== --- head/cddl/sbin/zfs/Makefile Sun Oct 30 15:21:27 2011 (r226939) +++ head/cddl/sbin/zfs/Makefile Sun Oct 30 16:29:04 2011 (r226940) @@ -21,8 +21,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -DPADD= ${LIBBSDXML} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} ${LIBUMEM} \ +DPADD= ${LIBGEOM} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} -LDADD= -lbsdxml -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs +LDADD= -lgeom -lnvpair -lumem -lutil -luutil -lzfs .include Modified: head/cddl/sbin/zpool/Makefile ============================================================================== --- head/cddl/sbin/zpool/Makefile Sun Oct 30 15:21:27 2011 (r226939) +++ head/cddl/sbin/zpool/Makefile Sun Oct 30 16:29:04 2011 (r226940) @@ -26,8 +26,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common -DPADD= ${LIBAVL} ${LIBBSDXML} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} \ +DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} -LDADD= -lavl -lbsdxml -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs +LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs .include Modified: head/cddl/usr.bin/zinject/Makefile ============================================================================== --- head/cddl/usr.bin/zinject/Makefile Sun Oct 30 15:21:27 2011 (r226939) +++ head/cddl/usr.bin/zinject/Makefile Sun Oct 30 16:29:04 2011 (r226940) @@ -19,8 +19,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ +DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ ${LIBZFS} ${LIBZPOOL} -LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool +LDADD= -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool .include Modified: head/cddl/usr.bin/ztest/Makefile ============================================================================== --- head/cddl/usr.bin/ztest/Makefile Sun Oct 30 15:21:27 2011 (r226939) +++ head/cddl/usr.bin/ztest/Makefile Sun Oct 30 16:29:04 2011 (r226940) @@ -18,8 +18,8 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../lib/libumem DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \ - ${LIBPTHREAD} ${LIBZ} ${LIBAVL} -LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl + ${LIBPTHREAD} ${LIBAVL} +LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lavl CSTD= c99 Modified: head/cddl/usr.sbin/zdb/Makefile ============================================================================== --- head/cddl/usr.sbin/zdb/Makefile Sun Oct 30 15:21:27 2011 (r226939) +++ head/cddl/usr.sbin/zdb/Makefile Sun Oct 30 16:29:04 2011 (r226940) @@ -23,9 +23,9 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ - ${LIBUUTIL} ${LIBZ} ${LIBZFS} ${LIBZPOOL} -LDADD= -lavl -lgeom -lm -lnvpair -lpthread -lumem -luutil -lz -lzfs -lzpool +DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ + ${LIBUUTIL} ${LIBZFS} ${LIBZPOOL} +LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool .include From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 20:55:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75DAD106564A; Sun, 30 Oct 2011 20:55:33 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2F58FC08; Sun, 30 Oct 2011 20:55:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UKtXoJ084323; Sun, 30 Oct 2011 20:55:33 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UKtXmW084321; Sun, 30 Oct 2011 20:55:33 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110302055.p9UKtXmW084321@svn.freebsd.org> From: Doug Barton Date: Sun, 30 Oct 2011 20:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226942 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 20:55:33 -0000 Author: dougb Date: Sun Oct 30 20:55:32 2011 New Revision: 226942 URL: http://svn.freebsd.org/changeset/base/226942 Log: Fix typo from r226927 Submitted by: scf Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Sun Oct 30 20:45:27 2011 (r226941) +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Oct 30 20:55:32 2011 (r226942) @@ -214,7 +214,7 @@ 09/08 Richard ``the Lionheart'', king of England born in Oxford, 1157 09/08 Peter Sellers born in Southsea, England, 1925 09/09 Chinese Communist Party Chairman Mao Tse-Tung dies at age 82, 1976 -09/09 Dennis MacAlistair Ritchie, creater of C, born, 1941 +09/09 Dennis MacAlistair Ritchie, creator of C, born, 1941 09/12 Jesse Owens born, 1913 09/13 Walter Reed born, 1851 09/15 Agatha Christie born in Torquay, England, 1890 From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 20:56:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DACF106566C; Sun, 30 Oct 2011 20:56:55 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2383C8FC1E; Sun, 30 Oct 2011 20:56:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UKutwN084407; Sun, 30 Oct 2011 20:56:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UKusEX084401; Sun, 30 Oct 2011 20:56:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201110302056.p9UKusEX084401@svn.freebsd.org> From: Martin Matuska Date: Sun, 30 Oct 2011 20:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226943 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 20:56:55 -0000 Author: mm Date: Sun Oct 30 20:56:54 2011 New Revision: 226943 URL: http://svn.freebsd.org/changeset/base/226943 Log: MFC r226724, r226732: MFC r226724: Update copyright information in several ZFS files, as the clause 3.3 of the CDDL licence explicitly requires every Contributor to add a copyright notice. This also reflects the copyright notices for the changes recently added by Illumos. MFC r226732: [1] Fix typo in copyright notice introduced in r226724 (missing character in e-mail adress) Reported by: pjd [1] Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sun Oct 30 20:55:32 2011 (r226942) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sun Oct 30 20:56:54 2011 (r226943) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 iXsystems, Inc */ #include Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sun Oct 30 20:55:32 2011 (r226942) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sun Oct 30 20:56:54 2011 (r226943) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 Martin Matuska */ #include Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Oct 30 20:55:32 2011 (r226942) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Oct 30 20:56:54 2011 (r226943) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 Martin Matuska */ #include Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Oct 30 20:55:32 2011 (r226942) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Oct 30 20:56:54 2011 (r226943) @@ -23,6 +23,7 @@ */ /* Portions Copyright 2007 Jeremy Teo */ +/* Portions Copyright 2011 Martin Matuska */ #ifdef _KERNEL #include Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Oct 30 20:55:32 2011 (r226942) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Oct 30 20:56:54 2011 (r226943) @@ -26,6 +26,7 @@ */ /* Portions Copyright 2010 Robert Milkowski */ +/* Portions Copyright 2011 Martin Matuska */ /* * ZFS volume emulation driver. From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 20:58:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AE0F1065704; Sun, 30 Oct 2011 20:58:53 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60F5E8FC1C; Sun, 30 Oct 2011 20:58:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UKwrQn084522; Sun, 30 Oct 2011 20:58:53 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UKwrLR084520; Sun, 30 Oct 2011 20:58:53 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201110302058.p9UKwrLR084520@svn.freebsd.org> From: Martin Matuska Date: Sun, 30 Oct 2011 20:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226944 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 20:58:53 -0000 Author: mm Date: Sun Oct 30 20:58:53 2011 New Revision: 226944 URL: http://svn.freebsd.org/changeset/base/226944 Log: MFC r226512: Import fix for Illumos bug #1475 to reduce diff against upstream. Panic caused by this bug was already partially fixed by pjd@ in p4 CH 185940 and 185942. Reference: 1475 zfs spill block hold can access invalid spill blkptr https://www.illumos.org/issues/1475 Reviewed by: delphij Obtained from: Illumos (issue 1475, changeset 13469:b8e89e5c4167) Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sun Oct 30 20:56:54 2011 (r226943) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sun Oct 30 20:58:53 2011 (r226944) @@ -21,6 +21,9 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + */ #include #include @@ -676,6 +679,8 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o ASSERT3P(dmu_ot[dn->dn_type].ot_byteswap, ==, zap_byteswap); if (dn->dn_maxblkid == 0 && !add) { + blkptr_t *bp; + /* * If there is only one block (i.e. this is a micro-zap) * and we are not adding anything, the accounting is simple. @@ -690,14 +695,13 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o * Use max block size here, since we don't know how much * the size will change between now and the dbuf dirty call. */ + bp = &dn->dn_phys->dn_blkptr[0]; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, - &dn->dn_phys->dn_blkptr[0], - dn->dn_phys->dn_blkptr[0].blk_birth)) { + bp, bp->blk_birth)) txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; - } else { + else txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - } - if (dn->dn_phys->dn_blkptr[0].blk_birth) + if (!BP_IS_HOLE(bp)) txh->txh_space_tounref += SPA_MAXBLOCKSIZE; return; } @@ -1273,7 +1277,6 @@ dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t { dnode_t *dn; dmu_tx_hold_t *txh; - blkptr_t *bp; txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, THT_SPILL, 0, 0); @@ -1286,15 +1289,16 @@ dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t /* If blkptr doesn't exist then add space to towrite */ if (!(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) { txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - txh->txh_space_tounref = 0; } else { + blkptr_t *bp; + bp = &dn->dn_phys->dn_spill; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, bp, bp->blk_birth)) txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; else txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - if (bp->blk_birth) + if (!BP_IS_HOLE(bp)) txh->txh_space_tounref += SPA_MAXBLOCKSIZE; } } From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 21:02:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB82A106564A; Sun, 30 Oct 2011 21:02:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D241D8FC1B; Sun, 30 Oct 2011 21:02:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UL21cj084702; Sun, 30 Oct 2011 21:02:01 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UL21GX084696; Sun, 30 Oct 2011 21:02:01 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201110302102.p9UL21GX084696@svn.freebsd.org> From: Martin Matuska Date: Sun, 30 Oct 2011 21:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226945 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:02:02 -0000 Author: mm Date: Sun Oct 30 21:02:01 2011 New Revision: 226945 URL: http://svn.freebsd.org/changeset/base/226945 Log: MFC r226724, r226732: MFC r226724: Update copyright information in several ZFS files, as the clause 3.3 of the CDDL licence explicitly requires every Contributor to add a copyright notice. This also reflects the copyright notices for the changes recently added by Illumos. MFC r226732: [1] Fix typo in copyright notice introduced in r226724 (missing character in e-mail adress) Reported by: pjd [1] Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sun Oct 30 20:58:53 2011 (r226944) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sun Oct 30 21:02:01 2011 (r226945) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 iXsystems, Inc */ #include Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sun Oct 30 20:58:53 2011 (r226944) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sun Oct 30 21:02:01 2011 (r226945) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 Martin Matuska */ #include Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Oct 30 20:58:53 2011 (r226944) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Oct 30 21:02:01 2011 (r226945) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 Martin Matuska */ #include Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Oct 30 20:58:53 2011 (r226944) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Oct 30 21:02:01 2011 (r226945) @@ -23,6 +23,7 @@ */ /* Portions Copyright 2007 Jeremy Teo */ +/* Portions Copyright 2011 Martin Matuska */ #ifdef _KERNEL #include Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Oct 30 20:58:53 2011 (r226944) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Oct 30 21:02:01 2011 (r226945) @@ -26,6 +26,7 @@ */ /* Portions Copyright 2010 Robert Milkowski */ +/* Portions Copyright 2011 Martin Matuska */ /* * ZFS volume emulation driver. From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 21:03:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00902106564A; Sun, 30 Oct 2011 21:03:13 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5068FC1C; Sun, 30 Oct 2011 21:03:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UL3CWU084790; Sun, 30 Oct 2011 21:03:12 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UL3Cej084788; Sun, 30 Oct 2011 21:03:12 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201110302103.p9UL3Cej084788@svn.freebsd.org> From: Martin Matuska Date: Sun, 30 Oct 2011 21:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226946 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:03:13 -0000 Author: mm Date: Sun Oct 30 21:03:12 2011 New Revision: 226946 URL: http://svn.freebsd.org/changeset/base/226946 Log: MFC r226512: Import fix for Illumos bug #1475 to reduce diff against upstream. Panic caused by this bug was already partially fixed by pjd@ in p4 CH 185940 and 185942. Reference: 1475 zfs spill block hold can access invalid spill blkptr https://www.illumos.org/issues/1475 Reviewed by: delphij Obtained from: Illumos (issue 1475, changeset 13469:b8e89e5c4167) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sun Oct 30 21:02:01 2011 (r226945) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sun Oct 30 21:03:12 2011 (r226946) @@ -21,6 +21,9 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + */ #include #include @@ -676,6 +679,8 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o ASSERT3P(dmu_ot[dn->dn_type].ot_byteswap, ==, zap_byteswap); if (dn->dn_maxblkid == 0 && !add) { + blkptr_t *bp; + /* * If there is only one block (i.e. this is a micro-zap) * and we are not adding anything, the accounting is simple. @@ -690,14 +695,13 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o * Use max block size here, since we don't know how much * the size will change between now and the dbuf dirty call. */ + bp = &dn->dn_phys->dn_blkptr[0]; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, - &dn->dn_phys->dn_blkptr[0], - dn->dn_phys->dn_blkptr[0].blk_birth)) { + bp, bp->blk_birth)) txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; - } else { + else txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - } - if (dn->dn_phys->dn_blkptr[0].blk_birth) + if (!BP_IS_HOLE(bp)) txh->txh_space_tounref += SPA_MAXBLOCKSIZE; return; } @@ -1273,7 +1277,6 @@ dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t { dnode_t *dn; dmu_tx_hold_t *txh; - blkptr_t *bp; txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, THT_SPILL, 0, 0); @@ -1286,15 +1289,16 @@ dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t /* If blkptr doesn't exist then add space to towrite */ if (!(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) { txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - txh->txh_space_tounref = 0; } else { + blkptr_t *bp; + bp = &dn->dn_phys->dn_spill; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, bp, bp->blk_birth)) txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; else txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - if (bp->blk_birth) + if (!BP_IS_HOLE(bp)) txh->txh_space_tounref += SPA_MAXBLOCKSIZE; } } From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 21:17:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DF431065672; Sun, 30 Oct 2011 21:17:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F11718FC08; Sun, 30 Oct 2011 21:17:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9ULHgGO085251; Sun, 30 Oct 2011 21:17:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9ULHgLD085245; Sun, 30 Oct 2011 21:17:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110302117.p9ULHgLD085245@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 21:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226947 - in head/sys: dev/esp sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:17:43 -0000 Author: marius Date: Sun Oct 30 21:17:42 2011 New Revision: 226947 URL: http://svn.freebsd.org/changeset/base/226947 Log: - Use device_t rather than the NetBSDish struct device. - Move esp_devclass to ncr53c9x.c in order to allow different bus front-ends to use it. - Use KOBJMETHOD_END. - Remove the gl_clear_latched_intr hook as it's not needed for any of the chips nor the front-ends supported in FreeBSD and likely never will be. - Correct the DMA constraints used in the SBus front-end, the LSI64854 isn't limited to 32-bit DMA. - The ESP200 also only supports up to 64k transfers. - Don't let the DMA and SBus front-end supply a maximum transfer size larger than MAXPHYS as that's the maximum the upper layers use and we otherwise just waste resources unnecessarily. - Initialize the ECB callout and don't zero the handle when returning ECBs to the free list so that ncr53c9x_callout() actually is called with the driver lock held. - On detach the driver lock should be held across cam_sim_free() according to isp(4) and a panic received. - Check the return value of NCRDMA_SETUP(), i.e. bus_dmamap_load(9), and try to handle failures gracefully. - In ncr53c9x_action() replace N calls to xpt_done() in a switch with just one at the end. - On XPT_PATH_INQ report "NCR" rather than "Sun" as the vendor as the former is somewhat more correct as well as the maximum supported transfer size via maxio in order to take advantage of controllers that that can handle more than DFLTPHYS. - Print the number of MESSAGE (EXTENDED) rejected. - Fix the path encoded in the multiple inclusion protection of ncr53c9xvar.h. - Correct the DMA constraints used in the LSI64854 core to not exceed the maximum supported transfer size and include the boundary so we don't need to check on every setup of a DMA transfer. - Let the bus DMA map callbacks do nothing in case of an error. - Correctly handle > 64k transfers for FAS366 in the LSI64854. A new feature flag NCR_F_LARGEXFER was introduced so we just need to check for this one and not for individual controllers supporting large transfers in several places. - Let the LSI64854 core load transfer buffers using BUS_DMA_NOWAIT as the NCR53C9x core can't handle EINPROGRESS. Due to lack of bounce buffers support, sparc64 doesn't actually use EINPROGRESS and likely never will, as an example for writing additional front-ends for the NCR53C9x core it makes sense to set BUS_DMA_NOWAIT anyway though. - Some minor cleanup. Modified: head/sys/dev/esp/esp_sbus.c head/sys/dev/esp/ncr53c9x.c head/sys/dev/esp/ncr53c9xvar.h head/sys/sparc64/sbus/lsi64854.c head/sys/sparc64/sbus/lsi64854var.h Modified: head/sys/dev/esp/esp_sbus.c ============================================================================== --- head/sys/dev/esp/esp_sbus.c Sun Oct 30 21:03:12 2011 (r226946) +++ head/sys/dev/esp/esp_sbus.c Sun Oct 30 21:17:42 2011 (r226947) @@ -68,13 +68,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$"); struct esp_softc { struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */ - struct device *sc_dev; + device_t sc_dev; struct resource *sc_res; @@ -102,8 +102,6 @@ struct esp_softc { struct lsi64854_softc *sc_dma; /* pointer to my DMA */ }; -static devclass_t esp_devclass; - static int esp_probe(device_t); static int esp_dma_attach(device_t); static int esp_dma_detach(device_t); @@ -118,7 +116,8 @@ static device_method_t esp_dma_methods[] DEVMETHOD(device_detach, esp_dma_detach), DEVMETHOD(device_suspend, esp_suspend), DEVMETHOD(device_resume, esp_resume), - {0, 0} + + KOBJMETHOD_END }; static driver_t esp_dma_driver = { @@ -136,7 +135,8 @@ static device_method_t esp_sbus_methods[ DEVMETHOD(device_detach, esp_sbus_detach), DEVMETHOD(device_suspend, esp_suspend), DEVMETHOD(device_resume, esp_resume), - {0, 0} + + KOBJMETHOD_END }; static driver_t esp_sbus_driver = { @@ -175,7 +175,6 @@ static const struct ncr53c9x_glue const esp_dma_go, esp_dma_stop, esp_dma_isactive, - NULL, /* gl_clear_latched_intr */ }; static int @@ -245,9 +244,9 @@ esp_sbus_attach(device_t dev) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - 0, /* nsegments */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* no locking */ &lsc->sc_parent_dmat); @@ -292,8 +291,10 @@ esp_sbus_attach(device_t dev) } for (i = 0; i < nchildren; i++) { if (device_is_attached(children[i]) && - sbus_get_slot(children[i]) == sbus_get_slot(dev) && - strcmp(ofw_bus_get_name(children[i]), "dma") == 0) { + sbus_get_slot(children[i]) == + sbus_get_slot(dev) && + strcmp(ofw_bus_get_name(children[i]), + "dma") == 0) { /* XXX hackery */ esc->sc_dma = (struct lsi64854_softc *) device_get_softc(children[i]); @@ -453,13 +454,6 @@ espattach(struct esp_softc *esc, const s NCR_LOCK_INIT(sc); - /* Attach the DMA engine. */ - error = lsi64854_attach(esc->sc_dma); - if (error != 0) { - device_printf(esc->sc_dev, "lsi64854_attach failed\n"); - goto fail_lock; - } - sc->sc_id = OF_getscsinitid(esc->sc_dev); #ifdef ESP_SBUS_DEBUG @@ -516,9 +510,9 @@ espattach(struct esp_softc *esc, const s NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); if ((NCR_READ_REG(sc, NCR_CFG2) & ~NCRCFG2_RSVD) != - (NCRCFG2_SCSI2 | NCRCFG2_RPE)) { + (NCRCFG2_SCSI2 | NCRCFG2_RPE)) sc->sc_rev = NCR_VARIANT_ESP100; - } else { + else { sc->sc_cfg2 = NCRCFG2_SCSI2; NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); sc->sc_cfg3 = 0; @@ -526,9 +520,9 @@ espattach(struct esp_softc *esc, const s sc->sc_cfg3 = (NCRCFG3_CDB | NCRCFG3_FCLK); NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3); if (NCR_READ_REG(sc, NCR_CFG3) != - (NCRCFG3_CDB | NCRCFG3_FCLK)) { + (NCRCFG3_CDB | NCRCFG3_FCLK)) sc->sc_rev = NCR_VARIANT_ESP100A; - } else { + else { /* NCRCFG2_FE enables > 64K transfers. */ sc->sc_cfg2 |= NCRCFG2_FE; sc->sc_cfg3 = 0; @@ -543,9 +537,11 @@ espattach(struct esp_softc *esc, const s case 0x02: if ((uid & 0x07) == 0x02) - sc->sc_rev = NCR_VARIANT_FAS216; + sc->sc_rev = + NCR_VARIANT_FAS216; else - sc->sc_rev = NCR_VARIANT_FAS236; + sc->sc_rev = + NCR_VARIANT_FAS236; break; case 0x0a: @@ -560,7 +556,8 @@ espattach(struct esp_softc *esc, const s */ device_printf(esc->sc_dev, "Unknown chip\n"); - goto fail_lsi; + error = ENXIO; + goto fail_lock; } } } @@ -571,12 +568,6 @@ espattach(struct esp_softc *esc, const s #endif /* - * XXX minsync and maxxfer _should_ be set up in MI code, - * XXX but it appears to have some dependency on what sort - * XXX of DMA we're hooked up to, etc. - */ - - /* * This is the value used to start sync negotiations * Note that the NCR register "SYNCTP" is programmed * in "clocks per byte", and has a minimum value of 4. @@ -587,31 +578,27 @@ espattach(struct esp_softc *esc, const s */ sc->sc_minsync = 1000 / sc->sc_freq; + /* + * Except for some variants the maximum transfer size is 64k. + */ + sc->sc_maxxfer = 64 * 1024; sc->sc_maxoffset = 15; sc->sc_extended_geom = 1; /* * Alas, we must now modify the value a bit, because it's - * only valid when can switch on FASTCLK and FASTSCSI bits - * in config register 3... + * only valid when we can switch on FASTCLK and FASTSCSI bits + * in the config register 3... */ switch (sc->sc_rev) { case NCR_VARIANT_ESP100: sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT; - sc->sc_maxxfer = 64 * 1024; sc->sc_minsync = 0; /* No synch on old chip? */ break; case NCR_VARIANT_ESP100A: - sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT; - sc->sc_maxxfer = 64 * 1024; - /* Min clocks/byte is 5 */ - sc->sc_minsync = ncr53c9x_cpb2stp(sc, 5); - break; - case NCR_VARIANT_ESP200: sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT; - sc->sc_maxxfer = 16 * 1024 * 1024; /* Min clocks/byte is 5 */ sc->sc_minsync = ncr53c9x_cpb2stp(sc, 5); break; @@ -642,6 +629,19 @@ espattach(struct esp_softc *esc, const s break; } + /* + * Given that we allocate resources based on sc->sc_maxxfer it doesn't + * make sense to supply a value higher than the maximum actually used. + */ + sc->sc_maxxfer = min(sc->sc_maxxfer, MAXPHYS); + + /* Attach the DMA engine. */ + error = lsi64854_attach(esc->sc_dma); + if (error != 0) { + device_printf(esc->sc_dev, "lsi64854_attach failed\n"); + goto fail_lock; + } + /* Establish interrupt channel. */ i = 0; if ((esc->sc_irqres = bus_alloc_resource_any(esc->sc_dev, SYS_RES_IRQ, Modified: head/sys/dev/esp/ncr53c9x.c ============================================================================== --- head/sys/dev/esp/ncr53c9x.c Sun Oct 30 21:03:12 2011 (r226946) +++ head/sys/dev/esp/ncr53c9x.c Sun Oct 30 21:17:42 2011 (r226947) @@ -123,6 +123,8 @@ __FBSDID("$FreeBSD$"); #include #include +devclass_t esp_devclass; + MODULE_DEPEND(esp, cam, 1, 1, 1); #ifdef NCR53C9X_DEBUG @@ -179,8 +181,7 @@ static inline int ncr53c9x_stp2cpb(struc #define NCR_SET_COUNT(sc, size) do { \ NCR_WRITE_REG((sc), NCR_TCL, (size)); \ NCR_WRITE_REG((sc), NCR_TCM, (size) >> 8); \ - if ((sc->sc_cfg2 & NCRCFG2_FE) || \ - (sc->sc_rev == NCR_VARIANT_FAS366)) \ + if ((sc->sc_features & NCR_F_LARGEXFER) != 0) \ NCR_WRITE_REG((sc), NCR_TCH, (size) >> 16); \ if (sc->sc_rev == NCR_VARIANT_FAS366) \ NCR_WRITE_REG(sc, NCR_RCH, 0); \ @@ -391,6 +392,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s ecb = &sc->ecb_array[i]; ecb->sc = sc; ecb->tag_id = i; + callout_init_mtx(&ecb->ch, &sc->sc_lock, 0); TAILQ_INSERT_HEAD(&sc->free_list, ecb, free_links); } @@ -449,10 +451,10 @@ ncr53c9x_detach(struct ncr53c9x_softc *s xpt_register_async(0, ncr53c9x_async, sc->sc_sim, sc->sc_path); xpt_free_path(sc->sc_path); xpt_bus_deregister(cam_sim_path(sc->sc_sim)); + cam_sim_free(sc->sc_sim, TRUE); NCR_UNLOCK(sc); - cam_sim_free(sc->sc_sim, TRUE); free(sc->ecb_array, M_DEVBUF); free(sc->sc_tinfo, M_DEVBUF); if (sc->sc_imess_self) @@ -504,6 +506,8 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc /* FALLTHROUGH */ case NCR_VARIANT_ESP100A: sc->sc_features |= NCR_F_SELATN3; + if ((sc->sc_cfg2 & NCRCFG2_FE) != 0) + sc->sc_features |= NCR_F_LARGEXFER; NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); /* FALLTHROUGH */ case NCR_VARIANT_ESP100: @@ -514,8 +518,8 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc break; case NCR_VARIANT_FAS366: - sc->sc_features |= - NCR_F_HASCFG3 | NCR_F_FASTSCSI | NCR_F_SELATN3; + sc->sc_features |= NCR_F_HASCFG3 | NCR_F_FASTSCSI | + NCR_F_SELATN3 | NCR_F_LARGEXFER; sc->sc_cfg3 = NCRFASCFG3_FASTCLK | NCRFASCFG3_OBAUTO; if (sc->sc_id > 7) sc->sc_cfg3 |= NCRFASCFG3_IDBIT3; @@ -711,9 +715,6 @@ ncr53c9x_readregs(struct ncr53c9x_softc sc->sc_espintr = NCR_READ_REG(sc, NCR_INTR); - if (sc->sc_glue->gl_clear_latched_intr != NULL) - (*sc->sc_glue->gl_clear_latched_intr)(sc); - /* * Determine the SCSI bus phase, return either a real SCSI bus phase * or some pseudo phase we use to detect certain exceptions. @@ -806,7 +807,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s struct ncr53c9x_tinfo *ti; uint8_t *cmd; size_t dmasize; - int clen, selatn3, selatns; + int clen, error, selatn3, selatns; int lun = ecb->ccb->ccb_h.target_lun; int target = ecb->ccb->ccb_h.target_id; @@ -887,13 +888,19 @@ ncr53c9x_select(struct ncr53c9x_softc *s dmasize = clen; sc->sc_cmdlen = clen; sc->sc_cmdp = cmd; - NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &dmasize); + error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, + &dmasize); + if (error != 0) { + sc->sc_cmdlen = 0; + sc->sc_cmdp = NULL; + goto cmd; + } + /* Program the SCSI counter. */ NCR_SET_COUNT(sc, dmasize); /* Load the count in. */ - /* if (sc->sc_rev != NCR_VARIANT_FAS366) */ - NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA); + NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA); /* And get the target's attention. */ if (selatn3) { @@ -906,6 +913,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s return; } +cmd: /* * Who am I? This is where we tell the target that we are * happy for it to disconnect etc. @@ -989,13 +997,11 @@ ncr53c9x_action(struct cam_sim *sim, uni case XPT_RESET_BUS: ncr53c9x_init(sc, 1); ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - return; + break; case XPT_CALC_GEOMETRY: cam_calc_geometry(&ccb->ccg, sc->sc_extended_geom); - xpt_done(ccb); - return; + break; case XPT_PATH_INQ: cpi = &ccb->cpi; @@ -1009,19 +1015,19 @@ ncr53c9x_action(struct cam_sim *sim, uni cpi->max_target = sc->sc_ntarg - 1; cpi->max_lun = 7; cpi->initiator_id = sc->sc_id; - cpi->bus_id = 0; - cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, "Sun", HBA_IDLEN); + strncpy(cpi->hba_vid, "NCR", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); - cpi->transport = XPORT_SPI; - cpi->transport_version = 2; + cpi->bus_id = 0; + cpi->base_transfer_speed = 3300; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->maxio = sc->sc_maxxfer; ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - return; + break; case XPT_GET_TRAN_SETTINGS: cts = &ccb->cts; @@ -1064,28 +1070,24 @@ ncr53c9x_action(struct cam_sim *sim, uni CTS_SPI_VALID_DISC; scsi->valid = CTS_SCSI_VALID_TQ; ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - return; + break; case XPT_ABORT: device_printf(sc->sc_dev, "XPT_ABORT called\n"); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; - xpt_done(ccb); - return; + break; case XPT_TERM_IO: device_printf(sc->sc_dev, "XPT_TERM_IO called\n"); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; - xpt_done(ccb); - return; + break; case XPT_RESET_DEV: case XPT_SCSI_IO: if (ccb->ccb_h.target_id < 0 || ccb->ccb_h.target_id >= sc->sc_ntarg) { ccb->ccb_h.status = CAM_PATH_INVALID; - xpt_done(ccb); - return; + goto done; } /* Get an ECB to use. */ ecb = ncr53c9x_get_ecb(sc); @@ -1097,8 +1099,7 @@ ncr53c9x_action(struct cam_sim *sim, uni xpt_freeze_simq(sim, 1); ccb->ccb_h.status = CAM_REQUEUE_REQ; device_printf(sc->sc_dev, "unable to allocate ecb\n"); - xpt_done(ccb); - return; + goto done; } /* Initialize ecb. */ @@ -1127,7 +1128,7 @@ ncr53c9x_action(struct cam_sim *sim, uni ecb->flags |= ECB_READY; if (sc->sc_state == NCR_IDLE) ncr53c9x_sched(sc); - break; + return; case XPT_SET_TRAN_SETTINGS: cts = &ccb->cts; @@ -1165,16 +1166,16 @@ ncr53c9x_action(struct cam_sim *sim, uni } ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - return; + break; default: device_printf(sc->sc_dev, "Unhandled function code %d\n", ccb->ccb_h.func_code); ccb->ccb_h.status = CAM_PROVIDE_FAIL; - xpt_done(ccb); - return; } + +done: + xpt_done(ccb); } /* @@ -2030,8 +2031,8 @@ gotit: default: xpt_print_path(ecb->ccb->ccb_h.path); - printf("unrecognized MESSAGE EXTENDED;" - " sending REJECT\n"); + printf("unrecognized MESSAGE EXTENDED 0x%x;" + " sending REJECT\n", sc->sc_imess[2]); goto reject; } break; @@ -2039,7 +2040,8 @@ gotit: default: NCR_MSGS(("ident ")); xpt_print_path(ecb->ccb->ccb_h.path); - printf("unrecognized MESSAGE; sending REJECT\n"); + printf("unrecognized MESSAGE 0x%x; sending REJECT\n", + sc->sc_imess[0]); /* FALLTHROUGH */ reject: ncr53c9x_sched_msgout(SEND_REJECT); @@ -2109,6 +2111,7 @@ ncr53c9x_msgout(struct ncr53c9x_softc *s struct ncr53c9x_tinfo *ti; struct ncr53c9x_ecb *ecb; size_t size; + int error; #ifdef NCR53C9X_DEBUG int i; #endif @@ -2246,17 +2249,14 @@ ncr53c9x_msgout(struct ncr53c9x_softc *s NCR_MSGS(("> ")); } #endif - if (sc->sc_rev == NCR_VARIANT_FAS366) { - /* - * XXX FIFO size - */ - ncr53c9x_flushfifo(sc); - ncr53c9x_wrfifo(sc, sc->sc_omp, sc->sc_omlen); - NCRCMD(sc, NCRCMD_TRANS); - } else { + + if (sc->sc_rev != NCR_VARIANT_FAS366) { /* (Re)send the message. */ size = ulmin(sc->sc_omlen, sc->sc_maxxfer); - NCRDMA_SETUP(sc, &sc->sc_omp, &sc->sc_omlen, 0, &size); + error = NCRDMA_SETUP(sc, &sc->sc_omp, &sc->sc_omlen, 0, &size); + if (error != 0) + goto cmd; + /* Program the SCSI counter. */ NCR_SET_COUNT(sc, size); @@ -2264,7 +2264,16 @@ ncr53c9x_msgout(struct ncr53c9x_softc *s NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA); NCRCMD(sc, NCRCMD_TRANS | NCRCMD_DMA); NCRDMA_GO(sc); + return; } + +cmd: + /* + * XXX FIFO size + */ + ncr53c9x_flushfifo(sc); + ncr53c9x_wrfifo(sc, sc->sc_omp, sc->sc_omlen); + NCRCMD(sc, NCRCMD_TRANS); } void @@ -2299,7 +2308,7 @@ ncr53c9x_intr1(struct ncr53c9x_softc *sc struct ncr53c9x_tinfo *ti; struct timeval cur, wait; size_t size; - int i, nfifo; + int error, i, nfifo; uint8_t msg; NCR_LOCK_ASSERT(sc, MA_OWNED); @@ -2974,8 +2983,14 @@ msgin: size = ecb->clen; sc->sc_cmdlen = size; sc->sc_cmdp = (void *)&ecb->cmd.cmd; - NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, + error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &size); + if (error != 0) { + sc->sc_cmdlen = 0; + sc->sc_cmdp = NULL; + goto cmd; + } + /* Program the SCSI counter. */ NCR_SET_COUNT(sc, size); @@ -2985,30 +3000,51 @@ msgin: /* Start the command transfer. */ NCRCMD(sc, NCRCMD_TRANS | NCRCMD_DMA); NCRDMA_GO(sc); - } else { - ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd, - ecb->clen); - NCRCMD(sc, NCRCMD_TRANS); + sc->sc_prevphase = COMMAND_PHASE; + break; } +cmd: + ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd, ecb->clen); + NCRCMD(sc, NCRCMD_TRANS); sc->sc_prevphase = COMMAND_PHASE; break; case DATA_OUT_PHASE: NCR_PHASE(("DATA_OUT_PHASE [%ld] ", (long)sc->sc_dleft)); + sc->sc_prevphase = DATA_OUT_PHASE; NCRCMD(sc, NCRCMD_FLUSH); size = ulmin(sc->sc_dleft, sc->sc_maxxfer); - NCRDMA_SETUP(sc, &sc->sc_dp, &sc->sc_dleft, 0, &size); - sc->sc_prevphase = DATA_OUT_PHASE; + error = NCRDMA_SETUP(sc, &sc->sc_dp, &sc->sc_dleft, 0, &size); goto setup_xfer; case DATA_IN_PHASE: NCR_PHASE(("DATA_IN_PHASE ")); + sc->sc_prevphase = DATA_IN_PHASE; if (sc->sc_rev == NCR_VARIANT_ESP100) NCRCMD(sc, NCRCMD_FLUSH); size = ulmin(sc->sc_dleft, sc->sc_maxxfer); - NCRDMA_SETUP(sc, &sc->sc_dp, &sc->sc_dleft, 1, &size); - sc->sc_prevphase = DATA_IN_PHASE; - setup_xfer: + error = NCRDMA_SETUP(sc, &sc->sc_dp, &sc->sc_dleft, 1, &size); +setup_xfer: + if (error != 0) { + switch (error) { + case EFBIG: + ecb->ccb->ccb_h.status |= CAM_REQ_TOO_BIG; + break; + case EINPROGRESS: + panic("%s: cannot deal with deferred DMA", + __func__); + case EINVAL: + ecb->ccb->ccb_h.status |= CAM_REQ_INVALID; + break; + case ENOMEM: + ecb->ccb->ccb_h.status |= CAM_REQUEUE_REQ; + break; + default: + ecb->ccb->ccb_h.status |= CAM_REQ_CMP_ERR; + } + goto finish; + } + /* Target returned to data phase: wipe "done" memory */ ecb->flags &= ~ECB_TENTATIVE_DONE; Modified: head/sys/dev/esp/ncr53c9xvar.h ============================================================================== --- head/sys/dev/esp/ncr53c9xvar.h Sun Oct 30 21:03:12 2011 (r226946) +++ head/sys/dev/esp/ncr53c9xvar.h Sun Oct 30 21:17:42 2011 (r226947) @@ -68,8 +68,8 @@ /* $FreeBSD$ */ -#ifndef _DEV_IC_NCR53C9XVAR_H_ -#define _DEV_IC_NCR53C9XVAR_H_ +#ifndef _NCR53C9XVAR_H_ +#define _NCR53C9XVAR_H_ #include @@ -115,7 +115,8 @@ * scsi_status,sense_data}. */ struct ncr53c9x_ecb { - /* These fields are preserved between alloc and free */ + /* These fields are preserved between alloc and free. */ + struct callout ch; struct ncr53c9x_softc *sc; int tag_id; int flags; @@ -130,7 +131,6 @@ struct ncr53c9x_ecb { #define ECB_RESET 0x80 #define ECB_TENTATIVE_DONE 0x100 int timeout; - struct callout ch; struct { uint8_t msg[3]; /* Selection Id msg and tags */ @@ -290,7 +290,7 @@ extern int ncr53c9x_debug; struct ncr53c9x_softc; /* - * Function switch used as glue to MD code. + * Function switch used as glue to MD code */ struct ncr53c9x_glue { /* Mandatory entry points. */ @@ -304,9 +304,6 @@ struct ncr53c9x_glue { void (*gl_dma_go)(struct ncr53c9x_softc *); void (*gl_dma_stop)(struct ncr53c9x_softc *); int (*gl_dma_isactive)(struct ncr53c9x_softc *); - - /* Optional entry points. */ - void (*gl_clear_latched_intr)(struct ncr53c9x_softc *); }; struct ncr53c9x_softc { @@ -330,7 +327,7 @@ struct ncr53c9x_softc { uint8_t sc_ccf; /* Clock Conversion */ uint8_t sc_timeout; - /* register copies, see espreadregs() */ + /* register copies, see ncr53c9x_readregs() */ uint8_t sc_espintr; uint8_t sc_espstat; uint8_t sc_espstep; @@ -415,6 +412,7 @@ struct ncr53c9x_softc { #define NCR_F_FASTSCSI 0x02 /* chip supports Fast mode */ #define NCR_F_DMASELECT 0x04 /* can do dmaselect */ #define NCR_F_SELATN3 0x08 /* chip supports SELATN3 command */ +#define NCR_F_LARGEXFER 0x10 /* chip supports transfers > 64k */ /* values for sc_msgout */ #define SEND_DEV_RESET 0x0001 @@ -499,8 +497,10 @@ struct ncr53c9x_softc { #define ncr53c9x_cpb2stp(sc, cpb) \ ((250 * (cpb)) / (sc)->sc_freq) +extern devclass_t esp_devclass; + int ncr53c9x_attach(struct ncr53c9x_softc *sc); int ncr53c9x_detach(struct ncr53c9x_softc *sc); void ncr53c9x_intr(void *arg); -#endif /* _DEV_IC_NCR53C9XVAR_H_ */ +#endif /* _NCR53C9XVAR_H_ */ Modified: head/sys/sparc64/sbus/lsi64854.c ============================================================================== --- head/sys/sparc64/sbus/lsi64854.c Sun Oct 30 21:03:12 2011 (r226946) +++ head/sys/sparc64/sbus/lsi64854.c Sun Oct 30 21:17:42 2011 (r226947) @@ -94,7 +94,12 @@ int lsi64854debug = 0; #define DPRINTF(a,x) #endif -#define MAX_DMA_SZ (16*1024*1024) +/* + * The rules say we cannot transfer more than the limit of this DMA chip (64k + * for old and 16Mb for new), and we cannot cross a 16Mb boundary. + */ +#define MAX_DMA_SZ (64 * 1024) +#define BOUNDARY (16 * 1024 * 1024) static void lsi64854_reset(struct lsi64854_softc *); static void lsi64854_map_scsi(void *, bus_dma_segment_t *, int, int); @@ -125,6 +130,7 @@ lsi64854_attach(struct lsi64854_softc *s lockfunc = NULL; lockfuncarg = NULL; + sc->sc_maxdmasize = MAX_DMA_SZ; switch (sc->sc_channel) { case L64854_CHANNEL_SCSI: @@ -135,6 +141,7 @@ lsi64854_attach(struct lsi64854_softc *s } lockfunc = busdma_lock_mutex; lockfuncarg = &nsc->sc_lock; + sc->sc_maxdmasize = nsc->sc_maxxfer; sc->intr = lsi64854_scsi_intr; sc->setup = lsi64854_setup; break; @@ -153,13 +160,13 @@ lsi64854_attach(struct lsi64854_softc *s if (sc->setup != NULL) { error = bus_dma_tag_create( sc->sc_parent_dmat, /* parent */ - 1, 0, /* alignment, boundary */ + 1, BOUNDARY, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAX_DMA_SZ, /* maxsize */ + sc->sc_maxdmasize, /* maxsize */ 1, /* nsegments */ - MAX_DMA_SZ, /* maxsegsize */ + sc->sc_maxdmasize, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ lockfunc, lockfuncarg, /* lockfunc, lockfuncarg */ &sc->sc_buffer_dmat); @@ -250,24 +257,25 @@ lsi64854_detach(struct lsi64854_softc *s * other revs: D_ESC_R_PEND bit reads as 0 \ */ \ DMAWAIT(sc, L64854_GCSR(sc) & D_ESC_R_PEND, "R_PEND", dontpanic);\ - if (sc->sc_rev != DMAREV_HME) { \ - /* \ - * Select drain bit based on revision \ - * also clears errors and D_TC flag \ - */ \ - csr = L64854_GCSR(sc); \ - if (sc->sc_rev == DMAREV_1 || sc->sc_rev == DMAREV_0) \ - csr |= D_ESC_DRAIN; \ - else \ - csr |= L64854_INVALIDATE; \ + if (sc->sc_rev != DMAREV_HME) { \ + /* \ + * Select drain bit based on revision \ + * also clears errors and D_TC flag \ + */ \ + csr = L64854_GCSR(sc); \ + if (sc->sc_rev == DMAREV_1 || sc->sc_rev == DMAREV_0) \ + csr |= D_ESC_DRAIN; \ + else \ + csr |= L64854_INVALIDATE; \ \ - L64854_SCSR(sc,csr); \ + L64854_SCSR(sc, csr); \ } \ /* \ * Wait for draining to finish \ * rev0 & rev1 call this PACKCNT \ */ \ - DMAWAIT(sc, L64854_GCSR(sc) & L64854_DRAINING, "DRAINING", dontpanic);\ + DMAWAIT(sc, L64854_GCSR(sc) & L64854_DRAINING, "DRAINING", \ + dontpanic); \ } while (/* CONSTCOND */0) #define DMA_FLUSH(sc, dontpanic) do { \ @@ -282,12 +290,14 @@ lsi64854_detach(struct lsi64854_softc *s csr = L64854_GCSR(sc); \ csr &= ~(L64854_WRITE|L64854_EN_DMA); /* no-ops on ENET */ \ csr |= L64854_INVALIDATE; /* XXX FAS ? */ \ - L64854_SCSR(sc,csr); \ + L64854_SCSR(sc, csr); \ } while (/* CONSTCOND */0) static void lsi64854_reset(struct lsi64854_softc *sc) { + bus_dma_tag_t dmat; + bus_dmamap_t dmam; uint32_t csr; DMA_FLUSH(sc, 1); @@ -296,10 +306,11 @@ lsi64854_reset(struct lsi64854_softc *sc DPRINTF(LDB_ANY, ("%s: csr 0x%x\n", __func__, csr)); if (sc->sc_dmasize != 0) { - bus_dmamap_sync(sc->sc_buffer_dmat, sc->sc_dmamap, - (csr & D_WRITE) != 0 ? BUS_DMASYNC_PREREAD : - BUS_DMASYNC_PREWRITE); - bus_dmamap_unload(sc->sc_buffer_dmat, sc->sc_dmamap); + dmat = sc->sc_buffer_dmat; + dmam = sc->sc_dmamap; + bus_dmamap_sync(dmat, dmam, (csr & D_WRITE) != 0 ? + BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE); + bus_dmamap_unload(dmat, dmam); } if (sc->sc_rev == DMAREV_HME) @@ -364,15 +375,16 @@ lsi64854_map_scsi(void *arg, bus_dma_seg sc = (struct lsi64854_softc *)arg; + if (error != 0) + return; if (nseg != 1) panic("%s: cannot map %d segments\n", __func__, nseg); bus_dmamap_sync(sc->sc_buffer_dmat, sc->sc_dmamap, - sc->sc_datain ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE); + sc->sc_datain != 0 ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE); bus_write_4(sc->sc_res, L64854_REG_ADDR, segs[0].ds_addr); } -#define DMAMAX(a) (MAX_DMA_SZ - ((a) & (MAX_DMA_SZ - 1))) /* * setup a DMA transfer */ @@ -381,6 +393,7 @@ lsi64854_setup(struct lsi64854_softc *sc int datain, size_t *dmasize) { long bcnt; + int error; uint32_t csr; DMA_FLUSH(sc, 0); @@ -392,15 +405,12 @@ lsi64854_setup(struct lsi64854_softc *sc sc->sc_dmalen = len; sc->sc_datain = datain; - /* - * The rules say we cannot transfer more than the limit - * of this DMA chip (64k for old and 16Mb for new), - * and we cannot cross a 16Mb boundary. - */ - *dmasize = sc->sc_dmasize = - ulmin(*dmasize, DMAMAX((size_t)*sc->sc_dmaaddr)); + KASSERT(*dmasize <= sc->sc_maxdmasize, + ("%s: transfer size %ld too large", __func__, (long)*dmasize)); - DPRINTF(LDB_ANY, ("%s: dmasize=%ld\n", __func__, (long)sc->sc_dmasize)); + sc->sc_dmasize = *dmasize; + + DPRINTF(LDB_ANY, ("%s: dmasize=%ld\n", __func__, (long)*dmasize)); /* * XXX what length? @@ -412,24 +422,31 @@ lsi64854_setup(struct lsi64854_softc *sc bus_write_4(sc->sc_res, L64854_REG_CNT, *dmasize); } - /* Program the DMA address */ - if (sc->sc_dmasize != 0) - if (bus_dmamap_load(sc->sc_buffer_dmat, sc->sc_dmamap, - *sc->sc_dmaaddr, sc->sc_dmasize, lsi64854_map_scsi, sc, 0)) - panic("%s: cannot allocate DVMA address", __func__); + /* + * Load the transfer buffer and program the DMA address. + * Note that the NCR53C9x core can't handle EINPROGRESS so we set + * BUS_DMA_NOWAIT. + */ + if (*dmasize != 0) { + error = bus_dmamap_load(sc->sc_buffer_dmat, sc->sc_dmamap, + *sc->sc_dmaaddr, *dmasize, lsi64854_map_scsi, sc, + BUS_DMA_NOWAIT); + if (error != 0) + return (error); + } if (sc->sc_rev == DMAREV_ESC) { /* DMA ESC chip bug work-around */ - bcnt = sc->sc_dmasize; + bcnt = *dmasize; if (((bcnt + (long)*sc->sc_dmaaddr) & PAGE_MASK_8K) != 0) bcnt = roundup(bcnt, PAGE_SIZE_8K); bus_write_4(sc->sc_res, L64854_REG_CNT, bcnt); } - /* Setup DMA control register */ + /* Setup the DMA control register. */ csr = L64854_GCSR(sc); - if (datain) + if (datain != 0) csr |= L64854_WRITE; else csr &= ~L64854_WRITE; @@ -455,19 +472,23 @@ lsi64854_scsi_intr(void *arg) { struct lsi64854_softc *sc = arg; struct ncr53c9x_softc *nsc = sc->sc_client; - int trans, resid; + bus_dma_tag_t dmat; + bus_dmamap_t dmam; + size_t dmasize; + int lxfer, resid, trans; uint32_t csr; csr = L64854_GCSR(sc); DPRINTF(LDB_SCSI, ("%s: addr 0x%x, csr %b\n", __func__, - bus_read_4(sc->sc_res, L64854_REG_ADDR), csr, DDMACSR_BITS)); + bus_read_4(sc->sc_res, L64854_REG_ADDR), csr, DDMACSR_BITS)); - if (csr & (D_ERR_PEND|D_SLAVE_ERR)) { - device_printf(sc->sc_dev, "error: csr=%b\n", csr, DDMACSR_BITS); - csr &= ~D_EN_DMA; /* Stop DMA */ + if (csr & (D_ERR_PEND | D_SLAVE_ERR)) { + device_printf(sc->sc_dev, "error: csr=%b\n", csr, + DDMACSR_BITS); + csr &= ~D_EN_DMA; /* Stop DMA. */ /* Invalidate the queue; SLAVE_ERR bit is write-to-clear */ - csr |= D_INVALIDATE|D_SLAVE_ERR; + csr |= D_INVALIDATE | D_SLAVE_ERR; L64854_SCSR(sc, csr); return (-1); } @@ -483,10 +504,11 @@ lsi64854_scsi_intr(void *arg) L64854_SCSR(sc, csr); sc->sc_active = 0; - if (sc->sc_dmasize == 0) { - /* A "Transfer Pad" operation completed */ - DPRINTF(LDB_SCSI, ("%s: discarded %d bytes (tcl=%d, tcm=%d)\n", - __func__, NCR_READ_REG(nsc, NCR_TCL) | + dmasize = sc->sc_dmasize; + if (dmasize == 0) { + /* A "Transfer Pad" operation completed. */ + DPRINTF(LDB_SCSI, ("%s: discarded %d bytes (tcl=%d, " + "tcm=%d)\n", __func__, NCR_READ_REG(nsc, NCR_TCL) | (NCR_READ_REG(nsc, NCR_TCM) << 8), NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM))); return (0); @@ -499,7 +521,7 @@ lsi64854_scsi_intr(void *arg) * as residual since the NCR53C9X counter registers get decremented * as bytes are clocked into the FIFO. */ - if (!(csr & D_WRITE) && + if ((csr & D_WRITE) == 0 && (resid = (NCR_READ_REG(nsc, NCR_FFLAG) & NCRFIFO_FF)) != 0) { DPRINTF(LDB_SCSI, ("%s: empty esp FIFO of %d ", __func__, resid)); @@ -509,22 +531,21 @@ lsi64854_scsi_intr(void *arg) } if ((nsc->sc_espstat & NCRSTAT_TC) == 0) { + lxfer = nsc->sc_features & NCR_F_LARGEXFER; /* - * `Terminal count' is off, so read the residue + * "Terminal count" is off, so read the residue * out of the NCR53C9X counter registers. */ resid += (NCR_READ_REG(nsc, NCR_TCL) | (NCR_READ_REG(nsc, NCR_TCM) << 8) | - ((nsc->sc_cfg2 & NCRCFG2_FE) ? - (NCR_READ_REG(nsc, NCR_TCH) << 16) : 0)); + (lxfer != 0 ? (NCR_READ_REG(nsc, NCR_TCH) << 16) : 0)); - if (resid == 0 && sc->sc_dmasize == 65536 && - (nsc->sc_cfg2 & NCRCFG2_FE) == 0) - /* A transfer of 64K is encoded as `TCL=TCM=0' */ + if (resid == 0 && dmasize == 65536 && lxfer == 0) + /* A transfer of 64k is encoded as TCL=TCM=0. */ resid = 65536; } - trans = sc->sc_dmasize - resid; + trans = dmasize - resid; if (trans < 0) { /* transferred < 0? */ #if 0 /* @@ -533,21 +554,22 @@ lsi64854_scsi_intr(void *arg) * another target. As such, don't print the warning. */ device_printf(sc->sc_dev, "xfer (%d) > req (%d)\n", trans, - sc->sc_dmasize); + dmasize); #endif - trans = sc->sc_dmasize; + trans = dmasize; } DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_cfg2 & NCRCFG2_FE) ? NCR_READ_REG(nsc, NCR_TCH) : 0, - trans, resid)); + (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); - if (sc->sc_dmasize != 0) { - bus_dmamap_sync(sc->sc_buffer_dmat, sc->sc_dmamap, - (csr & D_WRITE) != 0 ? BUS_DMASYNC_POSTREAD : - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->sc_buffer_dmat, sc->sc_dmamap); + if (dmasize != 0) { + dmat = sc->sc_buffer_dmat; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 21:19:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 447C4106566B; Sun, 30 Oct 2011 21:19:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34E158FC08; Sun, 30 Oct 2011 21:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9ULJEjt085331; Sun, 30 Oct 2011 21:19:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9ULJEuU085329; Sun, 30 Oct 2011 21:19:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110302119.p9ULJEuU085329@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 21:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226948 - head/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:19:14 -0000 Author: marius Date: Sun Oct 30 21:19:13 2011 New Revision: 226948 URL: http://svn.freebsd.org/changeset/base/226948 Log: Correct the DMA constraints, the LSI64854 isn't limited to 32-bit DMA. Modified: head/sys/sparc64/sbus/dma_sbus.c Modified: head/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- head/sys/sparc64/sbus/dma_sbus.c Sun Oct 30 21:17:42 2011 (r226947) +++ head/sys/sparc64/sbus/dma_sbus.c Sun Oct 30 21:19:13 2011 (r226948) @@ -233,9 +233,9 @@ dma_attach(device_t dev) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - 0, /* nsegments */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* no locking */ &lsc->sc_parent_dmat); From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 21:42:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83921106564A; Sun, 30 Oct 2011 21:42:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73FCE8FC14; Sun, 30 Oct 2011 21:42:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9ULgZ4A086049; Sun, 30 Oct 2011 21:42:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9ULgZTD086047; Sun, 30 Oct 2011 21:42:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110302142.p9ULgZTD086047@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 21:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226949 - head/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:42:35 -0000 Author: marius Date: Sun Oct 30 21:42:35 2011 New Revision: 226949 URL: http://svn.freebsd.org/changeset/base/226949 Log: Actually, limit to 32-bit DMA for the transfer buffers as the address is written into a 32-bit register. Modified: head/sys/sparc64/sbus/lsi64854.c Modified: head/sys/sparc64/sbus/lsi64854.c ============================================================================== --- head/sys/sparc64/sbus/lsi64854.c Sun Oct 30 21:19:13 2011 (r226948) +++ head/sys/sparc64/sbus/lsi64854.c Sun Oct 30 21:42:35 2011 (r226949) @@ -161,7 +161,7 @@ lsi64854_attach(struct lsi64854_softc *s error = bus_dma_tag_create( sc->sc_parent_dmat, /* parent */ 1, BOUNDARY, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sc->sc_maxdmasize, /* maxsize */ @@ -462,7 +462,7 @@ lsi64854_setup(struct lsi64854_softc *sc /* * Pseudo (chained) interrupt from the esp driver to kick the - * current running DMA transfer. Called from ncr53c9x_intr() + * current running DMA transfer. Called from ncr53c9x_intr() * for now. * * return 1 if it was a DMA continue. From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 21:45:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA9B01065677; Sun, 30 Oct 2011 21:45:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB2408FC21; Sun, 30 Oct 2011 21:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9ULjaAg086182; Sun, 30 Oct 2011 21:45:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9ULjaWB086180; Sun, 30 Oct 2011 21:45:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201110302145.p9ULjaWB086180@svn.freebsd.org> From: Marius Strobl Date: Sun, 30 Oct 2011 21:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226950 - head/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 21:45:36 -0000 Author: marius Date: Sun Oct 30 21:45:36 2011 New Revision: 226950 URL: http://svn.freebsd.org/changeset/base/226950 Log: Add multiple inclusion protection. Modified: head/sys/dev/esp/ncr53c9xreg.h Modified: head/sys/dev/esp/ncr53c9xreg.h ============================================================================== --- head/sys/dev/esp/ncr53c9xreg.h Sun Oct 30 21:42:35 2011 (r226949) +++ head/sys/dev/esp/ncr53c9xreg.h Sun Oct 30 21:45:36 2011 (r226950) @@ -31,6 +31,9 @@ /* $FreeBSD$ */ +#ifndef _NCR53C9XREG_H_ +#define _NCR53C9XREG_H_ + /* * Register addresses, relative to some base address */ @@ -288,3 +291,4 @@ #define NCRFAS_STAT2_OSHUTTLE 0x40 /* next byte from FIFO is MSB */ #define NCRFAS_STAT2_EMPTY 0x80 /* FIFO is empty */ +#endif /* _NCR53C9XREG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 30 22:20:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75A721065670; Sun, 30 Oct 2011 22:20:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6554B8FC0C; Sun, 30 Oct 2011 22:20:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UMKHOH087328; Sun, 30 Oct 2011 22:20:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UMKHD9087326; Sun, 30 Oct 2011 22:20:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201110302220.p9UMKHD9087326@svn.freebsd.org> From: Dimitry Andric Date: Sun, 30 Oct 2011 22:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226951 - head/contrib/llvm/tools/clang/lib/Basic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 22:20:17 -0000 Author: dim Date: Sun Oct 30 22:20:17 2011 New Revision: 226951 URL: http://svn.freebsd.org/changeset/base/226951 Log: Pull in r143305 and r143312 from upstream clang trunk, so using "clang -march=native" on AMD K10 family processors no longer errors out with "unknown target CPU 'amdfam10'". This also enables use of SSE4A. Reported by: David Marec MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sun Oct 30 21:45:36 2011 (r226950) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sun Oct 30 22:20:17 2011 (r226951) @@ -1282,6 +1282,7 @@ class X86TargetInfo : public TargetInfo CK_K8SSE3, CK_Opteron, CK_OpteronSSE3, + CK_AMDFAM10, /// This specification is deprecated and will be removed in the future. /// Users should prefer \see CK_K8. @@ -1381,6 +1382,7 @@ public: .Case("k8-sse3", CK_K8SSE3) .Case("opteron", CK_Opteron) .Case("opteron-sse3", CK_OpteronSSE3) + .Case("amdfam10", CK_AMDFAM10) .Case("x86-64", CK_x86_64) .Case("geode", CK_Geode) .Default(CK_Generic); @@ -1441,6 +1443,7 @@ public: case CK_K8SSE3: case CK_Opteron: case CK_OpteronSSE3: + case CK_AMDFAM10: case CK_x86_64: return true; } @@ -1459,12 +1462,10 @@ void X86TargetInfo::getDefaultFeatures(l Features["ssse3"] = false; Features["sse41"] = false; Features["sse42"] = false; + Features["sse4a"] = false; Features["aes"] = false; Features["avx"] = false; - // LLVM does not currently recognize this. - // Features["sse4a"] = false; - // FIXME: This *really* should not be here. // X86_64 always has SSE2. @@ -1561,6 +1562,11 @@ void X86TargetInfo::getDefaultFeatures(l setFeatureEnabled(Features, "sse3", true); setFeatureEnabled(Features, "3dnowa", true); break; + case CK_AMDFAM10: + setFeatureEnabled(Features, "sse3", true); + setFeatureEnabled(Features, "sse4a", true); + setFeatureEnabled(Features, "3dnowa", true); + break; case CK_C3_2: setFeatureEnabled(Features, "mmx", true); setFeatureEnabled(Features, "sse", true); @@ -1604,6 +1610,8 @@ bool X86TargetInfo::setFeatureEnabled(ll else if (Name == "avx") Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = Features["sse41"] = Features["sse42"] = true; + else if (Name == "sse4a") + Features["sse4a"] = true; } else { if (Name == "mmx") Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false; @@ -1630,6 +1638,8 @@ bool X86TargetInfo::setFeatureEnabled(ll Features["aes"] = false; else if (Name == "avx") Features["avx"] = false; + else if (Name == "sse4a") + Features["sse4a"] = false; } return true; @@ -1826,6 +1836,11 @@ void X86TargetInfo::getTargetDefines(con Builder.defineMacro("__k8__"); Builder.defineMacro("__tune_k8__"); break; + case CK_AMDFAM10: + Builder.defineMacro("__amdfam10"); + Builder.defineMacro("__amdfam10__"); + Builder.defineMacro("__tune_amdfam10__"); + break; case CK_Geode: Builder.defineMacro("__geode"); Builder.defineMacro("__geode__"); From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 03:47:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EBF6106564A; Mon, 31 Oct 2011 03:47:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0938FC08; Mon, 31 Oct 2011 03:47:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V3lNs1097588; Mon, 31 Oct 2011 03:47:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V3lNTZ097586; Mon, 31 Oct 2011 03:47:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201110310347.p9V3lNTZ097586@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 31 Oct 2011 03:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226956 - stable/9/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 03:47:23 -0000 Author: marcel Date: Mon Oct 31 03:47:23 2011 New Revision: 226956 URL: http://svn.freebsd.org/changeset/base/226956 Log: MFC r226647: Add support for Boot Camp. The support is defined as follows: o Detect when Boot Camp is enabled (i.e. the MBR mirrors the GPT). o When Boot Camp is enabled, update the MBR whenever we write the GPT. o Creation of a Boot Camp enabled GPT is not supported. o Automatically disable Boot Camp when the GPT has been changed so that there's either no EFI partition or no HFS+ partition. o The first 4 partitions (by index) get mirrored in the MBR. Requested by, discussed with and tested by: kris@pcbsd.org Approved by: re (bz@, kib@) Modified: stable/9/sys/geom/part/g_part_gpt.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/9/sys/geom/part/g_part_gpt.c Mon Oct 31 02:43:36 2011 (r226955) +++ stable/9/sys/geom/part/g_part_gpt.c Mon Oct 31 03:47:23 2011 (r226956) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002, 2005, 2006, 2007 Marcel Moolenaar + * Copyright (c) 2002, 2005-2007, 2011 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,6 +79,7 @@ struct g_part_gpt_table { struct gpt_hdr *hdr; quad_t lba[GPT_ELT_COUNT]; enum gpt_state state[GPT_ELT_COUNT]; + int bootcamp; }; struct g_part_gpt_entry { @@ -178,41 +179,165 @@ static struct uuid gpt_uuid_unused = GPT static struct g_part_uuid_alias { struct uuid *uuid; int alias; + int mbrtype; } gpt_uuid_alias_match[] = { - { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT }, - { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS }, - { &gpt_uuid_apple_label, G_PART_ALIAS_APPLE_LABEL }, - { &gpt_uuid_apple_raid, G_PART_ALIAS_APPLE_RAID }, - { &gpt_uuid_apple_raid_offline, G_PART_ALIAS_APPLE_RAID_OFFLINE }, - { &gpt_uuid_apple_tv_recovery, G_PART_ALIAS_APPLE_TV_RECOVERY }, - { &gpt_uuid_apple_ufs, G_PART_ALIAS_APPLE_UFS }, - { &gpt_uuid_bios_boot, G_PART_ALIAS_BIOS_BOOT }, - { &gpt_uuid_efi, G_PART_ALIAS_EFI }, - { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD }, - { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT }, - { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP }, - { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS }, - { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM }, - { &gpt_uuid_freebsd_zfs, G_PART_ALIAS_FREEBSD_ZFS }, - { &gpt_uuid_linux_data, G_PART_ALIAS_LINUX_DATA }, - { &gpt_uuid_linux_lvm, G_PART_ALIAS_LINUX_LVM }, - { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID }, - { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP }, - { &gpt_uuid_mbr, G_PART_ALIAS_MBR }, - { &gpt_uuid_ms_basic_data, G_PART_ALIAS_MS_BASIC_DATA }, - { &gpt_uuid_ms_ldm_data, G_PART_ALIAS_MS_LDM_DATA }, - { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA }, - { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED }, - { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD }, - { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD }, - { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS }, - { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS }, - { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID }, - { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP }, - - { NULL, 0 } + { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, + { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, + { &gpt_uuid_apple_label, G_PART_ALIAS_APPLE_LABEL, 0 }, + { &gpt_uuid_apple_raid, G_PART_ALIAS_APPLE_RAID, 0 }, + { &gpt_uuid_apple_raid_offline, G_PART_ALIAS_APPLE_RAID_OFFLINE, 0 }, + { &gpt_uuid_apple_tv_recovery, G_PART_ALIAS_APPLE_TV_RECOVERY, 0 }, + { &gpt_uuid_apple_ufs, G_PART_ALIAS_APPLE_UFS, 0 }, + { &gpt_uuid_bios_boot, G_PART_ALIAS_BIOS_BOOT, 0 }, + { &gpt_uuid_efi, G_PART_ALIAS_EFI, 0xee }, + { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD, 0xa5 }, + { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT, 0 }, + { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP, 0 }, + { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS, 0 }, + { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM, 0 }, + { &gpt_uuid_freebsd_zfs, G_PART_ALIAS_FREEBSD_ZFS, 0 }, + { &gpt_uuid_linux_data, G_PART_ALIAS_LINUX_DATA, 0x0b }, + { &gpt_uuid_linux_lvm, G_PART_ALIAS_LINUX_LVM, 0 }, + { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID, 0 }, + { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP, 0 }, + { &gpt_uuid_mbr, G_PART_ALIAS_MBR, 0 }, + { &gpt_uuid_ms_basic_data, G_PART_ALIAS_MS_BASIC_DATA, 0x0b }, + { &gpt_uuid_ms_ldm_data, G_PART_ALIAS_MS_LDM_DATA, 0 }, + { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA, 0 }, + { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED, 0 }, + { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD, 0 }, + { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD, 0 }, + { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS, 0 }, + { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS, 0 }, + { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID, 0 }, + { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP, 0 }, + { NULL, 0, 0 } }; +static int +gpt_write_mbr_entry(u_char *mbr, int idx, int typ, quad_t start, + quad_t end) +{ + + if (typ == 0 || start > UINT32_MAX || end > UINT32_MAX) + return (EINVAL); + + mbr += DOSPARTOFF + idx * DOSPARTSIZE; + mbr[0] = 0; + if (start == 1) { + /* + * Treat the PMBR partition specially to maximize + * interoperability with BIOSes. + */ + mbr[1] = mbr[3] = 0; + mbr[2] = 2; + } else + mbr[1] = mbr[2] = mbr[3] = 0xff; + mbr[4] = typ; + mbr[5] = mbr[6] = mbr[7] = 0xff; + le32enc(mbr + 8, (uint32_t)start); + le32enc(mbr + 12, (uint32_t)(end - start + 1)); + return (0); +} + +static int +gpt_map_type(struct uuid *t) +{ + struct g_part_uuid_alias *uap; + + for (uap = &gpt_uuid_alias_match[0]; uap->uuid; uap++) { + if (EQUUID(t, uap->uuid)) + return (uap->mbrtype); + } + return (0); +} + +/* + * Under Boot Camp the PMBR partition (type 0xEE) doesn't cover the + * whole disk anymore. Rather, it covers the GPT table and the EFI + * system partition only. This way the HFS+ partition and any FAT + * partitions can be added to the MBR without creating an overlap. + */ +static int +gpt_is_bootcamp(struct g_part_gpt_table *table, const char *provname) +{ + uint8_t *p; + + p = table->mbr + DOSPARTOFF; + if (p[4] != 0xee || le32dec(p + 8) != 1) + return (0); + + p += DOSPARTSIZE; + if (p[4] != 0xaf) + return (0); + + printf("GEOM: %s: enabling Boot Camp\n", provname); + return (1); +} + +static void +gpt_update_bootcamp(struct g_part_table *basetable) +{ + struct g_part_entry *baseentry; + struct g_part_gpt_entry *entry; + struct g_part_gpt_table *table; + int bootable, error, index, slices, typ; + + table = (struct g_part_gpt_table *)basetable; + + bootable = -1; + for (index = 0; index < NDOSPART; index++) { + if (table->mbr[DOSPARTOFF + DOSPARTSIZE * index]) + bootable = index; + } + + bzero(table->mbr + DOSPARTOFF, DOSPARTSIZE * NDOSPART); + slices = 0; + LIST_FOREACH(baseentry, &basetable->gpt_entry, gpe_entry) { + if (baseentry->gpe_deleted) + continue; + index = baseentry->gpe_index - 1; + if (index >= NDOSPART) + continue; + + entry = (struct g_part_gpt_entry *)baseentry; + + switch (index) { + case 0: /* This must be the EFI system partition. */ + if (!EQUUID(&entry->ent.ent_type, &gpt_uuid_efi)) + goto disable; + error = gpt_write_mbr_entry(table->mbr, index, 0xee, + 1ull, entry->ent.ent_lba_end); + break; + case 1: /* This must be the HFS+ partition. */ + if (!EQUUID(&entry->ent.ent_type, &gpt_uuid_apple_hfs)) + goto disable; + error = gpt_write_mbr_entry(table->mbr, index, 0xaf, + entry->ent.ent_lba_start, entry->ent.ent_lba_end); + break; + default: + typ = gpt_map_type(&entry->ent.ent_type); + error = gpt_write_mbr_entry(table->mbr, index, typ, + entry->ent.ent_lba_start, entry->ent.ent_lba_end); + break; + } + if (error) + continue; + + if (index == bootable) + table->mbr[DOSPARTOFF + DOSPARTSIZE * index] = 0x80; + slices |= 1 << index; + } + if ((slices & 3) == 3) + return; + + disable: + table->bootcamp = 0; + bzero(table->mbr + DOSPARTOFF, DOSPARTSIZE * NDOSPART); + gpt_write_mbr_entry(table->mbr, 0, 0xee, 1ull, + MIN(table->lba[GPT_ELT_SECHDR], UINT32_MAX)); +} + static struct gpt_hdr * gpt_read_hdr(struct g_part_gpt_table *table, struct g_consumer *cp, enum gpt_elt elt) @@ -457,8 +582,9 @@ g_part_gpt_bootcode(struct g_part_table if (codesz > 0) bcopy(gpp->gpp_codeptr, table->mbr, codesz); - /* Mark the PMBR active since some BIOS require it */ - table->mbr[DOSPARTOFF] = 0x80; /* status */ + /* Mark the PMBR active since some BIOS require it. */ + if (!table->bootcamp) + table->mbr[DOSPARTOFF] = 0x80; /* status */ return (0); } @@ -486,15 +612,7 @@ g_part_gpt_create(struct g_part_table *b last = (pp->mediasize / pp->sectorsize) - 1; le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC); - table->mbr[DOSPARTOFF + 1] = 0x01; /* shd */ - table->mbr[DOSPARTOFF + 2] = 0x01; /* ssect */ - table->mbr[DOSPARTOFF + 3] = 0x00; /* scyl */ - table->mbr[DOSPARTOFF + 4] = 0xee; /* typ */ - table->mbr[DOSPARTOFF + 5] = 0xff; /* ehd */ - table->mbr[DOSPARTOFF + 6] = 0xff; /* esect */ - table->mbr[DOSPARTOFF + 7] = 0xff; /* ecyl */ - le32enc(table->mbr + DOSPARTOFF + 8, 1); /* start */ - le32enc(table->mbr + DOSPARTOFF + 12, MIN(last, UINT32_MAX)); + gpt_write_mbr_entry(table->mbr, 0, 0xee, 1, MIN(last, UINT32_MAX)); /* Allocate space for the header */ table->hdr = g_malloc(sizeof(struct gpt_hdr), M_WAITOK | M_ZERO); @@ -802,6 +920,21 @@ g_part_gpt_read(struct g_part_table *bas } g_free(tbl); + + /* + * Under Mac OS X, the MBR mirrors the first 4 GPT partitions + * if (and only if) any FAT32 or FAT16 partitions have been + * created. This happens irrespective of whether Boot Camp is + * used/enabled, though it's generally understood to be done + * to support legacy Windows under Boot Camp. We refer to this + * mirroring simply as Boot Camp. We try to detect Boot Camp + * so that we can update the MBR if and when GPT changes have + * been made. Note that we do not enable Boot Camp if not + * previously enabled because we can't assume that we're on a + * Mac alongside Mac OS X. + */ + table->bootcamp = gpt_is_bootcamp(table, pp->name); + return (0); } @@ -816,73 +949,52 @@ g_part_gpt_recover(struct g_part_table * } static int -g_part_gpt_setunset(struct g_part_table *table, struct g_part_entry *baseentry, - const char *attrib, unsigned int set) +g_part_gpt_setunset(struct g_part_table *basetable, + struct g_part_entry *baseentry, const char *attrib, unsigned int set) { - struct g_part_entry *iter; struct g_part_gpt_entry *entry; - int changed, bootme, bootonce, bootfailed; + struct g_part_gpt_table *table; + uint64_t attr; + int i; - bootme = bootonce = bootfailed = 0; + table = (struct g_part_gpt_table *)basetable; + entry = (struct g_part_gpt_entry *)baseentry; + + if (strcasecmp(attrib, "active") == 0) { + if (!table->bootcamp || baseentry->gpe_index > NDOSPART) + return (EINVAL); + for (i = 0; i < NDOSPART; i++) { + table->mbr[DOSPARTOFF + i * DOSPARTSIZE] = + (i == baseentry->gpe_index - 1) ? 0x80 : 0; + } + return (0); + } + + attr = 0; if (strcasecmp(attrib, "bootme") == 0) { - bootme = 1; + attr |= GPT_ENT_ATTR_BOOTME; } else if (strcasecmp(attrib, "bootonce") == 0) { - /* BOOTME is set automatically with BOOTONCE, but not unset. */ - bootonce = 1; + attr |= GPT_ENT_ATTR_BOOTONCE; if (set) - bootme = 1; + attr |= GPT_ENT_ATTR_BOOTME; } else if (strcasecmp(attrib, "bootfailed") == 0) { /* * It should only be possible to unset BOOTFAILED, but it might * be useful for test purposes to also be able to set it. */ - bootfailed = 1; + attr |= GPT_ENT_ATTR_BOOTFAILED; } - if (!bootme && !bootonce && !bootfailed) + if (attr == 0) return (EINVAL); - LIST_FOREACH(iter, &table->gpt_entry, gpe_entry) { - if (iter->gpe_deleted) - continue; - if (iter != baseentry) - continue; - changed = 0; - entry = (struct g_part_gpt_entry *)iter; - if (set) { - if (bootme && - !(entry->ent.ent_attr & GPT_ENT_ATTR_BOOTME)) { - entry->ent.ent_attr |= GPT_ENT_ATTR_BOOTME; - changed = 1; - } - if (bootonce && - !(entry->ent.ent_attr & GPT_ENT_ATTR_BOOTONCE)) { - entry->ent.ent_attr |= GPT_ENT_ATTR_BOOTONCE; - changed = 1; - } - if (bootfailed && - !(entry->ent.ent_attr & GPT_ENT_ATTR_BOOTFAILED)) { - entry->ent.ent_attr |= GPT_ENT_ATTR_BOOTFAILED; - changed = 1; - } - } else { - if (bootme && - (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTME)) { - entry->ent.ent_attr &= ~GPT_ENT_ATTR_BOOTME; - changed = 1; - } - if (bootonce && - (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTONCE)) { - entry->ent.ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; - changed = 1; - } - if (bootfailed && - (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTFAILED)) { - entry->ent.ent_attr &= ~GPT_ENT_ATTR_BOOTFAILED; - changed = 1; - } - } - if (changed && !iter->gpe_created) - iter->gpe_modified = 1; + if (set) + attr = entry->ent.ent_attr | attr; + else + attr = entry->ent.ent_attr & ~attr; + if (attr != entry->ent.ent_attr) { + entry->ent.ent_attr = attr; + if (!baseentry->gpe_created) + baseentry->gpe_modified = 1; } return (0); } @@ -923,6 +1035,10 @@ g_part_gpt_write(struct g_part_table *ba tblsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + pp->sectorsize - 1) / pp->sectorsize; + /* Reconstruct the MBR from the GPT if under Boot Camp. */ + if (table->bootcamp) + gpt_update_bootcamp(basetable); + /* Write the PMBR */ buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); bcopy(table->mbr, buf, MBRSIZE); From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 04:25:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 811AB106568D; Mon, 31 Oct 2011 04:25:26 +0000 (UTC) Date: Mon, 31 Oct 2011 04:25:26 +0000 From: Alexey Dokuchaev To: Marius Strobl Message-ID: <20111031042526.GA57014@FreeBSD.org> References: <201110302117.p9ULHgLD085245@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201110302117.p9ULHgLD085245@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226947 - in head/sys: dev/esp sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 04:25:26 -0000 On Sun, Oct 30, 2011 at 09:17:42PM +0000, Marius Strobl wrote: > Author: marius > Date: Sun Oct 30 21:17:42 2011 > New Revision: 226947 > URL: http://svn.freebsd.org/changeset/base/226947 > > Log: > - Use device_t rather than the NetBSDish struct device. Hmm, I though that style(9) advises against this practice: Avoid using typedefs for structure types. Typedefs are problematic because they do not properly hide their underlying type; [...] When convention requires a typedef, make its name match the struct tag. Avoid typedefs ending in _t, except as specified in Standard C or by POSIX. Does these rules not apply for struct device for some reason? ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 05:11:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FF4E106564A; Mon, 31 Oct 2011 05:11:19 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 3EC0A8FC17; Mon, 31 Oct 2011 05:11:18 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p9V4VEYi089679 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 30 Oct 2011 21:31:19 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4EAE248E.1060507@freebsd.org> Date: Sun, 30 Oct 2011 21:31:10 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.23) Gecko/20110920 Thunderbird/3.1.15 MIME-Version: 1.0 To: Alexey Dokuchaev References: <201110302117.p9ULHgLD085245@svn.freebsd.org> <20111031042526.GA57014@FreeBSD.org> In-Reply-To: <20111031042526.GA57014@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r226947 - in head/sys: dev/esp sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 05:11:19 -0000 On 10/30/11 9:25 PM, Alexey Dokuchaev wrote: > On Sun, Oct 30, 2011 at 09:17:42PM +0000, Marius Strobl wrote: >> Author: marius >> Date: Sun Oct 30 21:17:42 2011 >> New Revision: 226947 >> URL: http://svn.freebsd.org/changeset/base/226947 >> >> Log: >> - Use device_t rather than the NetBSDish struct device. > Hmm, I though that style(9) advises against this practice: > > Avoid using typedefs for structure types. Typedefs are problematic > because they do not properly hide their underlying type; [...] > > When convention requires a typedef, make its name match the struct tag. > Avoid typedefs ending in _t, except as specified in Standard C or by > POSIX. > > Does these rules not apply for struct device for some reason? > > ./danfe > I agree we should be trying to get rid of the blah_t horrors. I think this went the wrong direction. From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 08:48:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC7E11065670; Mon, 31 Oct 2011 08:48:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A20608FC15; Mon, 31 Oct 2011 08:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V8mRd9007036; Mon, 31 Oct 2011 08:48:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V8mRlu007034; Mon, 31 Oct 2011 08:48:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201110310848.p9V8mRlu007034@svn.freebsd.org> From: Michael Tuexen Date: Mon, 31 Oct 2011 08:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226960 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 08:48:27 -0000 Author: tuexen Date: Mon Oct 31 08:48:27 2011 New Revision: 226960 URL: http://svn.freebsd.org/changeset/base/226960 Log: MFC 226868: Send out control chunks which have no specific destination. Approved by: re@ Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Mon Oct 31 08:32:36 2011 (r226959) +++ stable/9/sys/netinet/sctp_output.c Mon Oct 31 08:48:27 2011 (r226960) @@ -8003,12 +8003,20 @@ again_one_more_time: if (chk->rec.chunk_id.id != SCTP_ASCONF) { continue; } - if (chk->whoTo != net) { - /* - * No, not sent to the network we are - * looking at - */ - break; + if (chk->whoTo == NULL) { + if (asoc->alternate == NULL) { + if (asoc->primary_destination != net) { + break; + } + } else { + if (asoc->alternate != net) { + break; + } + } + } else { + if (chk->whoTo != net) { + break; + } } if (chk->data == NULL) { break; @@ -8092,6 +8100,10 @@ again_one_more_time: */ no_data_chunks = 1; chk->sent = SCTP_DATAGRAM_SENT; + if (chk->whoTo == NULL) { + chk->whoTo = net; + atomic_add_int(&net->ref_count, 1); + } chk->snd_count++; if (mtu == 0) { /* @@ -8198,12 +8210,20 @@ again_one_more_time: goto skip_net_check; } } - if (chk->whoTo != net) { - /* - * No, not sent to the network we are - * looking at - */ - continue; + if (chk->whoTo == NULL) { + if (asoc->alternate == NULL) { + if (asoc->primary_destination != net) { + continue; + } + } else { + if (asoc->alternate != net) { + continue; + } + } + } else { + if (chk->whoTo != net) { + continue; + } } skip_net_check: if (chk->data == NULL) { @@ -8332,6 +8352,10 @@ again_one_more_time: SCTP_STAT_INCR(sctps_sendecne); } chk->sent = SCTP_DATAGRAM_SENT; + if (chk->whoTo == NULL) { + chk->whoTo = net; + atomic_add_int(&net->ref_count, 1); + } chk->snd_count++; } if (mtu == 0) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 08:59:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3CC7106566C; Mon, 31 Oct 2011 08:59:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B98AC8FC12; Mon, 31 Oct 2011 08:59:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V8xHm0007408; Mon, 31 Oct 2011 08:59:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V8xHSr007401; Mon, 31 Oct 2011 08:59:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201110310859.p9V8xHSr007401@svn.freebsd.org> From: Ed Schouten Date: Mon, 31 Oct 2011 08:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226961 - in head/bin: cat ln mkdir mv rm test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 08:59:17 -0000 Author: ed Date: Mon Oct 31 08:59:17 2011 New Revision: 226961 URL: http://svn.freebsd.org/changeset/base/226961 Log: Put some static keywords in the source code. For these simple utilities, it doesn't harm to make all global variables static. In fact, this allows the compiler to perform better forms of optimisation and analysis. Modified: head/bin/cat/cat.c head/bin/ln/ln.c head/bin/mkdir/mkdir.c head/bin/mv/mv.c head/bin/rm/rm.c head/bin/test/test.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Mon Oct 31 08:48:27 2011 (r226960) +++ head/bin/cat/cat.c Mon Oct 31 08:59:17 2011 (r226961) @@ -64,9 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include -int bflag, eflag, nflag, sflag, tflag, vflag; -int rval; -const char *filename; +static int bflag, eflag, nflag, sflag, tflag, vflag; +static int rval; +static const char *filename; static void usage(void); static void scanfiles(char *argv[], int cooked); Modified: head/bin/ln/ln.c ============================================================================== --- head/bin/ln/ln.c Mon Oct 31 08:48:27 2011 (r226960) +++ head/bin/ln/ln.c Mon Oct 31 08:59:17 2011 (r226961) @@ -54,16 +54,16 @@ __FBSDID("$FreeBSD$"); #include #include -int fflag; /* Unlink existing files. */ -int Fflag; /* Remove empty directories also. */ -int hflag; /* Check new name for symlink first. */ -int iflag; /* Interactive mode. */ -int Pflag; /* Create hard links to symlinks. */ -int sflag; /* Symbolic, not hard, link. */ -int vflag; /* Verbose output. */ -int wflag; /* Warn if symlink target does not +static int fflag; /* Unlink existing files. */ +static int Fflag; /* Remove empty directories also. */ +static int hflag; /* Check new name for symlink first. */ +static int iflag; /* Interactive mode. */ +static int Pflag; /* Create hard links to symlinks. */ +static int sflag; /* Symbolic, not hard, link. */ +static int vflag; /* Verbose output. */ +static int wflag; /* Warn if symlink target does not * exist, and -f is not enabled. */ -char linkch; +static char linkch; int linkit(const char *, const char *, int); void usage(void); Modified: head/bin/mkdir/mkdir.c ============================================================================== --- head/bin/mkdir/mkdir.c Mon Oct 31 08:48:27 2011 (r226960) +++ head/bin/mkdir/mkdir.c Mon Oct 31 08:59:17 2011 (r226961) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static int build(char *, mode_t); static void usage(void); -int vflag; +static int vflag; int main(int argc, char *argv[]) Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Mon Oct 31 08:48:27 2011 (r226960) +++ head/bin/mv/mv.c Mon Oct 31 08:59:17 2011 (r226961) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); /* Exit code for a failed exec. */ #define EXEC_FAILED 127 -int fflg, iflg, nflg, vflg; +static int fflg, iflg, nflg, vflg; static int copy(const char *, const char *); static int do_move(const char *, const char *); Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Mon Oct 31 08:48:27 2011 (r226960) +++ head/bin/rm/rm.c Mon Oct 31 08:59:17 2011 (r226961) @@ -57,10 +57,10 @@ __FBSDID("$FreeBSD$"); #include #include -int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; -int rflag, Iflag; -uid_t uid; -volatile sig_atomic_t info; +static int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; +static int rflag, Iflag; +static uid_t uid; +static volatile sig_atomic_t info; int check(char *, char *, struct stat *); int check2(char **); Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Mon Oct 31 08:48:27 2011 (r226960) +++ head/bin/test/test.c Mon Oct 31 08:59:17 2011 (r226961) @@ -118,7 +118,7 @@ enum token_types { PAREN }; -struct t_op { +static struct t_op { const char *op_text; short op_num, op_type; } const ops [] = { @@ -165,10 +165,10 @@ struct t_op { {0, 0, 0} }; -struct t_op const *t_wp_op; -int nargc; -char **t_wp; -int parenlevel; +static struct t_op const *t_wp_op; +static int nargc; +static char **t_wp; +static int parenlevel; static int aexpr(enum token); static int binop(void); From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 09:18:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77277106564A; Mon, 31 Oct 2011 09:18:01 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 663DB8FC08; Mon, 31 Oct 2011 09:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V9I1OG008050; Mon, 31 Oct 2011 09:18:01 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V9I1fR008048; Mon, 31 Oct 2011 09:18:01 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201110310918.p9V9I1fR008048@svn.freebsd.org> From: Peter Holm Date: Mon, 31 Oct 2011 09:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226963 - stable/9/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 09:18:01 -0000 Author: pho Date: Mon Oct 31 09:18:01 2011 New Revision: 226963 URL: http://svn.freebsd.org/changeset/base/226963 Log: MFC r226681: Only unlock if the lock is exclusive. Approved by: re (kib) PR: kern/161956 Modified: stable/9/sys/fs/nullfs/null_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vfsops.c Mon Oct 31 09:06:33 2011 (r226962) +++ stable/9/sys/fs/nullfs/null_vfsops.c Mon Oct 31 09:18:01 2011 (r226963) @@ -104,11 +104,10 @@ nullfs_mount(struct mount *mp) return (EINVAL); /* - * Unlock lower node to avoid deadlock. - * (XXX) VOP_ISLOCKED is needed? + * Unlock lower node to avoid possible deadlock. */ if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) && - VOP_ISLOCKED(mp->mnt_vnodecovered)) { + VOP_ISLOCKED(mp->mnt_vnodecovered) == LK_EXCLUSIVE) { VOP_UNLOCK(mp->mnt_vnodecovered, 0); isvnunlocked = 1; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 09:22:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52838106564A; Mon, 31 Oct 2011 09:22:10 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41C1B8FC17; Mon, 31 Oct 2011 09:22:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V9MA6W008221; Mon, 31 Oct 2011 09:22:10 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V9MAsF008219; Mon, 31 Oct 2011 09:22:10 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201110310922.p9V9MAsF008219@svn.freebsd.org> From: Peter Holm Date: Mon, 31 Oct 2011 09:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226964 - stable/8/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 09:22:10 -0000 Author: pho Date: Mon Oct 31 09:22:09 2011 New Revision: 226964 URL: http://svn.freebsd.org/changeset/base/226964 Log: MFC r226681: Only unlock if the lock is exclusive. PR: kern/161956 Modified: stable/8/sys/fs/nullfs/null_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/8/sys/fs/nullfs/null_vfsops.c Mon Oct 31 09:18:01 2011 (r226963) +++ stable/8/sys/fs/nullfs/null_vfsops.c Mon Oct 31 09:22:09 2011 (r226964) @@ -104,11 +104,10 @@ nullfs_mount(struct mount *mp) return (EINVAL); /* - * Unlock lower node to avoid deadlock. - * (XXX) VOP_ISLOCKED is needed? + * Unlock lower node to avoid possible deadlock. */ if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) && - VOP_ISLOCKED(mp->mnt_vnodecovered)) { + VOP_ISLOCKED(mp->mnt_vnodecovered) == LK_EXCLUSIVE) { VOP_UNLOCK(mp->mnt_vnodecovered, 0); isvnunlocked = 1; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 09:27:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D63B106566C; Mon, 31 Oct 2011 09:27:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C7148FC14; Mon, 31 Oct 2011 09:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V9RBpF008414; Mon, 31 Oct 2011 09:27:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V9RBYp008412; Mon, 31 Oct 2011 09:27:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201110310927.p9V9RBYp008412@svn.freebsd.org> From: Michael Tuexen Date: Mon, 31 Oct 2011 09:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226965 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 09:27:11 -0000 Author: tuexen Date: Mon Oct 31 09:27:10 2011 New Revision: 226965 URL: http://svn.freebsd.org/changeset/base/226965 Log: MFC 226869: When adding a new remote address using sctp_add_remote_addr(), return the correct net if requested. Approved by: re@ Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Mon Oct 31 09:22:09 2011 (r226964) +++ stable/9/sys/netinet/sctp_pcb.c Mon Oct 31 09:27:10 2011 (r226965) @@ -4138,6 +4138,9 @@ sctp_add_remote_addr(struct sctp_tcb *st #ifdef INVARIANTS net->flowidset = 1; #endif + if (netp) { + *netp = net; + } netfirst = TAILQ_FIRST(&stcb->asoc.nets); if (net->ro.ro_rt == NULL) { /* Since we have no route put it at the back */ @@ -4209,9 +4212,6 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); } - if (netp) { - *netp = net; - } return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 10:53:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C489106566B; Mon, 31 Oct 2011 10:53:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9308FC08; Mon, 31 Oct 2011 10:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9VArRMf013181; Mon, 31 Oct 2011 10:53:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9VArRK2013179; Mon, 31 Oct 2011 10:53:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201110311053.p9VArRK2013179@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 31 Oct 2011 10:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226966 - head/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 10:53:27 -0000 Author: ae Date: Mon Oct 31 10:53:27 2011 New Revision: 226966 URL: http://svn.freebsd.org/changeset/base/226966 Log: Add information about MD_READONLY and MD_COMPRESS flags to the configuration dump. MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Oct 31 09:27:10 2011 (r226965) +++ head/sys/dev/md/md.c Mon Oct 31 10:53:27 2011 (r226966) @@ -1370,6 +1370,11 @@ g_md_dumpconf(struct sbuf *sb, const cha indent, (uintmax_t) mp->fwsectors); sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t) mp->mediasize); + sbuf_printf(sb, "%s%s\n", indent, + (mp->flags & MD_COMPRESS) == 0 ? "off": "on"); + sbuf_printf(sb, "%s%s\n", indent, + (mp->flags & MD_READONLY) == 0 ? "read-write": + "read-only"); sbuf_printf(sb, "%s%s\n", indent, type); if (mp->type == MD_VNODE && mp->vnode != NULL) From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 13:01:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9A731065674; Mon, 31 Oct 2011 13:01:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0058FC16; Mon, 31 Oct 2011 13:01:21 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p9VD1GY0025647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Nov 2011 00:01:18 +1100 Date: Tue, 1 Nov 2011 00:01:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexey Dokuchaev In-Reply-To: <20111031042526.GA57014@FreeBSD.org> Message-ID: <20111031233854.Y1523@besplex.bde.org> References: <201110302117.p9ULHgLD085245@svn.freebsd.org> <20111031042526.GA57014@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r226947 - in head/sys: dev/esp sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 13:01:22 -0000 On Mon, 31 Oct 2011, Alexey Dokuchaev wrote: > On Sun, Oct 30, 2011 at 09:17:42PM +0000, Marius Strobl wrote: >> Log: >> - Use device_t rather than the NetBSDish struct device. > > Hmm, I though that style(9) advises against this practice: > > Avoid using typedefs for structure types. Typedefs are problematic > because they do not properly hide their underlying type; [...] > > When convention requires a typedef, make its name match the struct tag. > Avoid typedefs ending in _t, except as specified in Standard C or by > POSIX. > > Does these rules not apply for struct device for some reason? Yes (they don't apply here). device_t is one of a few properly opaque typedefs for struct pointers. 'struct device' is only (completely) declared in kern/subr_bus.c. Thus the implementation details of it obviously cannot escape to drivers. Most of the APIs in are supposed to be like this. But `typedef struct kobj_class driver_t' and `#define driver_method_t kobj_method_t' are gross exceptions. has to include for dereferencing these, and kobj.h breaks the rule by providing both typedefs for struct pointers and complete struct declarations. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 15:01:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23E6A106564A; Mon, 31 Oct 2011 15:01:48 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1410E8FC17; Mon, 31 Oct 2011 15:01:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9VF1lfi020690; Mon, 31 Oct 2011 15:01:47 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9VF1lrf020688; Mon, 31 Oct 2011 15:01:47 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201110311501.p9VF1lrf020688@svn.freebsd.org> From: Peter Holm Date: Mon, 31 Oct 2011 15:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 15:01:48 -0000 Author: pho Date: Mon Oct 31 15:01:47 2011 New Revision: 226967 URL: http://svn.freebsd.org/changeset/base/226967 Log: The kern_renameat() looks up the fvp using the DELETE flag, which causes the removal of the name cache entry for fvp. Reported by: Anton Yuzhaninov In collaboration with: kib MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 10:53:27 2011 (r226966) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 15:01:47 2011 (r226967) @@ -1519,6 +1519,13 @@ relock: cache_purge(fdvp); } error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); + /* + * As the relookup of the fvp is done in two steps: + * ufs_lookup_ino() and then VFS_VGET(), another thread might do a + * normal lookup of the from name just before the VFS_VGET() call, + * causing the cache entry to be re-instantiated. + */ + cache_purge(fvp); unlockout: vput(fdvp); From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 16:33:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618EE106566C; Mon, 31 Oct 2011 16:33:04 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6F46C8FC1C; Mon, 31 Oct 2011 16:33:03 +0000 (UTC) Received: by faar19 with SMTP id r19so8136367faa.13 for ; Mon, 31 Oct 2011 09:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7iBU6FYPekzqcX3LzOETad6o4DHu9DSJTO9LXUz86KI=; b=toN3e9M9PcjgJCdwexFzHgijbSiIZUOB/ygHNxT0BdNserEZEIKeJxmeEZEXhnK3FO xXvg2AzPvfiyI5Yxwk87KQ4XH5LhYNHgt6crIUkfzQ7jmKm2+prFIv02XBRo2Rru2jPH CYvun5C0iwB1Vsa/KlZ0DAXNB6Ag2ZJw0+2/A= MIME-Version: 1.0 Received: by 10.182.59.5 with SMTP id v5mr3002757obq.78.1320078781645; Mon, 31 Oct 2011 09:33:01 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.182.89.41 with HTTP; Mon, 31 Oct 2011 09:33:01 -0700 (PDT) In-Reply-To: <201110300506.p9U56E3l049042@svn.freebsd.org> References: <201110300506.p9U56E3l049042@svn.freebsd.org> Date: Mon, 31 Oct 2011 19:33:01 +0300 X-Google-Sender-Auth: 6M2N4BX3H6aIzcsZjknutbVoZ1Q Message-ID: From: Sergey Kandaurov To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226928 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 16:33:04 -0000 On 30 October 2011 09:06, Alan Cox wrote: > Author: alc > Date: Sun Oct 30 05:06:14 2011 > New Revision: 226928 > URL: http://svn.freebsd.org/changeset/base/226928 > > Log: > =A0Eliminate vm_phys_bootstrap_alloc(). =A0It was a failed attempt at > =A0eliminating duplicated code in the various pmap implementations. > > =A0Micro-optimize vm_phys_free_pages(). > > =A0Introduce vm_phys_free_contig(). =A0It is fast routine for freeing an > =A0arbitrary number of physically contiguous pages. =A0In particular, it > =A0doesn't require the number of pages to be a power of two. > > =A0Use "u_long" instead of "unsigned long". > > =A0Bruce Evans (bde@) has convinced me that the "boundary" parameters > =A0to kmem_alloc_contig(), vm_phys_alloc_contig(), and > =A0vm_reserv_reclaim_contig() should be of type "vm_paddr_t" and not > =A0"u_long". =A0Make this change. Hello. After updating to this revision I constantly get random mtrash_ctor() assertions. [most often during make installkernel, otherwise idle.] Below is one of them (previous memory consumers in panicstr differ). Memory modified after free 0xfffffe0002700800(120) val=3D0 @ 0xfffffe000270= 0800 panic: Most recently used by proc-args cpuid =3D 1 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff802e009a =3D db_trace_self_wrapper+0x2= a kdb_backtrace() at 0xffffffff80486f17 =3D kdb_backtrace+0x37 panic() at 0xffffffff8044f87e =3D panic+0x2ee mtrash_ctor() at 0xffffffff8068c904 =3D mtrash_ctor+0x84 uma_zalloc_arg() at 0xffffffff8068c16c =3D uma_zalloc_arg+0x2dc malloc() at 0xffffffff8043abd6 =3D malloc+0xc6 pargs_alloc() at 0xffffffff804425d3 =3D pargs_alloc+0x23 kern_execve() at 0xffffffff8041cb47 =3D kern_execve+0x1277 sys_execve() at 0xffffffff8041ce6d =3D sys_execve+0x3d amd64_syscall() at 0xffffffff806c6319 =3D amd64_syscall+0x299 Xfast_syscall() at 0xffffffff806b16b7 =3D Xfast_syscall+0xf7 --- syscall (59, FreeBSD ELF64, sys_execve), rip =3D 0x800d4cbec, rsp =3D 0x7fffffffd1a8, rbp =3D 0x8014124a0 --- --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 16:42:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6C6C106564A; Mon, 31 Oct 2011 16:42:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8EC148FC15; Mon, 31 Oct 2011 16:42:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 31B2846B0A; Mon, 31 Oct 2011 12:42:05 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A482B8A02E; Mon, 31 Oct 2011 12:42:04 -0400 (EDT) From: John Baldwin To: Peter Holm Date: Mon, 31 Oct 2011 12:41:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110311501.p9VF1lrf020688@svn.freebsd.org> In-Reply-To: <201110311501.p9VF1lrf020688@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201110311241.42067.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 31 Oct 2011 12:42:04 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 16:42:05 -0000 On Monday, October 31, 2011 11:01:47 am Peter Holm wrote: > Author: pho > Date: Mon Oct 31 15:01:47 2011 > New Revision: 226967 > URL: http://svn.freebsd.org/changeset/base/226967 > > Log: > The kern_renameat() looks up the fvp using the DELETE flag, which causes > the removal of the name cache entry for fvp. > > Reported by: Anton Yuzhaninov > In collaboration with: kib > MFC after: 1 week Hmm, the log message doesn't seem to quite match the change? Was it truncated? > Modified: > head/sys/ufs/ufs/ufs_vnops.c > > Modified: head/sys/ufs/ufs/ufs_vnops.c > ============================================================================== > --- head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 10:53:27 2011 (r226966) > +++ head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 15:01:47 2011 (r226967) > @@ -1519,6 +1519,13 @@ relock: > cache_purge(fdvp); > } > error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); > + /* > + * As the relookup of the fvp is done in two steps: > + * ufs_lookup_ino() and then VFS_VGET(), another thread might do a > + * normal lookup of the from name just before the VFS_VGET() call, > + * causing the cache entry to be re-instantiated. > + */ > + cache_purge(fvp); > > unlockout: > vput(fdvp); > -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 17:30:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32F0E106564A; Mon, 31 Oct 2011 17:30:47 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id EF0C98FC16; Mon, 31 Oct 2011 17:30:46 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 81D28291AAF; Mon, 31 Oct 2011 12:13:22 -0500 (CDT) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 72D16297603; Mon, 31 Oct 2011 12:13:22 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 4gLz-lsylwvg; Mon, 31 Oct 2011 12:13:22 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 6E77E291AAF; Mon, 31 Oct 2011 12:13:21 -0500 (CDT) Message-ID: <4EAED730.5080205@rice.edu> Date: Mon, 31 Oct 2011 12:13:20 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.17) Gecko/20110620 Thunderbird/3.1.10 MIME-Version: 1.0 To: Sergey Kandaurov References: <201110300506.p9U56E3l049042@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226928 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 17:30:47 -0000 On 10/31/2011 11:33, Sergey Kandaurov wrote: > On 30 October 2011 09:06, Alan Cox wrote: >> Author: alc >> Date: Sun Oct 30 05:06:14 2011 >> New Revision: 226928 >> URL: http://svn.freebsd.org/changeset/base/226928 >> >> Log: >> Eliminate vm_phys_bootstrap_alloc(). It was a failed attempt at >> eliminating duplicated code in the various pmap implementations. >> >> Micro-optimize vm_phys_free_pages(). >> >> Introduce vm_phys_free_contig(). It is fast routine for freeing an >> arbitrary number of physically contiguous pages. In particular, it >> doesn't require the number of pages to be a power of two. >> >> Use "u_long" instead of "unsigned long". >> >> Bruce Evans (bde@) has convinced me that the "boundary" parameters >> to kmem_alloc_contig(), vm_phys_alloc_contig(), and >> vm_reserv_reclaim_contig() should be of type "vm_paddr_t" and not >> "u_long". Make this change. > Hello. > > After updating to this revision I constantly get random mtrash_ctor() > assertions. [most often during make installkernel, otherwise idle.] > > Below is one of them (previous memory consumers in panicstr differ). > > Memory modified after free 0xfffffe0002700800(120) val=0 @ 0xfffffe0002700800 > panic: Most recently used by proc-args > > cpuid = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at 0xffffffff802e009a = db_trace_self_wrapper+0x2a > kdb_backtrace() at 0xffffffff80486f17 = kdb_backtrace+0x37 > panic() at 0xffffffff8044f87e = panic+0x2ee > mtrash_ctor() at 0xffffffff8068c904 = mtrash_ctor+0x84 > uma_zalloc_arg() at 0xffffffff8068c16c = uma_zalloc_arg+0x2dc > malloc() at 0xffffffff8043abd6 = malloc+0xc6 > pargs_alloc() at 0xffffffff804425d3 = pargs_alloc+0x23 > kern_execve() at 0xffffffff8041cb47 = kern_execve+0x1277 > sys_execve() at 0xffffffff8041ce6d = sys_execve+0x3d > amd64_syscall() at 0xffffffff806c6319 = amd64_syscall+0x299 > Xfast_syscall() at 0xffffffff806b16b7 = Xfast_syscall+0xf7 > --- syscall (59, FreeBSD ELF64, sys_execve), rip = 0x800d4cbec, rsp = > 0x7fffffffd1a8, rbp = 0x8014124a0 --- > > I've not experienced anything like this, and I can't really see a direct connection between the above crash and the change. So, the only thing that I can suggest is reverting one piece of the change at a time. Please try this first: Index: vm/vm_phys.c =================================================================== --- vm/vm_phys.c (revision 226968) +++ vm/vm_phys.c (working copy) @@ -758,7 +758,6 @@ vm_phys_alloc_contig(u_long npages, vm_paddr_t low struct vnode *vp; vm_paddr_t pa, pa_last, size; vm_page_t deferred_vdrop_list, m, m_ret; - u_long npages_end; int domain, flind, i, oind, order, pind; #if VM_NDOMAIN > 1 @@ -871,10 +870,13 @@ done: deferred_vdrop_list = m; } } - /* Return excess pages to the free lists. */ - npages_end = roundup2(npages, 1 << imin(oind, order)); - if (npages < npages_end) - vm_phys_free_contig(&m_ret[npages], npages_end - npages); + for (; i < roundup2(npages, 1 << imin(oind, order)); i++) { + m = &m_ret[i]; + KASSERT(m->order == VM_NFREEORDER, + ("vm_phys_alloc_contig: page %p has unexpected order %d", + m, m->order)); + vm_phys_free_pages(m, 0); + } mtx_unlock(&vm_page_queue_free_mtx); while (deferred_vdrop_list != NULL) { vdrop((struct vnode *)deferred_vdrop_list->pageq.tqe_prev); From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 17:37:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E8351065677 for ; Mon, 31 Oct 2011 17:37:27 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id EBB598FC1B for ; Mon, 31 Oct 2011 17:37:26 +0000 (UTC) Received: (qmail 488 invoked from network); 31 Oct 2011 17:10:45 -0000 Received: from 87.58.144.241 (HELO x2.osted.lan) (87.58.144.241) by relay00.pair.com with SMTP; 31 Oct 2011 17:10:45 -0000 X-pair-Authenticated: 87.58.144.241 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.4/8.14.4) with ESMTP id p9VHAhBJ029715; Mon, 31 Oct 2011 18:10:43 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.4/8.14.4/Submit) id p9VHAh2U029714; Mon, 31 Oct 2011 18:10:43 +0100 (CET) (envelope-from pho) Date: Mon, 31 Oct 2011 18:10:43 +0100 From: Peter Holm To: John Baldwin Message-ID: <20111031171043.GB29244@x2.osted.lan> References: <201110311501.p9VF1lrf020688@svn.freebsd.org> <201110311241.42067.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201110311241.42067.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 17:37:27 -0000 On Mon, Oct 31, 2011 at 12:41:41PM -0400, John Baldwin wrote: > On Monday, October 31, 2011 11:01:47 am Peter Holm wrote: > > Author: pho > > Date: Mon Oct 31 15:01:47 2011 > > New Revision: 226967 > > URL: http://svn.freebsd.org/changeset/base/226967 > > > > Log: > > The kern_renameat() looks up the fvp using the DELETE flag, which causes > > the removal of the name cache entry for fvp. > > > > Reported by: Anton Yuzhaninov > > In collaboration with: kib > > MFC after: 1 week > > Hmm, the log message doesn't seem to quite match the change? Was it > truncated? > No, it was a misunderstanding on my part. The log message should have read: "Added missing cache purge of from argument." - Peter > > Modified: > > head/sys/ufs/ufs/ufs_vnops.c > > > > Modified: head/sys/ufs/ufs/ufs_vnops.c > > > ============================================================================== > > --- head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 10:53:27 2011 (r226966) > > +++ head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 15:01:47 2011 (r226967) > > @@ -1519,6 +1519,13 @@ relock: > > cache_purge(fdvp); > > } > > error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); > > + /* > > + * As the relookup of the fvp is done in two steps: > > + * ufs_lookup_ino() and then VFS_VGET(), another thread might do a > > + * normal lookup of the from name just before the VFS_VGET() call, > > + * causing the cache entry to be re-instantiated. > > + */ > > + cache_purge(fvp); > > > > unlockout: > > vput(fdvp); > > > > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 19:42:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 8B912106564A; Mon, 31 Oct 2011 19:42:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id F045C162D75; Mon, 31 Oct 2011 19:42:37 +0000 (UTC) Message-ID: <4EAEFA2D.7090607@FreeBSD.org> Date: Mon, 31 Oct 2011 12:42:37 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Peter Holm References: <201110311501.p9VF1lrf020688@svn.freebsd.org> <201110311241.42067.jhb@freebsd.org> <20111031171043.GB29244@x2.osted.lan> In-Reply-To: <20111031171043.GB29244@x2.osted.lan> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 19:42:38 -0000 On 10/31/2011 10:10, Peter Holm wrote: > No, it was a misunderstanding on my part. > > The log message should have read: > "Added missing cache purge of from argument." So perhaps a forced commit? -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 20:02:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B05F5106566B; Mon, 31 Oct 2011 20:02:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE068FC14; Mon, 31 Oct 2011 20:02:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9VK2B2i032022; Mon, 31 Oct 2011 20:02:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9VK2BQ7032019; Mon, 31 Oct 2011 20:02:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201110312002.p9VK2BQ7032019@svn.freebsd.org> From: Xin LI Date: Mon, 31 Oct 2011 20:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226969 - stable/9/sys/dev/tws X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 20:02:11 -0000 Author: delphij Date: Mon Oct 31 20:02:11 2011 New Revision: 226969 URL: http://svn.freebsd.org/changeset/base/226969 Log: MFC r226887: Don't expose a constant array into global namespace. Reported by: Ruslan Yakovlev via yongari Approved by: re (kib) Modified: stable/9/sys/dev/tws/tws_services.c stable/9/sys/dev/tws/tws_services.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/tws/tws_services.c ============================================================================== --- stable/9/sys/dev/tws/tws_services.c Mon Oct 31 16:05:33 2011 (r226968) +++ stable/9/sys/dev/tws/tws_services.c Mon Oct 31 20:02:11 2011 (r226969) @@ -53,7 +53,7 @@ struct tws_sense *tws_find_sense_from_mf -struct error_desc array[] = { +static struct error_desc array[] = { { "Cannot add sysctl tree node", 0x2000, ERROR, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, { "Register window not available", 0x2001, ERROR, Modified: stable/9/sys/dev/tws/tws_services.h ============================================================================== --- stable/9/sys/dev/tws/tws_services.h Mon Oct 31 16:05:33 2011 (r226968) +++ stable/9/sys/dev/tws/tws_services.h Mon Oct 31 20:02:11 2011 (r226969) @@ -114,7 +114,6 @@ struct error_desc { char *error_str; }; -extern struct error_desc array[]; /* ----------- q services ------------- */ #define TWS_FREE_Q 0 From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 20:02:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB9E1106566C; Mon, 31 Oct 2011 20:02:45 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-dy0-f54.google.com (mail-dy0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 08B1A8FC1F; Mon, 31 Oct 2011 20:02:44 +0000 (UTC) Received: by dye36 with SMTP id 36so345521dye.13 for ; Mon, 31 Oct 2011 13:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ofHpF1or3Jl0ClSWNlLcrI64wYhQ6ms9EMneGIpkx14=; b=r1+85MYhjRz+mG3FDJuziyFzT/CtQuWmnKq1hEMpfRKG8vIFcZsFQOcrbaNYqTV4hd Y7M548DkpAXjx8Zdfuw2gFqV/xJVwBAsWP2HG+Hzyid7P9IhRP0tlNpKmrHQoV5xirqs 5ovKRDTNuzgAg+FpuSyvaywZKLJCLDPfmNkSM= MIME-Version: 1.0 Received: by 10.182.59.5 with SMTP id v5mr3184480obq.78.1320091362393; Mon, 31 Oct 2011 13:02:42 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.182.89.41 with HTTP; Mon, 31 Oct 2011 13:02:42 -0700 (PDT) In-Reply-To: <4EAED730.5080205@rice.edu> References: <201110300506.p9U56E3l049042@svn.freebsd.org> <4EAED730.5080205@rice.edu> Date: Mon, 31 Oct 2011 23:02:42 +0300 X-Google-Sender-Auth: R2jD6sHWC4-4lIAVcO_8Rz-GnLE Message-ID: From: Sergey Kandaurov To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226928 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 20:02:46 -0000 On 31 October 2011 21:13, Alan Cox wrote: > On 10/31/2011 11:33, Sergey Kandaurov wrote: >> >> On 30 October 2011 09:06, Alan Cox =A0wrote: >>> >>> Author: alc >>> Date: Sun Oct 30 05:06:14 2011 >>> New Revision: 226928 >>> URL: http://svn.freebsd.org/changeset/base/226928 >>> >>> Log: >>> =A0Eliminate vm_phys_bootstrap_alloc(). =A0It was a failed attempt at >>> =A0eliminating duplicated code in the various pmap implementations. >>> >>> =A0Micro-optimize vm_phys_free_pages(). >>> >>> =A0Introduce vm_phys_free_contig(). =A0It is fast routine for freeing a= n >>> =A0arbitrary number of physically contiguous pages. =A0In particular, i= t >>> =A0doesn't require the number of pages to be a power of two. >>> >>> =A0Use "u_long" instead of "unsigned long". >>> >>> =A0Bruce Evans (bde@) has convinced me that the "boundary" parameters >>> =A0to kmem_alloc_contig(), vm_phys_alloc_contig(), and >>> =A0vm_reserv_reclaim_contig() should be of type "vm_paddr_t" and not >>> =A0"u_long". =A0Make this change. >> >> Hello. >> >> After updating to this revision I constantly get random mtrash_ctor() >> assertions. [most often during make installkernel, otherwise idle.] >> >> Below is one of them (previous memory consumers in panicstr differ). >> >> Memory modified after free 0xfffffe0002700800(120) val=3D0 @ >> 0xfffffe0002700800 >> panic: Most recently used by proc-args >> >> cpuid =3D 1 >> KDB: stack backtrace: >> db_trace_self_wrapper() at 0xffffffff802e009a =3D db_trace_self_wrapper+= 0x2a >> kdb_backtrace() at 0xffffffff80486f17 =3D kdb_backtrace+0x37 >> panic() at 0xffffffff8044f87e =3D panic+0x2ee >> mtrash_ctor() at 0xffffffff8068c904 =3D mtrash_ctor+0x84 >> uma_zalloc_arg() at 0xffffffff8068c16c =3D uma_zalloc_arg+0x2dc >> malloc() at 0xffffffff8043abd6 =3D malloc+0xc6 >> pargs_alloc() at 0xffffffff804425d3 =3D pargs_alloc+0x23 >> kern_execve() at 0xffffffff8041cb47 =3D kern_execve+0x1277 >> sys_execve() at 0xffffffff8041ce6d =3D sys_execve+0x3d >> amd64_syscall() at 0xffffffff806c6319 =3D amd64_syscall+0x299 >> Xfast_syscall() at 0xffffffff806b16b7 =3D Xfast_syscall+0xf7 >> --- syscall (59, FreeBSD ELF64, sys_execve), rip =3D 0x800d4cbec, rsp = =3D >> 0x7fffffffd1a8, rbp =3D 0x8014124a0 --- >> >> > > I've not experienced anything like this, and I can't really see a direct > connection between the above crash and the change. =A0So, the only thing = that > I can suggest is reverting one piece of the change at a time. =A0Please t= ry > this first: > I'm sorry. It appears that was due to regression in my local changes which triggered coinciding with this revision. I just reproduced it without your change. Sorry for noise. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 20:03:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC1001065673; Mon, 31 Oct 2011 20:03:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAC5A8FC14; Mon, 31 Oct 2011 20:03:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9VK39W4032107; Mon, 31 Oct 2011 20:03:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9VK39vk032104; Mon, 31 Oct 2011 20:03:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201110312003.p9VK39vk032104@svn.freebsd.org> From: Xin LI Date: Mon, 31 Oct 2011 20:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226970 - stable/8/sys/dev/tws X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 20:03:09 -0000 Author: delphij Date: Mon Oct 31 20:03:09 2011 New Revision: 226970 URL: http://svn.freebsd.org/changeset/base/226970 Log: MFC r226887: Don't expose a constant array into global namespace. Reported by: Ruslan Yakovlev via yongari Modified: stable/8/sys/dev/tws/tws_services.c stable/8/sys/dev/tws/tws_services.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/tws/tws_services.c ============================================================================== --- stable/8/sys/dev/tws/tws_services.c Mon Oct 31 20:02:11 2011 (r226969) +++ stable/8/sys/dev/tws/tws_services.c Mon Oct 31 20:03:09 2011 (r226970) @@ -53,7 +53,7 @@ struct tws_sense *tws_find_sense_from_mf -struct error_desc array[] = { +static struct error_desc array[] = { { "Cannot add sysctl tree node", 0x2000, ERROR, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, { "Register window not available", 0x2001, ERROR, Modified: stable/8/sys/dev/tws/tws_services.h ============================================================================== --- stable/8/sys/dev/tws/tws_services.h Mon Oct 31 20:02:11 2011 (r226969) +++ stable/8/sys/dev/tws/tws_services.h Mon Oct 31 20:03:09 2011 (r226970) @@ -114,7 +114,6 @@ struct error_desc { char *error_str; }; -extern struct error_desc array[]; /* ----------- q services ------------- */ #define TWS_FREE_Q 0 From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 20:24:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 839F01065670; Mon, 31 Oct 2011 20:24:33 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 731EF8FC12; Mon, 31 Oct 2011 20:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9VKOXa3032796; Mon, 31 Oct 2011 20:24:33 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9VKOXuR032794; Mon, 31 Oct 2011 20:24:33 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201110312024.p9VKOXuR032794@svn.freebsd.org> From: Peter Holm Date: Mon, 31 Oct 2011 20:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226971 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 20:24:33 -0000 Author: pho Date: Mon Oct 31 20:24:33 2011 New Revision: 226971 URL: http://svn.freebsd.org/changeset/base/226971 Log: Fix the wrong commit log message for r226967: "Added missing cache purge of from argument" and fix the comment. Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 20:03:09 2011 (r226970) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Oct 31 20:24:33 2011 (r226971) @@ -1520,6 +1520,8 @@ relock: } error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); /* + * The kern_renameat() looks up the fvp using the DELETE flag, which + * causes the removal of the name cache entry for fvp. * As the relookup of the fvp is done in two steps: * ufs_lookup_ino() and then VFS_VGET(), another thread might do a * normal lookup of the from name just before the VFS_VGET() call, From owner-svn-src-all@FreeBSD.ORG Mon Oct 31 20:30:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 73F861065670; Mon, 31 Oct 2011 20:30:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 333BC15F112; Mon, 31 Oct 2011 20:30:34 +0000 (UTC) Message-ID: <4EAF0569.7020207@FreeBSD.org> Date: Mon, 31 Oct 2011 13:30:33 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Peter Holm References: <201110312024.p9VKOXuR032794@svn.freebsd.org> In-Reply-To: <201110312024.p9VKOXuR032794@svn.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226971 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 20:30:43 -0000 On 10/31/2011 13:24, Peter Holm wrote: > Fix the wrong commit log message for r226967 Awesome, thanks! -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 1 01:28:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E80ED106566B; Tue, 1 Nov 2011 01:28:33 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C1858FC08; Tue, 1 Nov 2011 01:28:33 +0000 (UTC) Received: by vcbfk26 with SMTP id fk26so2234435vcb.13 for ; Mon, 31 Oct 2011 18:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=S58T6Os+VNQKrkoBKaXRLCKzdTNRfHUUBh69zHC+Z+s=; b=gArTEwXcDa2smqC+/QLJ+9XsyabQy41FRjphMQ234ssShMbaDni/IxYWgmePFS/P2x U8/1MF3FKG3PyvMyyJz9hRo7N9safsFOi8N1SWw8x/NCqEbrzc/SMsoDiIZzLZn2PFg4 fulnk1IGZsdBP3WdM/3YatwwbkseRqZPStWIM= MIME-Version: 1.0 Received: by 10.220.7.72 with SMTP id c8mr2438527vcc.149.1320109560873; Mon, 31 Oct 2011 18:06:00 -0700 (PDT) Received: by 10.221.13.130 with HTTP; Mon, 31 Oct 2011 18:06:00 -0700 (PDT) In-Reply-To: <4EAEFA2D.7090607@FreeBSD.org> References: <201110311501.p9VF1lrf020688@svn.freebsd.org> <201110311241.42067.jhb@freebsd.org> <20111031171043.GB29244@x2.osted.lan> <4EAEFA2D.7090607@FreeBSD.org> Date: Mon, 31 Oct 2011 18:06:00 -0700 Message-ID: From: Peter Wemm To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Peter Holm , svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 01:28:34 -0000 On Mon, Oct 31, 2011 at 12:42 PM, Doug Barton wrote: > On 10/31/2011 10:10, Peter Holm wrote: >> No, it was a misunderstanding on my part. >> >> The log message should have read: >> "Added missing cache purge of from argument." > > So perhaps a forced commit? No such thing anymore. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Nov 1 01:31:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0235106564A; Tue, 1 Nov 2011 01:31:26 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 8017F8FC18; Tue, 1 Nov 2011 01:31:26 +0000 (UTC) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 2A306F771; Mon, 31 Oct 2011 18:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1320111086; bh=WjU4FjAxSWg6U1rRMDzDKJ5BnqN52B+z9gbDjXwaArY=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=lIWtwgbZocihm8VHIQAhaknetF9w9Vzvx+UCDca24qWmibg3ys/C205hm/TvRdrUA 53x0ZAgDIznRpFJuVaGPzlGpYdGde1H6K//OCOZXcZQBBdbKtkZnaeIm6NBsDEkx6q 3y4Gw4lTPEJc2Av/h0MBqMRQKqnB8O1p+6gOCJnU= Message-ID: <4EAF4BEC.5000408@delphij.net> Date: Mon, 31 Oct 2011 18:31:24 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: Peter Wemm References: <201110311501.p9VF1lrf020688@svn.freebsd.org> <201110311241.42067.jhb@freebsd.org> <20111031171043.GB29244@x2.osted.lan> <4EAEFA2D.7090607@FreeBSD.org> In-Reply-To: OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Doug Barton , John Baldwin , Peter Holm , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 01:31:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 10/31/11 18:06, Peter Wemm wrote: > On Mon, Oct 31, 2011 at 12:42 PM, Doug Barton > wrote: >> On 10/31/2011 10:10, Peter Holm wrote: >>> No, it was a misunderstanding on my part. >>> >>> The log message should have read: "Added missing cache purge of >>> from argument." >> >> So perhaps a forced commit? > > No such thing anymore. I think it's a little bit tricky but still possible? (edit the file and add non-semantic change, for instance a blank line at the end) svn ci (enter commit message) ^Z <-- important (revert the files to previous state) fg and save. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJOr0vrAAoJEATO+BI/yjfB690H/2w16ovVzxvgwyIRF3eaZ8H3 GoXsyviUTJ0bnn8pCDba+aS/L6MyxQqOqC3Brl/i6X1/K9eKMvGsfUYRk4oZFimH g5vbsTLtvZlukRfnwyCRKSwyQk7utqtf1yx0Ae1HijVEkGKYQXDEYGdcQwZJb2aD eC8DU0sUjE2oR3/pymvrT9SHOId/5LHZTof7f3wQHEtaXCstkbHuiqsCIhO2UgAE Y+YwEJ1BEZmM8jbI04TQmpOjtddBIRfLIdEbl3pEoQDEhHPKBRHSFK7vTUyT9LFR KDQWm0OFhbL3OekSDKM/clMPvhTUz0kj+2aN+VD6wkU8kaBg10+YrNIz0+B2lgs= =DymR -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Nov 1 01:34:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37BE1065670; Tue, 1 Nov 2011 01:34:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21408FC1A; Tue, 1 Nov 2011 01:34:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA11YE8X042491; Tue, 1 Nov 2011 01:34:14 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA11YEUH042485; Tue, 1 Nov 2011 01:34:14 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201111010134.pA11YEUH042485@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 1 Nov 2011 01:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226974 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 01:34:15 -0000 Author: edwin Date: Tue Nov 1 01:34:14 2011 New Revision: 226974 URL: http://svn.freebsd.org/changeset/base/226974 Log: Vendor import of tzdata2011n - Fiji will end DST on 22 January 2012. - Moldova split into two timezones has been cancelled. - Cuba will end DST on 13 November 2011 Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: vendor/tzdata/dist/australasia vendor/tzdata/dist/backward vendor/tzdata/dist/europe vendor/tzdata/dist/northamerica vendor/tzdata/dist/zone.tab Modified: vendor/tzdata/dist/australasia ============================================================================== --- vendor/tzdata/dist/australasia Mon Oct 31 23:27:24 2011 (r226973) +++ vendor/tzdata/dist/australasia Tue Nov 1 01:34:14 2011 (r226974) @@ -1,5 +1,5 @@ #
-# @(#)australasia	8.28
+# @(#)australasia	8.29
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -308,6 +308,20 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # advance at 2am to 3am on October 23, 2011 and one hour back at 3am to 
 # 2am on February 26 next year.
 
+# From Ken Rylander (2011-10-24)
+# Another change to the Fiji DST end date. In the TZ database the end date for
+# Fiji DST 2012, is currently Feb 26. This has been changed to Jan 22.
+#
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155
+# 
+# states:
+#
+# The end of daylight saving scheduled initially for the 26th of February 2012
+# has been brought forward to the 22nd of January 2012.
+# The commencement of daylight saving will remain unchanged and start
+# on the  23rd of October, 2011.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
@@ -316,7 +330,7 @@ Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0
 Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
 Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 Rule	Fiji	2011	only	-	Oct	23	2:00	1:00	S
-Rule	Fiji	2012	only	-	Feb	26	3:00	0	-
+Rule	Fiji	2012	only	-	Jan	22	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time

Modified: vendor/tzdata/dist/backward
==============================================================================
--- vendor/tzdata/dist/backward	Mon Oct 31 23:27:24 2011	(r226973)
+++ vendor/tzdata/dist/backward	Tue Nov  1 01:34:14 2011	(r226974)
@@ -1,5 +1,5 @@
 # 
-# @(#)backward	8.10
+# @(#)backward	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -67,6 +67,7 @@ Link	America/Havana		Cuba
 Link	Africa/Cairo		Egypt
 Link	Europe/Dublin		Eire
 Link	Europe/London		Europe/Belfast
+Link	Europe/Chisinau		Europe/Tiraspol
 Link	Europe/London		GB
 Link	Europe/London		GB-Eire
 Link	Etc/GMT			GMT+0

Modified: vendor/tzdata/dist/europe
==============================================================================
--- vendor/tzdata/dist/europe	Mon Oct 31 23:27:24 2011	(r226973)
+++ vendor/tzdata/dist/europe	Tue Nov  1 01:34:14 2011	(r226974)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.39
+# @(#)europe	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1678,6 +1678,18 @@ Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov
 # a pre-1880 LMT offset of 1:58:32.
 #
 # (which agrees with the earlier entry that had been removed)
+#
+# From Alexander Krivenyshev (2011-10-26)
+# NO need to divide Moldova into two timezones at this point.
+# As of today, Transnistria (Pridnestrovie)- Tiraspol reversed its own
+# decision to abolish DST this winter. 
+# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
+# Tiraspol will go back to winter time on October 30, 2011.
+# News from Moldova (in russian):
+# 
+# http://ru.publika.md/link_317061.html
+# 
+
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Chisinau	1:55:20 -	LMT	1880
@@ -1694,21 +1706,6 @@ Zone	Europe/Chisinau	1:55:20 -	LMT	1880
 # See Romania commentary for the guessed 1997 transition to EU rules.
 			2:00	EU	EE%sT
 
-Zone	Europe/Tiraspol	1:58:32 -	LMT	1880
-			1:55	-	CMT	1918 Feb 15 # Chisinau MT
-			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
-			2:00	Romania	EE%sT	1940 Aug 15
-			2:00	1:00	EEST	1941 Jul 17
-			1:00	C-Eur	CE%sT	1944 Aug 24
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 May 6
-			2:00	-	EET	1991
-			2:00	Russia	EE%sT	1992
-			2:00	E-Eur	EE%sT	1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
-			2:00	EU	EE%sT	2011 Mar lastSun 1:00u
-			3:00	-	FET # Further-eastern European Time
-
 # Monaco
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.

Modified: vendor/tzdata/dist/northamerica
==============================================================================
--- vendor/tzdata/dist/northamerica	Mon Oct 31 23:27:24 2011	(r226973)
+++ vendor/tzdata/dist/northamerica	Tue Nov  1 01:34:14 2011	(r226974)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.50
+# @(#)northamerica	8.51
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2690,6 +2690,20 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # 
 # http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 # 
+#
+# From Steffen Thorsen (2011-10-30)
+# Cuba will end DST two weeks later this year. Instead of going back 
+# tonight, it has been delayed to 2011-11-13 at 01:00.
+#
+# One source (Spanish)
+# 
+# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
+# 
+#
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
@@ -2721,12 +2735,14 @@ Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
-Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2006	2010	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
 Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Nov	13	0:00s	0	S
 Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Oct	lastSun	0:00s	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

Modified: vendor/tzdata/dist/zone.tab
==============================================================================
--- vendor/tzdata/dist/zone.tab	Mon Oct 31 23:27:24 2011	(r226973)
+++ vendor/tzdata/dist/zone.tab	Tue Nov  1 01:34:14 2011	(r226974)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.50
+# @(#)zone.tab	8.52
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -258,7 +258,6 @@ LY	+3254+01311	Africa/Tripoli
 MA	+3339-00735	Africa/Casablanca
 MC	+4342+00723	Europe/Monaco
 MD	+4700+02850	Europe/Chisinau
-MD	+4651+02938	Europe/Tiraspol	Pridnestrovie
 ME	+4226+01916	Europe/Podgorica
 MF	+1804-06305	America/Marigot
 MG	-1855+04731	Indian/Antananarivo

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 01:34:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BEDE91065670;
	Tue,  1 Nov 2011 01:34:54 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9569D8FC1A;
	Tue,  1 Nov 2011 01:34:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA11YsVo042554;
	Tue, 1 Nov 2011 01:34:54 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA11Ys2E042553;
	Tue, 1 Nov 2011 01:34:54 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201111010134.pA11Ys2E042553@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Nov 2011 01:34:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226975 - vendor/tzdata/tzdata2011n
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 01:34:54 -0000

Author: edwin
Date: Tue Nov  1 01:34:54 2011
New Revision: 226975
URL: http://svn.freebsd.org/changeset/base/226975

Log:
  Tag of tzdata2011n

Added:
  vendor/tzdata/tzdata2011n/
     - copied from r226974, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 02:01:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D12D1065675;
	Tue,  1 Nov 2011 02:01:55 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8BCE78FC16;
	Tue,  1 Nov 2011 02:01:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA121tga043433;
	Tue, 1 Nov 2011 02:01:55 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA121t41043427;
	Tue, 1 Nov 2011 02:01:55 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201111010201.pA121t41043427@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Nov 2011 02:01:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226976 - head/contrib/tzdata
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 02:01:55 -0000

Author: edwin
Date: Tue Nov  1 02:01:55 2011
New Revision: 226976
URL: http://svn.freebsd.org/changeset/base/226976

Log:
  MFV of r226974, tzdata2011n
  
  - Fiji will end DST on 22 January 2012.
  - Moldova split into two timezones has been cancelled.
  - Cuba will end DST on 13 November 2011
  
  Obtained from:	ftp://ftp.iana.org/tz/releases/

Modified:
  head/contrib/tzdata/australasia
  head/contrib/tzdata/backward
  head/contrib/tzdata/europe
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/australasia
==============================================================================
--- head/contrib/tzdata/australasia	Tue Nov  1 01:34:54 2011	(r226975)
+++ head/contrib/tzdata/australasia	Tue Nov  1 02:01:55 2011	(r226976)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.28
+# @(#)australasia	8.29
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -308,6 +308,20 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # advance at 2am to 3am on October 23, 2011 and one hour back at 3am to 
 # 2am on February 26 next year.
 
+# From Ken Rylander (2011-10-24)
+# Another change to the Fiji DST end date. In the TZ database the end date for
+# Fiji DST 2012, is currently Feb 26. This has been changed to Jan 22.
+#
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155
+# 
+# states:
+#
+# The end of daylight saving scheduled initially for the 26th of February 2012
+# has been brought forward to the 22nd of January 2012.
+# The commencement of daylight saving will remain unchanged and start
+# on the  23rd of October, 2011.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
@@ -316,7 +330,7 @@ Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0
 Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
 Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 Rule	Fiji	2011	only	-	Oct	23	2:00	1:00	S
-Rule	Fiji	2012	only	-	Feb	26	3:00	0	-
+Rule	Fiji	2012	only	-	Jan	22	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time

Modified: head/contrib/tzdata/backward
==============================================================================
--- head/contrib/tzdata/backward	Tue Nov  1 01:34:54 2011	(r226975)
+++ head/contrib/tzdata/backward	Tue Nov  1 02:01:55 2011	(r226976)
@@ -1,5 +1,5 @@
 # 
-# @(#)backward	8.10
+# @(#)backward	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -67,6 +67,7 @@ Link	America/Havana		Cuba
 Link	Africa/Cairo		Egypt
 Link	Europe/Dublin		Eire
 Link	Europe/London		Europe/Belfast
+Link	Europe/Chisinau		Europe/Tiraspol
 Link	Europe/London		GB
 Link	Europe/London		GB-Eire
 Link	Etc/GMT			GMT+0

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Tue Nov  1 01:34:54 2011	(r226975)
+++ head/contrib/tzdata/europe	Tue Nov  1 02:01:55 2011	(r226976)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.39
+# @(#)europe	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1678,6 +1678,18 @@ Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov
 # a pre-1880 LMT offset of 1:58:32.
 #
 # (which agrees with the earlier entry that had been removed)
+#
+# From Alexander Krivenyshev (2011-10-26)
+# NO need to divide Moldova into two timezones at this point.
+# As of today, Transnistria (Pridnestrovie)- Tiraspol reversed its own
+# decision to abolish DST this winter. 
+# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
+# Tiraspol will go back to winter time on October 30, 2011.
+# News from Moldova (in russian):
+# 
+# http://ru.publika.md/link_317061.html
+# 
+
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Chisinau	1:55:20 -	LMT	1880
@@ -1694,21 +1706,6 @@ Zone	Europe/Chisinau	1:55:20 -	LMT	1880
 # See Romania commentary for the guessed 1997 transition to EU rules.
 			2:00	EU	EE%sT
 
-Zone	Europe/Tiraspol	1:58:32 -	LMT	1880
-			1:55	-	CMT	1918 Feb 15 # Chisinau MT
-			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
-			2:00	Romania	EE%sT	1940 Aug 15
-			2:00	1:00	EEST	1941 Jul 17
-			1:00	C-Eur	CE%sT	1944 Aug 24
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 May 6
-			2:00	-	EET	1991
-			2:00	Russia	EE%sT	1992
-			2:00	E-Eur	EE%sT	1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
-			2:00	EU	EE%sT	2011 Mar lastSun 1:00u
-			3:00	-	FET # Further-eastern European Time
-
 # Monaco
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.

Modified: head/contrib/tzdata/northamerica
==============================================================================
--- head/contrib/tzdata/northamerica	Tue Nov  1 01:34:54 2011	(r226975)
+++ head/contrib/tzdata/northamerica	Tue Nov  1 02:01:55 2011	(r226976)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.50
+# @(#)northamerica	8.51
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2690,6 +2690,20 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # 
 # http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 # 
+#
+# From Steffen Thorsen (2011-10-30)
+# Cuba will end DST two weeks later this year. Instead of going back 
+# tonight, it has been delayed to 2011-11-13 at 01:00.
+#
+# One source (Spanish)
+# 
+# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
+# 
+#
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
@@ -2721,12 +2735,14 @@ Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
-Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2006	2010	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
 Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Nov	13	0:00s	0	S
 Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Oct	lastSun	0:00s	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Tue Nov  1 01:34:54 2011	(r226975)
+++ head/contrib/tzdata/zone.tab	Tue Nov  1 02:01:55 2011	(r226976)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.50
+# @(#)zone.tab	8.52
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -257,8 +257,7 @@ LV	+5657+02406	Europe/Riga
 LY	+3254+01311	Africa/Tripoli
 MA	+3339-00735	Africa/Casablanca
 MC	+4342+00723	Europe/Monaco
-MD	+4700+02850	Europe/Chisinau	most locations
-MD	+4651+02938	Europe/Tiraspol	Pridnestrovie
+MD	+4700+02850	Europe/Chisinau
 ME	+4226+01916	Europe/Podgorica
 MF	+1804-06305	America/Marigot
 MG	-1855+04731	Indian/Antananarivo

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 02:03:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00AEB106564A;
	Tue,  1 Nov 2011 02:03:31 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E2EFE8FC08;
	Tue,  1 Nov 2011 02:03:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA123UwZ043553;
	Tue, 1 Nov 2011 02:03:30 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA123Ud1043547;
	Tue, 1 Nov 2011 02:03:30 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201111010203.pA123Ud1043547@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Nov 2011 02:03:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226977 - stable/8/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 02:03:31 -0000

Author: edwin
Date: Tue Nov  1 02:03:30 2011
New Revision: 226977
URL: http://svn.freebsd.org/changeset/base/226977

Log:
  MFC of 226976, tzdata2011n
  
  - Fiji will end DST on 22 January 2012.
  - Moldova split into two timezones has been cancelled.
  - Cuba will end DST on 13 November 2011
  
  Obtained from:	 ftp://ftp.iana.org/tz/releases/

Modified:
  stable/8/share/zoneinfo/australasia
  stable/8/share/zoneinfo/backward
  stable/8/share/zoneinfo/europe
  stable/8/share/zoneinfo/northamerica
  stable/8/share/zoneinfo/zone.tab
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/australasia
==============================================================================
--- stable/8/share/zoneinfo/australasia	Tue Nov  1 02:01:55 2011	(r226976)
+++ stable/8/share/zoneinfo/australasia	Tue Nov  1 02:03:30 2011	(r226977)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.28
+# @(#)australasia	8.29
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -308,6 +308,20 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # advance at 2am to 3am on October 23, 2011 and one hour back at 3am to 
 # 2am on February 26 next year.
 
+# From Ken Rylander (2011-10-24)
+# Another change to the Fiji DST end date. In the TZ database the end date for
+# Fiji DST 2012, is currently Feb 26. This has been changed to Jan 22.
+#
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155
+# 
+# states:
+#
+# The end of daylight saving scheduled initially for the 26th of February 2012
+# has been brought forward to the 22nd of January 2012.
+# The commencement of daylight saving will remain unchanged and start
+# on the  23rd of October, 2011.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
@@ -316,7 +330,7 @@ Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0
 Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
 Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 Rule	Fiji	2011	only	-	Oct	23	2:00	1:00	S
-Rule	Fiji	2012	only	-	Feb	26	3:00	0	-
+Rule	Fiji	2012	only	-	Jan	22	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time

Modified: stable/8/share/zoneinfo/backward
==============================================================================
--- stable/8/share/zoneinfo/backward	Tue Nov  1 02:01:55 2011	(r226976)
+++ stable/8/share/zoneinfo/backward	Tue Nov  1 02:03:30 2011	(r226977)
@@ -1,5 +1,5 @@
 # 
-# @(#)backward	8.10
+# @(#)backward	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -67,6 +67,7 @@ Link	America/Havana		Cuba
 Link	Africa/Cairo		Egypt
 Link	Europe/Dublin		Eire
 Link	Europe/London		Europe/Belfast
+Link	Europe/Chisinau		Europe/Tiraspol
 Link	Europe/London		GB
 Link	Europe/London		GB-Eire
 Link	Etc/GMT			GMT+0

Modified: stable/8/share/zoneinfo/europe
==============================================================================
--- stable/8/share/zoneinfo/europe	Tue Nov  1 02:01:55 2011	(r226976)
+++ stable/8/share/zoneinfo/europe	Tue Nov  1 02:03:30 2011	(r226977)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.39
+# @(#)europe	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1678,6 +1678,18 @@ Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov
 # a pre-1880 LMT offset of 1:58:32.
 #
 # (which agrees with the earlier entry that had been removed)
+#
+# From Alexander Krivenyshev (2011-10-26)
+# NO need to divide Moldova into two timezones at this point.
+# As of today, Transnistria (Pridnestrovie)- Tiraspol reversed its own
+# decision to abolish DST this winter. 
+# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
+# Tiraspol will go back to winter time on October 30, 2011.
+# News from Moldova (in russian):
+# 
+# http://ru.publika.md/link_317061.html
+# 
+
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Chisinau	1:55:20 -	LMT	1880
@@ -1694,21 +1706,6 @@ Zone	Europe/Chisinau	1:55:20 -	LMT	1880
 # See Romania commentary for the guessed 1997 transition to EU rules.
 			2:00	EU	EE%sT
 
-Zone	Europe/Tiraspol	1:58:32 -	LMT	1880
-			1:55	-	CMT	1918 Feb 15 # Chisinau MT
-			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
-			2:00	Romania	EE%sT	1940 Aug 15
-			2:00	1:00	EEST	1941 Jul 17
-			1:00	C-Eur	CE%sT	1944 Aug 24
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 May 6
-			2:00	-	EET	1991
-			2:00	Russia	EE%sT	1992
-			2:00	E-Eur	EE%sT	1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
-			2:00	EU	EE%sT	2011 Mar lastSun 1:00u
-			3:00	-	FET # Further-eastern European Time
-
 # Monaco
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.

Modified: stable/8/share/zoneinfo/northamerica
==============================================================================
--- stable/8/share/zoneinfo/northamerica	Tue Nov  1 02:01:55 2011	(r226976)
+++ stable/8/share/zoneinfo/northamerica	Tue Nov  1 02:03:30 2011	(r226977)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.50
+# @(#)northamerica	8.51
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2690,6 +2690,20 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # 
 # http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 # 
+#
+# From Steffen Thorsen (2011-10-30)
+# Cuba will end DST two weeks later this year. Instead of going back 
+# tonight, it has been delayed to 2011-11-13 at 01:00.
+#
+# One source (Spanish)
+# 
+# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
+# 
+#
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
@@ -2721,12 +2735,14 @@ Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
-Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2006	2010	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
 Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Nov	13	0:00s	0	S
 Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Oct	lastSun	0:00s	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Tue Nov  1 02:01:55 2011	(r226976)
+++ stable/8/share/zoneinfo/zone.tab	Tue Nov  1 02:03:30 2011	(r226977)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.50
+# @(#)zone.tab	8.52
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -257,8 +257,7 @@ LV	+5657+02406	Europe/Riga
 LY	+3254+01311	Africa/Tripoli
 MA	+3339-00735	Africa/Casablanca
 MC	+4342+00723	Europe/Monaco
-MD	+4700+02850	Europe/Chisinau	most locations
-MD	+4651+02938	Europe/Tiraspol	Pridnestrovie
+MD	+4700+02850	Europe/Chisinau
 ME	+4226+01916	Europe/Podgorica
 MF	+1804-06305	America/Marigot
 MG	-1855+04731	Indian/Antananarivo

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 02:04:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB2D9106564A;
	Tue,  1 Nov 2011 02:04:02 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B94548FC1E;
	Tue,  1 Nov 2011 02:04:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1242gW043620;
	Tue, 1 Nov 2011 02:04:02 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1242hk043614;
	Tue, 1 Nov 2011 02:04:02 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201111010204.pA1242hk043614@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Nov 2011 02:04:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226978 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 02:04:02 -0000

Author: edwin
Date: Tue Nov  1 02:04:02 2011
New Revision: 226978
URL: http://svn.freebsd.org/changeset/base/226978

Log:
  MFC of 226976, tzdata2011n
  
  - Fiji will end DST on 22 January 2012.
  - Moldova split into two timezones has been cancelled.
  - Cuba will end DST on 13 November 2011
  
  Obtained from:	 ftp://ftp.iana.org/tz/releases/

Modified:
  stable/7/share/zoneinfo/australasia
  stable/7/share/zoneinfo/backward
  stable/7/share/zoneinfo/europe
  stable/7/share/zoneinfo/northamerica
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/australasia
==============================================================================
--- stable/7/share/zoneinfo/australasia	Tue Nov  1 02:03:30 2011	(r226977)
+++ stable/7/share/zoneinfo/australasia	Tue Nov  1 02:04:02 2011	(r226978)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.28
+# @(#)australasia	8.29
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -308,6 +308,20 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # advance at 2am to 3am on October 23, 2011 and one hour back at 3am to 
 # 2am on February 26 next year.
 
+# From Ken Rylander (2011-10-24)
+# Another change to the Fiji DST end date. In the TZ database the end date for
+# Fiji DST 2012, is currently Feb 26. This has been changed to Jan 22.
+#
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155
+# 
+# states:
+#
+# The end of daylight saving scheduled initially for the 26th of February 2012
+# has been brought forward to the 22nd of January 2012.
+# The commencement of daylight saving will remain unchanged and start
+# on the  23rd of October, 2011.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
@@ -316,7 +330,7 @@ Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0
 Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
 Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 Rule	Fiji	2011	only	-	Oct	23	2:00	1:00	S
-Rule	Fiji	2012	only	-	Feb	26	3:00	0	-
+Rule	Fiji	2012	only	-	Jan	22	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time

Modified: stable/7/share/zoneinfo/backward
==============================================================================
--- stable/7/share/zoneinfo/backward	Tue Nov  1 02:03:30 2011	(r226977)
+++ stable/7/share/zoneinfo/backward	Tue Nov  1 02:04:02 2011	(r226978)
@@ -1,5 +1,5 @@
 # 
-# @(#)backward	8.10
+# @(#)backward	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -67,6 +67,7 @@ Link	America/Havana		Cuba
 Link	Africa/Cairo		Egypt
 Link	Europe/Dublin		Eire
 Link	Europe/London		Europe/Belfast
+Link	Europe/Chisinau		Europe/Tiraspol
 Link	Europe/London		GB
 Link	Europe/London		GB-Eire
 Link	Etc/GMT			GMT+0

Modified: stable/7/share/zoneinfo/europe
==============================================================================
--- stable/7/share/zoneinfo/europe	Tue Nov  1 02:03:30 2011	(r226977)
+++ stable/7/share/zoneinfo/europe	Tue Nov  1 02:04:02 2011	(r226978)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.39
+# @(#)europe	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1678,6 +1678,18 @@ Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov
 # a pre-1880 LMT offset of 1:58:32.
 #
 # (which agrees with the earlier entry that had been removed)
+#
+# From Alexander Krivenyshev (2011-10-26)
+# NO need to divide Moldova into two timezones at this point.
+# As of today, Transnistria (Pridnestrovie)- Tiraspol reversed its own
+# decision to abolish DST this winter. 
+# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
+# Tiraspol will go back to winter time on October 30, 2011.
+# News from Moldova (in russian):
+# 
+# http://ru.publika.md/link_317061.html
+# 
+
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Chisinau	1:55:20 -	LMT	1880
@@ -1694,21 +1706,6 @@ Zone	Europe/Chisinau	1:55:20 -	LMT	1880
 # See Romania commentary for the guessed 1997 transition to EU rules.
 			2:00	EU	EE%sT
 
-Zone	Europe/Tiraspol	1:58:32 -	LMT	1880
-			1:55	-	CMT	1918 Feb 15 # Chisinau MT
-			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
-			2:00	Romania	EE%sT	1940 Aug 15
-			2:00	1:00	EEST	1941 Jul 17
-			1:00	C-Eur	CE%sT	1944 Aug 24
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 May 6
-			2:00	-	EET	1991
-			2:00	Russia	EE%sT	1992
-			2:00	E-Eur	EE%sT	1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
-			2:00	EU	EE%sT	2011 Mar lastSun 1:00u
-			3:00	-	FET # Further-eastern European Time
-
 # Monaco
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.

Modified: stable/7/share/zoneinfo/northamerica
==============================================================================
--- stable/7/share/zoneinfo/northamerica	Tue Nov  1 02:03:30 2011	(r226977)
+++ stable/7/share/zoneinfo/northamerica	Tue Nov  1 02:04:02 2011	(r226978)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.50
+# @(#)northamerica	8.51
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2690,6 +2690,20 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # 
 # http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 # 
+#
+# From Steffen Thorsen (2011-10-30)
+# Cuba will end DST two weeks later this year. Instead of going back 
+# tonight, it has been delayed to 2011-11-13 at 01:00.
+#
+# One source (Spanish)
+# 
+# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
+# 
+#
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
@@ -2721,12 +2735,14 @@ Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
-Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2006	2010	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
 Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Nov	13	0:00s	0	S
 Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Oct	lastSun	0:00s	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Tue Nov  1 02:03:30 2011	(r226977)
+++ stable/7/share/zoneinfo/zone.tab	Tue Nov  1 02:04:02 2011	(r226978)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.50
+# @(#)zone.tab	8.52
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -257,8 +257,7 @@ LV	+5657+02406	Europe/Riga
 LY	+3254+01311	Africa/Tripoli
 MA	+3339-00735	Africa/Casablanca
 MC	+4342+00723	Europe/Monaco
-MD	+4700+02850	Europe/Chisinau	most locations
-MD	+4651+02938	Europe/Tiraspol	Pridnestrovie
+MD	+4700+02850	Europe/Chisinau
 ME	+4226+01916	Europe/Podgorica
 MF	+1804-06305	America/Marigot
 MG	-1855+04731	Indian/Antananarivo

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 02:04:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 24007106564A;
	Tue,  1 Nov 2011 02:04:53 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 121DB8FC13;
	Tue,  1 Nov 2011 02:04:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA124qqk043694;
	Tue, 1 Nov 2011 02:04:52 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA124qaV043687;
	Tue, 1 Nov 2011 02:04:52 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201111010204.pA124qaV043687@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Nov 2011 02:04:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226979 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 02:04:53 -0000

Author: edwin
Date: Tue Nov  1 02:04:52 2011
New Revision: 226979
URL: http://svn.freebsd.org/changeset/base/226979

Log:
  MFC of 226976, tzdata2011n
  
  - Fiji will end DST on 22 January 2012.
  - Moldova split into two timezones has been cancelled.
  - Cuba will end DST on 13 November 2011
  
  Obtained from:	 ftp://ftp.iana.org/tz/releases/

Modified:
  stable/6/share/zoneinfo/australasia
  stable/6/share/zoneinfo/backward
  stable/6/share/zoneinfo/europe
  stable/6/share/zoneinfo/northamerica
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/australasia
==============================================================================
--- stable/6/share/zoneinfo/australasia	Tue Nov  1 02:04:02 2011	(r226978)
+++ stable/6/share/zoneinfo/australasia	Tue Nov  1 02:04:52 2011	(r226979)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.28
+# @(#)australasia	8.29
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -308,6 +308,20 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # advance at 2am to 3am on October 23, 2011 and one hour back at 3am to 
 # 2am on February 26 next year.
 
+# From Ken Rylander (2011-10-24)
+# Another change to the Fiji DST end date. In the TZ database the end date for
+# Fiji DST 2012, is currently Feb 26. This has been changed to Jan 22.
+#
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155
+# 
+# states:
+#
+# The end of daylight saving scheduled initially for the 26th of February 2012
+# has been brought forward to the 22nd of January 2012.
+# The commencement of daylight saving will remain unchanged and start
+# on the  23rd of October, 2011.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
@@ -316,7 +330,7 @@ Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0
 Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
 Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 Rule	Fiji	2011	only	-	Oct	23	2:00	1:00	S
-Rule	Fiji	2012	only	-	Feb	26	3:00	0	-
+Rule	Fiji	2012	only	-	Jan	22	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time

Modified: stable/6/share/zoneinfo/backward
==============================================================================
--- stable/6/share/zoneinfo/backward	Tue Nov  1 02:04:02 2011	(r226978)
+++ stable/6/share/zoneinfo/backward	Tue Nov  1 02:04:52 2011	(r226979)
@@ -1,5 +1,5 @@
 # 
-# @(#)backward	8.10
+# @(#)backward	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -67,6 +67,7 @@ Link	America/Havana		Cuba
 Link	Africa/Cairo		Egypt
 Link	Europe/Dublin		Eire
 Link	Europe/London		Europe/Belfast
+Link	Europe/Chisinau		Europe/Tiraspol
 Link	Europe/London		GB
 Link	Europe/London		GB-Eire
 Link	Etc/GMT			GMT+0

Modified: stable/6/share/zoneinfo/europe
==============================================================================
--- stable/6/share/zoneinfo/europe	Tue Nov  1 02:04:02 2011	(r226978)
+++ stable/6/share/zoneinfo/europe	Tue Nov  1 02:04:52 2011	(r226979)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.39
+# @(#)europe	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1678,6 +1678,18 @@ Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov
 # a pre-1880 LMT offset of 1:58:32.
 #
 # (which agrees with the earlier entry that had been removed)
+#
+# From Alexander Krivenyshev (2011-10-26)
+# NO need to divide Moldova into two timezones at this point.
+# As of today, Transnistria (Pridnestrovie)- Tiraspol reversed its own
+# decision to abolish DST this winter. 
+# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
+# Tiraspol will go back to winter time on October 30, 2011.
+# News from Moldova (in russian):
+# 
+# http://ru.publika.md/link_317061.html
+# 
+
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Chisinau	1:55:20 -	LMT	1880
@@ -1694,21 +1706,6 @@ Zone	Europe/Chisinau	1:55:20 -	LMT	1880
 # See Romania commentary for the guessed 1997 transition to EU rules.
 			2:00	EU	EE%sT
 
-Zone	Europe/Tiraspol	1:58:32 -	LMT	1880
-			1:55	-	CMT	1918 Feb 15 # Chisinau MT
-			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
-			2:00	Romania	EE%sT	1940 Aug 15
-			2:00	1:00	EEST	1941 Jul 17
-			1:00	C-Eur	CE%sT	1944 Aug 24
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 May 6
-			2:00	-	EET	1991
-			2:00	Russia	EE%sT	1992
-			2:00	E-Eur	EE%sT	1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
-			2:00	EU	EE%sT	2011 Mar lastSun 1:00u
-			3:00	-	FET # Further-eastern European Time
-
 # Monaco
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.

Modified: stable/6/share/zoneinfo/northamerica
==============================================================================
--- stable/6/share/zoneinfo/northamerica	Tue Nov  1 02:04:02 2011	(r226978)
+++ stable/6/share/zoneinfo/northamerica	Tue Nov  1 02:04:52 2011	(r226979)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.50
+# @(#)northamerica	8.51
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2690,6 +2690,20 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # 
 # http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 # 
+#
+# From Steffen Thorsen (2011-10-30)
+# Cuba will end DST two weeks later this year. Instead of going back 
+# tonight, it has been delayed to 2011-11-13 at 01:00.
+#
+# One source (Spanish)
+# 
+# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
+# 
+#
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
@@ -2721,12 +2735,14 @@ Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
-Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2006	2010	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
 Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Nov	13	0:00s	0	S
 Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Oct	lastSun	0:00s	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

Modified: stable/6/share/zoneinfo/zone.tab
==============================================================================
--- stable/6/share/zoneinfo/zone.tab	Tue Nov  1 02:04:02 2011	(r226978)
+++ stable/6/share/zoneinfo/zone.tab	Tue Nov  1 02:04:52 2011	(r226979)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.50
+# @(#)zone.tab	8.52
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -257,8 +257,7 @@ LV	+5657+02406	Europe/Riga
 LY	+3254+01311	Africa/Tripoli
 MA	+3339-00735	Africa/Casablanca
 MC	+4342+00723	Europe/Monaco
-MD	+4700+02850	Europe/Chisinau	most locations
-MD	+4651+02938	Europe/Tiraspol	Pridnestrovie
+MD	+4700+02850	Europe/Chisinau
 ME	+4226+01916	Europe/Podgorica
 MF	+1804-06305	America/Marigot
 MG	-1855+04731	Indian/Antananarivo

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 02:07:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 615E11065677; Tue,  1 Nov 2011 02:07:43 +0000 (UTC)
Date: Tue, 1 Nov 2011 02:07:43 +0000
From: Alexey Dokuchaev 
To: Bruce Evans 
Message-ID: <20111101020743.GA14822@FreeBSD.org>
References: <201110302117.p9ULHgLD085245@svn.freebsd.org>
	<20111031042526.GA57014@FreeBSD.org>
	<20111031233854.Y1523@besplex.bde.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <20111031233854.Y1523@besplex.bde.org>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, Marius Strobl ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r226947 - in head/sys: dev/esp sparc64/sbus
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 02:07:43 -0000

On Tue, Nov 01, 2011 at 12:01:16AM +1100, Bruce Evans wrote:
> On Mon, 31 Oct 2011, Alexey Dokuchaev wrote:
> >   When convention requires a typedef, make its name match the struct tag.
> >   Avoid typedefs ending in _t, except as specified in Standard C or by
> >   POSIX.
> >
> > Do these rules not apply for struct device for some reason?
> 
> Yes (they don't apply here).  device_t is one of a few properly opaque
> typedefs for struct pointers.  'struct device' is only (completely)
> declared in kern/subr_bus.c.  Thus the implementation details of it
> obviously cannot escape to drivers.  Most of the APIs in 
> are supposed to be like this.  But `typedef struct kobj_class driver_t'
> and `#define driver_method_t kobj_method_t' are gross exceptions.
>  has to include  for dereferencing these, and
> kobj.h breaks the rule by providing both typedefs for struct pointers
> and complete struct declarations.

Thanks for detailed explanation Bruce.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 08:24:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 07BA01065708;
	Tue,  1 Nov 2011 08:24:02 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E980B8FC1D;
	Tue,  1 Nov 2011 08:24:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA18O1aM056462;
	Tue, 1 Nov 2011 08:24:01 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA18O1eW056454;
	Tue, 1 Nov 2011 08:24:01 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201111010824.pA18O1eW056454@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Tue, 1 Nov 2011 08:24:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226984 - in stable/8: etc/devd sys/dev/usb
	sys/dev/usb/quirk sys/dev/usb/wlan
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 08:24:02 -0000

Author: hselasky
Date: Tue Nov  1 08:24:01 2011
New Revision: 226984
URL: http://svn.freebsd.org/changeset/base/226984

Log:
  MFC r226903, r225777, r226221 and r226534:
  Add some new USB device IDs and some USB device quirks.
  Improve the USB mass storage auto quirk detection.
  
  PR:		usb/161798, usb/160911

Modified:
  stable/8/etc/devd/usb.conf
  stable/8/sys/dev/usb/quirk/usb_quirk.c
  stable/8/sys/dev/usb/usb_device.c
  stable/8/sys/dev/usb/usb_msctest.c
  stable/8/sys/dev/usb/usbdevs
  stable/8/sys/dev/usb/wlan/if_run.c
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/etc/devd/usb.conf
==============================================================================
--- stable/8/etc/devd/usb.conf	Tue Nov  1 04:21:57 2011	(r226983)
+++ stable/8/etc/devd/usb.conf	Tue Nov  1 08:24:01 2011	(r226984)
@@ -565,6 +565,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x04e8";
+	match "product" "0x2018";
+	action "kldload if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x04e8";
 	match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)";
 	action "kldload uipaq";
 };
@@ -741,7 +749,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x050d";
-	match "product" "(0x8053|0x805c|0x815c|0x825a)";
+	match "product" "(0x8053|0x805c|0x815c|0x825a|0x825b)";
 	action "kldload if_run";
 };
 
@@ -1877,7 +1885,23 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0af0";
-	match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901)";
+	match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701)";
+	action "kldload u3g";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0af0";
+	match "product" "0x6711";
+	action "kldload uhso";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0af0";
+	match "product" "(0x6721|0x6741|0x6761|0x6800|0x6901)";
 	action "kldload u3g";
 };
 
@@ -2069,7 +2093,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0b95";
-	match "product" "(0x1720|0x1780|0x7720|0x772a)";
+	match "product" "(0x1720|0x1780|0x7720|0x772a|0x772b)";
 	action "kldload if_axe";
 };
 
@@ -2500,6 +2524,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x0f3d";
+	match "product" "0x68a3";
+	action "kldload usie";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x0f4e";
 	match "product" "0x0200";
 	action "kldload uipaq";
@@ -2789,13 +2821,37 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x1199";
-	match "product" "(0x0220|0x0224|0x0fff|0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)";
+	match "product" "(0x0220|0x0224|0x0fff)";
+	action "kldload u3g";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x1199";
+	match "product" "0x0fff";
+	action "kldload usie";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x1199";
+	match "product" "(0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)";
 	action "kldload u3g";
 };
 
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x1199";
+	match "product" "0x68a3";
+	action "kldload usie";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x11ad";
 	match "product" "0x0701";
 	action "kldload uplcom";
@@ -2869,7 +2925,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x12d1";
-	match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520)";
+	match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520|0x1c05|0x1c0b)";
 	action "kldload u3g";
 };
 
@@ -2972,6 +3028,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x13b1";
+	match "product" "0x002f";
+	action "kldload if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x13d2";
 	match "product" "0x0400";
 	action "kldload if_kue";
@@ -3669,7 +3733,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x1c9e";
-	match "product" "(0x6061|0x9603|0xf000)";
+	match "product" "(0x6061|0x9603|0x9605|0xf000)";
 	action "kldload u3g";
 };
 
@@ -4263,5 +4327,5 @@ nomatch 32 {
 	action "kldload umass";
 };
 
-# 1634 USB entries processed
+# 1645 USB entries processed
 

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Nov  1 04:21:57 2011	(r226983)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.c	Tue Nov  1 08:24:01 2011	(r226984)
@@ -457,6 +457,14 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(ROLAND, SD80, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
 	USB_QUIRK(ROLAND, UA700, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
 	USB_QUIRK(MEDELI, DD305, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI, UQ_MATCH_VENDOR_ONLY),
+
+	/*
+	 * Quirks for manufacturers which USB devices does not respond
+	 * after issuing non-supported commands:
+	 */
+	USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
+	USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
+	USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
 };
 #undef USB_QUIRK_VP
 #undef USB_QUIRK

Modified: stable/8/sys/dev/usb/usb_device.c
==============================================================================
--- stable/8/sys/dev/usb/usb_device.c	Tue Nov  1 04:21:57 2011	(r226983)
+++ stable/8/sys/dev/usb/usb_device.c	Tue Nov  1 08:24:01 2011	(r226984)
@@ -1851,7 +1851,8 @@ repeat_set_config:
 		}
 	}
 	if (set_config_failed == 0 && config_index == 0 &&
-	    usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0) {
+	    usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 &&
+	    usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0) {
 
 		/*
 		 * Try to figure out if there are any MSC quirks we

Modified: stable/8/sys/dev/usb/usb_msctest.c
==============================================================================
--- stable/8/sys/dev/usb/usb_msctest.c	Tue Nov  1 04:21:57 2011	(r226983)
+++ stable/8/sys/dev/usb/usb_msctest.c	Tue Nov  1 08:24:01 2011	(r226984)
@@ -604,6 +604,29 @@ usb_iface_is_cdrom(struct usb_device *ud
 	return (is_cdrom);
 }
 
+static uint8_t
+usb_msc_get_max_lun(struct usb_device *udev, uint8_t iface_index)
+{
+	struct usb_device_request req;
+	usb_error_t err;
+	uint8_t buf = 0;
+
+
+	/* The Get Max Lun command is a class-specific request. */
+	req.bmRequestType = UT_READ_CLASS_INTERFACE;
+	req.bRequest = 0xFE;		/* GET_MAX_LUN */
+	USETW(req.wValue, 0);
+	req.wIndex[0] = iface_index;
+	req.wIndex[1] = 0;
+	USETW(req.wLength, 1);
+
+	err = usbd_do_request(udev, NULL, &req, &buf);
+	if (err)
+		buf = 0;
+
+	return (buf);
+}
+
 usb_error_t
 usb_msc_auto_quirk(struct usb_device *udev, uint8_t iface_index)
 {
@@ -623,6 +646,11 @@ usb_msc_auto_quirk(struct usb_device *ud
 	 */
 	usb_pause_mtx(NULL, hz);
 
+	if (usb_msc_get_max_lun(udev, iface_index) == 0) {
+		DPRINTF("Device has only got one LUN.\n");
+		usbd_add_dynamic_quirk(udev, UQ_MSC_NO_GETMAXLUN);
+	}
+
 	is_no_direct = 1;
 	for (timeout = 4; timeout; timeout--) {
 		err = bbb_command_start(sc, DIR_IN, 0, sc->buffer,

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Tue Nov  1 04:21:57 2011	(r226983)
+++ stable/8/sys/dev/usb/usbdevs	Tue Nov  1 08:24:01 2011	(r226984)
@@ -606,6 +606,7 @@ vendor BALTECH		0x13ad	Baltech
 vendor CISCOLINKSYS	0x13b1	Cisco-Linksys
 vendor SHARK		0x13d2	Shark
 vendor AZUREWAVE	0x13d3	AsureWave
+vendor INITIO		0x13fd	Initio Corporation
 vendor EMTEC		0x13fe	Emtec
 vendor NOVATEL		0x1410	Novatel Wireless
 vendor MERLIN		0x1416	Merlin
@@ -1142,6 +1143,7 @@ product BELKIN RT2870_1		0x8053	RT2870
 product BELKIN RT2870_2		0x805c	RT2870
 product BELKIN F5D8053V3	0x815c	F5D8053 v3
 product BELKIN F5D8055		0x825a	F5D8055
+product BELKIN F5D8055V2	0x825b	F5D8055 v2
 product BELKIN F5D9050V3	0x905b	F5D9050 ver 3 Wireless Adapter
 product BELKIN2 F5U002		0x0002	F5U002 Parallel printer
 product BELKIN F6D4050V1	0x935a	F6D4050 v1
@@ -1225,8 +1227,9 @@ product CISCOLINKSYS HU200TS	0x001a	HU20
 product CISCOLINKSYS WUSB54GC	0x0020	WUSB54GC
 product CISCOLINKSYS WUSB54GR	0x0023	WUSB54GR
 product CISCOLINKSYS WUSBF54G	0x0024	WUSBF54G
-product	CISCOLINKSYS2 RT3070	0x4001	RT3070
-product	CISCOLINKSYS3 RT3070	0x0101	RT3070
+product CISCOLINKSYS AE1000	0x002f	AE1000
+product CISCOLINKSYS2 RT3070	0x4001	RT3070
+product CISCOLINKSYS3 RT3070	0x0101	RT3070
 
 /* Clipsal products */
 product CLIPSAL 5500PCU		0x0303	5500PCU C-Bus
@@ -1567,6 +1570,7 @@ product EXTENDED XTNDACCESS	0x0100	XTNDA
 product FALCOM TWIST		0x0001	USB GSM/GPRS Modem
 
 /* FEIYA products */
+product FEIYA DUMMY		0x0000	Dummy product
 product FEIYA 5IN1		0x1132	5-in-1 Card Reader
 product FEIYA AC110		0x6300	AC-110 Card Reader
 
@@ -1884,6 +1888,10 @@ product IBM USBCDROMDRIVE	0x4427	USB CD-
 /* Imagination Technologies products */
 product IMAGINATION DBX1	0x2107	DBX1 DSP core
 
+/* Initio Corporation products */
+product INITIO DUMMY		0x0000	Dummy product
+product INITIO INIC_1610P	0x1e40	USB to SATA Bridge
+
 /* Inside Out Networks products */
 product INSIDEOUT EDGEPORT4	0x0001	EdgePort/4 serial ports
 
@@ -2774,6 +2782,7 @@ product RATOC REXUSB60F		0xb020	USB seri
 
 /* ReakTek products */
 /* Green House and CompUSA OEM this part */
+product REALTEK DUMMY		0x0000	Dummy product
 product REALTEK USB20CRW	0x0158	USB20CRW Card Reader
 product REALTEK USBKR100	0x8150	USBKR100 USB Ethernet
 product REALTEK RTL8187		0x8187	RTL8187 Wireless Adapter
@@ -2827,6 +2836,7 @@ product SAGEM XG760A		0x004a	XG-760A
 product SAGEM XG76NA		0x0062	XG-76NA
 
 /* Samsung products */
+product SAMSUNG WIS09ABGN	0x2018	WIS09ABGN Wireless LAN adapter
 product SAMSUNG ML6060		0x3008	ML-6060 laser printer
 product SAMSUNG YP_U2		0x5050	YP-U2 MP3 Player
 product SAMSUNG YP_U4		0x5092	YP-U4 MP3 Player

Modified: stable/8/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_run.c	Tue Nov  1 04:21:57 2011	(r226983)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Tue Nov  1 08:24:01 2011	(r226984)
@@ -144,9 +144,11 @@ static const STRUCT_USB_HOST_ID run_devs
     RUN_DEV(AZUREWAVE,		RT3070_3),
     RUN_DEV(BELKIN,		F5D8053V3),
     RUN_DEV(BELKIN,		F5D8055),
+    RUN_DEV(BELKIN,		F5D8055V2),
     RUN_DEV(BELKIN,		F6D4050V1),
     RUN_DEV(BELKIN,		RT2870_1),
     RUN_DEV(BELKIN,		RT2870_2),
+    RUN_DEV(CISCOLINKSYS,	AE1000),
     RUN_DEV(CISCOLINKSYS2,	RT3070),
     RUN_DEV(CISCOLINKSYS3,	RT3070),
     RUN_DEV(CONCEPTRONIC2,	RT2870_1),
@@ -247,6 +249,7 @@ static const STRUCT_USB_HOST_ID run_devs
     RUN_DEV(RALINK,		RT3370),
     RUN_DEV(RALINK,		RT3572),
     RUN_DEV(RALINK,		RT8070),
+    RUN_DEV(SAMSUNG,		WIS09ABGN),
     RUN_DEV(SAMSUNG2,		RT2870_1),
     RUN_DEV(SENAO,		RT2870_1),
     RUN_DEV(SENAO,		RT2870_2),

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 08:57:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93EAB106566B;
	Tue,  1 Nov 2011 08:57:49 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 840A88FC13;
	Tue,  1 Nov 2011 08:57:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA18vnAr057516;
	Tue, 1 Nov 2011 08:57:49 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA18vnjm057514;
	Tue, 1 Nov 2011 08:57:49 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201111010857.pA18vnjm057514@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 1 Nov 2011 08:57:49 +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: r226985 - head/sys/geom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 08:57:49 -0000

Author: mav
Date: Tue Nov  1 08:57:49 2011
New Revision: 226985
URL: http://svn.freebsd.org/changeset/base/226985

Log:
  Workaround the problem introduced by combination of r162200 and r215687.
  r162200 delays provider orphanization until all running requests complete,
  to workaround broken orphan() method implementation in some classes.
  r215687 removes persistent periodic (10Hz) event thread wake ups.
  Together these changes can indefinitely delay orphanization until some
  other event wake up the event thread. One consequence of this is inability
  of CAM to destroy device disconnected when busy and, as consequence, create
  new one after reconnection.
  
  While the best solution would be to revert r162200, it is not easy, as
  some classes still look broken in that way. Instead conditionally wake up
  event thread if there are some providers waiting for orphanization.
  
  MFC after:	1 week

Modified:
  head/sys/geom/geom_event.c

Modified: head/sys/geom/geom_event.c
==============================================================================
--- head/sys/geom/geom_event.c	Tue Nov  1 08:24:01 2011	(r226984)
+++ head/sys/geom/geom_event.c	Tue Nov  1 08:57:49 2011	(r226985)
@@ -294,7 +294,7 @@ g_run_events()
 		} else {
 			g_topology_unlock();
 			msleep(&g_wait_event, &g_eventlock, PRIBIO | PDROP,
-			    "-", 0);
+			    "-", TAILQ_EMPTY(&g_doorstep) ? 0 : hz / 10);
 		}
 	}
 	/* NOTREACHED */

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 09:28:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3372E106564A;
	Tue,  1 Nov 2011 09:28:48 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2360E8FC0A;
	Tue,  1 Nov 2011 09:28:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA19SmvN058459;
	Tue, 1 Nov 2011 09:28:48 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA19SmSP058457;
	Tue, 1 Nov 2011 09:28:48 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201111010928.pA19SmSP058457@svn.freebsd.org>
From: Fabien Thomas 
Date: Tue, 1 Nov 2011 09:28:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226986 - head/usr.sbin/pmcstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 09:28:48 -0000

Author: fabient
Date: Tue Nov  1 09:28:47 2011
New Revision: 226986
URL: http://svn.freebsd.org/changeset/base/226986

Log:
  Two bugs fixed:
  - Do not close stdout or stderr when redirecting to file.
  - Correctly handle error code to detect when no buffer available.
  
  MFC after:	1 month

Modified:
  head/usr.sbin/pmcstat/pmcstat.c

Modified: head/usr.sbin/pmcstat/pmcstat.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcstat.c	Tue Nov  1 08:57:49 2011	(r226985)
+++ head/usr.sbin/pmcstat/pmcstat.c	Tue Nov  1 09:28:47 2011	(r226986)
@@ -796,7 +796,9 @@ main(int argc, char **argv)
 			break;
 
 		case 'o':	/* outputfile */
-			if (args.pa_printfile != NULL)
+			if (args.pa_printfile != NULL &&
+			    args.pa_printfile != stdout &&
+			    args.pa_printfile != stderr)
 				(void) fclose(args.pa_printfile);
 			if ((args.pa_printfile = fopen(optarg, "w")) == NULL)
 				errx(EX_OSERR, "ERROR: cannot open \"%s\" for "
@@ -1394,7 +1396,7 @@ main(int argc, char **argv)
 
 		case EVFILT_TIMER: /* print out counting PMCs */
 			if ((args.pa_flags & FLAG_DO_TOP) &&
-			     pmc_flush_logfile() != ENOBUFS)
+			     pmc_flush_logfile() == 0)
 				do_read = 1;
 			do_print = 1;
 			break;

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 12:33:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF04E106564A;
	Tue,  1 Nov 2011 12:33:06 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DF7618FC18;
	Tue,  1 Nov 2011 12:33:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1CX6wr067145;
	Tue, 1 Nov 2011 12:33:06 GMT (envelope-from pho@svn.freebsd.org)
Received: (from pho@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1CX6BK067143;
	Tue, 1 Nov 2011 12:33:06 GMT (envelope-from pho@svn.freebsd.org)
Message-Id: <201111011233.pA1CX6BK067143@svn.freebsd.org>
From: Peter Holm 
Date: Tue, 1 Nov 2011 12:33:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226987 - head/sys/fs/tmpfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 12:33:07 -0000

Author: pho
Date: Tue Nov  1 12:33:06 2011
New Revision: 226987
URL: http://svn.freebsd.org/changeset/base/226987

Log:
  Added missing cache purge of from argument for rename().
  
  Reported by:	Anton Yuzhaninov 
  In collaboration with:	kib
  MFC after:	1 week

Modified:
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c	Tue Nov  1 09:28:47 2011	(r226986)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c	Tue Nov  1 12:33:06 2011	(r226987)
@@ -1138,6 +1138,7 @@ tmpfs_rename(struct vop_rename_args *v)
 		 * really reclaimed. */
 		tmpfs_free_dirent(VFS_TO_TMPFS(tvp->v_mount), de, TRUE);
 	}
+	cache_purge(fvp);
 
 	error = 0;
 

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 15:34:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6C59106566B;
	Tue,  1 Nov 2011 15:34:52 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B66878FC12;
	Tue,  1 Nov 2011 15:34:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1FYqrM072611;
	Tue, 1 Nov 2011 15:34:52 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1FYq3C072609;
	Tue, 1 Nov 2011 15:34:52 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111011534.pA1FYq3C072609@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Nov 2011 15:34:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226988 - stable/9/sys/fs/nullfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 15:34:52 -0000

Author: kib
Date: Tue Nov  1 15:34:52 2011
New Revision: 226988
URL: http://svn.freebsd.org/changeset/base/226988

Log:
  MFC r226686:
  The covered vnode must be reloced if it was unlocked. Remove VOP_ISLOCKED
  test because of this and also because it can lead to false positives.
  
  Approved by:	re (bz)

Modified:
  stable/9/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 12:33:06 2011	(r226987)
+++ stable/9/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:34:52 2011	(r226988)
@@ -119,7 +119,7 @@ nullfs_mount(struct mount *mp)
 	/*
 	 * Re-lock vnode.
 	 */
-	if (isvnunlocked && !VOP_ISLOCKED(mp->mnt_vnodecovered))
+	if (isvnunlocked)
 		vn_lock(mp->mnt_vnodecovered, LK_EXCLUSIVE | LK_RETRY);
 
 	if (error)

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 15:38:41 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DF299106566B;
	Tue,  1 Nov 2011 15:38:41 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CEA5F8FC13;
	Tue,  1 Nov 2011 15:38:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1FcfPe072788;
	Tue, 1 Nov 2011 15:38:41 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1FcfFK072786;
	Tue, 1 Nov 2011 15:38:41 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111011538.pA1FcfFK072786@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Nov 2011 15:38:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226989 - stable/9/sys/fs/nullfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 15:38:42 -0000

Author: kib
Date: Tue Nov  1 15:38:41 2011
New Revision: 226989
URL: http://svn.freebsd.org/changeset/base/226989

Log:
  MFC r226687:
  The only possible error return from null_nodeget() is due to insmntque1
  failure (the getnewvnode cannot return an error). In this case, the
  null_insmntque_dtr() already unlocked the reclaimed vnode, so VOP_UNLOCK()
  in the nullfs_mount() after null_nodeget() failure is wrong.
  
  Approved by:	re (bz)

Modified:
  stable/9/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:34:52 2011	(r226988)
+++ stable/9/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:38:41 2011	(r226989)
@@ -157,7 +157,6 @@ nullfs_mount(struct mount *mp)
 	 * Make sure the node alias worked
 	 */
 	if (error) {
-		VOP_UNLOCK(vp, 0);
 		vrele(lowerrootvp);
 		free(xmp, M_NULLFSMNT);	/* XXX */
 		return (error);

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 15:41:56 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02CF4106566C;
	Tue,  1 Nov 2011 15:41:56 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E67D08FC19;
	Tue,  1 Nov 2011 15:41:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1Fft5P072928;
	Tue, 1 Nov 2011 15:41:55 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1FftZO072926;
	Tue, 1 Nov 2011 15:41:55 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111011541.pA1FftZO072926@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Nov 2011 15:41:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226990 - stable/9/sys/fs/nullfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 15:41:56 -0000

Author: kib
Date: Tue Nov  1 15:41:55 2011
New Revision: 226990
URL: http://svn.freebsd.org/changeset/base/226990

Log:
  MFC r226688:
  The use of VOP_ISLOCKED() without a check for the return values can cause
  false positives. Replace the #ifdef block with the proper
  ASSERT_VOP_UNLOCKED() assert.
  
  Approved by:	re (bz)

Modified:
  stable/9/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:38:41 2011	(r226989)
+++ stable/9/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:41:55 2011	(r226990)
@@ -242,10 +242,7 @@ nullfs_root(mp, flags, vpp)
 	vp = MOUNTTONULLMOUNT(mp)->nullm_rootvp;
 	VREF(vp);
 
-#ifdef NULLFS_DEBUG
-	if (VOP_ISLOCKED(vp))
-		panic("root vnode is locked.\n");
-#endif
+	ASSERT_VOP_UNLOCKED(vp, "root vnode is locked");
 	vn_lock(vp, flags | LK_RETRY);
 	*vpp = vp;
 	return 0;

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 15:51:10 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3F0EA106566B;
	Tue,  1 Nov 2011 15:51:10 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E7688FC17;
	Tue,  1 Nov 2011 15:51:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1FpAib073255;
	Tue, 1 Nov 2011 15:51:10 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1FpAIY073253;
	Tue, 1 Nov 2011 15:51:10 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111011551.pA1FpAIY073253@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Nov 2011 15:51:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226991 - stable/8/sys/fs/nullfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 15:51:10 -0000

Author: kib
Date: Tue Nov  1 15:51:09 2011
New Revision: 226991
URL: http://svn.freebsd.org/changeset/base/226991

Log:
  MFC r226686:
  The covered vnode must be reloced if it was unlocked. Remove VOP_ISLOCKED
  test because of this and also because it can lead to false positives.

Modified:
  stable/8/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/8/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:41:55 2011	(r226990)
+++ stable/8/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:51:09 2011	(r226991)
@@ -119,7 +119,7 @@ nullfs_mount(struct mount *mp)
 	/*
 	 * Re-lock vnode.
 	 */
-	if (isvnunlocked && !VOP_ISLOCKED(mp->mnt_vnodecovered))
+	if (isvnunlocked)
 		vn_lock(mp->mnt_vnodecovered, LK_EXCLUSIVE | LK_RETRY);
 
 	if (error)

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 15:53:44 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB266106564A;
	Tue,  1 Nov 2011 15:53:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA9F08FC1E;
	Tue,  1 Nov 2011 15:53:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1FriKU073375;
	Tue, 1 Nov 2011 15:53:44 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1FriUk073373;
	Tue, 1 Nov 2011 15:53:44 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111011553.pA1FriUk073373@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Nov 2011 15:53:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226992 - stable/8/sys/fs/nullfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 15:53:45 -0000

Author: kib
Date: Tue Nov  1 15:53:44 2011
New Revision: 226992
URL: http://svn.freebsd.org/changeset/base/226992

Log:
  MFC r226687:
  The only possible error return from null_nodeget() is due to insmntque1
  failure (the getnewvnode cannot return an error). In this case, the
  null_insmntque_dtr() already unlocked the reclaimed vnode, so VOP_UNLOCK()
  in the nullfs_mount() after null_nodeget() failure is wrong.

Modified:
  stable/8/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/8/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:51:09 2011	(r226991)
+++ stable/8/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:53:44 2011	(r226992)
@@ -157,7 +157,6 @@ nullfs_mount(struct mount *mp)
 	 * Make sure the node alias worked
 	 */
 	if (error) {
-		VOP_UNLOCK(vp, 0);
 		vrele(lowerrootvp);
 		free(xmp, M_NULLFSMNT);	/* XXX */
 		return (error);

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 15:56:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6FA36106566B;
	Tue,  1 Nov 2011 15:56:15 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5F4098FC14;
	Tue,  1 Nov 2011 15:56:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1FuFDx073510;
	Tue, 1 Nov 2011 15:56:15 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1FuFAn073508;
	Tue, 1 Nov 2011 15:56:15 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111011556.pA1FuFAn073508@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Nov 2011 15:56:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226993 - stable/8/sys/fs/nullfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 15:56:15 -0000

Author: kib
Date: Tue Nov  1 15:56:15 2011
New Revision: 226993
URL: http://svn.freebsd.org/changeset/base/226993

Log:
  MFC r226688:
  The use of VOP_ISLOCKED() without a check for the return values can cause
  false positives. Replace the #ifdef block with the proper
  ASSERT_VOP_UNLOCKED() assert.

Modified:
  stable/8/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/8/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:53:44 2011	(r226992)
+++ stable/8/sys/fs/nullfs/null_vfsops.c	Tue Nov  1 15:56:15 2011	(r226993)
@@ -242,10 +242,7 @@ nullfs_root(mp, flags, vpp)
 	vp = MOUNTTONULLMOUNT(mp)->nullm_rootvp;
 	VREF(vp);
 
-#ifdef NULLFS_DEBUG
-	if (VOP_ISLOCKED(vp))
-		panic("root vnode is locked.\n");
-#endif
+	ASSERT_VOP_UNLOCKED(vp, "root vnode is locked");
 	vn_lock(vp, flags | LK_RETRY);
 	*vpp = vp;
 	return 0;

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 16:11:44 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB997106564A;
	Tue,  1 Nov 2011 16:11:44 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BAD588FC14;
	Tue,  1 Nov 2011 16:11:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1GBiCE074126;
	Tue, 1 Nov 2011 16:11:44 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1GBiKu074124;
	Tue, 1 Nov 2011 16:11:44 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201111011611.pA1GBiKu074124@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Tue, 1 Nov 2011 16:11:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226994 - stable/9/lib/libc/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 16:11:44 -0000

Author: pluknet
Date: Tue Nov  1 16:11:44 2011
New Revision: 226994
URL: http://svn.freebsd.org/changeset/base/226994

Log:
  MFC r226790:
  Fix typo in timer_getoverrun cross-reference.
  
  Approved by:	re (kib)

Modified:
  stable/9/lib/libc/sys/timer_create.2
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/stdtime/   (props changed)

Modified: stable/9/lib/libc/sys/timer_create.2
==============================================================================
--- stable/9/lib/libc/sys/timer_create.2	Tue Nov  1 15:56:15 2011	(r226993)
+++ stable/9/lib/libc/sys/timer_create.2	Tue Nov  1 16:11:44 2011	(r226994)
@@ -151,7 +151,7 @@ memory protection fault.
 .Sh SEE ALSO
 .Xr clock_getres 2 ,
 .Xr timer_delete 2 ,
-.Xr timer_getoverun 2 ,
+.Xr timer_getoverrun 2 ,
 .Xr siginfo 3
 .Sh STANDARDS
 The

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 16:14:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09D56106564A;
	Tue,  1 Nov 2011 16:14:00 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EA9518FC08;
	Tue,  1 Nov 2011 16:13:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1GDxCI074237;
	Tue, 1 Nov 2011 16:13:59 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1GDxHQ074224;
	Tue, 1 Nov 2011 16:13:59 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201111011613.pA1GDxHQ074224@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 1 Nov 2011 16:13:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226995 - in head/sys: arm/conf conf dev/bm dev/dc
	dev/mii dev/nge dev/sis dev/smc dev/ste dev/stge dev/tl
	dev/wb dev/xl modules/mii pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 16:14:00 -0000

Author: marius
Date: Tue Nov  1 16:13:59 2011
New Revision: 226995
URL: http://svn.freebsd.org/changeset/base/226995

Log:
  - Import the common MII bitbang'ing code from NetBSD and convert drivers to
    take advantage of it instead of duplicating it. This reduces the size of
    the i386 GENERIC kernel by about 4k. The only potential in-tree user left
    unconverted is xe(4), which generally should be changed to use miibus(4)
    instead of implementing PHY handling on its own, as otherwise it makes not
    much sense to add a dependency on miibus(4)/mii_bitbang(4) to xe(4) just
    for the MII bitbang'ing code. The common MII bitbang'ing code also is
    useful in the embedded space for using GPIO pins to implement MII access.
  - Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
    MII bitbang read and write functions of the other drivers converted in
    order to ensure the intended ordering. Given that register access via an
    index register as well as register bank/window switching is subject to the
    same problem, also add bus barriers to the respective functions of smc(4),
    tl(4) and xl(4).
  - Sprinkle some const.
  
  Thanks to the following testers:
  Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
  Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).
  
  Reviewed by:	yongari (subset of drivers)
  Obtained from:	NetBSD (partially)

Added:
  head/sys/dev/mii/mii_bitbang.c   (contents, props changed)
  head/sys/dev/mii/mii_bitbang.h   (contents, props changed)
Modified:
  head/sys/arm/conf/GUMSTIX
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/dev/bm/if_bm.c
  head/sys/dev/bm/if_bmreg.h
  head/sys/dev/bm/if_bmvar.h
  head/sys/dev/dc/if_dc.c
  head/sys/dev/dc/if_dcreg.h
  head/sys/dev/nge/if_nge.c
  head/sys/dev/nge/if_ngereg.h
  head/sys/dev/sis/if_sis.c
  head/sys/dev/sis/if_sisreg.h
  head/sys/dev/smc/if_smc.c
  head/sys/dev/ste/if_ste.c
  head/sys/dev/ste/if_stereg.h
  head/sys/dev/stge/if_stge.c
  head/sys/dev/stge/if_stgereg.h
  head/sys/dev/tl/if_tl.c
  head/sys/dev/tl/if_tlreg.h
  head/sys/dev/wb/if_wb.c
  head/sys/dev/wb/if_wbreg.h
  head/sys/dev/xl/if_xl.c
  head/sys/dev/xl/if_xlreg.h
  head/sys/modules/mii/Makefile
  head/sys/pci/if_rl.c
  head/sys/pci/if_rlreg.h

Modified: head/sys/arm/conf/GUMSTIX
==============================================================================
--- head/sys/arm/conf/GUMSTIX	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/arm/conf/GUMSTIX	Tue Nov  1 16:13:59 2011	(r226995)
@@ -70,6 +70,7 @@ options 	PREEMPTION
 device		loop
 device		ether
 device		mii
+device		mii_bitbang
 device		smc
 device		smcphy
 device		uart

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/conf/NOTES	Tue Nov  1 16:13:59 2011	(r226995)
@@ -1846,13 +1846,15 @@ device		puc
 # MII bus support is required for many PCI Ethernet NICs,
 # namely those which use MII-compliant transceivers or implement
 # transceiver control interfaces that operate like an MII.  Adding
-# "device miibus" to the kernel config pulls in support for
-# the generic miibus API and all of the PHY drivers, including a
-# generic one for PHYs that aren't specifically handled by an
-# individual driver.  Support for specific PHYs may be built by adding
-# "device mii" then adding the appropriate PHY driver.
-device  	miibus		# MII support including all PHYs
+# "device miibus" to the kernel config pulls in support for the generic
+# miibus API, the common support for for bit-bang'ing the MII and all
+# of the PHY drivers, including a generic one for PHYs that aren't
+# specifically handled by an individual driver.  Support for specific
+# PHYs may be built by adding "device mii", "device mii_bitbang" if
+# needed by the NIC driver and then adding the appropriate PHY driver.
 device  	mii		# Minimal MII support
+device  	mii_bitbang	# Common module for bit-bang'ing the MII
+device  	miibus		# MII support w/ bit-bang'ing and all PHYs
 
 device  	acphy		# Altima Communications AC101
 device  	amphy		# AMD AM79c873 / Davicom DM910{1,2}

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/conf/files	Tue Nov  1 16:13:59 2011	(r226995)
@@ -1425,6 +1425,7 @@ dev/mii/ip1000phy.c		optional miibus | i
 dev/mii/jmphy.c			optional miibus | jmphy
 dev/mii/lxtphy.c		optional miibus | lxtphy
 dev/mii/mii.c			optional miibus | mii
+dev/mii/mii_bitbang.c		optional miibus | mii_bitbang
 dev/mii/mii_physubr.c		optional miibus | mii
 dev/mii/miibus_if.m		optional miibus | mii
 dev/mii/mlphy.c			optional miibus | mlphy

Modified: head/sys/dev/bm/if_bm.c
==============================================================================
--- head/sys/dev/bm/if_bm.c	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/dev/bm/if_bm.c	Tue Nov  1 16:13:59 2011	(r226995)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -105,17 +106,28 @@ static void bm_tick		(void *xsc);
 static int bm_ifmedia_upd	(struct ifnet *);
 static void bm_ifmedia_sts	(struct ifnet *, struct ifmediareq *);
 
-static void bm_miicsr_dwrite	(struct bm_softc *, u_int16_t);
-static void bm_mii_writebit	(struct bm_softc *, int);
-static int bm_mii_readbit	(struct bm_softc *);
-static void bm_mii_sync		(struct bm_softc *);
-static void bm_mii_send		(struct bm_softc *, u_int32_t, int);
-static int bm_mii_readreg	(struct bm_softc *, struct bm_mii_frame *);
-static int bm_mii_writereg	(struct bm_softc *, struct bm_mii_frame *);
 static int bm_miibus_readreg	(device_t, int, int);
 static int bm_miibus_writereg	(device_t, int, int, int);
 static void bm_miibus_statchg	(device_t);
 
+/*
+ * MII bit-bang glue
+ */
+static uint32_t bm_mii_bitbang_read(device_t);
+static void bm_mii_bitbang_write(device_t, uint32_t);
+
+static const struct mii_bitbang_ops bm_mii_bitbang_ops = {
+	bm_mii_bitbang_read,
+	bm_mii_bitbang_write,
+	{
+		BM_MII_DATAOUT,	/* MII_BIT_MDO */
+		BM_MII_DATAIN,	/* MII_BIT_MDI */
+		BM_MII_CLK,	/* MII_BIT_MDC */
+		BM_MII_OENABLE,	/* MII_BIT_DIR_HOST_PHY */
+		0,		/* MII_BIT_DIR_PHY_HOST */
+	}
+};
+
 static device_method_t bm_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		bm_probe),
@@ -150,171 +162,36 @@ DRIVER_MODULE(miibus, bm, miibus_driver,
  */
 
 /*
- * Write to the MII csr, introducing a delay to allow valid
- * MII clock pulses to be formed
- */
-static void
-bm_miicsr_dwrite(struct bm_softc *sc, u_int16_t val)
-{
-	CSR_WRITE_2(sc, BM_MII_CSR, val);
-	/*
-	 * Assume this is a clock toggle and generate a 1us delay
-	 * to cover both MII's 160ns high/low minimum and 400ns
-	 * cycle miniumum
-	 */
-	DELAY(1);
-}
-
-/*
- * Write a bit to the MII bus.
- */
-static void
-bm_mii_writebit(struct bm_softc *sc, int bit)
-{
-	u_int16_t regval;
-
-	regval = BM_MII_OENABLE;
-	if (bit)
-		regval |= BM_MII_DATAOUT;
-
-	bm_miicsr_dwrite(sc, regval);
-	bm_miicsr_dwrite(sc, regval | BM_MII_CLK);
-	bm_miicsr_dwrite(sc, regval);
-}
-
-/*
- * Read a bit from the MII bus.
- */
-static int
-bm_mii_readbit(struct bm_softc *sc)
-{
-	u_int16_t regval, bitin;
-
-	/* ~BM_MII_OENABLE */
-	regval = 0;
-
-	bm_miicsr_dwrite(sc, regval);
-	bm_miicsr_dwrite(sc, regval | BM_MII_CLK);
-	bm_miicsr_dwrite(sc, regval);
-	bitin = CSR_READ_2(sc, BM_MII_CSR) & BM_MII_DATAIN;
-
-	return (bitin == BM_MII_DATAIN);
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
+ * Write the MII serial port for the MII bit-bang module.
  */
 static void
-bm_mii_sync(struct bm_softc *sc)
+bm_mii_bitbang_write(device_t dev, uint32_t val)
 {
-	int i;
-	u_int16_t regval;
-
-	regval = BM_MII_OENABLE | BM_MII_DATAOUT;
-
-	bm_miicsr_dwrite(sc, regval);
-	for (i = 0; i < 32; i++) {
-		bm_miicsr_dwrite(sc, regval | BM_MII_CLK);
-		bm_miicsr_dwrite(sc, regval);
-	}
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void
-bm_mii_send(struct bm_softc *sc, u_int32_t bits, int cnt)
-{
-	int i;
-
-	for (i = (0x1 << (cnt - 1)); i; i >>= 1)
-		bm_mii_writebit(sc, bits & i);
-}
-
-/*
- * Read a PHY register through the MII.
- */
-static int
-bm_mii_readreg(struct bm_softc *sc, struct bm_mii_frame *frame)
-{
-	int i, ack, bit;
-
-	/*
-	 * Set up frame for RX.
-	 */
-	frame->mii_stdelim = BM_MII_STARTDELIM;
-	frame->mii_opcode = BM_MII_READOP;
-	frame->mii_turnaround = 0;
-	frame->mii_data = 0;
-
-	/*
-	 * Sync the PHYs
-	 */
-	bm_mii_sync(sc);
-
-	/*
-	 * Send command/address info
-	 */
-	bm_mii_send(sc, frame->mii_stdelim, 2);
-	bm_mii_send(sc, frame->mii_opcode, 2);
-	bm_mii_send(sc, frame->mii_phyaddr, 5);
-	bm_mii_send(sc, frame->mii_regaddr, 5);
-
-	/*
-	 * Check for ack.
-	 */
-	ack = bm_mii_readbit(sc);
-
-	/*
-	 * Now try reading data bits. If the ack failed, we still
-	 * need to clock through 16 cycles to keep the PHY(s) in sync.
-	 */
-	for (i = 0x8000; i; i >>= 1) {
-		bit = bm_mii_readbit(sc);
-		if (!ack && bit)
-			frame->mii_data |= i;
-	}
+	struct bm_softc *sc;
 
-	/*
-	 * Skip through idle bit-times
-	 */
-	bm_mii_writebit(sc, 0);
-	bm_mii_writebit(sc, 0);
+	sc = device_get_softc(dev);
 
-	return ((ack) ? 1 : 0);
+	CSR_WRITE_2(sc, BM_MII_CSR, val);
+	CSR_BARRIER(sc, BM_MII_CSR, 2,
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 }
 
 /*
- * Write to a PHY register through the MII.
+ * Read the MII serial port for the MII bit-bang module.
  */
-static int
-bm_mii_writereg(struct bm_softc *sc, struct bm_mii_frame *frame)
+static uint32_t
+bm_mii_bitbang_read(device_t dev)
 {
-	/*
-	 * Set up frame for tx
-	 */
-	frame->mii_stdelim = BM_MII_STARTDELIM;
-	frame->mii_opcode = BM_MII_WRITEOP;
-	frame->mii_turnaround = BM_MII_TURNAROUND;
-
-	/*
-	 * Sync the phy and start the bitbang write sequence
-	 */
-	bm_mii_sync(sc);
+	struct bm_softc *sc;
+	uint32_t reg;
 
-	bm_mii_send(sc, frame->mii_stdelim, 2);
-	bm_mii_send(sc, frame->mii_opcode, 2);
-	bm_mii_send(sc, frame->mii_phyaddr, 5);
-	bm_mii_send(sc, frame->mii_regaddr, 5);
-	bm_mii_send(sc, frame->mii_turnaround, 2);
-	bm_mii_send(sc, frame->mii_data, 16);
+	sc = device_get_softc(dev);
 
-	/*
-	 * Idle bit.
-	 */
-	bm_mii_writebit(sc, 0);
+	reg = CSR_READ_2(sc, BM_MII_CSR);
+	CSR_BARRIER(sc, BM_MII_CSR, 2,
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
-	return (0);
+	return (reg);
 }
 
 /*
@@ -323,34 +200,15 @@ bm_mii_writereg(struct bm_softc *sc, str
 static int
 bm_miibus_readreg(device_t dev, int phy, int reg)
 {
-	struct bm_softc *sc;
-	struct bm_mii_frame frame;
-
-	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
-
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
 
-	bm_mii_readreg(sc, &frame);
-
-	return (frame.mii_data);
+	return (mii_bitbang_readreg(dev, &bm_mii_bitbang_ops, phy, reg));
 }
 
 static int
 bm_miibus_writereg(device_t dev, int phy, int reg, int data)
 {
-	struct bm_softc *sc;
-	struct bm_mii_frame frame;
-
-	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
-
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
-	frame.mii_data = data;
 
-	bm_mii_writereg(sc, &frame);
+	mii_bitbang_readreg(dev, &bm_mii_bitbang_ops, phy, reg);
 
 	return (0);
 }

Modified: head/sys/dev/bm/if_bmreg.h
==============================================================================
--- head/sys/dev/bm/if_bmreg.h	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/dev/bm/if_bmreg.h	Tue Nov  1 16:13:59 2011	(r226995)
@@ -129,14 +129,6 @@
 #define BM_MII_DATAIN	0x0008		/* MDIO data in */
 
 /*
- * MII constants
- */
-#define BM_MII_STARTDELIM	0x01
-#define BM_MII_READOP		0x02
-#define BM_MII_WRITEOP		0x01
-#define BM_MII_TURNAROUND	0x02
-
-/*
  * Various flags
  */
 
@@ -174,3 +166,5 @@
 #define	CSR_READ_1(sc, reg)		\
 	bus_read_1(sc->sc_memr, reg)
 
+#define CSR_BARRIER(sc, reg, length, flags)				\
+	bus_barrier(sc->sc_memr, reg, length, flags)

Modified: head/sys/dev/bm/if_bmvar.h
==============================================================================
--- head/sys/dev/bm/if_bmvar.h	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/dev/bm/if_bmvar.h	Tue Nov  1 16:13:59 2011	(r226995)
@@ -46,7 +46,6 @@
 /*
  * software state for transmit job mbufs (may be elements of mbuf chains)
  */
-
 struct bm_txsoft {
 	struct mbuf *txs_mbuf;		/* head of our mbuf chain */
 	bus_dmamap_t txs_dmamap;	/* our DMA map */
@@ -71,7 +70,6 @@ struct bm_rxsoft {
 	bus_dma_segment_t segment;
 };
 
-
 struct bm_softc {
 	struct ifnet    	*sc_ifp;
 	struct mtx		sc_mtx;	
@@ -113,13 +111,3 @@ struct bm_softc {
 
 	dbdma_channel_t		*sc_txdma, *sc_rxdma;
 };
-
-struct bm_mii_frame {
-	u_int8_t		mii_stdelim;
-	u_int8_t		mii_opcode;
-	u_int8_t		mii_phyaddr;
-	u_int8_t		mii_regaddr;
-	u_int8_t		mii_turnaround;
-	u_int16_t		mii_data;
-};
-

Modified: head/sys/dev/dc/if_dc.c
==============================================================================
--- head/sys/dev/dc/if_dc.c	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/dev/dc/if_dc.c	Tue Nov  1 16:13:59 2011	(r226995)
@@ -122,6 +122,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -149,7 +150,7 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1);
 /*
  * Various supported device vendors/types and their names.
  */
-static const struct dc_type dc_devs[] = {
+static const struct dc_type const dc_devs[] = {
 	{ DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143), 0,
 		"Intel 21143 10/100BaseTX" },
 	{ DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009), 0,
@@ -272,12 +273,6 @@ static void dc_eeprom_getword_xircom(str
 static void dc_eeprom_width(struct dc_softc *);
 static void dc_read_eeprom(struct dc_softc *, caddr_t, int, int, int);
 
-static void dc_mii_writebit(struct dc_softc *, int);
-static int dc_mii_readbit(struct dc_softc *);
-static void dc_mii_sync(struct dc_softc *);
-static void dc_mii_send(struct dc_softc *, uint32_t, int);
-static int dc_mii_readreg(struct dc_softc *, struct dc_mii_frame *);
-static int dc_mii_writereg(struct dc_softc *, struct dc_mii_frame *);
 static int dc_miibus_readreg(device_t, int, int);
 static int dc_miibus_writereg(device_t, int, int, int);
 static void dc_miibus_statchg(device_t);
@@ -307,6 +302,24 @@ static int dc_decode_leaf_sym(struct dc_
 static void dc_apply_fixup(struct dc_softc *, int);
 static int dc_check_multiport(struct dc_softc *);
 
+/*
+ * MII bit-bang glue
+ */
+static uint32_t dc_mii_bitbang_read(device_t);
+static void dc_mii_bitbang_write(device_t, uint32_t);
+
+static const struct mii_bitbang_ops dc_mii_bitbang_ops = {
+	dc_mii_bitbang_read,
+	dc_mii_bitbang_write,
+	{
+		DC_SIO_MII_DATAOUT,	/* MII_BIT_MDO */
+		DC_SIO_MII_DATAIN,	/* MII_BIT_MDI */
+		DC_SIO_MII_CLK,		/* MII_BIT_MDC */
+		0,			/* MII_BIT_DIR_HOST_PHY */
+		DC_SIO_MII_DIR,		/* MII_BIT_DIR_PHY_HOST */
+	}
+};
+
 #ifdef DC_USEIOSPACE
 #define	DC_RES			SYS_RES_IOPORT
 #define	DC_RID			DC_PCI_CFBIO
@@ -611,185 +624,45 @@ dc_read_eeprom(struct dc_softc *sc, cadd
 }
 
 /*
- * The following two routines are taken from the Macronix 98713
- * Application Notes pp.19-21.
- */
-/*
- * Write a bit to the MII bus.
+ * Write the MII serial port for the MII bit-bang module.
  */
 static void
-dc_mii_writebit(struct dc_softc *sc, int bit)
+dc_mii_bitbang_write(device_t dev, uint32_t val)
 {
-	uint32_t reg;
+	struct dc_softc *sc;
 
-	reg = DC_SIO_ROMCTL_WRITE | (bit != 0 ? DC_SIO_MII_DATAOUT : 0);
-	CSR_WRITE_4(sc, DC_SIO, reg);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
+	sc = device_get_softc(dev);
 
-	CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	CSR_WRITE_4(sc, DC_SIO, reg);
+	CSR_WRITE_4(sc, DC_SIO, val);
 	CSR_BARRIER_4(sc, DC_SIO,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
 }
 
 /*
- * Read a bit from the MII bus.
+ * Read the MII serial port for the MII bit-bang module.
  */
-static int
-dc_mii_readbit(struct dc_softc *sc)
+static uint32_t
+dc_mii_bitbang_read(device_t dev)
 {
-	uint32_t reg;
-
-	reg = DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR;
-	CSR_WRITE_4(sc, DC_SIO, reg);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	(void)CSR_READ_4(sc, DC_SIO);
-	CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	CSR_WRITE_4(sc, DC_SIO, reg);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	if (CSR_READ_4(sc, DC_SIO) & DC_SIO_MII_DATAIN)
-		return (1);
-
-	return (0);
-}
+	struct dc_softc *sc;
+	uint32_t val;
 
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void
-dc_mii_sync(struct dc_softc *sc)
-{
-	int i;
+	sc = device_get_softc(dev);
 
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE);
+	val = CSR_READ_4(sc, DC_SIO);
 	CSR_BARRIER_4(sc, DC_SIO,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-
-	for (i = 0; i < 32; i++)
-		dc_mii_writebit(sc, 1);
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void
-dc_mii_send(struct dc_softc *sc, uint32_t bits, int cnt)
-{
-	int i;
-
-	for (i = (0x1 << (cnt - 1)); i; i >>= 1)
-		dc_mii_writebit(sc, bits & i);
-}
 
-/*
- * Read an PHY register through the MII.
- */
-static int
-dc_mii_readreg(struct dc_softc *sc, struct dc_mii_frame *frame)
-{
-	int i;
-
-	/*
-	 * Set up frame for RX.
-	 */
-	frame->mii_stdelim = DC_MII_STARTDELIM;
-	frame->mii_opcode = DC_MII_READOP;
-
-	/*
-	 * Sync the PHYs.
-	 */
-	dc_mii_sync(sc);
-
-	/*
-	 * Send command/address info.
-	 */
-	dc_mii_send(sc, frame->mii_stdelim, 2);
-	dc_mii_send(sc, frame->mii_opcode, 2);
-	dc_mii_send(sc, frame->mii_phyaddr, 5);
-	dc_mii_send(sc, frame->mii_regaddr, 5);
-
-	/*
-	 * Now try reading data bits.  If the turnaround failed, we still
-	 * need to clock through 16 cycles to keep the PHY(s) in sync.
-	 */
-	frame->mii_turnaround = dc_mii_readbit(sc);
-	if (frame->mii_turnaround != 0) {
-		for (i = 0; i < 16; i++)
-			dc_mii_readbit(sc);
-		goto fail;
-	}
-	for (i = 0x8000; i; i >>= 1) {
-		if (dc_mii_readbit(sc))
-			frame->mii_data |= i;
-	}
-
-fail:
-
-	/* Clock the idle bits. */
-	dc_mii_writebit(sc, 0);
-	dc_mii_writebit(sc, 0);
-
-	if (frame->mii_turnaround != 0)
-		return (1);
-	return (0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int
-dc_mii_writereg(struct dc_softc *sc, struct dc_mii_frame *frame)
-{
-
-	/*
-	 * Set up frame for TX.
-	 */
-	frame->mii_stdelim = DC_MII_STARTDELIM;
-	frame->mii_opcode = DC_MII_WRITEOP;
-	frame->mii_turnaround = DC_MII_TURNAROUND;
-
-	/*
-	 * Sync the PHYs.
-	 */
-	dc_mii_sync(sc);
-
-	dc_mii_send(sc, frame->mii_stdelim, 2);
-	dc_mii_send(sc, frame->mii_opcode, 2);
-	dc_mii_send(sc, frame->mii_phyaddr, 5);
-	dc_mii_send(sc, frame->mii_regaddr, 5);
-	dc_mii_send(sc, frame->mii_turnaround, 2);
-	dc_mii_send(sc, frame->mii_data, 16);
-
-	/* Clock the idle bits. */
-	dc_mii_writebit(sc, 0);
-	dc_mii_writebit(sc, 0);
-
-	return (0);
+	return (val);
 }
 
 static int
 dc_miibus_readreg(device_t dev, int phy, int reg)
 {
-	struct dc_mii_frame frame;
-	struct dc_softc	 *sc;
+	struct dc_softc *sc;
 	int i, rval, phy_reg = 0;
 
 	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
 
 	if (sc->dc_pmode != DC_PMODE_MII) {
 		if (phy == (MII_NPHY - 1)) {
@@ -881,34 +754,29 @@ dc_miibus_readreg(device_t dev, int phy,
 		}
 
 		rval = CSR_READ_4(sc, phy_reg) & 0x0000FFFF;
-
 		if (rval == 0xFFFF)
 			return (0);
 		return (rval);
 	}
 
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
 	if (sc->dc_type == DC_TYPE_98713) {
 		phy_reg = CSR_READ_4(sc, DC_NETCFG);
 		CSR_WRITE_4(sc, DC_NETCFG, phy_reg & ~DC_NETCFG_PORTSEL);
 	}
-	dc_mii_readreg(sc, &frame);
+	rval = mii_bitbang_readreg(dev, &dc_mii_bitbang_ops, phy, reg);
 	if (sc->dc_type == DC_TYPE_98713)
 		CSR_WRITE_4(sc, DC_NETCFG, phy_reg);
 
-	return (frame.mii_data);
+	return (rval);
 }
 
 static int
 dc_miibus_writereg(device_t dev, int phy, int reg, int data)
 {
 	struct dc_softc *sc;
-	struct dc_mii_frame frame;
 	int i, phy_reg = 0;
 
 	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
 
 	if (DC_IS_PNIC(sc)) {
 		CSR_WRITE_4(sc, DC_PN_MII, DC_PN_MIIOPCODE_WRITE |
@@ -964,15 +832,11 @@ dc_miibus_writereg(device_t dev, int phy
 		return (0);
 	}
 
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
-	frame.mii_data = data;
-
 	if (sc->dc_type == DC_TYPE_98713) {
 		phy_reg = CSR_READ_4(sc, DC_NETCFG);
 		CSR_WRITE_4(sc, DC_NETCFG, phy_reg & ~DC_NETCFG_PORTSEL);
 	}
-	dc_mii_writereg(sc, &frame);
+	mii_bitbang_writereg(dev, &dc_mii_bitbang_ops, phy, reg, data);
 	if (sc->dc_type == DC_TYPE_98713)
 		CSR_WRITE_4(sc, DC_NETCFG, phy_reg);
 

Modified: head/sys/dev/dc/if_dcreg.h
==============================================================================
--- head/sys/dev/dc/if_dcreg.h	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/dev/dc/if_dcreg.h	Tue Nov  1 16:13:59 2011	(r226995)
@@ -531,27 +531,9 @@ struct dc_mediainfo {
 struct dc_type {
 	uint32_t		dc_devid;
 	uint8_t			dc_minrev;
-	char			*dc_name;
+	const char		*dc_name;
 };
 
-struct dc_mii_frame {
-	uint8_t			mii_stdelim;
-	uint8_t			mii_opcode;
-	uint8_t			mii_phyaddr;
-	uint8_t			mii_regaddr;
-	uint8_t			mii_turnaround;
-	uint16_t		mii_data;
-};
-
-/*
- * MII constants
- */
-#define	DC_MII_STARTDELIM	0x01
-#define	DC_MII_READOP		0x02
-#define	DC_MII_WRITEOP		0x01
-#define	DC_MII_TURNAROUND	0x02
-
-
 /*
  * Registers specific to clone devices.
  * This mainly relates to RX filter programming: not all 21x4x clones
@@ -827,7 +809,7 @@ struct dc_softc {
 #define	CSR_READ_4(sc, reg)		\
 	bus_space_read_4(sc->dc_btag, sc->dc_bhandle, reg)
 
-#define	CSR_BARRIER_4(sc, reg, flags)		\
+#define	CSR_BARRIER_4(sc, reg, flags)					\
 	bus_space_barrier(sc->dc_btag, sc->dc_bhandle, reg, 4, flags)
 
 #define	DC_TIMEOUT		1000

Added: head/sys/dev/mii/mii_bitbang.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/mii/mii_bitbang.c	Tue Nov  1 16:13:59 2011	(r226995)
@@ -0,0 +1,180 @@
+/*	$NetBSD: mii_bitbang.c,v 1.12 2008/05/04 17:06:09 xtraeme Exp $	*/
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * 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 didevlaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following didevlaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+/*
+ * Common module for bit-bang'ing the MII.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+MODULE_VERSION(mii_bitbang, 1);
+
+static void mii_bitbang_sendbits(device_t dev, mii_bitbang_ops_t ops,
+    uint32_t data, int nbits);
+
+#define	MWRITE(x)							\
+do {									\
+	ops->mbo_write(dev, (x));					\
+	DELAY(1);							\
+} while (/* CONSTCOND */ 0)
+
+#define	MREAD		ops->mbo_read(dev)
+
+#define	MDO		ops->mbo_bits[MII_BIT_MDO]
+#define	MDI		ops->mbo_bits[MII_BIT_MDI]
+#define	MDC		ops->mbo_bits[MII_BIT_MDC]
+#define	MDIRPHY		ops->mbo_bits[MII_BIT_DIR_HOST_PHY]
+#define	MDIRHOST	ops->mbo_bits[MII_BIT_DIR_PHY_HOST]
+
+/*
+ * mii_bitbang_sync:
+ *
+ *	Synchronize the MII.
+ */
+void
+mii_bitbang_sync(device_t dev, mii_bitbang_ops_t ops)
+{
+	int i;
+	uint32_t v;
+
+	v = MDIRPHY | MDO;
+
+	MWRITE(v);
+	for (i = 0; i < 32; i++) {
+		MWRITE(v | MDC);
+		MWRITE(v);
+	}
+}
+
+/*
+ * mii_bitbang_sendbits:
+ *
+ *	Send a series of bits to the MII.
+ */
+static void
+mii_bitbang_sendbits(device_t dev, mii_bitbang_ops_t ops, uint32_t data,
+    int nbits)
+{
+	int i;
+	uint32_t v;
+
+	v = MDIRPHY;
+	MWRITE(v);
+
+	for (i = 1 << (nbits - 1); i != 0; i >>= 1) {
+		if (data & i)
+			v |= MDO;
+		else
+			v &= ~MDO;
+		MWRITE(v);
+		MWRITE(v | MDC);
+		MWRITE(v);
+	}
+}
+
+/*
+ * mii_bitbang_readreg:
+ *
+ *	Read a PHY register by bit-bang'ing the MII.
+ */
+int
+mii_bitbang_readreg(device_t dev, mii_bitbang_ops_t ops, int phy, int reg)
+{
+	int i, error, val;
+
+	mii_bitbang_sync(dev, ops);
+
+	mii_bitbang_sendbits(dev, ops, MII_COMMAND_START, 2);
+	mii_bitbang_sendbits(dev, ops, MII_COMMAND_READ, 2);
+	mii_bitbang_sendbits(dev, ops, phy, 5);
+	mii_bitbang_sendbits(dev, ops, reg, 5);
+
+	/* Switch direction to PHY->host, without a clock transition. */
+	MWRITE(MDIRHOST);
+
+	/* Turnaround clock. */
+	MWRITE(MDIRHOST | MDC);
+	MWRITE(MDIRHOST);
+
+	/* Check for error. */
+	error = MREAD & MDI;
+
+	/* Idle clock. */
+	MWRITE(MDIRHOST | MDC);
+	MWRITE(MDIRHOST);
+
+	val = 0;
+	for (i = 0; i < 16; i++) {
+		val <<= 1;
+		/* Read data prior to clock low-high transition. */
+		if (error == 0 && (MREAD & MDI) != 0)
+			val |= 1;
+
+		MWRITE(MDIRHOST | MDC);
+		MWRITE(MDIRHOST);
+	}
+
+	/* Set direction to host->PHY, without a clock transition. */
+	MWRITE(MDIRPHY);
+
+	return (error != 0 ? 0 : val);
+}
+
+/*
+ * mii_bitbang_writereg:
+ *
+ *	Write a PHY register by bit-bang'ing the MII.
+ */
+void
+mii_bitbang_writereg(device_t dev, mii_bitbang_ops_t ops, int phy, int reg,
+    int val)
+{
+
+	mii_bitbang_sync(dev, ops);
+
+	mii_bitbang_sendbits(dev, ops, MII_COMMAND_START, 2);
+	mii_bitbang_sendbits(dev, ops, MII_COMMAND_WRITE, 2);
+	mii_bitbang_sendbits(dev, ops, phy, 5);
+	mii_bitbang_sendbits(dev, ops, reg, 5);
+	mii_bitbang_sendbits(dev, ops, MII_COMMAND_ACK, 2);
+	mii_bitbang_sendbits(dev, ops, val, 16);
+
+	MWRITE(MDIRPHY);
+}

Added: head/sys/dev/mii/mii_bitbang.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/mii/mii_bitbang.h	Tue Nov  1 16:13:59 2011	(r226995)
@@ -0,0 +1,54 @@
+/*	$NetBSD: mii_bitbang.h,v 1.6 2009/05/12 14:31:27 cegger Exp $	*/
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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$
+ */
+
+#define	MII_BIT_MDO		0	/* data out (host->PHY) */
+#define	MII_BIT_MDI		1	/* data in (PHY->host) */
+#define	MII_BIT_MDC		2	/* clock */
+#define	MII_BIT_DIR_HOST_PHY	3	/* set direction: host->PHY */
+#define	MII_BIT_DIR_PHY_HOST	4	/* set direction: PHY->host */
+#define	MII_NBITS		5
+
+struct mii_bitbang_ops {
+	uint32_t	(*mbo_read)(device_t);
+	void		(*mbo_write)(device_t, uint32_t);
+	uint32_t	mbo_bits[MII_NBITS];
+};
+
+typedef	const struct mii_bitbang_ops *mii_bitbang_ops_t;
+
+int	mii_bitbang_readreg(device_t dev, mii_bitbang_ops_t ops,
+	    int phy, int reg);
+void	mii_bitbang_sync(device_t dev, mii_bitbang_ops_t ops);
+void	mii_bitbang_writereg(device_t dev, mii_bitbang_ops_t ops,
+	    int phy, int reg, int val);

Modified: head/sys/dev/nge/if_nge.c
==============================================================================
--- head/sys/dev/nge/if_nge.c	Tue Nov  1 16:11:44 2011	(r226994)
+++ head/sys/dev/nge/if_nge.c	Tue Nov  1 16:13:59 2011	(r226995)
@@ -117,6 +117,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -138,7 +139,7 @@ MODULE_DEPEND(nge, miibus, 1, 1, 1);
 /*
  * Various supported device vendors/types and their names.
  */
-static struct nge_type nge_devs[] = {
+static const struct nge_type const nge_devs[] = {
 	{ NGE_VENDORID, NGE_DEVICEID,
 	    "National Semiconductor Gigabit Ethernet" },
 	{ 0, 0, NULL }
@@ -180,11 +181,6 @@ static void nge_eeprom_putbyte(struct ng
 static void nge_eeprom_getword(struct nge_softc *, int, uint16_t *);
 static void nge_read_eeprom(struct nge_softc *, caddr_t, int, int);
 
-static void nge_mii_sync(struct nge_softc *);
-static void nge_mii_send(struct nge_softc *, uint32_t, int);
-static int nge_mii_readreg(struct nge_softc *, struct nge_mii_frame *);
-static int nge_mii_writereg(struct nge_softc *, struct nge_mii_frame *);
-
 static int nge_miibus_readreg(device_t, int, int);
 static int nge_miibus_writereg(device_t, int, int, int);
 static void nge_miibus_statchg(device_t);
@@ -200,6 +196,24 @@ static void nge_sysctl_node(struct nge_s
 static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int);
 static int sysctl_hw_nge_int_holdoff(SYSCTL_HANDLER_ARGS);
 
+/*
+ * MII bit-bang glue
+ */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 16:27:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6BA8B1065677;
	Tue,  1 Nov 2011 16:27:47 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5AD5D8FC14;
	Tue,  1 Nov 2011 16:27:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1GRlGh074817;
	Tue, 1 Nov 2011 16:27:47 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1GRlFV074815;
	Tue, 1 Nov 2011 16:27:47 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201111011627.pA1GRlFV074815@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Tue, 1 Nov 2011 16:27:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226996 - stable/8/lib/libc/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 16:27:47 -0000

Author: pluknet
Date: Tue Nov  1 16:27:47 2011
New Revision: 226996
URL: http://svn.freebsd.org/changeset/base/226996

Log:
  MFC r226790:
  Fix typo in timer_getoverrun cross-reference.

Modified:
  stable/8/lib/libc/sys/timer_create.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/sys/timer_create.2
==============================================================================
--- stable/8/lib/libc/sys/timer_create.2	Tue Nov  1 16:13:59 2011	(r226995)
+++ stable/8/lib/libc/sys/timer_create.2	Tue Nov  1 16:27:47 2011	(r226996)
@@ -151,7 +151,7 @@ memory protection fault.
 .Sh SEE ALSO
 .Xr clock_getres 2 ,
 .Xr timer_delete 2 ,
-.Xr timer_getoverun 2 ,
+.Xr timer_getoverrun 2 ,
 .Xr siginfo 3
 .Sh STANDARDS
 The

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 16:56:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A13D106566B;
	Tue,  1 Nov 2011 16:56:43 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 294B78FC17;
	Tue,  1 Nov 2011 16:56:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1GuhiI075742;
	Tue, 1 Nov 2011 16:56:43 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1GuhhK075740;
	Tue, 1 Nov 2011 16:56:43 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201111011656.pA1GuhhK075740@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Tue, 1 Nov 2011 16:56:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226997 - stable/7/lib/libc/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 16:56:43 -0000

Author: pluknet
Date: Tue Nov  1 16:56:42 2011
New Revision: 226997
URL: http://svn.freebsd.org/changeset/base/226997

Log:
  MFC r226790:
  Fix typo in timer_getoverrun cross-reference.

Modified:
  stable/7/lib/libc/sys/timer_create.2
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/sys/timer_create.2
==============================================================================
--- stable/7/lib/libc/sys/timer_create.2	Tue Nov  1 16:27:47 2011	(r226996)
+++ stable/7/lib/libc/sys/timer_create.2	Tue Nov  1 16:56:42 2011	(r226997)
@@ -151,7 +151,7 @@ memory protection fault.
 .Sh SEE ALSO
 .Xr clock_getres 2 ,
 .Xr timer_delete 2 ,
-.Xr timer_getoverun 2 ,
+.Xr timer_getoverrun 2 ,
 .Xr siginfo 3
 .Sh STANDARDS
 The

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 17:04:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27E001065670;
	Tue,  1 Nov 2011 17:04:43 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 173648FC12;
	Tue,  1 Nov 2011 17:04:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1H4gmL076028;
	Tue, 1 Nov 2011 17:04:42 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1H4gmm076026;
	Tue, 1 Nov 2011 17:04:42 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201111011704.pA1H4gmm076026@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 1 Nov 2011 17:04:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226998 - head/sys/geom/stripe
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 17:04:43 -0000

Author: mav
Date: Tue Nov  1 17:04:42 2011
New Revision: 226998
URL: http://svn.freebsd.org/changeset/base/226998

Log:
  Refactor disk disconnection and geom destruction handling sequences.
  Do not close/destroy opened consumer directly in case of disconnect. Instead
  keep it existing until it will be closed in regular way in response to
  upstream provider destruction. Delay geom destruction in the same way.
  Previous implementation could destroy consumers still having active
  requests and worked only because of global workaround made on GEOM level.

Modified:
  head/sys/geom/stripe/g_stripe.c

Modified: head/sys/geom/stripe/g_stripe.c
==============================================================================
--- head/sys/geom/stripe/g_stripe.c	Tue Nov  1 16:56:42 2011	(r226997)
+++ head/sys/geom/stripe/g_stripe.c	Tue Nov  1 17:04:42 2011	(r226998)
@@ -160,28 +160,35 @@ static void
 g_stripe_remove_disk(struct g_consumer *cp)
 {
 	struct g_stripe_softc *sc;
-	u_int no;
 
+	g_topology_assert();
 	KASSERT(cp != NULL, ("Non-valid disk in %s.", __func__));
-	sc = (struct g_stripe_softc *)cp->private;
+	sc = (struct g_stripe_softc *)cp->geom->softc;
 	KASSERT(sc != NULL, ("NULL sc in %s.", __func__));
-	no = cp->index;
 
-	G_STRIPE_DEBUG(0, "Disk %s removed from %s.", cp->provider->name,
-	    sc->sc_name);
+	if (cp->private == NULL) {
+		G_STRIPE_DEBUG(0, "Disk %s removed from %s.",
+		    cp->provider->name, sc->sc_name);
+		cp->private = (void *)(uintptr_t)-1;
+	}
 
-	sc->sc_disks[no] = NULL;
 	if (sc->sc_provider != NULL) {
 		sc->sc_provider->flags |= G_PF_WITHER;
+		G_STRIPE_DEBUG(0, "Device %s deactivated.",
+		    sc->sc_provider->name);
 		g_orphan_provider(sc->sc_provider, ENXIO);
 		sc->sc_provider = NULL;
-		G_STRIPE_DEBUG(0, "Device %s removed.", sc->sc_name);
 	}
 
 	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
-		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
+		return;
+	sc->sc_disks[cp->index] = NULL;
+	cp->index = 0;
 	g_detach(cp);
 	g_destroy_consumer(cp);
+	/* If there are no valid disks anymore, remove device. */
+	if (LIST_EMPTY(&sc->sc_geom->consumer))
+		g_stripe_destroy(sc, 1);
 }
 
 static void
@@ -197,36 +204,20 @@ g_stripe_orphan(struct g_consumer *cp)
 		return;
 
 	g_stripe_remove_disk(cp);
-	/* If there are no valid disks anymore, remove device. */
-	if (g_stripe_nvalid(sc) == 0)
-		g_stripe_destroy(sc, 1);
 }
 
 static int
 g_stripe_access(struct g_provider *pp, int dr, int dw, int de)
 {
-	struct g_consumer *cp1, *cp2;
+	struct g_consumer *cp1, *cp2, *tmp;
 	struct g_stripe_softc *sc;
 	struct g_geom *gp;
 	int error;
 
+	g_topology_assert();
 	gp = pp->geom;
 	sc = gp->softc;
-
-	if (sc == NULL) {
-		/*
-		 * It looks like geom is being withered.
-		 * In that case we allow only negative requests.
-		 */
-		KASSERT(dr <= 0 && dw <= 0 && de <= 0,
-		    ("Positive access request (device=%s).", pp->name));
-		if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 &&
-		    (pp->ace + de) == 0) {
-			G_STRIPE_DEBUG(0, "Device %s definitely destroyed.",
-			    gp->name);
-		}
-		return (0);
-	}
+	KASSERT(sc != NULL, ("NULL sc in %s.", __func__));
 
 	/* On first open, grab an extra "exclusive" bit */
 	if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0)
@@ -235,22 +226,23 @@ g_stripe_access(struct g_provider *pp, i
 	if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && (pp->ace + de) == 0)
 		de--;
 
-	error = ENXIO;
-	LIST_FOREACH(cp1, &gp->consumer, consumer) {
+	LIST_FOREACH_SAFE(cp1, &gp->consumer, consumer, tmp) {
 		error = g_access(cp1, dr, dw, de);
-		if (error == 0)
-			continue;
-		/*
-		 * If we fail here, backout all previous changes.
-		 */
-		LIST_FOREACH(cp2, &gp->consumer, consumer) {
-			if (cp1 == cp2)
-				return (error);
-			g_access(cp2, -dr, -dw, -de);
+		if (error != 0)
+			goto fail;
+		if (cp1->acr == 0 && cp1->acw == 0 && cp1->ace == 0 &&
+		    cp1->private != NULL) {
+			g_stripe_remove_disk(cp1); /* May destroy geom. */
 		}
-		/* NOTREACHED */
 	}
+	return (0);
 
+fail:
+	LIST_FOREACH(cp2, &gp->consumer, consumer) {
+		if (cp1 == cp2)
+			break;
+		g_access(cp2, -dr, -dw, -de);
+	}
 	return (error);
 }
 
@@ -652,6 +644,7 @@ g_stripe_check_and_run(struct g_stripe_s
 	off_t mediasize, ms;
 	u_int no, sectorsize = 0;
 
+	g_topology_assert();
 	if (g_stripe_nvalid(sc) != sc->sc_ndisks)
 		return;
 
@@ -681,7 +674,7 @@ g_stripe_check_and_run(struct g_stripe_s
 	sc->sc_provider->stripeoffset = 0;
 	g_error_provider(sc->sc_provider, 0);
 
-	G_STRIPE_DEBUG(0, "Device %s activated.", sc->sc_name);
+	G_STRIPE_DEBUG(0, "Device %s activated.", sc->sc_provider->name);
 }
 
 static int
@@ -722,6 +715,7 @@ g_stripe_add_disk(struct g_stripe_softc 
 	struct g_geom *gp;
 	int error;
 
+	g_topology_assert();
 	/* Metadata corrupted? */
 	if (no >= sc->sc_ndisks)
 		return (EINVAL);
@@ -734,6 +728,8 @@ g_stripe_add_disk(struct g_stripe_softc 
 	fcp = LIST_FIRST(&gp->consumer);
 
 	cp = g_new_consumer(gp);
+	cp->private = NULL;
+	cp->index = no;
 	error = g_attach(cp, pp);
 	if (error != 0) {
 		g_destroy_consumer(cp);
@@ -764,12 +760,8 @@ g_stripe_add_disk(struct g_stripe_softc 
 		}
 	}
 
-	cp->private = sc;
-	cp->index = no;
 	sc->sc_disks[no] = cp;
-
 	G_STRIPE_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name);
-
 	g_stripe_check_and_run(sc);
 
 	return (0);
@@ -789,6 +781,7 @@ g_stripe_create(struct g_class *mp, cons
 	struct g_geom *gp;
 	u_int no;
 
+	g_topology_assert();
 	G_STRIPE_DEBUG(1, "Creating device %s (id=%u).", md->md_name,
 	    md->md_id);
 
@@ -850,8 +843,8 @@ static int
 g_stripe_destroy(struct g_stripe_softc *sc, boolean_t force)
 {
 	struct g_provider *pp;
+	struct g_consumer *cp, *cp1;
 	struct g_geom *gp;
-	u_int no;
 
 	g_topology_assert();
 
@@ -871,24 +864,22 @@ g_stripe_destroy(struct g_stripe_softc *
 		}
 	}
 
-	for (no = 0; no < sc->sc_ndisks; no++) {
-		if (sc->sc_disks[no] != NULL)
-			g_stripe_remove_disk(sc->sc_disks[no]);
+	gp = sc->sc_geom;
+	LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) {
+		g_stripe_remove_disk(cp);
+		if (cp1 == NULL)
+			return (0);	/* Recursion happened. */
 	}
+	if (!LIST_EMPTY(&gp->consumer))
+		return (EINPROGRESS);
 
-	gp = sc->sc_geom;
 	gp->softc = NULL;
 	KASSERT(sc->sc_provider == NULL, ("Provider still exists? (device=%s)",
 	    gp->name));
 	free(sc->sc_disks, M_STRIPE);
 	free(sc, M_STRIPE);
-
-	pp = LIST_FIRST(&gp->provider);
-	if (pp == NULL || (pp->acr == 0 && pp->acw == 0 && pp->ace == 0))
-		G_STRIPE_DEBUG(0, "Device %s destroyed.", gp->name);
-
+	G_STRIPE_DEBUG(0, "Device %s destroyed.", gp->name);
 	g_wither_geom(gp, ENXIO);
-
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 17:57:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 777BA106564A;
	Tue,  1 Nov 2011 17:57:21 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CED38FC15;
	Tue,  1 Nov 2011 17:57:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1HvLex077610;
	Tue, 1 Nov 2011 17:57:21 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1HvLMf077606;
	Tue, 1 Nov 2011 17:57:21 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201111011757.pA1HvLMf077606@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 1 Nov 2011 17:57:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227000 - in head/sys/dev/ata: . chipsets
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 17:57:21 -0000

Author: marius
Date: Tue Nov  1 17:57:21 2011
New Revision: 227000
URL: http://svn.freebsd.org/changeset/base/227000

Log:
  In r225931 I've missed the only other driver using the pointer returned
  by rman_get_virtual(9) to access device registers sparc64 currently cares
  about.
  Ideally ata(4) should just be converted to access these using bus_space(9)
  read/write functions instead as there's really no reason to do it the
  former way. However, this part of ata-siliconimage.c should go away in
  favor of siis(4) sooner or later anyway and I don't have the hardware to
  actually test the SX4 bits of ata-promise.c.
  Also ideally the other architectures should also properly handle the
  BUS_SPACE_MAP_LINEAR flag of bus_space_map(9) so this code wouldn't need
  to be #ifdef'ed.

Modified:
  head/sys/dev/ata/ata-pci.c
  head/sys/dev/ata/chipsets/ata-promise.c
  head/sys/dev/ata/chipsets/ata-siliconimage.c

Modified: head/sys/dev/ata/ata-pci.c
==============================================================================
--- head/sys/dev/ata/ata-pci.c	Tue Nov  1 17:18:57 2011	(r226999)
+++ head/sys/dev/ata/ata-pci.c	Tue Nov  1 17:57:21 2011	(r227000)
@@ -153,10 +153,20 @@ ata_pci_detach(device_t dev)
     }
     if (ctlr->chipdeinit != NULL)
 	ctlr->chipdeinit(dev);
-    if (ctlr->r_res2)
+    if (ctlr->r_res2) {
+#ifdef __sparc64__
+	bus_space_unmap(rman_get_bustag(ctlr->r_res2),
+	    rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2));
+#endif
 	bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2);
-    if (ctlr->r_res1)
+    }
+    if (ctlr->r_res1) {
+#ifdef __sparc64__
+	bus_space_unmap(rman_get_bustag(ctlr->r_res1),
+	    rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1));
+#endif
 	bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1);
+    }
 
     return 0;
 }
@@ -775,7 +785,6 @@ driver_t ata_pcichannel_driver = {
 
 DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0);
 
-
 /*
  * misc support fucntions
  */
@@ -936,4 +945,3 @@ ata_mode2idx(int mode)
 	return (mode & ATA_MODE_MASK) + 5;
     return (mode & ATA_MODE_MASK) - ATA_PIO0;
 }
-

Modified: head/sys/dev/ata/chipsets/ata-promise.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-promise.c	Tue Nov  1 17:18:57 2011	(r226999)
+++ head/sys/dev/ata/chipsets/ata-promise.c	Tue Nov  1 17:57:21 2011	(r227000)
@@ -94,7 +94,6 @@ static void ata_promise_next_hpkt(struct
 #define PR_SATA		0x40
 #define PR_SATA2	0x80
 
-
 /*
  * Promise chipset support functions
  */
@@ -250,6 +249,14 @@ ata_promise_chipinit(device_t dev)
 						    &ctlr->r_rid1, RF_ACTIVE)))
 	    goto failnfree;
 
+#ifdef __sparc64__
+	if (ctlr->chip->cfg2 == PR_SX4X &&
+	    !bus_space_map(rman_get_bustag(ctlr->r_res1),
+	    rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1),
+	    BUS_SPACE_MAP_LINEAR, NULL))
+		goto failnfree;
+#endif
+
 	ctlr->r_type2 = SYS_RES_MEMORY;
 	ctlr->r_rid2 = PCIR_BAR(3);
 	if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,

Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-siliconimage.c	Tue Nov  1 17:18:57 2011	(r226999)
+++ head/sys/dev/ata/chipsets/ata-siliconimage.c	Tue Nov  1 17:57:21 2011	(r227000)
@@ -80,7 +80,6 @@ static void ata_siiprb_dmainit(device_t 
 #define SII_BUG		0x04
 #define SII_4CH		0x08
 
-
 /*
  * Silicon Image Inc. (SiI) (former CMD) chipset support functions
  */
@@ -141,6 +140,17 @@ ata_sii_chipinit(device_t dev)
 	    bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,ctlr->r_res1);
 	    return ENXIO;
 	}
+#ifdef __sparc64__
+	if (!bus_space_map(rman_get_bustag(ctlr->r_res2),
+	    rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2),
+	    BUS_SPACE_MAP_LINEAR, NULL)) {
+	    	bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,
+		    ctlr->r_res1);
+		bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2,
+		    ctlr->r_res2);
+		return (ENXIO);
+	}
+#endif
 	ctlr->ch_attach = ata_siiprb_ch_attach;
 	ctlr->ch_detach = ata_siiprb_ch_detach;
 	ctlr->reset = ata_siiprb_reset;
@@ -432,7 +442,6 @@ ata_sii_setmode(device_t dev, int target
 	return (mode);
 }
 
-
 struct ata_siiprb_dma_prdentry {
     u_int64_t addr;
     u_int32_t count;

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 18:28:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E2F28106566C;
	Tue,  1 Nov 2011 18:28:33 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2FFD8FC0A;
	Tue,  1 Nov 2011 18:28:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1ISXgk078664;
	Tue, 1 Nov 2011 18:28:33 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1ISXNT078662;
	Tue, 1 Nov 2011 18:28:33 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201111011828.pA1ISXNT078662@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 1 Nov 2011 18:28:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227001 - head/sys/dev/mpt
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 18:28:34 -0000

Author: marius
Date: Tue Nov  1 18:28:33 2011
New Revision: 227001
URL: http://svn.freebsd.org/changeset/base/227001

Log:
  Increase the IOC port initialization timeouts by ten times to what the
  corresponding Linux driver uses. This allows mpt(4) to still recognize
  all good SATA devices in presence of a defective one, which takes about
  45 seconds.
  In the long term we probably should implement the logic used by mpt2sas(4)
  allowing IOC port initialization to complete at a later time.
  
  Submitted by:	Andrew Boyer
  MFC after:	3 days

Modified:
  head/sys/dev/mpt/mpt.c

Modified: head/sys/dev/mpt/mpt.c
==============================================================================
--- head/sys/dev/mpt/mpt.c	Tue Nov  1 17:57:21 2011	(r227000)
+++ head/sys/dev/mpt/mpt.c	Tue Nov  1 18:28:33 2011	(r227001)
@@ -2084,7 +2084,7 @@ mpt_send_port_enable(struct mpt_softc *m
 
 	mpt_send_cmd(mpt, req);
 	error = mpt_wait_req(mpt, req, REQ_STATE_DONE, REQ_STATE_DONE,
-	    FALSE, (mpt->is_sas || mpt->is_fc)? 30000 : 3000);
+	    FALSE, (mpt->is_sas || mpt->is_fc)? 300000 : 30000);
 	if (error != 0) {
 		mpt_prt(mpt, "port %d enable timed out\n", port);
 		return (-1);

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 18:29:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 991CC106566B;
	Tue,  1 Nov 2011 18:29:06 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F1388FC19;
	Tue,  1 Nov 2011 18:29:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1IT6I7078716;
	Tue, 1 Nov 2011 18:29:06 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1IT6PI078714;
	Tue, 1 Nov 2011 18:29:06 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <201111011829.pA1IT6PI078714@svn.freebsd.org>
From: Qing Li 
Date: Tue, 1 Nov 2011 18:29:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227002 - stable/9/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 18:29:06 -0000

Author: qingli
Date: Tue Nov  1 18:29:06 2011
New Revision: 227002
URL: http://svn.freebsd.org/changeset/base/227002

Log:
  MFC 226713
  
  Exclude host routes when checking for prefix coverage on multiple
  interfaces. A host route has a NULL mask so check for that condition.
  I have also been told by developers who customize the packet output
  path with direct manipulation of the route entry (or the outgoing
  interface to be specific). This patch checks for the route mask
  explicitly to make sure custom code will not panic.
  
  PR:		kern/161805
  Approved by:	re (kib)

Modified:
  stable/9/sys/netinet/in.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/netinet/in.c
==============================================================================
--- stable/9/sys/netinet/in.c	Tue Nov  1 18:28:33 2011	(r227001)
+++ stable/9/sys/netinet/in.c	Tue Nov  1 18:29:06 2011	(r227002)
@@ -1431,12 +1431,21 @@ in_lltable_rtcheck(struct ifnet *ifp, u_
 	 * on one interface and the corresponding outgoing packet leaves
 	 * another interface.
 	 */
-	if (rt->rt_ifp != ifp) {
+	if (!(rt->rt_flags & RTF_HOST) && rt->rt_ifp != ifp) {
 		const char *sa, *mask, *addr, *lim;
 		int len;
 
-		sa = (const char *)rt_key(rt);
 		mask = (const char *)rt_mask(rt);
+		/*
+		 * Just being extra cautious to avoid some custom
+		 * code getting into trouble.
+		 */
+		if (mask == NULL) {
+			RTFREE_LOCKED(rt);
+			return (EINVAL);
+		}
+
+		sa = (const char *)rt_key(rt);
 		addr = (const char *)l3addr;
 		len = ((const struct sockaddr_in *)l3addr)->sin_len;
 		lim = addr + len;

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 19:29:03 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF3F2106566C;
	Tue,  1 Nov 2011 19:29:03 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DEB608FC17;
	Tue,  1 Nov 2011 19:29:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1JT39S080516;
	Tue, 1 Nov 2011 19:29:03 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1JT3lq080514;
	Tue, 1 Nov 2011 19:29:03 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <201111011929.pA1JT3lq080514@svn.freebsd.org>
From: Qing Li 
Date: Tue, 1 Nov 2011 19:29:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227003 - stable/8/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 19:29:04 -0000

Author: qingli
Date: Tue Nov  1 19:29:03 2011
New Revision: 227003
URL: http://svn.freebsd.org/changeset/base/227003

Log:
  MFC 226710
  
  The host-id/interface-id can have a specific value and is properly
  masked out when adding a prefix route through the "route" command.
  However, when deleting the route, simply changing the command keyword
  from "add" to "delete" does not work. The failoure is observed in
  both IPv4 and IPv6 route insertion. The patch makes the route command
  behavior consistent between the "add" and the "delete" operation.

Modified:
  stable/8/sys/net/route.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/route.c
==============================================================================
--- stable/8/sys/net/route.c	Tue Nov  1 18:29:06 2011	(r227002)
+++ stable/8/sys/net/route.c	Tue Nov  1 19:29:03 2011	(r227003)
@@ -1031,6 +1031,7 @@ rtrequest1_fib(int req, struct rt_addrin
 	register struct radix_node_head *rnh;
 	struct ifaddr *ifa;
 	struct sockaddr *ndst;
+	struct sockaddr_storage mdst;
 #define senderr(x) { error = x ; goto bad; }
 
 	KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum"));
@@ -1057,6 +1058,10 @@ rtrequest1_fib(int req, struct rt_addrin
 
 	switch (req) {
 	case RTM_DELETE:
+		if (netmask) {
+			rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask);
+			dst = (struct sockaddr *)&mdst;
+		}
 #ifdef RADIX_MPATH
 		if (rn_mpath_capable(rnh)) {
 			error = rn_mpath_update(req, info, rnh, ret_nrt);

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 20:56:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84848106564A;
	Tue,  1 Nov 2011 20:56:19 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 73DE08FC16;
	Tue,  1 Nov 2011 20:56:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1KuJfM083267;
	Tue, 1 Nov 2011 20:56:19 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1KuJrt083264;
	Tue, 1 Nov 2011 20:56:19 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201111012056.pA1KuJrt083264@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 1 Nov 2011 20:56:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227004 - head/sys/geom/concat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 20:56:19 -0000

Author: mav
Date: Tue Nov  1 20:56:19 2011
New Revision: 227004
URL: http://svn.freebsd.org/changeset/base/227004

Log:
  Refactor disk disconnection and geom destruction handling sequences.
  Do not close/destroy opened consumer directly in case of disconnect. Instead
  keep it existing until it will be closed in regular way in response to
  upstream provider destruction. Delay geom destruction in the same way.
  Previous implementation could destroy consumers still having active
  requests and worked only because of global workaround made on GEOM level.

Modified:
  head/sys/geom/concat/g_concat.c
  head/sys/geom/concat/g_concat.h

Modified: head/sys/geom/concat/g_concat.c
==============================================================================
--- head/sys/geom/concat/g_concat.c	Tue Nov  1 19:29:03 2011	(r227003)
+++ head/sys/geom/concat/g_concat.c	Tue Nov  1 20:56:19 2011	(r227004)
@@ -117,25 +117,33 @@ g_concat_remove_disk(struct g_concat_dis
 	struct g_consumer *cp;
 	struct g_concat_softc *sc;
 
+	g_topology_assert();
 	KASSERT(disk->d_consumer != NULL, ("Non-valid disk in %s.", __func__));
 	sc = disk->d_softc;
 	cp = disk->d_consumer;
 
-	G_CONCAT_DEBUG(0, "Disk %s removed from %s.", cp->provider->name,
-	    sc->sc_name);
+	if (!disk->d_removed) {
+		G_CONCAT_DEBUG(0, "Disk %s removed from %s.",
+		    cp->provider->name, sc->sc_name);
+		disk->d_removed = 1;
+	}
 
-	disk->d_consumer = NULL;
 	if (sc->sc_provider != NULL) {
 		sc->sc_provider->flags |= G_PF_WITHER;
+		G_CONCAT_DEBUG(0, "Device %s deactivated.",
+		    sc->sc_provider->name);
 		g_orphan_provider(sc->sc_provider, ENXIO);
 		sc->sc_provider = NULL;
-		G_CONCAT_DEBUG(0, "Device %s removed.", sc->sc_name);
 	}
 
 	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
-		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
+		return;
+	disk->d_consumer = NULL;
 	g_detach(cp);
 	g_destroy_consumer(cp);
+	/* If there are no valid disks anymore, remove device. */
+	if (LIST_EMPTY(&sc->sc_geom->consumer))
+		g_concat_destroy(sc, 1);
 }
 
 static void
@@ -155,37 +163,18 @@ g_concat_orphan(struct g_consumer *cp)
 	if (disk == NULL)	/* Possible? */
 		return;
 	g_concat_remove_disk(disk);
-
-	/* If there are no valid disks anymore, remove device. */
-	if (g_concat_nvalid(sc) == 0)
-		g_concat_destroy(sc, 1);
 }
 
 static int
 g_concat_access(struct g_provider *pp, int dr, int dw, int de)
 {
-	struct g_consumer *cp1, *cp2;
-	struct g_concat_softc *sc;
+	struct g_consumer *cp1, *cp2, *tmp;
+	struct g_concat_disk *disk;
 	struct g_geom *gp;
 	int error;
 
+	g_topology_assert();
 	gp = pp->geom;
-	sc = gp->softc;
-
-	if (sc == NULL) {
-		/*
-		 * It looks like geom is being withered.
-		 * In that case we allow only negative requests.
-		 */
-		KASSERT(dr <= 0 && dw <= 0 && de <= 0,
-		    ("Positive access request (device=%s).", pp->name));
-		if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 &&
-		    (pp->ace + de) == 0) {
-			G_CONCAT_DEBUG(0, "Device %s definitely destroyed.",
-			    gp->name);
-		}
-		return (0);
-	}
 
 	/* On first open, grab an extra "exclusive" bit */
 	if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0)
@@ -194,22 +183,24 @@ g_concat_access(struct g_provider *pp, i
 	if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && (pp->ace + de) == 0)
 		de--;
 
-	error = ENXIO;
-	LIST_FOREACH(cp1, &gp->consumer, consumer) {
+	LIST_FOREACH_SAFE(cp1, &gp->consumer, consumer, tmp) {
 		error = g_access(cp1, dr, dw, de);
-		if (error == 0)
-			continue;
-		/*
-		 * If we fail here, backout all previous changes.
-		 */
-		LIST_FOREACH(cp2, &gp->consumer, consumer) {
-			if (cp1 == cp2)
-				return (error);
-			g_access(cp2, -dr, -dw, -de);
+		if (error != 0)
+			goto fail;
+		disk = cp1->private;
+		if (cp1->acr == 0 && cp1->acw == 0 && cp1->ace == 0 &&
+		    disk->d_removed) {
+			g_concat_remove_disk(disk); /* May destroy geom. */
 		}
-		/* NOTREACHED */
 	}
+	return (0);
 
+fail:
+	LIST_FOREACH(cp2, &gp->consumer, consumer) {
+		if (cp1 == cp2)
+			break;
+		g_access(cp2, -dr, -dw, -de);
+	}
 	return (error);
 }
 
@@ -391,6 +382,7 @@ g_concat_check_and_run(struct g_concat_s
 	u_int no, sectorsize = 0;
 	off_t start;
 
+	g_topology_assert();
 	if (g_concat_nvalid(sc) != sc->sc_ndisks)
 		return;
 
@@ -419,7 +411,7 @@ g_concat_check_and_run(struct g_concat_s
 	sc->sc_provider = pp;
 	g_error_provider(pp, 0);
 
-	G_CONCAT_DEBUG(0, "Device %s activated.", sc->sc_name);
+	G_CONCAT_DEBUG(0, "Device %s activated.", sc->sc_provider->name);
 }
 
 static int
@@ -461,6 +453,7 @@ g_concat_add_disk(struct g_concat_softc 
 	struct g_geom *gp;
 	int error;
 
+	g_topology_assert();
 	/* Metadata corrupted? */
 	if (no >= sc->sc_ndisks)
 		return (EINVAL);
@@ -509,6 +502,7 @@ g_concat_add_disk(struct g_concat_softc 
 	disk->d_softc = sc;
 	disk->d_start = 0;	/* not yet */
 	disk->d_end = 0;	/* not yet */
+	disk->d_removed = 0;
 
 	G_CONCAT_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name);
 
@@ -576,8 +570,8 @@ static int
 g_concat_destroy(struct g_concat_softc *sc, boolean_t force)
 {
 	struct g_provider *pp;
+	struct g_consumer *cp, *cp1;
 	struct g_geom *gp;
-	u_int no;
 
 	g_topology_assert();
 
@@ -597,24 +591,23 @@ g_concat_destroy(struct g_concat_softc *
 		}
 	}
 
-	for (no = 0; no < sc->sc_ndisks; no++) {
-		if (sc->sc_disks[no].d_consumer != NULL)
-			g_concat_remove_disk(&sc->sc_disks[no]);
+	gp = sc->sc_geom;
+	LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) {
+		g_concat_remove_disk(cp->private);
+		if (cp1 == NULL)
+			return (0);	/* Recursion happened. */
 	}
+	if (!LIST_EMPTY(&gp->consumer))
+		return (EINPROGRESS);
 
-	gp = sc->sc_geom;
 	gp->softc = NULL;
 	KASSERT(sc->sc_provider == NULL, ("Provider still exists? (device=%s)",
 	    gp->name));
 	free(sc->sc_disks, M_CONCAT);
 	free(sc, M_CONCAT);
 
-	pp = LIST_FIRST(&gp->provider);
-	if (pp == NULL || (pp->acr == 0 && pp->acw == 0 && pp->ace == 0))
-		G_CONCAT_DEBUG(0, "Device %s destroyed.", gp->name);
-
+	G_CONCAT_DEBUG(0, "Device %s destroyed.", gp->name);
 	g_wither_geom(gp, ENXIO);
-
 	return (0);
 }
 

Modified: head/sys/geom/concat/g_concat.h
==============================================================================
--- head/sys/geom/concat/g_concat.h	Tue Nov  1 19:29:03 2011	(r227003)
+++ head/sys/geom/concat/g_concat.h	Tue Nov  1 20:56:19 2011	(r227004)
@@ -72,6 +72,7 @@ struct g_concat_disk {
 	struct g_concat_softc	*d_softc;
 	off_t			 d_start;
 	off_t			 d_end;
+	int			 d_removed;
 };
 
 struct g_concat_softc {

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 21:21:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4C3691065670;
	Tue,  1 Nov 2011 21:21:37 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 237998FC19;
	Tue,  1 Nov 2011 21:21:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1LLb0e084048;
	Tue, 1 Nov 2011 21:21:37 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1LLbf8084046;
	Tue, 1 Nov 2011 21:21:37 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <201111012121.pA1LLbf8084046@svn.freebsd.org>
From: Qing Li 
Date: Tue, 1 Nov 2011 21:21:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227005 - stable/9/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 21:21:37 -0000

Author: qingli
Date: Tue Nov  1 21:21:36 2011
New Revision: 227005
URL: http://svn.freebsd.org/changeset/base/227005

Log:
  MFC 226451
  
  The IPv6 code was influx at the time of r196865 due to the L2/L3
  separation rewrite changes. r196865 was committed to fix a scope
  violation problem in the following test scenario:
  
    box-1# ifconfig em0 inet6 2001:db8:1:: prefixlen 64 anycast
    box-1# ifconfig em1 inet6 2001:db8:2::1 prefixlen 64
  
    box-2# ifconfig re0 inet6 2001:db8:1::6 prefixlen 64
  
    em0 and re0 are on the same link.
  
    box-2# ping6 2001:db8:1::
    PING6(56=40+8+8 bytes) 2001:db8:1::6 --> 2001:db8:1::
  
  the ICMPv6 response should have a source address of em1, which
  is 2001:db8:2::1, not the link-local address of em0.
  
  That code is no longer necessary and breaks the IPv6-Ready logo
  testing, so revert it now.
  
  Reviewed by:	hrs
  Approved by:	re (kib)

Modified:
  stable/9/sys/netinet6/icmp6.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/netinet6/icmp6.c
==============================================================================
--- stable/9/sys/netinet6/icmp6.c	Tue Nov  1 20:56:19 2011	(r227004)
+++ stable/9/sys/netinet6/icmp6.c	Tue Nov  1 21:21:36 2011	(r227005)
@@ -2244,10 +2244,6 @@ icmp6_reflect(struct mbuf *m, size_t off
 		}
 	}
 
-	if ((srcp != NULL) && 
-	    (in6_addrscope(srcp) != in6_addrscope(&ip6->ip6_src)))
-		srcp = NULL;
-
 	if (srcp == NULL) {
 		int e;
 		struct sockaddr_in6 sin6;

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 21:26:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CFE7106564A;
	Tue,  1 Nov 2011 21:26:58 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 29E2D8FC08;
	Tue,  1 Nov 2011 21:26:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1LQw2E084296;
	Tue, 1 Nov 2011 21:26:58 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1LQvhv084284;
	Tue, 1 Nov 2011 21:26:58 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201111012126.pA1LQvhv084284@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 1 Nov 2011 21:26:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227006 - in head: . sys/amd64/conf sys/conf
	sys/dev/esp sys/i386/conf sys/modules sys/modules/esp
	sys/pc98/conf sys/sparc64/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 21:26:58 -0000

Author: marius
Date: Tue Nov  1 21:26:57 2011
New Revision: 227006
URL: http://svn.freebsd.org/changeset/base/227006

Log:
  Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and
  replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel
  configuration files. Besides duplicating functionality, amd(4), which
  previously also supported the AMD Am53C974, unlike esp(4) is no longer
  maintained and has accumulated enough bit rot over time to always cause
  a panic during boot as long as at least one target is attached to it
  (see PR 124667).
  
  PR:		124667
  Obtained from:	NetBSD (based on)
  MFC after:	3 days

Added:
  head/sys/dev/esp/am53c974reg.h   (contents, props changed)
  head/sys/dev/esp/esp_pci.c   (contents, props changed)
Modified:
  head/UPDATING
  head/sys/amd64/conf/GENERIC
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/i386/conf/GENERIC
  head/sys/modules/Makefile
  head/sys/modules/esp/Makefile
  head/sys/pc98/conf/GENERIC
  head/sys/sparc64/conf/GENERIC

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/UPDATING	Tue Nov  1 21:26:57 2011	(r227006)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20111101:
+	The broken amd(4) driver has been replaced with esp(4) in the amd64,
+	i386 and pc98 GENERIC kernel configuration files.
+
 20110930:
 	sysinstall has been removed
 

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/amd64/conf/GENERIC	Tue Nov  1 21:26:57 2011	(r227006)
@@ -107,7 +107,7 @@ options 	AHC_REG_PRETTY_PRINT	# Print re
 device		ahd		# AHA39320/29320 and onboard AIC79xx devices
 options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug
 					# output.  Adds ~215k to driver.
-device		amd		# AMD 53C974 (Tekram DC-390(T))
+device		esp		# AMD Am53C974 (Tekram DC-390(T))
 device		hptiop		# Highpoint RocketRaid 3xxx series
 device		isp		# Qlogic family
 #device		ispfw		# Firmware for QLogic HBAs- normally a module

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/conf/NOTES	Tue Nov  1 21:26:57 2011	(r227006)
@@ -1459,7 +1459,9 @@ options 	TEKEN_UTF8		# UTF-8 output hand
 #      such as the Tekram DC-390(T).
 # bt:  Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x,
 #      BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F
-# esp: NCR53c9x.  Only for SBUS hardware right now.
+# esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers
+#      including the AMD Am53C974 (found on devices such as the Tekram
+#      DC-390(T)) and the Sun ESP and FAS families of controllers
 # isp: Qlogic ISP 1020, 1040 and 1040B PCI SCSI host adapters,
 #      ISP 1240 Dual Ultra SCSI, ISP 1080 and 1280 (Dual) Ultra2,
 #      ISP 12160 Ultra3 SCSI,

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/conf/files	Tue Nov  1 21:26:57 2011	(r227006)
@@ -1064,6 +1064,7 @@ dev/ep/if_ep_eisa.c		optional ep eisa
 dev/ep/if_ep_isa.c		optional ep isa
 dev/ep/if_ep_mca.c		optional ep mca
 dev/ep/if_ep_pccard.c		optional ep pccard
+dev/esp/esp_pci.c		optional esp pci
 dev/esp/ncr53c9x.c		optional esp
 dev/ex/if_ex.c			optional ex
 dev/ex/if_ex_isa.c		optional ex isa

Added: head/sys/dev/esp/am53c974reg.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/esp/am53c974reg.h	Tue Nov  1 21:26:57 2011	(r227006)
@@ -0,0 +1,72 @@
+/*	$NetBSD: pcscpreg.h,v 1.2 2008/04/28 20:23:55 martin Exp $	*/
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Izumi Tsutsui.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ */
+
+#ifndef _AM53C974_H_
+#define	_AM53C974_H_
+
+/*
+ * Am53c974 DMA engine registers
+ */
+
+#define	DMA_CMD		0x40 		/* Command */
+#define	 DMACMD_RSVD	0xFFFFFF28	/* reserved */
+#define	 DMACMD_DIR	0x00000080	/* Transfer Direction (read:1) */
+#define	 DMACMD_INTE	0x00000040	/* DMA Interrupt Enable	*/
+#define	 DMACMD_MDL	0x00000010	/* Map to Memory Description List */
+#define	 DMACMD_DIAG	0x00000004	/* Diagnostic */
+#define	 DMACMD_CMD	0x00000003	/* Command Code Bit */
+#define	  DMACMD_IDLE	0x00000000	/*  Idle */
+#define	  DMACMD_BLAST	0x00000001	/*  Blast */
+#define	  DMACMD_ABORT	0x00000002	/*  Abort */
+#define	  DMACMD_START	0x00000003	/*  Start */
+
+#define	DMA_STC		0x44		/* Start Transfer Count */
+#define	DMA_SPA		0x48		/* Start Physical Address */
+#define	DMA_WBC		0x4C		/* Working Byte Counter */
+#define	DMA_WAC		0x50		/* Working Address Counter */
+
+#define	DMA_STAT	0x54		/* Status Register */
+#define	 DMASTAT_RSVD	0xFFFFFF80	/* reserved */
+#define	 DMASTAT_PABT	0x00000040	/* PCI master/target Abort */
+#define	 DMASTAT_BCMP	0x00000020	/* BLAST Complete */
+#define	 DMASTAT_SINT	0x00000010	/* SCSI Interrupt */
+#define	 DMASTAT_DONE	0x00000008	/* DMA Transfer Terminated */
+#define	 DMASTAT_ABT	0x00000004	/* DMA Transfer Aborted */
+#define	 DMASTAT_ERR	0x00000002	/* DMA Transfer Error */
+#define	 DMASTAT_PWDN	0x00000001	/* Power Down Indicator */
+
+#define	DMA_SMDLA	0x58	/* Starting Memory Descpritor List Address */
+#define	DMA_WMAC	0x5C	/* Working MDL Counter */
+#define	DMA_SBAC	0x70	/* SCSI Bus and Control */
+
+#endif /* _AM53C974_H_ */

Added: head/sys/dev/esp/esp_pci.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/esp/esp_pci.c	Tue Nov  1 21:26:57 2011	(r227006)
@@ -0,0 +1,654 @@
+/*-
+ * Copyright (c) 2011 Marius Strobl 
+ * 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.
+ */
+
+/*	$NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $	*/
+
+/*-
+ * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center; Izumi Tsutsui.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+/*
+ * esp_pci.c: device dependent code for AMD Am53c974 (PCscsi-PCI)
+ * written by Izumi Tsutsui 
+ *
+ * Technical manual available at
+ * http://www.amd.com/files/connectivitysolutions/networking/archivednetworking/19113.pdf
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#define	PCI_DEVICE_ID_AMD53C974	0x20201022
+
+struct esp_pci_softc {
+	struct ncr53c9x_softc	sc_ncr53c9x;	/* glue to MI code */
+	struct device		*sc_dev;
+
+	struct resource *sc_res[2];
+#define	ESP_PCI_RES_INTR	0
+#define	ESP_PCI_RES_IO		1
+
+	bus_dma_tag_t		sc_pdmat;
+
+	bus_dma_tag_t		sc_xferdmat;	/* DMA tag for transfers */
+	bus_dmamap_t		sc_xferdmam;	/* DMA map for transfers */
+
+	void			*sc_ih;		/* interrupt handler */
+
+	size_t			sc_dmasize;	/* DMA size */
+	void			**sc_dmaaddr;	/* DMA address */
+	size_t			*sc_dmalen;	/* DMA length */
+	int			sc_active;	/* DMA state */
+	int			sc_datain;	/* DMA Data Direction */
+};
+
+static struct resource_spec esp_pci_res_spec[] = {
+	{ SYS_RES_IRQ, 0, RF_SHAREABLE | RF_ACTIVE },	/* ESP_PCI_RES_INTR */
+	{ SYS_RES_IOPORT, PCIR_BAR(0), RF_ACTIVE },	/* ESP_PCI_RES_IO */
+	{ -1, 0 }
+};
+
+#define	READ_DMAREG(sc, reg)						\
+	bus_read_4((sc)->sc_res[ESP_PCI_RES_IO], (reg))
+#define	WRITE_DMAREG(sc, reg, var)					\
+	bus_write_4((sc)->sc_res[ESP_PCI_RES_IO], (reg), (var))
+
+#define	READ_ESPREG(sc, reg)						\
+	bus_read_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2)
+#define	WRITE_ESPREG(sc, reg, val)					\
+	bus_write_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2, (val))
+
+static int	esp_pci_probe(device_t);
+static int	esp_pci_attach(device_t);
+static int	esp_pci_detach(device_t);
+static int	esp_pci_suspend(device_t);
+static int	esp_pci_resume(device_t);
+
+static device_method_t esp_pci_methods[] = {
+	DEVMETHOD(device_probe,		esp_pci_probe),
+	DEVMETHOD(device_attach,	esp_pci_attach),
+	DEVMETHOD(device_detach,	esp_pci_detach),
+	DEVMETHOD(device_suspend,	esp_pci_suspend),
+	DEVMETHOD(device_resume,	esp_pci_resume),
+
+	KOBJMETHOD_END
+};
+
+static driver_t esp_pci_driver = {
+	"esp",
+	esp_pci_methods,
+	sizeof(struct esp_pci_softc)
+};
+
+DRIVER_MODULE(esp, pci, esp_pci_driver, esp_devclass, 0, 0);
+MODULE_DEPEND(esp, pci, 1, 1, 1);
+
+/*
+ * Functions and the switch for the MI code
+ */
+static void	esp_pci_dma_go(struct ncr53c9x_softc *);
+static int	esp_pci_dma_intr(struct ncr53c9x_softc *);
+static int	esp_pci_dma_isactive(struct ncr53c9x_softc *);
+
+static int	esp_pci_dma_isintr(struct ncr53c9x_softc *);
+static void	esp_pci_dma_reset(struct ncr53c9x_softc *);
+static int	esp_pci_dma_setup(struct ncr53c9x_softc *, void **, size_t *,
+		    int, size_t *);
+static void	esp_pci_dma_stop(struct ncr53c9x_softc *);
+static void	esp_pci_write_reg(struct ncr53c9x_softc *, int, uint8_t);
+static uint8_t	esp_pci_read_reg(struct ncr53c9x_softc *, int);
+static void	esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nseg,
+		    int error);
+
+static struct ncr53c9x_glue esp_pci_glue = {
+	esp_pci_read_reg,
+	esp_pci_write_reg,
+	esp_pci_dma_isintr,
+	esp_pci_dma_reset,
+	esp_pci_dma_intr,
+	esp_pci_dma_setup,
+	esp_pci_dma_go,
+	esp_pci_dma_stop,
+	esp_pci_dma_isactive,
+};
+
+static int
+esp_pci_probe(device_t dev)
+{
+
+	if (pci_get_devid(dev) == PCI_DEVICE_ID_AMD53C974) {
+		device_set_desc(dev, "AMD Am53C974 Fast-SCSI");
+		return (BUS_PROBE_DEFAULT);
+	}
+
+	return (ENXIO);
+}
+
+/*
+ * Attach this instance, and then all the sub-devices
+ */
+static int
+esp_pci_attach(device_t dev)
+{
+	struct esp_pci_softc *esc;
+	struct ncr53c9x_softc *sc;
+	int error;
+
+	esc = device_get_softc(dev);
+	sc = &esc->sc_ncr53c9x;
+
+	NCR_LOCK_INIT(sc);
+
+	esc->sc_dev = dev;
+	sc->sc_glue = &esp_pci_glue;
+
+	pci_enable_busmaster(dev);
+
+	error = bus_alloc_resources(dev, esp_pci_res_spec, esc->sc_res);
+	if (error != 0) {
+		device_printf(dev, "failed to allocate resources\n");
+		bus_release_resources(dev, esp_pci_res_spec, esc->sc_res);
+		return (error);
+	}
+
+	error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0,
+	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+	    BUS_SPACE_MAXSIZE_32BIT, BUS_SPACE_UNRESTRICTED,
+	    BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &esc->sc_pdmat);
+	if (error != 0) {
+		device_printf(dev, "cannot create parent DMA tag\n");
+		goto fail_res;
+	}
+
+	/*
+	 * XXX More of this should be in ncr53c9x_attach(), but
+	 * XXX should we really poke around the chip that much in
+	 * XXX the MI code?  Think about this more...
+	 */
+
+	/*
+	 * Set up static configuration info.
+	 *
+	 * XXX we should read the configuration from the EEPROM.
+	 */
+	sc->sc_id = 7;
+	sc->sc_cfg1 = sc->sc_id | NCRCFG1_PARENB;
+	sc->sc_cfg2 = NCRCFG2_SCSI2 | NCRCFG2_FE;
+	sc->sc_cfg3 = NCRAMDCFG3_IDM | NCRAMDCFG3_FCLK;
+	sc->sc_cfg4 = NCRAMDCFG4_GE12NS | NCRAMDCFG4_RADE;
+	sc->sc_rev = NCR_VARIANT_AM53C974;
+	sc->sc_features = NCR_F_FASTSCSI | NCR_F_DMASELECT;
+	sc->sc_cfg3_fscsi = NCRAMDCFG3_FSCSI;
+	sc->sc_freq = 40; /* MHz */
+
+	/*
+	 * This is the value used to start sync negotiations
+	 * Note that the NCR register "SYNCTP" is programmed
+	 * in "clocks per byte", and has a minimum value of 4.
+	 * The SCSI period used in negotiation is one-fourth
+	 * of the time (in nanoseconds) needed to transfer one byte.
+	 * Since the chip's clock is given in MHz, we have the following
+	 * formula: 4 * period = (1000 / freq) * 4
+	 */
+	sc->sc_minsync = 1000 / sc->sc_freq;
+
+	sc->sc_maxxfer = DFLTPHYS;	/* see below */
+	sc->sc_maxoffset = 15;
+	sc->sc_extended_geom = 1;
+
+#define	MDL_SEG_SIZE	0x1000	/* 4kbyte per segment */
+
+	/*
+	 * Create the DMA tag and map for the data transfers.
+	 *
+	 * Note: given that bus_dma(9) only adheres to the requested alignment
+	 * for the first segment (and that also only for bus_dmamem_alloc()ed
+	 * DMA maps) we can't use the Memory Descriptor List.  However, also
+	 * when not using the MDL, the maximum transfer size apparently is
+	 * limited to 4k so we have to split transfers up, which plain sucks.
+	 */
+	error = bus_dma_tag_create(esc->sc_pdmat, PAGE_SIZE, 0,
+	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+	    MDL_SEG_SIZE, 1, MDL_SEG_SIZE, BUS_DMA_ALLOCNOW,
+	    busdma_lock_mutex, &sc->sc_lock, &esc->sc_xferdmat);
+	if (error != 0) {
+		device_printf(dev, "cannot create transfer DMA tag\n");
+		goto fail_pdmat;
+	}
+	error = bus_dmamap_create(esc->sc_xferdmat, 0, &esc->sc_xferdmam);
+	if (error != 0) {
+		device_printf(dev, "cannnot create transfer DMA map\n");
+		goto fail_xferdmat;
+	}
+
+	error = bus_setup_intr(dev, esc->sc_res[ESP_PCI_RES_INTR],
+	    INTR_MPSAFE | INTR_TYPE_CAM, NULL, ncr53c9x_intr, sc,
+	    &esc->sc_ih);
+	if (error != 0) {
+		device_printf(dev, "cannot set up interrupt\n");
+		goto fail_xferdmam;
+	}
+
+	/* Do the common parts of attachment. */
+	sc->sc_dev = esc->sc_dev;
+	error = ncr53c9x_attach(sc);
+	if (error != 0) {
+		device_printf(esc->sc_dev, "ncr53c9x_attach failed\n");
+		goto fail_intr;
+	}
+
+	return (0);
+
+ fail_intr:
+	 bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR],
+	    esc->sc_ih);
+ fail_xferdmam:
+	bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam);
+ fail_xferdmat:
+	bus_dma_tag_destroy(esc->sc_xferdmat);
+ fail_pdmat:
+	bus_dma_tag_destroy(esc->sc_pdmat);
+ fail_res:
+	bus_release_resources(dev, esp_pci_res_spec, esc->sc_res);
+	NCR_LOCK_DESTROY(sc);
+
+	return (error);
+}
+
+static int
+esp_pci_detach(device_t dev)
+{
+	struct ncr53c9x_softc *sc;
+	struct esp_pci_softc *esc;
+	int error;
+
+	esc = device_get_softc(dev);
+	sc = &esc->sc_ncr53c9x;
+
+	bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR],
+	    esc->sc_ih);
+	error = ncr53c9x_detach(sc);
+	if (error != 0)
+		return (error);
+	bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam);
+	bus_dma_tag_destroy(esc->sc_xferdmat);
+	bus_dma_tag_destroy(esc->sc_pdmat);
+	bus_release_resources(dev, esp_pci_res_spec, esc->sc_res);
+	NCR_LOCK_DESTROY(sc);
+
+	return (0);
+}
+
+static int
+esp_pci_suspend(device_t dev)
+{
+
+	return (ENXIO);
+}
+
+static int
+esp_pci_resume(device_t dev)
+{
+
+	return (ENXIO);
+}
+
+static void
+esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)arg;
+
+	if (error != 0)
+		return;
+
+	KASSERT(nsegs == 1, ("%s: bad transfer segment count %d", __func__,
+	    nsegs));
+	KASSERT(segs[0].ds_len <= MDL_SEG_SIZE,
+	    ("%s: bad transfer segment length %ld", __func__,
+	    (long)segs[0].ds_len));
+
+	/* Program the DMA Starting Physical Address. */
+	WRITE_DMAREG(esc, DMA_SPA, segs[0].ds_addr);
+}
+
+/*
+ * Glue functions
+ */
+
+static uint8_t
+esp_pci_read_reg(struct ncr53c9x_softc *sc, int reg)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+
+	return (READ_ESPREG(esc, reg));
+}
+
+static void
+esp_pci_write_reg(struct ncr53c9x_softc *sc, int reg, uint8_t v)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+
+	WRITE_ESPREG(esc, reg, v);
+}
+
+static int
+esp_pci_dma_isintr(struct ncr53c9x_softc *sc)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+
+	return (READ_ESPREG(esc, NCR_STAT) & NCRSTAT_INT) != 0;
+}
+
+static void
+esp_pci_dma_reset(struct ncr53c9x_softc *sc)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+
+	WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE);
+
+	esc->sc_active = 0;
+}
+
+static int
+esp_pci_dma_intr(struct ncr53c9x_softc *sc)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+	bus_dma_tag_t xferdmat;
+	bus_dmamap_t xferdmam;
+	size_t dmasize;
+	int datain, i, resid, trans;
+	uint32_t dmastat;
+	char *p = NULL;
+
+	xferdmat = esc->sc_xferdmat;
+	xferdmam = esc->sc_xferdmam;
+	datain = esc->sc_datain;
+
+	dmastat = READ_DMAREG(esc, DMA_STAT);
+
+	if ((dmastat & DMASTAT_ERR) != 0) {
+		/* XXX not tested... */
+		WRITE_DMAREG(esc, DMA_CMD, DMACMD_ABORT | (datain != 0 ?
+		    DMACMD_DIR : 0));
+
+		device_printf(esc->sc_dev, "DMA error detected; Aborting.\n");
+		bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ?
+		    BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
+		bus_dmamap_unload(xferdmat, xferdmam);
+		return (-1);
+	}
+
+	if ((dmastat & DMASTAT_ABT) != 0) {
+		/* XXX what should be done? */
+		device_printf(esc->sc_dev, "DMA aborted.\n");
+		WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ?
+		    DMACMD_DIR : 0));
+		esc->sc_active = 0;
+		return (0);
+	}
+
+	KASSERT(esc->sc_active != 0, ("%s: DMA wasn't active", __func__));
+
+	/* DMA has stopped. */
+
+	esc->sc_active = 0;
+
+	dmasize = esc->sc_dmasize;
+	if (dmasize == 0) {
+		/* A "Transfer Pad" operation completed. */
+		NCR_DMA(("%s: discarded %d bytes (tcl=%d, tcm=%d)\n",
+		    __func__, READ_ESPREG(esc, NCR_TCL) |
+		    (READ_ESPREG(esc, NCR_TCM) << 8),
+		    READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM)));
+		return (0);
+	}
+
+	resid = 0;
+	/*
+	 * If a transfer onto the SCSI bus gets interrupted by the device
+	 * (e.g. for a SAVEPOINTER message), the data in the FIFO counts
+	 * as residual since the ESP counter registers get decremented as
+	 * bytes are clocked into the FIFO.
+	 */
+	if (datain == 0 &&
+	    (resid = (READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF)) != 0)
+		NCR_DMA(("%s: empty esp FIFO of %d ", __func__, resid));
+
+	if ((sc->sc_espstat & NCRSTAT_TC) == 0) {
+		/*
+		 * "Terminal count" is off, so read the residue
+		 * out of the ESP counter registers.
+		 */
+		if (datain != 0) {
+			resid = READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF;
+			while (resid > 1)
+				resid =
+				    READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF;
+			WRITE_DMAREG(esc, DMA_CMD, DMACMD_BLAST | DMACMD_DIR);
+
+			for (i = 0; i < 0x8000; i++) /* XXX 0x8000 ? */
+				if ((READ_DMAREG(esc, DMA_STAT) &
+				    DMASTAT_BCMP) != 0)
+					break;
+
+			/* See the below comments... */
+			if (resid != 0)
+				p = *esc->sc_dmaaddr;
+		}
+
+		resid += READ_ESPREG(esc, NCR_TCL) |
+		    (READ_ESPREG(esc, NCR_TCM) << 8) |
+		    (READ_ESPREG(esc, NCR_TCH) << 16);
+	} else
+		while ((dmastat & DMASTAT_DONE) == 0)
+			dmastat = READ_DMAREG(esc, DMA_STAT);
+
+	WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ?
+	    DMACMD_DIR : 0));
+
+	/* Sync the transfer buffer. */
+	bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ?
+	    BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
+	bus_dmamap_unload(xferdmat, xferdmam);
+
+	trans = dmasize - resid;
+
+	/*
+	 * From the technical manual notes:
+	 *
+	 * "In some odd byte conditions, one residual byte will be left
+	 *  in the SCSI FIFO, and the FIFO flags will never count to 0.
+	 *  When this happens, the residual byte should be retrieved
+	 *  via PIO following completion of the BLAST operation."
+	 */
+	if (p != NULL) {
+		p += trans;
+		*p = READ_ESPREG(esc, NCR_FIFO);
+		trans++;
+	}
+
+	if (trans < 0) {			/* transferred < 0 ? */
+#if 0
+		/*
+		 * This situation can happen in perfectly normal operation
+		 * if the ESP is reselected while using DMA to select
+		 * another target.  As such, don't print the warning.
+		 */
+		device_printf(dev, "xfer (%d) > req (%d)\n", trans, dmasize);
+#endif
+		trans = dmasize;
+	}
+
+	NCR_DMA(("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__,
+	    READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM),
+	    READ_ESPREG(esc, NCR_TCH), trans, resid));
+
+	*esc->sc_dmalen -= trans;
+	*esc->sc_dmaaddr = (char *)*esc->sc_dmaaddr + trans;
+
+	return (0);
+}
+
+static int
+esp_pci_dma_setup(struct ncr53c9x_softc *sc, void **addr, size_t *len,
+    int datain, size_t *dmasize)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+	int error;
+
+	WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? DMACMD_DIR :
+	    0));
+
+	*dmasize = esc->sc_dmasize = ulmin(*dmasize, MDL_SEG_SIZE);
+	esc->sc_dmaaddr = addr;
+	esc->sc_dmalen = len;
+	esc->sc_datain = datain;
+
+	/*
+	 * There's no need to set up DMA for a "Transfer Pad" operation.
+	 */
+	if (*dmasize == 0)
+		return (0);
+
+	/* Set the transfer length. */
+	WRITE_DMAREG(esc, DMA_STC, *dmasize);
+
+	/*
+	 * Load the transfer buffer and program the DMA address.
+	 * Note that the NCR53C9x core can't handle EINPROGRESS so we set
+	 * BUS_DMA_NOWAIT.
+	 */
+	error = bus_dmamap_load(esc->sc_xferdmat, esc->sc_xferdmam,
+	    *esc->sc_dmaaddr, *dmasize, esp_pci_xfermap, sc, BUS_DMA_NOWAIT);
+
+	return (error);
+}
+
+static void
+esp_pci_dma_go(struct ncr53c9x_softc *sc)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+	int datain;
+
+	datain = esc->sc_datain;
+
+	/* No DMA transfer for a "Transfer Pad" operation */
+	if (esc->sc_dmasize == 0)
+		return;
+
+	/* Sync the transfer buffer. */
+	bus_dmamap_sync(esc->sc_xferdmat, esc->sc_xferdmam, datain != 0 ?
+	    BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
+
+	/* Set the DMA engine to the IDLE state. */
+	/* XXX DMA Transfer Interrupt Enable bit is broken? */
+	WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | /* DMACMD_INTE | */
+	    (datain != 0 ? DMACMD_DIR : 0));
+
+	/* Issue a DMA start command. */
+	WRITE_DMAREG(esc, DMA_CMD, DMACMD_START | /* DMACMD_INTE | */
+	    (datain != 0 ? DMACMD_DIR : 0));
+
+	esc->sc_active = 1;
+}
+
+static void
+esp_pci_dma_stop(struct ncr53c9x_softc *sc)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+
+	/* DMA stop */
+	/* XXX what should we do here ? */
+	WRITE_DMAREG(esc, DMA_CMD,
+	    DMACMD_ABORT | (esc->sc_datain != 0 ? DMACMD_DIR : 0));
+	bus_dmamap_unload(esc->sc_xferdmat, esc->sc_xferdmam);
+
+	esc->sc_active = 0;
+}
+
+static int
+esp_pci_dma_isactive(struct ncr53c9x_softc *sc)
+{
+	struct esp_pci_softc *esc = (struct esp_pci_softc *)sc;
+
+	/* XXX should we check esc->sc_active? */
+	if ((READ_DMAREG(esc, DMA_CMD) & DMACMD_CMD) != DMACMD_IDLE)
+		return (1);
+
+	return (0);
+}

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/i386/conf/GENERIC	Tue Nov  1 21:26:57 2011	(r227006)
@@ -110,7 +110,7 @@ options 	AHC_REG_PRETTY_PRINT	# Print re
 device		ahd		# AHA39320/29320 and onboard AIC79xx devices
 options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug
 					# output.  Adds ~215k to driver.
-device		amd		# AMD 53C974 (Tekram DC-390(T))
+device		esp		# AMD Am53C974 (Tekram DC-390(T))
 device		hptiop		# Highpoint RocketRaid 3xxx series
 device		isp		# Qlogic family
 #device		ispfw		# Firmware for QLogic HBAs- normally a module

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/modules/Makefile	Tue Nov  1 21:26:57 2011	(r227006)
@@ -89,6 +89,7 @@ SUBDIR=	${_3dfx} \
 	en \
 	${_ep} \
 	${_epic} \
+	esp \
 	${_et} \
 	${_ex} \
 	${_exca} \

Modified: head/sys/modules/esp/Makefile
==============================================================================
--- head/sys/modules/esp/Makefile	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/modules/esp/Makefile	Tue Nov  1 21:26:57 2011	(r227006)
@@ -3,7 +3,8 @@
 .PATH: ${.CURDIR}/../../dev/esp
 
 KMOD=	esp
-SRCS=	device_if.h ${esp_sbus} bus_if.h ncr53c9x.c ${ofw_bus_if} opt_cam.h
+SRCS=	device_if.h esp_pci.c ${esp_sbus} bus_if.h ncr53c9x.c ${ofw_bus_if}
+SRCS+=	opt_cam.h pci_if.h
 
 .if ${MACHINE} == "sparc64"
 ofw_bus_if=	ofw_bus_if.h

Modified: head/sys/pc98/conf/GENERIC
==============================================================================
--- head/sys/pc98/conf/GENERIC	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/pc98/conf/GENERIC	Tue Nov  1 21:26:57 2011	(r227006)
@@ -101,7 +101,7 @@ device		siis		# SiliconImage SiI3124/SiI
 # SCSI Controllers
 device		adv		# Advansys SCSI adapters
 device		ahc		# AHA2940 and onboard AIC7xxx devices
-device		amd		# AMD 53C974 (Tekram DC-390(T))
+device		esp		# AMD Am53C974 (Tekram DC-390(T))
 device		isp		# Qlogic family
 #device		ncr		# NCR/Symbios Logic
 device		sym		# NCR/Symbios Logic (newer chipsets + those of `ncr')

Modified: head/sys/sparc64/conf/GENERIC
==============================================================================
--- head/sys/sparc64/conf/GENERIC	Tue Nov  1 21:21:36 2011	(r227005)
+++ head/sys/sparc64/conf/GENERIC	Tue Nov  1 21:26:57 2011	(r227006)
@@ -103,11 +103,11 @@ device		ahc		# AHA2940 and onboard AIC7x
 options 	AHC_ALLOW_MEMIO	# Attempt to use memory mapped I/O
 options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
 					# output.  Adds ~128k to driver.
+device		esp		# AMD Am53C974, Sun ESP and FAS	families
 device		isp		# Qlogic family
 device		ispfw		# Firmware module for Qlogic host adapters
 device		mpt		# LSI-Logic MPT-Fusion
 device		sym		# NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D
-device		esp		# NCR53c9x (FEPS/FAS366)
 
 # ATA/SCSI peripherals
 device		scbus		# SCSI bus (required for ATA/SCSI)

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 22:00:50 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED926106566C;
	Tue,  1 Nov 2011 22:00:49 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D32498FC14;
	Tue,  1 Nov 2011 22:00:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1M0nmE085350;
	Tue, 1 Nov 2011 22:00:49 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1M0nF9085343;
	Tue, 1 Nov 2011 22:00:49 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201111012200.pA1M0nF9085343@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Tue, 1 Nov 2011 22:00:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227007 - in stable/9: etc/devd sys/dev/usb
	sys/dev/usb/quirk sys/dev/usb/wlan
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 22:00:50 -0000

Author: hselasky
Date: Tue Nov  1 22:00:49 2011
New Revision: 227007
URL: http://svn.freebsd.org/changeset/base/227007

Log:
  MFC r226903, r225777, r226221 and r226534:
  Add some new USB device IDs and some USB device quirks.
  Improve the USB mass storage auto quirk detection.
  
  PR:		usb/161798, usb/160911
  Approved by:	re (kib)

Modified:
  stable/9/etc/devd/usb.conf
  stable/9/sys/dev/usb/quirk/usb_quirk.c
  stable/9/sys/dev/usb/usb_device.c
  stable/9/sys/dev/usb/usb_msctest.c
  stable/9/sys/dev/usb/usbdevs
  stable/9/sys/dev/usb/wlan/if_run.c
Directory Properties:
  stable/9/etc/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/etc/devd/usb.conf
==============================================================================
--- stable/9/etc/devd/usb.conf	Tue Nov  1 21:26:57 2011	(r227006)
+++ stable/9/etc/devd/usb.conf	Tue Nov  1 22:00:49 2011	(r227007)
@@ -565,6 +565,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x04e8";
+	match "product" "0x2018";
+	action "kldload if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x04e8";
 	match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)";
 	action "kldload uipaq";
 };
@@ -741,7 +749,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x050d";
-	match "product" "(0x8053|0x805c|0x815c|0x825a)";
+	match "product" "(0x8053|0x805c|0x815c|0x825a|0x825b)";
 	action "kldload if_run";
 };
 
@@ -1877,7 +1885,23 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0af0";
-	match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901)";
+	match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701)";
+	action "kldload u3g";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0af0";
+	match "product" "0x6711";
+	action "kldload uhso";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0af0";
+	match "product" "(0x6721|0x6741|0x6761|0x6800|0x6901)";
 	action "kldload u3g";
 };
 
@@ -2069,7 +2093,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0b95";
-	match "product" "(0x1720|0x1780|0x7720|0x772a)";
+	match "product" "(0x1720|0x1780|0x7720|0x772a|0x772b)";
 	action "kldload if_axe";
 };
 
@@ -2500,6 +2524,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x0f3d";
+	match "product" "0x68a3";
+	action "kldload usie";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x0f4e";
 	match "product" "0x0200";
 	action "kldload uipaq";
@@ -2789,13 +2821,37 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x1199";
-	match "product" "(0x0220|0x0224|0x0fff|0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)";
+	match "product" "(0x0220|0x0224|0x0fff)";
+	action "kldload u3g";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x1199";
+	match "product" "0x0fff";
+	action "kldload usie";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x1199";
+	match "product" "(0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)";
 	action "kldload u3g";
 };
 
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x1199";
+	match "product" "0x68a3";
+	action "kldload usie";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x11ad";
 	match "product" "0x0701";
 	action "kldload uplcom";
@@ -2869,7 +2925,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x12d1";
-	match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520)";
+	match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520|0x1c05|0x1c0b)";
 	action "kldload u3g";
 };
 
@@ -2972,6 +3028,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x13b1";
+	match "product" "0x002f";
+	action "kldload if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x13d2";
 	match "product" "0x0400";
 	action "kldload if_kue";
@@ -3669,7 +3733,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x1c9e";
-	match "product" "(0x6061|0x9603|0xf000)";
+	match "product" "(0x6061|0x9603|0x9605|0xf000)";
 	action "kldload u3g";
 };
 
@@ -4263,5 +4327,5 @@ nomatch 32 {
 	action "kldload umass";
 };
 
-# 1634 USB entries processed
+# 1645 USB entries processed
 

Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- stable/9/sys/dev/usb/quirk/usb_quirk.c	Tue Nov  1 21:26:57 2011	(r227006)
+++ stable/9/sys/dev/usb/quirk/usb_quirk.c	Tue Nov  1 22:00:49 2011	(r227007)
@@ -457,6 +457,14 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(ROLAND, SD80, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
 	USB_QUIRK(ROLAND, UA700, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
 	USB_QUIRK(MEDELI, DD305, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI, UQ_MATCH_VENDOR_ONLY),
+
+	/*
+	 * Quirks for manufacturers which USB devices does not respond
+	 * after issuing non-supported commands:
+	 */
+	USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
+	USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
+	USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
 };
 #undef USB_QUIRK_VP
 #undef USB_QUIRK

Modified: stable/9/sys/dev/usb/usb_device.c
==============================================================================
--- stable/9/sys/dev/usb/usb_device.c	Tue Nov  1 21:26:57 2011	(r227006)
+++ stable/9/sys/dev/usb/usb_device.c	Tue Nov  1 22:00:49 2011	(r227007)
@@ -1851,7 +1851,8 @@ repeat_set_config:
 		}
 	}
 	if (set_config_failed == 0 && config_index == 0 &&
-	    usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0) {
+	    usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 &&
+	    usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0) {
 
 		/*
 		 * Try to figure out if there are any MSC quirks we

Modified: stable/9/sys/dev/usb/usb_msctest.c
==============================================================================
--- stable/9/sys/dev/usb/usb_msctest.c	Tue Nov  1 21:26:57 2011	(r227006)
+++ stable/9/sys/dev/usb/usb_msctest.c	Tue Nov  1 22:00:49 2011	(r227007)
@@ -603,6 +603,29 @@ usb_iface_is_cdrom(struct usb_device *ud
 	return (is_cdrom);
 }
 
+static uint8_t
+usb_msc_get_max_lun(struct usb_device *udev, uint8_t iface_index)
+{
+	struct usb_device_request req;
+	usb_error_t err;
+	uint8_t buf = 0;
+
+
+	/* The Get Max Lun command is a class-specific request. */
+	req.bmRequestType = UT_READ_CLASS_INTERFACE;
+	req.bRequest = 0xFE;		/* GET_MAX_LUN */
+	USETW(req.wValue, 0);
+	req.wIndex[0] = iface_index;
+	req.wIndex[1] = 0;
+	USETW(req.wLength, 1);
+
+	err = usbd_do_request(udev, NULL, &req, &buf);
+	if (err)
+		buf = 0;
+
+	return (buf);
+}
+
 usb_error_t
 usb_msc_auto_quirk(struct usb_device *udev, uint8_t iface_index)
 {
@@ -622,6 +645,11 @@ usb_msc_auto_quirk(struct usb_device *ud
 	 */
 	usb_pause_mtx(NULL, hz);
 
+	if (usb_msc_get_max_lun(udev, iface_index) == 0) {
+		DPRINTF("Device has only got one LUN.\n");
+		usbd_add_dynamic_quirk(udev, UQ_MSC_NO_GETMAXLUN);
+	}
+
 	is_no_direct = 1;
 	for (timeout = 4; timeout; timeout--) {
 		err = bbb_command_start(sc, DIR_IN, 0, sc->buffer,

Modified: stable/9/sys/dev/usb/usbdevs
==============================================================================
--- stable/9/sys/dev/usb/usbdevs	Tue Nov  1 21:26:57 2011	(r227006)
+++ stable/9/sys/dev/usb/usbdevs	Tue Nov  1 22:00:49 2011	(r227007)
@@ -606,6 +606,7 @@ vendor BALTECH		0x13ad	Baltech
 vendor CISCOLINKSYS	0x13b1	Cisco-Linksys
 vendor SHARK		0x13d2	Shark
 vendor AZUREWAVE	0x13d3	AsureWave
+vendor INITIO		0x13fd	Initio Corporation
 vendor EMTEC		0x13fe	Emtec
 vendor NOVATEL		0x1410	Novatel Wireless
 vendor MERLIN		0x1416	Merlin
@@ -1144,6 +1145,7 @@ product BELKIN RT2870_1		0x8053	RT2870
 product BELKIN RT2870_2		0x805c	RT2870
 product BELKIN F5D8053V3	0x815c	F5D8053 v3
 product BELKIN F5D8055		0x825a	F5D8055
+product BELKIN F5D8055V2	0x825b	F5D8055 v2
 product BELKIN F5D9050V3	0x905b	F5D9050 ver 3 Wireless Adapter
 product BELKIN2 F5U002		0x0002	F5U002 Parallel printer
 product BELKIN F6D4050V1	0x935a	F6D4050 v1
@@ -1227,8 +1229,9 @@ product CISCOLINKSYS HU200TS	0x001a	HU20
 product CISCOLINKSYS WUSB54GC	0x0020	WUSB54GC
 product CISCOLINKSYS WUSB54GR	0x0023	WUSB54GR
 product CISCOLINKSYS WUSBF54G	0x0024	WUSBF54G
-product	CISCOLINKSYS2 RT3070	0x4001	RT3070
-product	CISCOLINKSYS3 RT3070	0x0101	RT3070
+product CISCOLINKSYS AE1000	0x002f	AE1000
+product CISCOLINKSYS2 RT3070	0x4001	RT3070
+product CISCOLINKSYS3 RT3070	0x0101	RT3070
 
 /* Clipsal products */
 product CLIPSAL 5500PCU		0x0303	5500PCU C-Bus
@@ -1569,6 +1572,7 @@ product EXTENDED XTNDACCESS	0x0100	XTNDA
 product FALCOM TWIST		0x0001	USB GSM/GPRS Modem
 
 /* FEIYA products */
+product FEIYA DUMMY		0x0000	Dummy product
 product FEIYA 5IN1		0x1132	5-in-1 Card Reader
 product FEIYA AC110		0x6300	AC-110 Card Reader
 
@@ -1886,6 +1890,10 @@ product IBM USBCDROMDRIVE	0x4427	USB CD-
 /* Imagination Technologies products */
 product IMAGINATION DBX1	0x2107	DBX1 DSP core
 
+/* Initio Corporation products */
+product INITIO DUMMY		0x0000	Dummy product
+product INITIO INIC_1610P	0x1e40	USB to SATA Bridge
+
 /* Inside Out Networks products */
 product INSIDEOUT EDGEPORT4	0x0001	EdgePort/4 serial ports
 
@@ -2780,6 +2788,7 @@ product RATOC REXUSB60F		0xb020	USB seri
 
 /* ReakTek products */
 /* Green House and CompUSA OEM this part */
+product REALTEK DUMMY		0x0000	Dummy product
 product REALTEK USB20CRW	0x0158	USB20CRW Card Reader
 product REALTEK USBKR100	0x8150	USBKR100 USB Ethernet
 product REALTEK RTL8187		0x8187	RTL8187 Wireless Adapter
@@ -2833,6 +2842,7 @@ product SAGEM XG760A		0x004a	XG-760A
 product SAGEM XG76NA		0x0062	XG-76NA
 
 /* Samsung products */
+product SAMSUNG WIS09ABGN	0x2018	WIS09ABGN Wireless LAN adapter
 product SAMSUNG ML6060		0x3008	ML-6060 laser printer
 product SAMSUNG YP_U2		0x5050	YP-U2 MP3 Player
 product SAMSUNG YP_U4		0x5092	YP-U4 MP3 Player

Modified: stable/9/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/9/sys/dev/usb/wlan/if_run.c	Tue Nov  1 21:26:57 2011	(r227006)
+++ stable/9/sys/dev/usb/wlan/if_run.c	Tue Nov  1 22:00:49 2011	(r227007)
@@ -144,9 +144,11 @@ static const STRUCT_USB_HOST_ID run_devs
     RUN_DEV(AZUREWAVE,		RT3070_3),
     RUN_DEV(BELKIN,		F5D8053V3),
     RUN_DEV(BELKIN,		F5D8055),
+    RUN_DEV(BELKIN,		F5D8055V2),
     RUN_DEV(BELKIN,		F6D4050V1),
     RUN_DEV(BELKIN,		RT2870_1),
     RUN_DEV(BELKIN,		RT2870_2),
+    RUN_DEV(CISCOLINKSYS,	AE1000),
     RUN_DEV(CISCOLINKSYS2,	RT3070),
     RUN_DEV(CISCOLINKSYS3,	RT3070),
     RUN_DEV(CONCEPTRONIC2,	RT2870_1),
@@ -247,6 +249,7 @@ static const STRUCT_USB_HOST_ID run_devs
     RUN_DEV(RALINK,		RT3370),
     RUN_DEV(RALINK,		RT3572),
     RUN_DEV(RALINK,		RT8070),
+    RUN_DEV(SAMSUNG,		WIS09ABGN),
     RUN_DEV(SAMSUNG2,		RT2870_1),
     RUN_DEV(SENAO,		RT2870_1),
     RUN_DEV(SENAO,		RT2870_2),

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 22:22:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DF461065672;
	Tue,  1 Nov 2011 22:22:47 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 043768FC20;
	Tue,  1 Nov 2011 22:22:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1MMkRB086080;
	Tue, 1 Nov 2011 22:22:46 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1MMk9T086078;
	Tue, 1 Nov 2011 22:22:46 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <201111012222.pA1MMk9T086078@svn.freebsd.org>
From: Qing Li 
Date: Tue, 1 Nov 2011 22:22:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227008 - stable/9/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 22:22:47 -0000

Author: qingli
Date: Tue Nov  1 22:22:46 2011
New Revision: 227008
URL: http://svn.freebsd.org/changeset/base/227008

Log:
  MFC 226710
  
  The host-id/interface-id can have a specific value and is properly
  masked out when adding a prefix route through the "route" command.
  However, when deleting the route, simply changing the command keyword
  from "add" to "delete" does not work. The failoure is observed in
  both IPv4 and IPv6 route insertion. The patch makes the route command
  behavior consistent between the "add" and the "delete" operation.
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/net/route.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/net/route.c
==============================================================================
--- stable/9/sys/net/route.c	Tue Nov  1 22:00:49 2011	(r227007)
+++ stable/9/sys/net/route.c	Tue Nov  1 22:22:46 2011	(r227008)
@@ -1025,6 +1025,7 @@ rtrequest1_fib(int req, struct rt_addrin
 	register struct radix_node_head *rnh;
 	struct ifaddr *ifa;
 	struct sockaddr *ndst;
+	struct sockaddr_storage mdst;
 #define senderr(x) { error = x ; goto bad; }
 
 	KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum"));
@@ -1051,6 +1052,10 @@ rtrequest1_fib(int req, struct rt_addrin
 
 	switch (req) {
 	case RTM_DELETE:
+		if (netmask) {
+			rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask);
+			dst = (struct sockaddr *)&mdst;
+		}
 #ifdef RADIX_MPATH
 		if (rn_mpath_capable(rnh)) {
 			error = rn_mpath_update(req, info, rnh, ret_nrt);

From owner-svn-src-all@FreeBSD.ORG  Tue Nov  1 23:12:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 428621065675;
	Tue,  1 Nov 2011 23:12:23 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 32F158FC0C;
	Tue,  1 Nov 2011 23:12:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1NCNab089114;
	Tue, 1 Nov 2011 23:12:23 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1NCNuY089112;
	Tue, 1 Nov 2011 23:12:23 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201111012312.pA1NCNuY089112@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 1 Nov 2011 23:12:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227009 - head/sys/geom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 23:12:23 -0000

Author: mav
Date: Tue Nov  1 23:12:22 2011
New Revision: 227009
URL: http://svn.freebsd.org/changeset/base/227009

Log:
  Make orphan() method in geom_dev asynchronous using destroy_dev_sched_cb()
  instead of destroy_dev(). It moves device destruction waiting out of the
  topology lock and so fixes dead lock between orphanization and closing.
  Real provider and geom destruction called from swi context after device
  destroyed as callback of the destroy_dev_sched_cb().

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==============================================================================
--- head/sys/geom/geom_dev.c	Tue Nov  1 22:22:46 2011	(r227008)
+++ head/sys/geom/geom_dev.c	Tue Nov  1 23:12:22 2011	(r227009)
@@ -506,6 +506,32 @@ g_dev_strategy(struct bio *bp)
  */
 
 static void
+g_dev_cleanup(void *arg)
+{
+	struct g_geom *gp;
+	struct g_consumer *cp;
+
+	mtx_unlock(&Giant);
+	cp = arg;
+	gp = cp->geom;
+	g_trace(G_T_TOPOLOGY, "g_dev_cleanup(%p(%s))", cp, cp->provider->name);
+
+	/* Wait for the cows to come home */
+	while (cp->nstart != cp->nend)
+		pause("gdevcleanup", hz / 10);
+
+	g_topology_lock();
+	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
+		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
+
+	g_detach(cp);
+	g_destroy_consumer(cp);
+	g_destroy_geom(gp);
+	g_topology_unlock();
+	mtx_lock(&Giant);
+}
+
+static void
 g_dev_orphan(struct g_consumer *cp)
 {
 	struct g_geom *gp;
@@ -521,18 +547,7 @@ g_dev_orphan(struct g_consumer *cp)
 		set_dumper(NULL);
 
 	/* Destroy the struct cdev *so we get no more requests */
-	destroy_dev(dev);
-
-	/* Wait for the cows to come home */
-	while (cp->nstart != cp->nend)
-		pause("gdevorphan", hz / 10);
-
-	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
-		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
-
-	g_detach(cp);
-	g_destroy_consumer(cp);
-	g_destroy_geom(gp);
+	destroy_dev_sched_cb(dev, g_dev_cleanup, cp);
 }
 
 DECLARE_GEOM_CLASS(g_dev_class, g_dev);

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 04:21:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5FD0C1065670;
	Wed,  2 Nov 2011 04:21:21 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4FDC48FC0A;
	Wed,  2 Nov 2011 04:21:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA24LLO8099457;
	Wed, 2 Nov 2011 04:21:21 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA24LLgJ099455;
	Wed, 2 Nov 2011 04:21:21 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201111020421.pA24LLgJ099455@svn.freebsd.org>
From: Doug Barton 
Date: Wed, 2 Nov 2011 04:21:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227011 - head/usr.sbin/tzsetup
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 04:21:21 -0000

Author: dougb
Date: Wed Nov  2 04:21:20 2011
New Revision: 227011
URL: http://svn.freebsd.org/changeset/base/227011

Log:
  If the user is moving from any other time zone to UTC we need
  to delete any old /var/db/zoneinfo file that may exist so that
  tzsetup -r does the right thing.

Modified:
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.c	Wed Nov  2 00:21:03 2011	(r227010)
+++ head/usr.sbin/tzsetup/tzsetup.c	Wed Nov  2 04:21:20 2011	(r227011)
@@ -565,6 +565,18 @@ install_zoneinfo_file(const char *zonein
 
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
+			if (unlink(path_db) < 0 && errno != ENOENT) {
+				snprintf(title, sizeof(title), "Error");
+				snprintf(prompt, sizeof(prompt),
+				     "Could not delete %s: %s", path_db,
+				     strerror(errno));
+				if (usedialog)
+					dialog_mesgbox(title, prompt, 8, 72);
+				else
+					fprintf(stderr, "%s\n", prompt);
+
+				return (DITEM_FAILURE | DITEM_RECREATE);
+			}
 			return (DITEM_LEAVE_MENU);
 		}
 		

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 05:42:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2D92106566C;
	Wed,  2 Nov 2011 05:42:51 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5F39A8FC16;
	Wed,  2 Nov 2011 05:42:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA25gpoi002099;
	Wed, 2 Nov 2011 05:42:51 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA25gpAi002096;
	Wed, 2 Nov 2011 05:42:51 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201111020542.pA25gpAi002096@svn.freebsd.org>
From: Alan Cox 
Date: Wed, 2 Nov 2011 05:42:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227012 - in head/sys: mips/mips vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 05:42:51 -0000

Author: alc
Date: Wed Nov  2 05:42:51 2011
New Revision: 227012
URL: http://svn.freebsd.org/changeset/base/227012

Log:
  Add support for VM_ALLOC_WIRED and VM_ALLOC_ZERO to vm_page_alloc_freelist()
  and use these new options in the mips pmap.
  
  Wake up the page daemon in vm_page_alloc_freelist() if the number of free
  and cached pages becomes too low.
  
  Tidy up vm_page_alloc_init().  In particular, add a comment about an
  important restriction on its use.
  
  Tested by:	jchandra@

Modified:
  head/sys/mips/mips/pmap.c
  head/sys/vm/vm_page.c

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Wed Nov  2 04:21:20 2011	(r227011)
+++ head/sys/mips/mips/pmap.c	Wed Nov  2 05:42:51 2011	(r227012)
@@ -1077,7 +1077,8 @@ pmap_alloc_direct_page(unsigned int inde
 {
 	vm_page_t m;
 
-	m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, req);
+	m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, req | VM_ALLOC_WIRED |
+	    VM_ALLOC_ZERO);
 	if (m == NULL)
 		return (NULL);
 
@@ -1085,8 +1086,6 @@ pmap_alloc_direct_page(unsigned int inde
 		pmap_zero_page(m);
 
 	m->pindex = index;
-	atomic_add_int(&cnt.v_wire_count, 1);
-	m->wire_count = 1;
 	return (m);
 }
 

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Wed Nov  2 04:21:20 2011	(r227011)
+++ head/sys/vm/vm_page.c	Wed Nov  2 05:42:51 2011	(r227012)
@@ -1482,6 +1482,8 @@ vm_page_alloc(vm_object_t object, vm_pin
  * Initialize a page that has been freshly dequeued from a freelist.
  * The caller has to drop the vnode returned, if it is not NULL.
  *
+ * This function may only be used to initialize unmanaged pages.
+ *
  * To be called with vm_page_queue_free_mtx held.
  */
 struct vnode *
@@ -1507,11 +1509,12 @@ vm_page_alloc_init(vm_page_t m)
 	mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
 	drop = NULL;
 	if ((m->flags & PG_CACHED) != 0) {
+		KASSERT((m->flags & PG_ZERO) == 0,
+		    ("vm_page_alloc_init: cached page %p is PG_ZERO", m));
 		m->valid = 0;
 		m_object = m->object;
 		vm_page_cache_remove(m);
-		if (m_object->type == OBJT_VNODE &&
-		    m_object->cache == NULL)
+		if (m_object->type == OBJT_VNODE && m_object->cache == NULL)
 			drop = m_object->handle;
 	} else {
 		KASSERT(VM_PAGE_IS_FREE(m),
@@ -1519,9 +1522,9 @@ vm_page_alloc_init(vm_page_t m)
 		KASSERT(m->valid == 0,
 		    ("vm_page_alloc_init: free page %p is valid", m));
 		cnt.v_free_count--;
+		if ((m->flags & PG_ZERO) != 0)
+			vm_page_zero_count--;
 	}
-	if (m->flags & PG_ZERO)
-		vm_page_zero_count--;
 	/* Don't clear the PG_ZERO flag; we'll need it later. */
 	m->flags &= PG_ZERO;
 	m->aflags = 0;
@@ -1532,16 +1535,28 @@ vm_page_alloc_init(vm_page_t m)
 
 /*
  * 	vm_page_alloc_freelist:
- * 
- *	Allocate a page from the specified freelist.
- *	Only the ALLOC_CLASS values in req are honored, other request flags
- *	are ignored.
+ *
+ *	Allocate a physical page from the specified free page list.
+ *
+ *	The caller must always specify an allocation class.
+ *
+ *	allocation classes:
+ *	VM_ALLOC_NORMAL		normal process request
+ *	VM_ALLOC_SYSTEM		system *really* needs a page
+ *	VM_ALLOC_INTERRUPT	interrupt time request
+ *
+ *	optional allocation flags:
+ *	VM_ALLOC_WIRED		wire the allocated page
+ *	VM_ALLOC_ZERO		prefer a zeroed page
+ *
+ *	This routine may not sleep.
  */
 vm_page_t
 vm_page_alloc_freelist(int flind, int req)
 {
 	struct vnode *drop;
 	vm_page_t m;
+	u_int flags;
 	int page_req;
 
 	m = NULL;
@@ -1563,8 +1578,26 @@ vm_page_alloc_freelist(int flind, int re
 	}
 	drop = vm_page_alloc_init(m);
 	mtx_unlock(&vm_page_queue_free_mtx);
-	if (drop)
+
+	/*
+	 * Initialize the page.  Only the PG_ZERO flag is inherited.
+	 */
+	flags = 0;
+	if ((req & VM_ALLOC_ZERO) != 0)
+		flags = PG_ZERO;
+	m->flags &= flags;
+	if ((req & VM_ALLOC_WIRED) != 0) {
+		/*
+		 * The page lock is not required for wiring a page that does
+		 * not belong to an object.
+		 */
+		atomic_add_int(&cnt.v_wire_count, 1);
+		m->wire_count = 1;
+	}
+	if (drop != NULL)
 		vdrop(drop);
+	if (vm_paging_needed())
+		pagedaemon_wakeup();
 	return (m);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 07:40:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF378106564A;
	Wed,  2 Nov 2011 07:40:23 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BEA408FC08;
	Wed,  2 Nov 2011 07:40:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA27eN1P005759;
	Wed, 2 Nov 2011 07:40:23 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA27eN00005756;
	Wed, 2 Nov 2011 07:40:23 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201111020740.pA27eN00005756@svn.freebsd.org>
From: Doug Barton 
Date: Wed, 2 Nov 2011 07:40:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227013 - head/usr.sbin/mergemaster
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 07:40:24 -0000

Author: dougb
Date: Wed Nov  2 07:40:23 2011
New Revision: 227013
URL: http://svn.freebsd.org/changeset/base/227013

Log:
  1. Add a new option, --run-updates, to always or never run the newalises,
     pwd_mkdb, etc. updates at the end of the comparison.
  
  2. Add an update to the end to handle /etc/localtime, if it exists.
     If /var/db/zoneinfo exists, automatically update /etc/localtime,
     which should (hopefully) be safe to do. If not, prompt the user
     to run tzsetup.
  
  3. Update run_it_now(), the function that handles input for the updates,
     to make sure that we got a valid answer, and to handle the --run-updates
     option if supplied.

Modified:
  head/usr.sbin/mergemaster/mergemaster.8
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.8
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.8	Wed Nov  2 05:42:51 2011	(r227012)
+++ head/usr.sbin/mergemaster/mergemaster.8	Wed Nov  2 07:40:23 2011	(r227013)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 9, 2011
+.Dd November 1, 2011
 .Dt MERGEMASTER 8
 .Os
 .Sh NAME
@@ -34,6 +34,7 @@
 .Nm
 .Op Fl scrvhpCP
 .Op Fl a|iFU
+.Op Fl -run-updates=[always|never]
 .Op Fl m Ar /path/to/sources
 .Op Fl t Ar /path/to/temp/root
 .Op Fl d
@@ -246,6 +247,11 @@ rc file.
 Attempt to auto upgrade files that have not been user modified.
 This option can be dangerous when there are critical changes
 in the new versions that affect your running system.
+.It Fl -run-updates=[always|never]
+Specify always or never to run newaliases, pwd_mkdb, etc.
+at the end of the comparison run.
+If this option is omitted the default is to prompt the user
+for each update as necessary.
 .It Fl m Ar /path/to/sources
 Specify the path to the directory where you want to do the
 .Xr make 1 .
@@ -365,6 +371,9 @@ with all values commented out:
 # ***DANGEROUS***
 #AUTO_UPGRADE=
 #
+# Either always or never run newaliases, pwd_mkdb at the end (--run-updates)
+#RUN_UPDATES=
+#
 # Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C)
 #COMP_CONFS=
 #

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.sh	Wed Nov  2 05:42:51 2011	(r227012)
+++ head/usr.sbin/mergemaster/mergemaster.sh	Wed Nov  2 07:40:23 2011	(r227013)
@@ -15,7 +15,7 @@ PATH=/bin:/usr/bin:/usr/sbin
 display_usage () {
   VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
   echo "mergemaster version ${VERSION_NUMBER}"
-  echo 'Usage: mergemaster [-scrvhpCP] [-a|[-iFU]]'
+  echo 'Usage: mergemaster [-scrvhpCP] [-a|[-iFU]] [--run-updates=always|never]'
   echo '    [-m /path] [-t /path] [-d] [-u N] [-w N] [-A arch] [-D /path]'
   echo "Options:"
   echo "  -s  Strict comparison (diff every pair of files)"
@@ -31,6 +31,7 @@ display_usage () {
   echo '  -P  Preserve files that are overwritten'
   echo "  -U  Attempt to auto upgrade files that have not been user modified"
   echo '      ***DANGEROUS***'
+  echo '  --run-updates=  Specify always or never to run newalises, pwd_mkdb, etc.'
   echo ''
   echo "  -m /path/directory  Specify location of source to do the make in"
   echo "  -t /path/directory  Specify temp root directory"
@@ -262,6 +263,20 @@ if [ -r "$HOME/.mergemasterrc" ]; then
   . "$HOME/.mergemasterrc"
 fi
 
+for var in "$@" ; do
+  case "$var" in
+  --run-updates*)
+    RUN_UPDATES=`echo ${var#--run-updates=} | tr [:upper:] [:lower:]`
+    ;;
+  *)
+    newopts="$newopts $var"
+    ;;
+  esac
+done
+
+set -- $newopts
+unset var newopts
+
 # Check the command line options
 #
 while getopts ":ascrvhipCPm:t:du:w:D:A:FU" COMMAND_LINE_ARGUMENT ; do
@@ -1224,34 +1239,43 @@ case "${AUTO_UPGRADED_FILES}" in
 esac
 
 run_it_now () {
-  case "${AUTO_RUN}" in
-  '')
-    unset YES_OR_NO
-    echo ''
-    echo -n '    Would you like to run it now? y or n [n] '
-    read YES_OR_NO
+  [ -n "$AUTO_RUN" ] && return
+
+  local answer
+
+  echo ''
+  while : ; do
+    if [ "$RUN_UPDATES" = always ]; then
+      answer=y
+    elif [ "$RUN_UPDATES" = never ]; then
+      answer=n
+    else
+      echo -n '    Would you like to run it now? y or n [n] '
+      read answer
+    fi
 
-    case "${YES_OR_NO}" in
+    case "$answer" in
     y)
       echo "    Running ${1}"
       echo ''
       eval "${1}"
+      return
       ;;
     ''|n)
-      echo ''
-      echo "       *** Cancelled"
-      echo ''
+      if [ ! "$RUN_UPDATES" = never ]; then
+        echo ''
+        echo "       *** Cancelled"
+        echo ''
+      fi
       echo "    Make sure to run ${1} yourself"
+      return
       ;;
     *)
       echo ''
-      echo "       *** Sorry, I do not understand your answer (${YES_OR_NO})"
+      echo "       *** Sorry, I do not understand your answer (${answer})"
       echo ''
-      echo "    Make sure to run ${1} yourself"
     esac
-    ;;
-  *) ;;
-  esac
+  done
 }
 
 case "${NEED_NEWALIASES}" in
@@ -1310,6 +1334,19 @@ case "${NEED_PWD_MKDB}" in
   ;;
 esac
 
+if [ -e "${DESTDIR}/etc/localtime" ]; then	# Ignore if TZ == UTC
+  echo ''
+  if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then
+    echo "*** Reinstalling `cat ${DESTDIR}/var/db/zoneinfo` as ${DESTDIR}/etc/localtime"
+    [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}"
+    tzsetup $tzs_args -r
+  else
+    echo "*** There is no ${DESTDIR}/var/db/zoneinfo file to update ${DESTDIR}/etc/localtime."
+    echo '    You should run tzsetup'
+    run_it_now tzsetup
+  fi
+fi
+
 echo ''
 
 if [ -r "${MM_EXIT_SCRIPT}" ]; then

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 08:23:40 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AFFA106564A;
	Wed,  2 Nov 2011 08:23:40 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A0A88FC14;
	Wed,  2 Nov 2011 08:23:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA28Ne7N007168;
	Wed, 2 Nov 2011 08:23:40 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA28Ne2F007166;
	Wed, 2 Nov 2011 08:23:40 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201111020823.pA28Ne2F007166@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Wed, 2 Nov 2011 08:23:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227014 - stable/9/lib/libc/gen
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 08:23:40 -0000

Author: pluknet
Date: Wed Nov  2 08:23:40 2011
New Revision: 227014
URL: http://svn.freebsd.org/changeset/base/227014

Log:
  MFC r226836:
  Fix the manual section number for a cross-reference to open(2) and sort it.
  
  Approved by:	re (kib)

Modified:
  stable/9/lib/libc/gen/getutxent.3
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/stdtime/   (props changed)

Modified: stable/9/lib/libc/gen/getutxent.3
==============================================================================
--- stable/9/lib/libc/gen/getutxent.3	Wed Nov  2 07:40:23 2011	(r227013)
+++ stable/9/lib/libc/gen/getutxent.3	Wed Nov  2 08:23:40 2011	(r227014)
@@ -386,10 +386,10 @@ Otherwise, -1 is returned and the global
 is set to indicate the error.
 .Sh ERRORS
 In addition to the error conditions described in
+.Xr open 2 ,
 .Xr fdopen 3 ,
 .Xr fopen 3 ,
 .Xr fseek 3 ,
-.Xr open 3 ,
 the
 .Fn pututxline
 function can generate the following errors:

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 09:24:59 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E6B3106564A;
	Wed,  2 Nov 2011 09:24:59 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E2E68FC08;
	Wed,  2 Nov 2011 09:24:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA29Oxq8009137;
	Wed, 2 Nov 2011 09:24:59 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA29OxUV009135;
	Wed, 2 Nov 2011 09:24:59 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201111020924.pA29OxUV009135@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 2 Nov 2011 09:24:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227015 - head/sys/geom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 09:24:59 -0000

Author: mav
Date: Wed Nov  2 09:24:59 2011
New Revision: 227015
URL: http://svn.freebsd.org/changeset/base/227015

Log:
  Add mutex and two flags to make orphan() call properly asynchronous:
   - delay consumer closing and detaching on orphan() until all I/Os complete;
   - prevent new I/Os submission after orphan() called.
  Previous implementation could destroy consumers still having active
  requests and worked only because of global workaround made on GEOM level.

Modified:
  head/sys/geom/geom_vfs.c

Modified: head/sys/geom/geom_vfs.c
==============================================================================
--- head/sys/geom/geom_vfs.c	Wed Nov  2 08:23:40 2011	(r227014)
+++ head/sys/geom/geom_vfs.c	Wed Nov  2 09:24:59 2011	(r227015)
@@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 	/* XXX Temporary for VFS_LOCK_GIANT */
 
@@ -45,6 +47,13 @@ __FBSDID("$FreeBSD$");
  */
 #include 
 
+struct g_vfs_softc {
+	struct mtx	 sc_mtx;
+	struct bufobj	*sc_bo;
+	int		 sc_active;
+	int		 sc_orphaned;
+};
+
 static struct buf_ops __g_vfs_bufops = {
 	.bop_name =	"GEOM_VFS",
 	.bop_write =	bufwrite,
@@ -66,21 +75,29 @@ static struct g_class g_vfs_class = {
 DECLARE_GEOM_CLASS(g_vfs_class, g_vfs);
 
 static void
+g_vfs_destroy(void *arg, int flags __unused)
+{
+	struct g_consumer *cp;
+
+	g_topology_assert();
+	cp = arg;
+	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
+		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
+	g_detach(cp);
+	if (cp->geom->softc == NULL)
+		g_wither_geom(cp->geom, ENXIO);
+}
+
+static void
 g_vfs_done(struct bio *bip)
 {
+	struct g_consumer *cp;
+	struct g_vfs_softc *sc;
 	struct buf *bp;
-	int vfslocked;
-
-	/*
-	 * Provider ('bio_to') could have withered away sometime
-	 * between incrementing the 'nend' in g_io_deliver() and now,
-	 * making 'bio_to' a dangling pointer.  We cannot do that
-	 * in g_wither_geom(), as it would require going over
-	 * the 'g_bio_run_up' list, resetting the pointer.
-	 */
-	if (bip->bio_from->provider == NULL)
-		bip->bio_to = NULL;
+	int vfslocked, destroy;
 
+	cp = bip->bio_from;
+	sc = cp->geom->softc;
 	if (bip->bio_error) {
 		printf("g_vfs_done():");
 		g_print_bio(bip);
@@ -93,6 +110,13 @@ g_vfs_done(struct bio *bip)
 		bp->b_ioflags |= BIO_ERROR;
 	bp->b_resid = bp->b_bcount - bip->bio_completed;
 	g_destroy_bio(bip);
+
+	mtx_lock(&sc->sc_mtx);
+	destroy = ((--sc->sc_active) == 0 && sc->sc_orphaned);
+	mtx_unlock(&sc->sc_mtx);
+	if (destroy)
+		g_post_event(g_vfs_destroy, cp, M_WAITOK, NULL);
+
 	vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL));
 	bufdone(bp);
 	VFS_UNLOCK_GIANT(vfslocked);
@@ -101,17 +125,20 @@ g_vfs_done(struct bio *bip)
 void
 g_vfs_strategy(struct bufobj *bo, struct buf *bp)
 {
+	struct g_vfs_softc *sc;
 	struct g_consumer *cp;
 	struct bio *bip;
 	int vfslocked;
 
 	cp = bo->bo_private;
-	/* G_VALID_CONSUMER(cp); We likely lack topology lock */
+	sc = cp->geom->softc;
 
 	/*
 	 * If the provider has orphaned us, just return EXIO.
 	 */
-	if (cp->provider == NULL) {
+	mtx_lock(&sc->sc_mtx);
+	if (sc->sc_orphaned) {
+		mtx_unlock(&sc->sc_mtx);
 		bp->b_error = ENXIO;
 		bp->b_ioflags |= BIO_ERROR;
 		vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL));
@@ -119,6 +146,8 @@ g_vfs_strategy(struct bufobj *bo, struct
 		VFS_UNLOCK_GIANT(vfslocked);
 		return;
 	}
+	sc->sc_active++;
+	mtx_unlock(&sc->sc_mtx);
 
 	bip = g_alloc_bio();
 	bip->bio_cmd = bp->b_iocmd;
@@ -134,14 +163,20 @@ static void
 g_vfs_orphan(struct g_consumer *cp)
 {
 	struct g_geom *gp;
+	struct g_vfs_softc *sc;
+	int destroy;
 
 	g_topology_assert();
 
 	gp = cp->geom;
+	sc = gp->softc;
 	g_trace(G_T_TOPOLOGY, "g_vfs_orphan(%p(%s))", cp, gp->name);
-	if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
-		g_access(cp, -cp->acr, -cp->acw, -cp->ace);
-	g_detach(cp);
+	mtx_lock(&sc->sc_mtx);
+	sc->sc_orphaned = 1;
+	destroy = (sc->sc_active == 0);
+	mtx_unlock(&sc->sc_mtx);
+	if (destroy)
+		g_vfs_destroy(cp, 0);
 
 	/*
 	 * Do not destroy the geom.  Filesystem will do that during unmount.
@@ -154,6 +189,7 @@ g_vfs_open(struct vnode *vp, struct g_co
 	struct g_geom *gp;
 	struct g_provider *pp;
 	struct g_consumer *cp;
+	struct g_vfs_softc *sc;
 	struct bufobj *bo;
 	int vfslocked;
 	int error;
@@ -169,6 +205,10 @@ g_vfs_open(struct vnode *vp, struct g_co
 	if (pp == NULL)
 		return (ENOENT);
 	gp = g_new_geomf(&g_vfs_class, "%s.%s", fsname, pp->name);
+	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
+	mtx_init(&sc->sc_mtx, "g_vfs", NULL, MTX_DEF);
+	sc->sc_bo = bo;
+	gp->softc = sc;
 	cp = g_new_consumer(gp);
 	g_attach(cp, pp);
 	error = g_access(cp, 1, wr, wr);
@@ -184,7 +224,6 @@ g_vfs_open(struct vnode *vp, struct g_co
 	bo->bo_ops = g_vfs_bufops;
 	bo->bo_private = cp;
 	bo->bo_bsize = pp->sectorsize;
-	gp->softc = bo;
 
 	return (error);
 }
@@ -193,13 +232,17 @@ void
 g_vfs_close(struct g_consumer *cp)
 {
 	struct g_geom *gp;
-	struct bufobj *bo;
+	struct g_vfs_softc *sc;
 
 	g_topology_assert();
 
 	gp = cp->geom;
-	bo = gp->softc;
-	bufobj_invalbuf(bo, V_SAVE, 0, 0);
-	bo->bo_private = cp->private;
-	g_wither_geom_close(gp, ENXIO);
+	sc = gp->softc;
+	bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0);
+	sc->sc_bo->bo_private = cp->private;
+	gp->softc = NULL;
+	mtx_destroy(&sc->sc_mtx);
+	if (!sc->sc_orphaned || cp->provider == NULL)
+		g_wither_geom_close(gp, ENXIO);
+	g_free(sc);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 11:02:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E8A4106566C;
	Wed,  2 Nov 2011 11:02:43 +0000 (UTC)
	(envelope-from melifaro@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D74D8FC16;
	Wed,  2 Nov 2011 11:02:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2B2h0j019448;
	Wed, 2 Nov 2011 11:02:43 GMT (envelope-from melifaro@svn.freebsd.org)
Received: (from melifaro@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2B2hKs019446;
	Wed, 2 Nov 2011 11:02:43 GMT (envelope-from melifaro@svn.freebsd.org)
Message-Id: <201111021102.pA2B2hKs019446@svn.freebsd.org>
From: "Alexander V. Chernikov" 
Date: Wed, 2 Nov 2011 11:02:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227016 - stable/8/usr.bin/netstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 11:02:43 -0000

Author: melifaro
Date: Wed Nov  2 11:02:42 2011
New Revision: 227016
URL: http://svn.freebsd.org/changeset/base/227016

Log:
  MFC 213440 (by ru)
  
  Show hostcache statistics in nestat(1).
  
  Submitted by:   Maxim Dounin
  Approved by:    ae
  Approved by:    ru

Modified:
  stable/8/usr.bin/netstat/inet.c
Directory Properties:
  stable/8/usr.bin/netstat/   (props changed)

Modified: stable/8/usr.bin/netstat/inet.c
==============================================================================
--- stable/8/usr.bin/netstat/inet.c	Wed Nov  2 09:24:59 2011	(r227015)
+++ stable/8/usr.bin/netstat/inet.c	Wed Nov  2 11:02:42 2011	(r227016)
@@ -680,6 +680,9 @@ tcp_stats(u_long off, const char *name, 
 	p(tcps_sc_sendcookie, "\t%lu cookie%s sent\n");
 	p(tcps_sc_recvcookie, "\t%lu cookie%s received\n");
 
+	p(tcps_hc_added, "\t%lu hostcache entrie%s added\n");
+	p1a(tcps_hc_bucketoverflow, "\t\t%lu bucket overflow\n");
+
 	p(tcps_sack_recovery_episode, "\t%lu SACK recovery episode%s\n");
 	p(tcps_sack_rexmits,
 	    "\t%lu segment rexmit%s in SACK recovery episodes\n");

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 11:05:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 588E5106566C;
	Wed,  2 Nov 2011 11:05:12 +0000 (UTC)
	(envelope-from melifaro@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 478948FC0A;
	Wed,  2 Nov 2011 11:05:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2B5CHm019553;
	Wed, 2 Nov 2011 11:05:12 GMT (envelope-from melifaro@svn.freebsd.org)
Received: (from melifaro@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2B5Cmq019551;
	Wed, 2 Nov 2011 11:05:12 GMT (envelope-from melifaro@svn.freebsd.org)
Message-Id: <201111021105.pA2B5Cmq019551@svn.freebsd.org>
From: "Alexander V. Chernikov" 
Date: Wed, 2 Nov 2011 11:05:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227017 - stable/7/usr.bin/netstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 11:05:12 -0000

Author: melifaro
Date: Wed Nov  2 11:05:11 2011
New Revision: 227017
URL: http://svn.freebsd.org/changeset/base/227017

Log:
  MFC 213440 (by ru)
  
  Show hostcache statistics in netstat(1).
  
  Submitted by:   Maxim Dounin
  Approved by:    ae
  Approved by:    ru

Modified:
  stable/7/usr.bin/netstat/inet.c
Directory Properties:
  stable/7/usr.bin/netstat/   (props changed)

Modified: stable/7/usr.bin/netstat/inet.c
==============================================================================
--- stable/7/usr.bin/netstat/inet.c	Wed Nov  2 11:02:42 2011	(r227016)
+++ stable/7/usr.bin/netstat/inet.c	Wed Nov  2 11:05:11 2011	(r227017)
@@ -644,6 +644,9 @@ tcp_stats(u_long off, const char *name, 
 	p(tcps_sc_sendcookie, "\t%lu cookie%s sent\n");
 	p(tcps_sc_recvcookie, "\t%lu cookie%s received\n");
 
+	p(tcps_hc_added, "\t%lu hostcache entrie%s added\n");
+	p1a(tcps_hc_bucketoverflow, "\t\t%lu bucket overflow\n");
+
 	p(tcps_sack_recovery_episode, "\t%lu SACK recovery episode%s\n");
 	p(tcps_sack_rexmits,
 	    "\t%lu segment rexmit%s in SACK recovery episodes\n");

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 12:13:16 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3FB0106566B;
	Wed,  2 Nov 2011 12:13:16 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 383598FC13;
	Wed,  2 Nov 2011 12:13:16 +0000 (UTC)
Received: by vws11 with SMTP id 11so92697vws.13
	for ; Wed, 02 Nov 2011 05:13:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=Nw7klDHl1zRHltEhJasUdac/B93CuDOiK1J5z4FbsXs=;
	b=Yd18YUxK13tFxcdfLWh8i5ZLkUkXU2oiRfjQlE+oBaFkJfvtAHAdZVR1AW7e134iln
	Dsrarb6P92t3QkYhFsGSQNFcNX61qPmnTXV4db5Hq/Et0ekS+GVbp25ST4GEabf1D/5B
	eFjOrLXOl6fhPWWlSdxS2Bko8xEA4iiwnY0Tw=
MIME-Version: 1.0
Received: by 10.182.59.5 with SMTP id v5mr813472obq.78.1320235995373; Wed, 02
	Nov 2011 05:13:15 -0700 (PDT)
Sender: pluknet@gmail.com
Received: by 10.182.89.41 with HTTP; Wed, 2 Nov 2011 05:13:15 -0700 (PDT)
In-Reply-To: <201109271327.p8RDRHs8024689@svn.freebsd.org>
References: <201109271327.p8RDRHs8024689@svn.freebsd.org>
Date: Wed, 2 Nov 2011 15:13:15 +0300
X-Google-Sender-Auth: srXTREdA9PZG1moFCxfYONohENo
Message-ID: 
From: Sergey Kandaurov 
To: "Bjoern A. Zeeb" 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r225793 - in head/sys: modules/ipfw netinet/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 12:13:16 -0000

On 27 September 2011 17:27, Bjoern A. Zeeb  wrote:
> Author: bz
> Date: Tue Sep 27 13:27:17 2011
> New Revision: 225793
> URL: http://svn.freebsd.org/changeset/base/225793
>
> Log:
> =A0Unbreak no-ip and no-inet6 module builds with ipfw. =A0For now continu=
e to
> =A0build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the
> =A0assumption that the private L2 hook (which hopefully eventually will b=
e a
> =A0pfil hook as well) can still be useful.
>
> =A0Allow building the module without inet as well.
>
> =A0Glanced at by: =A0 =A0 =A0 =A0jhb
> =A0MFC after: =A0 =A03 days
>
> Modified:
> =A0head/sys/modules/ipfw/Makefile
> =A0head/sys/netinet/ipfw/ip_fw_pfil.c
>
> Modified: head/sys/modules/ipfw/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/modules/ipfw/Makefile =A0 =A0 =A0Tue Sep 27 13:20:41 2011 =
=A0 =A0 =A0 =A0(r225792)
> +++ head/sys/modules/ipfw/Makefile =A0 =A0 =A0Tue Sep 27 13:27:17 2011 =
=A0 =A0 =A0 =A0(r225793)
> @@ -8,7 +8,7 @@ KMOD=3D =A0 ipfw
> =A0SRCS=3D =A0ip_fw2.c ip_fw_pfil.c
> =A0SRCS+=3D ip_fw_dynamic.c ip_fw_log.c
> =A0SRCS+=3D ip_fw_sockopt.c ip_fw_table.c
> -SRCS+=3D opt_inet6.h opt_ipfw.h opt_ipsec.h
> +SRCS+=3D opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
>
> =A0CFLAGS+=3D -DIPFIREWALL
> =A0CFLAGS+=3D -I${.CURDIR}/../../contrib/pf
> @@ -22,6 +22,10 @@ CFLAGS+=3D -I${.CURDIR}/../../contrib/pf
> =A0#
>
> =A0.if !defined(KERNBUILDDIR)
> +.if ${MK_INET_SUPPORT} !=3D "no"
> +opt_inet.h:
> + =A0 =A0 =A0 echo "#define INET 1" > ${.TARGET}
> +.endif
> =A0.if ${MK_INET6_SUPPORT} !=3D "no"
> =A0opt_inet6.h:
> =A0 =A0 =A0 =A0echo "#define INET6 1" > ${.TARGET}
>
> Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/netinet/ipfw/ip_fw_pfil.c =A0Tue Sep 27 13:20:41 2011 =A0 =
=A0 =A0 =A0(r225792)
> +++ head/sys/netinet/ipfw/ip_fw_pfil.c =A0Tue Sep 27 13:27:17 2011 =A0 =
=A0 =A0 =A0(r225793)
> @@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$");
> =A0#if !defined(KLD_MODULE)
> =A0#include "opt_ipdn.h"
> =A0#include "opt_inet.h"
> +#include "opt_inet6.h"
> =A0#ifndef INET
> =A0#error IPFIREWALL requires INET.
> =A0#endif /* INET */
> =A0#endif /* KLD_MODULE */
> -#include "opt_inet6.h"

Hello.

This chunk seems to stop building inet6 part of ipfw.ko w/ INET6 enabled ke=
rnel.

Found by /etc/rc.d/ipfw restart:
[...]
/etc/rc.d/ipfw: WARNING: failed to enable IPv6 firewall

i.e. sysctl net.inet6.ip6.fw.enable doesn't present.

Reversion of this hunk fixed the problem.
NO_INET[46] lints aren't tested though.

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 13:12:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EDC38106566B;
	Wed,  2 Nov 2011 13:12:04 +0000 (UTC) (envelope-from bz@freebsd.org)
Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90])
	by mx1.freebsd.org (Postfix) with ESMTP id 73D398FC15;
	Wed,  2 Nov 2011 13:12:04 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id A8CA225D385E;
	Wed,  2 Nov 2011 12:53:32 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id CA442BD4077;
	Wed,  2 Nov 2011 12:53:31 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id oQo1aB3DqwN2; Wed,  2 Nov 2011 12:53:30 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id DEC5EBD40A5;
	Wed,  2 Nov 2011 12:53:29 +0000 (UTC)
Date: Wed, 2 Nov 2011 12:53:29 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: Sergey Kandaurov 
In-Reply-To: 
Message-ID: 
References: <201109271327.p8RDRHs8024689@svn.freebsd.org>
	
X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-1689620518-1320238410=:68690"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r225793 - in head/sys: modules/ipfw netinet/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 13:12:05 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1689620518-1320238410=:68690
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 2 Nov 2011, Sergey Kandaurov wrote:

> On 27 September 2011 17:27, Bjoern A. Zeeb  wrote:
>> Author: bz
>> Date: Tue Sep 27 13:27:17 2011
>> New Revision: 225793
>> URL: http://svn.freebsd.org/changeset/base/225793
>>
>> Log:
>>  Unbreak no-ip and no-inet6 module builds with ipfw.  For now continue to
>>  build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the
>>  assumption that the private L2 hook (which hopefully eventually will be a
>>  pfil hook as well) can still be useful.
>>
>>  Allow building the module without inet as well.
>>
>>  Glanced at by:        jhb
>>  MFC after:    3 days
>>
>> Modified:
>>  head/sys/modules/ipfw/Makefile
>>  head/sys/netinet/ipfw/ip_fw_pfil.c
>>
>> Modified: head/sys/modules/ipfw/Makefile
>> ==============================================================================
>> --- head/sys/modules/ipfw/Makefile      Tue Sep 27 13:20:41 2011        (r225792)
>> +++ head/sys/modules/ipfw/Makefile      Tue Sep 27 13:27:17 2011        (r225793)
>> @@ -8,7 +8,7 @@ KMOD=   ipfw
>>  SRCS=  ip_fw2.c ip_fw_pfil.c
>>  SRCS+= ip_fw_dynamic.c ip_fw_log.c
>>  SRCS+= ip_fw_sockopt.c ip_fw_table.c
>> -SRCS+= opt_inet6.h opt_ipfw.h opt_ipsec.h
>> +SRCS+= opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
>>
>>  CFLAGS+= -DIPFIREWALL
>>  CFLAGS+= -I${.CURDIR}/../../contrib/pf
>> @@ -22,6 +22,10 @@ CFLAGS+= -I${.CURDIR}/../../contrib/pf
>>  #
>>
>>  .if !defined(KERNBUILDDIR)
>> +.if ${MK_INET_SUPPORT} != "no"
>> +opt_inet.h:
>> +       echo "#define INET 1" > ${.TARGET}
>> +.endif
>>  .if ${MK_INET6_SUPPORT} != "no"
>>  opt_inet6.h:
>>        echo "#define INET6 1" > ${.TARGET}
>>
>> Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
>> ==============================================================================
>> --- head/sys/netinet/ipfw/ip_fw_pfil.c  Tue Sep 27 13:20:41 2011        (r225792)
>> +++ head/sys/netinet/ipfw/ip_fw_pfil.c  Tue Sep 27 13:27:17 2011        (r225793)
>> @@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$");
>>  #if !defined(KLD_MODULE)
>>  #include "opt_ipdn.h"
>>  #include "opt_inet.h"
>> +#include "opt_inet6.h"
>>  #ifndef INET
>>  #error IPFIREWALL requires INET.
>>  #endif /* INET */
>>  #endif /* KLD_MODULE */
>> -#include "opt_inet6.h"
>
> Hello.
>
> This chunk seems to stop building inet6 part of ipfw.ko w/ INET6 enabled kernel.
>
> Found by /etc/rc.d/ipfw restart:
> [...]
> /etc/rc.d/ipfw: WARNING: failed to enable IPv6 firewall
>
> i.e. sysctl net.inet6.ip6.fw.enable doesn't present.
>
> Reversion of this hunk fixed the problem.
> NO_INET[46] lints aren't tested though.


Just to double-check -- this only happens for you if you build and
use the module, not when you link it into the kernel?

As in that case I do have:
lion3#  sysctl net.inet6.ip6.fw.enable 
net.inet6.ip6.fw.enable: 1


What's your src.conf and make.conf files looking like in /etc should
you have them?  Any WITHOUT_INET6 or WITHOUT_INET6_SUPPORT in there?

/bz

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.
--0-1689620518-1320238410=:68690--

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 13:35:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 973DB106564A;
	Wed,  2 Nov 2011 13:35:35 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com
	[209.85.220.182])
	by mx1.freebsd.org (Postfix) with ESMTP id EC0FE8FC0C;
	Wed,  2 Nov 2011 13:35:34 +0000 (UTC)
Received: by vcbfk26 with SMTP id fk26so211563vcb.13
	for ; Wed, 02 Nov 2011 06:35:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=vLa373BGYxIcP8e6bLdwWviSRQl/k+XMBUR6/v/uDNc=;
	b=D3SFnmp46sAMOfj5Nr6NgOcX40tEHKocUfE7mz7F0nmnQvoIaEogBYAw/IsXFJ43GR
	4WvGF8USP86luJk8Pp7XLVh4Wl7rpJAhNCPm77k81tZE5oPubqoJM+RavlB3+o+SeAat
	WxOkIREAFe+j68/3g7eoTfqPcdEpRH/21UtsA=
MIME-Version: 1.0
Received: by 10.182.110.1 with SMTP id hw1mr901048obb.38.1320240934097; Wed,
	02 Nov 2011 06:35:34 -0700 (PDT)
Sender: pluknet@gmail.com
Received: by 10.182.89.41 with HTTP; Wed, 2 Nov 2011 06:35:34 -0700 (PDT)
In-Reply-To: 
References: <201109271327.p8RDRHs8024689@svn.freebsd.org>
	
	
Date: Wed, 2 Nov 2011 16:35:34 +0300
X-Google-Sender-Auth: p_4trOgU7Ch6_CWxhnhSGpVp8dU
Message-ID: 
From: Sergey Kandaurov 
To: "Bjoern A. Zeeb" 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r225793 - in head/sys: modules/ipfw netinet/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 13:35:35 -0000

On 2 November 2011 16:53, Bjoern A. Zeeb  wrote:
> On Wed, 2 Nov 2011, Sergey Kandaurov wrote:
>
>> On 27 September 2011 17:27, Bjoern A. Zeeb  wrote:
>>>
>>> Author: bz
>>> Date: Tue Sep 27 13:27:17 2011
>>> New Revision: 225793
>>> URL: http://svn.freebsd.org/changeset/base/225793
>>>
>>> Log:
>>> =A0Unbreak no-ip and no-inet6 module builds with ipfw. =A0For now conti=
nue to
>>> =A0build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under th=
e
>>> =A0assumption that the private L2 hook (which hopefully eventually will=
 be
>>> a
>>> =A0pfil hook as well) can still be useful.
>>>
>>> =A0Allow building the module without inet as well.
>>>
>>> =A0Glanced at by: =A0 =A0 =A0 =A0jhb
>>> =A0MFC after: =A0 =A03 days
>>>
>>> Modified:
>>> =A0head/sys/modules/ipfw/Makefile
>>> =A0head/sys/netinet/ipfw/ip_fw_pfil.c
>>>
>>> Modified: head/sys/modules/ipfw/Makefile
>>>
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>> --- head/sys/modules/ipfw/Makefile =A0 =A0 =A0Tue Sep 27 13:20:41 2011
>>> =A0(r225792)
>>> +++ head/sys/modules/ipfw/Makefile =A0 =A0 =A0Tue Sep 27 13:27:17 2011
>>> =A0(r225793)
>>> @@ -8,7 +8,7 @@ KMOD=3D =A0 ipfw
>>> =A0SRCS=3D =A0ip_fw2.c ip_fw_pfil.c
>>> =A0SRCS+=3D ip_fw_dynamic.c ip_fw_log.c
>>> =A0SRCS+=3D ip_fw_sockopt.c ip_fw_table.c
>>> -SRCS+=3D opt_inet6.h opt_ipfw.h opt_ipsec.h
>>> +SRCS+=3D opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
>>>
>>> =A0CFLAGS+=3D -DIPFIREWALL
>>> =A0CFLAGS+=3D -I${.CURDIR}/../../contrib/pf
>>> @@ -22,6 +22,10 @@ CFLAGS+=3D -I${.CURDIR}/../../contrib/pf
>>> =A0#
>>>
>>> =A0.if !defined(KERNBUILDDIR)
>>> +.if ${MK_INET_SUPPORT} !=3D "no"
>>> +opt_inet.h:
>>> + =A0 =A0 =A0 echo "#define INET 1" > ${.TARGET}
>>> +.endif
>>> =A0.if ${MK_INET6_SUPPORT} !=3D "no"
>>> =A0opt_inet6.h:
>>> =A0 =A0 =A0 =A0echo "#define INET6 1" > ${.TARGET}
>>>
>>> Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
>>>
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>> --- head/sys/netinet/ipfw/ip_fw_pfil.c =A0Tue Sep 27 13:20:41 2011
>>> =A0(r225792)
>>> +++ head/sys/netinet/ipfw/ip_fw_pfil.c =A0Tue Sep 27 13:27:17 2011
>>> =A0(r225793)
>>> @@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$");
>>> =A0#if !defined(KLD_MODULE)
>>> =A0#include "opt_ipdn.h"
>>> =A0#include "opt_inet.h"
>>> +#include "opt_inet6.h"
>>> =A0#ifndef INET
>>> =A0#error IPFIREWALL requires INET.
>>> =A0#endif /* INET */
>>> =A0#endif /* KLD_MODULE */
>>> -#include "opt_inet6.h"
>>
>> Hello.
>>
>> This chunk seems to stop building inet6 part of ipfw.ko w/ INET6 enabled
>> kernel.
>>
>> Found by /etc/rc.d/ipfw restart:
>> [...]
>> /etc/rc.d/ipfw: WARNING: failed to enable IPv6 firewall
>>
>> i.e. sysctl net.inet6.ip6.fw.enable doesn't present.
>>
>> Reversion of this hunk fixed the problem.
>> NO_INET[46] lints aren't tested though.
>
>
> Just to double-check -- this only happens for you if you build and
> use the module, not when you link it into the kernel?
>
> As in that case I do have:
> lion3# =A0sysctl net.inet6.ip6.fw.enable net.inet6.ip6.fw.enable: 1

ipfw is built and installed as a module as part of make kernel target.
There is no ipfw related options in KERNCONF itself.
ipfw.ko loads during rc(8) phase.

> What's your src.conf and make.conf files looking like in /etc should
> you have them? =A0Any WITHOUT_INET6 or WITHOUT_INET6_SUPPORT in there?

Nothing suspicious.

# cat /etc/src.conf
WITHOUT_CLANG=3D  yes

# cat /etc/make.conf
MODULES_OVERRIDE=3D       coretemp libalias nfsclient nfslockd nfslock \
                        nfs_common krpc nfssvc ipfw linux linprocfs \
                        mac_biba netgraph cyclic opensolaris dtrace \
                        dtrace/dtraceall cpufreq nullfs
KERNCONF=3DTST
WRKDIRPREFIX=3D/usr/works
# added by use.perl 2010-11-29 19:07:35
PERL_VERSION=3D5.10.1
WITHOUT_X11=3Dyes

(TST config has extra debugging changes, oldnfs and commented out devices.)

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 13:43:17 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 649291065670;
	Wed,  2 Nov 2011 13:43:17 +0000 (UTC)
	(envelope-from pawel@dawidek.net)
Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id 040FD8FC0C;
	Wed,  2 Nov 2011 13:43:17 +0000 (UTC)
Received: from localhost (58.wheelsystems.com [83.12.187.58])
	by mail.dawidek.net (Postfix) with ESMTPSA id AED71F04;
	Wed,  2 Nov 2011 14:43:14 +0100 (CET)
Date: Wed, 2 Nov 2011 14:42:26 +0100
From: Pawel Jakub Dawidek 
To: Alexander Motin 
Message-ID: <20111102134226.GA1656@garage.freebsd.pl>
References: <201111020924.pA29OxUV009135@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7"
Content-Disposition: inline
In-Reply-To: <201111020924.pA29OxUV009135@svn.freebsd.org>
X-OS: FreeBSD 9.0-CURRENT amd64
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r227015 - head/sys/geom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 13:43:17 -0000


--1yeeQ81UyVL57Vl7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 02, 2011 at 09:24:59AM +0000, Alexander Motin wrote:
> Author: mav
> Date: Wed Nov  2 09:24:59 2011
> New Revision: 227015
> URL: http://svn.freebsd.org/changeset/base/227015
>=20
> Log:
>   Add mutex and two flags to make orphan() call properly asynchronous:
>    - delay consumer closing and detaching on orphan() until all I/Os comp=
lete;
>    - prevent new I/Os submission after orphan() called.
>   Previous implementation could destroy consumers still having active
>   requests and worked only because of global workaround made on GEOM leve=
l.

Alexander, I'm not sure I agree with your recent changes to address
this. The checks in GEOM were there to avoid the need for counting
outstanding I/O requests in every single GEOM class.

Why do you think the checks in GEOM are not good enough?

Can we design solution that can be implemented in the framework itself,
so simple GEOM classes can stay simple?

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--1yeeQ81UyVL57Vl7
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk6xSMIACgkQForvXbEpPzR76ACfcnD2VIq+gZP/9wz8VrlaZrwE
McUAnj2DgGFLNV5j6g068uyWkM0C3qs8
=eTX9
-----END PGP SIGNATURE-----

--1yeeQ81UyVL57Vl7--

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 13:51:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79E1C106566C;
	Wed,  2 Nov 2011 13:51:29 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 698E28FC1C;
	Wed,  2 Nov 2011 13:51:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2DpTbS024238;
	Wed, 2 Nov 2011 13:51:29 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2DpTeb024236;
	Wed, 2 Nov 2011 13:51:29 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201111021351.pA2DpTeb024236@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 2 Nov 2011 13:51:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227018 - stable/9/etc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 13:51:29 -0000

Author: gavin
Date: Wed Nov  2 13:51:29 2011
New Revision: 227018
URL: http://svn.freebsd.org/changeset/base/227018

Log:
  Merge r226860 from head:
    Update the example rules in devfs.conf to reflect the changes since
    ATA_CAM.  While here, add another example rule, as many applications
    these days expect to find /dev/dvd instead.
  
  Approved by:	re (kib)
  
  _M   etc
  M    etc/devfs.conf

Modified:
  stable/9/etc/devfs.conf
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/devfs.conf
==============================================================================
--- stable/9/etc/devfs.conf	Wed Nov  2 11:05:11 2011	(r227017)
+++ stable/9/etc/devfs.conf	Wed Nov  2 13:51:29 2011	(r227018)
@@ -35,7 +35,8 @@
 #link	ttyv0	vga
 
 # Commonly used by many ports
-#link	acd0	cdrom
+#link	cd0	cdrom
+#link	cd0	dvd
 
 # Allow a user in the wheel group to query the smb0 device
 #perm	smb0	0660

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 14:28:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE4EA106564A;
	Wed,  2 Nov 2011 14:28:36 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AE7A28FC0C;
	Wed,  2 Nov 2011 14:28:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2ESacJ025473;
	Wed, 2 Nov 2011 14:28:36 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2ESa32025471;
	Wed, 2 Nov 2011 14:28:36 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201111021428.pA2ESa32025471@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 2 Nov 2011 14:28:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227020 - head/share/misc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 14:28:36 -0000

Author: maxim
Date: Wed Nov  2 14:28:36 2011
New Revision: 227020
URL: http://svn.freebsd.org/changeset/base/227020

Log:
  OpenBSD 5.0 added.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==============================================================================
--- head/share/misc/bsd-family-tree	Wed Nov  2 14:23:57 2011	(r227019)
+++ head/share/misc/bsd-family-tree	Wed Nov  2 14:28:36 2011	(r227020)
@@ -248,6 +248,9 @@ FreeBSD 5.2           |      |          
  |    8.2      7.4    |      |                 |               DragonFly 2.10.1
  |     v              |      |             OpenBSD 4.9                 |
  |                    |      |                 |                       |
+ |                    |      |                 |                       |
+ |                    |      |             OpenBSD 5.0                 |
+ |                    |      |                 |                       |
 FreeBSD 9 -current    |  NetBSD -current  OpenBSD -current             |
  |                    |      |                 |                       |
  v                    v      v                 v                       v
@@ -534,6 +537,7 @@ FreeBSD 7.4		2011-02-24 [FBD]
 FreeBSD 8.2		2011-02-24 [FBD]
 DragonFly 2.10.1	2011-04-26 [DFB]
 OpenBSD 4.9		2011-05-01 [OBD]
+OpenBSD 5.0		2011-11-01 [OBD]
 
 Bibliography
 ------------------------

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 15:09:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D147D106566C;
	Wed,  2 Nov 2011 15:09:47 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by mx1.freebsd.org (Postfix) with ESMTP id A4EF28FC12;
	Wed,  2 Nov 2011 15:09:46 +0000 (UTC)
Received: by eyd10 with SMTP id 10so315079eyd.13
	for ; Wed, 02 Nov 2011 08:09:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=tmTTEKLOik0FzEyhJDS901yl0Kq8lfduQW8kp6bnHu0=;
	b=CNaptAv2inEQiWJJWUhv+G2HaJnU5mZIaOTgSzjUiabVubGo5X3lcaFMryi1iTEopN
	1sH5O2ovT5JLjzNDfb+hDZkZ4dNh0jx8JYcYZoFiDQjQBzx43A0qTjVdzb7BpbhMieae
	WKeBKSIfeB2JaabKq5EIuYnQi+HF+DvAgBtZA=
Received: by 10.213.10.73 with SMTP id o9mr642721ebo.40.1320246585775;
	Wed, 02 Nov 2011 08:09:45 -0700 (PDT)
Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226])
	by mx.google.com with ESMTPS id z58sm7454557eea.3.2011.11.02.08.09.43
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 02 Nov 2011 08:09:44 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4EB15D36.9020409@FreeBSD.org>
Date: Wed, 02 Nov 2011 17:09:42 +0200
From: Alexander Motin 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
	rv:7.0.1) Gecko/20111003 Thunderbird/7.0.1
MIME-Version: 1.0
To: Pawel Jakub Dawidek 
References: <201111020924.pA29OxUV009135@svn.freebsd.org>
	<20111102134226.GA1656@garage.freebsd.pl>
In-Reply-To: <20111102134226.GA1656@garage.freebsd.pl>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r227015 - head/sys/geom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 15:09:48 -0000

On 11/02/11 15:42, Pawel Jakub Dawidek wrote:
> On Wed, Nov 02, 2011 at 09:24:59AM +0000, Alexander Motin wrote:
>> Author: mav
>> Date: Wed Nov  2 09:24:59 2011
>> New Revision: 227015
>> URL: http://svn.freebsd.org/changeset/base/227015
>>
>> Log:
>>   Add mutex and two flags to make orphan() call properly asynchronous:
>>    - delay consumer closing and detaching on orphan() until all I/Os complete;
>>    - prevent new I/Os submission after orphan() called.
>>   Previous implementation could destroy consumers still having active
>>   requests and worked only because of global workaround made on GEOM level.
> 
> Alexander, I'm not sure I agree with your recent changes to address
> this. The checks in GEOM were there to avoid the need for counting
> outstanding I/O requests in every single GEOM class.

Sorry, I've sent you letter last week asking for your opinion on this
problem, but got no response. :(

> Why do you think the checks in GEOM are not good enough?

Mostly because nstart increment and request submission are not locked.
There are race windows between start() call, request submission and
consumer detach: start() method may get provider pointer that will not
be valid in time of the request submission.

According geom(4), that race should be closed by assumption that
provider should not be closed until all active requests are completed.
Kind of reference counting, done by top consumers, such as geom_dev or
geom_vfs. That is what I am trying to fix with my changes.

Also I don't very like idea of periodic polling, trying to catch moment
when nstart == nend. As soon as at that time we haven't called orphan()
method yet, requests may go infinitely, even though each will be aborted
quickly. It looks dirty at least.

Counting of outstanding I/O requests needed only for classes that for
some reason can't follow that assumption. For example, geom_vfs releases
provider as soon as it orphans, not waiting for close() call from file
system. Another example is gmirror -- we want to drop single
disconnected disk while upstream provider is still working and won't be
closed.

> Can we design solution that can be implemented in the framework itself,
> so simple GEOM classes can stay simple?

Simple classes without special needs around access() method and
especially with one consumer should stay simple. All they should do on
orphan() call is just forward orphan() call up, calling some
g_wither_XXX() and not trying to forcefully close consumer, and let
things happen naturally.

The problem is that start() and bio_done() methods are not locked now,
but same time they expect topology not to change under them. I am not
sure how can it be simplified globally, unless we want to lock all of
them with topology lock.

-- 
Alexander Motin

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 15:18:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9ED4E1065670;
	Wed,  2 Nov 2011 15:18:11 +0000 (UTC) (envelope-from bz@freebsd.org)
Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90])
	by mx1.freebsd.org (Postfix) with ESMTP id B604B8FC0C;
	Wed,  2 Nov 2011 15:18:10 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id 8DF3325D3892;
	Wed,  2 Nov 2011 15:17:39 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id A9A77BD40AC;
	Wed,  2 Nov 2011 15:17:38 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id rcsPbEBc-euj; Wed,  2 Nov 2011 15:17:36 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id 9F6F5BD40A5;
	Wed,  2 Nov 2011 15:17:36 +0000 (UTC)
Date: Wed, 2 Nov 2011 15:17:36 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: Sergey Kandaurov 
In-Reply-To: 
Message-ID: 
References: <201109271327.p8RDRHs8024689@svn.freebsd.org>
	
	
	
X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-1886949233-1320247056=:68690"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r225793 - in head/sys: modules/ipfw netinet/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 15:18:11 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1886949233-1320247056=:68690
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 2 Nov 2011, Sergey Kandaurov wrote:

> On 2 November 2011 16:53, Bjoern A. Zeeb  wrote:
>> On Wed, 2 Nov 2011, Sergey Kandaurov wrote:
>>
>>> On 27 September 2011 17:27, Bjoern A. Zeeb  wrote:
>>>>
>>>> Author: bz
>>>> Date: Tue Sep 27 13:27:17 2011
>>>> New Revision: 225793
>>>> URL: http://svn.freebsd.org/changeset/base/225793
>>>>
>>>> Log:
>>>>  Unbreak no-ip and no-inet6 module builds with ipfw.  For now continue to
>>>>  build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the
>>>>  assumption that the private L2 hook (which hopefully eventually will be
>>>> a
>>>>  pfil hook as well) can still be useful.
>>>>
>>>>  Allow building the module without inet as well.
>>>>
>>>>  Glanced at by:        jhb
>>>>  MFC after:    3 days
>>>>
>>>> Modified:
>>>>  head/sys/modules/ipfw/Makefile
>>>>  head/sys/netinet/ipfw/ip_fw_pfil.c
>>>>
>>>> Modified: head/sys/modules/ipfw/Makefile
>>>>
>>>> ==============================================================================
>>>> --- head/sys/modules/ipfw/Makefile      Tue Sep 27 13:20:41 2011
>>>>  (r225792)
>>>> +++ head/sys/modules/ipfw/Makefile      Tue Sep 27 13:27:17 2011
>>>>  (r225793)
>>>> @@ -8,7 +8,7 @@ KMOD=   ipfw
>>>>  SRCS=  ip_fw2.c ip_fw_pfil.c
>>>>  SRCS+= ip_fw_dynamic.c ip_fw_log.c
>>>>  SRCS+= ip_fw_sockopt.c ip_fw_table.c
>>>> -SRCS+= opt_inet6.h opt_ipfw.h opt_ipsec.h
>>>> +SRCS+= opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
>>>>
>>>>  CFLAGS+= -DIPFIREWALL
>>>>  CFLAGS+= -I${.CURDIR}/../../contrib/pf
>>>> @@ -22,6 +22,10 @@ CFLAGS+= -I${.CURDIR}/../../contrib/pf
>>>>  #
>>>>
>>>>  .if !defined(KERNBUILDDIR)
>>>> +.if ${MK_INET_SUPPORT} != "no"
>>>> +opt_inet.h:
>>>> +       echo "#define INET 1" > ${.TARGET}
>>>> +.endif
>>>>  .if ${MK_INET6_SUPPORT} != "no"
>>>>  opt_inet6.h:
>>>>        echo "#define INET6 1" > ${.TARGET}
>>>>
>>>> Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
>>>>
>>>> ==============================================================================
>>>> --- head/sys/netinet/ipfw/ip_fw_pfil.c  Tue Sep 27 13:20:41 2011
>>>>  (r225792)
>>>> +++ head/sys/netinet/ipfw/ip_fw_pfil.c  Tue Sep 27 13:27:17 2011
>>>>  (r225793)
>>>> @@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$");
>>>>  #if !defined(KLD_MODULE)
>>>>  #include "opt_ipdn.h"
>>>>  #include "opt_inet.h"
>>>> +#include "opt_inet6.h"
>>>>  #ifndef INET
>>>>  #error IPFIREWALL requires INET.
>>>>  #endif /* INET */
>>>>  #endif /* KLD_MODULE */
>>>> -#include "opt_inet6.h"
>>>
>>> Hello.
>>>
>>> This chunk seems to stop building inet6 part of ipfw.ko w/ INET6 enabled
>>> kernel.
>>>
>>> Found by /etc/rc.d/ipfw restart:
>>> [...]
>>> /etc/rc.d/ipfw: WARNING: failed to enable IPv6 firewall
>>>
>>> i.e. sysctl net.inet6.ip6.fw.enable doesn't present.
>>>
>>> Reversion of this hunk fixed the problem.
>>> NO_INET[46] lints aren't tested though.
>>
>>
>> Just to double-check -- this only happens for you if you build and
>> use the module, not when you link it into the kernel?
>>
>> As in that case I do have:
>> lion3#  sysctl net.inet6.ip6.fw.enable net.inet6.ip6.fw.enable: 1
>
> ipfw is built and installed as a module as part of make kernel target.

Can you try to see if this fixes the problem?
http://people.freebsd.org/~bz/20111102-01-ipfw-kld.diff

Please not that in the module case we'd most likely also built out
some INET parts, not just INET6 once -- silently.

/bz

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.
--0-1886949233-1320247056=:68690--

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 16:45:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D6F21065670;
	Wed,  2 Nov 2011 16:45:29 +0000 (UTC)
	(envelope-from citrin@citrin.ru)
Received: from mail-chaos.rambler.ru (mail-chaos.rambler.ru [81.19.68.130])
	by mx1.freebsd.org (Postfix) with ESMTP id CD1108FC1C;
	Wed,  2 Nov 2011 16:45:28 +0000 (UTC)
Received: from citrin.office.vega.ru (office-nat.spylog.net [193.169.234.6])
	(Authenticated sender: citrin@citrin.ru)
	by mail-chaos.rambler.ru (Postfix) with ESMTPSA id CD9A01702A;
	Wed,  2 Nov 2011 19:34:52 +0300 (MSK)
Message-ID: <4EB1712C.9000309@citrin.ru>
Date: Wed, 02 Nov 2011 20:34:52 +0400
From: Anton Yuzhaninov 
User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
	rv:6.0.2) Gecko/20110922 Thunderbird/6.0.2
MIME-Version: 1.0
To: svn-src-all@freebsd.org, Andre Oppermann 
References: <201110161508.p9GF8hIc067651@svn.freebsd.org>
In-Reply-To: <201110161508.p9GF8hIc067651@svn.freebsd.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: 
Subject: Re: svn commit: r226437 - head/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 16:45:29 -0000

On 10/16/11 19:08, Andre Oppermann wrote:
> Author: andre
> Date: Sun Oct 16 15:08:43 2011
> New Revision: 226437
> URL: http://svn.freebsd.org/changeset/base/226437
>
> Log:
>    VNET virtualize tcp_sendspace/tcp_recvspace and change the
>    type to INT.  A long is not necessary as the TCP window is
>    limited to 2**30.  A larger initial window isn't useful.

In this commit sysctl renamed
from net.inet.tcp.sendspace to net.inet.tcp.tcp_sendspace
and from net.inet.tcp.recvspace to net.inet.tcp.tcp_recvspace

This break POLA without any benefits.
Please revert sysctl rename.

-- 
  Anton Yuzhaninov

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 17:40:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3E8911065670
	for ; Wed,  2 Nov 2011 17:40:11 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com
	[209.85.220.182])
	by mx1.freebsd.org (Postfix) with ESMTP id F1F688FC19
	for ; Wed,  2 Nov 2011 17:40:10 +0000 (UTC)
Received: by vcbfk26 with SMTP id fk26so590677vcb.13
	for ; Wed, 02 Nov 2011 10:40:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=uZV9GqRUPo+BfQIR05/yGllu2O5CHkcnwi4/v1IHs4c=;
	b=dyFg2N26v5O9kNbRm5cbUJ+t001haFKXLRiEZ8T1Xq8o7oebvo3VkrdQOpKRMpxiMV
	cQnqSx+AZXicqB1ShQruBMrONfjzuSCAhLlohT6oJTb5dk32WZihAf7eB1Pc5eTEfiB1
	7/4aXL2itMMHtgz/swj2c5TiUF499QuXLFPg8=
MIME-Version: 1.0
Received: by 10.182.17.103 with SMTP id n7mr1079639obd.68.1320255609993; Wed,
	02 Nov 2011 10:40:09 -0700 (PDT)
Received: by 10.182.89.41 with HTTP; Wed, 2 Nov 2011 10:40:09 -0700 (PDT)
In-Reply-To: <4EB1712C.9000309@citrin.ru>
References: <201110161508.p9GF8hIc067651@svn.freebsd.org>
	<4EB1712C.9000309@citrin.ru>
Date: Wed, 2 Nov 2011 20:40:09 +0300
Message-ID: 
From: Sergey Kandaurov 
To: Anton Yuzhaninov 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-all@freebsd.org, Andre Oppermann 
Subject: Re: svn commit: r226437 - head/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 17:40:11 -0000

On 2 November 2011 20:34, Anton Yuzhaninov  wrote:
> On 10/16/11 19:08, Andre Oppermann wrote:
>>
>> Author: andre
>> Date: Sun Oct 16 15:08:43 2011
>> New Revision: 226437
>> URL: http://svn.freebsd.org/changeset/base/226437
>>
>> Log:
>> =A0 VNET virtualize tcp_sendspace/tcp_recvspace and change the
>> =A0 type to INT. =A0A long is not necessary as the TCP window is
>> =A0 limited to 2**30. =A0A larger initial window isn't useful.
>
> In this commit sysctl renamed
> from net.inet.tcp.sendspace to net.inet.tcp.tcp_sendspace
> and from net.inet.tcp.recvspace to net.inet.tcp.tcp_recvspace
>
> This break POLA without any benefits.
> Please revert sysctl rename.

That was rather done accidentally as these names also match
in-kernel variables which hold the corresponding sysctl values.

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 18:06:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7232B1065687;
	Wed,  2 Nov 2011 18:06:23 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4729A8FC0A;
	Wed,  2 Nov 2011 18:06:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2I6NaT032238;
	Wed, 2 Nov 2011 18:06:23 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2I6Na9032235;
	Wed, 2 Nov 2011 18:06:23 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111021806.pA2I6Na9032235@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 2 Nov 2011 18:06:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227023 - head/lib/libc/amd64/gen
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 18:06:23 -0000

Author: kib
Date: Wed Nov  2 18:06:22 2011
New Revision: 227023
URL: http://svn.freebsd.org/changeset/base/227023

Log:
  Make sure that stack is 16-byte aligned before calling a function,
  as it is required by amd64 ABI. Add a comment for the places were
  the stack is accidentally properly aligned already.
  
  PR:	amd64/162214
  Submitted by:	yamayan 
  MFC after:	1 week

Modified:
  head/lib/libc/amd64/gen/setjmp.S
  head/lib/libc/amd64/gen/sigsetjmp.S

Modified: head/lib/libc/amd64/gen/setjmp.S
==============================================================================
--- head/lib/libc/amd64/gen/setjmp.S	Wed Nov  2 17:40:21 2011	(r227022)
+++ head/lib/libc/amd64/gen/setjmp.S	Wed Nov  2 18:06:22 2011	(r227023)
@@ -54,6 +54,7 @@ ENTRY(setjmp)
 	movq	$1,%rdi			/* SIG_BLOCK       */
 	movq	$0,%rsi			/* (sigset_t*)set  */
 	leaq	72(%rcx),%rdx		/* 9,10; (sigset_t*)oset */
+	/* stack is 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
 	popq	%rdi
 	movq	%rdi,%rcx
@@ -81,7 +82,9 @@ ENTRY(__longjmp)
 	movq	$3,%rdi			/* SIG_SETMASK     */
 	leaq	72(%rdx),%rsi		/* (sigset_t*)set  */
 	movq	$0,%rdx			/* (sigset_t*)oset */
+	subq	$0x8,%rsp		/* make the stack 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
+	addq	$0x8,%rsp
 	popq	%rsi
 	popq	%rdi			/* jmpbuf */
 	movq	%rdi,%rdx

Modified: head/lib/libc/amd64/gen/sigsetjmp.S
==============================================================================
--- head/lib/libc/amd64/gen/sigsetjmp.S	Wed Nov  2 17:40:21 2011	(r227022)
+++ head/lib/libc/amd64/gen/sigsetjmp.S	Wed Nov  2 18:06:22 2011	(r227023)
@@ -62,6 +62,7 @@ ENTRY(sigsetjmp)
 	movq	$1,%rdi			/* SIG_BLOCK       */
 	movq	$0,%rsi			/* (sigset_t*)set  */
 	leaq	72(%rcx),%rdx		/* 9,10 (sigset_t*)oset */
+	/* stack is 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
 	popq	%rdi
 2:	movq	%rdi,%rcx
@@ -90,7 +91,9 @@ ENTRY(__siglongjmp)
 	movq	$3,%rdi			/* SIG_SETMASK     */
 	leaq	72(%rdx),%rsi		/* (sigset_t*)set  */
 	movq	$0,%rdx			/* (sigset_t*)oset */
+	subq	$0x8,%rsp		/* make the stack 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
+	addq	$0x8,%rsp
 	popq	%rsi
 	popq	%rdi			/* jmpbuf */
 2:	movq	%rdi,%rdx

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 18:08:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3F9C106564A;
	Wed,  2 Nov 2011 18:08:30 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA7DB8FC1D;
	Wed,  2 Nov 2011 18:08:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2I8U8B032333;
	Wed, 2 Nov 2011 18:08:30 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2I8Udk032330;
	Wed, 2 Nov 2011 18:08:30 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111021808.pA2I8Udk032330@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 2 Nov 2011 18:08:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227024 - head/lib/libc/i386/gen
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 18:08:31 -0000

Author: kib
Date: Wed Nov  2 18:08:30 2011
New Revision: 227024
URL: http://svn.freebsd.org/changeset/base/227024

Log:
  Despite official i386 ABI does not mandate any stack alignment besides
  the word alignment, some versions of gcc do require 16-byte alignment.
  Make sure the stack is 16-byte aligned before calling a subroutine.
  
  Inspired by:	PR amd64/162214
  MFC after:	1 week

Modified:
  head/lib/libc/i386/gen/setjmp.S
  head/lib/libc/i386/gen/sigsetjmp.S

Modified: head/lib/libc/i386/gen/setjmp.S
==============================================================================
--- head/lib/libc/i386/gen/setjmp.S	Wed Nov  2 18:06:22 2011	(r227023)
+++ head/lib/libc/i386/gen/setjmp.S	Wed Nov  2 18:08:30 2011	(r227024)
@@ -51,12 +51,19 @@ __FBSDID("$FreeBSD$");
 ENTRY(setjmp)
 	movl	4(%esp),%ecx
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	leal	28(%ecx), %eax
 	pushl	%eax			/* (sigset_t*)oset */
 	pushl	$0			/* (sigset_t*)set  */
 	pushl	$1			/* SIG_BLOCK       */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%ecx
 	movl	0(%esp),%edx
@@ -76,12 +83,19 @@ END(setjmp)
 ENTRY(__longjmp)
 	movl	4(%esp),%edx
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	pushl	$0			/* (sigset_t*)oset */
 	leal	28(%edx), %eax
 	pushl	%eax			/* (sigset_t*)set  */
 	pushl	$3			/* SIG_SETMASK     */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%edx
 	movl	8(%esp),%eax

Modified: head/lib/libc/i386/gen/sigsetjmp.S
==============================================================================
--- head/lib/libc/i386/gen/sigsetjmp.S	Wed Nov  2 18:06:22 2011	(r227023)
+++ head/lib/libc/i386/gen/sigsetjmp.S	Wed Nov  2 18:08:30 2011	(r227024)
@@ -60,12 +60,19 @@ ENTRY(sigsetjmp)
 	testl	%eax,%eax
 	jz	2f
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	leal	28(%ecx), %eax
 	pushl	%eax			/* (sigset_t*)oset */
 	pushl	$0			/* (sigset_t*)set  */
 	pushl	$1			/* SIG_BLOCK       */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%ecx
 2:	movl	0(%esp),%edx
@@ -87,12 +94,19 @@ ENTRY(__siglongjmp)
 	cmpl	$0,44(%edx)
 	jz	2f
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	pushl	$0			/* (sigset_t*)oset */
 	leal	28(%edx), %eax
 	pushl	%eax			/* (sigset_t*)set  */
 	pushl	$3			/* SIG_SETMASK     */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%edx
 2:	movl	8(%esp),%eax

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 18:26:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9DB28106566C;
	Wed,  2 Nov 2011 18:26:47 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com
	[209.85.220.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 177768FC08;
	Wed,  2 Nov 2011 18:26:46 +0000 (UTC)
Received: by vcbfk26 with SMTP id fk26so657274vcb.13
	for ; Wed, 02 Nov 2011 11:26:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=V8JVJiAKzQL/38PlxwMoylnPHd2yII6d4f5Mbeo0u9k=;
	b=TDr7s6Z8tV0NF4Rl6E3R/mBdfadQfdyBLu9JdCcxLvWrxcIFN4XtkF2MRFvf2wflkg
	cDOhBpz0ZI5ZEGKP6YgUXQkDK25xouA49xZfAUPdLduVpr2233OcXcYCfr0jhTywkQoa
	+vJxxgIJ6MbSPBj7xQEvF7q2ktRL1GjZw3xT4=
MIME-Version: 1.0
Received: by 10.182.110.1 with SMTP id hw1mr1136294obb.38.1320258406289; Wed,
	02 Nov 2011 11:26:46 -0700 (PDT)
Sender: pluknet@gmail.com
Received: by 10.182.89.41 with HTTP; Wed, 2 Nov 2011 11:26:46 -0700 (PDT)
In-Reply-To: 
References: <201109271327.p8RDRHs8024689@svn.freebsd.org>
	
	
	
	
Date: Wed, 2 Nov 2011 21:26:46 +0300
X-Google-Sender-Auth: IMlazqwJFLMecc4U3T1MOLSeI5g
Message-ID: 
From: Sergey Kandaurov 
To: "Bjoern A. Zeeb" 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r225793 - in head/sys: modules/ipfw netinet/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 18:26:47 -0000

On 2 November 2011 19:17, Bjoern A. Zeeb  wrote:
> On Wed, 2 Nov 2011, Sergey Kandaurov wrote:
>
>> On 2 November 2011 16:53, Bjoern A. Zeeb  wrote:
>>>
>>> On Wed, 2 Nov 2011, Sergey Kandaurov wrote:
>>>
>>>> On 27 September 2011 17:27, Bjoern A. Zeeb  wrote:
>>>>>
>>>>> Author: bz
>>>>> Date: Tue Sep 27 13:27:17 2011
>>>>> New Revision: 225793
>>>>> URL: http://svn.freebsd.org/changeset/base/225793
>>>>>
>>>>> Log:
>>>>> =A0Unbreak no-ip and no-inet6 module builds with ipfw. =A0For now con=
tinue
>>>>> to
>>>>> =A0build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under =
the
>>>>> =A0assumption that the private L2 hook (which hopefully eventually wi=
ll
>>>>> be
>>>>> a
>>>>> =A0pfil hook as well) can still be useful.
>>>>>
>>>>> =A0Allow building the module without inet as well.
>>>>>
>>>>> =A0Glanced at by: =A0 =A0 =A0 =A0jhb
>>>>> =A0MFC after: =A0 =A03 days
>>>>>
>>>>> Modified:
>>>>> =A0head/sys/modules/ipfw/Makefile
>>>>> =A0head/sys/netinet/ipfw/ip_fw_pfil.c
>>>>>
>>>>> Modified: head/sys/modules/ipfw/Makefile
>>>>>
>>>>>
>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>>> --- head/sys/modules/ipfw/Makefile =A0 =A0 =A0Tue Sep 27 13:20:41 201=
1
>>>>> =A0(r225792)
>>>>> +++ head/sys/modules/ipfw/Makefile =A0 =A0 =A0Tue Sep 27 13:27:17 201=
1
>>>>> =A0(r225793)
>>>>> @@ -8,7 +8,7 @@ KMOD=3D =A0 ipfw
>>>>> =A0SRCS=3D =A0ip_fw2.c ip_fw_pfil.c
>>>>> =A0SRCS+=3D ip_fw_dynamic.c ip_fw_log.c
>>>>> =A0SRCS+=3D ip_fw_sockopt.c ip_fw_table.c
>>>>> -SRCS+=3D opt_inet6.h opt_ipfw.h opt_ipsec.h
>>>>> +SRCS+=3D opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
>>>>>
>>>>> =A0CFLAGS+=3D -DIPFIREWALL
>>>>> =A0CFLAGS+=3D -I${.CURDIR}/../../contrib/pf
>>>>> @@ -22,6 +22,10 @@ CFLAGS+=3D -I${.CURDIR}/../../contrib/pf
>>>>> =A0#
>>>>>
>>>>> =A0.if !defined(KERNBUILDDIR)
>>>>> +.if ${MK_INET_SUPPORT} !=3D "no"
>>>>> +opt_inet.h:
>>>>> + =A0 =A0 =A0 echo "#define INET 1" > ${.TARGET}
>>>>> +.endif
>>>>> =A0.if ${MK_INET6_SUPPORT} !=3D "no"
>>>>> =A0opt_inet6.h:
>>>>> =A0 =A0 =A0 =A0echo "#define INET6 1" > ${.TARGET}
>>>>>
>>>>> Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
>>>>>
>>>>>
>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>>>> --- head/sys/netinet/ipfw/ip_fw_pfil.c =A0Tue Sep 27 13:20:41 2011
>>>>> =A0(r225792)
>>>>> +++ head/sys/netinet/ipfw/ip_fw_pfil.c =A0Tue Sep 27 13:27:17 2011
>>>>> =A0(r225793)
>>>>> @@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$");
>>>>> =A0#if !defined(KLD_MODULE)
>>>>> =A0#include "opt_ipdn.h"
>>>>> =A0#include "opt_inet.h"
>>>>> +#include "opt_inet6.h"
>>>>> =A0#ifndef INET
>>>>> =A0#error IPFIREWALL requires INET.
>>>>> =A0#endif /* INET */
>>>>> =A0#endif /* KLD_MODULE */
>>>>> -#include "opt_inet6.h"
>>>>
>>>> Hello.
>>>>
>>>> This chunk seems to stop building inet6 part of ipfw.ko w/ INET6 enabl=
ed
>>>> kernel.
>>>>
>>>> Found by /etc/rc.d/ipfw restart:
>>>> [...]
>>>> /etc/rc.d/ipfw: WARNING: failed to enable IPv6 firewall
>>>>
>>>> i.e. sysctl net.inet6.ip6.fw.enable doesn't present.
>>>>
>>>> Reversion of this hunk fixed the problem.
>>>> NO_INET[46] lints aren't tested though.
>>>
>>>
>>> Just to double-check -- this only happens for you if you build and
>>> use the module, not when you link it into the kernel?
>>>
>>> As in that case I do have:
>>> lion3# =A0sysctl net.inet6.ip6.fw.enable net.inet6.ip6.fw.enable: 1
>>
>> ipfw is built and installed as a module as part of make kernel target.
>
> Can you try to see if this fixes the problem?
> http://people.freebsd.org/~bz/20111102-01-ipfw-kld.diff
>
> Please not that in the module case we'd most likely also built out
> some INET parts, not just INET6 once -- silently.
>

Hmm.. It is compiled differently when is built standalone and
as part of make buildkernel.

If built from sys/modules/ipfw:

# make
Warning: Object directory not changed from original /usr/src/sys/modules/ip=
fw
cc -O2 -pipe -DIPFIREWALL -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc  -I/usr/src/sys/modules/ipfw/../../contrib/pf
-I. -I@ -I@/contrib/altq -finline-limit=3D8000 --param
inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-common
-fno-omit-frame-pointer  -mno-sse -mcmodel=3Dkernel -mno-red-zone
-mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option -c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw2.c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw2.c:34:26: error:
opt_ipdivert.h: No such file or directory
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw2.c:35:22: error:
opt_ipdn.h: No such file or directory
*** Error code 1

# ls sys/modules/ipfw/opt*
sys/modules/ipfw/opt_inet.h     sys/modules/ipfw/opt_ipfw.h
sys/modules/ipfw/opt_inet6.h    sys/modules/ipfw/opt_ipsec.h

Maybe add the missing opt* into module's Makefile?

Index: sys/modules/ipfw/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/modules/ipfw/Makefile   (revision 226966)
+++ sys/modules/ipfw/Makefile   (working copy)
@@ -8,7 +8,8 @@
 SRCS=3D  ip_fw2.c ip_fw_pfil.c
 SRCS+=3D ip_fw_dynamic.c ip_fw_log.c
 SRCS+=3D ip_fw_sockopt.c ip_fw_table.c
-SRCS+=3D opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
+SRCS+=3D opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipdn.h opt_ipfw.h opt_i=
psec.h
+SRCS+=3D opt_compat.h    # for a local change

 CFLAGS+=3D -DIPFIREWALL
 CFLAGS+=3D -I${.CURDIR}/../../contrib/pf



And successfully as part of make buildkernel (w/o the above change to Makef=
ile):

[...]
=3D=3D=3D> ipfw (all)
cc -O2 -pipe -DIPFIREWALL -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc  -I/usr/src/sys/modules/ipfw/../../contrib/pf
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/TST/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=3D8000 --param inline-unit-growth=3D100 --param
large-function-growth=3D1000 -fno-common -g -fno-omit-frame-pointer
-I/usr/obj/usr/src/sys/TST  -mno-sse -mcmodel=3Dkernel -mno-red-zone
-mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option -c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw2.c
cc -O2 -pipe -DIPFIREWALL -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc  -I/usr/src/sys/modules/ipfw/../../contrib/pf
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/TST/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=3D8000 --param inline-unit-growth=3D100 --param
large-function-growth=3D1000 -fno-common -g -fno-omit-frame-pointer
-I/usr/obj/usr/src/sys/TST  -mno-sse -mcmodel=3Dkernel -mno-red-zone
-mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option -c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw_pfil.c
cc -O2 -pipe -DIPFIREWALL -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc  -I/usr/src/sys/modules/ipfw/../../contrib/pf
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/TST/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=3D8000 --param inline-unit-growth=3D100 --param
large-function-growth=3D1000 -fno-common -g -fno-omit-frame-pointer
-I/usr/obj/usr/src/sys/TST  -mno-sse -mcmodel=3Dkernel -mno-red-zone
-mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option -c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw_dynamic.c
cc -O2 -pipe -DIPFIREWALL -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc  -I/usr/src/sys/modules/ipfw/../../contrib/pf
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/TST/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=3D8000 --param inline-unit-growth=3D100 --param
large-function-growth=3D1000 -fno-common -g -fno-omit-frame-pointer
-I/usr/obj/usr/src/sys/TST  -mno-sse -mcmodel=3Dkernel -mno-red-zone
-mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option -c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw_log.c
ctfconvert -L VERSION -g ip_fw_pfil.o
ctfconvert -L VERSION -g ip_fw_log.o
cc -O2 -pipe -DIPFIREWALL -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc  -I/usr/src/sys/modules/ipfw/../../contrib/pf
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/TST/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=3D8000 --param inline-unit-growth=3D100 --param
large-function-growth=3D1000 -fno-common -g -fno-omit-frame-pointer
-I/usr/obj/usr/src/sys/TST  -mno-sse -mcmodel=3Dkernel -mno-red-zone
-mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option -c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw_sockopt.c
cc -O2 -pipe -DIPFIREWALL -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc  -I/usr/src/sys/modules/ipfw/../../contrib/pf
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/TST/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=3D8000 --param inline-unit-growth=3D100 --param
large-function-growth=3D1000 -fno-common -g -fno-omit-frame-pointer
-I/usr/obj/usr/src/sys/TST  -mno-sse -mcmodel=3Dkernel -mno-red-zone
-mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
-fdiagnostics-show-option -c
/usr/src/sys/modules/ipfw/../../netinet/ipfw/ip_fw_table.c
ctfconvert -L VERSION -g ip_fw_dynamic.o
ctfconvert -L VERSION -g ip_fw_table.o
ctfconvert -L VERSION -g ip_fw_sockopt.o
ctfconvert -L VERSION -g ip_fw2.o
ld  -d -warn-common -r -d -o ipfw.ko.debug ip_fw2.o ip_fw_pfil.o
ip_fw_dynamic.o ip_fw_log.o ip_fw_sockopt.o ip_fw_table.o
:> export_syms
awk -f /usr/src/sys/conf/kmod_syms.awk ipfw.ko.debug  export_syms |
xargs -J% objcopy % ipfw.ko.debug
objcopy --only-keep-debug ipfw.ko.debug ipfw.ko.symbols
objcopy --strip-debug --add-gnu-debuglink=3Dipfw.ko.symbols ipfw.ko.debug i=
pfw.ko
[...]

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 18:55:27 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E7F98106566B;
	Wed,  2 Nov 2011 18:55:26 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D66C18FC08;
	Wed,  2 Nov 2011 18:55:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2ItQDd033889;
	Wed, 2 Nov 2011 18:55:26 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2ItQ3V033887;
	Wed, 2 Nov 2011 18:55:26 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201111021855.pA2ItQ3V033887@svn.freebsd.org>
From: Dimitry Andric 
Date: Wed, 2 Nov 2011 18:55:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227025 - stable/9/contrib/llvm/tools/clang/lib/Basic
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 18:55:27 -0000

Author: dim
Date: Wed Nov  2 18:55:26 2011
New Revision: 227025
URL: http://svn.freebsd.org/changeset/base/227025

Log:
  MFC r226951:
  
  Pull in r143305 and r143312 from upstream clang trunk, so using "clang
  -march=native" on AMD K10 family processors no longer errors out with
  "unknown target CPU 'amdfam10'".  This also enables use of SSE4A.
  
  Reported by:	David Marec 
  Approved by:	re (kib)

Modified:
  stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
Directory Properties:
  stable/9/contrib/llvm/tools/clang/   (props changed)

Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
==============================================================================
--- stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Wed Nov  2 18:08:30 2011	(r227024)
+++ stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Wed Nov  2 18:55:26 2011	(r227025)
@@ -1282,6 +1282,7 @@ class X86TargetInfo : public TargetInfo 
     CK_K8SSE3,
     CK_Opteron,
     CK_OpteronSSE3,
+    CK_AMDFAM10,
 
     /// This specification is deprecated and will be removed in the future.
     /// Users should prefer \see CK_K8.
@@ -1381,6 +1382,7 @@ public:
       .Case("k8-sse3", CK_K8SSE3)
       .Case("opteron", CK_Opteron)
       .Case("opteron-sse3", CK_OpteronSSE3)
+      .Case("amdfam10", CK_AMDFAM10)
       .Case("x86-64", CK_x86_64)
       .Case("geode", CK_Geode)
       .Default(CK_Generic);
@@ -1441,6 +1443,7 @@ public:
     case CK_K8SSE3:
     case CK_Opteron:
     case CK_OpteronSSE3:
+    case CK_AMDFAM10:
     case CK_x86_64:
       return true;
     }
@@ -1459,12 +1462,10 @@ void X86TargetInfo::getDefaultFeatures(l
   Features["ssse3"] = false;
   Features["sse41"] = false;
   Features["sse42"] = false;
+  Features["sse4a"] = false;
   Features["aes"] = false;
   Features["avx"] = false;
 
-  // LLVM does not currently recognize this.
-  // Features["sse4a"] = false;
-
   // FIXME: This *really* should not be here.
 
   // X86_64 always has SSE2.
@@ -1561,6 +1562,11 @@ void X86TargetInfo::getDefaultFeatures(l
     setFeatureEnabled(Features, "sse3", true);
     setFeatureEnabled(Features, "3dnowa", true);
     break;
+  case CK_AMDFAM10:
+    setFeatureEnabled(Features, "sse3", true);
+    setFeatureEnabled(Features, "sse4a", true);
+    setFeatureEnabled(Features, "3dnowa", true);
+    break;
   case CK_C3_2:
     setFeatureEnabled(Features, "mmx", true);
     setFeatureEnabled(Features, "sse", true);
@@ -1604,6 +1610,8 @@ bool X86TargetInfo::setFeatureEnabled(ll
     else if (Name == "avx")
       Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
         Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
+    else if (Name == "sse4a")
+      Features["sse4a"] = true;
   } else {
     if (Name == "mmx")
       Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false;
@@ -1630,6 +1638,8 @@ bool X86TargetInfo::setFeatureEnabled(ll
       Features["aes"] = false;
     else if (Name == "avx")
       Features["avx"] = false;
+    else if (Name == "sse4a")
+      Features["sse4a"] = false;
   }
 
   return true;
@@ -1826,6 +1836,11 @@ void X86TargetInfo::getTargetDefines(con
     Builder.defineMacro("__k8__");
     Builder.defineMacro("__tune_k8__");
     break;
+  case CK_AMDFAM10:
+    Builder.defineMacro("__amdfam10");
+    Builder.defineMacro("__amdfam10__");
+    Builder.defineMacro("__tune_amdfam10__");
+    break;
   case CK_Geode:
     Builder.defineMacro("__geode");
     Builder.defineMacro("__geode__");

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 20:45:44 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B8C731065670;
	Wed,  2 Nov 2011 20:45:44 +0000 (UTC)
	(envelope-from cognet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A86FA8FC16;
	Wed,  2 Nov 2011 20:45:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2KjiYp037590;
	Wed, 2 Nov 2011 20:45:44 GMT (envelope-from cognet@svn.freebsd.org)
Received: (from cognet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2KjiYS037588;
	Wed, 2 Nov 2011 20:45:44 GMT (envelope-from cognet@svn.freebsd.org)
Message-Id: <201111022045.pA2KjiYS037588@svn.freebsd.org>
From: Olivier Houchard 
Date: Wed, 2 Nov 2011 20:45:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227032 - head/sys/dev/uart
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 20:45:44 -0000

Author: cognet
Date: Wed Nov  2 20:45:44 2011
New Revision: 227032
URL: http://svn.freebsd.org/changeset/base/227032

Log:
  Disable the TX ready interrupts once we received one, some UART won't clear
  the IIR_TXRDY bit upon reading.
  
  Reviewed by:	marcel

Modified:
  head/sys/dev/uart/uart_dev_ns8250.c

Modified: head/sys/dev/uart/uart_dev_ns8250.c
==============================================================================
--- head/sys/dev/uart/uart_dev_ns8250.c	Wed Nov  2 20:11:19 2011	(r227031)
+++ head/sys/dev/uart/uart_dev_ns8250.c	Wed Nov  2 20:45:44 2011	(r227032)
@@ -582,9 +582,11 @@ static int
 ns8250_bus_ipend(struct uart_softc *sc)
 {
 	struct uart_bas *bas;
+	struct ns8250_softc *ns8250;
 	int ipend;
 	uint8_t iir, lsr;
 
+	ns8250 = (struct ns8250_softc *)sc;
 	bas = &sc->sc_bas;
 	uart_lock(sc->sc_hwmtx);
 	iir = uart_getreg(bas, REG_IIR);
@@ -602,9 +604,10 @@ ns8250_bus_ipend(struct uart_softc *sc)
 		if (lsr & LSR_RXRDY)
 			ipend |= SER_INT_RXREADY;
 	} else {
-		if (iir & IIR_TXRDY)
+		if (iir & IIR_TXRDY) {
 			ipend |= SER_INT_TXIDLE;
-		else
+			uart_setreg(bas, REG_IER, ns8250->ier);
+		} else
 			ipend |= SER_INT_SIGCHG;
 	}
 	if (ipend == 0)

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 20:58:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCEEB106566C;
	Wed,  2 Nov 2011 20:58:47 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC6078FC0A;
	Wed,  2 Nov 2011 20:58:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2KwlqC038065;
	Wed, 2 Nov 2011 20:58:47 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2KwlpX038062;
	Wed, 2 Nov 2011 20:58:47 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201111022058.pA2KwlpX038062@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Wed, 2 Nov 2011 20:58:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227034 - head/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 20:58:48 -0000

Author: pluknet
Date: Wed Nov  2 20:58:47 2011
New Revision: 227034
URL: http://svn.freebsd.org/changeset/base/227034

Log:
  Restore sysctl names for tcp_sendspace/tcp_recvspace.
  
  They seem to be changed unintentionally in r226437, and there were no
  any mentions of renaming in commit log message.
  
  Reported by:	Anton Yuzhaninov 

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Wed Nov  2 20:55:55 2011	(r227033)
+++ head/sys/netinet/tcp_input.c	Wed Nov  2 20:58:47 2011	(r227034)
@@ -185,7 +185,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO,
 
 VNET_DEFINE(int, tcp_recvspace) = 1024*64;
 #define	V_tcp_recvspace	VNET(tcp_recvspace)
-SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, tcp_recvspace, CTLFLAG_RW,
+SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
     &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size");
 
 VNET_DEFINE(int, tcp_do_autorcvbuf) = 1;

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Wed Nov  2 20:55:55 2011	(r227033)
+++ head/sys/netinet/tcp_output.c	Wed Nov  2 20:58:47 2011	(r227034)
@@ -97,7 +97,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO,
 
 VNET_DEFINE(int, tcp_sendspace) = 1024*32;
 #define	V_tcp_sendspace	VNET(tcp_sendspace)
-SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_SENDSPACE, tcp_sendspace, CTLFLAG_RW,
+SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, CTLFLAG_RW,
 	&VNET_NAME(tcp_sendspace), 0, "Initial send socket buffer size");
 
 VNET_DEFINE(int, tcp_do_autosndbuf) = 1;

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 21:01:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E8774106564A;
	Wed,  2 Nov 2011 21:01:54 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 528858FC08;
	Wed,  2 Nov 2011 21:01:53 +0000 (UTC)
Received: by bkbzs2 with SMTP id zs2so758344bkb.13
	for ; Wed, 02 Nov 2011 14:01:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=7WgnS5BDIoDql39Sbkhnd0alTfHNhysHN2VNlyE7bHk=;
	b=eP/cSB3lI/DPY2TV5RmL2GkJBtqpzBvdQW6xxXY6kYyz6sjBxZM6Ypiu1kPYxjIcBe
	hDphMnW6oU79fnAPypiwx4sdQ6cBGiuUsD36TgGW50TK4+MEDSJzQGxI+He52hkxm87m
	BIEniMdNBCpncLjfa1JymBAFovmVEnCQyb7sM=
MIME-Version: 1.0
Received: by 10.182.59.5 with SMTP id v5mr1218479obq.78.1320267712825; Wed, 02
	Nov 2011 14:01:52 -0700 (PDT)
Received: by 10.182.89.41 with HTTP; Wed, 2 Nov 2011 14:01:52 -0700 (PDT)
In-Reply-To: 
References: <201110161508.p9GF8hIc067651@svn.freebsd.org>
	<4EB1712C.9000309@citrin.ru>
	
Date: Thu, 3 Nov 2011 00:01:52 +0300
Message-ID: 
From: Sergey Kandaurov 
To: Anton Yuzhaninov , Andre Oppermann 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-all@freebsd.org
Subject: Re: svn commit: r226437 - head/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 21:01:55 -0000

On 2 November 2011 21:40, Sergey Kandaurov  wrote:
> On 2 November 2011 20:34, Anton Yuzhaninov  wrote:
>> On 10/16/11 19:08, Andre Oppermann wrote:
>>>
>>> Author: andre
>>> Date: Sun Oct 16 15:08:43 2011
>>> New Revision: 226437
>>> URL: http://svn.freebsd.org/changeset/base/226437
>>>
>>> Log:
>>> =A0 VNET virtualize tcp_sendspace/tcp_recvspace and change the
>>> =A0 type to INT. =A0A long is not necessary as the TCP window is
>>> =A0 limited to 2**30. =A0A larger initial window isn't useful.
>>
>> In this commit sysctl renamed
>> from net.inet.tcp.sendspace to net.inet.tcp.tcp_sendspace
>> and from net.inet.tcp.recvspace to net.inet.tcp.tcp_recvspace
>>
>> This break POLA without any benefits.
>> Please revert sysctl rename.
>
> That was rather done accidentally as these names also match
> in-kernel variables which hold the corresponding sysctl values.

Please note, that I restored sysctl names for
tcp_sendspace/tcp_recvspace in svn r227034 revision.

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 21:54:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E3DA81065672;
	Wed,  2 Nov 2011 21:54:48 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E2C48FC19;
	Wed,  2 Nov 2011 21:54:48 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id E6B1725D3899;
	Wed,  2 Nov 2011 21:54:16 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id 10588BD40F9;
	Wed,  2 Nov 2011 21:54:16 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id GhfIevDHDd1p; Wed,  2 Nov 2011 21:54:14 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id 4B177BD40EC;
	Wed,  2 Nov 2011 21:54:14 +0000 (UTC)
Date: Wed, 2 Nov 2011 21:54:13 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: Sergey Kandaurov 
In-Reply-To: 
Message-ID: 
References: <201109271327.p8RDRHs8024689@svn.freebsd.org>
	
	
	
	
X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-863113531-1320270854=:68690"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r225793 - in head/sys: modules/ipfw netinet/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 21:54:49 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-863113531-1320270854=:68690
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 2 Nov 2011, Bjoern A. Zeeb wrote:

> On Wed, 2 Nov 2011, Sergey Kandaurov wrote:
>
>> On 2 November 2011 16:53, Bjoern A. Zeeb  wrote:
>>> On Wed, 2 Nov 2011, Sergey Kandaurov wrote:
>>> 
>>>> On 27 September 2011 17:27, Bjoern A. Zeeb  wrote:
>>>>> 
>>>>> Author: bz
>>>>> Date: Tue Sep 27 13:27:17 2011
>>>>> New Revision: 225793
>>>>> URL: http://svn.freebsd.org/changeset/base/225793
>>>>> 
>>>>> Log:
>>>>>  Unbreak no-ip and no-inet6 module builds with ipfw.  For now continue 
>>>>> to
>>>>>  build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the
>>>>>  assumption that the private L2 hook (which hopefully eventually will be
>>>>> a
>>>>>  pfil hook as well) can still be useful.
>>>>> 
>>>>>  Allow building the module without inet as well.
>>>>> 
>>>>>  Glanced at by:        jhb
>>>>>  MFC after:    3 days
>>>>> 
>>>>> Modified:
>>>>>  head/sys/modules/ipfw/Makefile
>>>>>  head/sys/netinet/ipfw/ip_fw_pfil.c
>>>>> 
>>>>> Modified: head/sys/modules/ipfw/Makefile
>>>>> 
>>>>> ==============================================================================
>>>>> --- head/sys/modules/ipfw/Makefile      Tue Sep 27 13:20:41 2011
>>>>>  (r225792)
>>>>> +++ head/sys/modules/ipfw/Makefile      Tue Sep 27 13:27:17 2011
>>>>>  (r225793)
>>>>> @@ -8,7 +8,7 @@ KMOD=   ipfw
>>>>>  SRCS=  ip_fw2.c ip_fw_pfil.c
>>>>>  SRCS+= ip_fw_dynamic.c ip_fw_log.c
>>>>>  SRCS+= ip_fw_sockopt.c ip_fw_table.c
>>>>> -SRCS+= opt_inet6.h opt_ipfw.h opt_ipsec.h
>>>>> +SRCS+= opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
>>>>> 
>>>>>  CFLAGS+= -DIPFIREWALL
>>>>>  CFLAGS+= -I${.CURDIR}/../../contrib/pf
>>>>> @@ -22,6 +22,10 @@ CFLAGS+= -I${.CURDIR}/../../contrib/pf
>>>>>  #
>>>>> 
>>>>>  .if !defined(KERNBUILDDIR)
>>>>> +.if ${MK_INET_SUPPORT} != "no"
>>>>> +opt_inet.h:
>>>>> +       echo "#define INET 1" > ${.TARGET}
>>>>> +.endif
>>>>>  .if ${MK_INET6_SUPPORT} != "no"
>>>>>  opt_inet6.h:
>>>>>        echo "#define INET6 1" > ${.TARGET}
>>>>> 
>>>>> Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
>>>>> 
>>>>> ==============================================================================
>>>>> --- head/sys/netinet/ipfw/ip_fw_pfil.c  Tue Sep 27 13:20:41 2011
>>>>>  (r225792)
>>>>> +++ head/sys/netinet/ipfw/ip_fw_pfil.c  Tue Sep 27 13:27:17 2011
>>>>>  (r225793)
>>>>> @@ -31,11 +31,11 @@ __FBSDID("$FreeBSD$");
>>>>>  #if !defined(KLD_MODULE)
>>>>>  #include "opt_ipdn.h"
>>>>>  #include "opt_inet.h"
>>>>> +#include "opt_inet6.h"
>>>>>  #ifndef INET
>>>>>  #error IPFIREWALL requires INET.
>>>>>  #endif /* INET */
>>>>>  #endif /* KLD_MODULE */
>>>>> -#include "opt_inet6.h"
>>>> 
>>>> Hello.
>>>> 
>>>> This chunk seems to stop building inet6 part of ipfw.ko w/ INET6 enabled
>>>> kernel.
>>>> 
>>>> Found by /etc/rc.d/ipfw restart:
>>>> [...]
>>>> /etc/rc.d/ipfw: WARNING: failed to enable IPv6 firewall
>>>> 
>>>> i.e. sysctl net.inet6.ip6.fw.enable doesn't present.
>>>> 
>>>> Reversion of this hunk fixed the problem.
>>>> NO_INET[46] lints aren't tested though.
>>> 
>>> 
>>> Just to double-check -- this only happens for you if you build and
>>> use the module, not when you link it into the kernel?
>>> 
>>> As in that case I do have:
>>> lion3#  sysctl net.inet6.ip6.fw.enable net.inet6.ip6.fw.enable: 1
>> 
>> ipfw is built and installed as a module as part of make kernel target.
>
> Can you try to see if this fixes the problem?
> http://people.freebsd.org/~bz/20111102-01-ipfw-kld.diff
>
> Please not that in the module case we'd most likely also built out
> some INET parts, not just INET6 once -- silently.

here's an updated patch that cleans up some more:

http://people.freebsd.org/~bz/20111102-03-ipfw-kld.diff

Any other testers and reviewers welcome as well.

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.
--0-863113531-1320270854=:68690--

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 22:07:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EAA3106564A
	for ; Wed,  2 Nov 2011 22:07:19 +0000 (UTC)
	(envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
	by mx1.freebsd.org (Postfix) with ESMTP id 6EAE68FC1F
	for ; Wed,  2 Nov 2011 22:07:18 +0000 (UTC)
Received: (qmail 63343 invoked from network); 2 Nov 2011 20:44:33 -0000
Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2])
	(envelope-sender )
	by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
	for ; 2 Nov 2011 20:44:33 -0000
Message-ID: <4EB1BF16.6000408@freebsd.org>
Date: Wed, 02 Nov 2011 23:07:18 +0100
From: Andre Oppermann 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version: 1.0
To: Sergey Kandaurov 
References: <201110161508.p9GF8hIc067651@svn.freebsd.org>
	<4EB1712C.9000309@citrin.ru>
	
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-all@freebsd.org, Anton Yuzhaninov 
Subject: Re: svn commit: r226437 - head/sys/netinet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 22:07:19 -0000

On 02.11.2011 22:01, Sergey Kandaurov wrote:
> On 2 November 2011 21:40, Sergey Kandaurov  wrote:
>> On 2 November 2011 20:34, Anton Yuzhaninov  wrote:
>>> On 10/16/11 19:08, Andre Oppermann wrote:
>>>>
>>>> Author: andre
>>>> Date: Sun Oct 16 15:08:43 2011
>>>> New Revision: 226437
>>>> URL: http://svn.freebsd.org/changeset/base/226437
>>>>
>>>> Log:
>>>>    VNET virtualize tcp_sendspace/tcp_recvspace and change the
>>>>    type to INT.  A long is not necessary as the TCP window is
>>>>    limited to 2**30.  A larger initial window isn't useful.
>>>
>>> In this commit sysctl renamed
>>> from net.inet.tcp.sendspace to net.inet.tcp.tcp_sendspace
>>> and from net.inet.tcp.recvspace to net.inet.tcp.tcp_recvspace
>>>
>>> This break POLA without any benefits.
>>> Please revert sysctl rename.
>>
>> That was rather done accidentally as these names also match
>> in-kernel variables which hold the corresponding sysctl values.
>
> Please note, that I restored sysctl names for
> tcp_sendspace/tcp_recvspace in svn r227034 revision.

Thanks. It was indeed a typo. My bad. Sorry for the confusion.

-- 
Andre


From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 23:22:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B0FD106564A;
	Wed,  2 Nov 2011 23:22:51 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2AB4A8FC13;
	Wed,  2 Nov 2011 23:22:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2NMpHH042886;
	Wed, 2 Nov 2011 23:22:51 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2NMpGL042884;
	Wed, 2 Nov 2011 23:22:51 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201111022322.pA2NMpGL042884@svn.freebsd.org>
From: Marius Strobl 
Date: Wed, 2 Nov 2011 23:22:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227042 - head/sys/dev/tl
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 23:22:51 -0000

Author: marius
Date: Wed Nov  2 23:22:50 2011
New Revision: 227042
URL: http://svn.freebsd.org/changeset/base/227042

Log:
  Remove variable initialized but no longer actually used since r226995.
  
  Found with:	Coverity Prevent(tm)
  CID:		10044

Modified:
  head/sys/dev/tl/if_tl.c

Modified: head/sys/dev/tl/if_tl.c
==============================================================================
--- head/sys/dev/tl/if_tl.c	Wed Nov  2 23:18:19 2011	(r227041)
+++ head/sys/dev/tl/if_tl.c	Wed Nov  2 23:22:50 2011	(r227042)
@@ -920,12 +920,9 @@ static void
 tl_hardreset(dev)
 	device_t		dev;
 {
-	struct tl_softc		*sc;
 	int			i;
 	u_int16_t		flags;
 
-	sc = device_get_softc(dev);
-
 	mii_bitbang_sync(dev, &tl_mii_bitbang_ops);
 
 	flags = BMCR_LOOP|BMCR_ISO|BMCR_PDOWN;

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 23:23:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA80A106564A;
	Wed,  2 Nov 2011 23:23:19 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C0A718FC0A;
	Wed,  2 Nov 2011 23:23:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2NNJ6d042938;
	Wed, 2 Nov 2011 23:23:19 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2NNJAL042936;
	Wed, 2 Nov 2011 23:23:19 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201111022323.pA2NNJAL042936@svn.freebsd.org>
From: Marius Strobl 
Date: Wed, 2 Nov 2011 23:23:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227043 - head/sys/dev/re
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 23:23:20 -0000

Author: marius
Date: Wed Nov  2 23:23:19 2011
New Revision: 227043
URL: http://svn.freebsd.org/changeset/base/227043

Log:
  Sprinkle some const.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Wed Nov  2 23:22:50 2011	(r227042)
+++ head/sys/dev/re/if_re.c	Wed Nov  2 23:23:19 2011	(r227043)
@@ -171,7 +171,7 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe
 /*
  * Various supported device vendors/types and their names.
  */
-static struct rl_type re_devs[] = {
+static const struct rl_type const re_devs[] = {
 	{ DLINK_VENDORID, DLINK_DEVICEID_528T, 0,
 	    "D-Link DGE-528(T) Gigabit Ethernet Adapter" },
 	{ DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0,
@@ -194,8 +194,8 @@ static struct rl_type re_devs[] = {
 	    "US Robotics 997902 (RTL8169S) Gigabit Ethernet" }
 };
 
-static struct rl_hwrev re_hwrevs[] = {
-	{ RL_HWREV_8139, RL_8139,  "", RL_MTU },
+static const struct rl_hwrev const re_hwrevs[] = {
+	{ RL_HWREV_8139, RL_8139, "", RL_MTU },
 	{ RL_HWREV_8139A, RL_8139, "A", RL_MTU },
 	{ RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU },
 	{ RL_HWREV_8139B, RL_8139, "B", RL_MTU },
@@ -868,7 +868,7 @@ re_diag(struct rl_softc *sc)
 		device_printf(sc->rl_dev, "expected TX data: %6D/%6D/0x%x\n",
 		    dst, ":", src, ":", ETHERTYPE_IP);
 		device_printf(sc->rl_dev, "received RX data: %6D/%6D/0x%x\n",
-		    eh->ether_dhost, ":",  eh->ether_shost, ":",
+		    eh->ether_dhost, ":", eh->ether_shost, ":",
 		    ntohs(eh->ether_type));
 		device_printf(sc->rl_dev, "You may have a defective 32-bit "
 		    "NIC plugged into a 64-bit PCI slot.\n");
@@ -903,7 +903,7 @@ done:
 static int
 re_probe(device_t dev)
 {
-	struct rl_type		*t;
+	const struct rl_type	*t;
 	uint16_t		devid, vendor;
 	uint16_t		revid, sdevid;
 	int			i;
@@ -1183,7 +1183,7 @@ re_attach(device_t dev)
 	u_int16_t		as[ETHER_ADDR_LEN / 2];
 	struct rl_softc		*sc;
 	struct ifnet		*ifp;
-	struct rl_hwrev		*hw_rev;
+	const struct rl_hwrev	*hw_rev;
 	int			hwrev;
 	u_int16_t		devid, re_did = 0;
 	int			error = 0, i, phy, rid;

From owner-svn-src-all@FreeBSD.ORG  Wed Nov  2 23:40:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60F02106566B;
	Wed,  2 Nov 2011 23:40:22 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5045F8FC13;
	Wed,  2 Nov 2011 23:40:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2NeLwR043460;
	Wed, 2 Nov 2011 23:40:21 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2NeLEB043458;
	Wed, 2 Nov 2011 23:40:21 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201111022340.pA2NeLEB043458@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 2 Nov 2011 23:40:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227044 - head/lib/libpam/modules/pam_unix
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 23:40:22 -0000

Author: des
Date: Wed Nov  2 23:40:21 2011
New Revision: 227044
URL: http://svn.freebsd.org/changeset/base/227044

Log:
  Note that pam_unix(8) does not respect PAM_CHANGE_EXPIRED_AUTHTOK.

Modified:
  head/lib/libpam/modules/pam_unix/pam_unix.8

Modified: head/lib/libpam/modules/pam_unix/pam_unix.8
==============================================================================
--- head/lib/libpam/modules/pam_unix/pam_unix.8	Wed Nov  2 23:23:19 2011	(r227043)
+++ head/lib/libpam/modules/pam_unix/pam_unix.8	Wed Nov  2 23:40:21 2011	(r227044)
@@ -199,3 +199,9 @@ password database.
 .Xr pam 8 ,
 .Xr pw 8 ,
 .Xr yp 8
+.Sh BUGS
+The
+.Nm
+module ignores the
+.Dv PAM_CHANGE_EXPIRED_AUTHTOK
+flag.

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 07:52:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FD211065670;
	Thu,  3 Nov 2011 07:52:21 +0000 (UTC)
	(envelope-from pawel@dawidek.net)
Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id BA4878FC18;
	Thu,  3 Nov 2011 07:52:20 +0000 (UTC)
Received: from localhost (58.wheelsystems.com [83.12.187.58])
	by mail.dawidek.net (Postfix) with ESMTPSA id 485B92F3;
	Thu,  3 Nov 2011 08:52:19 +0100 (CET)
Date: Thu, 3 Nov 2011 08:51:32 +0100
From: Pawel Jakub Dawidek 
To: Alexander Motin 
Message-ID: <20111103075132.GA1682@garage.freebsd.pl>
References: <201111020924.pA29OxUV009135@svn.freebsd.org>
	<20111102134226.GA1656@garage.freebsd.pl>
	<4EB15D36.9020409@FreeBSD.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR"
Content-Disposition: inline
In-Reply-To: <4EB15D36.9020409@FreeBSD.org>
X-OS: FreeBSD 9.0-CURRENT amd64
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r227015 - head/sys/geom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 07:52:21 -0000


--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 02, 2011 at 05:09:42PM +0200, Alexander Motin wrote:
> On 11/02/11 15:42, Pawel Jakub Dawidek wrote:
> > On Wed, Nov 02, 2011 at 09:24:59AM +0000, Alexander Motin wrote:
> >> Author: mav
> >> Date: Wed Nov  2 09:24:59 2011
> >> New Revision: 227015
> >> URL: http://svn.freebsd.org/changeset/base/227015
> >>
> >> Log:
> >>   Add mutex and two flags to make orphan() call properly asynchronous:
> >>    - delay consumer closing and detaching on orphan() until all I/Os c=
omplete;
> >>    - prevent new I/Os submission after orphan() called.
> >>   Previous implementation could destroy consumers still having active
> >>   requests and worked only because of global workaround made on GEOM l=
evel.
> >=20
> > Alexander, I'm not sure I agree with your recent changes to address
> > this. The checks in GEOM were there to avoid the need for counting
> > outstanding I/O requests in every single GEOM class.
>=20
> Sorry, I've sent you letter last week asking for your opinion on this
> problem, but got no response. :(

I did not receive it, sorry.

> > Why do you think the checks in GEOM are not good enough?
>=20
> Mostly because nstart increment and request submission are not locked.
> There are race windows between start() call, request submission and
> consumer detach: start() method may get provider pointer that will not
> be valid in time of the request submission.
>=20
> According geom(4), that race should be closed by assumption that
> provider should not be closed until all active requests are completed.
> Kind of reference counting, done by top consumers, such as geom_dev or
> geom_vfs. That is what I am trying to fix with my changes.
>=20
> Also I don't very like idea of periodic polling, trying to catch moment
> when nstart =3D=3D nend. As soon as at that time we haven't called orphan=
()
> method yet, requests may go infinitely, even though each will be aborted
> quickly. It looks dirty at least.
>=20
> Counting of outstanding I/O requests needed only for classes that for
> some reason can't follow that assumption. For example, geom_vfs releases
> provider as soon as it orphans, not waiting for close() call from file
> system. Another example is gmirror -- we want to drop single
> disconnected disk while upstream provider is still working and won't be
> closed.

Ok, I can see your point now. You are right. The check that nstart is
equal to nend I added was not to fix races within one class. IIRC I was
seeing panics there with simple classes that only forward orphan events,
so even if provider's error was set and no new I/O requests were coming,
we could destroy orphaned provider even if there were still in-flight
requests. I was a bit confused, because you were refering to the check I
added and I don't think it is really related.

> > Can we design solution that can be implemented in the framework itself,
> > so simple GEOM classes can stay simple?
>=20
> Simple classes without special needs around access() method and
> especially with one consumer should stay simple. All they should do on
> orphan() call is just forward orphan() call up, calling some
> g_wither_XXX() and not trying to forcefully close consumer, and let
> things happen naturally.
>=20
> The problem is that start() and bio_done() methods are not locked now,
> but same time they expect topology not to change under them. I am not
> sure how can it be simplified globally, unless we want to lock all of
> them with topology lock.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--T4sUOijqQbZv57TR
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk6ySAMACgkQForvXbEpPzTWwgCgpTH1CxznkLEdLordlt9+yvYL
+SoAoL1xgwZY0mDnH5z1A/iWHYFjQmKA
=LUib
-----END PGP SIGNATURE-----

--T4sUOijqQbZv57TR--

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 08:34:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A8F1106566C;
	Thu,  3 Nov 2011 08:34:42 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D8538FC17;
	Thu,  3 Nov 2011 08:34:40 +0000 (UTC)
Received: by eyd10 with SMTP id 10so1241233eyd.13
	for ; Thu, 03 Nov 2011 01:34:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	bh=1oq0WsaZFI3pG1BdtJ7TeIk9E+5Xkx1x+cTrwBbEXgI=;
	b=rCD24DK9fQq+VFhYrJduZZCo0TiXNYXAfkz7OUVswNekfCNmPwb8Gmofs/qW2ykR0D
	jVn7LDZSmIGKVzFQ5PYQD7+mccSDtgi/XdvelB8djPn3brRhtnAUzii2BKZ6X7josfvX
	YOFDh/HU3JRLct7N265bvMpeWnljU2PiU1yWk=
Received: by 10.14.3.232 with SMTP id 80mr724546eeh.117.1320309279874;
	Thu, 03 Nov 2011 01:34:39 -0700 (PDT)
Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226])
	by mx.google.com with ESMTPS id q28sm13632627eea.6.2011.11.03.01.34.38
	(version=SSLv3 cipher=OTHER); Thu, 03 Nov 2011 01:34:38 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4EB2521D.2090704@FreeBSD.org>
Date: Thu, 03 Nov 2011 10:34:37 +0200
From: Alexander Motin 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
	rv:6.0.2) Gecko/20110910 Thunderbird/6.0.2
MIME-Version: 1.0
To: Pawel Jakub Dawidek 
References: <201111020924.pA29OxUV009135@svn.freebsd.org>
	<20111102134226.GA1656@garage.freebsd.pl>
	<4EB15D36.9020409@FreeBSD.org>
	<20111103075132.GA1682@garage.freebsd.pl>
In-Reply-To: <20111103075132.GA1682@garage.freebsd.pl>
X-Enigmail-Version: undefined
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r227015 - head/sys/geom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 08:34:42 -0000

On 03.11.2011 09:51, Pawel Jakub Dawidek wrote:
> On Wed, Nov 02, 2011 at 05:09:42PM +0200, Alexander Motin wrote:
>> On 11/02/11 15:42, Pawel Jakub Dawidek wrote:
>>> On Wed, Nov 02, 2011 at 09:24:59AM +0000, Alexander Motin wrote:
>>>> Author: mav
>>>> Date: Wed Nov  2 09:24:59 2011
>>>> New Revision: 227015
>>>> URL: http://svn.freebsd.org/changeset/base/227015
>>>>
>>>> Log:
>>>>   Add mutex and two flags to make orphan() call properly asynchronous:
>>>>    - delay consumer closing and detaching on orphan() until all I/Os complete;
>>>>    - prevent new I/Os submission after orphan() called.
>>>>   Previous implementation could destroy consumers still having active
>>>>   requests and worked only because of global workaround made on GEOM level.
>>>
>>> Alexander, I'm not sure I agree with your recent changes to address
>>> this. The checks in GEOM were there to avoid the need for counting
>>> outstanding I/O requests in every single GEOM class.
>>
>> Sorry, I've sent you letter last week asking for your opinion on this
>> problem, but got no response. :(
> 
> I did not receive it, sorry.
> 
>>> Why do you think the checks in GEOM are not good enough?
>>
>> Mostly because nstart increment and request submission are not locked.
>> There are race windows between start() call, request submission and
>> consumer detach: start() method may get provider pointer that will not
>> be valid in time of the request submission.
>>
>> According geom(4), that race should be closed by assumption that
>> provider should not be closed until all active requests are completed.
>> Kind of reference counting, done by top consumers, such as geom_dev or
>> geom_vfs. That is what I am trying to fix with my changes.
>>
>> Also I don't very like idea of periodic polling, trying to catch moment
>> when nstart == nend. As soon as at that time we haven't called orphan()
>> method yet, requests may go infinitely, even though each will be aborted
>> quickly. It looks dirty at least.
>>
>> Counting of outstanding I/O requests needed only for classes that for
>> some reason can't follow that assumption. For example, geom_vfs releases
>> provider as soon as it orphans, not waiting for close() call from file
>> system. Another example is gmirror -- we want to drop single
>> disconnected disk while upstream provider is still working and won't be
>> closed.
> 
> Ok, I can see your point now. You are right. The check that nstart is
> equal to nend I added was not to fix races within one class. IIRC I was
> seeing panics there with simple classes that only forward orphan events,
> so even if provider's error was set and no new I/O requests were coming,
> we could destroy orphaned provider even if there were still in-flight
> requests. I was a bit confused, because you were refering to the check I
> added and I don't think it is really related.

Your check does good job to the original problem, reducing the race
window from huge start() -- bio_done() to two small start() -- nstart++
and nend++ -- bio_done(). It protects geoms below the broken one (panics
I see without check usually happen on random level below the real
source), but it does not protect the broken geom itself. Proper orphan()
methods protect both.

-- 
Alexander Motin

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 09:09:05 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ECF75106566C;
	Thu,  3 Nov 2011 09:09:05 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DCD968FC16;
	Thu,  3 Nov 2011 09:09:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3995AM061490;
	Thu, 3 Nov 2011 09:09:05 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3995RD061488;
	Thu, 3 Nov 2011 09:09:05 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201111030909.pA3995RD061488@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 3 Nov 2011 09:09:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227055 - head/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 09:09:06 -0000

Author: pluknet
Date: Thu Nov  3 09:09:05 2011
New Revision: 227055
URL: http://svn.freebsd.org/changeset/base/227055

Log:
  Remove a couple of write-only variables.

Modified:
  head/sys/netinet6/icmp6.c

Modified: head/sys/netinet6/icmp6.c
==============================================================================
--- head/sys/netinet6/icmp6.c	Thu Nov  3 05:44:00 2011	(r227054)
+++ head/sys/netinet6/icmp6.c	Thu Nov  3 09:09:05 2011	(r227055)
@@ -2351,8 +2351,6 @@ icmp6_redirect_input(struct mbuf *m, int
 	int icmp6len = ntohs(ip6->ip6_plen);
 	char *lladdr = NULL;
 	int lladdrlen = 0;
-	u_char *redirhdr = NULL;
-	int redirhdrlen = 0;
 	struct rtentry *rt = NULL;
 	int is_router;
 	int is_onlink;
@@ -2488,11 +2486,6 @@ icmp6_redirect_input(struct mbuf *m, int
 		lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3;
 	}
 
-	if (ndopts.nd_opts_rh) {
-		redirhdrlen = ndopts.nd_opts_rh->nd_opt_rh_len;
-		redirhdr = (u_char *)(ndopts.nd_opts_rh + 1); /* xxx */
-	}
-
 	if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) {
 		nd6log((LOG_INFO,
 		    "icmp6_redirect_input: lladdrlen mismatch for %s "

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 12:03:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04582106568D;
	Thu,  3 Nov 2011 12:03:04 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E7E438FC2F;
	Thu,  3 Nov 2011 12:03:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3C33rw069670;
	Thu, 3 Nov 2011 12:03:03 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3C33QM069667;
	Thu, 3 Nov 2011 12:03:03 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201111031203.pA3C33QM069667@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 3 Nov 2011 12:03:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227056 - in head/sys: boot/common conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 12:03:04 -0000

Author: pluknet
Date: Thu Nov  3 12:03:03 2011
New Revision: 227056
URL: http://svn.freebsd.org/changeset/base/227056

Log:
  Remove the remnants of /stand/sysinstall.
  
  loader.8:	Sync the default init_path list with kern/init_main.c.
  
  NOTES:		Replace with /rescue/init in the INIT_PATH kernel option.

Modified:
  head/sys/boot/common/loader.8
  head/sys/conf/NOTES

Modified: head/sys/boot/common/loader.8
==============================================================================
--- head/sys/boot/common/loader.8	Thu Nov  3 09:09:05 2011	(r227055)
+++ head/sys/boot/common/loader.8	Thu Nov  3 12:03:03 2011	(r227056)
@@ -443,7 +443,7 @@ Sets the list of binaries which the kern
 process.
 The first matching binary is used.
 The default list is
-.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init:/stand/sysinstall .
+.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init .
 .It Va init_script
 If set to a valid file name in the root file system,
 instructs

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Thu Nov  3 09:09:05 2011	(r227055)
+++ head/sys/conf/NOTES	Thu Nov  3 12:03:03 2011	(r227056)
@@ -2813,7 +2813,7 @@ options 	UBSEC_RNDTEST	# enable rndtest 
 # Embedded system options:
 #
 # An embedded system might want to run something other than init.
-options 	INIT_PATH=/sbin/init:/stand/sysinstall
+options 	INIT_PATH=/sbin/init:/rescue/init
 
 # Debug options
 options 	BUS_DEBUG	# enable newbus debugging

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 14:36:56 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EFBB9106566B;
	Thu,  3 Nov 2011 14:36:56 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DF6BC8FC1F;
	Thu,  3 Nov 2011 14:36:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3Eausb074440;
	Thu, 3 Nov 2011 14:36:56 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3EauWL074438;
	Thu, 3 Nov 2011 14:36:56 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201111031436.pA3EauWL074438@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 3 Nov 2011 14:36:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227058 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 14:36:57 -0000

Author: attilio
Date: Thu Nov  3 14:36:56 2011
New Revision: 227058
URL: http://svn.freebsd.org/changeset/base/227058

Log:
  Disable interrupt and preemption for smp_rendezvous() also in the
  UP/!SMP case.
  The callbacks may be relying on this feature and having 2 different
  ways to deal with them is not correct.
  
  Reported by:	rstone
  Reviewed by:	jhb
  MFC after:	2 weeks

Modified:
  head/sys/kern/subr_smp.c

Modified: head/sys/kern/subr_smp.c
==============================================================================
--- head/sys/kern/subr_smp.c	Thu Nov  3 12:24:44 2011	(r227057)
+++ head/sys/kern/subr_smp.c	Thu Nov  3 14:36:56 2011	(r227058)
@@ -415,13 +415,16 @@ smp_rendezvous_cpus(cpuset_t map,
 {
 	int curcpumap, i, ncpus = 0;
 
+	/* Look comments in the !SMP case. */
 	if (!smp_started) {
+		spinlock_enter();
 		if (setup_func != NULL)
 			setup_func(arg);
 		if (action_func != NULL)
 			action_func(arg);
 		if (teardown_func != NULL)
 			teardown_func(arg);
+		spinlock_exit();
 		return;
 	}
 
@@ -666,12 +669,18 @@ smp_rendezvous_cpus(cpuset_t map,
 	void (*teardown_func)(void *),
 	void *arg)
 {
+	/*
+	 * In the !SMP case we just need to ensure the same initial conditions
+	 * as the SMP case.
+	 */
+	spinlock_enter();
 	if (setup_func != NULL)
 		setup_func(arg);
 	if (action_func != NULL)
 		action_func(arg);
 	if (teardown_func != NULL)
 		teardown_func(arg);
+	spinlock_exit();
 }
 
 void
@@ -681,12 +690,15 @@ smp_rendezvous(void (*setup_func)(void *
 	       void *arg)
 {
 
+	/* Look comments in the smp_rendezvous_cpus() case. */
+	spinlock_enter();
 	if (setup_func != NULL)
 		setup_func(arg);
 	if (action_func != NULL)
 		action_func(arg);
 	if (teardown_func != NULL)
 		teardown_func(arg);
+	spinlock_exit();
 }
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 14:38:03 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7587C106566C;
	Thu,  3 Nov 2011 14:38:03 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 652368FC0C;
	Thu,  3 Nov 2011 14:38:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3Ec3hv074506;
	Thu, 3 Nov 2011 14:38:03 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3Ec3xL074504;
	Thu, 3 Nov 2011 14:38:03 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201111031438.pA3Ec3xL074504@svn.freebsd.org>
From: Rick Macklem 
Date: Thu, 3 Nov 2011 14:38:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227059 - head/sys/rpc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 14:38:03 -0000

Author: rmacklem
Date: Thu Nov  3 14:38:03 2011
New Revision: 227059
URL: http://svn.freebsd.org/changeset/base/227059

Log:
  Both a crash reported on freebsd-current on Oct. 18 under the
  subject heading "mtx_lock() of destroyed mutex on NFS" and
  PR# 156168 appear to be caused by clnt_dg_destroy() closing
  down the socket prematurely. When to close down the socket
  is controlled by a reference count (cs_refs), but clnt_dg_create()
  checks for sb_upcall being non-NULL to decide if a new socket
  is needed. I believe the crashes were caused by the following race:
    clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket
    clnt_dg_destroy() then loses race with clnt_dg_create() for
      acquisition of the SOCKBUF_LOCK()
    clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1
    clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to
      NULL and destroys socket
  
  This patch fixes the above race by changing clnt_dg_destroy() so
  that it acquires SOCKBUF_LOCK() before testing cs_refs.
  
  Tested by:	bz
  PR:		156168
  Reviewed by:	dfr
  MFC after:	2 weeks

Modified:
  head/sys/rpc/clnt_dg.c

Modified: head/sys/rpc/clnt_dg.c
==============================================================================
--- head/sys/rpc/clnt_dg.c	Thu Nov  3 14:36:56 2011	(r227058)
+++ head/sys/rpc/clnt_dg.c	Thu Nov  3 14:38:03 2011	(r227059)
@@ -1001,12 +1001,12 @@ clnt_dg_destroy(CLIENT *cl)
 	cs = cu->cu_socket->so_rcv.sb_upcallarg;
 	clnt_dg_close(cl);
 
+	SOCKBUF_LOCK(&cu->cu_socket->so_rcv);
 	mtx_lock(&cs->cs_lock);
 
 	cs->cs_refs--;
 	if (cs->cs_refs == 0) {
 		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);
@@ -1015,6 +1015,7 @@ clnt_dg_destroy(CLIENT *cl)
 		lastsocketref = TRUE;
 	} else {
 		mtx_unlock(&cs->cs_lock);
+		SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv);
 		lastsocketref = FALSE;
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 18:33:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6905106564A;
	Thu,  3 Nov 2011 18:33:30 +0000 (UTC)
	(envelope-from mlaier@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BC5C48FC15;
	Thu,  3 Nov 2011 18:33:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3IXUPT081869;
	Thu, 3 Nov 2011 18:33:30 GMT (envelope-from mlaier@svn.freebsd.org)
Received: (from mlaier@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3IXUpk081867;
	Thu, 3 Nov 2011 18:33:30 GMT (envelope-from mlaier@svn.freebsd.org)
Message-Id: <201111031833.pA3IXUpk081867@svn.freebsd.org>
From: Max Laier 
Date: Thu, 3 Nov 2011 18:33:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227061 - head/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 18:33:31 -0000

Author: mlaier
Date: Thu Nov  3 18:33:30 2011
New Revision: 227061
URL: http://svn.freebsd.org/changeset/base/227061

Log:
  Fix a use-after-free/redzone issue in the routing code.
  
  Reported by (repeatedly):	Mike Tancsa
  Prodded by (repeatedly):	bz
  Forgotten by (repeatedly):	mlaier
  MFC after:			2 weeks

Modified:
  head/sys/net/rtsock.c

Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c	Thu Nov  3 18:09:11 2011	(r227060)
+++ head/sys/net/rtsock.c	Thu Nov  3 18:33:30 2011	(r227061)
@@ -166,7 +166,7 @@ static void	rt_setmetrics(u_long which, 
 			struct rt_metrics_lite *out);
 static void	rt_getmetrics(const struct rt_metrics_lite *in,
 			struct rt_metrics *out);
-static void	rt_dispatch(struct mbuf *, const struct sockaddr *);
+static void	rt_dispatch(struct mbuf *, sa_family_t);
 
 static struct netisr_handler rtsock_nh = {
 	.nh_name = "rtsock",
@@ -545,6 +545,7 @@ route_output(struct mbuf *m, struct sock
 	int len, error = 0;
 	struct ifnet *ifp = NULL;
 	union sockaddr_union saun;
+	sa_family_t saf = AF_UNSPEC;
 
 #define senderr(e) { error = e; goto flush;}
 	if (m == NULL || ((m->m_len < sizeof(long)) &&
@@ -581,6 +582,7 @@ route_output(struct mbuf *m, struct sock
 	    (info.rti_info[RTAX_GATEWAY] != NULL &&
 	     info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX))
 		senderr(EINVAL);
+	saf = info.rti_info[RTAX_DST]->sa_family;
 	/*
 	 * Verify that the caller has the appropriate privilege; RTM_GET
 	 * is the only operation the non-superuser is allowed.
@@ -926,10 +928,10 @@ flush:
 			 */
 			unsigned short family = rp->rcb_proto.sp_family;
 			rp->rcb_proto.sp_family = 0;
-			rt_dispatch(m, info.rti_info[RTAX_DST]);
+			rt_dispatch(m, saf);
 			rp->rcb_proto.sp_family = family;
 		} else
-			rt_dispatch(m, info.rti_info[RTAX_DST]);
+			rt_dispatch(m, saf);
 	}
 	/* info.rti_info[RTAX_DST] (used above) can point inside of rtm */
 	if (rtm)
@@ -1185,7 +1187,7 @@ rt_missmsg_fib(int type, struct rt_addri
 	rtm->rtm_flags = RTF_DONE | flags;
 	rtm->rtm_errno = error;
 	rtm->rtm_addrs = rtinfo->rti_addrs;
-	rt_dispatch(m, sa);
+	rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC);
 }
 
 void
@@ -1217,7 +1219,7 @@ rt_ifmsg(struct ifnet *ifp)
 	ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags;
 	ifm->ifm_data = ifp->if_data;
 	ifm->ifm_addrs = 0;
-	rt_dispatch(m, NULL);
+	rt_dispatch(m, AF_UNSPEC);
 }
 
 /*
@@ -1295,7 +1297,7 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr
 			M_SETFIB(m, fibnum);
 			m->m_flags |= RTS_FILTER_FIB;
 		}
-		rt_dispatch(m, sa);
+		rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC);
 	}
 }
 
@@ -1338,7 +1340,7 @@ rt_newmaddrmsg(int cmd, struct ifmultiad
 	    __func__));
 	ifmam->ifmam_index = ifp->if_index;
 	ifmam->ifmam_addrs = info.rti_addrs;
-	rt_dispatch(m, ifma->ifma_addr);
+	rt_dispatch(m, ifma->ifma_addr ? ifma->ifma_addr->sa_family : AF_UNSPEC);
 }
 
 static struct mbuf *
@@ -1398,7 +1400,7 @@ rt_ieee80211msg(struct ifnet *ifp, int w
 		if (m->m_flags & M_PKTHDR)
 			m->m_pkthdr.len += data_len;
 		mtod(m, struct if_announcemsghdr *)->ifan_msglen += data_len;
-		rt_dispatch(m, NULL);
+		rt_dispatch(m, AF_UNSPEC);
 	}
 }
 
@@ -1414,11 +1416,11 @@ rt_ifannouncemsg(struct ifnet *ifp, int 
 
 	m = rt_makeifannouncemsg(ifp, RTM_IFANNOUNCE, what, &info);
 	if (m != NULL)
-		rt_dispatch(m, NULL);
+		rt_dispatch(m, AF_UNSPEC);
 }
 
 static void
-rt_dispatch(struct mbuf *m, const struct sockaddr *sa)
+rt_dispatch(struct mbuf *m, sa_family_t saf)
 {
 	struct m_tag *tag;
 
@@ -1427,14 +1429,14 @@ rt_dispatch(struct mbuf *m, const struct
 	 * use when injecting the mbuf into the routing socket buffer from
 	 * the netisr.
 	 */
-	if (sa != NULL) {
+	if (saf != AF_UNSPEC) {
 		tag = m_tag_get(PACKET_TAG_RTSOCKFAM, sizeof(unsigned short),
 		    M_NOWAIT);
 		if (tag == NULL) {
 			m_freem(m);
 			return;
 		}
-		*(unsigned short *)(tag + 1) = sa->sa_family;
+		*(unsigned short *)(tag + 1) = saf;
 		m_tag_prepend(m, tag);
 	}
 #ifdef VIMAGE

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 18:55:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 16A76106566B;
	Thu,  3 Nov 2011 18:55:19 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 069AE8FC17;
	Thu,  3 Nov 2011 18:55:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3ItIM1082538;
	Thu, 3 Nov 2011 18:55:18 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3ItInA082536;
	Thu, 3 Nov 2011 18:55:18 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111031855.pA3ItInA082536@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 3 Nov 2011 18:55:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227062 - head/sys/fs/devfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 18:55:19 -0000

Author: kib
Date: Thu Nov  3 18:55:18 2011
New Revision: 227062
URL: http://svn.freebsd.org/changeset/base/227062

Log:
  Fix kernel panic when d_fdopen csw method is called for NULL fp.
  This may happen when kernel consumer calls VOP_OPEN().
  
  Reported by:	Tavis Ormandy  through delphij
  MFC after:	3 days

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Thu Nov  3 18:33:30 2011	(r227061)
+++ head/sys/fs/devfs/devfs_vnops.c	Thu Nov  3 18:55:18 2011	(r227062)
@@ -1050,6 +1050,10 @@ devfs_open(struct vop_open_args *ap)
 	dsw = dev_refthread(dev, &ref);
 	if (dsw == NULL)
 		return (ENXIO);
+	if (fp == NULL && dsw->d_fdopen != NULL) {
+		dev_relthread(dev, ref);
+		return (ENXIO);
+	}
 
 	vlocked = VOP_ISLOCKED(vp);
 	VOP_UNLOCK(vp, 0);

From owner-svn-src-all@FreeBSD.ORG  Thu Nov  3 21:20:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4E14106566C;
	Thu,  3 Nov 2011 21:20:22 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D19938FC0C;
	Thu,  3 Nov 2011 21:20:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3LKMNW087270;
	Thu, 3 Nov 2011 21:20:22 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3LKMu6087259;
	Thu, 3 Nov 2011 21:20:22 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201111032120.pA3LKMu6087259@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 3 Nov 2011 21:20:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227064 - in head: share/man/man4 sys/conf
	sys/dev/qlxgb sys/modules sys/modules/qlxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 21:20:23 -0000

Author: bz
Date: Thu Nov  3 21:20:22 2011
New Revision: 227064
URL: http://svn.freebsd.org/changeset/base/227064

Log:
  Add QLogic 10 Gigabit Ethernet & CNA Adapter Driver version 1.30
  for 3200 and 8200 series cards.
  
  Submitted by:	David C Somayajulu (david.somayajulu@qlogic.com),
  		Qlogic Corporation
  MFC After:	3 days

Added:
  head/share/man/man4/qlxgb.4   (contents, props changed)
  head/sys/dev/qlxgb/
  head/sys/dev/qlxgb/README.txt   (contents, props changed)
  head/sys/dev/qlxgb/qla_dbg.c   (contents, props changed)
  head/sys/dev/qlxgb/qla_dbg.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_def.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_glbl.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_hw.c   (contents, props changed)
  head/sys/dev/qlxgb/qla_hw.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_inline.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_ioctl.c   (contents, props changed)
  head/sys/dev/qlxgb/qla_ioctl.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_isr.c   (contents, props changed)
  head/sys/dev/qlxgb/qla_misc.c   (contents, props changed)
  head/sys/dev/qlxgb/qla_os.c   (contents, props changed)
  head/sys/dev/qlxgb/qla_os.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_reg.h   (contents, props changed)
  head/sys/dev/qlxgb/qla_ver.h   (contents, props changed)
  head/sys/modules/qlxgb/
  head/sys/modules/qlxgb/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/sys/conf/files.amd64
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Thu Nov  3 20:29:20 2011	(r227063)
+++ head/share/man/man4/Makefile	Thu Nov  3 21:20:22 2011	(r227064)
@@ -347,6 +347,7 @@ MAN=	aac.4 \
 	pts.4 \
 	pty.4 \
 	puc.4 \
+	${_qlxgb.4} \
 	ral.4 \
 	random.4 \
 	rc.4 \
@@ -713,6 +714,10 @@ _xen.4=		xen.4
 MLINKS+=lindev.4 full.4
 .endif
 
+.if ${MACHINE_CPUARCH} == "amd64"
+_qlxgb.4=	qlxgb.4
+.endif
+
 .if ${MACHINE_CPUARCH} == "powerpc"
 _atp.4=		atp.4
 .endif

Added: head/share/man/man4/qlxgb.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/qlxgb.4	Thu Nov  3 21:20:22 2011	(r227064)
@@ -0,0 +1,93 @@
+.\"-
+.\" Copyright (c) 2011 "Bjoern A. Zeeb" 
+.\" 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 November 3, 2011
+.Dt QLXGB 4
+.Os
+.Sh NAME
+.Nm qlxgb
+.Nd "QLogic 10 Gigabit Ethernet & CNA Adapter Driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device qlxgb"
+.Ed
+.Pp
+To load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_qlxgb_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver supports IPv4 checksum offload,
+TCP and UDP checksum offload for both IPv4 and IPv6,
+Large Segment Offload for both IPv4 and IPv6,
+Jumbo frames, VLAN Tag, and
+Receive Side scaling.
+For further hardware information, see
+.Pa http://www.qlogic.com/ .
+.Sh HARDWARE
+The
+.Nm
+driver supports 10 Gigabit Ethernet & CNA Adapter based on the following
+chipsets:
+.Pp
+.Bl -bullet -compact
+.It
+QLogic 3200 series
+.It
+QLogic 8200 series
+.El
+.Sh SUPPORT
+For support questions please contact your QLogic approved reseller or
+QLogic Technical Support at
+.Pa http://support.qlogic.com ,
+or by E-mail at
+.Aq support@qlogic.com .
+.Sh SEE ALSO
+.Xr altq 4 ,
+.Xr arp 4 ,
+.Xr netintro 4 ,
+.Xr ng_ether 4 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 10.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An David C Somayajulu
+at Qlogic Corporation.

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Thu Nov  3 20:29:20 2011	(r227063)
+++ head/sys/conf/files.amd64	Thu Nov  3 21:20:22 2011	(r227064)
@@ -208,6 +208,12 @@ dev/lindev/lindev.c		optional	lindev
 dev/nfe/if_nfe.c		optional	nfe pci
 dev/nve/if_nve.c		optional	nve pci
 dev/nvram/nvram.c		optional	nvram isa
+dev/qlxgb/qla_dbg.c		optional	qlxgb pci
+dev/qlxgb/qla_hw.c		optional	qlxgb pci
+dev/qlxgb/qla_ioctl.c		optional	qlxgb pci
+dev/qlxgb/qla_isr.c		optional	qlxgb pci
+dev/qlxgb/qla_misc.c		optional	qlxgb pci
+dev/qlxgb/qla_os.c		optional	qlxgb pci
 dev/sio/sio.c			optional	sio
 dev/sio/sio_isa.c		optional	sio isa
 dev/sio/sio_pccard.c		optional	sio pccard

Added: head/sys/dev/qlxgb/README.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/qlxgb/README.txt	Thu Nov  3 21:20:22 2011	(r227064)
@@ -0,0 +1,99 @@
+# $FreeBSD$
+
+			README File
+	QLogic 3200 and 8200 series Single/Dual Port
+10 Gigabit Ethernet & CNA Adapter Driver for FreeBSD 7.x/8.x/9.x
+
+		QLogic Corporation.
+		All rights reserved. 
+
+
+Table of Contents
+1. Package Contents 
+2. OS Support
+3. Supported Features
+4. Using the Driver
+   4.1 Installing the driver
+   4.2 Removing the driver
+5. Driver Parameters
+6. Additional Notes
+7. Contacting Support
+
+1. Package Contents 
+ * Documentation 
+   - README (this document) version:1.0
+   - Release Notes Version:1.0
+ * Driver (if_qlxgb.ko)
+	- FreeBSD 7.x/8.x/9.x
+ * Firmware: pre-flashed on QLogic adapter;
+
+2. OS Support
+
+The Qlogic 10Gigabit Ethernet/CNA driver is compatible with the 
+following OS platforms:
+ * FreeBSD 7.x/8.x/9.x (64-bit) [Intel EM64T, AMD64]
+
+3. Supported Features
+10Gigabit Ethernet NIC/CNA driver supports following features
+
+* Large Segment Offload over TCP IPV4
+* Large Segment Offload over TCP IPV6
+* Receive Side scaling
+* TCP over IPv4 checksum offload
+* UDP over IPv4 checksum offload
+* IPV4 checksum offload
+* TCP over IPv6 checksum offload
+* UDP over IPv6 checksum offload
+* Jumbo frames
+* VLAN Tag
+
+
+4. Using the driver
+
+ 4.1 Installing the driver
+
+   - copy the driver file (if_qlxgb.ko) into some directory (say qla_driver)
+   - cd 
+   - kldload -v ./if_qlxgb.ko
+
+ 4.2 Removing the driver
+ 
+  - kldunload if_qlxgb
+
+5. Parameters to set prior to installing the driver
+
+   - Add the following lines to /etc/sysctl.conf and reboot the machine prior
+     to installing the driver
+   
+	kern.ipc.nmbjumbo9=262144
+	net.inet.tcp.recvbuf_max=262144
+	net.inet.tcp.recvbuf_inc=16384
+	kern.ipc.nmbclusters=1000000
+	kern.ipc.maxsockbuf=2097152
+	net.inet.tcp.recvspace=131072
+	net.inet.tcp.sendbuf_max=262144
+	net.inet.tcp.sendspace=65536
+ 
+   - If you do not want to reboot the system please run the following commands
+
+	login or su to root
+
+	sysctl kern.ipc.nmbjumbo9=262144
+	sysctl net.inet.tcp.recvbuf_max=262144
+	sysctl net.inet.tcp.recvbuf_inc=16384
+	sysctl kern.ipc.nmbclusters=1000000
+	sysctl kern.ipc.maxsockbuf=2097152
+	sysctl net.inet.tcp.recvspace=131072
+	sysctl net.inet.tcp.sendbuf_max=262144
+	sysctl net.inet.tcp.sendspace=65536
+
+6. Contacting Support 
+Please feel free to contact your QLogic approved reseller or QLogic 
+Technical Support at any phase of integration for assistance. QLogic
+Technical Support can be reached by the following methods: 
+Web:    http://support.qlogic.com
+E-mail: support@qlogic.com
+(c) Copyright 2011. All rights reserved worldwide. QLogic, the QLogic 
+logo, and the Powered by QLogic logo are registered trademarks of
+QLogic Corporation. All other brand and product names are trademarks 
+or registered trademarks of their respective owners. 

Added: head/sys/dev/qlxgb/qla_dbg.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/qlxgb/qla_dbg.c	Thu Nov  3 21:20:22 2011	(r227064)
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) 2010-2011 Qlogic Corporation
+ * 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 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 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.
+ */
+/*
+ * File : qla_dbg.c
+ * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "qla_os.h"
+#include "qla_reg.h"
+#include "qla_hw.h"
+#include "qla_def.h"
+#include "qla_inline.h"
+#include "qla_ver.h"
+#include "qla_glbl.h"
+#include "qla_dbg.h"
+
+
+uint32_t dbg_level = 0 ;
+/*
+ * Name: qla_dump_buf32
+ * Function: dumps a buffer as 32 bit words
+ */
+void qla_dump_buf32(qla_host_t *ha, char *msg, void *dbuf32, uint32_t len32)
+{
+        device_t dev;
+	uint32_t i = 0;
+	uint32_t *buf;
+
+        dev = ha->pci_dev;
+	buf = dbuf32;
+
+	device_printf(dev, "%s: %s dump start\n", __func__, msg);
+
+	while (len32 >= 4) {
+		device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
+			i, buf[0], buf[1], buf[2], buf[3]);
+		i += 4 * 4;
+		len32 -= 4;
+		buf += 4;
+	}
+	switch (len32) {
+	case 1:
+		device_printf(dev,"0x%08x: 0x%08x\n", i, buf[0]);
+		break;
+	case 2:
+		device_printf(dev,"0x%08x: 0x%08x 0x%08x\n", i, buf[0], buf[1]);
+		break;
+	case 3:
+		device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x\n",
+			i, buf[0], buf[1], buf[2]);
+		break;
+	default:
+		break;
+	}
+	device_printf(dev, "%s: %s dump end\n", __func__, msg);
+}
+
+/*
+ * Name: qla_dump_buf16
+ * Function: dumps a buffer as 16 bit words
+ */
+void qla_dump_buf16(qla_host_t *ha, char *msg, void *dbuf16, uint32_t len16)
+{
+        device_t dev;
+	uint32_t i = 0;
+	uint16_t *buf;
+
+        dev = ha->pci_dev;
+	buf = dbuf16;
+
+	device_printf(dev, "%s: %s dump start\n", __func__, msg);
+
+	while (len16 >= 8) {
+		device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x"
+			" 0x%04x 0x%04x 0x%04x 0x%04x\n", i, buf[0],
+			buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
+		i += 16;
+		len16 -= 8;
+		buf += 8;
+	}
+	switch (len16) {
+	case 1:
+		device_printf(dev,"0x%08x: 0x%04x\n", i, buf[0]);
+		break;
+	case 2:
+		device_printf(dev,"0x%08x: 0x%04x 0x%04x\n", i, buf[0], buf[1]);
+		break;
+	case 3:
+		device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x\n",
+			i, buf[0], buf[1], buf[2]);
+		break;
+	case 4:
+		device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
+			buf[0], buf[1], buf[2], buf[3]);
+		break;
+	case 5:
+		device_printf(dev,"0x%08x:"
+			" 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4]);
+		break;
+	case 6:
+		device_printf(dev,"0x%08x:"
+			" 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
+		break;
+	case 7:
+		device_printf(dev,"0x%04x: 0x%04x 0x%04x 0x%04x 0x%04x"
+			" 0x%04x 0x%04x 0x%04x\n", i, buf[0], buf[1],
+			buf[2], buf[3], buf[4], buf[5], buf[6]);
+		break;
+	default:
+		break;
+	}
+	device_printf(dev, "%s: %s dump end\n", __func__, msg);
+}
+
+/*
+ * Name: qla_dump_buf8
+ * Function: dumps a buffer as bytes
+ */
+void qla_dump_buf8(qla_host_t *ha, char *msg, void *dbuf, uint32_t len)
+{
+        device_t dev;
+	uint32_t i = 0;
+	uint8_t *buf;
+
+        dev = ha->pci_dev;
+	buf = dbuf;
+
+	device_printf(dev, "%s: %s 0x%x dump start\n", __func__, msg, len);
+	
+	while (len >= 16) {
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3],
+			buf[4], buf[5], buf[6], buf[7],
+			buf[8], buf[9], buf[10], buf[11],
+			buf[12], buf[13], buf[14], buf[15]);
+		i += 16;
+		len -= 16;
+		buf += 16;
+	}
+	switch (len) {
+	case 1:
+		device_printf(dev,"0x%08x: %02x\n", i, buf[0]);
+		break;
+	case 2:
+		device_printf(dev,"0x%08x: %02x %02x\n", i, buf[0], buf[1]);
+		break;
+	case 3:
+		device_printf(dev,"0x%08x: %02x %02x %02x\n",
+			i, buf[0], buf[1], buf[2]);
+		break;
+	case 4:
+		device_printf(dev,"0x%08x: %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3]);
+		break;
+	case 5:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4]);
+		break;
+	case 6:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
+		break;
+	case 7:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
+		break;
+	case 8:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7]);
+		break;
+	case 9:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7], buf[8]);
+		break;
+	case 10:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7], buf[8], buf[9]);
+		break;
+	case 11:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7], buf[8], buf[9], buf[10]);
+		break;
+	case 12:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7], buf[8], buf[9], buf[10], buf[11]);
+		break;
+	case 13:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7], buf[8], buf[9], buf[10], buf[11], buf[12]);
+		break;
+	case 14:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
+			buf[13]);
+		break;
+	case 15:
+		device_printf(dev,"0x%08x:"
+			" %02x %02x %02x %02x %02x %02x %02x %02x"
+			" %02x %02x %02x %02x %02x %02x %02x\n", i,
+			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+			buf[7], buf[8], buf[9], buf[10], buf[11], buf[12],
+			buf[13], buf[14]);
+		break;
+	default:
+		break;
+	}
+	
+	device_printf(dev, "%s: %s dump end\n", __func__, msg);
+}

Added: head/sys/dev/qlxgb/qla_dbg.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/qlxgb/qla_dbg.h	Thu Nov  3 21:20:22 2011	(r227064)
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2011 Qlogic Corporation
+ * 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 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 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$
+ */
+
+/*
+ * File : qla_dbg.h
+ * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+ */
+
+#ifndef _QL_DBG_H_
+#define _QL_DBG_H_
+
+extern uint32_t dbg_level;
+
+extern void qla_dump_buf8(qla_host_t *ha, char *str, void *dbuf,
+		uint32_t len);
+extern void qla_dump_buf16(qla_host_t *ha, char *str, void *dbuf,
+		uint32_t len16);
+extern void qla_dump_buf32(qla_host_t *ha, char *str, void *dbuf,
+		uint32_t len32);
+
+
+#define DBG 1
+
+#if DBG
+
+#define QL_DPRINT1(x)	if (dbg_level & 0x0001) device_printf x
+#define QL_DPRINT2(x)	if (dbg_level & 0x0002) device_printf x
+#define QL_DPRINT4(x)	if (dbg_level & 0x0004) device_printf x
+#define QL_DPRINT8(x)	if (dbg_level & 0x0008) device_printf x
+#define QL_DPRINT10(x)	if (dbg_level & 0x0010) device_printf x
+#define QL_DPRINT20(x)	if (dbg_level & 0x0020) device_printf x
+#define QL_DPRINT40(x)	if (dbg_level & 0x0040) device_printf x
+#define QL_DPRINT80(x)	if (dbg_level & 0x0080) device_printf x
+
+#define QL_DUMP_BUFFER8(h, s, b, n) if (dbg_level & 0x08000000)\
+					qla_dump_buf8(h, s, b, n)
+#define QL_DUMP_BUFFER16(h, s, b, n) if (dbg_level & 0x08000000)\
+					qla_dump_buf16(h, s, b, n)
+#define QL_DUMP_BUFFER32(h, s, b, n) if (dbg_level & 0x08000000)\
+					qla_dump_buf32(h, s, b, n)
+
+#else
+
+#define QL_DPRINT1(x)
+#define QL_DPRINT2(x)
+#define QL_DPRINT4(x)
+#define QL_DPRINT8(x)
+#define QL_DPRINT10(x)
+#define QL_DPRINT20(x)
+#define QL_DPRINT40(x)
+#define QL_DPRINT80(x)
+
+#define QL_DUMP_BUFFER8(h, s, b, n)
+#define QL_DUMP_BUFFER16(h, s, b, n)
+#define QL_DUMP_BUFFER32(h, s, b, n)
+
+#endif
+
+#endif /* #ifndef _QL_DBG_H_ */

Added: head/sys/dev/qlxgb/qla_def.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/qlxgb/qla_def.h	Thu Nov  3 21:20:22 2011	(r227064)
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2010-2011 Qlogic Corporation
+ * 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 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 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$
+ */
+
+/*
+ * File: qla_def.h
+ * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+ */
+
+#ifndef _QLA_DEF_H_
+#define _QLA_DEF_H_
+
+#define BIT_0                   (0x1 << 0)
+#define BIT_1                   (0x1 << 1)
+#define BIT_2                   (0x1 << 2)
+#define BIT_3                   (0x1 << 3)
+#define BIT_4                   (0x1 << 4)
+#define BIT_5                   (0x1 << 5)
+#define BIT_6                   (0x1 << 6)
+#define BIT_7                   (0x1 << 7)
+#define BIT_8                   (0x1 << 8)
+#define BIT_9                   (0x1 << 9)
+#define BIT_10                  (0x1 << 10)
+#define BIT_11                  (0x1 << 11)
+#define BIT_12                  (0x1 << 12)
+#define BIT_13                  (0x1 << 13)
+#define BIT_14                  (0x1 << 14)
+#define BIT_15                  (0x1 << 15)
+#define BIT_16                  (0x1 << 16)
+#define BIT_17                  (0x1 << 17)
+#define BIT_18                  (0x1 << 18)
+#define BIT_19                  (0x1 << 19)
+#define BIT_20                  (0x1 << 20)
+#define BIT_21                  (0x1 << 21)
+#define BIT_22                  (0x1 << 22)
+#define BIT_23                  (0x1 << 23)
+#define BIT_24                  (0x1 << 24)
+#define BIT_25                  (0x1 << 25)
+#define BIT_26                  (0x1 << 26)
+#define BIT_27                  (0x1 << 27)
+#define BIT_28                  (0x1 << 28)
+#define BIT_29                  (0x1 << 29)
+#define BIT_30                  (0x1 << 30)
+#define BIT_31                  (0x1 << 31)
+
+struct qla_rx_buf {
+	struct mbuf	*m_head;
+	bus_dmamap_t	map;
+	bus_addr_t      paddr;
+	uint32_t	handle;
+	void		*next;
+};
+typedef struct qla_rx_buf qla_rx_buf_t;
+
+struct qla_tx_buf {
+	struct mbuf	*m_head;
+	bus_dmamap_t	map;
+};
+typedef struct qla_tx_buf qla_tx_buf_t;
+
+#define QLA_MAX_SEGMENTS	63	/* maximum # of segs in a sg list */
+#define QLA_MAX_FRAME_SIZE	MJUM9BYTES
+#define QLA_STD_FRAME_SIZE	1514
+#define QLA_MAX_TSO_FRAME_SIZE	(64 * 1024 - 1)
+
+/* Number of MSIX/MSI Vectors required */
+#define Q8_MSI_COUNT		4
+
+struct qla_ivec {
+	struct resource		*irq;
+	void			*handle;
+	int			irq_rid;
+	void			*ha;
+	struct task		rcv_task;
+	struct taskqueue	*rcv_tq;
+};
+
+typedef struct qla_ivec qla_ivec_t;
+
+#define QLA_WATCHDOG_CALLOUT_TICKS	1
+
+/*
+ * Adapter structure contains the hardware independant information of the
+ * pci function.
+ */
+struct qla_host {
+        volatile struct {
+                volatile uint32_t
+			qla_watchdog_active  :1,
+			qla_watchdog_exit    :1,
+			qla_watchdog_pause   :1,
+			lro_init	:1,
+			stop_rcv	:1,
+			link_up		:1,
+			parent_tag	:1,
+			lock_init	:1;
+        } flags;
+
+	device_t		pci_dev;
+
+	uint8_t			pci_func;
+	uint16_t		watchdog_ticks;
+	uint8_t			resvd;
+
+        /* ioctl related */
+        struct cdev             *ioctl_dev;
+
+	/* register mapping */
+	struct resource		*pci_reg;
+	int			reg_rid;
+
+	/* interrupts */
+	struct resource         *irq;
+	int			msix_count;
+	void			*intr_handle;
+	qla_ivec_t		irq_vec[Q8_MSI_COUNT];
+	
+	/* parent dma tag */
+	bus_dma_tag_t           parent_tag;
+
+	/* interface to o.s */
+	struct ifnet		*ifp;
+
+	struct ifmedia		media;
+	uint16_t		max_frame_size;
+	uint16_t		rsrvd0;
+	int			if_flags;
+
+	/* hardware access lock */
+	struct mtx		hw_lock;
+	volatile uint32_t	hw_lock_held;
+
+	/* transmit and receive buffers */
+	qla_tx_buf_t		tx_buf[NUM_TX_DESCRIPTORS];
+	bus_dma_tag_t		tx_tag;
+	struct mtx		tx_lock;
+	struct task		tx_task;
+	struct taskqueue	*tx_tq;
+	struct callout		tx_callout;
+
+	qla_rx_buf_t		rx_buf[NUM_RX_DESCRIPTORS];
+	qla_rx_buf_t		rx_jbuf[NUM_RX_JUMBO_DESCRIPTORS];
+	bus_dma_tag_t		rx_tag;
+
+	struct mtx		rx_lock;
+	struct mtx		rxj_lock;
+
+	/* stats */
+	uint32_t		err_m_getcl;
+	uint32_t		err_m_getjcl;
+	uint32_t		err_tx_dmamap_create;
+	uint32_t		err_tx_dmamap_load;
+	uint32_t		err_tx_defrag;
+
+	uint64_t		rx_frames;
+	uint64_t		rx_bytes;
+
+	uint64_t		tx_frames;
+	uint64_t		tx_bytes;
+
+        uint32_t                fw_ver_major;
+        uint32_t                fw_ver_minor;
+        uint32_t                fw_ver_sub;
+        uint32_t                fw_ver_build;
+
+	/* hardware specific */
+	qla_hw_t		hw;
+
+	/* debug stuff */
+	volatile const char 	*qla_lock;
+	volatile const char	*qla_unlock;
+};
+typedef struct qla_host qla_host_t;
+
+/* note that align has to be a power of 2 */
+#define QL_ALIGN(size, align) (size + (align - 1)) & ~(align - 1);
+#define QL_MIN(x, y) ((x < y) ? x : y)
+
+#define QL_RUNNING(ifp) \
+		((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == \
+			IFF_DRV_RUNNING)
+
+#endif /* #ifndef _QLA_DEF_H_ */

Added: head/sys/dev/qlxgb/qla_glbl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/qlxgb/qla_glbl.h	Thu Nov  3 21:20:22 2011	(r227064)
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2010-2011 Qlogic Corporation
+ * 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 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 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$
+ */
+/*
+ * File: qla_glbl.h
+ * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+ * Content: Contains prototypes of the exported functions from each file.
+ */
+#ifndef _QLA_GLBL_H_
+#define _QLA_GLBL_H_
+
+/*
+ * from qla_isr.c
+ */
+extern void qla_isr(void *arg);
+extern void qla_rcv(void *context, int pending);
+
+/*
+ * from qla_os.c
+ */
+extern uint32_t std_replenish;
+extern uint32_t jumbo_replenish;
+extern uint32_t rcv_pkt_thres;
+extern uint32_t rcv_pkt_thres_d;
+extern uint32_t snd_pkt_thres;
+extern uint32_t free_pkt_thres;
+
+extern int qla_alloc_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
+extern void qla_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
+extern void qla_start(struct ifnet *ifp);
+extern int qla_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp,
+	        uint32_t jumbo);
+
+
+/*
+ * from qla_flash.c
+ */
+extern int qla_flash_rd32_words(qla_host_t *ha, uint32_t addr,
+		uint32_t *val, uint32_t num);
+extern int qla_flash_rd32(qla_host_t *ha, uint32_t addr, uint32_t *val);
+
+/*
+ * from qla_hw.c
+ */
+extern int qla_get_msix_count(qla_host_t *ha);
+extern int qla_alloc_dma(qla_host_t *ha);
+extern void qla_free_dma(qla_host_t *ha);
+extern void qla_hw_add_sysctls(qla_host_t *ha);
+extern int qla_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs,
+		uint32_t *tx_idx, struct mbuf *mp);
+extern int qla_init_hw_if(qla_host_t *ha);
+extern void qla_get_hw_caps(qla_host_t *ha);
+extern void qla_hw_set_multi(qla_host_t *ha, uint8_t *mta, uint32_t mcnt,
+	uint32_t add_multi);
+extern void qla_del_hw_if(qla_host_t *ha);
+extern void qla_set_promisc(qla_host_t *ha);
+extern void qla_set_allmulti(qla_host_t *ha);
+extern void qla_reset_promisc_allmulti(qla_host_t *ha);
+extern void qla_config_ipv4_addr(qla_host_t *ha, uint32_t ipv4_addr);
+extern int qla_hw_tx_compl(qla_host_t *ha);
+extern void qla_update_link_state(qla_host_t *ha);
+extern void qla_hw_tx_done(qla_host_t *ha);
+extern int qla_config_lro(qla_host_t *ha);
+extern void qla_free_lro(qla_host_t *ha);
+extern int qla_set_max_mtu(qla_host_t *ha, uint32_t mtu, uint16_t cntxt_id);
+extern void qla_hw_stop_rcv(qla_host_t *ha);
+
+/*
+ * from qla_misc.c
+ */
+extern int qla_init_hw(qla_host_t *ha);
+extern int qla_rdwr_indreg32(qla_host_t *ha, uint32_t addr, uint32_t *val,
+		uint32_t rd);
+extern int qla_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data);
+
+/*
+ * from qla_ioctl.c
+ */
+extern int qla_make_cdev(qla_host_t *ha);
+extern void qla_del_cdev(qla_host_t *ha);
+extern int qla_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
+		struct thread *td);
+
+#endif /* #ifndef_QLA_GLBL_H_ */

Added: head/sys/dev/qlxgb/qla_hw.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/qlxgb/qla_hw.c	Thu Nov  3 21:20:22 2011	(r227064)
@@ -0,0 +1,1776 @@
+/*
+ * Copyright (c) 2010-2011 Qlogic Corporation
+ * 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 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 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.
+ */
+
+/*
+ * File: qla_hw.c
+ * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+ * Content: Contains Hardware dependant functions
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "qla_os.h"
+#include "qla_reg.h"
+#include "qla_hw.h"
+#include "qla_def.h"
+#include "qla_inline.h"
+#include "qla_ver.h"
+#include "qla_glbl.h"
+#include "qla_dbg.h"
+
+static uint32_t sysctl_num_rds_rings = 2;
+static uint32_t sysctl_num_sds_rings = 4;
+
+/*
+ * Static Functions
+ */
+
+static void qla_init_cntxt_regions(qla_host_t *ha);
+static int qla_issue_cmd(qla_host_t *ha, qla_cdrp_t *cdrp);
+static int qla_fw_cmd(qla_host_t *ha, void *fw_cmd, uint32_t size);
+static int qla_config_mac_addr(qla_host_t *ha, uint8_t *mac_addr,
+		uint16_t cntxt_id, uint32_t add_multi);
+static void qla_del_rcv_cntxt(qla_host_t *ha);
+static int qla_init_rcv_cntxt(qla_host_t *ha);
+static void qla_del_xmt_cntxt(qla_host_t *ha);
+static int qla_init_xmt_cntxt(qla_host_t *ha);
+static int qla_get_max_rds(qla_host_t *ha);
+static int qla_get_max_sds(qla_host_t *ha);
+static int qla_get_max_rules(qla_host_t *ha);
+static int qla_get_max_rcv_cntxts(qla_host_t *ha);
+static int qla_get_max_tx_cntxts(qla_host_t *ha);
+static int qla_get_max_mtu(qla_host_t *ha);
+static int qla_get_max_lro(qla_host_t *ha);
+static int qla_get_flow_control(qla_host_t *ha);
+static void qla_hw_tx_done_locked(qla_host_t *ha);
+
+int
+qla_get_msix_count(qla_host_t *ha)
+{
+	return (sysctl_num_sds_rings);
+}
+
+/*
+ * Name: qla_hw_add_sysctls
+ * Function: Add P3Plus specific sysctls
+ */
+void
+qla_hw_add_sysctls(qla_host_t *ha)
+{
+        device_t	dev;
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 03:39:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAF0B106566B;
	Fri,  4 Nov 2011 03:39:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CAEDC8FC12;
	Fri,  4 Nov 2011 03:39:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA43dV2h099486;
	Fri, 4 Nov 2011 03:39:31 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA43dVt9099483;
	Fri, 4 Nov 2011 03:39:31 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201111040339.pA43dVt9099483@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 4 Nov 2011 03:39:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227069 - in head/sys: fs/devfs kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 03:39:32 -0000

Author: jhb
Date: Fri Nov  4 03:39:31 2011
New Revision: 227069
URL: http://svn.freebsd.org/changeset/base/227069

Log:
  Move the cleanup of f_cdevpriv when the reference count of a devfs
  file descriptor drops to zero out of _fdrop() and into devfs_close_f()
  as it is only relevant for devfs file descriptors.
  
  Reviewed by:	kib
  MFC after:	1 week

Modified:
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/kern/kern_descrip.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Fri Nov  4 02:34:52 2011	(r227068)
+++ head/sys/fs/devfs/devfs_vnops.c	Fri Nov  4 03:39:31 2011	(r227069)
@@ -604,6 +604,13 @@ devfs_close_f(struct file *fp, struct th
 	td->td_fpop = fp;
 	error = vnops.fo_close(fp, td);
 	td->td_fpop = fpop;
+
+	/*
+	 * The f_cdevpriv cannot be assigned non-NULL value while we
+	 * are destroying the file.
+	 */
+	if (fp->f_cdevpriv != NULL)
+		devfs_fpdrop(fp);
 	return (error);
 }
 

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Fri Nov  4 02:34:52 2011	(r227068)
+++ head/sys/kern/kern_descrip.c	Fri Nov  4 03:39:31 2011	(r227069)
@@ -2575,12 +2575,6 @@ _fdrop(struct file *fp, struct thread *t
 		panic("fdrop: count %d", fp->f_count);
 	if (fp->f_ops != &badfileops)
 		error = fo_close(fp, td);
-	/*
-	 * The f_cdevpriv cannot be assigned non-NULL value while we
-	 * are destroying the file.
-	 */
-	if (fp->f_cdevpriv != NULL)
-		devfs_fpdrop(fp);
 	atomic_subtract_int(&openfiles, 1);
 	crfree(fp->f_cred);
 	uma_zfree(file_zone, fp);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 04:02:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 554211065670;
	Fri,  4 Nov 2011 04:02:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 42AEB8FC13;
	Fri,  4 Nov 2011 04:02:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA442p48000338;
	Fri, 4 Nov 2011 04:02:51 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA442oYZ000317;
	Fri, 4 Nov 2011 04:02:50 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201111040402.pA442oYZ000317@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 4 Nov 2011 04:02:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227070 - in head: lib/libc/sys sys/compat/freebsd32
	sys/kern sys/sys sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 04:02:51 -0000

Author: jhb
Date: Fri Nov  4 04:02:50 2011
New Revision: 227070
URL: http://svn.freebsd.org/changeset/base/227070

Log:
  Add the posix_fadvise(2) system call.  It is somewhat similar to
  madvise(2) except that it operates on a file descriptor instead of a
  memory region.  It is currently only supported on regular files.
  
  Just as with madvise(2), the advice given to posix_fadvise(2) can be
  divided into two types.  The first type provide hints about data access
  patterns and are used in the file read and write routines to modify the
  I/O flags passed down to VOP_READ() and VOP_WRITE().  These modes are
  thus filesystem independent.  Note that to ease implementation (and
  since this API is only advisory anyway), only a single non-normal
  range is allowed per file descriptor.
  
  The second type of hints are used to hint to the OS that data will or
  will not be used.  These hints are implemented via a new VOP_ADVISE().
  A default implementation is provided which does nothing for the WILLNEED
  request and attempts to move any clean pages to the cache page queue for
  the DONTNEED request.  This latter case required two other changes.
  First, a new V_CLEANONLY flag was added to vinvalbuf().  This requests
  vinvalbuf() to only flush clean buffers for the vnode from the buffer
  cache and to not remove any backing pages from the vnode.  This is
  used to ensure clean pages are not wired into the buffer cache before
  attempting to move them to the cache page queue.  The second change adds
  a new vm_object_page_cache() method.  This method is somewhat similar to
  vm_object_page_remove() except that instead of freeing each page in the
  specified range, it attempts to move clean pages to the cache queue if
  possible.
  
  To preserve the ABI of struct file, the f_cdevpriv pointer is now reused
  in a union to point to the currently active advice region if one is
  present for regular files.
  
  Reviewed by:	jilles, kib, arch@
  Approved by:	re (kib)
  MFC after:	1 month

Added:
  head/lib/libc/sys/posix_fadvise.2   (contents, props changed)
Modified:
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/Symbol.map
  head/lib/libc/sys/madvise.2
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master
  head/sys/kern/vfs_default.c
  head/sys/kern/vfs_subr.c
  head/sys/kern/vfs_syscalls.c
  head/sys/kern/vfs_vnops.c
  head/sys/kern/vnode_if.src
  head/sys/sys/fcntl.h
  head/sys/sys/file.h
  head/sys/sys/param.h
  head/sys/sys/vnode.h
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h

Modified: head/lib/libc/sys/Makefile.inc
==============================================================================
--- head/lib/libc/sys/Makefile.inc	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/lib/libc/sys/Makefile.inc	Fri Nov  4 04:02:50 2011	(r227070)
@@ -96,7 +96,8 @@ MAN+=	abort2.2 accept.2 access.2 acct.2 
 	mq_setattr.2 \
 	msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \
 	msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \
-	pathconf.2 pdfork.2 pipe.2 poll.2 posix_fallocate.2 posix_openpt.2 profil.2 \
+	pathconf.2 pdfork.2 pipe.2 poll.2 posix_fadvise.2 posix_fallocate.2 \
+	posix_openpt.2 profil.2 \
 	pselect.2 ptrace.2 quotactl.2 \
 	read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \
 	rtprio.2

Modified: head/lib/libc/sys/Symbol.map
==============================================================================
--- head/lib/libc/sys/Symbol.map	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/lib/libc/sys/Symbol.map	Fri Nov  4 04:02:50 2011	(r227070)
@@ -378,6 +378,10 @@ FBSD_1.2 {
 	setloginclass;
 };
 
+FBSD_1.3 {
+	posix_fadvise;
+};
+
 FBSDprivate_1.0 {
 	___acl_aclcheck_fd;
 	__sys___acl_aclcheck_fd;

Modified: head/lib/libc/sys/madvise.2
==============================================================================
--- head/lib/libc/sys/madvise.2	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/lib/libc/sys/madvise.2	Fri Nov  4 04:02:50 2011	(r227070)
@@ -169,7 +169,8 @@ was specified and the process does not h
 .Xr mincore 2 ,
 .Xr mprotect 2 ,
 .Xr msync 2 ,
-.Xr munmap 2
+.Xr munmap 2 ,
+.Xr posix_fadvise 2
 .Sh STANDARDS
 The
 .Fn posix_madvise

Added: head/lib/libc/sys/posix_fadvise.2
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/sys/posix_fadvise.2	Fri Nov  4 04:02:50 2011	(r227070)
@@ -0,0 +1,139 @@
+.\" Copyright (c) 1991, 1993
+.\"	The Regents of the University of California.  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.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
+.\"
+.\"	@(#)madvise.2	8.1 (Berkeley) 6/9/93
+.\" $FreeBSD$
+.\"
+.Dd October 26, 2011
+.Dt POSIX_FADVISE 2
+.Os
+.Sh NAME
+.Nm posix_fadvise
+.Nd give advice about use of file data
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In fcntl.h
+.Ft int
+.Fn posix_fadvise "int fd" "off_t offset" "off_t len" "int advice"
+.Sh DESCRIPTION
+The
+.Fn posix_fadvise
+system call
+allows a process to describe to the system its data access behavior for an
+open file descriptor
+.Fa fd .
+The advice covers the data starting at offset
+.Fa offset
+and continuing for
+.Fa len
+bytes.
+If
+.Fa len
+is zero,
+all data from
+.Fa offset
+to the end of the file is covered.
+.Pp
+The behavior is specified by the
+.Fa advice
+parameter and may be one of:
+.Bl -tag -width POSIX_FADV_SEQUENTIAL
+.It Dv POSIX_FADV_NORMAL
+Tells the system to revert to the default data access behavior.
+.It Dv POSIX_FADV_RANDOM
+Is a hint that file data will be accessed randomly,
+and prefetching is likely not advantageous.
+.It Dv POSIX_FADV_SEQUENTIAL
+Tells the system that file data will be accessed sequentially.
+This currently does nothing as the default behavior uses heuristics to
+detect sequential behavior.
+.It Dv POSIX_FADV_WILLNEED
+Tells the system that the specified data will be accessed in the near future.
+The system may initiate an asychronous read of the data if it is not already
+present in memory.
+.It Dv POSIX_FADV_DONTNEED
+Tells the system that the specified data will not be accessed in the near
+future.
+The system may decrease the in-memory priority of clean data within the
+specified range and future access to this data may require a read operation.
+.It Dv POSIX_FADV_NOREUSE
+Tells the system that the specified data will only be accessed once and
+then not reused.
+Accesses to data within the specified range are treated as if the file
+descriptor has the
+.Dv O_DIRECT
+flag enabled.
+.El
+.Pp
+.Sh RETURN VALUES
+.Rv -std posix_fadvise
+.Sh ERRORS
+The
+.Fn posix_fadvise
+system call will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+The
+.Fa fd
+argument is not a valid file descriptor.
+.It Bq Er EINVAL
+The
+.Fa advice
+argument is not valid.
+.It Bq Er EINVAL
+The
+.Fa offset
+or
+.Fa len
+arguments are negative,
+or
+.Fa offset
++
+.Fa len
+is greater than the maximum file size.
+.It Bq Er ENODEV
+The
+.Fa fd
+argument does not refer to a regular file.
+.It Bq Er ESPIPE
+The
+.Fa fd
+argument is associated with a pipe or FIFO.
+.El
+.Sh SEE ALSO
+.Xr madvise 2
+.Sh STANDARDS
+The
+.Fn posix_fadvise
+interface conforms to
+.St -p1003.1-2001 .
+.Sh HISTORY
+The
+.Fn posix_fadvise
+system call first appeared in
+.Fx 10.0 .

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Fri Nov  4 04:02:50 2011	(r227070)
@@ -2835,3 +2835,16 @@ freebsd32_posix_fallocate(struct thread 
 	ap.len = PAIR32TO64(off_t, uap->len);
 	return (sys_posix_fallocate(td, &ap));
 }
+
+int
+freebsd32_posix_fadvise(struct thread *td,
+    struct freebsd32_posix_fadvise_args *uap)
+{
+	struct posix_fadvise_args ap;
+
+	ap.fd = uap->fd;
+	ap.offset = PAIR32TO64(off_t, uap->offset);
+	ap.len = PAIR32TO64(off_t, uap->len);
+	ap.advice = uap->advice;
+	return (sys_posix_fadvise(td, &ap));
+}

Modified: head/sys/compat/freebsd32/syscalls.master
==============================================================================
--- head/sys/compat/freebsd32/syscalls.master	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/compat/freebsd32/syscalls.master	Fri Nov  4 04:02:50 2011	(r227070)
@@ -991,4 +991,7 @@
 530	AUE_NULL	STD	{ int freebsd32_posix_fallocate(int fd,\
 				    uint32_t offset1, uint32_t offset2,\
 				    uint32_t len1, uint32_t len2); }
-531	AUE_NULL	UNIMPL	posix_fadvise
+531	AUE_NULL	STD	{ int freebsd32_posix_fadvise(int fd, \
+				    uint32_t offset1, uint32_t offset2,\
+				    uint32_t len1, uint32_t len2, \
+				    int advice); }

Modified: head/sys/kern/syscalls.master
==============================================================================
--- head/sys/kern/syscalls.master	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/kern/syscalls.master	Fri Nov  4 04:02:50 2011	(r227070)
@@ -947,6 +947,7 @@
 				    size_t outbuflen); }
 530	AUE_NULL	STD	{ int posix_fallocate(int fd, \
 				    off_t offset, off_t len); }
-531	AUE_NULL	UNIMPL	posix_fadvise
+531	AUE_NULL	STD	{ int posix_fadvise(int fd, off_t offset, \
+				    off_t len, int advice); }
 ; Please copy any additions and changes to the following compatability tables:
 ; sys/compat/freebsd32/syscalls.master

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/kern/vfs_default.c	Fri Nov  4 04:02:50 2011	(r227070)
@@ -96,6 +96,7 @@ struct vop_vector default_vnodeops = {
 
 	.vop_access =		vop_stdaccess,
 	.vop_accessx =		vop_stdaccessx,
+	.vop_advise =		vop_stdadvise,
 	.vop_advlock =		vop_stdadvlock,
 	.vop_advlockasync =	vop_stdadvlockasync,
 	.vop_advlockpurge =	vop_stdadvlockpurge,
@@ -984,6 +985,58 @@ vop_stdallocate(struct vop_allocate_args
 	return (error);
 }
 
+int
+vop_stdadvise(struct vop_advise_args *ap)
+{
+	struct vnode *vp;
+	off_t start, end;
+	int error, vfslocked;
+
+	vp = ap->a_vp;
+	switch (ap->a_advice) {
+	case POSIX_FADV_WILLNEED:
+		/*
+		 * Do nothing for now.  Filesystems should provide a
+		 * custom method which starts an asynchronous read of
+		 * the requested region.
+		 */
+		error = 0;
+		break;
+	case POSIX_FADV_DONTNEED:
+		/*
+		 * Flush any open FS buffers and then remove pages
+		 * from the backing VM object.  Using vinvalbuf() here
+		 * is a bit heavy-handed as it flushes all buffers for
+		 * the given vnode, not just the buffers covering the
+		 * requested range.
+		 */
+		error = 0;
+		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+		if (vp->v_iflag & VI_DOOMED) {
+			VOP_UNLOCK(vp, 0);
+			VFS_UNLOCK_GIANT(vfslocked);
+			break;
+		}
+		vinvalbuf(vp, V_CLEANONLY, 0, 0);
+		if (vp->v_object != NULL) {
+			start = trunc_page(ap->a_start);
+			end = round_page(ap->a_end);
+			VM_OBJECT_LOCK(vp->v_object);
+			vm_object_page_cache(vp->v_object, OFF_TO_IDX(start),
+			    OFF_TO_IDX(end));
+			VM_OBJECT_UNLOCK(vp->v_object);
+		}
+		VOP_UNLOCK(vp, 0);
+		VFS_UNLOCK_GIANT(vfslocked);
+		break;
+	default:
+		error = EINVAL;
+		break;
+	}
+	return (error);
+}
+
 /*
  * vfs default ops
  * used to fill the vfs function table to get reasonable default return values.

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/kern/vfs_subr.c	Fri Nov  4 04:02:50 2011	(r227070)
@@ -1191,7 +1191,7 @@ bufobj_invalbuf(struct bufobj *bo, int f
 	do {
 		error = flushbuflist(&bo->bo_clean,
 		    flags, bo, slpflag, slptimeo);
-		if (error == 0)
+		if (error == 0 && !(flags & V_CLEANONLY))
 			error = flushbuflist(&bo->bo_dirty,
 			    flags, bo, slpflag, slptimeo);
 		if (error != 0 && error != EAGAIN) {
@@ -1220,7 +1220,8 @@ bufobj_invalbuf(struct bufobj *bo, int f
 	/*
 	 * Destroy the copy in the VM cache, too.
 	 */
-	if (bo->bo_object != NULL && (flags & (V_ALT | V_NORMAL)) == 0) {
+	if (bo->bo_object != NULL &&
+	    (flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0) {
 		VM_OBJECT_LOCK(bo->bo_object);
 		vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ?
 		    OBJPR_CLEANONLY : 0);
@@ -1229,7 +1230,7 @@ bufobj_invalbuf(struct bufobj *bo, int f
 
 #ifdef INVARIANTS
 	BO_LOCK(bo);
-	if ((flags & (V_ALT | V_NORMAL)) == 0 &&
+	if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0 &&
 	    (bo->bo_dirty.bv_cnt > 0 || bo->bo_clean.bv_cnt > 0))
 		panic("vinvalbuf: flush failed");
 	BO_UNLOCK(bo);

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/kern/vfs_syscalls.c	Fri Nov  4 04:02:50 2011	(r227070)
@@ -86,6 +86,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+static MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information");
+
 SDT_PROVIDER_DEFINE(vfs);
 SDT_PROBE_DEFINE(vfs, , stat, mode, mode);
 SDT_PROBE_ARGTYPE(vfs, , stat, mode, 0, "char *");
@@ -4845,3 +4847,135 @@ sys_posix_fallocate(struct thread *td, s
 
 	return (kern_posix_fallocate(td, uap->fd, uap->offset, uap->len));
 }
+
+/*
+ * Unlike madvise(2), we do not make a best effort to remember every
+ * possible caching hint.  Instead, we remember the last setting with
+ * the exception that we will allow POSIX_FADV_NORMAL to adjust the
+ * region of any current setting.
+ */
+int
+sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap)
+{
+	struct fadvise_info *fa, *new;
+	struct file *fp;
+	struct vnode *vp;
+	off_t end;
+	int error;
+
+	if (uap->offset < 0 || uap->len < 0 ||
+	    uap->offset > OFF_MAX - uap->len)
+		return (EINVAL);
+	switch (uap->advice) {
+	case POSIX_FADV_SEQUENTIAL:
+	case POSIX_FADV_RANDOM:
+	case POSIX_FADV_NOREUSE:
+		new = malloc(sizeof(*fa), M_FADVISE, M_WAITOK);
+		break;
+	case POSIX_FADV_NORMAL:
+	case POSIX_FADV_WILLNEED:
+	case POSIX_FADV_DONTNEED:
+		new = NULL;
+		break;
+	default:
+		return (EINVAL);
+	}
+	/* XXX: CAP_POSIX_FADVISE? */
+	error = fget(td, uap->fd, 0, &fp);
+	if (error != 0)
+		goto out;
+	
+	switch (fp->f_type) {
+	case DTYPE_VNODE:
+		break;
+	case DTYPE_PIPE:
+	case DTYPE_FIFO:
+		error = ESPIPE;
+		goto out;
+	default:
+		error = ENODEV;
+		goto out;
+	}
+	vp = fp->f_vnode;
+	if (vp->v_type != VREG) {
+		error = ENODEV;
+		goto out;
+	}
+	if (uap->len == 0)
+		end = OFF_MAX;
+	else
+		end = uap->offset + uap->len - 1;
+	switch (uap->advice) {
+	case POSIX_FADV_SEQUENTIAL:
+	case POSIX_FADV_RANDOM:
+	case POSIX_FADV_NOREUSE:
+		/*
+		 * Try to merge any existing non-standard region with
+		 * this new region if possible, otherwise create a new
+		 * non-standard region for this request.
+		 */
+		mtx_pool_lock(mtxpool_sleep, fp);
+		fa = fp->f_advice;
+		if (fa != NULL && fa->fa_advice == uap->advice &&
+		    ((fa->fa_start <= end && fa->fa_end >= uap->offset) ||
+		    (end != OFF_MAX && fa->fa_start == end + 1) ||
+		    (fa->fa_end != OFF_MAX && fa->fa_end + 1 == uap->offset))) {
+			if (uap->offset < fa->fa_start)
+				fa->fa_start = uap->offset;
+			if (end > fa->fa_end)
+				fa->fa_end = end;
+		} else {
+			new->fa_advice = uap->advice;
+			new->fa_start = uap->offset;
+			new->fa_end = end;
+			fp->f_advice = new;
+			new = fa;
+		}
+		mtx_pool_unlock(mtxpool_sleep, fp);
+		break;
+	case POSIX_FADV_NORMAL:
+		/*
+		 * If a the "normal" region overlaps with an existing
+		 * non-standard region, trim or remove the
+		 * non-standard region.
+		 */
+		mtx_pool_lock(mtxpool_sleep, fp);
+		fa = fp->f_advice;
+		if (fa != NULL) {
+			if (uap->offset <= fa->fa_start &&
+			    end >= fa->fa_end) {
+				new = fa;
+				fp->f_advice = NULL;
+			} else if (uap->offset <= fa->fa_start &&
+			    end >= fa->fa_start)
+				fa->fa_start = end + 1;
+			else if (uap->offset <= fa->fa_end &&
+			    end >= fa->fa_end)
+				fa->fa_end = uap->offset - 1;
+			else if (uap->offset >= fa->fa_start &&
+			    end <= fa->fa_end) {
+				/*
+				 * If the "normal" region is a middle
+				 * portion of the existing
+				 * non-standard region, just remove
+				 * the whole thing rather than picking
+				 * one side or the other to
+				 * preserve.
+				 */
+				new = fa;
+				fp->f_advice = NULL;
+			}
+		}
+		mtx_pool_unlock(mtxpool_sleep, fp);
+		break;
+	case POSIX_FADV_WILLNEED:
+	case POSIX_FADV_DONTNEED:
+		error = VOP_ADVISE(vp, uap->offset, end, uap->advice);
+		break;
+	}
+out:
+	if (fp != NULL)
+		fdrop(fp, td);
+	free(new, M_FADVISE);
+	return (error);
+}

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/kern/vfs_vnops.c	Fri Nov  4 04:02:50 2011	(r227070)
@@ -518,7 +518,7 @@ vn_read(fp, uio, active_cred, flags, td)
 	struct vnode *vp;
 	int error, ioflag;
 	struct mtx *mtxp;
-	int vfslocked;
+	int advice, vfslocked;
 
 	KASSERT(uio->uio_td == td, ("uio_td %p is not td %p",
 	    uio->uio_td, td));
@@ -529,27 +529,48 @@ vn_read(fp, uio, active_cred, flags, td)
 		ioflag |= IO_NDELAY;
 	if (fp->f_flag & O_DIRECT)
 		ioflag |= IO_DIRECT;
+	advice = POSIX_FADV_NORMAL;
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
 	/*
 	 * According to McKusick the vn lock was protecting f_offset here.
 	 * It is now protected by the FOFFSET_LOCKED flag.
 	 */
-	if ((flags & FOF_OFFSET) == 0) {
+	if ((flags & FOF_OFFSET) == 0 || fp->f_advice != NULL) {
 		mtxp = mtx_pool_find(mtxpool_sleep, fp);
 		mtx_lock(mtxp);
-		while(fp->f_vnread_flags & FOFFSET_LOCKED) {
-			fp->f_vnread_flags |= FOFFSET_LOCK_WAITING;
-			msleep(&fp->f_vnread_flags, mtxp, PUSER -1,
-			    "vnread offlock", 0);
+		if ((flags & FOF_OFFSET) == 0) {
+			while (fp->f_vnread_flags & FOFFSET_LOCKED) {
+				fp->f_vnread_flags |= FOFFSET_LOCK_WAITING;
+				msleep(&fp->f_vnread_flags, mtxp, PUSER -1,
+				    "vnread offlock", 0);
+			}
+			fp->f_vnread_flags |= FOFFSET_LOCKED;
+			uio->uio_offset = fp->f_offset;
 		}
-		fp->f_vnread_flags |= FOFFSET_LOCKED;
+		if (fp->f_advice != NULL &&
+		    uio->uio_offset >= fp->f_advice->fa_start &&
+		    uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end)
+			advice = fp->f_advice->fa_advice;
 		mtx_unlock(mtxp);
-		vn_lock(vp, LK_SHARED | LK_RETRY);
-		uio->uio_offset = fp->f_offset;
-	} else
-		vn_lock(vp, LK_SHARED | LK_RETRY);
+	}
+	vn_lock(vp, LK_SHARED | LK_RETRY);
 
-	ioflag |= sequential_heuristic(uio, fp);
+	switch (advice) {
+	case POSIX_FADV_NORMAL:
+	case POSIX_FADV_SEQUENTIAL:
+		ioflag |= sequential_heuristic(uio, fp);
+		break;
+	case POSIX_FADV_RANDOM:
+		/* Disable read-ahead for random I/O. */
+		break;
+	case POSIX_FADV_NOREUSE:
+		/*
+		 * Request the underlying FS to discard the buffers
+		 * and pages after the I/O is complete.
+		 */
+		ioflag |= IO_DIRECT;
+		break;
+	}
 
 #ifdef MAC
 	error = mac_vnode_check_read(active_cred, fp->f_cred, vp);
@@ -584,7 +605,8 @@ vn_write(fp, uio, active_cred, flags, td
 	struct vnode *vp;
 	struct mount *mp;
 	int error, ioflag, lock_flags;
-	int vfslocked;
+	struct mtx *mtxp;
+	int advice, vfslocked;
 
 	KASSERT(uio->uio_td == td, ("uio_td %p is not td %p",
 	    uio->uio_td, td));
@@ -618,7 +640,33 @@ vn_write(fp, uio, active_cred, flags, td
 	vn_lock(vp, lock_flags | LK_RETRY);
 	if ((flags & FOF_OFFSET) == 0)
 		uio->uio_offset = fp->f_offset;
-	ioflag |= sequential_heuristic(uio, fp);
+	advice = POSIX_FADV_NORMAL;
+	if (fp->f_advice != NULL) {
+		mtxp = mtx_pool_find(mtxpool_sleep, fp);
+		mtx_lock(mtxp);
+		if (fp->f_advice != NULL &&
+		    uio->uio_offset >= fp->f_advice->fa_start &&
+		    uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end)
+			advice = fp->f_advice->fa_advice;
+		mtx_unlock(mtxp);
+	}
+	switch (advice) {
+	case POSIX_FADV_NORMAL:
+	case POSIX_FADV_SEQUENTIAL:
+		ioflag |= sequential_heuristic(uio, fp);
+		break;
+	case POSIX_FADV_RANDOM:
+		/* XXX: Is this correct? */
+		break;
+	case POSIX_FADV_NOREUSE:
+		/*
+		 * Request the underlying FS to discard the buffers
+		 * and pages after the I/O is complete.
+		 */
+		ioflag |= IO_DIRECT;
+		break;
+	}
+
 #ifdef MAC
 	error = mac_vnode_check_write(active_cred, fp->f_cred, vp);
 	if (error == 0)

Modified: head/sys/kern/vnode_if.src
==============================================================================
--- head/sys/kern/vnode_if.src	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/kern/vnode_if.src	Fri Nov  4 04:02:50 2011	(r227070)
@@ -628,3 +628,12 @@ vop_allocate {
 	INOUT off_t *offset;
 	INOUT off_t *len;
 };
+
+%% advise	vp	U U U
+
+vop_advise {
+	IN struct vnode *vp;
+	IN off_t start;
+	IN off_t end;
+	IN int advice;
+};

Modified: head/sys/sys/fcntl.h
==============================================================================
--- head/sys/sys/fcntl.h	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/sys/fcntl.h	Fri Nov  4 04:02:50 2011	(r227070)
@@ -277,9 +277,17 @@ struct oflock {
 #define	LOCK_UN		0x08		/* unlock file */
 #endif
 
+#if __POSIX_VISIBLE >= 200112
 /*
- * XXX missing posix_fadvise() and POSIX_FADV_* macros.
+ * Advice to posix_fadvise
  */
+#define	POSIX_FADV_NORMAL	0	/* no special treatment */
+#define	POSIX_FADV_RANDOM	1	/* expect random page references */
+#define	POSIX_FADV_SEQUENTIAL	2	/* expect sequential page references */
+#define	POSIX_FADV_WILLNEED	3	/* will need these pages */
+#define	POSIX_FADV_DONTNEED	4	/* dont need these pages */
+#define	POSIX_FADV_NOREUSE	5	/* access data only once */
+#endif
 
 #ifndef _KERNEL
 __BEGIN_DECLS
@@ -293,6 +301,7 @@ int	flock(int, int);
 int	openat(int, const char *, int, ...);
 #endif
 #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
+int	posix_fadvise(int, off_t, off_t, int);
 int	posix_fallocate(int, off_t, off_t);
 #endif
 __END_DECLS

Modified: head/sys/sys/file.h
==============================================================================
--- head/sys/sys/file.h	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/sys/file.h	Fri Nov  4 04:02:50 2011	(r227070)
@@ -122,6 +122,12 @@ struct fileops {
  * none	not locked
  */
 
+struct fadvise_info {
+	int		fa_advice;	/* (f) FADV_* type. */
+	off_t		fa_start;	/* (f) Region start. */
+	off_t		fa_end;		/* (f) Region end. */
+};
+
 struct file {
 	void		*f_data;	/* file descriptor specific data */
 	struct fileops	*f_ops;		/* File operations */
@@ -136,7 +142,11 @@ struct file {
 	 */
 	int		f_seqcount;	/* Count of sequential accesses. */
 	off_t		f_nextoff;	/* next expected read/write offset. */
-	struct cdev_privdata *f_cdevpriv; /* (d) Private data for the cdev. */
+	union {
+		struct cdev_privdata *fvn_cdevpriv;
+					/* (d) Private data for the cdev. */
+		struct fadvise_info *fvn_advice;
+	} f_vnun;
 	/*
 	 *  DFLAG_SEEKABLE specific fields
 	 */
@@ -147,6 +157,9 @@ struct file {
 	void		*f_label;	/* Place-holder for MAC label. */
 };
 
+#define	f_cdevpriv	f_vnun.fvn_cdevpriv
+#define	f_advice	f_vnun.fvn_advice
+
 #define	FOFFSET_LOCKED       0x1
 #define	FOFFSET_LOCK_WAITING 0x2		 
 

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/sys/param.h	Fri Nov  4 04:02:50 2011	(r227070)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1000000	/* Master, propagated to newvers */
+#define __FreeBSD_version 1000001	/* Master, propagated to newvers */
 
 #ifdef _KERNEL
 #define	P_OSREL_SIGWAIT		700000

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/sys/vnode.h	Fri Nov  4 04:02:50 2011	(r227070)
@@ -384,6 +384,7 @@ extern int		vttoif_tab[];
 #define	V_SAVE		0x0001	/* vinvalbuf: sync file first */
 #define	V_ALT		0x0002	/* vinvalbuf: invalidate only alternate bufs */
 #define	V_NORMAL	0x0004	/* vinvalbuf: invalidate only regular bufs */
+#define	V_CLEANONLY	0x0008	/* vinvalbuf: invalidate only clean bufs */
 #define	REVOKEALL	0x0001	/* vop_revoke: revoke all aliases */
 #define	V_WAIT		0x0001	/* vn_start_write: sleep for suspend */
 #define	V_NOWAIT	0x0002	/* vn_start_write: don't sleep for suspend */
@@ -685,6 +686,7 @@ int	vop_stdunlock(struct vop_unlock_args
 int	vop_nopoll(struct vop_poll_args *);
 int	vop_stdaccess(struct vop_access_args *ap);
 int	vop_stdaccessx(struct vop_accessx_args *ap);
+int	vop_stdadvise(struct vop_advise_args *ap);
 int	vop_stdadvlock(struct vop_advlock_args *ap);
 int	vop_stdadvlockasync(struct vop_advlockasync_args *ap);
 int	vop_stdadvlockpurge(struct vop_advlockpurge_args *ap);

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/vm/vm_object.c	Fri Nov  4 04:02:50 2011	(r227070)
@@ -1863,6 +1863,60 @@ skipmemq:
 }
 
 /*
+ *	vm_object_page_cache:
+ *
+ *	For the given object, attempt to move the specified clean
+ *	pages to the cache queue.  If a page is wired for any reason,
+ *	then it will not be changed.  Pages are specified by the given
+ *	range ["start", "end").  As a special case, if "end" is zero,
+ *	then the range extends from "start" to the end of the object.
+ *	Any mappings to the specified pages are removed before the
+ *	pages are moved to the cache queue.
+ *
+ *	This operation should only be performed on objects that
+ *	contain managed pages.
+ *
+ *	The object must be locked.
+ */
+void
+vm_object_page_cache(vm_object_t object, vm_pindex_t start, vm_pindex_t end)
+{
+	struct mtx *mtx, *new_mtx;
+	vm_page_t p, next;
+
+	VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
+	KASSERT((object->type != OBJT_DEVICE && object->type != OBJT_SG &&
+	    object->type != OBJT_PHYS),
+	    ("vm_object_page_cache: illegal object %p", object));
+	if (object->resident_page_count == 0)
+		return;
+	p = vm_page_find_least(object, start);
+
+	/*
+	 * Here, the variable "p" is either (1) the page with the least pindex
+	 * greater than or equal to the parameter "start" or (2) NULL. 
+	 */
+	mtx = NULL;
+	for (; p != NULL && (p->pindex < end || end == 0); p = next) {
+		next = TAILQ_NEXT(p, listq);
+
+		/*
+		 * Avoid releasing and reacquiring the same page lock.
+		 */
+		new_mtx = vm_page_lockptr(p);
+		if (mtx != new_mtx) {
+			if (mtx != NULL)
+				mtx_unlock(mtx);
+			mtx = new_mtx;
+			mtx_lock(mtx);
+		}
+		vm_page_try_to_cache(p);
+	}
+	if (mtx != NULL)
+		mtx_unlock(mtx);
+}
+
+/*
  *	Populate the specified range of the object with valid pages.  Returns
  *	TRUE if the range is successfully populated and FALSE otherwise.
  *

Modified: head/sys/vm/vm_object.h
==============================================================================
--- head/sys/vm/vm_object.h	Fri Nov  4 03:39:31 2011	(r227069)
+++ head/sys/vm/vm_object.h	Fri Nov  4 04:02:50 2011	(r227070)
@@ -223,6 +223,8 @@ void vm_object_destroy (vm_object_t);
 void vm_object_terminate (vm_object_t);
 void vm_object_set_writeable_dirty (vm_object_t);
 void vm_object_init (void);
+void vm_object_page_cache(vm_object_t object, vm_pindex_t start,
+    vm_pindex_t end);
 void vm_object_page_clean(vm_object_t object, vm_ooffset_t start,
     vm_ooffset_t end, int flags);
 void vm_object_page_remove(vm_object_t object, vm_pindex_t start,

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 04:06:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11F97106566B;
	Fri,  4 Nov 2011 04:06:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 007708FC15;
	Fri,  4 Nov 2011 04:06:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA446VmX000491;
	Fri, 4 Nov 2011 04:06:31 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA446V7F000479;
	Fri, 4 Nov 2011 04:06:31 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201111040406.pA446V7F000479@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 4 Nov 2011 04:06:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227071 - in head/sys: compat/freebsd32 kern sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 04:06:32 -0000

Author: jhb
Date: Fri Nov  4 04:06:31 2011
New Revision: 227071
URL: http://svn.freebsd.org/changeset/base/227071

Log:
  Regen.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_proto.h	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/compat/freebsd32/freebsd32_proto.h	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -580,6 +580,14 @@ struct freebsd32_posix_fallocate_args {
 	char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)];
 	char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)];
 };
+struct freebsd32_posix_fadvise_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)];
+	char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)];
+	char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)];
+	char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)];
+	char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)];
+};
 #if !defined(PAD64_REQUIRED) && defined(__powerpc__)
 #define PAD64_REQUIRED
 #endif
@@ -690,6 +698,7 @@ int	freebsd32_msgctl(struct thread *, st
 int	freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *);
 int	freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *);
 int	freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *);
+int	freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *);
 
 #ifdef COMPAT_43
 
@@ -1065,6 +1074,7 @@ int	freebsd7_freebsd32_shmctl(struct thr
 #define	FREEBSD32_SYS_AUE_freebsd32_shmctl	AUE_SHMCTL
 #define	FREEBSD32_SYS_AUE_freebsd32_pselect	AUE_SELECT
 #define	FREEBSD32_SYS_AUE_freebsd32_posix_fallocate	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_posix_fadvise	AUE_NULL
 
 #undef PAD_
 #undef PADL_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscall.h	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -424,4 +424,5 @@
 #define	FREEBSD32_SYS_rctl_add_rule	528
 #define	FREEBSD32_SYS_rctl_remove_rule	529
 #define	FREEBSD32_SYS_freebsd32_posix_fallocate	530
+#define	FREEBSD32_SYS_freebsd32_posix_fadvise	531
 #define	FREEBSD32_SYS_MAXSYSCALL	532

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscalls.c	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -554,5 +554,5 @@ const char *freebsd32_syscallnames[] = {
 	"rctl_add_rule",			/* 528 = rctl_add_rule */
 	"rctl_remove_rule",			/* 529 = rctl_remove_rule */
 	"freebsd32_posix_fallocate",			/* 530 = freebsd32_posix_fallocate */
-	"#531",			/* 531 = posix_fadvise */
+	"freebsd32_posix_fadvise",			/* 531 = freebsd32_posix_fadvise */
 };

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_sysent.c	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/compat/freebsd32/freebsd32_sysent.c	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #include "opt_compat.h"
@@ -591,5 +591,5 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 528 = rctl_add_rule */
 	{ AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 529 = rctl_remove_rule */
 	{ AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 530 = freebsd32_posix_fallocate */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 531 = posix_fadvise */
+	{ AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 531 = freebsd32_posix_fadvise */
 };

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3034,6 +3034,18 @@ systrace_args(int sysnum, void *params, 
 		*n_args = 5;
 		break;
 	}
+	/* freebsd32_posix_fadvise */
+	case 531: {
+		struct freebsd32_posix_fadvise_args *p = params;
+		iarg[0] = p->fd; /* int */
+		uarg[1] = p->offset1; /* uint32_t */
+		uarg[2] = p->offset2; /* uint32_t */
+		uarg[3] = p->len1; /* uint32_t */
+		uarg[4] = p->len2; /* uint32_t */
+		iarg[5] = p->advice; /* int */
+		*n_args = 6;
+		break;
+	}
 	default:
 		*n_args = 0;
 		break;
@@ -8093,6 +8105,31 @@ systrace_setargdesc(int sysnum, int ndx,
 			break;
 		};
 		break;
+	/* freebsd32_posix_fadvise */
+	case 531:
+		switch(ndx) {
+		case 0:
+			p = "int";
+			break;
+		case 1:
+			p = "uint32_t";
+			break;
+		case 2:
+			p = "uint32_t";
+			break;
+		case 3:
+			p = "uint32_t";
+			break;
+		case 4:
+			p = "uint32_t";
+			break;
+		case 5:
+			p = "int";
+			break;
+		default:
+			break;
+		};
+		break;
 	default:
 		break;
 	};

Modified: head/sys/kern/init_sysent.c
==============================================================================
--- head/sys/kern/init_sysent.c	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/kern/init_sysent.c	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #include "opt_compat.h"
@@ -565,5 +565,5 @@ struct sysent sysent[] = {
 	{ AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 528 = rctl_add_rule */
 	{ AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 529 = rctl_remove_rule */
 	{ AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 530 = posix_fallocate */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 531 = posix_fadvise */
+	{ AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 531 = posix_fadvise */
 };

Modified: head/sys/kern/syscalls.c
==============================================================================
--- head/sys/kern/syscalls.c	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/kern/syscalls.c	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 const char *syscallnames[] = {
@@ -538,5 +538,5 @@ const char *syscallnames[] = {
 	"rctl_add_rule",			/* 528 = rctl_add_rule */
 	"rctl_remove_rule",			/* 529 = rctl_remove_rule */
 	"posix_fallocate",			/* 530 = posix_fallocate */
-	"#531",			/* 531 = posix_fadvise */
+	"posix_fadvise",			/* 531 = posix_fadvise */
 };

Modified: head/sys/kern/systrace_args.c
==============================================================================
--- head/sys/kern/systrace_args.c	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/kern/systrace_args.c	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3234,6 +3234,16 @@ systrace_args(int sysnum, void *params, 
 		*n_args = 3;
 		break;
 	}
+	/* posix_fadvise */
+	case 531: {
+		struct posix_fadvise_args *p = params;
+		iarg[0] = p->fd; /* int */
+		iarg[1] = p->offset; /* off_t */
+		iarg[2] = p->len; /* off_t */
+		iarg[3] = p->advice; /* int */
+		*n_args = 4;
+		break;
+	}
 	default:
 		*n_args = 0;
 		break;
@@ -8603,6 +8613,25 @@ systrace_setargdesc(int sysnum, int ndx,
 			break;
 		};
 		break;
+	/* posix_fadvise */
+	case 531:
+		switch(ndx) {
+		case 0:
+			p = "int";
+			break;
+		case 1:
+			p = "off_t";
+			break;
+		case 2:
+			p = "off_t";
+			break;
+		case 3:
+			p = "int";
+			break;
+		default:
+			break;
+		};
+		break;
 	default:
 		break;
 	};

Modified: head/sys/sys/syscall.h
==============================================================================
--- head/sys/sys/syscall.h	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/sys/syscall.h	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #define	SYS_syscall	0
@@ -446,4 +446,5 @@
 #define	SYS_rctl_add_rule	528
 #define	SYS_rctl_remove_rule	529
 #define	SYS_posix_fallocate	530
+#define	SYS_posix_fadvise	531
 #define	SYS_MAXSYSCALL	532

Modified: head/sys/sys/syscall.mk
==============================================================================
--- head/sys/sys/syscall.mk	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/sys/syscall.mk	Fri Nov  4 04:06:31 2011	(r227071)
@@ -1,7 +1,7 @@
 # FreeBSD system call names.
 # DO NOT EDIT-- this file is automatically generated.
 # $FreeBSD$
-# created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+# created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
 MIASM =  \
 	syscall.o \
 	exit.o \
@@ -394,4 +394,5 @@ MIASM =  \
 	rctl_get_limits.o \
 	rctl_add_rule.o \
 	rctl_remove_rule.o \
-	posix_fallocate.o
+	posix_fallocate.o \
+	posix_fadvise.o

Modified: head/sys/sys/sysproto.h
==============================================================================
--- head/sys/sys/sysproto.h	Fri Nov  4 04:02:50 2011	(r227070)
+++ head/sys/sys/sysproto.h	Fri Nov  4 04:06:31 2011	(r227071)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #ifndef _SYS_SYSPROTO_H_
@@ -1733,6 +1733,12 @@ struct posix_fallocate_args {
 	char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
 	char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)];
 };
+struct posix_fadvise_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
+	char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)];
+	char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)];
+};
 int	nosys(struct thread *, struct nosys_args *);
 void	sys_sys_exit(struct thread *, struct sys_exit_args *);
 int	sys_fork(struct thread *, struct fork_args *);
@@ -2109,6 +2115,7 @@ int	sys_rctl_get_limits(struct thread *,
 int	sys_rctl_add_rule(struct thread *, struct rctl_add_rule_args *);
 int	sys_rctl_remove_rule(struct thread *, struct rctl_remove_rule_args *);
 int	sys_posix_fallocate(struct thread *, struct posix_fallocate_args *);
+int	sys_posix_fadvise(struct thread *, struct posix_fadvise_args *);
 
 #ifdef COMPAT_43
 
@@ -2799,6 +2806,7 @@ int	freebsd7_shmctl(struct thread *, str
 #define	SYS_AUE_rctl_add_rule	AUE_NULL
 #define	SYS_AUE_rctl_remove_rule	AUE_NULL
 #define	SYS_AUE_posix_fallocate	AUE_NULL
+#define	SYS_AUE_posix_fadvise	AUE_NULL
 
 #undef PAD_
 #undef PADL_

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 04:41:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB076106566C;
	Fri,  4 Nov 2011 04:41:58 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CB71B8FC08;
	Fri,  4 Nov 2011 04:41:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA44fwtX001671;
	Fri, 4 Nov 2011 04:41:58 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA44fwGc001669;
	Fri, 4 Nov 2011 04:41:58 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201111040441.pA44fwGc001669@svn.freebsd.org>
From: Alan Cox 
Date: Fri, 4 Nov 2011 04:41:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227072 - head/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 04:41:59 -0000

Author: alc
Date: Fri Nov  4 04:41:58 2011
New Revision: 227072
URL: http://svn.freebsd.org/changeset/base/227072

Log:
  Simplify the implementation of the failure case in kmem_alloc_attr().

Modified:
  head/sys/vm/vm_contig.c

Modified: head/sys/vm/vm_contig.c
==============================================================================
--- head/sys/vm/vm_contig.c	Fri Nov  4 04:06:31 2011	(r227071)
+++ head/sys/vm/vm_contig.c	Fri Nov  4 04:41:58 2011	(r227072)
@@ -258,8 +258,8 @@ kmem_alloc_attr(vm_map_t map, vm_size_t 
 retry:
 		m = vm_phys_alloc_contig(1, low, high, PAGE_SIZE, 0);
 		if (m == NULL) {
+			VM_OBJECT_UNLOCK(object);
 			if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) {
-				VM_OBJECT_UNLOCK(object);
 				vm_map_unlock(map);
 				vm_contig_grow_cache(tries, low, high);
 				vm_map_lock(map);
@@ -267,13 +267,12 @@ retry:
 				tries++;
 				goto retry;
 			}
-			while (i != 0) {
-				i -= PAGE_SIZE;
-				m = vm_page_lookup(object, OFF_TO_IDX(offset +
-				    i));
-				vm_page_free(m);
-			}
-			VM_OBJECT_UNLOCK(object);
+			/*
+			 * Since the pages that were allocated by any previous
+			 * iterations of this loop are not busy, they can be
+			 * freed by vm_object_page_remove(), which is called
+			 * by vm_map_delete().
+			 */
 			vm_map_delete(map, addr, addr + size);
 			vm_map_unlock(map);
 			return (0);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 06:14:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E5F2106564A;
	Fri,  4 Nov 2011 06:14:19 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5DAC08FC14;
	Fri,  4 Nov 2011 06:14:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA46EJnD004481;
	Fri, 4 Nov 2011 06:14:19 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA46EJTO004479;
	Fri, 4 Nov 2011 06:14:19 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201111040614.pA46EJTO004479@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Fri, 4 Nov 2011 06:14:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227073 - stable/9/sys/geom/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 06:14:19 -0000

Author: ae
Date: Fri Nov  4 06:14:18 2011
New Revision: 227073
URL: http://svn.freebsd.org/changeset/base/227073

Log:
  MFC r226880:
    Our geom withering function could take some time before geom with its
    providers and consumers will be destroyed.  Before take some actions
    with a geom, check that it is not destroyed at the moment.
  
    Tested by:	nwhitehorn
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/geom/part/g_part.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/geom/part/g_part.c
==============================================================================
--- stable/9/sys/geom/part/g_part.c	Fri Nov  4 04:41:58 2011	(r227072)
+++ stable/9/sys/geom/part/g_part.c	Fri Nov  4 06:14:18 2011	(r227073)
@@ -451,6 +451,10 @@ g_part_parm_geom(struct gctl_req *req, c
 		gctl_error(req, "%d %s '%s'", EINVAL, name, gname);
 		return (EINVAL);
 	}
+	if ((gp->flags & G_GEOM_WITHER) != 0) {
+		gctl_error(req, "%d %s", ENXIO, gname);
+		return (ENXIO);
+	}
 	*v = gp;
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 07:50:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ABCBF106566B;
	Fri,  4 Nov 2011 07:50:28 +0000 (UTC)
	(envelope-from villa.alberto@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id D44748FC13;
	Fri,  4 Nov 2011 07:50:27 +0000 (UTC)
Received: by wyg36 with SMTP id 36so2768603wyg.13
	for ; Fri, 04 Nov 2011 00:50:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=sender:from:organization:to:subject:date:user-agent:cc:references
	:in-reply-to:mime-version:content-type:content-transfer-encoding
	:message-id; bh=/LeCppGW+80YnxdwgVwchqcB5g/Ir5yKJAs3wpIGgaI=;
	b=TTW+pp0/stoUOUW9c8asdakA0Bi1Up+zLfBAb+mDMaCvf9hwkgofhyf3PvDPxIVdqt
	x6frrhFkFjKDGd6b14TAO4fxlq5A0jTGpUdxERPif+Bnh4EjhflBsWsWw5L9YlXvT7VN
	fc8SwNcyOVyU391tOXcGcUx3/PqzFel//EJBU=
Received: by 10.227.59.207 with SMTP id m15mr16515241wbh.12.1320391435120;
	Fri, 04 Nov 2011 00:23:55 -0700 (PDT)
Received: from woodstock.peanuts (wifinat-16.polito.it. [130.192.232.16])
	by mx.google.com with ESMTPS id fr4sm14470220wbb.0.2011.11.04.00.23.54
	(version=SSLv3 cipher=OTHER); Fri, 04 Nov 2011 00:23:54 -0700 (PDT)
Sender: Alberto Villa 
From: Alberto Villa 
Organization: The FreeBSD Project
To: svn-src-head@freebsd.org
Date: Fri, 4 Nov 2011 08:23:47 +0100
User-Agent: KMail/1.13.7 (FreeBSD/9.0-RC1; KDE/4.7.2; amd64; ; )
References: <201111040402.pA442oYZ000317@svn.freebsd.org>
In-Reply-To: <201111040402.pA442oYZ000317@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart2910288.EjliSkT16r";
	protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201111040823.52084.avilla@freebsd.org>
Cc: svn-src-all@freebsd.org, src-committers@freebsd.org,
	John Baldwin 
Subject: Re: svn commit: r227070 - in head: lib/libc/sys
	sys/compat/freebsd32 sys/kern sys/sys sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 07:50:28 -0000

--nextPart2910288.EjliSkT16r
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On Friday 04 November 2011 05:02:50 John Baldwin wrote:
> Author: jhb
> Date: Fri Nov  4 04:02:50 2011
> New Revision: 227070
> URL: http://svn.freebsd.org/changeset/base/227070
>=20
> Log:
>   Add the posix_fadvise(2) system call.

Shouldn't you define _POSIX_ADVISORY_INFO to 200112L in=20
sys/sys/unistd.h?
=2D-=20
Alberto Villa, FreeBSD committer 
http://people.FreeBSD.org/~avilla

Without adventure, civilization is in full decay.
		-- Alfred North Whitehead

--nextPart2910288.EjliSkT16r
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iJwEAAECAAYFAk6zkwcACgkQ3xiC6kQ1CovzDAP+JjyKsiSDlrq99oGdwdmkklno
+Cy+JxVFzK7CZL83HiQT3ccuMl6dn9M9DikoeH6ubvkBMcaN3kyjK+GAazJAc3pe
n+WFB8EMujslpwbNiJ5H+hYarsRePbBUvu5epPVu02L+TwpOQHHvLNEpwpaAC2cE
TCgPal1HGMYhxa3Hqv0=
=9bxn
-----END PGP SIGNATURE-----

--nextPart2910288.EjliSkT16r--

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 09:19:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1295F1065673;
	Fri,  4 Nov 2011 09:19:19 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 026EB8FC13;
	Fri,  4 Nov 2011 09:19:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA49JIBi010242;
	Fri, 4 Nov 2011 09:19:18 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA49JIIu010240;
	Fri, 4 Nov 2011 09:19:18 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201111040919.pA49JIIu010240@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 4 Nov 2011 09:19:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227075 - head/sys/dev/usb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 09:19:19 -0000

Author: hselasky
Date: Fri Nov  4 09:19:18 2011
New Revision: 227075
URL: http://svn.freebsd.org/changeset/base/227075

Log:
  Fix for panic at USB controller attach failure during cold boot.
  
  Reported by:	Jan Henrik Sylvester, Xin LI and more.
  MFC after:	3 days

Modified:
  head/sys/dev/usb/usb_process.c

Modified: head/sys/dev/usb/usb_process.c
==============================================================================
--- head/sys/dev/usb/usb_process.c	Fri Nov  4 06:56:59 2011	(r227074)
+++ head/sys/dev/usb/usb_process.c	Fri Nov  4 09:19:18 2011	(r227075)
@@ -67,11 +67,13 @@ static int usb_pcount;
 #define	USB_THREAD_CREATE(f, s, p, ...) \
 		kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \
 		    0, "usb", __VA_ARGS__)
+#define	USB_THREAD_SUSPEND_CHECK() kthread_suspend_check()
 #define	USB_THREAD_SUSPEND(p)   kthread_suspend(p,0)
 #define	USB_THREAD_EXIT(err)	kthread_exit()
 #else
 #define	USB_THREAD_CREATE(f, s, p, ...) \
 		kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__)
+#define	USB_THREAD_SUSPEND_CHECK() kthread_suspend_check()
 #define	USB_THREAD_SUSPEND(p)   kthread_suspend(p,0)
 #define	USB_THREAD_EXIT(err)	kthread_exit(err)
 #endif
@@ -98,6 +100,9 @@ usb_process(void *arg)
 	struct usb_proc_msg *pm;
 	struct thread *td;
 
+	/* in case of attach error, check for suspended */
+	USB_THREAD_SUSPEND_CHECK();
+
 	/* adjust priority */
 	td = curthread;
 	thread_lock(td);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 11:14:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A42601065672;
	Fri,  4 Nov 2011 11:14:04 +0000 (UTC)
	(envelope-from ache@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 93B2F8FC0C;
	Fri,  4 Nov 2011 11:14:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4BE4On015789;
	Fri, 4 Nov 2011 11:14:04 GMT (envelope-from ache@svn.freebsd.org)
Received: (from ache@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4BE4Iv015787;
	Fri, 4 Nov 2011 11:14:04 GMT (envelope-from ache@svn.freebsd.org)
Message-Id: <201111041114.pA4BE4Iv015787@svn.freebsd.org>
From: "Andrey A. Chernov" 
Date: Fri, 4 Nov 2011 11:14:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227076 - stable/9/usr.bin/sed
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 11:14:04 -0000

Author: ache
Date: Fri Nov  4 11:14:04 2011
New Revision: 227076
URL: http://svn.freebsd.org/changeset/base/227076

Log:
  MFC r226889,226895:
  
  "or" word in '}' description gives false impression that newline can be
  replaced by space. Reflect reality and POSIX.
  
  PR:             96236
  Submitted by:   dougb
  Approved by:    re (kib)

Modified:
  stable/9/usr.bin/sed/sed.1
Directory Properties:
  stable/9/usr.bin/sed/   (props changed)

Modified: stable/9/usr.bin/sed/sed.1
==============================================================================
--- stable/9/usr.bin/sed/sed.1	Fri Nov  4 09:19:18 2011	(r227075)
+++ stable/9/usr.bin/sed/sed.1	Fri Nov  4 11:14:04 2011	(r227076)
@@ -343,7 +343,7 @@ can be preceded by white space and can b
 The function can be preceded by white space.
 The terminating
 .Dq }
-must be preceded by a newline or optional white space.
+must be preceded by a newline, and may also be preceded by white space.
 .Pp
 .Bl -tag -width "XXXXXX" -compact
 .It [2addr] function-list

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 13:32:14 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 26CDC106564A;
	Fri,  4 Nov 2011 13:32:14 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1720B8FC15;
	Fri,  4 Nov 2011 13:32:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4DWDZB020100;
	Fri, 4 Nov 2011 13:32:13 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4DWDOG020098;
	Fri, 4 Nov 2011 13:32:13 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111041332.pA4DWDOG020098@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 4 Nov 2011 13:32:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227080 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 13:32:14 -0000

Author: adrian
Date: Fri Nov  4 13:32:13 2011
New Revision: 227080
URL: http://svn.freebsd.org/changeset/base/227080

Log:
  Call the correct chipset power routine when disabling the AR5416 and later NICs.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 13:31:03 2011	(r227079)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 13:32:13 2011	(r227080)
@@ -1178,7 +1178,7 @@ ar5416GetRfgain(struct ath_hal *ah)
 HAL_BOOL
 ar5416Disable(struct ath_hal *ah)
 {
-	if (!ar5212SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE))
+	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE))
 		return AH_FALSE;
 	if (! ar5416SetResetReg(ah, HAL_RESET_COLD))
 		return AH_FALSE;

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 13:36:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D386E106564A;
	Fri,  4 Nov 2011 13:36:02 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C0DB68FC12;
	Fri,  4 Nov 2011 13:36:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4Da24g020295;
	Fri, 4 Nov 2011 13:36:02 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4Da2M8020263;
	Fri, 4 Nov 2011 13:36:02 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201111041336.pA4Da2M8020263@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 4 Nov 2011 13:36: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: r227081 - in head/sbin: atm/atmconfig badsect
	camcontrol ccdconfig devfs dmesg dumpfs fdisk ffsinfo fsck
	fsck_msdosfs fsirand growfs init mount mount_cd9660
	mount_nullfs mount_udf natd ...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 13:36:02 -0000

Author: ed
Date: Fri Nov  4 13:36:02 2011
New Revision: 227081
URL: http://svn.freebsd.org/changeset/base/227081

Log:
  Add missing static keywords for global variables to tools in sbin/.
  
  These tools declare global variables without using the static keyword,
  even though their use is limited to a single C-file, or without placing
  an extern declaration of them in the proper header file.

Modified:
  head/sbin/atm/atmconfig/atmconfig_device.c
  head/sbin/atm/atmconfig/diag.c
  head/sbin/atm/atmconfig/main.c
  head/sbin/badsect/badsect.c
  head/sbin/camcontrol/camcontrol.c
  head/sbin/ccdconfig/ccdconfig.c
  head/sbin/devfs/rule.c
  head/sbin/dmesg/dmesg.c
  head/sbin/dumpfs/dumpfs.c
  head/sbin/fdisk/fdisk.c
  head/sbin/ffsinfo/ffsinfo.c
  head/sbin/fsck/fsck.c
  head/sbin/fsck/preen.c
  head/sbin/fsck_msdosfs/dir.c
  head/sbin/fsirand/fsirand.c
  head/sbin/growfs/growfs.c
  head/sbin/init/init.c
  head/sbin/mount/mount.c
  head/sbin/mount/mount_fs.c
  head/sbin/mount_cd9660/mount_cd9660.c
  head/sbin/mount_nullfs/mount_nullfs.c
  head/sbin/mount_udf/mount_udf.c
  head/sbin/natd/natd.c
  head/sbin/newfs/mkfs.c
  head/sbin/newfs/newfs.h
  head/sbin/rcorder/rcorder.c
  head/sbin/recoverdisk/recoverdisk.c
  head/sbin/shutdown/shutdown.c
  head/sbin/swapon/swapon.c
  head/sbin/tunefs/tunefs.c
  head/sbin/umount/umount.c

Modified: head/sbin/atm/atmconfig/atmconfig_device.c
==============================================================================
--- head/sbin/atm/atmconfig/atmconfig_device.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/atm/atmconfig/atmconfig_device.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -103,7 +103,7 @@ static struct atmhw_list atmhw_list;
 /*
  * Read ATM hardware table
  */
-const struct snmp_table atmhw_table = {
+static const struct snmp_table atmhw_table = {
 	OIDX_begemotAtmHWTable,
 	OIDX_begemotAtmIfTableLastChange, 2,
 	sizeof(struct atmhw),

Modified: head/sbin/atm/atmconfig/diag.c
==============================================================================
--- head/sbin/atm/atmconfig/diag.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/atm/atmconfig/diag.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -57,7 +57,7 @@ static void diag_phy_print(int, char *[]
 static void diag_phy_stats(int, char *[]);
 static void diag_stats(int, char *[]);
 
-const struct cmdtab diag_phy_tab[] = {
+static const struct cmdtab diag_phy_tab[] = {
 	{ "show",	NULL, 		diag_phy_show },
 	{ "set",	NULL, 		diag_phy_set },
 	{ "stats",	NULL,		diag_phy_stats },

Modified: head/sbin/atm/atmconfig/main.c
==============================================================================
--- head/sbin/atm/atmconfig/main.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/atm/atmconfig/main.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
 #include "private.h"
 
 /* verbosity level */
-int verbose;
+static int verbose;
 
 /* notitle option */
 static int notitle;

Modified: head/sbin/badsect/badsect.c
==============================================================================
--- head/sbin/badsect/badsect.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/badsect/badsect.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -71,9 +71,9 @@ __FBSDID("$FreeBSD$");
 
 #define sblock	disk.d_fs
 #define	acg	disk.d_cg
-struct	uufsd disk;
-struct	fs *fs = &sblock;
-int	errs;
+static struct	uufsd disk;
+static struct	fs *fs = &sblock;
+static int	errs;
 
 int	chkuse(daddr_t, int);
 

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/camcontrol/camcontrol.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -140,7 +140,7 @@ static const char smppc_opts[] = "a:A:d:
 static const char smpphylist_opts[] = "lq";
 #endif
 
-struct camcontrol_opts option_table[] = {
+static struct camcontrol_opts option_table[] = {
 #ifndef MINIMALISTIC
 	{"tur", CAM_CMD_TUR, CAM_ARG_NONE, NULL},
 	{"inquiry", CAM_CMD_INQUIRY, CAM_ARG_NONE, "DSR"},
@@ -207,8 +207,8 @@ struct cam_devlist {
 	path_id_t path_id;
 };
 
-cam_cmdmask cmdlist;
-cam_argmask arglist;
+static cam_cmdmask cmdlist;
+static cam_argmask arglist;
 
 camcontrol_optret getoption(struct camcontrol_opts *table, char *arg,
 			    uint32_t *cmdnum, cam_argmask *argnum,
@@ -4646,7 +4646,7 @@ bailout:
 	return (error);
 }
 
-struct camcontrol_opts phy_ops[] = {
+static struct camcontrol_opts phy_ops[] = {
 	{"nop", SMP_PC_PHY_OP_NOP, CAM_ARG_NONE, NULL},
 	{"linkreset", SMP_PC_PHY_OP_LINK_RESET, CAM_ARG_NONE, NULL},
 	{"hardreset", SMP_PC_PHY_OP_HARD_RESET, CAM_ARG_NONE, NULL},

Modified: head/sbin/ccdconfig/ccdconfig.c
==============================================================================
--- head/sbin/ccdconfig/ccdconfig.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/ccdconfig/ccdconfig.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -59,7 +59,7 @@ static	int lineno = 0;
 static	int verbose = 0;
 static	const char *ccdconf = _PATH_CCDCONF;
 
-struct	flagval {
+static struct flagval {
 	const char	*fv_flag;
 	int		fv_val;
 } flagvaltab[] = {

Modified: head/sbin/devfs/rule.c
==============================================================================
--- head/sbin/devfs/rule.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/devfs/rule.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -76,7 +76,7 @@ static struct intstr ist_type[] = {
 	{ NULL,			-1 }
 };
 
-devfs_rsnum in_rsnum;
+static devfs_rsnum in_rsnum;
 
 int
 rule_main(int ac, char **av)

Modified: head/sbin/dmesg/dmesg.c
==============================================================================
--- head/sbin/dmesg/dmesg.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/dmesg/dmesg.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -60,11 +60,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-char s_msgbufp[] = "_msgbufp";
-
-struct nlist nl[] = {
+static struct nlist nl[] = {
 #define	X_MSGBUF	0
-	{ s_msgbufp, 0, 0, 0, 0 },
+	{ "_msgbufp", 0, 0, 0, 0 },
 	{ NULL, 0, 0, 0, 0 },
 };
 

Modified: head/sbin/dumpfs/dumpfs.c
==============================================================================
--- head/sbin/dumpfs/dumpfs.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/dumpfs/dumpfs.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -77,7 +77,7 @@ static const char rcsid[] =
 #define	afs	disk.d_fs
 #define	acg	disk.d_cg
 
-struct uufsd disk;
+static struct uufsd disk;
 
 int	dumpfs(const char *);
 int	dumpfsid(void);

Modified: head/sbin/fdisk/fdisk.c
==============================================================================
--- head/sbin/fdisk/fdisk.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/fdisk/fdisk.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-int iotest;
+static int iotest;
 
 #define NO_DISK_SECTORS ((u_int32_t)-1)
 #define NO_TRACK_CYLINDERS 1023

Modified: head/sbin/ffsinfo/ffsinfo.c
==============================================================================
--- head/sbin/ffsinfo/ffsinfo.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/ffsinfo/ffsinfo.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -79,7 +79,7 @@ static const char rcsid[] =
 int	_dbg_lvl_ = (DL_INFO); /* DL_TRC */
 #endif /* FS_DEBUG */
 
-struct uufsd disk;
+static struct uufsd disk;
 
 #define sblock disk.d_fs
 #define acg    disk.d_cg

Modified: head/sbin/fsck/fsck.c
==============================================================================
--- head/sbin/fsck/fsck.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/fsck/fsck.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$");
 
 static enum { IN_LIST, NOT_IN_LIST } which = NOT_IN_LIST;
 
-TAILQ_HEAD(fstypelist, entry) opthead, selhead;
+static TAILQ_HEAD(fstypelist, entry) opthead, selhead;
 
 struct entry {
 	char *type;

Modified: head/sbin/fsck/preen.c
==============================================================================
--- head/sbin/fsck/preen.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/fsck/preen.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -62,7 +62,7 @@ struct partentry {
 	char		  	*p_type;	/* file system type */
 };
 
-TAILQ_HEAD(part, partentry) badh;
+static TAILQ_HEAD(part, partentry) badh;
 
 struct diskentry {
 	TAILQ_ENTRY(diskentry) 	    d_entries;
@@ -71,7 +71,7 @@ struct diskentry {
 	int			    d_pid;	/* 0 or pid of fsck proc */
 };
 
-TAILQ_HEAD(disk, diskentry) diskh;
+static TAILQ_HEAD(disk, diskentry) diskh;
 
 static int nrun = 0, ndisks = 0;
 

Modified: head/sbin/fsck_msdosfs/dir.c
==============================================================================
--- head/sbin/fsck_msdosfs/dir.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/fsck_msdosfs/dir.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -153,7 +153,7 @@ freeDirTodo(struct dirTodoNode *dt)
 /*
  * The stack of unread directories
  */
-struct dirTodoNode *pendingDirectories = NULL;
+static struct dirTodoNode *pendingDirectories = NULL;
 
 /*
  * Return the full pathname for a directory entry.

Modified: head/sbin/fsirand/fsirand.c
==============================================================================
--- head/sbin/fsirand/fsirand.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/fsirand/fsirand.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -60,7 +60,7 @@ int fsirand(char *);
  */
 static int sblock_try[] = SBLOCKSEARCH;
 
-int printonly = 0, force = 0, ignorelabel = 0;
+static int printonly = 0, force = 0, ignorelabel = 0;
 
 int
 main(int argc, char *argv[])

Modified: head/sbin/growfs/growfs.c
==============================================================================
--- head/sbin/growfs/growfs.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/growfs/growfs.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -116,7 +116,7 @@ union dinode {
 	} while (0)
 static ufs2_daddr_t 	inoblk;			/* inode block address */
 static char		inobuf[MAXBSIZE];	/* inode block */
-ino_t			maxino;			/* last valid inode */
+static ino_t		maxino;			/* last valid inode */
 static int		unlabeled;     /* unlabeled partition, e.g. vinum volume etc. */
 
 /*

Modified: head/sbin/init/init.c
==============================================================================
--- head/sbin/init/init.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/init/init.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -126,14 +126,14 @@ static state_func_t death_single(void);
 
 static state_func_t run_script(const char *);
 
-enum { AUTOBOOT, FASTBOOT } runcom_mode = AUTOBOOT;
+static enum { AUTOBOOT, FASTBOOT } runcom_mode = AUTOBOOT;
 #define FALSE	0
 #define TRUE	1
 
-int Reboot = FALSE;
-int howto = RB_AUTOBOOT;
+static int Reboot = FALSE;
+static int howto = RB_AUTOBOOT;
 
-int devfs;
+static int devfs;
 
 static void transition(state_t);
 static state_t requested_transition;

Modified: head/sbin/mount/mount.c
==============================================================================
--- head/sbin/mount/mount.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/mount/mount.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
 #define MOUNT_META_OPTION_FSTAB		"fstab"
 #define MOUNT_META_OPTION_CURRENT	"current"
 
-int debug, fstab_style, verbose;
+static int debug, fstab_style, verbose;
 
 struct cpa {
 	char	**a;

Modified: head/sbin/mount/mount_fs.c
==============================================================================
--- head/sbin/mount/mount_fs.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/mount/mount_fs.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -58,7 +58,7 @@ static const char rcsid[] =
 #include "extern.h"
 #include "mntopts.h"
 
-struct mntopt mopts[] = {
+static struct mntopt mopts[] = {
 	MOPT_STDOPTS,
 	MOPT_END
 };

Modified: head/sbin/mount_cd9660/mount_cd9660.c
==============================================================================
--- head/sbin/mount_cd9660/mount_cd9660.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/mount_cd9660/mount_cd9660.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -68,7 +68,7 @@ static const char rcsid[] =
 
 #include "mntopts.h"
 
-struct mntopt mopts[] = {
+static struct mntopt mopts[] = {
 	MOPT_STDOPTS,
 	MOPT_UPDATE,
 	MOPT_END

Modified: head/sbin/mount_nullfs/mount_nullfs.c
==============================================================================
--- head/sbin/mount_nullfs/mount_nullfs.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/mount_nullfs/mount_nullfs.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -57,7 +57,7 @@ static const char rcsid[] =
 
 #include "mntopts.h"
 
-struct mntopt mopts[] = {
+static struct mntopt mopts[] = {
 	MOPT_STDOPTS,
 	MOPT_END
 };

Modified: head/sbin/mount_udf/mount_udf.c
==============================================================================
--- head/sbin/mount_udf/mount_udf.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/mount_udf/mount_udf.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -61,7 +61,7 @@
 
 #include "mntopts.h"
 
-struct mntopt mopts[] = {
+static struct mntopt mopts[] = {
 	MOPT_STDOPTS,
 	MOPT_UPDATE,
 	MOPT_END

Modified: head/sbin/natd/natd.c
==============================================================================
--- head/sbin/natd/natd.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/natd/natd.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -71,8 +71,8 @@ struct instance {
 static LIST_HEAD(, instance) root = LIST_HEAD_INITIALIZER(root);
 
 struct libalias *mla;
-struct instance *mip;
-int ninstance = 1;
+static struct instance *mip;
+static int ninstance = 1;
 
 /* 
  * Default values for input and output

Modified: head/sbin/newfs/mkfs.c
==============================================================================
--- head/sbin/newfs/mkfs.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/newfs/mkfs.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -804,7 +804,7 @@ initcg(int cylno, time_t utime)
  */
 #define ROOTLINKCNT 3
 
-struct direct root_dir[] = {
+static struct direct root_dir[] = {
 	{ ROOTINO, sizeof(struct direct), DT_DIR, 1, "." },
 	{ ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
 	{ ROOTINO + 1, sizeof(struct direct), DT_DIR, 5, ".snap" },
@@ -812,7 +812,7 @@ struct direct root_dir[] = {
 
 #define SNAPLINKCNT 2
 
-struct direct snap_dir[] = {
+static struct direct snap_dir[] = {
 	{ ROOTINO + 1, sizeof(struct direct), DT_DIR, 1, "." },
 	{ ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
 };

Modified: head/sbin/newfs/newfs.h
==============================================================================
--- head/sbin/newfs/newfs.h	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/newfs/newfs.h	Fri Nov  4 13:36:02 2011	(r227081)
@@ -81,6 +81,7 @@ extern int	Nflag;		/* run mkfs without w
 extern int	Oflag;		/* build UFS1 format file system */
 extern int	Rflag;		/* regression test */
 extern int	Uflag;		/* enable soft updates for file system */
+extern int	jflag;		/* enable soft updates journaling for filesys */
 extern int	Xflag;		/* exit in middle of newfs for testing */
 extern int	Jflag;		/* enable gjournal for file system */
 extern int	lflag;		/* enable multilabel MAC for file system */

Modified: head/sbin/rcorder/rcorder.c
==============================================================================
--- head/sbin/rcorder/rcorder.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/rcorder/rcorder.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -73,9 +73,9 @@ int debug = 0;
 #define KEYWORDS_STR	"# KEYWORDS:"
 #define KEYWORDS_LEN	(sizeof(KEYWORDS_STR) - 1)
 
-int exit_code;
-int file_count;
-char **file_list;
+static int exit_code;
+static int file_count;
+static char **file_list;
 
 typedef int bool;
 #define TRUE 1

Modified: head/sbin/recoverdisk/recoverdisk.c
==============================================================================
--- head/sbin/recoverdisk/recoverdisk.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/recoverdisk/recoverdisk.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -24,7 +24,7 @@
 #include 
 #include 
 
-volatile sig_atomic_t aborting = 0;
+static volatile sig_atomic_t aborting = 0;
 static size_t bigsize = 1024 * 1024;
 static size_t medsize;
 static size_t minsize = 512;

Modified: head/sbin/shutdown/shutdown.c
==============================================================================
--- head/sbin/shutdown/shutdown.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/shutdown/shutdown.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$");
 #define	M		*60
 #define	S		*1
 #define	NOLOG_TIME	5*60
-struct interval {
+static struct interval {
 	int timeleft, timetowait;
 } tlist[] = {
 	{ 10 H,  5 H },

Modified: head/sbin/swapon/swapon.c
==============================================================================
--- head/sbin/swapon/swapon.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/swapon/swapon.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -60,7 +60,7 @@ static void usage(void);
 static int swap_on_off(char *name, int ignoreebusy);
 static void swaplist(int, int, int);
 
-enum { SWAPON, SWAPOFF, SWAPCTL } orig_prog, which_prog = SWAPCTL;
+static enum { SWAPON, SWAPOFF, SWAPCTL } orig_prog, which_prog = SWAPCTL;
 
 int
 main(int argc, char **argv)

Modified: head/sbin/tunefs/tunefs.c
==============================================================================
--- head/sbin/tunefs/tunefs.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/tunefs/tunefs.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$");
 /* the optimization warning string template */
 #define	OPTWARN	"should optimize for %s with minfree %s %d%%"
 
-struct uufsd disk;
+static struct uufsd disk;
 #define	sblock disk.d_fs
 
 void usage(void);
@@ -553,7 +553,7 @@ sbdirty(void)
 	disk.d_fs.fs_clean = 0;
 }
 
-int blocks;
+static int blocks;
 static char clrbuf[MAXBSIZE];
 
 static ufs2_daddr_t

Modified: head/sbin/umount/umount.c
==============================================================================
--- head/sbin/umount/umount.c	Fri Nov  4 13:32:13 2011	(r227080)
+++ head/sbin/umount/umount.c	Fri Nov  4 13:36:02 2011	(r227081)
@@ -63,9 +63,9 @@ static const char rcsid[] =
 
 typedef enum { FIND, REMOVE, CHECKUNIQUE } dowhat;
 
-struct  addrinfo *nfshost_ai = NULL;
-int	fflag, vflag;
-char   *nfshost;
+static struct addrinfo *nfshost_ai = NULL;
+static int	fflag, vflag;
+static char	*nfshost;
 
 struct statfs *checkmntlist(char *);
 int	 checkvfsname (const char *, char **);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 13:54:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 9C6291065674; Fri,  4 Nov 2011 13:54:22 +0000 (UTC)
Date: Fri, 4 Nov 2011 13:54:22 +0000
From: Alexey Dokuchaev 
To: Ed Schouten 
Message-ID: <20111104135422.GA26521@FreeBSD.org>
References: <201111041336.pA4Da2M8020263@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <201111041336.pA4Da2M8020263@svn.freebsd.org>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r227081 - in head/sbin: atm/atmconfig badsect
	camcontrol ccdconfig devfs dmesg dumpfs fdisk ffsinfo fsck
	fsck_msdosfs fsirand growfs init mount mount_cd9660
	mount_nullfs mount_udf natd ...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 13:54:22 -0000

On Fri, Nov 04, 2011 at 01:36:02PM +0000, Ed Schouten wrote:
> Author: ed
> Date: Fri Nov  4 13:36:02 2011
> New Revision: 227081
> URL: http://svn.freebsd.org/changeset/base/227081
> 
> Log:
>   Add missing static keywords for global variables to tools in sbin/.
>   
>   These tools declare global variables without using the static keyword,
>   even though their use is limited to a single C-file, or without placing
>   an extern declaration of them in the proper header file.

Thanks for doing this Ed, much appreciated!

./danfe

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 15:34:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE508106564A;
	Fri,  4 Nov 2011 15:34:31 +0000 (UTC) (envelope-from rmh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DF1C08FC08;
	Fri,  4 Nov 2011 15:34:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4FYVYo023954;
	Fri, 4 Nov 2011 15:34:31 GMT (envelope-from rmh@svn.freebsd.org)
Received: (from rmh@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4FYVXB023952;
	Fri, 4 Nov 2011 15:34:31 GMT (envelope-from rmh@svn.freebsd.org)
Message-Id: <201111041534.pA4FYVXB023952@svn.freebsd.org>
From: Robert Millan 
Date: Fri, 4 Nov 2011 15:34:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227082 - head/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 15:34:32 -0000

Author: rmh
Date: Fri Nov  4 15:34:31 2011
New Revision: 227082
URL: http://svn.freebsd.org/changeset/base/227082

Log:
  Silence an (otherwise harmless) very recurrent warning when building the
  kernel of FreeBSD with a non-FreeBSD compiler.
  
  Approved by:	kib (mentor)

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h	Fri Nov  4 13:36:02 2011	(r227081)
+++ head/sys/sys/cdefs.h	Fri Nov  4 15:34:31 2011	(r227082)
@@ -349,7 +349,8 @@
 #endif
 
 /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
-#if __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER)
+#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \
+    defined(__GNUC__) && !defined(__INTEL_COMPILER)
 #define	__printf0like(fmtarg, firstvararg) \
 	    __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
 #else

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 15:57:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2EACC106566C;
	Fri,  4 Nov 2011 15:57:39 +0000 (UTC)
	(envelope-from sbruno@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 04CBA8FC0A;
	Fri,  4 Nov 2011 15:57:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4FvcVK024685;
	Fri, 4 Nov 2011 15:57:38 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4Fvc5o024683;
	Fri, 4 Nov 2011 15:57:38 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201111041557.pA4Fvc5o024683@svn.freebsd.org>
From: Sean Bruno 
Date: Fri, 4 Nov 2011 15:57:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227083 - stable/8/libexec/tftpd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 15:57:39 -0000

Author: sbruno
Date: Fri Nov  4 15:57:38 2011
New Revision: 227083
URL: http://svn.freebsd.org/changeset/base/227083

Log:
  MFC r224536:
  Confirmed behavior of a Cisco 6509 in production.
  
  In the old TFTP server, there was an undocumented behavior where
  the block counter would rollover to 0 if a file larger
  than 65535 blocks was transferred.  With the default block size
  of 512 octets per block, this is a file size of approximately 32 megabytes.
  
  The new TFTP server code would report an error and stop transferring
  the file if a file was larger than 65535 blocks.
  
  This patch restores the old TFTP server's behavior to the new
  TFTP server code.  If a TFTP client transfers a file larger
  than 65535 blocks, and does *not* specify the "rollover" option,
  then automatically rollover the block counter to 0 every time
  we reach 65535 blocks.
  
  This restores interoperability with the FreeBSD 6 TFTP client.
  Without this change, if a FreeBSD 6 TFTP client tried to
  retrieve a file larger than 65535 blocks from a FreeBSD 9 TFTP server,
  the transfer would fail.  The same file could be retrieved successfully
  if the same FreeBSD 6 TFTP client was used against a FreeBSD 6 TFTP server.

Modified:
  stable/8/libexec/tftpd/tftp-transfer.c

Modified: stable/8/libexec/tftpd/tftp-transfer.c
==============================================================================
--- stable/8/libexec/tftpd/tftp-transfer.c	Fri Nov  4 15:34:31 2011	(r227082)
+++ stable/8/libexec/tftpd/tftp-transfer.c	Fri Nov  4 15:57:38 2011	(r227083)
@@ -129,14 +129,16 @@ tftp_send(int peer, uint16_t *block, str
 		(*block)++;
 		if (oldblock > *block) {
 			if (options[OPT_ROLLOVER].o_request == NULL) {
-				tftp_log(LOG_ERR,
-				    "Block rollover but not allowed.");
-				send_error(peer, EBADOP);
-				gettimeofday(&(ts->tstop), NULL);
-				return;
+				/*
+				 * "rollover" option not specified in
+				 * tftp client.  Default to rolling block
+				 * counter to 0.
+				 */
+				*block = 0;
+			} else {
+				*block = atoi(options[OPT_ROLLOVER].o_request);
 			}
 
-			*block = atoi(options[OPT_ROLLOVER].o_request);
 			ts->rollovers++;
 		}
 		gettimeofday(&(ts->tstop), NULL);
@@ -196,14 +198,16 @@ tftp_receive(int peer, uint16_t *block, 
 		(*block)++;
 		if (oldblock > *block) {
 			if (options[OPT_ROLLOVER].o_request == NULL) {
-				tftp_log(LOG_ERR,
-				    "Block rollover but not allowed.");
-				send_error(peer, EBADOP);
-				gettimeofday(&(ts->tstop), NULL);
-				return;
+				/*
+				 * "rollover" option not specified in
+				 * tftp client.  Default to rolling block
+				 * counter to 0.
+				 */
+				*block = 0;
+			} else {
+				*block = atoi(options[OPT_ROLLOVER].o_request);
 			}
 
-			*block = atoi(options[OPT_ROLLOVER].o_request);
 			ts->rollovers++;
 		}
 

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 16:24:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 010C1106564A;
	Fri,  4 Nov 2011 16:24:20 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E4B778FC18;
	Fri,  4 Nov 2011 16:24:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4GOJOX025650;
	Fri, 4 Nov 2011 16:24:19 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4GOJas025641;
	Fri, 4 Nov 2011 16:24:19 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201111041624.pA4GOJas025641@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 4 Nov 2011 16:24:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227085 - in head/sys: modules modules/ipfw netinet/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 16:24:20 -0000

Author: bz
Date: Fri Nov  4 16:24:19 2011
New Revision: 227085
URL: http://svn.freebsd.org/changeset/base/227085

Log:
  Always use the opt_*.h options for ipfw.ko, not just when
  compiled into the kernel.
  Do not try to build the module in case of no INET support but
  keep #error calls for now in case we would compile it into the
  kernel.
  
  This should fix an issue where the module would fail to enable
  IPv6 support from the rc framework, but also other INET and INET6
  parts being silently compiled out without giving a warning in the
  module case.
  
  While here garbage collect unneeded opt_*.h includes.
  opt_ipdn.h is not used anywhere but we need to leave the DUMMYNET
  entry in options for conditional inclusion in kernel so keep the
  file with the same name.
  
  Reported by:	pluknet
  Reviewed by:	plunket, jhb
  MFC After:	3 days

Modified:
  head/sys/modules/Makefile
  head/sys/modules/ipfw/Makefile
  head/sys/netinet/ipfw/ip_fw2.c
  head/sys/netinet/ipfw/ip_fw_dynamic.c
  head/sys/netinet/ipfw/ip_fw_log.c
  head/sys/netinet/ipfw/ip_fw_pfil.c
  head/sys/netinet/ipfw/ip_fw_sockopt.c
  head/sys/netinet/ipfw/ip_fw_table.c

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/modules/Makefile	Fri Nov  4 16:24:19 2011	(r227085)
@@ -137,7 +137,7 @@ SUBDIR=	${_3dfx} \
 	${_io} \
 	ipdivert \
 	${_ipfilter} \
-	ipfw \
+	${_ipfw} \
 	ipfw_nat \
 	${_ipmi} \
 	ip_mroute_mod \
@@ -379,6 +379,10 @@ _if_carp=	if_carp
 _ipfilter=	ipfilter
 .endif
 
+.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
+_ipfw=		ipfw
+.endif
+
 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
 _netgraph=	netgraph
 .endif

Modified: head/sys/modules/ipfw/Makefile
==============================================================================
--- head/sys/modules/ipfw/Makefile	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/modules/ipfw/Makefile	Fri Nov  4 16:24:19 2011	(r227085)
@@ -8,7 +8,7 @@ KMOD=	ipfw
 SRCS=	ip_fw2.c ip_fw_pfil.c
 SRCS+=	ip_fw_dynamic.c ip_fw_log.c
 SRCS+=	ip_fw_sockopt.c ip_fw_table.c
-SRCS+=	opt_inet.h opt_inet6.h opt_ipfw.h opt_ipsec.h
+SRCS+=	opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h opt_ipsec.h
 
 CFLAGS+= -DIPFIREWALL
 CFLAGS+= -I${.CURDIR}/../../contrib/pf

Modified: head/sys/netinet/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw2.c	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/netinet/ipfw/ip_fw2.c	Fri Nov  4 16:24:19 2011	(r227085)
@@ -31,14 +31,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
 #include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
 

Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_dynamic.c	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/netinet/ipfw/ip_fw_dynamic.c	Fri Nov  4 16:24:19 2011	(r227085)
@@ -34,16 +34,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include 
 #include 

Modified: head/sys/netinet/ipfw/ip_fw_log.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_log.c	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/netinet/ipfw/ip_fw_log.c	Fri Nov  4 16:24:19 2011	(r227085)
@@ -31,16 +31,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include 
 #include 

Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_pfil.c	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/netinet/ipfw/ip_fw_pfil.c	Fri Nov  4 16:24:19 2011	(r227085)
@@ -28,14 +28,11 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif /* KLD_MODULE */
 
 #include 
 #include 

Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_sockopt.c	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/netinet/ipfw/ip_fw_sockopt.c	Fri Nov  4 16:24:19 2011	(r227085)
@@ -34,16 +34,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include 
 #include 

Modified: head/sys/netinet/ipfw/ip_fw_table.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_table.c	Fri Nov  4 16:10:26 2011	(r227084)
+++ head/sys/netinet/ipfw/ip_fw_table.c	Fri Nov  4 16:24:19 2011	(r227085)
@@ -40,16 +40,11 @@ __FBSDID("$FreeBSD$");
  */
 
 #include "opt_ipfw.h"
-#if !defined(KLD_MODULE)
-#include "opt_ipdivert.h"
-#include "opt_ipdn.h"
 #include "opt_inet.h"
 #ifndef INET
 #error IPFIREWALL requires INET.
 #endif /* INET */
-#endif
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include 
 #include 

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 17:07:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BEB4E106564A;
	Fri,  4 Nov 2011 17:07:53 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A45CD8FC0C;
	Fri,  4 Nov 2011 17:07:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4H7rBo027032;
	Fri, 4 Nov 2011 17:07:53 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4H7rRt027030;
	Fri, 4 Nov 2011 17:07:53 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111041707.pA4H7rRt027030@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 17:07:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227086 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 17:07:53 -0000

Author: yongari
Date: Fri Nov  4 17:07:53 2011
New Revision: 227086
URL: http://svn.freebsd.org/changeset/base/227086

Log:
  Use ANSI function definations.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 16:24:19 2011	(r227085)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 17:07:53 2011	(r227086)
@@ -270,9 +270,7 @@ MODULE_DEPEND(ti, ether, 1, 1, 1);
 /*
  * Send an instruction or address to the EEPROM, check for ACK.
  */
-static u_int32_t ti_eeprom_putbyte(sc, byte)
-	struct ti_softc		*sc;
-	int			byte;
+static u_int32_t ti_eeprom_putbyte(struct ti_softc *sc, int byte)
 {
 	int			i, ack = 0;
 
@@ -316,10 +314,7 @@ static u_int32_t ti_eeprom_putbyte(sc, b
  * We have to send two address bytes since the EEPROM can hold
  * more than 256 bytes of data.
  */
-static u_int8_t ti_eeprom_getbyte(sc, addr, dest)
-	struct ti_softc		*sc;
-	int			addr;
-	u_int8_t		*dest;
+static u_int8_t ti_eeprom_getbyte(struct ti_softc *sc, int addr, u_int8_t *dest)
 {
 	int			i;
 	u_int8_t		byte = 0;
@@ -393,11 +388,7 @@ static u_int8_t ti_eeprom_getbyte(sc, ad
  * Read a sequence of bytes from the EEPROM.
  */
 static int
-ti_read_eeprom(sc, dest, off, cnt)
-	struct ti_softc		*sc;
-	caddr_t			dest;
-	int			off;
-	int			cnt;
+ti_read_eeprom(struct ti_softc *sc, caddr_t dest, int off, int cnt)
 {
 	int			err = 0, i;
 	u_int8_t		byte = 0;
@@ -417,10 +408,7 @@ ti_read_eeprom(sc, dest, off, cnt)
  * Can be used to copy data from NIC local memory.
  */
 static void
-ti_mem_read(sc, addr, len, buf)
-	struct ti_softc		*sc;
-	u_int32_t		addr, len;
-	void			*buf;
+ti_mem_read(struct ti_softc *sc, u_int32_t addr, u_int32_t len, void *buf)
 {
 	int			segptr, segsize, cnt;
 	char			*ptr;
@@ -450,10 +438,7 @@ ti_mem_read(sc, addr, len, buf)
  * Can be used to copy data into NIC local memory.
  */
 static void
-ti_mem_write(sc, addr, len, buf)
-	struct ti_softc		*sc;
-	u_int32_t		addr, len;
-	void			*buf;
+ti_mem_write(struct ti_softc *sc, u_int32_t addr, u_int32_t len, void *buf)
 {
 	int			segptr, segsize, cnt;
 	char			*ptr;
@@ -482,9 +467,7 @@ ti_mem_write(sc, addr, len, buf)
  * Can be used to clear a section of NIC local memory.
  */
 static void
-ti_mem_zero(sc, addr, len)
-	struct ti_softc		*sc;
-	u_int32_t		addr, len;
+ti_mem_zero(struct ti_softc *sc, u_int32_t addr, u_int32_t len)
 {
 	int			segptr, segsize, cnt;
 
@@ -505,11 +488,8 @@ ti_mem_zero(sc, addr, len)
 }
 
 static int
-ti_copy_mem(sc, tigon_addr, len, buf, useraddr, readdata)
-	struct ti_softc		*sc;
-	u_int32_t		tigon_addr, len;
-	caddr_t			buf;
-	int			useraddr, readdata;
+ti_copy_mem(struct ti_softc *sc, u_int32_t tigon_addr, u_int32_t len,
+    caddr_t buf, int useraddr, int readdata)
 {
 	int		segptr, segsize, cnt;
 	caddr_t		ptr;
@@ -704,12 +684,8 @@ ti_copy_mem(sc, tigon_addr, len, buf, us
 }
 
 static int
-ti_copy_scratch(sc, tigon_addr, len, buf, useraddr, readdata, cpu)
-	struct ti_softc		*sc;
-	u_int32_t		tigon_addr, len;
-	caddr_t			buf;
-	int			useraddr, readdata;
-	int			cpu;
+ti_copy_scratch(struct ti_softc *sc, u_int32_t tigon_addr, u_int32_t len,
+    caddr_t buf, int useraddr, int readdata, int cpu)
 {
 	u_int32_t	segptr;
 	int		cnt;
@@ -802,11 +778,7 @@ ti_copy_scratch(sc, tigon_addr, len, buf
 }
 
 static int
-ti_bcopy_swap(src, dst, len, swap_type)
-	const void	*src;
-	void		*dst;
-	size_t		len;
-	ti_swap_type	swap_type;
+ti_bcopy_swap(const void *src, void *dst, size_t len, ti_swap_type swap_type)
 {
 	const u_int8_t *tmpsrc;
 	u_int8_t *tmpdst;
@@ -844,8 +816,7 @@ ti_bcopy_swap(src, dst, len, swap_type)
  * Tigon 2.
  */
 static void
-ti_loadfw(sc)
-	struct ti_softc		*sc;
+ti_loadfw(struct ti_softc *sc)
 {
 
 	TI_LOCK_ASSERT(sc);
@@ -902,9 +873,7 @@ ti_loadfw(sc)
  * Send the NIC a command via the command ring.
  */
 static void
-ti_cmd(sc, cmd)
-	struct ti_softc		*sc;
-	struct ti_cmd_desc	*cmd;
+ti_cmd(struct ti_softc *sc, struct ti_cmd_desc *cmd)
 {
 	int			index;
 
@@ -920,11 +889,7 @@ ti_cmd(sc, cmd)
  * number of command slots to include after the initial command.
  */
 static void
-ti_cmd_ext(sc, cmd, arg, len)
-	struct ti_softc		*sc;
-	struct ti_cmd_desc	*cmd;
-	caddr_t			arg;
-	int			len;
+ti_cmd_ext(struct ti_softc *sc, struct ti_cmd_desc *cmd, caddr_t arg, int len)
 {
 	int			index;
 	int			i;
@@ -945,8 +910,7 @@ ti_cmd_ext(sc, cmd, arg, len)
  * Handle events that have triggered interrupts.
  */
 static void
-ti_handle_events(sc)
-	struct ti_softc		*sc;
+ti_handle_events(struct ti_softc *sc)
 {
 	struct ti_event_desc	*e;
 
@@ -1089,8 +1053,7 @@ ti_free_dmamaps(struct ti_softc *sc)
  */
 
 static int
-ti_alloc_jumbo_mem(sc)
-	struct ti_softc		*sc;
+ti_alloc_jumbo_mem(struct ti_softc *sc)
 {
 	caddr_t			ptr;
 	int			i;
@@ -1152,8 +1115,7 @@ ti_alloc_jumbo_mem(sc)
 /*
  * Allocate a jumbo buffer.
  */
-static void *ti_jalloc(sc)
-	struct ti_softc		*sc;
+static void *ti_jalloc(struct ti_softc *sc)
 {
 	struct ti_jpool_entry	*entry;
 
@@ -1173,9 +1135,7 @@ static void *ti_jalloc(sc)
  * Release a jumbo buffer.
  */
 static void
-ti_jfree(buf, args)
-	void			*buf;
-	void			*args;
+ti_jfree(void *buf, void *args)
 {
 	struct ti_softc		*sc;
 	int			i;
@@ -1205,8 +1165,7 @@ ti_jfree(buf, args)
 #else
 
 static int
-ti_alloc_jumbo_mem(sc)
-	struct ti_softc		*sc;
+ti_alloc_jumbo_mem(struct ti_softc *sc)
 {
 
 	/*
@@ -1237,10 +1196,7 @@ ti_alloc_jumbo_mem(sc)
  * Intialize a standard receive ring descriptor.
  */
 static int
-ti_newbuf_std(sc, i, m)
-	struct ti_softc		*sc;
-	int			i;
-	struct mbuf		*m;
+ti_newbuf_std(struct ti_softc *sc, int i, struct mbuf *m)
 {
 	bus_dmamap_t		map;
 	bus_dma_segment_t	segs;
@@ -1292,10 +1248,7 @@ ti_newbuf_std(sc, i, m)
  * the Tigon 2.
  */
 static int
-ti_newbuf_mini(sc, i, m)
-	struct ti_softc		*sc;
-	int			i;
-	struct mbuf		*m;
+ti_newbuf_mini(struct ti_softc *sc, int i, struct mbuf *m)
 {
 	bus_dma_segment_t	segs;
 	bus_dmamap_t		map;
@@ -1344,10 +1297,7 @@ ti_newbuf_mini(sc, i, m)
  * a jumbo buffer from the pool managed internally by the driver.
  */
 static int
-ti_newbuf_jumbo(sc, i, m)
-	struct ti_softc		*sc;
-	int			i;
-	struct mbuf		*m;
+ti_newbuf_jumbo(struct ti_softc *sc, int i, struct mbuf *m)
 {
 	bus_dmamap_t		map;
 	struct mbuf		*m_new = NULL;
@@ -1425,10 +1375,7 @@ static int HDR_LEN =  TCP_HDR_LEN;
  * a jumbo buffer from the pool managed internally by the driver.
  */
 static int
-ti_newbuf_jumbo(sc, idx, m_old)
-	struct ti_softc		*sc;
-	int			idx;
-	struct mbuf		*m_old;
+ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct mbuf *m_old)
 {
 	bus_dmamap_t		map;
 	struct mbuf		*cur, *m_new = NULL;
@@ -1582,8 +1529,7 @@ nobufs:
  * the NIC.
  */
 static int
-ti_init_rx_ring_std(sc)
-	struct ti_softc		*sc;
+ti_init_rx_ring_std(struct ti_softc *sc)
 {
 	int			i;
 	struct ti_cmd_desc	cmd;
@@ -1600,8 +1546,7 @@ ti_init_rx_ring_std(sc)
 }
 
 static void
-ti_free_rx_ring_std(sc)
-	struct ti_softc		*sc;
+ti_free_rx_ring_std(struct ti_softc *sc)
 {
 	bus_dmamap_t		map;
 	int			i;
@@ -1621,8 +1566,7 @@ ti_free_rx_ring_std(sc)
 }
 
 static int
-ti_init_rx_ring_jumbo(sc)
-	struct ti_softc		*sc;
+ti_init_rx_ring_jumbo(struct ti_softc *sc)
 {
 	int			i;
 	struct ti_cmd_desc	cmd;
@@ -1639,8 +1583,7 @@ ti_init_rx_ring_jumbo(sc)
 }
 
 static void
-ti_free_rx_ring_jumbo(sc)
-	struct ti_softc		*sc;
+ti_free_rx_ring_jumbo(struct ti_softc *sc)
 {
 	bus_dmamap_t		map;
 	int			i;
@@ -1660,8 +1603,7 @@ ti_free_rx_ring_jumbo(sc)
 }
 
 static int
-ti_init_rx_ring_mini(sc)
-	struct ti_softc		*sc;
+ti_init_rx_ring_mini(struct ti_softc *sc)
 {
 	int			i;
 
@@ -1677,8 +1619,7 @@ ti_init_rx_ring_mini(sc)
 }
 
 static void
-ti_free_rx_ring_mini(sc)
-	struct ti_softc		*sc;
+ti_free_rx_ring_mini(struct ti_softc *sc)
 {
 	bus_dmamap_t		map;
 	int			i;
@@ -1698,8 +1639,7 @@ ti_free_rx_ring_mini(sc)
 }
 
 static void
-ti_free_tx_ring(sc)
-	struct ti_softc		*sc;
+ti_free_tx_ring(struct ti_softc *sc)
 {
 	struct ti_txdesc	*txd;
 	int			i;
@@ -1722,8 +1662,7 @@ ti_free_tx_ring(sc)
 }
 
 static int
-ti_init_tx_ring(sc)
-	struct ti_softc		*sc;
+ti_init_tx_ring(struct ti_softc *sc)
 {
 	struct ti_txdesc	*txd;
 	int			i;
@@ -1747,9 +1686,7 @@ ti_init_tx_ring(sc)
  * work.
  */
 static void
-ti_add_mcast(sc, addr)
-	struct ti_softc		*sc;
-	struct ether_addr	*addr;
+ti_add_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
 	struct ti_cmd_desc	cmd;
 	u_int16_t		*m;
@@ -1775,9 +1712,7 @@ ti_add_mcast(sc, addr)
 }
 
 static void
-ti_del_mcast(sc, addr)
-	struct ti_softc		*sc;
-	struct ether_addr	*addr;
+ti_del_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
 	struct ti_cmd_desc	cmd;
 	u_int16_t		*m;
@@ -1817,8 +1752,7 @@ ti_del_mcast(sc, addr)
  * any given time.
  */
 static void
-ti_setmulti(sc)
-	struct ti_softc		*sc;
+ti_setmulti(struct ti_softc *sc)
 {
 	struct ifnet		*ifp;
 	struct ifmultiaddr	*ifma;
@@ -1877,8 +1811,7 @@ ti_setmulti(sc)
  * around it on the Tigon 2 by setting a bit in the PCI state register,
  * but for the Tigon 1 we must give up and abort the interface attach.
  */
-static int ti_64bitslot_war(sc)
-	struct ti_softc		*sc;
+static int ti_64bitslot_war(struct ti_softc *sc)
 {
 	if (!(CSR_READ_4(sc, TI_PCI_STATE) & TI_PCISTATE_32BIT_BUS)) {
 		CSR_WRITE_4(sc, 0x600, 0);
@@ -1903,8 +1836,7 @@ static int ti_64bitslot_war(sc)
  * self-test results.
  */
 static int
-ti_chipinit(sc)
-	struct ti_softc		*sc;
+ti_chipinit(struct ti_softc *sc)
 {
 	u_int32_t		cacheline;
 	u_int32_t		pci_writemax = 0;
@@ -2057,8 +1989,7 @@ ti_chipinit(sc)
  * start the CPU(s) running.
  */
 static int
-ti_gibinit(sc)
-	struct ti_softc		*sc;
+ti_gibinit(struct ti_softc *sc)
 {
 	struct ti_rcb		*rcb;
 	int			i;
@@ -2250,8 +2181,7 @@ ti_rdata_cb(void *arg, bus_dma_segment_t
  * against our list and return its name if we find a match.
  */
 static int
-ti_probe(dev)
-	device_t		dev;
+ti_probe(device_t dev)
 {
 	const struct ti_type	*t;
 
@@ -2270,8 +2200,7 @@ ti_probe(dev)
 }
 
 static int
-ti_attach(dev)
-	device_t		dev;
+ti_attach(device_t dev)
 {
 	struct ifnet		*ifp;
 	struct ti_softc		*sc;
@@ -2559,8 +2488,7 @@ fail:
  * allocated.
  */
 static int
-ti_detach(dev)
-	device_t		dev;
+ti_detach(device_t dev)
 {
 	struct ti_softc		*sc;
 	struct ifnet		*ifp;
@@ -2686,8 +2614,7 @@ ti_hdr_split(struct mbuf *top, int hdr_l
  */
 
 static void
-ti_rxeof(sc)
-	struct ti_softc		*sc;
+ti_rxeof(struct ti_softc *sc)
 {
 	bus_dmamap_t		map;
 	struct ifnet		*ifp;
@@ -2820,8 +2747,7 @@ ti_rxeof(sc)
 }
 
 static void
-ti_txeof(sc)
-	struct ti_softc		*sc;
+ti_txeof(struct ti_softc *sc)
 {
 	struct ti_txdesc	*txd;
 	struct ti_tx_desc	txdesc;
@@ -2867,8 +2793,7 @@ ti_txeof(sc)
 }
 
 static void
-ti_intr(xsc)
-	void			*xsc;
+ti_intr(void *xsc)
 {
 	struct ti_softc		*sc;
 	struct ifnet		*ifp;
@@ -2910,8 +2835,7 @@ ti_intr(xsc)
 }
 
 static void
-ti_stats_update(sc)
-	struct ti_softc		*sc;
+ti_stats_update(struct ti_softc *sc)
 {
 	struct ifnet		*ifp;
 
@@ -2936,9 +2860,7 @@ ti_stats_update(sc)
  * pointers to descriptors.
  */
 static int
-ti_encap(sc, m_head)
-	struct ti_softc		*sc;
-	struct mbuf		**m_head;
+ti_encap(struct ti_softc *sc, struct mbuf **m_head)
 {
 	struct ti_txdesc	*txd;
 	struct ti_tx_desc	*f;
@@ -3041,8 +2963,7 @@ ti_encap(sc, m_head)
 }
 
 static void
-ti_start(ifp)
-	struct ifnet		*ifp;
+ti_start(struct ifnet *ifp)
 {
 	struct ti_softc		*sc;
 
@@ -3057,8 +2978,7 @@ ti_start(ifp)
  * to the mbuf data regions directly in the transmit descriptors.
  */
 static void
-ti_start_locked(ifp)
-	struct ifnet		*ifp;
+ti_start_locked(struct ifnet *ifp)
 {
 	struct ti_softc		*sc;
 	struct mbuf		*m_head = NULL;
@@ -3123,8 +3043,7 @@ ti_start_locked(ifp)
 }
 
 static void
-ti_init(xsc)
-	void			*xsc;
+ti_init(void *xsc)
 {
 	struct ti_softc		*sc;
 
@@ -3135,8 +3054,7 @@ ti_init(xsc)
 }
 
 static void
-ti_init_locked(xsc)
-	void			*xsc;
+ti_init_locked(void *xsc)
 {
 	struct ti_softc		*sc = xsc;
 
@@ -3150,8 +3068,7 @@ ti_init_locked(xsc)
 	}
 }
 
-static void ti_init2(sc)
-	struct ti_softc		*sc;
+static void ti_init2(struct ti_softc *sc)
 {
 	struct ti_cmd_desc	cmd;
 	struct ifnet		*ifp;
@@ -3241,8 +3158,7 @@ static void ti_init2(sc)
  * Set media options.
  */
 static int
-ti_ifmedia_upd(ifp)
-	struct ifnet		*ifp;
+ti_ifmedia_upd(struct ifnet *ifp)
 {
 	struct ti_softc		*sc;
 	struct ifmedia		*ifm;
@@ -3343,9 +3259,7 @@ ti_ifmedia_upd(ifp)
  * Report current media status.
  */
 static void
-ti_ifmedia_sts(ifp, ifmr)
-	struct ifnet		*ifp;
-	struct ifmediareq	*ifmr;
+ti_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
 {
 	struct ti_softc		*sc;
 	u_int32_t		media = 0;
@@ -3391,10 +3305,7 @@ ti_ifmedia_sts(ifp, ifmr)
 }
 
 static int
-ti_ioctl(ifp, command, data)
-	struct ifnet		*ifp;
-	u_long			command;
-	caddr_t			data;
+ti_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
 {
 	struct ti_softc		*sc = ifp->if_softc;
 	struct ifreq		*ifr = (struct ifreq *) data;
@@ -3816,8 +3727,7 @@ ti_watchdog(void *arg)
  * RX and TX lists.
  */
 static void
-ti_stop(sc)
-	struct ti_softc		*sc;
+ti_stop(struct ti_softc *sc)
 {
 	struct ifnet		*ifp;
 	struct ti_cmd_desc	cmd;
@@ -3866,8 +3776,7 @@ ti_stop(sc)
  * get confused by errant DMAs when rebooting.
  */
 static int
-ti_shutdown(dev)
-	device_t		dev;
+ti_shutdown(device_t dev)
 {
 	struct ti_softc		*sc;
 

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 18:28:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 320DA106566B;
	Fri,  4 Nov 2011 18:28:11 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 210DA8FC12;
	Fri,  4 Nov 2011 18:28:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4ISBEL029455;
	Fri, 4 Nov 2011 18:28:11 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4ISBYn029453;
	Fri, 4 Nov 2011 18:28:11 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111041828.pA4ISBYn029453@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 18:28:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227087 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 18:28:11 -0000

Author: yongari
Date: Fri Nov  4 18:28:10 2011
New Revision: 227087
URL: http://svn.freebsd.org/changeset/base/227087

Log:
  style.
  No functional changes.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 17:07:53 2011	(r227086)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 18:28:10 2011	(r227087)
@@ -140,7 +140,6 @@ typedef enum {
 	TI_SWAP_NTOH
 } ti_swap_type;
 
-
 /*
  * Various supported device vendors/types and their names.
  */
@@ -210,9 +209,10 @@ static void ti_setmulti(struct ti_softc 
 static void ti_mem_read(struct ti_softc *, u_int32_t, u_int32_t, void *);
 static void ti_mem_write(struct ti_softc *, u_int32_t, u_int32_t, void *);
 static void ti_mem_zero(struct ti_softc *, u_int32_t, u_int32_t);
-static int ti_copy_mem(struct ti_softc *, u_int32_t, u_int32_t, caddr_t, int, int);
+static int ti_copy_mem(struct ti_softc *, u_int32_t, u_int32_t, caddr_t, int,
+    int);
 static int ti_copy_scratch(struct ti_softc *, u_int32_t, u_int32_t, caddr_t,
-		int, int, int);
+    int, int, int);
 static int ti_bcopy_swap(const void *, void *, size_t, ti_swap_type);
 static void ti_loadfw(struct ti_softc *);
 static void ti_cmd(struct ti_softc *, struct ti_cmd_desc *);
@@ -242,8 +242,8 @@ static int ti_chipinit(struct ti_softc *
 static int ti_gibinit(struct ti_softc *);
 
 #ifdef TI_JUMBO_HDRSPLIT
-static __inline void ti_hdr_split	(struct mbuf *top, int hdr_len,
-					     int pkt_len, int idx);
+static __inline void ti_hdr_split(struct mbuf *top, int hdr_len, int pkt_len,
+    int idx);
 #endif /* TI_JUMBO_HDRSPLIT */
 
 static device_method_t ti_methods[] = {
@@ -270,9 +270,10 @@ MODULE_DEPEND(ti, ether, 1, 1, 1);
 /*
  * Send an instruction or address to the EEPROM, check for ACK.
  */
-static u_int32_t ti_eeprom_putbyte(struct ti_softc *sc, int byte)
+static u_int32_t
+ti_eeprom_putbyte(struct ti_softc *sc, int byte)
 {
-	int			i, ack = 0;
+	int i, ack = 0;
 
 	/*
 	 * Make sure we're in TX mode.
@@ -314,10 +315,11 @@ static u_int32_t ti_eeprom_putbyte(struc
  * We have to send two address bytes since the EEPROM can hold
  * more than 256 bytes of data.
  */
-static u_int8_t ti_eeprom_getbyte(struct ti_softc *sc, int addr, u_int8_t *dest)
+static u_int8_t
+ti_eeprom_getbyte(struct ti_softc *sc, int addr, u_int8_t *dest)
 {
-	int			i;
-	u_int8_t		byte = 0;
+	int i;
+	u_int8_t byte = 0;
 
 	EEPROM_START;
 
@@ -390,8 +392,8 @@ static u_int8_t ti_eeprom_getbyte(struct
 static int
 ti_read_eeprom(struct ti_softc *sc, caddr_t dest, int off, int cnt)
 {
-	int			err = 0, i;
-	u_int8_t		byte = 0;
+	int err = 0, i;
+	u_int8_t byte = 0;
 
 	for (i = 0; i < cnt; i++) {
 		err = ti_eeprom_getbyte(sc, off + i, &byte);
@@ -410,8 +412,8 @@ ti_read_eeprom(struct ti_softc *sc, cadd
 static void
 ti_mem_read(struct ti_softc *sc, u_int32_t addr, u_int32_t len, void *buf)
 {
-	int			segptr, segsize, cnt;
-	char			*ptr;
+	int segptr, segsize, cnt;
+	char *ptr;
 
 	segptr = addr;
 	cnt = len;
@@ -440,8 +442,8 @@ ti_mem_read(struct ti_softc *sc, u_int32
 static void
 ti_mem_write(struct ti_softc *sc, u_int32_t addr, u_int32_t len, void *buf)
 {
-	int			segptr, segsize, cnt;
-	char			*ptr;
+	int segptr, segsize, cnt;
+	char *ptr;
 
 	segptr = addr;
 	cnt = len;
@@ -469,7 +471,7 @@ ti_mem_write(struct ti_softc *sc, u_int3
 static void
 ti_mem_zero(struct ti_softc *sc, u_int32_t addr, u_int32_t len)
 {
-	int			segptr, segsize, cnt;
+	int segptr, segsize, cnt;
 
 	segptr = addr;
 	cnt = len;
@@ -491,12 +493,12 @@ static int
 ti_copy_mem(struct ti_softc *sc, u_int32_t tigon_addr, u_int32_t len,
     caddr_t buf, int useraddr, int readdata)
 {
-	int		segptr, segsize, cnt;
-	caddr_t		ptr;
-	u_int32_t	origwin;
-	u_int8_t	tmparray[TI_WINLEN], tmparray2[TI_WINLEN];
-	int		resid, segresid;
-	int		first_pass;
+	int segptr, segsize, cnt;
+	caddr_t ptr;
+	u_int32_t origwin;
+	u_int8_t tmparray[TI_WINLEN], tmparray2[TI_WINLEN];
+	int resid, segresid;
+	int first_pass;
 
 	TI_LOCK_ASSERT(sc);
 
@@ -687,10 +689,10 @@ static int
 ti_copy_scratch(struct ti_softc *sc, u_int32_t tigon_addr, u_int32_t len,
     caddr_t buf, int useraddr, int readdata, int cpu)
 {
-	u_int32_t	segptr;
-	int		cnt;
-	u_int32_t	tmpval, tmpval2;
-	caddr_t		ptr;
+	u_int32_t segptr;
+	int cnt;
+	u_int32_t tmpval, tmpval2;
+	caddr_t ptr;
 
 	TI_LOCK_ASSERT(sc);
 
@@ -875,7 +877,7 @@ ti_loadfw(struct ti_softc *sc)
 static void
 ti_cmd(struct ti_softc *sc, struct ti_cmd_desc *cmd)
 {
-	int			index;
+	int index;
 
 	index = sc->ti_cmd_saved_prodidx;
 	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
@@ -891,8 +893,8 @@ ti_cmd(struct ti_softc *sc, struct ti_cm
 static void
 ti_cmd_ext(struct ti_softc *sc, struct ti_cmd_desc *cmd, caddr_t arg, int len)
 {
-	int			index;
-	int			i;
+	int index;
+	int i;
 
 	index = sc->ti_cmd_saved_prodidx;
 	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
@@ -912,7 +914,7 @@ ti_cmd_ext(struct ti_softc *sc, struct t
 static void
 ti_handle_events(struct ti_softc *sc)
 {
-	struct ti_event_desc	*e;
+	struct ti_event_desc *e;
 
 	if (sc->ti_rdata->ti_event_ring == NULL)
 		return;
@@ -1055,9 +1057,9 @@ ti_free_dmamaps(struct ti_softc *sc)
 static int
 ti_alloc_jumbo_mem(struct ti_softc *sc)
 {
-	caddr_t			ptr;
-	int			i;
-	struct ti_jpool_entry   *entry;
+	struct ti_jpool_entry *entry;
+	caddr_t ptr;
+	int i;
 
 	/*
 	 * Grab a big chunk o' storage.  Since we are chopping this pool up
@@ -1117,7 +1119,7 @@ ti_alloc_jumbo_mem(struct ti_softc *sc)
  */
 static void *ti_jalloc(struct ti_softc *sc)
 {
-	struct ti_jpool_entry	*entry;
+	struct ti_jpool_entry *entry;
 
 	entry = SLIST_FIRST(&sc->ti_jfree_listhead);
 
@@ -1137,9 +1139,9 @@ static void *ti_jalloc(struct ti_softc *
 static void
 ti_jfree(void *buf, void *args)
 {
-	struct ti_softc		*sc;
-	int			i;
-	struct ti_jpool_entry	*entry;
+	struct ti_softc *sc;
+	int i;
+	struct ti_jpool_entry *entry;
 
 	/* Extract the softc struct pointer. */
 	sc = (struct ti_softc *)args;
@@ -1198,11 +1200,11 @@ ti_alloc_jumbo_mem(struct ti_softc *sc)
 static int
 ti_newbuf_std(struct ti_softc *sc, int i, struct mbuf *m)
 {
-	bus_dmamap_t		map;
-	bus_dma_segment_t	segs;
-	struct mbuf		*m_new = NULL;
-	struct ti_rx_desc	*r;
-	int			nsegs;
+	bus_dmamap_t map;
+	bus_dma_segment_t segs;
+	struct mbuf *m_new = NULL;
+	struct ti_rx_desc *r;
+	int nsegs;
 
 	nsegs = 0;
 	if (m == NULL) {
@@ -1250,11 +1252,11 @@ ti_newbuf_std(struct ti_softc *sc, int i
 static int
 ti_newbuf_mini(struct ti_softc *sc, int i, struct mbuf *m)
 {
-	bus_dma_segment_t	segs;
-	bus_dmamap_t		map;
-	struct mbuf		*m_new = NULL;
-	struct ti_rx_desc	*r;
-	int			nsegs;
+	bus_dma_segment_t segs;
+	bus_dmamap_t map;
+	struct mbuf *m_new = NULL;
+	struct ti_rx_desc *r;
+	int nsegs;
 
 	nsegs = 0;
 	if (m == NULL) {
@@ -1299,14 +1301,14 @@ ti_newbuf_mini(struct ti_softc *sc, int 
 static int
 ti_newbuf_jumbo(struct ti_softc *sc, int i, struct mbuf *m)
 {
-	bus_dmamap_t		map;
-	struct mbuf		*m_new = NULL;
-	struct ti_rx_desc	*r;
-	int			nsegs;
-	bus_dma_segment_t	segs;
+	bus_dmamap_t map;
+	struct mbuf *m_new = NULL;
+	struct ti_rx_desc *r;
+	int nsegs;
+	bus_dma_segment_t segs;
 
 	if (m == NULL) {
-		caddr_t			*buf = NULL;
+		caddr_t *buf = NULL;
 
 		/* Allocate the mbuf. */
 		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
@@ -1367,8 +1369,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int
 #define TCP_HDR_LEN (52 + sizeof(struct ether_header))
 #define UDP_HDR_LEN (28 + sizeof(struct ether_header))
 #define NFS_HDR_LEN (UDP_HDR_LEN)
-static int HDR_LEN =  TCP_HDR_LEN;
-
+static int HDR_LEN = TCP_HDR_LEN;
 
 /*
  * Initialize a jumbo receive ring descriptor. This allocates
@@ -1377,17 +1378,17 @@ static int HDR_LEN =  TCP_HDR_LEN;
 static int
 ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct mbuf *m_old)
 {
-	bus_dmamap_t		map;
-	struct mbuf		*cur, *m_new = NULL;
-	struct mbuf		*m[3] = {NULL, NULL, NULL};
-	struct ti_rx_desc_ext	*r;
-	vm_page_t		frame;
-	static int		color;
-				/* 1 extra buf to make nobufs easy*/
-	struct sf_buf		*sf[3] = {NULL, NULL, NULL};
-	int			i;
-	bus_dma_segment_t	segs[4];
-	int			nsegs;
+	bus_dmamap_t map;
+	struct mbuf *cur, *m_new = NULL;
+	struct mbuf *m[3] = {NULL, NULL, NULL};
+	struct ti_rx_desc_ext *r;
+	vm_page_t frame;
+	static int color;
+	/* 1 extra buf to make nobufs easy*/
+	struct sf_buf *sf[3] = {NULL, NULL, NULL};
+	int i;
+	bus_dma_segment_t segs[4];
+	int nsegs;
 
 	if (m_old != NULL) {
 		m_new = m_old;
@@ -1520,8 +1521,6 @@ nobufs:
 }
 #endif
 
-
-
 /*
  * The standard receive ring has 512 entries in it. At 2K per mbuf cluster,
  * that's 1MB or memory, which is a lot. For now, we fill only the first
@@ -1531,8 +1530,8 @@ nobufs:
 static int
 ti_init_rx_ring_std(struct ti_softc *sc)
 {
-	int			i;
-	struct ti_cmd_desc	cmd;
+	int i;
+	struct ti_cmd_desc cmd;
 
 	for (i = 0; i < TI_SSLOTS; i++) {
 		if (ti_newbuf_std(sc, i, NULL) == ENOBUFS)
@@ -1548,8 +1547,8 @@ ti_init_rx_ring_std(struct ti_softc *sc)
 static void
 ti_free_rx_ring_std(struct ti_softc *sc)
 {
-	bus_dmamap_t		map;
-	int			i;
+	bus_dmamap_t map;
+	int i;
 
 	for (i = 0; i < TI_STD_RX_RING_CNT; i++) {
 		if (sc->ti_cdata.ti_rx_std_chain[i] != NULL) {
@@ -1568,8 +1567,8 @@ ti_free_rx_ring_std(struct ti_softc *sc)
 static int
 ti_init_rx_ring_jumbo(struct ti_softc *sc)
 {
-	int			i;
-	struct ti_cmd_desc	cmd;
+	struct ti_cmd_desc cmd;
+	int i;
 
 	for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) {
 		if (ti_newbuf_jumbo(sc, i, NULL) == ENOBUFS)
@@ -1585,8 +1584,8 @@ ti_init_rx_ring_jumbo(struct ti_softc *s
 static void
 ti_free_rx_ring_jumbo(struct ti_softc *sc)
 {
-	bus_dmamap_t		map;
-	int			i;
+	bus_dmamap_t map;
+	int i;
 
 	for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) {
 		if (sc->ti_cdata.ti_rx_jumbo_chain[i] != NULL) {
@@ -1605,7 +1604,7 @@ ti_free_rx_ring_jumbo(struct ti_softc *s
 static int
 ti_init_rx_ring_mini(struct ti_softc *sc)
 {
-	int			i;
+	int i;
 
 	for (i = 0; i < TI_MSLOTS; i++) {
 		if (ti_newbuf_mini(sc, i, NULL) == ENOBUFS)
@@ -1621,8 +1620,8 @@ ti_init_rx_ring_mini(struct ti_softc *sc
 static void
 ti_free_rx_ring_mini(struct ti_softc *sc)
 {
-	bus_dmamap_t		map;
-	int			i;
+	bus_dmamap_t map;
+	int i;
 
 	for (i = 0; i < TI_MINI_RX_RING_CNT; i++) {
 		if (sc->ti_cdata.ti_rx_mini_chain[i] != NULL) {
@@ -1641,8 +1640,8 @@ ti_free_rx_ring_mini(struct ti_softc *sc
 static void
 ti_free_tx_ring(struct ti_softc *sc)
 {
-	struct ti_txdesc	*txd;
-	int			i;
+	struct ti_txdesc *txd;
+	int i;
 
 	if (sc->ti_rdata->ti_tx_ring == NULL)
 		return;
@@ -1664,8 +1663,8 @@ ti_free_tx_ring(struct ti_softc *sc)
 static int
 ti_init_tx_ring(struct ti_softc *sc)
 {
-	struct ti_txdesc	*txd;
-	int			i;
+	struct ti_txdesc *txd;
+	int i;
 
 	STAILQ_INIT(&sc->ti_cdata.ti_txfreeq);
 	STAILQ_INIT(&sc->ti_cdata.ti_txbusyq);
@@ -1688,9 +1687,9 @@ ti_init_tx_ring(struct ti_softc *sc)
 static void
 ti_add_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
-	struct ti_cmd_desc	cmd;
-	u_int16_t		*m;
-	u_int32_t		ext[2] = {0, 0};
+	struct ti_cmd_desc cmd;
+	u_int16_t *m;
+	u_int32_t ext[2] = {0, 0};
 
 	m = (u_int16_t *)&addr->octet[0];
 
@@ -1714,9 +1713,9 @@ ti_add_mcast(struct ti_softc *sc, struct
 static void
 ti_del_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
-	struct ti_cmd_desc	cmd;
-	u_int16_t		*m;
-	u_int32_t		ext[2] = {0, 0};
+	struct ti_cmd_desc cmd;
+	u_int16_t *m;
+	u_int32_t ext[2] = {0, 0};
 
 	m = (u_int16_t *)&addr->octet[0];
 
@@ -1754,11 +1753,11 @@ ti_del_mcast(struct ti_softc *sc, struct
 static void
 ti_setmulti(struct ti_softc *sc)
 {
-	struct ifnet		*ifp;
-	struct ifmultiaddr	*ifma;
-	struct ti_cmd_desc	cmd;
-	struct ti_mc_entry	*mc;
-	u_int32_t		intrs;
+	struct ifnet *ifp;
+	struct ifmultiaddr *ifma;
+	struct ti_cmd_desc cmd;
+	struct ti_mc_entry *mc;
+	u_int32_t intrs;
 
 	TI_LOCK_ASSERT(sc);
 
@@ -1813,6 +1812,7 @@ ti_setmulti(struct ti_softc *sc)
  */
 static int ti_64bitslot_war(struct ti_softc *sc)
 {
+
 	if (!(CSR_READ_4(sc, TI_PCI_STATE) & TI_PCISTATE_32BIT_BUS)) {
 		CSR_WRITE_4(sc, 0x600, 0);
 		CSR_WRITE_4(sc, 0x604, 0);
@@ -1838,9 +1838,9 @@ static int ti_64bitslot_war(struct ti_so
 static int
 ti_chipinit(struct ti_softc *sc)
 {
-	u_int32_t		cacheline;
-	u_int32_t		pci_writemax = 0;
-	u_int32_t		hdrsplit;
+	u_int32_t cacheline;
+	u_int32_t pci_writemax = 0;
+	u_int32_t hdrsplit;
 
 	/* Initialize link to down state. */
 	sc->ti_linkstat = TI_EV_CODE_LINK_DOWN;
@@ -1991,10 +1991,10 @@ ti_chipinit(struct ti_softc *sc)
 static int
 ti_gibinit(struct ti_softc *sc)
 {
-	struct ti_rcb		*rcb;
-	int			i;
-	struct ifnet		*ifp;
-	uint32_t		rdphys;
+	struct ifnet *ifp;
+	struct ti_rcb *rcb;
+	uint32_t rdphys;
+	int i;
 
 	TI_LOCK_ASSERT(sc);
 
@@ -2175,7 +2175,7 @@ ti_rdata_cb(void *arg, bus_dma_segment_t
 	sc->ti_rdata_phys = segs[0].ds_addr;
 	return;
 }
-	
+
 /*
  * Probe for a Tigon chip. Check the PCI vendor and device IDs
  * against our list and return its name if we find a match.
@@ -2183,7 +2183,7 @@ ti_rdata_cb(void *arg, bus_dma_segment_t
 static int
 ti_probe(device_t dev)
 {
-	const struct ti_type	*t;
+	const struct ti_type *t;
 
 	t = ti_devs;
 
@@ -2202,10 +2202,10 @@ ti_probe(device_t dev)
 static int
 ti_attach(device_t dev)
 {
-	struct ifnet		*ifp;
-	struct ti_softc		*sc;
-	int			error = 0, rid;
-	u_char			eaddr[6];
+	struct ifnet *ifp;
+	struct ti_softc *sc;
+	int error = 0, rid;
+	u_char eaddr[6];
 
 	sc = device_get_softc(dev);
 	sc->ti_unit = device_get_unit(dev);
@@ -2490,8 +2490,8 @@ fail:
 static int
 ti_detach(device_t dev)
 {
-	struct ti_softc		*sc;
-	struct ifnet		*ifp;
+	struct ti_softc *sc;
+	struct ifnet *ifp;
 
 	sc = device_get_softc(dev);
 	if (sc->dev)
@@ -2616,20 +2616,20 @@ ti_hdr_split(struct mbuf *top, int hdr_l
 static void
 ti_rxeof(struct ti_softc *sc)
 {
-	bus_dmamap_t		map;
-	struct ifnet		*ifp;
-	struct ti_cmd_desc	cmd;
+	struct ifnet *ifp;
+	bus_dmamap_t map;
+	struct ti_cmd_desc cmd;
 
 	TI_LOCK_ASSERT(sc);
 
 	ifp = sc->ti_ifp;
 
 	while (sc->ti_rx_saved_considx != sc->ti_return_prodidx.ti_idx) {
-		struct ti_rx_desc	*cur_rx;
-		u_int32_t		rxidx;
-		struct mbuf		*m = NULL;
-		u_int16_t		vlan_tag = 0;
-		int			have_tag = 0;
+		struct ti_rx_desc *cur_rx;
+		struct mbuf *m = NULL;
+		u_int32_t rxidx;
+		u_int16_t vlan_tag = 0;
+		int have_tag = 0;
 
 		cur_rx =
 		    &sc->ti_rdata->ti_rx_return_ring[sc->ti_rx_saved_considx];
@@ -2749,11 +2749,11 @@ ti_rxeof(struct ti_softc *sc)
 static void
 ti_txeof(struct ti_softc *sc)
 {
-	struct ti_txdesc	*txd;
-	struct ti_tx_desc	txdesc;
-	struct ti_tx_desc	*cur_tx = NULL;
-	struct ifnet		*ifp;
-	int			idx;
+	struct ti_txdesc *txd;
+	struct ti_tx_desc txdesc;
+	struct ti_tx_desc *cur_tx = NULL;
+	struct ifnet *ifp;
+	int idx;
 
 	ifp = sc->ti_ifp;
 
@@ -2795,8 +2795,8 @@ ti_txeof(struct ti_softc *sc)
 static void
 ti_intr(void *xsc)
 {
-	struct ti_softc		*sc;
-	struct ifnet		*ifp;
+	struct ti_softc *sc;
+	struct ifnet *ifp;
 
 	sc = xsc;
 	TI_LOCK(sc);
@@ -2837,7 +2837,7 @@ ti_intr(void *xsc)
 static void
 ti_stats_update(struct ti_softc *sc)
 {
-	struct ifnet		*ifp;
+	struct ifnet *ifp;
 
 	ifp = sc->ti_ifp;
 
@@ -2862,13 +2862,13 @@ ti_stats_update(struct ti_softc *sc)
 static int
 ti_encap(struct ti_softc *sc, struct mbuf **m_head)
 {
-	struct ti_txdesc	*txd;
-	struct ti_tx_desc	*f;
-	struct ti_tx_desc	txdesc;
-	struct mbuf		*m;
-	bus_dma_segment_t	txsegs[TI_MAXTXSEGS];
-	u_int16_t		csum_flags;
-	int			error, frag, i, nseg;
+	struct ti_txdesc *txd;
+	struct ti_tx_desc *f;
+	struct ti_tx_desc txdesc;
+	struct mbuf *m;
+	bus_dma_segment_t txsegs[TI_MAXTXSEGS];
+	u_int16_t csum_flags;
+	int error, frag, i, nseg;
 
 	if ((txd = STAILQ_FIRST(&sc->ti_cdata.ti_txfreeq)) == NULL)
 		return (ENOBUFS);
@@ -2965,7 +2965,7 @@ ti_encap(struct ti_softc *sc, struct mbu
 static void
 ti_start(struct ifnet *ifp)
 {
-	struct ti_softc		*sc;
+	struct ti_softc *sc;
 
 	sc = ifp->if_softc;
 	TI_LOCK(sc);
@@ -2980,9 +2980,9 @@ ti_start(struct ifnet *ifp)
 static void
 ti_start_locked(struct ifnet *ifp)
 {
-	struct ti_softc		*sc;
-	struct mbuf		*m_head = NULL;
-	int			enq = 0;
+	struct ti_softc *sc;
+	struct mbuf *m_head = NULL;
+	int enq = 0;
 
 	sc = ifp->if_softc;
 
@@ -3045,7 +3045,7 @@ ti_start_locked(struct ifnet *ifp)
 static void
 ti_init(void *xsc)
 {
-	struct ti_softc		*sc;
+	struct ti_softc *sc;
 
 	sc = xsc;
 	TI_LOCK(sc);
@@ -3056,7 +3056,7 @@ ti_init(void *xsc)
 static void
 ti_init_locked(void *xsc)
 {
-	struct ti_softc		*sc = xsc;
+	struct ti_softc *sc = xsc;
 
 	/* Cancel pending I/O and flush buffers. */
 	ti_stop(sc);
@@ -3070,11 +3070,11 @@ ti_init_locked(void *xsc)
 
 static void ti_init2(struct ti_softc *sc)
 {
-	struct ti_cmd_desc	cmd;
-	struct ifnet		*ifp;
-	u_int8_t		*ea;
-	struct ifmedia		*ifm;
-	int			tmp;
+	struct ti_cmd_desc cmd;
+	struct ifnet *ifp;
+	u_int8_t *ea;
+	struct ifmedia *ifm;
+	int tmp;
 
 	TI_LOCK_ASSERT(sc);
 
@@ -3160,10 +3160,10 @@ static void ti_init2(struct ti_softc *sc
 static int
 ti_ifmedia_upd(struct ifnet *ifp)
 {
-	struct ti_softc		*sc;
-	struct ifmedia		*ifm;
-	struct ti_cmd_desc	cmd;
-	u_int32_t		flowctl;
+	struct ti_softc *sc;
+	struct ifmedia *ifm;
+	struct ti_cmd_desc cmd;
+	u_int32_t flowctl;
 
 	sc = ifp->if_softc;
 	ifm = &sc->ifmedia;
@@ -3261,8 +3261,8 @@ ti_ifmedia_upd(struct ifnet *ifp)
 static void
 ti_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
 {
-	struct ti_softc		*sc;
-	u_int32_t		media = 0;
+	struct ti_softc *sc;
+	u_int32_t media = 0;
 
 	sc = ifp->if_softc;
 
@@ -3307,10 +3307,10 @@ ti_ifmedia_sts(struct ifnet *ifp, struct
 static int
 ti_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
 {
-	struct ti_softc		*sc = ifp->if_softc;
-	struct ifreq		*ifr = (struct ifreq *) data;
-	int			mask, error = 0;
-	struct ti_cmd_desc	cmd;
+	struct ti_softc *sc = ifp->if_softc;
+	struct ifreq *ifr = (struct ifreq *) data;
+	struct ti_cmd_desc cmd;
+	int mask, error = 0;
 
 	switch (command) {
 	case SIOCSIFMTU:
@@ -3425,8 +3425,8 @@ static int
 ti_ioctl2(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
     struct thread *td)
 {
-	int error;
 	struct ti_softc *sc;
+	int error;
 
 	sc = dev->si_drv1;
 	if (sc == NULL)
@@ -3449,7 +3449,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 	}
 	case TIIOCGETPARAMS:
 	{
-		struct ti_params	*params;
+		struct ti_params *params;
 
 		params = (struct ti_params *)addr;
 
@@ -3531,8 +3531,8 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 		break;
 	}
 	case TIIOCGETTRACE: {
-		struct ti_trace_buf	*trace_buf;
-		u_int32_t		trace_start, cur_trace_ptr, trace_len;
+		struct ti_trace_buf *trace_buf;
+		u_int32_t trace_start, cur_trace_ptr, trace_len;
 
 		trace_buf = (struct ti_trace_buf *)addr;
 
@@ -3697,8 +3697,8 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 static void
 ti_watchdog(void *arg)
 {
-	struct ti_softc		*sc;
-	struct ifnet		*ifp;
+	struct ti_softc *sc;
+	struct ifnet *ifp;
 
 	sc = arg;
 	TI_LOCK_ASSERT(sc);
@@ -3729,8 +3729,8 @@ ti_watchdog(void *arg)
 static void
 ti_stop(struct ti_softc *sc)
 {
-	struct ifnet		*ifp;
-	struct ti_cmd_desc	cmd;
+	struct ifnet *ifp;
+	struct ti_cmd_desc cmd;
 
 	TI_LOCK_ASSERT(sc);
 
@@ -3778,7 +3778,7 @@ ti_stop(struct ti_softc *sc)
 static int
 ti_shutdown(device_t dev)
 {
-	struct ti_softc		*sc;
+	struct ti_softc *sc;
 
 	sc = device_get_softc(dev);
 	TI_LOCK(sc);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 18:39:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B4F50106566C;
	Fri,  4 Nov 2011 18:39:39 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A53A38FC0A;
	Fri,  4 Nov 2011 18:39:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4IddZ0029894;
	Fri, 4 Nov 2011 18:39:39 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4IddCg029892;
	Fri, 4 Nov 2011 18:39:39 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111041839.pA4IddCg029892@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 18:39:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227088 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 18:39:39 -0000

Author: yongari
Date: Fri Nov  4 18:39:39 2011
New Revision: 227088
URL: http://svn.freebsd.org/changeset/base/227088

Log:
  Make ti(4) build with 'options TI_PRIVATE_JUMBOS'.
  This was broken in r175872.
  
  We have a UMA backed jumbo allocator and that is much better
  implementation than having a local jumbo buffer allocator in
  driver. This local allocator would be removed in near future but
  fixing build before removal wouldn't be a bad idea.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 18:28:10 2011	(r227087)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 18:39:39 2011	(r227088)
@@ -1328,7 +1328,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int
 		/* Attach the buffer to the mbuf. */
 		m_new->m_data = (void *) buf;
 		m_new->m_len = m_new->m_pkthdr.len = TI_JUMBO_FRAMELEN;
-		MEXTADD(m_new, buf, TI_JUMBO_FRAMELEN, ti_jfree,
+		MEXTADD(m_new, buf, TI_JUMBO_FRAMELEN, ti_jfree, buf,
 		    (struct ti_softc *)sc, 0, EXT_NET_DRV);
 	} else {
 		m_new = m;

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 19:12:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA5AB106566B;
	Fri,  4 Nov 2011 19:12:07 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C92C98FC13;
	Fri,  4 Nov 2011 19:12:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4JC7bJ030908;
	Fri, 4 Nov 2011 19:12:07 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4JC7Tu030905;
	Fri, 4 Nov 2011 19:12:07 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111041912.pA4JC7Tu030905@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 19:12:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227089 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 19:12:08 -0000

Author: yongari
Date: Fri Nov  4 19:12:07 2011
New Revision: 227089
URL: http://svn.freebsd.org/changeset/base/227089

Log:
  s/u_intXX_t/uintXX_t/g

Modified:
  head/sys/dev/ti/if_ti.c
  head/sys/dev/ti/if_tireg.h

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 18:39:39 2011	(r227088)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 19:12:07 2011	(r227089)
@@ -198,20 +198,20 @@ static int ti_shutdown(device_t);
 static int ti_ifmedia_upd(struct ifnet *);
 static void ti_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 
-static u_int32_t ti_eeprom_putbyte(struct ti_softc *, int);
-static u_int8_t	ti_eeprom_getbyte(struct ti_softc *, int, u_int8_t *);
+static uint32_t ti_eeprom_putbyte(struct ti_softc *, int);
+static uint8_t	ti_eeprom_getbyte(struct ti_softc *, int, uint8_t *);
 static int ti_read_eeprom(struct ti_softc *, caddr_t, int, int);
 
 static void ti_add_mcast(struct ti_softc *, struct ether_addr *);
 static void ti_del_mcast(struct ti_softc *, struct ether_addr *);
 static void ti_setmulti(struct ti_softc *);
 
-static void ti_mem_read(struct ti_softc *, u_int32_t, u_int32_t, void *);
-static void ti_mem_write(struct ti_softc *, u_int32_t, u_int32_t, void *);
-static void ti_mem_zero(struct ti_softc *, u_int32_t, u_int32_t);
-static int ti_copy_mem(struct ti_softc *, u_int32_t, u_int32_t, caddr_t, int,
+static void ti_mem_read(struct ti_softc *, uint32_t, uint32_t, void *);
+static void ti_mem_write(struct ti_softc *, uint32_t, uint32_t, void *);
+static void ti_mem_zero(struct ti_softc *, uint32_t, uint32_t);
+static int ti_copy_mem(struct ti_softc *, uint32_t, uint32_t, caddr_t, int,
     int);
-static int ti_copy_scratch(struct ti_softc *, u_int32_t, u_int32_t, caddr_t,
+static int ti_copy_scratch(struct ti_softc *, uint32_t, uint32_t, caddr_t,
     int, int, int);
 static int ti_bcopy_swap(const void *, void *, size_t, ti_swap_type);
 static void ti_loadfw(struct ti_softc *);
@@ -270,7 +270,7 @@ MODULE_DEPEND(ti, ether, 1, 1, 1);
 /*
  * Send an instruction or address to the EEPROM, check for ACK.
  */
-static u_int32_t
+static uint32_t
 ti_eeprom_putbyte(struct ti_softc *sc, int byte)
 {
 	int i, ack = 0;
@@ -315,11 +315,11 @@ ti_eeprom_putbyte(struct ti_softc *sc, i
  * We have to send two address bytes since the EEPROM can hold
  * more than 256 bytes of data.
  */
-static u_int8_t
-ti_eeprom_getbyte(struct ti_softc *sc, int addr, u_int8_t *dest)
+static uint8_t
+ti_eeprom_getbyte(struct ti_softc *sc, int addr, uint8_t *dest)
 {
 	int i;
-	u_int8_t byte = 0;
+	uint8_t byte = 0;
 
 	EEPROM_START;
 
@@ -393,7 +393,7 @@ static int
 ti_read_eeprom(struct ti_softc *sc, caddr_t dest, int off, int cnt)
 {
 	int err = 0, i;
-	u_int8_t byte = 0;
+	uint8_t byte = 0;
 
 	for (i = 0; i < cnt; i++) {
 		err = ti_eeprom_getbyte(sc, off + i, &byte);
@@ -410,7 +410,7 @@ ti_read_eeprom(struct ti_softc *sc, cadd
  * Can be used to copy data from NIC local memory.
  */
 static void
-ti_mem_read(struct ti_softc *sc, u_int32_t addr, u_int32_t len, void *buf)
+ti_mem_read(struct ti_softc *sc, uint32_t addr, uint32_t len, void *buf)
 {
 	int segptr, segsize, cnt;
 	char *ptr;
@@ -426,7 +426,7 @@ ti_mem_read(struct ti_softc *sc, u_int32
 			segsize = TI_WINLEN - (segptr % TI_WINLEN);
 		CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1)));
 		bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle,
-		    TI_WINDOW + (segptr & (TI_WINLEN - 1)), (u_int32_t *)ptr,
+		    TI_WINDOW + (segptr & (TI_WINLEN - 1)), (uint32_t *)ptr,
 		    segsize / 4);
 		ptr += segsize;
 		segptr += segsize;
@@ -440,7 +440,7 @@ ti_mem_read(struct ti_softc *sc, u_int32
  * Can be used to copy data into NIC local memory.
  */
 static void
-ti_mem_write(struct ti_softc *sc, u_int32_t addr, u_int32_t len, void *buf)
+ti_mem_write(struct ti_softc *sc, uint32_t addr, uint32_t len, void *buf)
 {
 	int segptr, segsize, cnt;
 	char *ptr;
@@ -456,7 +456,7 @@ ti_mem_write(struct ti_softc *sc, u_int3
 			segsize = TI_WINLEN - (segptr % TI_WINLEN);
 		CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1)));
 		bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle,
-		    TI_WINDOW + (segptr & (TI_WINLEN - 1)), (u_int32_t *)ptr,
+		    TI_WINDOW + (segptr & (TI_WINLEN - 1)), (uint32_t *)ptr,
 		    segsize / 4);
 		ptr += segsize;
 		segptr += segsize;
@@ -469,7 +469,7 @@ ti_mem_write(struct ti_softc *sc, u_int3
  * Can be used to clear a section of NIC local memory.
  */
 static void
-ti_mem_zero(struct ti_softc *sc, u_int32_t addr, u_int32_t len)
+ti_mem_zero(struct ti_softc *sc, uint32_t addr, uint32_t len)
 {
 	int segptr, segsize, cnt;
 
@@ -490,13 +490,13 @@ ti_mem_zero(struct ti_softc *sc, u_int32
 }
 
 static int
-ti_copy_mem(struct ti_softc *sc, u_int32_t tigon_addr, u_int32_t len,
+ti_copy_mem(struct ti_softc *sc, uint32_t tigon_addr, uint32_t len,
     caddr_t buf, int useraddr, int readdata)
 {
 	int segptr, segsize, cnt;
 	caddr_t ptr;
-	u_int32_t origwin;
-	u_int8_t tmparray[TI_WINLEN], tmparray2[TI_WINLEN];
+	uint32_t origwin;
+	uint8_t tmparray[TI_WINLEN], tmparray2[TI_WINLEN];
 	int resid, segresid;
 	int first_pass;
 
@@ -559,7 +559,7 @@ ti_copy_mem(struct ti_softc *sc, u_int32
 
 			bus_space_read_region_4(sc->ti_btag,
 						sc->ti_bhandle, ti_offset,
-						(u_int32_t *)tmparray,
+						(uint32_t *)tmparray,
 						segsize >> 2);
 			if (useraddr) {
 				/*
@@ -606,7 +606,7 @@ ti_copy_mem(struct ti_softc *sc, u_int32
 
 			bus_space_write_region_4(sc->ti_btag,
 						 sc->ti_bhandle, ti_offset,
-						 (u_int32_t *)tmparray,
+						 (uint32_t *)tmparray,
 						 segsize >> 2);
 		}
 		segptr += segsize;
@@ -618,7 +618,7 @@ ti_copy_mem(struct ti_softc *sc, u_int32
 	 * Handle leftover, non-word-aligned bytes.
 	 */
 	if (resid != 0) {
-		u_int32_t	tmpval, tmpval2;
+		uint32_t	tmpval, tmpval2;
 		bus_size_t	ti_offset;
 
 		/*
@@ -686,12 +686,12 @@ ti_copy_mem(struct ti_softc *sc, u_int32
 }
 
 static int
-ti_copy_scratch(struct ti_softc *sc, u_int32_t tigon_addr, u_int32_t len,
+ti_copy_scratch(struct ti_softc *sc, uint32_t tigon_addr, uint32_t len,
     caddr_t buf, int useraddr, int readdata, int cpu)
 {
-	u_int32_t segptr;
+	uint32_t segptr;
 	int cnt;
-	u_int32_t tmpval, tmpval2;
+	uint32_t tmpval, tmpval2;
 	caddr_t ptr;
 
 	TI_LOCK_ASSERT(sc);
@@ -782,8 +782,8 @@ ti_copy_scratch(struct ti_softc *sc, u_i
 static int
 ti_bcopy_swap(const void *src, void *dst, size_t len, ti_swap_type swap_type)
 {
-	const u_int8_t *tmpsrc;
-	u_int8_t *tmpdst;
+	const uint8_t *tmpsrc;
+	uint8_t *tmpdst;
 	size_t tmplen;
 
 	if (len & 0x3) {
@@ -798,11 +798,11 @@ ti_bcopy_swap(const void *src, void *dst
 
 	while (tmplen) {
 		if (swap_type == TI_SWAP_NTOH)
-			*(u_int32_t *)tmpdst =
-				ntohl(*(const u_int32_t *)tmpsrc);
+			*(uint32_t *)tmpdst =
+				ntohl(*(const uint32_t *)tmpsrc);
 		else
-			*(u_int32_t *)tmpdst =
-				htonl(*(const u_int32_t *)tmpsrc);
+			*(uint32_t *)tmpdst =
+				htonl(*(const uint32_t *)tmpsrc);
 
 		tmpsrc += 4;
 		tmpdst += 4;
@@ -880,7 +880,7 @@ ti_cmd(struct ti_softc *sc, struct ti_cm
 	int index;
 
 	index = sc->ti_cmd_saved_prodidx;
-	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
+	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(uint32_t *)(cmd));
 	TI_INC(index, TI_CMD_RING_CNT);
 	CSR_WRITE_4(sc, TI_MB_CMDPROD_IDX, index);
 	sc->ti_cmd_saved_prodidx = index;
@@ -897,11 +897,11 @@ ti_cmd_ext(struct ti_softc *sc, struct t
 	int i;
 
 	index = sc->ti_cmd_saved_prodidx;
-	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
+	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(uint32_t *)(cmd));
 	TI_INC(index, TI_CMD_RING_CNT);
 	for (i = 0; i < len; i++) {
 		CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4),
-		    *(u_int32_t *)(&arg[i * 4]));
+		    *(uint32_t *)(&arg[i * 4]));
 		TI_INC(index, TI_CMD_RING_CNT);
 	}
 	CSR_WRITE_4(sc, TI_MB_CMDPROD_IDX, index);
@@ -1688,10 +1688,10 @@ static void
 ti_add_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
 	struct ti_cmd_desc cmd;
-	u_int16_t *m;
-	u_int32_t ext[2] = {0, 0};
+	uint16_t *m;
+	uint32_t ext[2] = {0, 0};
 
-	m = (u_int16_t *)&addr->octet[0];
+	m = (uint16_t *)&addr->octet[0];
 
 	switch (sc->ti_hwrev) {
 	case TI_HWREV_TIGON:
@@ -1714,10 +1714,10 @@ static void
 ti_del_mcast(struct ti_softc *sc, struct ether_addr *addr)
 {
 	struct ti_cmd_desc cmd;
-	u_int16_t *m;
-	u_int32_t ext[2] = {0, 0};
+	uint16_t *m;
+	uint32_t ext[2] = {0, 0};
 
-	m = (u_int16_t *)&addr->octet[0];
+	m = (uint16_t *)&addr->octet[0];
 
 	switch (sc->ti_hwrev) {
 	case TI_HWREV_TIGON:
@@ -1757,7 +1757,7 @@ ti_setmulti(struct ti_softc *sc)
 	struct ifmultiaddr *ifma;
 	struct ti_cmd_desc cmd;
 	struct ti_mc_entry *mc;
-	u_int32_t intrs;
+	uint32_t intrs;
 
 	TI_LOCK_ASSERT(sc);
 
@@ -1838,9 +1838,9 @@ static int ti_64bitslot_war(struct ti_so
 static int
 ti_chipinit(struct ti_softc *sc)
 {
-	u_int32_t cacheline;
-	u_int32_t pci_writemax = 0;
-	u_int32_t hdrsplit;
+	uint32_t cacheline;
+	uint32_t pci_writemax = 0;
+	uint32_t hdrsplit;
 
 	/* Initialize link to down state. */
 	sc->ti_linkstat = TI_EV_CODE_LINK_DOWN;
@@ -2627,8 +2627,8 @@ ti_rxeof(struct ti_softc *sc)
 	while (sc->ti_rx_saved_considx != sc->ti_return_prodidx.ti_idx) {
 		struct ti_rx_desc *cur_rx;
 		struct mbuf *m = NULL;
-		u_int32_t rxidx;
-		u_int16_t vlan_tag = 0;
+		uint32_t rxidx;
+		uint16_t vlan_tag = 0;
 		int have_tag = 0;
 
 		cur_rx =
@@ -2867,7 +2867,7 @@ ti_encap(struct ti_softc *sc, struct mbu
 	struct ti_tx_desc txdesc;
 	struct mbuf *m;
 	bus_dma_segment_t txsegs[TI_MAXTXSEGS];
-	u_int16_t csum_flags;
+	uint16_t csum_flags;
 	int error, frag, i, nseg;
 
 	if ((txd = STAILQ_FIRST(&sc->ti_cdata.ti_txfreeq)) == NULL)
@@ -3072,7 +3072,7 @@ static void ti_init2(struct ti_softc *sc
 {
 	struct ti_cmd_desc cmd;
 	struct ifnet *ifp;
-	u_int8_t *ea;
+	uint8_t *ea;
 	struct ifmedia *ifm;
 	int tmp;
 
@@ -3163,7 +3163,7 @@ ti_ifmedia_upd(struct ifnet *ifp)
 	struct ti_softc *sc;
 	struct ifmedia *ifm;
 	struct ti_cmd_desc cmd;
-	u_int32_t flowctl;
+	uint32_t flowctl;
 
 	sc = ifp->if_softc;
 	ifm = &sc->ifmedia;
@@ -3262,7 +3262,7 @@ static void
 ti_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
 {
 	struct ti_softc *sc;
-	u_int32_t media = 0;
+	uint32_t media = 0;
 
 	sc = ifp->if_softc;
 
@@ -3532,7 +3532,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 	}
 	case TIIOCGETTRACE: {
 		struct ti_trace_buf *trace_buf;
-		u_int32_t trace_start, cur_trace_ptr, trace_len;
+		uint32_t trace_start, cur_trace_ptr, trace_len;
 
 		trace_buf = (struct ti_trace_buf *)addr;
 
@@ -3593,7 +3593,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 	case ALT_WRITE_TG_MEM:
 	{
 		struct tg_mem *mem_param;
-		u_int32_t sram_end, scratch_end;
+		uint32_t sram_end, scratch_end;
 
 		mem_param = (struct tg_mem *)addr;
 
@@ -3655,7 +3655,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 	case ALT_WRITE_TG_REG:
 	{
 		struct tg_reg	*regs;
-		u_int32_t	tmpval;
+		uint32_t	tmpval;
 
 		regs = (struct tg_reg *)addr;
 

Modified: head/sys/dev/ti/if_tireg.h
==============================================================================
--- head/sys/dev/ti/if_tireg.h	Fri Nov  4 18:39:39 2011	(r227088)
+++ head/sys/dev/ti/if_tireg.h	Fri Nov  4 19:12:07 2011	(r227089)
@@ -477,8 +477,8 @@
  */
 
 typedef struct {
-	u_int32_t	ti_addr_hi;
-	u_int32_t	ti_addr_lo;
+	uint32_t	ti_addr_hi;
+	uint32_t	ti_addr_lo;
 } ti_hostaddr;
 
 #define TI_HOSTADDR(x)		x.ti_addr_lo
@@ -516,13 +516,13 @@ ti_hostaddr64(ti_hostaddr *x, bus_addr_t
 struct ti_rcb {
 	ti_hostaddr		ti_hostaddr;
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_max_len;
-	u_int16_t		ti_flags;
+	uint16_t		ti_max_len;
+	uint16_t		ti_flags;
 #else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_max_len;
+	uint16_t		ti_flags;
+	uint16_t		ti_max_len;
 #endif
-	u_int32_t		ti_unused;
+	uint32_t		ti_unused;
 };
 
 #define TI_RCB_FLAG_TCP_UDP_CKSUM	0x00000001
@@ -536,8 +536,8 @@ struct ti_rcb {
 #define TI_RCB_FLAG_RING_DISABLED	0x00000200
 
 struct ti_producer {
-	u_int32_t		ti_idx;
-	u_int32_t		ti_unused;
+	uint32_t		ti_idx;
+	uint32_t		ti_unused;
 };
 
 /*
@@ -571,35 +571,35 @@ struct ti_gib {
 struct ti_rx_desc {
 	ti_hostaddr		ti_addr;
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_idx;
-	u_int16_t		ti_len;
+	uint16_t		ti_idx;
+	uint16_t		ti_len;
 #else
-	u_int16_t		ti_len;
-	u_int16_t		ti_idx;
+	uint16_t		ti_len;
+	uint16_t		ti_idx;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_type;
-	u_int16_t		ti_flags;
+	uint16_t		ti_type;
+	uint16_t		ti_flags;
 #else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_type;
+	uint16_t		ti_flags;
+	uint16_t		ti_type;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_ip_cksum;
-	u_int16_t		ti_tcp_udp_cksum;
+	uint16_t		ti_ip_cksum;
+	uint16_t		ti_tcp_udp_cksum;
 #else
-	u_int16_t		ti_tcp_udp_cksum;
-	u_int16_t		ti_ip_cksum;
+	uint16_t		ti_tcp_udp_cksum;
+	uint16_t		ti_ip_cksum;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_error_flags;
-	u_int16_t		ti_vlan_tag;
+	uint16_t		ti_error_flags;
+	uint16_t		ti_vlan_tag;
 #else
-	u_int16_t		ti_vlan_tag;
-	u_int16_t		ti_error_flags;
+	uint16_t		ti_vlan_tag;
+	uint16_t		ti_error_flags;
 #endif
-	u_int32_t		ti_rsvd;
-	u_int32_t		ti_opaque;
+	uint32_t		ti_rsvd;
+	uint32_t		ti_opaque;
 };
 
 struct ti_rx_desc_ext {
@@ -607,50 +607,50 @@ struct ti_rx_desc_ext {
 	ti_hostaddr		ti_addr2;
 	ti_hostaddr		ti_addr3;
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_len1;
-	u_int16_t		ti_len2;
+	uint16_t		ti_len1;
+	uint16_t		ti_len2;
 #else
-	u_int16_t		ti_len2;
-	u_int16_t		ti_len1;
+	uint16_t		ti_len2;
+	uint16_t		ti_len1;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_len3;
-	u_int16_t		ti_rsvd0;
+	uint16_t		ti_len3;
+	uint16_t		ti_rsvd0;
 #else
-	u_int16_t		ti_rsvd0;
-	u_int16_t		ti_len3;
+	uint16_t		ti_rsvd0;
+	uint16_t		ti_len3;
 #endif
 	ti_hostaddr		ti_addr0;
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_idx;
-	u_int16_t		ti_len0;
+	uint16_t		ti_idx;
+	uint16_t		ti_len0;
 #else
-	u_int16_t		ti_len0;
-	u_int16_t		ti_idx;
+	uint16_t		ti_len0;
+	uint16_t		ti_idx;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_type;
-	u_int16_t		ti_flags;
+	uint16_t		ti_type;
+	uint16_t		ti_flags;
 #else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_type;
+	uint16_t		ti_flags;
+	uint16_t		ti_type;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_ip_cksum;
-	u_int16_t		ti_tcp_udp_cksum;
+	uint16_t		ti_ip_cksum;
+	uint16_t		ti_tcp_udp_cksum;
 #else
-	u_int16_t		ti_tcp_udp_cksum;
-	u_int16_t		ti_ip_cksum;
+	uint16_t		ti_tcp_udp_cksum;
+	uint16_t		ti_ip_cksum;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_error_flags;
-	u_int16_t		ti_vlan_tag;
+	uint16_t		ti_error_flags;
+	uint16_t		ti_vlan_tag;
 #else
-	u_int16_t		ti_vlan_tag;
-	u_int16_t		ti_error_flags;
+	uint16_t		ti_vlan_tag;
+	uint16_t		ti_error_flags;
 #endif
-	u_int32_t		ti_rsvd1;
-	u_int32_t		ti_opaque;
+	uint32_t		ti_rsvd1;
+	uint32_t		ti_opaque;
 };
 
 /*
@@ -659,18 +659,18 @@ struct ti_rx_desc_ext {
 struct ti_tx_desc {
 	ti_hostaddr		ti_addr;
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_len;
-	u_int16_t		ti_flags;
+	uint16_t		ti_len;
+	uint16_t		ti_flags;
 #else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_len;
+	uint16_t		ti_flags;
+	uint16_t		ti_len;
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_rsvd;
-	u_int16_t		ti_vlan_tag;
+	uint16_t		ti_rsvd;
+	uint16_t		ti_vlan_tag;
 #else
-	u_int16_t		ti_vlan_tag;
-	u_int16_t		ti_rsvd;
+	uint16_t		ti_vlan_tag;
+	uint16_t		ti_rsvd;
 #endif
 };
 
@@ -753,7 +753,7 @@ struct ti_tx_desc {
  * Tigon command structure.
  */
 struct ti_cmd_desc {
-	u_int32_t		ti_cmdx;
+	uint32_t		ti_cmdx;
 };
 
 #define TI_CMD_CMD(cmd)		(((((cmd)->ti_cmdx)) >> 24) & 0xff)
@@ -842,8 +842,8 @@ struct ti_cmd_desc {
  * Tigon event structure.
  */
 struct ti_event_desc {
-	u_int32_t		ti_eventx;
-	u_int32_t		ti_rsvd;
+	uint32_t		ti_eventx;
+	uint32_t		ti_rsvd;
 };
 
 #define TI_EVENT_EVENT(e)	(((((e)->ti_eventx)) >> 24) & 0xff)
@@ -898,8 +898,8 @@ struct ti_event_desc {
 #define TI_JSLOTS	256
 
 #define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN)
-#define TI_JLEN (TI_JRAWLEN + (sizeof(u_int64_t) - \
-	(TI_JRAWLEN % sizeof(u_int64_t))))
+#define TI_JLEN (TI_JRAWLEN + (sizeof(uint64_t) - \
+	(TI_JRAWLEN % sizeof(uint64_t))))
 #define TI_JPAGESZ PAGE_SIZE
 #define TI_RESID (TI_JPAGESZ - (TI_JLEN * TI_JSLOTS) % TI_JPAGESZ)
 #define TI_JMEM ((TI_JLEN * TI_JSLOTS) + TI_RESID)
@@ -934,11 +934,11 @@ struct ti_ring_data {
 	 * line boundaries.
 	 */
 	struct ti_producer	ti_ev_prodidx_r;
-	u_int32_t		ti_pad0[6];
+	uint32_t		ti_pad0[6];
 	struct ti_producer	ti_return_prodidx_r;
-	u_int32_t		ti_pad1[6];
+	uint32_t		ti_pad1[6];
 	struct ti_producer	ti_tx_considx_r;
-	u_int32_t		ti_pad2[6];
+	uint32_t		ti_pad2[6];
 	struct ti_gib		ti_info;
 };
 
@@ -965,8 +965,8 @@ struct ti_chain_data {
 };
 
 struct ti_type {
-	u_int16_t		ti_vid;
-	u_int16_t		ti_did;
+	uint16_t		ti_vid;
+	uint16_t		ti_did;
 	const char		*ti_name;
 };
 
@@ -1000,10 +1000,10 @@ struct ti_softc {
 	struct resource		*ti_irq;
 	struct resource		*ti_res;
 	struct ifmedia		ifmedia;	/* media info */
-	u_int8_t		ti_unit;	/* interface number */
-	u_int8_t		ti_hwrev;	/* Tigon rev (1 or 2) */
-	u_int8_t		ti_copper;	/* 1000baseTX card */
-	u_int8_t		ti_linkstat;	/* Link state */
+	uint8_t			ti_unit;	/* interface number */
+	uint8_t			ti_hwrev;	/* Tigon rev (1 or 2) */
+	uint8_t			ti_copper;	/* 1000baseTX card */
+	uint8_t			ti_linkstat;	/* Link state */
 	int			ti_hdrsplit;	/* enable header splitting */
 	bus_dma_tag_t		ti_parent_dmat;
 	bus_dma_tag_t		ti_jumbo_dmat;
@@ -1029,12 +1029,12 @@ struct ti_softc {
 	SLIST_HEAD(__ti_mchead, ti_mc_entry)	ti_mc_listhead;
 	SLIST_HEAD(__ti_jfreehead, ti_jpool_entry)	ti_jfree_listhead;
 	SLIST_HEAD(__ti_jinusehead, ti_jpool_entry)	ti_jinuse_listhead;
-	u_int32_t		ti_stat_ticks;
-	u_int32_t		ti_rx_coal_ticks;
-	u_int32_t		ti_tx_coal_ticks;
-	u_int32_t		ti_rx_max_coal_bds;
-	u_int32_t		ti_tx_max_coal_bds;
-	u_int32_t		ti_tx_buf_ratio;
+	uint32_t		ti_stat_ticks;
+	uint32_t		ti_rx_coal_ticks;
+	uint32_t		ti_tx_coal_ticks;
+	uint32_t		ti_rx_max_coal_bds;
+	uint32_t		ti_tx_max_coal_bds;
+	uint32_t		ti_tx_buf_ratio;
 	int			ti_if_flags;
 	int			ti_txcnt;
 	struct mtx		ti_mtx;

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 19:56:34 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 98BF8106567F;
	Fri,  4 Nov 2011 19:56:34 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 86E968FC08;
	Fri,  4 Nov 2011 19:56:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4JuYaN032221;
	Fri, 4 Nov 2011 19:56:34 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4JuYB1032219;
	Fri, 4 Nov 2011 19:56:34 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201111041956.pA4JuYB1032219@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 4 Nov 2011 19:56:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227090 - head/lib/libc/stdlib
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 19:56:34 -0000

Author: ed
Date: Fri Nov  4 19:56:34 2011
New Revision: 227090
URL: http://svn.freebsd.org/changeset/base/227090

Log:
  Fix a warning emitted by Clang.
  
  The size passed to strlcat() must depend on the input length, not the
  output length. Because the input and output buffers are equal in size,
  the resulting binary does not change at all.

Modified:
  head/lib/libc/stdlib/realpath.c

Modified: head/lib/libc/stdlib/realpath.c
==============================================================================
--- head/lib/libc/stdlib/realpath.c	Fri Nov  4 19:12:07 2011	(r227089)
+++ head/lib/libc/stdlib/realpath.c	Fri Nov  4 19:56:34 2011	(r227090)
@@ -212,7 +212,8 @@ realpath(const char * __restrict path, c
 					symlink[slen] = '/';
 					symlink[slen + 1] = 0;
 				}
-				left_len = strlcat(symlink, left, sizeof(left));
+				left_len = strlcat(symlink, left,
+				    sizeof(symlink));
 				if (left_len >= sizeof(left)) {
 					if (m)
 						free(resolved);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 20:25:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D87D7106564A;
	Fri,  4 Nov 2011 20:25:30 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C8B048FC0A;
	Fri,  4 Nov 2011 20:25:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4KPU8X033166;
	Fri, 4 Nov 2011 20:25:30 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4KPUnb033164;
	Fri, 4 Nov 2011 20:25:30 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111042025.pA4KPUnb033164@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 20:25:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227091 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 20:25:30 -0000

Author: yongari
Date: Fri Nov  4 20:25:30 2011
New Revision: 227091
URL: http://svn.freebsd.org/changeset/base/227091

Log:
  Make sure to unload loaded DMA area(descriptor, command, event ring).

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 19:56:34 2011	(r227090)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 20:25:30 2011	(r227091)
@@ -2522,6 +2522,8 @@ ti_detach(device_t dev)
 		bus_dma_tag_destroy(sc->ti_mbuftx_dmat);
 	if (sc->ti_mbufrx_dmat)
 		bus_dma_tag_destroy(sc->ti_mbufrx_dmat);
+	if (sc->ti_rdata && sc->ti_rdata_dmamap)
+		bus_dmamap_unload(sc->ti_rdata_dmat, sc->ti_rdata_dmamap);
 	if (sc->ti_rdata)
 		bus_dmamem_free(sc->ti_rdata_dmat, sc->ti_rdata,
 				sc->ti_rdata_dmamap);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 20:43:38 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3C321106566B;
	Fri,  4 Nov 2011 20:43:38 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 12D978FC1A;
	Fri,  4 Nov 2011 20:43:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4Khb0q033798;
	Fri, 4 Nov 2011 20:43:37 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4Khb6Z033796;
	Fri, 4 Nov 2011 20:43:37 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111042043.pA4Khb6Z033796@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 20:43:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227092 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 20:43:38 -0000

Author: yongari
Date: Fri Nov  4 20:43:37 2011
New Revision: 227092
URL: http://svn.freebsd.org/changeset/base/227092

Log:
  Announce IFCAP_LINKSTATE capability and let network stack know link
  state changes.  Hide superfluous link up/down message under
  bootverbose since if_link_state_change(9) shows that information.
  While I'm here, change baudrate with the resolved speed of the
  established link instead of blindly setting it 1G. Unfortunately,
  it seems there is no way to differentiate 10/100Mbps from
  non-gigabit link so just assume we established a 100Mbps link if
  current link is not a gigabit link.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 20:25:30 2011	(r227091)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 20:43:37 2011	(r227092)
@@ -924,12 +924,26 @@ ti_handle_events(struct ti_softc *sc)
 		switch (TI_EVENT_EVENT(e)) {
 		case TI_EV_LINKSTAT_CHANGED:
 			sc->ti_linkstat = TI_EVENT_CODE(e);
-			if (sc->ti_linkstat == TI_EV_CODE_LINK_UP)
-				device_printf(sc->ti_dev, "10/100 link up\n");
-			else if (sc->ti_linkstat == TI_EV_CODE_GIG_LINK_UP)
-				device_printf(sc->ti_dev, "gigabit link up\n");
-			else if (sc->ti_linkstat == TI_EV_CODE_LINK_DOWN)
-				device_printf(sc->ti_dev, "link down\n");
+			if (sc->ti_linkstat == TI_EV_CODE_LINK_UP) {
+				if_link_state_change(sc->ti_ifp, LINK_STATE_UP);
+				sc->ti_ifp->if_baudrate = IF_Mbps(100);
+				if (bootverbose)
+					device_printf(sc->ti_dev,
+					    "10/100 link up\n");
+			} else if (sc->ti_linkstat == TI_EV_CODE_GIG_LINK_UP) {
+				if_link_state_change(sc->ti_ifp, LINK_STATE_UP);
+				sc->ti_ifp->if_baudrate = IF_Gbps(1UL);
+				if (bootverbose)
+					device_printf(sc->ti_dev,
+					    "gigabit link up\n");
+			} else if (sc->ti_linkstat == TI_EV_CODE_LINK_DOWN) {
+				if_link_state_change(sc->ti_ifp,
+				    LINK_STATE_DOWN);
+				sc->ti_ifp->if_baudrate = 0;
+				if (bootverbose)
+					device_printf(sc->ti_dev,
+					    "link down\n");
+			}
 			break;
 		case TI_EV_ERROR:
 			if (TI_EVENT_CODE(e) == TI_EV_CODE_ERR_INVAL_CMD)
@@ -2417,7 +2431,7 @@ ti_attach(device_t dev)
 	ifp->if_ioctl = ti_ioctl;
 	ifp->if_start = ti_start;
 	ifp->if_init = ti_init;
-	ifp->if_baudrate = 1000000000;
+	ifp->if_baudrate = IF_Gbps(1UL);
 	ifp->if_snd.ifq_maxlen = TI_TX_RING_CNT - 1;
 
 	/* Set up ifmedia support. */
@@ -2464,6 +2478,10 @@ ti_attach(device_t dev)
 	 */
 	ether_ifattach(ifp, eaddr);
 
+	/* Driver supports link state tracking. */
+	ifp->if_capabilities |= IFCAP_LINKSTATE;
+	ifp->if_capenable |= IFCAP_LINKSTATE;
+
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->ti_irq, INTR_TYPE_NET|INTR_MPSAFE,
 	   NULL, ti_intr, sc, &sc->ti_intrhand);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 21:30:46 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D745B1065675;
	Fri,  4 Nov 2011 21:30:46 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AE0568FC0A;
	Fri,  4 Nov 2011 21:30:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4LUkRE035309;
	Fri, 4 Nov 2011 21:30:46 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4LUkO6035307;
	Fri, 4 Nov 2011 21:30:46 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111042130.pA4LUkO6035307@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 21:30:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227093 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 21:30:46 -0000

Author: yongari
Date: Fri Nov  4 21:30:46 2011
New Revision: 227093
URL: http://svn.freebsd.org/changeset/base/227093

Log:
  Introduce ti_ifmedia_upd_locked() to use in driver initialization
  and add missing driver lock for both ti_ifmedia_upd() and
  ti_ifmedia_sts().

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 20:43:37 2011	(r227092)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 21:30:46 2011	(r227093)
@@ -196,6 +196,7 @@ static void ti_stop(struct ti_softc *);
 static void ti_watchdog(void *);
 static int ti_shutdown(device_t);
 static int ti_ifmedia_upd(struct ifnet *);
+static int ti_ifmedia_upd_locked(struct ti_softc *);
 static void ti_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 
 static uint32_t ti_eeprom_putbyte(struct ti_softc *, int);
@@ -3170,7 +3171,7 @@ static void ti_init2(struct ti_softc *sc
 	ifm = &sc->ifmedia;
 	tmp = ifm->ifm_media;
 	ifm->ifm_media = ifm->ifm_cur->ifm_media;
-	ti_ifmedia_upd(ifp);
+	ti_ifmedia_upd_locked(sc);
 	ifm->ifm_media = tmp;
 }
 
@@ -3181,11 +3182,23 @@ static int
 ti_ifmedia_upd(struct ifnet *ifp)
 {
 	struct ti_softc *sc;
+	int error;
+
+	sc = ifp->if_softc;
+	TI_LOCK(sc);
+	error = ti_ifmedia_upd(ifp);
+	TI_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+ti_ifmedia_upd_locked(struct ti_softc *sc)
+{
 	struct ifmedia *ifm;
 	struct ti_cmd_desc cmd;
 	uint32_t flowctl;
 
-	sc = ifp->if_softc;
 	ifm = &sc->ifmedia;
 
 	if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
@@ -3286,11 +3299,15 @@ ti_ifmedia_sts(struct ifnet *ifp, struct
 
 	sc = ifp->if_softc;
 
+	TI_LOCK(sc);
+
 	ifmr->ifm_status = IFM_AVALID;
 	ifmr->ifm_active = IFM_ETHER;
 
-	if (sc->ti_linkstat == TI_EV_CODE_LINK_DOWN)
+	if (sc->ti_linkstat == TI_EV_CODE_LINK_DOWN) {
+		TI_UNLOCK(sc);
 		return;
+	}
 
 	ifmr->ifm_status |= IFM_ACTIVE;
 
@@ -3322,6 +3339,7 @@ ti_ifmedia_sts(struct ifnet *ifp, struct
 		if (media & TI_LNK_HALF_DUPLEX)
 			ifmr->ifm_active |= IFM_HDX;
 	}
+	TI_UNLOCK(sc);
 }
 
 static int

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 21:42:14 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B34C106566B;
	Fri,  4 Nov 2011 21:42:14 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B3038FC15;
	Fri,  4 Nov 2011 21:42:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4LgE91035665;
	Fri, 4 Nov 2011 21:42:14 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4LgE89035663;
	Fri, 4 Nov 2011 21:42:14 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111042142.pA4LgE89035663@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 21:42:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227094 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 21:42:14 -0000

Author: yongari
Date: Fri Nov  4 21:42:13 2011
New Revision: 227094
URL: http://svn.freebsd.org/changeset/base/227094

Log:
  Don't clear upper 4bits from VLAN tag information.  It's
  responsibility of vlan(4) to extract VLAN id from the tag
  information and vlan(4) correctly handles it.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 21:30:46 2011	(r227093)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 21:42:13 2011	(r227094)
@@ -2659,7 +2659,7 @@ ti_rxeof(struct ti_softc *sc)
 
 		if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) {
 			have_tag = 1;
-			vlan_tag = cur_rx->ti_vlan_tag & 0xfff;
+			vlan_tag = cur_rx->ti_vlan_tag;
 		}
 
 		if (cur_rx->ti_flags & TI_BDFLAG_JUMBO_RING) {
@@ -2954,7 +2954,7 @@ ti_encap(struct ti_softc *sc, struct mbu
 		f->ti_flags = csum_flags;
 		if (m->m_flags & M_VLANTAG) {
 			f->ti_flags |= TI_BDFLAG_VLAN_TAG;
-			f->ti_vlan_tag = m->m_pkthdr.ether_vtag & 0xfff;
+			f->ti_vlan_tag = m->m_pkthdr.ether_vtag;
 		} else {
 			f->ti_vlan_tag = 0;
 		}

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 22:53:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2D5A01065676;
	Fri,  4 Nov 2011 22:53:53 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 12F9B8FC0C;
	Fri,  4 Nov 2011 22:53:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4Mrqan037884;
	Fri, 4 Nov 2011 22:53:52 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4Mrqkm037882;
	Fri, 4 Nov 2011 22:53:52 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111042253.pA4Mrqkm037882@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 22:53:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227095 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 22:53:53 -0000

Author: yongari
Date: Fri Nov  4 22:53:52 2011
New Revision: 227095
URL: http://svn.freebsd.org/changeset/base/227095

Log:
  Don't abuse if_hwassist and make sure enabling corresponding TX/RX
  checksum offloading and VLAN hardware tag insertion/stripping from
  the currently enabled hardware offloading capabilities.
  Previously if_hwassist, which was initialized to TX/RX checksum
  offloading, was blindly used to enable both TX and RX checksum
  offloading such that disabling either TX or RX checksum offloading
  was not possible.
  
  ti(4) controllers support TX/RX checksum offloading with VLAN
  tagging so announce TX/RX checksum offloading capability over VLAN
  to vlan(4).
  
  Make VLAN hardware tag insertion/stripping honors currently enabled
  interface capability instead of blindly enabling VLAN hardware
  tagging. This change allows disabling hardware support of VLAN tag.
  
  Because ti(4) supports VLAN oversized frames, make network stack
  know the capability by setting if_hdrlen.
  
  While I'm here, rewrite SIOCSIFCAP handler and make sure to
  reinitialize controller whenever TX/RX checksum offloading and VLAN
  hardware tagging option is changed.  The requirement of controller
  reinitialization comes from the limitation of Tigon I/II firmware.
  Tigon I/II firmware requires all related RCBs should be
  reinitialized whenever any of its hardware offloading capabilities
  change.
  
  vlan(4) is also notified whenever the parent interface's capability
  changes such that it can correctly handle TX/RX checksum offloading
  based on parent interface's enabled offloading capabilities.
  
  RX checksum offloading handler was changed to make upper stack use
  controller computed partial checksum value.  Previously, ti(4) just
  set the computed value for any frames(IPv4, IPv6) and the value was
  not used in upper stack because driver didn't set CSUM_DATA_VALID
  such that upper network stack had to recompute checksum of TCP/UDP
  packets. I have no idea how this was not noticed for a long time.
  With this change, upper network stack does not have to fully
  recompute the checksum such that calculating pseudo checksum based
  on partial checksum is sufficient to know whether received packet's
  checksum is correct or not. However, I don't know why ti(4) does
  not have controller compute pseudo checksum as controller has
  ability to do it. I'm just guessing enabling that feature could
  trigger a firmware bug or could be slower than computing it on host
  side so just leave it as it was.
  
  In order not to produce false positives, ti(4) now checks whether
  controller actually computed IP or TCP/UDP checksum by checking
  ti_flags field.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 21:42:13 2011	(r227094)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 22:53:52 2011	(r227095)
@@ -1252,7 +1252,7 @@ ti_newbuf_std(struct ti_softc *sc, int i
 	r->ti_len = segs.ds_len;
 	r->ti_type = TI_BDTYPE_RECV_BD;
 	r->ti_flags = 0;
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM)
 		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM;
 	r->ti_idx = i;
 
@@ -1299,7 +1299,7 @@ ti_newbuf_mini(struct ti_softc *sc, int 
 	r->ti_len = segs.ds_len;
 	r->ti_type = TI_BDTYPE_RECV_BD;
 	r->ti_flags = TI_BDFLAG_MINI_RING;
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM)
 		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM;
 	r->ti_idx = i;
 
@@ -1365,7 +1365,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int
 	r->ti_len = segs.ds_len;
 	r->ti_type = TI_BDTYPE_RECV_JUMBO_BD;
 	r->ti_flags = TI_BDFLAG_JUMBO_RING;
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM)
 		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM;
 	r->ti_idx = i;
 
@@ -1507,7 +1507,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int
 
 	r->ti_flags = TI_BDFLAG_JUMBO_RING|TI_RCB_FLAG_USE_EXT_RX_BD;
 
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM)
 		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM|TI_BDFLAG_IP_CKSUM;
 
 	r->ti_idx = idx;
@@ -1860,11 +1860,6 @@ ti_chipinit(struct ti_softc *sc)
 	/* Initialize link to down state. */
 	sc->ti_linkstat = TI_EV_CODE_LINK_DOWN;
 
-	if (sc->ti_ifp->if_capenable & IFCAP_HWCSUM)
-		sc->ti_ifp->if_hwassist = TI_CSUM_FEATURES;
-	else
-		sc->ti_ifp->if_hwassist = 0;
-
 	/* Set endianness before we access any non-PCI registers. */
 #if 0 && BYTE_ORDER == BIG_ENDIAN
 	CSR_WRITE_4(sc, TI_MISC_HOST_CTL,
@@ -1983,7 +1978,7 @@ ti_chipinit(struct ti_softc *sc)
 	 * the firmware racks up lots of nicDmaReadRingFull
 	 * errors.  This is not compatible with hardware checksums.
 	 */
-	if (sc->ti_ifp->if_hwassist == 0)
+	if ((sc->ti_ifp->if_capenable & (IFCAP_TXCSUM | IFCAP_RXCSUM)) == 0)
 		TI_SETBIT(sc, TI_GCR_OPMODE, TI_OPMODE_1_DMA_ACTIVE);
 
 	/* Recommended settings from Tigon manual. */
@@ -2070,10 +2065,11 @@ ti_gibinit(struct ti_softc *sc)
 	TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_std_ring);
 	rcb->ti_max_len = TI_FRAMELEN;
 	rcb->ti_flags = 0;
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM)
 		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
 		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
+	if (sc->ti_ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
+		rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
 
 	/* Set up the jumbo receive ring. */
 	rcb = &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb;
@@ -2086,10 +2082,11 @@ ti_gibinit(struct ti_softc *sc)
 	rcb->ti_max_len = PAGE_SIZE;
 	rcb->ti_flags = TI_RCB_FLAG_USE_EXT_RX_BD;
 #endif
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM)
 		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
 		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
+	if (sc->ti_ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
+		rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
 
 	/*
 	 * Set up the mini ring. Only activated on the
@@ -2103,10 +2100,11 @@ ti_gibinit(struct ti_softc *sc)
 		rcb->ti_flags = TI_RCB_FLAG_RING_DISABLED;
 	else
 		rcb->ti_flags = 0;
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM)
 		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
 		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
+	if (sc->ti_ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
+		rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
 
 	/*
 	 * Set up the receive return ring.
@@ -2135,8 +2133,9 @@ ti_gibinit(struct ti_softc *sc)
 		rcb->ti_flags = 0;
 	else
 		rcb->ti_flags = TI_RCB_FLAG_HOST_RING;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
-	if (sc->ti_ifp->if_hwassist)
+	if (sc->ti_ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
+		rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
+	if (sc->ti_ifp->if_capenable & IFCAP_TXCSUM)
 		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
 		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
 	rcb->ti_max_len = TI_TX_RING_CNT;
@@ -2236,8 +2235,8 @@ ti_attach(device_t dev)
 		error = ENOSPC;
 		goto fail;
 	}
-	sc->ti_ifp->if_capabilities = IFCAP_HWCSUM |
-	    IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
+	sc->ti_ifp->if_hwassist = TI_CSUM_FEATURES;
+	sc->ti_ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM;
 	sc->ti_ifp->if_capenable = sc->ti_ifp->if_capabilities;
 
 	/*
@@ -2479,6 +2478,13 @@ ti_attach(device_t dev)
 	 */
 	ether_ifattach(ifp, eaddr);
 
+	/* VLAN capability setup. */
+	ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM |
+	    IFCAP_VLAN_HWTAGGING;
+	ifp->if_capenable = ifp->if_capabilities;
+	/* Tell the upper layer we support VLAN over-sized frames. */
+	ifp->if_hdrlen = sizeof(struct ether_vlan_header);
+
 	/* Driver supports link state tracking. */
 	ifp->if_capabilities |= IFCAP_LINKSTATE;
 	ifp->if_capenable |= IFCAP_LINKSTATE;
@@ -2736,12 +2742,17 @@ ti_rxeof(struct ti_softc *sc)
 		ifp->if_ipackets++;
 		m->m_pkthdr.rcvif = ifp;
 
-		if (ifp->if_hwassist) {
-			m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED |
-			    CSUM_DATA_VALID;
-			if ((cur_rx->ti_ip_cksum ^ 0xffff) == 0)
-				m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
-			m->m_pkthdr.csum_data = cur_rx->ti_tcp_udp_cksum;
+		if (ifp->if_capenable & IFCAP_RXCSUM) {
+			if (cur_rx->ti_flags & TI_BDFLAG_IP_CKSUM) {
+				m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
+				if ((cur_rx->ti_ip_cksum ^ 0xffff) == 0)
+					m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
+			}
+			if (cur_rx->ti_flags & TI_BDFLAG_TCP_UDP_CKSUM) {
+				m->m_pkthdr.csum_data =
+				    cur_rx->ti_tcp_udp_cksum;
+				m->m_pkthdr.csum_flags |= CSUM_DATA_VALID;
+			}
 		}
 
 		/*
@@ -3406,15 +3417,32 @@ ti_ioctl(struct ifnet *ifp, u_long comma
 	case SIOCSIFCAP:
 		TI_LOCK(sc);
 		mask = ifr->ifr_reqcap ^ ifp->if_capenable;
-		if (mask & IFCAP_HWCSUM) {
-			if (IFCAP_HWCSUM & ifp->if_capenable)
-				ifp->if_capenable &= ~IFCAP_HWCSUM;
-			else
-				ifp->if_capenable |= IFCAP_HWCSUM;
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+		if ((mask & IFCAP_TXCSUM) != 0 &&
+		    (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
+			ifp->if_capenable ^= IFCAP_TXCSUM;
+			if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
+				ifp->if_hwassist |= TI_CSUM_FEATURES;
+                        else
+				ifp->if_hwassist &= ~TI_CSUM_FEATURES;
+                }
+		if ((mask & IFCAP_RXCSUM) != 0 &&
+		    (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
+			ifp->if_capenable ^= IFCAP_RXCSUM;
+		if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
+		    (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0)
+                        ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
+		if ((mask & IFCAP_VLAN_HWCSUM) != 0 &&
+		    (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0)
+			ifp->if_capenable ^= IFCAP_VLAN_HWCSUM;
+		if ((mask & (IFCAP_TXCSUM | IFCAP_RXCSUM |
+		    IFCAP_VLAN_HWTAGGING)) != 0) {
+			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 				ti_init_locked(sc);
+			}
 		}
 		TI_UNLOCK(sc);
+		VLAN_CAPABILITIES(ifp);
 		break;
 	default:
 		error = ether_ioctl(ifp, command, data);

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 23:09:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A5B4106566C;
	Fri,  4 Nov 2011 23:09:57 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5A3768FC19;
	Fri,  4 Nov 2011 23:09:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4N9vFu038467;
	Fri, 4 Nov 2011 23:09:57 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4N9v0R038465;
	Fri, 4 Nov 2011 23:09:57 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111042309.pA4N9v0R038465@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 23:09:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227098 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 23:09:57 -0000

Author: yongari
Date: Fri Nov  4 23:09:57 2011
New Revision: 227098
URL: http://svn.freebsd.org/changeset/base/227098

Log:
  Because ti(4) drops a driver lock in RX handler, check whether
  driver is still running before re-enabling interrupts.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 22:58:34 2011	(r227097)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 23:09:57 2011	(r227098)
@@ -2856,12 +2856,12 @@ ti_intr(void *xsc)
 
 	ti_handle_events(sc);
 
-	/* Re-enable interrupts. */
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0);
-
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
-	    ifp->if_snd.ifq_head != NULL)
+	    ifp->if_snd.ifq_head != NULL) {
+		/* Re-enable interrupts. */
+		CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0);
 		ti_start_locked(ifp);
+	}
 
 	TI_UNLOCK(sc);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Nov  4 23:34:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D3FEB106564A;
	Fri,  4 Nov 2011 23:34:54 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A6AF08FC0C;
	Fri,  4 Nov 2011 23:34:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4NYsQ2039267;
	Fri, 4 Nov 2011 23:34:54 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4NYswA039265;
	Fri, 4 Nov 2011 23:34:54 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201111042334.pA4NYswA039265@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 4 Nov 2011 23:34:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227099 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 23:34:54 -0000

Author: yongari
Date: Fri Nov  4 23:34:54 2011
New Revision: 227099
URL: http://svn.freebsd.org/changeset/base/227099

Log:
  Implement altq(4) support.
  While I'm here fix a logic error in r227098 where it didn't
  re-enable interrupts when TX queue is empty.

Modified:
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Nov  4 23:09:57 2011	(r227098)
+++ head/sys/dev/ti/if_ti.c	Fri Nov  4 23:34:54 2011	(r227099)
@@ -2432,7 +2432,9 @@ ti_attach(device_t dev)
 	ifp->if_start = ti_start;
 	ifp->if_init = ti_init;
 	ifp->if_baudrate = IF_Gbps(1UL);
-	ifp->if_snd.ifq_maxlen = TI_TX_RING_CNT - 1;
+	ifp->if_snd.ifq_drv_maxlen = TI_TX_RING_CNT - 1;
+	IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
+	IFQ_SET_READY(&ifp->if_snd);
 
 	/* Set up ifmedia support. */
 	if (sc->ti_copper) {
@@ -2856,11 +2858,11 @@ ti_intr(void *xsc)
 
 	ti_handle_events(sc);
 
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
-	    ifp->if_snd.ifq_head != NULL) {
+	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
 		/* Re-enable interrupts. */
 		CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0);
-		ti_start_locked(ifp);
+		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+			ti_start_locked(ifp);
 	}
 
 	TI_UNLOCK(sc);
@@ -3018,9 +3020,9 @@ ti_start_locked(struct ifnet *ifp)
 
 	sc = ifp->if_softc;
 
-	for (; ifp->if_snd.ifq_head != NULL &&
+	for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
 	    sc->ti_txcnt < (TI_TX_RING_CNT - 16);) {
-		IF_DEQUEUE(&ifp->if_snd, m_head);
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
 		if (m_head == NULL)
 			break;
 
@@ -3036,7 +3038,7 @@ ti_start_locked(struct ifnet *ifp)
 		    m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) {
 			if ((TI_TX_RING_CNT - sc->ti_txcnt) <
 			    m_head->m_pkthdr.csum_data + 16) {
-				IF_PREPEND(&ifp->if_snd, m_head);
+				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
 				ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 				break;
 			}
@@ -3050,7 +3052,7 @@ ti_start_locked(struct ifnet *ifp)
 		if (ti_encap(sc, &m_head)) {
 			if (m_head == NULL)
 				break;
-			IF_PREPEND(&ifp->if_snd, m_head);
+			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 			break;
 		}

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 07:18:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5573106564A;
	Sat,  5 Nov 2011 07:18:53 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A38868FC14;
	Sat,  5 Nov 2011 07:18:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA57Irq1053811;
	Sat, 5 Nov 2011 07:18:53 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA57Ir75053803;
	Sat, 5 Nov 2011 07:18:53 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201111050718.pA57Ir75053803@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 5 Nov 2011 07:18:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227101 - in head/games: bcd caesar fortune/fortune
	fortune/unstr grdc morse number
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 07:18:53 -0000

Author: ed
Date: Sat Nov  5 07:18:53 2011
New Revision: 227101
URL: http://svn.freebsd.org/changeset/base/227101

Log:
  Add static keywords to variables and functions where possible in games/.
  
  This allows us to detect unused functions and variables and allows the
  compiler to do a better job at optimisation.

Modified:
  head/games/bcd/bcd.c
  head/games/caesar/caesar.c
  head/games/fortune/fortune/fortune.c
  head/games/fortune/unstr/unstr.c
  head/games/grdc/grdc.c
  head/games/morse/morse.c
  head/games/number/number.c

Modified: head/games/bcd/bcd.c
==============================================================================
--- head/games/bcd/bcd.c	Sat Nov  5 01:42:54 2011	(r227100)
+++ head/games/bcd/bcd.c	Sat Nov  5 07:18:53 2011	(r227101)
@@ -82,7 +82,7 @@ static const char rcsid[] =
 #include 
 #include 
 
-u_short holes[256] = {
+static u_short holes[256] = {
     0x0,	 0x0,	  0x0,	   0x0,	    0x0,     0x0,     0x0,     0x0,
     0x0,	 0x0,	  0x0,	   0x0,	    0x0,     0x0,     0x0,     0x0,
     0x0,	 0x0,	  0x0,	   0x0,	    0x0,     0x0,     0x0,     0x0,
@@ -117,7 +117,7 @@ u_short holes[256] = {
     0x202,	 0x201,	  0x082,   0x806,   0x822,   0x600,   0x282,   0x0
 };
 
-void printcard(char *);
+static void printcard(char *);
 
 /*
  * i'th bit of w.
@@ -148,7 +148,7 @@ main(int argc, char **argv)
 
 #define	COLUMNS	48
 
-void
+static void
 printcard(char *str)
 {
 	static char rowchars[] = "   123456789";

Modified: head/games/caesar/caesar.c
==============================================================================
--- head/games/caesar/caesar.c	Sat Nov  5 01:42:54 2011	(r227100)
+++ head/games/caesar/caesar.c	Sat Nov  5 07:18:53 2011	(r227101)
@@ -67,13 +67,13 @@ __FBSDID("$FreeBSD$");
  * letter frequencies (taken from some unix(tm) documentation)
  * (unix is a trademark of Bell Laboratories)
  */
-double stdf[26] = {
+static double stdf[26] = {
 	7.97, 1.35, 3.61, 4.78, 12.37, 2.01, 1.46, 4.49, 6.39, 0.04,
 	0.42, 3.81, 2.69, 5.92,  6.96, 2.91, 0.08, 6.63, 8.77, 9.68,
 	2.62, 0.81, 1.88, 0.23,  2.07, 0.06,
 };
 
-void printit(char *);
+static void printit(char *);
 
 int
 main(int argc, char **argv)
@@ -147,7 +147,7 @@ main(int argc, char **argv)
 	exit(0);
 }
 
-void
+static void
 printit(char *arg)
 {
 	int ch, rot;

Modified: head/games/fortune/fortune/fortune.c
==============================================================================
--- head/games/fortune/fortune/fortune.c	Sat Nov  5 01:42:54 2011	(r227100)
+++ head/games/fortune/fortune/fortune.c	Sat Nov  5 07:18:53 2011	(r227101)
@@ -97,73 +97,71 @@ typedef struct fd {
 	struct fd	*next, *prev;
 } FILEDESC;
 
-bool	Found_one;			/* did we find a match? */
-bool	Find_files	= FALSE;	/* just find a list of proper fortune files */
-bool	Fortunes_only   = FALSE;	/* check only "fortunes" files */
-bool	Wait		= FALSE;	/* wait desired after fortune */
-bool	Short_only	= FALSE;	/* short fortune desired */
-bool	Long_only	= FALSE;	/* long fortune desired */
-bool	Offend		= FALSE;	/* offensive fortunes only */
-bool	All_forts	= FALSE;	/* any fortune allowed */
-bool	Equal_probs	= FALSE;	/* scatter un-allocted prob equally */
-bool	Match		= FALSE;	/* dump fortunes matching a pattern */
+static bool	Found_one;		/* did we find a match? */
+static bool	Find_files = FALSE;	/* just find a list of proper fortune files */
+static bool	Fortunes_only = FALSE;	/* check only "fortunes" files */
+static bool	Wait = FALSE;		/* wait desired after fortune */
+static bool	Short_only = FALSE;	/* short fortune desired */
+static bool	Long_only = FALSE;	/* long fortune desired */
+static bool	Offend = FALSE;		/* offensive fortunes only */
+static bool	All_forts = FALSE;	/* any fortune allowed */
+static bool	Equal_probs = FALSE;	/* scatter un-allocted prob equally */
+static bool	Match = FALSE;		/* dump fortunes matching a pattern */
 #ifdef DEBUG
-bool	Debug = FALSE;			/* print debug messages */
+static bool	Debug = FALSE;		/* print debug messages */
 #endif
 
-char	*Fortbuf = NULL;			/* fortune buffer for -m */
+static char	*Fortbuf = NULL;	/* fortune buffer for -m */
 
-int	Fort_len = 0;
+static int	Fort_len = 0;
 
-off_t	Seekpts[2];                     /* seek pointers to fortunes */
+static off_t	Seekpts[2];		/* seek pointers to fortunes */
 
-FILEDESC	*File_list = NULL,	/* Head of file list */
+static FILEDESC	*File_list = NULL,	/* Head of file list */
 		*File_tail = NULL;	/* Tail of file list */
-FILEDESC	*Fortfile;		/* Fortune file to use */
+static FILEDESC	*Fortfile;		/* Fortune file to use */
 
-STRFILE		Noprob_tbl;		/* sum of data for all no prob files */
+static STRFILE	Noprob_tbl;		/* sum of data for all no prob files */
 
-const char	*Fortune_path;
-char	**Fortune_path_arr;
+static const char *Fortune_path;
+static char	**Fortune_path_arr;
 
-int	 add_dir(FILEDESC *);
-int	 add_file(int, const char *, const char *, FILEDESC **, FILEDESC **,
-	    FILEDESC *);
-void	 all_forts(FILEDESC *, char *);
-char	*copy(const char *, u_int);
-void	 display(FILEDESC *);
-void	 do_free(void *);
-void	*do_malloc(u_int);
-int	 form_file_list(char **, int);
-int	 fortlen(void);
-void	 get_fort(void);
-void	 get_pos(FILEDESC *);
-void	 get_tbl(FILEDESC *);
-void	 getargs(int, char *[]);
-void	 getpath(void);
-void	 init_prob(void);
-int	 is_dir(const char *);
-int	 is_fortfile(const char *, char **, char **, int);
-int	 is_off_name(const char *);
-int	 max(int, int);
-FILEDESC *
-	 new_fp(void);
-char	*off_name(const char *);
-void	 open_dat(FILEDESC *);
-void	 open_fp(FILEDESC *);
-FILEDESC *
-	 pick_child(FILEDESC *);
-void	 print_file_list(void);
-void	 print_list(FILEDESC *, int);
-void	 sum_noprobs(FILEDESC *);
-void	 sum_tbl(STRFILE *, STRFILE *);
-void	 usage(void);
-void	 zero_tbl(STRFILE *);
-
-char	*conv_pat(char *);
-int	 find_matches(void);
-void	 matches_in_list(FILEDESC *);
-int	 maxlen_in_list(FILEDESC *);
+static int	 add_dir(FILEDESC *);
+static int	 add_file(int, const char *, const char *, FILEDESC **,
+		     FILEDESC **, FILEDESC *);
+static void	 all_forts(FILEDESC *, char *);
+static char	*copy(const char *, u_int);
+static void	 display(FILEDESC *);
+static void	 do_free(void *);
+static void	*do_malloc(u_int);
+static int	 form_file_list(char **, int);
+static int	 fortlen(void);
+static void	 get_fort(void);
+static void	 get_pos(FILEDESC *);
+static void	 get_tbl(FILEDESC *);
+static void	 getargs(int, char *[]);
+static void	 getpath(void);
+static void	 init_prob(void);
+static int	 is_dir(const char *);
+static int	 is_fortfile(const char *, char **, char **, int);
+static int	 is_off_name(const char *);
+static int	 max(int, int);
+static FILEDESC *new_fp(void);
+static char	*off_name(const char *);
+static void	 open_dat(FILEDESC *);
+static void	 open_fp(FILEDESC *);
+static FILEDESC *pick_child(FILEDESC *);
+static void	 print_file_list(void);
+static void	 print_list(FILEDESC *, int);
+static void	 sum_noprobs(FILEDESC *);
+static void	 sum_tbl(STRFILE *, STRFILE *);
+static void	 usage(void);
+static void	 zero_tbl(STRFILE *);
+
+static char	*conv_pat(char *);
+static int	 find_matches(void);
+static void	 matches_in_list(FILEDESC *);
+static int	 maxlen_in_list(FILEDESC *);
 
 static regex_t Re_pat;
 
@@ -219,7 +217,7 @@ main(int argc, char *argv[])
 	exit(0);
 }
 
-void
+static void
 display(FILEDESC *fp)
 {
 	char   *p;
@@ -252,7 +250,7 @@ display(FILEDESC *fp)
  * fortlen:
  *	Return the length of the fortune.
  */
-int
+static int
 fortlen(void)
 {
 	int	nchar;
@@ -276,7 +274,7 @@ fortlen(void)
 /*
  *	This routine evaluates the arguments on the command line
  */
-void
+static void
 getargs(int argc, char *argv[])
 {
 	int	ignore_case;
@@ -362,7 +360,7 @@ getargs(int argc, char *argv[])
  * form_file_list:
  *	Form the file list from the file specifications.
  */
-int
+static int
 form_file_list(char **files, int file_cnt)
 {
 	int	i, percent;
@@ -456,7 +454,7 @@ form_file_list(char **files, int file_cn
  * add_file:
  *	Add a file to the file list.
  */
-int
+static int
 add_file(int percent, const char *file, const char *dir, FILEDESC **head,
     FILEDESC **tail, FILEDESC *parent)
 {
@@ -598,7 +596,7 @@ over:
  * new_fp:
  *	Return a pointer to an initialized new FILEDESC.
  */
-FILEDESC *
+static FILEDESC *
 new_fp(void)
 {
 	FILEDESC	*fp;
@@ -624,7 +622,7 @@ new_fp(void)
  * off_name:
  *	Return a pointer to the offensive version of a file of this name.
  */
-char *
+static char *
 off_name(const char *file)
 {
 	char	*new;
@@ -638,7 +636,7 @@ off_name(const char *file)
  * is_off_name:
  *	Is the file an offensive-style name?
  */
-int
+static int
 is_off_name(const char *file)
 {
 	int	len;
@@ -653,7 +651,7 @@ is_off_name(const char *file)
  *	Modify a FILEDESC element to be the parent of two children if
  *	there are two children to be a parent of.
  */
-void
+static void
 all_forts(FILEDESC *fp, char *offensive)
 {
 	char		*sp;
@@ -701,7 +699,7 @@ all_forts(FILEDESC *fp, char *offensive)
  * add_dir:
  *	Add the contents of an entire directory.
  */
-int
+static int
 add_dir(FILEDESC *fp)
 {
 	DIR		*dir;
@@ -740,7 +738,7 @@ add_dir(FILEDESC *fp)
  * is_dir:
  *	Return TRUE if the file is a directory, FALSE otherwise.
  */
-int
+static int
 is_dir(const char *file)
 {
 	struct stat	sbuf;
@@ -759,7 +757,7 @@ is_dir(const char *file)
  *	suffixes, as contained in suflist[], are ruled out.
  */
 /* ARGSUSED */
-int
+static int
 is_fortfile(const char *file, char **datp, char **posp, int check_for_offend)
 {
 	int	i;
@@ -840,7 +838,7 @@ is_fortfile(const char *file, char **dat
  * copy:
  *	Return a malloc()'ed copy of the string
  */
-char *
+static char *
 copy(const char *str, unsigned int len)
 {
 	char *new, *sp;
@@ -858,7 +856,7 @@ copy(const char *str, unsigned int len)
  * do_malloc:
  *	Do a malloc, checking for NULL return.
  */
-void *
+static void *
 do_malloc(unsigned int size)
 {
 	void *new;
@@ -875,7 +873,7 @@ do_malloc(unsigned int size)
  * do_free:
  *	Free malloc'ed space, if any.
  */
-void
+static void
 do_free(void *ptr)
 {
 	if (ptr != NULL)
@@ -886,7 +884,7 @@ do_free(void *ptr)
  * init_prob:
  *	Initialize the fortune probabilities.
  */
-void
+static void
 init_prob(void)
 {
 	FILEDESC       *fp, *last = NULL;
@@ -955,7 +953,7 @@ init_prob(void)
  * get_fort:
  *	Get the fortune data file's seek pointer for the next fortune.
  */
-void
+static void
 get_fort(void)
 {
 	FILEDESC	*fp;
@@ -1018,7 +1016,7 @@ get_fort(void)
  * pick_child
  *	Pick a child from a chosen parent.
  */
-FILEDESC *
+static FILEDESC *
 pick_child(FILEDESC *parent)
 {
 	FILEDESC	*fp;
@@ -1054,7 +1052,7 @@ pick_child(FILEDESC *parent)
  * sum_noprobs:
  *	Sum up all the noprob probabilities, starting with fp.
  */
-void
+static void
 sum_noprobs(FILEDESC *fp)
 {
 	static bool	did_noprobs = FALSE;
@@ -1070,7 +1068,7 @@ sum_noprobs(FILEDESC *fp)
 	did_noprobs = TRUE;
 }
 
-int
+static int
 max(int i, int j)
 {
 	return (i >= j ? i : j);
@@ -1080,7 +1078,7 @@ max(int i, int j)
  * open_fp:
  *	Assocatiate a FILE * with the given FILEDESC.
  */
-void
+static void
 open_fp(FILEDESC *fp)
 {
 	if (fp->inf == NULL && (fp->inf = fdopen(fp->fd, "r")) == NULL) {
@@ -1093,7 +1091,7 @@ open_fp(FILEDESC *fp)
  * open_dat:
  *	Open up the dat file if we need to.
  */
-void
+static void
 open_dat(FILEDESC *fp)
 {
 	if (fp->datfd < 0 && (fp->datfd = open(fp->datfile, O_RDONLY)) < 0) {
@@ -1107,7 +1105,7 @@ open_dat(FILEDESC *fp)
  *	Get the position from the pos file, if there is one.  If not,
  *	return a random number.
  */
-void
+static void
 get_pos(FILEDESC *fp)
 {
 #ifdef OK_TO_WRITE_DISK
@@ -1137,7 +1135,7 @@ get_pos(FILEDESC *fp)
  * get_tbl:
  *	Get the tbl data file the datfile.
  */
-void
+static void
 get_tbl(FILEDESC *fp)
 {
 	int		fd;
@@ -1176,7 +1174,7 @@ get_tbl(FILEDESC *fp)
  * zero_tbl:
  *	Zero out the fields we care about in a tbl structure.
  */
-void
+static void
 zero_tbl(STRFILE *tp)
 {
 	tp->str_numstr = 0;
@@ -1188,7 +1186,7 @@ zero_tbl(STRFILE *tp)
  * sum_tbl:
  *	Merge the tbl data of t2 into t1.
  */
-void
+static void
 sum_tbl(STRFILE *t1, STRFILE *t2)
 {
 	t1->str_numstr += t2->str_numstr;
@@ -1204,7 +1202,7 @@ sum_tbl(STRFILE *t1, STRFILE *t2)
  * print_file_list:
  *	Print out the file list
  */
-void
+static void
 print_file_list(void)
 {
 	print_list(File_list, 0);
@@ -1214,7 +1212,7 @@ print_file_list(void)
  * print_list:
  *	Print out the actual list, recursively.
  */
-void
+static void
 print_list(FILEDESC *list, int lev)
 {
 	while (list != NULL) {
@@ -1237,7 +1235,7 @@ print_list(FILEDESC *list, int lev)
  * conv_pat:
  *	Convert the pattern to an ignore-case equivalent.
  */
-char *
+static char *
 conv_pat(char *orig)
 {
 	char		*sp;
@@ -1280,7 +1278,7 @@ conv_pat(char *orig)
  * find_matches:
  *	Find all the fortunes which match the pattern we've been given.
  */
-int
+static int
 find_matches(void)
 {
 	Fort_len = maxlen_in_list(File_list);
@@ -1298,7 +1296,7 @@ find_matches(void)
  * maxlen_in_list
  *	Return the maximum fortune len in the file list.
  */
-int
+static int
 maxlen_in_list(FILEDESC *list)
 {
 	FILEDESC	*fp;
@@ -1324,7 +1322,7 @@ maxlen_in_list(FILEDESC *list)
  * matches_in_list
  *	Print out the matches from the files in the list.
  */
-void
+static void
 matches_in_list(FILEDESC *list)
 {
 	char           *sp, *p;
@@ -1375,7 +1373,7 @@ matches_in_list(FILEDESC *list)
 	}
 }
 
-void
+static void
 usage(void)
 {
 	(void) fprintf(stderr, "fortune [-a");
@@ -1394,7 +1392,7 @@ usage(void)
  *	if not set, use the compiled in FORTDIR.
  */
 
-void
+static void
 getpath(void)
 {
 	int	nstr, foundenv;

Modified: head/games/fortune/unstr/unstr.c
==============================================================================
--- head/games/fortune/unstr/unstr.c	Sat Nov  5 01:42:54 2011	(r227100)
+++ head/games/fortune/unstr/unstr.c	Sat Nov  5 07:18:53 2011	(r227101)
@@ -67,13 +67,13 @@ __FBSDID("$FreeBSD$");
 
 #include "strfile.h"
 
-char	*Infile,			/* name of input file */
-	Datafile[MAXPATHLEN],		/* name of data file */
-	Delimch;			/* delimiter character */
+static char	*Infile,		/* name of input file */
+		Datafile[MAXPATHLEN],	/* name of data file */
+		Delimch;		/* delimiter character */
 
-FILE	*Inf, *Dataf;
+static FILE	*Inf, *Dataf;
 
-void order_unstr(STRFILE *);
+static void order_unstr(STRFILE *);
 
 /* ARGSUSED */
 int
@@ -107,7 +107,7 @@ main(int argc, char *argv[])
 	exit(0);
 }
 
-void
+static void
 order_unstr(STRFILE *tbl)
 {
 	uint32_t i;

Modified: head/games/grdc/grdc.c
==============================================================================
--- head/games/grdc/grdc.c	Sat Nov  5 01:42:54 2011	(r227100)
+++ head/games/grdc/grdc.c	Sat Nov  5 07:18:53 2011	(r227101)
@@ -26,29 +26,30 @@
 #define XLENGTH 58
 #define YDEPTH  7
 
-struct timespec now;
-struct tm *tm;
+static struct timespec now;
+static struct tm *tm;
 
-short disp[11] = {
+static short disp[11] = {
 	075557, 011111, 071747, 071717, 055711,
 	074717, 074757, 071111, 075757, 075717, 002020
 };
-long old[6], next[6], new[6], mask;
+static long old[6], next[6], new[6], mask;
 
-volatile sig_atomic_t sigtermed;
+static volatile sig_atomic_t sigtermed;
 
-int hascolor = 0;
+static int hascolor = 0;
 
-void set(int, int);
-void standt(int);
-void movto(int, int);
-void sighndl(int);
-void usage(void);
+static void set(int, int);
+static void standt(int);
+static void movto(int, int);
+static void sighndl(int);
+static void usage(void);
 
-void
+static void
 sighndl(int signo)
 {
-	sigtermed=signo;
+
+	sigtermed = signo;
 }
 
 int
@@ -225,7 +226,7 @@ main(int argc, char *argv[])
 	return(0);
 }
 
-void
+static void
 set(int t, int n)
 {
 	int i, m;
@@ -239,7 +240,7 @@ set(int t, int n)
 		mask |= m;
 }
 
-void
+static void
 standt(int on)
 {
 	if (on) {
@@ -257,13 +258,13 @@ standt(int on)
 	}
 }
 
-void
+static void
 movto(int line, int col)
 {
 	move(line, col);
 }
 
-void
+static void
 usage(void)
 {
 

Modified: head/games/morse/morse.c
==============================================================================
--- head/games/morse/morse.c	Sat Nov  5 01:42:54 2011	(r227100)
+++ head/games/morse/morse.c	Sat Nov  5 07:18:53 2011	(r227101)
@@ -261,33 +261,33 @@ static const struct morsetab koi8rtab[] 
 	{'\0', ""}
 };
 
-void            show(const char *), play(const char *), morse(char);
-void		ttyout(const char *);
-void		sighandler(int);
+static void	show(const char *), play(const char *), morse(char);
+static void	ttyout(const char *);
+static void	sighandler(int);
 
 #define GETOPTOPTS "c:d:ef:lsw:"
 #define USAGE \
 "usage: morse [-els] [-d device] [-w speed] [-c speed] [-f frequency] [string ...]\n"
 
-static int      pflag, lflag, sflag, eflag;
-static int      wpm = 20;	/* effective words per minute */
-static int      cpm;		/* effective words per minute between
+static int	pflag, lflag, sflag, eflag;
+static int	wpm = 20;	/* effective words per minute */
+static int	cpm;		/* effective words per minute between
 				 * characters */
 #define FREQUENCY 600
-static int      freq = FREQUENCY;
+static int	freq = FREQUENCY;
 static char	*device;	/* for tty-controlled generator */
 
 #define DASH_LEN 3
 #define CHAR_SPACE 3
 #define WORD_SPACE (7 - CHAR_SPACE - 1)
-static float    dot_clock;
-static float    cdot_clock;
-int             spkr, line;
-struct termios	otty, ntty;
-int		olflags;
+static float	dot_clock;
+static float	cdot_clock;
+static int	spkr, line;
+static struct termios otty, ntty;
+static int	olflags;
 
 #ifdef SPEAKER
-tone_t          sound;
+static tone_t	sound;
 #undef GETOPTOPTS
 #define GETOPTOPTS "c:d:ef:lpsw:"
 #undef USAGE
@@ -439,7 +439,7 @@ main(int argc, char **argv)
 	exit(0);
 }
 
-void
+static void
 morse(char c)
 {
 	const struct morsetab *m;
@@ -473,7 +473,7 @@ morse(char c)
 	}
 }
 
-void
+static void
 show(const char *s)
 {
 	if (lflag) {
@@ -488,7 +488,7 @@ show(const char *s)
 	}
 }
 
-void
+static void
 play(const char *s)
 {
 #ifdef SPEAKER
@@ -530,7 +530,7 @@ play(const char *s)
 #endif
 }
 
-void
+static void
 ttyout(const char *s)
 {
 	const char *c;
@@ -572,7 +572,7 @@ ttyout(const char *s)
 	usleep(duration);
 }
 
-void
+static void
 sighandler(int signo)
 {
 

Modified: head/games/number/number.c
==============================================================================
--- head/games/number/number.c	Sat Nov  5 01:42:54 2011	(r227100)
+++ head/games/number/number.c	Sat Nov  5 07:18:53 2011	(r227101)
@@ -74,14 +74,13 @@ static const char	*name1[] = {
 	"novemdecillion",		"vigintillion",
 };
 
-void	convert(char *);
-int	number(char *, int);
-void	pfract(int);
-void	toobig(void);
-int	unit(int, char *);
-void	usage(void);
+static void	convert(char *);
+static int	number(char *, int);
+static void	pfract(int);
+static int	unit(int, char *);
+static void	usage(void);
 
-int lflag;
+static int lflag;
 
 int
 main(int argc, char *argv[])
@@ -120,7 +119,7 @@ main(int argc, char *argv[])
 	exit(0);
 }
 
-void
+static void
 convert(char *line)
 {
 	int flen, len, rval;
@@ -188,7 +187,7 @@ badnum:			errx(1, "illegal number: %s", 
 		(void)printf("\n");
 }
 
-int
+static int
 unit(int len, char *p)
 {
 	int off, rval;
@@ -222,7 +221,7 @@ unit(int len, char *p)
 	return (rval);
 }
 
-int
+static int
 number(char *p, int len)
 {
 	int val, rval;
@@ -260,7 +259,7 @@ number(char *p, int len)
 	return (rval);
 }
 
-void
+static void
 pfract(int len)
 {
 	static char const * const pref[] = { "", "ten-", "hundred-" };
@@ -278,7 +277,7 @@ pfract(int len)
 	}
 }
 
-void
+static void
 usage(void)
 {
 	(void)fprintf(stderr, "usage: number [-l] [# ...]\n");

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 08:20:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97A3B106564A;
	Sat,  5 Nov 2011 08:20:32 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 873308FC08;
	Sat,  5 Nov 2011 08:20:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA58KWJB055721;
	Sat, 5 Nov 2011 08:20:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA58KWDT055717;
	Sat, 5 Nov 2011 08:20:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111050820.pA58KWDT055717@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 5 Nov 2011 08:20:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227102 - head/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 08:20:32 -0000

Author: kib
Date: Sat Nov  5 08:20:32 2011
New Revision: 227102
URL: http://svn.freebsd.org/changeset/base/227102

Log:
  Provide typedefs for the type of bit mask for the page bits.
  Use the defined types instead of int when manipulating masks.
  Supposedly, it could fix support for 32KB page size in the
  machine-independend VM layer.
  
  Reviewed by:	alc
  MFC after:	2 weeks

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sat Nov  5 07:18:53 2011	(r227101)
+++ head/sys/vm/vm_page.c	Sat Nov  5 08:20:32 2011	(r227102)
@@ -137,7 +137,7 @@ SYSCTL_INT(_vm, OID_AUTO, tryrelock_rest
 
 static uma_zone_t fakepg_zone;
 
-static void vm_page_clear_dirty_mask(vm_page_t m, int pagebits);
+static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits);
 static void vm_page_queue_remove(int queue, vm_page_t m);
 static void vm_page_enqueue(int queue, vm_page_t m);
 static void vm_page_init_fakepg(void *dummy);
@@ -2350,7 +2350,7 @@ retrylookup:
  *
  * Inputs are required to range within a page.
  */
-int
+vm_page_bits_t
 vm_page_bits(int base, int size)
 {
 	int first_bit;
@@ -2367,7 +2367,8 @@ vm_page_bits(int base, int size)
 	first_bit = base >> DEV_BSHIFT;
 	last_bit = (base + size - 1) >> DEV_BSHIFT;
 
-	return ((2 << last_bit) - (1 << first_bit));
+	return (((vm_page_bits_t)2 << last_bit) -
+	    ((vm_page_bits_t)1 << first_bit));
 }
 
 /*
@@ -2426,7 +2427,7 @@ vm_page_set_valid(vm_page_t m, int base,
  * Clear the given bits from the specified page's dirty field.
  */
 static __inline void
-vm_page_clear_dirty_mask(vm_page_t m, int pagebits)
+vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits)
 {
 	uintptr_t addr;
 #if PAGE_SIZE < 16384
@@ -2455,7 +2456,6 @@ vm_page_clear_dirty_mask(vm_page_t m, in
 		 */
 		addr = (uintptr_t)&m->dirty;
 #if PAGE_SIZE == 32768
-#error pagebits too short
 		atomic_clear_64((uint64_t *)addr, pagebits);
 #elif PAGE_SIZE == 16384
 		atomic_clear_32((uint32_t *)addr, pagebits);
@@ -2492,8 +2492,8 @@ vm_page_clear_dirty_mask(vm_page_t m, in
 void
 vm_page_set_validclean(vm_page_t m, int base, int size)
 {
-	u_long oldvalid;
-	int endoff, frag, pagebits;
+	vm_page_bits_t oldvalid, pagebits;
+	int endoff, frag;
 
 	VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
 	if (size == 0)	/* handle degenerate case */
@@ -2505,7 +2505,7 @@ vm_page_set_validclean(vm_page_t m, int 
 	 * first block.
 	 */
 	if ((frag = base & ~(DEV_BSIZE - 1)) != base &&
-	    (m->valid & (1 << (base >> DEV_BSHIFT))) == 0)
+	    (m->valid & ((vm_page_bits_t)1 << (base >> DEV_BSHIFT))) == 0)
 		pmap_zero_page_area(m, frag, base - frag);
 
 	/*
@@ -2515,7 +2515,7 @@ vm_page_set_validclean(vm_page_t m, int 
 	 */
 	endoff = base + size;
 	if ((frag = endoff & ~(DEV_BSIZE - 1)) != endoff &&
-	    (m->valid & (1 << (endoff >> DEV_BSHIFT))) == 0)
+	    (m->valid & ((vm_page_bits_t)1 << (endoff >> DEV_BSHIFT))) == 0)
 		pmap_zero_page_area(m, endoff,
 		    DEV_BSIZE - (endoff & (DEV_BSIZE - 1)));
 
@@ -2585,7 +2585,7 @@ vm_page_clear_dirty(vm_page_t m, int bas
 void
 vm_page_set_invalid(vm_page_t m, int base, int size)
 {
-	int bits;
+	vm_page_bits_t bits;
 
 	VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
 	KASSERT((m->oflags & VPO_BUSY) == 0,
@@ -2625,8 +2625,7 @@ vm_page_zero_invalid(vm_page_t m, boolea
 	 */
 	for (b = i = 0; i <= PAGE_SIZE / DEV_BSIZE; ++i) {
 		if (i == (PAGE_SIZE / DEV_BSIZE) || 
-		    (m->valid & (1 << i))
-		) {
+		    (m->valid & ((vm_page_bits_t)1 << i))) {
 			if (i > b) {
 				pmap_zero_page_area(m, 
 				    b << DEV_BSHIFT, (i - b) << DEV_BSHIFT);
@@ -2656,9 +2655,10 @@ vm_page_zero_invalid(vm_page_t m, boolea
 int
 vm_page_is_valid(vm_page_t m, int base, int size)
 {
-	int bits = vm_page_bits(base, size);
+	vm_page_bits_t bits;
 
 	VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
+	bits = vm_page_bits(base, size);
 	if (m->valid && ((m->valid & bits) == bits))
 		return 1;
 	else

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Sat Nov  5 07:18:53 2011	(r227101)
+++ head/sys/vm/vm_page.h	Sat Nov  5 08:20:32 2011	(r227102)
@@ -113,6 +113,20 @@
 
 TAILQ_HEAD(pglist, vm_page);
 
+#if PAGE_SIZE == 4096
+#define VM_PAGE_BITS_ALL 0xffu
+typedef uint8_t vm_page_bits_t;
+#elif PAGE_SIZE == 8192
+#define VM_PAGE_BITS_ALL 0xffffu
+typedef uint16_t vm_page_bits_t;
+#elif PAGE_SIZE == 16384
+#define VM_PAGE_BITS_ALL 0xffffffffu
+typedef uint32_t vm_page_bits_t;
+#elif PAGE_SIZE == 32768
+#define VM_PAGE_BITS_ALL 0xfffffffffffffffflu
+typedef uint64_t vm_page_bits_t;
+#endif
+
 struct vm_page {
 	TAILQ_ENTRY(vm_page) pageq;	/* queue info for FIFO queue or free list (Q) */
 	TAILQ_ENTRY(vm_page) listq;	/* pages in same object (O) 	*/
@@ -137,20 +151,8 @@ struct vm_page {
 	u_char	busy;			/* page busy count (O) */
 	/* NOTE that these must support one bit per DEV_BSIZE in a page!!! */
 	/* so, on normal X86 kernels, they must be at least 8 bits wide */
-	/* In reality, support for 32KB pages is not fully implemented. */
-#if PAGE_SIZE == 4096
-	uint8_t	valid;			/* map of valid DEV_BSIZE chunks (O) */
-	uint8_t	dirty;			/* map of dirty DEV_BSIZE chunks (M) */
-#elif PAGE_SIZE == 8192
-	uint16_t valid;			/* map of valid DEV_BSIZE chunks (O) */
-	uint16_t dirty;			/* map of dirty DEV_BSIZE chunks (M) */
-#elif PAGE_SIZE == 16384
-	uint32_t valid;			/* map of valid DEV_BSIZE chunks (O) */
-	uint32_t dirty;			/* map of dirty DEV_BSIZE chunks (M) */
-#elif PAGE_SIZE == 32768
-	uint64_t valid;			/* map of valid DEV_BSIZE chunks (O) */
-	uint64_t dirty;			/* map of dirty DEV_BSIZE chunks (M) */
-#endif
+	vm_page_bits_t valid;		/* map of valid DEV_BSIZE chunks (O) */
+	vm_page_bits_t dirty;		/* map of dirty DEV_BSIZE chunks (M) */
 };
 
 /*
@@ -403,7 +405,7 @@ void vm_page_clear_dirty (vm_page_t, int
 void vm_page_set_invalid (vm_page_t, int, int);
 int vm_page_is_valid (vm_page_t, int, int);
 void vm_page_test_dirty (vm_page_t);
-int vm_page_bits (int, int);
+vm_page_bits_t vm_page_bits(int base, int size);
 void vm_page_zero_invalid(vm_page_t m, boolean_t setvalid);
 void vm_page_free_toq(vm_page_t m);
 void vm_page_zero_idle_wakeup(void);

Modified: head/sys/vm/vnode_pager.c
==============================================================================
--- head/sys/vm/vnode_pager.c	Sat Nov  5 07:18:53 2011	(r227101)
+++ head/sys/vm/vnode_pager.c	Sat Nov  5 08:20:32 2011	(r227102)
@@ -486,15 +486,16 @@ vnode_pager_input_smlfs(object, m)
 	vm_object_t object;
 	vm_page_t m;
 {
-	int bits, i;
 	struct vnode *vp;
 	struct bufobj *bo;
 	struct buf *bp;
 	struct sf_buf *sf;
 	daddr_t fileaddr;
 	vm_offset_t bsize;
-	int error = 0;
+	vm_page_bits_t bits;
+	int error, i;
 
+	error = 0;
 	vp = object->handle;
 	if (vp->v_iflag & VI_DOOMED)
 		return VM_PAGER_BAD;

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 09:03:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB90B1065673;
	Sat,  5 Nov 2011 09:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ABB448FC0C;
	Sat,  5 Nov 2011 09:03:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA593IjK057119;
	Sat, 5 Nov 2011 09:03:18 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA593Ics057117;
	Sat, 5 Nov 2011 09:03:18 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111050903.pA593Ics057117@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 5 Nov 2011 09:03:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227103 - head/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 09:03:18 -0000

Author: kib
Date: Sat Nov  5 09:03:18 2011
New Revision: 227103
URL: http://svn.freebsd.org/changeset/base/227103

Log:
  Remove redundand definitions. The chunk was missed from r227102.
  
  MFC after:	2 weeks

Modified:
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Sat Nov  5 08:20:32 2011	(r227102)
+++ head/sys/vm/vm_page.h	Sat Nov  5 09:03:18 2011	(r227103)
@@ -324,16 +324,6 @@ extern struct vpglocks vm_page_queue_loc
 #define vm_page_lock_queues()   mtx_lock(&vm_page_queue_mtx)
 #define vm_page_unlock_queues() mtx_unlock(&vm_page_queue_mtx)
 
-#if PAGE_SIZE == 4096
-#define VM_PAGE_BITS_ALL 0xffu
-#elif PAGE_SIZE == 8192
-#define VM_PAGE_BITS_ALL 0xffffu
-#elif PAGE_SIZE == 16384
-#define VM_PAGE_BITS_ALL 0xffffffffu
-#elif PAGE_SIZE == 32768
-#define VM_PAGE_BITS_ALL 0xfffffffffffffffflu
-#endif
-
 /* page allocation classes: */
 #define VM_ALLOC_NORMAL		0
 #define VM_ALLOC_INTERRUPT	1

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 09:04:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E4651065673;
	Sat,  5 Nov 2011 09:04:13 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4EA868FC18;
	Sat,  5 Nov 2011 09:04:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA594DGo057177;
	Sat, 5 Nov 2011 09:04:13 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA594D7O057175;
	Sat, 5 Nov 2011 09:04:13 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111050904.pA594D7O057175@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 5 Nov 2011 09:04:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227104 - head/sys/fs/procfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 09:04:13 -0000

Author: kib
Date: Sat Nov  5 09:04:13 2011
New Revision: 227104
URL: http://svn.freebsd.org/changeset/base/227104

Log:
  Fix typo.
  
  MFC after:	3 days

Modified:
  head/sys/fs/procfs/procfs_status.c

Modified: head/sys/fs/procfs/procfs_status.c
==============================================================================
--- head/sys/fs/procfs/procfs_status.c	Sat Nov  5 09:03:18 2011	(r227103)
+++ head/sys/fs/procfs/procfs_status.c	Sat Nov  5 09:04:13 2011	(r227104)
@@ -175,7 +175,7 @@ procfs_doproccmdline(PFS_FILL_ARGS)
 	/*
 	 * If we are using the ps/cmdline caching, use that.  Otherwise
 	 * revert back to the old way which only implements full cmdline
-	 * for the currept process and just p->p_comm for all other
+	 * for the current process and just p->p_comm for all other
 	 * processes.
 	 * Note that if the argv is no longer available, we deliberately
 	 * don't fall back on p->p_comm or return an error: the authentic

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 10:00:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CB5C106566C;
	Sat,  5 Nov 2011 10:00:30 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C7CC8FC13;
	Sat,  5 Nov 2011 10:00:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5A0UcX058897;
	Sat, 5 Nov 2011 10:00:30 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5A0URU058895;
	Sat, 5 Nov 2011 10:00:30 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201111051000.pA5A0URU058895@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 5 Nov 2011 10:00:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227105 - head/lib/libpam/modules/pam_unix
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 10:00:30 -0000

Author: ed
Date: Sat Nov  5 10:00:29 2011
New Revision: 227105
URL: http://svn.freebsd.org/changeset/base/227105

Log:
  Remove an unused variable from pam_unix.
  
  This variable was added in r82352 back in 2001, but even then it didn't
  have any use. Because it's not marked static, the C compiler won't
  complain about it.
  
  Discussed with:	des

Modified:
  head/lib/libpam/modules/pam_unix/pam_unix.c

Modified: head/lib/libpam/modules/pam_unix/pam_unix.c
==============================================================================
--- head/lib/libpam/modules/pam_unix/pam_unix.c	Sat Nov  5 09:04:13 2011	(r227104)
+++ head/lib/libpam/modules/pam_unix/pam_unix.c	Sat Nov  5 10:00:29 2011	(r227105)
@@ -81,8 +81,6 @@ static char password_hash[] =		PASSWORD_
 #define PAM_OPT_LOCAL_PASS	"local_pass"
 #define PAM_OPT_NIS_PASS	"nis_pass"
 
-char *tempname = NULL;
-
 /*
  * authentication management
  */

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 11:04:26 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 16560106566B;
	Sat,  5 Nov 2011 11:04:26 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 058A68FC15;
	Sat,  5 Nov 2011 11:04:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5B4PfI062804;
	Sat, 5 Nov 2011 11:04:25 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5B4PjJ062802;
	Sat, 5 Nov 2011 11:04:25 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201111051104.pA5B4PjJ062802@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 5 Nov 2011 11:04:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227106 - stable/8/sys/dev/sound/pcm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 11:04:26 -0000

Author: avg
Date: Sat Nov  5 11:04:25 2011
New Revision: 227106
URL: http://svn.freebsd.org/changeset/base/227106

Log:
  MFC r225505: dsp_ioctl: fix type of variable used to store ioctl request
  
  PR:		kern/156433

Modified:
  stable/8/sys/dev/sound/pcm/dsp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/sound/pcm/dsp.c
==============================================================================
--- stable/8/sys/dev/sound/pcm/dsp.c	Sat Nov  5 10:00:29 2011	(r227105)
+++ stable/8/sys/dev/sound/pcm/dsp.c	Sat Nov  5 11:04:25 2011	(r227106)
@@ -1062,7 +1062,8 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd
 {
     	struct pcm_channel *chn, *rdch, *wrch;
 	struct snddev_info *d;
-	int *arg_i, ret, tmp, xcmd;
+	u_long xcmd;
+	int *arg_i, ret, tmp;
 
 	d = dsp_get_info(i_dev);
 	if (!DSP_REGISTERED(d, i_dev))

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 11:18:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57F5C106564A;
	Sat,  5 Nov 2011 11:18:47 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 466178FC0A;
	Sat,  5 Nov 2011 11:18:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5BIlDi063274;
	Sat, 5 Nov 2011 11:18:47 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5BIlPB063272;
	Sat, 5 Nov 2011 11:18:47 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201111051118.pA5BIlPB063272@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 5 Nov 2011 11:18:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227107 - stable/7/sys/dev/sound/pcm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 11:18:47 -0000

Author: avg
Date: Sat Nov  5 11:18:46 2011
New Revision: 227107
URL: http://svn.freebsd.org/changeset/base/227107

Log:
  MFC r225505: dsp_ioctl: fix type of variable used to store ioctl request
  
  PR:		kern/156433

Modified:
  stable/7/sys/dev/sound/pcm/dsp.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/sound/pcm/dsp.c
==============================================================================
--- stable/7/sys/dev/sound/pcm/dsp.c	Sat Nov  5 11:04:25 2011	(r227106)
+++ stable/7/sys/dev/sound/pcm/dsp.c	Sat Nov  5 11:18:46 2011	(r227107)
@@ -778,7 +778,8 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd
 {
     	struct pcm_channel *chn, *rdch, *wrch;
 	struct snddev_info *d;
-	int *arg_i, ret, kill, tmp, xcmd;
+	u_long xcmd;
+	int *arg_i, ret, kill, tmp;
 
 	d = dsp_get_info(i_dev);
 	if (!DSP_REGISTERED(d, i_dev))

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 12:01:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48DB71065691;
	Sat,  5 Nov 2011 12:01:52 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 37A218FC38;
	Sat,  5 Nov 2011 12:01:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5C1pR8064654;
	Sat, 5 Nov 2011 12:01:51 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5C1pGU064652;
	Sat, 5 Nov 2011 12:01:51 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201111051201.pA5C1pGU064652@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sat, 5 Nov 2011 12:01:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227108 - head/sys/dev/usb/serial
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 12:01:52 -0000

Author: hselasky
Date: Sat Nov  5 12:01:51 2011
New Revision: 227108
URL: http://svn.freebsd.org/changeset/base/227108

Log:
  Implement support for modem control lines.
  Don't short terminate transmitted BULK data.
  Assume that the chip reads one USB packet at a time.
  
  PR:		usb/162307
  MFC after:	3 days

Modified:
  head/sys/dev/usb/serial/uslcom.c

Modified: head/sys/dev/usb/serial/uslcom.c
==============================================================================
--- head/sys/dev/usb/serial/uslcom.c	Sat Nov  5 11:18:46 2011	(r227107)
+++ head/sys/dev/usb/serial/uslcom.c	Sat Nov  5 12:01:51 2011	(r227108)
@@ -63,43 +63,61 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb
 
 #define	USLCOM_SET_DATA_BITS(x)	((x) << 8)
 
+/* Request types */
 #define	USLCOM_WRITE		0x41
 #define	USLCOM_READ		0xc1
 
+/* Request codes */
 #define	USLCOM_UART		0x00
 #define	USLCOM_BAUD_RATE	0x01	
 #define	USLCOM_DATA		0x03
 #define	USLCOM_BREAK		0x05
 #define	USLCOM_CTRL		0x07
+#define	USLCOM_RCTRL            0x08
+#define	USLCOM_SET_FLOWCTRL     0x13
 
+/* USLCOM_UART values */
 #define	USLCOM_UART_DISABLE	0x00
 #define	USLCOM_UART_ENABLE	0x01
 
+/* USLCOM_CTRL/USLCOM_RCTRL values */
 #define	USLCOM_CTRL_DTR_ON	0x0001	
 #define	USLCOM_CTRL_DTR_SET	0x0100
 #define	USLCOM_CTRL_RTS_ON	0x0002
 #define	USLCOM_CTRL_RTS_SET	0x0200
 #define	USLCOM_CTRL_CTS		0x0010
 #define	USLCOM_CTRL_DSR		0x0020
+#define	USLCOM_CTRL_RI          0x0040
 #define	USLCOM_CTRL_DCD		0x0080
 
+/* USLCOM_BAUD_RATE values */
 #define	USLCOM_BAUD_REF		0x384000
 
+/* USLCOM_DATA values */
 #define	USLCOM_STOP_BITS_1	0x00
 #define	USLCOM_STOP_BITS_2	0x02
-
 #define	USLCOM_PARITY_NONE	0x00
 #define	USLCOM_PARITY_ODD	0x10
 #define	USLCOM_PARITY_EVEN	0x20
 
 #define	USLCOM_PORT_NO		0xFFFF /* XXX think this should be 0 --hps */
 
+/* USLCOM_BREAK values */
 #define	USLCOM_BREAK_OFF	0x00
 #define	USLCOM_BREAK_ON		0x01
 
+/* USLCOM_SET_FLOWCTRL values - 1st word */
+#define	USLCOM_FLOW_DTR_ON      0x00000001
+#define	USLCOM_FLOW_CTS_HS      0x00000008 /* CTS handshake */
+#define	USLCOM_FLOW_RESERVED    0xFFFFFF80
+/* USLCOM_SET_FLOWCTRL values - 2nd word */
+#define	USLCOM_FLOW_RTS_ON      0x00000040
+#define	USLCOM_FLOW_RTS_HS      0x00000080 /* RTS handshake */
+
 enum {
 	USLCOM_BULK_DT_WR,
 	USLCOM_BULK_DT_RD,
+	USLCOM_CTRL_DT_RD,
 	USLCOM_N_TRANSFER,
 };
 
@@ -121,6 +139,7 @@ static device_detach_t uslcom_detach;
 
 static usb_callback_t uslcom_write_callback;
 static usb_callback_t uslcom_read_callback;
+static usb_callback_t uslcom_control_callback;
 
 static void uslcom_open(struct ucom_softc *);
 static void uslcom_close(struct ucom_softc *);
@@ -143,7 +162,7 @@ static const struct usb_config uslcom_co
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_OUT,
 		.bufsize = USLCOM_BULK_BUF_SIZE,
-		.flags = {.pipe_bof = 1,.force_short_xfer = 1,},
+               .flags = {.pipe_bof = 1,},
 		.callback = &uslcom_write_callback,
 	},
 
@@ -155,6 +174,16 @@ static const struct usb_config uslcom_co
 		.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
 		.callback = &uslcom_read_callback,
 	},
+	[USLCOM_CTRL_DT_RD] = {
+		.type = UE_CONTROL,
+		.endpoint = 0x00,
+		.direction = UE_DIR_ANY,
+		.interval = 150,	/* poll status every 150 ms */
+		.bufsize = sizeof(struct usb_device_request) + 8,
+		.flags = {.pipe_bof = 1,},
+		.callback = &uslcom_control_callback,
+		.timeout = 1000,	/* 1 second timeout */
+	},
 };
 
 static struct ucom_callback uslcom_callback = {
@@ -371,6 +400,8 @@ uslcom_open(struct ucom_softc *ucom)
 	    &req, NULL, 0, 1000)) {
 		DPRINTF("UART enable failed (ignored)\n");
 	}
+	/* Start polling status */
+	usbd_transfer_start(sc->sc_xfer[USLCOM_CTRL_DT_RD]);
 }
 
 static void
@@ -379,13 +410,16 @@ uslcom_close(struct ucom_softc *ucom)
 	struct uslcom_softc *sc = ucom->sc_parent;
 	struct usb_device_request req;
 
+	/* Stop polling status */
+	usbd_transfer_stop(sc->sc_xfer[USLCOM_CTRL_DT_RD]);
+
 	req.bmRequestType = USLCOM_WRITE;
 	req.bRequest = USLCOM_UART;
 	USETW(req.wValue, USLCOM_UART_DISABLE);
 	USETW(req.wIndex, USLCOM_PORT_NO);
 	USETW(req.wLength, 0);
 
-        if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, 
+	if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, 
 	    &req, NULL, 0, 1000)) {
 		DPRINTF("UART disable failed (ignored)\n");
 	}
@@ -452,6 +486,7 @@ uslcom_param(struct ucom_softc *ucom, st
 {
 	struct uslcom_softc *sc = ucom->sc_parent;
 	struct usb_device_request req;
+	uint32_t flowctrl[4];
 	uint16_t data;
 
 	DPRINTF("\n");
@@ -503,7 +538,30 @@ uslcom_param(struct ucom_softc *ucom, st
 	    &req, NULL, 0, 1000)) {
 		DPRINTF("Set format failed (ignored)\n");
 	}
-	return;
+       
+	if (t->c_cflag & CRTSCTS) {
+		flowctrl[0] = htole32(USLCOM_FLOW_RESERVED |
+		    USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS);
+		flowctrl[1] = htole32(USLCOM_FLOW_RTS_HS);
+		flowctrl[2] = 0;
+		flowctrl[3] = 0;
+	} else {
+		flowctrl[0] = htole32(USLCOM_FLOW_RESERVED |
+		    USLCOM_FLOW_DTR_ON);
+		flowctrl[1] = htole32(USLCOM_FLOW_RTS_ON);
+		flowctrl[2] = 0;
+		flowctrl[3] = 0;
+	}
+	req.bmRequestType = USLCOM_WRITE;
+	req.bRequest = USLCOM_SET_FLOWCTRL;
+	USETW(req.wValue, 0);
+	USETW(req.wIndex, USLCOM_PORT_NO);
+	USETW(req.wLength, sizeof(flowctrl));
+
+	if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, 
+	    &req, flowctrl, 0, 1000)) {
+		DPRINTF("Set flowcontrol failed (ignored)\n");
+	}
 }
 
 static void
@@ -599,6 +657,63 @@ tr_setup:
 }
 
 static void
+uslcom_control_callback(struct usb_xfer *xfer, usb_error_t error)
+{
+	struct uslcom_softc *sc = usbd_xfer_softc(xfer);
+	struct usb_page_cache *pc;
+	struct usb_device_request req;
+	uint8_t msr = 0;
+	uint8_t buf;
+
+	switch (USB_GET_STATE(xfer)) {
+	case USB_ST_TRANSFERRED:
+		pc = usbd_xfer_get_frame(xfer, 1);
+		usbd_copy_out(pc, 0, &buf, sizeof(buf));
+		if (buf & USLCOM_CTRL_CTS)
+			msr |= SER_CTS;
+		if (buf & USLCOM_CTRL_DSR)
+			msr |= SER_DSR;
+		if (buf & USLCOM_CTRL_RI)
+			msr |= SER_RI;
+		if (buf & USLCOM_CTRL_DCD)
+			msr |= SER_DCD;
+
+		if (msr != sc->sc_msr) {
+			DPRINTF("status change msr=0x%02x "
+			    "(was 0x%02x)\n", msr, sc->sc_msr);
+			sc->sc_msr = msr;
+			ucom_status_change(&sc->sc_ucom);
+		}
+
+		/* FALLTHROUGH */
+
+	case USB_ST_SETUP:
+tr_setup:              
+		req.bmRequestType = USLCOM_READ;
+		req.bRequest = USLCOM_RCTRL;
+		USETW(req.wValue, 0);
+		USETW(req.wIndex, 0);
+		USETW(req.wLength, sizeof(buf));
+               
+		usbd_xfer_set_frames(xfer, 2);
+		usbd_xfer_set_frame_len(xfer, 0, sizeof(req));
+		usbd_xfer_set_frame_len(xfer, 1, sizeof(buf));
+
+		pc = usbd_xfer_get_frame(xfer, 0);
+		usbd_copy_in(pc, 0, &req, sizeof(req));
+		usbd_transfer_submit(xfer);
+		break;
+
+	default:		/* error */
+		if (error != USB_ERR_CANCELLED) {
+			DPRINTF("error=%s\n", usbd_errstr(error));
+			goto tr_setup;
+		}
+		break;
+	}
+}
+
+static void
 uslcom_start_read(struct ucom_softc *ucom)
 {
 	struct uslcom_softc *sc = ucom->sc_parent;

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 16:29:03 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 814D3106566B;
	Sat,  5 Nov 2011 16:29:03 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 70D548FC08;
	Sat,  5 Nov 2011 16:29:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5GT3j5075555;
	Sat, 5 Nov 2011 16:29:03 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5GT3tE075553;
	Sat, 5 Nov 2011 16:29:03 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201111051629.pA5GT3tE075553@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 5 Nov 2011 16:29:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227110 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 16:29:03 -0000

Author: pjd
Date: Sat Nov  5 16:29:03 2011
New Revision: 227110
URL: http://svn.freebsd.org/changeset/base/227110

Log:
  In zvol_open() if the spa_namespace_lock is already held, it means that
  ZFS is trying to open and taste ZVOL as its VDEV. This is not supported,
  so return an error instead of panicing on spa_namespace_lock recursion.
  
  Reported by:	Robert Millan 
  PR:		kern/162008
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Nov  5 16:04:57 2011	(r227109)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Nov  5 16:29:03 2011	(r227110)
@@ -875,6 +875,14 @@ zvol_open(struct g_provider *pp, int fla
 	zvol_state_t *zv;
 	int err = 0;
 
+	if (MUTEX_HELD(&spa_namespace_lock)) {
+		/*
+		 * If the spa_namespace_lock is being held, it means that ZFS
+		 * is trying to open ZVOL as its VDEV. This i not supported.
+		 */
+		return (EOPNOTSUPP);
+	}
+
 	mutex_enter(&spa_namespace_lock);
 
 	zv = pp->private;

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 16:44:25 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B6FF106566C;
	Sat,  5 Nov 2011 16:44:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B2278FC12;
	Sat,  5 Nov 2011 16:44:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5GiPCP076072;
	Sat, 5 Nov 2011 16:44:25 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5GiPIj076070;
	Sat, 5 Nov 2011 16:44:25 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201111051644.pA5GiPIj076070@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 5 Nov 2011 16:44:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227111 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 16:44:25 -0000

Author: pjd
Date: Sat Nov  5 16:44:25 2011
New Revision: 227111
URL: http://svn.freebsd.org/changeset/base/227111

Log:
  Correct typo in comment.
  
  Reported by:	Fabian Keil 
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Nov  5 16:29:03 2011	(r227110)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Nov  5 16:44:25 2011	(r227111)
@@ -878,7 +878,7 @@ zvol_open(struct g_provider *pp, int fla
 	if (MUTEX_HELD(&spa_namespace_lock)) {
 		/*
 		 * If the spa_namespace_lock is being held, it means that ZFS
-		 * is trying to open ZVOL as its VDEV. This i not supported.
+		 * is trying to open ZVOL as its VDEV. This is not supported.
 		 */
 		return (EOPNOTSUPP);
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 16:47:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 974C51065670;
	Sat,  5 Nov 2011 16:47:47 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8781B8FC1B;
	Sat,  5 Nov 2011 16:47:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5Gllut076228;
	Sat, 5 Nov 2011 16:47:47 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5Gllmx076226;
	Sat, 5 Nov 2011 16:47:47 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201111051647.pA5Gllmx076226@svn.freebsd.org>
From: Dimitry Andric 
Date: Sat, 5 Nov 2011 16:47:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227112 - head/etc/rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 16:47:47 -0000

Author: dim
Date: Sat Nov  5 16:47:47 2011
New Revision: 227112
URL: http://svn.freebsd.org/changeset/base/227112

Log:
  Whenever you boot with nfsv4_server_enable=NO (the default) in rc.conf,
  the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3.
  
  Then, when you set nfsv4_server_enable=YES in rc.conf, and restart nfsd
  via the rc.d script, without rebooting, the sysctl does *not* get reset
  to max version 4, so NFSv4 still doesn't work.
  
  Fix this by explicitly setting vfs.nfsd.server_max_nfsvers to 4 when
  NFSv4 is requested.
  
  I also added resetting of the nfs_privport sysctls, since this has the
  same issue: nfs_reserved_port_only=YES in rc.conf sets the nfs_privport
  sysctl to 1, but in the other case, the sysctl doesn't get reset to 0.
  
  Reviewed by:	rmacklem
  Silence from:	rc@
  MFC after:	3 days

Modified:
  head/etc/rc.d/nfsd

Modified: head/etc/rc.d/nfsd
==============================================================================
--- head/etc/rc.d/nfsd	Sat Nov  5 16:44:25 2011	(r227111)
+++ head/etc/rc.d/nfsd	Sat Nov  5 16:47:47 2011	(r227112)
@@ -29,6 +29,8 @@ nfsd_precmd()
 		if checkyesno nfs_reserved_port_only; then
 			echo 'NFS on reserved port only=YES'
 			sysctl vfs.nfsrv.nfs_privport=1 > /dev/null
+		else
+			sysctl vfs.nfsrv.nfs_privport=0 > /dev/null
 		fi
 	else
 		rc_flags="${nfs_server_flags}"
@@ -40,9 +42,12 @@ nfsd_precmd()
 		if checkyesno nfs_reserved_port_only; then
 			echo 'NFS on reserved port only=YES'
 			sysctl vfs.nfsd.nfs_privport=1 > /dev/null
+		else
+			sysctl vfs.nfsd.nfs_privport=0 > /dev/null
 		fi
 
 		if checkyesno nfsv4_server_enable; then
+			sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
 			if ! checkyesno nfsuserd_enable  && \
 			    ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1
 			then

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 17:55:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 991D3106566C;
	Sat,  5 Nov 2011 17:55:49 +0000 (UTC) (envelope-from jmg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8839B8FC1B;
	Sat,  5 Nov 2011 17:55:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5HtnY9078537;
	Sat, 5 Nov 2011 17:55:49 GMT (envelope-from jmg@svn.freebsd.org)
Received: (from jmg@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5HtnTF078535;
	Sat, 5 Nov 2011 17:55:49 GMT (envelope-from jmg@svn.freebsd.org)
Message-Id: <201111051755.pA5HtnTF078535@svn.freebsd.org>
From: John-Mark Gurney 
Date: Sat, 5 Nov 2011 17:55:49 +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: r227116 - head/share/man/man9
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 17:55:49 -0000

Author: jmg
Date: Sat Nov  5 17:55:49 2011
New Revision: 227116
URL: http://svn.freebsd.org/changeset/base/227116

Log:
  group functions together by function...
  
  document knlist_delete, and better document what knlist_clear does...  Note
  that both of these functions may sleep, and also unlock/relock the list
  lock...
  
  document knlist_init_mtx (forgotten by kib)...
  
  other minor improvements
  
  Reviewed by:	ru (previous rev)
  MFC after:	1 week

Modified:
  head/share/man/man9/kqueue.9

Modified: head/share/man/man9/kqueue.9
==============================================================================
--- head/share/man/man9/kqueue.9	Sat Nov  5 17:43:28 2011	(r227115)
+++ head/share/man/man9/kqueue.9	Sat Nov  5 17:55:49 2011	(r227116)
@@ -1,4 +1,4 @@
-.\" Copyright 2006 John-Mark Gurney
+.\" Copyright 2006,2011 John-Mark Gurney
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,15 +24,16 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 28, 2006
+.Dd November 5, 2011
 .Dt KQUEUE 9
 .Os
 .Sh NAME
 .Nm kqueue_add_filteropts , kqueue_del_filteropts ,
 .Nm kqfd_register ,
 .Nm knote_fdclose ,
+.Nm knlist_init , knlist_init_mtx ,
 .Nm knlist_add , knlist_remove , knlist_remove_inevent , knlist_empty ,
-.Nm knlist_init , knlist_destroy , knlist_clear , knlist_delete ,
+.Nm knlist_clear , knlist_delete , knlist_destroy ,
 .Nm KNOTE_LOCKED , KNOTE_UNLOCKED
 .Nd "event delivery subsystem"
 .Sh SYNOPSIS
@@ -46,14 +47,6 @@
 .Ft void
 .Fn knote_fdclose "struct thread *td" "int fd"
 .Ft void
-.Fn knlist_add "struct knlist *knl" "struct knote *kn" "int islocked"
-.Ft void
-.Fn knlist_remove "struct knlist *knl" "struct knote *kn" "int islocked"
-.Ft void
-.Fn knlist_remove_inevent "struct knlist *knl" "struct knote *kn"
-.Ft int
-.Fn knlist_empty "struct knlist *knl"
-.Ft void
 .Fo knlist_init
 .Fa "struct knlist *knl"
 .Fa "void *lock"
@@ -62,12 +55,22 @@
 .Fa "int \*[lp]*kl_locked\*[rp]\*[lp]void *\*[rp]"
 .Fc
 .Ft void
-.Fn knlist_destroy "struct knlist *knl"
+.Fn knlist_init_mtx "struct knlist *knl" "struct mtx *lock"
+.Ft void
+.Fn knlist_add "struct knlist *knl" "struct knote *kn" "int islocked"
+.Ft void
+.Fn knlist_remove "struct knlist *knl" "struct knote *kn" "int islocked"
+.Ft void
+.Fn knlist_remove_inevent "struct knlist *knl" "struct knote *kn"
+.Ft int
+.Fn knlist_empty "struct knlist *knl"
 .Ft void
 .Fn knlist_clear "struct knlist *knl" "int islocked"
 .Ft void
 .Fn knlist_delete "struct knlist *knl" "struct thread *td" "int islocked"
 .Ft void
+.Fn knlist_destroy "struct knlist *knl"
+.Ft void
 .Fn KNOTE_LOCKED "struct knlist *knl" "long hint"
 .Ft void
 .Fn KNOTE_UNLOCKED "struct knlist *knl" "long hint"
@@ -135,7 +138,8 @@ bit of
 .Va kn_status
 in the
 .Vt knote .
-The function shall return 0 on success, or appropriate error for the failure.
+The function shall return 0 on success, or appropriate error for the failure,
+such as when the object is being destroyed, or does not exist.
 During
 .Va f_attach ,
 it is valid to change the
@@ -155,7 +159,13 @@ function will be called to detach the
 if the
 .Vt knote
 has not already been detached by a call to
-.Fn knlist_remove .
+.Fn knlist_remove ,
+.Fn knlist_remove_inevent
+or
+.Fn knlist_delete .
+The list
+.Fa lock
+will not be held when this function is called.
 .It Va f_event
 The
 .Va f_event
@@ -247,57 +257,120 @@ A
 is not required, but is commonly used.
 If used, the
 .Vt knlist
-must be initialized with the
+must be initialized with either
 .Fn knlist_init
-function.
-If
+or
+.Fn knlist_init_mtx .
+The
+.Vt knlist
+structure may be embedded into the object structure.
+The
+.Fa lock
+will be held over
+.Va f_event
+calls.
+.Pp
+For the
+.Fn knlist_init
+function, if
 .Fa lock
 is
 .Dv NULL ,
-an internal lock will be used and the remaining arguments will be ignored.
-The
+a shared global lock will be used and the remaining arguments must be
+.Dv NULL .
+The function pointers
 .Fa kl_lock , kl_unlock
 and
 .Fa kl_locked
-functions will be used to manipulate a
+will be used to manipulate the argument
 .Fa lock .
-If the argument is
+If any of the function pointers are
 .Dv NULL ,
-default routines operating on
-.Vt "struct mtx *"
-will be used.
-The
+a function operating on
+.Dv MTX_DEF
+style
+.Xr mutex 9
+locks will be used instead.
+.Pp
+The function
+.Fn knlist_init_mtx
+may be used to initalize a
 .Vt knlist
-structure may be embedded into the object structure.
-The
+when
 .Fa lock
-will be held over calls to
-.Va f_event .
-If
-.Dv NULL
-is passed for the mutex, a private mutex will be used.
+is a
+.Dv MTX_DEF
+style
+.Xr mutex 9
+lock.
+.Pp
 The function
 .Fn knlist_empty
-requires that a
+returns true when there are no
+.Vt knotes
+on the list.
+The function requires that the
 .Fa lock
-be held.
+be held when called.
+.Pp
 The function
 .Fn knlist_clear
-is used to remove all
+removes all
 .Vt knotes
-associated with the list.
+from the list.
 The
 .Fa islocked
-argument declares if
+argument declares if the
 .Fa lock
 has been acquired.
 All
 .Vt knotes
-will be marked as detached, and
+will have
 .Dv EV_ONESHOT
-will be set so that the
+set so that the
 .Vt knote
-will be deleted after the next scan.
+will be returned and removed durning the next scan.
+The
+.Va f_detach
+function will be called when the
+.Vt knote
+is deleted durning the next scan.
+This function must not be used when
+.Va f_isfd
+is set in
+.Vt "struct filterops" ,
+as the
+.Fa td
+argument of
+.Fn fdrop
+will be
+.Dv NULL .
+.Pp
+The function
+.Fn knlist_delete
+removes and deletes all
+.Vt knotes
+on the list.
+The function
+.Va f_detach
+will not be called, and the
+.Vt knote
+will not be returned on the next scan.
+Using this function could leak user land resources if a process uses the
+.Vt knote
+to track resources.
+.Pp
+Both the
+.Fn knlist_clear
+and
+.Fn knlist_delete
+functions may sleep.
+They also may release the
+.Fa lock
+to wait for other
+.Vt knotes
+to drain.
+.Pp
 The
 .Fn knlist_destroy
 function is used to destroy a
@@ -314,7 +387,9 @@ may be attached to the object.
 A
 .Vt knlist
 may be emptied by calling
-.Fn knlist_clear .
+.Fn knlist_clear
+or
+.Fn knlist_delete .
 .Pp
 The macros
 .Fn KNOTE_LOCKED
@@ -333,7 +408,7 @@ The macro
 .Fn KNOTE_LOCKED
 must be used if the lock associated with the
 .Fa knl
-passed in is held.
+is held.
 The function
 .Fn KNOTE_UNLOCKED
 will acquire the lock before iterating over the list of

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 18:27:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 864B71065673;
	Sat,  5 Nov 2011 18:27:47 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 759BB8FC12;
	Sat,  5 Nov 2011 18:27:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5IRlfp079596;
	Sat, 5 Nov 2011 18:27:47 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5IRl8O079594;
	Sat, 5 Nov 2011 18:27:47 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201111051827.pA5IRl8O079594@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 5 Nov 2011 18:27:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227117 - stable/9/sys/dev/mfi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 18:27:47 -0000

Author: kib
Date: Sat Nov  5 18:27:47 2011
New Revision: 227117
URL: http://svn.freebsd.org/changeset/base/227117

Log:
  MFC r226896:
  Fix an implicit dependency between the MFI driver and CAM that had grown due
  to an API change in CAM.  It's once again possible to link a static kernel
  with 'mfi' without requiring 'scbus' as well.  Ditto for KLD loading.
  
  Approved by:	re (bz)

Modified:
  stable/9/sys/dev/mfi/mfivar.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/mfi/mfivar.h
==============================================================================
--- stable/9/sys/dev/mfi/mfivar.h	Sat Nov  5 17:55:49 2011	(r227116)
+++ stable/9/sys/dev/mfi/mfivar.h	Sat Nov  5 18:27:47 2011	(r227117)
@@ -352,12 +352,29 @@ mfi_dequeue_bio(struct mfi_softc *sc)
 	return (bp);
 }
 
+/*
+ * This is from the original scsi_extract_sense() in CAM.  It's copied
+ * here because CAM now uses a non-inline version that follows more complex
+ * additions to the SPC spec, and we don't want to force a dependency on
+ * the CAM module for such a trivial action.
+ */
+static __inline void
+mfi_extract_sense(struct scsi_sense_data_fixed *sense,
+    int *error_code, int *sense_key, int *asc, int *ascq)
+{
+
+	*error_code = sense->error_code & SSD_ERRCODE;
+	*sense_key = sense->flags & SSD_KEY;
+	*asc = (sense->extra_len >= 5) ? sense->add_sense_code : 0;
+	*ascq = (sense->extra_len >= 6) ? sense->add_sense_code_qual : 0;
+}
+
 static __inline void
 mfi_print_sense(struct mfi_softc *sc, void *sense)
 {
 	int error, key, asc, ascq;
 
-	scsi_extract_sense((struct scsi_sense_data *)sense,
+	mfi_extract_sense((struct scsi_sense_data_fixed *)sense,
 	    &error, &key, &asc, &ascq);
 	device_printf(sc->mfi_dev, "sense error %d, sense_key %d, "
 	    "asc %d, ascq %d\n", error, key, asc, ascq);

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 19:25:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93EDF106566B;
	Sat,  5 Nov 2011 19:25:21 +0000 (UTC)
	(envelope-from jpaetzel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 796188FC19;
	Sat,  5 Nov 2011 19:25:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5JPLKw081338;
	Sat, 5 Nov 2011 19:25:21 GMT (envelope-from jpaetzel@svn.freebsd.org)
Received: (from jpaetzel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5JPLPL081333;
	Sat, 5 Nov 2011 19:25:21 GMT (envelope-from jpaetzel@svn.freebsd.org)
Message-Id: <201111051925.pA5JPLPL081333@svn.freebsd.org>
From: Josh Paetzel 
Date: Sat, 5 Nov 2011 19:25:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227118 - head/usr.sbin/pc-sysinstall/backend
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 19:25:21 -0000

Author: jpaetzel
Date: Sat Nov  5 19:25:21 2011
New Revision: 227118
URL: http://svn.freebsd.org/changeset/base/227118

Log:
  Roll up several patches used by PC-BSD.
  
  - Fix an issue with gmirror.
  - Allow IPv4 DHCP and IPv6 SLAAC concurrently.
  - Fix zpool options using the wrong device name.
  
  Approved by:	kib (mentor)
  Obtained from:	kris@pcbsd.org
  MFC after:	3 days

Modified:
  head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh
  head/usr.sbin/pc-sysinstall/backend/functions-disk.sh
  head/usr.sbin/pc-sysinstall/backend/functions-networking.sh
  head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh

Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh	Sat Nov  5 18:27:47 2011	(r227117)
+++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh	Sat Nov  5 19:25:21 2011	(r227118)
@@ -280,7 +280,7 @@ setup_gpart_partitions()
       if [ "${_pType}" = "gpt" ] ; then
         get_fs_line_xvars "${_pDisk}p${CURPART}" "${STRING}"
       else
-        get_fs_line_xvars "${_wSlice}" "${STRING}"
+        get_fs_line_xvars "${_wSlice}${PARTLETTER}" "${STRING}"
       fi
       XTRAOPTS="${VAR}"
 

Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh	Sat Nov  5 18:27:47 2011	(r227117)
+++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh	Sat Nov  5 19:25:21 2011	(r227118)
@@ -470,7 +470,8 @@ setup_disk_slice()
               # Default to round-robin if the user didn't specify
               if [ -z "$MIRRORBAL" ]; then MIRRORBAL="round-robin" ; fi
 
-              echo "$MIRRORDISK:$MIRRORBAL:gm${gmnum}" >${MIRRORCFGDIR}/$DISK
+	      _mFile=`echo $DISK | sed 's|/|%|g'`
+              echo "$MIRRORDISK:$MIRRORBAL:gm${gmnum}" >${MIRRORCFGDIR}/$_mFile
 	      init_gmirror "$gmnum" "$MIRRORBAL" "$DISK" "$MIRRORDISK"
 
 	      # Reset DISK to the gmirror device

Modified: head/usr.sbin/pc-sysinstall/backend/functions-networking.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-networking.sh	Sat Nov  5 18:27:47 2011	(r227117)
+++ head/usr.sbin/pc-sysinstall/backend/functions-networking.sh	Sat Nov  5 19:25:21 2011	(r227118)
@@ -431,6 +431,10 @@ start_networking()
   elif [ "$NETDEV" = "IPv6-SLAAC" ]
   then
     enable_auto_slaac
+  elif [ "$NETDEV" = "AUTO-DHCP-SLAAC" ]
+  then
+    enable_auto_dhcp
+    enable_auto_slaac
   else
     enable_manual_nic ${NETDEV}
   fi
@@ -457,6 +461,10 @@ save_networking_install()
   elif [ "$NETDEV" = "IPv6-SLAAC" ]
   then
     save_auto_slaac
+  elif [ "$NETDEV" = "AUTO-DHCP-SLAAC" ]
+  then
+    save_auto_dhcp
+    save_auto_slaac
   else
     save_manual_nic ${NETDEV}
   fi

Modified: head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh	Sat Nov  5 18:27:47 2011	(r227117)
+++ head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh	Sat Nov  5 19:25:21 2011	(r227118)
@@ -43,7 +43,7 @@ start_gmirror_sync()
 {
 
   cd ${MIRRORCFGDIR}
-  for DISK in `ls *`
+  for DISK in `ls ${MIRRORCFGDIR}`
   do
     MIRRORDISK="`cat ${DISK} | cut -d ':' -f 1`"
     MIRRORBAL="`cat ${DISK} | cut -d ':' -f 2`"
@@ -51,7 +51,7 @@ start_gmirror_sync()
    
     # Start the mirroring service
     rc_nohalt "gmirror forget ${MIRRORNAME}"
-    rc_halt "gmirror insert ${MIRRORNAME} /dev/${MIRRORDISK}"
+    rc_halt "gmirror insert ${MIRRORNAME} ${MIRRORDISK}"
 
   done
 

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 21:16:40 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60E4C106566C;
	Sat,  5 Nov 2011 21:16:40 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 375A58FC16;
	Sat,  5 Nov 2011 21:16:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5LGeoq085058;
	Sat, 5 Nov 2011 21:16:40 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5LGeFx085056;
	Sat, 5 Nov 2011 21:16:40 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201111052116.pA5LGeFx085056@svn.freebsd.org>
From: Dimitry Andric 
Date: Sat, 5 Nov 2011 21:16:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227120 - head
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 21:16:40 -0000

Author: dim
Date: Sat Nov  5 21:16:39 2011
New Revision: 227120
URL: http://svn.freebsd.org/changeset/base/227120

Log:
  Make it possible to set CC and CXX (and optionally, AS and LD) in
  make.conf(5), while allowing the build32 stage on 64-bit architectures
  to still override them, so that stage can successfully build 32-bit
  compatibility libraries.
  
  Explanation:
  1) The build32 stage sets environment variables CC, CXX, AS and LD for
     its sub-make, to add 32-bit specific flags (-m32 and such).
  2) The sub-make reads sys.mk, encounters CC?= and CXX?= assignments, so
     does not alter them.
  3) After some other stuff, sys.mk reads /etc/make.conf.  When you have
     "CC=xxx" and "CXX=yyy" statements in there, they will *override* the
     build32-supplied CC/CXX values, nullifying the 32-bit specific flags.
  4) Thus all objects get built as 64-bit anyway, and since LD is usually
     not set in make.conf, it still has the 32-bit flags!
  5) Now, whenever something is linked, you will get a "ld: Relocatable
     linking with relocations from format elf64-x86-64-freebsd (foo.o) to
     format elf32-i386-freebsd (bar.o) is not supported" error.
  
  Fix this by adding "-ECC -ECXX -EAS -ELD" to the build32 sub-make
  invocation, which forces those environment variables to always override
  any assignment in makefiles.  Thus making it possible to simply set:
  
  CC=my-cc
  CXX=my-c++
  
  in your make.conf, or specify a path, even:
  
  CC=/usr/local/bin/other-cc
  CXX=/usr/local/bin/other-c++
  
  Note this was never a problem on i386, since it has no build32 stage.
  
  Silence from:	current@
  MFC after:	1 week

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sat Nov  5 19:58:05 2011	(r227119)
+++ head/Makefile.inc1	Sat Nov  5 21:16:39 2011	(r227120)
@@ -313,7 +313,8 @@ LIB32WMAKEENV+=	MAKEOBJDIRPREFIX=${OBJTR
 
 LIB32WMAKE=	${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
 		-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \
-		-DWITHOUT_HTML -DNO_CTF -DNO_LINT DESTDIR=${LIB32TMP}
+		-DWITHOUT_HTML -DNO_CTF -DNO_LINT -ECC -ECXX -EAS -ELD \
+		DESTDIR=${LIB32TMP}
 LIB32IMAKE=	${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
 .endif
 

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 21:32:17 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8BAFE106566B;
	Sat,  5 Nov 2011 21:32:17 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B8CA8FC18;
	Sat,  5 Nov 2011 21:32:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5LWHhe085550;
	Sat, 5 Nov 2011 21:32:17 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5LWHNv085548;
	Sat, 5 Nov 2011 21:32:17 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201111052132.pA5LWHNv085548@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 5 Nov 2011 21:32:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227121 - head/usr.bin/make
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 21:32:17 -0000

Author: jilles
Date: Sat Nov  5 21:32:17 2011
New Revision: 227121
URL: http://svn.freebsd.org/changeset/base/227121

Log:
  make(1): obj dirs are physical paths so write `pwd -P` rather than `pwd`.
  
  Regular pwd may return a pathname containing symlinks, but make does not use
  such pathnames.

Modified:
  head/usr.bin/make/make.1

Modified: head/usr.bin/make/make.1
==============================================================================
--- head/usr.bin/make/make.1	Sat Nov  5 21:16:39 2011	(r227120)
+++ head/usr.bin/make/make.1	Sat Nov  5 21:32:17 2011	(r227121)
@@ -32,7 +32,7 @@
 .\"	@(#)make.1	8.8 (Berkeley) 6/13/95
 .\" $FreeBSD$
 .\"
-.Dd December 29, 2008
+.Dd November 5, 2011
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -631,7 +631,7 @@ The following directories are tried in o
 .Pp
 .Bl -enum -compact
 .It
-${MAKEOBJDIRPREFIX}/`pwd`
+${MAKEOBJDIRPREFIX}/`pwd -P`
 .It
 ${MAKEOBJDIR}
 .It
@@ -639,7 +639,7 @@ obj.${MACHINE}
 .It
 obj
 .It
-/usr/obj/`pwd`
+/usr/obj/`pwd -P`
 .El
 .Pp
 The first directory that

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 21:56:46 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B4BE106566C;
	Sat,  5 Nov 2011 21:56:46 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2AB288FC12;
	Sat,  5 Nov 2011 21:56:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5LukAX086297;
	Sat, 5 Nov 2011 21:56:46 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5LukQh086295;
	Sat, 5 Nov 2011 21:56:46 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201111052156.pA5LukQh086295@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 5 Nov 2011 21:56:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227122 - head/bin/sh
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 21:56:46 -0000

Author: jilles
Date: Sat Nov  5 21:56:45 2011
New Revision: 227122
URL: http://svn.freebsd.org/changeset/base/227122

Log:
  sh(1): Improve documentation of field splitting.

Modified:
  head/bin/sh/sh.1

Modified: head/bin/sh/sh.1
==============================================================================
--- head/bin/sh/sh.1	Sat Nov  5 21:32:17 2011	(r227121)
+++ head/bin/sh/sh.1	Sat Nov  5 21:56:45 2011	(r227122)
@@ -32,7 +32,7 @@
 .\"	from: @(#)sh.1	8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd July 10, 2011
+.Dd November 5, 2011
 .Dt SH 1
 .Os
 .Sh NAME
@@ -1160,6 +1160,11 @@ of alphabetics, numerics, and underscore
 The first letter of a variable name must not be numeric.
 A parameter can also be denoted by a number
 or a special character as explained below.
+.Pp
+Assignments are expanded differently from other words:
+tilde expansion is also performed after the equals sign and after any colon
+and usernames are also terminated by colons,
+and field splitting and pathname expansion are not performed.
 .Ss Positional Parameters
 A positional parameter is a parameter denoted by a number greater than zero.
 The shell sets these initially to the values of its command line
@@ -1273,11 +1278,15 @@ used in tilde expansion and as a default
 built-in.
 .It Va IFS
 Input Field Separators.
-This is normally set to
+The default value is
 .Aq space ,
 .Aq tab ,
 and
-.Aq newline .
+.Aq newline
+in that order.
+This default also applies if
+.Va IFS
+is unset, but not if it is set to the empty string.
 See the
 .Sx White Space Splitting
 section for more details.
@@ -1423,12 +1432,12 @@ part of the name.
 If a parameter expansion occurs inside double-quotes:
 .Bl -enum
 .It
-Pathname expansion is not performed on the results of the
-expansion.
-.It
 Field splitting is not performed on the results of the
 expansion, with the exception of the special parameter
 .Va @ .
+.It
+Pathname expansion is not performed on the results of the
+expansion.
 .El
 .Pp
 In addition, a parameter expansion can be modified by using one of the
@@ -1641,16 +1650,51 @@ and contain integer constants.
 .Pp
 The result of the expression is substituted in decimal.
 .Ss White Space Splitting (Field Splitting)
-After parameter expansion, command substitution, and
+In certain contexts,
+after parameter expansion, command substitution, and
 arithmetic expansion the shell scans the results of
 expansions and substitutions that did not occur in double-quotes for
 field splitting and multiple fields can result.
 .Pp
-The shell treats each character of the
+Characters in
+.Va IFS
+that are whitespace
+.Po
+.Aq space ,
+.Aq tab ,
+and
+.Aq newline
+.Pc
+are treated differently from other characters in
+.Va IFS .
+.Pp
+Whitespace in
+.Va IFS
+at the beginning or end of a word is discarded.
+.Pp
+Subsequently, a field is delimited by either
+.Bl -enum
+.It
+a non-whitespace character in
+.Va IFS
+with any whitespace in
+.Va IFS
+surrounding it, or
+.It
+one or more whitespace characters in
+.Va IFS .
+.El
+.Pp
+If a word ends with a non-whitespace character in
+.Va IFS ,
+there is no empty field after this character.
+.Pp
+If no field is delimited, the word is discarded.
+In particular, if a word consists solely of an unquoted substitution
+and the result of the substitution is null,
+it is removed by field splitting even if
 .Va IFS
-variable as a delimiter and uses
-the delimiters to split the results of parameter expansion and command
-substitution into fields.
+is null.
 .Ss Pathname Expansion (File Name Generation)
 Unless the
 .Fl f

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 22:25:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C7523106566C;
	Sat,  5 Nov 2011 22:25:15 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B6ED18FC13;
	Sat,  5 Nov 2011 22:25:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5MPFpQ087304;
	Sat, 5 Nov 2011 22:25:15 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5MPFuR087302;
	Sat, 5 Nov 2011 22:25:15 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201111052225.pA5MPFuR087302@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 5 Nov 2011 22:25:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227123 - head/usr.bin/xlint/xlint
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 22:25:15 -0000

Author: jilles
Date: Sat Nov  5 22:25:15 2011
New Revision: 227123
URL: http://svn.freebsd.org/changeset/base/227123

Log:
  lint: Fix lseek() argument order.
  
  Because SEEK_SET is 0, this seems to have no effect on the generated code.
  
  PR:		bin/160806
  Submitted by:	Henning Petersen 
  Obtained from:	NetBSD

Modified:
  head/usr.bin/xlint/xlint/xlint.c

Modified: head/usr.bin/xlint/xlint/xlint.c
==============================================================================
--- head/usr.bin/xlint/xlint/xlint.c	Sat Nov  5 21:56:45 2011	(r227122)
+++ head/usr.bin/xlint/xlint/xlint.c	Sat Nov  5 22:25:15 2011	(r227123)
@@ -656,7 +656,7 @@ fname(const char *name)
 	appcstrg(&args, name);
 
 	/* we reuse the same tmp file for cpp output, so rewind and truncate */
-	if (lseek(cppoutfd, SEEK_SET, (off_t)0) != 0) {
+	if (lseek(cppoutfd, (off_t)0, SEEK_SET) != 0) {
 		warn("lseek");
 		terminate(-1);
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Nov  5 22:33:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA2E4106564A;
	Sat,  5 Nov 2011 22:33:19 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B9BCE8FC0C;
	Sat,  5 Nov 2011 22:33:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5MXJxa087583;
	Sat, 5 Nov 2011 22:33:19 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5MXJMd087581;
	Sat, 5 Nov 2011 22:33:19 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201111052233.pA5MXJMd087581@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 5 Nov 2011 22:33:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227124 - head/tools/regression/fifo/fifo_misc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 22:33:19 -0000

Author: jilles
Date: Sat Nov  5 22:33:19 2011
New Revision: 227124
URL: http://svn.freebsd.org/changeset/base/227124

Log:
  fifo_misc test: Fix swapped lseek arguments.
  
  It worked regardless because SEEK_CUR happens to be 1.

Modified:
  head/tools/regression/fifo/fifo_misc/fifo_misc.c

Modified: head/tools/regression/fifo/fifo_misc/fifo_misc.c
==============================================================================
--- head/tools/regression/fifo/fifo_misc/fifo_misc.c	Sat Nov  5 22:25:15 2011	(r227123)
+++ head/tools/regression/fifo/fifo_misc/fifo_misc.c	Sat Nov  5 22:33:19 2011	(r227124)
@@ -115,7 +115,7 @@ test_lseek(void)
 		exit(-1);
 	}
 
-	if (lseek(reader_fd, SEEK_CUR, 1) >= 0) {
+	if (lseek(reader_fd, 1, SEEK_CUR) >= 0) {
 		warnx("%s: lseek succeeded instead of returning ESPIPE",
 		    __func__);
 		cleanfifo("testfifo", reader_fd, writer_fd);