projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
resync ixp4xx 2.6.30 patches with -rc3
[openwrt.git]
/
package
/
switch
/
src
/
switch-robo.c
diff --git
a/package/switch/src/switch-robo.c
b/package/switch/src/switch-robo.c
index
779b89f
..
21343ed
100644
(file)
--- a/
package/switch/src/switch-robo.c
+++ b/
package/switch/src/switch-robo.c
@@
-41,6
+41,7
@@
#define ROBO_PHY_ADDR 0x1E /* robo switch phy address */
#define ROBO_PHY_ADDR_TG3 0x01 /* Tigon3 PHY address */
#define ROBO_PHY_ADDR 0x1E /* robo switch phy address */
#define ROBO_PHY_ADDR_TG3 0x01 /* Tigon3 PHY address */
+#define ROBO_PHY_ADDR_BCM63XX 0x00 /* BCM63XX PHY address */
/* MII registers */
#define REG_MII_PAGE 0x10 /* MII Page register */
/* MII registers */
#define REG_MII_PAGE 0x10 /* MII Page register */
@@
-67,6
+68,10
@@
#define bool int
#endif
#define bool int
#endif
+
+extern char *nvram_get(const char *name);
+#define getvar(str) (nvram_get(str)?:"")
+
/* Data structure for a Roboswitch device. */
struct robo_switch {
char *device; /* The device name string (ethX) */
/* Data structure for a Roboswitch device. */
struct robo_switch {
char *device; /* The device name string (ethX) */
@@
-270,8
+275,9
@@
static int robo_switch_enable(void)
robo_write16(ROBO_CTRL_PAGE, i, 0);
}
robo_write16(ROBO_CTRL_PAGE, i, 0);
}
- /* WAN port LED */
- robo_write16(ROBO_CTRL_PAGE, 0x16, 0x1F);
+ /* WAN port LED, except for Netgear WGT634U */
+ if (strcmp(getvar("nvram_type"), "cfe") != 0)
+ robo_write16(ROBO_CTRL_PAGE, 0x16, 0x1F);
return 0;
}
return 0;
}
@@
-318,13
+324,14
@@
static int robo_probe(char *devname)
/* got phy address check for robo address */
struct mii_ioctl_data *mii = (struct mii_ioctl_data *) &robo.ifr.ifr_data;
if ((mii->phy_id != ROBO_PHY_ADDR) &&
/* got phy address check for robo address */
struct mii_ioctl_data *mii = (struct mii_ioctl_data *) &robo.ifr.ifr_data;
if ((mii->phy_id != ROBO_PHY_ADDR) &&
+ (mii->phy_id != ROBO_PHY_ADDR_BCM63XX) &&
(mii->phy_id != ROBO_PHY_ADDR_TG3)) {
printk("Invalid phy address (%d)\n", mii->phy_id);
return 1;
}
robo.use_et = 0;
/* The robo has a fixed PHY address that is different from the
(mii->phy_id != ROBO_PHY_ADDR_TG3)) {
printk("Invalid phy address (%d)\n", mii->phy_id);
return 1;
}
robo.use_et = 0;
/* The robo has a fixed PHY address that is different from the
- * Tigon3 PHY address. */
+ * Tigon3
and BCM63xx
PHY address. */
robo.phy_addr = ROBO_PHY_ADDR;
}
robo.phy_addr = ROBO_PHY_ADDR;
}
@@
-332,7
+339,7
@@
static int robo_probe(char *devname)
(mdio_read(robo.phy_addr, 0x3) << 16);
if (phyid == 0xffffffff || phyid == 0x55210022) {
(mdio_read(robo.phy_addr, 0x3) << 16);
if (phyid == 0xffffffff || phyid == 0x55210022) {
- printk("No Robo switch in managed mode found
\n"
);
+ printk("No Robo switch in managed mode found
, phy_id = 0x%08x\n", phyid
);
return 1;
}
return 1;
}
This page took
0.023277 seconds
and
4
git commands to generate.