aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
diff options
context:
space:
mode:
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 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)