aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ucc_geth.c37
-rw-r--r--drivers/net/ucc_geth.h1
2 files changed, 30 insertions, 8 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index fa25dc1fcdf1..6ebefe951b95 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3355,13 +3355,17 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
3355 return 0; 3355 return 0;
3356} 3356}
3357 3357
3358/* ucc_geth_timeout gets called when a packet has not been 3358static int ucc_geth_close(struct net_device *dev);
3359 * transmitted after a set amount of time. 3359static int ucc_geth_open(struct net_device *dev);
3360 * For now, assume that clearing out all the structures, and 3360
3361 * starting over will fix the problem. */ 3361/* Reopen device. This will reset the MAC and PHY. */
3362static void ucc_geth_timeout(struct net_device *dev) 3362static void ucc_geth_timeout_work(struct work_struct *work)
3363{ 3363{
3364 struct ucc_geth_private *ugeth = netdev_priv(dev); 3364 struct ucc_geth_private *ugeth;
3365 struct net_device *dev;
3366
3367 ugeth = container_of(work, struct ucc_geth_private, timeout_work);
3368 dev = ugeth->dev;
3365 3369
3366 ugeth_vdbg("%s: IN", __func__); 3370 ugeth_vdbg("%s: IN", __func__);
3367 3371
@@ -3370,13 +3374,29 @@ static void ucc_geth_timeout(struct net_device *dev)
3370 ugeth_dump_regs(ugeth); 3374 ugeth_dump_regs(ugeth);
3371 3375
3372 if (dev->flags & IFF_UP) { 3376 if (dev->flags & IFF_UP) {
3373 ucc_geth_stop(ugeth); 3377 /*
3374 ucc_geth_startup(ugeth); 3378 * Must reset MAC *and* PHY. This is done by reopening
3379 * the device.
3380 */
3381 ucc_geth_close(dev);
3382 ucc_geth_open(dev);
3375 } 3383 }
3376 3384
3377 netif_tx_schedule_all(dev); 3385 netif_tx_schedule_all(dev);
3378} 3386}
3379 3387
3388/*
3389 * ucc_geth_timeout gets called when a packet has not been
3390 * transmitted after a set amount of time.
3391 */
3392static void ucc_geth_timeout(struct net_device *dev)
3393{
3394 struct ucc_geth_private *ugeth = netdev_priv(dev);
3395
3396 netif_carrier_off(dev);
3397 schedule_work(&ugeth->timeout_work);
3398}
3399
3380/* This is called by the kernel when a frame is ready for transmission. */ 3400/* This is called by the kernel when a frame is ready for transmission. */
3381/* It is pointed to by the dev->hard_start_xmit function pointer */ 3401/* It is pointed to by the dev->hard_start_xmit function pointer */
3382static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) 3402static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -4027,6 +4047,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
4027 dev->hard_start_xmit = ucc_geth_start_xmit; 4047 dev->hard_start_xmit = ucc_geth_start_xmit;
4028 dev->tx_timeout = ucc_geth_timeout; 4048 dev->tx_timeout = ucc_geth_timeout;
4029 dev->watchdog_timeo = TX_TIMEOUT; 4049 dev->watchdog_timeo = TX_TIMEOUT;
4050 INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
4030 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT); 4051 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
4031#ifdef CONFIG_NET_POLL_CONTROLLER 4052#ifdef CONFIG_NET_POLL_CONTROLLER
4032 dev->poll_controller = ucc_netpoll; 4053 dev->poll_controller = ucc_netpoll;
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index abc0e2242634..d74d2f7cb739 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -1186,6 +1186,7 @@ struct ucc_geth_private {
1186 struct ucc_fast_private *uccf; 1186 struct ucc_fast_private *uccf;
1187 struct net_device *dev; 1187 struct net_device *dev;
1188 struct napi_struct napi; 1188 struct napi_struct napi;
1189 struct work_struct timeout_work;
1189 struct ucc_geth __iomem *ug_regs; 1190 struct ucc_geth __iomem *ug_regs;
1190 struct ucc_geth_init_pram *p_init_enet_param_shadow; 1191 struct ucc_geth_init_pram *p_init_enet_param_shadow;
1191 struct ucc_geth_exf_global_pram __iomem *p_exf_glbl_param; 1192 struct ucc_geth_exf_global_pram __iomem *p_exf_glbl_param;