diff options
authorBen Hutchings <>2013-04-30 19:14:57 +0100
committerBen Hutchings <>2013-04-30 19:19:42 +0100
commit0e061da5b137d4236e737abdb501d386a75d29a0 (patch)
parentd655af4172ac05449d1a371766c42b5d67429f21 (diff)
ixgbe: check mac type from ethtool_regs.version
This patch cleans up the mac type checks by using ethtool_regs.version provided by the driver. This change eliminates the need to add device IDs every time they are added to the driver. Note that when using ethtool with this patch with a version of ixgbe that does not provide the mac_type in ethtool_regs.version the register dump may be incomplete. However this issue would've existed previously for device IDs that were not added to ethtool. Original patch and description by Emil Tantilov <>. Signed-off-by: Ben Hutchings <>
1 files changed, 5 insertions, 2 deletions
diff --git a/ixgbe.c b/ixgbe.c
index dae11d4..9b005f2 100644
--- a/ixgbe.c
+++ b/ixgbe.c
@@ -133,10 +133,13 @@ ixgbe_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
u8 i;
enum ixgbe_mac_type mac_type;
- if (version != 1)
+ if (version == 0)
return -1;
- mac_type = ixgbe_get_mac_type(hw_device_id);
+ /* The current driver reports the MAC type, but older versions
+ * only report the device ID so we have to infer the MAC type.
+ */
+ mac_type = version > 1 ? version : ixgbe_get_mac_type(hw_device_id);
reg = regs_buff[1065];