[openib-general] [PATCH] mad: Add RMPP support for DevMgt class
Hal Rosenstock
halr at voltaire.com
Thu Mar 16 15:21:09 PST 2006
mad: Add RMPP support for DevMgt class
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Index: include/rdma/ib_mad.h
===================================================================
--- include/rdma/ib_mad.h (revision 5874)
+++ include/rdma/ib_mad.h (working copy)
@@ -117,6 +117,8 @@ enum {
IB_MGMT_VENDOR_DATA = 216,
IB_MGMT_SA_HDR = 56,
IB_MGMT_SA_DATA = 200,
+ IB_MGMT_DM_HDR = 64,
+ IB_MGMT_DM_DATA = 192,
};
struct ib_mad_hdr {
Index: core/mad_rmpp.c
===================================================================
--- core/mad_rmpp.c (revision 5874)
+++ core/mad_rmpp.c (working copy)
@@ -104,6 +104,8 @@ static int data_offset(u8 mgmt_class)
{
if (mgmt_class == IB_MGMT_CLASS_SUBN_ADM)
return IB_MGMT_SA_HDR;
+ else if (mgmt_class == IB_MGMT_CLASS_DEVICE_MGMT)
+ return IB_MGMT_DM_HDR;
else if ((mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START) &&
(mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END))
return IB_MGMT_VENDOR_HDR;
Index: core/user_mad.c
===================================================================
--- core/user_mad.c (revision 5874)
+++ core/user_mad.c (working copy)
@@ -181,6 +181,8 @@ static int data_offset(u8 mgmt_class)
{
if (mgmt_class == IB_MGMT_CLASS_SUBN_ADM)
return IB_MGMT_SA_HDR;
+ else if (mgmt_class == IB_MGMT_CLASS_DEVICE_MGMT)
+ return IB_MGMT_DM_HDR;
else if ((mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START) &&
(mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END))
return IB_MGMT_VENDOR_HDR;
@@ -446,6 +448,11 @@ static ssize_t ib_umad_write(struct file
copy_offset = IB_MGMT_RMPP_HDR;
rmpp_active = ib_get_rmpp_flags(&rmpp_mad->rmpp_hdr) &
IB_MGMT_RMPP_FLAG_ACTIVE;
+ } else if (rmpp_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_DEVICE_MGMT) {
+ hdr_len = IB_MGMT_DM_HDR;
+ copy_offset = IB_MGMT_RMPP_HDR;
+ rmpp_active = ib_get_rmpp_flags(&rmpp_mad->rmpp_hdr) &
+ IB_MGMT_RMPP_FLAG_ACTIVE;
} else if (rmpp_mad->mad_hdr.mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START &&
rmpp_mad->mad_hdr.mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END) {
hdr_len = IB_MGMT_VENDOR_HDR;
More information about the general
mailing list