Clean up rxeof routines a little.

This commit is contained in:
Bill Paul 2000-01-14 00:49:28 +00:00
parent 0f210c922b
commit f1a80ccf63
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55940
2 changed files with 17 additions and 9 deletions

View File

@ -985,14 +985,15 @@ static void aue_rxeof(xfer, priv, status)
/* Put the packet on the special USB input queue. */
usb_ether_input(m);
return;
done:
#ifdef foo
/* Setup new transfer. */
usbd_setup_xfer(xfer, sc->aue_ep[AUE_ENDPT_RX],
c, mtod(c->aue_mbuf, char *), AUE_CUTOFF, USBD_SHORT_XFER_OK,
USBD_NO_TIMEOUT, aue_rxeof);
usbd_transfer(xfer);
#endif
return;
}

View File

@ -698,13 +698,8 @@ static void kue_rxeof(xfer, priv, status)
usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL);
m = c->kue_mbuf;
if (total_len <= 1) {
usbd_setup_xfer(c->kue_xfer, sc->kue_ep[KUE_ENDPT_RX],
c, mtod(c->kue_mbuf, char *), KUE_BUFSZ, USBD_SHORT_XFER_OK,
USBD_NO_TIMEOUT, kue_rxeof);
usbd_transfer(c->kue_xfer);
return;
}
if (total_len <= 1)
goto done;
len = *mtod(m, u_int16_t *);
m_adj(m, sizeof(u_int16_t));
@ -712,6 +707,11 @@ static void kue_rxeof(xfer, priv, status)
/* No errors; receive the packet. */
total_len = len;
if (len < sizeof(struct ether_header)) {
ifp->if_ierrors++;
goto done;
}
ifp->if_ipackets++;
m->m_pkthdr.rcvif = (struct ifnet *)&kue_qdat;
m->m_pkthdr.len = m->m_len = total_len;
@ -719,8 +719,15 @@ static void kue_rxeof(xfer, priv, status)
/* Put the packet on the special USB input queue. */
usb_ether_input(m);
return;
done:
/* Setup new transfer. */
usbd_setup_xfer(c->kue_xfer, sc->kue_ep[KUE_ENDPT_RX],
c, mtod(c->kue_mbuf, char *), KUE_BUFSZ, USBD_SHORT_XFER_OK,
USBD_NO_TIMEOUT, kue_rxeof);
usbd_transfer(c->kue_xfer);
return;
}