mirror of https://github.com/xemu-project/xemu.git
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQEcBAABAgAGBQJYRiFXAAoJEO8Ells5jWIRRMwH/3KGW5OpVexmS4sYD/jM+k+0 61UqThlKEdxcvgfJAFqnO+xmmq41ScAwGyweWwehrIJjcMXXsX1AGpEydxAchfIq 4nmV7+Xmvkdr0fOBxcbDFoLWnPevdQgCyL3a1QJn6WQsXa5NTP/H14KtuMtdA68e eda19TnXiHx+rJwtg4+jbXKcmwYGSs1mA7PE+StB83KY6cNrqd8tESzmQmbAdkTj r2zqg7zhQvj6iaE4PPZK4/tlM817zaLnqRVOfHbwlHqUW4K3N4osUvWQMfRe5gg5 /TpeE4JgLp6wbRh5Gxv2dKicFyD7KHLXkJrlEx9o9JQ/pIP/COiDhFW5zDAmh3M= =izsw -----END PGP SIGNATURE----- Merge remote-tracking branch 'jasowang/tags/net-pull-request' into staging # gpg: Signature made Tue 06 Dec 2016 02:24:23 AM GMT # gpg: using RSA key 0xEF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * jasowang/tags/net-pull-request: fsl_etsec: Fix various small problems in hexdump code fsl_etsec: Pad short payloads with zeros net: mcf: check receive buffer size register value Message-id: 1480991552-14360-1-git-send-email-jasowang@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
commit
ce1f3e88f8
|
@ -348,8 +348,8 @@ static ssize_t etsec_receive(NetClientState *nc,
|
|||
eTSEC *etsec = qemu_get_nic_opaque(nc);
|
||||
|
||||
#if defined(HEX_DUMP)
|
||||
fprintf(stderr, "%s receive size:%d\n", etsec->nic->nc.name, size);
|
||||
qemu_hexdump(buf, stderr, "", size);
|
||||
fprintf(stderr, "%s receive size:%zd\n", nc->name, size);
|
||||
qemu_hexdump((void *)buf, stderr, "", size);
|
||||
#endif
|
||||
/* Flush is unnecessary as are already in receiving path */
|
||||
etsec->need_flush = false;
|
||||
|
|
|
@ -474,6 +474,14 @@ static void rx_init_frame(eTSEC *etsec, const uint8_t *buf, size_t size)
|
|||
/* CRC padding (We don't have to compute the CRC) */
|
||||
etsec->rx_padding = 4;
|
||||
|
||||
/*
|
||||
* Ensure that payload length + CRC length is at least 802.3
|
||||
* minimum MTU size bytes long (64)
|
||||
*/
|
||||
if (etsec->rx_buffer_len < 60) {
|
||||
etsec->rx_padding += 60 - etsec->rx_buffer_len;
|
||||
}
|
||||
|
||||
etsec->rx_first_in_frame = 1;
|
||||
etsec->rx_remaining_data = etsec->rx_buffer_len;
|
||||
RING_DEBUG("%s: rx_buffer_len:%u rx_padding+crc:%u\n", __func__,
|
||||
|
|
|
@ -393,7 +393,7 @@ static void mcf_fec_write(void *opaque, hwaddr addr,
|
|||
s->tx_descriptor = s->etdsr;
|
||||
break;
|
||||
case 0x188:
|
||||
s->emrbr = value & 0x7f0;
|
||||
s->emrbr = value > 0 ? value & 0x7F0 : 0x7F0;
|
||||
break;
|
||||
default:
|
||||
hw_error("mcf_fec_write Bad address 0x%x\n", (int)addr);
|
||||
|
|
Loading…
Reference in New Issue