RDMA: Introduce ib_port_phys_state enum
In order to improve readability, add ib_port_phys_state enum to replace the use of magic numbers. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Reviewed-by: Andrew Boyer <aboyer@tobark.org> Acked-by: Michal Kalderon <michal.kalderon@marvell.com> Acked-by: Bernard Metzler <bmt@zurich.ibm.com> Link: https://lore.kernel.org/r/20190807103138.17219-2-kamalheib1@gmail.com Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
@@ -221,10 +221,10 @@ int qedr_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr *attr)
|
||||
/* *attr being zeroed by the caller, avoid zeroing it here */
|
||||
if (rdma_port->port_state == QED_RDMA_PORT_UP) {
|
||||
attr->state = IB_PORT_ACTIVE;
|
||||
attr->phys_state = 5;
|
||||
attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP;
|
||||
} else {
|
||||
attr->state = IB_PORT_DOWN;
|
||||
attr->phys_state = 3;
|
||||
attr->phys_state = IB_PORT_PHYS_STATE_DISABLED;
|
||||
}
|
||||
attr->max_mtu = IB_MTU_4096;
|
||||
attr->active_mtu = iboe_get_mtu(dev->ndev->mtu);
|
||||
|
Reference in New Issue
Block a user