提交 20b429b0 编写于 作者: S Simon Glass 提交者: Tom Rini

net: smsc95xx: Correct free_pkt() implementation

On further review this returns the wrong packet length from the driver.
It may not be noticed since protocols will take care of it. Fix it by
subtracting the header length from the packet length returned.
Signed-off-by: NSimon Glass <sjg@chromium.org>
上级 dd9999d5
......@@ -998,7 +998,7 @@ int smsc95xx_eth_recv(struct udevice *dev, int flags, uchar **packetp)
}
*packetp = ptr + sizeof(packet_len);
return packet_len;
return packet_len - 4;
err:
usb_ether_advance_rxbuf(ueth, -1);
......@@ -1009,7 +1009,7 @@ static int smsc95xx_free_pkt(struct udevice *dev, uchar *packet, int packet_len)
{
struct smsc95xx_private *priv = dev_get_priv(dev);
packet_len = ALIGN(packet_len, 4);
packet_len = ALIGN(packet_len + sizeof(u32), 4);
usb_ether_advance_rxbuf(&priv->ueth, sizeof(u32) + packet_len);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册