e1000: improve auto-negotiation reporting via mii-tool
authorGabriel L. Somlo <gsomlo@gmail.com>
Thu, 19 Jun 2014 15:55:34 +0000 (11:55 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 23 Jun 2014 14:38:00 +0000 (17:38 +0300)
commit6883b5914029fa8ffc42a43d2a2188493c27fd58
tree21fe8ff4e1bf2b09d96fa2250cdad396c235bdf5
parent6a2acedb19221ddf5e6fd3fb3590ba636aa21007
e1000: improve auto-negotiation reporting via mii-tool

Using mii-tool (on F20-live), the following output is produced:

  SIOCGMIIREG on ens3 failed: Input/output error
  ens3: no autonegotiation, 1000baseT-FD flow-control, link ok

The first line (SIOCGMIIREG error) is due to mii-tool's inability
to read the PHY auto-negotiation expansion register.
On the second line, "no autonegotiation" is wrong, and caused by
the absence of a flag in the link partner ability register which
would indicate that our link partner has acked us. This flag is
listed as "reserved" in the Intel e1000 manual, but mii-tool uses
it as LPA_LPACK from /usr/include/linux/mii.h.

This patch adds read access to PHY_AUTONEG_EXP and defines the
link partner ack flag, allowing mii-tool to generate output as
normally expected:

  ens3: negotiated 1000baseT-FD flow-control, link ok

Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/e1000.c
hw/net/e1000_regs.h