From owner-svn-src-all@FreeBSD.ORG Tue Apr 20 21:52:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B67D910656A6; Tue, 20 Apr 2010 21:52:54 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A51C08FC15; Tue, 20 Apr 2010 21:52:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3KLqsXv055410; Tue, 20 Apr 2010 21:52:54 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KLqsa4055407; Tue, 20 Apr 2010 21:52:54 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201004202152.o3KLqsa4055407@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 20 Apr 2010 21:52:54 +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: r206938 - in stable/8/sys/dev: bwn siba X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2010 21:52:54 -0000 Author: weongyo Date: Tue Apr 20 21:52:54 2010 New Revision: 206938 URL: http://svn.freebsd.org/changeset/base/206938 Log: MFC r204257: o adds sysctl variables to show device statistics. o records RTS success/fail statistics. Pointed by: imp Modified: stable/8/sys/dev/bwn/if_bwn.c stable/8/sys/dev/bwn/if_bwnvar.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/dev/uath/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/siba/siba_cc.c (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/8/sys/dev/bwn/if_bwn.c Tue Apr 20 21:51:45 2010 (r206937) +++ stable/8/sys/dev/bwn/if_bwn.c Tue Apr 20 21:52:54 2010 (r206938) @@ -536,6 +536,7 @@ static void bwn_phy_lp_gaintbl_write_r2( struct bwn_txgain_entry); static void bwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int, struct bwn_txgain_entry); +static void bwn_sysctl_node(struct bwn_softc *); static struct resource_spec bwn_res_spec_legacy[] = { { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, @@ -1066,9 +1067,6 @@ bwn_attach_post(struct bwn_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct siba_dev_softc *sd = sc->sc_sd; struct siba_sprom *sprom = &sd->sd_bus->siba_sprom; -#ifdef BWN_DEBUG - device_t dev = sc->sc_dev; -#endif ic = ifp->if_l2com; ic->ic_ifp = ifp; @@ -1117,11 +1115,7 @@ bwn_attach_post(struct bwn_softc *sc) &sc->sc_rx_th.wr_ihdr, sizeof(sc->sc_rx_th), BWN_RX_RADIOTAP_PRESENT); -#ifdef BWN_DEBUG - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags"); -#endif + bwn_sysctl_node(sc); if (bootverbose) ieee80211_announce(ic); @@ -9077,6 +9071,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co struct bwn_pio_txqueue *tq; struct bwn_pio_txpkt *tp = NULL; struct bwn_softc *sc = mac->mac_sc; + struct bwn_stats *stats = &mac->mac_stats; struct ieee80211_node *ni; int slot; @@ -9088,9 +9083,9 @@ bwn_handle_txeof(struct bwn_mac *mac, co device_printf(sc->sc_dev, "TODO: STATUS AMPDU\n"); if (status->rtscnt) { if (status->rtscnt == 0xf) - device_printf(sc->sc_dev, "TODO: RTS fail\n"); + stats->rtsfail++; else - device_printf(sc->sc_dev, "TODO: RTS ok\n"); + stats->rts++; } if (mac->mac_flags & BWN_MAC_FLAG_DMA) { @@ -14286,6 +14281,36 @@ bwn_phy_lp_gaintbl_write_r01(struct bwn_ } static void +bwn_sysctl_node(struct bwn_softc *sc) +{ + device_t dev = sc->sc_dev; + struct bwn_mac *mac; + struct bwn_stats *stats; + + /* XXX assume that count of MAC is only 1. */ + + if ((mac = sc->sc_curmac) == NULL) + return; + stats = &mac->mac_stats; + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "linknoise", CTLFLAG_RW, &stats->rts, 0, "Noise level"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rts", CTLFLAG_RW, &stats->rts, 0, "RTS"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rtsfail", CTLFLAG_RW, &stats->rtsfail, 0, "RTS failed to send"); + +#ifdef BWN_DEBUG + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags"); +#endif +} + +static void bwn_identify(driver_t *driver, device_t parent) { Modified: stable/8/sys/dev/bwn/if_bwnvar.h ============================================================================== --- stable/8/sys/dev/bwn/if_bwnvar.h Tue Apr 20 21:51:45 2010 (r206937) +++ stable/8/sys/dev/bwn/if_bwnvar.h Tue Apr 20 21:52:54 2010 (r206938) @@ -515,6 +515,8 @@ struct bwn_tx_radiotap_header { }; struct bwn_stats { + int32_t rtsfail; + int32_t rts; int32_t link_noise; };