Fix from stegerg: double size so wrapped-over data can be appended at end

This commit is contained in:
deadwood 2024-04-23 10:32:54 +02:00
parent 7adbd730b8
commit 7c4b46dc28
2 changed files with 9 additions and 0 deletions

View File

@ -555,7 +555,11 @@ static int rtl8139nic_open(struct net_device *unit)
np->rx_buffer = HIDD_PCIDriver_AllocPCIMem(
unit->rtl8139u_PCIDriver,
#if 1 //stegerg: double size so wrapped-over data can be appended at end
(np->rx_buf_len * 2 + 16 + (TX_BUF_SIZE * NUM_TX_DESC))
#else
(np->rx_buf_len + 16 + (TX_BUF_SIZE * NUM_TX_DESC))
#endif
);
if (np->rx_buffer != NULL)

View File

@ -212,8 +212,13 @@ RTLD(bug("[%s] RTL8139_RX_Process: frame @ %p, len=%d\n", unit->rtl8139u_name, f
{
overspill = (ring_offset + rx_size) - np->rx_buf_len;
RTLD(bug("[%s] RTL8139_RX_Process: WRAPPED Frame! (%d bytes overspill)\n", unit->rtl8139u_name, overspill))
#if 1 //stegerg: double size so wrapped-over data can be appended at end
CopyMem(np->rx_buffer, np->rx_buffer + np->rx_buf_len, overspill);
#else
len = len - overspill;
/* TODO: We need to copy the wrapped buffer into a temp buff to pass to listeners! */
#endif
}
RTLD( int j;