realtek: convert to per-chip mask

The previous HW_REVID macro did not make identifiers more readable
(compared to hex values like 0x12345678) and only allowed for one static
mask. To make it easier to update the chips list, let's use similar
structures as r8169 and remove HW_REVID.

Names are removed and separated from the table and separated because the
mac_version does not have to be unique.

While at it, change "RTL-xxxx" to "RTLxxxx" to match the names of
Realtek and r8169 driver. Besides that, the only output change is when
a chip is not recognized in which case "TxConfig" is now mentioned
instead of "mask". Since the mask can be anything, the displayed word is
not masked either.

Signed-off-by: Peter Wu <lekensteyn@gmail.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
realtek: update devices to 3.11

RTL8168_8111Bb/RTL8168_8111Bef is like RTL8111B/RTL8168B, RTL8100E and RTL8101E
(datasheet revision 1.0 from 26 January 2006). Assume that RTL8101e is also
similar (I may be very wrong at that though...).

Note that the scanning heuristics is the same as the r8169 module: newer devices
with stronger masks come before the others. Perhaps the older 8139 cards should
be appended to the list, after all r8169 chips.

Signed-off-by: Peter Wu <lekensteyn@gmail.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
ethtool: add ixgbevf support for register dump

This patch adds support for the ixgbevf driver, which previously was printing
out as hex dump, and in the driver via printk. This patch corrects the
implementation to have a new ixgbevf_reg_dump function that will format the
register output in a more human readable format.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
ethtool: correct ixgbevf copyright date

This patch corrects the copyright date of the ixgbevf code, which was only
recently added.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
ethtool: fix ixgbe 82598EB only registers

This patch fixes ixgbe_reg_dump to only display registers specific to the
82598EB part, as these registers display 0xDEADBEEF otherwise, and clutter up
the register dump.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
[bwh: Don't remove RDPROBE register from dump]
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
ethtool: don't display some registers on ixgbe X540

This patch modifies ixgbe_reg_dump to take into account registers removed in the
ixgbe X540 adapter. This adapter no longer has some of the registers, and thus
returns 0xDEADBEAF for the value. Rather than display this invalid register
value, modify ixgbe_reg_dump to only display these registers on older mac types.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Release version 3.11.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Revert "Fix reporting of VLAN tag offload flags on Linux < 2.6.37"

This reverts commit 1cddbe64cfc66b58988c85086d6df3a77c0c61a5.
It causes 'ethtool -K' to pass the VLAN tag offload flags to
ETHTOOL_SFLAGS when they are not supported and will be rejected.
Hide state of VLAN tag offload and LRO if the kernel is too old

Starting with Linux 2.6.37 and ethtool 2.6.36 it was possible to show
the state of VLAN tag offload (using ETHTOOL_GFLAGS).  But the state
would always be shown as 'off' for older kernel versions, even though
VLAN tag offload had been implemented long before this.

In ethtool 3.4.2 I attempted to fix this by also reading the state of
VLAN tag offload from the 'features' attribute in sysfs.  But this had
to be reverted because it causes 'ethtool -K' to pass the flags back
into ETHTOOL_SFLAGS.

Instead, hide the VLAN tag offload flags if the kernel is older than
2.6.37.

Similarly, LRO was implemented some time before it was exposed through
ETHTOOL_GFLAGS in Linux 2.6.24.  So hide the LRO flag if the kernel
is older than that.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
sfc: Add support for EF10 registers

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
sfc: Stop using bitfields in register definition structures

This doesn't make any difference to the static data size, and
decreases the code size a little.

Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>