aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ucc_geth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r--drivers/net/ucc_geth.c81
1 files changed, 39 insertions, 42 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 78a2ede19c5e..7d5a1303e30d 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3072,48 +3072,6 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
3072 return 0; 3072 return 0;
3073} 3073}
3074 3074
3075static int ucc_geth_close(struct net_device *dev);
3076static int ucc_geth_open(struct net_device *dev);
3077
3078/* Reopen device. This will reset the MAC and PHY. */
3079static void ucc_geth_timeout_work(struct work_struct *work)
3080{
3081 struct ucc_geth_private *ugeth;
3082 struct net_device *dev;
3083
3084 ugeth = container_of(work, struct ucc_geth_private, timeout_work);
3085 dev = ugeth->dev;
3086
3087 ugeth_vdbg("%s: IN", __func__);
3088
3089 dev->stats.tx_errors++;
3090
3091 ugeth_dump_regs(ugeth);
3092
3093 if (dev->flags & IFF_UP) {
3094 /*
3095 * Must reset MAC *and* PHY. This is done by reopening
3096 * the device.
3097 */
3098 ucc_geth_close(dev);
3099 ucc_geth_open(dev);
3100 }
3101
3102 netif_tx_schedule_all(dev);
3103}
3104
3105/*
3106 * ucc_geth_timeout gets called when a packet has not been
3107 * transmitted after a set amount of time.
3108 */
3109static void ucc_geth_timeout(struct net_device *dev)
3110{
3111 struct ucc_geth_private *ugeth = netdev_priv(dev);
3112
3113 netif_carrier_off(dev);
3114 schedule_work(&ugeth->timeout_work);
3115}
3116
3117/* This is called by the kernel when a frame is ready for transmission. */ 3075/* This is called by the kernel when a frame is ready for transmission. */
3118/* It is pointed to by the dev->hard_start_xmit function pointer */ 3076/* It is pointed to by the dev->hard_start_xmit function pointer */
3119static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) 3077static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -3524,6 +3482,45 @@ static int ucc_geth_close(struct net_device *dev)
3524 return 0; 3482 return 0;
3525} 3483}
3526 3484
3485/* Reopen device. This will reset the MAC and PHY. */
3486static void ucc_geth_timeout_work(struct work_struct *work)
3487{
3488 struct ucc_geth_private *ugeth;
3489 struct net_device *dev;
3490
3491 ugeth = container_of(work, struct ucc_geth_private, timeout_work);
3492 dev = ugeth->dev;
3493
3494 ugeth_vdbg("%s: IN", __func__);
3495
3496 dev->stats.tx_errors++;
3497
3498 ugeth_dump_regs(ugeth);
3499
3500 if (dev->flags & IFF_UP) {
3501 /*
3502 * Must reset MAC *and* PHY. This is done by reopening
3503 * the device.
3504 */
3505 ucc_geth_close(dev);
3506 ucc_geth_open(dev);
3507 }
3508
3509 netif_tx_schedule_all(dev);
3510}
3511
3512/*
3513 * ucc_geth_timeout gets called when a packet has not been
3514 * transmitted after a set amount of time.
3515 */
3516static void ucc_geth_timeout(struct net_device *dev)
3517{
3518 struct ucc_geth_private *ugeth = netdev_priv(dev);
3519
3520 netif_carrier_off(dev);
3521 schedule_work(&ugeth->timeout_work);
3522}
3523
3527static phy_interface_t to_phy_interface(const char *phy_connection_type) 3524static phy_interface_t to_phy_interface(const char *phy_connection_type)
3528{ 3525{
3529 if (strcasecmp(phy_connection_type, "mii") == 0) 3526 if (strcasecmp(phy_connection_type, "mii") == 0)