From owner-svn-src-stable@FreeBSD.ORG Sun Oct 30 01:13:47 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 01:13:50 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 01:24:53 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 01:24:57 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 02:36:49 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 08:35:19 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 12:23:00 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 12:23:04 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 12:23:07 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 20:56:55 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 20:58:53 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 21:02:02 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Sun Oct 30 21:03:13 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Mon Oct 31 03:47:23 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Mon Oct 31 08:48:27 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Mon Oct 31 09:18:01 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Mon Oct 31 09:22:10 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Mon Oct 31 09:27:11 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Mon Oct 31 20:02:11 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Mon Oct 31 20:03:09 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG Tue Nov 1 02:03:31 2011 Return-Path: Delivered-To: svn-src-stable@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-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@FreeBSD.ORG  Tue Nov  1 02:04:02 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 02:04:53 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 08:24:02 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 15:34:52 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 15:38:41 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 15:41:56 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 15:51:10 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 15:53:44 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 15:56:15 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 16:11:44 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 16:27:47 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 16:56:43 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 18:29:06 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 19:29:03 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 21:21:37 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 22:00:50 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Tue Nov  1 22:22:47 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Wed Nov  2 08:23:40 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Wed Nov  2 11:02:43 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Wed Nov  2 11:05:12 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Wed Nov  2 13:51:29 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Wed Nov  2 18:55:27 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Fri Nov  4 06:14:19 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Fri Nov  4 11:14:04 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Fri Nov  4 15:57:39 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Sat Nov  5 11:04:26 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Sat Nov  5 11:18:47 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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-stable@FreeBSD.ORG  Sat Nov  5 18:27:47 2011
Return-Path: 
Delivered-To: svn-src-stable@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-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	
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);