Add support for reporting physical state when calling query_port() via the sysfs interface. Signed-off-by: Kamal Heib <kamalheib1@xxxxxxxxx> --- drivers/infiniband/hw/cxgb4/provider.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 5e59c5708729..d38c242a1693 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -317,18 +317,24 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port, props->max_mtu = IB_MTU_4096; props->active_mtu = ib_mtu_int_to_enum(netdev->mtu); - if (!netif_carrier_ok(netdev)) + if (!netif_carrier_ok(netdev)) { props->state = IB_PORT_DOWN; - else { + props->phys_state = 3; + } else { inetdev = in_dev_get(netdev); if (inetdev) { - if (inetdev->ifa_list) + if (inetdev->ifa_list) { props->state = IB_PORT_ACTIVE; - else + props->phys_state = 5; + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } in_dev_put(inetdev); - } else + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } } props->port_cap_flags = -- 2.20.1