> thats why I added the set_mac_address function and i'm calling it in the
> initialization. you should get something stange now from
> if ( (netdev = dev_get_by_name("eth0")) )
>                       netdev->set_mac_address(netdev, &address);
> 
> I'll check that.
>       Harald

This patch seems to work. I stripped all the 'real' stuff from
set_mac_address and let the very same code in eth_open care for it.
This doesn't matter as eth_open is called anyway as soon as
the device is brought up.

no idea why this code works in eth_open but not in set_mac_address

Harald

--- drivers/net/arm/ixp4xx_eth.c	2008-01-04 16:45:47.379661516 +0100
+++ ../../../../../trunk/build_dir/linux-ixp4xx_generic/linux-2.6.23.12/drivers/net/arm/ixp4xx_eth.c	2008-01-04 16:41:26.668804451 +0100
@@ -1113,6 +1113,22 @@
 	return 0;
 }
 
+static int set_mac_address(struct net_device *dev, 
+	void * addr) {
+
+	struct port *port = netdev_priv(dev);
+	struct msg msg;
+	struct sockaddr *address = addr;
+	int i;
+	
+	if (!is_valid_ether_addr(address->sa_data))
+		return -EADDRNOTAVAIL;
+	  
+        memcpy(dev->dev_addr, address->sa_data, dev->addr_len);		
+
+	return 0; 
+}
+
 static int __devinit eth_init_one(struct platform_device *pdev)
 {
 	struct port *port;
@@ -1155,6 +1171,7 @@
 	dev->get_stats = eth_stats;
 	dev->do_ioctl = eth_ioctl;
 	dev->set_multicast_list = eth_set_mcast_list;
+	dev->set_mac_address = set_mac_address;
 	dev->weight = 16;
 	dev->tx_queue_len = 100;
 
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to