From owner-p4-projects@FreeBSD.ORG Mon Feb 2 02:23:46 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 26D2810656D1; Mon, 2 Feb 2009 02:23:46 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4CBE1065688 for ; Mon, 2 Feb 2009 02:23:45 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C342E8FC18 for ; Mon, 2 Feb 2009 02:23:45 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n122Njvs002285 for ; Mon, 2 Feb 2009 02:23:45 GMT (envelope-from weongyo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n122NjgY002283 for perforce@freebsd.org; Mon, 2 Feb 2009 02:23:45 GMT (envelope-from weongyo@FreeBSD.org) Date: Mon, 2 Feb 2009 02:23:45 GMT Message-Id: <200902020223.n122NjgY002283@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to weongyo@FreeBSD.org using -f From: Weongyo Jeong To: Perforce Change Reviews Cc: Subject: PERFORCE change 157018 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 02:23:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=157018 Change 157018 by weongyo@weongyo_ws on 2009/02/02 02:23:00 code nits for readability. Affected files ... .. //depot/projects/vap/sys/dev/usb/if_uath.c#10 edit Differences ... ==== //depot/projects/vap/sys/dev/usb/if_uath.c#10 (text+ko) ==== @@ -266,6 +266,9 @@ static void uath_update_promisc(struct ifnet *); static int uath_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); +static int uath_dataflush(struct uath_softc *); +static int uath_cmdflush(struct uath_softc *); +static int uath_flush(struct uath_softc *); static int uath_match(device_t dev) @@ -1723,6 +1726,30 @@ static int uath_flush(struct uath_softc *sc) { + int error; + + error = uath_dataflush(sc); + if (error != 0) + goto failed; + + error = uath_cmdflush(sc); + if (error != 0) + goto failed; + +failed: + return (error); +} + +static int +uath_cmdflush(struct uath_softc *sc) +{ + + return uath_cmd_write(sc, WDCMSG_FLUSH, NULL, 0, 0); +} + +static int +uath_dataflush(struct uath_softc *sc) +{ struct uath_data *data; struct uath_chunk *chunk; struct uath_tx_desc *desc; @@ -2376,15 +2403,9 @@ error = uath_flush(sc); if (error) { device_printf(sc->sc_dev, - "could not flush data pipe, error %d\n", error); + "could not flush pipes, error %d\n", error); goto failed; } - error = uath_cmd_write(sc, WDCMSG_FLUSH, NULL, 0, 0); - if (error) { - device_printf(sc->sc_dev, - "could not flush control pipe, error %d\n", error); - goto failed; - } failed: return (error); } @@ -2543,8 +2564,7 @@ /* abort pending transmits */ uath_abort_pipes(sc); /* flush data & control requests into the target */ - uath_flush(sc); - uath_cmd_write(sc, WDCMSG_FLUSH, NULL, 0, 0); + (void)uath_flush(sc); /* set a LED status to the disconnected. */ uath_set_ledstate(sc, 0); /* stop the target */