[kernel] r15915 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Wed Jun 30 01:02:06 UTC 2010


Author: benh
Date: Wed Jun 30 01:01:44 2010
New Revision: 15915

Log:
asix: fix setting mac address for AX88772 (Closes: #587580)

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/asix-fix-setting-mac-address-for-AX88772.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/16

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Sun Jun 27 13:33:50 2010	(r15914)
+++ dists/sid/linux-2.6/debian/changelog	Wed Jun 30 01:01:44 2010	(r15915)
@@ -38,6 +38,7 @@
     stable 2.6.32.12 (Closes: #584273)
   * linux-base: If the disk ID update process fails, give the user a
     chance to retry or change their answers (Closes: #585609)
+  * asix: fix setting mac address for AX88772 (Closes: #587580)
 
   [ Aurelien Jarno ]
   * [sh4] fix sh_tmu clocksource following recent nohz changes.

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/asix-fix-setting-mac-address-for-AX88772.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/asix-fix-setting-mac-address-for-AX88772.patch	Wed Jun 30 01:01:44 2010	(r15915)
@@ -0,0 +1,89 @@
+From: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
+Date: Tue, 9 Mar 2010 12:24:38 +0000
+Subject: [PATCH] asix: fix setting mac address for AX88772
+
+commit 7f29a3baa825725d29db399663790d15c78cddcf upstream.
+
+Setting new MAC address only worked when device was set to promiscuous mode.
+Fix MAC address by writing new address to device using undocumented command
+AX_CMD_READ_NODE_ID+1. Patch is tested with AX88772 device.
+
+Signed-off-by: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
+Acked-by: David Hollis <dhollis at davehollis.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/usb/asix.c |   30 ++++++++++++++++++++++++++++--
+ 1 files changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
+index 20e3460..9e05639 100644
+--- a/drivers/net/usb/asix.c
++++ b/drivers/net/usb/asix.c
+@@ -54,6 +54,7 @@ static const char driver_name [] = "asix";
+ #define AX_CMD_WRITE_IPG0		0x12
+ #define AX_CMD_WRITE_IPG1		0x13
+ #define AX_CMD_READ_NODE_ID		0x13
++#define AX_CMD_WRITE_NODE_ID		0x14
+ #define AX_CMD_WRITE_IPG2		0x14
+ #define AX_CMD_WRITE_MULTI_FILTER	0x16
+ #define AX88172_CMD_READ_NODE_ID	0x17
+@@ -165,6 +166,7 @@ static const char driver_name [] = "asix";
+ /* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
+ struct asix_data {
+ 	u8 multi_filter[AX_MCAST_FILTER_SIZE];
++	u8 mac_addr[ETH_ALEN];
+ 	u8 phymode;
+ 	u8 ledmode;
+ 	u8 eeprom_len;
+@@ -732,6 +734,30 @@ static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
+ 	return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
+ }
+ 
++static int asix_set_mac_address(struct net_device *net, void *p)
++{
++	struct usbnet *dev = netdev_priv(net);
++	struct asix_data *data = (struct asix_data *)&dev->data;
++	struct sockaddr *addr = p;
++
++	if (netif_running(net))
++		return -EBUSY;
++	if (!is_valid_ether_addr(addr->sa_data))
++		return -EADDRNOTAVAIL;
++
++	memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
++
++	/* We use the 20 byte dev->data
++	 * for our 6 byte mac buffer
++	 * to avoid allocating memory that
++	 * is tricky to free later */
++	memcpy(data->mac_addr, addr->sa_data, ETH_ALEN);
++	asix_write_cmd_async(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
++							data->mac_addr);
++
++	return 0;
++}
++
+ /* We need to override some ethtool_ops so we require our
+    own structure so we don't interfere with other usbnet
+    devices that may be connected at the same time. */
+@@ -919,7 +945,7 @@ static const struct net_device_ops ax88772_netdev_ops = {
+ 	.ndo_start_xmit		= usbnet_start_xmit,
+ 	.ndo_tx_timeout		= usbnet_tx_timeout,
+ 	.ndo_change_mtu		= usbnet_change_mtu,
+-	.ndo_set_mac_address 	= eth_mac_addr,
++	.ndo_set_mac_address 	= asix_set_mac_address,
+ 	.ndo_validate_addr	= eth_validate_addr,
+ 	.ndo_do_ioctl		= asix_ioctl,
+ 	.ndo_set_multicast_list = asix_set_multicast,
+@@ -1213,7 +1239,7 @@ static const struct net_device_ops ax88178_netdev_ops = {
+ 	.ndo_stop		= usbnet_stop,
+ 	.ndo_start_xmit		= usbnet_start_xmit,
+ 	.ndo_tx_timeout		= usbnet_tx_timeout,
+-	.ndo_set_mac_address 	= eth_mac_addr,
++	.ndo_set_mac_address 	= asix_set_mac_address,
+ 	.ndo_validate_addr	= eth_validate_addr,
+ 	.ndo_set_multicast_list = asix_set_multicast,
+ 	.ndo_do_ioctl 		= asix_ioctl,
+-- 
+1.7.1
+

Modified: dists/sid/linux-2.6/debian/patches/series/16
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/16	Sun Jun 27 13:33:50 2010	(r15914)
+++ dists/sid/linux-2.6/debian/patches/series/16	Wed Jun 30 01:01:44 2010	(r15915)
@@ -160,3 +160,4 @@
 + bugfix/all/3c59x-Specify-window-for-access-to-windowed-regs.patch
 + bugfix/all/3c59x-Use-fine-grained-locks-for-MII-and-windowed-regs.patch
 + bugfix/x86/Revert-tpm-autoload-tpm_tis-based-on-system-PnP-IDs.patch
++ bugfix/all/asix-fix-setting-mac-address-for-AX88772.patch



More information about the Kernel-svn-changes mailing list