Lines Matching refs:mad
203 static int send_mad_to_wire(struct mlx4_ib_demux_ctx *ctx, struct ib_mad *mad) in send_mad_to_wire() argument
217 IB_QPT_GSI, 0, 1, IB_QP1_QKEY, &ah_attr, mad); in send_mad_to_wire()
221 struct ib_mad *mad) in send_mad_to_slave() argument
241 return mlx4_ib_send_to_slave(dev, slave, ctx->port, IB_QPT_GSI, &wc, NULL, mad); in send_mad_to_slave()
246 struct ib_sa_mad mad; in send_join_to_wire() local
247 struct ib_sa_mcmember_data *sa_mad_data = (struct ib_sa_mcmember_data *)&mad.data; in send_join_to_wire()
251 memcpy(&mad, sa_mad, sizeof mad); in send_join_to_wire()
257 mad.mad_hdr.tid = mlx4_ib_get_new_demux_tid(group->demux); in send_join_to_wire()
258 group->last_req_tid = mad.mad_hdr.tid; /* keep it for later validation */ in send_join_to_wire()
260 ret = send_mad_to_wire(group->demux, (struct ib_mad *)&mad); in send_join_to_wire()
273 struct ib_sa_mad mad; in send_leave_to_wire() local
274 struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)&mad.data; in send_leave_to_wire()
277 memset(&mad, 0, sizeof mad); in send_leave_to_wire()
278 mad.mad_hdr.base_version = 1; in send_leave_to_wire()
279 mad.mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM; in send_leave_to_wire()
280 mad.mad_hdr.class_version = 2; in send_leave_to_wire()
281 mad.mad_hdr.method = IB_SA_METHOD_DELETE; in send_leave_to_wire()
282 mad.mad_hdr.status = cpu_to_be16(0); in send_leave_to_wire()
283 mad.mad_hdr.class_specific = cpu_to_be16(0); in send_leave_to_wire()
284 mad.mad_hdr.tid = mlx4_ib_get_new_demux_tid(group->demux); in send_leave_to_wire()
285 group->last_req_tid = mad.mad_hdr.tid; /* keep it for later validation */ in send_leave_to_wire()
286 mad.mad_hdr.attr_id = cpu_to_be16(IB_SA_ATTR_MC_MEMBER_REC); in send_leave_to_wire()
287 mad.mad_hdr.attr_mod = cpu_to_be32(0); in send_leave_to_wire()
288 mad.sa_hdr.sm_key = 0x0; in send_leave_to_wire()
289 mad.sa_hdr.attr_offset = cpu_to_be16(7); in send_leave_to_wire()
290 mad.sa_hdr.comp_mask = IB_SA_MCMEMBER_REC_MGID | in send_leave_to_wire()
296 ret = send_mad_to_wire(group->demux, (struct ib_mad *)&mad); in send_leave_to_wire()
313 struct ib_sa_mad mad; in send_reply_to_slave() local
314 struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)&mad.data; in send_reply_to_slave()
318 memset(&mad, 0, sizeof mad); in send_reply_to_slave()
319 mad.mad_hdr.base_version = 1; in send_reply_to_slave()
320 mad.mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM; in send_reply_to_slave()
321 mad.mad_hdr.class_version = 2; in send_reply_to_slave()
322 mad.mad_hdr.method = IB_MGMT_METHOD_GET_RESP; in send_reply_to_slave()
323 mad.mad_hdr.status = cpu_to_be16(status); in send_reply_to_slave()
324 mad.mad_hdr.class_specific = cpu_to_be16(0); in send_reply_to_slave()
325 mad.mad_hdr.tid = req_sa_mad->mad_hdr.tid; in send_reply_to_slave()
326 *(u8 *)&mad.mad_hdr.tid = 0; /* resetting tid to 0 */ in send_reply_to_slave()
327 mad.mad_hdr.attr_id = cpu_to_be16(IB_SA_ATTR_MC_MEMBER_REC); in send_reply_to_slave()
328 mad.mad_hdr.attr_mod = cpu_to_be32(0); in send_reply_to_slave()
329 mad.sa_hdr.sm_key = req_sa_mad->sa_hdr.sm_key; in send_reply_to_slave()
330 mad.sa_hdr.attr_offset = cpu_to_be16(7); in send_reply_to_slave()
331 mad.sa_hdr.comp_mask = 0; /* ignored on responses, see IBTA spec */ in send_reply_to_slave()
340 ret = send_mad_to_slave(slave, group->demux, (struct ib_mad *)&mad); in send_reply_to_slave()
879 struct ib_sa_mad *mad) in mlx4_ib_mcg_demux_handler() argument
882 struct ib_sa_mcmember_data *rec = (struct ib_sa_mcmember_data *)mad->data; in mlx4_ib_mcg_demux_handler()
886 switch (mad->mad_hdr.method) { in mlx4_ib_mcg_demux_handler()
893 if (mad->mad_hdr.method == IB_MGMT_METHOD_GET_RESP) { in mlx4_ib_mcg_demux_handler()
894 __be64 tid = mad->mad_hdr.tid; in mlx4_ib_mcg_demux_handler()
905 group->response_sa_mad = *mad; in mlx4_ib_mcg_demux_handler()
922 port, mad->mad_hdr.method); in mlx4_ib_mcg_demux_handler()
1152 struct ib_sa_mad *mad = &req->sa_mad; in build_leave_mad() local
1154 mad->mad_hdr.method = IB_SA_METHOD_DELETE; in build_leave_mad()