From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 4/9] net: designware: Export the operation functions
Date: Sun, 27 Nov 2016 10:01:44 -0700 [thread overview]
Message-ID: <1480266109-7209-5-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1480266109-7209-1-git-send-email-sjg@chromium.org>
Export all functions so that drivers can use them, or not, as the need
arises.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- Add new patch to export the operation functions
Changes in v2: None
drivers/net/designware.c | 19 +++++++++----------
drivers/net/designware.h | 9 +++++++++
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 0c596a7..f242fc6 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -271,7 +271,7 @@ static void _dw_eth_halt(struct dw_eth_dev *priv)
phy_shutdown(priv->phydev);
}
-static int _dw_eth_init(struct dw_eth_dev *priv, u8 *enetaddr)
+int designware_eth_init(struct dw_eth_dev *priv, u8 *enetaddr)
{
struct eth_mac_regs *mac_p = priv->mac_regs_p;
struct eth_dma_regs *dma_p = priv->dma_regs_p;
@@ -330,7 +330,7 @@ static int _dw_eth_init(struct dw_eth_dev *priv, u8 *enetaddr)
return 0;
}
-static int designware_eth_enable(struct dw_eth_dev *priv)
+int designware_eth_enable(struct dw_eth_dev *priv)
{
struct eth_mac_regs *mac_p = priv->mac_regs_p;
@@ -493,7 +493,7 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
{
int ret;
- ret = _dw_eth_init(dev->priv, dev->enetaddr);
+ ret = designware_eth_init(dev->priv, dev->enetaddr);
if (!ret)
ret = designware_eth_enable(dev->priv);
@@ -591,7 +591,7 @@ static int designware_eth_start(struct udevice *dev)
struct dw_eth_dev *priv = dev_get_priv(dev);
int ret;
- ret = _dw_eth_init(priv, pdata->enetaddr);
+ ret = designware_eth_init(priv, pdata->enetaddr);
if (ret)
return ret;
ret = designware_eth_enable(priv);
@@ -601,36 +601,35 @@ static int designware_eth_start(struct udevice *dev)
return 0;
}
-static int designware_eth_send(struct udevice *dev, void *packet, int length)
+int designware_eth_send(struct udevice *dev, void *packet, int length)
{
struct dw_eth_dev *priv = dev_get_priv(dev);
return _dw_eth_send(priv, packet, length);
}
-static int designware_eth_recv(struct udevice *dev, int flags, uchar **packetp)
+int designware_eth_recv(struct udevice *dev, int flags, uchar **packetp)
{
struct dw_eth_dev *priv = dev_get_priv(dev);
return _dw_eth_recv(priv, packetp);
}
-static int designware_eth_free_pkt(struct udevice *dev, uchar *packet,
- int length)
+int designware_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
{
struct dw_eth_dev *priv = dev_get_priv(dev);
return _dw_free_pkt(priv);
}
-static void designware_eth_stop(struct udevice *dev)
+void designware_eth_stop(struct udevice *dev)
{
struct dw_eth_dev *priv = dev_get_priv(dev);
return _dw_eth_halt(priv);
}
-static int designware_eth_write_hwaddr(struct udevice *dev)
+int designware_eth_write_hwaddr(struct udevice *dev)
{
struct eth_pdata *pdata = dev_get_platdata(dev);
struct dw_eth_dev *priv = dev_get_priv(dev);
diff --git a/drivers/net/designware.h b/drivers/net/designware.h
index 087ebef..7992d0e 100644
--- a/drivers/net/designware.h
+++ b/drivers/net/designware.h
@@ -253,6 +253,15 @@ struct dw_eth_pdata {
struct eth_pdata eth_pdata;
u32 reset_delays[3];
};
+
+int designware_eth_init(struct dw_eth_dev *priv, u8 *enetaddr);
+int designware_eth_enable(struct dw_eth_dev *priv);
+int designware_eth_send(struct udevice *dev, void *packet, int length);
+int designware_eth_recv(struct udevice *dev, int flags, uchar **packetp);
+int designware_eth_free_pkt(struct udevice *dev, uchar *packet,
+ int length);
+void designware_eth_stop(struct udevice *dev);
+int designware_eth_write_hwaddr(struct udevice *dev);
#endif
#endif
--
2.8.0.rc3.226.g39d4020
next prev parent reply other threads:[~2016-11-27 17:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-27 17:01 [U-Boot] [PATCH v3 0/9] From Simon: Simon Glass
2016-11-27 17:01 ` [U-Boot] [PATCH v3 1/9] net: designware: Export various functions/struct to allow subclassing Simon Glass
2016-11-29 22:28 ` Joe Hershberger
2016-11-27 17:01 ` [U-Boot] [PATCH v3 2/9] net: designware: Adjust dw_adjust_link() to return an error Simon Glass
2016-11-29 22:10 ` Joe Hershberger
2016-11-27 17:01 ` [U-Boot] [PATCH v3 3/9] net: designware: Split the link init into a separate function Simon Glass
2016-11-29 22:28 ` Joe Hershberger
2016-11-27 17:01 ` Simon Glass [this message]
2016-11-29 22:31 ` [U-Boot] [PATCH v3 4/9] net: designware: Export the operation functions Joe Hershberger
2016-11-27 17:01 ` [U-Boot] [PATCH v3 5/9] net: gmac_rk3288: Add RK3288 GMAC driver Simon Glass
2016-11-29 22:34 ` Joe Hershberger
2016-11-27 17:01 ` [U-Boot] [PATCH v3 6/9] rockchip: Enable networking support on rock2 and firefly Simon Glass
2016-11-27 17:01 ` [U-Boot] [PATCH v3 7/9] rockchip: evb-rk3339: Enable DHCP Simon Glass
2016-11-29 10:22 ` Heiko Stübner
2016-11-27 17:01 ` [U-Boot] [PATCH v3 8/9] rockchip: Add PXE and DHCP to the default boot targets Simon Glass
2016-11-27 17:01 ` [U-Boot] [PATCH v3 9/9] rockchip: Drop Ethernet from the TODO Simon Glass
2016-11-29 23:45 ` [U-Boot] [PATCH v3 0/9] From Simon: Heiko Stübner
2016-11-30 2:47 ` Simon Glass
2016-11-30 11:52 ` Heiko Stübner
2016-11-30 19:50 ` Heiko Stübner
2016-12-01 2:20 ` Simon Glass
2016-12-01 15:30 ` Heiko Stübner
2016-12-26 5:23 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480266109-7209-5-git-send-email-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.