patch-1.3.6 linux/drivers/net/net_init.c

Next file: linux/drivers/net/ni52.c
Previous file: linux/drivers/net/loopback.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.5/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -159,6 +159,17 @@
 	return dev;
 }
 
+
+static int eth_mac_addr(struct device *dev, void * addr)
+{
+	struct ifreq * ifr = (struct ifreq *) addr;
+
+	if(dev->start)
+		return -EBUSY;
+	memcpy(dev->dev_addr, ifr->ifr_hwaddr.sa_data,dev->hard_header_len);
+	return 0;
+}
+
 void ether_setup(struct device *dev)
 {
 	int i;
@@ -182,6 +193,7 @@
 
 	dev->hard_header	= eth_header;
 	dev->rebuild_header = eth_rebuild_header;
+	dev->set_mac_address = eth_mac_addr;
 
 	dev->type		= ARPHRD_ETHER;
 	dev->hard_header_len = ETH_HLEN;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this