* [U-Boot] [PATCH] smc91111: add write_hwaddr
@ 2010-10-05 7:30 Thomas Chou
2010-10-05 19:42 ` Mike Frysinger
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Chou @ 2010-10-05 7:30 UTC (permalink / raw)
To: u-boot
Add smc_write_hwaddr() to set mac address.
Clear dev before use.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
drivers/net/smc91111.c | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index 54a1bfb..ba9c67e 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -654,6 +654,28 @@ again:
return length;
}
+static int smc_write_hwaddr(struct eth_device *dev)
+{
+ int i;
+
+ swap_to(ETHERNET);
+ SMC_SELECT_BANK (dev, 1);
+#ifdef USE_32_BIT
+ for (i = 0; i < 6; i += 2) {
+ word address;
+
+ address = dev->enetaddr[i + 1] << 8;
+ address |= dev->enetaddr[i];
+ SMC_outw(dev, address, (ADDR0_REG + i));
+ }
+#else
+ for (i = 0; i < 6; i++)
+ SMC_outb(dev, dev->enetaddr[i], (ADDR0_REG + i));
+#endif
+ swap_to(FLASH);
+ return 0;
+}
+
/*
* Open and Initialize the board
*
@@ -662,8 +684,6 @@ again:
*/
static int smc_init(struct eth_device *dev, bd_t *bd)
{
- int i;
-
swap_to(ETHERNET);
PRINTK2 ("%s: smc_init\n", SMC_DEV_NAME);
@@ -680,20 +700,6 @@ static int smc_init(struct eth_device *dev, bd_t *bd)
/* conservative setting (10Mbps, HalfDuplex, no AutoNeg.) */
/* SMC_SELECT_BANK(dev, 0); */
/* SMC_outw(dev, 0, RPC_REG); */
- SMC_SELECT_BANK (dev, 1);
-
-#ifdef USE_32_BIT
- for (i = 0; i < 6; i += 2) {
- word address;
-
- address = dev->enetaddr[i + 1] << 8;
- address |= dev->enetaddr[i];
- SMC_outw(dev, address, (ADDR0_REG + i));
- }
-#else
- for (i = 0; i < 6; i++)
- SMC_outb(dev, dev->enetaddr[i], (ADDR0_REG + i));
-#endif
printf(SMC_DEV_NAME ": MAC %pM\n", dev->enetaddr);
@@ -1360,6 +1366,7 @@ int smc91111_initialize(u8 dev_num, int base_addr)
return 0;
}
+ memset(dev, 0, sizeof(*dev));
priv->dev_num = dev_num;
dev->priv = priv;
dev->iobase = base_addr;
@@ -1374,6 +1381,7 @@ int smc91111_initialize(u8 dev_num, int base_addr)
dev->halt = smc_halt;
dev->send = smc_send;
dev->recv = smc_rcv;
+ dev->write_hwaddr = smc_write_hwaddr;
sprintf(dev->name, "%s-%hu", SMC_DEV_NAME, dev_num);
eth_register(dev);
--
1.7.1.86.g0e460
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-05 7:30 Thomas Chou
@ 2010-10-05 19:42 ` Mike Frysinger
0 siblings, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2010-10-05 19:42 UTC (permalink / raw)
To: u-boot
On Tuesday, October 05, 2010 03:30:33 Thomas Chou wrote:
> Add smc_write_hwaddr() to set mac address.
> Clear dev before use.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101005/2c78f00d/attachment.pgp
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
@ 2010-10-06 1:16 Thomas Chou
2010-10-06 2:09 ` Mike Frysinger
2010-10-12 6:32 ` Ben Warren
0 siblings, 2 replies; 10+ messages in thread
From: Thomas Chou @ 2010-10-06 1:16 UTC (permalink / raw)
To: u-boot
Add smc_write_hwaddr() to set mac address.
Clear dev before use.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
drivers/net/smc91111.c | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index 54a1bfb..ba9c67e 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -654,6 +654,28 @@ again:
return length;
}
+static int smc_write_hwaddr(struct eth_device *dev)
+{
+ int i;
+
+ swap_to(ETHERNET);
+ SMC_SELECT_BANK (dev, 1);
+#ifdef USE_32_BIT
+ for (i = 0; i < 6; i += 2) {
+ word address;
+
+ address = dev->enetaddr[i + 1] << 8;
+ address |= dev->enetaddr[i];
+ SMC_outw(dev, address, (ADDR0_REG + i));
+ }
+#else
+ for (i = 0; i < 6; i++)
+ SMC_outb(dev, dev->enetaddr[i], (ADDR0_REG + i));
+#endif
+ swap_to(FLASH);
+ return 0;
+}
+
/*
* Open and Initialize the board
*
@@ -662,8 +684,6 @@ again:
*/
static int smc_init(struct eth_device *dev, bd_t *bd)
{
- int i;
-
swap_to(ETHERNET);
PRINTK2 ("%s: smc_init\n", SMC_DEV_NAME);
@@ -680,20 +700,6 @@ static int smc_init(struct eth_device *dev, bd_t *bd)
/* conservative setting (10Mbps, HalfDuplex, no AutoNeg.) */
/* SMC_SELECT_BANK(dev, 0); */
/* SMC_outw(dev, 0, RPC_REG); */
- SMC_SELECT_BANK (dev, 1);
-
-#ifdef USE_32_BIT
- for (i = 0; i < 6; i += 2) {
- word address;
-
- address = dev->enetaddr[i + 1] << 8;
- address |= dev->enetaddr[i];
- SMC_outw(dev, address, (ADDR0_REG + i));
- }
-#else
- for (i = 0; i < 6; i++)
- SMC_outb(dev, dev->enetaddr[i], (ADDR0_REG + i));
-#endif
printf(SMC_DEV_NAME ": MAC %pM\n", dev->enetaddr);
@@ -1360,6 +1366,7 @@ int smc91111_initialize(u8 dev_num, int base_addr)
return 0;
}
+ memset(dev, 0, sizeof(*dev));
priv->dev_num = dev_num;
dev->priv = priv;
dev->iobase = base_addr;
@@ -1374,6 +1381,7 @@ int smc91111_initialize(u8 dev_num, int base_addr)
dev->halt = smc_halt;
dev->send = smc_send;
dev->recv = smc_rcv;
+ dev->write_hwaddr = smc_write_hwaddr;
sprintf(dev->name, "%s-%hu", SMC_DEV_NAME, dev_num);
eth_register(dev);
--
1.7.1.86.g0e460
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-06 1:16 [U-Boot] [PATCH] smc91111: add write_hwaddr Thomas Chou
@ 2010-10-06 2:09 ` Mike Frysinger
2010-10-06 5:37 ` Thomas Chou
2010-10-12 6:32 ` Ben Warren
1 sibling, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2010-10-06 2:09 UTC (permalink / raw)
To: u-boot
On Tuesday, October 05, 2010 21:16:10 Thomas Chou wrote:
> Add smc_write_hwaddr() to set mac address.
> Clear dev before use.
how is this different from the one sent earlier today ? when re-submitting,
you should note what changed.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101005/f5b49162/attachment.pgp
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-06 2:09 ` Mike Frysinger
@ 2010-10-06 5:37 ` Thomas Chou
2010-10-06 7:30 ` Wolfgang Denk
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Chou @ 2010-10-06 5:37 UTC (permalink / raw)
To: u-boot
Mike Frysinger wrote:
> On Tuesday, October 05, 2010 21:16:10 Thomas Chou wrote:
>> Add smc_write_hwaddr() to set mac address.
>> Clear dev before use.
>
> how is this different from the one sent earlier today ? when re-submitting,
> you should note what changed.
> -mike
Sorry. It is the same patch resend.
I was confused by the greylisting of denx mail server and wondered why
the first mail was not received after 12 hours.
- Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-06 5:37 ` Thomas Chou
@ 2010-10-06 7:30 ` Wolfgang Denk
2010-10-07 10:27 ` Detlev Zundel
0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2010-10-06 7:30 UTC (permalink / raw)
To: u-boot
Dear Thomas Chou,
In message <4CAC0B1E.1050007@wytron.com.tw> you wrote:
>
> I was confused by the greylisting of denx mail server and wondered why
> the first mail was not received after 12 hours.
There is no greylisting on our side.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There is is no reason for any individual to have a computer in their
home. -- Ken Olsen (President of Digital Equipment Corporation),
Convention of the World Future Society, in Boston, 1977
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-06 7:30 ` Wolfgang Denk
@ 2010-10-07 10:27 ` Detlev Zundel
2010-10-08 7:14 ` Thomas Chou
0 siblings, 1 reply; 10+ messages in thread
From: Detlev Zundel @ 2010-10-07 10:27 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
> Dear Thomas Chou,
>
> In message <4CAC0B1E.1050007@wytron.com.tw> you wrote:
>>
>> I was confused by the greylisting of denx mail server and wondered why
>> the first mail was not received after 12 hours.
>
> There is no greylisting on our side.
Well actually we do run postgrey. But as yet we did not get any
complaints that this interferes with regular usage. The default values
of the software should not intrude much on completely unfiltered
traffic.
Cheers
Detlev
--
A change in language can transform our appreciation of the cosmos
-- Benjamin Lee Whorf
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-07 10:27 ` Detlev Zundel
@ 2010-10-08 7:14 ` Thomas Chou
2010-10-08 8:17 ` Wolfgang Denk
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Chou @ 2010-10-08 7:14 UTC (permalink / raw)
To: u-boot
On 10/07/2010 06:27 PM, Detlev Zundel wrote:
> Hi Wolfgang,
>
>> Dear Thomas Chou,
>>
>> In message<4CAC0B1E.1050007@wytron.com.tw> you wrote:
>>>
>>> I was confused by the greylisting of denx mail server and wondered why
>>> the first mail was not received after 12 hours.
>>
>> There is no greylisting on our side.
>
> Well actually we do run postgrey. But as yet we did not get any
> complaints that this interferes with regular usage. The default values
> of the software should not intrude much on completely unfiltered
> traffic.
Dear Wolfgang and Detlev,
The retransmission wait time on my first mail server is quite long and I
forgot that there is postgrey on denx mail server, so I sent the patch
again using another mail server. I wondered if my first mail server
changed IP. Sorry for the noise.
Best regards,
Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-08 7:14 ` Thomas Chou
@ 2010-10-08 8:17 ` Wolfgang Denk
0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2010-10-08 8:17 UTC (permalink / raw)
To: u-boot
Dear Thomas Chou,
In message <4CAEC4CD.6050705@wytron.com.tw> you wrote:
>
> The retransmission wait time on my first mail server is quite long and I
> forgot that there is postgrey on denx mail server, so I sent the patch
> again using another mail server. I wondered if my first mail server
> changed IP. Sorry for the noise.
No problem. It was informative for me, too, as I learned that we're
running postgrey. I didn't know that before.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The game of life is a game of boomerangs. Our thoughts, deeds and
words return to us sooner or later with astounding accuracy.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] smc91111: add write_hwaddr
2010-10-06 1:16 [U-Boot] [PATCH] smc91111: add write_hwaddr Thomas Chou
2010-10-06 2:09 ` Mike Frysinger
@ 2010-10-12 6:32 ` Ben Warren
1 sibling, 0 replies; 10+ messages in thread
From: Ben Warren @ 2010-10-12 6:32 UTC (permalink / raw)
To: u-boot
Hi Thomas,
On 10/5/2010 6:16 PM, Thomas Chou wrote:
> Add smc_write_hwaddr() to set mac address.
> Clear dev before use.
>
> Signed-off-by: Thomas Chou<thomas@wytron.com.tw>
> ---
> drivers/net/smc91111.c | 40 ++++++++++++++++++++++++----------------
> 1 files changed, 24 insertions(+), 16 deletions(-)
Applied to net repo.
thanks,
Ben
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-10-12 6:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06 1:16 [U-Boot] [PATCH] smc91111: add write_hwaddr Thomas Chou
2010-10-06 2:09 ` Mike Frysinger
2010-10-06 5:37 ` Thomas Chou
2010-10-06 7:30 ` Wolfgang Denk
2010-10-07 10:27 ` Detlev Zundel
2010-10-08 7:14 ` Thomas Chou
2010-10-08 8:17 ` Wolfgang Denk
2010-10-12 6:32 ` Ben Warren
-- strict thread matches above, loose matches on Subject: below --
2010-10-05 7:30 Thomas Chou
2010-10-05 19:42 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox