diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/bfin_mac.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/bfin_mac.c')
-rw-r--r-- | drivers/net/bfin_mac.c | 25 |
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) | |||
811 | static void bfin_mac_multicast_hash(struct net_device *dev) | 812 | static 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; |