Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122928
b: refs/heads/master
c: fdb614c
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and David S. Miller committed Dec 26, 2008
1 parent 2a44151 commit 2922599
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 43 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c54004ea717116a10886e254e26502ffb1136e9
refs/heads/master: fdb614c28487df41f7bf2c98e85f29f31885561e
81 changes: 39 additions & 42 deletions trunk/drivers/net/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3072,48 +3072,6 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
return 0;
}

static int ucc_geth_close(struct net_device *dev);
static int ucc_geth_open(struct net_device *dev);

/* Reopen device. This will reset the MAC and PHY. */
static void ucc_geth_timeout_work(struct work_struct *work)
{
struct ucc_geth_private *ugeth;
struct net_device *dev;

ugeth = container_of(work, struct ucc_geth_private, timeout_work);
dev = ugeth->dev;

ugeth_vdbg("%s: IN", __func__);

dev->stats.tx_errors++;

ugeth_dump_regs(ugeth);

if (dev->flags & IFF_UP) {
/*
* Must reset MAC *and* PHY. This is done by reopening
* the device.
*/
ucc_geth_close(dev);
ucc_geth_open(dev);
}

netif_tx_schedule_all(dev);
}

/*
* ucc_geth_timeout gets called when a packet has not been
* transmitted after a set amount of time.
*/
static void ucc_geth_timeout(struct net_device *dev)
{
struct ucc_geth_private *ugeth = netdev_priv(dev);

netif_carrier_off(dev);
schedule_work(&ugeth->timeout_work);
}

/* This is called by the kernel when a frame is ready for transmission. */
/* It is pointed to by the dev->hard_start_xmit function pointer */
static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
Expand Down Expand Up @@ -3524,6 +3482,45 @@ static int ucc_geth_close(struct net_device *dev)
return 0;
}

/* Reopen device. This will reset the MAC and PHY. */
static void ucc_geth_timeout_work(struct work_struct *work)
{
struct ucc_geth_private *ugeth;
struct net_device *dev;

ugeth = container_of(work, struct ucc_geth_private, timeout_work);
dev = ugeth->dev;

ugeth_vdbg("%s: IN", __func__);

dev->stats.tx_errors++;

ugeth_dump_regs(ugeth);

if (dev->flags & IFF_UP) {
/*
* Must reset MAC *and* PHY. This is done by reopening
* the device.
*/
ucc_geth_close(dev);
ucc_geth_open(dev);
}

netif_tx_schedule_all(dev);
}

/*
* ucc_geth_timeout gets called when a packet has not been
* transmitted after a set amount of time.
*/
static void ucc_geth_timeout(struct net_device *dev)
{
struct ucc_geth_private *ugeth = netdev_priv(dev);

netif_carrier_off(dev);
schedule_work(&ugeth->timeout_work);
}

static phy_interface_t to_phy_interface(const char *phy_connection_type)
{
if (strcasecmp(phy_connection_type, "mii") == 0)
Expand Down

0 comments on commit 2922599

Please sign in to comment.