diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-09 11:00:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-09 11:00:55 -0500 |
commit | b37df85960a34dd96d0a4695c650f7972ef56c30 (patch) | |
tree | 6b096e3c01bbfd4bac062f3e013e9a43de1a8f4e /drivers/net/ucc_geth.c | |
parent | 5986a2ec35836a878350c54af4bd91b1de6abc59 (diff) | |
parent | 2cb4abd12bab7efd22a8b69d3b9a739500e8fee5 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
MAINTAINERS: update DMFE and wireless drivers mailing list
ucc_geth: Add support to local-mac-address property
ucc_geth: Remove obsolete workaround of link speed change
cxgb3: sysfs attributes in -mm tree
Add Attansic L1 ethernet driver.
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r-- | drivers/net/ucc_geth.c | 79 |
1 files changed, 12 insertions, 67 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index abb8611c5a91..31c97a6591a4 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -1709,75 +1709,13 @@ static void adjust_link(struct net_device *dev) | |||
1709 | if (mii_info->speed != ugeth->oldspeed) { | 1709 | if (mii_info->speed != ugeth->oldspeed) { |
1710 | switch (mii_info->speed) { | 1710 | switch (mii_info->speed) { |
1711 | case 1000: | 1711 | case 1000: |
1712 | #ifdef CONFIG_PPC_MPC836x | 1712 | ugeth->ug_info->enet_interface = ENET_1000_RGMII; |
1713 | /* FIXME: This code is for 100Mbs BUG fixing, | ||
1714 | remove this when it is fixed!!! */ | ||
1715 | if (ugeth->ug_info->enet_interface == | ||
1716 | ENET_1000_GMII) | ||
1717 | /* Run the commands which initialize the PHY */ | ||
1718 | { | ||
1719 | tempval = | ||
1720 | (u32) mii_info->mdio_read(ugeth-> | ||
1721 | dev, mii_info->mii_id, 0x1b); | ||
1722 | tempval |= 0x000f; | ||
1723 | mii_info->mdio_write(ugeth->dev, | ||
1724 | mii_info->mii_id, 0x1b, | ||
1725 | (u16) tempval); | ||
1726 | tempval = | ||
1727 | (u32) mii_info->mdio_read(ugeth-> | ||
1728 | dev, mii_info->mii_id, | ||
1729 | MII_BMCR); | ||
1730 | mii_info->mdio_write(ugeth->dev, | ||
1731 | mii_info->mii_id, MII_BMCR, | ||
1732 | (u16) (tempval | BMCR_RESET)); | ||
1733 | } else if (ugeth->ug_info->enet_interface == | ||
1734 | ENET_1000_RGMII) | ||
1735 | /* Run the commands which initialize the PHY */ | ||
1736 | { | ||
1737 | tempval = | ||
1738 | (u32) mii_info->mdio_read(ugeth-> | ||
1739 | dev, mii_info->mii_id, 0x1b); | ||
1740 | tempval = (tempval & ~0x000f) | 0x000b; | ||
1741 | mii_info->mdio_write(ugeth->dev, | ||
1742 | mii_info->mii_id, 0x1b, | ||
1743 | (u16) tempval); | ||
1744 | tempval = | ||
1745 | (u32) mii_info->mdio_read(ugeth-> | ||
1746 | dev, mii_info->mii_id, | ||
1747 | MII_BMCR); | ||
1748 | mii_info->mdio_write(ugeth->dev, | ||
1749 | mii_info->mii_id, MII_BMCR, | ||
1750 | (u16) (tempval | BMCR_RESET)); | ||
1751 | } | ||
1752 | msleep(4000); | ||
1753 | #endif /* CONFIG_MPC8360 */ | ||
1754 | adjust_enet_interface(ugeth); | ||
1755 | break; | 1713 | break; |
1756 | case 100: | 1714 | case 100: |
1757 | case 10: | ||
1758 | #ifdef CONFIG_PPC_MPC836x | ||
1759 | /* FIXME: This code is for 100Mbs BUG fixing, | ||
1760 | remove this lines when it will be fixed!!! */ | ||
1761 | ugeth->ug_info->enet_interface = ENET_100_RGMII; | 1715 | ugeth->ug_info->enet_interface = ENET_100_RGMII; |
1762 | tempval = | 1716 | break; |
1763 | (u32) mii_info->mdio_read(ugeth->dev, | 1717 | case 10: |
1764 | mii_info->mii_id, | 1718 | ugeth->ug_info->enet_interface = ENET_10_RGMII; |
1765 | 0x1b); | ||
1766 | tempval = (tempval & ~0x000f) | 0x000b; | ||
1767 | mii_info->mdio_write(ugeth->dev, | ||
1768 | mii_info->mii_id, 0x1b, | ||
1769 | (u16) tempval); | ||
1770 | tempval = | ||
1771 | (u32) mii_info->mdio_read(ugeth->dev, | ||
1772 | mii_info->mii_id, | ||
1773 | MII_BMCR); | ||
1774 | mii_info->mdio_write(ugeth->dev, | ||
1775 | mii_info->mii_id, MII_BMCR, | ||
1776 | (u16) (tempval | | ||
1777 | BMCR_RESET)); | ||
1778 | msleep(4000); | ||
1779 | #endif /* CONFIG_MPC8360 */ | ||
1780 | adjust_enet_interface(ugeth); | ||
1781 | break; | 1719 | break; |
1782 | default: | 1720 | default: |
1783 | ugeth_warn | 1721 | ugeth_warn |
@@ -1785,6 +1723,7 @@ remove this lines when it will be fixed!!! */ | |||
1785 | dev->name, mii_info->speed); | 1723 | dev->name, mii_info->speed); |
1786 | break; | 1724 | break; |
1787 | } | 1725 | } |
1726 | adjust_enet_interface(ugeth); | ||
1788 | 1727 | ||
1789 | ugeth_info("%s: Speed %dBT", dev->name, | 1728 | ugeth_info("%s: Speed %dBT", dev->name, |
1790 | mii_info->speed); | 1729 | mii_info->speed); |
@@ -4133,6 +4072,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
4133 | static int mii_mng_configured = 0; | 4072 | static int mii_mng_configured = 0; |
4134 | const phandle *ph; | 4073 | const phandle *ph; |
4135 | const unsigned int *prop; | 4074 | const unsigned int *prop; |
4075 | const void *mac_addr; | ||
4136 | 4076 | ||
4137 | ugeth_vdbg("%s: IN", __FUNCTION__); | 4077 | ugeth_vdbg("%s: IN", __FUNCTION__); |
4138 | 4078 | ||
@@ -4258,7 +4198,12 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
4258 | 4198 | ||
4259 | ugeth->ug_info = ug_info; | 4199 | ugeth->ug_info = ug_info; |
4260 | ugeth->dev = dev; | 4200 | ugeth->dev = dev; |
4261 | memcpy(dev->dev_addr, get_property(np, "mac-address", NULL), 6); | 4201 | |
4202 | mac_addr = get_property(np, "mac-address", NULL); | ||
4203 | if (mac_addr == NULL) | ||
4204 | mac_addr = get_property(np, "local-mac-address", NULL); | ||
4205 | if (mac_addr) | ||
4206 | memcpy(dev->dev_addr, mac_addr, 6); | ||
4262 | 4207 | ||
4263 | return 0; | 4208 | return 0; |
4264 | } | 4209 | } |