Lines Matching refs:mad
209 static int send_mad_to_wire(struct mlx4_ib_demux_ctx *ctx, struct ib_mad *mad) in send_mad_to_wire() argument
225 &ah_attr, NULL, 0xffff, mad); in send_mad_to_wire()
229 struct ib_mad *mad) in send_mad_to_slave() argument
249 return mlx4_ib_send_to_slave(dev, slave, ctx->port, IB_QPT_GSI, &wc, NULL, mad); in send_mad_to_slave()
254 struct ib_sa_mad mad; in send_join_to_wire() local
255 struct ib_sa_mcmember_data *sa_mad_data = (struct ib_sa_mcmember_data *)&mad.data; in send_join_to_wire()
259 memcpy(&mad, sa_mad, sizeof mad); in send_join_to_wire()
265 mad.mad_hdr.tid = mlx4_ib_get_new_demux_tid(group->demux); in send_join_to_wire()
266 group->last_req_tid = mad.mad_hdr.tid; /* keep it for later validation */ in send_join_to_wire()
268 ret = send_mad_to_wire(group->demux, (struct ib_mad *)&mad); in send_join_to_wire()
281 struct ib_sa_mad mad; in send_leave_to_wire() local
282 struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)&mad.data; in send_leave_to_wire()
285 memset(&mad, 0, sizeof mad); in send_leave_to_wire()
286 mad.mad_hdr.base_version = 1; in send_leave_to_wire()
287 mad.mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM; in send_leave_to_wire()
288 mad.mad_hdr.class_version = 2; in send_leave_to_wire()
289 mad.mad_hdr.method = IB_SA_METHOD_DELETE; in send_leave_to_wire()
290 mad.mad_hdr.status = cpu_to_be16(0); in send_leave_to_wire()
291 mad.mad_hdr.class_specific = cpu_to_be16(0); in send_leave_to_wire()
292 mad.mad_hdr.tid = mlx4_ib_get_new_demux_tid(group->demux); in send_leave_to_wire()
293 group->last_req_tid = mad.mad_hdr.tid; /* keep it for later validation */ in send_leave_to_wire()
294 mad.mad_hdr.attr_id = cpu_to_be16(IB_SA_ATTR_MC_MEMBER_REC); in send_leave_to_wire()
295 mad.mad_hdr.attr_mod = cpu_to_be32(0); in send_leave_to_wire()
296 mad.sa_hdr.sm_key = 0x0; in send_leave_to_wire()
297 mad.sa_hdr.attr_offset = cpu_to_be16(7); in send_leave_to_wire()
298 mad.sa_hdr.comp_mask = IB_SA_MCMEMBER_REC_MGID | in send_leave_to_wire()
304 ret = send_mad_to_wire(group->demux, (struct ib_mad *)&mad); in send_leave_to_wire()
321 struct ib_sa_mad mad; in send_reply_to_slave() local
322 struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)&mad.data; in send_reply_to_slave()
326 memset(&mad, 0, sizeof mad); in send_reply_to_slave()
327 mad.mad_hdr.base_version = 1; in send_reply_to_slave()
328 mad.mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM; in send_reply_to_slave()
329 mad.mad_hdr.class_version = 2; in send_reply_to_slave()
330 mad.mad_hdr.method = IB_MGMT_METHOD_GET_RESP; in send_reply_to_slave()
331 mad.mad_hdr.status = cpu_to_be16(status); in send_reply_to_slave()
332 mad.mad_hdr.class_specific = cpu_to_be16(0); in send_reply_to_slave()
333 mad.mad_hdr.tid = req_sa_mad->mad_hdr.tid; in send_reply_to_slave()
334 *(u8 *)&mad.mad_hdr.tid = 0; /* resetting tid to 0 */ in send_reply_to_slave()
335 mad.mad_hdr.attr_id = cpu_to_be16(IB_SA_ATTR_MC_MEMBER_REC); in send_reply_to_slave()
336 mad.mad_hdr.attr_mod = cpu_to_be32(0); in send_reply_to_slave()
337 mad.sa_hdr.sm_key = req_sa_mad->sa_hdr.sm_key; in send_reply_to_slave()
338 mad.sa_hdr.attr_offset = cpu_to_be16(7); in send_reply_to_slave()
339 mad.sa_hdr.comp_mask = 0; /* ignored on responses, see IBTA spec */ in send_reply_to_slave()
348 ret = send_mad_to_slave(slave, group->demux, (struct ib_mad *)&mad); in send_reply_to_slave()
883 struct ib_sa_mad *mad) in mlx4_ib_mcg_demux_handler() argument
886 struct ib_sa_mcmember_data *rec = (struct ib_sa_mcmember_data *)mad->data; in mlx4_ib_mcg_demux_handler()
890 switch (mad->mad_hdr.method) { in mlx4_ib_mcg_demux_handler()
897 if (mad->mad_hdr.method == IB_MGMT_METHOD_GET_RESP) { in mlx4_ib_mcg_demux_handler()
898 __be64 tid = mad->mad_hdr.tid; in mlx4_ib_mcg_demux_handler()
909 group->response_sa_mad = *mad; in mlx4_ib_mcg_demux_handler()
926 port, mad->mad_hdr.method); in mlx4_ib_mcg_demux_handler()
1167 struct ib_sa_mad *mad = &req->sa_mad; in build_leave_mad() local
1169 mad->mad_hdr.method = IB_SA_METHOD_DELETE; in build_leave_mad()