PERFORCE change 157018 for review
Weongyo Jeong
weongyo at FreeBSD.org
Sun Feb 1 18:23:47 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=157018
Change 157018 by weongyo at 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 */
More information about the p4-projects
mailing list