mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
net: designware: Pad small packets
Make sure that we pad small packets to a minimum length of 60 bytes (without FCS). This is necessary to interface with Ethernet switches that will reject RUNT frames unless padded correctly. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
This commit is contained in:
parent
137963d71a
commit
7a9ca9db40
1 changed files with 5 additions and 0 deletions
|
|
@ -18,6 +18,7 @@
|
|||
#include <pci.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/io.h>
|
||||
#include <power/regulator.h>
|
||||
#include "designware.h"
|
||||
|
|
@ -344,6 +345,8 @@ int designware_eth_enable(struct dw_eth_dev *priv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define ETH_ZLEN 60
|
||||
|
||||
static int _dw_eth_send(struct dw_eth_dev *priv, void *packet, int length)
|
||||
{
|
||||
struct eth_dma_regs *dma_p = priv->dma_regs_p;
|
||||
|
|
@ -370,6 +373,8 @@ static int _dw_eth_send(struct dw_eth_dev *priv, void *packet, int length)
|
|||
return -EPERM;
|
||||
}
|
||||
|
||||
length = max(length, ETH_ZLEN);
|
||||
|
||||
memcpy((void *)data_start, packet, length);
|
||||
|
||||
/* Flush data to be sent */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue