aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vx
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@FreeBSD.org>1997-10-01 05:54:58 +0000
committerJun-ichiro itojun Hagino <itojun@FreeBSD.org>1997-10-01 05:54:58 +0000
commitb51da36807dd378ca35e7d098d8813bcc73885f3 (patch)
tree8c296081f8424ff5b699306032a12cd400f2d755 /sys/dev/vx
parent34de7199ea2963cae5cfe91bc9f7f62ff4f9c9f6 (diff)
downloadsrc-b51da36807dd378ca35e7d098d8813bcc73885f3.tar.gz
src-b51da36807dd378ca35e7d098d8813bcc73885f3.zip
To obey the traditional practice in mbuf chaining.
PR: 4020 Reviewed by: hamada@astec.co.jp
Notes
Notes: svn path=/head/; revision=30022
Diffstat (limited to 'sys/dev/vx')
-rw-r--r--sys/dev/vx/if_vx.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c
index 71799bf54256..f1f744f2ec42 100644
--- a/sys/dev/vx/if_vx.c
+++ b/sys/dev/vx/if_vx.c
@@ -850,6 +850,12 @@ vxget(sc, totlen)
*/
sh = splhigh();
+ /*
+ * Since we don't set allowLargePackets bit in MacControl register,
+ * we can assume that totlen <= 1500bytes.
+ * The while loop will be performed iff we have a packet with
+ * MLEN < m_len < MINCLSIZE.
+ */
while (totlen > 0) {
if (top) {
m = sc->mb[sc->next_mb];
@@ -867,18 +873,17 @@ vxget(sc, totlen)
len = MLEN;
}
if (totlen >= MINCLSIZE) {
- MCLGET(m, M_DONTWAIT);
- if (m->m_flags & M_EXT)
- len = MCLBYTES;
+ MCLGET(m, M_DONTWAIT);
+ if (m->m_flags & M_EXT)
+ len = MCLBYTES;
}
len = min(totlen, len);
- if (len > 3) {
- len &= ~3;
- insl(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int32_t *),
- len / 4);
- } else
- insb(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int8_t *),
- len);
+ if (len > 3)
+ insl(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int32_t *), len / 4);
+ if (len & 3) {
+ insb(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int8_t *) + (len & ~3),
+ len & 3);
+ }
m->m_len = len;
totlen -= len;
*mp = m;