netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Blackfin EMAC driver: add function to change the MAC address
@ 2007-09-16  2:57 Bryan Wu
  2007-09-18 22:07 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Bryan Wu @ 2007-09-16  2:57 UTC (permalink / raw)
  To: jeff, akpm, linux-kernel, netdev, uclinux-dist-devel

>From 157dfddae50708a716c2a42a314eccb9621d8793 Mon Sep 17 00:00:00 2001
From: Alex Landau <lirsb@yahoo.com>
Date: Sun, 5 Aug 2007 15:58:03 +0800
Subject: [PATCH] Blackfin Ethernet MAC driver: add function to change the MAC address

Alex Landau writes in the forums:
  Previously, changing the MAC address (e.g. via ifconfig) resulted
  in a generic function to be called that only changed a variable in
  memory. This patch also updated the Blackfin MAC address registers
  to filter the correct new MAC.

Signed-off-by: Alex Landau <lirsb@yahoo.com>
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
---
 drivers/net/bfin_mac.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 2bb97d4..8d61ca9 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -468,7 +468,7 @@ void setup_system_regs(struct net_device *dev)
 	bfin_write_DMA1_Y_MODIFY(0);
 }
 
-void setup_mac_addr(u8 * mac_addr)
+static void setup_mac_addr(u8 *mac_addr)
 {
 	u32 addr_low = le32_to_cpu(*(__le32 *) & mac_addr[0]);
 	u16 addr_hi = le16_to_cpu(*(__le16 *) & mac_addr[4]);
@@ -478,6 +478,16 @@ void setup_mac_addr(u8 * mac_addr)
 	bfin_write_EMAC_ADDRHI(addr_hi);
 }
 
+static int bf537mac_set_mac_address(struct net_device *dev, void *p)
+{
+	struct sockaddr *addr = p;
+	if (netif_running(dev))
+		return -EBUSY;
+	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+	setup_mac_addr(dev->dev_addr);
+	return 0;
+}
+
 static void adjust_tx_list(void)
 {
 	int timeout_cnt = MAX_TIMEOUT_CNT;
@@ -895,6 +905,7 @@ static int __init bf537mac_probe(struct net_device *dev)
 	dev->open = bf537mac_open;
 	dev->stop = bf537mac_close;
 	dev->hard_start_xmit = bf537mac_hard_start_xmit;
+	dev->set_mac_address = bf537mac_set_mac_address;
 	dev->tx_timeout = bf537mac_timeout;
 	dev->get_stats = bf537mac_query_statistics;
 	dev->set_multicast_list = bf537mac_set_multicast_list;
-- 
1.5.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] Blackfin EMAC driver: add function to change the MAC address
  2007-09-16  2:57 [PATCH 1/3] Blackfin EMAC driver: add function to change the MAC address Bryan Wu
@ 2007-09-18 22:07 ` Jeff Garzik
  2007-09-19  7:07   ` Bryan Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2007-09-18 22:07 UTC (permalink / raw)
  To: bryan.wu; +Cc: akpm, linux-kernel, netdev, uclinux-dist-devel

Bryan Wu wrote:
>>From 157dfddae50708a716c2a42a314eccb9621d8793 Mon Sep 17 00:00:00 2001
> From: Alex Landau <lirsb@yahoo.com>
> Date: Sun, 5 Aug 2007 15:58:03 +0800
> Subject: [PATCH] Blackfin Ethernet MAC driver: add function to change the MAC address
> 
> Alex Landau writes in the forums:
>   Previously, changing the MAC address (e.g. via ifconfig) resulted
>   in a generic function to be called that only changed a variable in
>   memory. This patch also updated the Blackfin MAC address registers
>   to filter the correct new MAC.
> 
> Signed-off-by: Alex Landau <lirsb@yahoo.com>
> Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
> Signed-off-by: Bryan Wu <bryan.wu@analog.com>

ACK patches 1-3... but can you regenerate them against 
netdev-2.6.git#upstream (or davem/net-2.6.24.git)?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] Blackfin EMAC driver: add function to change the MAC address
  2007-09-18 22:07 ` Jeff Garzik
@ 2007-09-19  7:07   ` Bryan Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Bryan Wu @ 2007-09-19  7:07 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: bryan.wu, akpm, linux-kernel, netdev, uclinux-dist-devel

On Wed, 2007-09-19 at 06:07 +0800, Jeff Garzik wrote:
> Bryan Wu wrote: 
> >>From 157dfddae50708a716c2a42a314eccb9621d8793 Mon Sep 17 00:00:00
> 2001 
> > From: Alex Landau <lirsb@yahoo.com> 
> > Date: Sun, 5 Aug 2007 15:58:03 +0800 
> > Subject: [PATCH] Blackfin Ethernet MAC driver: add function to
> change the MAC address 
> > 
> > Alex Landau writes in the forums: 
> >   Previously, changing the MAC address (e.g. via ifconfig) resulted 
> >   in a generic function to be called that only changed a variable
> in 
> >   memory. This patch also updated the Blackfin MAC address
> registers 
> >   to filter the correct new MAC. 
> > 
> > Signed-off-by: Alex Landau <lirsb@yahoo.com> 
> > Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> 
> > Signed-off-by: Bryan Wu <bryan.wu@analog.com>
> 
> ACK patches 1-3... but can you regenerate them against 
> netdev-2.6.git#upstream (or davem/net-2.6.24.git)?

Excellent, I will resend the patch against the netdev-2.6.git#upstream
ASAP.

Thanks
-Bryan Wu
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-19  7:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-16  2:57 [PATCH 1/3] Blackfin EMAC driver: add function to change the MAC address Bryan Wu
2007-09-18 22:07 ` Jeff Garzik
2007-09-19  7:07   ` Bryan Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).