Esempio n. 1
0
static int __init
ramips_eth_probe(struct net_device *dev)
{
    struct raeth_priv *priv = netdev_priv(dev);
    int err;

    BUG_ON(!priv->plat->reset_fe);
    priv->plat->reset_fe();
    net_srandom(jiffies);
    memcpy(dev->dev_addr, priv->plat->mac, ETH_ALEN);

    ether_setup(dev);
    dev->mtu = 1500;
    dev->watchdog_timeo = TX_TIMEOUT;
    spin_lock_init(&priv->page_lock);
    spin_lock_init(&priv->phy_lock);

    err = ramips_mdio_init(priv);
    if (err)
        return err;

    err = ramips_phy_connect(priv);
    if (err)
        goto err_mdio_cleanup;

    return 0;

err_mdio_cleanup:
    ramips_mdio_cleanup(priv);
    return err;
}
Esempio n. 2
0
static void
ramips_eth_uninit(struct net_device *dev)
{
    struct raeth_priv *re = netdev_priv(dev);

    ramips_phy_disconnect(re);
    ramips_mdio_cleanup(re);
}
Esempio n. 3
0
static void
ramips_eth_uninit(struct net_device *dev)
{
	struct raeth_priv *re = netdev_priv(dev);

	raeth_debugfs_exit(re);
	ramips_phy_disconnect(re);
	ramips_mdio_cleanup(re);
	ramips_fe_twr(0, RAETH_REG_FE_INT_ENABLE);
	free_irq(dev->irq, dev);
	tasklet_kill(&re->tx_housekeeping_tasklet);
	tasklet_kill(&re->rx_tasklet);
	ramips_ring_cleanup(re);
	ramips_ring_free(re);
}