[openib-general] [PATCH] libibmad: Add sa_rpc_call API
Hal Rosenstock
halr at voltaire.com
Wed Sep 13 03:21:12 PDT 2006
libibmad: Add sa_rpc_call API
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Index: libibmad/include/infiniband/mad.h
===================================================================
--- libibmad/include/infiniband/mad.h (revision 9425)
+++ libibmad/include/infiniband/mad.h (working copy)
@@ -748,6 +748,8 @@ safe_smp_set(void *rcvbuf, ib_portid_t *
/* sa.c */
uint8_t * sa_call(void *rcvbuf, ib_portid_t *portid, ib_sa_call_t *sa,
uint timeout);
+uint8_t * sa_rpc_call(void *ibmad_port, void *rcvbuf, ib_portid_t *portid,
+ ib_sa_call_t *sa, uint timeout);
int ib_path_query(ib_gid_t srcgid, ib_gid_t destgid, ib_portid_t *sm_id,
void *buf); /* returns lid */
Index: libibmad/src/libibmad.map
===================================================================
--- libibmad/src/libibmad.map (revision 9425)
+++ libibmad/src/libibmad.map (working copy)
@@ -1,4 +1,4 @@
-IBMAD_1.1 {
+IBMAD_1.2 {
global:
_mad_dump;
_mad_dump_field;
@@ -79,6 +79,7 @@ IBMAD_1.1 {
madrpc_unlock;
ib_path_query;
sa_call;
+ sa_rpc_call;
mad_alloc;
mad_free;
mad_receive;
Index: libibmad/src/sa.c
===================================================================
--- libibmad/src/sa.c (revision 9425)
+++ libibmad/src/sa.c (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004,2005 Voltaire Inc. All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
@@ -50,7 +50,8 @@
#define DEBUG if (ibdebug) IBWARN
uint8_t *
-sa_call(void *rcvbuf, ib_portid_t *portid, ib_sa_call_t *sa, uint timeout)
+sa_rpc_call(void *ibmad_port, void *rcvbuf, ib_portid_t *portid,
+ ib_sa_call_t *sa, uint timeout)
{
ib_rpc_t rpc = {0};
uint8_t *p;
@@ -77,7 +78,7 @@ sa_call(void *rcvbuf, ib_portid_t *porti
if (!portid->qkey)
portid->qkey = IB_DEFAULT_QP1_QKEY;
- p = madrpc_rmpp(&rpc, portid, 0/*&sa->rmpp*/, rcvbuf); /* TODO: RMPP */
+ p = mad_rpc_rmpp(ibmad_port, &rpc, portid, 0/*&sa->rmpp*/, rcvbuf); /* TODO: RMPP */
sa->recsz = rpc.recsz;
Index: libibmad/src/rpc.c
===================================================================
--- libibmad/src/rpc.c (revision 9425)
+++ libibmad/src/rpc.c (working copy)
@@ -386,3 +386,14 @@ mad_rpc_close_port(void *port_id)
umad_close_port(p->port_id);
free(p);
}
+
+uint8_t *
+sa_call(void *rcvbuf, ib_portid_t *portid, ib_sa_call_t *sa, uint timeout)
+{
+ struct ibmad_port port;
+
+ port.port_id = mad_portid;
+ port.class_agents[IB_SA_CLASS] = mad_class_agent(IB_SA_CLASS);
+ return sa_rpc_call(&port, rcvbuf, portid, sa, timeout);
+}
+
More information about the general
mailing list