Lines Matching defs:rpc
109 mad_encode(void *buf, ib_rpc_t *rpc, ib_dr_path_t *drpath, void *data)
111 int is_resp = rpc->method & IB_MAD_RESPONSE;
114 mad_set_field(buf, 0, IB_MAD_METHOD_F, rpc->method);
116 mad_set_field(buf, 0, IB_MAD_CLASSVER_F, rpc->mgtclass == IB_SA_CLASS ? 2 : 1);
117 mad_set_field(buf, 0, IB_MAD_MGMTCLASS_F, rpc->mgtclass);
121 if (rpc->mgtclass == IB_SMI_DIRECT_CLASS) {
128 mad_set_field(buf, 0, IB_DRSMP_STATUS_F, rpc->rstatus);
131 mad_set_field(buf, 0, IB_MAD_STATUS_F, rpc->rstatus);
134 if (!rpc->trid)
135 rpc->trid = mad_trid();
137 mad_set_field64(buf, 0, IB_MAD_TRID_F, rpc->trid);
138 mad_set_field(buf, 0, IB_MAD_ATTRID_F, rpc->attr.id);
139 mad_set_field(buf, 0, IB_MAD_ATTRMOD_F, rpc->attr.mod);
142 mad_set_field(buf, 0, IB_MAD_MKEY_F, rpc->mkey >> 32);
143 mad_set_field(buf, 4, IB_MAD_MKEY_F, rpc->mkey & 0xffffffff);
145 if (rpc->mgtclass == IB_SMI_DIRECT_CLASS) {
157 if (rpc->mgtclass == IB_SA_CLASS)
158 mad_set_field64(buf, 0, IB_SA_COMPMASK_F, rpc->mask);
161 memcpy((char *)buf + rpc->dataoffs, data, rpc->datasz);
164 if (mad_is_vendor_range2(rpc->mgtclass))
165 mad_set_field(buf, 0, IB_VEND2_OUI_F, rpc->oui);
171 mad_build_pkt(void *umad, ib_rpc_t *rpc, ib_portid_t *dport,
175 int lid_routed = rpc->mgtclass != IB_SMI_DIRECT_CLASS;
176 int is_smi = (rpc->mgtclass == IB_SMI_CLASS ||
177 rpc->mgtclass == IB_SMI_DIRECT_CLASS);
201 p = mad_encode(mad, rpc, lid_routed ? 0 : &dport->drpath, data);