Lines Matching refs:mad
72 struct ib_mad *mad);
74 struct ib_mad_private *mad);
178 int ib_response_mad(struct ib_mad *mad)
180 return ((mad->mad_hdr.method & IB_MGMT_METHOD_RESP) ||
181 (mad->mad_hdr.method == IB_MGMT_METHOD_TRAP_REPRESS) ||
182 ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_BM) &&
183 (mad->mad_hdr.attr_mod & IB_BM_ATTR_MOD_RESP)));
366 /* Add mad agent into port's agent list */
673 struct ib_smp *smp = mad_send_wr->send_buf.mad;
734 (struct ib_mad *)&mad_priv->mad);
738 if (ib_response_mad(&mad_priv->mad.mad) &&
758 memcpy(&mad_priv->mad.mad, smp, sizeof(struct ib_mad));
760 &mad_priv->mad.mad);
820 struct ib_rmpp_mad *rmpp_mad = send_buf->mad;
885 mad_send_wr->send_buf.mad = buf;
976 return mad_send_wr->send_buf.mad +
991 kfree(send_buf->mad);
1014 mad_send_wr->send_buf.mad,
1079 if (!ib_is_mad_class_rmpp(((struct ib_mad_hdr *) send_buf->mad)->mgmt_class)) {
1094 if (((struct ib_mad_hdr *) send_buf->mad)->mgmt_class ==
1104 mad_send_wr->tid = ((struct ib_mad_hdr *) send_buf->mad)->tid;
1282 /* Remove any methods for this mad agent */
1335 /* Remove any methods for this mad agent */
1430 /* Remove any methods for this mad agent */
1480 /* Remove any methods for this mad agent */
1517 /* Remove any methods for this mad agent */
1552 struct ib_mad *mad)
1558 if (ib_response_mad(mad)) {
1566 hi_tid = be64_to_cpu(mad->mad_hdr.tid) >> 32;
1585 if (mad->mad_hdr.class_version >= MAX_MGMT_VERSION)
1587 if (!is_vendor_class(mad->mad_hdr.mgmt_class)) {
1589 mad->mad_hdr.class_version].class;
1593 mad->mad_hdr.mgmt_class)];
1595 mad_agent = method->agent[mad->mad_hdr.method &
1599 mad->mad_hdr.class_version].vendor;
1603 mad->mad_hdr.mgmt_class)];
1607 vendor_mad = (struct ib_vendor_mad *)mad;
1613 mad_agent = method->agent[mad->mad_hdr.method &
1635 static int validate_mad(struct ib_mad *mad, u32 qp_num)
1640 if (mad->mad_hdr.base_version != IB_MGMT_BASE_VERSION) {
1642 "version %d\n", mad->mad_hdr.base_version);
1647 if ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED) ||
1648 (mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE)) {
1676 return ((struct ib_mad *)(wr->send_buf.mad))->mad_hdr.mgmt_class ==
1677 rwc->recv_buf.mad->mad_hdr.mgmt_class;
1691 send_resp = ib_response_mad((struct ib_mad *)wr->send_buf.mad);
1692 rcv_resp = ib_response_mad(rwc->recv_buf.mad);
1741 struct ib_mad *mad;
1743 mad = (struct ib_mad *)wc->recv_buf.mad;
1746 if ((wr->tid == mad->mad_hdr.tid) &&
1752 (is_direct(wc->recv_buf.mad->mad_hdr.mgmt_class) ||
1762 if (is_data_mad(mad_agent_priv, wr->send_buf.mad) &&
1763 wr->tid == mad->mad_hdr.tid &&
1770 (is_direct(wc->recv_buf.mad->mad_hdr.mgmt_class) ||
1805 if (ib_response_mad(mad_recv_wc->recv_buf.mad)) {
1861 recv->header.recv_wc.recv_buf.mad = &recv->mad.mad;
1868 if (!validate_mad(&recv->mad.mad, qp_info->qp->qp_num))
1883 if (recv->mad.mad.mad_hdr.mgmt_class ==
1887 if (smi_handle_dr_smp_recv(&recv->mad.smp,
1894 retsmi = smi_check_forward_dr_smp(&recv->mad.smp);
1899 if (smi_handle_dr_smp_send(&recv->mad.smp,
1904 if (smi_check_local_smp(&recv->mad.smp, port_priv->device) == IB_SMI_DISCARD)
1910 response->header.recv_wc.recv_buf.mad = &response->mad.mad;
1913 agent_send_response(&response->mad.mad,
1916 smi_get_fwd_port(&recv->mad.smp),
1931 &recv->mad.mad,
1932 &response->mad.mad);
1937 agent_send_response(&response->mad.mad,
1947 mad_agent = find_mad_agent(port_priv, &recv->mad.mad);
2300 if (is_data_mad(mad_agent_priv, mad_send_wr->send_buf.mad) &&
2393 local->mad_priv->header.recv_wc.recv_buf.mad =
2394 &local->mad_priv->mad.mad;
2527 struct ib_mad_private *mad)
2547 if (mad) {
2548 mad_priv = mad;
2549 mad = NULL;
2976 .name = "mad",