Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122884
b: refs/heads/master
c: 490b772
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Hałasa committed Dec 21, 2008
1 parent 9a8166a commit 8751d1b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4954936e25cb8ce99a96cac9dd9417d7b639867a
refs/heads/master: 490b77224fe66c77ab7cb48d6b77e62cb55591a0
45 changes: 45 additions & 0 deletions trunk/drivers/net/arm/ixp4xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ struct port {
u32 desc_tab_phys;
int id; /* logical port ID */
int speed, duplex;
u8 firmware[4];
};

/* NPE message structure */
Expand Down Expand Up @@ -795,6 +796,45 @@ static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
return phy_mii_ioctl(port->phydev, if_mii(req), cmd);
}

/* ethtool support */

static void ixp4xx_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct port *port = netdev_priv(dev);
strcpy(info->driver, DRV_NAME);
snprintf(info->fw_version, sizeof(info->fw_version), "%u:%u:%u:%u",
port->firmware[0], port->firmware[1],
port->firmware[2], port->firmware[3]);
strcpy(info->bus_info, "internal");
}

static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct port *port = netdev_priv(dev);
return phy_ethtool_gset(port->phydev, cmd);
}

static int ixp4xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct port *port = netdev_priv(dev);
return phy_ethtool_sset(port->phydev, cmd);
}

static int ixp4xx_nway_reset(struct net_device *dev)
{
struct port *port = netdev_priv(dev);
return phy_start_aneg(port->phydev);
}

static struct ethtool_ops ixp4xx_ethtool_ops = {
.get_drvinfo = ixp4xx_get_drvinfo,
.get_settings = ixp4xx_get_settings,
.set_settings = ixp4xx_set_settings,
.nway_reset = ixp4xx_nway_reset,
.get_link = ethtool_op_get_link,
};


static int request_queues(struct port *port)
{
Expand Down Expand Up @@ -942,6 +982,10 @@ static int eth_open(struct net_device *dev)
npe_name(npe));
return -EIO;
}
port->firmware[0] = msg.byte4;
port->firmware[1] = msg.byte5;
port->firmware[2] = msg.byte6;
port->firmware[3] = msg.byte7;
}

memset(&msg, 0, sizeof(msg));
Expand Down Expand Up @@ -1151,6 +1195,7 @@ static int __devinit eth_init_one(struct platform_device *pdev)
dev->hard_start_xmit = eth_xmit;
dev->stop = eth_close;
dev->do_ioctl = eth_ioctl;
dev->ethtool_ops = &ixp4xx_ethtool_ops;
dev->set_multicast_list = eth_set_mcast_list;
dev->tx_queue_len = 100;

Expand Down

0 comments on commit 8751d1b

Please sign in to comment.