aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 12:02:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 12:02:26 -0500
commit37969581301e50872a1ae84dc73962b5f7ee6b76 (patch)
tree35bbd6a07f903f248f4bd209b8d194a922415fe0 /drivers/net
parent80ff8a805113850a3ffafcc8e6eaa1fdd51b02f3 (diff)
parent24f1a849614ba1805e26a05da7cc8c6bd67490ea (diff)
Merge branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (69 commits) [POWERPC] Add SPE registers to core dumps [POWERPC] Use regset code for compat PTRACE_*REGS* calls [POWERPC] Use generic compat_sys_ptrace [POWERPC] Use generic compat_ptrace_request [POWERPC] Use generic ptrace peekdata/pokedata [POWERPC] Use regset code for PTRACE_*REGS* requests [POWERPC] Switch to generic compat_binfmt_elf code [POWERPC] Switch to using user_regset-based core dumps [POWERPC] Add user_regset compat support [POWERPC] Add user_regset_view definitions [POWERPC] Use user_regset accessors for GPRs [POWERPC] ptrace accessors for special regs MSR and TRAP [POWERPC] Use user_regset accessors for SPE regs [POWERPC] Use user_regset accessors for altivec regs [POWERPC] Use user_regset accessors for FP regs [POWERPC] mpc52xx: fix compile error introduce when rebasing patch [POWERPC] 4xx: PCIe indirect DCR spinlock fix. [POWERPC] Add missing native dcr dcr_ind_lock spinlock [POWERPC] 4xx: Fix offset value on Warp board [POWERPC] 4xx: Add 440EPx Sequoia ehci dts entry ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig4
-rw-r--r--drivers/net/cpmac.c55
2 files changed, 19 insertions, 40 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 7d170cd381c3..9cc25fd80b60 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1737,10 +1737,8 @@ config SC92031
1737 1737
1738config CPMAC 1738config CPMAC
1739 tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)" 1739 tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)"
1740 depends on NET_ETHERNET && EXPERIMENTAL && AR7 1740 depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN
1741 select PHYLIB 1741 select PHYLIB
1742 select FIXED_PHY
1743 select FIXED_MII_100_FDX
1744 help 1742 help
1745 TI AR7 CPMAC Ethernet support 1743 TI AR7 CPMAC Ethernet support
1746 1744
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index 6ccebb830ff9..c85194f2cd2d 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -845,15 +845,6 @@ static void cpmac_adjust_link(struct net_device *dev)
845 spin_unlock(&priv->lock); 845 spin_unlock(&priv->lock);
846} 846}
847 847
848static int cpmac_link_update(struct net_device *dev,
849 struct fixed_phy_status *status)
850{
851 status->link = 1;
852 status->speed = 100;
853 status->duplex = 1;
854 return 0;
855}
856
857static int cpmac_open(struct net_device *dev) 848static int cpmac_open(struct net_device *dev)
858{ 849{
859 int i, size, res; 850 int i, size, res;
@@ -996,11 +987,11 @@ static int external_switch;
996static int __devinit cpmac_probe(struct platform_device *pdev) 987static int __devinit cpmac_probe(struct platform_device *pdev)
997{ 988{
998 int rc, phy_id, i; 989 int rc, phy_id, i;
990 int mdio_bus_id = cpmac_mii.id;
999 struct resource *mem; 991 struct resource *mem;
1000 struct cpmac_priv *priv; 992 struct cpmac_priv *priv;
1001 struct net_device *dev; 993 struct net_device *dev;
1002 struct plat_cpmac_data *pdata; 994 struct plat_cpmac_data *pdata;
1003 struct fixed_info *fixed_phy;
1004 DECLARE_MAC_BUF(mac); 995 DECLARE_MAC_BUF(mac);
1005 996
1006 pdata = pdev->dev.platform_data; 997 pdata = pdev->dev.platform_data;
@@ -1014,9 +1005,23 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1014 } 1005 }
1015 1006
1016 if (phy_id == PHY_MAX_ADDR) { 1007 if (phy_id == PHY_MAX_ADDR) {
1017 if (external_switch || dumb_switch) 1008 if (external_switch || dumb_switch) {
1009 struct fixed_phy_status status = {};
1010
1011 mdio_bus_id = 0;
1012
1013 /*
1014 * FIXME: this should be in the platform code!
1015 * Since there is not platform code at all (that is,
1016 * no mainline users of that driver), place it here
1017 * for now.
1018 */
1018 phy_id = 0; 1019 phy_id = 0;
1019 else { 1020 status.link = 1;
1021 status.duplex = 1;
1022 status.speed = 100;
1023 fixed_phy_add(PHY_POLL, phy_id, &status);
1024 } else {
1020 printk(KERN_ERR "cpmac: no PHY present\n"); 1025 printk(KERN_ERR "cpmac: no PHY present\n");
1021 return -ENODEV; 1026 return -ENODEV;
1022 } 1027 }
@@ -1060,32 +1065,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1060 priv->msg_enable = netif_msg_init(debug_level, 0xff); 1065 priv->msg_enable = netif_msg_init(debug_level, 0xff);
1061 memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); 1066 memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
1062 1067
1063 if (phy_id == 31) { 1068 snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
1064 snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, cpmac_mii.id,
1065 phy_id);
1066 } else {
1067 /* Let's try to get a free fixed phy... */
1068 for (i = 0; i < MAX_PHY_AMNT; i++) {
1069 fixed_phy = fixed_mdio_get_phydev(i);
1070 if (!fixed_phy)
1071 continue;
1072 if (!fixed_phy->phydev->attached_dev) {
1073 strncpy(priv->phy_name,
1074 fixed_phy->phydev->dev.bus_id,
1075 BUS_ID_SIZE);
1076 fixed_mdio_set_link_update(fixed_phy->phydev,
1077 &cpmac_link_update);
1078 goto phy_found;
1079 }
1080 }
1081 if (netif_msg_drv(priv))
1082 printk(KERN_ERR "%s: Could not find fixed PHY\n",
1083 dev->name);
1084 rc = -ENODEV;
1085 goto fail;
1086 }
1087 1069
1088phy_found:
1089 priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0, 1070 priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
1090 PHY_INTERFACE_MODE_MII); 1071 PHY_INTERFACE_MODE_MII);
1091 if (IS_ERR(priv->phy)) { 1072 if (IS_ERR(priv->phy)) {