* [U-Boot] [PATCH] net: ethoc: add write_hwaddr support
@ 2010-04-27 4:09 Thomas Chou
2010-04-27 12:20 ` [U-Boot] [PATCH v2] " Thomas Chou
2010-04-27 17:03 ` [U-Boot] [PATCH] " Ben Warren
0 siblings, 2 replies; 4+ messages in thread
From: Thomas Chou @ 2010-04-27 4:09 UTC (permalink / raw)
To: u-boot
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
drivers/net/ethoc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index b912e44..286fbe7 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -215,13 +215,14 @@ static inline void ethoc_write_bd(struct eth_device *dev, int index,
ethoc_write(dev, offset + 4, bd->addr);
}
-static inline void ethoc_set_mac_address(struct eth_device *dev)
+static int ethoc_set_mac_address(struct eth_device *dev)
{
u8 *mac = dev->enetaddr;
ethoc_write(dev, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
(mac[4] << 8) | (mac[5] << 0));
ethoc_write(dev, MAC_ADDR1, (mac[0] << 8) | (mac[1] << 0));
+ return 0;
}
static inline void ethoc_ack_irq(struct eth_device *dev, u32 mask)
@@ -504,6 +505,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
dev->halt = ethoc_halt;
dev->send = ethoc_send;
dev->recv = ethoc_recv;
+ dev->write_hwaddr = ethoc_set_mac_address;
sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
eth_register(dev);
--
1.6.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] net: ethoc: add write_hwaddr support
2010-04-27 4:09 [U-Boot] [PATCH] net: ethoc: add write_hwaddr support Thomas Chou
@ 2010-04-27 12:20 ` Thomas Chou
2010-04-27 17:10 ` Ben Warren
2010-04-27 17:03 ` [U-Boot] [PATCH] " Ben Warren
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Chou @ 2010-04-27 12:20 UTC (permalink / raw)
To: u-boot
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
v2 remove set mac address from init.
drivers/net/ethoc.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index b912e44..34cc47f 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -215,13 +215,14 @@ static inline void ethoc_write_bd(struct eth_device *dev, int index,
ethoc_write(dev, offset + 4, bd->addr);
}
-static inline void ethoc_set_mac_address(struct eth_device *dev)
+static int ethoc_set_mac_address(struct eth_device *dev)
{
u8 *mac = dev->enetaddr;
ethoc_write(dev, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
(mac[4] << 8) | (mac[5] << 0));
ethoc_write(dev, MAC_ADDR1, (mac[0] << 8) | (mac[1] << 0));
+ return 0;
}
static inline void ethoc_ack_irq(struct eth_device *dev, u32 mask)
@@ -308,8 +309,6 @@ static int ethoc_init(struct eth_device *dev, bd_t * bd)
struct ethoc *priv = (struct ethoc *)dev->priv;
printf("ethoc\n");
- ethoc_set_mac_address(dev);
-
priv->num_tx = 1;
priv->num_rx = PKTBUFSRX;
ethoc_write(dev, TX_BD_NUM, priv->num_tx);
@@ -504,6 +503,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
dev->halt = ethoc_halt;
dev->send = ethoc_send;
dev->recv = ethoc_recv;
+ dev->write_hwaddr = ethoc_set_mac_address;
sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
eth_register(dev);
--
1.6.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] net: ethoc: add write_hwaddr support
2010-04-27 4:09 [U-Boot] [PATCH] net: ethoc: add write_hwaddr support Thomas Chou
2010-04-27 12:20 ` [U-Boot] [PATCH v2] " Thomas Chou
@ 2010-04-27 17:03 ` Ben Warren
1 sibling, 0 replies; 4+ messages in thread
From: Ben Warren @ 2010-04-27 17:03 UTC (permalink / raw)
To: u-boot
Hi Thomas,
On 4/26/2010 9:09 PM, Thomas Chou wrote:
> Signed-off-by: Thomas Chou<thomas@wytron.com.tw>
> ---
> drivers/net/ethoc.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
> index b912e44..286fbe7 100644
> --- a/drivers/net/ethoc.c
> +++ b/drivers/net/ethoc.c
> @@ -215,13 +215,14 @@ static inline void ethoc_write_bd(struct eth_device *dev, int index,
> ethoc_write(dev, offset + 4, bd->addr);
> }
>
> -static inline void ethoc_set_mac_address(struct eth_device *dev)
> +static int ethoc_set_mac_address(struct eth_device *dev)
> {
> u8 *mac = dev->enetaddr;
>
> ethoc_write(dev, MAC_ADDR0, (mac[2]<< 24) | (mac[3]<< 16) |
> (mac[4]<< 8) | (mac[5]<< 0));
> ethoc_write(dev, MAC_ADDR1, (mac[0]<< 8) | (mac[1]<< 0));
> + return 0;
> }
>
> static inline void ethoc_ack_irq(struct eth_device *dev, u32 mask)
> @@ -504,6 +505,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
> dev->halt = ethoc_halt;
> dev->send = ethoc_send;
> dev->recv = ethoc_recv;
> + dev->write_hwaddr = ethoc_set_mac_address;
> sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
>
> eth_register(dev);
>
Applied to net repo.
thanks,
Ben
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] net: ethoc: add write_hwaddr support
2010-04-27 12:20 ` [U-Boot] [PATCH v2] " Thomas Chou
@ 2010-04-27 17:10 ` Ben Warren
0 siblings, 0 replies; 4+ messages in thread
From: Ben Warren @ 2010-04-27 17:10 UTC (permalink / raw)
To: u-boot
Thomas,
On 4/27/2010 5:20 AM, Thomas Chou wrote:
> Signed-off-by: Thomas Chou<thomas@wytron.com.tw>
> ---
> v2 remove set mac address from init.
>
> drivers/net/ethoc.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
Applied to net repo. Please ignore similar message about V1, V2 is the
one that was applied.
regards,
Ben
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-27 17:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 4:09 [U-Boot] [PATCH] net: ethoc: add write_hwaddr support Thomas Chou
2010-04-27 12:20 ` [U-Boot] [PATCH v2] " Thomas Chou
2010-04-27 17:10 ` Ben Warren
2010-04-27 17:03 ` [U-Boot] [PATCH] " Ben Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox