mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 00:41:30 +01:00
Clean up rxeof routines a little.
This commit is contained in:
parent
0f210c922b
commit
f1a80ccf63
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55940
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user