Commit 37cf3477 authored by Petko Manolov's avatar Petko Manolov Committed by Greg Kroah-Hartman

USB: Pegasus driver failing for ADMtek 8515 network device

Address http://bugzilla.kernel.org/show_bug.cgi?id=7126

Attempting to read the ethernet ID directly from the eeprom somehow
confuses ADM8515.  Subsequent read requests to either the eeprom or the MII
fail as well.  Didn't dig much deeper, though.  For example ADM8513 does
not experience this problem.

I used the fact that at power up the device is reading its ID automatically
(not true for older Pegasus based devices) and put it in the Ethernet ID
registers.  So now the driver uses get_registers() instead of
read_eprom_word() if the device is Pegasus_II based one.  Tested it with
all (Pegasus and Pegasus_II) gadgets i have and everything seems ok.

Cc: <jogeedaklown@yahoo.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7923811a
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
/* /*
* Version Information * Version Information
*/ */
#define DRIVER_VERSION "v0.6.13 (2005/11/13)" #define DRIVER_VERSION "v0.6.14 (2006/09/27)"
#define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>" #define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>"
#define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver"
...@@ -339,7 +339,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) ...@@ -339,7 +339,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
} }
fail: fail:
if (netif_msg_drv(pegasus)) if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); dev_warn(&pegasus->intf->dev, "%s failed\n", __FUNCTION__);
return ret; return ret;
} }
...@@ -376,7 +376,7 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd) ...@@ -376,7 +376,7 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd)
fail: fail:
if (netif_msg_drv(pegasus)) if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); dev_warn(&pegasus->intf->dev, "%s failed\n", __FUNCTION__);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -413,7 +413,7 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata) ...@@ -413,7 +413,7 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
fail: fail:
if (netif_msg_drv(pegasus)) if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); dev_warn(&pegasus->intf->dev, "%s failed\n", __FUNCTION__);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -461,7 +461,7 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data) ...@@ -461,7 +461,7 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data)
return ret; return ret;
fail: fail:
if (netif_msg_drv(pegasus)) if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); dev_warn(&pegasus->intf->dev, "%s failed\n", __FUNCTION__);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
#endif /* PEGASUS_WRITE_EEPROM */ #endif /* PEGASUS_WRITE_EEPROM */
...@@ -481,8 +481,12 @@ static void set_ethernet_addr(pegasus_t * pegasus) ...@@ -481,8 +481,12 @@ static void set_ethernet_addr(pegasus_t * pegasus)
{ {
__u8 node_id[6]; __u8 node_id[6];
get_node_id(pegasus, node_id); if (pegasus->features & PEGASUS_II) {
set_registers(pegasus, EthID, sizeof (node_id), node_id); get_registers(pegasus, 0x10, sizeof(node_id), node_id);
} else {
get_node_id(pegasus, node_id);
set_registers(pegasus, EthID, sizeof (node_id), node_id);
}
memcpy(pegasus->net->dev_addr, node_id, sizeof (node_id)); memcpy(pegasus->net->dev_addr, node_id, sizeof (node_id));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment