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.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 14bd3801f7d3..587f93cf03f6 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -33,6 +33,7 @@
33#include <asm/dma.h> 33#include <asm/dma.h>
34#include <linux/dma-mapping.h> 34#include <linux/dma-mapping.h>
35 35
36#include <asm/dpmc.h>
36#include <asm/blackfin.h> 37#include <asm/blackfin.h>
37#include <asm/cacheflush.h> 38#include <asm/cacheflush.h>
38#include <asm/portmux.h> 39#include <asm/portmux.h>
@@ -386,8 +387,8 @@ static int mii_probe(struct net_device *dev)
386 u32 sclk, mdc_div; 387 u32 sclk, mdc_div;
387 388
388 /* Enable PHY output early */ 389 /* Enable PHY output early */
389 if (!(bfin_read_VR_CTL() & PHYCLKOE)) 390 if (!(bfin_read_VR_CTL() & CLKBUFOE))
390 bfin_write_VR_CTL(bfin_read_VR_CTL() | PHYCLKOE); 391 bfin_write_VR_CTL(bfin_read_VR_CTL() | CLKBUFOE);
391 392
392 sclk = get_sclk(); 393 sclk = get_sclk();
393 mdc_div = ((sclk / MDC_CLK) / 2) - 1; 394 mdc_div = ((sclk / MDC_CLK) / 2) - 1;
@@ -554,8 +555,8 @@ static void adjust_tx_list(void)
554{ 555{
555 int timeout_cnt = MAX_TIMEOUT_CNT; 556 int timeout_cnt = MAX_TIMEOUT_CNT;
556 557
557 if (tx_list_head->status.status_word != 0 558 if (tx_list_head->status.status_word != 0 &&
558 && current_tx_ptr != tx_list_head) { 559 current_tx_ptr != tx_list_head) {
559 goto adjust_head; /* released something, just return; */ 560 goto adjust_head; /* released something, just return; */
560 } 561 }
561 562
@@ -567,8 +568,8 @@ static void adjust_tx_list(void)
567 if (current_tx_ptr->next->next == tx_list_head) { 568 if (current_tx_ptr->next->next == tx_list_head) {
568 while (tx_list_head->status.status_word == 0) { 569 while (tx_list_head->status.status_word == 0) {
569 udelay(10); 570 udelay(10);
570 if (tx_list_head->status.status_word != 0 571 if (tx_list_head->status.status_word != 0 ||
571 || !(bfin_read_DMA2_IRQ_STATUS() & DMA_RUN)) { 572 !(bfin_read_DMA2_IRQ_STATUS() & DMA_RUN)) {
572 goto adjust_head; 573 goto adjust_head;
573 } 574 }
574 if (timeout_cnt-- < 0) { 575 if (timeout_cnt-- < 0) {
@@ -596,8 +597,8 @@ adjust_head:
596 ": no sk_buff in a transmitted frame!\n"); 597 ": no sk_buff in a transmitted frame!\n");
597 } 598 }
598 tx_list_head = tx_list_head->next; 599 tx_list_head = tx_list_head->next;
599 } while (tx_list_head->status.status_word != 0 600 } while (tx_list_head->status.status_word != 0 &&
600 && current_tx_ptr != tx_list_head); 601 current_tx_ptr != tx_list_head);
601 return; 602 return;
602 603
603} 604}
@@ -811,16 +812,14 @@ static void bfin_mac_timeout(struct net_device *dev)
811static void bfin_mac_multicast_hash(struct net_device *dev) 812static void bfin_mac_multicast_hash(struct net_device *dev)
812{ 813{
813 u32 emac_hashhi, emac_hashlo; 814 u32 emac_hashhi, emac_hashlo;
814 struct dev_mc_list *dmi = dev->mc_list; 815 struct dev_mc_list *dmi;
815 char *addrs; 816 char *addrs;
816 int i;
817 u32 crc; 817 u32 crc;
818 818
819 emac_hashhi = emac_hashlo = 0; 819 emac_hashhi = emac_hashlo = 0;
820 820
821 for (i = 0; i < dev->mc_count; i++) { 821 netdev_for_each_mc_addr(dmi, dev) {
822 addrs = dmi->dmi_addr; 822 addrs = dmi->dmi_addr;
823 dmi = dmi->next;
824 823
825 /* skip non-multicast addresses */ 824 /* skip non-multicast addresses */
826 if (!(*addrs & 1)) 825 if (!(*addrs & 1))
@@ -861,7 +860,7 @@ static void bfin_mac_set_multicast_list(struct net_device *dev)
861 sysctl = bfin_read_EMAC_OPMODE(); 860 sysctl = bfin_read_EMAC_OPMODE();
862 sysctl |= PAM; 861 sysctl |= PAM;
863 bfin_write_EMAC_OPMODE(sysctl); 862 bfin_write_EMAC_OPMODE(sysctl);
864 } else if (dev->mc_count) { 863 } else if (!netdev_mc_empty(dev)) {
865 /* set up multicast hash table */ 864 /* set up multicast hash table */
866 sysctl = bfin_read_EMAC_OPMODE(); 865 sysctl = bfin_read_EMAC_OPMODE();
867 sysctl |= HM; 866 sysctl |= HM;