summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorMadalin Bucur <madalin.bucur@freescale.com>2014-01-09 17:15:13 (GMT)
committerMadalin-Cristian Bucur <madalin.bucur@freescale.com>2014-01-13 09:45:54 (GMT)
commitea6c457d45f0cc23edb91c33c1640aa30b62ab3f (patch)
tree5acb5c374e94286b3601fdfecb5a447f43e163f2 /drivers/net/ethernet/freescale
parenta03c54962123bb798959ecb508730583a6e82101 (diff)
downloadlinux-fsl-qoriq-ea6c457d45f0cc23edb91c33c1640aa30b62ab3f.tar.xz
dpaa_eth: simplify adjust_link()
Remove awareness of macless + proxy scenario from adjust_link(). Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com> Change-Id: Ie6e033480436634f12a504d5c3dd4d4ebed8851a Reviewed-on: http://git.am.freescale.net:8181/7792 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Marian Cristian Rotariu <marian.rotariu@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/7816 Reviewed-by: Cristian-Constantin Sovaiala <Cristian.Sovaiala@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com> (cherry picked from commit 26b6123a5ad1c3da918b51d55453bf5bf0de0741) Reviewed-on: http://git.am.freescale.net:8181/7826
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c1
-rw-r--r--drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c5
-rw-r--r--drivers/net/ethernet/freescale/dpa/mac-api.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c
index def86e2..2cc23d5 100644
--- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c
+++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c
@@ -359,6 +359,7 @@ static int dpaa_eth_macless_probe(struct platform_device *_of_dev)
priv->msg_enable = netif_msg_init(debug, -1);
/* control over proxy's mac device */
priv->peer = (void *)proxy_dev;
+ priv->mac_dev = proxy_dev->mac_dev;
INIT_LIST_HEAD(&priv->dpa_fq_list);
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c
index ebb27ad..c0c618e 100644
--- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c
+++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c
@@ -502,7 +502,8 @@ int __hot dpa_shared_tx(struct sk_buff *skb, struct net_device *net_dev)
dpa_bp_vaddr + dpa_fd_offset(&fd),
dpa_fd_length(&fd));
- if (!priv->mac_dev)
+ /* if no mac device or peer set it's macless */
+ if (!priv->mac_dev || priv->peer)
fd.cmd |= FM_FD_CMD_DTC;
else {
/* Enable L3/L4 hardware checksum computation,
@@ -521,7 +522,7 @@ int __hot dpa_shared_tx(struct sk_buff *skb, struct net_device *net_dev)
}
} else {
- if (!priv->mac_dev)
+ if (!priv->mac_dev || priv->peer)
fd.cmd |= FM_FD_CMD_DTC;
else {
/* Enable L3/L4 hardware checksum computation,
diff --git a/drivers/net/ethernet/freescale/dpa/mac-api.c b/drivers/net/ethernet/freescale/dpa/mac-api.c
index 98dd243..ab16134 100644
--- a/drivers/net/ethernet/freescale/dpa/mac-api.c
+++ b/drivers/net/ethernet/freescale/dpa/mac-api.c
@@ -333,9 +333,7 @@ static int __cold set_multi(struct net_device *net_dev,
static void adjust_link(struct net_device *net_dev)
{
struct dpa_priv_s *priv = netdev_priv(net_dev);
- struct proxy_device *proxy_dev = (struct proxy_device *)priv->peer;
- struct mac_device *mac_dev = proxy_dev ? proxy_dev->mac_dev :
- priv->mac_dev;
+ struct mac_device *mac_dev = priv->mac_dev;
struct phy_device *phy_dev = mac_dev->phy_dev;
fm_mac_adjust_link(mac_dev->get_mac_handle(mac_dev),