aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar7
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-08-22 17:09:00 +0000
committerFlorian Fainelli <florian@openwrt.org>2010-08-22 17:09:00 +0000
commit81ae0e49c46fdad2b5e99b19bc75e3a2e2acbd37 (patch)
tree7caa7c91ae1de5a9d84c2f889626a9480bcfac11 /target/linux/ar7
parent54df4395cccd0483a54b9c424bdd919d641218d7 (diff)
downloadupstream-81ae0e49c46fdad2b5e99b19bc75e3a2e2acbd37.tar.gz
upstream-81ae0e49c46fdad2b5e99b19bc75e3a2e2acbd37.tar.bz2
upstream-81ae0e49c46fdad2b5e99b19bc75e3a2e2acbd37.zip
[ar7] cleanup the cpmac phy mask, patch from Ben Witten
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22770 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar7')
-rw-r--r--target/linux/ar7/patches-2.6.32/971-cpmac_cleanup.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.32/971-cpmac_cleanup.patch b/target/linux/ar7/patches-2.6.32/971-cpmac_cleanup.patch
new file mode 100644
index 0000000000..754119a41c
--- /dev/null
+++ b/target/linux/ar7/patches-2.6.32/971-cpmac_cleanup.patch
@@ -0,0 +1,48 @@
+--- a/drivers/net/cpmac.c
++++ b/drivers/net/cpmac.c
+@@ -33,7 +33,6 @@
+ #include <linux/skbuff.h>
+ #include <linux/mii.h>
+ #include <linux/phy.h>
+-#include <linux/phy_fixed.h>
+ #include <linux/platform_device.h>
+ #include <linux/dma-mapping.h>
+ #include <asm/gpio.h>
+@@ -1104,8 +1103,6 @@ static const struct net_device_ops cpmac
+ .ndo_set_mac_address = eth_mac_addr,
+ };
+
+-static int external_switch;
+-
+ static int __devinit cpmac_probe(struct platform_device *pdev)
+ {
+ int rc, phy_id;
+@@ -1127,10 +1124,8 @@ static int __devinit cpmac_probe(struct
+ }
+
+ if (phy_id == PHY_MAX_ADDR) {
+- //This probably wont work as no fixed bus anymore.
+- dev_err(&pdev->dev, "no PHY present, falling back to switch mode\n");
+- strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+- phy_id = pdev->id;
++ dev_err(&pdev->dev, "no PHY present\n");
++ return -ENODEV;
+ }
+
+ dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
+@@ -1258,14 +1253,8 @@ int __devinit cpmac_init(void)
+ else
+ msleep(10);
+
+- mask &= 0x7fffffff;
+- if (mask & (mask - 1)) {
+- external_switch = 1;
+- mask = 0;
+- }
+-
+ cpmac_mii->phy_mask = ar7_is_titan()? ~(mask | 0x80000000 | 0x40000000):
+- ~(mask | 0x80000001);
++ ~(mask | 0x80000000);
+ snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1");
+
+ res = mdiobus_register(cpmac_mii);