aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/norm_desc.c8
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index 029c2a2cf524..e13226b80d47 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,
126 for (i = 0; i < ring_size; i++) { 126 for (i = 0; i < ring_size; i++) {
127 p->des01.rx.own = 1; 127 p->des01.rx.own = 1;
128 p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1; 128 p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1;
129 p->des01.rx.buffer2_size = BUF_SIZE_2KiB - 1;
129 if (i == ring_size - 1) 130 if (i == ring_size - 1)
130 p->des01.rx.end_ring = 1; 131 p->des01.rx.end_ring = 1;
131 if (disable_rx_ic) 132 if (disable_rx_ic)
@@ -183,7 +184,12 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
183 int csum_flag) 184 int csum_flag)
184{ 185{
185 p->des01.tx.first_segment = is_fs; 186 p->des01.tx.first_segment = is_fs;
186 p->des01.tx.buffer1_size = len; 187
188 if (unlikely(len > BUF_SIZE_2KiB)) {
189 p->des01.etx.buffer1_size = BUF_SIZE_2KiB - 1;
190 p->des01.etx.buffer2_size = len - p->des01.etx.buffer1_size;
191 } else
192 p->des01.tx.buffer1_size = len;
187} 193}
188 194
189static void ndesc_clear_tx_ic(struct dma_desc *p) 195static void ndesc_clear_tx_ic(struct dma_desc *p)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f80190d78f90..3c7ef7127d75 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1412,10 +1412,10 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
1412 return -EBUSY; 1412 return -EBUSY;
1413 } 1413 }
1414 1414
1415 if (priv->plat->has_gmac) 1415 if (priv->plat->enh_desc)
1416 max_mtu = JUMBO_LEN; 1416 max_mtu = JUMBO_LEN;
1417 else 1417 else
1418 max_mtu = ETH_DATA_LEN; 1418 max_mtu = BUF_SIZE_4KiB;
1419 1419
1420 if ((new_mtu < 46) || (new_mtu > max_mtu)) { 1420 if ((new_mtu < 46) || (new_mtu > max_mtu)) {
1421 pr_err("%s: invalid MTU, max MTU is: %d\n", dev->name, max_mtu); 1421 pr_err("%s: invalid MTU, max MTU is: %d\n", dev->name, max_mtu);