aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers/net
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-07 16:32:34 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-07 16:32:34 +0000
commit5a83b3a5c7a14a1ae52c4958698676b0f7c75f31 (patch)
tree91373af9be0b20b959c9f195f6969720c3f2640d /target/linux/ar71xx/files/drivers/net
parent759c341e68f1107b5aebac7373f2c4be8905677d (diff)
downloadupstream-5a83b3a5c7a14a1ae52c4958698676b0f7c75f31.tar.gz
upstream-5a83b3a5c7a14a1ae52c4958698676b0f7c75f31.tar.bz2
upstream-5a83b3a5c7a14a1ae52c4958698676b0f7c75f31.zip
ar71xx: ag71xx: use the generic get_port_link implementation
SVN-Revision: 30840
Diffstat (limited to 'target/linux/ar71xx/files/drivers/net')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
index 0fc4ba708f..4866aac7ea 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
@@ -801,64 +801,6 @@ ar7240_get_vlan(struct switch_dev *dev, const struct switch_attr *attr,
return 0;
}
-static const char *
-ar7240_speed_str(u32 status)
-{
- u32 speed;
-
- speed = (status >> AR7240_PORT_STATUS_SPEED_S) &
- AR7240_PORT_STATUS_SPEED_M;
- switch (speed) {
- case AR7240_PORT_STATUS_SPEED_10:
- return "10baseT";
- case AR7240_PORT_STATUS_SPEED_100:
- return "100baseT";
- case AR7240_PORT_STATUS_SPEED_1000:
- return "1000baseT";
- }
-
- return "unknown";
-}
-
-static int
-ar7240_port_get_link(struct switch_dev *dev, const struct switch_attr *attr,
- struct switch_val *val)
-{
- struct ar7240sw *as = sw_to_ar7240(dev);
- struct mii_bus *mii = as->mii_bus;
- u32 len;
- u32 status;
- int port;
-
- port = val->port_vlan;
-
- memset(as->buf, '\0', sizeof(as->buf));
- status = ar7240sw_reg_read(mii, AR7240_REG_PORT_STATUS(port));
-
- if (status & AR7240_PORT_STATUS_LINK_UP) {
- len = snprintf(as->buf, sizeof(as->buf),
- "port:%d link:up speed:%s %s-duplex %s%s%s",
- port,
- ar7240_speed_str(status),
- (status & AR7240_PORT_STATUS_DUPLEX) ?
- "full" : "half",
- (status & AR7240_PORT_STATUS_TXFLOW) ?
- "txflow ": "",
- (status & AR7240_PORT_STATUS_RXFLOW) ?
- "rxflow " : "",
- (status & AR7240_PORT_STATUS_LINK_AUTO) ?
- "auto ": "");
- } else {
- len = snprintf(as->buf, sizeof(as->buf),
- "port:%d link:down", port);
- }
-
- val->value.s = as->buf;
- val->len = len;
-
- return 0;
-}
-
static void
ar7240_vtu_op(struct ar7240sw *as, u32 op, u32 val)
{
@@ -998,14 +940,6 @@ static struct switch_attr ar7240_globals[] = {
};
static struct switch_attr ar7240_port[] = {
- {
- .type = SWITCH_TYPE_STRING,
- .name = "link",
- .description = "Get port link information",
- .max = 1,
- .set = NULL,
- .get = ar7240_port_get_link,
- },
};
static struct switch_attr ar7240_vlan[] = {