diff options
author | Simon Glass | 2017-01-11 11:46:10 +0100 |
---|---|---|
committer | Simon Glass | 2017-01-11 20:23:50 -0700 |
commit | e72ced234045f817df48cec71b4795b00e87afe3 (patch) | |
tree | c7f22ca280c49566816b909f6229c78c629358d4 /drivers | |
parent | f63f28ee2520263f5c78f64f1d404b2c329ffe87 (diff) |
net: designware: Export the operation functions
Export all functions so that drivers can use them, or not, as the need
arises.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Romain Perier <romain.perier@collabora.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/designware.c | 19 | ||||
-rw-r--r-- | 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 0c596a7aea3..f242fc6b3fa 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 087ebef2971..7992d0ebeeb 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 |