aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar7/patches-2.6.35/971-cpmac_cleanup.patch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-08-26 09:13:44 +0000
committerFlorian Fainelli <florian@openwrt.org>2010-08-26 09:13:44 +0000
commit00e15a3abfca51c397cd3a0bb4812b6513a0cbd2 (patch)
tree35f55921833769838e6fe66bf00ba60d96c77029 /target/linux/ar7/patches-2.6.35/971-cpmac_cleanup.patch
parent7ec50d1a2f8299e16e57f88392b7dab6a96af1e5 (diff)
downloadupstream-00e15a3abfca51c397cd3a0bb4812b6513a0cbd2.tar.gz
upstream-00e15a3abfca51c397cd3a0bb4812b6513a0cbd2.tar.bz2
upstream-00e15a3abfca51c397cd3a0bb4812b6513a0cbd2.zip
add 2.6.35 support
SVN-Revision: 22812
Diffstat (limited to 'target/linux/ar7/patches-2.6.35/971-cpmac_cleanup.patch')
-rw-r--r--target/linux/ar7/patches-2.6.35/971-cpmac_cleanup.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.35/971-cpmac_cleanup.patch b/target/linux/ar7/patches-2.6.35/971-cpmac_cleanup.patch
new file mode 100644
index 0000000000..99e8fbe8d9
--- /dev/null
+++ b/target/linux/ar7/patches-2.6.35/971-cpmac_cleanup.patch
@@ -0,0 +1,69 @@
+--- a/drivers/net/cpmac.c
++++ b/drivers/net/cpmac.c
+@@ -34,7 +34,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 <linux/clk.h>
+@@ -1108,8 +1107,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;
+@@ -1121,24 +1118,18 @@ static int __devinit cpmac_probe(struct
+
+ pdata = pdev->dev.platform_data;
+
+- if (external_switch || dumb_switch) {
+- strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+- phy_id = pdev->id;
+- } else {
+- for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
+- if (!(pdata->phy_mask & (1 << phy_id)))
+- continue;
+- if (!cpmac_mii->phy_map[phy_id])
+- continue;
+- strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE);
+- break;
+- }
++ for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
++ if (!(pdata->phy_mask & (1 << phy_id)))
++ continue;
++ if (!cpmac_mii->phy_map[phy_id])
++ continue;
++ strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE);
++ break;
+ }
+
+ if (phy_id == PHY_MAX_ADDR) {
+- dev_err(&pdev->dev, "no PHY present, falling back to switch on MDIO bus 0\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);
+@@ -1266,14 +1257,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);