diff options
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/norm_desc.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c index 88df0b48e35b..47d509435ebb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c | |||
@@ -122,37 +122,28 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, | |||
122 | return ret; | 122 | return ret; |
123 | } | 123 | } |
124 | 124 | ||
125 | static void ndesc_init_rx_desc(struct dma_desc *p, unsigned int ring_size, | 125 | static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode, |
126 | int disable_rx_ic, int mode) | 126 | int end) |
127 | { | 127 | { |
128 | int i; | 128 | p->des01.rx.own = 1; |
129 | for (i = 0; i < ring_size; i++) { | 129 | p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1; |
130 | p->des01.rx.own = 1; | 130 | |
131 | p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1; | 131 | if (mode == STMMAC_CHAIN_MODE) |
132 | 132 | ndesc_rx_set_on_chain(p, end); | |
133 | if (mode == STMMAC_CHAIN_MODE) | 133 | else |
134 | ndesc_rx_set_on_chain(p, (i == ring_size - 1)); | 134 | ndesc_rx_set_on_ring(p, end); |
135 | else | 135 | |
136 | ndesc_rx_set_on_ring(p, (i == ring_size - 1)); | 136 | if (disable_rx_ic) |
137 | 137 | p->des01.rx.disable_ic = 1; | |
138 | if (disable_rx_ic) | ||
139 | p->des01.rx.disable_ic = 1; | ||
140 | p++; | ||
141 | } | ||
142 | } | 138 | } |
143 | 139 | ||
144 | static void ndesc_init_tx_desc(struct dma_desc *p, unsigned int ring_size, | 140 | static void ndesc_init_tx_desc(struct dma_desc *p, int mode, int end) |
145 | int mode) | ||
146 | { | 141 | { |
147 | int i; | 142 | p->des01.tx.own = 0; |
148 | for (i = 0; i < ring_size; i++) { | 143 | if (mode == STMMAC_CHAIN_MODE) |
149 | p->des01.tx.own = 0; | 144 | ndesc_tx_set_on_chain(p, end); |
150 | if (mode == STMMAC_CHAIN_MODE) | 145 | else |
151 | ndesc_tx_set_on_chain(p, (i == (ring_size - 1))); | 146 | ndesc_tx_set_on_ring(p, end); |
152 | else | ||
153 | ndesc_tx_set_on_ring(p, (i == (ring_size - 1))); | ||
154 | p++; | ||
155 | } | ||
156 | } | 147 | } |
157 | 148 | ||
158 | static int ndesc_get_tx_owner(struct dma_desc *p) | 149 | static int ndesc_get_tx_owner(struct dma_desc *p) |