diff options
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r-- | drivers/net/fec.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 2b5782056dda..0fbf1bbbaee9 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -751,13 +751,11 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi | |||
751 | if (mii_head) { | 751 | if (mii_head) { |
752 | mii_tail->mii_next = mip; | 752 | mii_tail->mii_next = mip; |
753 | mii_tail = mip; | 753 | mii_tail = mip; |
754 | } | 754 | } else { |
755 | else { | ||
756 | mii_head = mii_tail = mip; | 755 | mii_head = mii_tail = mip; |
757 | fep->hwp->fec_mii_data = regval; | 756 | fep->hwp->fec_mii_data = regval; |
758 | } | 757 | } |
759 | } | 758 | } else { |
760 | else { | ||
761 | retval = 1; | 759 | retval = 1; |
762 | } | 760 | } |
763 | 761 | ||
@@ -768,14 +766,11 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi | |||
768 | 766 | ||
769 | static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) | 767 | static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) |
770 | { | 768 | { |
771 | int k; | ||
772 | |||
773 | if(!c) | 769 | if(!c) |
774 | return; | 770 | return; |
775 | 771 | ||
776 | for(k = 0; (c+k)->mii_data != mk_mii_end; k++) { | 772 | for (; c->mii_data != mk_mii_end; c++) |
777 | mii_queue(dev, (c+k)->mii_data, (c+k)->funct); | 773 | mii_queue(dev, c->mii_data, c->funct); |
778 | } | ||
779 | } | 774 | } |
780 | 775 | ||
781 | static void mii_parse_sr(uint mii_reg, struct net_device *dev) | 776 | static void mii_parse_sr(uint mii_reg, struct net_device *dev) |
@@ -792,7 +787,6 @@ static void mii_parse_sr(uint mii_reg, struct net_device *dev) | |||
792 | status |= PHY_STAT_FAULT; | 787 | status |= PHY_STAT_FAULT; |
793 | if (mii_reg & 0x0020) | 788 | if (mii_reg & 0x0020) |
794 | status |= PHY_STAT_ANC; | 789 | status |= PHY_STAT_ANC; |
795 | |||
796 | *s = status; | 790 | *s = status; |
797 | } | 791 | } |
798 | 792 | ||
@@ -1239,7 +1233,6 @@ mii_link_interrupt(int irq, void * dev_id); | |||
1239 | #endif | 1233 | #endif |
1240 | 1234 | ||
1241 | #if defined(CONFIG_M5272) | 1235 | #if defined(CONFIG_M5272) |
1242 | |||
1243 | /* | 1236 | /* |
1244 | * Code specific to Coldfire 5272 setup. | 1237 | * Code specific to Coldfire 5272 setup. |
1245 | */ | 1238 | */ |
@@ -2020,8 +2013,7 @@ static void mii_relink(struct work_struct *work) | |||
2020 | & (PHY_STAT_100FDX | PHY_STAT_10FDX)) | 2013 | & (PHY_STAT_100FDX | PHY_STAT_10FDX)) |
2021 | duplex = 1; | 2014 | duplex = 1; |
2022 | fec_restart(dev, duplex); | 2015 | fec_restart(dev, duplex); |
2023 | } | 2016 | } else |
2024 | else | ||
2025 | fec_stop(dev); | 2017 | fec_stop(dev); |
2026 | 2018 | ||
2027 | #if 0 | 2019 | #if 0 |
@@ -2119,8 +2111,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) | |||
2119 | fep->phy_id = phytype << 16; | 2111 | fep->phy_id = phytype << 16; |
2120 | mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), | 2112 | mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), |
2121 | mii_discover_phy3); | 2113 | mii_discover_phy3); |
2122 | } | 2114 | } else { |
2123 | else { | ||
2124 | fep->phy_addr++; | 2115 | fep->phy_addr++; |
2125 | mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), | 2116 | mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), |
2126 | mii_discover_phy); | 2117 | mii_discover_phy); |
@@ -2574,8 +2565,7 @@ fec_restart(struct net_device *dev, int duplex) | |||
2574 | if (duplex) { | 2565 | if (duplex) { |
2575 | fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ | 2566 | fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ |
2576 | fecp->fec_x_cntrl = 0x04; /* FD enable */ | 2567 | fecp->fec_x_cntrl = 0x04; /* FD enable */ |
2577 | } | 2568 | } else { |
2578 | else { | ||
2579 | /* MII enable|No Rcv on Xmit */ | 2569 | /* MII enable|No Rcv on Xmit */ |
2580 | fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; | 2570 | fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; |
2581 | fecp->fec_x_cntrl = 0x00; | 2571 | fecp->fec_x_cntrl = 0x00; |