summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
diff options
context:
space:
mode:
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>2011-10-18 00:01:21 (GMT)
committerDavid S. Miller <davem@davemloft.net>2011-10-19 23:24:17 (GMT)
commit48febf7e64767c673cb84c7d9e2d1006115a0dc8 (patch)
tree966a9cf9dc87751c7b4ff3f80c6be1be0185a1e4 /drivers/net/ethernet/stmicro/stmmac/norm_desc.c
parent51e3137b9b6113c7e12cf0a0dc82238854a86712 (diff)
downloadlinux-fsl-qoriq-48febf7e64767c673cb84c7d9e2d1006115a0dc8.tar.xz
stmmac: allow mtu bigger than 1500 in case of normal desc (V4)
This patch allows to set the mtu bigger than 1500 in case of normal descriptors. This is helping some SPEAr customers. Signed-off-by: Deepak SIKRI <deepak.sikri@st.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/norm_desc.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/norm_desc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index 029c2a2..e13226b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -126,6 +126,7 @@ static void ndesc_init_rx_desc(struct dma_desc *p, unsigned int ring_size,
for (i = 0; i < ring_size; i++) {
p->des01.rx.own = 1;
p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1;
+ p->des01.rx.buffer2_size = BUF_SIZE_2KiB - 1;
if (i == ring_size - 1)
p->des01.rx.end_ring = 1;
if (disable_rx_ic)
@@ -183,7 +184,12 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
int csum_flag)
{
p->des01.tx.first_segment = is_fs;
- p->des01.tx.buffer1_size = len;
+
+ if (unlikely(len > BUF_SIZE_2KiB)) {
+ p->des01.etx.buffer1_size = BUF_SIZE_2KiB - 1;
+ p->des01.etx.buffer2_size = len - p->des01.etx.buffer1_size;
+ } else
+ p->des01.tx.buffer1_size = len;
}
static void ndesc_clear_tx_ic(struct dma_desc *p)