]> err.no Git - linux-2.6/blobdiff - drivers/net/bfin_mac.c
smc91x: introduce platform data flags V2
[linux-2.6] / drivers / net / bfin_mac.c
index f2368b71a7203b8ba2a4380b5f7639c28ba5f78c..c993a32b3f50c1b0389a90ee193aa7bb24e94ba4 100644 (file)
@@ -408,7 +408,7 @@ static int mii_probe(struct net_device *dev)
        mdc_div = ((sclk / MDC_CLK) / 2) - 1;
 
        sysctl = bfin_read_EMAC_SYSCTL();
-       sysctl |= SET_MDCDIV(mdc_div);
+       sysctl = (sysctl & ~MDCDIV) | SET_MDCDIV(mdc_div);
        bfin_write_EMAC_SYSCTL(sysctl);
 
        /* search for connect PHY device */
@@ -651,6 +651,12 @@ static void bf537mac_rx(struct net_device *dev)
        current_rx_ptr->skb = new_skb;
        current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;
 
+       /* Invidate the data cache of skb->data range when it is write back
+        * cache. It will prevent overwritting the new data from DMA
+        */
+       blackfin_dcache_invalidate_range((unsigned long)new_skb->head,
+                                        (unsigned long)new_skb->end);
+
        len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
        skb_put(skb, len);
        blackfin_dcache_invalidate_range((unsigned long)skb->head,