static void c2_tx_timeout(struct net_device *netdev) { struct c2_port *c2_port = netdev_priv(netdev); if (netif_msg_timer(c2_port)) pr_debug("%s: tx timeout\n", netdev->name); c2_tx_clean(c2_port); }
static int c2_down(struct net_device *netdev) { struct c2_port *c2_port = netdev_priv(netdev); struct c2_dev *c2dev = c2_port->c2dev; if (netif_msg_ifdown(c2_port)) pr_debug("%s: disabling interface\n", netdev->name); c2_tx_interrupt(netdev); netif_stop_queue(netdev); writel(1, c2dev->regs + C2_IDIS); writel(0, c2dev->regs + C2_NIMR0); c2_reset(c2_port); c2_tx_clean(c2_port); c2_rx_clean(c2_port); kfree(c2_port->rx_ring.start); kfree(c2_port->tx_ring.start); pci_free_consistent(c2dev->pcidev, c2_port->mem_size, c2_port->mem, c2_port->dma); return 0; }
static int c2_down(struct net_device *netdev) { struct c2_port *c2_port = netdev_priv(netdev); struct c2_dev *c2dev = c2_port->c2dev; if (netif_msg_ifdown(c2_port)) pr_debug("%s: disabling interface\n", netdev->name); /* Wait for all the queued packets to get sent */ c2_tx_interrupt(netdev); /* Disable network packets */ netif_stop_queue(netdev); /* Disable IRQs by clearing the interrupt mask */ writel(1, c2dev->regs + C2_IDIS); writel(0, c2dev->regs + C2_NIMR0); /* missing: Stop transmitter */ /* missing: Stop receiver */ /* Reset the adapter, ensures the driver is in sync with the RXP */ c2_reset(c2_port); /* missing: Turn off LEDs here */ /* Free all buffers in the host descriptor rings */ c2_tx_clean(c2_port); c2_rx_clean(c2_port); /* Free the host descriptor rings */ kfree(c2_port->rx_ring.start); kfree(c2_port->tx_ring.start); pci_free_consistent(c2dev->pcidev, c2_port->mem_size, c2_port->mem, c2_port->dma); return 0; }