aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bfin_mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bfin_mac.c')
-rw-r--r--drivers/net/bfin_mac.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 16f2a37c733d..2b364ba6b62e 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -203,6 +203,11 @@ static int desc_list_init(void)
203 goto init_error; 203 goto init_error;
204 } 204 }
205 skb_reserve(new_skb, NET_IP_ALIGN); 205 skb_reserve(new_skb, NET_IP_ALIGN);
206 /* Invidate the data cache of skb->data range when it is write back
207 * cache. It will prevent overwritting the new data from DMA
208 */
209 blackfin_dcache_invalidate_range((unsigned long)new_skb->head,
210 (unsigned long)new_skb->end);
206 r->skb = new_skb; 211 r->skb = new_skb;
207 212
208 /* 213 /*
@@ -1011,19 +1016,17 @@ static void bfin_mac_rx(struct net_device *dev)
1011 } 1016 }
1012 /* reserve 2 bytes for RXDWA padding */ 1017 /* reserve 2 bytes for RXDWA padding */
1013 skb_reserve(new_skb, NET_IP_ALIGN); 1018 skb_reserve(new_skb, NET_IP_ALIGN);
1014 current_rx_ptr->skb = new_skb;
1015 current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;
1016
1017 /* Invidate the data cache of skb->data range when it is write back 1019 /* Invidate the data cache of skb->data range when it is write back
1018 * cache. It will prevent overwritting the new data from DMA 1020 * cache. It will prevent overwritting the new data from DMA
1019 */ 1021 */
1020 blackfin_dcache_invalidate_range((unsigned long)new_skb->head, 1022 blackfin_dcache_invalidate_range((unsigned long)new_skb->head,
1021 (unsigned long)new_skb->end); 1023 (unsigned long)new_skb->end);
1022 1024
1025 current_rx_ptr->skb = new_skb;
1026 current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;
1027
1023 len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN); 1028 len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
1024 skb_put(skb, len); 1029 skb_put(skb, len);
1025 blackfin_dcache_invalidate_range((unsigned long)skb->head,
1026 (unsigned long)skb->tail);
1027 1030
1028 skb->protocol = eth_type_trans(skb, dev); 1031 skb->protocol = eth_type_trans(skb, dev);
1029 1032