Skip to content

Commit

Permalink
MIMXRT1050: Fix ENET issues
Browse files Browse the repository at this point in the history
This is a fix for Issue 10239. The change aligns
the receive buffer lengths

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
  • Loading branch information
mmahadevan108 committed Apr 3, 2019
1 parent d8dc981 commit 65942ba
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ bool Kinetis_EMAC::low_level_init_successful()

/* Create buffers for each receive BD */
for (i = 0; i < ENET_RX_RING_LEN; i++) {
rx_buff[i] = memory_manager->alloc_heap(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT);
rx_buff[i] = memory_manager->alloc_heap(ENET_ALIGN(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT),
ENET_BUFF_ALIGNMENT);
if (NULL == rx_buff[i])
return false;

Expand Down Expand Up @@ -279,7 +280,8 @@ emac_mem_buf_t *Kinetis_EMAC::low_level_input(int idx)
memory_manager->set_len(p, length);

/* Attempt to queue new buffer */
temp_rxbuf = memory_manager->alloc_heap(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT);
temp_rxbuf = memory_manager->alloc_heap(ENET_ALIGN(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT),
ENET_BUFF_ALIGNMENT);
if (NULL == temp_rxbuf) {
/* Re-queue the same buffer */
update_read_buffer(NULL);
Expand Down

0 comments on commit 65942ba

Please sign in to comment.