ibmvnic: Report actual backing device speed and duplex values

The ibmvnic driver currently reports a fixed value for both speed and
duplex settings regardless of the actual backing device that is being
used. By adding support to the QUERY_PHYS_PARMS command defined by the
PAPR+ we can query the current physical port state and report the proper
values for these feilds.

Reported-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Signed-off-by: Murilo Fossa Vicentini <muvic@linux.ibm.com>
Reviewed-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Murilo Fossa Vicentini
2019-03-19 10:28:51 -03:00
committed by David S. Miller
parent c55c8edafa
commit f8d6ae0d27
2 changed files with 94 additions and 17 deletions

View File

@@ -377,11 +377,16 @@ struct ibmvnic_phys_parms {
u8 flags2;
#define IBMVNIC_LOGICAL_LNK_ACTIVE 0x80
__be32 speed;
#define IBMVNIC_AUTONEG 0x80
#define IBMVNIC_10MBPS 0x40
#define IBMVNIC_100MBPS 0x20
#define IBMVNIC_1GBPS 0x10
#define IBMVNIC_10GBPS 0x08
#define IBMVNIC_AUTONEG 0x80000000
#define IBMVNIC_10MBPS 0x40000000
#define IBMVNIC_100MBPS 0x20000000
#define IBMVNIC_1GBPS 0x10000000
#define IBMVNIC_10GBP 0x08000000
#define IBMVNIC_40GBPS 0x04000000
#define IBMVNIC_100GBPS 0x02000000
#define IBMVNIC_25GBPS 0x01000000
#define IBMVNIC_50GBPS 0x00800000
#define IBMVNIC_200GBPS 0x00400000
__be32 mtu;
struct ibmvnic_rc rc;
} __packed __aligned(8);
@@ -999,6 +1004,9 @@ struct ibmvnic_adapter {
int phys_link_state;
int logical_link_state;
u32 speed;
u8 duplex;
/* login data */
struct ibmvnic_login_buffer *login_buf;
dma_addr_t login_buf_token;