aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/asix_devices.c
diff options
context:
space:
mode:
authorChristian Riesch <christian.riesch@omicron.at>2012-07-18 20:23:06 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-19 13:48:07 -0400
commitceb02c91dd76012e902799e0132ad3ad3e659394 (patch)
tree4a200ab9b830cc15eebb88a2201d197c30ccf800 /drivers/net/usb/asix_devices.c
parent84c9f8c41df9f62a34eb680009b59cc817a76d6e (diff)
asix: Rework reading from EEPROM
The current code for reading the EEPROM via ethtool in the asix driver has a few issues. It cannot handle odd length values (accesses must be aligned at 16 bit boundaries) and interprets the offset provided by ethtool as 16 bit word offset instead as byte offset. The new code for asix_get_eeprom() introduced by this patch is modeled after the code in drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c and provides read access to the entire EEPROM with arbitrary offsets and lengths. Signed-off-by: Christian Riesch <christian.riesch@omicron.at> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/asix_devices.c')
-rw-r--r--drivers/net/usb/asix_devices.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index ed9403b0c437..658c08fe2c03 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -201,9 +201,6 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
201 u8 buf[ETH_ALEN]; 201 u8 buf[ETH_ALEN];
202 int i; 202 int i;
203 unsigned long gpio_bits = dev->driver_info->data; 203 unsigned long gpio_bits = dev->driver_info->data;
204 struct asix_data *data = (struct asix_data *)&dev->data;
205
206 data->eeprom_len = AX88172_EEPROM_LEN;
207 204
208 usbnet_get_endpoints(dev,intf); 205 usbnet_get_endpoints(dev,intf);
209 206
@@ -409,12 +406,9 @@ static const struct net_device_ops ax88772_netdev_ops = {
409static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 406static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
410{ 407{
411 int ret, embd_phy; 408 int ret, embd_phy;
412 struct asix_data *data = (struct asix_data *)&dev->data;
413 u8 buf[ETH_ALEN]; 409 u8 buf[ETH_ALEN];
414 u32 phyid; 410 u32 phyid;
415 411
416 data->eeprom_len = AX88772_EEPROM_LEN;
417
418 usbnet_get_endpoints(dev,intf); 412 usbnet_get_endpoints(dev,intf);
419 413
420 /* Get the MAC address */ 414 /* Get the MAC address */
@@ -767,9 +761,6 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
767{ 761{
768 int ret; 762 int ret;
769 u8 buf[ETH_ALEN]; 763 u8 buf[ETH_ALEN];
770 struct asix_data *data = (struct asix_data *)&dev->data;
771
772 data->eeprom_len = AX88772_EEPROM_LEN;
773 764
774 usbnet_get_endpoints(dev,intf); 765 usbnet_get_endpoints(dev,intf);
775 766