Skip to content

Commit

Permalink
ixgbe: check mac type from ethtool_regs.version
Browse files Browse the repository at this point in the history
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 <[email protected]>.

Signed-off-by: Ben Hutchings <[email protected]>
  • Loading branch information
Ben Hutchings committed Apr 30, 2013
1 parent d655af4 commit 0e061da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ixgbe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
fprintf(stdout,
Expand Down

0 comments on commit 0e061da

Please sign in to comment.