/* stmmac_mac_device_setup @dev : device pointer Description: select and initialise the mac device (mac100 or Gmac).  */
static int stmmac_mac_device_setup(struct net_device *dev)
/* stmmac_mac_device_setup @dev : device pointer Description: select and initialise the mac device (mac100 or Gmac).  */
static int stmmac_mac_device_setup(struct net_device *dev)
{
	struct stmmac_priv *priv = netdev_priv(dev);
	unsigned long ioaddr = dev->base_addr;
	struct mac_device_info *device;
	if (priv->is_gmac)
		device = gmac_setup(ioaddr);
	else
		device = mac100_setup(ioaddr);
	if (!device)
		return -ENOMEM;
	priv->mac_type = device;
	priv->wolenabled = priv->mac_type->hw.pmt;
	if (priv->wolenabled == PMT_SUPPORTED)
		priv->wolopts = WAKE_MAGIC;
	return 0;
}