Lines Matching refs:mad
124 struct ib_user_mad mad;
165 for (packet->mad.hdr.id = 0;
166 packet->mad.hdr.id < IB_UMAD_MAX_AGENTS;
167 packet->mad.hdr.id++)
168 if (agent == __get_agent(file, packet->mad.hdr.id)) {
200 packet->mad.hdr.status = ETIMEDOUT;
223 packet->mad.hdr.status = 0;
224 packet->mad.hdr.length = hdr_size(file) + mad_recv_wc->mad_len;
225 packet->mad.hdr.qpn = cpu_to_be32(mad_recv_wc->wc->src_qp);
226 packet->mad.hdr.lid = cpu_to_be16(mad_recv_wc->wc->slid);
227 packet->mad.hdr.sl = mad_recv_wc->wc->sl;
228 packet->mad.hdr.path_bits = mad_recv_wc->wc->dlid_path_bits;
229 packet->mad.hdr.pkey_index = mad_recv_wc->wc->pkey_index;
230 packet->mad.hdr.grh_present = !!(mad_recv_wc->wc->wc_flags & IB_WC_GRH);
231 if (packet->mad.hdr.grh_present) {
238 packet->mad.hdr.gid_index = ah_attr.grh.sgid_index;
239 packet->mad.hdr.hop_limit = ah_attr.grh.hop_limit;
240 packet->mad.hdr.traffic_class = ah_attr.grh.traffic_class;
241 memcpy(packet->mad.hdr.gid, &ah_attr.grh.dgid, 16);
242 packet->mad.hdr.flow_label = cpu_to_be32(ah_attr.grh.flow_label);
263 if ((packet->length <= sizeof (*recv_buf->mad) &&
265 (packet->length > sizeof (*recv_buf->mad) &&
266 count < hdr_size(file) + sizeof (*recv_buf->mad)))
269 if (copy_to_user(buf, &packet->mad, hdr_size(file)))
273 seg_payload = min_t(int, packet->length, sizeof (*recv_buf->mad));
274 if (copy_to_user(buf, recv_buf->mad, seg_payload))
289 offset = ib_get_mad_data_offset(recv_buf->mad->mad_hdr.mgmt_class);
297 if (copy_to_user(buf, ((void *) recv_buf->mad) + offset,
313 if (copy_to_user(buf, &packet->mad, hdr_size(file)))
318 if (copy_to_user(buf, packet->mad.data, packet->length))
378 copy_from_user(msg->mad + IB_MGMT_RMPP_HDR, buf + IB_MGMT_RMPP_HDR,
410 hdr = (struct ib_mad_hdr *) packet->mad.data;
412 sent_hdr = (struct ib_mad_hdr *) sent_packet->mad.data;
430 if (same_destination(&packet->mad.hdr, &sent_packet->mad.hdr))
456 if (copy_from_user(&packet->mad, buf, hdr_size(file))) {
461 if (packet->mad.hdr.id < 0 ||
462 packet->mad.hdr.id >= IB_UMAD_MAX_AGENTS) {
469 if (copy_from_user(packet->mad.data, buf, IB_MGMT_RMPP_HDR)) {
476 agent = __get_agent(file, packet->mad.hdr.id);
483 ah_attr.dlid = be16_to_cpu(packet->mad.hdr.lid);
484 ah_attr.sl = packet->mad.hdr.sl;
485 ah_attr.src_path_bits = packet->mad.hdr.path_bits;
487 if (packet->mad.hdr.grh_present) {
489 memcpy(ah_attr.grh.dgid.raw, packet->mad.hdr.gid, 16);
490 ah_attr.grh.sgid_index = packet->mad.hdr.gid_index;
491 ah_attr.grh.flow_label = be32_to_cpu(packet->mad.hdr.flow_label);
492 ah_attr.grh.hop_limit = packet->mad.hdr.hop_limit;
493 ah_attr.grh.traffic_class = packet->mad.hdr.traffic_class;
502 rmpp_mad = (struct ib_rmpp_mad *) packet->mad.data;
515 be32_to_cpu(packet->mad.hdr.qpn),
516 packet->mad.hdr.pkey_index, rmpp_active,
524 packet->msg->timeout_ms = packet->mad.hdr.timeout_ms;
525 packet->msg->retries = packet->mad.hdr.retries;
529 memcpy(packet->msg->mad, packet->mad.data, IB_MGMT_MAD_HDR);
532 if (copy_from_user(packet->msg->mad + copy_offset,
549 if (!ib_response_mad(packet->msg->mad)) {
550 tid = &((struct ib_mad_hdr *) packet->msg->mad)->tid;