/* * Open and Initialize the interface * * Set up everything, reset the card, etc.. */ static int bfin_mac_open(struct net_device *dev) { struct bfin_mac_local *lp = netdev_priv(dev); int retval; pr_debug("%s: %s\n", dev->name, __func__); /* * Check that the address is valid. If its not, refuse * to bring the device up. The user must specify an * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx */ if (!is_valid_ether_addr(dev->dev_addr)) { printk(KERN_WARNING DRV_NAME ": no valid ethernet hw addr\n"); return -EINVAL; } /* initial rx and tx list */ retval = desc_list_init(); if (retval) return retval; phy_start(lp->phydev); phy_write(lp->phydev, MII_BMCR, BMCR_RESET); setup_system_regs(dev); setup_mac_addr(dev->dev_addr); bfin_mac_disable(); bfin_mac_enable(); pr_debug("hardware init finished\n"); netif_start_queue(dev); netif_carrier_on(dev); return 0; }
static int bfin_mac_open(struct net_device *dev) { struct bfin_mac_local *lp = netdev_priv(dev); int retval; pr_debug("%s: %s\n", dev->name, __func__); if (!is_valid_ether_addr(dev->dev_addr)) { printk(KERN_WARNING DRV_NAME ": no valid ethernet hw addr\n"); return -EINVAL; } retval = desc_list_init(); if (retval) return retval; phy_start(lp->phydev); phy_write(lp->phydev, MII_BMCR, BMCR_RESET); setup_system_regs(dev); setup_mac_addr(dev->dev_addr); bfin_mac_disable(); bfin_mac_enable(); pr_debug("hardware init finished\n"); netif_start_queue(dev); netif_carrier_on(dev); return 0; }
/* Our watchdog timed out. Called by the networking layer */ static void bfin_mac_timeout(struct net_device *dev) { pr_debug("%s: %s\n", dev->name, __func__); bfin_mac_disable(); /* reset tx queue */ tx_list_tail = tx_list_head->next; bfin_mac_enable(); /* We can accept TX packets again */ dev->trans_start = jiffies; netif_wake_queue(dev); }
static void bfin_mac_timeout(struct net_device *dev) { pr_debug("%s: %s\n", dev->name, __func__); bfin_mac_disable(); tx_list_tail = tx_list_head->next; bfin_mac_enable(); dev->trans_start = jiffies; netif_wake_queue(dev); }