diff mbox series

[for-next,3/3] RDMA/i40iw: Report phys_state in query_port

Message ID 20190722070550.25395-4-kamalheib1@gmail.com (mailing list archive)
State Changes Requested
Headers show
Series {cxgb3, cxgb4, i40iw} Report phys_state | expand

Commit Message

Kamal Heib July 22, 2019, 7:05 a.m. UTC
Add support for reporting physical state when calling query_port() via
the sysfs interface.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/infiniband/hw/i40iw/i40iw_verbs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index d169a8031375..c678b05bb829 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -105,10 +105,13 @@  static int i40iw_query_port(struct ib_device *ibdev,
 	props->active_mtu = ib_mtu_int_to_enum(netdev->mtu);
 
 	props->lid = 1;
-	if (netif_carrier_ok(iwdev->netdev))
+	if (netif_carrier_ok(iwdev->netdev)) {
 		props->state = IB_PORT_ACTIVE;
-	else
+		props->phys_state = 5;
+	} else {
 		props->state = IB_PORT_DOWN;
+		props->phys_state = 3;
+	}
 	props->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP |
 		IB_PORT_VENDOR_CLASS_SUP | IB_PORT_BOOT_MGMT_SUP;
 	props->gid_tbl_len = 1;