]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ib/sa: export function to pack a path record into wire format
authorSean Hefty <sean.hefty@intel.com>
Wed, 7 Apr 2010 00:22:38 +0000 (17:22 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 7 Apr 2010 00:22:38 +0000 (17:22 -0700)
Allow converting from struct ib_sa_path_rec to the IB defined
SA path record wire format.  This will be used to report path
data from the rdma cm into user space.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
drivers/infiniband/core/sa_query.c
include/rdma/ib_sa.h

index 7e1ffd8ccd5c07084317fecbae15cd3574938991..54ec971f715e76cd3c64c1124a34d4626a93789d 100644 (file)
@@ -610,6 +610,12 @@ void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec)
 }
 EXPORT_SYMBOL(ib_sa_unpack_path);
 
+void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute)
+{
+       ib_pack(path_rec_table, ARRAY_SIZE(path_rec_table), rec, attribute);
+}
+EXPORT_SYMBOL(ib_sa_pack_path);
+
 static void ib_sa_path_rec_callback(struct ib_sa_query *sa_query,
                                    int status,
                                    struct ib_sa_mad *mad)
index 1082afaed15878aff3e37317501377f96604b746..86aa772acb25d6d2c3fbde9b05b5ef9722d13f65 100644 (file)
@@ -385,4 +385,10 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
  */
 void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec);
 
+/**
+ * ib_sa_pack_path - Conert a path record from struct ib_sa_path_rec
+ * to IB MAD wire format.
+ */
+void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute);
+
 #endif /* IB_SA_H */