Date: Mon, 2 Feb 2009 02:23:45 GMT From: Weongyo Jeong <weongyo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 157018 for review Message-ID: <200902020223.n122NjgY002283@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902020223.n122NjgY002283>