summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/asix.h
diff options
context:
space:
mode:
authorChristian Riesch <christian.riesch@omicron.at>2012-07-19 02:23:06 +0200
committerDavid S. Miller <davem@davemloft.net>2012-07-19 19:48:07 +0200
commitceb02c91dd76012e902799e0132ad3ad3e659394 (patch)
tree4a200ab9b830cc15eebb88a2201d197c30ccf800 /drivers/net/usb/asix.h
parentnet: stmmac: Add ip version to dts bindings (diff)
downloadlinux-ceb02c91dd76012e902799e0132ad3ad3e659394.tar.xz
linux-ceb02c91dd76012e902799e0132ad3ad3e659394.zip
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.h')
-rw-r--r--drivers/net/usb/asix.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/usb/asix.h b/drivers/net/usb/asix.h
index 77d9e4c1e235..fbff17748a1d 100644
--- a/drivers/net/usb/asix.h
+++ b/drivers/net/usb/asix.h
@@ -156,8 +156,7 @@
#define AX_GPIO_RSE 0x80 /* Reload serial EEPROM */
#define AX_EEPROM_MAGIC 0xdeadbeef
-#define AX88172_EEPROM_LEN 0x40
-#define AX88772_EEPROM_LEN 0xff
+#define AX_EEPROM_LEN 0x200
/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
struct asix_data {
@@ -165,7 +164,7 @@ struct asix_data {
u8 mac_addr[ETH_ALEN];
u8 phymode;
u8 ledmode;
- u8 eeprom_len;
+ u8 res;
};
int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,