summaryrefslogtreecommitdiff
path: root/drivers/net/sh_eth.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2018-01-21 16:27:51 +0300
committerMarek Vasut <marex@denx.de>2018-01-27 22:38:53 +0300
commitdca221bd92cf3befa387a711a2256f1e4e06e51e (patch)
treed60ab725186bd617d7ffbd04fd489bde7e9c0911 /drivers/net/sh_eth.c
parenteffb79027e9a178c14e80f48c907332048d0fb3d (diff)
downloadu-boot-dca221bd92cf3befa387a711a2256f1e4e06e51e.tar.xz
net: sh_eth: Pass sh_eth_dev around
Pass sh_eth_dev structure around instead of eth_device, since the later is specific to the legacy networking support. This change is done in preparation for the DM addition. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/sh_eth.c')
-rw-r--r--drivers/net/sh_eth.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index d065141bf9..7b11a5a0d3 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -54,9 +54,8 @@
#define TIMEOUT_CNT 1000
-int sh_eth_send(struct eth_device *dev, void *packet, int len)
+static int sh_eth_send_common(struct sh_eth_dev *eth, void *packet, int len)
{
- struct sh_eth_dev *eth = dev->priv;
int port = eth->port, ret = 0, timeout;
struct sh_eth_info *port_info = &eth->port_info[port];
@@ -112,9 +111,15 @@ err:
return ret;
}
-int sh_eth_recv(struct eth_device *dev)
+static int sh_eth_send_legacy(struct eth_device *dev, void *packet, int len)
{
struct sh_eth_dev *eth = dev->priv;
+
+ return sh_eth_send_common(eth, packet, len);
+}
+
+static int sh_eth_recv_common(struct sh_eth_dev *eth)
+{
int port = eth->port, len = 0;
struct sh_eth_info *port_info = &eth->port_info[port];
uchar *packet;
@@ -154,6 +159,13 @@ int sh_eth_recv(struct eth_device *dev)
return len;
}
+static int sh_eth_recv_legacy(struct eth_device *dev)
+{
+ struct sh_eth_dev *eth = dev->priv;
+
+ return sh_eth_recv_common(eth);
+}
+
static int sh_eth_reset(struct sh_eth_dev *eth)
{
struct sh_eth_info *port_info = &eth->port_info[eth->port];
@@ -569,8 +581,8 @@ int sh_eth_initialize(bd_t *bd)
dev->iobase = 0;
dev->init = sh_eth_init;
dev->halt = sh_eth_halt;
- dev->send = sh_eth_send;
- dev->recv = sh_eth_recv;
+ dev->send = sh_eth_send_legacy;
+ dev->recv = sh_eth_recv_legacy;
eth->port_info[eth->port].dev = dev;
strcpy(dev->name, SHETHER_NAME);