Lines Matching refs:mad
131 struct ib_user_mad mad; member
191 for (packet->mad.hdr.id = 0; in queue_packet()
192 packet->mad.hdr.id < IB_UMAD_MAX_AGENTS; in queue_packet()
193 packet->mad.hdr.id++) in queue_packet()
194 if (agent == __get_agent(file, packet->mad.hdr.id)) { in queue_packet()
226 packet->mad.hdr.status = ETIMEDOUT; in send_handler()
250 packet->mad.hdr.status = 0; in recv_handler()
251 packet->mad.hdr.length = hdr_size(file) + mad_recv_wc->mad_len; in recv_handler()
252 packet->mad.hdr.qpn = cpu_to_be32(mad_recv_wc->wc->src_qp); in recv_handler()
258 packet->mad.hdr.lid = ib_lid_be16(0xFFFF & in recv_handler()
261 packet->mad.hdr.lid = ib_lid_be16(mad_recv_wc->wc->slid); in recv_handler()
262 packet->mad.hdr.sl = mad_recv_wc->wc->sl; in recv_handler()
263 packet->mad.hdr.path_bits = mad_recv_wc->wc->dlid_path_bits; in recv_handler()
264 packet->mad.hdr.pkey_index = mad_recv_wc->wc->pkey_index; in recv_handler()
265 packet->mad.hdr.grh_present = !!(mad_recv_wc->wc->wc_flags & IB_WC_GRH); in recv_handler()
266 if (packet->mad.hdr.grh_present) { in recv_handler()
279 packet->mad.hdr.gid_index = grh->sgid_index; in recv_handler()
280 packet->mad.hdr.hop_limit = grh->hop_limit; in recv_handler()
281 packet->mad.hdr.traffic_class = grh->traffic_class; in recv_handler()
282 memcpy(packet->mad.hdr.gid, &grh->dgid, 16); in recv_handler()
283 packet->mad.hdr.flow_label = cpu_to_be32(grh->flow_label); in recv_handler()
314 if (copy_to_user(buf, &packet->mad, hdr_size(file))) in copy_recv_mad()
319 if (copy_to_user(buf, recv_buf->mad, seg_payload)) in copy_recv_mad()
334 offset = ib_get_mad_data_offset(recv_buf->mad->mad_hdr.mgmt_class); in copy_recv_mad()
342 if (copy_to_user(buf, ((void *) recv_buf->mad) + offset, in copy_recv_mad()
348 trace_ib_umad_read_recv(file, &packet->mad.hdr, &recv_buf->mad->mad_hdr); in copy_recv_mad()
361 if (copy_to_user(buf, &packet->mad, hdr_size(file))) in copy_send_mad()
366 if (copy_to_user(buf, packet->mad.data, packet->length)) in copy_send_mad()
369 trace_ib_umad_read_send(file, &packet->mad.hdr, in copy_send_mad()
370 (struct ib_mad_hdr *)&packet->mad.data); in copy_send_mad()
439 copy_from_user(msg->mad + IB_MGMT_RMPP_HDR, buf + IB_MGMT_RMPP_HDR, in copy_rmpp_mad()
471 hdr = (struct ib_mad_hdr *) packet->mad.data; in is_duplicate()
473 sent_hdr = (struct ib_mad_hdr *) sent_packet->mad.data; in is_duplicate()
491 if (same_destination(&packet->mad.hdr, &sent_packet->mad.hdr)) in is_duplicate()
518 if (copy_from_user(&packet->mad, buf, hdr_size(file))) { in ib_umad_write()
523 if (packet->mad.hdr.id >= IB_UMAD_MAX_AGENTS) { in ib_umad_write()
530 if (copy_from_user(packet->mad.data, buf, IB_MGMT_RMPP_HDR)) { in ib_umad_write()
537 trace_ib_umad_write(file, &packet->mad.hdr, in ib_umad_write()
538 (struct ib_mad_hdr *)&packet->mad.data); in ib_umad_write()
540 agent = __get_agent(file, packet->mad.hdr.id); in ib_umad_write()
549 rdma_ah_set_dlid(&ah_attr, be16_to_cpu(packet->mad.hdr.lid)); in ib_umad_write()
550 rdma_ah_set_sl(&ah_attr, packet->mad.hdr.sl); in ib_umad_write()
551 rdma_ah_set_path_bits(&ah_attr, packet->mad.hdr.path_bits); in ib_umad_write()
553 if (packet->mad.hdr.grh_present) { in ib_umad_write()
555 be32_to_cpu(packet->mad.hdr.flow_label), in ib_umad_write()
556 packet->mad.hdr.gid_index, in ib_umad_write()
557 packet->mad.hdr.hop_limit, in ib_umad_write()
558 packet->mad.hdr.traffic_class); in ib_umad_write()
559 rdma_ah_set_dgid_raw(&ah_attr, packet->mad.hdr.gid); in ib_umad_write()
568 rmpp_mad_hdr = (struct ib_rmpp_mad_hdr *)packet->mad.data; in ib_umad_write()
581 base_version = ((struct ib_mad_hdr *)&packet->mad.data)->base_version; in ib_umad_write()
584 be32_to_cpu(packet->mad.hdr.qpn), in ib_umad_write()
585 packet->mad.hdr.pkey_index, rmpp_active, in ib_umad_write()
594 packet->msg->timeout_ms = packet->mad.hdr.timeout_ms; in ib_umad_write()
595 packet->msg->retries = packet->mad.hdr.retries; in ib_umad_write()
599 memcpy(packet->msg->mad, packet->mad.data, IB_MGMT_MAD_HDR); in ib_umad_write()
602 if (copy_from_user(packet->msg->mad + copy_offset, in ib_umad_write()
619 if (!ib_response_mad(packet->msg->mad)) { in ib_umad_write()
620 tid = &((struct ib_mad_hdr *) packet->msg->mad)->tid; in ib_umad_write()