@@ -363,6 +363,7 @@ union rdma_protocol_stats {
#define RDMA_CORE_CAP_IB_CM 0x0000000000000004ULL
#define RDMA_CORE_CAP_IW_CM 0x0000000000000008ULL
#define RDMA_CORE_CAP_IB_SA 0x0000000000000010ULL
+#define RDMA_CORE_CAP_OPA_MAD 0x0000000000000020ULL
/* Address format 0x0000FFFF00000000 */
#define RDMA_CORE_CAP_AF_IB 0x0000000100000000ULL
@@ -1812,6 +1813,21 @@ static inline int cap_ib_mad(struct ib_device *device, u8 port_num)
}
/**
+ * cap_opa_mad - Check if the port of device supports OPA defined
+ * Management Datagrams.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device does not support OPA
+ * Management Datagrams.
+ */
+static inline int cap_opa_mad(struct ib_device *device, u8 port_num)
+{
+ return !!(device->core_cap_flags[port_num] & RDMA_CORE_CAP_OPA_MAD);
+}
+
+/**
* cap_ib_smi - Check if the port of device has the capability Infiniband
* Subnet Management Interface.
*