Commit 3d90c508 authored by Giuseppe CAVALLARO's avatar Giuseppe CAVALLARO Committed by David S. Miller

stmmac: get the descriptor structure from platform

Output for chip that uses the Enhanced descriptors:
[snip]
STMMAC driver:
	platform registration... done!
	DWMAC1000 - user ID: 0x10, Synopsys ID: 0x33
	Enhanced descriptor structure
	no valid MAC address;please, use ifconfig or nwhwconfig!
	eth0 - (dev. name: stmmaceth - id: 0, IRQ #134
	IO base addr: 0xfd110000)
STMMAC MII Bus: probed
[snip]
Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e326e850
...@@ -93,6 +93,7 @@ struct stmmac_priv { ...@@ -93,6 +93,7 @@ struct stmmac_priv {
#ifdef STMMAC_VLAN_TAG_USED #ifdef STMMAC_VLAN_TAG_USED
struct vlan_group *vlgrp; struct vlan_group *vlgrp;
#endif #endif
int enh_desc;
}; };
#ifdef CONFIG_STM_DRIVERS #ifdef CONFIG_STM_DRIVERS
......
...@@ -1581,13 +1581,16 @@ static int stmmac_mac_device_setup(struct net_device *dev) ...@@ -1581,13 +1581,16 @@ static int stmmac_mac_device_setup(struct net_device *dev)
struct mac_device_info *device; struct mac_device_info *device;
if (priv->is_gmac) { if (priv->is_gmac)
device = dwmac1000_setup(ioaddr); device = dwmac1000_setup(ioaddr);
device->desc = &enh_desc_ops; else
} else {
device = dwmac100_setup(ioaddr); device = dwmac100_setup(ioaddr);
if (priv->enh_desc) {
device->desc = &enh_desc_ops;
pr_info("\tEnhanced descriptor structure\n");
} else
device->desc = &ndesc_ops; device->desc = &ndesc_ops;
}
if (!device) if (!device)
return -ENOMEM; return -ENOMEM;
...@@ -1729,6 +1732,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev) ...@@ -1729,6 +1732,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
priv->bus_id = plat_dat->bus_id; priv->bus_id = plat_dat->bus_id;
priv->pbl = plat_dat->pbl; /* TLI */ priv->pbl = plat_dat->pbl; /* TLI */
priv->is_gmac = plat_dat->has_gmac; /* GMAC is on board */ priv->is_gmac = plat_dat->has_gmac; /* GMAC is on board */
priv->enh_desc = plat_dat->enh_desc;
platform_set_drvdata(pdev, ndev); platform_set_drvdata(pdev, ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment