static int gelic_net_nway_reset(struct net_device *netdev) { if (netif_running(netdev)) { gelic_net_stop(netdev); gelic_net_open(netdev); } return 0; }
/** * gelic_net_tx_timeout_task - task scheduled by the watchdog timeout * function (to be called not under interrupt status) * @work: work is context of tx timout task * * called as task when tx hangs, resets interface (if interface is up) */ static void gelic_net_tx_timeout_task(struct work_struct *work) { struct gelic_card *card = container_of(work, struct gelic_card, tx_timeout_task); struct net_device *netdev = card->netdev[GELIC_PORT_ETHERNET]; dev_info(ctodev(card), "%s:Timed out. Restarting... \n", __func__); if (!(netdev->flags & IFF_UP)) goto out; netif_device_detach(netdev); gelic_net_stop(netdev); gelic_net_open(netdev); netif_device_attach(netdev); out: atomic_dec(&card->tx_timeout_task_counter); }